");
(0, _size.setWidth)($div, "100%");
(0, _size.setHeight)($div, scrollBarWidth - 1);
this._groupElement.after($div)
}
this._scrollBarWidth = scrollBarWidth
}
getScrollPath(offset) {
const tableElement = this.tableElement();
let cell;
offset -= parseInt(tableElement[0].style.top, 10) || 0;
(0, _iterator.each)(tableElement.find("tr"), (_, tr) => {
const td = tr.childNodes[tr.childNodes.length - 1];
if (td && 1 === td.rowSpan && td.offsetTop <= offset && td.offsetHeight + td.offsetTop > offset) {
cell = td;
return false
}
return
});
return getCellPath(tableElement, cell)
}
_moveFakeTable(scrollPos) {
this._moveFakeTableTop(scrollPos);
super._moveFakeTable()
}
_getRowClassNames(rowIndex, cell, rowClassNames) {
if (0 !== rowIndex & cell.expanded && !rowClassNames.includes("dx-expand-border")) {
rowClassNames.push("dx-expand-border")
}
}
_getMainElementMarkup() {
const tbody = _dom_adapter.default.createElement("tbody");
tbody.classList.add(this._getAreaClassName());
return tbody
}
_getCloseMainElementMarkup() {
return ""
}
updateColspans(columnCount) {
const {
rows: rows
} = this.tableElement()[0];
let columnOffset = 0;
const columnOffsetResetIndexes = [];
if (this.getColumnsCount() - columnCount > 0) {
return
}
for (let i = 0; i < rows.length; i += 1) {
for (let j = 0; j < rows[i].cells.length; j += 1) {
const cell = rows[i].cells[j];
const {
rowSpan: rowSpan
} = cell;
if (columnOffsetResetIndexes[i]) {
columnOffset -= columnOffsetResetIndexes[i];
columnOffsetResetIndexes[i] = 0
}
const diff = columnCount - (columnOffset + cell.colSpan);
if (j === rows[i].cells.length - 1 && diff > 0) {
cell.colSpan += diff
}
columnOffsetResetIndexes[i + rowSpan] = (columnOffsetResetIndexes[i + rowSpan] || 0) + cell.colSpan;
columnOffset += cell.colSpan
}
}
}
}
exports.VerticalHeadersArea = VerticalHeadersArea;
exports.default = {
HorizontalHeadersArea: HorizontalHeadersArea,
VerticalHeadersArea: VerticalHeadersArea
}
},
47825(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.LocalStore = void 0;
var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../common/data/array_store */ 80556));
var _custom_store = __webpack_require__( /*! ../../../../common/data/custom_store */ 63326);
var _data_source = __webpack_require__( /*! ../../../../common/data/data_source/data_source */ 68216);
var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../common/data/query */ 30771));
var _utils = __webpack_require__( /*! ../../../../common/data/utils */ 89358);
var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 55620));
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _data = __webpack_require__( /*! ../../../../core/utils/data */ 31e3);
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 71051));
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 87739);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 21274);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 12062);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const LocalStore = exports.LocalStore = _class.default.inherit(function() {
const DATE_INTERVAL_SELECTORS = {
year: date => date && date.getFullYear(),
quarter: date => date && Math.floor(date.getMonth() / 3) + 1,
month: date => date && date.getMonth() + 1,
day: date => date && date.getDate(),
dayOfWeek: date => date && date.getDay()
};
function getDataSelector(dataField) {
return -1 !== dataField.indexOf(".") ? (0, _data.compileGetter)(dataField) : function(data) {
return data[dataField]
}
}
function getDateValue(dataSelector) {
return function(data) {
let value = dataSelector(data);
if (value && !(value instanceof Date)) {
value = _date_serialization.default.deserializeDate(value)
}
return value
}
}
function prepareFields(fields) {
(0, _iterator.each)(fields || [], (_, field) => {
let fieldSelector;
let intervalSelector;
const {
dataField: dataField
} = field;
let groupInterval;
const {
levels: levels
} = field;
let dataSelector;
if (!field.selector) {
if (!dataField) {
dataSelector = function(data) {
return data
}
} else {
dataSelector = getDataSelector(dataField)
}
if (levels) {
prepareFields(levels)
}
if ("date" === field.dataType) {
intervalSelector = DATE_INTERVAL_SELECTORS[field.groupInterval];
const valueSelector = getDateValue(dataSelector);
fieldSelector = function(data) {
const value = valueSelector(data);
return intervalSelector ? intervalSelector(value) : value
}
} else if ("number" === field.dataType) {
groupInterval = (0, _type.isNumeric)(field.groupInterval) && field.groupInterval > 0 && field.groupInterval;
fieldSelector = function(data) {
let value = dataSelector(data);
if ((0, _type.isString)(value)) {
value = Number(value)
}
return groupInterval ? Math.floor(value / groupInterval) * groupInterval : value
}
} else {
fieldSelector = dataSelector
}(0, _m_widget_utils.setDefaultFieldValueFormatting)(field);
(0, _m_widget_utils.setFieldProperty)(field, "selector", fieldSelector)
}
})
}
function fillHierarchyItemIndexesCore(indexes, options, children, expandIndex, pathHash) {
const dimension = options.dimensions[expandIndex];
const {
expandedPathsHash: expandedPathsHash
} = options;
let dimensionValue;
let hierarchyItem;
if (dimension) {
dimensionValue = dimension.selector(options.data);
pathHash = void 0 !== pathHash ? pathHash + "/./" + dimensionValue : `${dimensionValue}`;
hierarchyItem = function(value, hierarchyItems, pathHash, childrenHash) {
let hierarchyItem = childrenHash[pathHash];
if (!hierarchyItem) {
hierarchyItem = {
value: value,
index: childrenHash.length++
};
childrenHash[pathHash] = hierarchyItem;
hierarchyItems.push(hierarchyItem)
}
return hierarchyItem
}(dimensionValue, children, pathHash, options.childrenHash);
indexes.push(hierarchyItem.index);
if (expandedPathsHash && expandedPathsHash[pathHash] || dimension.expanded) {
if (!hierarchyItem.children) {
hierarchyItem.children = []
}
fillHierarchyItemIndexesCore(indexes, options, hierarchyItem.children, expandIndex + 1, pathHash)
}
}
}
function generateHierarchyItems(data, loadOptions, headers, headerName) {
const result = [0];
const expandIndex = loadOptions.headerName === headerName ? loadOptions.path.length : 0;
const expandedPaths = "rows" === headerName ? loadOptions.rowExpandedPaths : loadOptions.columnExpandedPaths;
const options = {
data: data,
childrenHash: headers[`${headerName}Hash`],
dimensions: loadOptions[headerName],
expandedPathsHash: loadOptions.headerName !== headerName && expandedPaths && expandedPaths.hash
};
fillHierarchyItemIndexesCore(result, options, headers[headerName], expandIndex);
return result
}
function generateAggregationCells(data, cells, headers, options) {
const cellSet = [];
let x;
let y;
let rowIndex;
let columnIndex;
const rowIndexes = generateHierarchyItems(data, options, headers, "rows");
const columnIndexes = generateHierarchyItems(data, options, headers, "columns");
for (y = 0; y < rowIndexes.length; y += 1) {
rowIndex = rowIndexes[y];
cells[rowIndex] = cells[rowIndex] || [];
for (x = 0; x < columnIndexes.length; x += 1) {
columnIndex = columnIndexes[x];
cellSet.push(cells[rowIndex][columnIndex] = cells[rowIndex][columnIndex] || [])
}
}
return cellSet
}
function fillHashExpandedPath(expandedPaths) {
if (expandedPaths) {
const hash = expandedPaths.hash = {};
expandedPaths.forEach(path => {
const pathValue = path.map(value => `${value}`).join("/./");
hash[pathValue] = true
})
}
}
function prepareLoadOption(options) {
options.rows = options.rows || [];
options.columns = options.columns || [];
options.filters = options.filters || [];
fillHashExpandedPath(options.columnExpandedPaths);
fillHashExpandedPath(options.rowExpandedPaths);
prepareFields(options.columns);
prepareFields(options.rows);
prepareFields(options.values);
prepareFields(options.filters)
}
function getAggregator(field) {
if ("custom" === field.summaryType) {
field.calculateCustomSummary = field.calculateCustomSummary || _common.noop;
return {
seed() {
const options = {
summaryProcess: "start",
totalValue: void 0
};
field.calculateCustomSummary(options);
return options
},
step(options, value) {
options.summaryProcess = "calculate";
options.value = value;
field.calculateCustomSummary(options);
return options
},
finalize(options) {
options.summaryProcess = "finalize";
delete options.value;
field.calculateCustomSummary(options);
return options.totalValue
}
}
}
return _utils.aggregators[field.summaryType] || _utils.aggregators.count
}
function aggregationStep(measures, aggregationCells, data) {
for (let aggregatorIndex = 0; aggregatorIndex < measures.length; aggregatorIndex += 1) {
const cellField = measures[aggregatorIndex];
const cellValue = cellField.selector(data);
const aggregator = getAggregator(cellField);
const isAggregatorSeedFunction = "function" === typeof aggregator.seed;
for (let cellSetIndex = 0; cellSetIndex < aggregationCells.length; cellSetIndex += 1) {
const cell = aggregationCells[cellSetIndex];
if (cell.length <= aggregatorIndex) {
cell[aggregatorIndex] = isAggregatorSeedFunction ? aggregator.seed() : aggregator.seed
}
if (void 0 === cell[aggregatorIndex]) {
cell[aggregatorIndex] = cellValue
} else if ((0, _type.isDefined)(cellValue)) {
cell[aggregatorIndex] = aggregator.step(cell[aggregatorIndex], cellValue)
}
}
}
}
function areValuesEqual(filterValue, fieldValue) {
let valueOfFilter = filterValue && filterValue.valueOf();
let valueOfField = fieldValue && fieldValue.valueOf();
if (Array.isArray(filterValue)) {
fieldValue = fieldValue || [];
for (let i = 0; i < filterValue.length; i += 1) {
valueOfFilter = filterValue[i] && filterValue[i].valueOf();
valueOfField = fieldValue[i] && fieldValue[i].valueOf();
if (valueOfFilter !== valueOfField) {
return false
}
}
return true
}
return valueOfFilter === valueOfField
}
function createDimensionFilters(dimension) {
const filters = [];
(0, _iterator.each)(dimension, (_, field) => {
const filterValues = field.filterValues || [];
const {
groupName: groupName
} = field;
if (groupName && (0, _type.isNumeric)(field.groupIndex)) {
return
}
filterValues.length && filters.push(function(dataItem) {
const value = field.levels ? function(levels, data) {
const value = [];
(0, _iterator.each)(levels, (_, field) => {
value.push(field.selector(data))
});
return value
}(field.levels, dataItem) : field.selector(dataItem);
let result = false;
for (let i = 0; i < filterValues.length; i += 1) {
if (areValuesEqual(filterValues[i], value)) {
result = true;
break
}
}
return "exclude" === field.filterType ? !result : result
})
});
return filters
}
function createFilter(options) {
const filters = createDimensionFilters(options.rows).concat(createDimensionFilters(options.columns)).concat(createDimensionFilters(options.filters));
const expandedDimensions = options[options.headerName];
const {
path: path
} = options;
if (expandedDimensions) {
filters.push(dataItem => {
let expandValue;
for (let i = 0; i < path.length; i += 1) {
expandValue = expandedDimensions[i].selector(dataItem);
if ((0, _data.toComparable)(expandValue, true) !== (0, _data.toComparable)(path[i], true)) {
return false
}
}
return true
})
}
return function(dataItem) {
for (let i = 0; i < filters.length; i += 1) {
if (!filters[i](dataItem)) {
return false
}
}
return true
}
}
function loadCore(items, options, notifyProgress) {
const headers = {
columns: [],
rows: [],
columnsHash: {
length: 1
},
rowsHash: {
length: 1
}
};
const values = [];
let aggregationCells;
let data;
const d = new _deferred.Deferred;
let i = 0;
const filter = createFilter(options);
! function processData() {
const t = new Date;
const startIndex = i;
for (; i < items.length; i += 1) {
if (i > startIndex && i % 1e4 === 0) {
if (new Date - t >= 300) {
notifyProgress(i / items.length);
setTimeout(processData, 0);
return
}
}
data = items[i];
if (filter(data)) {
aggregationCells = generateAggregationCells(data, values, headers, options);
aggregationStep(options.values, aggregationCells, data)
}
}
measures = options.values, cells = values, void(0, _iterator.each)(measures, (aggregatorIndex, cellField) => {
const aggregator = getAggregator(cellField);
if (aggregator.finalize) {
(0, _iterator.each)(cells, (_, row) => {
(0, _iterator.each)(row, (_, cell) => {
if (cell && void 0 !== cell[aggregatorIndex]) {
cell[aggregatorIndex] = aggregator.finalize(cell[aggregatorIndex])
}
})
})
}
});
var measures, cells;
notifyProgress(1);
d.resolve({
rows: headers.rows,
columns: headers.columns,
values: values,
grandTotalRowIndex: 0,
grandTotalColumnIndex: 0
})
}();
return d
}
function filterDataSource(dataSource, fieldSelectors) {
let filter = dataSource.filter();
if (dataSource.store() instanceof _custom_store.CustomStore && filter) {
filter = processFilter(filter, fieldSelectors);
return (0, _query.default)(dataSource.items()).filter(filter).toArray()
}
return dataSource.items()
}
function loadDataSource(dataSource, fieldSelectors, reload) {
const d = new _deferred.Deferred;
const customizeStoreLoadOptionsHandler = function(options) {
if (dataSource.store() instanceof _array_store.default) {
options.storeLoadOptions.filter = processFilter(options.storeLoadOptions.filter, fieldSelectors)
}
};
dataSource.on("customizeStoreLoadOptions", customizeStoreLoadOptionsHandler);
if (!dataSource.isLoaded() || reload) {
const loadDeferred = reload ? dataSource.load() : dataSource.reload();
(0, _deferred.when)(loadDeferred).done(() => {
loadDataSource(dataSource, fieldSelectors).done(() => {
d.resolve(filterDataSource(dataSource, fieldSelectors))
}).fail(d.reject)
}).fail(d.reject)
} else {
d.resolve(filterDataSource(dataSource, fieldSelectors))
}
return d.always(() => {
dataSource.off("customizeStoreLoadOptions", customizeStoreLoadOptionsHandler)
})
}
function fillSelectorsByFields(selectors, fields) {
fields.forEach(field => {
if (field.dataField && "date" === field.dataType) {
const valueSelector = getDateValue(getDataSelector(field.dataField));
selectors[field.dataField] = function(data) {
return valueSelector(data)
}
}
})
}
function getFieldSelectors(options) {
const selectors = {};
if (Array.isArray(options)) {
fillSelectorsByFields(selectors, options)
} else if (options) {
["rows", "columns", "filters"].forEach(area => {
options[area] && fillSelectorsByFields(selectors, options[area])
})
}
return selectors
}
function processFilter(filter, fieldSelectors) {
if (!Array.isArray(filter)) {
return filter
}
filter = filter.slice(0);
if ((0, _type.isString)(filter[0]) && (filter[1] instanceof Date || filter[2] instanceof Date)) {
filter[0] = fieldSelectors[filter[0]]
}
for (let i = 0; i < filter.length; i += 1) {
filter[i] = processFilter(filter[i], fieldSelectors)
}
return filter
}
return {
ctor(options) {
this._progressChanged = options.onProgressChanged || _common.noop;
this._dataSource = new _data_source.DataSource(options);
this._dataSource.paginate(false)
},
getFields(fields) {
const dataSource = this._dataSource;
const d = new _deferred.Deferred;
loadDataSource(dataSource, getFieldSelectors(fields)).done(data => {
d.resolve((0, _m_widget_utils.discoverObjectFields)(data, fields))
}).fail(d.reject);
return d
},
key() {
return this._dataSource.key()
},
load(options) {
const that = this;
const dataSource = that._dataSource;
const d = new _deferred.Deferred;
prepareLoadOption(options);
loadDataSource(dataSource, getFieldSelectors(options), options.reload).done(data => {
(0, _deferred.when)(loadCore(data, options, that._progressChanged)).done(d.resolve)
}).fail(d.reject);
return d
},
filter() {
const dataSource = this._dataSource;
return dataSource.filter.apply(dataSource, arguments)
},
supportPaging: () => false,
getDrillDownItems(loadOptions, params) {
loadOptions = loadOptions || {};
params = params || {};
prepareLoadOption(loadOptions);
const drillDownItems = [];
const items = this._dataSource.items();
let item;
const {
maxRowCount: maxRowCount
} = params;
const {
customColumns: customColumns
} = params;
const filter = createFilter(loadOptions);
const pathFilter = createFilter({
rows: (0, _m_widget_utils.getFiltersByPath)(loadOptions.rows, params.rowPath),
columns: (0, _m_widget_utils.getFiltersByPath)(loadOptions.columns, params.columnPath),
filters: []
});
for (let i = 0; i < items.length; i += 1) {
if (pathFilter(items[i]) && filter(items[i])) {
if (customColumns) {
item = {};
for (let j = 0; j < customColumns.length; j += 1) {
item[customColumns[j]] = items[i][customColumns[j]]
}
} else {
item = items[i]
}
drillDownItems.push(item)
}
if (maxRowCount > 0 && drillDownItems.length === maxRowCount) {
break
}
}
return drillDownItems
}
}
}()).include(_m_widget_utils.storeDrillDownMixin);
exports.default = {
LocalStore: LocalStore
}
},
16508(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.PivotGrid = void 0;
var _click = __webpack_require__( /*! ../../../common/core/events/click */ 64044);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/events/core/events_engine */ 92774));
var _index = __webpack_require__( /*! ../../../common/core/events/utils/index */ 98834);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _element = __webpack_require__( /*! ../../../core/element */ 61404);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 17781);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 21274);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _string = __webpack_require__( /*! ../../../core/utils/string */ 54497);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 3104);
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 64973));
var _context_menu = _interopRequireDefault(__webpack_require__( /*! ../../../ui/context_menu */ 34378));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 10720));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 52071);
var _widget = _interopRequireDefault(__webpack_require__( /*! ../../core/widget/widget */ 89275));
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 53226));
var _m_chart_integration = __webpack_require__( /*! ./chart_integration/m_chart_integration */ 67705);
var _m_data_area = _interopRequireDefault(__webpack_require__( /*! ./data_area/m_data_area */ 31045));
var _m_data_controller = _interopRequireDefault(__webpack_require__( /*! ./data_controller/m_data_controller */ 18509));
var _m_export = __webpack_require__( /*! ./export/m_export */ 12867);
var _m_field_chooser = __webpack_require__( /*! ./field_chooser/m_field_chooser */ 62989);
var _m_field_chooser_base = __webpack_require__( /*! ./field_chooser/m_field_chooser_base */ 70317);
var _m_fields_area = __webpack_require__( /*! ./fields_area/m_fields_area */ 2997);
var _m_headers_area = _interopRequireDefault(__webpack_require__( /*! ./headers_area/m_headers_area */ 77195));
var _m_widget_utils = __webpack_require__( /*! ./m_widget_utils */ 12062);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const window = (0, _window.getWindow)();
const TR = "
";
const TD = "";
const DIV = "";
const FIELD_CALCULATED_OPTIONS = ["allowSorting", "allowSortingBySummary", "allowFiltering", "allowExpandAll"];
function getArraySum(array) {
let sum = 0;
(0, _iterator.each)(array, (_, value) => {
sum += value || 0
});
return sum
}
function adjustSizeArray(sizeArray, space) {
const delta = space / sizeArray.length;
for (let i = 0; i < sizeArray.length; i += 1) {
sizeArray[i] -= delta
}
}
function unsubscribeScrollEvents(area) {
area.off("scroll").off("stop")
}
function getCommonBorderWidth(elements, direction) {
const borderStyleNames = "width" === direction ? ["borderLeftWidth", "borderRightWidth"] : ["borderTopWidth", "borderBottomWidth"];
let width = 0;
(0, _iterator.each)(elements, (_, elem) => {
const computedStyle = window.getComputedStyle(elem.get(0));
borderStyleNames.forEach(borderStyleName => {
width += parseFloat(computedStyle[borderStyleName]) || 0
})
});
return width
}
class PivotGrid extends _widget.default {
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
scrolling: {
timeout: 300,
renderingThreshold: 150,
minTimeout: 10,
mode: "standard",
useNative: "auto",
removeInvisiblePages: true,
virtualRowHeight: 50,
virtualColumnWidth: 100,
loadTwoPagesOnStart: true
},
encodeHtml: true,
dataSource: null,
activeStateEnabled: false,
fieldChooser: {
minWidth: 250,
minHeight: 250,
enabled: true,
allowSearch: false,
searchTimeout: 500,
layout: 0,
title: _message.default.format("dxPivotGrid-fieldChooserTitle"),
width: 600,
height: 600,
applyChangesMode: "instantly"
},
onContextMenuPreparing: null,
allowSorting: false,
allowSortingBySummary: false,
allowFiltering: false,
allowExpandAll: false,
wordWrapEnabled: true,
fieldPanel: {
showColumnFields: true,
showFilterFields: true,
showDataFields: true,
showRowFields: true,
allowFieldDragging: true,
visible: false,
texts: {
columnFieldArea: _message.default.format("dxPivotGrid-columnFieldArea"),
rowFieldArea: _message.default.format("dxPivotGrid-rowFieldArea"),
filterFieldArea: _message.default.format("dxPivotGrid-filterFieldArea"),
dataFieldArea: _message.default.format("dxPivotGrid-dataFieldArea")
}
},
dataFieldArea: "column",
export: {
enabled: false,
fileName: "PivotGrid"
},
showRowTotals: true,
showRowGrandTotals: true,
showColumnTotals: true,
showColumnGrandTotals: true,
hideEmptySummaryCells: true,
showTotalsPrior: "none",
rowHeaderLayout: "standard",
loadPanel: {
enabled: true,
text: _message.default.format("Loading"),
width: 200,
height: 70,
showIndicator: true,
showPane: true
},
texts: {
grandTotal: _message.default.format("dxPivotGrid-grandTotal"),
total: _message.default.getFormatter("dxPivotGrid-total"),
noData: _message.default.format("dxDataGrid-noDataText"),
showFieldChooser: _message.default.format("dxPivotGrid-showFieldChooser"),
expandAll: _message.default.format("dxPivotGrid-expandAll"),
collapseAll: _message.default.format("dxPivotGrid-collapseAll"),
sortColumnBySummary: _message.default.getFormatter("dxPivotGrid-sortColumnBySummary"),
sortRowBySummary: _message.default.getFormatter("dxPivotGrid-sortRowBySummary"),
removeAllSorting: _message.default.format("dxPivotGrid-removeAllSorting"),
exportToExcel: _message.default.format("dxDataGrid-exportToExcel"),
dataNotAvailable: _message.default.format("dxPivotGrid-dataNotAvailable")
},
onCellClick: null,
onCellPrepared: null,
showBorders: false,
stateStoring: {
enabled: false,
storageKey: null,
type: "localStorage",
customLoad: null,
customSave: null,
savingTimeout: 2e3
},
onExpandValueChanging: null,
renderCellCountLimit: 2e4,
onExporting: null,
headerFilter: {
width: 252,
height: 325,
allowSelectAll: true,
showRelevantValues: false,
search: {
enabled: false,
timeout: 500,
editorOptions: {},
mode: "contains"
},
texts: {
emptyValue: _message.default.format("dxDataGrid-headerFilterEmptyValue"),
ok: _message.default.format("dxDataGrid-headerFilterOK"),
cancel: _message.default.format("dxDataGrid-headerFilterCancel")
}
}
})
}
_setDeprecatedOptions() {
super._setDeprecatedOptions();
this._deprecatedOptions = Object.assign({}, this._deprecatedOptions, {
"loadPanel.indicatorSrc": {
since: "25.2",
alias: "loadPanel.indicatorOptions.src"
}
})
}
_updateCalculatedOptions(fields) {
const that = this;
(0, _iterator.each)(fields, (_, field) => {
(0, _iterator.each)(FIELD_CALCULATED_OPTIONS, (_, optionName) => {
const isCalculated = field._initProperties && optionName in field._initProperties && void 0 === field._initProperties[optionName];
const needUpdate = void 0 === field[optionName] || isCalculated;
if (needUpdate) {
(0, _m_widget_utils.setFieldProperty)(field, optionName, that.option(optionName))
}
})
})
}
_getDataControllerOptions() {
const that = this;
return {
component: that,
dataSource: that.option("dataSource"),
texts: that.option("texts"),
showRowTotals: that.option("showRowTotals"),
showRowGrandTotals: that.option("showRowGrandTotals"),
showColumnTotals: that.option("showColumnTotals"),
showTotalsPrior: that.option("showTotalsPrior"),
showColumnGrandTotals: that.option("showColumnGrandTotals"),
dataFieldArea: that.option("dataFieldArea"),
rowHeaderLayout: that.option("rowHeaderLayout"),
hideEmptySummaryCells: that.option("hideEmptySummaryCells"),
onFieldsPrepared(fields) {
that._updateCalculatedOptions(fields)
}
}
}
_initDataController() {
const that = this;
that._dataController && that._dataController.dispose();
that._dataController = new _m_data_controller.default.DataController(that._getDataControllerOptions());
if ((0, _window.hasWindow)()) {
that._dataController.changed.add(() => {
that._render()
})
}
that._dataController.scrollChanged.add(options => {
that._scrollLeft = options.left;
that._scrollTop = options.top
});
that._dataController.loadingChanged.add(() => {
that._updateLoading()
});
that._dataController.progressChanged.add(that._updateLoading.bind(that));
that._dataController.dataSourceChanged.add(() => {
that._trigger("onChanged", void 0)
});
const expandValueChanging = that.option("onExpandValueChanging");
if (expandValueChanging) {
that._dataController.expandValueChanging.add(e => {
expandValueChanging(e)
})
}
}
_init() {
super._init();
this._initDataController();
_m_utils.default.logHeaderFilterDeprecatedWarningIfNeed(this);
this._scrollLeft = this._scrollTop = null;
this._initActions()
}
_initActions() {
this._actions = {
onChanged: this._createActionByOption("onChanged"),
onContextMenuPreparing: this._createActionByOption("onContextMenuPreparing"),
onCellClick: this._createActionByOption("onCellClick"),
onExporting: this._createActionByOption("onExporting"),
onCellPrepared: this._createActionByOption("onCellPrepared")
}
}
_trigger(eventName, eventArg) {
this._actions[eventName](eventArg)
}
_optionChanged(args) {
const that = this;
if (FIELD_CALCULATED_OPTIONS.includes(args.name)) {
const fields = this.getDataSource().fields();
this._updateCalculatedOptions(fields)
}
switch (args.name) {
case "dataSource":
case "allowSorting":
case "allowFiltering":
case "allowExpandAll":
case "allowSortingBySummary":
case "scrolling":
case "stateStoring":
that._initDataController();
that.getFieldChooserPopup().hide();
that._renderFieldChooser();
that._invalidate();
break;
case "texts":
case "showTotalsPrior":
case "showRowTotals":
case "showRowGrandTotals":
case "showColumnTotals":
case "showColumnGrandTotals":
case "hideEmptySummaryCells":
case "dataFieldArea":
that._dataController.updateViewOptions(that._getDataControllerOptions());
break;
case "useNativeScrolling":
case "encodeHtml":
case "renderCellCountLimit":
case "onExpandValueChanging":
break;
case "rtlEnabled":
super._optionChanged(args);
that._renderFieldChooser();
that._renderContextMenu();
(0, _window.hasWindow)() && that._renderLoadPanel(that._dataArea.groupElement(), that.$element());
that._invalidate();
break;
case "export":
that._renderDescriptionArea();
break;
case "onCellClick":
case "onContextMenuPreparing":
case "onExporting":
case "onExported":
case "onFileSaving":
case "onCellPrepared":
that._actions[args.name] = that._createActionByOption(args.name);
break;
case "fieldChooser":
that._renderFieldChooser();
that._renderDescriptionArea();
break;
case "loadPanel":
if ((0, _window.hasWindow)()) {
if ("loadPanel.enabled" === args.fullName) {
clearTimeout(this._hideLoadingTimeoutID);
that._renderLoadPanel(that._dataArea.groupElement(), that.$element())
} else {
that._renderLoadPanel(that._dataArea.groupElement(), that.$element());
that._invalidate()
}
}
break;
case "fieldPanel":
that._renderDescriptionArea();
that._invalidate();
break;
case "headerFilter":
that._renderFieldChooser();
that._invalidate();
break;
case "showBorders":
that._tableElement().toggleClass("dx-pivotgrid-border", !!args.value);
that.updateDimensions();
break;
case "wordWrapEnabled":
that._tableElement().toggleClass("dx-word-wrap", !!args.value);
that.updateDimensions();
break;
case "rowHeaderLayout":
that._tableElement().find(".dx-area-row-cell").toggleClass("dx-area-tree-view", "tree" === args.value);
that._dataController.updateViewOptions(that._getDataControllerOptions());
break;
case "height":
case "width":
that._hasHeight = null;
super._optionChanged(args);
that.resize();
break;
default:
super._optionChanged(args)
}
}
_updateScrollPosition(columnsArea, rowsArea, dataArea) {
let force = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : false;
const that = this;
let scrollTop;
let scrollLeft;
const scrolled = that._scrollTop || that._scrollLeft;
if (that._scrollUpdating) {
return
}
that._scrollUpdating = true;
if (rowsArea && !rowsArea.hasScroll() && that._hasHeight) {
that._scrollTop = null
}
if (columnsArea && !columnsArea.hasScroll()) {
that._scrollLeft = null
}
if (null !== that._scrollTop || null !== that._scrollLeft || scrolled || that.option("rtlEnabled")) {
scrollTop = that._scrollTop || 0;
scrollLeft = that._scrollLeft || 0;
dataArea.scrollTo({
left: scrollLeft,
top: scrollTop
}, force);
columnsArea.scrollTo({
left: scrollLeft
}, force);
rowsArea.scrollTo({
top: scrollTop
}, force);
that._dataController.updateWindowScrollPosition(that._scrollTop)
}
that._scrollUpdating = false
}
_subscribeToEvents(columnsArea, rowsArea, dataArea) {
const that = this;
(0, _iterator.each)([columnsArea, rowsArea, dataArea], (_, area) => {
! function(area, handler) {
unsubscribeScrollEvents(area);
area.on("scroll", handler).on("stop", handler)
}(area, e => function(e, area) {
const {
scrollOffset: scrollOffset
} = e;
const scrollable = area._getScrollable();
const leftOffset = "vertical" !== scrollable.option("direction") ? scrollOffset.left : that._scrollLeft;
const topOffset = "horizontal" !== scrollable.option("direction") && that._hasHeight ? scrollOffset.top : that._scrollTop;
if ((that._scrollLeft || 0) !== (leftOffset || 0) || (that._scrollTop || 0) !== (topOffset || 0)) {
that._scrollLeft = leftOffset;
that._scrollTop = topOffset;
that._updateScrollPosition(columnsArea, rowsArea, dataArea);
if ("virtual" === that.option("scrolling.mode")) {
that._dataController.setViewportPosition(that._scrollLeft, that._scrollTop)
}
}
}(e, area))
});
!that._hasHeight && that._dataController.subscribeToWindowScrollEvents(dataArea.groupElement())
}
_clean() {
(0, _common.noop)()
}
_needDelayResizing(cellsInfo) {
const cellsCount = cellsInfo.length * (cellsInfo.length ? cellsInfo[0].length : 0);
return cellsCount > Number(this.option("renderCellCountLimit"))
}
_renderFieldChooser() {
const that = this;
const container = that._pivotGridContainer;
const fieldChooserOptions = that.option("fieldChooser") || {};
const toolbarItems = "onDemand" === fieldChooserOptions.applyChangesMode ? [{
toolbar: "bottom",
location: "after",
widget: "dxButton",
options: {
text: _message.default.format("OK"),
onClick() {
that.getFieldChooserPopup().$content().dxPivotGridFieldChooser("applyChanges");
that.getFieldChooserPopup().hide()
}
}
}, {
toolbar: "bottom",
location: "after",
widget: "dxButton",
options: {
text: _message.default.format("Cancel"),
onClick() {
that.getFieldChooserPopup().hide()
}
}
}] : [];
const fieldChooserComponentOptions = {
layout: fieldChooserOptions.layout,
texts: fieldChooserOptions.texts || {},
dataSource: that.getDataSource(),
allowSearch: fieldChooserOptions.allowSearch,
searchTimeout: fieldChooserOptions.searchTimeout,
width: void 0,
height: void 0,
headerFilter: that.option("headerFilter"),
encodeHtml: that.option("fieldChooser.encodeHtml") ?? that.option("encodeHtml"),
applyChangesMode: fieldChooserOptions.applyChangesMode,
rtlEnabled: that.option("rtlEnabled"),
onContextMenuPreparing(e) {
that._trigger("onContextMenuPreparing", e)
}
};
const popupOptions = {
shading: false,
title: fieldChooserOptions.title,
width: fieldChooserOptions.width,
height: fieldChooserOptions.height,
showCloseButton: true,
resizeEnabled: true,
minWidth: fieldChooserOptions.minWidth,
minHeight: fieldChooserOptions.minHeight,
toolbarItems: toolbarItems,
onResize(e) {
e.component.$content().dxPivotGridFieldChooser("updateDimensions")
},
onShown(e) {
that._createComponent(e.component.content(), _m_field_chooser.FieldChooser, fieldChooserComponentOptions)
},
onHidden(e) {
const fieldChooser = e.component.$content().dxPivotGridFieldChooser("instance");
fieldChooser.resetTreeView();
fieldChooser.cancelChanges()
}
};
if (that.getFieldChooserPopup()) {
that._fieldChooserPopup.option(popupOptions);
that._fieldChooserPopup.$content().dxPivotGridFieldChooser(fieldChooserComponentOptions)
} else {
that._fieldChooserPopup = that._createComponent((0, _renderer.default)(DIV).addClass("dx-fieldchooser-popup").appendTo(container), _ui.default, popupOptions)
}
}
_renderContextMenu() {
const that = this;
const $container = that._pivotGridContainer;
if (that._contextMenu) {
that._contextMenu.$element().remove()
}
that._contextMenu = that._createComponent((0, _renderer.default)(DIV).appendTo($container), _context_menu.default, {
onPositioning(actionArgs) {
const {
event: event
} = actionArgs;
actionArgs.cancel = true;
if (!event) {
return
}
const targetElement = event.target.cellIndex >= 0 ? event.target : (0, _renderer.default)(event.target).closest("td").get(0);
if (!targetElement) {
return
}
const args = that._createEventArgs(targetElement, event);
const items = that._getContextMenuItems(args);
if (items) {
actionArgs.component.option("items", items);
actionArgs.cancel = false
}
},
onItemClick(params) {
params.itemData.onItemClick && params.itemData.onItemClick(params)
},
cssClass: "dx-pivotgrid",
target: that.$element()
})
}
_getContextMenuItems(e) {
const that = this;
let items = [];
const texts = that.option("texts");
if ("row" === e.area || "column" === e.area) {
const areaFields = e[`${e.area}Fields`];
const oppositeAreaFields = e["column" === e.area ? "rowFields" : "columnFields"];
const field = e.cell.path && areaFields[e.cell.path.length - 1];
const dataSource = that.getDataSource();
if (field && field.allowExpandAll && e.cell.path.length < e[`${e.area}Fields`].length && !dataSource.paginate()) {
items.push({
beginGroup: true,
icon: "none",
text: texts.expandAll,
onItemClick() {
dataSource.expandAll(field.index)
}
});
items.push({
text: texts.collapseAll,
icon: "none",
onItemClick() {
dataSource.collapseAll(field.index)
}
})
}
if (e.cell.isLast && !dataSource.paginate()) {
let sortingBySummaryItemCount = 0;
(0, _iterator.each)(oppositeAreaFields, (_, field) => {
if (!field.allowSortingBySummary) {
return
}(0, _iterator.each)(e.dataFields, (dataIndex, dataField) => {
if ((0, _type.isDefined)(e.cell.dataIndex) && e.cell.dataIndex !== dataIndex) {
return
}
const showDataFieldCaption = !(0, _type.isDefined)(e.cell.dataIndex) && e.dataFields.length > 1;
const textFormat = "column" === e.area ? texts.sortColumnBySummary : texts.sortRowBySummary;
const checked = (0, _m_widget_utils.findField)(e.dataFields, field.sortBySummaryField) === dataIndex && (e.cell.path || []).join("/") === (field.sortBySummaryPath || []).join("/");
const text = (0, _string.format)(textFormat, showDataFieldCaption ? `${field.caption} - ${dataField.caption}` : field.caption);
items.push({
beginGroup: 0 === sortingBySummaryItemCount,
icon: checked ? "desc" === field.sortOrder ? "sortdowntext" : "sortuptext" : "none",
text: text,
onItemClick() {
dataSource.field(field.index, {
sortBySummaryField: dataField.name || dataField.caption || dataField.dataField,
sortBySummaryPath: e.cell.path,
sortOrder: "desc" === field.sortOrder ? "asc" : "desc"
});
dataSource.load()
}
});
sortingBySummaryItemCount += 1
})
});
(0, _iterator.each)(oppositeAreaFields, (_, field) => {
if (!field.allowSortingBySummary || !(0, _type.isDefined)(field.sortBySummaryField)) {
return
}
items.push({
beginGroup: 0 === sortingBySummaryItemCount,
icon: "none",
text: texts.removeAllSorting,
onItemClick() {
(0, _iterator.each)(oppositeAreaFields, (_, field) => {
dataSource.field(field.index, {
sortBySummaryField: void 0,
sortBySummaryPath: void 0,
sortOrder: void 0
})
});
dataSource.load()
}
});
return false
})
}
}
if (that.option("fieldChooser.enabled")) {
items.push({
beginGroup: true,
icon: "columnchooser",
text: texts.showFieldChooser,
onItemClick() {
that.getFieldChooserPopup().show()
}
})
}
if (that.option("export.enabled")) {
items.push({
beginGroup: true,
icon: "xlsxfile",
text: texts.exportToExcel,
onItemClick() {
that.exportTo()
}
})
}
e.items = items;
that._trigger("onContextMenuPreparing", e);
items = e.items;
if (items && items.length) {
return items
}
return
}
_createEventArgs(targetElement, dxEvent) {
const that = this;
const dataSource = that.getDataSource();
const args = {
rowFields: dataSource.getAreaFields("row"),
columnFields: dataSource.getAreaFields("column"),
dataFields: dataSource.getAreaFields("data"),
event: dxEvent
};
if ($targetElement = (0, _renderer.default)(targetElement), $targetElement.closest(".dx-area-fields").length || $targetElement.find(".dx-area-fields").length) {
return (0, _extend.extend)(that._createFieldArgs(targetElement), args)
}
var $targetElement;
return (0, _extend.extend)(that._createCellArgs(targetElement), args)
}
_createFieldArgs(targetElement) {
const field = (0, _renderer.default)(targetElement).children().data("field");
const args = {
field: field
};
return (0, _type.isDefined)(field) ? args : {}
}
_createCellArgs(cellElement) {
const $cellElement = (0, _renderer.default)(cellElement);
const columnIndex = cellElement.cellIndex;
const {
rowIndex: rowIndex
} = cellElement.parentElement;
const $table = $cellElement.closest("table");
const data = $table.data("data");
const cell = data && data[rowIndex] && data[rowIndex][columnIndex];
const args = {
area: $table.data("area"),
rowIndex: rowIndex,
columnIndex: columnIndex,
cellElement: (0, _element.getPublicElement)($cellElement),
cell: cell
};
return args
}
_handleCellClick(e) {
const that = this;
const args = that._createEventArgs(e.currentTarget, e);
const {
cell: cell
} = args;
if (!cell || !args.area && (args.rowIndex || args.columnIndex)) {
return
}
that._trigger("onCellClick", args);
cell && !args.cancel && (0, _type.isDefined)(cell.expanded) && setTimeout(() => {
that._dataController[cell.expanded ? "collapseHeaderItem" : "expandHeaderItem"](args.area, cell.path)
})
}
_getNoDataText() {
return this.option("texts.noData")
}
_renderNoDataText(element) {
return _m_utils.default.renderNoDataText.call(this, element)
}
_renderLoadPanel(element, container) {
return _m_utils.default.renderLoadPanel.call(this, element, container, void 0)
}
_updateLoading(progress) {
const that = this;
const isLoading = that._dataController.isLoading();
if (!that._loadPanel) {
return
}
const loadPanelVisible = that._loadPanel.option("visible");
if (!loadPanelVisible) {
that._startLoadingTime = new Date
}
if (isLoading) {
if (progress) {
if (new Date - that._startLoadingTime >= 1e3) {
that._loadPanel.option("message", `${Math.floor(100*progress)}%`)
}
} else {
that._loadPanel.option("message", that.option("loadPanel.text"))
}
}
clearTimeout(that._hideLoadingTimeoutID);
if (loadPanelVisible && !isLoading) {
that._hideLoadingTimeoutID = setTimeout(() => {
that._loadPanel.option("visible", false);
that.$element().removeClass("dx-overflow-hidden")
})
} else {
const visibilityOptions = {
visible: isLoading
};
if (isLoading) {
visibilityOptions.position = _m_utils.default.calculateLoadPanelPosition(that._dataArea.groupElement())
}
that._loadPanel.option(visibilityOptions);
that.$element().toggleClass("dx-overflow-hidden", !isLoading)
}
}
_renderDescriptionArea() {
const $element = this.$element();
const $descriptionCell = $element.find(".dx-area-description-cell");
const $toolbarContainer = (0, _renderer.default)(DIV).addClass("dx-pivotgrid-toolbar");
const fieldPanel = this.option("fieldPanel");
const $filterHeader = $element.find(".dx-filter-header");
const $columnHeader = $element.find(".dx-column-header");
let $targetContainer;
if (fieldPanel.visible && fieldPanel.showFilterFields) {
$targetContainer = $filterHeader
} else if (fieldPanel.visible && (fieldPanel.showDataFields || fieldPanel.showColumnFields)) {
$targetContainer = $columnHeader
} else {
$targetContainer = $descriptionCell
}
$columnHeader.toggleClass("dx-bottom-border", !!(fieldPanel.visible && (fieldPanel.showDataFields || fieldPanel.showColumnFields)));
$filterHeader.toggleClass("dx-bottom-border", !!(fieldPanel.visible && fieldPanel.showFilterFields));
$descriptionCell.toggleClass("dx-pivotgrid-background", fieldPanel.visible && (fieldPanel.showDataFields || fieldPanel.showColumnFields || fieldPanel.showRowFields));
this.$element().find(".dx-pivotgrid-toolbar").remove();
$toolbarContainer.prependTo($targetContainer);
const stylingMode = (0, _themes.isFluent)((0, _themes.current)()) ? "text" : "contained";
if (this.option("fieldChooser.enabled")) {
const $buttonElement = (0, _renderer.default)(DIV).appendTo($toolbarContainer).addClass("dx-pivotgrid-field-chooser-button");
const buttonOptions = {
icon: "columnchooser",
hint: this.option("texts.showFieldChooser"),
stylingMode: stylingMode,
onClick: () => {
this.getFieldChooserPopup().show()
}
};
this._createComponent($buttonElement, _button.default, buttonOptions)
}
if (this.option("export.enabled")) {
const $buttonElement = (0, _renderer.default)(DIV).appendTo($toolbarContainer).addClass("dx-pivotgrid-export-button");
const buttonOptions = {
icon: "xlsxfile",
hint: this.option("texts.exportToExcel"),
stylingMode: stylingMode,
onClick: () => {
this.exportTo()
}
};
this._createComponent($buttonElement, _button.default, buttonOptions)
}
}
_detectHasContainerHeight() {
const that = this;
const element = that.$element();
if ((0, _type.isDefined)(that._hasHeight)) {
const height = that.option("height") || that.$element().get(0).style.height;
if (height && that._hasHeight ^ "auto" !== height) {
that._hasHeight = null
}
}
if ((0, _type.isDefined)(that._hasHeight) || element.is(":hidden")) {
return
}
that._pivotGridContainer.addClass("dx-hidden");
const testElement = (0, _renderer.default)(DIV);
(0, _size.setHeight)(testElement, 66666);
element.append(testElement);
that._hasHeight = 66666 !== (0, _size.getHeight)(element);
that._pivotGridContainer.removeClass("dx-hidden");
testElement.remove()
}
_renderHeaders(rowHeaderContainer, columnHeaderContainer, filterHeaderContainer, dataHeaderContainer) {
const dataSource = this.getDataSource();
this._rowFields = this._rowFields || new _m_fields_area.FieldsArea(this, "row");
this._rowFields.render(rowHeaderContainer, dataSource.getAreaFields("row"));
this._columnFields = this._columnFields || new _m_fields_area.FieldsArea(this, "column");
this._columnFields.render(columnHeaderContainer, dataSource.getAreaFields("column"));
this._filterFields = this._filterFields || new _m_fields_area.FieldsArea(this, "filter");
this._filterFields.render(filterHeaderContainer, dataSource.getAreaFields("filter"));
this._dataFields = this._dataFields || new _m_fields_area.FieldsArea(this, "data");
this._dataFields.render(dataHeaderContainer, dataSource.getAreaFields("data"));
this.$element().dxPivotGridFieldChooserBase("instance").renderSortable()
}
_createTableElement() {
const $table = (0, _renderer.default)(" ").css({
width: "100%"
}).toggleClass("dx-pivotgrid-border", !!this.option("showBorders")).toggleClass("dx-word-wrap", !!this.option("wordWrapEnabled"));
_events_engine.default.on($table, (0, _index.addNamespace)(_click.name, "dxPivotGrid"), "td", this._handleCellClick.bind(this));
return $table
}
_renderDataArea(dataAreaElement) {
const dataArea = this._dataArea || new _m_data_area.default.DataArea(this);
this._dataArea = dataArea;
dataArea.render(dataAreaElement, this._dataController.getCellsInfo());
return dataArea
}
_renderRowsArea(rowsAreaElement) {
const rowsArea = this._rowsArea || new _m_headers_area.default.VerticalHeadersArea(this);
this._rowsArea = rowsArea;
rowsArea.render(rowsAreaElement, this._dataController.getRowsInfo());
return rowsArea
}
_renderColumnsArea(columnsAreaElement) {
const columnsArea = this._columnsArea || new _m_headers_area.default.HorizontalHeadersArea(this);
this._columnsArea = columnsArea;
columnsArea.render(columnsAreaElement, this._dataController.getColumnsInfo());
return columnsArea
}
_initMarkup() {
super._initMarkup();
this.$element().addClass("dx-pivotgrid")
}
_renderContentImpl() {
const that = this;
let columnsAreaElement;
let rowsAreaElement;
let dataAreaElement;
let tableElement;
const isFirstDrawing = !that._pivotGridContainer;
let rowHeaderContainer;
let columnHeaderContainer;
let filterHeaderContainer;
let dataHeaderContainer;
tableElement = !isFirstDrawing && that._tableElement();
if (!tableElement) {
that.$element().addClass("dx-row-lines").addClass("dx-pivotgrid-fields-container");
that._pivotGridContainer = (0, _renderer.default)(DIV).addClass("dx-pivotgrid-container");
that._renderFieldChooser();
that._renderContextMenu();
columnsAreaElement = (0, _renderer.default)(TD).addClass("dx-area-column-cell");
rowsAreaElement = (0, _renderer.default)(TD).addClass("dx-area-row-cell");
dataAreaElement = (0, _renderer.default)(TD).addClass("dx-area-data-cell");
tableElement = that._createTableElement();
dataHeaderContainer = (0, _renderer.default)(TD).addClass("dx-data-header");
filterHeaderContainer = (0, _renderer.default)("").attr("colspan", "2").addClass("dx-filter-header");
columnHeaderContainer = (0, _renderer.default)(TD).addClass("dx-column-header");
rowHeaderContainer = (0, _renderer.default)(TD).addClass("dx-area-description-cell");
(0, _renderer.default)(TR).append(filterHeaderContainer).appendTo(tableElement);
(0, _renderer.default)(TR).append(dataHeaderContainer).append(columnHeaderContainer).appendTo(tableElement);
(0, _renderer.default)(TR).append(rowHeaderContainer).append(columnsAreaElement).appendTo(tableElement);
(0, _renderer.default)(TR).addClass("dx-bottom-row").append(rowsAreaElement).append(dataAreaElement).appendTo(tableElement);
that._pivotGridContainer.append(tableElement);
that.$element().append(that._pivotGridContainer);
if ("tree" === that.option("rowHeaderLayout")) {
rowsAreaElement.addClass("dx-area-tree-view")
}
}
that.$element().addClass("dx-overflow-hidden");
const fieldChooserBaseConfig = {
dataSource: that.getDataSource(),
encodeHtml: that.option("encodeHtml"),
allowFieldDragging: that.option("fieldPanel.allowFieldDragging"),
headerFilter: that.option("headerFilter"),
visible: that.option("visible"),
remoteSort: "virtual" === that.option("scrolling.mode")
};
if (that._fieldChooserBase) {
that._fieldChooserBase.option(fieldChooserBaseConfig)
} else {
that._fieldChooserBase = that._createComponent(that.$element(), _m_field_chooser_base.FieldChooserBase, fieldChooserBaseConfig)
}
const dataArea = that._renderDataArea(dataAreaElement);
const rowsArea = that._renderRowsArea(rowsAreaElement);
const columnsArea = that._renderColumnsArea(columnsAreaElement);
dataArea.tableElement().prepend(columnsArea.headElement());
if (isFirstDrawing) {
that._renderLoadPanel(dataArea.groupElement().parent(), that.$element());
that._renderDescriptionArea();
rowsArea.renderScrollable();
columnsArea.renderScrollable();
dataArea.renderScrollable()
} [dataArea, rowsArea, columnsArea].forEach(area => {
unsubscribeScrollEvents(area)
});
that._renderHeaders(rowHeaderContainer, columnHeaderContainer, filterHeaderContainer, dataHeaderContainer);
that._update(isFirstDrawing)
}
_update(isFirstDrawing) {
const that = this;
const updateHandler = function() {
that.updateDimensions()
};
if (that._needDelayResizing(that._dataArea.getData()) && isFirstDrawing) {
setTimeout(updateHandler)
} else {
updateHandler()
}
}
_fireContentReadyAction() {
if (!this._dataController.isLoading()) {
super._fireContentReadyAction()
}
}
getScrollPath(area) {
const that = this;
if ("column" === area) {
return that._columnsArea.getScrollPath(that._scrollLeft)
}
return that._rowsArea.getScrollPath(that._scrollTop)
}
getDataSource() {
return this._dataController.getDataSource()
}
getFieldChooserPopup() {
return this._fieldChooserPopup
}
hasScroll(area) {
return "column" === area ? this._columnsArea.hasScroll() : this._rowsArea.hasScroll()
}
_dimensionChanged() {
this.updateDimensions()
}
_visibilityChanged(visible) {
if (visible) {
this.updateDimensions()
}
}
_dispose() {
const that = this;
clearTimeout(that._hideLoadingTimeoutID);
if (that._dataController) {
that._dataController.dispose()
}
super._dispose()
}
_tableElement() {
return this.$element().find("table").first()
}
addWidgetPrefix(className) {
return `dx-pivotgrid-${className}`
}
resize() {
this.updateDimensions()
}
isReady() {
return super.isReady() && !this._dataController.isLoading()
}
updateDimensions() {
const that = this;
let groupWidth;
const tableElement = that._tableElement();
let bordersWidth;
let totalWidth = 0;
let totalHeight = 0;
let rowsAreaWidth = 0;
let hasRowsScroll;
let hasColumnsScroll;
const dataAreaCell = tableElement.find(".dx-area-data-cell");
const rowAreaCell = tableElement.find(".dx-area-row-cell");
const columnAreaCell = tableElement.find(".dx-area-column-cell");
const descriptionCell = tableElement.find(".dx-area-description-cell");
const filterHeaderCell = tableElement.find(".dx-filter-header");
const columnHeaderCell = tableElement.find(".dx-column-header");
const rowFieldsHeader = that._rowFields;
const d = new _deferred.Deferred;
if (!(0, _window.hasWindow)()) {
return
}
const needSynchronizeFieldPanel = rowFieldsHeader.isVisible() && "tree" !== that.option("rowHeaderLayout");
that._detectHasContainerHeight();
if (!that._dataArea.headElement().length) {
that._dataArea.tableElement().prepend(that._columnsArea.headElement())
}
if (needSynchronizeFieldPanel) {
that._rowsArea.updateColspans(rowFieldsHeader.getColumnsCount());
that._rowsArea.tableElement().prepend(rowFieldsHeader.headElement())
}
tableElement.addClass("dx-incompressible-fields");
that._dataArea.reset();
that._rowsArea.reset();
that._columnsArea.reset();
rowFieldsHeader.reset();
const calculateHasScroll = (areaSize, totalSize) => totalSize - areaSize >= 1;
const calculateGroupHeight = (dataAreaHeight, totalHeight, hasRowsScroll, hasColumnsScroll, scrollBarWidth) => hasRowsScroll ? dataAreaHeight : totalHeight + (hasColumnsScroll ? scrollBarWidth : 0);
(0, _common.deferUpdate)(() => {
const rowHeights = that._rowsArea.getRowsHeight();
const descriptionCellHeight = (0, _size.getOuterHeight)(descriptionCell[0], true) + (needSynchronizeFieldPanel ? rowHeights[0] : 0);
const dataAreaHeadHeight = (0, _size.getHeight)(that._dataArea.headElement());
let filterAreaHeight = 0;
let dataAreaHeight = 0;
if (that._hasHeight) {
filterAreaHeight = (0, _size.getHeight)(filterHeaderCell);
const $dataHeader = tableElement.find(".dx-data-header");
const dataHeaderHeight = (0, _size.getHeight)($dataHeader);
bordersWidth = getCommonBorderWidth([columnAreaCell, dataAreaCell, tableElement, columnHeaderCell, filterHeaderCell], "height");
dataAreaHeight = (0, _size.getHeight)(that.$element()) - filterAreaHeight - dataHeaderHeight - (Math.max(dataAreaHeadHeight, (0, _size.getHeight)(columnAreaCell), descriptionCellHeight) + bordersWidth)
}
const scrollBarWidth = that._dataArea.getScrollbarWidth();
const rowsAreaTableHeight = (0, _size.getHeight)(that._rowsArea.tableElement());
const dataAreaTableHeight = (0, _size.getHeight)(that._dataArea.tableElement());
const correctDataTableHeight = Math.max(rowsAreaTableHeight, dataAreaTableHeight - dataAreaHeadHeight);
const hasVerticalScrollbar = calculateHasScroll(dataAreaHeight, correctDataTableHeight);
that._dataArea.tableElement().css({
width: that._hasHeight && hasVerticalScrollbar && scrollBarWidth ? `calc(100% - ${scrollBarWidth}px)` : "100%"
});
const resultWidths = that._dataArea.getColumnsWidth();
const rowsAreaHeights = needSynchronizeFieldPanel ? rowHeights.slice(1) : rowHeights;
const dataAreaHeights = that._dataArea.getRowsHeight();
const columnsAreaRowCount = that._dataController.getColumnsInfo().length;
const resultHeights = (0, _m_widget_utils.mergeArraysByMaxValue)(rowsAreaHeights, dataAreaHeights.slice(columnsAreaRowCount));
const columnsAreaRowHeights = dataAreaHeights.slice(0, columnsAreaRowCount);
const columnsAreaHeight = getArraySum(columnsAreaRowHeights);
const rowsAreaColumnWidths = that._rowsArea.getColumnsWidth();
totalWidth = (0, _size.getWidth)(that._dataArea.tableElement());
totalHeight = getArraySum(resultHeights);
if (!totalWidth || !totalHeight) {
d.resolve();
return
}
rowsAreaWidth = getArraySum(rowsAreaColumnWidths);
const elementWidth = (0, _size.getWidth)(that.$element());
bordersWidth = getCommonBorderWidth([rowAreaCell, dataAreaCell, tableElement], "width");
groupWidth = elementWidth - rowsAreaWidth - bordersWidth;
groupWidth = groupWidth > 0 ? groupWidth : totalWidth;
const diff = totalWidth - groupWidth;
const needAdjustWidthOnZoom = diff >= 0 && diff <= 2;
if (needAdjustWidthOnZoom) {
adjustSizeArray(resultWidths, diff);
totalWidth = groupWidth
}
hasRowsScroll = that._hasHeight && calculateHasScroll(dataAreaHeight, totalHeight);
hasColumnsScroll = calculateHasScroll(groupWidth, totalWidth);
const groupHeight = calculateGroupHeight(dataAreaHeight, totalHeight, hasRowsScroll, hasColumnsScroll, scrollBarWidth);
(0, _common.deferRender)(() => {
that._columnsArea.tableElement().append(that._dataArea.headElement());
rowFieldsHeader.tableElement().append(that._rowsArea.headElement());
if (descriptionCellHeight > columnsAreaHeight) {
adjustSizeArray(columnsAreaRowHeights, columnsAreaHeight - descriptionCellHeight);
that._columnsArea.setRowsHeight(columnsAreaRowHeights)
}
tableElement.removeClass("dx-incompressible-fields");
columnHeaderCell.children().css("maxWidth", groupWidth);
that._columnsArea.setGroupWidth(groupWidth);
that._columnsArea.processScrollBarSpacing(hasRowsScroll ? scrollBarWidth : 0);
that._columnsArea.setColumnsWidth(resultWidths);
that._rowsArea.setGroupHeight(that._hasHeight ? groupHeight : "auto");
that._rowsArea.processScrollBarSpacing(hasColumnsScroll ? scrollBarWidth : 0);
that._rowsArea.setColumnsWidth(rowsAreaColumnWidths);
that._rowsArea.setRowsHeight(resultHeights);
that._dataArea.setColumnsWidth(resultWidths);
that._dataArea.setRowsHeight(resultHeights);
that._dataArea.setGroupWidth(groupWidth);
that._dataArea.setGroupHeight(that._hasHeight ? groupHeight : "auto");
needSynchronizeFieldPanel && rowFieldsHeader.setColumnsWidth(rowsAreaColumnWidths);
dataAreaCell.toggleClass("dx-bottom-border", !hasRowsScroll);
rowAreaCell.toggleClass("dx-bottom-border", !hasRowsScroll);
if (!that._hasHeight && elementWidth !== (0, _size.getWidth)(that.$element())) {
const diff = elementWidth - (0, _size.getWidth)(that.$element());
if (!hasColumnsScroll) {
adjustSizeArray(resultWidths, diff);
that._columnsArea.setColumnsWidth(resultWidths);
that._dataArea.setColumnsWidth(resultWidths)
}
that._dataArea.setGroupWidth(groupWidth - diff);
that._columnsArea.setGroupWidth(groupWidth - diff)
}
if (that._hasHeight && that._filterFields.isVisible() && (0, _size.getHeight)(filterHeaderCell) !== filterAreaHeight) {
const diff = (0, _size.getHeight)(filterHeaderCell) - filterAreaHeight;
if (diff > 0) {
hasRowsScroll = calculateHasScroll(dataAreaHeight - diff, totalHeight);
const groupHeight = calculateGroupHeight(dataAreaHeight - diff, totalHeight, hasRowsScroll, hasColumnsScroll, scrollBarWidth);
that._dataArea.setGroupHeight(groupHeight);
that._rowsArea.setGroupHeight(groupHeight)
}
}
const scrollingOptions = that.option("scrolling");
if ("virtual" === scrollingOptions.mode) {
that._setVirtualContentParams(scrollingOptions, resultWidths, resultHeights, groupWidth, groupHeight, that._hasHeight, rowsAreaWidth)
}
const updateScrollableResults = [];
that._dataArea.updateScrollableOptions({
direction: that._dataArea.getScrollableDirection(hasColumnsScroll, hasRowsScroll),
rtlEnabled: that.option("rtlEnabled")
});
(0, _iterator.each)([that._columnsArea, that._rowsArea, that._dataArea], (_, area) => {
updateScrollableResults.push(area && area.updateScrollable())
});
that._updateLoading();
that._renderNoDataText(dataAreaCell);
_deferred.when.apply(_renderer.default, updateScrollableResults).done(() => {
that._updateScrollPosition(that._columnsArea, that._rowsArea, that._dataArea, true);
that._subscribeToEvents(that._columnsArea, that._rowsArea, that._dataArea);
d.resolve()
})
})
});
return d
}
_setVirtualContentParams(scrollingOptions, resultWidths, resultHeights, groupWidth, groupHeight, hasHeight, rowsAreaWidth) {
const virtualContentParams = this._dataController.calculateVirtualContentParams({
virtualRowHeight: scrollingOptions.virtualRowHeight,
virtualColumnWidth: scrollingOptions.virtualColumnWidth,
itemWidths: resultWidths,
itemHeights: resultHeights,
rowCount: resultHeights.length,
columnCount: resultWidths.length,
viewportWidth: groupWidth,
viewportHeight: hasHeight ? groupHeight : (0, _size.getOuterHeight)(window)
});
this._dataArea.setVirtualContentParams({
top: virtualContentParams.contentTop,
left: virtualContentParams.contentLeft,
width: virtualContentParams.width,
height: virtualContentParams.height
});
this._rowsArea.setVirtualContentParams({
top: virtualContentParams.contentTop,
width: rowsAreaWidth,
height: virtualContentParams.height
});
this._columnsArea.setVirtualContentParams({
left: virtualContentParams.contentLeft,
width: virtualContentParams.width,
height: (0, _size.getHeight)(this._columnsArea.groupElement())
})
}
applyPartialDataSource(area, path, dataSource) {
this._dataController.applyPartialDataSource(area, path, dataSource)
}
}
exports.PivotGrid = PivotGrid;
Object.assign(PivotGrid.prototype, _m_export.ExportController);
Object.assign(PivotGrid.prototype, _m_chart_integration.ChartIntegrationMixin);
(0, _component_registrator.default)("dxPivotGrid", PivotGrid);
exports.default = {
PivotGrid: PivotGrid
}
},
12062(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateScrollbarWidth = void 0;
exports.createPath = createPath;
exports.default = void 0;
exports.discoverObjectFields = discoverObjectFields;
exports.findField = findField;
exports.foreachDataLevel = foreachDataLevel;
exports.foreachTreeAsync = exports.foreachTree = void 0;
exports.formatValue = formatValue;
exports.getCompareFunction = getCompareFunction;
exports.getExpandedLevel = getExpandedLevel;
exports.getFieldsDataType = getFieldsDataType;
exports.getFiltersByPath = getFiltersByPath;
exports.getScrollbarWidth = void 0;
exports.mergeArraysByMaxValue = mergeArraysByMaxValue;
exports.sendRequest = sendRequest;
exports.setDefaultFieldValueFormatting = setDefaultFieldValueFormatting;
exports.storeDrillDownMixin = exports.setFieldProperty = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/date */ 38662));
var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../common/data/array_store */ 80556));
var _data_source = __webpack_require__( /*! ../../../common/data/data_source/data_source */ 68216);
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 64960));
var _ajax = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/ajax */ 78670));
var _call_once = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/call_once */ 13630));
var _data = __webpack_require__( /*! ../../../core/utils/data */ 31e3);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 21274);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _format_helper = _interopRequireDefault(__webpack_require__( /*! ../../../format_helper */ 2082));
var _const = __webpack_require__( /*! ./const */ 58537);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const setFieldProperty = function(field, property, value, isInitialization) {
const initProperties = field._initProperties = field._initProperties || {};
const initValue = isInitialization ? value : field[property];
const needInitProperty = !Object.prototype.hasOwnProperty.call(initProperties, property) || isInitialization;
if (needInitProperty && "_initProperties" !== property) {
initProperties[property] = initValue
}
field[property] = value
};
exports.setFieldProperty = setFieldProperty;
function sendRequest(options) {
return _ajax.default.sendRequest(options)
}
let foreachTreeAsyncDate = new Date;
function createForeachTreeFunc(isAsync) {
const foreachTreeFunc = function(items, callback, parentAtFirst, members, index, isChildrenProcessing) {
members = members || [];
items = items || [];
let i;
let deferred;
index = index || 0;
function createForeachTreeAsyncHandler(deferred, i, isChildrenProcessing) {
(0, _deferred.when)(foreachTreeFunc(items, callback, parentAtFirst, members, i, isChildrenProcessing)).done(deferred.resolve)
}
for (i = index; i < items.length; i += 1) {
if (isAsync && i > index && i % 1e4 === 0 && new Date - foreachTreeAsyncDate >= 300) {
foreachTreeAsyncDate = new Date;
deferred = new _deferred.Deferred;
createForeachTreeAsyncHandler(deferred, i, false);
return deferred
}
const item = items[i];
if (!isChildrenProcessing) {
members.unshift(item);
if (parentAtFirst && false === callback(members, i)) {
return
}
if (item.children) {
const childrenDeferred = foreachTreeFunc(item.children, callback, parentAtFirst, members);
if (isAsync && childrenDeferred) {
deferred = new _deferred.Deferred;
childrenDeferred.done(createForeachTreeAsyncHandler(deferred, i, true));
return deferred
}
}
}
isChildrenProcessing = false;
if (!parentAtFirst && false === callback(members, i)) {
return
}
members.shift();
if (items[i] !== item) {
i -= 1
}
}
return
};
return foreachTreeFunc
}
const foreachTree = exports.foreachTree = createForeachTreeFunc(false);
const foreachTreeAsync = exports.foreachTreeAsync = createForeachTreeFunc(true);
function findField(fields, id) {
if (fields && (0, _type.isDefined)(id)) {
for (let i = 0; i < fields.length; i += 1) {
const field = fields[i];
if (field.name === id || field.caption === id || field.dataField === id || field.index === id) {
return i
}
}
}
return -1
}
function formatValue(value, options) {
const valueText = value === value && _format_helper.default.format(value, options.format);
const formatObject = {
value: value,
valueText: valueText || ""
};
return options.customizeText ? options.customizeText.call(options, formatObject) : formatObject.valueText
}
function getCompareFunction(valueSelector) {
return function(a, b) {
let result = 0;
const valueA = valueSelector(a);
const valueB = valueSelector(b);
const aIsDefined = (0, _type.isDefined)(valueA);
const bIsDefined = (0, _type.isDefined)(valueB);
if (aIsDefined && bIsDefined) {
if (valueA > valueB) {
result = 1
} else if (valueA < valueB) {
result = -1
}
}
if (aIsDefined && !bIsDefined) {
result = 1
}
if (!aIsDefined && bIsDefined) {
result = -1
}
return result
}
}
function createPath(items) {
const result = [];
for (let i = items.length - 1; i >= 0; i -= 1) {
result.push(items[i].key || items[i].value)
}
return result
}
function foreachDataLevel(data, callback, index, childrenField) {
index = index || 0;
childrenField = childrenField || "children";
if (data.length) {
callback(data, index)
}
for (let i = 0; i < data.length; i += 1) {
var _item$childrenField;
const item = data[i];
if (null !== (_item$childrenField = item[childrenField]) && void 0 !== _item$childrenField && _item$childrenField.length) {
foreachDataLevel(item[childrenField], callback, index + 1, childrenField)
}
}
}
function mergeArraysByMaxValue(values1, values2) {
const result = [];
for (let i = 0; i < values1.length; i += 1) {
result.push(Math.max(values1[i] || 0, values2[i] || 0))
}
return result
}
function getExpandedLevel(options, axisName) {
const fields = options[axisName];
const expandedPaths = ("columns" === axisName ? options.columnExpandedPaths : options.rowExpandedPaths) || [];
let expandedLevel = 0;
if (options.headerName === axisName) {
expandedLevel = options.path.length
} else if (options.headerName && options.headerName !== axisName && options.oppositePath) {
expandedLevel = options.oppositePath.length
} else {
(0, _iterator.each)(expandedPaths, (_, path) => {
expandedLevel = Math.max(expandedLevel, path.length)
})
}
while (fields[expandedLevel + 1] && fields[expandedLevel].expanded) {
expandedLevel += 1
}
return expandedLevel
}
function parseFields(dataSource, fieldsList, path, fieldsDataType) {
const result = [];
Object.keys(fieldsList || []).forEach(field => {
if (field && field.startsWith("__")) {
return
}
let dataIndex = 1;
const currentPath = path.length ? `${path}.${field}` : field;
let dataType = fieldsDataType[currentPath];
const getter = (0, _data.compileGetter)(currentPath);
let value = fieldsList[field];
let items;
while (!(0, _type.isDefined)(value) && dataSource[dataIndex]) {
value = getter(dataSource[dataIndex]);
dataIndex += 1
}
if (!dataType && (0, _type.isDefined)(value)) {
dataType = (0, _type.type)(value)
}
items = [{
dataField: currentPath,
dataType: dataType,
groupName: "date" === dataType ? field : void 0,
groupInterval: void 0,
displayFolder: path
}];
if ("date" === dataType) {
items = items.concat((item = items[0], (0, _iterator.map)(["year", "quarter", "month"], (value, index) => (0, _extend.extend)({}, item, {
groupInterval: value,
groupIndex: index
}))))
} else if ("object" === dataType) {
items = parseFields(dataSource, value, currentPath, fieldsDataType)
}
var item;
result.push.apply(result, items)
});
return result
}
function discoverObjectFields(items, fields) {
const fieldsDataType = getFieldsDataType(fields);
return parseFields(items, items[0], "", fieldsDataType)
}
function getFieldsDataType(fields) {
const result = {};
(0, _iterator.each)(fields, (_, field) => {
result[field.dataField] = result[field.dataField] || field.dataType
});
return result
}
const DATE_INTERVAL_FORMATS = {
month: value => _date.default.getMonthNames()[value - 1],
quarter: value => _date.default.format(new Date(2e3, 3 * value - 1), "quarter"),
dayOfWeek: value => _date.default.getDayNames()[value]
};
function setDefaultFieldValueFormatting(field) {
if ("date" === field.dataType) {
if (!field.format) {
setFieldProperty(field, "format", DATE_INTERVAL_FORMATS[field.groupInterval])
}
} else if ("number" === field.dataType) {
const groupInterval = (0, _type.isNumeric)(field.groupInterval) && field.groupInterval > 0 && field.groupInterval;
if (groupInterval && !field.customizeText) {
setFieldProperty(field, "customizeText", formatObject => {
const secondValue = formatObject.value + groupInterval;
const secondValueText = _format_helper.default.format(secondValue, field.format);
return formatObject.valueText && secondValueText ? `${formatObject.valueText} - ${secondValueText}` : ""
})
}
}
}
function getFiltersByPath(fields, path) {
const result = [];
path = path || [];
for (let i = 0; i < path.length; i += 1) {
result.push((0, _extend.extend)({}, fields[i], {
groupIndex: null,
groupName: null,
filterType: "include",
filterValues: [path[i]]
}))
}
return result
}
const storeDrillDownMixin = exports.storeDrillDownMixin = {
createDrillDownDataSource(descriptions, params) {
const items = this.getDrillDownItems(descriptions, params);
function createCustomStoreMethod(methodName) {
return function(options) {
let d;
if (void 0) {
d = (void 0)[methodName](options)
} else {
d = new _deferred.Deferred;
(0, _deferred.when)(items).done(data => {
const arrayStore = new _array_store.default(data);
arrayStore[methodName](options).done(d.resolve).fail(d.reject)
}).fail(d.reject)
}
return d
}
}
const dataSource = new _data_source.DataSource({
load: createCustomStoreMethod("load"),
totalCount: createCustomStoreMethod("totalCount"),
key: this.key()
});
return dataSource
}
};
const getScrollbarWidth = containerElement => containerElement.offsetWidth - containerElement.clientWidth;
exports.getScrollbarWidth = getScrollbarWidth;
const calculateScrollbarWidth = exports.calculateScrollbarWidth = (0, _call_once.default)(() => {
const document = _dom_adapter.default.getDocument();
document.body.insertAdjacentHTML("beforeend", ``);
const scrollbar = document.body.lastElementChild;
const scrollbarWidth = getScrollbarWidth(scrollbar);
if (scrollbar) {
document.body.removeChild(scrollbar)
}
return scrollbarWidth
});
exports.default = {
setFieldProperty: setFieldProperty,
sendRequest: sendRequest,
foreachTree: foreachTree,
foreachTreeAsync: foreachTreeAsync,
findField: findField,
formatValue: formatValue,
getCompareFunction: getCompareFunction,
createPath: createPath,
foreachDataLevel: foreachDataLevel,
mergeArraysByMaxValue: mergeArraysByMaxValue,
getExpandedLevel: getExpandedLevel,
discoverObjectFields: discoverObjectFields,
getFieldsDataType: getFieldsDataType,
setDefaultFieldValueFormatting: setDefaultFieldValueFormatting,
getFiltersByPath: getFiltersByPath,
storeDrillDownMixin: storeDrillDownMixin,
getScrollbarWidth: getScrollbarWidth,
calculateScrollbarWidth: calculateScrollbarWidth
}
},
81383(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.RemoteStore = void 0;
var _data_source = __webpack_require__( /*! ../../../../common/data/data_source/data_source */ 68216);
var _utils = __webpack_require__( /*! ../../../../common/data/data_source/utils */ 97169);
var _date_serialization = (e = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 71051), e && e.__esModule ? e : {
default: e
});
var e;
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 21274);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _capitalize = __webpack_require__( /*! ../../../core/utils/capitalize */ 72928);
var _m_widget_utils = function(e, t) {
if ("function" == typeof WeakMap) {
var r = new WeakMap,
n = new WeakMap
}
return function(e, t) {
if (!t && e && e.__esModule) {
return e
}
var o, i, f = {
__proto__: null,
default: e
};
if (null === e || "object" != typeof e && "function" != typeof e) {
return f
}
if (o = t ? n : r) {
if (o.has(e)) {
return o.get(e)
}
o.set(e, f)
}
for (const t in e) {
"default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t])
}
return f
}(e, t)
}(__webpack_require__( /*! ../m_widget_utils */ 12062));
var _m_remote_store_utils = __webpack_require__( /*! ./m_remote_store_utils */ 84265);
function createGroupingOptions(fields, useSortOrder) {
const groupingOptions = [];
(0, _iterator.each)(fields, (index, field) => {
groupingOptions.push({
selector: field.dataField,
groupInterval: field.groupInterval,
desc: useSortOrder && "desc" === field.sortOrder,
isExpanded: index < fields.length - 1
})
});
return groupingOptions
}
function getIntervalFilterExpression(selector, numericInterval, numericValue, isExcludedFilterType) {
const startFilterValue = [selector, isExcludedFilterType ? "<" : ">=", numericValue];
const endFilterValue = [selector, isExcludedFilterType ? ">=" : "<", numericValue + numericInterval];
return [startFilterValue, isExcludedFilterType ? "or" : "and", endFilterValue]
}
function getFilterExpressionForFilterValue(field, filterValue, filterType) {
const selector = function(field) {
let selector = field.dataField;
let {
groupInterval: groupInterval
} = field;
if ("date" === field.dataType && "string" === typeof groupInterval) {
if ("quarter" === groupInterval.toLowerCase()) {
groupInterval = "Month"
}
selector = `${selector}.${(0,_capitalize.capitalize)(groupInterval)}`
}
return selector
}(field);
const isExcludedFilterType = "exclude" === (filterType || field.filterType);
let expression = [selector, isExcludedFilterType ? "<>" : "=", filterValue];
if ((0, _type.isDefined)(field.groupInterval)) {
if ("string" === typeof field.groupInterval && "quarter" === field.groupInterval.toLowerCase()) {
expression = getIntervalFilterExpression(selector, 3, 3 * (filterValue - 1) + 1, isExcludedFilterType)
} else if ("number" === typeof field.groupInterval && "date" !== field.dataType) {
expression = getIntervalFilterExpression(selector, field.groupInterval, filterValue, isExcludedFilterType)
}
}
return expression
}
function createFieldFilterExpressions(field, operation) {
const fieldFilterExpressions = [];
if (field.searchValue) {
return [field.dataField, "contains", field.searchValue]
}
if ("exclude" === field.filterType) {
operation = operation || "and"
} else {
operation = operation || "or"
}(0, _iterator.each)(field.filterValues, (index, filterValue) => {
let currentExpression = [];
if (Array.isArray(filterValue)) {
var _field$levels;
const parseLevelsRecursive = null === (_field$levels = field.levels) || void 0 === _field$levels ? void 0 : _field$levels.length;
if (parseLevelsRecursive) {
currentExpression = createFieldFilterExpressions({
filterValues: filterValue,
filterType: field.filterType,
levels: field.levels
}, "and")
}
} else {
const currentField = field.levels ? field.levels[index] : field;
currentExpression = getFilterExpressionForFilterValue(currentField, filterValue)
}
if (!currentExpression.length) {
return
}
if (fieldFilterExpressions.length) {
fieldFilterExpressions.push(operation)
}
fieldFilterExpressions.push(currentExpression)
});
return fieldFilterExpressions
}
function createFilterExpressions(fields) {
let filterExpressions = [];
(0, _iterator.each)(fields, (_, field) => {
const fieldExpressions = createFieldFilterExpressions(field);
if (!fieldExpressions.length) {
return []
}
if (filterExpressions.length) {
filterExpressions.push("and")
}
filterExpressions.push(fieldExpressions);
return
});
if (1 === filterExpressions.length) {
filterExpressions = filterExpressions[0]
}
return filterExpressions
}
function mergeFilters(filters) {
let op = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "and";
const result = [];
(0, _iterator.each)(filters, (_, filter) => {
if ((filter => !!(null !== filter && void 0 !== filter && filter.length))(filter)) {
result.push(filter, op)
}
});
result.pop();
if (1 === result.length) {
return result[0]
}
return result
}
function setValue(valuesArray, value, rowIndex, columnIndex, dataIndex) {
valuesArray[rowIndex] = valuesArray[rowIndex] || [];
valuesArray[rowIndex][columnIndex] = valuesArray[rowIndex][columnIndex] || [];
if (!(0, _type.isDefined)(valuesArray[rowIndex][columnIndex][dataIndex])) {
valuesArray[rowIndex][columnIndex][dataIndex] = value
}
}
function parseValue(value, field) {
if (field && "number" === field.dataType && (0, _type.isString)(value)) {
return Number(value)
}
if (field && "date" === field.dataType && !field.groupInterval && !(value instanceof Date)) {
return _date_serialization.default.deserializeDate(value)
}
return value
}
function getFiltersForDimension(fields) {
return (null === fields || void 0 === fields ? void 0 : fields.filter(f => {
var _f$filterValues;
return (null === (_f$filterValues = f.filterValues) || void 0 === _f$filterValues ? void 0 : _f$filterValues.length) || f.searchValue
})) || []
}
function getExpandedIndex(options, axis) {
if (options.headerName) {
if (axis === options.headerName) {
return options.path.length
}
if (options.oppositePath) {
return options.oppositePath.length
}
}
return 0
}
function getFirstCollapsedIndex(fields) {
for (let index = 0; index < fields.length; index += 1) {
if (!fields[index].expanded) {
return index
}
}
return 0
}
function getExpandedPathsFilterExprByLevel(options, axis, level) {
if (options.headerName === axis) {
return []
}
const firstCollapsedFieldIndex = "rows" === axis ? getFirstCollapsedIndex(options.rows) : getFirstCollapsedIndex(options.columns);
const startFieldIndex = level <= firstCollapsedFieldIndex ? firstCollapsedFieldIndex : 0;
const fields = options[axis].slice(startFieldIndex, level);
const paths = ("rows" === axis ? options.rowExpandedPaths : options.columnExpandedPaths) || [];
let result = [];
(0, _iterator.each)(paths, (_, path) => {
path = path.slice(startFieldIndex);
if (!((fields, path) => {
if (path.length > level) {
return false
}
let expandedLevel = path.length;
while (null !== (_fields$expandedLevel = fields[expandedLevel]) && void 0 !== _fields$expandedLevel && _fields$expandedLevel.expanded) {
var _fields$expandedLevel;
expandedLevel += 1
}
return expandedLevel >= level
})(fields, path)) {
return
}
const filters = [];
for (let i = 0; i < path.length; i += 1) {
const field = fields[i];
if (!(0, _type.isDefined)(field)) {
break
}
const fieldFilterExpression = getFilterExpressionForFilterValue(field, path[i], "include");
filters.push(fieldFilterExpression)
}
const pathFilterExpression = mergeFilters(filters);
result.push(pathFilterExpression)
});
result = mergeFilters(result, "or");
return result
}
function getGrandTotalRequest(options, dimensionName, commonFilters) {
const expandedIndex = getExpandedIndex(options, dimensionName);
const expandedLevel = (0, _m_widget_utils.getExpandedLevel)(options, dimensionName);
const expandedPaths = ("columns" === dimensionName ? options.columnExpandedPaths : options.rowExpandedPaths) || [];
const oppositeDimensionName = "columns" === dimensionName ? "rows" : "columns";
const fields = options[dimensionName];
const result = [];
if (expandedPaths.length) {
for (let i = expandedIndex; i <= expandedLevel; i += 1) {
const slicedFields = fields.slice(expandedIndex, i + 1);
const filterExpr = getExpandedPathsFilterExprByLevel(options, dimensionName, i);
const grandTotalOptions = {
filters: commonFilters,
filterExpression: filterExpr,
[dimensionName]: slicedFields,
[oppositeDimensionName]: []
};
result.push((0, _extend.extend)({}, options, grandTotalOptions))
}
} else {
const slicedFields = fields.slice(expandedIndex, expandedLevel + 1);
const grandTotalOptions = {
filters: commonFilters,
[dimensionName]: slicedFields,
[oppositeDimensionName]: []
};
result.push((0, _extend.extend)({}, options, grandTotalOptions))
}
result[0].includeTotalSummary = true;
return result
}
function createRequestsOptions(options) {
const rowExpandedIndex = getExpandedIndex(options, "rows");
const rowExpandedLevel = (0, _m_widget_utils.getExpandedLevel)(options, "rows");
const columnExpandedIndex = getExpandedIndex(options, "columns");
const columnExpandedLevel = (0, _m_widget_utils.getExpandedLevel)(options, "columns");
const requestsOptions = [];
const commonFilters = (options.filters || []).concat(getFiltersForDimension(options.rows), getFiltersForDimension(options.columns), function(options) {
const oppositeAxis = "rows" === options.headerName ? "columns" : "rows";
const fields = options[options.headerName];
const oppositeFields = options[oppositeAxis];
const filters = (0, _m_widget_utils.getFiltersByPath)(fields, options.path);
const oppositeFieldsFilters = (0, _m_widget_utils.getFiltersByPath)(oppositeFields, options.oppositePath || []);
return filters.concat(oppositeFieldsFilters)
}(options));
const columnTotalsOptions = getGrandTotalRequest(options, "columns", commonFilters);
const rowTotalsOptions = getGrandTotalRequest(options, "rows", commonFilters);
if (options.rows.length && options.columns.length) {
if ("rows" !== options.headerName) {
requestsOptions.push(...columnTotalsOptions)
}
for (let i = rowExpandedIndex; i <= rowExpandedLevel; i += 1) {
const rows = options.rows.slice(rowExpandedIndex, i + 1);
const rowsFilterExpr = getExpandedPathsFilterExprByLevel(options, "rows", i);
for (let j = columnExpandedIndex; j <= columnExpandedLevel; j += 1) {
const columns = options.columns.slice(columnExpandedIndex, j + 1);
const columnsFilterExpr = getExpandedPathsFilterExprByLevel(options, "columns", j);
const filterExpression = mergeFilters([rowsFilterExpr, columnsFilterExpr]);
const requestOptions = (0, _extend.extend)({}, options, {
columns: columns,
rows: rows,
filters: commonFilters,
filterExpression: filterExpression
});
requestsOptions.push(requestOptions)
}
}
} else {
const totalOptions = options.columns.length ? columnTotalsOptions : rowTotalsOptions;
requestsOptions.push(...totalOptions)
}
return requestsOptions
}
function prepareFields(fields) {
(0, _iterator.each)(fields || [], (_, field) => {
const {
levels: levels
} = field;
if (levels) {
prepareFields(levels)
}(0, _m_widget_utils.setDefaultFieldValueFormatting)(field)
})
}
class RemoteStore {
constructor(options) {
this._dataSource = new _data_source.DataSource(options);
this._store = this._dataSource.store()
}
getFields(fields) {
const d = new _deferred.Deferred;
this._store.load({
skip: 0,
take: 20
}).done(data => {
const normalizedArguments = (0, _utils.normalizeLoadResult)(data);
d.resolve(_m_widget_utils.default.discoverObjectFields(normalizedArguments.data, fields))
}).fail(d.reject);
return d
}
key() {
return this._store.key()
}
load(options) {
const that = this;
const d = new _deferred.Deferred;
const result = {
rows: [],
columns: [],
values: [],
grandTotalRowIndex: 0,
grandTotalColumnIndex: 0,
rowHash: {},
columnHash: {},
rowIndex: 1,
columnIndex: 1
};
const requestsOptions = createRequestsOptions(options);
const deferreds = [];
prepareFields(options.rows);
prepareFields(options.columns);
prepareFields(options.filters);
(0, _iterator.each)(requestsOptions, (_, requestOptions) => {
const loadOptions = function(options, externalFilterExpr, hasRows) {
const loadOptions = {
groupSummary: [],
totalSummary: []
};
const rowGroupingOptions = createGroupingOptions(options.rows, options.rowTake);
const columnGroupingOptions = createGroupingOptions(options.columns, options.columnTake);
const groupingOptions = [...rowGroupingOptions, ...columnGroupingOptions];
if (groupingOptions.length) {
loadOptions.group = groupingOptions;
loadOptions.take = void 0
} else {
loadOptions.group = void 0;
loadOptions.take = 1
}
if (options.rows.length && options.rowTake) {
loadOptions.skip = options.rowSkip;
loadOptions.take = options.rowTake;
loadOptions.requireGroupCount = true
} else if (options.columns.length && options.columnTake && !hasRows) {
loadOptions.skip = options.columnSkip;
loadOptions.take = options.columnTake;
loadOptions.requireGroupCount = true
}
let filterExpressions = createFilterExpressions(options.filters);
filterExpressions = externalFilterExpr ? mergeFilters([filterExpressions, options.filterExpression, externalFilterExpr]) : mergeFilters([filterExpressions, options.filterExpression]);
if (filterExpressions.length) {
loadOptions.filter = filterExpressions
}(0, _iterator.each)(options.values, (_, value) => {
const summaryOption = {
selector: value.dataField,
summaryType: value.summaryType || "count"
};
loadOptions.groupSummary.push(summaryOption);
options.includeTotalSummary && loadOptions.totalSummary.push(summaryOption)
});
return loadOptions
}(requestOptions, that.filter(), options.rows.length);
const loadDeferred = that._store.load(loadOptions);
deferreds.push(loadDeferred)
});
_deferred.when.apply(null, deferreds).done(function() {
const args = deferreds.length > 1 ? arguments : [arguments];
(0, _iterator.each)(args, (index, argument) => {
const normalizedArguments = (0, _utils.normalizeLoadResult)(argument[0], argument[1]);
! function(data, total, descriptions, result) {
const rowPath = [];
let columnPath = [];
const {
rowHash: rowHash
} = result;
const {
columnHash: columnHash
} = result;
if (null !== total && void 0 !== total && total.summary) {
(0, _iterator.each)(total.summary, (index, summary) => {
setValue(result.values, summary, result.grandTotalRowIndex, result.grandTotalColumnIndex, index)
})
}
if (total && total.groupCount >= 0) {
const skip = descriptions.rows.length ? descriptions.rowSkip : descriptions.columnSkip;
data = [...Array(skip)].concat(data);
data.length = total.groupCount
}
function getItem(dataItem, dimensionName, path, level, field) {
const dimensionHash = result[`${dimensionName}Hash`];
let parentItem;
let parentItemChildren;
let item;
const pathValue = path.slice(0, level + 1).join("/");
let parentPathValue;
if (void 0 !== dimensionHash[pathValue]) {
item = dimensionHash[pathValue]
} else {
item = {
value: parseValue(dataItem.key, field),
index: result[`${dimensionName}Index`]++,
displayText: dataItem.displayText
};
parentPathValue = path.slice(0, level).join("/");
if (level > 0 && void 0 !== dimensionHash[parentPathValue]) {
parentItem = dimensionHash[parentPathValue];
parentItemChildren = parentItem.children = parentItem.children || []
} else {
parentItemChildren = result[`${dimensionName}s`]
}
parentItemChildren.push(item);
dimensionHash[pathValue] = item
}
return item
}(0, _m_remote_store_utils.forEachGroup)(data, (item, level) => {
var _rowItem, _columnItem;
const rowLevel = level >= descriptions.rows.length ? descriptions.rows.length : level;
const columnLevel = level >= descriptions.rows.length ? level - descriptions.rows.length : 0;
let columnItem;
let rowItem;
if (level >= descriptions.rows.length && columnLevel >= descriptions.columns.length) {
return
}
if (level < descriptions.rows.length) {
columnPath = []
}
if (level >= descriptions.rows.length) {
if (item) {
columnPath[columnLevel] = `${item.key}`;
columnItem = getItem(item, "column", columnPath, columnLevel, descriptions.columns[columnLevel]);
rowItem = rowHash[rowPath.slice(0, rowLevel + 1).join("/")]
} else {
result.columns.push({})
}
} else if (item) {
rowPath[rowLevel] = `${item.key}`;
rowItem = getItem(item, "row", rowPath, rowLevel, descriptions.rows[rowLevel]);
columnItem = columnHash[columnPath.slice(0, columnLevel + 1).join("/")]
} else {
result.rows.push({})
}
const currentRowIndex = (null === (_rowItem = rowItem) || void 0 === _rowItem ? void 0 : _rowItem.index) || result.grandTotalRowIndex;
const currentColumnIndex = (null === (_columnItem = columnItem) || void 0 === _columnItem ? void 0 : _columnItem.index) || result.grandTotalColumnIndex;
(0, _iterator.each)((null === item || void 0 === item ? void 0 : item.summary) || [], (i, summary) => {
setValue(result.values, summary, currentRowIndex, currentColumnIndex, i)
})
});
return result
}(normalizedArguments.data, normalizedArguments.extra, requestsOptions[index], result)
});
d.resolve({
rows: result.rows,
columns: result.columns,
values: result.values,
grandTotalRowIndex: result.grandTotalRowIndex,
grandTotalColumnIndex: result.grandTotalColumnIndex
})
}).fail(d.reject);
return d
}
filter() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key]
}
return this._dataSource.filter.apply(this._dataSource, args)
}
supportPaging() {
return false
}
createDrillDownDataSource(loadOptions, params) {
loadOptions = loadOptions || {};
params = params || {};
const store = this._store;
const filters = (0, _m_widget_utils.getFiltersByPath)(loadOptions.rows, params.rowPath).concat((0, _m_widget_utils.getFiltersByPath)(loadOptions.columns, params.columnPath)).concat(getFiltersForDimension(loadOptions.rows)).concat(loadOptions.filters || []).concat(getFiltersForDimension(loadOptions.columns));
const filterExp = createFilterExpressions(filters);
return new _data_source.DataSource({
load(loadOptions) {
const filter = mergeFilters([filterExp, loadOptions.filter]);
const extendedLoadOptions = (0, _extend.extend)({}, loadOptions, {
filter: 0 === filter.length ? void 0 : filter,
select: params.customColumns
});
return store.load(extendedLoadOptions)
}
})
}
}
exports.RemoteStore = RemoteStore;
exports.default = {
RemoteStore: RemoteStore
}
},
84265(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.forEachGroup = exports.default = void 0;
const forEachGroup = function(data, callback, level) {
data = data || [];
level = level || 0;
for (let i = 0; i < data.length; i += 1) {
const group = data[i];
callback(group, level);
if (group && group.items && group.items.length) {
forEachGroup(group.items, callback, level + 1)
}
}
};
exports.forEachGroup = forEachGroup;
exports.default = {
forEachGroup: forEachGroup
}
},
87691(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.Sortable = void 0;
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/events/core/events_engine */ 92774));
var _drag = __webpack_require__( /*! ../../../../common/core/events/drag */ 59144);
var _index = __webpack_require__( /*! ../../../../common/core/events/utils/index */ 98834);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../../core/component_registrator */ 92848));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 64960));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 64553));
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 21274);
var _size = __webpack_require__( /*! ../../../../core/utils/size */ 57653);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _swatch_container = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/swatch_container */ 40954));
var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../../core/widget/dom_component */ 22331));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const {
getSwatchContainer: getSwatchContainer
} = _swatch_container.default;
function checkHorizontalPosition(position, itemOffset, rtl) {
if ((0, _type.isDefined)(itemOffset.posHorizontal)) {
return rtl ? position > itemOffset.posHorizontal : position < itemOffset.posHorizontal
}
return true
}
function getTargetGroup(e, $groups) {
let result;
(0, _iterator.each)($groups, function() {
if (function(element, x, y) {
const $item = (0, _renderer.default)(element);
const offset = $item.offset();
if (x >= offset.left && x <= offset.left + (0, _size.getOuterWidth)($item, true)) {
if (y >= offset.top && y <= offset.top + (0, _size.getOuterHeight)($item, true)) {
return true
}
}
return
}(this, e.pageX, e.pageY)) {
result = (0, _renderer.default)(this)
}
});
return result
}
class Sortable extends _dom_component.default {
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
onChanged: null,
onDragging: null,
itemRender: null,
groupSelector: null,
itemSelector: ".dx-sort-item",
itemContainerSelector: ".dx-sortable-old",
sourceClass: "dx-drag-source",
dragClass: "dx-drag",
targetClass: "dx-drag-target",
direction: "vertical",
allowDragging: true,
groupFilter: null,
useIndicator: false
})
}
_renderItem($sourceItem, target) {
const itemRender = this.option("itemRender");
let $item;
if (itemRender) {
$item = itemRender($sourceItem, target)
} else {
$item = $sourceItem.clone();
$item.css({
width: (0, _size.getWidth)($sourceItem),
height: (0, _size.getHeight)($sourceItem)
})
}
return $item
}
_renderIndicator($item, isVertical, $targetGroup, isLast) {
const height = (0, _size.getOuterHeight)($item, true);
const width = (0, _size.getOuterWidth)($item, true);
const top = $item.offset().top - $targetGroup.offset().top;
const left = $item.offset().left - $targetGroup.offset().left;
this._indicator.css({
position: "absolute",
top: isLast && isVertical ? top + height : top,
left: isLast && !isVertical ? left + width : left
}).toggleClass("dx-position-indicator-horizontal", !isVertical).toggleClass("dx-position-indicator-vertical", !!isVertical).toggleClass("dx-position-indicator-last", !!isLast).appendTo($targetGroup);
(0, _size.setHeight)(this._indicator, "");
(0, _size.setWidth)(this._indicator, "");
if (isVertical) {
(0, _size.setWidth)(this._indicator, width)
} else {
(0, _size.setHeight)(this._indicator, height)
}
}
_renderDraggable($sourceItem) {
this._$draggable && this._$draggable.remove();
this._$draggable = this._renderItem($sourceItem, "drag").addClass(this.option("dragClass")).appendTo(getSwatchContainer($sourceItem)).css({
zIndex: 1e6,
position: "absolute"
})
}
_detachEventHandlers() {
const dragEventsString = [_drag.move, _drag.start, _drag.end, _drag.enter, _drag.leave, _drag.drop].join(" ");
_events_engine.default.off(this._getEventListener(), (0, _index.addNamespace)(dragEventsString, "dxSortable"), void 0)
}
_getItemOffset(isVertical, itemsOffset, e) {
for (let i = 0; i < itemsOffset.length; i += 1) {
let shouldInsert;
const sameLine = e.pageY < itemsOffset[i].posVertical;
if (isVertical) {
shouldInsert = sameLine
} else if (sameLine) {
shouldInsert = checkHorizontalPosition(e.pageX, itemsOffset[i], this.option("rtlEnabled"));
if (!shouldInsert && itemsOffset[i + 1] && itemsOffset[i + 1].posVertical > itemsOffset[i].posVertical) {
shouldInsert = true
}
}
if (shouldInsert) {
return itemsOffset[i]
}
}
return
}
_getEventListener() {
const groupSelector = this.option("groupSelector");
const element = this.$element();
return groupSelector ? element.find(groupSelector) : element
}
_attachEventHandlers() {
const that = this;
const itemSelector = that.option("itemSelector");
const itemContainerSelector = that.option("itemContainerSelector");
const groupSelector = that.option("groupSelector");
const sourceClass = that.option("sourceClass");
const targetClass = that.option("targetClass");
const onDragging = that.option("onDragging");
const groupFilter = that.option("groupFilter");
let $sourceItem;
let sourceIndex;
let $targetItem;
let $targetGroup;
let startPositions;
let sourceGroup;
const element = that.$element();
let $groups;
let scrollWrapper = null;
let targetIndex = -1;
const disposeScrollWrapper = function() {
var _scrollWrapper;
null === (_scrollWrapper = scrollWrapper) || void 0 === _scrollWrapper || _scrollWrapper.dispose();
scrollWrapper = null
};
that._detachEventHandlers();
if (that.option("allowDragging")) {
const $eventListener = that._getEventListener();
_events_engine.default.on($eventListener, (0, _index.addNamespace)(_drag.start, "dxSortable"), itemSelector, e => {
$sourceItem = (0, _renderer.default)(e.currentTarget);
const $sourceGroup = $sourceItem.closest(groupSelector);
sourceGroup = $sourceGroup.attr("group");
sourceIndex = function($items, $item) {
let index = -1;
const itemElement = $item.get(0);
(0, _iterator.each)($items, (elementIndex, element) => {
const $element = (0, _renderer.default)(element);
if (!($element.attr("item-group") && $element.attr("item-group") === $items.eq(elementIndex - 1).attr("item-group"))) {
index += 1
}
if (element === itemElement) {
return false
}
return
});
return index === $items.length ? -1 : index
}((groupSelector ? $sourceGroup : element).find(itemSelector), $sourceItem);
if ($sourceItem.attr("item-group")) {
$sourceItem = $sourceGroup.find(`[item-group='${$sourceItem.attr("item-group")}']`)
}
that._renderDraggable($sourceItem);
$targetItem = that._renderItem($sourceItem, "target").addClass(targetClass);
$sourceItem.addClass(sourceClass);
! function() {
startPositions = [];
(0, _iterator.each)($sourceItem, (_, item) => {
startPositions.push((0, _renderer.default)(item).offset())
})
}();
$groups = function() {
const root = _dom_adapter.default.getRootNode(that.$element().get(0));
if (!groupSelector) {
return element
}
return groupFilter ? (0, _renderer.default)(root).find(groupSelector).filter(groupFilter) : element.find(groupSelector)
}();
that._indicator = (0, _renderer.default)("").addClass("dx-position-indicator")
});
_events_engine.default.on($eventListener, (0, _index.addNamespace)(_drag.move, "dxSortable"), e => {
let $item;
let $lastItem;
let $prevItem;
if (!$sourceItem) {
return
}
targetIndex = -1;
that._indicator.detach();
(0, _iterator.each)(that._$draggable, (index, draggableElement) => {
(0, _renderer.default)(draggableElement).css({
top: startPositions[index].top + e.offset.y,
left: startPositions[index].left + e.offset.x
})
});
$targetGroup && $targetGroup.removeClass(targetClass);
$targetGroup = getTargetGroup(e, $groups);
$targetGroup && function() {
const draggingArgs = {
sourceGroup: sourceGroup,
sourceIndex: sourceIndex,
sourceElement: $sourceItem,
targetGroup: $targetGroup.attr("group"),
targetIndex: $targetGroup.find(itemSelector).index($targetItem)
};
onDragging && onDragging(draggingArgs);
if (draggingArgs.cancel) {
$targetGroup = void 0
}
}();
if ($targetGroup && scrollWrapper && $targetGroup.get(0) !== scrollWrapper.element().get(0)) {
disposeScrollWrapper()
}
scrollWrapper && scrollWrapper.moveIfNeed(e);
if (!$targetGroup) {
$targetItem.detach();
return
}
if (!scrollWrapper && $targetGroup.attr("allow-scrolling")) {
scrollWrapper = function(scrollable) {
let timeout;
let scrollTop = scrollable.scrollTop();
const $element = scrollable.$element();
const {
top: top
} = $element.offset();
const height = (0, _size.getHeight)($element);
let delta = 0;
function onScroll(e) {
scrollTop = e.scrollOffset.top
}
scrollable.on("scroll", onScroll);
function move() {
stop();
scrollable.scrollTo(scrollTop += delta);
timeout = setTimeout(move, 10)
}
function stop() {
clearTimeout(timeout)
}
return {
moveIfNeed: function(event) {
if (event.pageY <= top + 20) {
delta = -2
} else if (event.pageY >= top + height - 20) {
delta = 2
} else {
delta = 0;
stop();
return
}
move()
},
element: () => $element,
dispose() {
stop();
scrollable.off("scroll", onScroll)
}
}
}($targetGroup.dxScrollable("instance"))
}
$targetGroup.addClass(targetClass);
const $itemContainer = $targetGroup.find(itemContainerSelector);
const $items = $itemContainer.find(itemSelector);
const targetSortable = $targetGroup.closest(".dx-sortable-old").data("dxSortableOld");
const useIndicator = targetSortable.option("useIndicator");
const isVertical = "vertical" === (targetSortable || that).option("direction");
const itemsOffset = function($elements, isVertical, $itemsContainer) {
const result = [];
let $item = [];
for (let i = 0; i < $elements.length; i += $item.length) {
$item = $elements.eq(i);
if ($item.attr("item-group")) {
$item = $itemsContainer.find(`[item-group='${$item.attr("item-group")}']`)
}
if ($item.is(":visible")) {
const offset = {
item: $item,
index: result.length,
posVertical: isVertical ? ($item.last().offset().top + $item.offset().top + (0, _size.getOuterHeight)($item.last(), true)) / 2 : (0, _size.getOuterHeight)($item.last(), true) + $item.last().offset().top,
posHorizontal: isVertical ? void 0 : ((0, _size.getOuterWidth)($item.last(), true) + $item.last().offset().left + $item.offset().left) / 2
};
result.push(offset)
}
}
return result
}($items, isVertical, $itemContainer);
const itemOffset = that._getItemOffset(isVertical, itemsOffset, e);
if (itemOffset) {
$item = itemOffset.item;
$prevItem = itemsOffset[itemOffset.index - 1] && itemsOffset[itemOffset.index - 1].item;
if ($item.hasClass(sourceClass) || $prevItem && $prevItem.hasClass(sourceClass) && $prevItem.is(":visible")) {
$targetItem.detach();
return
}
targetIndex = itemOffset.index;
if (!useIndicator) {
$targetItem.insertBefore($item);
return
}
const isAnotherGroup = $targetGroup.attr("group") !== sourceGroup;
const isSameIndex = targetIndex === sourceIndex;
const isNextIndex = targetIndex === sourceIndex + 1;
if (isAnotherGroup) {
that._renderIndicator($item, isVertical, $targetGroup, that.option("rtlEnabled") && !isVertical);
return
}
if (!isSameIndex && !isNextIndex) {
that._renderIndicator($item, isVertical, $targetGroup, that.option("rtlEnabled") && !isVertical)
}
} else {
$lastItem = $items.last();
if ($lastItem.is(":visible") && $lastItem.hasClass(sourceClass)) {
return
}
if ($itemContainer.length) {
targetIndex = itemsOffset.length ? itemsOffset[itemsOffset.length - 1].index + 1 : 0
}
if (useIndicator) {
$items.length && that._renderIndicator($lastItem, isVertical, $targetGroup, !that.option("rtlEnabled") || isVertical)
} else {
$targetItem.appendTo($itemContainer)
}
}
});
_events_engine.default.on($eventListener, (0, _index.addNamespace)(_drag.end, "dxSortable"), () => {
disposeScrollWrapper();
if (!$sourceItem) {
return
}
const onChanged = that.option("onChanged");
const changedArgs = {
sourceIndex: sourceIndex,
sourceElement: $sourceItem,
sourceGroup: sourceGroup,
targetIndex: targetIndex,
removeSourceElement: true,
removeTargetElement: false,
removeSourceClass: true
};
if ($targetGroup) {
$targetGroup.removeClass(targetClass);
changedArgs.targetGroup = $targetGroup.attr("group");
if (sourceGroup !== changedArgs.targetGroup || targetIndex > -1) {
onChanged && onChanged(changedArgs);
changedArgs.removeSourceElement && $sourceItem.remove()
}
}
that._indicator.detach();
changedArgs.removeSourceClass && $sourceItem.removeClass(sourceClass);
$sourceItem = null;
that._$draggable.remove();
that._$draggable = null;
changedArgs.removeTargetElement && $targetItem.remove();
$targetItem.removeClass(targetClass);
$targetItem = null
})
}
}
_init() {
super._init();
this._attachEventHandlers()
}
_render() {
super._render();
this.$element().addClass("dx-sortable-old")
}
_dispose() {
super._dispose();
this._$draggable && this._$draggable.detach();
this._indicator && this._indicator.detach()
}
_optionChanged(args) {
const that = this;
switch (args.name) {
case "onDragging":
case "onChanged":
case "itemRender":
case "groupSelector":
case "itemSelector":
case "itemContainerSelector":
case "sourceClass":
case "targetClass":
case "dragClass":
case "allowDragging":
case "groupFilter":
case "useIndicator":
that._attachEventHandlers();
break;
case "direction":
break;
default:
super._optionChanged(args)
}
}
_useTemplates() {
return false
}
}
exports.Sortable = Sortable;
(0, _component_registrator.default)("dxSortableOld", Sortable);
exports.default = {
Sortable: Sortable
}
},
81221(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Cell = void 0;
exports.applyDisplaySummaryMode = applyDisplaySummaryMode;
exports.applyRunningTotal = applyRunningTotal;
exports.createMockSummaryCell = createMockSummaryCell;
exports.default = void 0;
exports.getExpression = getExpression;
exports.summaryDictionary = void 0;
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _m_widget_utils = function(e, t) {
if ("function" == typeof WeakMap) {
var r = new WeakMap,
n = new WeakMap
}
return function(e, t) {
if (!t && e && e.__esModule) {
return e
}
var o, i, f = {
__proto__: null,
default: e
};
if (null === e || "object" != typeof e && "function" != typeof e) {
return f
}
if (o = t ? n : r) {
if (o.has(e)) {
return o.get(e)
}
o.set(e, f)
}
for (const t in e) {
"default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t])
}
return f
}(e, t)
}(__webpack_require__( /*! ../m_widget_utils */ 12062));
const ROW = "row";
const calculatePercentValue = function(value, totalValue) {
let result = value / totalValue;
if (!(0, _type.isDefined)(value) || isNaN(result)) {
result = null
}
return result
};
const percentOfGrandTotal = function(e, dimension) {
return calculatePercentValue(e.value(), e.grandTotal(dimension).value())
};
const percentOfParent = function(e, dimension) {
const parent = e.parent(dimension);
const parentValue = parent ? parent.value() : e.value();
return calculatePercentValue(e.value(), parentValue)
};
const createAbsoluteVariationExp = function(allowCrossGroup) {
return function(e) {
const prevCell = e.prev("column", allowCrossGroup);
const prevValue = prevCell && prevCell.value();
if ((0, _type.isDefined)(prevValue) && (0, _type.isDefined)(e.value())) {
return e.value() - prevValue
}
return null
}
};
const summaryDictionary = exports.summaryDictionary = {
percentOfColumnTotal: e => percentOfParent(e, ROW),
percentOfRowTotal: e => percentOfParent(e, "column"),
percentOfColumnGrandTotal: e => percentOfGrandTotal(e, ROW),
percentOfRowGrandTotal: e => percentOfGrandTotal(e, "column"),
percentOfGrandTotal: e => percentOfGrandTotal(e)
};
const getPrevCellCrossGroup = function(cell, direction) {
if (!cell || !cell.parent(direction)) {
return
}
let prevCell = cell.prev(direction);
if (!prevCell) {
prevCell = getPrevCellCrossGroup(cell.parent(direction), direction)
}
return prevCell
};
const createRunningTotalExpr = field => {
if (!field.runningTotal) {
return
}
const direction = "column" === field.runningTotal ? ROW : "column";
return e => {
const prevCell = field.allowCrossGroupCalculation ? getPrevCellCrossGroup(e, direction) : e.prev(direction, false);
const calculatedValue = e.value(true);
const originalValue = e.value(false);
const prevCalculatedValue = null === prevCell || void 0 === prevCell ? void 0 : prevCell.value(true);
switch (true) {
case (0, _type.isDefined)(calculatedValue) && (0, _type.isDefined)(originalValue) && (0, _type.isDefined)(prevCalculatedValue):
return prevCalculatedValue + calculatedValue;
case (0, _type.isDefined)(prevCalculatedValue):
return prevCalculatedValue;
default:
return calculatedValue
}
}
};
function getFieldPos(descriptions, field, cache) {
let fieldParams = {
index: -1
};
if (!(0, _type.isObject)(field)) {
if (cache.fields[field]) {
field = cache[field]
} else {
const allFields = descriptions.columns.concat(descriptions.rows).concat(descriptions.values);
const fieldIndex = (0, _m_widget_utils.findField)(allFields, field);
field = cache[field] = allFields[fieldIndex]
}
}
if (field) {
const area = field.area || "data";
fieldParams = cache.positions[field.index] = cache.positions[field.index] || {
area: area,
index: descriptions["data" === area ? "values" : `${area}s`].indexOf(field)
}
}
return fieldParams
}
function getPathFieldName(dimension) {
return dimension === ROW ? "_rowPath" : "_columnPath"
}
const SummaryCell = function(columnPath, rowPath, data, descriptions, fieldIndex, fieldsCache) {
this._columnPath = columnPath;
this._rowPath = rowPath;
this._fieldIndex = fieldIndex;
this._fieldsCache = fieldsCache || {
fields: {},
positions: {}
};
this._data = data;
this._descriptions = descriptions;
const cell = data.values && data.values[rowPath[0].index] && data.values[rowPath[0].index][columnPath[0].index];
if (cell) {
cell.originalCell = cell.originalCell || cell.slice();
cell.postProcessedFlags = cell.postProcessedFlags || [];
this._cell = cell
}
};
exports.Cell = SummaryCell;
SummaryCell.prototype = (0, _extend.extend)(SummaryCell.prototype, {
_getPath(dimension) {
return this[getPathFieldName(dimension)]
},
_getDimension(dimension) {
dimension = dimension === ROW ? "rows" : "columns";
return this._descriptions[dimension]
},
_createCell(config) {
return new SummaryCell(config._columnPath || this._columnPath, config._rowPath || this._rowPath, this._data, this._descriptions, this._fieldIndex)
},
parent(direction) {
const path = this._getPath(direction).slice();
const config = {};
path.shift();
if (path.length) {
config[getPathFieldName(direction)] = path;
return this._createCell(config)
}
return null
},
children(direction) {
const path = this._getPath(direction).slice();
const item = path[0];
const result = [];
const cellConfig = {};
if (item.children) {
for (let i = 0; i < item.children.length; i += 1) {
cellConfig[getPathFieldName(direction)] = [item.children[i]].concat(path.slice());
result.push(this._createCell(cellConfig))
}
}
return result
},
grandTotal(direction) {
const config = {};
const rowPath = this._rowPath;
const columnPath = this._columnPath;
const dimensionPath = this._getPath(direction);
const pathFieldName = getPathFieldName(direction);
if (!direction) {
config._rowPath = [rowPath[rowPath.length - 1]];
config._columnPath = [columnPath[columnPath.length - 1]]
} else {
config[pathFieldName] = [dimensionPath[dimensionPath.length - 1]]
}
return this._createCell(config)
},
next(direction, allowCrossGroup) {
const currentPath = this._getPath(direction);
const item = currentPath[0];
let parent = this.parent(direction);
let siblings;
if (parent) {
const index = currentPath[1].children.indexOf(item);
siblings = parent.children(direction);
if (siblings[index + 1]) {
return siblings[index + 1]
}
}
if (allowCrossGroup && parent) {
do {
parent = parent.next(direction, allowCrossGroup);
siblings = parent ? parent.children(direction) : []
} while (parent && !siblings.length);
return siblings[0] || null
}
return null
},
prev(direction, allowCrossGroup) {
const currentPath = this._getPath(direction);
const item = currentPath[0];
let parent = this.parent(direction);
let siblings;
if (parent) {
const index = currentPath[1].children.indexOf(item);
siblings = parent.children(direction);
if (siblings[index - 1]) {
return siblings[index - 1]
}
}
if (allowCrossGroup && parent) {
do {
parent = parent.prev(direction, allowCrossGroup);
siblings = parent ? parent.children(direction) : []
} while (parent && !siblings.length);
return siblings[siblings.length - 1] || null
}
return null
},
cell() {
return this._cell
},
field(area) {
if ("data" === area) {
return this._descriptions.values[this._fieldIndex]
}
const path = this._getPath(area);
const descriptions = this._getDimension(area);
const field = descriptions[path.length - 2];
return field || null
},
child(direction, fieldValue) {
let childLevelField;
const children = this.children(direction);
for (let i = 0; i < children.length; i += 1) {
childLevelField = childLevelField || children[i].field(direction);
if (children[i].value(childLevelField) === fieldValue) {
return children[i]
}
}
return null
},
slice(field, value) {
const that = this;
const config = {};
const fieldPos = getFieldPos(this._descriptions, field, this._fieldsCache);
const {
area: area
} = fieldPos;
const fieldIndex = fieldPos.index;
let sliceCell = null;
const newPath = [];
if (area === ROW || "column" === area) {
const path = this._getPath(area).slice();
const level = -1 !== fieldIndex && path.length - 2 - fieldIndex;
if (path[level]) {
newPath[path.length - 1] = path[path.length - 1];
for (let i = level; i >= 0; i -= 1) {
if (path[i + 1]) {
const childItems = path[i + 1].children || [];
const currentValue = i === level ? value : path[i].value;
path[i] = void 0;
for (let childIndex = 0; childIndex < childItems.length; childIndex += 1) {
if (childItems[childIndex].value === currentValue) {
path[i] = childItems[childIndex];
break
}
}
}
if (void 0 === path[i]) {
return sliceCell
}
}
config[getPathFieldName(area)] = path;
sliceCell = that._createCell(config)
}
}
return sliceCell
},
value(arg1, arg2) {
const cell = this._cell;
let fieldIndex = this._fieldIndex;
const fistArgIsBoolean = true === arg1 || false === arg1;
const field = !fistArgIsBoolean ? arg1 : null;
const needCalculatedValue = fistArgIsBoolean && arg1 || arg2;
if ((0, _type.isDefined)(field)) {
const fieldPos = getFieldPos(this._descriptions, field, this._fieldsCache);
fieldIndex = fieldPos.index;
if ("data" !== fieldPos.area) {
const path = this._getPath(fieldPos.area);
const level = -1 !== fieldIndex && path.length - 2 - fieldIndex;
return path[level] && path[level].value
}
}
if (cell && cell.originalCell) {
return needCalculatedValue ? cell[fieldIndex] : cell.originalCell[fieldIndex]
}
return null
},
isPostProcessed(field) {
let fieldIndex = this._fieldIndex;
if ((0, _type.isDefined)(field)) {
const fieldPos = getFieldPos(this._descriptions, field, this._fieldsCache);
fieldIndex = fieldPos.index;
if ("data" !== fieldPos.area) {
return false
}
}
return !!(this._cell && this._cell.postProcessedFlags[fieldIndex])
}
});
function getExpression(field) {
const {
summaryDisplayMode: summaryDisplayMode
} = field;
const crossGroupCalculation = field.allowCrossGroupCalculation;
let expression = null;
if ((0, _type.isFunction)(field.calculateSummaryValue)) {
expression = field.calculateSummaryValue
} else if (summaryDisplayMode) {
if ("absoluteVariation" === summaryDisplayMode) {
expression = createAbsoluteVariationExp(crossGroupCalculation)
} else if ("percentVariation" === summaryDisplayMode) {
expression = function(allowCrossGroup) {
const absoluteExp = createAbsoluteVariationExp(allowCrossGroup);
return function(e) {
const absVar = absoluteExp(e);
const prevCell = e.prev("column", allowCrossGroup);
const prevValue = prevCell && prevCell.value();
return null !== absVar && prevValue ? absVar / prevValue : null
}
}(crossGroupCalculation)
} else {
expression = summaryDictionary[summaryDisplayMode]
}
if (expression && !field.format && -1 !== summaryDisplayMode.indexOf("percent")) {
_m_widget_utils.default.setFieldProperty(field, "format", "percent")
}
}
return expression
}
function processDataCell(data, rowIndex, columnIndex, isRunningTotalCalculation) {
const values = data.values[rowIndex][columnIndex] = data.values[rowIndex][columnIndex] || [];
const {
originalCell: originalCell
} = values;
if (!originalCell) {
return
}
if (values.allowResetting || !isRunningTotalCalculation) {
data.values[rowIndex][columnIndex] = originalCell.slice()
}
data.values[rowIndex][columnIndex].allowResetting = isRunningTotalCalculation
}
function applyDisplaySummaryMode(descriptions, data) {
const expressions = [];
const columnElements = [{
index: data.grandTotalColumnIndex,
children: data.columns
}];
const rowElements = [{
index: data.grandTotalRowIndex,
children: data.rows
}];
const valueFields = descriptions.values;
const fieldsCache = {
fields: {},
positions: {}
};
data.values = data.values || [];
(0, _m_widget_utils.foreachTree)(columnElements, columnPath => {
columnPath[0].isEmpty = []
}, false);
(0, _m_widget_utils.foreachTree)(rowElements, rowPath => {
const rowItem = rowPath[0];
rowItem.isEmpty = [];
data.values[rowItem.index] = data.values[rowItem.index] || [];
(0, _m_widget_utils.foreachTree)(columnElements, columnPath => {
const columnItem = columnPath[0];
let isEmptyCell;
processDataCell(data, rowItem.index, columnItem.index, false);
for (let i = 0; i < valueFields.length; i += 1) {
const field = valueFields[i];
const expression = expressions[i] = void 0 === expressions[i] ? getExpression(field) : expressions[i];
isEmptyCell = false;
if (expression) {
const expressionArg = new SummaryCell(columnPath, rowPath, data, descriptions, i, fieldsCache);
const cell = expressionArg.cell();
const value = cell[i] = expression(expressionArg);
cell.postProcessedFlags[i] = true;
isEmptyCell = null === value || void 0 === value
}
if (void 0 === columnItem.isEmpty[i]) {
columnItem.isEmpty[i] = true
}
if (void 0 === rowItem.isEmpty[i]) {
rowItem.isEmpty[i] = true
}
if (!isEmptyCell) {
rowItem.isEmpty[i] = columnItem.isEmpty[i] = false
}
}
}, false)
}, false);
data.isEmptyGrandTotalRow = rowElements[0].isEmpty;
data.isEmptyGrandTotalColumn = columnElements[0].isEmpty
}
function applyRunningTotal(descriptions, data) {
const expressions = [];
const columnElements = [{
index: data.grandTotalColumnIndex,
children: data.columns
}];
const rowElements = [{
index: data.grandTotalRowIndex,
children: data.rows
}];
const valueFields = descriptions.values;
const fieldsCache = {
fields: {},
positions: {}
};
data.values = data.values || [];
(0, _m_widget_utils.foreachTree)(rowElements, rowPath => {
const rowItem = rowPath[0];
data.values[rowItem.index] = data.values[rowItem.index] || [];
(0, _m_widget_utils.foreachTree)(columnElements, columnPath => {
const columnItem = columnPath[0];
processDataCell(data, rowItem.index, columnItem.index, true);
for (let i = 0; i < valueFields.length; i += 1) {
const field = valueFields[i];
const expression = expressions[i] = void 0 === expressions[i] ? createRunningTotalExpr(field) : expressions[i];
if (expression) {
const expressionArg = new SummaryCell(columnPath, rowPath, data, descriptions, i, fieldsCache);
const cell = expressionArg.cell();
cell[i] = expression(expressionArg);
cell.postProcessedFlags[i] = true
}
}
}, false)
}, false)
}
function createMockSummaryCell(descriptions, fields, indices) {
const summaryCell = new SummaryCell([], [], {}, descriptions, 0);
summaryCell.value = function(fieldId) {
if ((0, _type.isDefined)(fieldId)) {
const index = (0, _m_widget_utils.findField)(fields, fieldId);
const field = fields[index];
if (!indices[index] && field && !(0, _type.isDefined)(field.area)) {
descriptions.values.push(field);
indices[index] = true
}
}
};
summaryCell.grandTotal = function() {
return this
};
summaryCell.children = function() {
return []
};
return summaryCell
}
exports.default = {
Cell: SummaryCell,
summaryDictionary: summaryDictionary,
getExpression: getExpression,
applyRunningTotal: applyRunningTotal,
createMockSummaryCell: createMockSummaryCell,
applyDisplaySummaryMode: applyDisplaySummaryMode
}
},
48063(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.XmlaStore = void 0;
var _language_codes = __webpack_require__( /*! ../../../../common/core/localization/language_codes */ 64333);
var _errors = __webpack_require__( /*! ../../../../common/data/errors */ 82812);
var _renderer = (e = __webpack_require__( /*! ../../../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 21274);
var _string = __webpack_require__( /*! ../../../../core/utils/string */ 54497);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _window = __webpack_require__( /*! ../../../../core/utils/window */ 3104);
var _m_widget_utils = function(e, t) {
if ("function" == typeof WeakMap) {
var r = new WeakMap,
n = new WeakMap
}
return function(e, t) {
if (!t && e && e.__esModule) {
return e
}
var o, i, f = {
__proto__: null,
default: e
};
if (null === e || "object" != typeof e && "function" != typeof e) {
return f
}
if (o = t ? n : r) {
if (o.has(e)) {
return o.get(e)
}
o.set(e, f)
}
for (const t in e) {
"default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t])
}
return f
}(e, t)
}(__webpack_require__( /*! ../m_widget_utils */ 12062));
function crossJoinElements(elements) {
const elementsString = elements.join(",");
return elements.length > 1 ? (0, _string.format)(MDX_CROSS_JOIN_TEMPLATE, elementsString) : elementsString
}
function mdxDescendants(level, levelMember, nextLevel) {
const memberExpression = levelMember || level;
return `Descendants({${memberExpression}}, ${nextLevel}, SELF_AND_BEFORE)`
}
function getAllMember(dimension) {
return `${dimension.hierarchyName||dimension.dataField}.[All]`
}
function getAllMembers(field) {
let result = `${field.dataField}.allMembers`;
let {
searchValue: searchValue
} = field;
if (searchValue) {
searchValue = searchValue.replace(/'/g, "''");
result = `Filter(${result}, instr(${field.dataField}.currentmember.member_caption,'${searchValue}') > 0)`
}
return result
}
function preparePathValue(pathValue, dataField) {
if (pathValue) {
const shouldSkipWrappingPathValue = (0, _type.isString)(pathValue) && (pathValue.includes("&") || pathValue.startsWith(`${dataField}.`));
pathValue = shouldSkipWrappingPathValue ? pathValue : `[${pathValue}]`;
if (dataField && 0 === pathValue.indexOf(`${dataField}.`)) {
pathValue = pathValue.slice(dataField.length + 1, pathValue.length)
}
}
return pathValue
}
function getNumber(str) {
return parseInt(str, 10)
}
function parseValue(valueText) {
return (0, _type.isNumeric)(valueText) ? parseFloat(valueText) : valueText
}
function getFirstChildText(node, childTagName) {
return getNodeText(function(node, tagName) {
return (node.getElementsByTagName(tagName) || [])[0]
}(node, childTagName))
}
function getNodeText(node) {
return node && (node.textContent || node.text || node.innerHTML) || ""
}
function getLocaleIdProperty() {
const languageId = (0, _language_codes.getLanguageId)();
if (void 0 !== languageId) {
return (0, _string.format)(" {0}", languageId)
}
return ""
}
const window = (0, _window.getWindow)();
const XMLA_DISCOVER_TEMPLATE = ' {2}{0}{1}{0}{3}';
const MDX_CROSS_JOIN_TEMPLATE = "CrossJoin({0})";
class XmlaStore {
constructor(options) {
this._options = options
}
key() {
(0, _common.noop)()
}
filter() {
(0, _common.noop)()
}
execXMLA(requestOptions, data) {
const deferred = new _deferred.Deferred;
const {
beforeSend: beforeSend
} = requestOptions;
const ajaxSettings = {
url: requestOptions.url,
dataType: "text",
data: data,
headers: {
"Content-Type": "text/xml"
},
xhrFields: {},
method: "POST"
};
if ((0, _type.isFunction)(beforeSend)) {
beforeSend(ajaxSettings)
}
_m_widget_utils.default.sendRequest(ajaxSettings).fail(function() {
deferred.reject(arguments)
}).done(text => {
const parser = new window.DOMParser;
let xml;
try {
try {
xml = parser.parseFromString(text, "text/xml")
} catch (e) {
xml = void 0
}
if (!xml || xml.getElementsByTagName("parsererror").length || 0 === xml.childNodes.length) {
throw _errors.errors.Error("E4023", text)
}
} catch (e) {
deferred.reject({
statusText: e.message,
stack: e.stack,
responseText: text
})
}
deferred.resolve(xml)
});
return deferred
}
generateCrossJoin(path, expandLevel, expandAllCount, expandIndex, slicePath, options, axisName, take) {
const crossJoinArgs = [];
const dimensions = options[axisName];
const fields = [];
let arg;
let prevDimension;
let member;
for (let i = expandIndex; i <= expandLevel; i += 1) {
const field = dimensions[i];
const {
dataField: dataField
} = field;
const prevHierarchyName = dimensions[i - 1] && dimensions[i - 1].hierarchyName;
const {
hierarchyName: hierarchyName
} = field;
const isLastDimensionInGroup = !hierarchyName || !dimensions[i + 1] || dimensions[i + 1].hierarchyName !== hierarchyName;
const expandAllIndex = path.length + expandAllCount + expandIndex;
arg = null;
fields.push(field);
if (i < path.length) {
if (isLastDimensionInGroup) {
arg = `(${dataField}.${preparePathValue(path[i],dataField)})`
}
} else if (i <= expandAllIndex) {
if (0 === i && 0 === expandAllCount) {
const allMember = getAllMember(dimensions[expandIndex]);
if (!hierarchyName) {
arg = getAllMembers(dimensions[expandIndex])
} else {
arg = `${allMember},${dimensions[expandIndex].dataField}`
}
} else if (hierarchyName) {
member = preparePathValue(slicePath[slicePath.length - 1]);
if (isLastDimensionInGroup || i === expandAllIndex) {
if (prevHierarchyName === hierarchyName) {
if (slicePath.length) {
prevDimension = dimensions[slicePath.length - 1]
}
if (!prevDimension || prevDimension.hierarchyName !== hierarchyName) {
prevDimension = dimensions[i - 1];
member = ""
}
arg = mdxDescendants(prevDimension.dataField, member, dataField)
} else {
arg = getAllMembers(field)
}
}
} else {
arg = getAllMembers(field)
}
} else {
const isFirstDimensionInGroup = !hierarchyName || prevHierarchyName !== hierarchyName;
if (isFirstDimensionInGroup) {
arg = `(${getAllMember(field)})`
}
}
if (arg) {
arg = (0, _string.format)("{{0}}", arg);
if (take) {
const sortBy = (field.hierarchyName || field.dataField) + ("displayText" === field.sortBy ? ".MEMBER_CAPTION" : ".MEMBER_VALUE");
arg = (0, _string.format)("Order({0}, {1}, {2})", arg, sortBy, "desc" === field.sortOrder ? "DESC" : "ASC")
}
crossJoinArgs.push(arg)
}
}
return crossJoinElements(crossJoinArgs)
}
fillCrossJoins(crossJoins, path, expandLevel, expandIndex, slicePath, options, axisName, cellsString, take, totalsOnly) {
let expandAllCount = -1;
const dimensions = options[axisName];
let dimensionIndex;
do {
expandAllCount += 1;
dimensionIndex = path.length + expandAllCount + expandIndex;
let crossJoin = this.generateCrossJoin(path, expandLevel, expandAllCount, expandIndex, slicePath, options, axisName, take);
if (!take && !totalsOnly) {
crossJoin = (0, _string.format)("NonEmpty({0}, {1})", crossJoin, cellsString)
}
crossJoins.push(crossJoin)
} while (dimensions[dimensionIndex] && dimensions[dimensionIndex + 1] && dimensions[dimensionIndex].expanded)
}
declare(expression, withArray, name, type) {
name = name || `[DX_Set_${withArray.length}]`;
type = type || "set";
withArray.push((0, _string.format)("{0} {1} as {2}", type, name, expression));
return name
}
generateAxisMdx(options, axisName, cells, withArray, parseOptions) {
const dimensions = options[axisName];
const crossJoins = [];
let path = [];
let expandedPaths = [];
let expandIndex = 0;
let expandLevel = 0;
const result = [];
const cellsString = (0, _string.format)("{{0}}", cells.join(","));
if (dimensions && dimensions.length) {
if (options.headerName === axisName) {
path = options.path;
expandIndex = path.length
} else if (options.headerName && options.oppositePath) {
path = options.oppositePath;
expandIndex = path.length
} else {
expandedPaths = ("columns" === axisName ? options.columnExpandedPaths : options.rowExpandedPaths) || expandedPaths
}
expandLevel = (0, _m_widget_utils.getExpandedLevel)(options, axisName);
this.fillCrossJoins(crossJoins, [], expandLevel, expandIndex, path, options, axisName, cellsString, "rows" === axisName ? options.rowTake : options.columnTake, options.totalsOnly);
(0, _iterator.each)(expandedPaths, (_, expandedPath) => {
this.fillCrossJoins(crossJoins, expandedPath, expandLevel, expandIndex, expandedPath, options, axisName, cellsString)
});
for (let i = expandLevel; i >= path.length; i -= 1) {
if (dimensions[i].hierarchyName) {
parseOptions.visibleLevels[dimensions[i].hierarchyName] = parseOptions.visibleLevels[dimensions[i].hierarchyName] || [];
parseOptions.visibleLevels[dimensions[i].hierarchyName].push(dimensions[i].dataField)
}
}
}
if (crossJoins.length) {
let expression = function(elements) {
const elementsString = elements.join(",");
return elements.length > 1 ? `Union(${elementsString})` : elementsString
}(crossJoins);
if ("rows" === axisName && options.rowTake) {
expression = (0, _string.format)("Subset({0}, {1}, {2})", expression, options.rowSkip > 0 ? options.rowSkip + 1 : 0, options.rowSkip > 0 ? options.rowTake : options.rowTake + 1)
}
if ("columns" === axisName && options.columnTake) {
expression = (0, _string.format)("Subset({0}, {1}, {2})", expression, options.columnSkip > 0 ? options.columnSkip + 1 : 0, options.columnSkip > 0 ? options.columnTake : options.columnTake + 1)
}
const axisSet = `[DX_${axisName}]`;
result.push(this.declare(expression, withArray, axisSet));
if (options.totalsOnly) {
result.push(this.declare(`COUNT(${axisSet})`, withArray, `[DX_${axisName}_count]`, "member"))
}
}
if ("columns" === axisName && cells.length && !options.skipValues) {
result.push(cellsString)
}
return (0, _string.format)("{0} DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME, MEMBER_VALUE ON {1}", crossJoinElements(result), axisName)
}
generateAxisFieldsFilter(fields) {
const filterMembers = [];
(0, _iterator.each)(fields, (_, field) => {
const {
dataField: dataField
} = field;
const filterExpression = [];
const filterValues = field.filterValues || [];
let filterStringExpression;
if (field.hierarchyName && (0, _type.isNumeric)(field.groupIndex)) {
return
}(0, _iterator.each)(filterValues, (_, filterValue) => {
let filterMdx = `${dataField}.${preparePathValue(Array.isArray(filterValue)?filterValue[filterValue.length-1]:filterValue,dataField)}`;
if ("exclude" === field.filterType) {
filterExpression.push(`${filterMdx}.parent`);
filterMdx = `Descendants(${filterMdx})`
}
filterExpression.push(filterMdx)
});
if (filterValues.length) {
filterStringExpression = (0, _string.format)("{{0}}", filterExpression.join(","));
if ("exclude" === field.filterType) {
filterStringExpression = `Except(${getAllMembers(field)},${filterStringExpression})`
}
filterMembers.push(filterStringExpression)
}
});
return filterMembers.length ? crossJoinElements(filterMembers) : ""
}
generateFrom(columnsFilter, rowsFilter, filter, cubeName) {
let from = `[${cubeName}]`;
(0, _iterator.each)([columnsFilter, rowsFilter, filter], (_, filter) => {
if (filter) {
from = (0, _string.format)("(SELECT {0} FROM {1})", `${filter}on 0`, from)
}
});
return from
}
generateMdxCore(axisStrings, withArray, columns, rows, filters, slice, cubeName) {
let options = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : {};
let mdxString = "";
const withString = (withArray.length ? `with ${withArray.join(" ")}` : "") + " ";
if (axisStrings.length) {
let select;
if (options.totalsOnly) {
const countMembers = [];
if (rows.length) {
countMembers.push("[DX_rows_count]")
}
if (columns.length) {
countMembers.push("[DX_columns_count]")
}
select = `{${countMembers.join(",")}} on columns`
} else {
select = axisStrings.join(",")
}
mdxString = withString + (0, _string.format)("SELECT {2} FROM {0} {1} CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS", this.generateFrom(this.generateAxisFieldsFilter(columns), this.generateAxisFieldsFilter(rows), this.generateAxisFieldsFilter(filters || []), cubeName), slice.length ? (0, _string.format)("WHERE ({0})", slice.join(",")) : "", select)
}
return mdxString
}
prepareDataFields(withArray, valueFields) {
return (0, _iterator.map)(valueFields, cell => {
if ((0, _type.isString)(cell.expression)) {
this.declare(cell.expression, withArray, cell.dataField, "member")
}
return cell.dataField
})
}
addSlices(slices, options, headerName, path) {
(0, _iterator.each)(path, (index, value) => {
const dimension = options[headerName][index];
if (!dimension.hierarchyName || dimension.hierarchyName !== options[headerName][index + 1].hierarchyName) {
slices.push(`${dimension.dataField}.${this.preparePathValue(value,dimension.dataField)}`)
}
})
}
generateMDX(options, cubeName, parseOptions) {
const columns = options.columns || [];
const rows = options.rows || [];
const values = options.values && options.values.length ? options.values : [{
dataField: "[Measures]"
}];
const slice = [];
const withArray = [];
const axisStrings = [];
const dataFields = this.prepareDataFields(withArray, values);
parseOptions.measureCount = options.skipValues ? 1 : values.length;
parseOptions.visibleLevels = {};
if (options.headerName && options.path) {
this.addSlices(slice, options, options.headerName, options.path)
}
if (options.headerName && options.oppositePath) {
this.addSlices(slice, options, "rows" === options.headerName ? "columns" : "rows", options.oppositePath)
}
if (columns.length || dataFields.length) {
axisStrings.push(this.generateAxisMdx(options, "columns", dataFields, withArray, parseOptions))
}
if (rows.length) {
axisStrings.push(this.generateAxisMdx(options, "rows", dataFields, withArray, parseOptions))
}
return this.generateMdxCore(axisStrings, withArray, columns, rows, options.filters, slice, cubeName, options)
}
createDrillDownAxisSlice(slice, fields, path) {
(0, _iterator.each)(path, (index, value) => {
const field = fields[index];
if (field.hierarchyName && (fields[index + 1] || {}).hierarchyName === field.hierarchyName) {
return
}
slice.push(`${field.dataField}.${this.preparePathValue(value,field.dataField)}`)
})
}
generateDrillDownMDX(options, cubeName, params) {
const columns = options.columns || [];
const rows = options.rows || [];
const values = options.values && options.values.length ? options.values : [{
dataField: "[Measures]"
}];
const slice = [];
const withArray = [];
const axisStrings = [];
const dataFields = this.prepareDataFields(withArray, values);
const {
maxRowCount: maxRowCount
} = params;
const customColumns = params.customColumns || [];
const customColumnsString = customColumns.length > 0 ? ` return ${customColumns.join(",")}` : "";
this.createDrillDownAxisSlice(slice, columns, params.columnPath || []);
this.createDrillDownAxisSlice(slice, rows, params.rowPath || []);
if (columns.length || dataFields.length) {
axisStrings.push([`${dataFields[params.dataIndex]||dataFields[0]} on 0`])
}
const coreMDX = this.generateMdxCore(axisStrings, withArray, columns, rows, options.filters, slice, cubeName);
return coreMDX ? `drillthrough${maxRowCount>0?` maxrows ${maxRowCount}`:""}${coreMDX}${customColumnsString}` : coreMDX
}
parseAxes(xml, skipValues) {
const axes = [];
(0, _iterator.each)(xml.getElementsByTagName("Axis"), (_, axisElement) => {
const name = axisElement.getAttribute("name");
const axis = [];
let index = 0;
if (0 === name.indexOf("Axis") && (0, _type.isNumeric)(getNumber(name.substr(4)))) {
axes.push(axis);
(0, _iterator.each)(axisElement.getElementsByTagName("Tuple"), (_, tupleElement) => {
const tupleMembers = tupleElement.childNodes;
let levelSum = 0;
const members = [];
let membersCount = skipValues ? tupleMembers.length : tupleMembers.length - 1;
const isAxisWithMeasure = 1 === axes.length;
if (isAxisWithMeasure) {
membersCount -= 1
}
axis.push(members);
for (let i = membersCount; i >= 0; i -= 1) {
const tuple = tupleMembers[i];
const level = getNumber(getFirstChildText(tuple, "LNum"));
members[i] = {
caption: getFirstChildText(tuple, "Caption"),
value: parseValue(getFirstChildText(tuple, "MEMBER_VALUE")),
level: level,
index: index++,
hasValue: !levelSum && (!!level || 0 === i),
name: getFirstChildText(tuple, "UName"),
hierarchyName: tupleMembers[i].getAttribute("Hierarchy"),
parentName: getFirstChildText(tuple, "PARENT_UNIQUE_NAME"),
levelName: getFirstChildText(tuple, "LName")
};
levelSum += level
}
})
}
});
while (axes.length < 2) {
axes.push([
[{
level: 0
}]
])
}
return axes
}
getNodeText(node) {
return getNodeText(node)
}
parseCells(xml, axes, measureCount) {
const cells = [];
let cell = [];
let index = 0;
const cellsOriginal = [];
const cellElements = xml.getElementsByTagName("Cell");
const errorDictionary = {};
for (let i = 0; i < cellElements.length; i += 1) {
const xmlCell = cellElements[i];
const valueElement = xmlCell.getElementsByTagName("Value")[0];
const errorElements = valueElement && valueElement.getElementsByTagName("Error") || [];
const text = 0 === errorElements.length ? this.getNodeText(valueElement) : "#N/A";
const value = parseFloat(text);
const cellOrdinal = getNumber(xmlCell.getAttribute("CellOrdinal"));
if (errorElements.length) {
errorDictionary[this.getNodeText(errorElements[0].getElementsByTagName("ErrorCode")[0])] = this.getNodeText(errorElements[0].getElementsByTagName("Description")[0])
}
cellsOriginal[cellOrdinal] = {
value: (0, _type.isNumeric)(text) ? value : text || null
}
}(0, _iterator.each)(axes[1], () => {
const row = [];
cells.push(row);
(0, _iterator.each)(axes[0], () => {
const measureIndex = index % measureCount;
if (0 === measureIndex) {
cell = [];
row.push(cell)
}
cell.push(cellsOriginal[index] ? cellsOriginal[index].value : null);
index += 1
})
});
Object.keys(errorDictionary).forEach(key => {
_errors.errors.log("W4002", errorDictionary[key])
});
return cells
}
preparePathValue(pathValue, dataField) {
return preparePathValue(pathValue, dataField)
}
getItem(hash, name, member, index) {
let item = hash[name];
if (!item) {
item = {};
hash[name] = item
}
if (!(0, _type.isDefined)(item.value) && member) {
item.text = member.caption;
item.value = member.value;
item.key = name || "";
item.levelName = member.levelName;
item.hierarchyName = member.hierarchyName;
item.parentName = member.parentName;
item.index = index;
item.level = member.level
}
return item
}
getVisibleChildren(item, visibleLevels) {
const result = [];
const children = item.children && (item.children.length ? item.children : Object.keys(item.children.grandTotalHash || {}).reduce((result, name) => result.concat(item.children.grandTotalHash[name].children), []));
const firstChild = children && children[0];
if (firstChild && (visibleLevels[firstChild.hierarchyName] && visibleLevels[firstChild.hierarchyName].includes(firstChild.levelName) || !visibleLevels[firstChild.hierarchyName] || 0 === firstChild.level)) {
const newChildren = children.filter(child => child.hierarchyName === firstChild.hierarchyName);
newChildren.grandTotalHash = children.grandTotalHash;
return newChildren
}
if (firstChild) {
for (let i = 0; i < children.length; i += 1) {
if (children[i].hierarchyName === firstChild.hierarchyName) {
result.push.apply(result, this.getVisibleChildren(children[i], visibleLevels))
}
}
}
return result
}
processMember(dataIndex, member, parentItem) {
let children = parentItem.children = parentItem.children || [];
const hash = children.hash = children.hash || {};
const grandTotalHash = children.grandTotalHash = children.grandTotalHash || {};
if (member.parentName) {
parentItem = this.getItem(hash, member.parentName);
children = parentItem.children = parentItem.children || []
}
const currentItem = this.getItem(hash, member.name, member, dataIndex);
if (member.hasValue && !currentItem.added) {
currentItem.index = dataIndex;
currentItem.added = true;
children.push(currentItem)
}
if ((!parentItem.value || !parentItem.parentName) && member.parentName) {
grandTotalHash[member.parentName] = parentItem
} else if (grandTotalHash[parentItem.name]) {
delete grandTotalHash[member.parentName]
}
return currentItem
}
getGrandTotalIndex(parentItem, visibleLevels) {
let grandTotalIndex;
if (1 === parentItem.children.length && "" === parentItem.children[0].parentName) {
grandTotalIndex = parentItem.children[0].index;
const {
grandTotalHash: grandTotalHash
} = parentItem.children;
parentItem.children = parentItem.children[0].children || [];
parentItem.children.grandTotalHash = grandTotalHash;
parentItem.children = this.getVisibleChildren(parentItem, visibleLevels)
} else if (0 === parentItem.children.length) {
grandTotalIndex = 0
}
return grandTotalIndex
}
fillDataSourceAxes(dataSourceAxis, axisTuples, measureCount, visibleLevels) {
const result = [];
(0, _iterator.each)(axisTuples, (tupleIndex, members) => {
let parentItem = {
children: result
};
const dataIndex = (0, _type.isDefined)(measureCount) ? Math.floor(tupleIndex / measureCount) : tupleIndex;
(0, _iterator.each)(members, (_, member) => {
parentItem = this.processMember(dataIndex, member, parentItem)
})
});
const parentItem = {
children: result
};
parentItem.children = this.getVisibleChildren(parentItem, visibleLevels);
const grandTotalIndex = this.getGrandTotalIndex(parentItem, visibleLevels);
(0, _m_widget_utils.foreachTree)(parentItem.children, items => {
const item = items[0];
const children = this.getVisibleChildren(item, visibleLevels);
if (children.length) {
item.children = children
} else {
delete item.children
}
delete item.levelName;
delete item.hierarchyName;
delete item.added;
delete item.parentName;
delete item.level
}, true);
(0, _iterator.each)(parentItem.children || [], (_, e) => {
dataSourceAxis.push(e)
});
return grandTotalIndex
}
checkError(xml) {
const faultElementNS = xml.getElementsByTagName("soap:Fault");
const faultElement = xml.getElementsByTagName("Fault");
const errorElement = (0, _renderer.default)([].slice.call(faultElement.length ? faultElement : faultElementNS)).find("Error");
if (errorElement.length) {
const description = errorElement.attr("Description");
const error = _errors.errors.Error("E4000", description);
_errors.errors.log("E4000", description);
return error
}
return null
}
parseResult(xml, parseOptions) {
const dataSource = {
columns: [],
rows: []
};
const {
measureCount: measureCount
} = parseOptions;
const axes = this.parseAxes(xml, parseOptions.skipValues);
dataSource.grandTotalColumnIndex = this.fillDataSourceAxes(dataSource.columns, axes[0], measureCount, parseOptions.visibleLevels);
dataSource.grandTotalRowIndex = this.fillDataSourceAxes(dataSource.rows, axes[1], void 0, parseOptions.visibleLevels);
dataSource.values = this.parseCells(xml, axes, measureCount);
return dataSource
}
parseDiscoverRowSet(xml, schema, dimensions, translatedDisplayFolders) {
const result = [];
const isMeasure = "MEASURE" === schema;
const displayFolderField = isMeasure ? "MEASUREGROUP_NAME" : `${schema}_DISPLAY_FOLDER`;
(0, _iterator.each)(xml.getElementsByTagName("row"), (_, row) => {
const hierarchyName = "LEVEL" === schema ? getFirstChildText(row, "HIERARCHY_UNIQUE_NAME") : void 0;
const levelNumber = getFirstChildText(row, "LEVEL_NUMBER");
let displayFolder = getFirstChildText(row, displayFolderField);
if (isMeasure) {
displayFolder = translatedDisplayFolders[displayFolder] || displayFolder
}
if (("0" !== levelNumber || "true" !== getFirstChildText(row, `${schema}_IS_VISIBLE`)) && "2" !== getFirstChildText(row, "DIMENSION_TYPE")) {
const dimension = isMeasure ? "DX_MEASURES" : getFirstChildText(row, "DIMENSION_UNIQUE_NAME");
const dataField = getFirstChildText(row, `${schema}_UNIQUE_NAME`);
result.push({
dimension: dimensions.names[dimension] || dimension,
groupIndex: levelNumber ? getNumber(levelNumber) - 1 : void 0,
dataField: dataField,
caption: getFirstChildText(row, `${schema}_CAPTION`),
hierarchyName: hierarchyName,
groupName: hierarchyName,
displayFolder: displayFolder,
isMeasure: isMeasure,
isDefault: !!dimensions.defaultHierarchies[dataField]
})
}
});
return result
}
parseMeasureGroupDiscoverRowSet(xml) {
const measureGroups = {};
(0, _iterator.each)(xml.getElementsByTagName("row"), (_, row) => {
measureGroups[getFirstChildText(row, "MEASUREGROUP_NAME")] = getFirstChildText(row, "MEASUREGROUP_CAPTION")
});
return measureGroups
}
parseDimensionsDiscoverRowSet(xml) {
const result = {
names: {},
defaultHierarchies: {}
};
(0, _iterator.each)((0, _renderer.default)(xml).find("row"), function() {
const $row = (0, _renderer.default)(this);
const type = $row.children("DIMENSION_TYPE").text();
const dimensionName = "2" === type ? "DX_MEASURES" : $row.children("DIMENSION_UNIQUE_NAME").text();
result.names[dimensionName] = $row.children("DIMENSION_CAPTION").text();
result.defaultHierarchies[$row.children("DEFAULT_HIERARCHY").text()] = true
});
return result
}
parseStringWithUnicodeSymbols(str) {
return function(str) {
str = str.replace(/_x(....)_/g, (_, group1) => String.fromCharCode(parseInt(group1, 16)));
const stringArray = str.match(/\[.+?\]/gi);
if (stringArray && stringArray.length) {
str = stringArray[stringArray.length - 1]
}
return str.replace(/\[/gi, "").replace(/\]/gi, "").replace(/\$/gi, "").replace(/\./gi, " ")
}(str)
}
parseDrillDownRowSet(xml) {
const rows = xml.getElementsByTagName("row");
const result = [];
const columnNames = {};
for (let i = 0; i < rows.length; i += 1) {
const children = rows[i].childNodes;
const item = {};
for (let j = 0; j < children.length; j += 1) {
const {
tagName: tagName
} = children[j];
const name = columnNames[tagName] = columnNames[tagName] || this.parseStringWithUnicodeSymbols(tagName);
item[name] = this.getNodeText(children[j])
}
result.push(item)
}
return result
}
sendQuery(storeOptions, mdxString) {
mdxString = (0, _renderer.default)(" ").text(mdxString).html();
return this.execXMLA(storeOptions, (0, _string.format)(' {0}{1}TrueMicrosoft SQL Server Management Studio3600{2}', mdxString, storeOptions.catalog, getLocaleIdProperty()))
}
processTotalCount(data, options, totalCountXml) {
const axes = [];
const columnOptions = options.columns || [];
const rowOptions = options.rows || [];
if (columnOptions.length) {
axes.push({})
}
if (rowOptions.length) {
axes.push({})
}
const cells = this.parseCells(totalCountXml, [
[{}],
[{}, {}]
], 1);
if (!columnOptions.length && rowOptions.length) {
data.rowCount = Math.max(cells[0][0][0] - 1, 0)
}
if (!rowOptions.length && columnOptions.length) {
data.columnCount = Math.max(cells[0][0][0] - 1, 0)
}
if (rowOptions.length && columnOptions.length) {
data.rowCount = Math.max(cells[0][0][0] - 1, 0);
data.columnCount = Math.max(cells[1][0][0] - 1, 0)
}
if (void 0 !== data.rowCount && options.rowTake) {
data.rows = [...Array(options.rowSkip)].concat(data.rows);
data.rows.length = data.rowCount;
for (let i = 0; i < data.rows.length; i += 1) {
data.rows[i] = data.rows[i] || {}
}
}
if (void 0 !== data.columnCount && options.columnTake) {
data.columns = [...Array(options.columnSkip)].concat(data.columns);
data.columns.length = data.columnCount;
for (let i = 0; i < data.columns.length; i += 1) {
data.columns[i] = data.columns[i] || {}
}
}
}
getFields() {
const options = this._options;
const {
catalog: catalog
} = options;
const {
cube: cube
} = options;
const localeIdProperty = getLocaleIdProperty();
const dimensionsRequest = this.execXMLA(options, (0, _string.format)(XMLA_DISCOVER_TEMPLATE, catalog, cube, "MDSCHEMA_DIMENSIONS", localeIdProperty));
const measuresRequest = this.execXMLA(options, (0, _string.format)(XMLA_DISCOVER_TEMPLATE, catalog, cube, "MDSCHEMA_MEASURES", localeIdProperty));
const hierarchiesRequest = this.execXMLA(options, (0, _string.format)(XMLA_DISCOVER_TEMPLATE, catalog, cube, "MDSCHEMA_HIERARCHIES", localeIdProperty));
const levelsRequest = this.execXMLA(options, (0, _string.format)(XMLA_DISCOVER_TEMPLATE, catalog, cube, "MDSCHEMA_LEVELS", localeIdProperty));
const result = new _deferred.Deferred;
(0, _deferred.when)(dimensionsRequest, measuresRequest, hierarchiesRequest, levelsRequest).then((dimensionsResponse, measuresResponse, hierarchiesResponse, levelsResponse) => {
this.execXMLA(options, (0, _string.format)(XMLA_DISCOVER_TEMPLATE, catalog, cube, "MDSCHEMA_MEASUREGROUPS", localeIdProperty)).done(measureGroupsResponse => {
const dimensions = this.parseDimensionsDiscoverRowSet(dimensionsResponse);
const hierarchies = this.parseDiscoverRowSet(hierarchiesResponse, "HIERARCHY", dimensions);
const levels = this.parseDiscoverRowSet(levelsResponse, "LEVEL", dimensions);
const measureGroups = this.parseMeasureGroupDiscoverRowSet(measureGroupsResponse);
const fields = this.parseDiscoverRowSet(measuresResponse, "MEASURE", dimensions, measureGroups).concat(hierarchies);
const levelsByHierarchy = {};
(0, _iterator.each)(levels, (_, level) => {
levelsByHierarchy[level.hierarchyName] = levelsByHierarchy[level.hierarchyName] || [];
levelsByHierarchy[level.hierarchyName].push(level)
});
(0, _iterator.each)(hierarchies, (_, hierarchy) => {
if (levelsByHierarchy[hierarchy.dataField] && levelsByHierarchy[hierarchy.dataField].length > 1) {
hierarchy.groupName = hierarchy.hierarchyName = hierarchy.dataField;
fields.push.apply(fields, levelsByHierarchy[hierarchy.hierarchyName])
}
});
result.resolve(fields)
}).fail(result.reject)
}).fail(result.reject);
return result
}
load(options) {
const result = new _deferred.Deferred;
const storeOptions = this._options;
const parseOptions = {
skipValues: options.skipValues
};
const mdxString = this.generateMDX(options, storeOptions.cube, parseOptions);
let rowCountMdx;
if (options.rowSkip || options.rowTake || options.columnTake || options.columnSkip) {
rowCountMdx = this.generateMDX((0, _extend.extend)({}, options, {
totalsOnly: true,
rowSkip: null,
rowTake: null,
columnSkip: null,
columnTake: null
}), storeOptions.cube, {})
}
const load = () => {
if (mdxString) {
(0, _deferred.when)(this.sendQuery(storeOptions, mdxString), rowCountMdx && this.sendQuery(storeOptions, rowCountMdx)).done((executeXml, rowCountXml) => {
const error = this.checkError(executeXml) || rowCountXml && this.checkError(rowCountXml);
if (!error) {
const response = this.parseResult(executeXml, parseOptions);
if (rowCountXml) {
this.processTotalCount(response, options, rowCountXml)
}
result.resolve(response)
} else {
result.reject(error)
}
}).fail(result.reject)
} else {
result.resolve({
columns: [],
rows: [],
values: [],
grandTotalColumnIndex: 0,
grandTotalRowIndex: 0
})
}
};
if (options.delay) {
setTimeout(load, options.delay)
} else {
load()
}
return result
}
supportPaging() {
return true
}
getDrillDownItems(options, params) {
const result = new _deferred.Deferred;
const storeOptions = this._options;
const mdxString = this.generateDrillDownMDX(options, storeOptions.cube, params);
if (mdxString) {
(0, _deferred.when)(this.sendQuery(storeOptions, mdxString)).done(executeXml => {
const error = this.checkError(executeXml);
if (!error) {
result.resolve(this.parseDrillDownRowSet(executeXml))
} else {
result.reject(error)
}
}).fail(result.reject)
} else {
result.resolve([])
}
return result
}
}
exports.XmlaStore = XmlaStore;
Object.assign(XmlaStore.prototype, _m_widget_utils.storeDrillDownMixin);
exports.default = {
XmlaStore: XmlaStore
}
},
46331(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TreeListDataController = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _m_data_controller = __webpack_require__( /*! ../../../grids/grid_core/data_controller/m_data_controller */ 32688);
var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../data_source_adapter/m_data_source_adapter */ 39051));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 99477));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class TreeListDataController extends _m_data_controller.DataController {
_getDataSourceAdapter() {
return _m_data_source_adapter.default
}
_getNodeLevel(node) {
let level = -1;
while (node.parent) {
if (node.visible) {
level++
}
node = node.parent
}
return level
}
_generateDataItem(node, options) {
return {
rowType: "data",
node: node,
key: node.key,
data: node.data,
isExpanded: this.isRowExpanded(node.key, options),
level: this._getNodeLevel(node)
}
}
_loadOnOptionChange() {
this._dataSource.load()
}
_isItemEquals(item1, item2) {
if (item1.isSelected !== item2.isSelected) {
return false
}
if (item1.node && item2.node && item1.node.hasChildren !== item2.node.hasChildren) {
return false
}
if (item1.level !== item2.level || item1.isExpanded !== item2.isExpanded) {
return false
}
return super._isItemEquals.apply(this, arguments)
}
_isCellChanged(oldRow, newRow, visibleRowIndex, columnIndex, isLiveUpdate) {
const firstDataColumnIndex = this._columnsController.getFirstDataColumnIndex();
if (columnIndex === firstDataColumnIndex && oldRow.isSelected !== newRow.isSelected) {
return true
}
return super._isCellChanged.apply(this, arguments)
}
init() {
this.createAction("onRowExpanding");
this.createAction("onRowExpanded");
this.createAction("onRowCollapsing");
this.createAction("onRowCollapsed");
super.init.apply(this, arguments)
}
keyOf(data) {
const dataSource = this._dataSource;
if (dataSource) {
return dataSource.keyOf(data)
}
}
key() {
const dataSource = this._dataSource;
if (dataSource) {
return dataSource.getKeyExpr()
}
}
publicMethods() {
return super.publicMethods().concat(["expandRow", "collapseRow", "isRowExpanded", "getRootNode", "getNodeByKey", "loadDescendants", "forEachNode"])
}
changeRowExpand(key) {
if (this._dataSource) {
const args = {
key: key
};
const isExpanded = this.isRowExpanded(key);
this.executeAction(isExpanded ? "onRowCollapsing" : "onRowExpanding", args);
if (!args.cancel) {
return this._dataSource.changeRowExpand(key).done(() => {
this.executeAction(isExpanded ? "onRowCollapsed" : "onRowExpanded", args)
})
}
}
return (new _deferred.Deferred).resolve()
}
isRowExpanded(key, cache) {
return this._dataSource && this._dataSource.isRowExpanded(key, cache)
}
expandRow(key) {
if (!this.isRowExpanded(key)) {
return this.changeRowExpand(key)
}
return (new _deferred.Deferred).resolve()
}
collapseRow(key) {
if (this.isRowExpanded(key)) {
return this.changeRowExpand(key)
}
return (new _deferred.Deferred).resolve()
}
getRootNode() {
return this._dataSource && this._dataSource.getRootNode()
}
optionChanged(args) {
switch (args.name) {
case "rootValue":
case "parentIdExpr":
case "itemsExpr":
case "filterMode":
case "expandNodesOnFiltering":
case "autoExpandAll":
case "hasItemsExpr":
case "dataStructure":
this._columnsController.reset();
this._items = [];
this._refreshDataSource();
args.handled = true;
break;
case "expandedRowKeys":
case "onNodesInitialized":
if (this._dataSource && !this._dataSource._isNodesInitializing && !(0, _common.equalByValue)(args.value, args.previousValue)) {
this._loadOnOptionChange()
}
args.handled = true;
break;
case "maxFilterLengthInRequest":
args.handled = true;
break;
default:
super.optionChanged(args)
}
}
getNodeByKey(key) {
if (!this._dataSource) {
return
}
return this._dataSource.getNodeByKey(key)
}
getChildNodeKeys(parentKey) {
if (!this._dataSource) {
return
}
return this._dataSource.getChildNodeKeys(parentKey)
}
loadDescendants(keys, childrenOnly) {
if (!this._dataSource) {
return
}
return this._dataSource.loadDescendants(keys, childrenOnly)
}
forEachNode() {
this._dataSource.forEachNode.apply(this, arguments)
}
}
exports.TreeListDataController = TreeListDataController;
_m_core.default.registerModule("data", {
defaultOptions: () => (0, _extend.extend)({}, _m_data_controller.dataControllerModule.defaultOptions(), {
itemsExpr: "items",
parentIdExpr: "parentId",
rootValue: 0,
dataStructure: "plain",
expandedRowKeys: [],
filterMode: "withAncestors",
expandNodesOnFiltering: true,
autoExpandAll: false,
onNodesInitialized: null,
maxFilterLengthInRequest: 1500,
paging: {
enabled: false
}
}),
controllers: {
data: TreeListDataController
}
})
},
39051(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DataSourceAdapterTreeList = void 0;
var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../common/data/array_store */ 80556));
var _array_utils = __webpack_require__( /*! ../../../../common/data/array_utils */ 43792);
var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../common/data/query */ 30771));
var _store_helper = _interopRequireDefault(__webpack_require__( /*! ../../../../common/data/store_helper */ 66177));
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _data = __webpack_require__( /*! ../../../../core/utils/data */ 31e3);
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 21274);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 35185));
var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/data_source_adapter/m_data_source_adapter */ 3120));
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_utils */ 53226));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 99477));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const {
queryByOptions: queryByOptions
} = _store_helper.default;
const isFullBranchFilterMode = that => "fullBranch" === that.option("filterMode");
const applySorting = (data, sort) => queryByOptions((0, _query.default)(data), {
sort: sort
}).toArray();
class DataSourceAdapterTreeList extends _m_data_source_adapter.default {
_createKeyGetter() {
const keyExpr = this.getKeyExpr();
return (0, _data.compileGetter)(keyExpr)
}
_createKeySetter() {
const keyExpr = this.getKeyExpr();
if ((0, _type.isFunction)(keyExpr)) {
return keyExpr
}
return (0, _data.compileSetter)(keyExpr)
}
createParentIdGetter() {
return (0, _data.compileGetter)(this.option("parentIdExpr"))
}
createParentIdSetter() {
const parentIdExpr = this.option("parentIdExpr");
if ((0, _type.isFunction)(parentIdExpr)) {
return parentIdExpr
}
return (0, _data.compileSetter)(parentIdExpr)
}
_createItemsGetter() {
return (0, _data.compileGetter)(this.option("itemsExpr"))
}
_createHasItemsGetter() {
const hasItemsExpr = this.option("hasItemsExpr");
return hasItemsExpr && (0, _data.compileGetter)(hasItemsExpr)
}
_createHasItemsSetter() {
const hasItemsExpr = this.option("hasItemsExpr");
if ((0, _type.isFunction)(hasItemsExpr)) {
return hasItemsExpr
}
return hasItemsExpr && (0, _data.compileSetter)(hasItemsExpr)
}
_updateIndexByKeyObject(items) {
const that = this;
that._indexByKey = {};
(0, _iterator.each)(items, (index, item) => {
that._indexByKey[item.key] = index
})
}
_calculateHasItems(node, options) {
const that = this;
const {
parentIds: parentIds
} = options.storeLoadOptions;
let hasItems;
const isFullBranch = isFullBranchFilterMode(that);
if (that._hasItemsGetter && (parentIds || !options.storeLoadOptions.filter || isFullBranch)) {
hasItems = that._hasItemsGetter(node.data)
}
if (void 0 === hasItems) {
if (!that._isChildrenLoaded[node.key] && options.remoteOperations.filtering && (parentIds || isFullBranch)) {
hasItems = true
} else if (options.loadOptions.filter && !options.remoteOperations.filtering && isFullBranch) {
hasItems = node.children.length
} else {
hasItems = node.hasChildren
}
}
return !!hasItems
}
_fillVisibleItemsByNodes(nodes, options, result) {
for (let i = 0; i < nodes.length; i++) {
if (nodes[i].visible) {
result.push(nodes[i])
}
if ((this.isRowExpanded(nodes[i].key, options) || !nodes[i].visible) && nodes[i].hasChildren && nodes[i].children.length) {
this._fillVisibleItemsByNodes(nodes[i].children, options, result)
}
}
}
_convertItemToNode(item, rootValue, nodeByKey) {
const key = this._keyGetter(item);
let parentId = this._parentIdGetter(item);
parentId = (0, _type.isDefined)(parentId) ? parentId : rootValue;
const parentNode = nodeByKey[parentId] = nodeByKey[parentId] || {
key: parentId,
children: []
};
const node = nodeByKey[key] = nodeByKey[key] || {
key: key,
children: []
};
node.data = item;
node.parent = parentNode;
return node
}
_createNodesByItems(items, visibleItems) {
const that = this;
const rootValue = that.option("rootValue");
const visibleByKey = {};
const nodeByKey = that._nodeByKey = {};
let i;
if (visibleItems) {
for (i = 0; i < visibleItems.length; i++) {
visibleByKey[this._keyGetter(visibleItems[i])] = true
}
}
for (i = 0; i < items.length; i++) {
const node = that._convertItemToNode(items[i], rootValue, nodeByKey);
if (void 0 === node.key) {
return
}
node.visible = !visibleItems || !!visibleByKey[node.key];
if (node.parent) {
node.parent.children.push(node)
}
}
const rootNode = nodeByKey[rootValue] || {
key: rootValue,
children: []
};
rootNode.level = -1;
return rootNode
}
_convertDataToPlainStructure(data, parentId, result) {
let key;
if (this._itemsGetter && !data.isConverted) {
result = result || [];
for (let i = 0; i < data.length; i++) {
const item = (0, _array_utils.createObjectWithChanges)(data[i]);
key = this._keyGetter(item);
if (void 0 === key) {
key = result.length + 1;
this._keySetter(item, key)
}
this._parentIdSetter(item, void 0 === parentId ? this.option("rootValue") : parentId);
result.push(item);
const childItems = this._itemsGetter(item);
if (childItems && childItems.length) {
this._convertDataToPlainStructure(childItems, key, result);
const itemsExpr = this.option("itemsExpr");
if (!(0, _type.isFunction)(itemsExpr)) {
delete item[itemsExpr]
}
}
}
result.isConverted = true;
return result
}
return data
}
_createIdFilter(field, keys) {
const parentIdFilters = [];
for (let i = 0; i < keys.length; i++) {
parentIdFilters.push([field, "=", keys[i]])
}
return _m_utils.default.combineFilters(parentIdFilters, "or")
}
_customizeRemoteOperations(options, operationTypes) {
super._customizeRemoteOperations.apply(this, arguments);
options.remoteOperations.paging = false;
let expandVisibleNodes = false;
if (this.option("autoExpandAll")) {
options.remoteOperations.sorting = false;
options.remoteOperations.filtering = false;
if ((!this._lastLoadOptions || operationTypes.filtering && !options.storeLoadOptions.filter) && !options.isCustomLoading) {
expandVisibleNodes = true
}
}
if (!options.isCustomLoading) {
this._isReload = this._isReload || operationTypes.reload;
if (!options.cachedStoreData) {
this._isChildrenLoaded = {};
if (this._isReload) {
this._nodeByKey = {}
}
}
if (this.option("expandNodesOnFiltering") && (operationTypes.filtering || this._isReload && options.storeLoadOptions.filter)) {
if (options.storeLoadOptions.filter) {
expandVisibleNodes = true
} else {
options.collapseVisibleNodes = true
}
}
}
options.expandVisibleNodes = expandVisibleNodes
}
_getParentIdsToLoad(parentIds) {
const parentIdsToLoad = [];
for (let i = 0; i < parentIds.length; i++) {
const node = this.getNodeByKey(parentIds[i]);
if (!node || node.hasChildren && !node.children.length) {
parentIdsToLoad.push(parentIds[i])
}
}
return parentIdsToLoad
}
_handleCustomizeStoreLoadOptions(options) {
const rootValue = this.option("rootValue");
const parentIdExpr = this.option("parentIdExpr");
let {
parentIds: parentIds
} = options.storeLoadOptions;
if (parentIds) {
options.isCustomLoading = false
}
super._handleCustomizeStoreLoadOptions.apply(this, arguments);
if (options.remoteOperations.filtering && !options.isCustomLoading) {
if (isFullBranchFilterMode(this) && options.cachedStoreData || !options.storeLoadOptions.filter) {
const expandedRowKeys = options.collapseVisibleNodes ? [] : this.option("expandedRowKeys");
parentIds = [rootValue].concat(expandedRowKeys).concat(parentIds || []);
const parentIdsToLoad = options.data ? this._getParentIdsToLoad(parentIds) : parentIds;
if (parentIdsToLoad.length) {
options.cachedPagingData = void 0;
options.data = void 0;
options.mergeStoreLoadData = true;
options.delay = this.option("loadingTimeout")
}
options.storeLoadOptions.parentIds = parentIdsToLoad;
options.storeLoadOptions.filter = this._createIdFilter(parentIdExpr, parentIdsToLoad)
}
}
}
_generateInfoToLoad(data, needChildren) {
const that = this;
let key;
const keyMap = {};
const resultKeyMap = {};
const resultKeys = [];
const rootValue = that.option("rootValue");
let i;
for (i = 0; i < data.length; i++) {
key = needChildren ? that._parentIdGetter(data[i]) : that._keyGetter(data[i]);
keyMap[key] = true
}
for (i = 0; i < data.length; i++) {
key = needChildren ? that._keyGetter(data[i]) : that._parentIdGetter(data[i]);
const needToLoad = needChildren ? that.isRowExpanded(key) : key !== rootValue;
if (!keyMap[key] && !resultKeyMap[key] && needToLoad) {
resultKeyMap[key] = true;
resultKeys.push(key)
}
}
return {
keyMap: resultKeyMap,
keys: resultKeys
}
}
_isOperationIdOutdated(operationId) {
return void 0 !== operationId && void 0 !== this._lastOperationId && operationId !== this._lastOperationId
}
_loadParentsOrChildren(data, options, needChildren) {
var _options$storeLoadOpt, _options$loadOptions;
if (this._isOperationIdOutdated(options.operationId)) {
this._dataSource.cancel(options.operationId);
const rejectedDeferred = new _deferred.Deferred;
rejectedDeferred.reject();
return rejectedDeferred
}
let filter;
let needLocalFiltering;
const {
keys: keys,
keyMap: keyMap
} = this._generateInfoToLoad(data, needChildren);
const d = new _deferred.Deferred;
const isRemoteFiltering = options.remoteOperations.filtering;
const maxFilterLengthInRequest = this.option("maxFilterLengthInRequest");
const sort = (null === (_options$storeLoadOpt = options.storeLoadOptions) || void 0 === _options$storeLoadOpt ? void 0 : _options$storeLoadOpt.sort) ?? (null === (_options$loadOptions = options.loadOptions) || void 0 === _options$loadOptions ? void 0 : _options$loadOptions.sort);
let loadOptions = isRemoteFiltering ? options.storeLoadOptions : options.loadOptions;
const concatLoadedData = loadedData => {
if (isRemoteFiltering) {
this._cachedStoreData = applySorting(this._cachedStoreData.concat(loadedData), sort)
}
return applySorting(data.concat(loadedData), sort)
};
if (!keys.length) {
return d.resolve(data)
}
let cachedNodes = keys.map(id => this.getNodeByKey(id)).filter(node => node && node.data);
if (cachedNodes.length === keys.length) {
if (needChildren) {
cachedNodes = cachedNodes.reduce((result, node) => result.concat(node.children), [])
}
if (cachedNodes.length) {
return this._loadParentsOrChildren(concatLoadedData(cachedNodes.map(node => node.data)), options, needChildren)
}
}
const keyExpr = needChildren ? this.option("parentIdExpr") : this.getKeyExpr();
filter = this._createIdFilter(keyExpr, keys);
const filterLength = encodeURI(JSON.stringify(filter)).length;
if (filterLength > maxFilterLengthInRequest) {
filter = itemData => keyMap[needChildren ? this._parentIdGetter(itemData) : this._keyGetter(itemData)];
needLocalFiltering = isRemoteFiltering
}
loadOptions = (0, _extend.extend)({}, loadOptions, {
filter: !needLocalFiltering ? filter : null
});
const store = options.fullData ? new _array_store.default(options.fullData) : this._dataSource.store();
this.loadFromStore(loadOptions, store).done(loadedData => {
if (this._isOperationIdOutdated(options.operationId)) {
d.reject();
return
}
if (loadedData.length) {
if (needLocalFiltering) {
loadedData = (0, _query.default)(loadedData).filter(filter).toArray()
}
this._loadParentsOrChildren(concatLoadedData(loadedData), options, needChildren).done(d.resolve).fail(d.reject)
} else {
d.resolve(data)
}
}).fail(d.reject);
return d
}
_loadParents(data, options) {
return this._loadParentsOrChildren(data, options)
}
_loadChildrenIfNeed(data, options) {
if (isFullBranchFilterMode(this)) {
return this._loadParentsOrChildren(data, options, true)
}
return (0, _deferred.when)(data)
}
_updateHasItemsMap(options) {
const {
parentIds: parentIds
} = options.storeLoadOptions;
if (parentIds) {
for (let i = 0; i < parentIds.length; i++) {
this._isChildrenLoaded[parentIds[i]] = true
}
}
}
_getKeyInfo() {
return {
key: () => "key",
keyOf: data => data.key
}
}
_processChanges(changes) {
let processedChanges = [];
changes.forEach(change => {
if ("insert" === change.type) {
processedChanges = processedChanges.concat(this._applyInsert(change))
} else if ("remove" === change.type) {
processedChanges = processedChanges.concat(this._applyRemove(change))
} else if ("update" === change.type) {
processedChanges.push({
type: change.type,
key: change.key,
data: {
data: change.data
}
})
}
});
return processedChanges
}
_handleChanging(e) {
super._handleChanging.apply(this, arguments);
e.postProcessChanges = changes => {
const changesToProcess = changes.filter(item => "update" === item.type);
return this._processChanges(changesToProcess)
}
}
_applyBatch(changes) {
const processedChanges = this._processChanges(changes);
super._applyBatch(processedChanges)
}
_setHasItems(node, value) {
const hasItemsSetter = this._hasItemsSetter;
node.hasChildren = value;
if (hasItemsSetter && node.data) {
hasItemsSetter(node.data, value)
}
}
_applyInsert(change) {
const that = this;
const baseChanges = [];
const parentId = that.parentKeyOf(change.data);
const parentNode = that.getNodeByKey(parentId);
if (parentNode) {
const rootValue = that.option("rootValue");
const node = that._convertItemToNode(change.data, rootValue, that._nodeByKey);
node.hasChildren = false;
node.level = parentNode.level + 1;
node.visible = true;
parentNode.children.push(node);
that._isChildrenLoaded[node.key] = true;
that._setHasItems(parentNode, true);
if ((!parentNode.parent || that.isRowExpanded(parentNode.key)) && void 0 !== change.index) {
let index = that.items().indexOf(parentNode) + 1;
index += change.index >= 0 ? Math.min(change.index, parentNode.children.length) : parentNode.children.length;
baseChanges.push({
type: change.type,
data: node,
index: index
})
}
}
return baseChanges
}
_needToCopyDataObject() {
return false
}
_applyRemove(change) {
let baseChanges = [];
const node = this.getNodeByKey(change.key);
const parentNode = node && node.parent;
if (parentNode) {
const index = parentNode.children.indexOf(node);
if (index >= 0) {
parentNode.children.splice(index, 1);
if (!parentNode.children.length) {
this._setHasItems(parentNode, false)
}
baseChanges.push(change);
baseChanges = baseChanges.concat(this.getChildNodeKeys(change.key).map(key => ({
type: change.type,
key: key
})))
}
}
return baseChanges
}
_handleDataLoaded(options) {
const data = options.data = this._convertDataToPlainStructure(options.data);
if (!options.remoteOperations.filtering && options.loadOptions.filter) {
options.fullData = queryByOptions((0, _query.default)(options.data), {
sort: options.loadOptions && options.loadOptions.sort
}).toArray()
}
this._updateHasItemsMap(options);
super._handleDataLoaded(options);
if (data.isConverted && this._cachedStoreData) {
this._cachedStoreData.isConverted = true
}
}
_fillNodes(nodes, options, expandedRowKeys, level) {
const isFullBranch = isFullBranchFilterMode(this);
level = level || 0;
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
let needToExpand = false;
this._fillNodes(nodes[i].children, options, expandedRowKeys, level + 1);
node.level = level;
node.hasChildren = this._calculateHasItems(node, options);
if (node.visible && node.hasChildren) {
if (isFullBranch) {
if (node.children.filter(node => node.visible).length) {
needToExpand = true
} else if (node.children.length) {
_m_core.default.foreachNodes(node.children, node => {
node.visible = true
})
}
} else {
needToExpand = true
}
if (options.expandVisibleNodes && needToExpand) {
expandedRowKeys.push(node.key)
}
}
if (node.visible || node.hasChildren) {
node.parent.hasChildren = true
}
}
}
_processTreeStructure(options, visibleItems) {
let {
data: data
} = options;
const {
parentIds: parentIds
} = options.storeLoadOptions;
const expandedRowKeys = [];
if (parentIds && parentIds.length || this._isReload) {
if (options.fullData) {
data = options.fullData;
visibleItems = visibleItems || options.data
}
this._rootNode = this._createNodesByItems(data, visibleItems);
if (!this._rootNode) {
options.data = (new _deferred.Deferred).reject(_ui.default.Error("E1046", this.getKeyExpr()));
return
}
this._fillNodes(this._rootNode.children, options, expandedRowKeys);
this._isNodesInitializing = true;
if (options.collapseVisibleNodes || expandedRowKeys.length) {
this.option("expandedRowKeys", expandedRowKeys)
}
this._isReload = false;
this.executeAction("onNodesInitialized", {
root: this._rootNode
});
this._isNodesInitializing = false
}
const resultData = [];
this._fillVisibleItemsByNodes(this._rootNode.children, options, resultData);
options.data = resultData;
this._totalItemsCount = resultData.length
}
_handleDataLoadedCore(options) {
const that = this;
const {
data: data
} = options;
const filter = options.storeLoadOptions.filter || options.loadOptions.filter;
const filterMode = that.option("filterMode");
let visibleItems;
const {
parentIds: parentIds
} = options.storeLoadOptions;
const needLoadParents = filter && (!parentIds || !parentIds.length) && "standard" !== filterMode;
if (!options.isCustomLoading) {
if (needLoadParents) {
const d = options.data = new _deferred.Deferred;
if ("matchOnly" === filterMode) {
visibleItems = data
}
return that._loadParents(data, options).done(data => {
that._loadChildrenIfNeed(data, options).done(data => {
options.data = data;
that._processTreeStructure(options, visibleItems);
super._handleDataLoadedCore.call(that, options);
d.resolve(options.data)
})
}).fail(d.reject)
}
that._processTreeStructure(options)
}
super._handleDataLoadedCore(options)
}
_handlePush(_ref) {
let {
changes: changes
} = _ref;
const reshapeOnPush = this._dataSource._reshapeOnPush;
const isNeedReshape = reshapeOnPush && !!changes.length;
if (isNeedReshape) {
this._isReload = true
}
changes.forEach(change => {
change.index ?? (change.index = -1)
});
super._handlePush.apply(this, arguments)
}
init(dataSource, remoteOperations) {
super.init.apply(this, arguments);
const dataStructure = this.option("dataStructure");
this._keyGetter = this._createKeyGetter();
this._parentIdGetter = this.createParentIdGetter();
this._hasItemsGetter = this._createHasItemsGetter();
this._hasItemsSetter = this._createHasItemsSetter();
if ("tree" === dataStructure) {
this._itemsGetter = this._createItemsGetter();
this._keySetter = this._createKeySetter();
this._parentIdSetter = this.createParentIdSetter()
}
this._nodeByKey = {};
this._isChildrenLoaded = {};
this._totalItemsCount = 0;
this.createAction("onNodesInitialized")
}
getKeyExpr() {
const store = this.store();
const key = store && store.key();
const keyExpr = this.option("keyExpr");
if ((0, _type.isDefined)(key) && (0, _type.isDefined)(keyExpr)) {
if (!(0, _common.equalByValue)(key, keyExpr)) {
throw _ui.default.Error("E1044")
}
}
return key || keyExpr || "id"
}
keyOf(data) {
return this._keyGetter && this._keyGetter(data)
}
parentKeyOf(data) {
return this._parentIdGetter && this._parentIdGetter(data)
}
getRootNode() {
return this._rootNode
}
totalItemsCount() {
return this._totalItemsCount + this._totalCountCorrection
}
isRowExpanded(key, cache) {
if (cache) {
let {
isExpandedByKey: isExpandedByKey
} = cache;
if (!isExpandedByKey) {
const expandedRowKeys = this.option("expandedRowKeys") ?? [];
isExpandedByKey = cache.isExpandedByKey = {};
expandedRowKeys.forEach(key => {
isExpandedByKey[key] = true
})
}
return !!isExpandedByKey[key]
}
const indexExpandedNodeKey = _m_utils.default.getIndexByKey(key, this.option("expandedRowKeys"), null);
return indexExpandedNodeKey >= 0
}
_changeRowExpandCore(key) {
const expandedRowKeys = this.option("expandedRowKeys").slice();
const indexExpandedNodeKey = _m_utils.default.getIndexByKey(key, expandedRowKeys, null);
if (indexExpandedNodeKey < 0) {
expandedRowKeys.push(key)
} else {
expandedRowKeys.splice(indexExpandedNodeKey, 1)
}
this.option("expandedRowKeys", expandedRowKeys)
}
changeRowExpand(key) {
this._changeRowExpandCore(key);
return this._isNodesInitializing ? (new _deferred.Deferred).resolve() : this.load()
}
getNodeByKey(key) {
if (this._nodeByKey) {
return this._nodeByKey[key]
}
}
getNodeLeafKeys() {
const that = this;
const result = [];
const keys = that._rootNode ? [that._rootNode.key] : [];
keys.forEach(key => {
const node = that.getNodeByKey(key);
node && _m_core.default.foreachNodes([node], childNode => {
!childNode.children.length && result.push(childNode.key)
})
});
return result
}
getChildNodeKeys(parentKey) {
const node = this.getNodeByKey(parentKey);
const childrenKeys = [];
node && _m_core.default.foreachNodes(node.children, childNode => {
childrenKeys.push(childNode.key)
});
return childrenKeys
}
loadDescendants(keys, childrenOnly) {
const that = this;
const d = new _deferred.Deferred;
const remoteOperations = that.remoteOperations();
if ((0, _type.isDefined)(keys)) {
keys = Array.isArray(keys) ? keys : [keys]
} else {
keys = that.getNodeLeafKeys()
}
if (!remoteOperations.filtering || !keys.length) {
return d.resolve()
}
const loadOptions = that._dataSource._createStoreLoadOptions();
loadOptions.parentIds = keys;
that.load(loadOptions).done(() => {
if (!childrenOnly) {
const childKeys = function(that, keys) {
const childKeys = [];
keys.forEach(key => {
const node = that.getNodeByKey(key);
node && node.children.forEach(child => {
childKeys.push(child.key)
})
});
return childKeys
}(that, keys);
if (childKeys.length) {
that.loadDescendants(childKeys, childrenOnly).done(d.resolve).fail(d.reject);
return
}
}
d.resolve()
}).fail(d.reject);
return d.promise()
}
forEachNode() {
let nodes = [];
let callback;
if (1 === arguments.length) {
callback = arguments[0];
const rootNode = this.getRootNode();
nodes = rootNode && rootNode.children || []
} else if (2 === arguments.length) {
callback = arguments[1];
nodes = arguments[0];
nodes = Array.isArray(nodes) ? nodes : [nodes]
}
_m_core.default.foreachNodes(nodes, callback)
}
}
exports.DataSourceAdapterTreeList = DataSourceAdapterTreeList;
let DataSourceAdapterTreeListType = DataSourceAdapterTreeList;
exports.default = {
extend(extender) {
DataSourceAdapterTreeListType = extender(DataSourceAdapterTreeListType)
},
create: component => new DataSourceAdapterTreeListType(component)
}
},
53343(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
__webpack_require__( /*! ../module_not_extended/editor_factory */ 16109);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/message */ 4671));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 64553));
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 35185));
var _m_editing = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing */ 13876);
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_utils */ 53226));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 99477));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class EditingController extends _m_editing.editingModule.controllers.editing {
_generateNewItem(key) {
const item = super._generateNewItem(key);
item.data = {
key: key
};
item.children = [];
item.level = 0;
item.parentKey = this.option("rootValue");
return item
}
_isProcessedItem() {
return true
}
_setInsertAfterOrBeforeKey(change, parentKey) {
const dataSourceAdapter = this._dataController.dataSource();
const key = parentKey || (null === dataSourceAdapter || void 0 === dataSourceAdapter ? void 0 : dataSourceAdapter.parentKeyOf(change.data));
if (void 0 !== key && key !== this.option("rootValue")) {
change.insertAfterKey = key
} else {
super._setInsertAfterOrBeforeKey.apply(this, arguments)
}
}
_getLoadedRowIndex(items, change) {
const dataSourceAdapter = this._dataController.dataSource();
const parentKey = null === dataSourceAdapter || void 0 === dataSourceAdapter ? void 0 : dataSourceAdapter.parentKeyOf(change.data);
if (void 0 !== parentKey && parentKey !== this.option("rootValue")) {
const rowIndex = _m_utils.default.getIndexByKey(parentKey, items);
if (rowIndex >= 0 && this._dataController.isRowExpanded(parentKey)) {
return super._getLoadedRowIndex.apply(this, arguments)
}
return -1
}
return super._getLoadedRowIndex.apply(this, arguments)
}
_isEditColumnVisible() {
const result = super._isEditColumnVisible.apply(this, arguments);
const editingOptions = this.option("editing");
return result || editingOptions.allowAdding
}
_isDefaultButtonVisible(button, options) {
const result = super._isDefaultButtonVisible.apply(this, arguments);
const {
row: row
} = options;
if ("add" === button.name) {
return this.allowAdding(options) && row.rowIndex !== this._getVisibleEditRowIndex() && !(row.removed || row.isNewRow)
}
return result
}
_getEditingButtons(options) {
const buttons = super._getEditingButtons.apply(this, arguments);
if (!options.column.buttons) {
buttons.unshift(this._getButtonConfig("add", options))
}
return buttons
}
_beforeSaveEditData(change) {
const result = super._beforeSaveEditData.apply(this, arguments);
if (change && "insert" !== change.type) {
var _this$_dataController;
const store = null === (_this$_dataController = this._dataController) || void 0 === _this$_dataController ? void 0 : _this$_dataController.store();
const key = null === store || void 0 === store ? void 0 : store.key();
if (!(0, _type.isDefined)(key)) {
throw _ui.default.Error("E1045")
}
}
return result
}
addRowByRowIndex(rowIndex) {
const row = this._dataController.getVisibleRows()[rowIndex];
return this.addRow(row ? row.key : void 0)
}
addRow(key) {
if (void 0 === key) {
key = this.option("rootValue")
}
return super.addRow.call(this, key)
}
_addRowCore(data, parentKey, oldEditRowIndex) {
const rootValue = this.option("rootValue");
const dataSourceAdapter = this._dataController.dataSource();
const parentKeyGetter = dataSourceAdapter.createParentIdGetter();
parentKey = parentKeyGetter(data);
if (void 0 !== parentKey && parentKey !== rootValue && !this._dataController.isRowExpanded(parentKey)) {
const deferred = new _deferred.Deferred;
this._dataController.expandRow(parentKey).done(() => {
setTimeout(() => {
super._addRowCore.call(this, data, parentKey, oldEditRowIndex).done(deferred.resolve).fail(deferred.reject)
})
}).fail(deferred.reject);
return deferred.promise()
}
return super._addRowCore.call(this, data, parentKey, oldEditRowIndex)
}
_initNewRow(options, parentKey) {
const dataSourceAdapter = this._dataController.dataSource();
const parentIdSetter = dataSourceAdapter.createParentIdSetter();
parentIdSetter(options.data, parentKey);
return super._initNewRow.apply(this, arguments)
}
allowAdding(options) {
return this._allowEditAction("allowAdding", options)
}
_needToCloseEditableCell($targetElement) {
return super._needToCloseEditableCell.apply(this, arguments) || $targetElement.closest(".dx-treelist-icon-container").length && this.isEditing()
}
getButtonLocalizationNames() {
const names = super.getButtonLocalizationNames.apply(this);
names.add = "dxTreeList-editingAddRowToNode";
return names
}
}
_m_core.default.registerModule("editing", {
defaultOptions: () => (0, _extend.extend)(true, _m_editing.editingModule.defaultOptions(), {
editing: {
texts: {
addRowToNode: _message.default.format("dxTreeList-editingAddRowToNode")
}
}
}),
controllers: {
editing: EditingController
},
extenders: {
controllers: {
data: Base => class extends((0, _m_editing.dataControllerEditingExtenderMixin)(Base)) {
changeRowExpand() {
this._editingController.refresh();
return super.changeRowExpand.apply(this, arguments)
}
}
},
views: {
rowsView: Base => class extends(_m_editing.editingModule.extenders.views.rowsView(Base)) {
_renderCellCommandContent($container, options) {
const editingController = this._editingController;
const isEditRow = options.row && editingController.isEditRow(options.row.rowIndex);
const isEditing = options.isEditing || isEditRow;
if (!options.isOnForm && !isEditing) {
return super._renderCellCommandContent.apply(this, arguments)
}
return false
}
validateClick(e) {
const $targetElement = (0, _renderer.default)(e.event.target);
const originalClickHandler = "dxdblclick" === e.event.type ? super._rowDblClick : super._rowClick;
if ($targetElement.closest(".dx-select-checkbox").length) {
return false
}
return !this.needToCallOriginalClickHandler(e, originalClickHandler)
}
needToCallOriginalClickHandler(e, originalClickHandler) {
const $targetElement = (0, _renderer.default)(e.event.target);
if (!$targetElement.closest(".dx-treelist-icon-container").length) {
originalClickHandler.call(this, e);
return true
}
return false
}
_rowClick(e) {
if (this.validateClick(e)) {
super._rowClickTreeListHack.apply(this, arguments)
}
}
_rowDblClick(e) {
if (this.validateClick(e)) {
super._rowDblClickTreeListHack.apply(this, arguments)
}
}
},
headerPanel: _m_editing.editingModule.extenders.views.headerPanel
}
}
})
},
84538(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _m_columns_controller = __webpack_require__( /*! ../../grids/grid_core/columns_controller/m_columns_controller */ 17798);
var _m_core = (e = __webpack_require__( /*! ./m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
class TreeListColumnsController extends _m_columns_controller.ColumnsController {
_getFirstItems(dataSourceAdapter) {
return super._getFirstItems(dataSourceAdapter).map(node => node.data)
}
getFirstDataColumnIndex() {
const visibleColumns = this.getVisibleColumns();
const visibleColumnsLength = visibleColumns.length;
let firstDataColumnIndex = 0;
for (let i = 0; i <= visibleColumnsLength - 1; i++) {
if (!(0, _type.isDefined)(visibleColumns[i].command)) {
firstDataColumnIndex = visibleColumns[i].index;
break
}
}
return firstDataColumnIndex
}
}
_m_core.default.registerModule("columns", {
defaultOptions: _m_columns_controller.columnsControllerModule.defaultOptions,
controllers: {
columns: TreeListColumnsController
}
})
},
99477(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _m_modules = (e = __webpack_require__( /*! ../../grids/grid_core/m_modules */ 74854), e && e.__esModule ? e : {
default: e
});
var e;
exports.default = (0, _extend.extend)({}, _m_modules.default, {
modules: [],
foreachNodes(nodes, callBack, ignoreHasChildren) {
for (let i = 0; i < nodes.length; i++) {
if (false !== callBack(nodes[i]) && (ignoreHasChildren || nodes[i].hasChildren) && nodes[i].children.length) {
this.foreachNodes(nodes[i].children, callBack, ignoreHasChildren)
}
}
}
})
},
4788(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 87739);
var _m_focus = __webpack_require__( /*! ../../grids/grid_core/focus/m_focus */ 51628);
var _m_core = (e = __webpack_require__( /*! ./m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("focus", Object.assign({}, _m_focus.focusModule, {
extenders: Object.assign({}, _m_focus.focusModule.extenders, {
controllers: Object.assign({}, _m_focus.focusModule.extenders.controllers, {
data: Base => class extends(_m_focus.focusModule.extenders.controllers.data(Base)) {
changeRowExpand(key) {
if (this.option("focusedRowEnabled") && this.isRowExpanded(key)) {
if (this._isFocusedRowInside(key)) {
this.option("focusedRowKey", key)
}
}
return super.changeRowExpand.apply(this, arguments)
}
_isFocusedRowInside(parentKey) {
const focusedRowKey = this.option("focusedRowKey");
const rowIndex = this.getRowIndexByKey(focusedRowKey);
const focusedRow = rowIndex >= 0 && this.getVisibleRows()[rowIndex];
let parent = focusedRow && focusedRow.node.parent;
while (parent) {
if (parent.key === parentKey) {
return true
}
parent = parent.parent
}
return false
}
getParentKey(key) {
const dataSource = this._dataSource;
const node = this.getNodeByKey(key);
const d = new _deferred.Deferred;
if (node) {
d.resolve(node.parent ? node.parent.key : void 0)
} else {
dataSource.load({
filter: [dataSource.getKeyExpr(), "=", key]
}).done(items => {
const parentData = items[0];
if (parentData) {
d.resolve(dataSource.parentKeyOf(parentData))
} else {
d.resolve()
}
}).fail(d.reject)
}
return d.promise()
}
expandAscendants(key) {
const that = this;
const dataSource = that._dataSource;
const d = new _deferred.Deferred;
that.getParentKey(key).done(parentKey => {
if (dataSource && void 0 !== parentKey && parentKey !== that.option("rootValue")) {
dataSource._isNodesInitializing = true;
that.expandRow(parentKey);
dataSource._isNodesInitializing = false;
that.expandAscendants(parentKey).done(d.resolve).fail(d.reject)
} else {
d.resolve()
}
}).fail(d.reject);
return d.promise()
}
getPageIndexByKey(key) {
const that = this;
const dataSource = that._dataSource;
const d = new _deferred.Deferred;
that.expandAscendants(key).done(() => {
dataSource.load({
parentIds: []
}).done(nodes => {
const offset = function(items, callback) {
let result = -1;
items.forEach((node, index) => {
if (callback(node)) {
result = index
}
});
return result
}(nodes, node => that.keyOf(node.data) === key);
let pageIndex = -1;
if (offset >= 0) {
pageIndex = Math.floor(offset / that.pageSize())
}
d.resolve(pageIndex)
}).fail(d.reject)
}).fail(d.reject);
return d.promise()
}
}
})
})
}))
},
77188(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_grid_view = __webpack_require__( /*! ../../grids/grid_core/views/m_grid_view */ 33706);
var _m_core = (e = __webpack_require__( /*! ./m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
class TreeListResizingController extends _m_grid_view.ResizingController {
constructor() {
super(...arguments);
this._expandableWidgetAriaId = "dxTreeList-ariaExpandableInstruction"
}
_getWidgetAriaLabel() {
return "dxTreeList-ariaTreeList"
}
_toggleBestFitMode(isBestFit) {
super._toggleBestFitMode(isBestFit);
const $rowsTable = this._rowsView.getTableElement();
$rowsTable.find(".dx-treelist-cell-expandable").toggleClass(this.addWidgetPrefix("best-fit"), isBestFit)
}
}
_m_core.default.registerModule("gridView", {
defaultOptions: _m_grid_view.gridViewModule.defaultOptions,
controllers: Object.assign({}, _m_grid_view.gridViewModule.controllers, {
resizing: TreeListResizingController
}),
views: _m_grid_view.gridViewModule.views
})
},
90264(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _m_keyboard_navigation = __webpack_require__( /*! ../../grids/grid_core/keyboard_navigation/m_keyboard_navigation */ 4628);
var _scrollable_a11y = __webpack_require__( /*! ../../grids/grid_core/keyboard_navigation/scrollable_a11y */ 47526);
var _m_core = (e = __webpack_require__( /*! ./m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("keyboardNavigation", (0, _extend.extend)(true, {}, _m_keyboard_navigation.keyboardNavigationModule, {
extenders: {
controllers: {
keyboardNavigation: Base => class extends((0, _scrollable_a11y.keyboardNavigationScrollableA11yExtender)(Base)) {
_leftRightKeysHandler(eventArgs, _isEditing) {
const rowIndex = this.getVisibleRowIndex();
const dataController = this._dataController;
if (eventArgs.ctrl) {
const directionCode = this._getDirectionCodeByKey(eventArgs.keyName);
const key = dataController.getKeyByRowIndex(rowIndex);
if ("nextInRow" === directionCode) {
dataController.expandRow(key)
} else {
dataController.collapseRow(key)
}
} else {
return super._leftRightKeysHandler.apply(this, arguments)
}
}
}
}
}
}))
},
62434(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _m_master_detail = __webpack_require__( /*! ../../grids/grid_core/master_detail/m_master_detail */ 11052);
var _m_core = (e = __webpack_require__( /*! ./m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("masterDetail", (0, _extend.extend)(true, {}, _m_master_detail.masterDetailModule, {
extenders: {
controllers: {
data: Base => class extends((0, _m_master_detail.dataMasterDetailExtenderMixin)(Base)) {
isRowExpanded() {
return this.isRowExpandedHack.apply(this, arguments)
}
_processItems() {
return this._processItemsHack.apply(this, arguments)
}
_processDataItem() {
return this._processDataItemHack.apply(this, arguments)
}
}
}
}
}))
},
30816(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_state_storing = __webpack_require__( /*! ../../grids/grid_core/state_storing/m_state_storing */ 87960);
var _m_core = (e = __webpack_require__( /*! ./m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("stateStoring", Object.assign({}, _m_state_storing.stateStoringModule, {
extenders: Object.assign({}, _m_state_storing.stateStoringModule.extenders, {
controllers: Object.assign({}, _m_state_storing.stateStoringModule.extenders.controllers, {
stateStoring: Base => class extends(_m_state_storing.stateStoringModule.extenders.controllers.stateStoring(Base)) {
applyState(state) {
super.applyState(state);
this.option("expandedRowKeys", state.expandedRowKeys ? state.expandedRowKeys.slice() : [])
}
},
data: Base => class extends(_m_state_storing.stateStoringModule.extenders.controllers.data(Base)) {
getUserState() {
const state = super.getUserState();
if (!this.option("autoExpandAll")) {
state.expandedRowKeys = this.option("expandedRowKeys")
}
return state
}
}
})
})
}))
},
52735(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_validating = __webpack_require__( /*! ../../grids/grid_core/validating/m_validating */ 52932);
var _m_core = (e = __webpack_require__( /*! ./m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("validating", {
defaultOptions: _m_validating.validatingModule.defaultOptions,
controllers: _m_validating.validatingModule.controllers,
extenders: {
controllers: {
editing: Base => class extends(_m_validating.validatingModule.extenders.controllers.editing(Base)) {
processDataItem(item) {
super.processDataItemTreeListHack.apply(this, arguments)
}
processItems(items, e) {
return super.processItemsTreeListHack.apply(this, arguments)
}
},
editorFactory: _m_validating.validatingModule.extenders.controllers.editorFactory
},
views: _m_validating.validatingModule.extenders.views
}
})
},
21291(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 53226));
var _m_virtual_scrolling = __webpack_require__( /*! ../../grids/grid_core/virtual_scrolling/m_virtual_scrolling */ 21640);
var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ./data_source_adapter/m_data_source_adapter */ 39051));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 99477));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const oldDefaultOptions = _m_virtual_scrolling.virtualScrollingModule.defaultOptions;
_m_virtual_scrolling.virtualScrollingModule.extenders.views.rowsView = Base => class extends((0, _m_virtual_scrolling.rowsView)(Base)) {
_handleDataChanged(e) {
const {
operationTypes: operationTypes
} = e;
if (null !== e && void 0 !== e && e.isDataChanged && _m_utils.default.isVirtualRowRendering(this) && operationTypes) {
const {
fullReload: fullReload,
pageIndex: pageIndex
} = operationTypes;
if (!fullReload && pageIndex) {
this._updateContentPosition()
}
}
super._handleDataChanged(e)
}
};
_m_virtual_scrolling.virtualScrollingModule.extenders.controllers.data = Base => class extends((0, _m_virtual_scrolling.data)(Base)) {
_loadOnOptionChange() {
var _this$_dataSource;
const virtualScrollController = null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource ? void 0 : _this$_dataSource._virtualScrollController;
null === virtualScrollController || void 0 === virtualScrollController || virtualScrollController.reset();
super._loadOnOptionChange()
}
};
_m_core.default.registerModule("virtualScrolling", Object.assign({}, _m_virtual_scrolling.virtualScrollingModule, {
defaultOptions: () => (0, _extend.extend)(true, oldDefaultOptions(), {
scrolling: {
mode: "virtual"
}
})
}));
_m_data_source_adapter.default.extend(Base => class extends((0, _m_virtual_scrolling.dataSourceAdapterExtender)(Base)) {
changeRowExpand() {
return super.changeRowExpand.apply(this, arguments).done(() => {
const viewportItemIndex = this.getViewportItemIndex();
viewportItemIndex >= 0 && this.setViewportItemIndex(viewportItemIndex)
})
}
})
},
62514(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _m_widget_base = (e = __webpack_require__( /*! ./m_widget_base */ 7444), e && e.__esModule ? e : {
default: e
});
var e;
__webpack_require__( /*! ./m_state_storing */ 30816);
__webpack_require__( /*! ./module_not_extended/ai_column */ 71132);
__webpack_require__( /*! ./module_not_extended/column_chooser */ 22697);
__webpack_require__( /*! ./m_master_detail */ 62434);
__webpack_require__( /*! ./editing/m_editing */ 53343);
__webpack_require__( /*! ./module_not_extended/editing_row_based */ 76446);
__webpack_require__( /*! ./module_not_extended/editing_form_based */ 99446);
__webpack_require__( /*! ./module_not_extended/editing_cell_based */ 56876);
__webpack_require__( /*! ./m_validating */ 52735);
__webpack_require__( /*! ./m_virtual_scrolling */ 21291);
__webpack_require__( /*! ./module_not_extended/filter_row */ 47988);
__webpack_require__( /*! ./module_not_extended/header_filter */ 63449);
__webpack_require__( /*! ./module_not_extended/filter_sync */ 56065);
__webpack_require__( /*! ./module_not_extended/filter_builder */ 49219);
__webpack_require__( /*! ./module_not_extended/filter_panel */ 53242);
__webpack_require__( /*! ./module_not_extended/pager */ 92906);
__webpack_require__( /*! ./module_not_extended/columns_resizing_reordering */ 11956);
__webpack_require__( /*! ./module_not_extended/sticky_columns */ 40882);
__webpack_require__( /*! ./module_not_extended/column_fixing */ 3967);
__webpack_require__( /*! ./module_not_extended/adaptivity */ 73996);
__webpack_require__( /*! ./selection/m_selection */ 17463);
__webpack_require__( /*! ./module_not_extended/search */ 51565);
__webpack_require__( /*! ./m_keyboard_navigation */ 90264);
__webpack_require__( /*! ./module_not_extended/headers_keyboard_navigation */ 43644);
__webpack_require__( /*! ./module_not_extended/virtual_columns */ 47890);
__webpack_require__( /*! ./m_focus */ 4788);
__webpack_require__( /*! ./module_not_extended/row_dragging */ 40190);
__webpack_require__( /*! ./module_not_extended/toast */ 60446);
exports.default = _m_widget_base.default
},
7444(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
__webpack_require__( /*! ./module_not_extended/column_headers */ 62602);
__webpack_require__( /*! ./m_columns_controller */ 84538);
__webpack_require__( /*! ./data_controller/m_data_controller */ 46331);
__webpack_require__( /*! ./module_not_extended/sorting */ 63017);
__webpack_require__( /*! ./rows/m_rows */ 86435);
__webpack_require__( /*! ./module_not_extended/context_menu */ 72714);
__webpack_require__( /*! ./module_not_extended/error_handling */ 60607);
__webpack_require__( /*! ./m_grid_view */ 77188);
__webpack_require__( /*! ./module_not_extended/header_panel */ 2765);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 52071);
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 53226));
var _m_widget_base = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_widget_base */ 99335));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 99477));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
_m_core.default.registerModulesOrder(["stateStoring", "columns", "selection", "editorFactory", "columnChooser", "editingRowBased", "editingFormBased", "editingCellBased", "editing", "grouping", "masterDetail", "validating", "adaptivity", "data", "virtualScrolling", "aiColumn", "columnHeaders", "filterRow", "headerPanel", "headerFilter", "sorting", "search", "rows", "pager", "columnsResizingReordering", "contextMenu", "keyboardNavigation", "headersKeyboardNavigation", "errorHandling", "summary", "columnFixing", "export", "toast", "gridView"]);
class TreeList extends _m_widget_base.default {
_initMarkup() {
super._initMarkup.apply(this, arguments);
this.$element().addClass("dx-treelist");
this.getView("gridView").render(this.$element())
}
static registerModule() {
_m_core.default.registerModule.apply(_m_core.default, arguments)
}
_defaultOptionsRules() {
return super._defaultOptionsRules().concat([{
device: () => (0, _themes.isMaterialBased)(),
options: {
showRowLines: true,
showColumnLines: false,
headerFilter: {
height: 315
},
editing: {
useIcons: true
}
}
}])
}
_init() {
super._init();
if (!this.option("_disableDeprecationWarnings")) {
_m_utils.default.logHeaderFilterDeprecatedWarningIfNeed(this)
}
_m_core.default.processModules(this, _m_core.default);
_m_core.default.callModuleItemsMethod(this, "init")
}
getGridCoreHelper() {
return _m_core.default
}
focus(element) {
this.getController("keyboardNavigation").focus(element)
}
}(0, _component_registrator.default)("dxTreeList", TreeList);
exports.default = TreeList
},
73996(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_adaptivity = __webpack_require__( /*! ../../../grids/grid_core/adaptivity/m_adaptivity */ 8468);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("adaptivity", _m_adaptivity.adaptivityModule)
},
71132(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _index = __webpack_require__( /*! ../../../grids/grid_core/ai_column/index */ 6549);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("aiColumn", {
controllers: {
aiColumn: _index.AIColumnController,
aiPromptEditor: _index.AIPromptEditorViewController
},
views: {
aiPromptEditorView: _index.AIPromptEditorView
},
extenders: {
views: {
columnHeadersView: _index.columnHeadersViewExtender
}
}
})
},
22697(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_column_chooser = __webpack_require__( /*! ../../../grids/grid_core/column_chooser/m_column_chooser */ 69862);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("columnChooser", _m_column_chooser.columnChooserModule)
},
3967(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_column_fixing = __webpack_require__( /*! ../../../grids/grid_core/column_fixing/m_column_fixing */ 54704);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("columnFixing", _m_column_fixing.columnFixingModule)
},
62602(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_column_headers = __webpack_require__( /*! ../../../grids/grid_core/column_headers/m_column_headers */ 88568);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("columnHeaders", _m_column_headers.columnHeadersModule)
},
11956(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_columns_resizing_reordering = __webpack_require__( /*! ../../../grids/grid_core/columns_resizing_reordering/m_columns_resizing_reordering */ 19448);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("columnsResizingReordering", _m_columns_resizing_reordering.columnsResizingReorderingModule)
},
72714(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_context_menu = __webpack_require__( /*! ../../../grids/grid_core/context_menu/m_context_menu */ 73680);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("contextMenu", _m_context_menu.contextMenuModule)
},
56876(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editing_cell_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_cell_based */ 48295);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("editingCellBased", _m_editing_cell_based.editingCellBasedModule)
},
99446(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editing_form_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_form_based */ 29657);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("editingFormBased", _m_editing_form_based.editingFormBasedModule)
},
76446(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editing_row_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_row_based */ 56671);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("editingRowBased", _m_editing_row_based.editingRowBasedModule)
},
16109(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editor_factory = __webpack_require__( /*! ../../../grids/grid_core/editor_factory/m_editor_factory */ 77862);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("editorFactory", _m_editor_factory.editorFactoryModule)
},
60607(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_error_handling = __webpack_require__( /*! ../../../grids/grid_core/error_handling/m_error_handling */ 82358);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("errorHandling", _m_error_handling.errorHandlingModule)
},
49219(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_builder = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_builder */ 65382);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("filterBuilder", _m_filter_builder.filterBuilderModule)
},
53242(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_panel = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_panel */ 17887);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("filterPanel", _m_filter_panel.filterPanelModule)
},
47988(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_row = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_row */ 62289);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("filterRow", _m_filter_row.filterRowModule)
},
56065(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_sync = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_sync */ 78746);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("filterSync", _m_filter_sync.filterSyncModule)
},
63449(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_header_filter = __webpack_require__( /*! ../../../grids/grid_core/header_filter/m_header_filter */ 69952);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("headerFilter", _m_header_filter.headerFilterModule)
},
2765(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_header_panel = __webpack_require__( /*! ../../../grids/grid_core/header_panel/m_header_panel */ 5542);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("headerPanel", _m_header_panel.headerPanelModule)
},
43644(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_headers_keyboard_navigation = __webpack_require__( /*! ../../../grids/grid_core/keyboard_navigation/m_headers_keyboard_navigation */ 86421);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("headersKeyboardNavigation", _m_headers_keyboard_navigation.headersKeyboardNavigationModule)
},
92906(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_pager = __webpack_require__( /*! ../../../grids/grid_core/pager/m_pager */ 66040);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("pager", _m_pager.pagerModule)
},
40190(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_row_dragging = __webpack_require__( /*! ../../../grids/grid_core/row_dragging/m_row_dragging */ 52714);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("rowDragging", _m_row_dragging.rowDraggingModule)
},
51565(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_search = __webpack_require__( /*! ../../../grids/grid_core/search/m_search */ 7370);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("search", _m_search.searchModule)
},
63017(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_sorting = __webpack_require__( /*! ../../../grids/grid_core/sorting/m_sorting */ 8036);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("sorting", _m_sorting.sortingModule)
},
40882(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_sticky_columns = __webpack_require__( /*! ../../../grids/grid_core/sticky_columns/m_sticky_columns */ 67624);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("stickyColumns", _m_sticky_columns.stickyColumnsModule)
},
60446(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_toast_controller = __webpack_require__( /*! ../../../grids/grid_core/toast/m_toast_controller */ 39859);
var _m_toast_view = __webpack_require__( /*! ../../../grids/grid_core/toast/m_toast_view */ 66982);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("toast", {
controllers: {
toastViewController: _m_toast_controller.ToastViewController
},
views: {
toastView: _m_toast_view.ToastView
}
})
},
47890(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_virtual_columns = __webpack_require__( /*! ../../../grids/grid_core/virtual_columns/m_virtual_columns */ 74280);
var _m_core = (e = __webpack_require__( /*! ../m_core */ 99477), e && e.__esModule ? e : {
default: e
});
var e;
_m_core.default.registerModule("virtualColumns", _m_virtual_columns.virtualColumnsModule)
},
86435(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/events/core/events_engine */ 92774));
var _remove = __webpack_require__( /*! ../../../../common/core/events/remove */ 28630);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 64553));
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _m_rows_view = __webpack_require__( /*! ../../../grids/grid_core/views/m_rows_view */ 77081);
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 99477));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const createIcon = (isLast, hasIcon, isExpanded) => {
const $iconElement = (0, _renderer.default)(" ").addClass("dx-treelist-empty-space");
if (isLast) {
$iconElement.addClass("dx-treelist-empty-space--last")
}
if (hasIcon) {
$iconElement.addClass(isExpanded ? "dx-treelist-expanded" : "dx-treelist-collapsed")
}
return $iconElement
};
class TreeListRowsView extends _m_rows_view.RowsView {
_renderIconContainer($container, options) {
const $iconContainer = (0, _renderer.default)(" ").addClass("dx-treelist-icon-container").appendTo($container);
if (options.watch) {
const dispose = options.watch(() => [options.row.level, options.row.isExpanded, options.row.node.hasChildren], () => {
$iconContainer.empty();
this._renderIcons($iconContainer, options)
});
_events_engine.default.on($iconContainer, _remove.removeEvent, dispose)
}
$container.addClass("dx-treelist-cell-expandable");
return this._renderIcons($iconContainer, options)
}
_renderIcons($container, options) {
const $iconContainer = super._renderIcons($container, options);
const {
row: row
} = options;
const {
level: level
} = row;
for (let idx = 0; idx <= level; idx += 1) {
const isLast = idx === level;
const hasIcon = isLast && row.node.hasChildren;
const $icon = createIcon(isLast, hasIcon, row.isExpanded);
$icon.appendTo($iconContainer)
}
return $iconContainer
}
_renderCellCommandContent(container, model) {
this._renderIconContainer(container, model);
return true
}
_processTemplate(template, options) {
var _options$column;
const that = this;
let resultTemplate;
const renderingTemplate = super._processTemplate(template);
const firstDataColumnIndex = that._columnsController.getFirstDataColumnIndex();
if (renderingTemplate && (null === (_options$column = options.column) || void 0 === _options$column ? void 0 : _options$column.index) === firstDataColumnIndex) {
resultTemplate = {
render(options) {
const $container = options.container;
if (that._renderCellCommandContent($container, options.model)) {
options.container = function($container) {
return (0, _renderer.default)(" ").addClass("dx-treelist-text-content").appendTo($container)
}($container)
}
renderingTemplate.render(options)
}
}
} else {
resultTemplate = renderingTemplate
}
return resultTemplate
}
_updateCell($cell, options) {
$cell = $cell.hasClass("dx-treelist-text-content") ? $cell.parent() : $cell;
super._updateCell($cell, options)
}
_rowClick(e) {
const dataController = this._dataController;
const $targetElement = (0, _renderer.default)(e.event.target);
const isExpandIcon = this.isExpandIcon($targetElement);
const item = null === dataController || void 0 === dataController ? void 0 : dataController.items()[e.rowIndex];
if (isExpandIcon && item) {
dataController.changeRowExpand(item.key)
}
super._rowClick(e)
}
_createRow(row) {
const node = row && row.node;
const $rowElement = super._createRow.apply(this, arguments);
if (node) {
this.setAria("level", row.level + 1, $rowElement);
if (node.hasChildren) {
this.setAriaExpandedAttribute($rowElement, row)
}
}
return $rowElement
}
_getGridRoleName() {
return "treegrid"
}
isExpandIcon($targetElement) {
return !!$targetElement.closest(".dx-treelist-expanded, .dx-treelist-collapsed").length
}
setAriaExpandedAttribute($row, row) {
const isRowExpanded = row.isExpanded;
this.setAria("expanded", (0, _type.isDefined)(isRowExpanded) && isRowExpanded.toString(), $row)
}
}
_m_core.default.registerModule("rows", {
defaultOptions: _m_rows_view.rowsModule.defaultOptions,
views: {
rowsView: TreeListRowsView
}
})
},
17463(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 64553));
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _m_selection = __webpack_require__( /*! ../../../grids/grid_core/selection/m_selection */ 1620);
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 99477));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const nodeExists = function(array, currentKey) {
return !!array.filter(key => key === currentKey).length
};
_m_core.default.registerModule("selection", (0, _extend.extend)(true, {}, _m_selection.selectionModule, {
defaultOptions: () => (0, _extend.extend)(true, _m_selection.selectionModule.defaultOptions(), {
selection: {
showCheckBoxesMode: "always",
recursive: false
}
}),
extenders: {
controllers: {
data: Base => class extends((0, _m_selection.dataSelectionExtenderMixin)(Base)) {
_handleDataChanged(e) {
const isRecursiveSelection = this._selectionController.isRecursiveSelection();
if (isRecursiveSelection && (!e || "updateSelectionState" !== e.changeType)) {
this._selectionController.updateSelectionState({
selectedItemKeys: this.option("selectedRowKeys")
})
}
super._handleDataChanged.apply(this, arguments)
}
loadDescendants() {
const that = this;
const d = super.loadDescendants.apply(that, arguments);
const isRecursiveSelection = this._selectionController.isRecursiveSelection();
if (isRecursiveSelection) {
d.done(() => {
this._selectionController.updateSelectionState({
selectedItemKeys: that.option("selectedRowKeys")
})
})
}
return d
}
},
selection: Base => class extends Base {
constructor() {
super(...arguments);
this._updateSelectColumn = _common.noop
}
init() {
super.init.apply(this, arguments);
this._selectionStateByKey = {}
}
_getSelectionConfig() {
const config = super._getSelectionConfig.apply(this, arguments);
const {
plainItems: plainItems
} = config;
config.plainItems = cached => {
let result;
if (cached) {
result = this._dataController.getCachedStoreData()
}
result || (result = plainItems.apply(this, arguments).map(item => item.data));
return result || []
};
config.isItemSelected = item => {
const key = this._dataController.keyOf(item);
return this.isRowSelected(key)
};
config.isSelectableItem = item => !!item;
config.getItemData = item => item;
config.allowLoadByRange = void 0;
return config
}
renderSelectCheckBoxContainer($container, model) {
const rowsView = this.component.getView("rowsView");
const $checkbox = rowsView._renderSelectCheckBox($container, {
value: model.row.isSelected,
row: model.row,
column: model.column
});
rowsView._attachCheckBoxClickEvent($checkbox)
}
_getSelectAllNodeKeys() {
const {
component: component
} = this;
const root = component.getRootNode();
const cache = {};
const keys = [];
const isRecursiveSelection = this.isRecursiveSelection();
root && _m_core.default.foreachNodes(root.children, node => {
if (void 0 !== node.key && (node.visible || isRecursiveSelection)) {
keys.push(node.key)
}
if (!node.visible) {
return true
}
return isRecursiveSelection ? false : component.isRowExpanded(node.key, cache)
});
return keys
}
isSelectAll() {
const selectedRowKeys = this.option("selectedRowKeys") || [];
if (0 === selectedRowKeys.length) {
return false
}
const {
component: component
} = this;
const visibleKeys = this._getSelectAllNodeKeys();
const isRecursiveSelection = this.isRecursiveSelection();
let hasIndeterminateState = false;
const selectedVisibleKeys = visibleKeys.filter(key => {
const isRowSelected = component.isRowSelected(key, isRecursiveSelection);
if (void 0 === isRowSelected) {
hasIndeterminateState = true
}
return isRowSelected
});
if (!selectedVisibleKeys.length) {
return hasIndeterminateState ? void 0 : false
}
if (selectedVisibleKeys.length === visibleKeys.length) {
return true
}
return
}
selectAll() {
const visibleKeys = this._getSelectAllNodeKeys().filter(key => !this.isRowSelected(key));
this.focusedItemIndex(-1);
return this.selectRows(visibleKeys, true)
}
deselectAll() {
const visibleKeys = this._getSelectAllNodeKeys();
this.focusedItemIndex(-1);
return this.deselectRows(visibleKeys)
}
selectedItemKeys(value, preserve, isDeselect, isSelectAll) {
const that = this;
const selectedRowKeys = that.option("selectedRowKeys");
const isRecursiveSelection = this.isRecursiveSelection();
const normalizedArgs = isRecursiveSelection && that._normalizeSelectionArgs({
keys: (0, _type.isDefined)(value) ? value : []
}, preserve, !isDeselect);
if (normalizedArgs && !(0, _common.equalByValue)(normalizedArgs.selectedRowKeys, selectedRowKeys)) {
that._isSelectionNormalizing = true;
return super.selectedItemKeys(normalizedArgs.selectedRowKeys, false, false, false).always(() => {
that._isSelectionNormalizing = false
}).done(items => {
normalizedArgs.selectedRowsData = items;
that._fireSelectionChanged(normalizedArgs)
})
}
return super.selectedItemKeys(value, preserve, isDeselect, isSelectAll)
}
changeItemSelection(itemIndex, keyboardKeys, setFocusOnly) {
const isRecursiveSelection = this.isRecursiveSelection();
const callBase = super.changeItemSelection.bind(this);
if (isRecursiveSelection && !keyboardKeys.shift) {
const key = this._dataController.getKeyByRowIndex(itemIndex);
return this.selectedItemKeys(key, true, this.isRowSelected(key)).done(() => {
this.isRowSelected(key) && callBase(itemIndex, keyboardKeys, true)
})
}
return super.changeItemSelection.apply(this, arguments)
}
_updateParentSelectionState(node, isSelected) {
const that = this;
let state = isSelected;
const parentNode = node.parent;
if (parentNode) {
if (parentNode.children.length > 1) {
if (false === isSelected) {
const hasSelectedState = parentNode.children.some(childNode => that._selectionStateByKey[childNode.key]);
state = hasSelectedState ? void 0 : false
} else if (true === isSelected) {
const hasNonSelectedState = parentNode.children.some(childNode => !that._selectionStateByKey[childNode.key]);
state = hasNonSelectedState ? void 0 : true
}
}
this._selectionStateByKey[parentNode.key] = state;
if (parentNode.parent && parentNode.parent.level >= 0) {
this._updateParentSelectionState(parentNode, state)
}
}
}
_updateChildrenSelectionState(node, isSelected) {
const that = this;
const {
children: children
} = node;
children && children.forEach(childNode => {
that._selectionStateByKey[childNode.key] = isSelected;
if (childNode.children.length > 0) {
that._updateChildrenSelectionState(childNode, isSelected)
}
})
}
_updateSelectionStateCore(keys, isSelected) {
const dataController = this._dataController;
this._selectionStateByKey = {};
for (let i = 0; i < keys.length; i++) {
this._selectionStateByKey[keys[i]] = isSelected;
const node = dataController.getNodeByKey(keys[i]);
if (node) {
this._updateParentSelectionState(node, isSelected);
this._updateChildrenSelectionState(node, isSelected)
}
}
}
_getSelectedParentKeys(key, selectedItemKeys, useCash) {
let selectedParentNode;
const node = this._dataController.getNodeByKey(key);
let parentNode = node && node.parent;
let result = [];
while (parentNode && parentNode.level >= 0) {
result.unshift(parentNode.key);
const isSelected = useCash ? !nodeExists(selectedItemKeys, parentNode.key) && this.isRowSelected(parentNode.key) : selectedItemKeys.indexOf(parentNode.key) >= 0;
if (isSelected) {
selectedParentNode = parentNode;
result = this._getSelectedParentKeys(selectedParentNode.key, selectedItemKeys, useCash).concat(result);
break
} else if (useCash) {
break
}
parentNode = parentNode.parent
}
return selectedParentNode && result || []
}
_getSelectedChildKeys(key, keysToIgnore) {
const childKeys = [];
const node = this._dataController.getNodeByKey(key);
node && _m_core.default.foreachNodes(node.children, childNode => {
const ignoreKeyIndex = keysToIgnore.indexOf(childNode.key);
if (ignoreKeyIndex < 0) {
childKeys.push(childNode.key)
}
return ignoreKeyIndex > 0 || ignoreKeyIndex < 0 && void 0 === this._selectionStateByKey[childNode.key]
});
return childKeys
}
_normalizeParentKeys(key, args) {
const that = this;
let keysToIgnore = [key];
const parentNodeKeys = that._getSelectedParentKeys(key, args.selectedRowKeys);
if (parentNodeKeys.length) {
keysToIgnore = keysToIgnore.concat(parentNodeKeys);
keysToIgnore.forEach(key => {
const index = args.selectedRowKeys.indexOf(key);
if (index >= 0) {
args.selectedRowKeys.splice(index, 1)
}
});
const childKeys = that._getSelectedChildKeys(parentNodeKeys[0], keysToIgnore);
args.selectedRowKeys = args.selectedRowKeys.concat(childKeys)
}
}
_normalizeChildrenKeys(key, args) {
const node = this._dataController.getNodeByKey(key);
node && node.children.forEach(childNode => {
const index = args.selectedRowKeys.indexOf(childNode.key);
if (index >= 0) {
args.selectedRowKeys.splice(index, 1)
}
this._normalizeChildrenKeys(childNode.key, args)
})
}
_normalizeSelectedRowKeysCore(keys, args, preserve, isSelect) {
const that = this;
keys.forEach(key => {
if (preserve && that.isRowSelected(key) === isSelect) {
return
}
that._normalizeChildrenKeys(key, args);
const index = args.selectedRowKeys.indexOf(key);
if (isSelect) {
if (index < 0) {
args.selectedRowKeys.push(key)
}
args.currentSelectedRowKeys.push(key)
} else {
if (index >= 0) {
args.selectedRowKeys.splice(index, 1)
}
args.currentDeselectedRowKeys.push(key);
that._normalizeParentKeys(key, args)
}
})
}
_normalizeSelectionArgs(args, preserve, isSelect) {
let result;
const keys = Array.isArray(args.keys) ? args.keys : [args.keys];
const selectedRowKeys = this.option("selectedRowKeys") || [];
if (keys.length) {
result = {
currentSelectedRowKeys: [],
currentDeselectedRowKeys: [],
selectedRowKeys: preserve ? selectedRowKeys.slice(0) : []
};
this._normalizeSelectedRowKeysCore(keys, result, preserve, isSelect)
}
return result
}
_updateSelectedItems(args) {
this.updateSelectionState(args);
super._updateSelectedItems(args)
}
_fireSelectionChanged() {
if (!this._isSelectionNormalizing) {
super._fireSelectionChanged.apply(this, arguments)
}
}
_isModeLeavesOnly(mode) {
return "leavesOnly" === mode
}
_removeDuplicatedKeys(keys) {
const result = [];
const processedKeys = {};
keys.forEach(key => {
if (!processedKeys[key]) {
processedKeys[key] = true;
result.push(key)
}
});
return result
}
_getAllChildKeys(key) {
const childKeys = [];
const node = this._dataController.getNodeByKey(key);
node && _m_core.default.foreachNodes(node.children, childNode => {
childKeys.push(childNode.key)
}, true);
return childKeys
}
_getAllSelectedRowKeys(keys) {
let result = [];
keys.forEach(key => {
const parentKeys = this._getSelectedParentKeys(key, [], true);
const childKeys = this._getAllChildKeys(key);
result.push.apply(result, parentKeys.concat([key], childKeys))
});
result = this._removeDuplicatedKeys(result);
return result
}
_getParentSelectedRowKeys(keys) {
const that = this;
const result = [];
keys.forEach(key => {
const parentKeys = that._getSelectedParentKeys(key, keys);
!parentKeys.length && result.push(key)
});
return result
}
_getLeafSelectedRowKeys(keys) {
const result = [];
const dataController = this._dataController;
keys.forEach(key => {
const node = dataController.getNodeByKey(key);
node && !node.hasChildren && result.push(key)
});
return result
}
isRecursiveSelection() {
const selectionMode = this.option("selection.mode");
const isRecursive = this.option("selection.recursive");
return "multiple" === selectionMode && isRecursive
}
updateSelectionState(options) {
const removedItemKeys = options.removedItemKeys || [];
const selectedItemKeys = options.selectedItemKeys || [];
if (this.isRecursiveSelection()) {
this._updateSelectionStateCore(removedItemKeys, false);
this._updateSelectionStateCore(selectedItemKeys, true)
}
}
isRowSelected(key, isRecursiveSelection) {
const result = super.isRowSelected.apply(this, arguments);
isRecursiveSelection = isRecursiveSelection ?? this.isRecursiveSelection();
if (!result && isRecursiveSelection) {
if (key in this._selectionStateByKey) {
return this._selectionStateByKey[key]
}
return false
}
return result
}
getSelectedRowKeys(mode) {
const that = this;
if (!that._dataController) {
return []
}
let selectedRowKeys = super.getSelectedRowKeys.apply(that, arguments);
if (mode) {
if (this.isRecursiveSelection()) {
selectedRowKeys = this._getAllSelectedRowKeys(selectedRowKeys)
}
if ("all" !== mode) {
if ("excludeRecursive" === mode) {
selectedRowKeys = that._getParentSelectedRowKeys(selectedRowKeys)
} else if (that._isModeLeavesOnly(mode)) {
selectedRowKeys = that._getLeafSelectedRowKeys(selectedRowKeys)
}
}
}
return selectedRowKeys
}
getSelectedRowsData(mode) {
const dataController = this._dataController;
const selectedKeys = this.getSelectedRowKeys(mode) || [];
const selectedRowsData = [];
selectedKeys.forEach(key => {
const node = dataController.getNodeByKey(key);
node && selectedRowsData.push(node.data)
});
return selectedRowsData
}
refresh() {
this._selectionStateByKey = {};
return super.refresh.apply(this, arguments)
}
}
},
views: {
columnHeadersView: Base => class extends((0, _m_selection.columnHeadersSelectionExtenderMixin)(Base)) {
_processTemplate(template, options) {
const that = this;
let resultTemplate;
const renderingTemplate = super._processTemplate(template, options);
const firstDataColumnIndex = that._columnsController.getFirstDataColumnIndex();
if (renderingTemplate && "header" === options.rowType && options.column.index === firstDataColumnIndex) {
resultTemplate = {
render(options) {
renderingTemplate.render(options);
if ("multiple" === that.option("selection.mode")) {
that.renderSelectAll(options.container, options.model)
}
}
}
} else {
resultTemplate = renderingTemplate
}
return resultTemplate
}
_renderSelectAllCheckBox($container) {
const $checkboxWrapper = (0, _renderer.default)(" ").addClass("dx-treelist-select-checkbox-container");
const $checkbox = this._createSelectAllCheckboxElement();
$checkbox.appendTo($checkboxWrapper);
$checkboxWrapper.prependTo($container);
return $checkbox
}
renderSelectAll($cell, options) {
$cell.addClass("dx-treelist-select-all");
this._renderSelectAllCheckBox($cell)
}
_isSortableElement($target) {
return super._isSortableElement($target) && !$target.closest(".dx-select-checkbox").length
}
},
rowsView: Base => class extends((0, _m_selection.rowsViewSelectionExtenderMixin)(Base)) {
_renderIcons($container, options) {
const $iconContainer = super._renderIcons($container, options);
const isMultipleSelection = "multiple" === this.option("selection.mode");
if (!options.row.isNewRow && isMultipleSelection) {
const $checkboxWrapper = (0, _renderer.default)(" ").addClass("dx-treelist-select-checkbox-container");
$checkboxWrapper.appendTo($iconContainer);
this._selectionController.renderSelectCheckBoxContainer($checkboxWrapper, options)
}
return $iconContainer
}
_rowClick(e) {
const $targetElement = (0, _renderer.default)(e.event.target);
if (this.isExpandIcon($targetElement)) {
super._rowClickForTreeList.apply(this, arguments)
} else {
super._rowClick.apply(this, arguments)
}
}
}
}
}
}))
},
24595(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_error = _interopRequireDefault(__webpack_require__( /*! ../core/utils/m_error */ 40818));
var _m_version = __webpack_require__( /*! ../core/utils/m_version */ 5388);
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
var _use_jquery = _interopRequireDefault(__webpack_require__( /*! ./jquery/use_jquery */ 64688));
__webpack_require__( /*! ./jquery/renderer */ 49381);
__webpack_require__( /*! ./jquery/hooks */ 85004);
__webpack_require__( /*! ./jquery/deferred */ 63113);
__webpack_require__( /*! ./jquery/hold_ready */ 11447);
__webpack_require__( /*! ./jquery/events */ 32999);
__webpack_require__( /*! ./jquery/easing */ 96979);
__webpack_require__( /*! ./jquery/element_data */ 30987);
__webpack_require__( /*! ./jquery/element */ 9008);
__webpack_require__( /*! ./jquery/component_registrator */ 76116);
__webpack_require__( /*! ./jquery/ajax */ 91828);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const useJQuery = (0, _use_jquery.default)();
if (useJQuery && (0, _m_version.compare)(_jquery.default.fn.jquery, [1, 10]) < 0) {
throw _m_error.default.Error("E0012")
}
},
91828(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_ajax = __webpack_require__( /*! ../../core/utils/m_ajax */ 14136);
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
var _use_jquery = _interopRequireDefault(__webpack_require__( /*! ./use_jquery */ 64688));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const useJQuery = (0, _use_jquery.default)();
if (useJQuery) {
_m_ajax.Ajax.inject({
sendRequest(options) {
if (!options.responseType && !options.upload) {
return _jquery.default.ajax(options)
}
return this.callBase.apply(this, [options])
}
})
}
},
76116(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_component_registrator_callbacks = __webpack_require__( /*! ../../core/m_component_registrator_callbacks */ 21233);
var _m_errors = _interopRequireDefault(__webpack_require__( /*! ../../core/m_errors */ 5583));
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
if (_jquery.default) {
const registerJQueryComponent = function(name, componentClass) {
_jquery.default.fn[name] = function(options) {
const isMemberInvoke = "string" === typeof options;
let result;
if (isMemberInvoke) {
const memberName = options;
const memberArgs = [].slice.call(arguments).slice(1);
this.each(function() {
const instance = componentClass.getInstance(this);
if (!instance) {
throw _m_errors.default.Error("E0009", name)
}
const member = instance[memberName];
const memberValue = member.apply(instance, memberArgs);
if (void 0 === result) {
result = memberValue
}
})
} else {
this.each(function() {
const instance = componentClass.getInstance(this);
if (instance) {
instance.option(options)
} else {
new componentClass(this, options)
}
});
result = this
}
return result
}
};
_m_component_registrator_callbacks.componentRegistratorCallbacks.add(registerJQueryComponent)
}
},
63113(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_deferred = __webpack_require__( /*! ../../core/utils/m_deferred */ 77117);
var _m_version = __webpack_require__( /*! ../../core/utils/m_version */ 5388);
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
var _use_jquery = _interopRequireDefault(__webpack_require__( /*! ./use_jquery */ 64688));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const useJQuery = (0, _use_jquery.default)();
if (useJQuery) {
const {
Deferred: Deferred
} = _jquery.default;
const strategy = {
Deferred: Deferred
};
strategy.when = (0, _m_version.compare)(_jquery.default.fn.jquery, [3]) < 0 ? _jquery.default.when : function(singleArg) {
if (0 === arguments.length) {
return (new Deferred).resolve()
}
if (1 === arguments.length) {
return null !== singleArg && void 0 !== singleArg && singleArg.then ? singleArg : (new Deferred).resolve(singleArg)
}
return _jquery.default.when.apply(_jquery.default, arguments)
};
(0, _m_deferred.setStrategy)(strategy)
}
},
96979(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _easing = __webpack_require__( /*! ../../common/core/animation/easing */ 11610);
var _jquery = (e = __webpack_require__( /*! jquery */ 10561), e && e.__esModule ? e : {
default: e
});
var e;
if (_jquery.default) {
(0, _easing.setEasing)(_jquery.default.easing)
}
},
9008(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPublicElementJQuery = getPublicElementJQuery;
var _m_element = __webpack_require__( /*! ../../core/m_element */ 93630);
var _use_jquery = (e = __webpack_require__( /*! ./use_jquery */ 64688), e && e.__esModule ? e : {
default: e
});
var e;
const useJQuery = (0, _use_jquery.default)();
function getPublicElementJQuery($element) {
return $element
}
if (useJQuery) {
(0, _m_element.setPublicElementWrapper)(getPublicElementJQuery)
}
},
30987(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_element_data = __webpack_require__( /*! ../../core/m_element_data */ 29489);
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
var _use_jquery = _interopRequireDefault(__webpack_require__( /*! ./use_jquery */ 64688));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const useJQuery = (0, _use_jquery.default)();
if (useJQuery) {
(0, _m_element_data.setDataStrategy)(_jquery.default)
}
},
32999(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _event_registrator_callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/events/core/event_registrator_callbacks */ 85030));
var _m_dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../core/m_dom_adapter */ 62018));
var _m_events_engine = _interopRequireDefault(__webpack_require__( /*! ../../events/core/m_events_engine */ 36306));
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
var _use_jquery = _interopRequireDefault(__webpack_require__( /*! ./use_jquery */ 64688));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const useJQuery = (0, _use_jquery.default)();
if (useJQuery) {
_event_registrator_callbacks.default.add((name, eventObject) => {
_jquery.default.event.special[name] = eventObject
});
if (_m_events_engine.default.passiveEventHandlersSupported()) {
_m_events_engine.default.forcePassiveFalseEventNames.forEach(eventName => {
_jquery.default.event.special[eventName] = {
setup(data, namespaces, handler) {
_m_dom_adapter.default.listen(this, eventName, handler, {
passive: false
})
}
}
})
}
_m_events_engine.default.set({
on(element) {
(0, _jquery.default)(element).on.apply((0, _jquery.default)(element), Array.prototype.slice.call(arguments, 1))
},
one(element) {
(0, _jquery.default)(element).one.apply((0, _jquery.default)(element), Array.prototype.slice.call(arguments, 1))
},
off(element) {
(0, _jquery.default)(element).off.apply((0, _jquery.default)(element), Array.prototype.slice.call(arguments, 1))
},
trigger(element) {
(0, _jquery.default)(element).trigger.apply((0, _jquery.default)(element), Array.prototype.slice.call(arguments, 1))
},
triggerHandler(element) {
(0, _jquery.default)(element).triggerHandler.apply((0, _jquery.default)(element), Array.prototype.slice.call(arguments, 1))
},
Event: _jquery.default.Event
})
}
},
11447(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_ready_callbacks = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/m_ready_callbacks */ 18344));
var _m_themes_callback = __webpack_require__( /*! ../../ui/m_themes_callback */ 68831);
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
if (_jquery.default && !_m_themes_callback.themeReadyCallback.fired()) {
const holdReady = _jquery.default.holdReady || _jquery.default.fn.holdReady;
holdReady(true);
_m_themes_callback.themeReadyCallback.add(() => {
_m_ready_callbacks.default.add(() => {
holdReady(false)
})
})
}
},
85004(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_iterator = __webpack_require__( /*! ../../core/utils/m_iterator */ 26044);
var _m_type = __webpack_require__( /*! ../../core/utils/m_type */ 39918);
var _m_version = __webpack_require__( /*! ../../core/utils/m_version */ 5388);
var _m_event_registrator = _interopRequireDefault(__webpack_require__( /*! ../../events/core/m_event_registrator */ 65381));
var _m_hook_touch_props = _interopRequireDefault(__webpack_require__( /*! ../../events/core/m_hook_touch_props */ 40866));
var _index = __webpack_require__( /*! ../../events/utils/index */ 61210);
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
var _use_jquery = _interopRequireDefault(__webpack_require__( /*! ./use_jquery */ 64688));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const useJQuery = (0, _use_jquery.default)();
if (useJQuery) {
if ((0, _m_version.compare)(_jquery.default.fn.jquery, [3]) < 0) {
const POINTER_TYPE_MAP = {
2: "touch",
3: "pen",
4: "mouse"
};
(0, _m_iterator.each)(["MSPointerDown", "MSPointerMove", "MSPointerUp", "MSPointerCancel", "MSPointerOver", "MSPointerOut", "mouseenter", "mouseleave", "pointerdown", "pointermove", "pointerup", "pointercancel", "pointerover", "pointerout", "pointerenter", "pointerleave"], function() {
_jquery.default.event.fixHooks[this] = {
filter(event, originalEvent) {
const {
pointerType: pointerType
} = originalEvent;
if ((0, _m_type.isNumeric)(pointerType)) {
event.pointerType = POINTER_TYPE_MAP[pointerType]
}
return event
},
props: _jquery.default.event.mouseHooks.props.concat(["pointerId", "pointerType", "originalTarget", "width", "height", "pressure", "result", "tiltX", "charCode", "tiltY", "detail", "isPrimary", "prevValue"])
}
});
(0, _m_iterator.each)(["touchstart", "touchmove", "touchend", "touchcancel"], function() {
_jquery.default.event.fixHooks[this] = {
filter(event, originalEvent) {
(0, _m_hook_touch_props.default)((name, hook) => {
event[name] = hook(originalEvent)
});
return event
},
props: _jquery.default.event.mouseHooks.props.concat(["touches", "changedTouches", "targetTouches", "detail", "result", "originalTarget", "charCode", "prevValue"])
}
});
_jquery.default.event.fixHooks.wheel = _jquery.default.event.mouseHooks;
const DX_EVENT_HOOKS = {
props: _jquery.default.event.mouseHooks.props.concat(["pointerType", "pointerId", "pointers"])
};
_m_event_registrator.default.callbacks.add(name => {
_jquery.default.event.fixHooks[name] = DX_EVENT_HOOKS
});
const fix = function(event, originalEvent) {
const fixHook = _jquery.default.event.fixHooks[originalEvent.type] || _jquery.default.event.mouseHooks;
const props = fixHook.props ? _jquery.default.event.props.concat(fixHook.props) : _jquery.default.event.props;
let propIndex = props.length;
while (propIndex -= 1) {
const prop = props[propIndex];
event[prop] = originalEvent[prop]
}
return fixHook.filter ? fixHook.filter(event, originalEvent) : event
};
(0, _index.setEventFixMethod)(fix)
} else {
(0, _m_hook_touch_props.default)((name, hook) => {
_jquery.default.event.addProp(name, hook)
})
}
}
},
49381(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_renderer_base = _interopRequireDefault(__webpack_require__( /*! ../../core/m_renderer_base */ 1811));
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
var _use_jquery = _interopRequireDefault(__webpack_require__( /*! ./use_jquery */ 64688));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const useJQuery = (0, _use_jquery.default)();
if (useJQuery) {
_m_renderer_base.default.set(_jquery.default)
}
},
64688(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function() {
return _jquery.default && (0, _config.default)().useJQuery
};
var _config = _interopRequireDefault(__webpack_require__( /*! ../../../core/config */ 66636));
var _jquery = _interopRequireDefault(__webpack_require__( /*! jquery */ 10561));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const {
useJQuery: useJQuery
} = (0, _config.default)();
if (_jquery.default && false !== useJQuery) {
(0, _config.default)({
useJQuery: true
})
}
},
453(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_error = _interopRequireDefault(__webpack_require__( /*! ../core/utils/m_error */ 40818));
var _m_version = __webpack_require__( /*! ../core/utils/m_version */ 5388);
var _knockout = _interopRequireDefault(__webpack_require__( /*! knockout */ 78117));
__webpack_require__( /*! ./knockout/component_registrator */ 3794);
__webpack_require__( /*! ./knockout/event_registrator */ 55445);
__webpack_require__( /*! ./knockout/components */ 19856);
__webpack_require__( /*! ./knockout/validation */ 61287);
__webpack_require__( /*! ./knockout/variable_wrapper_utils */ 83518);
__webpack_require__( /*! ./knockout/clean_node */ 76858);
__webpack_require__( /*! ./knockout/clean_node_old */ 23204);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
if (_knockout.default) {
if ((0, _m_version.compare)(_knockout.default.version, [2, 3]) < 0) {
throw _m_error.default.Error("E0013")
}
}
},
76858(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_element_data = __webpack_require__( /*! ../../core/m_element_data */ 29489);
var _m_version = __webpack_require__( /*! ../../core/utils/m_version */ 5388);
var _knockout = (e = __webpack_require__( /*! knockout */ 78117), e && e.__esModule ? e : {
default: e
});
var e;
var _utils = __webpack_require__( /*! ./utils */ 41983);
if (_knockout.default) {
const originalKOCleanExternalData = _knockout.default.utils.domNodeDisposal.cleanExternalData;
const patchCleanData = () => {
(0, _m_element_data.afterCleanData)(nodes => {
for (let i = 0; i < nodes.length; i += 1) {
nodes[i].cleanedByJquery = true
}
for (let i = 0; i < nodes.length; i += 1) {
if (!nodes[i].cleanedByKo) {
_knockout.default.cleanNode(nodes[i])
}
delete nodes[i].cleanedByKo
}
for (let i = 0; i < nodes.length; i += 1) {
delete nodes[i].cleanedByJquery
}
});
_knockout.default.utils.domNodeDisposal.cleanExternalData = node => {
node.cleanedByKo = true;
if ((0, _utils.getClosestNodeWithKoCreation)(node)) {
if (!node.cleanedByJquery) {
(0, _m_element_data.cleanData)([node])
}
}
}
};
const restoreOriginCleanData = () => {
(0, _m_element_data.afterCleanData)(() => {});
_knockout.default.utils.domNodeDisposal.cleanExternalData = originalKOCleanExternalData
};
patchCleanData();
_m_element_data.strategyChanging.add(strategy => {
const isJQuery = !!strategy.fn;
if (isJQuery && (0, _m_version.compare)(strategy.fn.jquery, [2, 0]) < 0) {
restoreOriginCleanData()
}
})
}
},
23204(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_element_data = __webpack_require__( /*! ../../core/m_element_data */ 29489);
var _m_version = __webpack_require__( /*! ../../core/utils/m_version */ 5388);
var _knockout = (e = __webpack_require__( /*! knockout */ 78117), e && e.__esModule ? e : {
default: e
});
var e;
if (_knockout.default) {
const patchCleanData = function(jQuery) {
const cleanKoData = function(element, andSelf) {
const cleanNode = function() {
_knockout.default.cleanNode(this)
};
if (andSelf) {
element.each(cleanNode)
} else {
element.find("*").each(cleanNode)
}
};
const originalEmpty = jQuery.fn.empty;
jQuery.fn.empty = function() {
cleanKoData(this, false);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key]
}
return originalEmpty.apply(this, args)
};
const originalRemove = jQuery.fn.remove;
jQuery.fn.remove = function(selector, keepData) {
if (!keepData) {
let subject = this;
if (selector) {
subject = subject.filter(selector)
}
cleanKoData(subject, true)
}
return originalRemove.call(this, selector, keepData)
};
const originalHtml = jQuery.fn.html;
jQuery.fn.html = function(value) {
if ("string" === typeof value) {
cleanKoData(this, false)
}
return originalHtml.apply(this, arguments)
};
const originalReplaceWith = jQuery.fn.replaceWith;
jQuery.fn.replaceWith = function() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2]
}
const result = originalReplaceWith.apply(this, args);
if (!this.parent().length) {
cleanKoData(this, true)
}
return result
}
};
_m_element_data.strategyChanging.add(strategy => {
const isJQuery = !!strategy.fn;
if (isJQuery && (0, _m_version.compare)(strategy.fn.jquery, [2, 0]) < 0) {
patchCleanData(strategy)
}
})
}
},
3794(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 11118));
var _m_component_registrator_callbacks = __webpack_require__( /*! ../../core/m_component_registrator_callbacks */ 21233);
var _m_config = _interopRequireDefault(__webpack_require__( /*! ../../core/m_config */ 34338));
var _component_wrapper = __webpack_require__( /*! ../../core/r1/component_wrapper */ 34993);
var _m_callbacks = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/m_callbacks */ 63172));
var _m_locker = __webpack_require__( /*! ../../core/utils/m_locker */ 24574);
var _m_type = __webpack_require__( /*! ../../core/utils/m_type */ 39918);
var _m_draggable = _interopRequireDefault(__webpack_require__( /*! ../../m_draggable */ 89983));
var _editor = _interopRequireDefault(__webpack_require__( /*! ../../ui/editor/editor */ 24768));
var _scroll_view = _interopRequireDefault(__webpack_require__( /*! ../../ui/scroll_view/scroll_view */ 71100));
var _m_base_widget = _interopRequireDefault(__webpack_require__( /*! ../../viz/core/m_base_widget */ 34506));
var _knockout = _interopRequireDefault(__webpack_require__( /*! knockout */ 78117));
var _template = __webpack_require__( /*! ./template */ 36390);
var _utils = __webpack_require__( /*! ./utils */ 41983);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
if (_knockout.default) {
const LOCKS_DATA_KEY = "dxKoLocks";
const CREATED_WITH_KO_DATA_KEY = "dxKoCreation";
const editorsBindingHandlers = [];
const registerComponentKoBinding = function(componentName, componentClass) {
if (_editor.default.isEditor(componentClass.prototype)) {
editorsBindingHandlers.push(componentName)
}
_knockout.default.bindingHandlers[componentName] = {
init(domNode, valueAccessor) {
const $element = (0, _renderer.default)(domNode);
const optionChangedCallbacks = (0, _m_callbacks.default)();
let optionsByReference = {};
let component;
const knockoutConfig = (0, _m_config.default)().knockout;
const isBindingPropertyPredicateName = null === knockoutConfig || void 0 === knockoutConfig ? void 0 : knockoutConfig.isBindingPropertyPredicateName;
let isBindingPropertyPredicate;
let ctorOptions = {
onInitializing(options) {
optionsByReference = this._getOptionsByReference();
_knockout.default.computed(() => {
const model = _knockout.default.unwrap(valueAccessor());
if (component) {
component.beginUpdate()
}
isBindingPropertyPredicate = isBindingPropertyPredicateName && (null === model || void 0 === model ? void 0 : model[isBindingPropertyPredicateName]);
unwrapModel(model);
if (component) {
component.endUpdate()
} else {
var _model$onInitializing;
null === model || void 0 === model || null === (_model$onInitializing = model.onInitializing) || void 0 === _model$onInitializing || _model$onInitializing.call(this, options)
}
}, null, {
disposeWhenNodeIsRemoved: domNode
});
component = this
},
modelByElement($element) {
if ($element.length) {
const node = (0, _utils.getClosestNodeWithContext)($element.get(0));
return _knockout.default.dataFor(node)
}
},
nestedComponentOptions: component => ({
modelByElement: component.option("modelByElement"),
nestedComponentOptions: component.option("nestedComponentOptions")
}),
_optionChangedCallbacks: optionChangedCallbacks,
integrationOptions: {
watchMethod(fn, callback, options) {
options = options || {};
let skipCallback = options.skipImmediate;
const watcher = _knockout.default.computed(() => {
const newValue = _knockout.default.unwrap(fn());
if (!skipCallback) {
callback(newValue)
}
skipCallback = false
});
return function() {
watcher.dispose()
}
},
templates: {
"dx-polymorph-widget": {
render(options) {
const widgetName = _knockout.default.utils.unwrapObservable(options.model.widget);
if (!widgetName) {
return
}
const markup = (0, _renderer.default)(" ").attr("data-bind", `${widgetName}: options`).get(0);
(0, _renderer.default)(options.container).append(markup);
_knockout.default.applyBindings(options.model, markup)
}
}
},
createTemplate: element => new _template.KoTemplate(element)
}
};
const optionNameToModelMap = {};
const applyModelValueToOption = function(optionName, modelValue, unwrap) {
const locks = $element.data(LOCKS_DATA_KEY);
const optionValue = unwrap ? _knockout.default.unwrap(modelValue) : modelValue;
if (_knockout.default.isWriteableObservable(modelValue)) {
optionNameToModelMap[optionName] = modelValue
}
if (component) {
if (locks.locked(optionName)) {
return
}
locks.obtain(optionName);
try {
if (_knockout.default.ignoreDependencies) {
_knockout.default.ignoreDependencies(component.option, component, [optionName, optionValue])
} else {
component.option(optionName, optionValue)
}
} finally {
locks.release(optionName)
}
} else {
ctorOptions[optionName] = optionValue
}
};
const handleOptionChanged = function(args) {
const optionName = args.fullName;
const optionValue = args.value;
if (!(optionName in optionNameToModelMap)) {
return
}
const $element = this._$element;
const locks = $element.data(LOCKS_DATA_KEY);
if (locks.locked(optionName)) {
return
}
locks.obtain(optionName);
try {
optionNameToModelMap[optionName](optionValue)
} finally {
locks.release(optionName)
}
};
const unwrapModelValue = function(currentModel, propertyName, propertyPath) {
if (propertyPath === isBindingPropertyPredicateName) {
return
}
if (!isBindingPropertyPredicate || isBindingPropertyPredicate(propertyPath, propertyName, currentModel)) {
let unwrappedPropertyValue;
_knockout.default.computed(() => {
const propertyValue = currentModel[propertyName];
applyModelValueToOption(propertyPath, propertyValue, true);
unwrappedPropertyValue = _knockout.default.unwrap(propertyValue)
}, null, {
disposeWhenNodeIsRemoved: domNode
});
if ((0, _m_type.isPlainObject)(unwrappedPropertyValue)) {
if (!optionsByReference[propertyPath]) {
unwrapModel(unwrappedPropertyValue, propertyPath)
}
}
} else {
applyModelValueToOption(propertyPath, currentModel[propertyName], false)
}
};
function unwrapModel(model, propertyPath) {
for (const propertyName in model) {
if (Object.prototype.hasOwnProperty.call(model, propertyName)) {
unwrapModelValue(model, propertyName, propertyPath ? [propertyPath, propertyName].join(".") : propertyName)
}
}
}! function() {
optionChangedCallbacks.add(handleOptionChanged);
$element.data(CREATED_WITH_KO_DATA_KEY, true).data(LOCKS_DATA_KEY, new _m_locker.Locker);
new componentClass($element, ctorOptions);
ctorOptions = null
}();
return {
controlsDescendantBindings: componentClass.subclassOf(_ui.default) || componentClass.subclassOf(_m_base_widget.default) || componentClass.subclassOf(_component_wrapper.ComponentWrapper) && !(component instanceof _scroll_view.default) || component instanceof _m_draggable.default
}
}
};
if ("dxValidator" === componentName) {
_knockout.default.bindingHandlers.dxValidator.after = editorsBindingHandlers
}
};
_m_component_registrator_callbacks.componentRegistratorCallbacks.add((name, componentClass) => {
registerComponentKoBinding(name, componentClass)
})
}
},
19856(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_icon = __webpack_require__( /*! ../../core/utils/m_icon */ 42463);
var _knockout = (e = __webpack_require__( /*! knockout */ 78117), e && e.__esModule ? e : {
default: e
});
var e;
if (_knockout.default) {
_knockout.default.bindingHandlers.dxControlsDescendantBindings = {
init: (_, valueAccessor) => ({
controlsDescendantBindings: _knockout.default.unwrap(valueAccessor())
})
};
_knockout.default.bindingHandlers.dxIcon = {
init(element, valueAccessor) {
const options = _knockout.default.utils.unwrapObservable(valueAccessor()) || {};
const iconElement = (0, _m_icon.getImageContainer)(options);
_knockout.default.virtualElements.emptyNode(element);
if (iconElement) {
_knockout.default.virtualElements.prepend(element, iconElement.get(0))
}
},
update(element, valueAccessor) {
const options = _knockout.default.utils.unwrapObservable(valueAccessor()) || {};
const iconElement = (0, _m_icon.getImageContainer)(options);
_knockout.default.virtualElements.emptyNode(element);
if (iconElement) {
_knockout.default.virtualElements.prepend(element, iconElement.get(0))
}
}
};
_knockout.default.virtualElements.allowedBindings.dxIcon = true
}
},
55445(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _event_registrator_callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/events/core/event_registrator_callbacks */ 85030));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _m_type = __webpack_require__( /*! ../../core/utils/m_type */ 39918);
var _m_events_engine = _interopRequireDefault(__webpack_require__( /*! ../../events/core/m_events_engine */ 36306));
var _index = __webpack_require__( /*! ../../events/utils/index */ 61210);
var _knockout = _interopRequireDefault(__webpack_require__( /*! knockout */ 78117));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
if (_knockout.default) {
_event_registrator_callbacks.default.add(name => {
const koBindingEventName = (0, _index.addNamespace)(name, `${name}Binding`);
_knockout.default.bindingHandlers[name] = {
update(element, valueAccessor, allBindingsAccessor, viewModel) {
const $element = (0, _renderer.default)(element);
const unwrappedValue = _knockout.default.utils.unwrapObservable(valueAccessor());
const eventSource = unwrappedValue.execute ? unwrappedValue.execute : unwrappedValue;
_m_events_engine.default.off($element, koBindingEventName);
_m_events_engine.default.on($element, koBindingEventName, (0, _m_type.isPlainObject)(unwrappedValue) ? unwrappedValue : {}, e => {
eventSource.call(viewModel, viewModel, e)
})
}
}
})
}
},
36390(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.KoTemplate = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _m_dom_adapter = __webpack_require__( /*! ../../core/m_dom_adapter */ 62018);
var _m_template_base = __webpack_require__( /*! ../../core/templates/m_template_base */ 31292);
var _m_dom = __webpack_require__( /*! ../../core/utils/m_dom */ 76400);
var _m_type = __webpack_require__( /*! ../../core/utils/m_type */ 39918);
var _knockout = _interopRequireDefault(__webpack_require__( /*! knockout */ 78117));
var _utils = __webpack_require__( /*! ./utils */ 41983);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const KoTemplate = class extends _m_template_base.TemplateBase {
constructor(element) {
super();
this._element = element;
this._template = (0, _renderer.default)(" ").append((0, _m_dom.normalizeTemplateElement)(element));
this._registerKoTemplate()
}
_registerKoTemplate() {
const template = this._template.get(0);
new _knockout.default.templateSources.anonymousTemplate(template).nodes(template)
}
_prepareDataForContainer(data, container) {
if (null !== container && void 0 !== container && container.length) {
const node = (0, _utils.getClosestNodeWithContext)(container.get(0));
const containerContext = _knockout.default.contextFor(node);
data = void 0 !== data ? data : _knockout.default.dataFor(node) || {};
if (containerContext) {
return data === containerContext.$data ? containerContext : containerContext.createChildContext(data)
}
}
return function(data) {
const parentNode = _m_dom_adapter.domAdapter.createElement("div");
_knockout.default.applyBindingsToNode(parentNode, null, data);
const parentContext = _knockout.default.contextFor(parentNode);
_knockout.default.cleanNode(parentNode);
return parentContext
}(data).createChildContext(data)
}
_renderCore(options) {
const model = this._prepareDataForContainer(options.model, (0, _renderer.default)(options.container));
if ((0, _m_type.isDefined)(options.index)) {
model.$index = options.index
}
const $placeholder = (0, _renderer.default)(" ").appendTo(options.container);
let $result;
_knockout.default.renderTemplate(this._template.get(0), model, {
afterRender(nodes) {
$result = (0, _renderer.default)(nodes)
}
}, $placeholder.get(0), "replaceNode");
return $result
}
source() {
return (0, _renderer.default)(this._element).clone()
}
dispose() {
this._template.remove()
}
};
exports.KoTemplate = KoTemplate
},
41983(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getClosestNodeWithKoCreation = exports.getClosestNodeWithContext = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _knockout = _interopRequireDefault(__webpack_require__( /*! knockout */ 78117));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const getClosestNodeWithContext = node => {
const context = _knockout.default.contextFor(node);
if (!context && node.parentNode) {
return getClosestNodeWithContext(node.parentNode)
}
return node
};
exports.getClosestNodeWithContext = getClosestNodeWithContext;
const getClosestNodeWithKoCreation = node => {
const $el = (0, _renderer.default)(node);
const data = $el.data();
const hasFlag = null === data || void 0 === data ? void 0 : data.dxKoCreation;
if (hasFlag) {
return node
}
if (node.parentNode) {
return getClosestNodeWithKoCreation(node.parentNode)
}
return null
};
exports.getClosestNodeWithKoCreation = getClosestNodeWithKoCreation
},
61287(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_class = _interopRequireDefault(__webpack_require__( /*! ../../core/m_class */ 40958));
var _m_events_strategy = __webpack_require__( /*! ../../core/m_events_strategy */ 14201);
var _m_guid = __webpack_require__( /*! ../../core/m_guid */ 7201);
var _m_deferred = __webpack_require__( /*! ../../core/utils/m_deferred */ 77117);
var _m_extend = __webpack_require__( /*! ../../core/utils/m_extend */ 96298);
var _m_iterator = __webpack_require__( /*! ../../core/utils/m_iterator */ 26044);
var _m_validation_engine = _interopRequireDefault(__webpack_require__( /*! ../../ui/m_validation_engine */ 79697));
var _knockout = _interopRequireDefault(__webpack_require__( /*! knockout */ 78117));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
if (_knockout.default) {
const VALIDATION_STATUS_VALID = "valid";
const VALIDATION_STATUS_PENDING = "pending";
const koDxValidator = _m_class.default.inherit({
ctor(target, _ref) {
let {
name: name,
validationRules: validationRules
} = _ref;
this.target = target;
this.name = name;
this.isValid = _knockout.default.observable(true);
this.validationError = _knockout.default.observable();
this.validationErrors = _knockout.default.observable();
this.validationStatus = _knockout.default.observable(VALIDATION_STATUS_VALID);
this._eventsStrategy = new _m_events_strategy.EventsStrategy(this);
this.validationRules = (0, _m_iterator.map)(validationRules, (rule, index) => (0, _m_extend.extend)({}, rule, {
validator: this,
index: index
}));
this._validationInfo = {
result: null,
deferred: null
}
},
_updateValidationResult(result) {
if (!this._validationInfo.result || this._validationInfo.result.id !== result.id) {
const complete = this._validationInfo.deferred && this._validationInfo.result.complete;
this._validationInfo.result = (0, _m_extend.extend)({}, result, {
complete: complete
})
} else {
for (const prop in result) {
if ("id" !== prop && "complete" !== prop) {
this._validationInfo.result[prop] = result[prop]
}
}
}
},
validate() {
var _this$_validationInfo, _result$complete;
const currentResult = null === (_this$_validationInfo = this._validationInfo) || void 0 === _this$_validationInfo ? void 0 : _this$_validationInfo.result;
const value = this.target();
if (currentResult && currentResult.status === VALIDATION_STATUS_PENDING && currentResult.value === value) {
return (0, _m_extend.extend)({}, currentResult)
}
const result = _m_validation_engine.default.validate(value, this.validationRules, this.name);
result.id = (new _m_guid.Guid).toString();
this._applyValidationResult(result);
null === (_result$complete = result.complete) || void 0 === _result$complete || _result$complete.then(res => {
if (res.id === this._validationInfo.result.id) {
this._applyValidationResult(res)
}
});
return (0, _m_extend.extend)({}, this._validationInfo.result)
},
reset() {
this.target(null);
const result = {
id: null,
isValid: true,
brokenRule: null,
pendingRules: null,
status: VALIDATION_STATUS_VALID,
complete: null
};
this._applyValidationResult(result);
return result
},
_applyValidationResult(result) {
result.validator = this;
this._updateValidationResult(result);
this.target.dxValidator.isValid(this._validationInfo.result.isValid);
this.target.dxValidator.validationError(this._validationInfo.result.brokenRule);
this.target.dxValidator.validationErrors(this._validationInfo.result.brokenRules);
this.target.dxValidator.validationStatus(this._validationInfo.result.status);
if (result.status === VALIDATION_STATUS_PENDING) {
if (!this._validationInfo.deferred) {
this._validationInfo.deferred = new _m_deferred.Deferred;
this._validationInfo.result.complete = this._validationInfo.deferred.promise()
}
this._eventsStrategy.fireEvent("validating", [this._validationInfo.result]);
return
}
if (result.status !== VALIDATION_STATUS_PENDING) {
this._eventsStrategy.fireEvent("validated", [result]);
if (this._validationInfo.deferred) {
this._validationInfo.deferred.resolve(result);
this._validationInfo.deferred = null
}
}
},
on(eventName, eventHandler) {
this._eventsStrategy.on(eventName, eventHandler);
return this
},
off(eventName, eventHandler) {
this._eventsStrategy.off(eventName, eventHandler);
return this
}
});
_knockout.default.extenders.dxValidator = function(target, option) {
target.dxValidator = new koDxValidator(target, option);
target.subscribe(target.dxValidator.validate.bind(target.dxValidator));
return target
};
_m_validation_engine.default.registerModelForValidation = function(model) {
(0, _m_iterator.each)(model, (_, member) => {
if (_knockout.default.isObservable(member) && member.dxValidator) {
_m_validation_engine.default.registerValidatorInGroup(model, member.dxValidator)
}
})
};
_m_validation_engine.default.unregisterModelForValidation = function(model) {
(0, _m_iterator.each)(model, (_, member) => {
if (_knockout.default.isObservable(member) && member.dxValidator) {
_m_validation_engine.default.removeRegisteredValidator(model, member.dxValidator)
}
})
};
_m_validation_engine.default.validateModel = _m_validation_engine.default.validateGroup
}
},
83518(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_variable_wrapper = __webpack_require__( /*! ../../core/utils/m_variable_wrapper */ 66082);
var _knockout = (e = __webpack_require__( /*! knockout */ 78117), e && e.__esModule ? e : {
default: e
});
var e;
if (_knockout.default) {
_m_variable_wrapper.variableWrapper.inject({
isWrapped: _knockout.default.isObservable,
isWritableWrapped: _knockout.default.isWritableObservable,
wrap: _knockout.default.observable,
unwrap(value) {
if (_knockout.default.isObservable(value)) {
return _knockout.default.utils.unwrapObservable(value)
}
return this.callBase(value)
},
assign(variable, value) {
if (_knockout.default.isObservable(variable)) {
variable(value)
} else {
this.callBase(variable, value)
}
}
})
}
},
54699(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const standardColorNames = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "00ffff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000000",
blanchedalmond: "ffebcd",
blue: "0000ff",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "00ffff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgoldenrod: "b8860b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkgrey: "a9a9a9",
darkkhaki: "bdb76b",
darkmagenta: "8b008b",
darkolivegreen: "556b2f",
darkorange: "ff8c00",
darkorchid: "9932cc",
darkred: "8b0000",
darksalmon: "e9967a",
darkseagreen: "8fbc8f",
darkslateblue: "483d8b",
darkslategray: "2f4f4f",
darkslategrey: "2f4f4f",
darkturquoise: "00ced1",
darkviolet: "9400d3",
deeppink: "ff1493",
deepskyblue: "00bfff",
dimgray: "696969",
dimgrey: "696969",
dodgerblue: "1e90ff",
feldspar: "d19275",
firebrick: "b22222",
floralwhite: "fffaf0",
forestgreen: "228b22",
fuchsia: "ff00ff",
gainsboro: "dcdcdc",
ghostwhite: "f8f8ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
grey: "808080",
honeydew: "f0fff0",
hotpink: "ff69b4",
indianred: "cd5c5c",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgray: "d3d3d3",
lightgreen: "90ee90",
lightgrey: "d3d3d3",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslateblue: "8470ff",
lightslategray: "778899",
lightslategrey: "778899",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "00ff00",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "ff00ff",
maroon: "800000",
mediumaquamarine: "66cdaa",
mediumblue: "0000cd",
mediumorchid: "ba55d3",
mediumpurple: "9370d8",
mediumseagreen: "3cb371",
mediumslateblue: "7b68ee",
mediumspringgreen: "00fa9a",
mediumturquoise: "48d1cc",
mediumvioletred: "c71585",
midnightblue: "191970",
mintcream: "f5fffa",
mistyrose: "ffe4e1",
moccasin: "ffe4b5",
navajowhite: "ffdead",
navy: "000080",
oldlace: "fdf5e6",
olive: "808000",
olivedrab: "6b8e23",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
palegoldenrod: "eee8aa",
palegreen: "98fb98",
paleturquoise: "afeeee",
palevioletred: "d87093",
papayawhip: "ffefd5",
peachpuff: "ffdab9",
peru: "cd853f",
pink: "ffc0cb",
plum: "dda0dd",
powderblue: "b0e0e6",
purple: "800080",
rebeccapurple: "663399",
red: "ff0000",
rosybrown: "bc8f8f",
royalblue: "4169e1",
saddlebrown: "8b4513",
salmon: "fa8072",
sandybrown: "f4a460",
seagreen: "2e8b57",
seashell: "fff5ee",
sienna: "a0522d",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
slategrey: "708090",
snow: "fffafa",
springgreen: "00ff7f",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
thistle: "d8bfd8",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
violetred: "d02090",
wheat: "f5deb3",
white: "ffffff",
whitesmoke: "f5f5f5",
yellow: "ffff00",
yellowgreen: "9acd32"
};
const standardColorTypes = [{
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
process: colorString => [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10)]
}, {
re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*\.*\d+)\)$/,
process: colorString => [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10), parseFloat(colorString[4])]
}, {
re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/,
process: colorString => [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16)]
}, {
re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/,
process: colorString => [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16), Number((parseInt(colorString[4], 16) / 255).toFixed(2))]
}, {
re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/,
process: colorString => [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16), Number((parseInt(colorString[4] + colorString[4], 16) / 255).toFixed(2))]
}, {
re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/,
process: colorString => [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16)]
}, {
re: /^hsv\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
process(colorString) {
const h = parseInt(colorString[1], 10);
const s = parseInt(colorString[2], 10);
const v = parseInt(colorString[3], 10);
const rgb = hsvToRgb(h, s, v);
return [rgb[0], rgb[1], rgb[2], 1, [h, s, v]]
}
}, {
re: /^hsl\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
process(colorString) {
const h = parseInt(colorString[1], 10);
const s = parseInt(colorString[2], 10);
const l = parseInt(colorString[3], 10);
const rgb = hslToRgb(h, s, l);
return [rgb[0], rgb[1], rgb[2], 1, null, [h, s, l]]
}
}];
const _round = Math.round;
function Color(value) {
this.baseColor = value;
let color;
if (value) {
color = String(value).toLowerCase().replace(/ /g, "");
color = standardColorNames[color] ? `#${standardColorNames[color]}` : color;
color = function(color) {
if ("transparent" === color) {
return [0, 0, 0, 0]
}
let i = 0;
const ii = standardColorTypes.length;
let str;
for (; i < ii; ++i) {
str = standardColorTypes[i].re.exec(color);
if (str) {
return standardColorTypes[i].process(str)
}
}
return null
}(color)
}
if (!color) {
this.colorIsInvalid = true
}
color = color || {};
this.r = normalize(color[0]);
this.g = normalize(color[1]);
this.b = normalize(color[2]);
this.a = normalize(color[3], 1, 1);
if (color[4]) {
this.hsv = {
h: color[4][0],
s: color[4][1],
v: color[4][2]
}
} else {
this.hsv = function(r, g, b) {
const max = Math.max(r, g, b);
const min = Math.min(r, g, b);
const delta = max - min;
let H;
let S;
let V = max;
S = 0 === max ? 0 : 1 - min / max;
if (max === min) {
H = 0
} else {
switch (max) {
case r:
H = (g - b) / delta * 60;
if (g < b) {
H += 360
}
break;
case g:
H = (b - r) / delta * 60 + 120;
break;
case b:
H = (r - g) / delta * 60 + 240
}
}
S *= 100;
V *= 100 / 255;
return {
h: Math.round(H),
s: Math.round(S),
v: Math.round(V)
}
}(this.r, this.g, this.b)
}
if (color[5]) {
this.hsl = {
h: color[5][0],
s: color[5][1],
l: color[5][2]
}
} else {
this.hsl = function(r, g, b) {
r = convertTo01Bounds(r, 255);
g = convertTo01Bounds(g, 255);
b = convertTo01Bounds(b, 255);
const max = Math.max(r, g, b);
const min = Math.min(r, g, b);
const maxMinSum = max + min;
let h;
let s;
const l = maxMinSum / 2;
if (max === min) {
h = s = 0
} else {
const delta = max - min;
if (l > .5) {
s = delta / (2 - maxMinSum)
} else {
s = delta / maxMinSum
}
h = function(r, g, b, delta) {
const max = Math.max(r, g, b);
switch (max) {
case r:
return (g - b) / delta + (g < b ? 6 : 0);
case g:
return (b - r) / delta + 2;
case b:
return (r - g) / delta + 4;
default:
return
}
}(r, g, b, delta);
h /= 6
}
return {
h: _round(360 * h),
s: _round(100 * s),
l: _round(100 * l)
}
}(this.r, this.g, this.b)
}
}
function normalize(colorComponent, def, max) {
def = def || 0;
max = max || 255;
return colorComponent < 0 || isNaN(colorComponent) ? def : colorComponent > max ? max : colorComponent
}
function hsvToRgb(h, s, v) {
const index = Math.floor(h % 360 / 60);
const vMin = (100 - s) * v / 100;
const a = h % 60 / 60 * (v - vMin);
const vInc = vMin + a;
const vDec = v - a;
let r;
let g;
let b;
switch (index) {
case 0:
r = v;
g = vInc;
b = vMin;
break;
case 1:
r = vDec;
g = v;
b = vMin;
break;
case 2:
r = vMin;
g = v;
b = vInc;
break;
case 3:
r = vMin;
g = vDec;
b = v;
break;
case 4:
r = vInc;
g = vMin;
b = v;
break;
case 5:
r = v;
g = vMin;
b = vDec
}
return [Math.round(2.55 * r), Math.round(2.55 * g), Math.round(2.55 * b)]
}
function makeColorTint(colorPart, h) {
let colorTint = h;
if ("r" === colorPart) {
colorTint = h + 1 / 3
}
if ("b" === colorPart) {
colorTint = h - 1 / 3
}
return colorTint
}
function hueToRgb(p, q, colorTint) {
colorTint = function(colorTint) {
if (colorTint < 0) {
colorTint += 1
}
if (colorTint > 1) {
colorTint -= 1
}
return colorTint
}(colorTint);
if (colorTint < 1 / 6) {
return p + 6 * (q - p) * colorTint
}
if (colorTint < .5) {
return q
}
if (colorTint < 2 / 3) {
return p + (q - p) * (2 / 3 - colorTint) * 6
}
return p
}
function hslToRgb(h, s, l) {
let r;
let g;
let b;
h = convertTo01Bounds(h, 360);
s = convertTo01Bounds(s, 100);
l = convertTo01Bounds(l, 100);
if (0 === s) {
r = g = b = l
} else {
const q = l < .5 ? l * (1 + s) : l + s - l * s;
const p = 2 * l - q;
r = hueToRgb(p, q, makeColorTint("r", h));
g = hueToRgb(p, q, makeColorTint("g", h));
b = hueToRgb(p, q, makeColorTint("b", h))
}
return [_round(255 * r), _round(255 * g), _round(255 * b)]
}
function convertTo01Bounds(n, max) {
n = Math.min(max, Math.max(0, parseFloat(n)));
if (Math.abs(n - max) < 1e-6) {
return 1
}
return n % max / parseFloat(max)
}
function isIntegerBetweenMinAndMax(number, min, max) {
min = min || 0;
max = max || 255;
if (number % 1 !== 0 || number < min || number > max || "number" !== typeof number || isNaN(number)) {
return false
}
return true
}
Color.prototype = {
constructor: Color,
highlight(step) {
step = step || 10;
return this.alter(step).toHex()
},
darken(step) {
step = step || 10;
return this.alter(-step).toHex()
},
alter(step) {
const result = new Color;
result.r = normalize(this.r + step);
result.g = normalize(this.g + step);
result.b = normalize(this.b + step);
return result
},
blend(blendColor, opacity) {
const other = blendColor instanceof Color ? blendColor : new Color(blendColor);
const result = new Color;
result.r = normalize(_round(this.r * (1 - opacity) + other.r * opacity));
result.g = normalize(_round(this.g * (1 - opacity) + other.g * opacity));
result.b = normalize(_round(this.b * (1 - opacity) + other.b * opacity));
return result
},
toHex() {
return r = this.r, g = this.g, b = this.b, `#${(16777216|r<<16|g<<8|b).toString(16).slice(1)}`;
var r, g, b
},
getPureColor() {
const rgb = hsvToRgb(this.hsv.h, 100, 100);
return new Color(`rgb(${rgb.join(",")})`)
},
isValidHex: hex => /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex),
isValidRGB(r, g, b) {
if (!isIntegerBetweenMinAndMax(r) || !isIntegerBetweenMinAndMax(g) || !isIntegerBetweenMinAndMax(b)) {
return false
}
return true
},
isValidAlpha(a) {
if (isNaN(a) || a < 0 || a > 1 || "number" !== typeof a) {
return false
}
return true
},
colorIsInvalid: false,
fromHSL(hsl) {
const color = new Color;
const rgb = hslToRgb(hsl.h, hsl.s, hsl.l);
color.r = rgb[0];
color.g = rgb[1];
color.b = rgb[2];
return color
}
};
exports.default = Color
},
89983(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _position = _interopRequireDefault(__webpack_require__( /*! ../common/core/animation/position */ 3030));
var _translator = __webpack_require__( /*! ../common/core/animation/translator */ 88603);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../common/core/events/core/events_engine */ 92774));
var _drag = __webpack_require__( /*! ../common/core/events/drag */ 59144);
var _pointer = _interopRequireDefault(__webpack_require__( /*! ../common/core/events/pointer */ 89797));
var _index = __webpack_require__( /*! ../common/core/events/utils/index */ 98834);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../core/component_registrator */ 92848));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../core/dom_adapter */ 64960));
var _element = __webpack_require__( /*! ../core/element */ 61404);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../core/renderer */ 64553));
var _empty_template = __webpack_require__( /*! ../core/templates/empty_template */ 48650);
var _common = __webpack_require__( /*! ../core/utils/common */ 17781);
var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../core/utils/extend */ 52576);
var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 53124);
var _position2 = __webpack_require__( /*! ../core/utils/position */ 41639);
var _size = __webpack_require__( /*! ../core/utils/size */ 57653);
var _string = __webpack_require__( /*! ../core/utils/string */ 54497);
var _type = __webpack_require__( /*! ../core/utils/type */ 11528);
var _view_port = __webpack_require__( /*! ../core/utils/view_port */ 55355);
var _window = __webpack_require__( /*! ../core/utils/window */ 3104);
var _dom_component = _interopRequireDefault(__webpack_require__( /*! ./core/widget/dom_component */ 22331));
var _animator = _interopRequireDefault(__webpack_require__( /*! ./ui/scroll_view/animator */ 68634));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const window = (0, _window.getWindow)();
const DRAGGABLE = "dxDraggable";
const DRAGSTART_EVENT_NAME = (0, _index.addNamespace)(_drag.start, DRAGGABLE);
const DRAG_EVENT_NAME = (0, _index.addNamespace)(_drag.move, DRAGGABLE);
const DRAGEND_EVENT_NAME = (0, _index.addNamespace)(_drag.end, DRAGGABLE);
const DRAG_ENTER_EVENT_NAME = (0, _index.addNamespace)(_drag.enter, DRAGGABLE);
const DRAGEND_LEAVE_EVENT_NAME = (0, _index.addNamespace)(_drag.leave, DRAGGABLE);
const POINTERDOWN_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.down, DRAGGABLE);
const KEYDOWN_EVENT_NAME = (0, _index.addNamespace)("keydown", DRAGGABLE);
let targetDraggable;
let sourceDraggable;
const getMousePosition = event => ({
x: event.pageX - (0, _renderer.default)(window).scrollLeft(),
y: event.pageY - (0, _renderer.default)(window).scrollTop()
});
class ScrollHelper {
constructor(orientation, component) {
this._$scrollableAtPointer = null;
this._preventScroll = true;
this._component = component;
if ("vertical" === orientation) {
this._scrollValue = "scrollTop";
this._overFlowAttr = "overflowY";
this._sizeAttr = "height";
this._scrollSizeProp = "scrollHeight";
this._clientSizeProp = "clientHeight";
this._limitProps = {
start: "top",
end: "bottom"
}
} else {
this._scrollValue = "scrollLeft";
this._overFlowAttr = "overflowX";
this._sizeAttr = "width";
this._scrollSizeProp = "scrollWidth";
this._clientSizeProp = "clientWidth";
this._limitProps = {
start: "left",
end: "right"
}
}
}
updateScrollable(elements, mousePosition) {
let isScrollableFound = false;
elements.some(element => {
const $element = (0, _renderer.default)(element);
const isTargetOverOverlayWrapper = $element.hasClass("dx-overlay-wrapper");
const isTargetOverOverlayContent = $element.hasClass("dx-overlay-content");
if (isTargetOverOverlayWrapper || isTargetOverOverlayContent) {
return true
}
isScrollableFound = this._trySetScrollable(element, mousePosition);
return isScrollableFound
});
if (!isScrollableFound) {
this._$scrollableAtPointer = null;
this._scrollSpeed = 0
}
}
isScrolling() {
return !!this._scrollSpeed
}
isScrollable($element) {
return ("auto" === $element.css(this._overFlowAttr) || $element.hasClass("dx-scrollable-container")) && $element.prop(this._scrollSizeProp) > Math.ceil("width" === this._sizeAttr ? (0, _size.getWidth)($element) : (0, _size.getHeight)($element))
}
_trySetScrollable(element, mousePosition) {
const that = this;
const $element = (0, _renderer.default)(element);
let distanceToBorders;
const sensitivity = that._component.option("scrollSensitivity");
let isScrollable = that.isScrollable($element);
if (isScrollable) {
distanceToBorders = that._calculateDistanceToBorders($element, mousePosition);
if (sensitivity > distanceToBorders[that._limitProps.start]) {
if (!that._preventScroll) {
that._scrollSpeed = -that._calculateScrollSpeed(distanceToBorders[that._limitProps.start]);
that._$scrollableAtPointer = $element
}
} else if (sensitivity > distanceToBorders[that._limitProps.end]) {
if (!that._preventScroll) {
that._scrollSpeed = that._calculateScrollSpeed(distanceToBorders[that._limitProps.end]);
that._$scrollableAtPointer = $element
}
} else {
isScrollable = false;
that._preventScroll = false
}
}
return isScrollable
}
_calculateDistanceToBorders($area, mousePosition) {
const area = $area.get(0);
let areaBoundingRect;
if (area) {
areaBoundingRect = (0, _position2.getBoundingRect)(area);
return {
left: mousePosition.x - areaBoundingRect.left,
top: mousePosition.y - areaBoundingRect.top,
right: areaBoundingRect.right - mousePosition.x,
bottom: areaBoundingRect.bottom - mousePosition.y
}
}
return {}
}
_calculateScrollSpeed(distance) {
const component = this._component;
const sensitivity = component.option("scrollSensitivity");
const maxSpeed = component.option("scrollSpeed");
return Math.ceil(((sensitivity - distance) / sensitivity) ** 2 * maxSpeed)
}
scrollByStep() {
const that = this;
if (that._$scrollableAtPointer && that._scrollSpeed) {
if (that._$scrollableAtPointer.hasClass("dx-scrollable-container")) {
const $scrollable = that._$scrollableAtPointer.closest(".dx-scrollable");
const scrollableInstance = $scrollable.data("dxScrollable") || $scrollable.data("dxScrollView");
if (scrollableInstance) {
const nextScrollPosition = scrollableInstance.scrollOffset()[that._limitProps.start] + that._scrollSpeed;
scrollableInstance.scrollTo({
[that._limitProps.start]: nextScrollPosition
})
}
} else {
const nextScrollPosition = that._$scrollableAtPointer[that._scrollValue]() + that._scrollSpeed;
that._$scrollableAtPointer[that._scrollValue](nextScrollPosition)
}
const dragMoveArgs = that._component._dragMoveArgs;
if (dragMoveArgs) {
that._component._dragMoveHandler(dragMoveArgs)
}
}
}
reset() {
this._$scrollableAtPointer = null;
this._scrollSpeed = 0;
this._preventScroll = true
}
isOutsideScrollable($scrollable, event) {
if (!$scrollable) {
return false
}
const scrollableSize = (0, _position2.getBoundingRect)($scrollable.get(0));
const start = scrollableSize[this._limitProps.start];
const size = scrollableSize[this._sizeAttr];
const mousePosition = getMousePosition(event);
const location = "width" === this._sizeAttr ? mousePosition.x : mousePosition.y;
return location < start || location > start + size
}
}
class ScrollAnimator extends _animator.default {
constructor(strategy) {
super();
this._strategy = strategy
}
_step() {
const horizontalScrollHelper = this._strategy._horizontalScrollHelper;
const verticalScrollHelper = this._strategy._verticalScrollHelper;
null === horizontalScrollHelper || void 0 === horizontalScrollHelper || horizontalScrollHelper.scrollByStep();
null === verticalScrollHelper || void 0 === verticalScrollHelper || verticalScrollHelper.scrollByStep()
}
}
class Draggable extends _dom_component.default {
reset() {}
dragMove(e) {}
dragEnter() {}
dragLeave() {}
dragEnd(sourceEvent) {
const sourceDraggable = this._getSourceDraggable();
sourceDraggable._fireRemoveEvent(sourceEvent);
return (0, _deferred.Deferred)().resolve()
}
_fireRemoveEvent(sourceEvent) {}
_getDefaultOptions() {
return Object.assign({}, super._getDefaultOptions(), {
onDragStart: null,
onDragMove: null,
onDragEnd: null,
onDragEnter: null,
onDragLeave: null,
onDragCancel: null,
onCancelByEsc: false,
onDrop: null,
immediate: true,
dragDirection: "both",
boundOffset: 0,
allowMoveByClick: false,
itemData: null,
contentTemplate: "content",
handle: "",
filter: "",
clone: false,
autoScroll: true,
scrollSpeed: 30,
scrollSensitivity: 60
})
}
_setOptionsByReference() {
super._setOptionsByReference.apply(this, arguments);
(0, _extend.extend)(this._optionsByReference, {
component: true,
group: true,
itemData: true,
data: true
})
}
_init() {
super._init();
this._attachEventHandlers();
this._scrollAnimator = new ScrollAnimator(this);
this._horizontalScrollHelper = new ScrollHelper("horizontal", this);
this._verticalScrollHelper = new ScrollHelper("vertical", this);
this._initScrollTop = 0;
this._initScrollLeft = 0
}
_normalizeCursorOffset(offset) {
if ((0, _type.isObject)(offset)) {
offset = {
h: offset.x,
v: offset.y
}
}
offset = (0, _common.splitPair)(offset).map(value => parseFloat(value));
return {
left: offset[0],
top: 1 === offset.length ? offset[0] : offset[1]
}
}
_getNormalizedCursorOffset(offset, options) {
if ((0, _type.isFunction)(offset)) {
offset = offset.call(this, options)
}
return this._normalizeCursorOffset(offset)
}
_calculateElementOffset(options) {
let elementOffset;
let dragElementOffset;
const {
event: event
} = options;
const $element = (0, _renderer.default)(options.itemElement);
const $dragElement = (0, _renderer.default)(options.dragElement);
const isCloned = this._dragElementIsCloned();
const cursorOffset = this.option("cursorOffset");
let normalizedCursorOffset = {
left: 0,
top: 0
};
const currentLocate = this._initialLocate = (0, _translator.locate)($dragElement);
if (isCloned || options.initialOffset || cursorOffset) {
elementOffset = options.initialOffset || $element.offset();
if (cursorOffset) {
normalizedCursorOffset = this._getNormalizedCursorOffset(cursorOffset, options);
if (isFinite(normalizedCursorOffset.left)) {
elementOffset.left = event.pageX
}
if (isFinite(normalizedCursorOffset.top)) {
elementOffset.top = event.pageY
}
}
dragElementOffset = $dragElement.offset();
elementOffset.top -= dragElementOffset.top + (normalizedCursorOffset.top || 0) - currentLocate.top;
elementOffset.left -= dragElementOffset.left + (normalizedCursorOffset.left || 0) - currentLocate.left
}
return elementOffset
}
_initPosition(options) {
const $dragElement = (0, _renderer.default)(options.dragElement);
const elementOffset = this._calculateElementOffset(options);
if (elementOffset) {
this._move(elementOffset, $dragElement)
}
this._startPosition = (0, _translator.locate)($dragElement)
}
_startAnimator() {
if (!this._scrollAnimator.inProgress()) {
this._scrollAnimator.start()
}
}
_stopAnimator() {
this._scrollAnimator.stop()
}
_addWidgetPrefix(className) {
const componentName = this.NAME;
return (0, _inflector.dasherize)(componentName) + (className ? `-${className}` : "")
}
_getItemsSelector() {
return this.option("filter") || ""
}
_$content() {
const $element = this.$element();
const $wrapper = $element.children(".dx-template-wrapper");
return $wrapper.length ? $wrapper : $element
}
_attachEventHandlers() {
if (this.option("disabled")) {
return
}
let $element = this._$content();
let itemsSelector = this._getItemsSelector();
const allowMoveByClick = this.option("allowMoveByClick");
const data = {
direction: this.option("dragDirection"),
immediate: this.option("immediate"),
checkDropTarget: ($target, event) => {
const targetGroup = this.option("group");
const sourceGroup = this._getSourceDraggable().option("group");
const $scrollable = this._getScrollable($target);
if (this._verticalScrollHelper.isOutsideScrollable($scrollable, event) || this._horizontalScrollHelper.isOutsideScrollable($scrollable, event)) {
return false
}
return sourceGroup && sourceGroup === targetGroup
}
};
if (allowMoveByClick) {
$element = this._getArea();
_events_engine.default.on($element, POINTERDOWN_EVENT_NAME, data, this._pointerDownHandler.bind(this))
}
if (">" === itemsSelector[0]) {
itemsSelector = itemsSelector.slice(1)
}
_events_engine.default.on($element, DRAGSTART_EVENT_NAME, itemsSelector, data, this._dragStartHandler.bind(this));
_events_engine.default.on($element, DRAG_EVENT_NAME, data, this._dragMoveHandler.bind(this));
_events_engine.default.on($element, DRAGEND_EVENT_NAME, data, this._dragEndHandler.bind(this));
_events_engine.default.on($element, DRAG_ENTER_EVENT_NAME, data, this._dragEnterHandler.bind(this));
_events_engine.default.on($element, DRAGEND_LEAVE_EVENT_NAME, data, this._dragLeaveHandler.bind(this));
if (this.option("onCancelByEsc")) {
_events_engine.default.on($element, KEYDOWN_EVENT_NAME, this._keydownHandler.bind(this))
}
}
_dragElementIsCloned() {
var _this$_$dragElement;
return null === (_this$_$dragElement = this._$dragElement) || void 0 === _this$_$dragElement ? void 0 : _this$_$dragElement.hasClass(this._addWidgetPrefix("clone"))
}
_getDragTemplateArgs($element, $container) {
return {
container: (0, _element.getPublicElement)($container),
model: {
itemData: this.option("itemData"),
itemElement: (0, _element.getPublicElement)($element)
}
}
}
_createDragElement($element) {
let result = $element;
const clone = this.option("clone");
const $container = this._getContainer();
let template = this.option("dragTemplate");
if (template) {
template = this._getTemplate(template);
result = (0, _renderer.default)(" ").appendTo($container);
template.render(this._getDragTemplateArgs($element, result))
} else if (clone) {
result = (0, _renderer.default)(" ").appendTo($container);
$element.clone().css({
width: $element.css("width"),
height: $element.css("height")
}).appendTo(result)
}
return result.toggleClass(this._addWidgetPrefix("clone"), result.get(0) !== $element.get(0)).toggleClass("dx-rtl", this.option("rtlEnabled"))
}
_resetDragElement() {
if (this._dragElementIsCloned()) {
var _this$_$dragElement2;
null === (_this$_$dragElement2 = this._$dragElement) || void 0 === _this$_$dragElement2 || _this$_$dragElement2.remove()
} else {
this._toggleDraggingClass(false)
}
this._$dragElement = null
}
_resetSourceElement() {
this._toggleDragSourceClass(false);
this._$sourceElement = null
}
_detachEventHandlers() {
_events_engine.default.off(this._$content(), `.${DRAGGABLE}`);
_events_engine.default.off(this._getArea(), `.${DRAGGABLE}`)
}
_move(position, $element) {
(0, _translator.move)($element || this._$dragElement, position)
}
_getDraggableElement(e) {
const $sourceElement = this._getSourceElement();
if ($sourceElement) {
return $sourceElement
}
const allowMoveByClick = this.option("allowMoveByClick");
if (allowMoveByClick) {
return this.$element()
}
let $target = (0, _renderer.default)(null === e || void 0 === e ? void 0 : e.target);
const itemsSelector = this._getItemsSelector();
if (">" === itemsSelector[0]) {
const $items = this._$content().find(itemsSelector);
if (!$items.is($target)) {
$target = $target.closest($items)
}
}
return $target
}
_getSourceElement() {
const draggable = this._getSourceDraggable();
return draggable._$sourceElement
}
_pointerDownHandler(e) {
if ((0, _index.needSkipEvent)(e)) {
return
}
const position = {};
const $element = this.$element();
const {
dragDirection: dragDirection
} = this.option();
if ("horizontal" === dragDirection || "both" === dragDirection) {
position.left = e.pageX - $element.offset().left + (0, _translator.locate)($element).left - (0, _size.getWidth)($element) / 2
}
if ("vertical" === dragDirection || "both" === dragDirection) {
position.top = e.pageY - $element.offset().top + (0, _translator.locate)($element).top - (0, _size.getHeight)($element) / 2
}
this._move(position, $element);
this._getAction("onDragMove")(this._getEventArgs(e))
}
_isValidElement(event, $element) {
var _event$originalEvent;
const {
handle: handle
} = this.option();
const $target = (0, _renderer.default)(null === (_event$originalEvent = event.originalEvent) || void 0 === _event$originalEvent ? void 0 : _event$originalEvent.target);
if (handle && !$target.closest(handle).length) {
return false
}
if (!$element.length) {
return false
}
return !$element.is(".dx-state-disabled, .dx-state-disabled *")
}
_dragStartHandler(e) {
const $element = this._getDraggableElement(e);
this.dragInProgress = true;
if (!this._isValidElement(e, $element)) {
e.cancel = true;
return
}
if (this._$sourceElement) {
return
}
const dragStartArgs = this._getDragStartArgs(e, $element);
this._getAction("onDragStart")(dragStartArgs);
if (dragStartArgs.cancel) {
e.cancel = true;
return
}
this.option("itemData", dragStartArgs.itemData);
this._setSourceDraggable();
this._$sourceElement = $element;
let initialOffset = $element.offset();
if (!this._hasClonedDraggable() && this.option("autoScroll")) {
this._initScrollTop = this._getScrollableScrollTop();
this._initScrollLeft = this._getScrollableScrollLeft();
initialOffset = this._getDraggableElementOffset(initialOffset.left, initialOffset.top)
}
const $dragElement = this._$dragElement = this._createDragElement($element);
this._toggleDraggingClass(true);
this._toggleDragSourceClass(true);
this._setGestureCoverCursor($dragElement.children());
const isFixedPosition = "fixed" === $dragElement.css("position");
this._initPosition((0, _extend.extend)({}, dragStartArgs, {
dragElement: $dragElement.get(0),
initialOffset: isFixedPosition && initialOffset
}));
this._getAction("onDraggableElementShown")(Object.assign({}, dragStartArgs, {
dragElement: $dragElement
}));
const $area = this._getArea();
const areaOffset = this._getAreaOffset($area);
const boundOffset = this._getBoundOffset();
const areaWidth = (0, _size.getOuterWidth)($area);
const areaHeight = (0, _size.getOuterHeight)($area);
const elementWidth = (0, _size.getWidth)($dragElement);
const elementHeight = (0, _size.getHeight)($dragElement);
const startOffset_left = $dragElement.offset().left - areaOffset.left,
startOffset_top = $dragElement.offset().top - areaOffset.top;
if ($area.length) {
e.maxLeftOffset = startOffset_left - boundOffset.left;
e.maxRightOffset = areaWidth - startOffset_left - elementWidth - boundOffset.right;
e.maxTopOffset = startOffset_top - boundOffset.top;
e.maxBottomOffset = areaHeight - startOffset_top - elementHeight - boundOffset.bottom
}
if (this.option("autoScroll")) {
this._startAnimator()
}
}
_getAreaOffset($area) {
const offset = $area && _position.default.offset($area);
return offset || {
left: 0,
top: 0
}
}
_toggleDraggingClass(value) {
var _this$_$dragElement3;
null === (_this$_$dragElement3 = this._$dragElement) || void 0 === _this$_$dragElement3 || _this$_$dragElement3.toggleClass(this._addWidgetPrefix("dragging"), value)
}
_toggleDragSourceClass(value, $element) {
const $sourceElement = $element || this._$sourceElement;
null === $sourceElement || void 0 === $sourceElement || $sourceElement.toggleClass(this._addWidgetPrefix("source"), value)
}
_setGestureCoverCursor($element) {
(0, _renderer.default)(".dx-gesture-cover").css("cursor", $element.css("cursor"))
}
_getBoundOffset() {
let boundOffset = this.option("boundOffset");
if ((0, _type.isFunction)(boundOffset)) {
boundOffset = boundOffset.call(this)
}
return (0, _string.quadToObject)(boundOffset)
}
_getArea() {
let area = this.option("boundary");
if ((0, _type.isFunction)(area)) {
area = area.call(this)
}
return (0, _renderer.default)(area)
}
_getContainer() {
let {
container: container
} = this.option();
if (void 0 === container) {
container = (0, _view_port.value)()
}
return (0, _renderer.default)(container)
}
_getDraggableElementOffset(initialOffsetX, initialOffsetY) {
var _this$_startPosition, _this$_startPosition2;
const initScrollTop = this._initScrollTop;
const initScrollLeft = this._initScrollLeft;
const scrollTop = this._getScrollableScrollTop();
const scrollLeft = this._getScrollableScrollLeft();
const elementPosition = (0, _renderer.default)(this.element()).css("position");
const isFixedPosition = "fixed" === elementPosition;
const result = {
left: ((null === (_this$_startPosition = this._startPosition) || void 0 === _this$_startPosition ? void 0 : _this$_startPosition.left) ?? 0) + initialOffsetX,
top: ((null === (_this$_startPosition2 = this._startPosition) || void 0 === _this$_startPosition2 ? void 0 : _this$_startPosition2.top) ?? 0) + initialOffsetY
};
if (isFixedPosition || this._hasClonedDraggable()) {
return result
}
return {
left: (0, _type.isNumeric)(scrollLeft) ? result.left + scrollLeft - initScrollLeft : result.left,
top: (0, _type.isNumeric)(scrollTop) ? result.top + scrollTop - initScrollTop : result.top
}
}
_hasClonedDraggable() {
return this.option("clone") || this.option("dragTemplate")
}
_dragMoveHandler(e) {
this._dragMoveArgs = e;
if (!this._$dragElement) {
e.cancel = true;
return
}
const offset = this._getDraggableElementOffset(e.offset.x, e.offset.y);
this._move(offset);
this._updateScrollable(e);
const eventArgs = this._getEventArgs(e);
this._getAction("onDragMove")(eventArgs);
if (true === eventArgs.cancel) {
return
}
const targetDraggable = this._getTargetDraggable();
targetDraggable.dragMove(e, scrollBy)
}
_updateScrollable(e) {
const that = this;
if (that.option("autoScroll")) {
const mousePosition = getMousePosition(e);
const allObjects = _dom_adapter.default.elementsFromPoint(mousePosition.x, mousePosition.y, this.$element().get(0));
that._verticalScrollHelper.updateScrollable(allObjects, mousePosition);
that._horizontalScrollHelper.updateScrollable(allObjects, mousePosition)
}
}
_getScrollable($element) {
let $scrollable;
$element.parents().toArray().some(parent => {
const $parent = (0, _renderer.default)(parent);
if (this._horizontalScrollHelper.isScrollable($parent) || this._verticalScrollHelper.isScrollable($parent)) {
$scrollable = $parent;
return true
}
return false
});
return $scrollable
}
_getScrollableScrollTop() {
var _this$_getScrollable;
return (null === (_this$_getScrollable = this._getScrollable((0, _renderer.default)(this.element()))) || void 0 === _this$_getScrollable ? void 0 : _this$_getScrollable.scrollTop()) ?? 0
}
_getScrollableScrollLeft() {
var _this$_getScrollable2;
return (null === (_this$_getScrollable2 = this._getScrollable((0, _renderer.default)(this.element()))) || void 0 === _this$_getScrollable2 ? void 0 : _this$_getScrollable2.scrollLeft()) ?? 0
}
_defaultActionArgs() {
const args = super._defaultActionArgs.apply(this, arguments);
const component = this.option("component");
if (component) {
args.component = component;
args.element = component.element()
}
return args
}
_getEventArgs(e) {
const sourceDraggable = this._getSourceDraggable();
const targetDraggable = this._getTargetDraggable();
return {
event: e,
itemData: sourceDraggable.option("itemData"),
itemElement: (0, _element.getPublicElement)(sourceDraggable._$sourceElement),
fromComponent: sourceDraggable.option("component") || sourceDraggable,
toComponent: targetDraggable.option("component") || targetDraggable,
fromData: sourceDraggable.option("data"),
toData: targetDraggable.option("data")
}
}
_getDragStartArgs(e, $itemElement) {
const args = this._getEventArgs(e);
return {
event: args.event,
itemData: args.itemData,
itemElement: $itemElement,
fromData: args.fromData
}
}
_revertItemToInitialPosition() {
!this._dragElementIsCloned() && this._move(this._initialLocate, this._$sourceElement)
}
_dragEndHandler(e) {
const d = (0, _deferred.Deferred)();
const dragEndEventArgs = this._getEventArgs(e);
const dropEventArgs = this._getEventArgs(e);
const targetDraggable = this._getTargetDraggable();
let needRevertPosition = true;
this.dragInProgress = false;
try {
this._getAction("onDragEnd")(dragEndEventArgs)
} finally {
(0, _deferred.when)((0, _deferred.fromPromise)(dragEndEventArgs.cancel)).done(cancel => {
if (!cancel) {
if (targetDraggable !== this) {
targetDraggable._getAction("onDrop")(dropEventArgs)
}
if (!dropEventArgs.cancel) {
needRevertPosition = false;
(0, _deferred.when)((0, _deferred.fromPromise)(targetDraggable.dragEnd(dragEndEventArgs))).always(d.resolve);
return
}
}
d.resolve()
}).fail(d.resolve);
d.done(() => {
if (needRevertPosition) {
this._revertItemToInitialPosition()
}
this._resetDragOptions(targetDraggable)
})
}
}
_isTargetOverAnotherDraggable(e) {
const sourceDraggable = this._getSourceDraggable();
if (this === sourceDraggable) {
return false
}
const $dragElement = sourceDraggable._$dragElement;
const $sourceDraggableElement = sourceDraggable.$element();
const $targetDraggableElement = this.$element();
const mousePosition = getMousePosition(e);
const elements = _dom_adapter.default.elementsFromPoint(mousePosition.x, mousePosition.y, this.element());
const firstWidgetElement = elements.filter(element => {
const $element = (0, _renderer.default)(element);
if ($element.hasClass(this._addWidgetPrefix())) {
return !$element.closest($dragElement).length
}
return false
})[0];
const $sourceElement = this._getSourceElement();
const isTargetOverItself = firstWidgetElement === $sourceDraggableElement.get(0);
const isTargetOverNestedDraggable = (0, _renderer.default)(firstWidgetElement).closest($sourceElement).length;
return !firstWidgetElement || firstWidgetElement === $targetDraggableElement.get(0) && !isTargetOverItself && !isTargetOverNestedDraggable
}
_dragEnterHandler(e) {
this._fireDragEnterEvent(e);
if (this._isTargetOverAnotherDraggable(e)) {
this._setTargetDraggable()
}
const sourceDraggable = this._getSourceDraggable();
sourceDraggable.dragEnter(e)
}
_dragLeaveHandler(e) {
this._fireDragLeaveEvent(e);
this._resetTargetDraggable();
if (this !== this._getSourceDraggable()) {
this.reset()
}
const sourceDraggable = this._getSourceDraggable();
sourceDraggable.dragLeave(e)
}
_keydownHandler(e) {
if (this.dragInProgress && "Escape" === e.key) {
this._keydownEscapeHandler(e)
}
}
_keydownEscapeHandler(e) {
var _sourceDraggable;
const $sourceElement = this._getSourceElement();
if (!$sourceElement) {
return
}
const dragCancelEventArgs = this._getEventArgs(e);
this._getAction("onDragCancel")(dragCancelEventArgs);
if (dragCancelEventArgs.cancel) {
return
}
this.dragInProgress = false;
null === (_sourceDraggable = sourceDraggable) || void 0 === _sourceDraggable || _sourceDraggable._toggleDraggingClass(false);
this._detachEventHandlers();
this._revertItemToInitialPosition();
const targetDraggable = this._getTargetDraggable();
this._resetDragOptions(targetDraggable);
this._attachEventHandlers()
}
_getAction(name) {
return this[`_${name}Action`] || this._createActionByOption(name)
}
_getAnonymousTemplateName() {
return "content"
}
_initTemplates() {
if (!this.option("contentTemplate")) {
return
}
this._templateManager.addDefaultTemplates({
content: new _empty_template.EmptyTemplate
});
super._initTemplates.apply(this, arguments)
}
_render() {
super._render();
this.$element().addClass(this._addWidgetPrefix());
const transclude = this._templateManager.anonymousTemplateName === this.option("contentTemplate");
const template = this._getTemplateByOption("contentTemplate");
if (template) {
(0, _renderer.default)(template.render({
container: this.element(),
transclude: transclude
}))
}
}
_optionChanged(args) {
const {
name: name
} = args;
switch (name) {
case "onDragStart":
case "onDragMove":
case "onDragEnd":
case "onDrop":
case "onDragEnter":
case "onDragLeave":
case "onDragCancel":
case "onDraggableElementShown":
this[`_${name}Action`] = this._createActionByOption(name);
break;
case "dragTemplate":
case "contentTemplate":
case "container":
case "clone":
case "scrollSensitivity":
case "scrollSpeed":
case "boundOffset":
case "handle":
case "group":
case "data":
case "itemData":
break;
case "allowMoveByClick":
case "dragDirection":
case "disabled":
case "boundary":
case "filter":
case "immediate":
this._resetDragElement();
this._detachEventHandlers();
this._attachEventHandlers();
break;
case "onCancelByEsc":
this._keydownHandler();
break;
case "autoScroll":
this._verticalScrollHelper.reset();
this._horizontalScrollHelper.reset();
break;
default:
super._optionChanged(args)
}
}
_getTargetDraggable() {
return targetDraggable || this
}
_getSourceDraggable() {
return sourceDraggable || this
}
_setTargetDraggable() {
const currentGroup = this.option("group");
const sourceDraggable = this._getSourceDraggable();
if (currentGroup && currentGroup === sourceDraggable.option("group")) {
targetDraggable = this
}
}
_setSourceDraggable() {
sourceDraggable = this
}
_resetSourceDraggable() {
sourceDraggable = null
}
_resetTargetDraggable() {
targetDraggable = null
}
_resetDragOptions(targetDraggable) {
this.reset();
targetDraggable.reset();
this._stopAnimator();
this._horizontalScrollHelper.reset();
this._verticalScrollHelper.reset();
this._resetDragElement();
this._resetSourceElement();
this._resetTargetDraggable();
this._resetSourceDraggable()
}
_dispose() {
super._dispose();
this._detachEventHandlers();
this._resetDragElement();
this._resetTargetDraggable();
this._resetSourceDraggable();
this._$sourceElement = null;
this._stopAnimator()
}
_fireDragEnterEvent(sourceEvent) {
const args = this._getEventArgs(sourceEvent);
this._getAction("onDragEnter")(args)
}
_fireDragLeaveEvent(sourceEvent) {
const args = this._getEventArgs(sourceEvent);
this._getAction("onDragLeave")(args)
}
}(0, _component_registrator.default)(DRAGGABLE, Draggable);
exports.default = Draggable
},
96334(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _animation = __webpack_require__( /*! ../common/core/animation */ 16826);
var _translator = __webpack_require__( /*! ../common/core/animation/translator */ 88603);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../common/core/events/core/events_engine */ 92774));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../core/component_registrator */ 92848));
var _element = __webpack_require__( /*! ../core/element */ 61404);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../core/renderer */ 64553));
var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../core/utils/extend */ 52576);
var _position = __webpack_require__( /*! ../core/utils/position */ 41639);
var _size = __webpack_require__( /*! ../core/utils/size */ 57653);
var _window = __webpack_require__( /*! ../core/utils/window */ 3104);
var _m_draggable = _interopRequireDefault(__webpack_require__( /*! ./m_draggable */ 89983));
var _type = __webpack_require__( /*! ../core/utils/type */ 11528);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const window = (0, _window.getWindow)();
const isElementVisible = itemElement => (0, _renderer.default)(itemElement).is(":visible");
const animate = (element, config) => {
var _config$to, _config$to2;
if (!element) {
return
}
const left = (null === (_config$to = config.to) || void 0 === _config$to ? void 0 : _config$to.left) || 0;
const top = (null === (_config$to2 = config.to) || void 0 === _config$to2 ? void 0 : _config$to2.top) || 0;
element.style.transform = `translate(${left}px,${top}px)`;
element.style.transition = _animation.fx.off ? "" : `transform ${config.duration}ms ${config.easing}`
};
const stopAnimation = element => {
if (!element) {
return
}
element.style.transform = "";
element.style.transition = ""
};
class Sortable extends _m_draggable.default {
_init() {
super._init();
this._sourceScrollHandler = this._handleSourceScroll.bind(this);
this._sourceScrollableInfo = null
}
_getDefaultOptions() {
return Object.assign({}, super._getDefaultOptions(), {
clone: true,
filter: "> *",
itemOrientation: "vertical",
dropFeedbackMode: "push",
allowDropInsideItem: false,
allowReordering: true,
moveItemOnDrop: false,
onDragChange: null,
onAdd: null,
onRemove: null,
onReorder: null,
onPlaceholderPrepared: null,
placeholderClassName: "",
animation: {
type: "slide",
duration: 300,
easing: "ease"
},
fromIndex: null,
toIndex: null,
dropInsideItem: false,
itemPoints: null,
fromIndexOffset: 0,
offset: 0,
autoUpdate: false,
draggableElementSize: 0
})
}
reset() {
this.option({
dropInsideItem: false,
toIndex: null,
fromIndex: null,
itemPoints: null,
fromIndexOffset: 0,
draggableElementSize: 0
});
if (this._$placeholderElement) {
this._$placeholderElement.remove()
}
this._$placeholderElement = null;
if (!this._isIndicateMode() && this._$modifiedItem) {
this._$modifiedItem.css("marginBottom", this._modifiedItemMargin);
this._$modifiedItem = null
}
}
_getPrevVisibleItem(items, index) {
return items.slice(0, index).reverse().filter(isElementVisible)[0]
}
_dragStartHandler(e) {
super._dragStartHandler.apply(this, arguments);
if (true === e.cancel) {
return
}
const $sourceElement = this._getSourceElement();
this._updateItemPoints();
this._subscribeToSourceScroll(e);
this.option("fromIndex", this._getElementIndex($sourceElement));
this.option("fromIndexOffset", this.option("offset"))
}
_subscribeToSourceScroll(e) {
const $scrollable = this._getScrollable((0, _renderer.default)(e.target));
if ($scrollable) {
this._sourceScrollableInfo = {
element: $scrollable,
scrollLeft: $scrollable.scrollLeft(),
scrollTop: $scrollable.scrollTop()
};
_events_engine.default.off($scrollable, "scroll", this._sourceScrollHandler);
_events_engine.default.on($scrollable, "scroll", this._sourceScrollHandler)
}
}
_unsubscribeFromSourceScroll() {
if (this._sourceScrollableInfo) {
_events_engine.default.off(this._sourceScrollableInfo.element, "scroll", this._sourceScrollHandler);
this._sourceScrollableInfo = null
}
}
_handleSourceScroll(e) {
const sourceScrollableInfo = this._sourceScrollableInfo;
if (sourceScrollableInfo) {
["scrollLeft", "scrollTop"].forEach(scrollProp => {
if (e.target[scrollProp] !== sourceScrollableInfo[scrollProp]) {
const scrollBy = e.target[scrollProp] - sourceScrollableInfo[scrollProp];
this._correctItemPoints(scrollBy);
this._movePlaceholder();
sourceScrollableInfo[scrollProp] = e.target[scrollProp]
}
})
}
}
_dragEnterHandler(e) {
super._dragEnterHandler.apply(this, arguments);
if (this === this._getSourceDraggable()) {
return
}
this._subscribeToSourceScroll(e);
this._updateItemPoints();
this.option("fromIndex", -1);
if (!this._isIndicateMode()) {
const itemPoints = this.option("itemPoints");
const lastItemPoint = itemPoints[itemPoints.length - 1];
if (lastItemPoint) {
const $element = this.$element();
const $sourceElement = this._getSourceElement();
const isVertical = this._isVerticalOrientation();
const sourceElementSize = isVertical ? (0, _size.getOuterHeight)($sourceElement, true) : (0, _size.getOuterWidth)($sourceElement, true);
const scrollSize = $element.get(0)[isVertical ? "scrollHeight" : "scrollWidth"];
const scrollPosition = $element.get(0)[isVertical ? "scrollTop" : "scrollLeft"];
const positionProp = isVertical ? "top" : "left";
const lastPointPosition = lastItemPoint[positionProp];
const elementPosition = $element.offset()[positionProp];
const freeSize = elementPosition + scrollSize - scrollPosition - lastPointPosition;
if (freeSize < sourceElementSize) {
if (isVertical) {
const items = this._getItems();
const $lastItem = (0, _renderer.default)(this._getPrevVisibleItem(items));
this._$modifiedItem = $lastItem;
this._modifiedItemMargin = $lastItem.get(0).style.marginBottom;
$lastItem.css("marginBottom", sourceElementSize - freeSize);
const $sortable = $lastItem.closest(".dx-sortable");
const sortable = $sortable.data("dxScrollable") || $sortable.data("dxScrollView");
null === sortable || void 0 === sortable || sortable.update()
}
}
}
}
}
_dragLeaveHandler() {
super._dragLeaveHandler.apply(this, arguments);
if (this !== this._getSourceDraggable()) {
this._unsubscribeFromSourceScroll()
}
}
dragEnter() {
if (this !== this._getTargetDraggable()) {
this.option("toIndex", -1)
}
}
dragLeave() {
if (this !== this._getTargetDraggable()) {
this.option("toIndex", this.option("fromIndex"))
}
}
_allowDrop(event) {
const targetDraggable = this._getTargetDraggable();
const $targetDraggable = targetDraggable.$element();
const $scrollable = this._getScrollable($targetDraggable);
if ($scrollable) {
const {
left: left,
right: right,
top: top,
bottom: bottom
} = function($scrollable) {
const offset = $scrollable.offset();
const {
style: style
} = $scrollable[0];
const paddingLeft = parseFloat(style.paddingLeft) || 0;
const paddingRight = parseFloat(style.paddingRight) || 0;
const paddingTop = parseFloat(style.paddingTop) || 0;
const width = $scrollable[0].clientWidth - (paddingLeft + paddingRight);
const height = (0, _size.getHeight)($scrollable);
const left = offset.left + paddingLeft;
const top = offset.top + paddingTop;
return {
left: left,
right: left + width,
top: top,
bottom: top + height
}
}($scrollable);
const toIndex = this.option("toIndex");
const itemPoints = this.option("itemPoints");
const itemPoint = null === itemPoints || void 0 === itemPoints ? void 0 : itemPoints.filter(item => item.index === toIndex)[0];
if (itemPoint && void 0 !== itemPoint.top) {
const isVertical = this._isVerticalOrientation();
if (isVertical) {
return top <= Math.ceil(itemPoint.top) && Math.floor(itemPoint.top) <= bottom
}
return left <= Math.ceil(itemPoint.left) && Math.floor(itemPoint.left) <= right
}
}
return true
}
dragEnd(sourceEvent) {
this._unsubscribeFromSourceScroll();
const $sourceElement = this._getSourceElement();
const sourceDraggable = this._getSourceDraggable();
const isSourceDraggable = sourceDraggable.NAME !== this.NAME;
const toIndex = this.option("toIndex");
const {
event: event
} = sourceEvent;
const allowDrop = this._allowDrop(event);
if (null !== toIndex && toIndex >= 0 && allowDrop) {
let cancelAdd;
let cancelRemove;
if (sourceDraggable !== this) {
cancelAdd = this._fireAddEvent(event);
if (!cancelAdd) {
cancelRemove = this._fireRemoveEvent(event)
}
}
if (isSourceDraggable) {
(0, _translator.resetPosition)($sourceElement)
}
if (this.option("moveItemOnDrop")) {
!cancelAdd && this._moveItem($sourceElement, toIndex, cancelRemove)
}
if (sourceDraggable === this) {
return this._fireReorderEvent(event)
}
}
return (0, _deferred.Deferred)().resolve()
}
dragMove(e) {
const itemPoints = this.option("itemPoints");
if (!itemPoints) {
return
}
const isVertical = this._isVerticalOrientation();
const axisName = isVertical ? "top" : "left";
const cursorPosition = isVertical ? e.pageY : e.pageX;
const rtlEnabled = this.option("rtlEnabled");
let itemPoint;
for (let i = itemPoints.length - 1; i >= 0; i--) {
const centerPosition = itemPoints[i + 1] && (itemPoints[i][axisName] + itemPoints[i + 1][axisName]) / 2;
if ((!isVertical && rtlEnabled ? cursorPosition > centerPosition : centerPosition > cursorPosition) || void 0 === centerPosition) {
itemPoint = itemPoints[i]
} else {
break
}
}
if (itemPoint) {
this._updatePlaceholderPosition(e, itemPoint);
if (this._verticalScrollHelper.isScrolling() && this._isIndicateMode()) {
this._movePlaceholder()
}
}
}
_isIndicateMode() {
return "indicate" === this.option("dropFeedbackMode") || this.option("allowDropInsideItem")
}
_createPlaceholder() {
if (!this._isIndicateMode()) {
return
}
const customCssClass = this.option("placeholderClassName");
this._$placeholderElement = (0, _renderer.default)(" ").addClass(this._addWidgetPrefix("placeholder")).addClass(customCssClass ?? "").insertBefore(this._getSourceDraggable()._$dragElement);
return this._$placeholderElement
}
_getItems() {
const itemsSelector = this._getItemsSelector();
return this._$content().find(itemsSelector).not(`.${this._addWidgetPrefix("placeholder")}`).not(`.${this._addWidgetPrefix("clone")}`).toArray()
}
_allowReordering() {
const sourceDraggable = this._getSourceDraggable();
const targetDraggable = this._getTargetDraggable();
return sourceDraggable !== targetDraggable || this.option("allowReordering")
}
_isValidPoint(visibleIndex, draggableVisibleIndex, dropInsideItem) {
const allowDropInsideItem = this.option("allowDropInsideItem");
const allowReordering = dropInsideItem || this._allowReordering();
if (!allowReordering && (0 !== visibleIndex || !allowDropInsideItem)) {
return false
}
if (!this._isIndicateMode()) {
return true
}
return -1 === draggableVisibleIndex || visibleIndex !== draggableVisibleIndex && (dropInsideItem || visibleIndex !== draggableVisibleIndex + 1)
}
_getItemPoints() {
const that = this;
let result = [];
let $item;
let offset;
let itemWidth;
const {
rtlEnabled: rtlEnabled
} = that.option();
const isVertical = that._isVerticalOrientation();
const itemElements = that._getItems();
const visibleItemElements = itemElements.filter(isElementVisible);
const visibleItemCount = visibleItemElements.length;
const $draggableItem = this._getDraggableElement();
const draggableVisibleIndex = visibleItemElements.indexOf($draggableItem.get(0));
if (visibleItemCount) {
for (let i = 0; i <= visibleItemCount; i++) {
const needCorrectLeftPosition = !isVertical && rtlEnabled ^ i === visibleItemCount;
const needCorrectTopPosition = isVertical && i === visibleItemCount;
if (i < visibleItemCount) {
$item = (0, _renderer.default)(visibleItemElements[i]);
offset = $item.offset();
itemWidth = (0, _size.getOuterWidth)($item)
}
result.push({
dropInsideItem: false,
left: offset.left + (needCorrectLeftPosition ? itemWidth : 0),
top: offset.top + (needCorrectTopPosition ? result[i - 1].height : 0),
index: i === visibleItemCount ? itemElements.length : itemElements.indexOf($item.get(0)),
$item: $item,
width: (0, _size.getOuterWidth)($item),
height: (0, _size.getOuterHeight)($item),
isValid: that._isValidPoint(i, draggableVisibleIndex)
})
}
if (this.option("allowDropInsideItem")) {
const points = result;
result = [];
for (let i = 0; i < points.length; i++) {
result.push(points[i]);
if (points[i + 1]) {
result.push((0, _extend.extend)({}, points[i], {
dropInsideItem: true,
top: Math.floor((points[i].top + points[i + 1].top) / 2),
left: Math.floor((points[i].left + points[i + 1].left) / 2),
isValid: this._isValidPoint(i, draggableVisibleIndex, true)
}))
}
}
}
} else {
result.push({
dropInsideItem: false,
index: 0,
isValid: true
})
}
return result
}
_updateItemPoints(forceUpdate) {
if (forceUpdate || this.option("autoUpdate") || !this.option("itemPoints")) {
this.option("itemPoints", this._getItemPoints())
}
}
_correctItemPoints(scrollBy) {
const itemPoints = this.option("itemPoints");
if (scrollBy && itemPoints && !this.option("autoUpdate")) {
const isVertical = this._isVerticalOrientation();
const positionPropName = isVertical ? "top" : "left";
itemPoints.forEach(itemPoint => {
itemPoint[positionPropName] -= scrollBy
})
}
}
_getElementIndex($itemElement) {
return this._getItems().indexOf($itemElement.get(0))
}
_getDragTemplateArgs($element) {
const args = super._getDragTemplateArgs.apply(this, arguments);
args.model.fromIndex = this._getElementIndex($element);
return args
}
_togglePlaceholder(value) {
var _this$_$placeholderEl;
null === (_this$_$placeholderEl = this._$placeholderElement) || void 0 === _this$_$placeholderEl || _this$_$placeholderEl.toggle(value)
}
_isVerticalOrientation() {
const {
itemOrientation: itemOrientation
} = this.option();
return "vertical" === itemOrientation
}
_normalizeToIndex(toIndex, skipOffsetting) {
const isAnotherDraggable = this._getSourceDraggable() !== this._getTargetDraggable();
const fromIndex = this._getActualFromIndex();
if (null === toIndex) {
return fromIndex
}
return Math.max(isAnotherDraggable || fromIndex >= toIndex || skipOffsetting ? toIndex : toIndex - 1, 0)
}
_updatePlaceholderPosition(e, itemPoint) {
const sourceDraggable = this._getSourceDraggable();
const toIndex = this._normalizeToIndex(itemPoint.index, itemPoint.dropInsideItem);
const eventArgs = (0, _extend.extend)(this._getEventArgs(e), {
toIndex: toIndex,
dropInsideItem: itemPoint.dropInsideItem
});
itemPoint.isValid && this._getAction("onDragChange")(eventArgs);
if (eventArgs.cancel || !itemPoint.isValid) {
if (!itemPoint.isValid) {
this.option({
dropInsideItem: false,
toIndex: null
})
}
return
}
this.option({
dropInsideItem: itemPoint.dropInsideItem,
toIndex: itemPoint.index
});
this._getAction("onPlaceholderPrepared")((0, _extend.extend)(this._getEventArgs(e), {
placeholderElement: (0, _element.getPublicElement)(this._$placeholderElement),
dragElement: (0, _element.getPublicElement)(sourceDraggable._$dragElement)
}));
this._updateItemPoints()
}
_makeWidthCorrection($item, width) {
this._$scrollable = this._getScrollable($item);
if (this._$scrollable) {
const scrollableWidth = (0, _size.getWidth)(this._$scrollable);
const overflowLeft = this._$scrollable.offset().left - $item.offset().left;
const overflowRight = (0, _size.getOuterWidth)($item) - overflowLeft - scrollableWidth;
if (overflowLeft > 0) {
width -= overflowLeft
}
if (overflowRight > 0) {
width -= overflowRight
}
}
return width
}
_updatePlaceholderSizes($placeholderElement, $itemElement) {
const dropInsideItem = this.option("dropInsideItem");
const isVertical = this._isVerticalOrientation();
let width = "";
let height = "";
$placeholderElement.toggleClass(this._addWidgetPrefix("placeholder-inside"), dropInsideItem);
if (isVertical || dropInsideItem) {
width = (0, _size.getOuterWidth)($itemElement)
}
if (!isVertical || dropInsideItem) {
height = (0, _size.getOuterHeight)($itemElement)
}
width = this._makeWidthCorrection($itemElement, width);
$placeholderElement.css({
width: width,
height: height
})
}
_moveItem($itemElement, index, cancelRemove) {
let $prevTargetItemElement;
const $itemElements = this._getItems();
const $targetItemElement = $itemElements[index];
const sourceDraggable = this._getSourceDraggable();
if (cancelRemove) {
$itemElement = $itemElement.clone();
sourceDraggable._toggleDragSourceClass(false, $itemElement)
}
if (!$targetItemElement) {
$prevTargetItemElement = $itemElements[index - 1]
}
this._moveItemCore($itemElement, $targetItemElement, $prevTargetItemElement)
}
_moveItemCore($targetItem, item, prevItem) {
if (!item && !prevItem) {
$targetItem.appendTo(this.$element())
} else if (prevItem) {
$targetItem.insertAfter((0, _renderer.default)(prevItem))
} else {
$targetItem.insertBefore((0, _renderer.default)(item))
}
}
_getDragStartArgs(e, $itemElement) {
return (0, _extend.extend)(super._getDragStartArgs.apply(this, arguments), {
fromIndex: this._getElementIndex($itemElement)
})
}
_getEventArgs(e) {
const sourceDraggable = this._getSourceDraggable();
const targetDraggable = this._getTargetDraggable();
const dropInsideItem = targetDraggable.option("dropInsideItem");
return (0, _extend.extend)(super._getEventArgs.apply(this, arguments), {
fromIndex: sourceDraggable.option("fromIndex"),
toIndex: this._normalizeToIndex(targetDraggable.option("toIndex"), dropInsideItem),
dropInsideItem: dropInsideItem
})
}
_optionChanged(args) {
const {
name: name
} = args;
switch (name) {
case "onDragChange":
case "onPlaceholderPrepared":
case "onAdd":
case "onRemove":
case "onReorder":
this[`_${name}Action`] = this._createActionByOption(name);
break;
case "fromIndex":
[false, true].forEach(isDragSource => {
const fromIndex = isDragSource ? args.value : args.previousValue;
if (null !== fromIndex) {
const $fromElement = (0, _renderer.default)(this._getItems()[fromIndex]);
this._toggleDragSourceClass(isDragSource, $fromElement)
}
});
break;
case "dropInsideItem":
this._optionChangedDropInsideItem(args);
break;
case "toIndex":
this._optionChangedToIndex(args);
break;
case "itemOrientation":
case "allowDropInsideItem":
case "moveItemOnDrop":
case "dropFeedbackMode":
case "itemPoints":
case "animation":
case "allowReordering":
case "fromIndexOffset":
case "offset":
case "draggableElementSize":
case "autoUpdate":
case "placeholderClassName":
break;
default:
super._optionChanged(args)
}
}
_optionChangedDropInsideItem() {
if (this._isIndicateMode() && this._$placeholderElement) {
this._movePlaceholder()
}
}
_isPositionVisible(position) {
const $element = this.$element();
let scrollContainer;
if ("hidden" !== $element.css("overflow")) {
scrollContainer = $element.get(0)
} else {
$element.parents().each(function() {
if ("visible" !== (0, _renderer.default)(this).css("overflow")) {
scrollContainer = this;
return false
}
return
})
}
if (scrollContainer) {
const clientRect = (0, _position.getBoundingRect)(scrollContainer);
const isVerticalOrientation = this._isVerticalOrientation();
const start = isVerticalOrientation ? "top" : "left";
const end = isVerticalOrientation ? "bottom" : "right";
const pageOffset = isVerticalOrientation ? window.pageYOffset : window.pageXOffset;
if (position[start] < clientRect[start] + pageOffset || position[start] > clientRect[end] + pageOffset) {
return false
}
}
return true
}
_optionChangedToIndex(args) {
const toIndex = args.value;
if (this._isIndicateMode()) {
const showPlaceholder = null !== toIndex && toIndex >= 0;
this._togglePlaceholder(showPlaceholder);
if (showPlaceholder) {
this._movePlaceholder()
}
} else {
this._moveItems(args.previousValue, args.value, args.fullUpdate)
}
}
update() {
if (null === this.option("fromIndex") && null === this.option("toIndex")) {
return
}
this._updateItemPoints(true);
this._updateDragSourceClass();
const toIndex = this.option("toIndex");
this._optionChangedToIndex({
value: toIndex,
fullUpdate: true
})
}
_updateDragSourceClass() {
const fromIndex = this._getActualFromIndex();
const $fromElement = (0, _renderer.default)(this._getItems()[fromIndex]);
if ($fromElement.length) {
this._$sourceElement = $fromElement;
this._toggleDragSourceClass(true, $fromElement)
}
}
_makeLeftCorrection(left) {
const $scrollable = this._$scrollable;
if ($scrollable && this._isVerticalOrientation()) {
const overflowLeft = $scrollable.offset().left - left;
if (overflowLeft > 0) {
left += overflowLeft
}
}
return left
}
_movePlaceholder() {
const that = this;
const $placeholderElement = that._$placeholderElement || that._createPlaceholder();
if (!$placeholderElement) {
return
}
const items = that._getItems();
const toIndex = that.option("toIndex");
const isVerticalOrientation = that._isVerticalOrientation();
const rtlEnabled = this.option("rtlEnabled");
const dropInsideItem = that.option("dropInsideItem");
let position = null;
let itemElement = items[toIndex];
if (itemElement) {
const $itemElement = (0, _renderer.default)(itemElement);
position = $itemElement.offset();
if (!isVerticalOrientation && rtlEnabled && !dropInsideItem) {
position.left += (0, _size.getOuterWidth)($itemElement, true)
}
} else {
const prevVisibleItemElement = itemElement = this._getPrevVisibleItem(items, toIndex);
if (prevVisibleItemElement) {
position = (0, _renderer.default)(prevVisibleItemElement).offset();
if (isVerticalOrientation) {
position.top += (0, _size.getOuterHeight)(prevVisibleItemElement, true)
} else if (!rtlEnabled) {
position.left += (0, _size.getOuterWidth)(prevVisibleItemElement, true)
}
}
}
that._updatePlaceholderSizes($placeholderElement, (0, _renderer.default)(itemElement));
if (position && !that._isPositionVisible(position)) {
position = null
}
if (position) {
const isLastVerticalPosition = isVerticalOrientation && toIndex === items.length;
const outerPlaceholderHeight = (0, _size.getOuterHeight)($placeholderElement);
position.left = that._makeLeftCorrection(position.left);
position.top = isLastVerticalPosition && position.top >= outerPlaceholderHeight ? position.top - outerPlaceholderHeight : position.top;
that._move(position, $placeholderElement)
}
$placeholderElement.toggle(!!position)
}
_getPositions(items, elementSize, fromIndex, toIndex) {
const positions = [];
for (let i = 0; i < items.length; i++) {
let position = 0;
if (null === toIndex || null === fromIndex) {
positions.push(position);
continue
}
if (-1 === fromIndex) {
if (i >= toIndex) {
position = elementSize
}
} else if (-1 === toIndex) {
if (i > fromIndex) {
position = -elementSize
}
} else if (fromIndex < toIndex) {
if (i > fromIndex && i < toIndex) {
position = -elementSize
}
} else if (fromIndex > toIndex) {
if (i >= toIndex && i < fromIndex) {
position = elementSize
}
}
positions.push(position)
}
return positions
}
_getDraggableElementSize(isVerticalOrientation) {
const $draggableItem = this._getDraggableElement();
let size = this.option("draggableElementSize");
if (!size) {
size = isVerticalOrientation ? ((0, _size.getOuterHeight)($draggableItem) + (0, _size.getOuterHeight)($draggableItem, true)) / 2 : ((0, _size.getOuterWidth)($draggableItem) + (0, _size.getOuterWidth)($draggableItem, true)) / 2;
if (!this.option("autoUpdate")) {
this.option("draggableElementSize", size)
}
}
return size
}
_getActualFromIndex() {
const {
fromIndex: fromIndex,
fromIndexOffset: fromIndexOffset,
offset: offset
} = this.option();
return null == fromIndex ? null : fromIndex + fromIndexOffset - offset
}
_moveItems(prevToIndex, toIndex, fullUpdate) {
const fromIndex = this._getActualFromIndex();
const isVerticalOrientation = this._isVerticalOrientation();
const positionPropName = isVerticalOrientation ? "top" : "left";
const elementSize = this._getDraggableElementSize(isVerticalOrientation);
const items = this._getItems();
const prevPositions = this._getPositions(items, elementSize, fromIndex, prevToIndex);
const positions = this._getPositions(items, elementSize, fromIndex, toIndex);
const animationConfig = this.option("animation");
const rtlEnabled = this.option("rtlEnabled");
for (let i = 0; i < items.length; i++) {
const itemElement = items[i];
const prevPosition = prevPositions[i];
const position = positions[i];
if (null === toIndex || null === fromIndex) {
stopAnimation(itemElement)
} else if (prevPosition !== position || fullUpdate && (0, _type.isDefined)(position)) {
animate(itemElement, (0, _extend.extend)({}, animationConfig, {
to: {
[positionPropName]: !isVerticalOrientation && rtlEnabled ? -position : position
}
}))
}
}
}
_toggleDragSourceClass(value, $element) {
const $sourceElement = $element || this._$sourceElement;
super._toggleDragSourceClass.apply(this, arguments);
if (!this._isIndicateMode()) {
null === $sourceElement || void 0 === $sourceElement || $sourceElement.toggleClass(this._addWidgetPrefix("source-hidden"), value)
}
}
_dispose() {
this.reset();
super._dispose()
}
_fireAddEvent(sourceEvent) {
const args = this._getEventArgs(sourceEvent);
this._getAction("onAdd")(args);
return args.cancel
}
_fireRemoveEvent(sourceEvent) {
const sourceDraggable = this._getSourceDraggable();
const args = this._getEventArgs(sourceEvent);
sourceDraggable._getAction("onRemove")(args);
return args.cancel
}
_fireReorderEvent(sourceEvent) {
const args = this._getEventArgs(sourceEvent);
this._getAction("onReorder")(args);
return args.promise || (0, _deferred.Deferred)().resolve()
}
}(0, _component_registrator.default)("dxSortable", Sortable);
exports.default = Sortable
},
48500(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BasePaginationDefaultProps = void 0;
var _base_props = __webpack_require__( /*! ../../core/r1/base_props */ 28112);
exports.BasePaginationDefaultProps = Object.assign({}, _base_props.BaseWidgetDefaultProps, {
isGridCompatibilityMode: false,
showInfo: false,
displayMode: "adaptive",
maxPagesCount: 10,
pageCount: 1,
visible: true,
hasKnownLastPage: true,
pagesNavigatorVisible: "auto",
showPageSizeSelector: "auto",
allowedPageSizes: [5, 10],
showNavigationButtons: false,
itemCount: 1,
label: void 0
})
},
54623(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PAGINATION_SELECTION_CLASS = exports.PAGINATION_SELECTED_PAGE_SIZE_CLASS = exports.PAGINATION_PAGE_SIZE_CLASS = exports.PAGINATION_PAGE_SIZES_CLASS = exports.PAGINATION_PAGE_INDEXES_CLASS = exports.PAGINATION_PAGE_CLASS = exports.PAGINATION_PAGES_CLASS = exports.PAGINATION_CLASS = exports.PAGER_CLASS = exports.LIGHT_MODE_CLASS = exports.FIRST_CHILD_CLASS = void 0;
exports.PAGER_CLASS = "dx-pager";
exports.PAGINATION_CLASS = "dx-pagination";
exports.LIGHT_MODE_CLASS = "dx-light-mode";
exports.PAGINATION_PAGES_CLASS = "dx-pages";
exports.PAGINATION_PAGE_INDEXES_CLASS = "dx-page-indexes";
exports.PAGINATION_PAGE_CLASS = "dx-page";
const PAGINATION_SELECTION_CLASS = exports.PAGINATION_SELECTION_CLASS = "dx-selection";
const PAGINATION_PAGE_SIZE_CLASS = exports.PAGINATION_PAGE_SIZE_CLASS = "dx-page-size";
exports.PAGINATION_PAGE_SIZES_CLASS = "dx-page-sizes";
exports.PAGINATION_SELECTED_PAGE_SIZE_CLASS = `${PAGINATION_PAGE_SIZE_CLASS} ${PAGINATION_SELECTION_CLASS}`;
exports.FIRST_CHILD_CLASS = "dx-first-child"
},
5655(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.KeyboardActionContext = void 0;
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
exports.KeyboardActionContext = (0, _index.createContext)(void 0)
},
17286(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LightButtonDefaultProps = exports.LightButton = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _subscribe_to_event = __webpack_require__( /*! ../../core/r1/utils/subscribe_to_event */ 28677);
var _keyboard_action_context = __webpack_require__( /*! ./keyboard_action_context */ 5655);
const LightButtonDefaultProps = exports.LightButtonDefaultProps = {
className: "",
label: "",
tabIndex: 0,
selected: false
};
class LightButton extends _index.InfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.refs = null;
this.widgetRef = (0, _inferno.createRef)();
this.keyboardEffect = this.keyboardEffect.bind(this);
this.subscribeToClick = this.subscribeToClick.bind(this)
}
getComponentProps() {
return this.props
}
getKeyboardContext() {
if (this.context[_keyboard_action_context.KeyboardActionContext.id]) {
return this.context[_keyboard_action_context.KeyboardActionContext.id]
}
return _keyboard_action_context.KeyboardActionContext.defaultValue
}
componentWillUpdate(nextProps, nextState, context) {
super.componentWillUpdate(nextProps, nextState, context)
}
createEffects() {
return [new _index.InfernoEffect(this.keyboardEffect, [this.getKeyboardContext(), this.props.onClick]), new _index.InfernoEffect(this.subscribeToClick, [this.props.onClick])]
}
updateEffects() {
var _this$_effects$, _this$_effects$2;
null === (_this$_effects$ = this._effects[0]) || void 0 === _this$_effects$ || _this$_effects$.update([this.getKeyboardContext(), this.props.onClick]);
null === (_this$_effects$2 = this._effects[1]) || void 0 === _this$_effects$2 || _this$_effects$2.update([this.props.onClick])
}
keyboardEffect() {
return this.getKeyboardContext().registerKeyboardAction(this.widgetRef.current, this.props.onClick)
}
subscribeToClick() {
return (0, _subscribe_to_event.subscribeToClickEvent)(this.widgetRef.current, this.props.onClick)
}
render() {
return (0, _inferno.createVNode)(1, "div", this.props.className, this.props.children, 0, {
tabindex: this.props.tabIndex,
role: "button",
"aria-label": this.props.label,
"aria-current": this.props.selected ? "page" : void 0
}, null, this.widgetRef)
}
}
exports.LightButton = LightButton;
LightButton.defaultProps = LightButtonDefaultProps
},
32576(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PaginationConfigContext = void 0;
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
exports.PaginationConfigContext = (0, _index.createContext)(void 0)
},
62502(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PaginationConfigProviderDefaultProps = exports.PaginationConfigProvider = void 0;
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _pagination_config_context = __webpack_require__( /*! ./pagination_config_context */ 32576);
const PaginationConfigProviderDefaultProps = exports.PaginationConfigProviderDefaultProps = {};
class PaginationConfigProvider extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.state = {}
}
getConfig() {
return {
isGridCompatibilityMode: this.props.isGridCompatibilityMode
}
}
getChildContext() {
return Object.assign({}, this.context, {
[_pagination_config_context.PaginationConfigContext.id]: this.getConfig() || _pagination_config_context.PaginationConfigContext.defaultValue
})
}
render() {
return this.props.children
}
}
exports.PaginationConfigProvider = PaginationConfigProvider;
PaginationConfigProvider.defaultProps = PaginationConfigProviderDefaultProps
},
64522(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PaginationDefaultProps = void 0;
var _base_pagination_props = __webpack_require__( /*! ./base_pagination_props */ 48500);
exports.PaginationDefaultProps = Object.assign({}, _base_pagination_props.BasePaginationDefaultProps, {
pageSize: 5,
pageIndex: 1,
pageIndexChangedInternal: () => {},
pageSizeChangedInternal: () => {}
})
},
62388(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PaginationContentDefaultProps = exports.PaginationContent = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../core/r1/runtime/inferno/index */ 6257);
var _widget = __webpack_require__( /*! ../core/r1/widget */ 93796);
var _message = (e = __webpack_require__( /*! ../../common/core/localization/message */ 4671), e && e.__esModule ? e : {
default: e
});
var e;
var _render_utils = __webpack_require__( /*! ../core/r1/utils/render_utils */ 71312);
var _accessibility = __webpack_require__( /*! ../ui/shared/accessibility */ 51697);
var _consts = __webpack_require__( /*! ./common/consts */ 54623);
var _keyboard_action_context = __webpack_require__( /*! ./common/keyboard_action_context */ 5655);
var _pagination_config_provider = __webpack_require__( /*! ./common/pagination_config_provider */ 62502);
var _pagination_props = __webpack_require__( /*! ./common/pagination_props */ 64522);
var _info = __webpack_require__( /*! ./info */ 49329);
var _selector = __webpack_require__( /*! ./page_size/selector */ 1542);
var _page_index_selector = __webpack_require__( /*! ./pages/page_index_selector */ 33494);
const PaginationContentDefaultProps = exports.PaginationContentDefaultProps = Object.assign({}, _pagination_props.PaginationDefaultProps, {
infoTextVisible: true,
isLargeDisplayMode: true
});
class PaginationContent extends _index.InfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.refs = null;
this.widgetElementRef = (0, _inferno.createRef)();
this.widgetRootElementRef = (0, _inferno.createRef)();
this.pagesRef = (0, _inferno.createRef)();
this.infoTextRef = (0, _inferno.createRef)();
this.__getterCache = {
keyboardAction: void 0
};
this.state = {};
this.__getterCache = {};
this.setRootElementRef = this.setRootElementRef.bind(this);
this.createFakeInstance = this.createFakeInstance.bind(this)
}
createEffects() {
return [new _index.InfernoEffect(this.setRootElementRef, [])]
}
getChildContext() {
return Object.assign({}, this.context, {
[_keyboard_action_context.KeyboardActionContext.id]: this.getKeyboardAction() || _keyboard_action_context.KeyboardActionContext.defaultValue
})
}
setRootElementRef() {
const {
rootElementRef: rootElementRef
} = this.props;
if (rootElementRef && this.widgetRootElementRef) {
rootElementRef.current = this.widgetRootElementRef.current
}
}
getWidgetRootElement() {
var _this$widgetRootEleme;
return null === (_this$widgetRootEleme = this.widgetRootElementRef) || void 0 === _this$widgetRootEleme ? void 0 : _this$widgetRootEleme.current
}
createFakeInstance() {
return {
option: () => false,
element: () => this.getWidgetRootElement(),
component: this.props._getParentComponentRootNode ? {
element: () => {
var _this$props$_getParen, _this$props;
return null === (_this$props$_getParen = (_this$props = this.props)._getParentComponentRootNode) || void 0 === _this$props$_getParen ? void 0 : _this$props$_getParen.call(_this$props)
}
} : {
element: () => this.getWidgetRootElement()
},
_createActionByOption: () => e => {
var _this$props$onKeyDown, _this$props2;
null === (_this$props$onKeyDown = (_this$props2 = this.props).onKeyDown) || void 0 === _this$props$onKeyDown || _this$props$onKeyDown.call(_this$props2, e)
}
}
}
getKeyboardAction() {
return {
registerKeyboardAction: (element, action) => {
const fakePaginationInstance = this.createFakeInstance();
return (0, _accessibility.registerKeyboardAction)("pager", fakePaginationInstance, element, void 0, action)
}
}
}
getInfoVisible() {
const {
infoTextVisible: infoTextVisible,
showInfo: showInfo
} = this.props;
return !!showInfo && infoTextVisible
}
getPageIndexSelectorVisible() {
return 0 !== this.props.pageSize
}
getNormalizedDisplayMode() {
const {
displayMode: displayMode,
lightModeEnabled: lightModeEnabled
} = this.props;
if ("adaptive" === displayMode && void 0 !== lightModeEnabled) {
return lightModeEnabled ? "compact" : "full"
}
return displayMode ?? "adaptive"
}
getPagesContainerVisible() {
return !!this.props.pagesNavigatorVisible && this.props.pageCount > 0
}
getPagesContainerVisibility() {
const {
pagesNavigatorVisible: pagesNavigatorVisible,
pageCount: pageCount,
hasKnownLastPage: hasKnownLastPage,
showInfo: showInfo,
showNavigationButtons: showNavigationButtons,
showPageSizeSelector: showPageSizeSelector
} = this.props;
const shouldHideBasedOnPageCount = "auto" === pagesNavigatorVisible && 1 === pageCount && hasKnownLastPage;
const hasExplicitVisibleComponents = Boolean(showInfo) || Boolean(showNavigationButtons) || true === showPageSizeSelector;
const shouldHide = shouldHideBasedOnPageCount && !hasExplicitVisibleComponents;
const result = shouldHide ? "hidden" : void 0;
return result
}
getIsLargeDisplayMode() {
const displayMode = this.getNormalizedDisplayMode();
let result = false;
if ("adaptive" === displayMode) {
result = this.props.isLargeDisplayMode
} else {
result = "full" === displayMode
}
return result
}
getClasses() {
const classesMap = {
[`${this.props.className}`]: !!this.props.className,
[_consts.PAGER_CLASS]: !!this.props.isGridCompatibilityMode,
[_consts.PAGINATION_CLASS]: !this.props.isGridCompatibilityMode,
[_consts.LIGHT_MODE_CLASS]: !this.getIsLargeDisplayMode()
};
return (0, _render_utils.combineClasses)(classesMap)
}
getAria() {
const label = this.props.label ?? _message.default.format("dxPagination-ariaLabel");
return {
role: "navigation",
label: label
}
}
componentWillUpdate(nextProps) {
super.componentWillUpdate();
if (this.props.onKeyDown !== nextProps.onKeyDown) {
this.__getterCache.keyboardAction = void 0
}
}
render() {
const {
isGridCompatibilityMode: isGridCompatibilityMode,
rtlEnabled: rtlEnabled,
visible: visible,
showPageSizeSelector: showPageSizeSelector,
allowedPageSizesRef: allowedPageSizesRef,
pageSize: pageSize,
pageSizeChangedInternal: pageSizeChangedInternal,
allowedPageSizes: allowedPageSizes,
infoTextRef: infoTextRef,
infoText: infoText,
pageCount: pageCount,
pageIndex: pageIndex,
itemCount: itemCount,
pagesRef: pagesRef,
hasKnownLastPage: hasKnownLastPage,
maxPagesCount: maxPagesCount,
pageIndexChangedInternal: pageIndexChangedInternal,
pagesCountText: pagesCountText,
showNavigationButtons: showNavigationButtons,
style: style,
width: width,
height: height,
elementAttr: elementAttr,
hint: hint,
disabled: disabled,
tabIndex: tabIndex,
accessKey: accessKey,
activeStateEnabled: activeStateEnabled,
focusStateEnabled: focusStateEnabled,
hoverStateEnabled: hoverStateEnabled
} = this.props;
const content = (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _widget.Widget, Object.assign({
rootElementRef: this.widgetRootElementRef,
rtlEnabled: rtlEnabled,
classes: this.getClasses(),
visible: visible,
aria: this.getAria(),
style: style,
width: width,
height: height,
hint: hint,
disabled: disabled,
tabIndex: tabIndex,
accessKey: accessKey,
activeStateEnabled: activeStateEnabled,
focusStateEnabled: focusStateEnabled,
hoverStateEnabled: hoverStateEnabled
}, elementAttr, {
children: [showPageSizeSelector && (0, _inferno.createComponentVNode)(2, _selector.PageSizeSelector, {
rootElementRef: allowedPageSizesRef,
isLargeDisplayMode: this.getIsLargeDisplayMode(),
itemCount: itemCount,
pageSize: pageSize,
pageSizeChangedInternal: pageSizeChangedInternal,
allowedPageSizes: allowedPageSizes
}), this.getPagesContainerVisible() && (0, _inferno.createVNode)(1, "div", _consts.PAGINATION_PAGES_CLASS, [this.getInfoVisible() && (0, _inferno.createComponentVNode)(2, _info.InfoText, {
rootElementRef: infoTextRef,
infoText: infoText,
pageCount: pageCount,
pageIndex: pageIndex,
itemCount: itemCount
}), this.getPageIndexSelectorVisible() && (0, _inferno.createVNode)(1, "div", _consts.PAGINATION_PAGE_INDEXES_CLASS, (0, _inferno.createComponentVNode)(2, _page_index_selector.PageIndexSelector, {
hasKnownLastPage: hasKnownLastPage,
isLargeDisplayMode: this.getIsLargeDisplayMode(),
maxPagesCount: maxPagesCount,
pageCount: pageCount,
pageIndex: pageIndex,
pageIndexChangedInternal: pageIndexChangedInternal,
pagesCountText: pagesCountText,
showNavigationButtons: showNavigationButtons,
itemCount: itemCount
}), 2, null, null, pagesRef)], 0, {
style: {
visibility: this.getPagesContainerVisibility()
}
})]
})));
return (0, _inferno.createComponentVNode)(2, _pagination_config_provider.PaginationConfigProvider, {
isGridCompatibilityMode: isGridCompatibilityMode,
children: content
})
}
}
exports.PaginationContent = PaginationContent;
PaginationContent.defaultProps = PaginationContentDefaultProps
},
567(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SelectBox = exports.NumberBoxDefaultProps = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _select_box = (e = __webpack_require__( /*! ../../../ui/select_box */ 60695), e && e.__esModule ? e : {
default: e
});
var e;
var _dom_component_wrapper = __webpack_require__( /*! ../../core/r1/dom_component_wrapper */ 10922);
var _editor_label_props = __webpack_require__( /*! ../editors/common/editor_label_props */ 71027);
var _editor_props = __webpack_require__( /*! ../editors/common/editor_props */ 90650);
var _editor_state_props = __webpack_require__( /*! ../editors/common/editor_state_props */ 49916);
const NumberBoxDefaultProps = exports.NumberBoxDefaultProps = Object.assign({}, _editor_props.EditorDefaultProps, _editor_state_props.EditorStateDefaultProps, _editor_label_props.EditorLabelDefaultProps, {
placeholder: "",
hoverStateEnabled: true,
searchEnabled: false,
value: null,
isReactComponentWrapper: true
});
class SelectBox extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.state = {};
this.refs = null
}
get componentProps() {
return this.props
}
render() {
return (0, _inferno.createComponentVNode)(2, _dom_component_wrapper.DomComponentWrapper, {
componentType: _select_box.default,
componentProps: this.componentProps,
templateNames: ["dropDownButtonTemplate", "groupTemplate", "itemTemplate"]
})
}
}
exports.SelectBox = SelectBox;
SelectBox.defaultProps = NumberBoxDefaultProps
},
25435(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BaseWidgetDefaultProps = void 0;
exports.BaseWidgetDefaultProps = {
className: "",
activeStateEnabled: false,
disabled: false,
focusStateEnabled: false,
hoverStateEnabled: false,
tabIndex: 0,
visible: true,
rtlEnabled: false
}
},
71027(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EditorLabelDefaultProps = void 0;
var _themes = __webpack_require__( /*! ../../../../ui/themes */ 52071);
exports.EditorLabelDefaultProps = {
label: "",
labelMode: (0, _themes.isMaterial)((0, _themes.current)()) ? "floating" : "static"
}
},
90650(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EditorDefaultProps = void 0;
var _base_widget_props = __webpack_require__( /*! ./base_widget_props */ 25435);
var _widget_props = __webpack_require__( /*! ./widget_props */ 34211);
exports.EditorDefaultProps = Object.assign({}, _base_widget_props.BaseWidgetDefaultProps, {
aria: _widget_props.WidgetDefaultProps.aria,
classes: _widget_props.WidgetDefaultProps.classes,
readOnly: false,
name: "",
value: null,
validationError: null,
validationErrors: null,
validationMessageMode: "auto",
validationMessagePosition: "bottom",
validationStatus: "valid",
isValid: true,
isDirty: false,
inputAttr: {}
})
},
49916(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EditorStateDefaultProps = void 0;
var _devices = (e = __webpack_require__( /*! ../../../../core/devices */ 65951), e && e.__esModule ? e : {
default: e
});
var e;
exports.EditorStateDefaultProps = {
hoverStateEnabled: true,
activeStateEnabled: true,
focusStateEnabled: "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator()
}
},
34211(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.WidgetDefaultProps = void 0;
var _base_props = __webpack_require__( /*! ../../../core/r1/base_props */ 28112);
exports.WidgetDefaultProps = Object.assign({}, _base_props.BaseWidgetDefaultProps, {
_feedbackHideTimeout: 400,
_feedbackShowTimeout: 30,
cssText: "",
aria: {},
classes: "",
name: "",
addWidgetClass: true
})
},
71897(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NumberBoxDefaultProps = exports.NumberBox = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _number_box = (e = __webpack_require__( /*! ../../../ui/number_box */ 48042), e && e.__esModule ? e : {
default: e
});
var e;
var _dom_component_wrapper = __webpack_require__( /*! ../../core/r1/dom_component_wrapper */ 10922);
var _editor_label_props = __webpack_require__( /*! ./common/editor_label_props */ 71027);
var _editor_props = __webpack_require__( /*! ./common/editor_props */ 90650);
var _editor_state_props = __webpack_require__( /*! ./common/editor_state_props */ 49916);
const NumberBoxDefaultProps = exports.NumberBoxDefaultProps = Object.assign({}, _editor_props.EditorDefaultProps, _editor_state_props.EditorStateDefaultProps, _editor_label_props.EditorLabelDefaultProps, {
value: 0,
isReactComponentWrapper: true
});
class NumberBox extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.state = {};
this.refs = null
}
get componentProps() {
return this.props
}
render() {
return (0, _inferno.createComponentVNode)(2, _dom_component_wrapper.DomComponentWrapper, {
componentType: _number_box.default,
componentProps: this.componentProps,
templateNames: []
})
}
}
exports.NumberBox = NumberBox;
NumberBox.defaultProps = NumberBoxDefaultProps
},
49329(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PAGER_INFO_CLASS = exports.InfoText = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../core/r1/runtime/inferno/index */ 6257);
var _string = __webpack_require__( /*! ../../core/utils/string */ 54497);
var _pagination_props = __webpack_require__( /*! ./common/pagination_props */ 64522);
var _compatibility_utils = __webpack_require__( /*! ./utils/compatibility_utils */ 4917);
const PAGER_INFO_CLASS = exports.PAGER_INFO_CLASS = "dx-info";
const InfoTextDefaultProps = {
pageCount: _pagination_props.PaginationDefaultProps.pageCount,
pageIndex: _pagination_props.PaginationDefaultProps.pageIndex,
itemCount: _pagination_props.PaginationDefaultProps.itemCount
};
class InfoText extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.state = {};
this.refs = null;
this.rootElementRef = (0, _inferno.createRef)()
}
getInfoText() {
return this.props.infoText ?? (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-infoText")
}
getText() {
const {
pageCount: pageCount,
pageIndex: pageIndex,
itemCount: itemCount
} = this.props;
return (0, _string.format)(this.getInfoText(), (pageIndex + 1).toString(), null === pageCount || void 0 === pageCount ? void 0 : pageCount.toString(), null === itemCount || void 0 === itemCount ? void 0 : itemCount.toString())
}
render() {
return (0, _inferno.createVNode)(1, "div", PAGER_INFO_CLASS, this.getText(), 0, null, null, this.props.rootElementRef)
}
}
exports.InfoText = InfoText;
InfoText.defaultProps = InfoTextDefaultProps
},
40340(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PageSizeLargeDefaultProps = exports.PageSizeLarge = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _string = __webpack_require__( /*! ../../../core/utils/string */ 54497);
var _render_utils = __webpack_require__( /*! ../../core/r1/utils/render_utils */ 71312);
var _consts = __webpack_require__( /*! ../common/consts */ 54623);
var _light_button = __webpack_require__( /*! ../common/light_button */ 17286);
var _pagination_props = __webpack_require__( /*! ../common/pagination_props */ 64522);
var _compatibility_utils = __webpack_require__( /*! ../utils/compatibility_utils */ 4917);
const PageSizeLargeDefaultProps = exports.PageSizeLargeDefaultProps = {
allowedPageSizes: [],
pageSize: _pagination_props.PaginationDefaultProps.pageSize,
pageSizeChangedInternal: _pagination_props.PaginationDefaultProps.pageSizeChangedInternal
};
class PageSizeLarge extends _index.BaseInfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.refs = null;
this.__getterCache = {
pageSizesText: void 0
};
this.state = {};
this.onPageSizeChange = this.onPageSizeChange.bind(this)
}
getPageSizesText() {
if (void 0 !== this.__getterCache.pageSizesText) {
return this.__getterCache.pageSizesText
}
const result = (() => {
const {
pageSize: pageSize,
allowedPageSizes: allowedPageSizes
} = this.props;
return allowedPageSizes.map((_ref3, index) => {
const {
text: text,
value: processedPageSize
} = _ref3;
const selected = processedPageSize === pageSize;
const className = (0, _render_utils.combineClasses)({
[selected ? _consts.PAGINATION_SELECTED_PAGE_SIZE_CLASS : _consts.PAGINATION_PAGE_SIZE_CLASS]: true,
[_consts.FIRST_CHILD_CLASS]: 0 === index
});
return {
className: className,
click: this.onPageSizeChange(processedPageSize),
label: (0, _string.format)((0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-pageSize"), processedPageSize || (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-pageSizesAllText")),
text: text
}
})
})();
this.__getterCache.pageSizesText = result;
return result
}
onPageSizeChange(processedPageSize) {
return () => {
this.props.pageSizeChangedInternal(processedPageSize);
return this.props.pageSize
}
}
componentWillUpdate(nextProps) {
const componentChanged = this.props.pageSize !== nextProps.pageSize || this.props.allowedPageSizes !== nextProps.allowedPageSizes || this.props.pageSizeChangedInternal !== nextProps.pageSizeChangedInternal;
if (componentChanged) {
this.__getterCache.pageSizesText = void 0
}
}
render() {
return (0, _inferno.createFragment)(this.getPageSizesText().map(_ref => {
let {
text: text,
className: className,
label: label,
click: click
} = _ref;
return (0, _inferno.createComponentVNode)(2, _light_button.LightButton, {
className: className,
label: label,
onClick: click,
children: text
}, text)
}), 0)
}
}
exports.PageSizeLarge = PageSizeLarge;
PageSizeLarge.defaultProps = PageSizeLargeDefaultProps
},
1542(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PageSizeSelector = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _consts = __webpack_require__( /*! ../common/consts */ 54623);
var _pagination_props = __webpack_require__( /*! ../common/pagination_props */ 64522);
var _compatibility_utils = __webpack_require__( /*! ../utils/compatibility_utils */ 4917);
var _large = __webpack_require__( /*! ./large */ 40340);
var _small = __webpack_require__( /*! ./small */ 54892);
const PageSizeSelectorDefaultProps = {
isLargeDisplayMode: true,
pageSize: _pagination_props.PaginationDefaultProps.pageSize,
pageSizeChangedInternal: _pagination_props.PaginationDefaultProps.pageSizeChangedInternal,
allowedPageSizes: _pagination_props.PaginationDefaultProps.allowedPageSizes
};
class PageSizeSelector extends _index.InfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.refs = null;
this.rootElementRef = (0, _inferno.createRef)();
this.htmlRef = (0, _inferno.createRef)();
this.__getterCache = {
normalizedPageSizes: void 0
};
this.setRootElementRef = this.setRootElementRef.bind(this)
}
createEffects() {
return [new _index.InfernoEffect(this.setRootElementRef, [])]
}
setRootElementRef() {
const {
rootElementRef: rootElementRef
} = this.props;
if (rootElementRef) {
rootElementRef.current = this.htmlRef.current
}
}
getAllText() {
return (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-pageSizesAllText")
}
getNormalizedPageSizes() {
if (void 0 !== this.__getterCache.normalizedPageSizes) {
return this.__getterCache.normalizedPageSizes
}
const result = this.props.allowedPageSizes.map(p => "all" === p || 0 === p ? {
text: this.getAllText(),
value: 0
} : {
text: String(p),
value: p
});
this.__getterCache.normalizedPageSizes = result;
return result
}
componentWillUpdate(nextProps) {
super.componentWillUpdate();
if (this.props.allowedPageSizes !== nextProps.allowedPageSizes) {
this.__getterCache.normalizedPageSizes = void 0
}
}
render() {
const normalizedPageSizes = this.getNormalizedPageSizes();
const {
pageSize: pageSize,
pageSizeChangedInternal: pageSizeChangedInternal,
isLargeDisplayMode: isLargeDisplayMode
} = this.props;
return (0, _inferno.createVNode)(1, "div", _consts.PAGINATION_PAGE_SIZES_CLASS, [isLargeDisplayMode && (0, _inferno.createComponentVNode)(2, _large.PageSizeLarge, {
allowedPageSizes: normalizedPageSizes,
pageSize: pageSize,
pageSizeChangedInternal: pageSizeChangedInternal
}), !isLargeDisplayMode && (0, _inferno.createComponentVNode)(2, _small.PageSizeSmall, {
parentRef: this.htmlRef,
allowedPageSizes: normalizedPageSizes,
pageSize: pageSize,
pageSizeChangedInternal: pageSizeChangedInternal
})], 0, null, null, this.htmlRef)
}
}
exports.PageSizeSelector = PageSizeSelector;
PageSizeSelector.defaultProps = PageSizeSelectorDefaultProps
},
54892(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PageSizeSmall = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _pagination_props = __webpack_require__( /*! ../common/pagination_props */ 64522);
var _select_box = __webpack_require__( /*! ../drop_down_editors/select_box */ 567);
var _calculate_values_fitted_width = __webpack_require__( /*! ../utils/calculate_values_fitted_width */ 19e3);
var _compatibility_utils = __webpack_require__( /*! ../utils/compatibility_utils */ 4917);
var _get_element_width = __webpack_require__( /*! ../utils/get_element_width */ 70267);
const PageSizeSmallDefaultProps = Object.assign({}, {
allowedPageSizes: []
}, {
pageSize: _pagination_props.PaginationDefaultProps.pageSize,
pageSizeChangedInternal: _pagination_props.PaginationDefaultProps.pageSizeChangedInternal
});
class PageSizeSmall extends _index.InfernoComponent {
constructor(props) {
super(props);
this.state = {
minWidth: 10
};
this.refs = null;
this.updateWidth = this.updateWidth.bind(this)
}
componentWillUpdate(nextProps, nextState, context) {
super.componentWillUpdate(nextProps, nextState, context)
}
createEffects() {
const dependency = [this.props, this.state.minWidth, this.props.pageSize, this.props.pageSizeChangedInternal, this.props.allowedPageSizes];
return [new _index.InfernoEffect(this.updateWidth, dependency)]
}
updateEffects() {
var _this$_effects$;
const dependency = [this.props, this.state.minWidth, this.props.pageSize, this.props.pageSizeChangedInternal, this.props.allowedPageSizes];
null === (_this$_effects$ = this._effects[0]) || void 0 === _this$_effects$ || _this$_effects$.update(dependency)
}
updateWidth() {
var _this$props$parentRef;
const minWidth = (0, _get_element_width.getElementMinWidth)(null === (_this$props$parentRef = this.props.parentRef) || void 0 === _this$props$parentRef ? void 0 : _this$props$parentRef.current);
this.setState(state => ({
minWidth: minWidth > 0 ? minWidth : state.minWidth
}))
}
getWidth() {
var _this$props$allowedPa;
return (0, _calculate_values_fitted_width.calculateValuesFittedWidth)(this.state.minWidth, null === (_this$props$allowedPa = this.props.allowedPageSizes) || void 0 === _this$props$allowedPa ? void 0 : _this$props$allowedPa.map(p => p.value))
}
getInputAttributes() {
return {
"aria-label": (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-ariaPageSize")
}
}
render() {
const {
allowedPageSizes: allowedPageSizes,
pageSize: pageSize,
pageSizeChangedInternal: pageSizeChangedInternal
} = this.props;
return (0, _inferno.createComponentVNode)(2, _select_box.SelectBox, {
displayExpr: "text",
valueExpr: "value",
dataSource: allowedPageSizes,
value: pageSize,
valueChange: pageSizeChangedInternal,
width: this.getWidth(),
inputAttr: this.getInputAttributes()
})
}
}
exports.PageSizeSmall = PageSizeSmall;
PageSizeSmall.defaultProps = PageSizeSmallDefaultProps
},
35853(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PagesLarge = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _config_context = __webpack_require__( /*! ../../core/r1/config_context */ 12274);
var _pagination_props = __webpack_require__( /*! ../common/pagination_props */ 64522);
var _page = __webpack_require__( /*! ./page */ 12363);
const PagesLargeDefaultProps = {
maxPagesCount: _pagination_props.PaginationDefaultProps.maxPagesCount,
pageCount: _pagination_props.PaginationDefaultProps.pageCount,
pageIndex: _pagination_props.PaginationDefaultProps.pageIndex,
pageIndexChangedInternal: _pagination_props.PaginationDefaultProps.pageIndexChangedInternal
};
function getDelimiterType(startIndex, slidingWindowSize, pageCount) {
switch (true) {
case 1 === startIndex:
return "high";
case startIndex + slidingWindowSize === pageCount - 1:
return "low";
default:
return "both"
}
}
function createPageIndexesBySlidingWindowIndexes(slidingWindowIndexes, pageCount, delimiter) {
let pageIndexes = [];
let indexesForReuse = [];
switch (delimiter) {
case "none":
pageIndexes = [...slidingWindowIndexes];
break;
case "both":
pageIndexes = [0, "low", ...slidingWindowIndexes, "high", pageCount - 1];
indexesForReuse = slidingWindowIndexes.slice(1, -1);
break;
case "high":
pageIndexes = [0, ...slidingWindowIndexes, "high", pageCount - 1];
indexesForReuse = slidingWindowIndexes.slice(0, -1);
break;
case "low":
pageIndexes = [0, "low", ...slidingWindowIndexes, pageCount - 1];
indexesForReuse = slidingWindowIndexes.slice(1)
}
return {
slidingWindowIndexes: slidingWindowIndexes,
indexesForReuse: indexesForReuse,
pageIndexes: pageIndexes
}
}
function createPageIndexes(startIndex, slidingWindowSize, pageCount, delimiter) {
const slidingWindowIndexes = [];
for (let i = 0; i < slidingWindowSize; i += 1) {
slidingWindowIndexes.push(i + startIndex)
}
return createPageIndexesBySlidingWindowIndexes(slidingWindowIndexes, pageCount, delimiter)
}
class PagesLarge extends _index.BaseInfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.refs = null;
this.canReuseSlidingWindow = this.canReuseSlidingWindow.bind(this);
this.generatePageIndexes = this.generatePageIndexes.bind(this);
this.isSlidingWindowMode = this.isSlidingWindowMode.bind(this);
this.onPageClick = this.onPageClick.bind(this)
}
getConfig() {
if (this.context[_config_context.ConfigContext.id]) {
return this.context[_config_context.ConfigContext.id]
}
return _config_context.ConfigContext.defaultValue
}
getSlidingWindowState() {
const slidingWindowState = this.slidingWindowStateHolder;
if (!slidingWindowState) {
return {
indexesForReuse: [],
slidingWindowIndexes: []
}
}
return slidingWindowState
}
canReuseSlidingWindow(currentPageCount, pageIndex) {
const {
indexesForReuse: indexesForReuse
} = this.getSlidingWindowState();
const lastPageIsFartherThanWindow = indexesForReuse.slice(-1)[0] < currentPageCount - 1;
const pageIndexExistInIndexes = indexesForReuse.includes(pageIndex);
return lastPageIsFartherThanWindow && pageIndexExistInIndexes
}
generatePageIndexes() {
const {
pageCount: pageCount,
pageIndex: pageIndex
} = this.props;
let startIndex = 0;
const {
slidingWindowIndexes: slidingWindowIndexes
} = this.getSlidingWindowState();
if (pageIndex === slidingWindowIndexes[0]) {
startIndex = pageIndex - 1
} else if (pageIndex === slidingWindowIndexes[slidingWindowIndexes.length - 1]) {
startIndex = pageIndex + 2 - 4
} else if (pageIndex < 4) {
startIndex = 1
} else if (pageIndex >= pageCount - 4) {
startIndex = pageCount - 4 - 1
} else {
startIndex = pageIndex - 1
}
const delimiter = getDelimiterType(startIndex, 4, pageCount);
const indexes = createPageIndexes(startIndex, 4, pageCount, delimiter);
const {
pageIndexes: pageIndexes
} = indexes;
this.slidingWindowStateHolder = indexes;
return pageIndexes
}
isSlidingWindowMode() {
const {
maxPagesCount: maxPagesCount,
pageCount: pageCount
} = this.props;
return pageCount <= 4 || pageCount <= maxPagesCount
}
onPageClick(pageIndex) {
this.props.pageIndexChangedInternal(pageIndex)
}
getPageIndexes() {
const {
pageCount: pageCount
} = this.props;
if (this.isSlidingWindowMode()) {
return createPageIndexes(0, pageCount, pageCount, "none").pageIndexes
}
if (this.canReuseSlidingWindow(pageCount, this.props.pageIndex)) {
const {
slidingWindowIndexes: slidingWindowIndexes
} = this.getSlidingWindowState();
const delimiter = getDelimiterType(slidingWindowIndexes[0], 4, pageCount);
return createPageIndexesBySlidingWindowIndexes(slidingWindowIndexes, pageCount, delimiter).pageIndexes
}
return this.generatePageIndexes()
}
getPages() {
var _this$getConfig;
const {
pageIndex: pageIndex
} = this.props;
const createPage = index => {
const paginationProps = "low" === index || "high" === index ? null : {
index: index,
onClick: () => this.onPageClick(index),
selected: pageIndex === index
};
return {
key: index.toString(),
pageProps: paginationProps
}
};
const indices = this.getPageIndexes();
const rtlPageIndexes = null !== (_this$getConfig = this.getConfig()) && void 0 !== _this$getConfig && _this$getConfig.rtlEnabled ? [...indices].reverse() : indices;
return rtlPageIndexes.map(index => createPage(index))
}
render() {
const PagesMarkup = this.getPages().map(_ref => {
let {
key: key,
pageProps: pageProps
} = _ref;
return pageProps ? (0, _inferno.createComponentVNode)(2, _page.Page, {
index: pageProps.index,
selected: pageProps.selected,
onClick: pageProps.onClick
}, key) : (0, _inferno.createVNode)(1, "div", "dx-separator", ". . .", 16, null, key)
});
return (0, _inferno.createFragment)(PagesMarkup, 0)
}
}
exports.PagesLarge = PagesLarge;
PagesLarge.defaultProps = PagesLargeDefaultProps
},
12363(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PageDefaultProps = exports.Page = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _string = __webpack_require__( /*! ../../../core/utils/string */ 54497);
var _render_utils = __webpack_require__( /*! ../../core/r1/utils/render_utils */ 71312);
var _consts = __webpack_require__( /*! ../common/consts */ 54623);
var _light_button = __webpack_require__( /*! ../common/light_button */ 17286);
var _compatibility_utils = __webpack_require__( /*! ../utils/compatibility_utils */ 4917);
const PageDefaultProps = exports.PageDefaultProps = {
index: 0,
selected: false,
className: _consts.PAGINATION_PAGE_CLASS
};
class Page extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.state = {};
this.refs = null
}
getLabel() {
return (0, _string.format)((0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-page"), this.getValue())
}
getValue() {
return this.props.index + 1
}
getClassName() {
return (0, _render_utils.combineClasses)({
[`${this.props.className}`]: !!this.props.className,
[_consts.PAGINATION_SELECTION_CLASS]: !!this.props.selected
})
}
render() {
return (0, _inferno.createComponentVNode)(2, _light_button.LightButton, {
className: this.getClassName(),
label: this.getLabel(),
onClick: this.props.onClick,
selected: this.props.selected,
children: this.getValue()
})
}
}
exports.Page = Page;
Page.defaultProps = PageDefaultProps
},
33494(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PageIndexSelector = exports.PAGER_BUTTON_DISABLE_CLASS = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _config_context = __webpack_require__( /*! ../../core/r1/config_context */ 12274);
var _light_button = __webpack_require__( /*! ../common/light_button */ 17286);
var _pagination_props = __webpack_require__( /*! ../common/pagination_props */ 64522);
var _compatibility_utils = __webpack_require__( /*! ../utils/compatibility_utils */ 4917);
var _large = __webpack_require__( /*! ./large */ 35853);
var _small = __webpack_require__( /*! ./small */ 70057);
const PAGER_BUTTON_DISABLE_CLASS = exports.PAGER_BUTTON_DISABLE_CLASS = "dx-button-disable";
const classNames = {
nextEnabledClass: "dx-navigate-button dx-next-button",
prevEnabledClass: "dx-navigate-button dx-prev-button",
nextDisabledClass: `${PAGER_BUTTON_DISABLE_CLASS} dx-navigate-button dx-next-button`,
prevDisabledClass: `${PAGER_BUTTON_DISABLE_CLASS} dx-navigate-button dx-prev-button`
};
const reverseDirections = {
next: "prev",
prev: "next"
};
const PageIndexSelectorDefaultProps = {
isLargeDisplayMode: true,
maxPagesCount: _pagination_props.PaginationDefaultProps.maxPagesCount,
pageCount: _pagination_props.PaginationDefaultProps.pageCount,
pageIndex: _pagination_props.PaginationDefaultProps.pageIndex,
pageIndexChangedInternal: _pagination_props.PaginationDefaultProps.pageIndexChangedInternal,
showNavigationButtons: _pagination_props.PaginationDefaultProps.showNavigationButtons,
itemCount: _pagination_props.PaginationDefaultProps.itemCount
};
class PageIndexSelector extends _index.BaseInfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.refs = null;
this.__getterCache = {
prevButtonProps: void 0,
nextButtonProps: void 0
};
this.pageIndexChangedInternal = this.pageIndexChangedInternal.bind(this);
this.getButtonProps = this.getButtonProps.bind(this);
this.canNavigateToPage = this.canNavigateToPage.bind(this);
this.getNextPageIndex = this.getNextPageIndex.bind(this);
this.canNavigateTo = this.canNavigateTo.bind(this);
this.navigateToPage = this.navigateToPage.bind(this)
}
getConfig() {
if (this.context[_config_context.ConfigContext.id]) {
return this.context[_config_context.ConfigContext.id]
}
return _config_context.ConfigContext.defaultValue
}
pageIndexChangedInternal(pageIndex) {
if (this.canNavigateToPage(pageIndex)) {
this.props.pageIndexChangedInternal(pageIndex)
}
}
getButtonProps(direction) {
var _this$getConfig;
const rtlAwareDirection = null !== (_this$getConfig = this.getConfig()) && void 0 !== _this$getConfig && _this$getConfig.rtlEnabled ? reverseDirections[direction] : direction;
const canNavigate = this.canNavigateTo(rtlAwareDirection);
const className = classNames[`${direction}${canNavigate?"Enabled":"Disabled"}Class`];
return {
className: className,
tabIndex: canNavigate ? 0 : -1,
navigate: () => this.navigateToPage(rtlAwareDirection)
}
}
canNavigateToPage(pageIndex) {
if (!this.props.hasKnownLastPage) {
return pageIndex >= 0
}
return pageIndex >= 0 && pageIndex <= this.props.pageCount - 1
}
getNextPageIndex(direction) {
return this.props.pageIndex + function(direction) {
return "next" === direction ? 1 : -1
}(direction)
}
canNavigateTo(direction) {
return this.canNavigateToPage(this.getNextPageIndex(direction))
}
navigateToPage(direction) {
this.pageIndexChangedInternal(this.getNextPageIndex(direction))
}
getRenderPrevButton() {
const {
isLargeDisplayMode: isLargeDisplayMode,
showNavigationButtons: showNavigationButtons
} = this.props;
return (!isLargeDisplayMode || showNavigationButtons) ?? false
}
getRenderNextButton() {
return this.getRenderPrevButton() || !this.props.hasKnownLastPage
}
getPrevButtonProps() {
if (void 0 !== this.__getterCache.prevButtonProps) {
return this.__getterCache.prevButtonProps
}
const result = (() => this.getButtonProps("prev"))();
this.__getterCache.prevButtonProps = result;
return result
}
getNextButtonProps() {
if (void 0 !== this.__getterCache.nextButtonProps) {
return this.__getterCache.nextButtonProps
}
const result = (() => this.getButtonProps("next"))();
this.__getterCache.nextButtonProps = result;
return result
}
componentWillUpdate(nextProps, nextState, context) {
const isComponentUpdated = this.context[_config_context.ConfigContext.id] !== context[_config_context.ConfigContext.id] || this.props.hasKnownLastPage !== nextProps.hasKnownLastPage || this.props.pageCount !== nextProps.pageCount || this.props.pageIndex !== nextProps.pageIndex || this.props.pageIndexChangedInternal !== nextProps.pageIndexChangedInternal;
if (isComponentUpdated) {
this.__getterCache.prevButtonProps = void 0;
this.__getterCache.nextButtonProps = void 0
}
}
getPrevButtonLabel() {
return (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-prevPage")
}
getNextButtonLabel() {
return (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-nextPage")
}
render() {
const {
className: className,
tabIndex: tabIndex,
navigate: navigate
} = this.getPrevButtonProps();
const {
isLargeDisplayMode: isLargeDisplayMode,
maxPagesCount: maxPagesCount,
pageCount: pageCount,
pageIndex: pageIndex,
pagesCountText: pagesCountText
} = this.props;
return (0, _inferno.createFragment)([this.getRenderPrevButton() && (0, _inferno.createComponentVNode)(2, _light_button.LightButton, {
label: this.getPrevButtonLabel(),
className: className,
tabIndex: tabIndex,
onClick: navigate
}), isLargeDisplayMode && (0, _inferno.createComponentVNode)(2, _large.PagesLarge, {
maxPagesCount: maxPagesCount,
pageCount: pageCount,
pageIndex: pageIndex,
pageIndexChangedInternal: this.pageIndexChangedInternal
}), !isLargeDisplayMode && (0, _inferno.createComponentVNode)(2, _small.PagesSmall, {
pageCount: pageCount,
pageIndex: pageIndex,
pageIndexChangedInternal: this.pageIndexChangedInternal,
pagesCountText: pagesCountText
}), this.getRenderNextButton() && (0, _inferno.createComponentVNode)(2, _light_button.LightButton, {
label: this.getNextButtonLabel(),
className: this.getNextButtonProps().className,
tabIndex: this.getNextButtonProps().tabIndex,
onClick: this.getNextButtonProps().navigate
})], 0)
}
}
exports.PageIndexSelector = PageIndexSelector;
PageIndexSelector.defaultProps = PageIndexSelectorDefaultProps
},
70057(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PaginationSmallDefaultProps = exports.PagesSmall = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../core/r1/runtime/inferno/index */ 6257);
var _pagination_props = __webpack_require__( /*! ../common/pagination_props */ 64522);
var _number_box = __webpack_require__( /*! ../editors/number_box */ 71897);
var _info = __webpack_require__( /*! ../info */ 49329);
var _calculate_values_fitted_width = __webpack_require__( /*! ../utils/calculate_values_fitted_width */ 19e3);
var _compatibility_utils = __webpack_require__( /*! ../utils/compatibility_utils */ 4917);
var _get_element_width = __webpack_require__( /*! ../utils/get_element_width */ 70267);
var _page = __webpack_require__( /*! ./page */ 12363);
const PAGER_INFO_TEXT_CLASS = `${_info.PAGER_INFO_CLASS} dx-info-text`;
const PaginationSmallDefaultProps = exports.PaginationSmallDefaultProps = {
pageIndex: _pagination_props.PaginationDefaultProps.pageIndex,
pageCount: _pagination_props.PaginationDefaultProps.pageCount,
pageIndexChangedInternal: _pagination_props.PaginationDefaultProps.pageIndexChangedInternal
};
class PagesSmall extends _index.InfernoComponent {
constructor(props) {
super(props);
this.state = {
minWidth: 10
};
this.refs = null;
this.pageIndexRef = (0, _inferno.createRef)();
this.updateWidth = this.updateWidth.bind(this);
this.selectLastPageIndex = this.selectLastPageIndex.bind(this);
this.valueChange = this.valueChange.bind(this)
}
componentWillUpdate(nextProps, nextState, context) {
super.componentWillUpdate(nextProps, nextState, context)
}
createEffects() {
return [new _index.InfernoEffect(this.updateWidth, [this.state.minWidth])]
}
updateEffects() {
var _this$_effects$;
null === (_this$_effects$ = this._effects[0]) || void 0 === _this$_effects$ || _this$_effects$.update([this.state.minWidth])
}
updateWidth() {
var _this$pageIndexRef$cu;
const el = null === (_this$pageIndexRef$cu = this.pageIndexRef.current) || void 0 === _this$pageIndexRef$cu ? void 0 : _this$pageIndexRef$cu.querySelector(".dx-page-index");
const minWidth = el ? (0, _get_element_width.getElementMinWidth)(el) : 0;
this.setState(state => ({
minWidth: minWidth > 0 ? minWidth : state.minWidth
}))
}
getValue() {
return this.props.pageIndex + 1
}
getWidth() {
return (0, _calculate_values_fitted_width.calculateValuesFittedWidth)(this.state.minWidth, [this.props.pageCount])
}
getPagesCountText() {
return (this.props.pagesCountText ?? "") || (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-pagesCountText")
}
getInputAttributes() {
return {
"aria-label": (0, _compatibility_utils.getLocalizationMessage)(this.context, "dxPagination-ariaPageNumber")
}
}
selectLastPageIndex() {
this.props.pageIndexChangedInternal(this.props.pageCount - 1)
}
valueChange(value) {
this.props.pageIndexChangedInternal(value - 1)
}
render() {
return (0, _inferno.createVNode)(1, "div", "dx-light-pages", [(0, _inferno.createComponentVNode)(2, _number_box.NumberBox, {
className: "dx-page-index",
min: 1,
max: Math.max(this.props.pageCount, this.getValue()),
width: this.getWidth(),
value: this.getValue(),
valueChange: this.valueChange,
inputAttr: this.getInputAttributes()
}), (0, _inferno.createVNode)(1, "span", PAGER_INFO_TEXT_CLASS, this.getPagesCountText(), 0), (0, _inferno.createComponentVNode)(2, _page.Page, {
className: "dx-pages-count",
selected: false,
index: this.props.pageCount - 1,
onClick: this.selectLastPageIndex
})], 4, null, null, this.pageIndexRef)
}
}
exports.PagesSmall = PagesSmall;
PagesSmall.defaultProps = PaginationSmallDefaultProps
},
94585(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Pagination = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../core/r1/runtime/inferno/index */ 6257);
var _render_utils = __webpack_require__( /*! ../core/r1/utils/render_utils */ 71312);
var _pagination_props = __webpack_require__( /*! ./common/pagination_props */ 64522);
var _content = __webpack_require__( /*! ./content */ 62388);
var _resizable_container = __webpack_require__( /*! ./resizable_container */ 30980);
var _compatibility_utils = __webpack_require__( /*! ./utils/compatibility_utils */ 4917);
class Pagination extends _index.InfernoWrapperComponent {
constructor(props) {
super(props);
this.__getterCache = {};
this.pageIndexChangedInternal = this.pageIndexChangedInternal.bind(this);
this.pageSizeChangedInternal = this.pageSizeChangedInternal.bind(this)
}
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
pageIndexChangedInternal(newPageIndex) {
const newValue = newPageIndex + 1;
this.setState(() => ({
pageIndex: newValue
}));
this.props.pageIndexChangedInternal(newValue)
}
getPageIndex() {
return this.props.pageIndex - 1
}
pageSizeChangedInternal(newPageSize) {
this.setState(() => ({
pageSize: newPageSize
}));
this.props.pageSizeChangedInternal(newPageSize)
}
getClassName() {
return (0, _render_utils.combineClasses)({
"dx-datagrid-pager": (0, _compatibility_utils.isGridCompatibilityMode)(this.context),
[`${this.props.className}`]: !!this.props.className
})
}
getPaginationProps() {
return Object.assign({}, this.props, {
className: this.getClassName(),
pageIndex: this.getPageIndex(),
pageIndexChangedInternal: pageIndex => this.pageIndexChangedInternal(pageIndex),
pageSizeChangedInternal: pageSize => this.pageSizeChangedInternal(pageSize)
})
}
render() {
return (0, _inferno.createComponentVNode)(2, _resizable_container.ResizableContainer, {
contentTemplate: _content.PaginationContent,
paginationProps: this.getPaginationProps()
})
}
}
exports.Pagination = Pagination;
Pagination.defaultProps = _pagination_props.PaginationDefaultProps
},
30980(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ResizableContainerDefaultProps = exports.ResizableContainer = void 0;
exports.calculateInfoTextVisible = calculateInfoTextVisible;
exports.calculateLargeDisplayMode = calculateLargeDisplayMode;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../core/r1/runtime/inferno/index */ 6257);
var _resize_callbacks = (e = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 63283), e && e.__esModule ? e : {
default: e
});
var e;
var _type = __webpack_require__( /*! ../../core/utils/type */ 11528);
var _pagination_props = __webpack_require__( /*! ./common/pagination_props */ 64522);
var _get_element_width = __webpack_require__( /*! ./utils/get_element_width */ 70267);
function calculateLargeDisplayMode(_ref) {
let {
parent: parentWidth,
allowedPageSizes: pageSizesWidth,
pages: pagesWidth
} = _ref;
return parentWidth - (pageSizesWidth + pagesWidth) > 0
}
function calculateInfoTextVisible(_ref2) {
let {
parent: parentWidth,
allowedPageSizes: pageSizesWidth,
pages: pagesWidth,
info: infoWidth
} = _ref2;
const minimalWidth = pageSizesWidth + pagesWidth + infoWidth;
return parentWidth - minimalWidth > 0
}
const ResizableContainerDefaultProps = exports.ResizableContainerDefaultProps = {
paginationProps: Object.assign({}, _pagination_props.PaginationDefaultProps)
};
class ResizableContainer extends _index.InfernoComponent {
constructor(props) {
super(props);
this.state = {
infoTextVisible: true,
isLargeDisplayMode: true
};
this.refs = null;
this.parentRef = (0, _inferno.createRef)();
this.infoTextRef = (0, _inferno.createRef)();
this.pagesRef = (0, _inferno.createRef)();
this.allowedPageSizesRef = (0, _inferno.createRef)();
this.elementsWidth = {};
this.actualIsLargeDisplayMode = true;
this.actualInfoTextVisible = true;
this.subscribeToResize = this.subscribeToResize.bind(this);
this.effectUpdateChildProps = this.effectUpdateChildProps.bind(this);
this.updateAdaptivityProps = this.updateAdaptivityProps.bind(this)
}
componentWillUpdate(nextProps, nextState, context) {
super.componentWillUpdate(nextProps, nextState, context)
}
createEffects() {
return [new _index.InfernoEffect(this.subscribeToResize, [this.state.infoTextVisible, this.state.isLargeDisplayMode]), new _index.InfernoEffect(this.effectUpdateChildProps, [this.props, this.state.infoTextVisible, this.state.isLargeDisplayMode, this.props.paginationProps, this.props.contentTemplate])]
}
updateEffects() {
var _this$_effects$, _this$_effects$2;
null === (_this$_effects$ = this._effects[0]) || void 0 === _this$_effects$ || _this$_effects$.update([this.state.infoTextVisible, this.state.isLargeDisplayMode]);
null === (_this$_effects$2 = this._effects[1]) || void 0 === _this$_effects$2 || _this$_effects$2.update([this.props, this.state.infoTextVisible, this.state.isLargeDisplayMode, this.props.paginationProps, this.props.contentTemplate])
}
subscribeToResize() {
const callback = () => {
if (this.getParentWidth() > 0) {
this.updateAdaptivityProps()
}
};
_resize_callbacks.default.add(callback);
return () => {
_resize_callbacks.default.remove(callback)
}
}
effectUpdateChildProps() {
if (this.getParentWidth() > 0) {
this.updateAdaptivityProps()
}
}
getContentAttributes() {
const {
className: className,
displayMode: displayMode,
isGridCompatibilityMode: isGridCompatibilityMode,
_getParentComponentRootNode: _getParentComponentRootNode,
hasKnownLastPage: hasKnownLastPage,
infoText: infoText,
label: label,
lightModeEnabled: lightModeEnabled,
maxPagesCount: maxPagesCount,
onKeyDown: onKeyDown,
pageCount: pageCount,
pageIndex: pageIndex,
pageIndexChangedInternal: pageIndexChangedInternal,
pageSize: pageSize,
pageSizeChangedInternal: pageSizeChangedInternal,
allowedPageSizes: allowedPageSizes,
pagesCountText: pagesCountText,
pagesNavigatorVisible: pagesNavigatorVisible,
rtlEnabled: rtlEnabled,
showInfo: showInfo,
showNavigationButtons: showNavigationButtons,
showPageSizeSelector: showPageSizeSelector,
itemCount: itemCount,
visible: visible,
style: style,
width: width,
height: height,
elementAttr: elementAttr,
hint: hint,
disabled: disabled,
tabIndex: tabIndex,
accessKey: accessKey,
activeStateEnabled: activeStateEnabled,
focusStateEnabled: focusStateEnabled,
hoverStateEnabled: hoverStateEnabled
} = this.props.paginationProps;
return {
pageSize: pageSize,
pageIndex: pageIndex,
pageIndexChangedInternal: pageIndexChangedInternal,
pageSizeChangedInternal: pageSizeChangedInternal,
isGridCompatibilityMode: isGridCompatibilityMode,
_getParentComponentRootNode: _getParentComponentRootNode,
className: className,
showInfo: showInfo,
infoText: infoText,
lightModeEnabled: lightModeEnabled,
displayMode: displayMode,
maxPagesCount: maxPagesCount,
pageCount: pageCount,
pagesCountText: pagesCountText,
visible: visible,
hasKnownLastPage: hasKnownLastPage,
pagesNavigatorVisible: pagesNavigatorVisible,
showPageSizeSelector: showPageSizeSelector,
allowedPageSizes: allowedPageSizes,
rtlEnabled: rtlEnabled,
showNavigationButtons: showNavigationButtons,
itemCount: itemCount,
onKeyDown: onKeyDown,
label: label,
style: style,
width: width,
height: height,
elementAttr: elementAttr,
hint: hint,
disabled: disabled,
tabIndex: tabIndex,
accessKey: accessKey,
activeStateEnabled: activeStateEnabled,
focusStateEnabled: focusStateEnabled,
hoverStateEnabled: hoverStateEnabled
}
}
getParentWidth() {
var _this$parentRef;
return null !== (_this$parentRef = this.parentRef) && void 0 !== _this$parentRef && _this$parentRef.current ? (0, _get_element_width.getElementWidth)(this.parentRef.current) : 0
}
updateAdaptivityProps() {
var _this$parentRef2, _this$allowedPageSize, _this$infoTextRef, _this$pagesRef;
const currentElementsWidth = function(_ref3) {
let {
parent: parent,
allowedPageSizes: allowedPageSizes,
pages: pages,
info: info
} = _ref3;
const parentWidth = (0, _get_element_width.getElementContentWidth)(parent);
const pageSizesWidth = (0, _get_element_width.getElementWidth)(allowedPageSizes);
const infoWidth = (0, _get_element_width.getElementWidth)(info);
const pagesHtmlWidth = (0, _get_element_width.getElementWidth)(pages);
return {
parent: parentWidth,
allowedPageSizes: pageSizesWidth,
info: infoWidth + (0, _get_element_width.getElementStyle)("marginLeft", info) + (0, _get_element_width.getElementStyle)("marginRight", info),
pages: pagesHtmlWidth
}
}({
parent: null === (_this$parentRef2 = this.parentRef) || void 0 === _this$parentRef2 ? void 0 : _this$parentRef2.current,
allowedPageSizes: null === (_this$allowedPageSize = this.allowedPageSizesRef) || void 0 === _this$allowedPageSize ? void 0 : _this$allowedPageSize.current,
info: null === (_this$infoTextRef = this.infoTextRef) || void 0 === _this$infoTextRef ? void 0 : _this$infoTextRef.current,
pages: null === (_this$pagesRef = this.pagesRef) || void 0 === _this$pagesRef ? void 0 : _this$pagesRef.current
});
if (this.actualInfoTextVisible !== this.state.infoTextVisible || this.actualIsLargeDisplayMode !== this.state.isLargeDisplayMode) {
return
}
const isEmpty = !(0, _type.isDefined)(this.elementsWidth);
if (isEmpty) {
this.elementsWidth = {}
}
if (isEmpty || this.state.isLargeDisplayMode) {
this.elementsWidth.allowedPageSizes = currentElementsWidth.allowedPageSizes;
this.elementsWidth.pages = currentElementsWidth.pages
}
if (isEmpty || this.state.infoTextVisible) {
this.elementsWidth.info = currentElementsWidth.info
}
this.actualIsLargeDisplayMode = calculateLargeDisplayMode({
parent: currentElementsWidth.parent,
allowedPageSizes: this.elementsWidth.allowedPageSizes,
pages: this.elementsWidth.pages
});
this.actualInfoTextVisible = calculateInfoTextVisible(Object.assign({}, currentElementsWidth, {
info: this.elementsWidth.info
}));
this.setState(() => ({
infoTextVisible: this.actualInfoTextVisible
}));
this.setState(() => ({
isLargeDisplayMode: this.actualIsLargeDisplayMode
}))
}
render() {
const {
infoTextVisible: infoTextVisible,
isLargeDisplayMode: isLargeDisplayMode
} = this.state;
const {
props: {
contentTemplate: Content
}
} = this;
return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, Content, Object.assign({
rootElementRef: this.parentRef,
allowedPageSizesRef: this.allowedPageSizesRef,
infoTextRef: this.infoTextRef,
pagesRef: this.pagesRef,
infoTextVisible: infoTextVisible,
isLargeDisplayMode: isLargeDisplayMode
}, this.getContentAttributes())))
}
}
exports.ResizableContainer = ResizableContainer;
ResizableContainer.defaultProps = ResizableContainerDefaultProps
},
19e3(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateValuesFittedWidth = function(minWidth, values) {
return minWidth + oneDigitWidth * Math.max(...values).toString().length
};
exports.oneDigitWidth = void 0;
const oneDigitWidth = exports.oneDigitWidth = 10
},
4917(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getLocalizationMessage = function(context, key) {
let actualKey = key;
if (isGridCompatibilityMode(context)) {
actualKey = key.replace("dxPagination", "dxPager")
}
return _message.default.getFormatter(actualKey)()
};
exports.isGridCompatibilityMode = isGridCompatibilityMode;
var _message = (e = __webpack_require__( /*! ../../../common/core/localization/message */ 4671), e && e.__esModule ? e : {
default: e
});
var e;
var _pagination_config_context = __webpack_require__( /*! ../common/pagination_config_context */ 32576);
function isGridCompatibilityMode(context) {
var _getPaginationConfig;
return !!(null !== (_getPaginationConfig = function(context) {
if (context[_pagination_config_context.PaginationConfigContext.id]) {
return context[_pagination_config_context.PaginationConfigContext.id]
}
return _pagination_config_context.PaginationConfigContext.defaultValue
}(context)) && void 0 !== _getPaginationConfig && _getPaginationConfig.isGridCompatibilityMode)
}
},
70267(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getElementContentWidth = function(element) {
const padding = getElementStyle("paddingLeft", element) + getElementStyle("paddingRight", element);
const width = getElementStyle("width", element);
return width - padding
};
exports.getElementMinWidth = function(element) {
return getElementStyle("minWidth", element)
};
exports.getElementStyle = getElementStyle;
exports.getElementWidth = function(element) {
const margin = getElementStyle("marginLeft", element) + getElementStyle("marginRight", element);
const width = getElementStyle("width", element);
return margin + width
};
var _get_computed_style = (e = __webpack_require__( /*! ../../core/r1/utils/get_computed_style */ 31006), e && e.__esModule ? e : {
default: e
});
var e;
var _type_conversion = __webpack_require__( /*! ../../core/r1/utils/type_conversion */ 7529);
function getElementStyle(name, element) {
const computedStyle = (0, _get_computed_style.default)(element) ?? {};
return (0, _type_conversion.toNumber)(computedStyle[name])
}
},
28462(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validateOptions = function(oldPageSize, oldPageIndex, oldItemCount) {
const pageSize = function(pageSize) {
if (pageSize < 0) {
return 1
}
return pageSize
}(oldPageSize);
const itemCount = function(itemCount) {
if (itemCount < 0) {
return 0
}
return itemCount
}(oldItemCount);
const pageCount = getPageCount(pageSize, oldItemCount);
const pageIndex = function(pageIndex, pageSize, itemCount) {
if (pageIndex < 1) {
return 1
}
const pageCount = getPageCount(pageSize, itemCount);
return Math.min(pageIndex, pageCount)
}(oldPageIndex, pageSize, itemCount);
return {
pageSize: pageSize,
pageIndex: pageIndex,
itemCount: itemCount,
pageCount: pageCount
}
};
function getPageCount(pageSize, itemCount) {
if (pageSize > 0 && itemCount > 0) {
return Math.max(1, Math.ceil(itemCount / pageSize))
}
return 1
}
},
76988(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _pagination = __webpack_require__( /*! ../pagination */ 94585);
var _pagination_wrapper = __webpack_require__( /*! ./pagination_wrapper */ 16952);
class Pagination extends _pagination_wrapper.PaginationWrapper {
getProps() {
const props = super.getProps();
props.onKeyDown = this._wrapKeyDownHandler(props.onKeyDown);
return props
}
get _propsInfo() {
return {
twoWay: [
["pageSize", "defaultPageSize", "pageSizeChangedInternal", "pageSizeChanged"],
["pageIndex", "defaultPageIndex", "pageIndexChangedInternal", "pageIndexChanged"]
],
allowNull: [],
elements: [],
templates: [],
props: ["defaultPageSize", "pageSizeChanged", "pageSizeChangedInternal", "defaultPageIndex", "pageIndexChanged", "pageIndexChangedInternal", "isGridCompatibilityMode", "className", "showInfo", "infoText", "lightModeEnabled", "displayMode", "maxPagesCount", "pageCount", "pagesCountText", "visible", "hasKnownLastPage", "pagesNavigatorVisible", "showPageSizeSelector", "allowedPageSizes", "rtlEnabled", "showNavigationButtons", "itemCount", "label", "onKeyDown", "pageSize", "pageIndex", "width", "height", "elementAttr", "hint", "disabled", "tabIndex", "accessKey", "activeStateEnabled", "focusStateEnabled", "hoverStateEnabled", "_skipValidation", "_getParentComponentRootNode"]
}
}
get _viewComponent() {
return _pagination.Pagination
}
}
exports.default = Pagination
},
16952(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PaginationWrapper = void 0;
var _component_wrapper = __webpack_require__( /*! ../../core/r1/component_wrapper */ 34993);
var _validation_utils = __webpack_require__( /*! ../utils/validation_utils */ 28462);
const _excluded = ["pageSize", "pageIndex", "itemCount"];
class PaginationWrapper extends _component_wrapper.ComponentWrapper {
_optionChanged(args) {
switch (args.name) {
case "pageIndex": {
const pageIndexChanged = this.option("pageIndexChanged");
if (pageIndexChanged) {
pageIndexChanged(args.value)
}
break
}
case "pageSize": {
const pageSizeChanged = this.option("pageSizeChanged");
if (pageSizeChanged) {
pageSizeChanged(args.value)
}
break
}
}
super._optionChanged(args)
}
getPageCount() {
return this.option("pageCount")
}
_validateOptions(options) {
if (options._skipValidation || this.option("_skipValidation")) {
return options
}
const initialOptions = super._validateOptions(options);
let {
pageSize: pageSize,
pageIndex: pageIndex,
itemCount: itemCount
} = initialOptions, rest = function(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue
}
t[n] = r[n]
}
}
return t
}(initialOptions, _excluded);
if (void 0 === pageSize) {
pageSize = this.option("pageSize")
}
if (void 0 === pageIndex) {
pageIndex = this.option("pageIndex")
}
if (void 0 === itemCount) {
itemCount = this.option("itemCount")
}
const validatedOptions = (0, _validation_utils.validateOptions)(pageSize, pageIndex, itemCount);
return Object.assign({}, rest, validatedOptions)
}
}
exports.PaginationWrapper = PaginationWrapper
},
24988(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createA11yStatusContainer = void 0;
var _renderer = (e = __webpack_require__( /*! ../../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
const CLASSES_container = "dx-scheduler-a11y-status-container";
exports.createA11yStatusContainer = function() {
let statusText = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
return (0, _renderer.default)(" ").text(statusText).addClass(CLASSES_container).attr("role", "status")
}
},
71883(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getA11yStatusText = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/date */ 38662));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const KEYS_dateRange = "dxScheduler-dateRange",
KEYS_label = "dxScheduler-ariaLabel",
KEYS_indicatorPresent = "dxScheduler-ariaLabel-currentIndicator-present",
KEYS_indicatorNotPresent = "dxScheduler-ariaLabel-currentIndicator-not-present";
const viewTypeLocalization = {
agenda: "dxScheduler-switcherAgenda",
day: "dxScheduler-switcherDay",
month: "dxScheduler-switcherMonth",
week: "dxScheduler-switcherWeek",
workWeek: "dxScheduler-switcherWorkWeek",
timelineDay: "dxScheduler-switcherTimelineDay",
timelineMonth: "dxScheduler-switcherTimelineMonth",
timelineWeek: "dxScheduler-switcherTimelineWeek",
timelineWorkWeek: "dxScheduler-switcherTimelineWorkWeek"
};
const localizeMonth = date => String(_date.default.format(date, "monthAndYear"));
const localizeDate = date => `${_date.default.format(date,"monthAndDay")}, ${_date.default.format(date,"year")}`;
exports.getA11yStatusText = (view, startDate, endDate, appointmentCount, indicatorTime) => {
const viewType = null === view || void 0 === view ? void 0 : view.type;
const viewName = null === view || void 0 === view ? void 0 : view.name;
const viewTypeLabel = ((viewName, viewType) => {
if (viewName) {
return viewName
}
if (viewType) {
return _message.default.format(viewTypeLocalization[viewType])
}
return ""
})(viewName, viewType);
const isMonth = "month" === viewType || "timelineMonth" === viewType;
const startDateText = isMonth ? localizeMonth(startDate) : localizeDate(startDate);
const endDateText = isMonth ? localizeMonth(endDate) : localizeDate(endDate);
const intervalText = startDateText === endDateText ? `${startDateText}` : _message.default.format(KEYS_dateRange, startDateText, endDateText);
const statusText = _message.default.format(KEYS_label, viewTypeLabel, intervalText, appointmentCount);
if (indicatorTime) {
const indicatorStatus = ((date, startDate, endDate) => _message.default.format(date >= startDate && date < endDate ? KEYS_indicatorPresent : KEYS_indicatorNotPresent))(indicatorTime, startDate, endDate);
return `${statusText}. ${indicatorStatus}`
}
return statusText
}
},
77575(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRepeatSelectItems = exports.getRecurrenceWeekDayItems = exports.getRecurrenceMonthItems = exports.getRecurrenceFrequencyItems = exports.REPEAT_NEVER_VALUE = exports.ICAL_WEEK_DAYS = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/date */ 38662));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _capitalize = __webpack_require__( /*! ../../core/utils/capitalize */ 72928);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const REPEAT_NEVER_VALUE = exports.REPEAT_NEVER_VALUE = "never";
const ICAL_WEEK_DAYS = exports.ICAL_WEEK_DAYS = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"];
const repeatSelectItemDefs = [{
messageId: "dxScheduler-recurrenceNever",
value: REPEAT_NEVER_VALUE
}, {
messageId: "dxScheduler-recurrenceHourly",
value: "hourly"
}, {
messageId: "dxScheduler-recurrenceDaily",
value: "daily"
}, {
messageId: "dxScheduler-recurrenceWeekly",
value: "weekly"
}, {
messageId: "dxScheduler-recurrenceMonthly",
value: "monthly"
}, {
messageId: "dxScheduler-recurrenceYearly",
value: "yearly"
}];
const recurrenceFrequencyItemDefs = [{
messageId: "dxScheduler-recurrenceRepeatHourly",
value: "hourly"
}, {
messageId: "dxScheduler-recurrenceRepeatDaily",
value: "daily"
}, {
messageId: "dxScheduler-recurrenceRepeatWeekly",
value: "weekly"
}, {
messageId: "dxScheduler-recurrenceRepeatMonthly",
value: "monthly"
}, {
messageId: "dxScheduler-recurrenceRepeatYearly",
value: "yearly"
}];
exports.getRepeatSelectItems = () => repeatSelectItemDefs.map(item => ({
text: _message.default.format(item.messageId),
value: item.value
}));
exports.getRecurrenceFrequencyItems = () => recurrenceFrequencyItemDefs.map(item => ({
text: (0, _capitalize.capitalize)(_message.default.format(item.messageId)),
value: item.value
}));
exports.getRecurrenceMonthItems = () => _date.default.getMonthNames().map((monthName, index) => ({
value: index + 1,
text: monthName
}));
exports.getRecurrenceWeekDayItems = firstDayOfWeek => {
const localizedDayNames = _date.default.getDayNames("abbreviated");
const orderedWeekDayItems = ICAL_WEEK_DAYS.map((day, index) => ({
text: localizedDayNames[index].slice(0, 1).toUpperCase(),
key: day
}));
const validFirstDayOfWeek = firstDayOfWeek ?? _date.default.firstDayOfWeekIndex();
return orderedWeekDayItems.slice(validFirstDayOfWeek).concat(orderedWeekDayItems.slice(0, validFirstDayOfWeek))
}
},
10504(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.customizeFormItems = void 0;
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
const isGroupItem = item => "items" in item;
const buildFormItemsMap = function(items) {
let map = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Map;
return items.reduce((accumulator, item) => {
if (item.name) {
accumulator.set(item.name, Object.assign({}, item))
}
return buildFormItemsMap(isGroupItem(item) ? item.items ?? [] : [], accumulator)
}, map)
};
exports.customizeFormItems = (items, userConfig) => {
if (!userConfig) {
return items
}
const defaultItemsMap = buildFormItemsMap(items);
const resolveItem = customItems => {
const itemName = (customItem = customItems, "string" === typeof customItem ? customItem : customItem.name);
var customItem;
const defaultItem = itemName ? defaultItemsMap.get(itemName) : void 0;
if (defaultItem && itemName) {
((itemName, itemsMap) => {
Array.from(itemsMap.values()).forEach(group => {
if (isGroupItem(group) && group.items) {
group.items = group.items.filter(item => item.name !== itemName)
}
})
})(itemName, defaultItemsMap);
return (customItems => "object" === typeof customItems)(customItems) ? (0, _extend.extend)(true, {}, defaultItem, customItems) : defaultItem
}
return configItem = customItems, "string" === typeof configItem ? {
itemType: "simple",
editorType: "dxTextBox",
name: configItem,
dataField: configItem
} : configItem;
var configItem
};
const customize = userItems => userItems.map(customItems => {
const formItem = resolveItem(customItems);
if (isGroupItem(formItem) && (customItems => "object" === typeof customItems && isGroupItem(customItems) && Boolean(customItems.items))(customItems) && customItems.items) {
return Object.assign({}, formItem, {
items: customize(customItems.items)
})
}
return formItem
});
return customize(userConfig)
}
},
8107(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentForm = void 0;
__webpack_require__( /*! ../../../ui/radio_group */ 84798);
__webpack_require__( /*! ../../../ui/text_area */ 23116);
__webpack_require__( /*! ../../../ui/tag_box */ 4575);
__webpack_require__( /*! ../../../ui/switch */ 91029);
__webpack_require__( /*! ../../../ui/select_box */ 60695);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _data = __webpack_require__( /*! ../../../common/data */ 11036);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _form = _interopRequireDefault(__webpack_require__( /*! ../../../ui/form */ 74075));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 52071);
var _m_date_serialization = __webpack_require__( /*! ../../core/utils/m_date_serialization */ 62897);
var _m_drop_down_editor = _interopRequireDefault(__webpack_require__( /*! ../../ui/drop_down_editor/m_drop_down_editor */ 28906));
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 18648));
var _constants = __webpack_require__( /*! ../utils/options/constants */ 46912);
var _appointment_groups_utils = __webpack_require__( /*! ../utils/resource_manager/appointment_groups_utils */ 11649);
var _localized_items = __webpack_require__( /*! ./localized_items */ 77575);
var _m_customize_form_items = __webpack_require__( /*! ./m_customize_form_items */ 10504);
var _m_recurrence_form = __webpack_require__( /*! ./m_recurrence_form */ 58452);
var _utils = __webpack_require__( /*! ./utils */ 63512);
const _excluded = ["items", "onContentReady", "onInitialized"];
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const CLASSES_form = "dx-scheduler-form",
CLASSES_icon = "dx-icon",
CLASSES_fieldItemContent = "dx-field-item-content",
CLASSES_formItem = "dx-item",
CLASSES_labelTop = "dx-field-item-label-location-top",
CLASSES_label = "dx-label",
CLASSES_groupWithIcon = "dx-scheduler-form-group-with-icon",
CLASSES_formIcon = "dx-scheduler-form-icon",
CLASSES_formIconTopLabelOffset = "dx-scheduler-form-top-label-offset",
CLASSES_formIconInnerLabelOffset = "dx-scheduler-form-inner-label-offset",
CLASSES_defaultResourceIcon = "dx-scheduler-default-resources-icon",
CLASSES_mainGroup = "dx-scheduler-form-main-group",
CLASSES_subjectGroup = "dx-scheduler-form-subject-group",
CLASSES_dateRangeGroup = "dx-scheduler-form-date-range-group",
CLASSES_startDateGroup = "dx-scheduler-form-start-date-group",
CLASSES_endDateGroup = "dx-scheduler-form-end-date-group",
CLASSES_repeatGroup = "dx-scheduler-form-repeat-group",
CLASSES_descriptionGroup = "dx-scheduler-form-description-group",
CLASSES_resourcesGroup = "dx-scheduler-form-resources-group",
CLASSES_textEditor = "dx-scheduler-form-text-editor",
CLASSES_allDaySwitch = "dx-scheduler-form-all-day-switch",
CLASSES_startDateEditor = "dx-scheduler-form-start-date-editor",
CLASSES_startTimeEditor = "dx-scheduler-form-start-time-editor",
CLASSES_startDateTimeZoneEditor = "dx-scheduler-form-start-date-timezone-editor",
CLASSES_endDateEditor = "dx-scheduler-form-end-date-editor",
CLASSES_endTimeEditor = "dx-scheduler-form-end-time-editor",
CLASSES_endDateTimeZoneEditor = "dx-scheduler-form-end-date-timezone-editor",
CLASSES_repeatEditor = "dx-scheduler-form-repeat-editor",
CLASSES_descriptionEditor = "dx-scheduler-form-description-editor",
CLASSES_recurrenceSettingsButton = "dx-scheduler-form-recurrence-settings-button",
CLASSES_mainHidden = "dx-scheduler-form-main-group-hidden",
CLASSES_recurrenceGroup = "dx-scheduler-form-recurrence-group",
CLASSES_recurrenceHidden = "dx-scheduler-form-recurrence-group-hidden";
exports.AppointmentForm = class {
get dxForm() {
return this.dxFormInstance
}
get dxPopup() {
return this._popup.dxPopup
}
get readOnly() {
return this.dxForm.option("readOnly")
}
set readOnly(value) {
this.dxForm.option("readOnly", value);
this.recurrenceForm.setReadOnly(value)
}
get formData() {
return this.dxForm.option("formData")
}
set formData(formData) {
this.dxForm.option("formData", formData)
}
get startDate() {
const {
startDateExpr: startDateExpr
} = this.scheduler.getDataAccessors().expr;
const value = this.getFormDataField(startDateExpr);
return value ? new Date(_m_date_serialization.dateSerialization.deserializeDate(value)) : null
}
get endDate() {
const {
endDateExpr: endDateExpr
} = this.scheduler.getDataAccessors().expr;
const value = this.getFormDataField(endDateExpr);
return value ? new Date(_m_date_serialization.dateSerialization.deserializeDate(value)) : null
}
get recurrenceRuleRaw() {
const {
recurrenceRuleExpr: recurrenceRuleExpr
} = this.scheduler.getDataAccessors().expr;
const value = this.getFormDataField(recurrenceRuleExpr);
return value ?? null
}
constructor(scheduler) {
this.scheduler = scheduler;
this.resourceManager = scheduler.getResourceManager()
}
getFormDataField(field) {
return this.dxForm.option(`formData.${field}`)
}
dispose() {
var _this$dxFormInstance;
null === (_this$dxFormInstance = this.dxFormInstance) || void 0 === _this$dxFormInstance || _this$dxFormInstance.dispose();
this.dxFormInstance = void 0;
if (this.recurrenceForm) {
this.recurrenceForm.dxForm = void 0
}
}
create(popup) {
var _editingConfig$form;
this._popup = popup;
const mainGroup = this.createMainFormGroup();
this.recurrenceForm = new _m_recurrence_form.RecurrenceForm(this.scheduler);
const recurrenceGroup = this.recurrenceForm.createRecurrenceFormGroup();
const items = [mainGroup, recurrenceGroup];
const iconsShowMode = this.getIconsShowMode();
const showMainGroupIcons = ["main", "both"].includes(iconsShowMode);
const showRecurrenceGroupIcons = ["recurrence", "both"].includes(iconsShowMode);
this.applyFormItemDefaults(mainGroup, showMainGroupIcons);
this.applyFormItemDefaults(recurrenceGroup, showRecurrenceGroupIcons);
const editingConfig = this.scheduler.getEditingConfig();
const customizedItems = (0, _m_customize_form_items.customizeFormItems)(items, null === editingConfig || void 0 === editingConfig || null === (_editingConfig$form = editingConfig.form) || void 0 === _editingConfig$form ? void 0 : _editingConfig$form.items);
this.createForm(customizedItems)
}
getIconsShowMode() {
var _editingConfig$form2;
const editingConfig = this.scheduler.getEditingConfig();
if ((0, _type.isBoolean)(editingConfig)) {
return _constants.DEFAULT_ICONS_SHOW_MODE
}
return (null === editingConfig || void 0 === editingConfig || null === (_editingConfig$form2 = editingConfig.form) || void 0 === _editingConfig$form2 ? void 0 : _editingConfig$form2.iconsShowMode) ?? _constants.DEFAULT_ICONS_SHOW_MODE
}
createForm(items) {
const element = (0, _renderer.default)(" ");
const editingConfig = this.scheduler.getEditingConfig();
const _ref = (null === editingConfig || void 0 === editingConfig ? void 0 : editingConfig.form) ?? {},
{
onContentReady: onContentReady,
onInitialized: onInitialized
} = _ref,
customFormOptions = function(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue
}
t[n] = r[n]
}
}
return t
}(_ref, _excluded);
const defaultOptions = {
items: items,
formData: {},
showColonAfterLabel: false,
showValidationSummary: false,
scrollingEnabled: false,
labelLocation: "top",
colCountByScreen: {
xs: 1
},
elementAttr: {
class: CLASSES_form
},
onFieldDataChanged: e => {
const {
startDateExpr: startDateExpr,
endDateExpr: endDateExpr,
recurrenceRuleExpr: recurrenceRuleExpr
} = this.scheduler.getDataAccessors().expr;
const {
dataField: dataField
} = e;
if (!dataField) {
return
}
const isDateRangeChanged = [startDateExpr, endDateExpr].includes(dataField);
const isRecurrenceRuleChanged = dataField === recurrenceRuleExpr;
const isResourceChanged = Object.keys(this.scheduler.getResourceById()).includes(dataField);
if (isDateRangeChanged) {
this.updateDateEditorsValues()
}
if (isRecurrenceRuleChanged || startDateExpr === dataField) {
this.recurrenceForm.updateRecurrenceFormValues(this.recurrenceRuleRaw, this.startDate)
}
if (isRecurrenceRuleChanged) {
this.updateRepeatEditorValue()
}
if (isResourceChanged) {
this.updateSubjectIconColor()
}
},
onInitialized: e => {
this.dxFormInstance = e.component;
this.recurrenceForm.dxForm = this.dxForm;
null === onInitialized || void 0 === onInitialized || onInitialized.call(this, e)
},
onContentReady: e => {
const $formElement = e.component.$element();
this.$mainGroup = $formElement.find(`.${CLASSES_mainGroup}`);
this.$recurrenceGroup = $formElement.find(`.${CLASSES_recurrenceGroup}`);
this.alignIconsWithEditors();
null === onContentReady || void 0 === onContentReady || onContentReady.call(this, e)
}
};
const formOptions = (0, _extend.extend)(true, defaultOptions, customFormOptions);
return this.scheduler.createComponent(element, _form.default, formOptions)
}
createMainFormGroup() {
return {
name: "mainGroup",
itemType: "group",
colSpan: 1,
cssClass: CLASSES_mainGroup,
items: [this.createSubjectGroup(), this.createDateRangeGroup(), this.createRepeatGroup(), this.createResourcesGroup(), this.createDescriptionGroup()]
}
}
createSubjectGroup() {
const {
textExpr: textExpr
} = this.scheduler.getDataAccessors().expr;
return {
name: "subjectGroup",
itemType: "group",
cssClass: `${CLASSES_subjectGroup} ${CLASSES_groupWithIcon}`,
items: [{
name: "subjectIcon",
colSpan: 1,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)("isnotblank")
}, {
name: "subjectEditor",
colSpan: 1,
itemType: "simple",
cssClass: CLASSES_textEditor,
dataField: textExpr,
label: {
text: _message.default.format("dxScheduler-editorLabelTitle")
},
editorType: "dxTextBox"
}]
}
}
createDateRangeGroup() {
return {
name: "dateGroup",
itemType: "group",
cssClass: `${CLASSES_dateRangeGroup} ${CLASSES_groupWithIcon}`,
items: [{
name: "dateIcon",
colSpan: 1,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)("clock")
}, {
colSpan: 1,
name: "dateOptionsGroup",
itemType: "group",
items: [this.createAllDaySwitch(), this.createStartDateGroup(), this.createEndDateGroup()]
}]
}
}
createAllDaySwitch() {
const {
allDayExpr: allDayExpr,
startDateExpr: startDateExpr,
endDateExpr: endDateExpr
} = this.scheduler.getDataAccessors().expr;
return {
name: "allDayEditor",
itemType: "simple",
dataField: allDayExpr,
cssClass: CLASSES_allDaySwitch,
label: {
text: _message.default.format("dxScheduler-allDay"),
location: "left"
},
editorType: "dxSwitch",
editorOptions: {
onValueChanged: e => {
this.updateDateTimeEditorsVisibility();
const {
startDate: startDate
} = this;
if (!startDate || void 0 === e.event) {
return
}
if (e.value) {
const allDayStartDate = _date.default.trimTime(startDate);
this.dxForm.updateData(startDateExpr, allDayStartDate);
this.dxForm.updateData(endDateExpr, allDayStartDate)
} else {
const startHour = this.scheduler.getStartDayHour();
startDate.setHours(startHour);
const calculatedEndDate = this.scheduler.getCalculatedEndDate(startDate);
this.dxForm.updateData(startDateExpr, startDate);
this.dxForm.updateData(endDateExpr, calculatedEndDate)
}
}
}
}
}
createStartDateGroup() {
const {
startDateExpr: startDateExpr,
startDateTimeZoneExpr: startDateTimeZoneExpr,
endDateTimeZoneExpr: endDateTimeZoneExpr
} = this.scheduler.getDataAccessors().expr;
return this.createDateGroup(startDateExpr, {
name: "startDateGroup",
cssClass: CLASSES_startDateGroup
}, {
name: "startDateEditor",
label: {
text: _message.default.format("dxScheduler-editorLabelStartDate")
},
cssClass: CLASSES_startDateEditor
}, {
name: "startTimeEditor",
cssClass: CLASSES_startTimeEditor,
editorOptions: {
inputAttr: {
"aria-label": _message.default.format("dxScheduler-editorAriaLabelStartTime")
}
}
}, {
name: "startDateTimeZoneEditor",
dataField: startDateTimeZoneExpr,
cssClass: CLASSES_startDateTimeZoneEditor,
editorOptions: {
onValueChanged: e => {
const endDateTimeZoneEditor = this.dxForm.getEditor(endDateTimeZoneExpr);
null === endDateTimeZoneEditor || void 0 === endDateTimeZoneEditor || endDateTimeZoneEditor.option("value", e.value)
}
}
})
}
createEndDateGroup() {
const {
endDateExpr: endDateExpr,
endDateTimeZoneExpr: endDateTimeZoneExpr
} = this.scheduler.getDataAccessors().expr;
return this.createDateGroup(endDateExpr, {
name: "endDateGroup",
cssClass: CLASSES_endDateGroup
}, {
name: "endDateEditor",
label: {
text: _message.default.format("dxScheduler-editorLabelEndDate")
},
cssClass: CLASSES_endDateEditor
}, {
name: "endTimeEditor",
cssClass: CLASSES_endTimeEditor,
editorOptions: {
inputAttr: {
"aria-label": _message.default.format("dxScheduler-editorAriaLabelEndTime")
}
}
}, {
name: "endDateTimeZoneEditor",
dataField: endDateTimeZoneExpr,
cssClass: CLASSES_endDateTimeZoneEditor
})
}
createDateGroup(dateExpr, groupItemOptions, dateItemOptions, timeItemOptions, timezoneItemOptions) {
const {
allowTimeZoneEditing: allowTimeZoneEditing
} = this.scheduler.getEditingConfig();
const {
startDateExpr: startDateExpr,
endDateExpr: endDateExpr
} = this.scheduler.getDataAccessors().expr;
const isStartDateEditor = dateExpr === startDateExpr;
const getEditorsDate = () => isStartDateEditor ? this.startDate : this.endDate;
const correctDateRange = previousDateValue => {
const {
startDate: startDate,
endDate: endDate
} = this;
if (!startDate || !endDate || startDate.getTime() <= endDate.getTime()) {
return
}
if (isStartDateEditor) {
const duration = previousDateValue ? endDate.getTime() - previousDateValue.getTime() : 0;
const correctedEndDate = new Date(startDate.getTime() + duration);
this.dxForm.updateData(endDateExpr, correctedEndDate)
} else {
const duration = previousDateValue ? previousDateValue.getTime() - startDate.getTime() : 0;
const correctedStartDate = new Date(endDate.getTime() - duration);
this.dxForm.updateData(startDateExpr, correctedStartDate)
}
};
const dateValueChanged = (e, modifyDate) => {
const currentDate = getEditorsDate();
if (!currentDate) {
this.dxForm.updateData(dateExpr, e.value);
return
}
if (!e.value) {
return
}
if (!e.event && currentDate.getTime() === e.value.getTime()) {
return
}
const previousDateValue = new Date(currentDate);
modifyDate(currentDate);
this.dxForm.updateData(dateExpr, currentDate);
correctDateRange(previousDateValue)
};
return Object.assign({
itemType: "group",
items: [{
name: isStartDateEditor ? "startDateTimeGroup" : "endDateTimeGroup",
itemType: "group",
colCount: 2,
colCountByScreen: {
xs: 2
},
items: [(0, _extend.extend)(true, (0, _utils.getStartDateCommonConfig)(this.scheduler.getFirstDayOfWeek()), {
editorOptions: {
onValueChanged: e => {
dateValueChanged(e, date => {
date.setFullYear(e.value.getFullYear(), e.value.getMonth(), e.value.getDate())
})
},
onContentReady: e => {
e.component.option("value", getEditorsDate())
}
}
}, dateItemOptions), (0, _extend.extend)(true, {
itemType: "simple",
colSpan: 1,
editorType: "dxDateBox",
validationRules: [{
type: "required"
}],
editorOptions: {
type: "time",
useMaskBehavior: true,
calendarOptions: {
firstDayOfWeek: this.scheduler.getFirstDayOfWeek()
},
onValueChanged: e => {
dateValueChanged(e, date => {
date.setHours(e.value.getHours(), e.value.getMinutes())
})
},
onContentReady: e => {
e.component.option("value", getEditorsDate())
}
}
}, timeItemOptions)]
}, (0, _extend.extend)(true, {
itemType: "simple",
colSpan: 2,
editorType: "dxSelectBox",
visible: allowTimeZoneEditing,
editorOptions: {
displayExpr: "title",
valueExpr: "id",
placeholder: _message.default.format("dxScheduler-noTimezoneTitle"),
searchEnabled: true,
dataSource: new _data.DataSource({
store: _m_utils_time_zone.default.getTimeZonesCache(),
paginate: true,
pageSize: 10
})
}
}, timezoneItemOptions)]
}, groupItemOptions)
}
createRepeatGroup() {
const {
recurrenceRuleExpr: recurrenceRuleExpr
} = this.scheduler.getDataAccessors().expr;
return {
name: "repeatGroup",
itemType: "group",
cssClass: `${CLASSES_repeatGroup} ${CLASSES_groupWithIcon}`,
items: [{
name: "repeatIcon",
colSpan: 1,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)("repeat")
}, {
name: "repeatEditor",
colSpan: 1,
itemType: "simple",
cssClass: CLASSES_repeatEditor,
label: {
text: _message.default.format("dxScheduler-editorLabelRecurrence")
},
editorType: "dxSelectBox",
editorOptions: {
items: (0, _localized_items.getRepeatSelectItems)(),
valueExpr: "value",
displayExpr: "text",
onContentReady: () => {
this.updateRepeatEditorValue()
},
onValueChanged: e => {
if (e.value === _localized_items.REPEAT_NEVER_VALUE) {
this.dxForm.updateData(recurrenceRuleExpr, "")
} else {
const currentRecurrenceRule = this.recurrenceForm.recurrenceRule.toString() ?? "";
const recurrenceRule = new _utils.RecurrenceRule(currentRecurrenceRule, this.startDate);
recurrenceRule.frequency = e.value;
this.dxForm.updateData(recurrenceRuleExpr, recurrenceRule.toString())
}
if (e.value !== _localized_items.REPEAT_NEVER_VALUE && e.event) {
this.showRecurrenceGroup()
}
e.component.option("buttons", this.getRepeatEditorButtons())
}
}
}]
}
}
createDescriptionGroup() {
const {
descriptionExpr: descriptionExpr
} = this.scheduler.getDataAccessors().expr;
return {
name: "descriptionGroup",
itemType: "group",
cssClass: `${CLASSES_descriptionGroup} ${CLASSES_groupWithIcon}`,
items: [{
name: "descriptionIcon",
colSpan: 1,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)("description")
}, {
name: "descriptionEditor",
dataField: descriptionExpr,
colSpan: 1,
itemType: "simple",
cssClass: CLASSES_descriptionEditor,
label: {
text: _message.default.format("dxScheduler-editorLabelDescription")
},
editorType: "dxTextArea",
editorOptions: {
minHeight: 100
}
}]
}
}
createResourcesGroup() {
const resourcesLoaders = Object.values(this.scheduler.getResourceById());
let resourcesItems = resourcesLoaders.map(resourceLoader => {
const {
dataSource: dataSource,
dataAccessor: dataAccessor
} = resourceLoader;
const dataField = resourceLoader.resourceIndex;
const name = `${dataField}Editor`;
const label = resourceLoader.resourceName ?? dataField;
const editorType = resourceLoader.allowMultiple ? "dxTagBox" : "dxSelectBox";
return {
itemType: "simple",
name: name,
dataField: dataField,
label: {
text: label
},
colSpan: 1,
editorType: editorType,
editorOptions: {
dataSource: dataSource,
displayExpr: dataAccessor.textExpr,
valueExpr: dataAccessor.idExpr
}
}
});
const noCustomResourceIcons = resourcesLoaders.every(resource => !resource.icon);
if (noCustomResourceIcons) {
return {
name: "resourcesGroup",
itemType: "group",
visible: resourcesItems.length > 0,
cssClass: `${CLASSES_resourcesGroup} ${CLASSES_groupWithIcon}`,
items: [{
name: "resourcesGroupIcon",
colSpan: 1,
cssClass: `${CLASSES_formIcon} ${CLASSES_defaultResourceIcon}`,
template: (0, _utils.createFormIconTemplate)("addcircleoutline")
}, {
name: "resourceEditorsGroup",
itemType: "group",
colSpan: 1,
items: resourcesItems
}]
}
}
resourcesItems = resourcesItems.map((item, index) => {
const icon = resourcesLoaders[index].icon ?? "";
const dataField = resourcesLoaders[index].resourceIndex;
return {
itemType: "group",
name: `${dataField}Group`,
cssClass: CLASSES_groupWithIcon,
items: [{
colSpan: 1,
name: `${dataField}Icon`,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)(icon)
}, item]
}
});
return {
name: "resourcesGroup",
itemType: "group",
colCount: 1,
colCountByScreen: {
xs: 1
},
cssClass: CLASSES_resourcesGroup,
items: resourcesItems
}
}
applyFormItemDefaults(item, showIcon) {
const itemClasses = (item.cssClass ?? "").split(" ");
const isIconItem = itemClasses.includes(CLASSES_formIcon);
if (isIconItem) {
item.visible = showIcon;
return
}
if ("simple" === item.itemType) {
const simpleItem = item;
const stylingMode = (0, _themes.isFluent)((0, _themes.current)()) ? "filled" : void 0;
simpleItem.editorOptions = (0, _extend.extend)(simpleItem.editorOptions, {
stylingMode: stylingMode
});
return
}
if ("group" === item.itemType) {
var _groupItem$items;
const groupItem = item;
if (itemClasses.includes(CLASSES_groupWithIcon)) {
const colCount = showIcon ? 2 : 1;
groupItem.colCount = colCount;
groupItem.colCountByScreen = {
xs: colCount
}
}
null === (_groupItem$items = groupItem.items) || void 0 === _groupItem$items || _groupItem$items.forEach(child => {
this.applyFormItemDefaults(child, showIcon)
})
}
}
alignIconsWithEditors() {
const $groups = this.dxForm.$element().find(`.${CLASSES_groupWithIcon}`);
$groups.toArray().forEach(groupElement => {
const iconElement = groupElement.querySelector(`.${CLASSES_formIcon}`);
const itemElements = groupElement.querySelectorAll(`.${CLASSES_formItem}`);
const firstSimpleItemElement = Array.from(itemElements).find(itemElement => {
const isGroup = null !== itemElement.querySelector(`.${CLASSES_formItem}`);
const isIcon = null !== itemElement.querySelector(`.${CLASSES_formIcon}`);
return !isGroup && !isIcon
});
if (!firstSimpleItemElement || !iconElement) {
return
}
const hasTopLabel = null !== firstSimpleItemElement.querySelector(`.${CLASSES_labelTop}`);
const hasInnerLabel = !hasTopLabel && null !== firstSimpleItemElement.querySelector(`.${CLASSES_label}`);
iconElement.classList.toggle(CLASSES_formIconTopLabelOffset, hasTopLabel);
iconElement.classList.toggle(CLASSES_formIconInnerLabelOffset, hasInnerLabel)
})
}
showMainGroup() {
var _editingConfig$popup;
const currentHeight = this.dxPopup.option("height");
const editingConfig = this.scheduler.getEditingConfig();
const configuredHeight = (null === editingConfig || void 0 === editingConfig || null === (_editingConfig$popup = editingConfig.popup) || void 0 === _editingConfig$popup ? void 0 : _editingConfig$popup.height) ?? "auto";
if ("number" === typeof currentHeight) {
this.dxPopup.option("height", configuredHeight)
}
if (this.$mainGroup) {
this.$mainGroup.removeClass(CLASSES_mainHidden);
this.$mainGroup.removeAttr("inert");
this.focusFirstFocusableInGroup(this.$mainGroup)
}
if (this.$recurrenceGroup) {
this.$recurrenceGroup.addClass(CLASSES_recurrenceHidden);
this.$recurrenceGroup.attr("inert", true)
}
this._popup.updateToolbarForMainGroup()
}
showRecurrenceGroup() {
const repeatEditor = this.dxForm.getEditor("repeatEditor");
if (repeatEditor instanceof _m_drop_down_editor.default) {
repeatEditor.close()
}
this.updateAnimationOffset();
const currentHeight = this.dxPopup.option("height");
if ("auto" === currentHeight || void 0 === currentHeight) {
const overlayHeight = this.dxPopup.$overlayContent().get(0).clientHeight;
this.dxPopup.option("height", overlayHeight)
}
if (this.$mainGroup) {
this.$mainGroup.addClass(CLASSES_mainHidden);
this.$mainGroup.attr("inert", true)
}
if (this.$recurrenceGroup) {
this.$recurrenceGroup.removeClass(CLASSES_recurrenceHidden);
this.$recurrenceGroup.removeAttr("inert");
this.focusFirstFocusableInGroup(this.$recurrenceGroup)
}
this._popup.updateToolbarForRecurrenceGroup()
}
saveRecurrenceValue() {
const {
recurrenceRule: recurrenceRule
} = this.recurrenceForm;
const {
recurrenceRuleExpr: recurrenceRuleExpr
} = this.scheduler.getDataAccessors().expr;
const recurrenceRuleSerialized = recurrenceRule.toString() ?? "";
this.dxForm.updateData(recurrenceRuleExpr, recurrenceRuleSerialized);
if (recurrenceRuleSerialized) {
var _this$dxForm$getEdito;
null === (_this$dxForm$getEdito = this.dxForm.getEditor("startDateEditor")) || void 0 === _this$dxForm$getEdito || _this$dxForm$getEdito.option("value", recurrenceRule.startDate)
}
}
async updateSubjectIconColor() {
const groupValues = (0, _appointment_groups_utils.getRawAppointmentGroupValues)(this.formData, this.resourceManager.resources);
const groupIndex = (0, _appointment_groups_utils.getAppointmentGroupIndex)((0, _appointment_groups_utils.getSafeGroupValues)(groupValues), this.resourceManager.groupsLeafs)[0];
const color = await this.resourceManager.getAppointmentColor({
itemData: this.formData,
groupIndex: groupIndex
});
const $icon = this.dxForm.$element().find(`.${CLASSES_subjectGroup} .${CLASSES_formIcon} .${CLASSES_icon}`);
$icon.css("color", color ?? "")
}
updateDateEditorsValues() {
const startDateEditor = this.dxForm.getEditor("startDateEditor");
const startTimeEditor = this.dxForm.getEditor("startTimeEditor");
const endDateEditor = this.dxForm.getEditor("endDateEditor");
const endTimeEditor = this.dxForm.getEditor("endTimeEditor");
null === startDateEditor || void 0 === startDateEditor || startDateEditor.option("value", this.startDate);
null === startTimeEditor || void 0 === startTimeEditor || startTimeEditor.option("value", this.startDate);
null === endDateEditor || void 0 === endDateEditor || endDateEditor.option("value", this.endDate);
null === endTimeEditor || void 0 === endTimeEditor || endTimeEditor.option("value", this.endDate)
}
updateRepeatEditorValue() {
const repeatEditor = this.dxForm.getEditor("repeatEditor");
if (!repeatEditor) {
return
}
if (null === this.recurrenceRuleRaw) {
repeatEditor.option("value", _localized_items.REPEAT_NEVER_VALUE)
} else {
const recurrenceRule = new _utils.RecurrenceRule(this.recurrenceRuleRaw, this.startDate);
const {
frequency: frequency
} = recurrenceRule;
const value = frequency ?? _localized_items.REPEAT_NEVER_VALUE;
repeatEditor.option("value", value)
}
}
getRepeatEditorButtons() {
const buttons = [];
const repeatEditor = this.dxForm.getEditor("repeatEditor");
const selectedValue = null === repeatEditor || void 0 === repeatEditor ? void 0 : repeatEditor.option("value");
if (selectedValue && "never" !== selectedValue) {
buttons.push({
location: "after",
name: "settings",
options: {
disabled: false,
icon: "optionsoutline",
stylingMode: "text",
onClick: () => {
this.showRecurrenceGroup()
},
elementAttr: {
class: `${CLASSES_recurrenceSettingsButton} dx-shape-standard`
}
}
})
}
buttons.push({
name: "dropDown"
});
return buttons
}
updateDateTimeEditorsVisibility() {
const {
allDayExpr: allDayExpr
} = this.scheduler.getDataAccessors().expr;
const visible = !this.getFormDataField(allDayExpr);
const startDateGroupPath = "mainGroup.dateGroup.dateOptionsGroup.startDateGroup.startDateTimeGroup";
const endDateGroupPath = "mainGroup.dateGroup.dateOptionsGroup.endDateGroup.endDateTimeGroup";
const startDateItemName = `${startDateGroupPath}.startDateEditor`;
const startTimeItemName = `${startDateGroupPath}.startTimeEditor`;
const endDateItemName = `${endDateGroupPath}.endDateEditor`;
const endTimeItemName = `${endDateGroupPath}.endTimeEditor`;
this.dxForm.beginUpdate();
this.dxForm.itemOption(startDateItemName, "colSpan", visible ? 1 : 2);
this.dxForm.itemOption(startTimeItemName, "visible", visible);
this.dxForm.itemOption(endDateItemName, "colSpan", visible ? 1 : 2);
this.dxForm.itemOption(endTimeItemName, "visible", visible);
this.dxForm.endUpdate()
}
updateAnimationOffset() {
if (!this.$mainGroup) {
return
}
const formElement = this.dxForm.$element()[0];
const mainGroupElement = this.$mainGroup[0];
const formRect = formElement.getBoundingClientRect();
const groupRect = mainGroupElement.getBoundingClientRect();
const topOffset = groupRect.top - formRect.top;
formElement.style.setProperty("--dx-scheduler-animation-top", `${topOffset}px`)
}
focusFirstFocusableInGroup($group) {
const focusTarget = $group.find(`.${CLASSES_fieldItemContent} [tabindex]`).first().get(0);
null === focusTarget || void 0 === focusTarget || focusTarget.focus({
preventScroll: true
})
}
}
},
27483(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentPopup = exports.APPOINTMENT_POPUP_CLASS = void 0;
var _visibility_change = __webpack_require__( /*! ../../../common/core/events/visibility_change */ 18029);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 3104);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 10720));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 52071);
var _m_loading = __webpack_require__( /*! ../m_loading */ 73922);
var _appointment_adapter = __webpack_require__( /*! ../utils/appointment_adapter/appointment_adapter */ 36791);
var _appointment_groups_utils = __webpack_require__( /*! ../utils/resource_manager/appointment_groups_utils */ 11649);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const APPOINTMENT_POPUP_CLASS = exports.APPOINTMENT_POPUP_CLASS = "dx-scheduler-appointment-popup";
exports.AppointmentPopup = class {
get popup() {
return this._popup
}
get visible() {
var _this$_popup;
return Boolean(null === (_this$_popup = this._popup) || void 0 === _this$_popup ? void 0 : _this$_popup.option("visible"))
}
constructor(scheduler, form) {
this.config = {
onSave: () => Promise.resolve(),
title: "",
readOnly: false
};
this.scheduler = scheduler;
this.form = form;
this.state = {
saveChangesLocker: false,
appointment: {
data: null
}
}
}
show(appointment, config) {
this.state.appointment.data = appointment;
this.config = config;
this.disposePopup();
const popupConfig = this.createPopupConfig();
this.createPopup(popupConfig);
this._popup.show()
}
hide() {
var _this$_popup2;
null === (_this$_popup2 = this._popup) || void 0 === _this$_popup2 || _this$_popup2.hide()
}
dispose() {
this.disposePopup()
}
disposePopup() {
if (this._popup) {
const $element = this._popup.$element();
this.form.dispose();
this._popup.dispose();
$element.remove();
this._popup = void 0
}
}
createPopup(options) {
const popupElement = (0, _renderer.default)(" ").addClass(APPOINTMENT_POPUP_CLASS).appendTo(this.scheduler.getElement());
this.scheduler.createComponent(popupElement, _ui.default, options)
}
createPopupConfig() {
const editingConfig = this.scheduler.getEditingConfig();
const customPopupOptions = (null === editingConfig || void 0 === editingConfig ? void 0 : editingConfig.popup) ?? {};
this.customPopupOptions = customPopupOptions;
const defaultPopupConfig = {
height: "auto",
maxHeight: "90%",
showCloseButton: false,
showTitle: false,
preventScrollEvents: false,
enableBodyScroll: false,
_ignorePreventScrollEventsDeprecation: true,
onInitialized: e => {
var _customPopupOptions$o;
this._popup = e.component;
null === customPopupOptions || void 0 === customPopupOptions || null === (_customPopupOptions$o = customPopupOptions.onInitialized) || void 0 === _customPopupOptions$o || _customPopupOptions$o.call(customPopupOptions, e)
},
onHiding: e => {
var _customPopupOptions$o2;
this.scheduler.focus();
null === customPopupOptions || void 0 === customPopupOptions || null === (_customPopupOptions$o2 = customPopupOptions.onHiding) || void 0 === _customPopupOptions$o2 || _customPopupOptions$o2.call(customPopupOptions, e)
},
contentTemplate: () => {
this.form.create({
dxPopup: this.popup,
updateToolbarForMainGroup: () => this.updateToolbarForMainGroup(),
updateToolbarForRecurrenceGroup: () => this.updateToolbarForRecurrenceGroup()
});
return this.form.dxForm.$element()
},
onShowing: e => {
var _customPopupOptions$o3;
this.onShowing(e);
null === customPopupOptions || void 0 === customPopupOptions || null === (_customPopupOptions$o3 = customPopupOptions.onShowing) || void 0 === _customPopupOptions$o3 || _customPopupOptions$o3.call(customPopupOptions, e)
},
wrapperAttr: {
class: APPOINTMENT_POPUP_CLASS
}
};
return (0, _extend.extend)(true, {}, defaultPopupConfig, customPopupOptions, {
onInitialized: defaultPopupConfig.onInitialized,
onHiding: defaultPopupConfig.onHiding,
onShowing: defaultPopupConfig.onShowing
})
}
onShowing(e) {
this.updateForm();
e.component.$overlayContent().attr("aria-label", _message.default.format("dxScheduler-ariaEditForm"));
const arg = {
form: this.form.dxForm,
popup: this.popup,
appointmentData: this.state.appointment.data,
cancel: false
};
this.scheduler.getAppointmentFormOpening()(arg);
this.scheduler.processActionResult(arg, canceled => {
if (canceled) {
e.cancel = true
} else {
this.updatePopupFullScreenMode()
}
})
}
createAppointmentAdapter(rawAppointment) {
return new _appointment_adapter.AppointmentAdapter(rawAppointment, this.scheduler.getDataAccessors())
}
updateForm() {
const rawAppointment = this.state.appointment.data;
const appointmentAdapter = this.createAppointmentAdapter(rawAppointment).clone().calculateDates(this.scheduler.getTimeZoneCalculator(), "toAppointment");
const formData = this.createFormData(appointmentAdapter);
this.form.readOnly = this.config.readOnly;
this.form.formData = formData;
this.form.showMainGroup()
}
createFormData(appointmentAdapter) {
const {
resources: resources
} = this.scheduler.getResourceManager();
const groupValues = (0, _appointment_groups_utils.getRawAppointmentGroupValues)(appointmentAdapter.source, resources);
const {
allDayExpr: allDayExpr,
recurrenceRuleExpr: recurrenceRuleExpr
} = this.scheduler.getDataAccessors().expr;
return Object.assign({}, appointmentAdapter.source, groupValues, {
[allDayExpr]: Boolean(appointmentAdapter.allDay),
[recurrenceRuleExpr]: appointmentAdapter.recurrenceRule
})
}
triggerResize() {
var _this$popup;
if (null !== (_this$popup = this.popup) && void 0 !== _this$popup && _this$popup.$element()) {
(0, _visibility_change.triggerResizeEvent)(this.popup.$element())
}
}
getMaxWidth() {
var _this$customPopupOpti, _this$customPopupOpti2;
if (void 0 !== (null === (_this$customPopupOpti = this.customPopupOptions) || void 0 === _this$customPopupOpti ? void 0 : _this$customPopupOpti.maxWidth)) {
return this.customPopupOptions.maxWidth
}
if (void 0 !== (null === (_this$customPopupOpti2 = this.customPopupOptions) || void 0 === _this$customPopupOpti2 ? void 0 : _this$customPopupOpti2.width)) {
return this.customPopupOptions.width
}
return (0, _themes.isFluent)((0, _themes.current)()) ? 380 : 420
}
updatePopupFullScreenMode() {
if (this.visible) {
var _this$customPopupOpti3;
const isPopupFullScreenNeeded = () => {
const window = (0, _window.getWindow)();
const width = window && (0, _size.getWidth)(window);
return width < 485
};
const isFullScreen = isPopupFullScreenNeeded();
this.popup.option("fullScreen", isFullScreen);
if (void 0 !== (null === (_this$customPopupOpti3 = this.customPopupOptions) || void 0 === _this$customPopupOpti3 ? void 0 : _this$customPopupOpti3.width)) {
this.popup.option("width", this.customPopupOptions.width)
}
const maxWidth = this.getMaxWidth();
this.popup.option("maxWidth", isFullScreen ? "100%" : maxWidth)
}
}
saveChangesAsync(isShowLoadPanel) {
this.form.saveRecurrenceValue();
const deferred = new _deferred.Deferred;
const validation = this.form.dxForm.validate();
isShowLoadPanel && this.showLoadPanel();
(0, _deferred.when)((null === validation || void 0 === validation ? void 0 : validation.complete) ?? validation).done(validation => {
if (validation && !validation.isValid) {
(0, _m_loading.hide)();
deferred.resolve(false);
return
}
const adapter = this.createAppointmentAdapter(this.form.formData);
const clonedAdapter = adapter.clone().calculateDates(this.scheduler.getTimeZoneCalculator(), "fromAppointment");
this.addMissingDSTTime(adapter, clonedAdapter);
const appointment = clonedAdapter.source;
(0, _deferred.when)(this.config.onSave(appointment)).done(deferred.resolve);
deferred.done(() => {
(0, _m_loading.hide)()
})
});
return deferred.promise()
}
saveButtonClickHandler(e) {
e.cancel = true;
this.saveEditDataAsync()
}
saveEditDataAsync() {
const deferred = new _deferred.Deferred;
if (this.tryLockSaveChanges()) {
(0, _deferred.when)(this.saveChangesAsync(true)).done(() => {
this.unlockSaveChanges();
deferred.resolve()
})
}
return deferred.promise()
}
showLoadPanel() {
const container = this.popup.$overlayContent();
(0, _m_loading.show)({
container: container,
position: {
of: container
}
})
}
tryLockSaveChanges() {
if (false === this.state.saveChangesLocker) {
this.state.saveChangesLocker = true;
return true
}
return false
}
unlockSaveChanges() {
this.state.saveChangesLocker = false
}
addMissingDSTTime(formAppointmentAdapter, clonedAppointmentAdapter) {
const timeZoneCalculator = this.scheduler.getTimeZoneCalculator();
clonedAppointmentAdapter.startDate = this.addMissingDSTShiftToDate(timeZoneCalculator, formAppointmentAdapter.startDate, clonedAppointmentAdapter.startDate);
if (clonedAppointmentAdapter.endDate) {
clonedAppointmentAdapter.endDate = this.addMissingDSTShiftToDate(timeZoneCalculator, formAppointmentAdapter.endDate, clonedAppointmentAdapter.endDate)
}
}
addMissingDSTShiftToDate(timeZoneCalculator, originFormDate, clonedDate) {
var _timeZoneCalculator$g, _timeZoneCalculator$g2;
const originTimezoneShift = null === (_timeZoneCalculator$g = timeZoneCalculator.getOffsets(originFormDate)) || void 0 === _timeZoneCalculator$g ? void 0 : _timeZoneCalculator$g.common;
const clonedTimezoneShift = null === (_timeZoneCalculator$g2 = timeZoneCalculator.getOffsets(clonedDate)) || void 0 === _timeZoneCalculator$g2 ? void 0 : _timeZoneCalculator$g2.common;
const shiftDifference = originTimezoneShift - clonedTimezoneShift;
return shiftDifference ? new Date(clonedDate.getTime() + shiftDifference * _date.default.dateToMilliseconds("hour")) : clonedDate
}
tryApplyCustomToolbarItems() {
var _this$customPopupOpti4;
if (null !== (_this$customPopupOpti4 = this.customPopupOptions) && void 0 !== _this$customPopupOpti4 && _this$customPopupOpti4.toolbarItems) {
this.popup.option("toolbarItems", this.customPopupOptions.toolbarItems);
return true
}
return false
}
updateToolbarForMainGroup() {
if (this.tryApplyCustomToolbarItems()) {
return
}
const toolbarItems = [{
toolbar: "top",
location: "before",
text: this.config.title,
cssClass: "dx-toolbar-label"
}];
const canSave = !this.form.readOnly;
if (canSave) {
toolbarItems.push({
toolbar: "top",
location: "after",
options: {
onClick: e => this.saveButtonClickHandler(e),
stylingMode: "contained",
type: "default",
text: _message.default.format("dxScheduler-editPopupSaveButtonText")
},
shortcut: "done"
})
}
toolbarItems.push({
toolbar: "top",
location: "after",
shortcut: "cancel",
options: {
stylingMode: "outlined"
}
});
this.popup.option("toolbarItems", toolbarItems)
}
updateToolbarForRecurrenceGroup() {
if (this.tryApplyCustomToolbarItems()) {
return
}
const toolbarItems = [{
toolbar: "top",
location: "before",
widget: "dxButton",
options: {
icon: "arrowleft",
stylingMode: "text",
elementAttr: {
"aria-label": _message.default.format("Back")
},
onClick: () => {
this.form.saveRecurrenceValue();
this.form.showMainGroup()
}
}
}, {
toolbar: "top",
location: "before",
text: _message.default.format("dxScheduler-editorLabelRecurrence"),
cssClass: "dx-toolbar-label"
}];
const canSave = !this.form.readOnly;
if (canSave) {
toolbarItems.push({
toolbar: "top",
location: "after",
options: {
onClick: e => this.saveButtonClickHandler(e),
stylingMode: "contained",
type: "default",
text: _message.default.format("dxScheduler-editPopupSaveButtonText")
},
shortcut: "done"
})
}
toolbarItems.push({
toolbar: "top",
location: "after",
shortcut: "cancel",
options: {
stylingMode: "outlined"
}
});
this.popup.option("toolbarItems", toolbarItems)
}
}
},
58452(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RecurrenceForm = void 0;
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 64973));
var _localized_items = __webpack_require__( /*! ./localized_items */ 77575);
var _utils = __webpack_require__( /*! ./utils */ 63512);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const CLASSES_groupWithIcon = "dx-scheduler-form-group-with-icon",
CLASSES_formIcon = "dx-scheduler-form-icon",
CLASSES_recurrenceGroup = "dx-scheduler-form-recurrence-group",
CLASSES_recurrenceHidden = "dx-scheduler-form-recurrence-group-hidden",
CLASSES_recurrenceStartDateEditor = "dx-scheduler-form-recurrence-start-date-editor",
CLASSES_frequencyEditor = "dx-scheduler-form-recurrence-frequency-editor",
CLASSES_byMonthEditor = "dx-scheduler-form-recurrence-by-month-editor",
CLASSES_dayOfMonthEditor = "dx-scheduler-form-day-of-month-editor",
CLASSES_countEditor = "dx-scheduler-form-recurrence-count-editor",
CLASSES_daysOfWeekButtons = "dx-scheduler-days-of-week-buttons",
CLASSES_dayOfMonthGroup = "dx-scheduler-form-day-of-month-group",
CLASSES_dayOfYearGroup = "dx-scheduler-form-day-of-year-group",
CLASSES_recurrenceEndGroup = "dx-scheduler-form-recurrence-end-group",
CLASSES_recurrenceEndEditors = "dx-scheduler-form-recurrence-end-editors",
CLASSES_recurrenceSettingsGroup = "dx-scheduler-form-recurrence-settings-group";
const FREQ_WEEKLY = "weekly",
FREQ_MONTHLY = "monthly",
FREQ_YEARLY = "yearly";
const EDITOR_NAMES_recurrenceStartDateEditor = "recurrenceStartDateEditor",
EDITOR_NAMES_recurrenceCountEditor = "recurrenceCountEditor",
EDITOR_NAMES_recurrencePeriodEditor = "recurrencePeriodEditor",
EDITOR_NAMES_recurrenceDayOfYearMonthEditor = "recurrenceDayOfYearMonthEditor",
EDITOR_NAMES_recurrenceDayOfMonthEditor = "recurrenceDayOfMonthEditor",
EDITOR_NAMES_recurrenceDayOfYearDayEditor = "recurrenceDayOfYearDayEditor",
EDITOR_NAMES_recurrenceEndEditor = "recurrenceEndEditor",
EDITOR_NAMES_recurrenceRepeatEndEditor = "recurrenceRepeatEndEditor",
EDITOR_NAMES_recurrenceEndUntilEditor = "recurrenceEndUntilEditor",
EDITOR_NAMES_recurrenceEndCountEditor = "recurrenceEndCountEditor",
EDITOR_NAMES_recurrenceEndSpacer = "recurrenceEndSpacer";
const GROUP_NAMES_recurrenceStartDateGroup = "recurrenceStartDateGroup",
GROUP_NAMES_recurrenceRuleGroup = "recurrenceRuleGroup",
GROUP_NAMES_recurrencePatternGroup = "recurrencePatternGroup",
GROUP_NAMES_recurrenceRuleRepeatGroup = "recurrenceRuleRepeatGroup",
GROUP_NAMES_recurrenceEndGroup = "recurrenceEndGroup",
GROUP_NAMES_recurrenceDaysOfWeekEditor = "recurrenceDaysOfWeekEditor",
GROUP_NAMES_recurrenceDayOfYearGroup = "recurrenceDayOfYearGroup",
GROUP_NAMES_recurrenceEndEditorsGroup = "recurrenceEndEditorsGroup";
const ICON_NAMES_recurrenceStartDateIcon = "recurrenceStartDateIcon",
ICON_NAMES_recurrenceRuleIcon = "recurrenceRuleIcon",
ICON_NAMES_recurrenceEndIcon = "recurrenceEndIcon";
exports.RecurrenceForm = class {
constructor(scheduler) {
this.recurrenceRule = new _utils.RecurrenceRule("", new Date);
this.weekDayButtons = {};
this.readOnly = false;
this.scheduler = scheduler
}
createByMonthDayNumberBoxItem(name, labelVisible) {
return {
itemType: "simple",
name: name,
colSpan: 1,
editorType: "dxNumberBox",
cssClass: CLASSES_dayOfMonthEditor,
label: labelVisible ? {
text: _message.default.format("dxScheduler-recurrenceRepeatOn")
} : {
visible: false
},
editorOptions: Object.assign({}, labelVisible ? {} : {
labelMode: "hidden"
}, {
min: 1,
max: 31,
format: "#",
showSpinButtons: true,
useLargeSpinButtons: false,
onContentReady: e => {
e.component.option("value", this.recurrenceRule.byMonthDay ?? void 0)
},
onValueChanged: e => {
this.recurrenceRule.byMonthDay = e.value
}
})
}
}
get dxForm() {
return this.dxFormInstance
}
set dxForm(value) {
this.dxFormInstance = value
}
setReadOnly(value) {
this.readOnly = value
}
createRecurrenceFormGroup() {
return {
name: "recurrenceGroup",
itemType: "group",
cssClass: `${CLASSES_recurrenceGroup} ${CLASSES_recurrenceHidden}`,
colSpan: 1,
items: [this.createRecurrenceStartDateGroup(), this.createRecurrenceSettingsGroup(), this.createRecurrenceEndGroup()]
}
}
createRecurrenceStartDateGroup() {
return {
name: GROUP_NAMES_recurrenceStartDateGroup,
itemType: "group",
cssClass: CLASSES_groupWithIcon,
items: [{
name: ICON_NAMES_recurrenceStartDateIcon,
colSpan: 1,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)("clock")
}, (0, _extend.extend)(true, (0, _utils.getStartDateCommonConfig)(this.scheduler.getFirstDayOfWeek()), {
name: EDITOR_NAMES_recurrenceStartDateEditor,
cssClass: CLASSES_recurrenceStartDateEditor,
label: {
text: _message.default.format("dxScheduler-editorLabelStartDate")
},
editorOptions: {
onContentReady: e => {
e.component.option("value", this.recurrenceRule.startDate)
},
onValueChanged: e => {
this.recurrenceRule.startDate = e.value
}
}
})]
}
}
createRecurrenceSettingsGroup() {
return {
itemType: "group",
name: GROUP_NAMES_recurrenceRuleGroup,
cssClass: `${CLASSES_recurrenceSettingsGroup} ${CLASSES_groupWithIcon}`,
items: [{
name: ICON_NAMES_recurrenceRuleIcon,
colSpan: 1,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)("repeat")
}, {
itemType: "group",
name: GROUP_NAMES_recurrencePatternGroup,
colSpan: 1,
colCount: 1,
colCountByScreen: {
xs: 1
},
items: [this.createRecurrenceRuleGroup(), this.createDaysOfWeekGroup(), this.createDayOfMonthGroup(), this.createDayOfYearGroup()]
}]
}
}
createRecurrenceRuleGroup() {
let needRestoreFrequencyEditorFocus = false;
return {
itemType: "group",
name: GROUP_NAMES_recurrenceRuleRepeatGroup,
colSpan: 1,
colCount: 2,
colCountByScreen: {
xs: 2
},
items: [{
itemType: "simple",
name: EDITOR_NAMES_recurrenceCountEditor,
colSpan: 1,
editorType: "dxNumberBox",
label: {
text: _message.default.format("dxScheduler-recurrenceRepeatEvery")
},
editorOptions: {
format: "#",
min: 1,
showSpinButtons: true,
useLargeSpinButtons: false,
onContentReady: e => {
e.component.option("value", this.recurrenceRule.interval)
},
onValueChanged: e => {
this.recurrenceRule.interval = e.value
}
}
}, {
itemType: "simple",
name: EDITOR_NAMES_recurrencePeriodEditor,
cssClass: CLASSES_frequencyEditor,
colSpan: 1,
editorType: "dxSelectBox",
label: {
visible: false
},
editorOptions: {
labelMode: "hidden",
items: (0, _localized_items.getRecurrenceFrequencyItems)(),
valueExpr: "value",
displayExpr: "text",
onContentReady: e => {
e.component.option("value", this.recurrenceRule.frequency);
if (needRestoreFrequencyEditorFocus) {
setTimeout(() => {
e.component.focus();
needRestoreFrequencyEditorFocus = false
})
}
},
onValueChanged: e => {
const previousValue = this.recurrenceRule.frequency;
if (previousValue === e.value) {
return
}
if (e.event) {
needRestoreFrequencyEditorFocus = true
}
this.recurrenceRule.frequency = e.value;
this.updateDayEditorsVisibility()
}
}
}]
}
}
createDaysOfWeekGroup() {
return {
name: GROUP_NAMES_recurrenceDaysOfWeekEditor,
colSpan: 1,
cssClass: "dx-field-item-has-group",
label: {
visible: false
},
template: () => {
const $container = (0, _renderer.default)(" ").addClass(CLASSES_daysOfWeekButtons);
const weekDayItems = (0, _localized_items.getRecurrenceWeekDayItems)(this.scheduler.getFirstDayOfWeek());
weekDayItems.forEach(item => {
var _this$weekDayButtons$;
const buttonContainer = (0, _renderer.default)(" ").appendTo($container);
null === (_this$weekDayButtons$ = this.weekDayButtons[item.key]) || void 0 === _this$weekDayButtons$ || _this$weekDayButtons$.dispose();
this.weekDayButtons[item.key] = this.scheduler.createComponent(buttonContainer, _button.default, {
text: item.text,
disabled: this.readOnly,
onContentReady: e => {
(0, _renderer.default)(e.element).removeClass("dx-button-has-text");
const isSelected = this.recurrenceRule.byDay.includes(item.key);
e.component.option("stylingMode", isSelected ? "contained" : "outlined");
e.component.option("type", isSelected ? "default" : "normal")
},
onClick: e => {
const isSelected = this.recurrenceRule.byDay.includes(item.key);
if (isSelected) {
const index = this.recurrenceRule.byDay.indexOf(item.key);
this.recurrenceRule.byDay.splice(index, 1);
e.component.option("stylingMode", "outlined");
e.component.option("type", "normal")
} else {
this.recurrenceRule.byDay.push(item.key);
e.component.option("stylingMode", "contained");
e.component.option("type", "default")
}
}
})
});
return $container
}
}
}
createDayOfMonthGroup() {
return Object.assign({}, this.createByMonthDayNumberBoxItem(EDITOR_NAMES_recurrenceDayOfMonthEditor, true), {
cssClass: `${CLASSES_dayOfMonthEditor} ${CLASSES_dayOfMonthGroup}`
})
}
createDayOfYearGroup() {
return {
itemType: "group",
name: GROUP_NAMES_recurrenceDayOfYearGroup,
cssClass: CLASSES_dayOfYearGroup,
colCount: 2,
colCountByScreen: {
xs: 2
},
items: [{
itemType: "simple",
name: EDITOR_NAMES_recurrenceDayOfYearMonthEditor,
colSpan: 1,
cssClass: CLASSES_byMonthEditor,
editorType: "dxSelectBox",
label: {
text: _message.default.format("dxScheduler-recurrenceRepeatEvery")
},
editorOptions: {
items: (0, _localized_items.getRecurrenceMonthItems)(),
displayExpr: "text",
valueExpr: "value",
onContentReady: e => {
e.component.option("value", this.recurrenceRule.byMonth)
},
onValueChanged: e => {
this.recurrenceRule.byMonth = e.value
}
}
}, this.createByMonthDayNumberBoxItem(EDITOR_NAMES_recurrenceDayOfYearDayEditor, false)]
}
}
createRecurrenceEndGroup() {
return {
name: GROUP_NAMES_recurrenceEndGroup,
itemType: "group",
cssClass: `${CLASSES_groupWithIcon} ${CLASSES_recurrenceEndGroup}`,
items: [{
name: ICON_NAMES_recurrenceEndIcon,
colSpan: 1,
cssClass: CLASSES_formIcon,
template: (0, _utils.createFormIconTemplate)("description")
}, {
itemType: "group",
name: EDITOR_NAMES_recurrenceEndEditor,
colSpan: 1,
colCount: 2,
colCountByScreen: {
xs: 2
},
label: {
text: _message.default.format("dxScheduler-recurrenceEnd")
},
items: [this.createRecurrenceEndRadioGroup(), this.createRecurrenceEndEditors()]
}]
}
}
createRecurrenceEndRadioGroup() {
return {
itemType: "simple",
name: EDITOR_NAMES_recurrenceRepeatEndEditor,
colSpan: 1,
editorType: "dxRadioGroup",
label: {
visible: false
},
editorOptions: {
labelMode: "hidden",
valueExpr: "type",
items: [{
text: _message.default.format("dxScheduler-recurrenceNever"),
type: "never"
}, {
text: _message.default.format("dxScheduler-recurrenceOn"),
type: "until"
}, {
text: _message.default.format("dxScheduler-recurrenceAfter"),
type: "count"
}],
layout: "vertical",
onContentReady: e => {
e.component.option("value", this.recurrenceRule.repeatEnd)
},
onValueChanged: e => {
this.recurrenceRule.repeatEnd = e.value;
this.updateRepeatEndEditors()
}
}
}
}
createRecurrenceEndEditors() {
return {
itemType: "group",
name: GROUP_NAMES_recurrenceEndEditorsGroup,
cssClass: CLASSES_recurrenceEndEditors,
colSpan: 1,
items: [{
itemType: "empty",
name: EDITOR_NAMES_recurrenceEndSpacer
}, {
itemType: "simple",
name: EDITOR_NAMES_recurrenceEndUntilEditor,
label: {
visible: false
},
editorType: "dxDateBox",
editorOptions: {
labelMode: "hidden",
type: "date",
useMaskBehavior: true,
calendarOptions: {
firstDayOfWeek: this.scheduler.getFirstDayOfWeek()
},
inputAttr: {
"aria-label": _message.default.format("dxScheduler-recurrenceUntilDateLabel")
},
onContentReady: e => {
const repeatEndValue = this.recurrenceRule.repeatEnd;
e.component.option("value", this.recurrenceRule.until);
e.component.option("disabled", "until" !== repeatEndValue)
},
onValueChanged: e => {
this.recurrenceRule.until = e.value
}
}
}, {
itemType: "simple",
name: EDITOR_NAMES_recurrenceEndCountEditor,
cssClass: CLASSES_countEditor,
label: {
visible: false
},
editorType: "dxNumberBox",
editorOptions: {
labelMode: "hidden",
format: `# ${_message.default.format("dxScheduler-recurrenceRepeatCount")}`,
min: 1,
showSpinButtons: true,
useLargeSpinButtons: false,
inputAttr: {
"aria-label": _message.default.format("dxScheduler-recurrenceOccurrenceLabel")
},
onContentReady: e => {
const repeatEndValue = this.recurrenceRule.repeatEnd;
e.component.option("value", this.recurrenceRule.count ?? void 0);
e.component.option("disabled", "count" !== repeatEndValue)
},
onValueChanged: e => {
this.recurrenceRule.count = e.value
}
}
}]
}
}
updateRecurrenceFormValues(recurrenceRuleRaw, startDate) {
var _this$dxForm$getEdito, _this$dxForm$getEdito2, _this$dxForm$getEdito3, _this$dxForm$getEdito4, _this$dxForm$getEdito5, _this$dxForm$getEdito6;
this.recurrenceRule = this.createRecurrenceRule(recurrenceRuleRaw, startDate);
null === (_this$dxForm$getEdito = this.dxForm.getEditor(EDITOR_NAMES_recurrenceStartDateEditor)) || void 0 === _this$dxForm$getEdito || _this$dxForm$getEdito.option("value", this.recurrenceRule.startDate);
null === (_this$dxForm$getEdito2 = this.dxForm.getEditor(EDITOR_NAMES_recurrencePeriodEditor)) || void 0 === _this$dxForm$getEdito2 || _this$dxForm$getEdito2.option("value", this.recurrenceRule.frequency);
null === (_this$dxForm$getEdito3 = this.dxForm.getEditor(EDITOR_NAMES_recurrenceCountEditor)) || void 0 === _this$dxForm$getEdito3 || _this$dxForm$getEdito3.option("value", this.recurrenceRule.interval);
null === (_this$dxForm$getEdito4 = this.dxForm.getEditor(EDITOR_NAMES_recurrenceRepeatEndEditor)) || void 0 === _this$dxForm$getEdito4 || _this$dxForm$getEdito4.option("value", this.recurrenceRule.repeatEnd);
null === (_this$dxForm$getEdito5 = this.dxForm.getEditor(EDITOR_NAMES_recurrenceEndUntilEditor)) || void 0 === _this$dxForm$getEdito5 || _this$dxForm$getEdito5.option("value", this.recurrenceRule.until);
null === (_this$dxForm$getEdito6 = this.dxForm.getEditor(EDITOR_NAMES_recurrenceEndCountEditor)) || void 0 === _this$dxForm$getEdito6 || _this$dxForm$getEdito6.option("value", this.recurrenceRule.count);
this.updateRepeatEndEditors();
this.updateDayEditorsVisibility()
}
createRecurrenceRule(recurrenceRuleRaw, startDate) {
const recurrenceRule = new _utils.RecurrenceRule(recurrenceRuleRaw ?? "", startDate);
if (0 === recurrenceRule.byDay.length) {
const defaultByDay = [_localized_items.ICAL_WEEK_DAYS[(null === startDate || void 0 === startDate ? void 0 : startDate.getDay()) ?? this.scheduler.getFirstDayOfWeek()]];
recurrenceRule.byDay = defaultByDay
}
return recurrenceRule
}
updateRepeatEndEditors() {
const repeatEndValue = this.recurrenceRule.repeatEnd;
const untilEditor = this.dxForm.getEditor(EDITOR_NAMES_recurrenceEndUntilEditor);
const countEditor = this.dxForm.getEditor(EDITOR_NAMES_recurrenceEndCountEditor);
null === untilEditor || void 0 === untilEditor || untilEditor.option("disabled", "until" !== repeatEndValue);
null === countEditor || void 0 === countEditor || countEditor.option("disabled", "count" !== repeatEndValue)
}
updateDayEditorsVisibility() {
const recurrencePatternGroupPath = `recurrenceGroup.${GROUP_NAMES_recurrenceRuleGroup}.${GROUP_NAMES_recurrencePatternGroup}`;
const daysOfWeekGroup = `${recurrencePatternGroupPath}.${GROUP_NAMES_recurrenceDaysOfWeekEditor}`;
const dayOfMonthGroup = `${recurrencePatternGroupPath}.${EDITOR_NAMES_recurrenceDayOfMonthEditor}`;
const dayOfYearGroup = `${recurrencePatternGroupPath}.${GROUP_NAMES_recurrenceDayOfYearGroup}`;
this.dxForm.beginUpdate();
this.dxForm.itemOption(daysOfWeekGroup, "visible", false);
this.dxForm.itemOption(dayOfMonthGroup, "visible", false);
this.dxForm.itemOption(dayOfYearGroup, "visible", false);
switch (this.recurrenceRule.frequency) {
case FREQ_WEEKLY:
this.dxForm.itemOption(daysOfWeekGroup, "visible", true);
break;
case FREQ_MONTHLY:
this.dxForm.itemOption(dayOfMonthGroup, "visible", true);
break;
case FREQ_YEARLY:
this.dxForm.itemOption(dayOfYearGroup, "visible", true)
}
this.dxForm.endUpdate()
}
}
},
63512(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getStartDateCommonConfig = exports.createFormIconTemplate = exports.RecurrenceRule = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _m_icon = __webpack_require__( /*! ../../core/utils/m_icon */ 42463);
var _base = __webpack_require__( /*! ../recurrence/base */ 57872);
var _days_from_by_day_rule = __webpack_require__( /*! ../recurrence/days_from_by_day_rule */ 2165);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.createFormIconTemplate = iconName => () => (0, _m_icon.getImageContainer)(iconName) ?? (0, _renderer.default)(" ").addClass("dx-scheduler-form-icon-sized-gap");
exports.getStartDateCommonConfig = firstDayOfWeek => ({
colSpan: 1,
itemType: "simple",
editorType: "dxDateBox",
validationRules: [{
type: "required"
}],
editorOptions: {
type: "date",
useMaskBehavior: true,
calendarOptions: {
firstDayOfWeek: firstDayOfWeek,
showTodayButton: true
}
}
});
exports.RecurrenceRule = class {
constructor(rule, startDate) {
var _recurrenceRule$freq, _this$startDate;
this.startDate = null;
this.frequency = null;
const recurrenceRule = (0, _base.parseRecurrenceRule)(rule);
const todayEnd = _date.default.setToDayEnd(new Date);
this.startDate = startDate;
this.frequency = (null === (_recurrenceRule$freq = recurrenceRule.freq) || void 0 === _recurrenceRule$freq ? void 0 : _recurrenceRule$freq.toLowerCase()) ?? null;
this.interval = recurrenceRule.interval ?? 1;
this.until = recurrenceRule.until ?? todayEnd;
this.count = recurrenceRule.count ?? 1;
this.byDay = (0, _days_from_by_day_rule.daysFromByDayRule)(recurrenceRule);
this.byMonthDay = recurrenceRule.bymonthday ? Number(recurrenceRule.bymonthday) : (null === startDate || void 0 === startDate ? void 0 : startDate.getDate()) ?? 1;
this.byMonth = recurrenceRule.bymonth ? Number(recurrenceRule.bymonth) : ((null === (_this$startDate = this.startDate) || void 0 === _this$startDate ? void 0 : _this$startDate.getMonth()) ?? 0) + 1;
this.repeatEnd = "never";
if ((0, _type.isDefined)(recurrenceRule.count)) {
this.repeatEnd = "count"
} else if ((0, _type.isDefined)(recurrenceRule.until)) {
this.repeatEnd = "until"
}
}
toString() {
if (!this.frequency) {
return
}
const rule = {
freq: this.frequency,
interval: this.interval
};
if ("until" === this.repeatEnd && this.until) {
rule.until = this.until
} else if ("count" === this.repeatEnd && this.count) {
rule.count = this.count
}
switch (this.frequency) {
case "weekly":
rule.byday = this.byDay.join(",");
break;
case "monthly":
if (this.byMonthDay) {
rule.bymonthday = String(this.byMonthDay)
}
break;
case "yearly":
if (this.byMonthDay && this.byMonth) {
rule.bymonthday = String(this.byMonthDay);
rule.bymonth = String(this.byMonth)
}
}
return (0, _base.getRecurrenceString)(rule)
}
}
},
12901(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AgendaAppointment = void 0;
var _renderer = (e = __webpack_require__( /*! ../../../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
var _m_classes = __webpack_require__( /*! ../../m_classes */ 80126);
var _m_appointment = __webpack_require__( /*! ./m_appointment */ 198);
class AgendaAppointment extends _m_appointment.Appointment {
get coloredElement() {
return this.$element().find(`.${_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_MARKER}`)
}
_renderResourceList() {
const resourceManager = this.option("getResourceManager")();
void resourceManager.getAppointmentResourcesValues(this.rawAppointment).then(list => {
const parent = this.$element().find(`.${_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS}`);
const container = (0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_RESOURCE_LIST).appendTo(parent);
list.forEach(item => {
const itemContainer = (0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_RESOURCE_LIST_ITEM).appendTo(container);
(0, _renderer.default)(" ").text(`${item.label}:`).appendTo(itemContainer);
(0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_RESOURCE_LIST_ITEM_VALUE).text(item.values.join(", ")).appendTo(itemContainer)
})
})
}
_render() {
super._render();
this._renderResourceList()
}
}
exports.AgendaAppointment = AgendaAppointment
},
198(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Appointment = void 0;
var _translator = __webpack_require__( /*! ../../../../common/core/animation/translator */ 88603);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/events/core/events_engine */ 92774));
var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/events/pointer */ 89797));
var _index = __webpack_require__( /*! ../../../../common/core/events/utils/index */ 98834);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../../core/component_registrator */ 92848));
var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_component */ 97832));
var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../../core/guid */ 19427));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 64553));
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _resizable = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/resizable */ 28416));
var _m_tooltip = __webpack_require__( /*! ../../../ui/tooltip/m_tooltip */ 33476);
var _m_classes = __webpack_require__( /*! ../../m_classes */ 80126);
var _validate_rule = __webpack_require__( /*! ../../recurrence/validate_rule */ 25152);
var _text_utils = __webpack_require__( /*! ./text_utils */ 46942);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const REDUCED_APPOINTMENT_POINTERENTER_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.enter, "dxSchedulerAppointment");
const REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.leave, "dxSchedulerAppointment");
class Appointment extends _dom_component.default {
get coloredElement() {
return this.$element()
}
get rawAppointment() {
return this.option("data")
}
get dataAccessors() {
return this.option("dataAccessors")
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
data: {},
groupIndex: -1,
groups: [],
geometry: {
top: 0,
left: 0,
width: 0,
height: 0
},
allowDrag: true,
allowResize: true,
reduced: null,
isCompact: false,
direction: "vertical",
resizableConfig: {
keepAspectRatio: false
},
cellHeight: 0,
cellWidth: 0,
isDragSource: false
})
}
notifyObserver(funcName, args) {
this.invoke(funcName, ...args)
}
invoke(funcName) {
const notifyScheduler = this.option("notifyScheduler");
if (!notifyScheduler) {
return
}
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key]
}
return notifyScheduler.invoke(funcName, ...args)
}
_optionChanged(args) {
switch (args.name) {
case "data":
case "groupIndex":
case "groupTexts":
case "geometry":
case "allowDrag":
case "allowResize":
case "reduced":
case "sortedIndex":
case "isCompact":
case "direction":
case "resizableConfig":
case "cellHeight":
case "cellWidth":
this._invalidate();
break;
case "isDragSource":
this._renderDragSourceClass();
break;
default:
super._optionChanged(args)
}
}
_getHorizontalResizingRule() {
const reducedHandles = {
head: this.option("rtlEnabled") ? "right" : "left",
body: "",
tail: this.option("rtlEnabled") ? "left" : "right"
};
const getResizableStep = this.option("getResizableStep");
const step = getResizableStep ? getResizableStep() : 0;
return {
handles: this.option("reduced") ? reducedHandles[this.option("reduced")] : "left right",
minHeight: 0,
minWidth: this.invoke("getCellWidth"),
step: step,
roundStepValue: false
}
}
_getVerticalResizingRule() {
const height = Math.round(this.invoke("getCellHeight"));
return {
handles: "top bottom",
minWidth: 0,
minHeight: height,
step: height,
roundStepValue: true
}
}
_render() {
super._render();
this._renderAppointmentGeometry();
this._renderAriaLabel();
this._renderEmptyClass();
this._renderReducedAppointment();
this._renderAllDayClass();
this._renderDragSourceClass();
this._renderDirection();
this.$element().data("dxAppointmentStartDate", this.option("startDate"));
this.$element().attr("role", "button");
this._renderRecurrenceClass();
this._renderResizable();
this._setResourceColor()
}
_setResourceColor() {
const appointmentConfig = {
itemData: this.rawAppointment,
groupIndex: this.option("groupIndex") ?? 0
};
const resourceManager = this.option("getResourceManager")();
resourceManager.getAppointmentColor(appointmentConfig).then(color => {
if (color) {
this.coloredElement.css("backgroundColor", color);
this.coloredElement.addClass(_m_classes.APPOINTMENT_HAS_RESOURCE_COLOR_CLASS)
}
})
}
_renderAriaLabel() {
const $element = this.$element();
$element.attr("aria-label", (0, _text_utils.getAriaLabel)(this.option()));
void(0, _text_utils.getAriaDescription)(this.option()).then(text => {
if (text) {
const id = `dx-${new _guid.default}`;
const $description = $element.find(`.${_m_classes.APPOINTMENT_CONTENT_CLASSES.ARIA_DESCRIPTION}`);
if ($description) {
$element.attr("aria-describedby", id);
$description.text(text).attr("id", id)
}
}
})
}
_renderAppointmentGeometry() {
const geometry = this.option("geometry");
const $element = this.$element();
(0, _translator.move)($element, {
top: geometry.top,
left: geometry.left
});
$element.css({
width: geometry.width < 0 ? 0 : geometry.width,
height: geometry.height < 0 ? 0 : geometry.height
})
}
_renderEmptyClass() {
const geometry = this.option("geometry");
if (geometry.empty || this.option("isCompact")) {
this.$element().addClass(_m_classes.EMPTY_APPOINTMENT_CLASS)
}
}
_renderReducedAppointment() {
const reducedPart = this.option("reduced");
if (!reducedPart) {
return
}
this.$element().toggleClass(_m_classes.REDUCED_APPOINTMENT_CLASS, true).toggleClass(_m_classes.REDUCED_APPOINTMENT_PARTS_CLASSES[reducedPart], true);
this._renderAppointmentReducedIcon()
}
_renderAppointmentReducedIcon() {
const $icon = (0, _renderer.default)(" ").addClass(_m_classes.REDUCED_APPOINTMENT_ICON).appendTo(this.$element());
_events_engine.default.off($icon, REDUCED_APPOINTMENT_POINTERENTER_EVENT_NAME);
_events_engine.default.on($icon, REDUCED_APPOINTMENT_POINTERENTER_EVENT_NAME, () => {
(0, _m_tooltip.show)({
target: $icon,
content: (0, _text_utils.getReducedIconTooltip)(this.option())
})
});
_events_engine.default.off($icon, REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME);
_events_engine.default.on($icon, REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME, () => {
(0, _m_tooltip.hide)()
})
}
_renderAllDayClass() {
this.$element().toggleClass(_m_classes.ALL_DAY_APPOINTMENT_CLASS, Boolean(this.option("allDay")))
}
_renderDragSourceClass() {
this.$element().toggleClass(_m_classes.APPOINTMENT_DRAG_SOURCE_CLASS, Boolean(this.option("isDragSource")))
}
_renderRecurrenceClass() {
const rule = this.dataAccessors.get("recurrenceRule", this.rawAppointment);
if ((0, _validate_rule.validateRRule)(rule)) {
this.$element().addClass(_m_classes.RECURRENCE_APPOINTMENT_CLASS)
}
}
_renderDirection() {
this.$element().addClass(_m_classes.DIRECTION_APPOINTMENT_CLASSES[this.option("direction")])
}
_createResizingConfig() {
const config = "vertical" === this.option("direction") ? this._getVerticalResizingRule() : this._getHorizontalResizingRule();
if (!this.invoke("isGroupedByDate")) {
config.stepPrecision = "strict"
}
return config
}
_renderResizable() {
if (this.option("allowResize")) {
this._createComponent(this.$element(), _resizable.default, (0, _extend.extend)(this._createResizingConfig(), this.option("resizableConfig")))
}
}
_useTemplates() {
return false
}
}
exports.Appointment = Appointment;
(0, _component_registrator.default)("dxSchedulerAppointment", Appointment)
},
46942(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getReducedIconTooltip = exports.getAriaLabel = exports.getAriaDescription = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/date */ 38662));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/message */ 4671));
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const localizeDate = date => `${_date.default.format(date,"monthAndDay")}, ${_date.default.format(date,"year")}`;
const localizeTime = date => `${_date.default.format(date,"shorttime")}`;
const getDate = (options, propName) => {
var _options$timeZoneCalc;
const result = options.dataAccessors.get(propName, options.data);
if (!result) {
return result
}
const date = new Date(result);
const gridDate = null === (_options$timeZoneCalc = options.timeZoneCalculator) || void 0 === _options$timeZoneCalc ? void 0 : _options$timeZoneCalc.createDate(date, "toGrid");
return gridDate ?? date
};
exports.getAriaLabel = options => {
const name = options.dataAccessors.get("text", options.data) ?? "";
const dates = (options => {
const startDate = getDate(options, "startDate");
const endDate = getDate(options, "endDate");
const startDateText = localizeDate(startDate);
const endDateText = localizeDate(endDate);
const startTimeText = localizeTime(startDate);
const endTimeText = localizeTime(endDate);
const isAllDay = options.dataAccessors.get("allDay", options.data);
const allDayText = _message.default.format("dxScheduler-allDay");
if (startDateText === endDateText) {
return isAllDay ? `${startDateText}, ${allDayText}` : `${startDateText}, ${startTimeText} - ${endTimeText}`
}
return isAllDay ? `${startDateText} - ${endDateText}, ${allDayText}` : `${startDateText}, ${startTimeText} - ${endDateText}, ${endTimeText}`
})(options);
const parts = (_ref => {
let {
partIndex: partIndex,
partTotalCount: partTotalCount
} = _ref;
return (0, _type.isDefined)(partIndex) && partTotalCount > 0 ? ` (${partIndex+1}/${partTotalCount})` : ""
})(options);
return `${name}: ${dates}${parts}`
};
exports.getReducedIconTooltip = options => {
const tooltipLabel = _message.default.format("dxScheduler-editorLabelEndDate");
const endDateText = localizeDate(getDate(options, "endDate"));
return `${tooltipLabel}: ${endDateText}`
};
const getGroupText = options => {
if (!options.groupTexts.length) {
return ""
}
const groupText = options.groupTexts.join(", ");
return _message.default.format("dxScheduler-appointmentAriaLabel-group", groupText)
};
exports.getAriaDescription = async options => {
const resources = await (async options => {
const resourceManager = options.getResourceManager();
const list = await resourceManager.getAppointmentResourcesValues(options.data);
return list.map(item => `${item.label}: ${item.values.join(", ")}`)
})(options);
const texts = [getGroupText(options), ...resources].filter(Boolean);
return texts.join("; ")
}
},
5311(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _translator = __webpack_require__( /*! ../../../common/core/animation/translator */ 88603);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/events/core/events_engine */ 92774));
var _double_click = __webpack_require__( /*! ../../../common/core/events/double_click */ 5636);
var _index = __webpack_require__( /*! ../../../common/core/events/utils/index */ 98834);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 64960));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 17781);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _dom = __webpack_require__( /*! ../../../core/utils/dom */ 86858);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 21274);
var _position = __webpack_require__( /*! ../../../core/utils/position */ 41639);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _date2 = __webpack_require__( /*! ../../core/utils/date */ 55594);
var _collection_widget = _interopRequireDefault(__webpack_require__( /*! ../../ui/collection/collection_widget.edit */ 79839));
var _constants = __webpack_require__( /*! ../constants */ 25307);
var _m_classes = __webpack_require__( /*! ../m_classes */ 80126);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 18648));
var _appointment_adapter = __webpack_require__( /*! ../utils/appointment_adapter/appointment_adapter */ 36791);
var _get_targeted_appointment = __webpack_require__( /*! ../utils/get_targeted_appointment */ 31985);
var _appointment_groups_utils = __webpack_require__( /*! ../utils/resource_manager/appointment_groups_utils */ 11649);
var _group_utils = __webpack_require__( /*! ../utils/resource_manager/group_utils */ 76131);
var _agenda_appointment = __webpack_require__( /*! ./appointment/agenda_appointment */ 12901);
var _m_appointment = __webpack_require__( /*! ./appointment/m_appointment */ 198);
var _m_appointment_layout = __webpack_require__( /*! ./m_appointment_layout */ 18413);
var _m_appointments_kbn = __webpack_require__( /*! ./m_appointments_kbn */ 79349);
var _m_text_utils = __webpack_require__( /*! ./m_text_utils */ 9680);
var _m_core = __webpack_require__( /*! ./resizing/m_core */ 57498);
var _get_arrays_diff = __webpack_require__( /*! ./utils/get_arrays_diff */ 22184);
var _get_view_model_diff = __webpack_require__( /*! ./utils/get_view_model_diff */ 95951);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const DBLCLICK_EVENT_NAME = (0, _index.addNamespace)(_double_click.name, "dxSchedulerAppointment");
const toMs = _date.default.dateToMilliseconds;
class SchedulerAppointments extends _collection_widget.default {
constructor() {
super(...arguments);
this._isResizing = false
}
get isResizing() {
return this._isResizing
}
get isAgendaView() {
return this.invoke("isCurrentViewAgenda")
}
get isVirtualScrolling() {
return this.invoke("isVirtualScrolling")
}
get appointmentDataSource() {
return this.option("getAppointmentDataSource")()
}
get dataAccessors() {
return this.option("dataAccessors")
}
get sortedItems() {
return this.option("getSortedAppointments")()
}
getResourceManager() {
return this.option("getResourceManager")()
}
option(optionName, value) {
return super.option(...arguments)
}
notifyObserver(subject, args) {
const notifyScheduler = this.option("notifyScheduler");
if (notifyScheduler) {
notifyScheduler.invoke(subject, args)
}
}
invoke(funcName) {
const notifyScheduler = this.option("notifyScheduler");
if (notifyScheduler) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key]
}
return notifyScheduler.invoke(funcName, ...args)
}
}
_dispose() {
clearTimeout(this._appointmentClickTimeout);
super._dispose()
}
_supportedKeys() {
const parentValue = super._supportedKeys();
const kbnValue = this._kbn.getSupportedKeys();
return Object.assign({
enter: parentValue.enter,
space: parentValue.space
}, kbnValue)
}
getAppointmentSettings($item) {
return $item.data(_constants.APPOINTMENT_SETTINGS_KEY)
}
_moveFocus() {}
_focusTarget() {
return this._kbn.getFocusableItems()
}
_renderFocusTarget() {
var _this$$itemBySortedIn;
if (null !== (_this$$itemBySortedIn = this.$itemBySortedIndex) && void 0 !== _this$$itemBySortedIn && _this$$itemBySortedIn.length) {
this._kbn.resetTabIndex(this._kbn.getFirstVisibleItem())
}
}
_cleanFocusState() {
this._focusedItemIndexBeforeRender = this._kbn.isNavigating ? this._kbn.focusedItemSortIndex : -1;
super._cleanFocusState()
}
_renderFocusState() {
super._renderFocusState();
if (-1 !== this._focusedItemIndexBeforeRender) {
this._kbn.focusedItemSortIndex = this._focusedItemIndexBeforeRender;
this._kbn.isNavigating = false;
this._kbn.focus();
this._focusedItemIndexBeforeRender = -1
} else {
this._kbn.focusedItemSortIndex = -1
}
}
_focusInHandler(e) {
super._focusInHandler(e);
this._kbn.focusInHandler(e)
}
_focusOutHandler(e) {
this._kbn.focusOutHandler();
super._focusOutHandler(e)
}
_eventBindingTarget() {
return this._itemContainer()
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
noDataText: null,
activeStateEnabled: true,
hoverStateEnabled: true,
tabIndex: 0,
fixedContainer: null,
allDayContainer: null,
allowDrag: true,
allowResize: true,
allowAllDayResize: true,
onAppointmentDblClick: null,
groups: [],
resources: []
})
}
getItemsDiff() {
let previousValue = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
let value = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
const elementsInRenderOrder = previousValue.map(_ref => {
let {
sortedIndex: sortedIndex
} = _ref;
return this.$itemBySortedIndex[sortedIndex]
});
const diff = (0, _get_view_model_diff.getViewModelDiff)(previousValue, value, this.appointmentDataSource);
diff.filter(item => !(0, _get_arrays_diff.isNeedToAdd)(item)).forEach((item, index) => {
item.element = elementsInRenderOrder[index]
});
return diff
}
_optionChanged(args) {
switch (args.name) {
case "items":
this._cleanFocusState();
if (this.isAgendaView) {
this.forceRepaintAllAppointments(args.value || [])
} else {
const diff = this.getItemsDiff(args.previousValue, args.value);
this.repaintAppointments(diff)
}
this._attachAppointmentsEvents();
break;
case "fixedContainer":
case "allDayContainer":
case "onAppointmentDblClick":
case "allowDelete":
break;
case "allowDrag":
case "allowResize":
case "allowAllDayResize":
this._cleanFocusState();
this.forceRepaintAllAppointments(this.option("items") || []);
this._attachAppointmentsEvents();
break;
case "focusedElement":
this._kbn.resetTabIndex((0, _renderer.default)(args.value));
super._optionChanged(args);
break;
case "focusStateEnabled":
this._clearDropDownItemsElements();
this.renderDropDownAppointments();
super._optionChanged(args);
break;
default:
super._optionChanged(args)
}
}
_applyFragment(fragment, allDay) {
if (fragment.children().length > 0) {
this._getAppointmentContainer(allDay).append(fragment)
}
}
forceRepaintAllAppointments(items) {
this.$itemBySortedIndex = [];
this._renderByFragments(($commonFragment, $allDayFragment) => {
this._getAppointmentContainer(true).html("");
this._getAppointmentContainer(false).html("");
if (0 === items.length) {
this._cleanItemContainer()
}
items.forEach((item, index) => {
const container = item.allDay ? $allDayFragment : $commonFragment;
this._renderItem(index, item, container)
})
})
}
repaintAppointments(diff) {
this.$itemBySortedIndex = [];
this._renderByFragments(($commonFragment, $allDayFragment) => {
const isRepaintAll = diff.every(item => Boolean(item.needToAdd ?? item.needToRemove));
if (isRepaintAll) {
this._getAppointmentContainer(true).html("");
this._getAppointmentContainer(false).html("")
}
if (0 === diff.length) {
this._cleanItemContainer()
}
diff.forEach((item, index) => {
if (isRepaintAll && item.needToRemove) {
return
}
if (item.needToRemove) {
var _item$element, _item$element2;
null === (_item$element = item.element) || void 0 === _item$element || _item$element.detach();
null === (_item$element2 = item.element) || void 0 === _item$element2 || _item$element2.remove();
return
}
if (item.needToAdd) {
const container = item.item.allDay ? $allDayFragment : $commonFragment;
this._renderItem(index, item.item, container);
return
}
if (item.element) {
item.element.data(_constants.APPOINTMENT_SETTINGS_KEY, item.item);
this.$itemBySortedIndex[item.item.sortedIndex] = item.element
}
})
})
}
_renderByFragments(renderFunction) {
if (this.isVirtualScrolling) {
const $commonFragment = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment());
const $allDayFragment = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment());
renderFunction($commonFragment, $allDayFragment);
this._applyFragment($commonFragment, false);
this._applyFragment($allDayFragment, true)
} else {
renderFunction(this._getAppointmentContainer(false), this._getAppointmentContainer(true))
}
}
_refreshActiveDescendant() {}
_attachAppointmentsEvents() {
this._attachClickEvent();
this._attachHoldEvent();
this._attachContextMenuEvent();
this._attachAppointmentDblClick();
this._renderFocusState();
this._attachFeedbackEvents();
this._attachHoverEvents()
}
_clearDropDownItemsElements() {
this.invoke("clearCompactAppointments")
}
_findItemElementByItem(item) {
const result = [];
const that = this;
this.itemElements().each(function() {
const $item = (0, _renderer.default)(this);
if ($item.data(that._itemDataKey()) === item) {
result.push($item)
}
});
return result
}
_itemClass() {
return _m_classes.APPOINTMENT_ITEM_CLASS
}
_itemContainer() {
const $container = super._itemContainer();
let $result = $container;
const $allDayContainer = this.option("allDayContainer");
if ($allDayContainer) {
$result = $container.add($allDayContainer)
}
return $result
}
_cleanItemContainer() {
super._cleanItemContainer();
const $allDayContainer = this.option("allDayContainer");
if ($allDayContainer) {
$allDayContainer.empty()
}
}
_init() {
super._init();
this.$itemBySortedIndex = [];
this._kbn = new _m_appointments_kbn.AppointmentsKeyboardNavigation(this);
this._focusedItemIndexBeforeRender = -1;
this.$element().addClass("dx-scheduler-scrollable-appointments");
this._preventSingleAppointmentClick = false
}
_renderAppointmentTemplate($container, appointment, model) {
const config = {
isAllDay: appointment.allDay,
isRecurrence: appointment.recurrenceRule,
html: (0, _type.isPlainObject)(appointment) && appointment.html ? appointment.html : void 0
};
let {
targetedAppointmentData: targetedAppointmentData
} = model;
if (this._currentAppointmentSettings && "isAgendaModel" in this._currentAppointmentSettings) {
targetedAppointmentData = (0, _get_targeted_appointment.getTargetedAppointmentFromInfo)(this._currentAppointmentSettings.itemData, this._currentAppointmentSettings, this.dataAccessors, this.getResourceManager(), true)
}
const formatText = this.invoke("createFormattedDateText", appointment, targetedAppointmentData, appointment.allDay ? _m_text_utils.DateFormatType.DATE : _m_text_utils.DateFormatType.TIME);
$container.append(this.isAgendaView ? (0, _m_appointment_layout.createAgendaAppointmentLayout)(formatText, config) : (0, _m_appointment_layout.createAppointmentLayout)(formatText, config));
if (!this.isAgendaView) {
$container.parent().prepend((0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.STRIP))
}
}
_executeItemRenderAction(index, itemData, itemElement) {
const action = this._getItemRenderAction();
if (action) {
action(this.invoke("mapAppointmentFields", {
itemData: itemData,
itemElement: itemElement
}))
}
delete this._currentAppointmentSettings
}
_itemClickHandler(e) {
super._itemClickHandler(e, {}, {
afterExecute: function(e) {
this._processItemClick(e.args[0].event)
}.bind(this)
})
}
_processItemClick(e) {
const $target = (0, _renderer.default)(e.currentTarget);
const data = this._getItemData($target);
if ($target.is(".dx-scheduler-appointment-collector")) {
return
}
if ("keydown" === e.type || (0, _index.isFakeClickEvent)(e)) {
this.notifyObserver("showEditAppointmentPopup", {
data: data,
target: $target
});
return
}
this._appointmentClickTimeout = setTimeout(() => {
if (!this._preventSingleAppointmentClick && (0, _dom.isElementInDom)($target)) {
this.notifyObserver("showAppointmentTooltip", {
data: data,
target: $target
})
}
this._preventSingleAppointmentClick = false
}, 300)
}
_extendActionArgs($itemElement) {
const args = super._extendActionArgs($itemElement);
return this.invoke("mapAppointmentFields", args)
}
_render() {
super._render();
this._attachAppointmentDblClick()
}
_attachAppointmentDblClick() {
const that = this;
const itemSelector = that._itemSelector();
const itemContainer = this._itemContainer();
_events_engine.default.off(itemContainer, DBLCLICK_EVENT_NAME, itemSelector);
_events_engine.default.on(itemContainer, DBLCLICK_EVENT_NAME, itemSelector, e => {
that._itemDXEventHandler(e, "onAppointmentDblClick", {}, {
afterExecute(e) {
that._dblClickHandler(e.args[0].event)
}
})
})
}
_dblClickHandler(e) {
const $targetAppointment = (0, _renderer.default)(e.currentTarget);
const appointmentData = this._getItemData($targetAppointment);
clearTimeout(this._appointmentClickTimeout);
this._preventSingleAppointmentClick = true;
this.notifyObserver("showEditAppointmentPopup", {
data: appointmentData,
target: $targetAppointment
})
}
_renderItem(index, item, container) {
if ("items" in item) {
return this.renderDropDownAppointment(container, item)
}
this._currentAppointmentSettings = item;
const $item = super._renderItem(index, item.itemData, container);
$item.data(_constants.APPOINTMENT_SETTINGS_KEY, item);
if (-1 !== item.sortedIndex) {
this.$itemBySortedIndex[item.sortedIndex] = $item
}
return $item
}
_getItemContent($itemFrame) {
$itemFrame.data(_constants.APPOINTMENT_SETTINGS_KEY, this._currentAppointmentSettings);
const $itemContent = super._getItemContent($itemFrame);
return $itemContent
}
_createItemByTemplate(itemTemplate, renderArgs) {
const {
itemData: itemData,
container: container,
index: index
} = renderArgs;
const parent = (0, _renderer.default)(container).parent();
parent.prepend((0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.ARIA_DESCRIPTION).attr("hidden", true));
return itemTemplate.render({
model: {
appointmentData: itemData,
targetedAppointmentData: this.invoke("getTargetedAppointmentData", itemData, parent)
},
container: container,
index: index
})
}
_getAppointmentContainer(allDay) {
const $allDayContainer = this.option("allDayContainer");
const $container = this.itemsContainer().not($allDayContainer);
return allDay && $allDayContainer ? $allDayContainer : $container
}
_postprocessRenderItem(args) {
this.renderAppointment(args.itemElement, this._currentAppointmentSettings)
}
renderAppointment(element, settings) {
element.data(_constants.APPOINTMENT_SETTINGS_KEY, settings);
this._applyResourceDataAttr(element);
if (this.isAgendaView) {
this.renderAgendaAppointment(element, settings);
return
}
this.renderGeneralAppointment(element, settings)
}
renderAgendaAppointment(element, settings) {
if (settings.isLastInGroup) {
element.addClass(_m_classes.AGENDA_LAST_IN_DATE_APPOINTMENT_CLASS)
}
const {
groups: groups,
groupsLeafs: groupsLeafs,
resourceById: resourceById
} = this.getResourceManager();
const config = {
data: settings.itemData,
groupIndex: settings.groupIndex,
groupTexts: (0, _group_utils.getGroupTexts)(groups, groupsLeafs, resourceById, settings.groupIndex),
notifyScheduler: this.option("notifyScheduler"),
geometry: settings,
allowResize: false,
allowDrag: false,
groups: this.option("groups"),
dataAccessors: this.option("dataAccessors"),
timeZoneCalculator: this.option("timeZoneCalculator"),
getResourceManager: this.option("getResourceManager")
};
this._createComponent(element, _agenda_appointment.AgendaAppointment, config)
}
renderGeneralAppointment(element, settings) {
var _settings$info;
const allowResize = this.option("allowResize") && !settings.skipResizing;
const allowDrag = this.option("allowDrag");
const {
allDay: allDay
} = settings;
const {
groups: groups,
groupsLeafs: groupsLeafs,
resourceById: resourceById
} = this.getResourceManager();
const isGroupByDate = this.option("groupByDate");
const config = {
data: settings.itemData,
groupIndex: settings.groupIndex,
groupTexts: (0, _group_utils.getGroupTexts)(groups, groupsLeafs, resourceById, settings.groupIndex),
notifyScheduler: this.option("notifyScheduler"),
geometry: settings,
direction: settings.direction || "vertical",
allowResize: allowResize,
allowDrag: allowDrag,
allDay: allDay,
reduced: isGroupByDate ? void 0 : settings.reduced,
startDate: new Date(null === (_settings$info = settings.info) || void 0 === _settings$info ? void 0 : _settings$info.appointment.startDate),
cellWidth: this.invoke("getCellWidth"),
cellHeight: this.invoke("getCellHeight"),
resizableConfig: this._resizableConfig(settings.itemData, settings),
groups: this.option("groups"),
partIndex: settings.partIndex,
partTotalCount: settings.partTotalCount,
dataAccessors: this.option("dataAccessors"),
timeZoneCalculator: this.option("timeZoneCalculator"),
getResizableStep: this.option("getResizableStep"),
getResourceManager: this.option("getResourceManager")
};
this._createComponent(element, _m_appointment.Appointment, config)
}
_applyResourceDataAttr($appointment) {
const {
resources: resources
} = this.getResourceManager();
const rawAppointment = this._getItemData($appointment);
const appointmentGroups = (0, _appointment_groups_utils.getAppointmentGroupValues)(rawAppointment, resources);
Object.entries(appointmentGroups).forEach(_ref2 => {
let [resourceIndex, resourceIds] = _ref2;
if (resourceIds.length) {
const prefix = `data-${(0,_common.normalizeKey)(resourceIndex.toLowerCase())}-`;
resourceIds.forEach(value => $appointment.attr(prefix + (0, _common.normalizeKey)(value), true))
}
})
}
_resizableConfig(appointmentData, itemSetting) {
return {
area: this._calculateResizableArea(itemSetting, appointmentData),
onResizeStart: e => {
const $appointment = (0, _renderer.default)(e.element);
this._isResizing = true;
this._kbn.focus($appointment);
if (this.invoke("needRecalculateResizableArea")) {
const updatedArea = this._calculateResizableArea(this.getAppointmentSettings($appointment), $appointment.data("dxItemData"));
e.component.option("area", updatedArea);
e.component._renderDragOffsets(e.event)
}
this._initialSize = {
width: e.width,
height: e.height
};
this._initialCoordinates = (0, _translator.locate)($appointment)
},
onResizeEnd: e => {
this._isResizing = false;
this._resizeEndHandler(e)
}
}
}
_calculateResizableArea(itemSetting, appointmentData) {
const area = this.$element().closest(".dx-scrollable-content");
return this.invoke("getResizableAppointmentArea", {
coordinates: {
left: itemSetting.left,
top: 0,
groupIndex: itemSetting.groupIndex
},
allDay: itemSetting.allDay
}) || area
}
_resizeEndHandler(e) {
const $element = (0, _renderer.default)(e.element);
const {
allDay: allDay,
info: info
} = $element.data(_constants.APPOINTMENT_SETTINGS_KEY);
const sourceAppointment = this._getItemData($element);
const viewOffset = this.invoke("getViewOffsetMs");
let dateRange;
if (allDay) {
dateRange = this.resizeAllDay(e)
} else {
const startDate = this._getEndResizeAppointmentStartDate(e, sourceAppointment, info.appointment);
const {
endDate: endDate
} = info.appointment;
const shiftedStartDate = _date2.dateUtilsTs.addOffsets(startDate, -viewOffset);
const shiftedEndDate = _date2.dateUtilsTs.addOffsets(endDate, -viewOffset);
dateRange = this.getDateRange(e, shiftedStartDate, shiftedEndDate);
dateRange.startDate = _date2.dateUtilsTs.addOffsets(dateRange.startDate, viewOffset);
dateRange.endDate = _date2.dateUtilsTs.addOffsets(dateRange.endDate, viewOffset)
}
this.updateResizedAppointment($element, dateRange, this.dataAccessors, this.option("timeZoneCalculator"))
}
resizeAllDay(e) {
const $element = (0, _renderer.default)(e.element);
const timeZoneCalculator = this.option("timeZoneCalculator");
return (0, _m_core.getAppointmentDateRange)({
handles: e.handles,
appointmentSettings: $element.data(_constants.APPOINTMENT_SETTINGS_KEY),
isVerticalGroupedWorkSpace: this.option("isVerticalGroupedWorkSpace")(),
appointmentRect: (0, _position.getBoundingRect)($element[0]),
parentAppointmentRect: (0, _position.getBoundingRect)($element.parent()[0]),
viewDataProvider: this.option("getViewDataProvider")(),
isDateAndTimeView: this.option("isDateAndTimeView")(),
startDayHour: this.invoke("getStartDayHour"),
endDayHour: this.invoke("getEndDayHour"),
timeZoneCalculator: timeZoneCalculator,
dataAccessors: this.dataAccessors,
rtlEnabled: this.option("rtlEnabled"),
DOMMetaData: this.option("getDOMElementsMetaData")(),
viewOffset: this.invoke("getViewOffsetMs")
})
}
updateResizedAppointment($element, dateRange, dataAccessors, timeZoneCalculator) {
const sourceAppointment = this._getItemData($element);
const gridAdapter = new _appointment_adapter.AppointmentAdapter(sourceAppointment, dataAccessors).clone();
gridAdapter.startDate = new Date(dateRange.startDate);
gridAdapter.endDate = new Date(dateRange.endDate);
const convertedBackAdapter = gridAdapter.clone().calculateDates(timeZoneCalculator, "fromGrid").calculateDates(timeZoneCalculator, "toGrid");
const startDateDelta = gridAdapter.startDate.getTime() - convertedBackAdapter.startDate.getTime();
const endDateDelta = gridAdapter.endDate.getTime() - convertedBackAdapter.endDate.getTime();
gridAdapter.startDate = _date2.dateUtilsTs.addOffsets(gridAdapter.startDate, startDateDelta);
gridAdapter.endDate = _date2.dateUtilsTs.addOffsets(gridAdapter.endDate, endDateDelta);
const data = gridAdapter.calculateDates(timeZoneCalculator, "fromGrid").source;
this.notifyObserver("updateAppointmentAfterResize", {
target: sourceAppointment,
data: data,
$appointment: $element
})
}
_getEndResizeAppointmentStartDate(e, rawAppointment, appointmentInfo) {
const timeZoneCalculator = this.option("timeZoneCalculator");
const appointmentAdapter = new _appointment_adapter.AppointmentAdapter(rawAppointment, this.dataAccessors);
let {
startDate: startDate
} = appointmentInfo;
const {
startDateTimeZone: startDateTimeZone,
isRecurrent: isRecurrent
} = appointmentAdapter;
const isAllDay = this.invoke("isAllDay", rawAppointment);
if (!e.handles.top && !isRecurrent && !isAllDay) {
startDate = timeZoneCalculator.createDate(appointmentAdapter.startDate, "toGrid", startDateTimeZone)
}
return startDate
}
getDateRange(e, startDate, endDate) {
const itemData = this._getItemData(e.element);
const deltaTime = this.invoke("getDeltaTime", e, this._initialSize, itemData);
const renderingStrategyDirection = this.invoke("getRenderingStrategyDirection");
let isStartDateChanged = false;
const isAllDay = this.invoke("isAllDay", itemData);
const needCorrectDates = this.invoke("needCorrectAppointmentDates") && !isAllDay;
let startTime;
let endTime;
if ("vertical" !== renderingStrategyDirection || isAllDay) {
isStartDateChanged = this.option("rtlEnabled") ? e.handles.right : e.handles.left
} else {
isStartDateChanged = e.handles.top
}
if (isStartDateChanged) {
startTime = needCorrectDates ? this._correctStartDateByDelta(startDate, deltaTime) : startDate.getTime() - deltaTime;
startTime += _m_utils_time_zone.default.getTimezoneOffsetChangeInMs(startDate, endDate, startTime, endDate);
endTime = endDate.getTime()
} else {
startTime = startDate.getTime();
endTime = needCorrectDates ? this._correctEndDateByDelta(endDate, deltaTime) : endDate.getTime() + deltaTime;
endTime -= _m_utils_time_zone.default.getTimezoneOffsetChangeInMs(startDate, endDate, startDate, endTime)
}
return {
startDate: new Date(startTime),
endDate: new Date(endTime)
}
}
_correctEndDateByDelta(endDate, deltaTime) {
const endDayHour = this.invoke("getEndDayHour");
const startDayHour = this.invoke("getStartDayHour");
const maxDate = new Date(endDate);
const minDate = new Date(endDate);
const correctEndDate = new Date(endDate);
minDate.setHours(startDayHour, 0, 0, 0);
maxDate.setHours(endDayHour, 0, 0, 0);
if (correctEndDate > maxDate) {
correctEndDate.setHours(endDayHour, 0, 0, 0)
}
let result = correctEndDate.getTime() + deltaTime;
const visibleDayDuration = (endDayHour - startDayHour) * toMs("hour");
const daysCount = deltaTime > 0 ? Math.ceil(deltaTime / visibleDayDuration) : Math.floor(deltaTime / visibleDayDuration);
if (result > maxDate.getTime() || result <= minDate.getTime()) {
const tailOfCurrentDay = maxDate.getTime() - correctEndDate.getTime();
const tailOfPrevDays = deltaTime - tailOfCurrentDay;
const correctedEndDate = new Date(correctEndDate).setDate(correctEndDate.getDate() + daysCount);
const lastDay = new Date(correctedEndDate);
lastDay.setHours(startDayHour, 0, 0, 0);
result = lastDay.getTime() + tailOfPrevDays - visibleDayDuration * (daysCount - 1)
}
return result
}
_correctStartDateByDelta(startDate, deltaTime) {
const endDayHour = this.invoke("getEndDayHour");
const startDayHour = this.invoke("getStartDayHour");
const maxDate = new Date(startDate);
const minDate = new Date(startDate);
const correctStartDate = new Date(startDate);
minDate.setHours(startDayHour, 0, 0, 0);
maxDate.setHours(endDayHour, 0, 0, 0);
if (correctStartDate < minDate) {
correctStartDate.setHours(startDayHour, 0, 0, 0)
}
let result = correctStartDate.getTime() - deltaTime;
const visibleDayDuration = (endDayHour - startDayHour) * toMs("hour");
const daysCount = deltaTime > 0 ? Math.ceil(deltaTime / visibleDayDuration) : Math.floor(deltaTime / visibleDayDuration);
if (result < minDate.getTime() || result >= maxDate.getTime()) {
const tailOfCurrentDay = correctStartDate.getTime() - minDate.getTime();
const tailOfPrevDays = deltaTime - tailOfCurrentDay;
const firstDay = new Date(correctStartDate.setDate(correctStartDate.getDate() - daysCount));
firstDay.setHours(endDayHour, 0, 0, 0);
result = firstDay.getTime() - tailOfPrevDays + visibleDayDuration * (daysCount - 1)
}
return result
}
renderDropDownAppointments() {
this._renderByFragments(($commonFragment, $allDayFragment) => {
const items = this.option("items") || [];
items.forEach(item => {
if ("items" in item) {
const $fragment = item.allDay ? $allDayFragment : $commonFragment;
this.renderDropDownAppointment($fragment, item)
}
})
})
}
renderDropDownAppointment($fragment, appointment) {
const virtualItems = appointment.items;
const items = [];
virtualItems.forEach(item => {
const appointmentConfig = {
itemData: item.itemData,
groupIndex: appointment.groupIndex,
groups: this.option("groups")
};
const resourceManager = this.getResourceManager();
items.push({
appointment: item.itemData,
targetedAppointment: (0, _get_targeted_appointment.getTargetedAppointment)(item.itemData, item, this.dataAccessors, resourceManager),
color: resourceManager.getAppointmentColor(appointmentConfig),
settings: item
})
});
const $item = this.invoke("renderCompactAppointments", {
$container: $fragment,
coordinates: {
top: appointment.top,
left: appointment.left
},
items: items,
buttonColor: items[0].color,
sortedIndex: appointment.sortedIndex,
width: appointment.width,
height: appointment.height,
onAppointmentClick: this.option("onItemClick"),
allowDrag: this.option("allowDrag"),
isCompact: appointment.isCompact
});
this.$itemBySortedIndex[appointment.sortedIndex] = $item;
return $item
}
moveAppointmentBack(dragEvent) {
const $appointment = this._kbn.$focusTarget();
const size = this._initialSize;
const coords = this._initialCoordinates;
this._isResizing = false;
if (dragEvent) {
this._removeDragSourceClassFromDraggedAppointment();
if ((0, _type.isDeferred)(dragEvent.cancel)) {
dragEvent.cancel.resolve(true)
} else {
dragEvent.cancel = true
}
}
if ($appointment.get(0) && !dragEvent) {
if (coords) {
(0, _translator.move)($appointment, coords);
delete this._initialSize
}
if (size) {
(0, _size.setOuterWidth)($appointment, size.width);
(0, _size.setOuterHeight)($appointment, size.height);
delete this._initialCoordinates
}
}
}
focus() {
this._kbn.focus()
}
_removeDragSourceClassFromDraggedAppointment() {
const $appointments = this._itemElements().filter(`.${_m_classes.APPOINTMENT_DRAG_SOURCE_CLASS}`);
$appointments.each((_, element) => {
const appointmentInstance = (0, _renderer.default)(element).dxSchedulerAppointment("instance");
appointmentInstance.option("isDragSource", false)
})
}
_setDragSourceAppointment(appointment, settings) {
const $appointments = this._findItemElementByItem(appointment);
const {
startDate: startDate,
endDate: endDate
} = settings.info.sourceAppointment;
const {
groupIndex: groupIndex
} = settings;
$appointments.forEach($item => {
const {
info: itemInfo,
groupIndex: itemGroupIndex
} = $item.data(_constants.APPOINTMENT_SETTINGS_KEY);
const {
startDate: itemStartDate,
endDate: itemEndDate
} = itemInfo.sourceAppointment;
const appointmentInstance = $item.dxSchedulerAppointment("instance");
const isDragSource = startDate.getTime() === itemStartDate.getTime() && endDate.getTime() === itemEndDate.getTime() && groupIndex === itemGroupIndex;
appointmentInstance.option("isDragSource", isDragSource)
})
}
updateResizableArea() {
const $allResizableElements = this.$element().find(".dx-scheduler-appointment.dx-resizable");
const horizontalResizables = (0, _common.grep)($allResizableElements, el => {
const $el = (0, _renderer.default)(el);
const resizableInst = $el.dxResizable("instance");
const {
area: area,
handles: handles
} = resizableInst.option();
return ("right left" === handles || "left right" === handles) && (0, _type.isPlainObject)(area)
});
(0, _iterator.each)(horizontalResizables, (_, el) => {
const $el = (0, _renderer.default)(el);
const position = (0, _translator.locate)($el);
const appointmentData = this._getItemData($el);
const area = this._calculateResizableArea({
left: position.left
}, appointmentData);
$el.dxResizable("instance").option("area", area)
})
}
}(0, _component_registrator.default)("dxSchedulerAppointments", SchedulerAppointments);
exports.default = SchedulerAppointments
},
18413(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createAppointmentLayout = exports.createAgendaAppointmentLayout = void 0;
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 64960));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _m_classes = __webpack_require__( /*! ../m_classes */ 80126);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const allDayText = ` ${_message.default.format("dxScheduler-allDay")}: `;
const recurringText = _message.default.format("dxScheduler-appointmentAriaLabel-recurring");
exports.createAppointmentLayout = (formatText, config) => {
const result = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment());
(0, _renderer.default)("").text(formatText.text).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_TITLE).appendTo(result);
if (config.html) {
result.html(config.html)
}
const $contentDetails = (0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS).appendTo(result);
(0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_DATE).text(formatText.formatDate).appendTo($contentDetails);
config.isRecurrence && (0, _renderer.default)(" ").addClass(`${_m_classes.APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).attr("aria-label", recurringText).attr("role", "img").appendTo(result);
config.isAllDay && (0, _renderer.default)("").text(allDayText).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.ALL_DAY_CONTENT).prependTo($contentDetails);
return result
};
exports.createAgendaAppointmentLayout = (formatText, config) => {
const result = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment());
const leftLayoutContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-agenda-appointment-left-layout").appendTo(result);
const rightLayoutContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-agenda-appointment-right-layout").appendTo(result);
const marker = (0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_MARKER).appendTo(leftLayoutContainer);
config.isRecurrence && (0, _renderer.default)(" ").addClass(`${_m_classes.APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).attr("aria-label", recurringText).appendTo(marker);
(0, _renderer.default)("").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_TITLE).text(formatText.text).appendTo(rightLayoutContainer);
const additionalContainer = (0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS).appendTo(rightLayoutContainer);
(0, _renderer.default)(" ").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_DATE).text(formatText.formatDate).appendTo(additionalContainer);
if (config.isAllDay) {
(0, _renderer.default)(" ").text(allDayText).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.ALL_DAY_CONTENT).prependTo(additionalContainer)
}
return result
}
},
79349(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentsKeyboardNavigation = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _m_element = __webpack_require__( /*! ../../core/m_element */ 93630);
var _m_events_engine = _interopRequireDefault(__webpack_require__( /*! ../../events/core/m_events_engine */ 36306));
var _appointment_groups_utils = __webpack_require__( /*! ../utils/resource_manager/appointment_groups_utils */ 11649);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.AppointmentsKeyboardNavigation = class {
constructor(collection) {
this.focusedItemSortIndex = -1;
this.isNavigating = false;
this._collection = collection
}
getFocusableItems() {
const appts = this._collection._itemElements().not(".dx-state-disabled");
const collectors = this._collection.$element().find(".dx-scheduler-appointment-collector");
return appts.add(collectors)
}
focus($item) {
const $target = $item ?? this.$focusTarget();
if ($target.length) {
_m_events_engine.default.trigger($target, "focus")
}
}
$focusTarget() {
const $items = this._collection.$itemBySortedIndex;
if (!$items) {
return (0, _renderer.default)()
}
const $item = $items[this.focusedItemSortIndex];
return $item || (0, _renderer.default)()
}
resetTabIndex($item) {
const $target = $item ?? this.$focusTarget();
this.getFocusableItems().attr("tabIndex", -1);
$target.attr("tabIndex", this._collection.option("tabIndex"))
}
focusInHandler(e) {
const $target = (0, _renderer.default)(e.target);
const itemData = this._collection.getAppointmentSettings($target);
if (!itemData) {
return
}
this.focusedItemSortIndex = itemData.sortedIndex;
this._collection.option("focusedElement", (0, _m_element.getPublicElement)(e.target))
}
focusOutHandler() {
this._collection.option("focusedElement", (0, _m_element.getPublicElement)(this.getFirstVisibleItem()))
}
getSupportedKeys() {
return {
escape: this.escHandler.bind(this),
del: this.delHandler.bind(this),
tab: this.tabHandler.bind(this)
}
}
delHandler(e) {
if (this._collection.option("allowDelete")) {
e.preventDefault();
const data = this._collection.getAppointmentSettings((0, _renderer.default)(e.target)).itemData;
this._collection.notifyObserver("onDeleteButtonPress", {
data: data,
target: e.target
})
}
}
escHandler() {
if (!this._collection.isResizing) {
return
}
this._collection.moveAppointmentBack();
const resizableInstance = this.$focusTarget().dxResizable("instance");
if (resizableInstance) {
resizableInstance._detachEventHandlers();
resizableInstance._attachEventHandlers();
resizableInstance._toggleResizingClass(false)
}
}
tabHandler(e) {
const items = this._collection.sortedItems;
const nextIndex = this.focusedItemSortIndex + (e.shiftKey ? -1 : 1);
const nextItemData = items[nextIndex];
if (!nextItemData) {
return
}
e.preventDefault();
this.focusByItemData(nextItemData)
}
focusByItemData(itemData) {
this.focusedItemSortIndex = itemData.sortedIndex;
if (this._collection.isVirtualScrolling) {
this.isNavigating = true;
this.scrollToByItemData(itemData)
}
this.focus()
}
scrollToByItemData(itemData) {
const date = new Date(Math.max(this._collection.invoke("getStartViewDate").getTime(), itemData.source.startDate));
const group = (0, _appointment_groups_utils.getRawAppointmentGroupValues)(itemData.itemData, this._collection.getResourceManager().resources);
this._collection.option("scrollTo")(date, {
group: group,
allDay: itemData.allDay
})
}
getFirstVisibleItem() {
const $items = this._collection.$itemBySortedIndex;
const $itemsPlainArray = Object.values($items);
const $firstItem = this._collection.isVirtualScrolling ? $itemsPlainArray.find($item => this.isItemVisibleInViewport($item)) ?? (0, _renderer.default)() : (0, _renderer.default)($itemsPlainArray[0]);
return $firstItem
}
isItemVisibleInViewport($item) {
const $container = this._collection.$element().closest(".dx-scrollable-container");
const containerRect = $container.get(0).getBoundingClientRect();
const itemRect = $item.get(0).getBoundingClientRect();
return itemRect.top < containerRect.bottom && itemRect.bottom > containerRect.top && itemRect.left < containerRect.right && itemRect.right > containerRect.left
}
}
},
9680(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getFormatType = exports.formatDates = exports.createFormattedDateText = exports.DateFormatType = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/date */ 38662));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
var DateFormatType;
! function(DateFormatType) {
DateFormatType.DATETIME = "DATETIME";
DateFormatType.TIME = "TIME";
DateFormatType.DATE = "DATE"
}(DateFormatType || (exports.DateFormatType = DateFormatType = {}));
exports.createFormattedDateText = options => {
const {
startDate: startDate,
endDate: endDate,
allDay: allDay,
format: format
} = options;
const formatType = format || getFormatType(startDate, endDate, allDay);
return formatDates(startDate, endDate, formatType)
};
const getFormatType = (startDate, endDate, isAllDay, isDateAndTimeView) => {
if (isAllDay) {
return DateFormatType.DATE
}
if (isDateAndTimeView && _date2.default.sameDate(startDate, endDate)) {
return DateFormatType.TIME
}
return DateFormatType.DATETIME
};
exports.getFormatType = getFormatType;
const formatDates = (startDate, endDate, formatType) => {
const isSameDate = startDate.getDate() === endDate.getDate();
switch (formatType) {
case DateFormatType.DATETIME:
return [_date.default.format(startDate, "monthandday"), " ", _date.default.format(startDate, "shorttime"), " - ", isSameDate ? "" : `${_date.default.format(endDate,"monthandday")} `, _date.default.format(endDate, "shorttime")].join("");
case DateFormatType.TIME:
return `${_date.default.format(startDate,"shorttime")} - ${_date.default.format(endDate,"shorttime")}`;
case DateFormatType.DATE:
return `${_date.default.format(startDate,"monthandday")}${isSameDate?"":` - ${_date.default.format(endDate,"monthandday")}`}`;
default:
return
}
};
exports.formatDates = formatDates
},
334(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDeltaTime = void 0;
var _date = (e = __webpack_require__( /*! ../../../../core/utils/date */ 41380), e && e.__esModule ? e : {
default: e
});
var e;
var _constants = __webpack_require__( /*! ../../constants */ 25307);
const toMs = _date.default.dateToMilliseconds;
exports.getDeltaTime = (args, initialSize, options) => {
const {
viewType: viewType,
resizableStep: resizableStep,
isAllDayPanel: isAllDayPanel
} = options;
switch (true) {
case ["timelineMonth", "month"].includes(viewType) || Boolean(isAllDayPanel):
return ((args, initialSize, resizableStep) => {
const intervalWidth = resizableStep || 2;
const initialWidth = initialSize.width;
return Math.round((args.width - initialWidth) / intervalWidth)
})(args, initialSize, resizableStep) * toMs("day");
case "agenda" === viewType:
return 0;
case _constants.VERTICAL_VIEW_TYPES.includes(viewType) && !isAllDayPanel:
return ((args, initialSize, _ref2) => {
let {
cellSize: cellSize,
cellDurationInMinutes: cellDurationInMinutes
} = _ref2;
const deltaHeight = args.height - initialSize.height;
const deltaTime = toMs("minute") * Math.round(deltaHeight * cellDurationInMinutes / cellSize.height);
return deltaTime
})(args, initialSize, options);
default:
return ((args, initialSize, _ref) => {
let {
cellSize: cellSize,
cellDurationInMinutes: cellDurationInMinutes
} = _ref;
const deltaWidth = args.width - initialSize.width;
const deltaTime = toMs("minute") * Math.round(deltaWidth * cellDurationInMinutes / cellSize.width);
return deltaTime
})(args, initialSize, options)
}
}
},
57498(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAppointmentDateRange = void 0;
var _date = __webpack_require__( /*! ../../../core/utils/date */ 55594);
var _m_date = __webpack_require__( /*! ../../../core/utils/m_date */ 66570);
const toMs = _m_date.dateUtils.dateToMilliseconds;
const getCellData = function(_ref, cellRowIndex, cellColumnIndex, isOccupiedAllDay) {
let {
viewDataProvider: viewDataProvider
} = _ref;
let isAllDay = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : false;
let rtlEnabled = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : false;
const cellData = viewDataProvider.getCellData(cellRowIndex, cellColumnIndex, isOccupiedAllDay, rtlEnabled);
if (!isAllDay) {
cellData.endDate = _date.dateUtilsTs.addOffsets(cellData.startDate, toMs("day"))
}
return cellData
};
const getAppointmentLeftCell = options => {
const {
cellHeight: cellHeight,
cellWidth: cellWidth,
relativeAppointmentRect: relativeAppointmentRect,
appointment: appointment,
rtlEnabled: rtlEnabled
} = options;
const cellRowIndex = Math.floor(relativeAppointmentRect.top / cellHeight);
const cellColumnIndex = Math.round(relativeAppointmentRect.left / cellWidth);
return getCellData(options, cellRowIndex, cellColumnIndex, appointment.isOccupiedAllDay, appointment.isAllDay, rtlEnabled)
};
exports.getAppointmentDateRange = options => {
const {
appointmentSettings: appointmentSettings
} = options;
const relativeAppointmentRect = ((appointmentRect, parentAppointmentRect) => {
const left = appointmentRect.left - parentAppointmentRect.left;
const top = appointmentRect.top - parentAppointmentRect.top;
const width = left < 0 ? appointmentRect.width + left : appointmentRect.width;
const height = top < 0 ? appointmentRect.height + top : appointmentRect.height;
return {
left: Math.max(0, left),
top: Math.max(0, top),
width: width,
height: height
}
})(options.appointmentRect, options.parentAppointmentRect);
const cellInfo = (options => {
const {
appointmentSettings: appointmentSettings,
isVerticalGroupedWorkSpace: isVerticalGroupedWorkSpace,
DOMMetaData: DOMMetaData
} = options;
const DOMMetaTable = appointmentSettings.allDay && !isVerticalGroupedWorkSpace ? [DOMMetaData.allDayPanelCellsMeta] : DOMMetaData.dateTableCellsMeta;
const {
height: cellHeight,
width: cellWidth
} = DOMMetaTable[appointmentSettings.rowIndex][appointmentSettings.columnIndex];
const cellCountInRow = DOMMetaTable[appointmentSettings.rowIndex].length;
return {
cellWidth: cellWidth,
cellHeight: cellHeight,
cellCountInRow: cellCountInRow
}
})(options);
const appointment = {
startDate: appointmentSettings.info.sourceAppointment.startDate,
endDate: appointmentSettings.info.sourceAppointment.endDate,
isAllDay: Boolean(appointmentSettings.info.appointment.allDay),
isOccupiedAllDay: Boolean(appointmentSettings.allDay)
};
const extendedOptions = Object.assign({}, options, cellInfo, {
appointment: appointment,
relativeAppointmentRect: relativeAppointmentRect
});
return !options.rtlEnabled ? (options => {
const {
cellWidth: cellWidth,
cellCountInRow: cellCountInRow,
relativeAppointmentRect: relativeAppointmentRect,
appointment: appointment,
handles: handles
} = options;
const appointmentFirstCell = getAppointmentLeftCell(options);
const appointmentCellsAmount = Math.round(relativeAppointmentRect.width / cellWidth);
const appointmentLastCellIndex = appointmentFirstCell.index + (appointmentCellsAmount - 1);
if (handles.left) {
return {
startDate: appointmentFirstCell.startDate,
endDate: appointmentFirstCell.startDate > appointment.endDate ? appointmentFirstCell.startDate : appointment.endDate
}
}
const appointmentRowIndex = Math.floor(appointmentLastCellIndex / cellCountInRow);
const appointmentColumnIndex = appointmentLastCellIndex % cellCountInRow;
const appointmentLastCell = getCellData(options, appointmentRowIndex, appointmentColumnIndex, appointment.isOccupiedAllDay, appointment.isAllDay);
const {
endDate: endDate
} = appointmentLastCell;
return {
startDate: endDate < appointment.startDate ? endDate : appointment.startDate,
endDate: endDate
}
})(extendedOptions) : (options => {
const {
cellCountInRow: cellCountInRow,
appointment: appointment,
handles: handles,
cellWidth: cellWidth,
relativeAppointmentRect: relativeAppointmentRect
} = options;
const appointmentLastCell = getAppointmentLeftCell(options);
if (handles.right) {
const appointmentLastCellIndex = appointmentLastCell.index;
const appointmentCellsAmount = Math.round(relativeAppointmentRect.width / cellWidth);
const appointmentFirstCellIndex = appointmentLastCellIndex - appointmentCellsAmount + 1;
const appointmentRowIndex = Math.floor(appointmentLastCellIndex / cellCountInRow);
const appointmentFirstCell = getCellData(options, appointmentRowIndex, appointmentFirstCellIndex, appointment.isOccupiedAllDay, appointment.isAllDay);
return {
startDate: appointmentFirstCell.startDate,
endDate: appointmentFirstCell.startDate > appointment.endDate ? appointmentFirstCell.startDate : appointment.endDate
}
}
const {
endDate: endDate
} = appointmentLastCell;
return {
startDate: endDate < appointment.startDate ? endDate : appointment.startDate,
endDate: endDate
}
})(extendedOptions)
}
},
22184(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getArraysDiff = function(a, b, equal) {
const n = a.length;
const m = b.length;
const dp = Array.from({
length: n + 1
}, () => new Array(m + 1).fill(0));
for (let i = 1; i <= n; i += 1) {
const ai = a[i - 1];
for (let j = 1; j <= m; j += 1) {
dp[i][j] = equal(ai, b[j - 1]) ? dp[i - 1][j - 1] + 1 : Math.max(dp[i - 1][j], dp[i][j - 1])
}
}
const result = [];
let i = n;
let j = m;
while (i > 0 && j > 0) {
if (equal(a[i - 1], b[j - 1])) {
result.push({
item: b[j - 1]
});
i -= 1;
j -= 1
} else if (dp[i - 1][j] >= dp[i][j - 1]) {
result.push({
item: a[i - 1],
needToRemove: true
});
i -= 1
} else {
result.push({
item: b[j - 1],
needToAdd: true
});
j -= 1
}
}
while (i > 0) {
result.push({
item: a[i - 1],
needToRemove: true
});
i -= 1
}
while (j > 0) {
result.push({
item: b[j - 1],
needToAdd: true
});
j -= 1
}
result.reverse();
return result
};
exports.isNeedToRemove = exports.isNeedToAdd = void 0;
exports.isNeedToRemove = item => item.needToRemove;
exports.isNeedToAdd = item => item.needToAdd
},
95951(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getViewModelDiff = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _get_arrays_diff = __webpack_require__( /*! ./get_arrays_diff */ 22184);
const getObjectToCompare = item => {
if ("isAgendaModel" in item) {
return {}
}
if ("items" in item) {
return {
allDay: item.allDay,
groupIndex: item.groupIndex,
top: item.top,
left: item.left,
items: item.items.length
}
}
return {
allDay: item.allDay,
groupIndex: item.groupIndex,
direction: item.direction,
left: item.left,
top: item.top,
height: item.height,
width: item.width,
reduced: item.reduced,
partIndex: item.partIndex,
partTotalCount: item.partTotalCount,
rowIndex: item.rowIndex,
columnIndex: item.columnIndex
}
};
exports.getViewModelDiff = (viewModelOld, viewModelNext, appointmentDataSource) => (0, _get_arrays_diff.getArraysDiff)(viewModelOld, viewModelNext, (appointmentDataSource => (viewModelOld, viewModelNext) => viewModelOld.itemData === viewModelNext.itemData && !((data, appointmentDataSource) => {
const updatedData = appointmentDataSource.getUpdatedAppointment();
return updatedData === data || appointmentDataSource.getUpdatedAppointmentKeys().some(item => data[item.key] === item.value)
})(viewModelNext.itemData, appointmentDataSource) && (0, _common.equalByValue)(getObjectToCompare(viewModelOld), getObjectToCompare(viewModelNext)))(appointmentDataSource))
},
61954(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AgendaAppointmentView = void 0;
var _renderer = (e = __webpack_require__( /*! ../../../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
var _const = __webpack_require__( /*! ../const */ 91167);
var _base_appointment = __webpack_require__( /*! ./base_appointment */ 82359);
class AgendaAppointmentView extends _base_appointment.BaseAppointmentView {
applyElementClasses() {
super.applyElementClasses();
this.$element().toggleClass(_const.AGENDA_APPOINTMENT_CLASSES.LAST_IN_DATE, this.option().modifiers.isLastInGroup)
}
resize() {
this.$element().css({
height: this.option().geometry.height,
width: this.option().geometry.width
})
}
defaultAppointmentContent($container) {
this.renderMarker($container);
this.renderInfo($container);
return $container
}
renderMarker($container) {
const $leftContainer = (0, _renderer.default)(" ").addClass(_const.AGENDA_APPOINTMENT_CLASSES.LEFT_LAYOUT).appendTo($container);
const $marker = (0, _renderer.default)(" ").addClass(_const.AGENDA_APPOINTMENT_CLASSES.MARKER).appendTo($leftContainer);
void this.option().getResourceColor().then(color => {
if (color) {
this.$element().addClass(_const.APPOINTMENT_TYPE_CLASSES.HAS_RESOURCE);
$marker.css("backgroundColor", color)
}
});
if (this.isRecurring()) {
(0, _renderer.default)(" ").addClass(`${_const.APPOINTMENT_CLASSES.RECURRENCE_ICON} dx-icon-repeat`).attr("aria-label", _const.RECURRING_LABEL).appendTo($marker)
}
}
renderInfo($container) {
const $rightContainer = (0, _renderer.default)("").addClass(_const.AGENDA_APPOINTMENT_CLASSES.RIGHT_LAYOUT).appendTo($container);
(0, _renderer.default)(" ").addClass(_const.APPOINTMENT_CLASSES.TITLE).text(this.getTitleText()).appendTo($rightContainer);
const $contentDetails = (0, _renderer.default)(" ").addClass(_const.APPOINTMENT_CLASSES.DETAILS).appendTo($rightContainer);
(0, _renderer.default)(" ").addClass(_const.APPOINTMENT_CLASSES.DATE).text(this.getDateText()).appendTo($contentDetails);
if (this.isAllDay()) {
(0, _renderer.default)(" ").text(_const.ALL_DAY_TEXT).addClass(_const.APPOINTMENT_CLASSES.ALL_DAY_TEXT).prependTo($contentDetails)
}
this.renderResourceList($contentDetails)
}
renderResourceList($contentDetails) {
void this.option().getResourcesValues(this.appointmentData).then(resources => {
const container = (0, _renderer.default)(" ").addClass(_const.AGENDA_APPOINTMENT_CLASSES.RESOURCE_LIST).appendTo($contentDetails);
resources.forEach(resource => {
const itemContainer = (0, _renderer.default)(" ").addClass(_const.AGENDA_APPOINTMENT_CLASSES.RESOURCE_ITEM).appendTo(container);
(0, _renderer.default)(" ").text(`${resource.label}:`).appendTo(itemContainer);
(0, _renderer.default)(" ").addClass(_const.AGENDA_APPOINTMENT_CLASSES.RESOURCE_ITEM_VALUE).text(resource.values.join(", ")).appendTo(itemContainer)
})
})
}
}
exports.AgendaAppointmentView = AgendaAppointmentView
},
82359(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BaseAppointmentView = void 0;
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/message */ 4671));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../../core/component_registrator */ 92848));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 64553));
var _m_element = __webpack_require__( /*! ../../../core/m_element */ 93630);
var _m_empty_template = __webpack_require__( /*! ../../../core/templates/m_empty_template */ 11768);
var _m_function_template = __webpack_require__( /*! ../../../core/templates/m_function_template */ 88969);
var _m_short = __webpack_require__( /*! ../../../events/m_short */ 43926);
var _const = __webpack_require__( /*! ../const */ 91167);
var _get_date_text = __webpack_require__( /*! ../utils/get_date_text */ 4995);
var _view_item = __webpack_require__( /*! ../view_item */ 49269);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class BaseAppointmentView extends _view_item.ViewItem {
get targetedAppointmentData() {
return this.option().targetedAppointmentData
}
get appointmentData() {
return this.option().appointmentData
}
_init() {
super._init();
this.defaultAppointmentTemplate = new _m_function_template.FunctionTemplate(options => {
this.defaultAppointmentContent((0, _renderer.default)(options.container))
})
}
_initMarkup() {
super._initMarkup();
this.resize();
this.applyElementClasses();
this.applyAria();
this.attachFocusEvents();
this.attachClickEvent();
this.attachKeydownEvents();
this.renderContentTemplate()
}
_dispose() {
super._dispose();
_m_short.click.off(this.$element(), _view_item.EVENTS_NAMESPACE)
}
applyElementClasses() {
this.$element().addClass(_const.APPOINTMENT_CLASSES.CONTAINER).toggleClass(_const.APPOINTMENT_TYPE_CLASSES.RECURRING, this.isRecurring()).toggleClass(_const.APPOINTMENT_TYPE_CLASSES.ALL_DAY, this.isAllDay())
}
applyAria() {
this.$element().attr("role", "button").attr("tabindex", this.option().tabIndex)
}
attachClickEvent() {
_m_short.click.off(this.$element(), _view_item.EVENTS_NAMESPACE);
_m_short.click.on(this.$element(), this.onClick.bind(this), _view_item.EVENTS_NAMESPACE)
}
onFocusIn() {
this.$element().addClass(_const.FOCUSED_STATE_CLASS);
super.onFocusIn()
}
onFocusOut(e) {
this.$element().removeClass(_const.FOCUSED_STATE_CLASS);
super.onFocusOut(e)
}
setTabIndex(tabIndex) {
super.setTabIndex(tabIndex);
this.$element().attr("tabindex", tabIndex ?? null)
}
getTitleText() {
const dataAccessor = this.option().getDataAccessor();
const titleText = dataAccessor.get("text", this.targetedAppointmentData);
if (!titleText) {
return _message.default.format("dxScheduler-noSubject")
}
return titleText
}
getDateText() {
const dateText = (0, _get_date_text.getDateTextFromTargetAppointment)(this.targetedAppointmentData, this.isAllDay() ? _get_date_text.DateFormatType.DATE : _get_date_text.DateFormatType.TIME);
return dateText
}
isRecurring() {
const dataAccessor = this.option().getDataAccessor();
const recurrenceRule = dataAccessor.get("recurrenceRule", this.targetedAppointmentData);
return Boolean(recurrenceRule)
}
isAllDay() {
const dataAccessor = this.option().getDataAccessor();
const allDay = dataAccessor.get("allDay", this.targetedAppointmentData);
return Boolean(allDay)
}
renderContentTemplate() {
const $content = (0, _renderer.default)(" ").addClass(_const.APPOINTMENT_CLASSES.CONTENT).appendTo(this.$element());
const template = this.option().appointmentTemplate instanceof _m_empty_template.EmptyTemplate ? this.defaultAppointmentTemplate : this.option().appointmentTemplate;
template.render({
container: (0, _m_element.getPublicElement)($content),
model: {
appointmentData: this.appointmentData,
targetedAppointmentData: this.targetedAppointmentData
},
index: this.option().index,
onRendered: () => {
this.option().onRendered({
element: (0, _m_element.getPublicElement)(this.$element()),
appointmentData: this.appointmentData,
targetedAppointmentData: this.targetedAppointmentData
})
}
})
}
defaultAppointmentContent($container) {
return $container
}
}
exports.BaseAppointmentView = BaseAppointmentView;
(0, _component_registrator.default)("dxSchedulerNewAppointment", BaseAppointmentView)
},
3902(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridAppointmentView = void 0;
var _renderer = (e = __webpack_require__( /*! ../../../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
var _const = __webpack_require__( /*! ../const */ 91167);
var _base_appointment = __webpack_require__( /*! ./base_appointment */ 82359);
class GridAppointmentView extends _base_appointment.BaseAppointmentView {
_initMarkup() {
super._initMarkup();
void this.applyElementColor()
}
resize(geometry) {
const newGeometry = geometry ?? this.option().geometry;
const {
top: top,
left: left,
width: width,
height: height
} = newGeometry;
this.$element().css({
height: height,
width: width,
top: top,
left: left
})
}
applyElementClasses() {
super.applyElementClasses();
this.$element().toggleClass(_const.APPOINTMENT_TYPE_CLASSES.EMPTY, this.option().modifiers.empty)
}
defaultAppointmentContent($container) {
(0, _renderer.default)(" ").text(this.getTitleText()).addClass(_const.APPOINTMENT_CLASSES.TITLE).appendTo($container);
if (this.isRecurring()) {
(0, _renderer.default)(" ").addClass(`${_const.APPOINTMENT_CLASSES.RECURRENCE_ICON} dx-icon-repeat`).attr("aria-label", _const.RECURRING_LABEL).attr("role", "img").appendTo($container)
}
const $contentDetails = (0, _renderer.default)("").addClass(_const.APPOINTMENT_CLASSES.DETAILS).appendTo($container);
(0, _renderer.default)(" ").addClass(_const.APPOINTMENT_CLASSES.DATE).text(this.getDateText()).appendTo($contentDetails);
if (this.isAllDay()) {
(0, _renderer.default)(" ").text(_const.ALL_DAY_TEXT).addClass(_const.APPOINTMENT_CLASSES.ALL_DAY_TEXT).prependTo($contentDetails)
}
return $container
}
async applyElementColor() {
const color = await this.option().getResourceColor();
if (color) {
this.$element().addClass(_const.APPOINTMENT_TYPE_CLASSES.HAS_RESOURCE);
this.$element().css("backgroundColor", color)
}
}
}
exports.GridAppointmentView = GridAppointmentView
},
82241(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentCollector = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/date */ 38662));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _empty_template = __webpack_require__( /*! ../../../core/templates/empty_template */ 48650);
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 64973));
var _m_function_template = __webpack_require__( /*! ../../core/templates/m_function_template */ 88969);
var _const = __webpack_require__( /*! ./const */ 91167);
var _view_item = __webpack_require__( /*! ./view_item */ 49269);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class AppointmentCollector extends _view_item.ViewItem {
get appointmentsCount() {
return this.option().appointmentsData.length
}
_init() {
super._init();
this.defaultAppointmentCollectorTemplate = new _m_function_template.FunctionTemplate(options => {
this.defaultAppointmentCollectorContent((0, _renderer.default)(options.container))
})
}
_initMarkup() {
super._initMarkup();
this.resize();
this.applyElementClasses();
this.applyElementAria();
this.attachFocusEvents();
this.attachKeydownEvents();
this.renderContentTemplate()
}
resize(geometry) {
var _this$buttonInstance;
const newGeometry = geometry ?? this.option().geometry;
const {
top: top,
left: left,
width: width,
height: height
} = newGeometry;
this.$element().css({
top: top,
left: left
});
null === (_this$buttonInstance = this.buttonInstance) || void 0 === _this$buttonInstance || _this$buttonInstance.option({
width: width,
height: height
})
}
setTabIndex(tabIndex) {
var _this$buttonInstance2;
super.setTabIndex(tabIndex);
null === (_this$buttonInstance2 = this.buttonInstance) || void 0 === _this$buttonInstance2 || _this$buttonInstance2.option("tabIndex", tabIndex)
}
applyElementClasses() {
this.$element().addClass(_const.APPOINTMENT_COLLECTOR_CLASSES.CONTAINER).toggleClass(_const.APPOINTMENT_COLLECTOR_CLASSES.COMPACT, this.option().isCompact)
}
applyElementAria() {
const localizeDate = date => `${_date.default.format(date,"monthAndDay")}, ${_date.default.format(date,"year")}`;
const {
targetedAppointmentData: targetedAppointmentData
} = this.option();
const startDateText = localizeDate(targetedAppointmentData.displayStartDate);
const endDateText = localizeDate(targetedAppointmentData.displayEndDate);
const dateText = startDateText === endDateText ? startDateText : `${startDateText} - ${endDateText}`;
this.$element().attr("aria-roledescription", dateText)
}
renderContentTemplate() {
const template = this.option().appointmentCollectorTemplate instanceof _empty_template.EmptyTemplate ? this.defaultAppointmentCollectorTemplate : this.option().appointmentCollectorTemplate;
this.buttonInstance = this._createComponent(this.$element(), _button.default, {
type: "default",
tabIndex: this.option().tabIndex,
width: this.option().geometry.width,
height: this.option().geometry.height,
template: new _m_function_template.FunctionTemplate(e => template.render({
container: e.container,
model: {
appointmentCount: this.appointmentsCount,
isCompact: this.option().isCompact,
items: this.option().appointmentsData
}
})),
onClick: this.onClick.bind(this)
})
}
defaultAppointmentCollectorContent($container) {
const count = this.appointmentsCount;
const text = this.option().isCompact ? count : _message.default.getFormatter("dxScheduler-moreAppointments")(count);
(0, _renderer.default)(" ").text(text).appendTo($container);
$container.addClass(_const.APPOINTMENT_COLLECTOR_CLASSES.CONTENT);
return $container
}
}
exports.AppointmentCollector = AppointmentCollector;
(0, _component_registrator.default)("dxSchedulerNewAppointmentCollector", AppointmentCollector)
},
72025(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentsFocusController = void 0;
var _renderer = (e = __webpack_require__( /*! ../../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
var _m_short = __webpack_require__( /*! ../../events/m_short */ 43926);
var _appointment_groups_utils = __webpack_require__( /*! ../utils/resource_manager/appointment_groups_utils */ 11649);
exports.AppointmentsFocusController = class {
get sortedAppointments() {
return this.appointments.option().getSortedAppointments()
}
get isVirtualScrolling() {
return this.appointments.option().isVirtualScrolling()
}
get tabIndex() {
return this.appointments.option().tabIndex
}
constructor(appointments) {
this.appointments = appointments;
this.focusableSortedIndex = 0;
this.needRestoreFocusIndex = -1
}
onViewItemClick(viewItem) {
this.focusViewItem(viewItem)
}
onViewItemFocusIn() {}
onViewItemFocusOut(e) {
const focusEvent = e.originalEvent;
const $relatedTarget = (0, _renderer.default)(focusEvent.relatedTarget);
const {
$commonContainer: $commonContainer,
$allDayContainer: $allDayContainer
} = this.appointments;
const isFocusOutside = 0 === $relatedTarget.length || 0 === $relatedTarget.closest($commonContainer).length && 0 === (null === $relatedTarget || void 0 === $relatedTarget ? void 0 : $relatedTarget.closest($allDayContainer ?? (0, _renderer.default)()).length);
if (isFocusOutside) {
this.resetTabIndex(0)
}
}
onViewItemKeyDown(viewItem, e) {
if ("Tab" === e.key) {
this.handleTabKeyDown(e, viewItem.option().sortedIndex)
}
}
resetTabIndex(newFocusableIndex) {
var _this$appointments$ge2;
if (this.needRestoreFocusIndex >= 0) {
const viewItem = this.appointments.getViewItemBySortedIndex(this.needRestoreFocusIndex);
null === viewItem || void 0 === viewItem || viewItem.setTabIndex(this.tabIndex);
_m_short.focus.trigger(null === viewItem || void 0 === viewItem ? void 0 : viewItem.$element());
this.focusableSortedIndex = this.needRestoreFocusIndex;
this.needRestoreFocusIndex = -1;
return
}
if (void 0 !== newFocusableIndex) {
var _this$appointments$ge;
null === (_this$appointments$ge = this.appointments.getViewItemBySortedIndex(this.focusableSortedIndex)) || void 0 === _this$appointments$ge || _this$appointments$ge.setTabIndex(-1);
this.focusableSortedIndex = newFocusableIndex
}
null === (_this$appointments$ge2 = this.appointments.getViewItemBySortedIndex(this.focusableSortedIndex)) || void 0 === _this$appointments$ge2 || _this$appointments$ge2.setTabIndex(this.tabIndex)
}
handleTabKeyDown(e, sortedIndex) {
const nextIndex = sortedIndex + (e.shift ? -1 : 1);
const nextItemData = this.sortedAppointments[nextIndex];
if (!nextItemData) {
return
}
e.originalEvent.preventDefault();
this.focusByItemData(nextItemData)
}
focusByItemData(itemData) {
if (this.isVirtualScrolling) {
this.scrollToItem(itemData)
}
const viewItem = this.appointments.getViewItemBySortedIndex(itemData.sortedIndex);
if (viewItem) {
this.focusViewItem(viewItem)
} else if (this.isVirtualScrolling) {
this.needRestoreFocusIndex = itemData.sortedIndex
}
}
focusViewItem(viewItem) {
this.resetTabIndex(viewItem.option().sortedIndex);
_m_short.focus.trigger(null === viewItem || void 0 === viewItem ? void 0 : viewItem.$element())
}
scrollToItem(itemData) {
const {
getStartViewDate: getStartViewDate,
getResourceManager: getResourceManager,
scrollTo: scrollTo
} = this.appointments.option();
const date = new Date(Math.max(getStartViewDate().getTime(), itemData.source.startDate));
const group = (0, _appointment_groups_utils.getRawAppointmentGroupValues)(itemData.itemData, getResourceManager().resources);
scrollTo(date, {
group: group,
allDay: itemData.allDay
})
}
}
},
30820(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Appointments = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _m_dom_adapter = __webpack_require__( /*! ../../core/m_dom_adapter */ 62018);
var _m_empty_template = __webpack_require__( /*! ../../core/templates/m_empty_template */ 11768);
var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../core/widget/dom_component */ 22331));
var _agenda_appointment = __webpack_require__( /*! ./appointment/agenda_appointment */ 61954);
var _grid_appointment = __webpack_require__( /*! ./appointment/grid_appointment */ 3902);
var _appointment_collector = __webpack_require__( /*! ./appointment_collector */ 82241);
var _appointments = __webpack_require__( /*! ./appointments.focus_controller */ 72025);
var _const = __webpack_require__( /*! ./const */ 91167);
var _get_targeted_appointment = __webpack_require__( /*! ./utils/get_targeted_appointment */ 63491);
var _get_view_model_diff = __webpack_require__( /*! ./utils/get_view_model_diff */ 21010);
var _type_helpers = __webpack_require__( /*! ./utils/type_helpers */ 52074);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class Appointments extends _dom_component.default {
constructor() {
super(...arguments);
this.viewItemBySortedIndex = {};
this.viewItems = []
}
getViewItemByIndex(index) {
return this.viewItems[index]
}
getViewItemBySortedIndex(sortedIndex) {
return this.viewItemBySortedIndex[sortedIndex]
}
get $allDayContainer() {
return this.option().$allDayContainer
}
get $commonContainer() {
return this.$element()
}
_init() {
super._init();
this.focusController = new _appointments.AppointmentsFocusController(this);
this._templateManager.addDefaultTemplates({
appointment: new _m_empty_template.EmptyTemplate,
appointmentCollector: new _m_empty_template.EmptyTemplate
});
if ("item" === this.option().appointmentTemplate) {
this.option("appointmentTemplate", "appointment")
}
}
_initMarkup() {
super._initMarkup();
this.$element().addClass(_const.APPOINTMENTS_CONTAINER_CLASS)
}
_getDefaultOptions() {
return Object.assign({}, super._getDefaultOptions(), {
tabIndex: 0,
viewModel: [],
$allDayContainer: null,
appointmentTemplate: "appointment",
appointmentCollectorTemplate: "appointmentCollector",
onAppointmentRendered: () => {}
})
}
_optionChanged(args) {
switch (args.name) {
case "items":
this.option("viewModel", args.value);
break;
case "viewModel": {
if ("agenda" === this.option().currentView) {
this.renderViewModel(args.value);
break
}
const diff = this.getViewModelDiff(args.previousValue ?? [], args.value ?? []);
this.renderViewModelDiff(diff);
break
}
case "appointmentCollectorTemplate":
case "appointmentTemplate":
if ("appointmentTemplate" === args.name && "item" === args.value) {
this.option("appointmentTemplate", "appointment");
break
}
this.renderViewModel(this.option().viewModel);
break;
case "tabIndex":
this.focusController.resetTabIndex()
}
}
updateResizableArea() {}
moveAppointmentBack() {}
focus() {}
_renderAppointmentTemplate() {}
getViewModelDiff(oldViewModel, newViewModel) {
const isPreviousAgenda = oldViewModel.length && (0, _type_helpers.isAgendaAppointmentViewModel)(oldViewModel[0]);
const normalizedOldViewModel = isPreviousAgenda ? [] : oldViewModel;
return (0, _get_view_model_diff.getViewModelDiff)(normalizedOldViewModel, newViewModel, this.option().getAppointmentDataSource())
}
renderViewModel() {
var _this$$allDayContaine, _this$$allDayContaine2;
let viewModel = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
const allDayFragment = _m_dom_adapter.domAdapter.createDocumentFragment();
const commonFragment = _m_dom_adapter.domAdapter.createDocumentFragment();
this.viewItemBySortedIndex = {};
null === (_this$$allDayContaine = this.$allDayContainer) || void 0 === _this$$allDayContaine || _this$$allDayContaine.empty();
this.$commonContainer.empty();
viewModel.forEach((viewModelItem, index) => {
const container = "agenda" === this.option().currentView || !viewModelItem.allDay ? commonFragment : allDayFragment;
const viewItem = this.renderViewItem(container, viewModelItem, index);
this.viewItemBySortedIndex[viewModelItem.sortedIndex] = viewItem
});
this.viewItems = Object.values(this.viewItemBySortedIndex);
null === (_this$$allDayContaine2 = this.$allDayContainer) || void 0 === _this$$allDayContaine2 || _this$$allDayContaine2.get(0).appendChild(allDayFragment);
this.$commonContainer.get(0).appendChild(commonFragment);
this.focusController.resetTabIndex()
}
renderViewModelDiff(viewModelDiff) {
var _this$$allDayContaine4;
const allDayFragment = _m_dom_adapter.domAdapter.createDocumentFragment();
const commonFragment = _m_dom_adapter.domAdapter.createDocumentFragment();
const newViewItemBySortedIndex = {};
const isRepaintAll = viewModelDiff.every(item => Boolean(item.needToAdd ?? item.needToRemove));
if (isRepaintAll) {
var _this$$allDayContaine3;
null === (_this$$allDayContaine3 = this.$allDayContainer) || void 0 === _this$$allDayContaine3 || _this$$allDayContaine3.empty();
this.$commonContainer.empty()
}
viewModelDiff.forEach((diffItem, index) => {
const {
allDay: allDay,
sortedIndex: sortedIndex
} = diffItem.item;
const lookupIndex = diffItem.oldSortedIndex ?? sortedIndex;
const viewItem = this.viewItemBySortedIndex[lookupIndex];
switch (true) {
case diffItem.needToRemove:
if (isRepaintAll) {
break
}
viewItem.$element().remove();
break;
case diffItem.needToAdd: {
const fragment = allDay ? allDayFragment : commonFragment;
const newViewItem = this.renderViewItem(fragment, diffItem.item, index);
newViewItemBySortedIndex[sortedIndex] = newViewItem;
break
}
default:
if (diffItem.needToResize) {
viewItem.resize({
height: diffItem.item.height,
width: diffItem.item.width,
top: diffItem.item.top,
left: diffItem.item.left
})
}
viewItem.option("sortedIndex", sortedIndex);
newViewItemBySortedIndex[sortedIndex] = viewItem
}
});
this.viewItemBySortedIndex = newViewItemBySortedIndex;
this.viewItems = Object.values(this.viewItemBySortedIndex);
null === (_this$$allDayContaine4 = this.$allDayContainer) || void 0 === _this$$allDayContaine4 || _this$$allDayContaine4.get(0).appendChild(allDayFragment);
this.$commonContainer.get(0).appendChild(commonFragment);
this.focusController.resetTabIndex()
}
renderViewItem(fragment, appointmentViewModel, index) {
const $element = (0, _renderer.default)("");
fragment.appendChild($element.get(0));
const targetedAppointmentData = this.getTargetedAppointmentData(appointmentViewModel);
const baseViewItemConfig = {
tabIndex: -1,
sortedIndex: appointmentViewModel.sortedIndex,
onFocusIn: this.focusController.onViewItemFocusIn.bind(this.focusController),
onFocusOut: this.focusController.onViewItemFocusOut.bind(this.focusController),
onClick: this.focusController.onViewItemClick.bind(this.focusController),
onKeyDown: this.focusController.onViewItemKeyDown.bind(this.focusController)
};
if ((0, _type_helpers.isCollectorViewModel)(appointmentViewModel)) {
return this._createComponent($element, _appointment_collector.AppointmentCollector, Object.assign({}, baseViewItemConfig, {
appointmentsData: appointmentViewModel.items.map(item => item.itemData),
isCompact: appointmentViewModel.isCompact,
geometry: {
height: appointmentViewModel.height,
width: appointmentViewModel.width,
top: appointmentViewModel.top,
left: appointmentViewModel.left
},
targetedAppointmentData: targetedAppointmentData,
appointmentCollectorTemplate: this._getTemplateByOption("appointmentCollectorTemplate")
}))
}
const baseAppointmentViewConfig = Object.assign({}, baseViewItemConfig, {
index: index,
appointmentTemplate: this._getTemplateByOption("appointmentTemplate"),
appointmentData: appointmentViewModel.itemData,
targetedAppointmentData: targetedAppointmentData,
onRendered: this.option().onAppointmentRendered,
getResourceColor: this.getResourceColor.bind(this, appointmentViewModel),
getDataAccessor: this.option().getDataAccessor
});
if ((0, _type_helpers.isGridAppointmentViewModel)(appointmentViewModel)) {
return this._createComponent($element, _grid_appointment.GridAppointmentView, Object.assign({}, baseAppointmentViewConfig, {
geometry: {
height: appointmentViewModel.height,
width: appointmentViewModel.width,
top: appointmentViewModel.top,
left: appointmentViewModel.left
},
modifiers: {
empty: appointmentViewModel.empty
}
}))
}
return this._createComponent($element, _agenda_appointment.AgendaAppointmentView, Object.assign({}, baseAppointmentViewConfig, {
modifiers: {
isLastInGroup: appointmentViewModel.isLastInGroup
},
geometry: {
height: appointmentViewModel.height,
width: appointmentViewModel.width
},
getResourcesValues: this.getResourcesValues.bind(this)
}))
}
getTargetedAppointmentData(appointmentViewModel) {
const normalizedAppointmentViewModel = (0, _type_helpers.isCollectorViewModel)(appointmentViewModel) ? appointmentViewModel.items[0] : appointmentViewModel;
return (0, _get_targeted_appointment.getTargetedAppointment)(normalizedAppointmentViewModel, this.option().getDataAccessor(), this.option().getResourceManager())
}
getResourceColor(appointmentViewModel) {
const resourceManager = this.option().getResourceManager();
return resourceManager.getAppointmentColor({
itemData: appointmentViewModel.itemData,
groupIndex: appointmentViewModel.groupIndex
})
}
getResourcesValues(appointmentData) {
const resourceManager = this.option().getResourceManager();
return resourceManager.getAppointmentResourcesValues(appointmentData)
}
}
exports.Appointments = Appointments;
(0, _component_registrator.default)("dxSchedulerNewAppointments", Appointments)
},
91167(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RECURRING_LABEL = exports.FOCUSED_STATE_CLASS = exports.APPOINTMENT_TYPE_CLASSES = exports.APPOINTMENT_COLLECTOR_CLASSES = exports.APPOINTMENT_CLASSES = exports.APPOINTMENTS_CONTAINER_CLASS = exports.ALL_DAY_TEXT = exports.AGENDA_APPOINTMENT_CLASSES = void 0;
var _message = (e = __webpack_require__( /*! ../../../common/core/localization/message */ 4671), e && e.__esModule ? e : {
default: e
});
var e;
exports.ALL_DAY_TEXT = ` ${_message.default.format("dxScheduler-allDay")}: `;
exports.RECURRING_LABEL = _message.default.format("dxScheduler-appointmentAriaLabel-recurring");
exports.APPOINTMENTS_CONTAINER_CLASS = "dx-scheduler-scrollable-appointments";
exports.APPOINTMENT_COLLECTOR_CLASSES = {
CONTAINER: "dx-scheduler-appointment-collector",
COMPACT: "dx-scheduler-appointment-collector-compact",
CONTENT: "dx-scheduler-appointment-collector-content"
};
exports.APPOINTMENT_TYPE_CLASSES = {
EMPTY: "dx-scheduler-appointment-empty",
ALL_DAY: "dx-scheduler-all-day-appointment",
RECURRING: "dx-scheduler-appointment-recurrence",
HAS_RESOURCE: "dx-scheduler-appointment-has-resource-color"
};
exports.APPOINTMENT_CLASSES = {
CONTAINER: "dx-scheduler-appointment",
CONTENT: "dx-scheduler-appointment-content",
ARIA_DESCRIPTION: "dx-scheduler-appointment-aria-description",
STRIP: "dx-scheduler-appointment-strip",
TITLE: "dx-scheduler-appointment-title",
RECURRENCE_ICON: "dx-scheduler-appointment-recurrence-icon",
DETAILS: "dx-scheduler-appointment-content-details",
DATE: "dx-scheduler-appointment-content-date",
ALL_DAY_TEXT: "dx-scheduler-appointment-content-allday"
};
exports.AGENDA_APPOINTMENT_CLASSES = {
LEFT_LAYOUT: "dx-scheduler-agenda-appointment-left-layout",
RIGHT_LAYOUT: "dx-scheduler-agenda-appointment-right-layout",
LAST_IN_DATE: "dx-scheduler-last-in-date-agenda-appointment",
MARKER: "dx-scheduler-agenda-appointment-marker",
RESOURCE_LIST: "dx-scheduler-appointment-resource-list",
RESOURCE_ITEM: "dx-scheduler-appointment-resource-item",
RESOURCE_ITEM_VALUE: "dx-scheduler-appointment-resource-item-value"
};
exports.FOCUSED_STATE_CLASS = "dx-state-focused"
},
4995(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDateTextFromTargetAppointment = exports.getDateText = exports.getDateFormatType = exports.DateFormatType = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/date */ 38662));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 41380));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
var DateFormatType;
! function(DateFormatType) {
DateFormatType.DATETIME = "DATETIME";
DateFormatType.TIME = "TIME";
DateFormatType.DATE = "DATE"
}(DateFormatType || (exports.DateFormatType = DateFormatType = {}));
const getDateFormatType = (startDate, endDate, isAllDay, viewType) => {
if (isAllDay) {
return DateFormatType.DATE
}
if ("month" !== viewType && _date2.default.sameDate(startDate, endDate)) {
return DateFormatType.TIME
}
return DateFormatType.DATETIME
};
exports.getDateFormatType = getDateFormatType;
const getDateText = (startDate, endDate, formatType) => {
const isSameDate = _date2.default.sameDate(startDate, endDate);
switch (formatType) {
case DateFormatType.DATETIME:
return [_date.default.format(startDate, "monthandday"), " ", _date.default.format(startDate, "shorttime"), " - ", isSameDate ? "" : `${_date.default.format(endDate,"monthandday")} `, _date.default.format(endDate, "shorttime")].join("");
case DateFormatType.TIME:
return `${_date.default.format(startDate,"shorttime")} - ${_date.default.format(endDate,"shorttime")}`;
case DateFormatType.DATE:
return `${_date.default.format(startDate,"monthandday")}${isSameDate?"":` - ${_date.default.format(endDate,"monthandday")}`}`;
default:
return ""
}
};
exports.getDateText = getDateText;
exports.getDateTextFromTargetAppointment = (targetedAppointmentData, format, viewType) => {
const {
displayStartDate: startDate,
displayEndDate: endDate,
allDay: allDay
} = targetedAppointmentData;
const formatType = format ?? getDateFormatType(startDate, endDate, allDay, viewType);
return getDateText(startDate, endDate, formatType)
}
},
63491(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTargetedAppointment = void 0;
var _appointment_groups_utils = __webpack_require__( /*! ../../../scheduler/utils/resource_manager/appointment_groups_utils */ 11649);
var _group_utils = __webpack_require__( /*! ../../../scheduler/utils/resource_manager/group_utils */ 76131);
exports.getTargetedAppointment = (appointmentViewModel, dataAccessor, resourceManager) => {
const {
info: info,
itemData: itemData
} = appointmentViewModel;
const displayDates = "partialDates" in info ? info.partialDates : info.appointment;
const targetedAppointment = Object.assign({}, itemData, {
displayStartDate: new Date(displayDates.startDate),
displayEndDate: new Date(displayDates.endDate)
});
dataAccessor.set("startDate", targetedAppointment, new Date(info.sourceAppointment.startDate));
dataAccessor.set("endDate", targetedAppointment, new Date(info.sourceAppointment.endDate));
((targetedAppointment, appointmentViewModel, resourceManager) => {
const {
groups: groups,
resourceById: resourceById,
groupsLeafs: groupsLeafs
} = resourceManager;
if (groups.length) {
const cellGroups = (0, _group_utils.getLeafGroupValues)(groupsLeafs, appointmentViewModel.groupIndex);
(0, _appointment_groups_utils.setAppointmentGroupValues)(targetedAppointment, resourceById, cellGroups)
}
})(targetedAppointment, appointmentViewModel, resourceManager);
return targetedAppointment
}
},
21010(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getViewModelDiff = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _type_helpers = __webpack_require__( /*! ./type_helpers */ 52074);
const getObjectToCompare = (item, includeDimensions) => {
const result = (0, _type_helpers.isCollectorViewModel)(item) ? {
allDay: item.allDay,
groupIndex: item.groupIndex,
items: item.items.length
} : {
allDay: item.allDay,
groupIndex: item.groupIndex,
direction: item.direction,
reduced: item.reduced,
partIndex: item.partIndex,
partTotalCount: item.partTotalCount,
rowIndex: item.rowIndex,
columnIndex: item.columnIndex
};
return includeDimensions ? Object.assign({}, result, {
left: item.left,
top: item.top,
height: item.height,
width: item.width
}) : result
};
exports.getViewModelDiff = (oldViewModel, newViewModel, appointmentDataSource) => {
const result = function(options) {
const {
a: a,
b: b,
match: match,
equal: equal,
canResize: canResize
} = options;
const n = a.length;
const m = b.length;
const dp = Array.from({
length: n + 1
}, () => new Array(m + 1).fill(0));
for (let i = 1; i <= n; i += 1) {
const ai = a[i - 1];
for (let j = 1; j <= m; j += 1) {
dp[i][j] = match(ai, b[j - 1]) ? dp[i - 1][j - 1] + 1 : Math.max(dp[i - 1][j], dp[i][j - 1])
}
}
const result = [];
let i = n;
let j = m;
while (i > 0 && j > 0) {
const ai = a[i - 1];
const bj = b[j - 1];
if (match(ai, bj)) {
if (equal(ai, bj)) {
result.push({
item: bj,
oldSortedIndex: ai.sortedIndex
})
} else if (canResize(ai, bj)) {
result.push({
item: bj,
needToResize: true,
oldSortedIndex: ai.sortedIndex
})
} else {
result.push({
item: ai,
needToRemove: true
});
result.push({
item: bj,
needToAdd: true
})
}
i -= 1;
j -= 1
} else if (dp[i - 1][j] >= dp[i][j - 1]) {
result.push({
item: ai,
needToRemove: true
});
i -= 1
} else {
result.push({
item: bj,
needToAdd: true
});
j -= 1
}
}
while (i > 0) {
result.push({
item: a[i - 1],
needToRemove: true
});
i -= 1
}
while (j > 0) {
result.push({
item: b[j - 1],
needToAdd: true
});
j -= 1
}
result.reverse();
return result
}({
a: oldViewModel,
b: newViewModel,
match: (a, b) => a.itemData === b.itemData && !((appointmentData, appointmentDataSource) => {
const updatedAppointmentData = appointmentDataSource.getUpdatedAppointment();
if (updatedAppointmentData === appointmentData) {
return true
}
const updateAppointmentKeys = appointmentDataSource.getUpdatedAppointmentKeys();
return updateAppointmentKeys.some(item => appointmentData[item.key] === item.value)
})(b.itemData, appointmentDataSource),
equal: (a, b) => (0, _common.equalByValue)(getObjectToCompare(a, true), getObjectToCompare(b, true)),
canResize: (a, b) => (0, _common.equalByValue)(getObjectToCompare(a, false), getObjectToCompare(b, false))
});
return result
}
},
52074(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isGridAppointmentViewModel = exports.isCollectorViewModel = exports.isAgendaAppointmentViewModel = void 0;
const isAgendaAppointmentViewModel = appointmentViewModel => "isAgendaModel" in appointmentViewModel;
exports.isAgendaAppointmentViewModel = isAgendaAppointmentViewModel;
const isCollectorViewModel = appointmentViewModel => "isCompact" in appointmentViewModel;
exports.isCollectorViewModel = isCollectorViewModel;
exports.isGridAppointmentViewModel = appointmentViewModel => !isAgendaAppointmentViewModel(appointmentViewModel) && !isCollectorViewModel(appointmentViewModel)
},
49269(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewItem = exports.EVENTS_NAMESPACE = void 0;
var _dom_component = (e = __webpack_require__( /*! ../../core/widget/dom_component */ 22331), e && e.__esModule ? e : {
default: e
});
var e;
var _m_short = __webpack_require__( /*! ../../events/m_short */ 43926);
const EVENTS_NAMESPACE = exports.EVENTS_NAMESPACE = {
namespace: "dxSchedulerViewItem"
};
class ViewItem extends _dom_component.default {
_getSynchronizableOptionsForCreateComponent() {
return super._getSynchronizableOptionsForCreateComponent()
}
_dispose() {
super._dispose();
_m_short.focus.off(this.$element(), EVENTS_NAMESPACE);
_m_short.keyboard.off(this.keyboardListenerId)
}
resize(geometry) {}
setTabIndex(tabIndex) {
this.option("tabIndex", tabIndex)
}
attachFocusEvents() {
_m_short.focus.off(this.$element(), EVENTS_NAMESPACE);
_m_short.focus.on(this.$element(), this.onFocusIn.bind(this), this.onFocusOut.bind(this), EVENTS_NAMESPACE)
}
attachKeydownEvents() {
_m_short.keyboard.off(this.keyboardListenerId);
this.keyboardListenerId = _m_short.keyboard.on(this.$element(), this.$element(), this.onKeyDown.bind(this))
}
onFocusIn() {
this.option().onFocusIn(this.option().sortedIndex)
}
onFocusOut(e) {
this.option().onFocusOut(e, this.option().sortedIndex)
}
onClick() {
this.option().onClick(this)
}
onKeyDown(e) {
this.option().onKeyDown(this, e)
}
}
exports.ViewItem = ViewItem
},
32060(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.default = class {
constructor(_ref) {
let {
scheduler: scheduler
} = _ref;
this.scheduler = scheduler
}
invoke(funcName) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key]
}
return this.scheduler.fire(funcName, ...args)
}
}
},
25307(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VERTICAL_VIEW_TYPES = exports.VERTICAL_GROUP_ORIENTATION = exports.LIST_ITEM_DATA_KEY = exports.LIST_ITEM_CLASS = exports.HORIZONTAL_GROUP_ORIENTATION = exports.APPOINTMENT_SETTINGS_KEY = void 0;
exports.LIST_ITEM_DATA_KEY = "dxListItemData";
exports.LIST_ITEM_CLASS = "dx-list-item";
exports.APPOINTMENT_SETTINGS_KEY = "dxAppointmentSettings";
exports.VERTICAL_GROUP_ORIENTATION = "vertical";
exports.HORIZONTAL_GROUP_ORIENTATION = "horizontal";
exports.VERTICAL_VIEW_TYPES = ["day", "week", "workWeek"]
},
23710(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.globalCache = exports.Cache = void 0;
var _type = __webpack_require__( /*! ../../core/utils/type */ 11528);
class Cache {
constructor() {
this.cache = new Map
}
get size() {
return this.cache.size
}
clear() {
this.cache.clear()
}
get(name) {
return this.cache.get(name)
}
memo(name, valueCallback) {
if (!this.cache.has(name)) {
const value = valueCallback();
if ((0, _type.isDefined)(value)) {
this.cache.set(name, value)
}
}
return this.cache.get(name)
}
delete(name) {
this.cache.delete(name)
}
}
exports.Cache = Cache;
exports.globalCache = {
timezones: new Cache,
DST: new Cache
}
},
71548(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Direction = void 0;
var Direction;
! function(Direction) {
Direction[Direction.Left = -1] = "Left";
Direction[Direction.Right = 1] = "Right"
}(Direction || (exports.Direction = Direction = {}))
},
52170(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 65951));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popover/ui.popover */ 98894));
var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 10720));
var _widget = _interopRequireDefault(__webpack_require__( /*! ../../core/widget/widget */ 89275));
var _calendar = _interopRequireDefault(__webpack_require__( /*! ../../ui/calendar/calendar */ 92874));
var _scrollable = _interopRequireDefault(__webpack_require__( /*! ../../ui/scroll_view/scrollable */ 85326));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class SchedulerCalendar extends _widget.default {
async show(target) {
var _this$overlay2;
if (!SchedulerCalendar.isMobileLayout()) {
var _this$overlay;
null === (_this$overlay = this.overlay) || void 0 === _this$overlay || _this$overlay.option("target", target)
}
await (null === (_this$overlay2 = this.overlay) || void 0 === _this$overlay2 ? void 0 : _this$overlay2.show())
}
async hide() {
var _this$overlay3;
await (null === (_this$overlay3 = this.overlay) || void 0 === _this$overlay3 ? void 0 : _this$overlay3.hide())
}
_keyboardHandler(opts) {
var _this$calendar;
return (null === (_this$calendar = this.calendar) || void 0 === _this$calendar ? void 0 : _this$calendar._keyboardHandler(opts)) ?? false
}
_init() {
super._init();
this.$element()
}
_render() {
super._render();
this.renderOverlay()
}
renderOverlay() {
this.$element().addClass("dx-scheduler-navigator-calendar-popover");
const isMobileLayout = SchedulerCalendar.isMobileLayout();
const overlayConfig = {
contentTemplate: () => this.createOverlayContent(),
onShown: () => {
var _this$calendar2;
null === (_this$calendar2 = this.calendar) || void 0 === _this$calendar2 || _this$calendar2.focus()
},
defaultOptionsRules: [{
device: () => isMobileLayout,
options: {
fullScreen: true,
showCloseButton: false,
toolbarItems: [{
shortcut: "cancel"
}],
_ignorePreventScrollEventsDeprecation: true,
preventScrollEvents: false,
enableBodyScroll: false
}
}]
};
if (isMobileLayout) {
this.overlay = this._createComponent(this.$element(), _ui2.default, overlayConfig)
} else {
this.overlay = this._createComponent(this.$element(), _ui.default, overlayConfig)
}
}
createOverlayContent() {
const result = (0, _renderer.default)(" ").addClass("dx-scheduler-navigator-calendar");
this.calendar = this._createComponent(result, _calendar.default, this.getCalendarOptions());
if (SchedulerCalendar.isMobileLayout()) {
const scrollable = this.createScrollable(result);
return scrollable.$element()
}
return result
}
createScrollable(content) {
const result = this._createComponent(" ", _scrollable.default, {
height: "auto",
direction: "both"
});
result.$content().append(content);
return result
}
_optionChanged(args) {
var _this$calendar3;
const {
name: name,
value: value
} = args;
if ("value" === name) {
null === (_this$calendar3 = this.calendar) || void 0 === _this$calendar3 || _this$calendar3.option("value", value)
}
}
getCalendarOptions() {
const {
value: value,
min: min,
max: max,
firstDayOfWeek: firstDayOfWeek,
focusStateEnabled: focusStateEnabled,
tabIndex: tabIndex,
onValueChanged: onValueChanged
} = this.option();
return {
value: value,
min: min,
max: max,
firstDayOfWeek: firstDayOfWeek,
focusStateEnabled: focusStateEnabled,
tabIndex: tabIndex,
onValueChanged: onValueChanged,
skipFocusCheck: true
}
}
static isMobileLayout() {
return !_devices.default.current().generic
}
}
exports.default = SchedulerCalendar;
(0, _component_registrator.default)("dxSchedulerCalendarPopup", SchedulerCalendar)
},
13842(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTodayButtonOptions = exports.getDateNavigator = exports.ITEMS_NAME = exports.DEFAULT_ITEMS = exports.CLASS = void 0;
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 52071);
var _date2 = __webpack_require__( /*! ../../core/utils/date */ 55594);
var _m_extend = __webpack_require__( /*! ../../core/utils/m_extend */ 96298);
var _constants = __webpack_require__( /*! ./constants */ 71548);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const CLASS = exports.CLASS = {
container: "dx-scheduler-navigator",
previousButton: "dx-scheduler-navigator-previous",
calendarButton: "dx-scheduler-navigator-caption",
nextButton: "dx-scheduler-navigator-next"
};
const ITEMS_NAME = exports.ITEMS_NAME = {
previousButton: "prev",
nextButton: "next",
calendarButton: "dateInterval"
};
const DEFAULT_ITEMS = exports.DEFAULT_ITEMS = [ITEMS_NAME.previousButton, ITEMS_NAME.nextButton, ITEMS_NAME.calendarButton];
const {
trimTime: trimTime
} = _date.default;
const isPreviousButtonDisabled = header => {
const minOption = header.option().min;
if (!_date2.dateUtilsTs.isValidDate(minOption)) {
return false
}
let min = new Date(minOption);
const caption = header.getCaption();
min = trimTime(min);
const previousDate = header.getNextDate(_constants.Direction.Left, caption.endDate);
return previousDate < min
};
const isNextButtonDisabled = header => {
const maxOption = header.option().max;
if (!_date2.dateUtilsTs.isValidDate(maxOption)) {
return false
}
const max = new Date(maxOption);
const caption = header.getCaption();
max.setHours(23, 59, 59);
const nextDate = header.getNextDate(_constants.Direction.Right, caption.startDate);
return nextDate > max
};
exports.getTodayButtonOptions = (header, item) => (0, _m_extend.extend)(true, {}, {
location: "before",
locateInMenu: "auto",
widget: "dxButton",
cssClass: "dx-scheduler-today",
options: {
text: _message.default.format("dxScheduler-navigationToday"),
icon: "today",
stylingMode: "outlined",
type: "normal",
onClick() {
const {
indicatorTime: indicatorTime
} = header.option();
header.updateCurrentDate(indicatorTime ?? new Date)
}
}
}, item);
exports.getDateNavigator = (header, item) => {
const stylingMode = (0, _themes.isMaterialBased)((0, _themes.current)()) ? "text" : "contained";
const config = (0, _m_extend.extend)(true, {}, {
location: "before",
name: "dateNavigator",
widget: "dxButtonGroup",
cssClass: CLASS.container,
options: {
stylingMode: stylingMode,
selectionMode: "none"
}
}, item);
const options = config.options;
const {
onItemClick: onItemClick
} = options;
const items = options.items ?? DEFAULT_ITEMS;
options.items = items.map(groupItem => {
switch (groupItem) {
case ITEMS_NAME.previousButton:
return (header => {
const ariaMessage = _message.default.format("dxScheduler-navigationPrevious");
return {
key: ITEMS_NAME.previousButton,
icon: "chevronprev",
elementAttr: {
class: CLASS.previousButton,
"aria-label": ariaMessage
},
clickHandler: () => header.updateDateByDirection(_constants.Direction.Left),
onContentReady: event => {
const previousButton = event.component;
previousButton.option("disabled", isPreviousButtonDisabled(header));
header.addEvent("min", () => {
previousButton.option("disabled", isPreviousButtonDisabled(header))
});
header.addEvent("currentDate", () => {
previousButton.option("disabled", isPreviousButtonDisabled(header))
});
header.addEvent("startViewDate", () => {
previousButton.option("disabled", isPreviousButtonDisabled(header))
})
}
}
})(header);
case ITEMS_NAME.nextButton:
return (header => {
const ariaMessage = _message.default.format("dxScheduler-navigationNext");
return {
key: ITEMS_NAME.nextButton,
icon: "chevronnext",
elementAttr: {
class: CLASS.nextButton,
"aria-label": ariaMessage
},
clickHandler: () => header.updateDateByDirection(_constants.Direction.Right),
onContentReady: event => {
const nextButton = event.component;
nextButton.option("disabled", isNextButtonDisabled(header));
header.addEvent("min", () => {
nextButton.option("disabled", isNextButtonDisabled(header))
});
header.addEvent("currentDate", () => {
nextButton.option("disabled", isNextButtonDisabled(header))
});
header.addEvent("startViewDate", () => {
nextButton.option("disabled", isNextButtonDisabled(header))
})
}
}
})(header);
case ITEMS_NAME.calendarButton:
return (header => ({
key: ITEMS_NAME.calendarButton,
text: header.captionText,
elementAttr: {
class: CLASS.calendarButton
},
clickHandler: event => header.showCalendar(event),
onContentReady: event => {
const calendarButton = event.component;
header.addEvent("currentView", () => {
calendarButton.option("text", header.captionText)
});
header.addEvent("currentDate", () => {
calendarButton.option("text", header.captionText)
});
header.addEvent("startViewDate", () => {
calendarButton.option("text", header.captionText)
});
header.addEvent("views", () => {
calendarButton.option("text", header.captionText)
});
header.addEvent("firstDayOfWeek", () => {
calendarButton.option("text", header.captionText)
})
}
}))(header);
default:
return groupItem
}
});
options.onItemClick = event => {
var _event$itemData$click, _event$itemData;
null === (_event$itemData$click = (_event$itemData = event.itemData).clickHandler) || void 0 === _event$itemData$click || _event$itemData$click.call(_event$itemData, event);
null === onItemClick || void 0 === onItemClick || onItemClick(event)
};
return config
}
},
84829(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SchedulerHeader = void 0;
__webpack_require__( /*! ../../../ui/drop_down_button */ 56582);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 65951));
var _errors = _interopRequireDefault(__webpack_require__( /*! ../../../core/errors */ 87129));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _data = __webpack_require__( /*! ../../../core/utils/data */ 31e3);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _toolbar = _interopRequireDefault(__webpack_require__( /*! ../../../ui/toolbar */ 2850));
var _widget = _interopRequireDefault(__webpack_require__( /*! ../../core/widget/widget */ 89275));
var _m_calendar = _interopRequireDefault(__webpack_require__( /*! ./m_calendar */ 52170));
var _m_date_navigator = __webpack_require__( /*! ./m_date_navigator */ 13842);
var _m_utils = __webpack_require__( /*! ./m_utils */ 25379);
var _m_view_switcher = __webpack_require__( /*! ./m_view_switcher */ 94791);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const CLASSES_component = "dx-scheduler-header",
CLASSES_invisible = "dx-state-invisible";
const ITEM_NAMES_today = "today",
ITEM_NAMES_dateNavigator = "dateNavigator",
ITEM_NAMES_viewSwitcher = "viewSwitcher";
class SchedulerHeader extends _widget.default {
get captionText() {
return this.getCaption().text
}
getIntervalOptions(date) {
const {
currentView: currentView,
firstDayOfWeek: firstDayOfWeek
} = this.option();
const step = (0, _m_utils.getStep)(currentView.type);
return {
date: date,
step: step,
firstDayOfWeek: firstDayOfWeek,
intervalCount: currentView.intervalCount,
agendaDuration: currentView.agendaDuration
}
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
_useShortDateFormat: !_devices.default.real().generic || _devices.default.isSimulator()
})
}
createEventMap() {
this.eventMap = new Map([
["currentView", []],
["views", []],
["currentDate", [this.getCalendarOptionUpdater("value")]],
["min", [this.getCalendarOptionUpdater("min")]],
["max", [this.getCalendarOptionUpdater("max")]],
["tabIndex", [this.repaint.bind(this)]],
["focusStateEnabled", [this.repaint.bind(this)]],
["useDropDownViewSwitcher", [this.repaint.bind(this)]],
["indicatorTime", []]
])
}
addEvent(name, event) {
const events = this.eventMap.get(name) ?? [];
this.eventMap.set(name, [...events, event])
}
_optionChanged(args) {
const {
name: name,
value: value
} = args;
const events = this.eventMap.get(name);
null === events || void 0 === events || events.forEach(event => {
event(value)
})
}
onToolbarOptionChanged(fullName, value) {
var _this$toolbar, _this$toolbar2, _this$toolbar3;
const parts = (0, _data.getPathParts)(fullName);
const optionName = fullName.replace(/^toolbar\./, "");
this.option(fullName, value);
this._toggleVisibility();
switch (true) {
case "toolbar" === fullName:
this.repaint();
break;
case "toolbar.items" === fullName:
null === (_this$toolbar = this.toolbar) || void 0 === _this$toolbar || _this$toolbar.option("items", value.map(item => this.parseItem(item)));
break;
case "items" === parts[1] && 3 === parts.length:
null === (_this$toolbar2 = this.toolbar) || void 0 === _this$toolbar2 || _this$toolbar2.option(optionName, this.parseItem(value));
break;
default:
null === (_this$toolbar3 = this.toolbar) || void 0 === _this$toolbar3 || _this$toolbar3.option(optionName, value)
}
}
_init() {
super._init();
this.createEventMap();
this.$element().addClass(CLASSES_component)
}
_render() {
super._render();
this.createEventMap();
this.renderToolbar();
this._toggleVisibility()
}
renderToolbar() {
const config = this.createToolbarConfig();
const toolbarElement = (0, _renderer.default)(" ");
toolbarElement.appendTo(this.$element());
this.toolbar = this._createComponent(toolbarElement, _toolbar.default, config)
}
_toggleVisibility() {
const {
toolbar: toolbar
} = this.option();
const isHeaderShown = toolbar.visible ?? toolbar.items.length;
if (isHeaderShown) {
this.$element().removeClass(CLASSES_invisible)
} else {
this.$element().addClass(CLASSES_invisible)
}
}
createToolbarConfig() {
const {
toolbar: toolbar
} = this.option();
const parsedItems = toolbar.items.map(element => this.parseItem(element));
return Object.assign({}, toolbar, {
items: parsedItems
})
}
parseItem(item) {
const itemName = "string" === typeof item ? item : item.name;
const itemOptions = "string" === typeof item ? {} : item;
if (itemName) {
switch (itemName) {
case ITEM_NAMES_today:
return (0, _m_date_navigator.getTodayButtonOptions)(this, itemOptions);
case ITEM_NAMES_viewSwitcher:
return this.option().useDropDownViewSwitcher ? (0, _m_view_switcher.getDropDownViewSwitcher)(this, itemOptions) : (0, _m_view_switcher.getTabViewSwitcher)(this, itemOptions);
case ITEM_NAMES_dateNavigator:
this.renderCalendar();
return (0, _m_date_navigator.getDateNavigator)(this, itemOptions);
default:
_errors.default.log(`Unknown default element type: ${itemName}`)
}
}
return (0, _extend.extend)(true, {}, item)
}
callEvent(event, arg) {
const events = this.eventMap.get(event);
null === events || void 0 === events || events.forEach(EventMapHandler => EventMapHandler(arg))
}
updateCurrentView(view) {
const {
onCurrentViewChange: onCurrentViewChange
} = this.option();
onCurrentViewChange(view.name)
}
updateCalendarValueAndCurrentDate(date) {
var _this$calendar;
this.updateCurrentDate(date);
null === (_this$calendar = this.calendar) || void 0 === _this$calendar || _this$calendar.option("value", date)
}
updateCurrentDate(date) {
const {
onCurrentDateChange: onCurrentDateChange
} = this.option();
onCurrentDateChange(date);
this.callEvent("currentDate", date)
}
renderCalendar() {
const {
currentDate: currentDate,
min: min,
max: max,
firstDayOfWeek: firstDayOfWeek,
focusStateEnabled: focusStateEnabled,
tabIndex: tabIndex
} = this.option();
this.calendar = this._createComponent(" ", _m_calendar.default, {
value: currentDate,
min: min,
max: max,
firstDayOfWeek: firstDayOfWeek,
focusStateEnabled: focusStateEnabled,
tabIndex: tabIndex,
onValueChanged: async e => {
var _this$calendar2;
this.updateCurrentDate(e.value);
await (null === (_this$calendar2 = this.calendar) || void 0 === _this$calendar2 ? void 0 : _this$calendar2.hide())
}
});
this.calendar.$element().appendTo(this.$element())
}
getCalendarOptionUpdater(name) {
return value => {
if (this.calendar) {
this.calendar.option(name, value)
}
}
}
getNextDate(direction, initialDate) {
const {
currentDate: currentDate
} = this.option();
const date = initialDate ?? currentDate;
const options = this.getIntervalOptions(date);
return (0, _m_utils.getNextIntervalDate)(options, direction)
}
getDisplayedDate() {
const {
startViewDate: startViewDate,
currentView: currentView
} = this.option();
const isMonth = "month" === currentView.type;
return isMonth ? (0, _m_utils.nextWeek)(startViewDate) : startViewDate
}
getCaptionOptions() {
const {
currentDate: currentDate,
startViewDate: startViewDate
} = this.option();
let date = currentDate;
if (startViewDate) {
date = this.getDisplayedDate()
}
date = _date.default.trimTime(date);
return this.getIntervalOptions(date)
}
getCaption() {
const {
customizeDateNavigatorText: customizeDateNavigatorText
} = this.option();
const options = this.getCaptionOptions();
const useShortDateFormat = this.option()._useShortDateFormat;
return (0, _m_utils.getCaption)(options, Boolean(useShortDateFormat), customizeDateNavigatorText)
}
updateDateByDirection(direction) {
const date = this.getNextDate(direction);
this.updateCalendarValueAndCurrentDate(date)
}
async showCalendar(e) {
var _this$calendar3;
await (null === (_this$calendar3 = this.calendar) || void 0 === _this$calendar3 ? void 0 : _this$calendar3.show(e.element))
}
}
exports.SchedulerHeader = SchedulerHeader;
(0, _component_registrator.default)("dxSchedulerHeader", SchedulerHeader)
},
25379(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.nextWeek = exports.getViewText = exports.getViewName = exports.getStep = exports.getNextIntervalDate = exports.getCaptionInterval = exports.getCaption = exports.formatViews = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/date */ 38662));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 33881));
var _m_inflector = __webpack_require__( /*! ../../core/utils/m_inflector */ 66122);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const {
correctDateWithUnitBeginning: getPeriodStart,
getFirstWeekDate: getWeekStart,
getLastMonthDay: getLastMonthDay,
addDateInterval: addDateInterval
} = _date2.default;
const {
format: formatDate
} = _date.default;
const MS_DURATION = {
milliseconds: 1
};
const DAY_DURATION = {
days: 1
};
const WEEK_DURATION = {
days: 7
};
const SATURDAY_INDEX = 6;
const SUNDAY_INDEX = 0;
const nextDay = date => addDateInterval(date, DAY_DURATION, 1);
const nextWeek = date => addDateInterval(date, WEEK_DURATION, 1);
exports.nextWeek = nextWeek;
const isWeekend = date => [SATURDAY_INDEX, SUNDAY_INDEX].includes(date.getDay());
const getIntervalStartDate = options => {
const {
date: date,
step: step,
firstDayOfWeek: firstDayOfWeek
} = options;
switch (step) {
case "day":
case "week":
case "month":
return getPeriodStart(date, step, false, firstDayOfWeek);
case "workWeek":
return (firstDayOfWeek => {
let date = new Date(firstDayOfWeek);
while (isWeekend(date)) {
date = nextDay(date)
}
return date
})(getWeekStart(date, firstDayOfWeek));
default:
return new Date(date)
}
};
const getPeriodEndDate = (currentPeriodStartDate, step, agendaDuration) => {
const calculators = {
day: () => nextDay(currentPeriodStartDate),
week: () => nextWeek(currentPeriodStartDate),
month: () => (date => {
const days = getLastMonthDay(date);
return addDateInterval(date, {
days: days
}, 1)
})(currentPeriodStartDate),
workWeek: () => (workWeekStart => {
let date = new Date(workWeekStart);
let workDaysCount = 0;
while (workDaysCount < 5) {
if (!isWeekend(date)) {
workDaysCount += 1
}
date = nextDay(date)
}
return date
})(currentPeriodStartDate),
agenda: () => ((date, agendaDuration) => addDateInterval(date, {
days: agendaDuration
}, 1))(currentPeriodStartDate, agendaDuration)
};
return date = calculators[step](), addDateInterval(date, MS_DURATION, -1);
var date
};
const getNextPeriodStartDate = (currentPeriodEndDate, step) => {
let date = (date => addDateInterval(date, MS_DURATION, 1))(currentPeriodEndDate);
if ("workWeek" === step) {
while (isWeekend(date)) {
date = nextDay(date)
}
}
return date
};
exports.getNextIntervalDate = (options, direction) => {
const {
date: date,
step: step,
intervalCount: intervalCount,
agendaDuration: agendaDuration
} = options;
let dayDuration = 0;
switch (step) {
case "day":
dayDuration = Number(intervalCount);
break;
case "week":
case "workWeek":
dayDuration = 7 * intervalCount;
break;
case "agenda":
dayDuration = agendaDuration ?? 0;
break;
case "month":
return ((date, intervalCount, direction) => {
const currentDate = date.getDate();
const currentMonthFirstDate = new Date(new Date(date.getTime()).setDate(1));
const thatMonthFirstDate = new Date(currentMonthFirstDate.setMonth(currentMonthFirstDate.getMonth() + intervalCount * direction));
const thatMonthDuration = getLastMonthDay(thatMonthFirstDate);
const minDate = currentDate < thatMonthDuration ? currentDate : thatMonthDuration;
const currentMonthMinDate = new Date(new Date(date.getTime()).setDate(minDate));
const thatMonthMinDate = new Date(currentMonthMinDate.setMonth(currentMonthMinDate.getMonth() + intervalCount * direction));
return thatMonthMinDate
})(date, intervalCount, direction)
}
return addDateInterval(date, {
days: dayDuration
}, direction)
};
const getDateMonthFormatter = isShort => {
const monthType = isShort ? "abbreviated" : "wide";
const months = _date.default.getMonthNames(monthType);
return date => {
const day = formatDate(date, "day");
const month = months[date.getMonth()];
return `${day} ${month}`
}
};
const formatMonthYear = date => {
const months = _date.default.getMonthNames("abbreviated");
const month = months[date.getMonth()];
const year = formatDate(date, "year");
return `${month} ${year}`
};
const getDateMonthYearFormatter = isShort => date => {
const dateMonthFormat = getDateMonthFormatter(isShort);
const dateMonth = dateMonthFormat(date);
const year = formatDate(date, "year");
return `${dateMonth} ${year}`
};
const getCaptionInterval = options => {
const startDate = getIntervalStartDate(options);
const endDate = ((startDate, options) => {
const {
intervalCount: intervalCount,
step: step,
agendaDuration: agendaDuration
} = options;
let periodStartDate = new Date(startDate);
let periodEndDate = new Date(startDate);
let nextPeriodStartDate = new Date(startDate);
for (let i = 0; i < intervalCount; i += 1) {
periodStartDate = nextPeriodStartDate;
periodEndDate = getPeriodEndDate(periodStartDate, step, agendaDuration ?? 0);
nextPeriodStartDate = getNextPeriodStartDate(periodEndDate, step)
}
return periodEndDate
})(startDate, options);
return {
startDate: startDate,
endDate: endDate
}
};
exports.getCaptionInterval = getCaptionInterval;
const formatCaptionByMonths = (startDate, endDate, isShort) => {
const isDifferentYears = startDate.getFullYear() !== endDate.getFullYear();
if (isDifferentYears) {
return ((startDate, endDate) => {
const firstDateText = formatDate(startDate, getDateMonthYearFormatter(true));
const lastDateDateText = formatDate(endDate, getDateMonthYearFormatter(true));
return `${firstDateText}-${lastDateDateText}`
})(startDate, endDate)
}
return ((startDate, endDate, isShort) => {
const isDifferentMonthDates = startDate.getMonth() !== endDate.getMonth();
const useShortFormat = isDifferentMonthDates || isShort;
const firstDateFormat = isDifferentMonthDates ? getDateMonthFormatter(useShortFormat) : "d";
const firstDateText = formatDate(startDate, firstDateFormat);
const lastDateText = formatDate(endDate, getDateMonthYearFormatter(useShortFormat));
return `${firstDateText}-${lastDateText}`
})(startDate, endDate, isShort)
};
const getCaptionText = (startDate, endDate, isShort, step) => {
if (_date2.default.sameDate(startDate, endDate)) {
return ((date, step, isShort) => {
const useShortFormat = "agenda" === step ? isShort : false;
const dateMonthFormat = getDateMonthFormatter(useShortFormat);
const dateMonth = dateMonthFormat(date);
const year = formatDate(date, "year");
return `${dateMonth} ${year}`
})(startDate, step, isShort)
}
if ("month" === step) {
return ((startDate, endDate) => {
if (_date2.default.sameMonth(startDate, endDate)) {
return String(formatDate(startDate, "monthandyear") ?? "")
}
const isSameYear = _date2.default.sameYear(startDate, endDate);
const firstDateText = isSameYear ? _date.default.getMonthNames("abbreviated")[startDate.getMonth()] : formatMonthYear(startDate);
const lastDateText = formatMonthYear(endDate);
return `${firstDateText}-${lastDateText}`
})(startDate, endDate)
}
return formatCaptionByMonths(startDate, endDate, isShort)
};
exports.getCaption = (options, isShort, customizationFunction) => {
const {
startDate: startDate,
endDate: endDate
} = getCaptionInterval(options);
let text = getCaptionText(startDate, endDate, isShort, options.step);
if ((0, _type.isFunction)(customizationFunction)) {
text = customizationFunction({
startDate: startDate,
endDate: endDate,
text: text
})
}
return {
startDate: startDate,
endDate: endDate,
text: text
}
};
const STEP_MAP = {
day: "day",
week: "week",
workWeek: "workWeek",
month: "month",
timelineDay: "day",
timelineWeek: "week",
timelineWorkWeek: "workWeek",
timelineMonth: "month",
agenda: "agenda"
};
const getViewName = view => {
if ((0, _type.isObject)(view)) {
return view.name ?? view.type
}
return view
};
exports.getViewName = getViewName;
const getViewText = view => view.name || _message.default.format(`dxScheduler-switcher${(0,_m_inflector.camelize)(view.type,true)}`);
exports.getViewText = getViewText;
exports.formatViews = views => views.map(view => Object.assign({}, view, {
name: getViewName(view),
text: getViewText(view)
}));
exports.getStep = type => STEP_MAP[type]
},
94791(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTabViewSwitcher = exports.getDropDownViewSwitcher = void 0;
var _themes = __webpack_require__( /*! ../../../ui/themes */ 52071);
var _m_utils = __webpack_require__( /*! ./m_utils */ 25379);
const ClASS_container = "dx-scheduler-view-switcher",
ClASS_dropDownButton = "dx-scheduler-view-switcher-dropdown-button",
ClASS_dropDownButtonContent = "dx-scheduler-view-switcher-dropdown-button-content";
const getViewsAndSelectedView = header => {
const {
views: views,
currentView: currentView
} = header.option();
const formattedViews = (0, _m_utils.formatViews)(views);
const selectedView = (0, _m_utils.getViewName)(currentView);
const isSelectedViewInViews = formattedViews.some(view => view.name === selectedView);
return {
selectedView: isSelectedViewInViews ? selectedView : void 0,
views: formattedViews
}
};
const isViewSwitcherVisible = views => views.length > 1;
exports.getTabViewSwitcher = (header, item) => {
const {
selectedView: selectedView,
views: views
} = getViewsAndSelectedView(header);
const isVisible = isViewSwitcherVisible(views);
const stylingMode = (0, _themes.isFluent)((0, _themes.current)()) ? "outlined" : "contained";
return Object.assign({
widget: "dxButtonGroup",
locateInMenu: "auto",
location: "after",
name: "viewSwitcher",
cssClass: ClASS_container,
visible: isVisible,
options: {
items: views,
keyExpr: "name",
selectedItemKeys: [selectedView],
stylingMode: stylingMode,
onItemClick: e => {
header.updateCurrentView(e.itemData)
},
onContentReady: e => {
const viewSwitcher = e.component;
header.addEvent("currentView", view => {
viewSwitcher.option("selectedItemKeys", [(0, _m_utils.getViewName)(view)])
})
}
}
}, item)
};
exports.getDropDownViewSwitcher = (header, item) => {
const {
selectedView: selectedView,
views: views
} = getViewsAndSelectedView(header);
const isVisible = isViewSwitcherVisible(views);
return Object.assign({
widget: "dxDropDownButton",
locateInMenu: "never",
location: "after",
name: "viewSwitcher",
cssClass: ClASS_container,
visible: isVisible,
options: {
items: views,
useSelectMode: true,
keyExpr: "name",
selectedItemKey: selectedView,
displayExpr: "text",
showArrowIcon: true,
elementAttr: {
class: ClASS_dropDownButton
},
onItemClick: e => {
header.updateCurrentView(e.itemData)
},
onContentReady: e => {
const viewSwitcher = e.component;
header.addEvent("currentView", view => {
viewSwitcher.option("selectedItemKey", (0, _m_utils.getViewName)(view))
})
},
dropDownOptions: {
width: "max-content",
_wrapperClassExternal: ClASS_dropDownButtonContent
}
}
}, item)
}
},
80621(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 64553));
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 52576);
var _draggable = _interopRequireDefault(__webpack_require__( /*! ../../ui/draggable */ 5298));
var _constants = __webpack_require__( /*! ./constants */ 25307);
var _is_scheduler_component = __webpack_require__( /*! ./utils/is_scheduler_component */ 28740);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.default = class {
constructor(scheduler) {
this.scheduler = scheduler;
this.workspace = this.scheduler._workSpace;
this.appointments = this.scheduler._appointments;
this.initialPosition = {
left: 0,
top: 0
};
this.appointmentInfo = null;
this.dragBetweenComponentsPromise = null
}
isAllDay(appointment) {
return appointment.data(_constants.APPOINTMENT_SETTINGS_KEY).allDay
}
onDragStart(e) {
const {
itemSettings: itemSettings,
itemData: itemData,
initialPosition: initialPosition
} = e;
this.initialPosition = initialPosition;
this.appointmentInfo = {
appointment: itemData,
settings: itemSettings
};
this.appointments.notifyObserver("hideAppointmentTooltip")
}
onDragMove(e) {
if (e.fromComponent !== e.toComponent) {
this.appointments.notifyObserver("removeDroppableCellClass")
}
}
getAppointmentElement(e) {
var _e$event$data;
const itemElement = (null === (_e$event$data = e.event.data) || void 0 === _e$event$data ? void 0 : _e$event$data.itemElement) || e.itemElement;
return (0, _renderer.default)(itemElement)
}
onDragEnd(event) {
const element = this.getAppointmentElement(event);
const isAllDay = this.isAllDay(element);
const rawAppointment = this.appointments._getItemData(element);
const container = this.appointments._getAppointmentContainer(isAllDay);
container.append(element);
const $targetCell = this.workspace.getDroppableCell();
const $dragCell = this.workspace.getCellByCoordinates(this.initialPosition, isAllDay);
this.appointments.notifyObserver("updateAppointmentAfterDrag", {
event: event,
element: element,
rawAppointment: rawAppointment,
isDropToTheSameCell: $targetCell.is($dragCell),
isDropToSelfScheduler: $targetCell.length > 0
})
}
onDragCancel() {
this.removeDroppableClasses()
}
getItemData(appointmentElement) {
const dataFromTooltip = (0, _renderer.default)(appointmentElement).data(_constants.LIST_ITEM_DATA_KEY);
const itemDataFromTooltip = null === dataFromTooltip || void 0 === dataFromTooltip ? void 0 : dataFromTooltip.appointment;
const itemDataFromGrid = this.appointments._getItemData(appointmentElement);
return itemDataFromTooltip || itemDataFromGrid
}
getItemSettings(appointment) {
const itemData = (0, _renderer.default)(appointment).data(_constants.LIST_ITEM_DATA_KEY);
return null === itemData || void 0 === itemData ? void 0 : itemData.settings
}
createDragStartHandler(options, appointmentDragging) {
return e => {
var _appointmentDragging$;
e.itemData = this.getItemData(e.itemElement);
e.itemSettings = this.getItemSettings(e.itemElement);
if (this.scheduler._isAppointmentBeingUpdated(e.itemData)) {
e.cancel = true;
return
}
null === (_appointmentDragging$ = appointmentDragging.onDragStart) || void 0 === _appointmentDragging$ || _appointmentDragging$.call(appointmentDragging, e);
if (!e.cancel) {
options.onDragStart(e)
}
}
}
createDragMoveHandler(options, appointmentDragging) {
return e => {
var _appointmentDragging$2;
if (!this.appointmentInfo) {
e.cancel = true;
return
}
if (this.scheduler._isAppointmentBeingUpdated(this.appointmentInfo.appointment)) {
e.cancel = true;
return
}
null === (_appointmentDragging$2 = appointmentDragging.onDragMove) || void 0 === _appointmentDragging$2 || _appointmentDragging$2.call(appointmentDragging, e);
if (!e.cancel) {
options.onDragMove(e)
}
}
}
createDragEndHandler(options, appointmentDragging) {
return e => {
var _appointmentDragging$3;
if (!this.appointmentInfo) {
e.cancel = true;
return
}
const updatedData = this.appointments.invoke("getUpdatedData", e.itemData);
this.appointmentInfo = null;
e.toItemData = (0, _extend.extend)({}, e.itemData, updatedData);
null === (_appointmentDragging$3 = appointmentDragging.onDragEnd) || void 0 === _appointmentDragging$3 || _appointmentDragging$3.call(appointmentDragging, e);
if (!e.cancel) {
options.onDragEnd(e);
if (e.fromComponent !== e.toComponent) {
var _appointmentDragging$4;
null === (_appointmentDragging$4 = appointmentDragging.onRemove) || void 0 === _appointmentDragging$4 || _appointmentDragging$4.call(appointmentDragging, e)
}
}
if (true === e.cancel) {
options.onDragCancel(e)
}
if (true !== e.cancel && (0, _is_scheduler_component.isSchedulerComponent)(e.toComponent)) {
const targetDragBehavior = e.toComponent._getDragBehavior();
targetDragBehavior.dragBetweenComponentsPromise = new _deferred.Deferred
}
}
}
createDropHandler(appointmentDragging) {
return e => {
const updatedData = this.appointments.invoke("getUpdatedData", e.itemData);
e.itemData = (0, _extend.extend)({}, e.itemData, updatedData);
if (e.fromComponent !== e.toComponent) {
var _appointmentDragging$5;
null === (_appointmentDragging$5 = appointmentDragging.onAdd) || void 0 === _appointmentDragging$5 || _appointmentDragging$5.call(appointmentDragging, e)
}
if (this.dragBetweenComponentsPromise) {
this.dragBetweenComponentsPromise.resolve()
}
}
}
addTo(container, config) {
const appointmentDragging = this.scheduler.option("appointmentDragging") || {};
const options = (0, _extend.extend)({
component: this.scheduler,
contentTemplate: null,
filter: ".dx-scheduler-appointment",
immediate: false,
onDragStart: this.onDragStart.bind(this),
onDragMove: this.onDragMove.bind(this),
onDragEnd: this.onDragEnd.bind(this),
onDragCancel: this.onDragCancel.bind(this)
}, config);
this.appointments._createComponent(container, _draggable.default, (0, _extend.extend)({}, options, appointmentDragging, {
onDragStart: this.createDragStartHandler(options, appointmentDragging),
onDragMove: this.createDragMoveHandler(options, appointmentDragging),
onDragEnd: this.createDragEndHandler(options, appointmentDragging),
onDrop: this.createDropHandler(appointmentDragging),
onCancelByEsc: true
}))
}
updateDragSource(appointment, settings) {
const {
appointmentInfo: appointmentInfo
} = this;
if (appointmentInfo || appointment) {
const currentAppointment = appointment || appointmentInfo.appointment;
const currentSettings = settings || appointmentInfo.settings;
this.appointments._setDragSourceAppointment(currentAppointment, currentSettings)
}
}
removeDroppableClasses() {
this.appointments._removeDragSourceClassFromDraggedAppointment();
this.workspace.removeDroppableCellClass()
}
}
},
80126(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VIRTUAL_CELL_CLASS = exports.VERTICAL_GROUP_COUNT_CLASSES = exports.TIME_PANEL_CLASS = exports.REDUCED_APPOINTMENT_PARTS_CLASSES = exports.REDUCED_APPOINTMENT_ICON = exports.REDUCED_APPOINTMENT_CLASS = exports.RECURRENCE_APPOINTMENT_CLASS = exports.LAST_GROUP_CELL_CLASS = exports.HEADER_CURRENT_TIME_CELL_CLASS = exports.GROUP_ROW_CLASS = exports.GROUP_HEADER_CONTENT_CLASS = exports.FIXED_CONTAINER_CLASS = exports.FIRST_GROUP_CELL_CLASS = exports.EMPTY_APPOINTMENT_CLASS = exports.DIRECTION_APPOINTMENT_CLASSES = exports.DATE_TABLE_ROW_CLASS = exports.DATE_TABLE_CLASS = exports.APPOINTMENT_ITEM_CLASS = exports.APPOINTMENT_HAS_RESOURCE_COLOR_CLASS = exports.APPOINTMENT_DRAG_SOURCE_CLASS = exports.APPOINTMENT_CONTENT_CLASSES = exports.ALL_DAY_APPOINTMENT_CLASS = exports.AGENDA_LAST_IN_DATE_APPOINTMENT_CLASS = void 0;
exports.FIXED_CONTAINER_CLASS = "dx-scheduler-fixed-appointments";
exports.REDUCED_APPOINTMENT_CLASS = "dx-scheduler-appointment-reduced";
exports.REDUCED_APPOINTMENT_ICON = "dx-scheduler-appointment-reduced-icon";
exports.RECURRENCE_APPOINTMENT_CLASS = "dx-scheduler-appointment-recurrence";
exports.EMPTY_APPOINTMENT_CLASS = "dx-scheduler-appointment-empty";
exports.ALL_DAY_APPOINTMENT_CLASS = "dx-scheduler-all-day-appointment";
exports.REDUCED_APPOINTMENT_PARTS_CLASSES = {
head: "dx-scheduler-appointment-head",
body: "dx-scheduler-appointment-body",
tail: "dx-scheduler-appointment-tail"
};
exports.DIRECTION_APPOINTMENT_CLASSES = {
horizontal: "dx-scheduler-appointment-horizontal",
vertical: "dx-scheduler-appointment-vertical"
};
exports.APPOINTMENT_DRAG_SOURCE_CLASS = "dx-scheduler-appointment-drag-source";
exports.APPOINTMENT_ITEM_CLASS = "dx-scheduler-appointment";
exports.APPOINTMENT_CONTENT_CLASSES = {
APPOINTMENT_CONTENT_DETAILS: "dx-scheduler-appointment-content-details",
RECURRING_ICON: "dx-scheduler-appointment-recurrence-icon",
APPOINTMENT_TITLE: "dx-scheduler-appointment-title",
APPOINTMENT_DATE: "dx-scheduler-appointment-content-date",
ALL_DAY_CONTENT: "dx-scheduler-appointment-content-allday",
ARIA_DESCRIPTION: "dx-scheduler-appointment-aria-description",
ITEM: "dx-scheduler-appointment",
STRIP: "dx-scheduler-appointment-strip",
AGENDA_MARKER: "dx-scheduler-agenda-appointment-marker",
AGENDA_RESOURCE_LIST: "dx-scheduler-appointment-resource-list",
AGENDA_RESOURCE_LIST_ITEM: "dx-scheduler-appointment-resource-item",
AGENDA_RESOURCE_LIST_ITEM_VALUE: "dx-scheduler-appointment-resource-item-value"
};
exports.AGENDA_LAST_IN_DATE_APPOINTMENT_CLASS = "dx-scheduler-last-in-date-agenda-appointment";
exports.APPOINTMENT_HAS_RESOURCE_COLOR_CLASS = "dx-scheduler-appointment-has-resource-color";
exports.HEADER_CURRENT_TIME_CELL_CLASS = "dx-scheduler-header-panel-current-time-cell";
exports.VIRTUAL_CELL_CLASS = "dx-scheduler-virtual-cell";
exports.TIME_PANEL_CLASS = "dx-scheduler-time-panel";
exports.DATE_TABLE_CLASS = "dx-scheduler-date-table";
exports.DATE_TABLE_ROW_CLASS = "dx-scheduler-date-table-row";
exports.GROUP_ROW_CLASS = "dx-scheduler-group-row";
exports.GROUP_HEADER_CONTENT_CLASS = "dx-scheduler-group-header-content";
exports.LAST_GROUP_CELL_CLASS = "dx-scheduler-last-group-cell";
exports.FIRST_GROUP_CELL_CLASS = "dx-scheduler-first-group-cell";
exports.VERTICAL_GROUP_COUNT_CLASSES = ["dx-scheduler-group-column-count-one", "dx-scheduler-group-column-count-two", "dx-scheduler-group-column-count-three"]
},
64787(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CompactAppointmentsHelper = void 0;
var _translator = __webpack_require__( /*! ../../common/core/animation/translator */ 88603);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../common/core/localization/date */ 38662));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../common/core/localization/message */ 4671));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 64553));
var _function_template = __webpack_require__( /*! ../../core/templates/function_template */ 38699);
var _button = _interopRequireDefault(__webpack_require__( /*! ../../ui/button */ 64973));
var _constants = __webpack_require__( /*! ./constants */ 25307);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.CompactAppointmentsHelper = class {
constructor(instance) {
this.elements = [];
this.instance = instance
}
render(options) {
const {
isCompact: isCompact,
items: items
} = options;
const template = this.createTemplate(items.length, isCompact);
const button = this.createCompactButton(template, options);
const $button = button.$element();
this.elements.push($button);
$button.data("items", items);
return $button
}
clear() {
this.elements.forEach(button => {
button.detach();
button.remove()
});
this.elements = []
}
onButtonClick(e, options) {
const $button = (0, _renderer.default)(e.element);
this.instance.showAppointmentTooltipCore($button, $button.data("items"), this.getExtraOptionsForTooltip(options, $button))
}
getExtraOptionsForTooltip(options, $appointmentCollector) {
return {
clickEvent: this.clickEvent(options.onAppointmentClick).bind(this),
dragBehavior: options.allowDrag && this.createTooltipDragBehavior($appointmentCollector).bind(this),
isButtonClick: true,
_loopFocus: true
}
}
clickEvent(onAppointmentClick) {
return e => {
const clickEventArgs = this.instance._createEventArgs(e);
onAppointmentClick(clickEventArgs)
}
}
createTooltipDragBehavior($appointmentCollector) {
return e => {
const $element = (0, _renderer.default)(e.element);
const $schedulerElement = (0, _renderer.default)(this.instance.element());
const workSpace = this.instance.getWorkSpace();
const initialPosition = (0, _translator.locate)($appointmentCollector);
const options = {
filter: `.${_constants.LIST_ITEM_CLASS}`,
isSetCursorOffset: true,
initialPosition: initialPosition,
getItemData: itemElement => {
var _$$data;
return null === (_$$data = (0, _renderer.default)(itemElement).data(_constants.LIST_ITEM_DATA_KEY)) || void 0 === _$$data ? void 0 : _$$data.appointment
},
getItemSettings: (_, event) => event.itemSettings
};
workSpace.createDragBehaviorBase($element, $schedulerElement, options)
}
}
setPosition(element, position) {
(0, _translator.move)(element, {
top: position.top,
left: position.left
})
}
createCompactButton(template, options) {
const $button = this.createCompactButtonElement(options);
return this.instance._createComponent($button, _button.default, {
type: "default",
width: options.width,
height: options.height,
onClick: e => this.onButtonClick(e, options),
template: this.renderTemplate(template, options.items, options.isCompact)
})
}
static measureCollectorDimensions($container, isCompact) {
const $collector = (0, _renderer.default)(" ").addClass("dx-scheduler-appointment-collector").toggleClass("dx-scheduler-appointment-collector-compact", isCompact).appendTo($container);
const styles = getComputedStyle($collector.get(0));
const geometry = {
width: styles.width,
height: styles.height,
marginLeft: styles.marginLeft,
marginRight: styles.marginRight,
marginTop: styles.marginTop,
marginBottom: styles.marginBottom
};
$collector.detach();
$collector.remove();
return geometry
}
createCompactButtonElement(_ref) {
let {
isCompact: isCompact,
$container: $container,
coordinates: coordinates,
sortedIndex: sortedIndex,
items: items
} = _ref;
const appointmentDate = this.getDateText(items[0].appointment, items[0].targetedAppointment);
const result = (0, _renderer.default)(" ").addClass("dx-scheduler-appointment-collector").attr("aria-roledescription", appointmentDate).toggleClass("dx-scheduler-appointment-collector-compact", isCompact).appendTo($container);
result.data(_constants.APPOINTMENT_SETTINGS_KEY, {
sortedIndex: sortedIndex
});
this.setPosition(result, coordinates);
return result
}
renderTemplate(template, items, isCompact) {
return new _function_template.FunctionTemplate(options => template.render({
model: {
appointmentCount: items.length,
items: items.map(item => item.appointment),
isCompact: isCompact
},
container: options.container
}))
}
createTemplate(count, isCompact) {
this.initButtonTemplate(count, isCompact);
return this.instance.getAppointmentTemplate("appointmentCollectorTemplate")
}
initButtonTemplate(count, isCompact) {
this.instance._templateManager.addDefaultTemplates({
appointmentCollector: new _function_template.FunctionTemplate(options => this.createButtonTemplate(count, (0, _renderer.default)(options.container), isCompact))
})
}
createButtonTemplate(appointmentCount, element, isCompact) {
const text = isCompact ? appointmentCount : _message.default.getFormatter("dxScheduler-moreAppointments")(appointmentCount);
return element.append((0, _renderer.default)(" ").text(text)).addClass("dx-scheduler-appointment-collector-content")
}
localizeDate(date) {
return `${_date.default.format(date,"monthAndDay")}, ${_date.default.format(date,"year")}`
}
getDateText(appointment, targetedAppointment) {
const startDate = (null === targetedAppointment || void 0 === targetedAppointment ? void 0 : targetedAppointment.displayStartDate) ?? appointment.startDate;
const endDate = (null === targetedAppointment || void 0 === targetedAppointment ? void 0 : targetedAppointment.displayEndDate) ?? appointment.endDate;
const startDateText = this.localizeDate(startDate);
const endDateText = this.localizeDate(endDate);
return startDateText === endDateText ? startDateText : `${startDateText} - ${endDateText}`
}
}
},
73922(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hide = function() {
if (!loading) {
return (new _deferred.Deferred).resolve()
}
return loading.hide().done(removeLoadPanel).promise()
};
exports.show = function(options) {
removeLoadPanel();
loading = function(options) {
return new _load_panel.default((0, _renderer.default)("").appendTo(options && options.container || (0, _view_port.value)()), options)
}(options);
return loading.show()
};
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 64553));
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 87739);
var _view_port = __webpack_require__( /*! ../../core/utils/view_port */ 55355);
var _load_panel = _interopRequireDefault(__webpack_require__( /*! ../../ui/load_panel */ 31876));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
let loading = null;
const removeLoadPanel = function() {
if (!loading) {
return
}
loading.$element().remove();
loading = null
}
},
84056(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
__webpack_require__( /*! ../../ui/radio_group */ 84798);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../common/core/localization/date */ 38662));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../common/core/localization/message */ 4671));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../core/component_registrator */ 92848));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 64553));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 41380));
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 52576);
var _type = __webpack_require__( /*! ../../core/utils/type */ 11528);
var _button_group = _interopRequireDefault(__webpack_require__( /*! ../../ui/button_group */ 17809));
var _editor = _interopRequireDefault(__webpack_require__( /*! ../../ui/editor/editor */ 78694));
var _form = _interopRequireDefault(__webpack_require__( /*! ../../ui/form */ 74075));
var _themes = __webpack_require__( /*! ../../ui/themes */ 52071);
var _base = __webpack_require__( /*! ./recurrence/base */ 57872);
var _days_from_by_day_rule = __webpack_require__( /*! ./recurrence/days_from_by_day_rule */ 2165);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const INTERVAL_EDITOR = "dx-recurrence-numberbox-interval";
const frequenciesMessages = [{
recurrence: "dxScheduler-recurrenceHourly",
value: "hourly"
}, {
recurrence: "dxScheduler-recurrenceDaily",
value: "daily"
}, {
recurrence: "dxScheduler-recurrenceWeekly",
value: "weekly"
}, {
recurrence: "dxScheduler-recurrenceMonthly",
value: "monthly"
}, {
recurrence: "dxScheduler-recurrenceYearly",
value: "yearly"
}];
const frequencies = frequenciesMessages.map(item => ({
text: () => _message.default.format(item.recurrence),
value: item.value
}));
const repeatEndTypes = [{
type: "never"
}, {
type: "until"
}, {
type: "count"
}];
const days = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"];
const getStylingModeFunc = () => (0, _themes.isFluent)((0, _themes.current)()) ? "filled" : void 0;
class RecurrenceRule {
constructor(rule) {
this.recurrenceRule = (0, _base.parseRecurrenceRule)(rule)
}
makeRules(string) {
this.recurrenceRule = (0, _base.parseRecurrenceRule)(string)
}
makeRule(field, value) {
if (!value || Array.isArray(value) && !value.length) {
delete this.recurrenceRule[field];
return
}
if ((0, _type.isDefined)(field)) {
if ("until" === field) {
delete this.recurrenceRule.count
}
if ("count" === field) {
delete this.recurrenceRule.until
}
this.recurrenceRule[field] = value
}
}
getRepeatEndRule() {
const rules = this.recurrenceRule;
if ("count" in rules) {
return "count"
}
if ("until" in rules) {
return "until"
}
return "never"
}
getRecurrenceString() {
return (0, _base.getRecurrenceString)(this.recurrenceRule)
}
getRules() {
return this.recurrenceRule
}
getDaysFromByDayRule() {
return (0, _days_from_by_day_rule.daysFromByDayRule)(this.recurrenceRule)
}
}
class RecurrenceEditor extends _editor.default {
_getDefaultOptions() {
const defaultOptions = super._getDefaultOptions();
return (0, _extend.extend)(defaultOptions, {
value: null,
startDate: new Date,
firstDayOfWeek: void 0
})
}
getFirstDayOfWeek() {
const firstDayOfWeek = this.option("firstDayOfWeek");
return (0, _type.isDefined)(firstDayOfWeek) ? firstDayOfWeek : _date.default.firstDayOfWeekIndex()
}
createComponent(element, name) {
let config = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
this._extendConfig(config, {
readOnly: this.option("readOnly")
});
return super._createComponent(element, name, config)
}
_init() {
super._init();
this.recurrenceRule = new RecurrenceRule(this.option("value"))
}
_render() {
super._render();
this.$element().addClass("dx-recurrence-editor");
this.$container = (0, _renderer.default)(" ").addClass("dx-recurrence-editor-container").appendTo(this.$element());
this.prepareEditors();
this.renderEditors(this.$container);
this.updateRepeatInputAriaLabel()
}
getEditorByField(fieldName) {
let editor = this.getRecurrenceForm().getEditor(fieldName);
if (!(0, _type.isDefined)(editor)) {
if ("byday" === fieldName) {
editor = this.weekEditor
}
}
return editor
}
prepareEditors() {
const freq = (this.recurrenceRule.getRules().freq || frequenciesMessages[1].value).toLowerCase();
this.editors = [this.createFreqEditor(freq), this.createIntervalEditor(freq), this.createRepeatOnLabel(freq), {
itemType: "group",
cssClass: "dx-recurrence-repeat-on",
colCount: 2,
colCountByScreen: {
xs: 2
},
items: this.createRepeatOnEditor(freq)
}, {
itemType: "group",
colCount: 2,
items: this.createRepeatEndEditor()
}];
return this.editors
}
createFreqEditor(freq) {
return {
dataField: "freq",
name: "FREQ",
editorType: "dxSelectBox",
cssClass: "dx-recurrence-selectbox-freq",
editorOptions: {
stylingMode: getStylingModeFunc(),
items: frequencies,
value: freq,
field: "freq",
valueExpr: "value",
displayExpr: "text",
layout: "horizontal",
elementAttr: {
class: "dx-recurrence-selectbox-freq"
},
onValueChanged: args => this.valueChangedHandler(args)
},
label: {
text: _message.default.format("dxScheduler-editorLabelRecurrence")
}
}
}
createIntervalEditor(freq) {
const interval = this.recurrenceRule.getRules().interval || 1;
return {
itemType: "group",
colCount: 2,
cssClass: `${INTERVAL_EDITOR}-wrapper`,
colCountByScreen: {
xs: 2
},
items: [{
dataField: "interval",
editorType: "dxNumberBox",
editorOptions: {
stylingMode: getStylingModeFunc(),
format: "#",
width: 90,
min: 1,
field: "interval",
value: interval,
showSpinButtons: true,
useLargeSpinButtons: false,
elementAttr: {
class: INTERVAL_EDITOR
},
onValueChanged: args => this.valueChangedHandler(args)
},
label: {
text: _message.default.format("dxScheduler-recurrenceRepeatEvery")
}
}, {
name: "intervalLabel",
cssClass: `${INTERVAL_EDITOR}-label`,
template: () => _message.default.format(`dxScheduler-recurrenceRepeat${freq.charAt(0).toUpperCase()}${freq.substr(1).toLowerCase()}`)
}]
}
}
createRepeatOnLabel(freq) {
return {
itemType: "group",
cssClass: "dx-recurrence-repeat-on-label",
items: [{
name: "repeatOnLabel",
colSpan: 2,
template: () => _message.default.format("dxScheduler-recurrenceRepeatOn"),
visible: freq && "daily" !== freq && "hourly" !== freq
}]
}
}
createRepeatOnEditor(freq) {
return [this.createByDayEditor(freq), this.createByMonthEditor(freq), this.createByMonthDayEditor(freq)]
}
createByDayEditor(freq) {
return {
dataField: "byday",
colSpan: 2,
template: (_, itemElement) => {
const firstDayOfWeek = this.getFirstDayOfWeek();
const byDay = this.daysOfWeekByRules();
const localDaysNames = _date.default.getDayNames("abbreviated");
const dayNames = days.slice(firstDayOfWeek).concat(days.slice(0, firstDayOfWeek));
const itemsButtonGroup = localDaysNames.slice(firstDayOfWeek).concat(localDaysNames.slice(0, firstDayOfWeek)).map((item, index) => ({
text: item,
key: dayNames[index]
}));
this.$repeatOnWeek = (0, _renderer.default)(" ").addClass("dx-recurrence-button-group").appendTo(itemElement);
this.weekEditor = this.createComponent(this.$repeatOnWeek, _button_group.default, {
items: itemsButtonGroup,
field: "byday",
selectionMode: "multiple",
selectedItemKeys: byDay,
keyExpr: "key",
onSelectionChanged: e => {
const selectedItemKeys = e.component.option("selectedItemKeys");
const selectedKeys = null !== selectedItemKeys && void 0 !== selectedItemKeys && selectedItemKeys.length ? selectedItemKeys : this.getDefaultByDayValue();
this.recurrenceRule.makeRule("byday", selectedKeys);
this.changeEditorValue()
}
})
},
visible: "weekly" === freq,
label: {
visible: false
}
}
}
createByMonthEditor(freq) {
const monthsName = _date.default.getMonthNames("wide");
const months = [...Array(12)].map((_, i) => ({
value: `${i+1}`,
text: monthsName[i]
}));
return {
dataField: "bymonth",
editorType: "dxSelectBox",
editorOptions: {
stylingMode: getStylingModeFunc(),
field: "bymonth",
items: months,
value: this.monthOfYearByRules(),
width: 120,
displayExpr: "text",
valueExpr: "value",
elementAttr: {
class: "dx-recurrence-selectbox-month-of-year"
},
onValueChanged: args => this.valueChangedHandler(args)
},
visible: "yearly" === freq,
label: {
visible: false
}
}
}
createByMonthDayEditor(freq) {
return {
dataField: "bymonthday",
editorType: "dxNumberBox",
editorOptions: {
stylingMode: getStylingModeFunc(),
min: 1,
max: 31,
format: "#",
width: 90,
field: "bymonthday",
showSpinButtons: true,
useLargeSpinButtons: false,
value: this.dayOfMonthByRules(),
elementAttr: {
class: "dx-recurrence-numberbox-day-of-month"
},
onValueChanged: args => this.valueChangedHandler(args)
},
visible: "monthly" === freq || "yearly" === freq,
label: {
visible: false
}
}
}
createRepeatEndEditor() {
const repeatType = this.recurrenceRule.getRepeatEndRule();
return [{
colSpan: 2,
template: _message.default.format("dxScheduler-recurrenceEnd")
}, {
colSpan: 1,
label: {
visible: false
},
dataField: "repeatEnd",
editorType: "dxRadioGroup",
editorOptions: {
items: repeatEndTypes,
value: repeatType,
valueExpr: "type",
field: "repeatEnd",
itemTemplate: itemData => {
if ("count" === itemData.type) {
return _message.default.format("dxScheduler-recurrenceAfter")
}
if ("until" === itemData.type) {
return _message.default.format("dxScheduler-recurrenceOn")
}
return _message.default.format("dxScheduler-recurrenceNever")
},
layout: "vertical",
elementAttr: {
class: "dx-recurrence-radiogroup-repeat-type"
},
onValueChanged: args => this.repeatEndValueChangedHandler(args)
}
}, {
colSpan: 1,
itemType: "group",
items: [this.getRepeatUntilEditorOptions(), this.getRepeatCountEditorOptions()]
}]
}
renderEditors($container) {
this.recurrenceForm = this.createComponent($container, _form.default, {
items: this.editors,
showValidationSummary: false,
scrollingEnabled: true,
showColonAfterLabel: false,
labelLocation: "top"
});
this.changeRepeatEndInputsVisibility()
}
getRecurrenceForm() {
return this.recurrenceForm
}
changeValueByVisibility(value) {
if (value) {
if (!this.option("value")) {
this.handleDefaults()
}
} else {
this.recurrenceRule.makeRules("");
this.option("value", "")
}
}
handleDefaults() {
this.recurrenceRule.makeRule("freq", frequenciesMessages[1].value);
this.changeEditorValue()
}
changeEditorValue() {
this.option("value", this.recurrenceRule.getRecurrenceString() ?? "")
}
daysOfWeekByRules() {
let daysByRule = this.recurrenceRule.getDaysFromByDayRule();
if (!daysByRule.length) {
daysByRule = this.getDefaultByDayValue()
}
return daysByRule
}
getDefaultByDayValue() {
const startDate = this.option("startDate");
const startDay = startDate.getDay();
return [days[startDay]]
}
dayOfMonthByRules() {
let dayByRule = this.recurrenceRule.getRules().bymonthday;
if (!dayByRule) {
dayByRule = this.option("startDate").getDate()
}
return dayByRule
}
monthOfYearByRules() {
let monthByRule = this.recurrenceRule.getRules().bymonth;
if (!monthByRule) {
monthByRule = this.option("startDate").getMonth() + 1
}
return String(monthByRule)
}
repeatEndValueChangedHandler(args) {
const {
value: value
} = args;
this.changeRepeatEndInputsVisibility(value);
if ("until" === value) {
this.recurrenceRule.makeRule(value, this.getUntilValue())
}
if ("count" === value) {
this.recurrenceRule.makeRule(value, this.recurrenceForm.option("formData.count"))
}
if ("never" === value) {
this.recurrenceRule.makeRule("count", "");
this.recurrenceRule.makeRule("until", "")
}
this.changeEditorValue();
this.updateRepeatInputAriaLabel()
}
changeRepeatEndInputsVisibility() {
let value = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.recurrenceRule.getRepeatEndRule();
if ("until" === value) {
this.recurrenceForm.itemOption("until", "visible", true);
this.recurrenceForm.itemOption("count", "visible", false)
}
if ("count" === value) {
this.recurrenceForm.itemOption("until", "visible", false);
this.recurrenceForm.itemOption("count", "visible", true)
}
if ("never" === value) {
this.recurrenceForm.itemOption("until", "visible", false);
this.recurrenceForm.itemOption("count", "visible", false)
}
}
getRepeatCountEditorOptions() {
const count = this.recurrenceRule.getRules().count || 1;
return {
dataField: "count",
cssClass: "dx-recurrence-numberbox-repeat-count",
label: {
visible: false
},
editorType: "dxNumberBox",
editorOptions: {
stylingMode: getStylingModeFunc(),
field: "count",
format: `# ${_message.default.format("dxScheduler-recurrenceRepeatCount")}`,
width: "100%",
min: 1,
showSpinButtons: true,
useLargeSpinButtons: false,
value: count,
onValueChanged: this.repeatCountValueChangeHandler.bind(this),
inputAttr: {
"aria-label": _message.default.format("dxScheduler-recurrenceOccurrenceLabel")
}
}
}
}
updateRepeatInputAriaLabel() {
const radioButtons = this.getEditorByField("repeatEnd").itemElements();
const untilLabel = _message.default.format("dxScheduler-recurrenceOn");
const untilValue = this.recurrenceForm.getEditor("until").option("value");
const untilValueFormat = `${_date.default.format(untilValue,"d")} ${_date.default.format(untilValue,"monthAndYear")}`;
const isUntilVisible = this.recurrenceForm.itemOption("until").visible;
const countLabel = _message.default.format("dxScheduler-recurrenceAfter");
const countPostfix = _message.default.format("dxScheduler-recurrenceRepeatCount");
const countValue = this.recurrenceForm.getEditor("count").option("value");
const isCountVisible = this.recurrenceForm.itemOption("count").visible;
radioButtons[1].setAttribute("aria-label", isUntilVisible ? `${untilLabel} ${untilValueFormat}` : untilLabel);
radioButtons[2].setAttribute("aria-label", isCountVisible ? `${countLabel} ${countValue} ${countPostfix}` : countLabel)
}
repeatCountValueChangeHandler(args) {
if ("count" === this.recurrenceRule.getRepeatEndRule()) {
const {
value: value
} = args;
this.recurrenceRule.makeRule("count", value);
this.changeEditorValue();
this.updateRepeatInputAriaLabel()
}
}
getRepeatUntilEditorOptions() {
const until = this.getUntilValue();
return {
dataField: "until",
label: {
visible: false
},
cssClass: "dx-recurrence-datebox-until-date",
editorType: "dxDateBox",
editorOptions: {
stylingMode: getStylingModeFunc(),
field: "until",
value: until,
type: "date",
width: "100%",
onValueChanged: this.repeatUntilValueChangeHandler.bind(this),
calendarOptions: {
firstDayOfWeek: this.getFirstDayOfWeek()
},
useMaskBehavior: true,
inputAttr: {
"aria-label": _message.default.format("dxScheduler-recurrenceUntilDateLabel")
}
}
}
}
formatUntilDate(date) {
const untilDate = this.recurrenceRule.getRules().until;
const isSameDate = _date2.default.sameDate(untilDate, date);
return untilDate && isSameDate ? date : _date2.default.setToDayEnd(date)
}
repeatUntilValueChangeHandler(args) {
if ("until" === this.recurrenceRule.getRepeatEndRule()) {
const dateInTimeZone = this.formatUntilDate(new Date(args.value));
const getStartDateTimeZone = this.option("getStartDateTimeZone");
const appointmentTimeZone = getStartDateTimeZone();
const path = appointmentTimeZone ? "fromAppointment" : "fromGrid";
const dateInLocaleTimeZone = this.option("timeZoneCalculator").createDate(dateInTimeZone, path, appointmentTimeZone);
this.recurrenceRule.makeRule("until", dateInLocaleTimeZone);
this.changeEditorValue();
this.updateRepeatInputAriaLabel()
}
}
valueChangedHandler(args) {
const {
value: value,
previousValue: previousValue
} = args;
const field = args.component.option("field");
if (!this.option("visible")) {
this.option("value", "")
} else {
this.recurrenceRule.makeRule(field, value);
if ("freq" === field) {
this.makeRepeatOnRule(value);
this.changeRepeatOnVisibility(value, previousValue)
}
this.changeEditorValue()
}
}
makeRepeatOnRule(value) {
if ("daily" === value || "hourly" === value) {
this.recurrenceRule.makeRule("byday", "");
this.recurrenceRule.makeRule("bymonth", "");
this.recurrenceRule.makeRule("bymonthday", "")
}
if ("weekly" === value) {
this.recurrenceRule.makeRule("byday", this.daysOfWeekByRules());
this.recurrenceRule.makeRule("bymonth", "");
this.recurrenceRule.makeRule("bymonthday", "")
}
if ("monthly" === value) {
this.recurrenceRule.makeRule("bymonthday", this.dayOfMonthByRules());
this.recurrenceRule.makeRule("bymonth", "");
this.recurrenceRule.makeRule("byday", "")
}
if ("yearly" === value) {
this.recurrenceRule.makeRule("bymonthday", this.dayOfMonthByRules());
this.recurrenceRule.makeRule("bymonth", this.monthOfYearByRules());
this.recurrenceRule.makeRule("byday", "")
}
}
_optionChanged(args) {
var _this$recurrenceForm, _this$weekEditor;
switch (args.name) {
case "readOnly":
null === (_this$recurrenceForm = this.recurrenceForm) || void 0 === _this$recurrenceForm || _this$recurrenceForm.option("readOnly", args.value);
null === (_this$weekEditor = this.weekEditor) || void 0 === _this$weekEditor || _this$weekEditor.option("readOnly", args.value);
super._optionChanged(args);
break;
case "value":
this.recurrenceRule.makeRules(args.value);
this.changeRepeatIntervalLabel();
this.changeRepeatEndInputsVisibility();
this.changeEditorsValue(this.recurrenceRule.getRules());
super._optionChanged(args);
break;
case "startDate":
this.makeRepeatOnRule(this.recurrenceRule.getRules().freq);
if ((0, _type.isDefined)(this.recurrenceRule.getRecurrenceString())) {
this.changeEditorValue()
}
break;
case "firstDayOfWeek":
if (this.weekEditor) {
const localDaysNames = _date.default.getDayNames("abbreviated");
const dayNames = days.slice(args.value).concat(days.slice(0, args.value));
const itemsButtonGroup = localDaysNames.slice(args.value).concat(localDaysNames.slice(0, args.value)).map((item, index) => ({
text: item,
key: dayNames[index]
}));
this.weekEditor.option("items", itemsButtonGroup)
}
if (this.recurrenceForm.itemOption("until").visible) {
this.recurrenceForm.getEditor("until").option("calendarOptions.firstDayOfWeek", this.getFirstDayOfWeek())
}
break;
default:
super._optionChanged(args)
}
}
changeRepeatOnVisibility(freq, previousFreq) {
if (freq !== previousFreq) {
this.recurrenceForm.itemOption("byday", "visible", false);
this.recurrenceForm.itemOption("bymonthday", "visible", false);
this.recurrenceForm.itemOption("bymonth", "visible", false);
this.recurrenceForm.itemOption("repeatOnLabel", "visible", freq && "daily" !== freq && "hourly" !== freq);
if ("weekly" === freq) {
this.recurrenceForm.itemOption("byday", "visible", true)
}
if ("monthly" === freq) {
this.recurrenceForm.itemOption("bymonthday", "visible", true)
}
if ("yearly" === freq) {
this.recurrenceForm.itemOption("bymonthday", "visible", true);
this.recurrenceForm.itemOption("bymonth", "visible", true)
}
}
}
changeRepeatIntervalLabel() {
const {
freq: freq
} = this.recurrenceRule.getRules();
freq && this.recurrenceForm.itemOption("intervalLabel", "template", _message.default.format(`dxScheduler-recurrenceRepeat${freq.charAt(0).toUpperCase()}${freq.substr(1).toLowerCase()}`))
}
changeEditorsValue(rules) {
this.recurrenceForm.getEditor("freq").option("value", (rules.freq || frequenciesMessages[1].value).toLowerCase());
this.changeDayOfWeekValue();
this.changeDayOfMonthValue();
this.changeMonthOfYearValue();
this.changeIntervalValue(rules.interval);
this.changeRepeatCountValue();
this.changeRepeatEndValue();
this.changeRepeatUntilValue()
}
changeIntervalValue(value) {
this.recurrenceForm.getEditor("interval").option("value", value || 1)
}
changeRepeatEndValue() {
const repeatType = this.recurrenceRule.getRepeatEndRule();
this.recurrenceForm.getEditor("repeatEnd").option("value", repeatType)
}
changeDayOfWeekValue() {
const isEditorVisible = this.recurrenceForm.itemOption("byday").visible;
if (isEditorVisible) {
const days = this.daysOfWeekByRules();
this.getEditorByField("byday").option("selectedItemKeys", days)
}
}
changeDayOfMonthValue() {
const isEditorVisible = this.recurrenceForm.itemOption("bymonthday").visible;
if (isEditorVisible) {
const day = this.dayOfMonthByRules();
this.recurrenceForm.getEditor("bymonthday").option("value", day)
}
}
changeMonthOfYearValue() {
const isEditorVisible = this.recurrenceForm.itemOption("bymonth").visible;
if (isEditorVisible) {
const month = this.monthOfYearByRules();
this.recurrenceForm.getEditor("bymonth").option("value", month)
}
}
changeRepeatCountValue() {
const count = this.recurrenceRule.getRules().count || 1;
this.recurrenceForm.getEditor("count").option("value", count)
}
changeRepeatUntilValue() {
this.recurrenceForm.getEditor("until").option("value", this.getUntilValue())
}
getUntilValue() {
const untilDate = this.recurrenceRule.getRules().until;
if (!untilDate) {
return this.formatUntilDate(new Date)
}
const getStartDateTimeZone = this.option("getStartDateTimeZone");
const appointmentTimeZone = getStartDateTimeZone();
const path = appointmentTimeZone ? "toAppointment" : "toGrid";
return this.option("timeZoneCalculator").createDate(untilDate, path, appointmentTimeZone)
}
}(0, _component_registrator.default)("dxRecurrenceEditor", RecurrenceEditor);
exports.default = RecurrenceEditor
},
21155(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.POPUP_DIALOG_CLASS = void 0;
var _visibility_change = __webpack_require__( /*! ../../common/core/events/visibility_change */ 18029);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../common/core/localization/date */ 38662));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../common/core/localization/message */ 4671));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../core/component_registrator */ 92848));
var _config = _interopRequireDefault(__webpack_require__( /*! ../../core/config */ 66636));
var _element = __webpack_require__( /*! ../../core/element */ 61404);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 64553));
var _bindable_template = __webpack_require__( /*! ../../core/templates/bindable_template */ 27286);
var _empty_template = __webpack_require__( /*! ../../core/templates/empty_template */ 48650);
var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/callbacks */ 84718));
var _common = __webpack_require__( /*! ../../core/utils/common */ 17781);
var _data = __webpack_require__( /*! ../../core/utils/data */ 31e3);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 41380));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date_serialization */ 71051));
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 87739);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 52576);
var _position = __webpack_require__( /*! ../../core/utils/position */ 41639);
var _type = __webpack_require__( /*! ../../core/utils/type */ 11528);
var _window = __webpack_require__( /*! ../../core/utils/window */ 3104);
var _data_helper = _interopRequireDefault(__webpack_require__( /*! ../../data_helper */ 87755));
var _dialog = __webpack_require__( /*! ../../ui/dialog */ 35757);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.errors */ 35185));
var _date3 = __webpack_require__( /*! ../core/utils/date */ 55594);
var _a11y_status_render = __webpack_require__( /*! ./a11y_status/a11y_status_render */ 24988);
var _a11y_status_text = __webpack_require__( /*! ./a11y_status/a11y_status_text */ 71883);
var _m_form = __webpack_require__( /*! ./appointment_popup/m_form */ 8107);
var _m_popup = __webpack_require__( /*! ./appointment_popup/m_popup */ 27483);
var _m_appointment_collection = _interopRequireDefault(__webpack_require__( /*! ./appointments/m_appointment_collection */ 5311));
var _appointments = __webpack_require__( /*! ./appointments_new/appointments */ 30820);
var _m_widget_notify_scheduler = _interopRequireDefault(__webpack_require__( /*! ./base/m_widget_notify_scheduler */ 32060));
var _m_header = __webpack_require__( /*! ./header/m_header */ 84829);
var _m_compact_appointments_helper = __webpack_require__( /*! ./m_compact_appointments_helper */ 64787);
var _m_loading = __webpack_require__( /*! ./m_loading */ 73922);
var _m_subscribes = _interopRequireDefault(__webpack_require__( /*! ./m_subscribes */ 58713));
var _m_utils = __webpack_require__( /*! ./m_utils */ 5327);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ./m_utils_time_zone */ 18648));
var _remote = __webpack_require__( /*! ./r1/filterting/remote */ 89755);
var _index = __webpack_require__( /*! ./r1/timezone_calculator/index */ 97777);
var _index2 = __webpack_require__( /*! ./r1/utils/index */ 34396);
var _validate_rule = __webpack_require__( /*! ./recurrence/validate_rule */ 25152);
var _scheduler_options_base_widget = __webpack_require__( /*! ./scheduler_options_base_widget */ 13367);
var _m_desktop_tooltip_strategy = __webpack_require__( /*! ./tooltip_strategies/m_desktop_tooltip_strategy */ 93048);
var _m_mobile_tooltip_strategy = __webpack_require__( /*! ./tooltip_strategies/m_mobile_tooltip_strategy */ 96588);
var _appointment_adapter = __webpack_require__( /*! ./utils/appointment_adapter/appointment_adapter */ 36791);
var _appointment_data_accessor = __webpack_require__( /*! ./utils/data_accessor/appointment_data_accessor */ 94077);
var _get_targeted_appointment = __webpack_require__( /*! ./utils/get_targeted_appointment */ 31985);
var _index3 = __webpack_require__( /*! ./utils/index */ 80356);
var _is_agenda_workpace_component = __webpack_require__( /*! ./utils/is_agenda_workpace_component */ 24862);
var _constants_view = __webpack_require__( /*! ./utils/options/constants_view */ 43582);
var _appointment_groups_utils = __webpack_require__( /*! ./utils/resource_manager/appointment_groups_utils */ 11649);
var _resource_manager = __webpack_require__( /*! ./utils/resource_manager/resource_manager */ 42409);
var _appointments_layout_manager = _interopRequireDefault(__webpack_require__( /*! ./view_model/appointments_layout_manager */ 67673));
var _m_appointment_data_source = __webpack_require__( /*! ./view_model/m_appointment_data_source */ 61526);
var _m_agenda = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_agenda */ 11129));
var _m_timeline_day = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_day */ 52515));
var _m_timeline_month = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_month */ 23791));
var _m_timeline_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_week */ 10621));
var _m_timeline_work_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_work_week */ 64063));
var _m_work_space_day = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_day */ 83216));
var _m_work_space_month = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_month */ 3416));
var _m_work_space_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_week */ 23276));
var _m_work_space_work_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_work_week */ 27420));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const toMs = _date2.default.dateToMilliseconds;
const POPUP_DIALOG_CLASS = exports.POPUP_DIALOG_CLASS = "dx-dialog";
const VIEWS_CONFIG = {
day: {
workSpace: _m_work_space_day.default,
renderingStrategy: "vertical"
},
week: {
workSpace: _m_work_space_week.default,
renderingStrategy: "vertical"
},
workWeek: {
workSpace: _m_work_space_work_week.default,
renderingStrategy: "vertical"
},
month: {
workSpace: _m_work_space_month.default,
renderingStrategy: "horizontalMonth"
},
timelineDay: {
workSpace: _m_timeline_day.default,
renderingStrategy: "horizontal"
},
timelineWeek: {
workSpace: _m_timeline_week.default,
renderingStrategy: "horizontal"
},
timelineWorkWeek: {
workSpace: _m_timeline_work_week.default,
renderingStrategy: "horizontal"
},
timelineMonth: {
workSpace: _m_timeline_month.default,
renderingStrategy: "horizontalMonthLine"
},
agenda: {
workSpace: _m_agenda.default,
renderingStrategy: "agenda"
}
};
const StoreEventNames_ADDING = "onAppointmentAdding",
StoreEventNames_ADDED = "onAppointmentAdded",
StoreEventNames_DELETING = "onAppointmentDeleting",
StoreEventNames_DELETED = "onAppointmentDeleted",
StoreEventNames_UPDATING = "onAppointmentUpdating",
StoreEventNames_UPDATED = "onAppointmentUpdated";
const RECURRENCE_EDITING_MODE_SERIES = "editSeries",
RECURRENCE_EDITING_MODE_OCCURRENCE = "editOccurrence",
RECURRENCE_EDITING_MODE_CANCEL = "cancel";
class Scheduler extends _scheduler_options_base_widget.SchedulerOptionsBaseWidget {
constructor() {
super(...arguments);
this.updatingAppointments = new Set
}
get timeZoneCalculator() {
if (!this.timeZoneCalculatorInstance) {
this.timeZoneCalculatorInstance = (0, _index.createTimeZoneCalculator)(this.option("timeZone"))
}
return this.timeZoneCalculatorInstance
}
postponeDataSourceLoading(promise) {
this.postponedOperations.add("_reloadDataSource", this.reloadDataSource.bind(this), promise)
}
postponeResourceLoading() {
let forceReload = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
const whenLoaded = this.postponedOperations.add("loadResources", () => {
const groups = this.getViewOption("groups");
return (0, _deferred.fromPromise)(this.resourceManager.loadGroupResources(groups, forceReload))
});
const resolveCallbacks = new _deferred.Deferred;
whenLoaded.done(() => {
resolveCallbacks.resolve()
});
this.postponeDataSourceLoading(whenLoaded);
return resolveCallbacks.promise()
}
_optionChanged(args) {
var _this$resourceManager;
this.schedulerOptionChanged(args);
const {
value: value,
name: name
} = args;
switch (args.name) {
case "customizeDateNavigatorText":
this.updateOption("header", name, value);
break;
case "firstDayOfWeek":
this.updateOption("workSpace", name, value);
this.updateOption("header", name, value);
this.cleanPopup();
break;
case "currentDate": {
const dateValue = this.getViewOption(name);
this.option("selectedCellData", []);
this.updateOption("workSpace", name, dateValue);
this.updateOption("header", name, dateValue);
this.updateOption("header", "startViewDate", this.getStartViewDate());
this._appointments.option("items", []);
this.setRemoteFilterIfNeeded();
this.postponeDataSourceLoading();
break
}
case "dataSource":
this._initDataSource();
this.postponeResourceLoading().done(() => {
this.appointmentDataSource.setDataSource(this._dataSource);
this.setRemoteFilterIfNeeded();
this.updateOption("workSpace", "showAllDayPanel", this.option("showAllDayPanel"))
});
break;
case "min":
case "max": {
const value = this.getViewOption(name);
this.updateOption("header", name, value);
this.updateOption("workSpace", name, value);
break
}
case "views":
if (this.currentView) {
this.repaint()
} else {
this.updateOption("header", "views", this.views)
}
break;
case "useDropDownViewSwitcher":
this.updateOption("header", name, value);
break;
case "currentView":
if (this.option("_newAppointments")) {
this._appointments.option({
currentView: value,
viewModel: [],
appointmentTemplate: this.getViewOption("appointmentTemplate"),
appointmentCollectorTemplate: this.getViewOption("appointmentCollectorTemplate")
})
} else {
this._appointments.option({
items: [],
allowDrag: this.allowDragging(),
allowResize: this.allowResizing(),
itemTemplate: this.getAppointmentTemplate("appointmentTemplate")
})
}
this.postponeResourceLoading().done(() => {
var _this$header;
this.refreshWorkSpace();
null === (_this$header = this.header) || void 0 === _this$header || _this$header.option(this.headerConfig());
this.setRemoteFilterIfNeeded();
if (!this.option("_newAppointments")) {
this._appointments.option("allowAllDayResize", "day" !== value)
}
});
this.postponedOperations.callPostponedOperations();
break;
case "appointmentTemplate":
if (this.option("_newAppointments")) {
this._appointments.option("appointmentTemplate", this.getViewOption("appointmentTemplate"))
} else {
this._appointments.option("itemTemplate", value)
}
break;
case "dateCellTemplate":
case "resourceCellTemplate":
case "dataCellTemplate":
case "timeCellTemplate":
this.repaint();
break;
case "groups":
this.postponeResourceLoading().done(() => {
this.refreshWorkSpace();
this.setRemoteFilterIfNeeded()
});
break;
case "resources":
null === (_this$resourceManager = this.resourceManager) || void 0 === _this$resourceManager || _this$resourceManager.dispose();
this.resourceManager = new _resource_manager.ResourceManager(this.option("resources"));
this.updateAppointmentDataSource();
this.postponeResourceLoading().done(() => {
this._appointments.option("items", []);
this.refreshWorkSpace();
this.setRemoteFilterIfNeeded();
this.createAppointmentPopupForm()
});
break;
case "startDayHour":
case "endDayHour":
this.updateAppointmentDataSource();
this._appointments.option("items", []);
this.updateOption("workSpace", name, value);
if (!this.option("_newAppointments")) {
this._appointments.repaint()
}
this.setRemoteFilterIfNeeded();
this.postponeDataSourceLoading();
break;
case "offset":
this.updateAppointmentDataSource();
this._appointments.option("items", []);
this.updateOption("workSpace", "viewOffset", this.normalizeViewOffsetValue(value));
if (!this.option("_newAppointments")) {
this._appointments.repaint()
}
this.setRemoteFilterIfNeeded();
this.postponeDataSourceLoading();
break;
case StoreEventNames_ADDING:
case StoreEventNames_ADDED:
case StoreEventNames_UPDATING:
case StoreEventNames_UPDATED:
case StoreEventNames_DELETING:
case StoreEventNames_DELETED:
case "onAppointmentFormOpening":
case "onAppointmentTooltipShowing":
this.actions[name] = this._createActionByOption(name);
break;
case "onAppointmentRendered":
if (this.option("_newAppointments")) {
this.createAppointmentRenderedAction()
} else {
this._appointments.option("onItemRendered", this.getAppointmentRenderedAction())
}
break;
case "onAppointmentClick":
this._appointments.option("onItemClick", this._createActionByOption(name));
break;
case "onAppointmentDblClick":
this._appointments.option(name, this._createActionByOption(name));
break;
case "onAppointmentContextMenu":
this._appointments.option("onItemContextMenu", this._createActionByOption(name));
this.appointmentTooltip._options.onItemContextMenu = this._createActionByOption(name);
break;
case "noDataText":
case "allowMultipleCellSelection":
case "selectedCellData":
case "accessKey":
case "onCellClick":
case "onCellContextMenu":
this.updateOption("workSpace", name, value);
break;
case "crossScrollingEnabled":
this.postponeResourceLoading().done(() => {
this._appointments.option("items", []);
this.refreshWorkSpace();
if (this.readyToRenderAppointments) {
this._appointments.option("items", this._layoutManager.generateViewModel())
}
});
break;
case "cellDuration":
this.updateOption("workSpace", name, value);
this._appointments.option("items", []);
if (this.readyToRenderAppointments) {
this.updateOption("workSpace", "hoursInterval", value / 60);
this._appointments.option("items", this._layoutManager.generateViewModel())
}
break;
case "tabIndex":
case "focusStateEnabled":
this.updateOption("header", name, value);
this.updateOption("workSpace", name, value);
this._appointments.option(name, value);
super._optionChanged(args);
break;
case "width":
this.updateOption("header", name, value);
if (this.option("crossScrollingEnabled")) {
this.updateOption("workSpace", "width", value)
}
this.updateOption("workSpace", "schedulerWidth", value);
super._optionChanged(args);
this._dimensionChanged(null, true);
break;
case "height":
super._optionChanged(args);
this._dimensionChanged(null, true);
this.updateOption("workSpace", "schedulerHeight", value);
break;
case "editing": {
this.initEditing();
const {
editing: editing
} = this;
this.bringEditingModeToAppointments(editing);
this.hideAppointmentTooltip();
this.cleanPopup();
break
}
case "showAllDayPanel":
this.updateAppointmentDataSource();
this.repaint();
break;
case "showCurrentTimeIndicator":
case "indicatorUpdateInterval":
case "shadeUntilCurrentTime":
case "groupByDate":
this.updateOption("workSpace", name, value);
this.repaint();
break;
case "indicatorTime":
this.updateOption("workSpace", name, value);
this.updateOption("header", name, value);
this.repaint();
break;
case "appointmentDragging":
case "appointmentTooltipTemplate":
case "appointmentPopupTemplate":
case "recurrenceEditMode":
case "remoteFiltering":
case "timeZone":
this.updateAppointmentDataSource();
this.repaint();
break;
case "appointmentCollectorTemplate":
if (this.option("_newAppointments")) {
this._appointments.option("appointmentCollectorTemplate", this.getViewOption("appointmentCollectorTemplate"))
} else {
this.repaint()
}
break;
case "_appointmentTooltipOffset":
this.repaint();
break;
case "dateSerializationFormat":
break;
case "maxAppointmentsPerCell":
this.repaint();
break;
case "startDateExpr":
case "endDateExpr":
case "startDateTimeZoneExpr":
case "endDateTimeZoneExpr":
case "textExpr":
case "descriptionExpr":
case "allDayExpr":
case "recurrenceRuleExpr":
case "recurrenceExceptionExpr":
case "disabledExpr":
case "visibleExpr":
this.updateExpression(name, value);
this.initAppointmentTemplate();
this.repaint();
break;
case "adaptivityEnabled":
this.toggleAdaptiveClass();
this.repaint();
break;
case "scrolling":
this.option("crossScrollingEnabled", this.isHorizontalVirtualScrolling() || this.option("crossScrollingEnabled"));
this.updateOption("workSpace", args.fullName, value);
break;
case "allDayPanelMode":
this.updateAppointmentDataSource();
this.updateOption("workSpace", args.fullName, value);
break;
case "renovateRender":
this.updateOption("workSpace", name, value);
break;
case "_draggingMode":
this.updateOption("workSpace", "draggingMode", value);
break;
case "toolbar":
this.header ? this.header.onToolbarOptionChanged(args.fullName, value) : this.repaint();
break;
default:
super._optionChanged(args)
}
}
bringEditingModeToAppointments(editing) {
const editingConfig = {
allowDelete: editing.allowUpdating && editing.allowDeleting
};
if (!this.isAgenda()) {
editingConfig.allowDrag = editing.allowDragging;
editingConfig.allowResize = editing.allowResizing;
editingConfig.allowAllDayResize = editing.allowResizing && this.supportAllDayResizing()
}
this._appointments.option(editingConfig);
this.repaint()
}
isAgenda() {
return "agenda" === this.currentView.type
}
allowDragging() {
return this.editing.allowDragging && !this.isAgenda()
}
allowResizing() {
return this.editing.allowResizing && !this.isAgenda()
}
allowAllDayResizing() {
return this.editing.allowResizing && this.supportAllDayResizing()
}
supportAllDayResizing() {
return "day" !== this.currentView.type || this.currentView.intervalCount > 1
}
isAllDayExpanded() {
return this.option("showAllDayPanel") && this._layoutManager.hasAllDayAppointments()
}
setRemoteFilterIfNeeded() {
const dataSource = this._dataSource;
const remoteFiltering = this.option("remoteFiltering");
if (!this._workSpace || !remoteFiltering || !dataSource) {
return
}
const dateRange = this._workSpace.getDateRange();
const startDate = this.timeZoneCalculator.createDate(dateRange[0], "fromGrid");
const endDate = this.timeZoneCalculator.createDate(dateRange[1], "fromGrid");
const dateSerializationFormat = this.option("dateSerializationFormat");
const dataSourceFilter = dataSource.filter();
const filter = (0, _remote.combineRemoteFilter)({
dataSourceFilter: dataSourceFilter,
dataAccessors: this._dataAccessors,
min: startDate,
max: endDate,
dateSerializationFormat: dateSerializationFormat,
forceIsoDateParsing: (0, _config.default)().forceIsoDateParsing
});
dataSource.filter(filter)
}
reloadDataSource() {
const result = new _deferred.Deferred;
if (this._dataSource) {
this._dataSource.load().done(() => {
(0, _m_loading.hide)();
this._fireContentReadyAction(result)
}).fail(() => {
(0, _m_loading.hide)();
result.reject()
});
this._dataSource.isLoading() && (0, _m_loading.show)({
container: this.$element(),
position: {
of: this.$element()
}
})
} else {
this._fireContentReadyAction(result)
}
return result.promise()
}
_fireContentReadyAction(result) {
const contentReadyBase = super._fireContentReadyAction.bind(this);
const fireContentReady = () => {
contentReadyBase();
null === result || void 0 === result || result.resolve()
};
if (this.workSpaceRecalculation) {
var _this$workSpaceRecalc;
null === (_this$workSpaceRecalc = this.workSpaceRecalculation) || void 0 === _this$workSpaceRecalc || _this$workSpaceRecalc.done(() => {
fireContentReady()
})
} else {
fireContentReady()
}
}
_dimensionChanged(value) {
let isForce = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
const isFixedHeight = "number" === typeof this.option("height");
const isFixedWidth = "number" === typeof this.option("width");
if (!this._isVisible()) {
return
}
this.toggleSmallClass();
const workspace = this.getWorkSpace();
if (!this.isAgenda() && this._layoutManager && workspace && !(0, _is_agenda_workpace_component.isAgendaWorkspaceComponent)(workspace)) {
if (isForce || !isFixedHeight || !isFixedWidth) {
workspace.option("allDayExpanded", this.isAllDayExpanded());
workspace._dimensionChanged();
const appointments = this._layoutManager.generateViewModel();
this._appointments.option("items", appointments)
}
}
this.hideAppointmentTooltip();
this.appointmentPopup.triggerResize();
this.appointmentPopup.updatePopupFullScreenMode()
}
_clean() {
this.cleanPopup();
super._clean()
}
toggleSmallClass() {
const {
width: width
} = (0, _position.getBoundingRect)(this.$element().get(0));
this.$element().toggleClass("dx-scheduler-small", width < 400)
}
toggleAdaptiveClass() {
this.$element().toggleClass("dx-scheduler-adaptive", this.option("adaptivityEnabled"))
}
_visibilityChanged(visible) {
visible && this._dimensionChanged(null, true)
}
_dataSourceOptions() {
return {
paginate: false
}
}
initAllDayPanel() {
if ("hidden" === this.option("allDayPanelMode")) {
this.option("showAllDayPanel", false)
}
}
_init() {
this.timeZonesPromise = _m_utils_time_zone.default.cacheTimeZones();
this.initExpressions({
startDateExpr: this.option("startDateExpr"),
endDateExpr: this.option("endDateExpr"),
startDateTimeZoneExpr: this.option("startDateTimeZoneExpr"),
endDateTimeZoneExpr: this.option("endDateTimeZoneExpr"),
allDayExpr: this.option("allDayExpr"),
textExpr: this.option("textExpr"),
descriptionExpr: this.option("descriptionExpr"),
recurrenceRuleExpr: this.option("recurrenceRuleExpr"),
recurrenceExceptionExpr: this.option("recurrenceExceptionExpr"),
disabledExpr: this.option("disabledExpr"),
visibleExpr: this.option("visibleExpr")
});
super._init();
this.initAllDayPanel();
this._initDataSource();
this.customizeDataSourceLoadOptions();
this.$element().addClass("dx-scheduler");
this.initEditing();
this.updateAppointmentDataSource();
this.initActions();
this._compactAppointmentsHelper = new _m_compact_appointments_helper.CompactAppointmentsHelper(this);
this.asyncTemplatesTimers = [];
this.dataSourceLoadedCallback = (0, _callbacks.default)();
this.subscribes = _m_subscribes.default;
this.resourceManager = new _resource_manager.ResourceManager(this.option("resources"));
this.notifyScheduler = new _m_widget_notify_scheduler.default({
scheduler: this
});
this.createAppointmentRenderedAction()
}
createAppointmentRenderedAction() {
this.appointmentRenderedAction = this._createActionByOption("onAppointmentRendered")
}
createAppointmentDataSource() {
var _this$appointmentData;
null === (_this$appointmentData = this.appointmentDataSource) || void 0 === _this$appointmentData || _this$appointmentData.destroy();
this.appointmentDataSource = new _m_appointment_data_source.AppointmentDataSource(this._dataSource)
}
updateAppointmentDataSource() {
this.timeZoneCalculatorInstance = null;
if (this.getWorkSpace()) {
this.createAppointmentDataSource()
}
}
customizeDataSourceLoadOptions() {
var _this$_dataSource;
null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource || _this$_dataSource.on("customizeStoreLoadOptions", _ref => {
let {
storeLoadOptions: storeLoadOptions
} = _ref;
storeLoadOptions.startDate = this.getStartViewDate();
storeLoadOptions.endDate = this.getEndViewDate()
})
}
_initTemplates() {
this.initAppointmentTemplate();
this._templateManager.addDefaultTemplates({
appointmentTooltip: new _empty_template.EmptyTemplate,
dropDownAppointment: new _empty_template.EmptyTemplate
});
super._initTemplates()
}
initAppointmentTemplate() {
const {
expr: expr
} = this._dataAccessors;
const createGetter = property => (0, _data.compileGetter)(`appointmentData.${property}`);
const getDate = getter => data => {
const value = getter(data);
if (value instanceof Date) {
return value.valueOf()
}
return value
};
this._templateManager.addDefaultTemplates({
item: new _bindable_template.BindableTemplate(($container, data, model) => this.getAppointmentsInstance()._renderAppointmentTemplate($container, data, model), ["html", "text", "startDate", "endDate", "allDay", "description", "recurrenceRule", "recurrenceException", "startDateTimeZone", "endDateTimeZone"], this.option("integrationOptions.watchMethod"), {
text: createGetter(expr.textExpr),
startDate: getDate(createGetter(expr.startDateExpr)),
endDate: getDate(createGetter(expr.endDateExpr)),
startDateTimeZone: createGetter(expr.startDateTimeZoneExpr),
endDateTimeZone: createGetter(expr.endDateTimeZoneExpr),
allDay: createGetter(expr.allDayExpr),
recurrenceRule: createGetter(expr.recurrenceRuleExpr)
})
})
}
_renderContent() {
this._renderContentImpl()
}
_dataSourceChangedHandler(result) {
if (this.readyToRenderAppointments) {
this.workSpaceRecalculation.done(() => {
this._layoutManager.prepareAppointments(result);
this.renderAppointments();
this.updateA11yStatus()
})
}
}
isVirtualScrolling() {
const workspace = this.getWorkSpace();
if (workspace) {
return workspace.isVirtualScrolling()
}
const scrolling = this.getViewOption("scrolling");
return "virtual" === (null === scrolling || void 0 === scrolling ? void 0 : scrolling.mode)
}
renderAppointments() {
const workspace = this.getWorkSpace();
this._layoutManager.filterAppointments();
workspace.option("allDayExpanded", this.isAllDayExpanded());
const viewModel = this._isVisible() ? this._layoutManager.generateViewModel() : [];
this._appointments.option("items", viewModel);
this.appointmentDataSource.cleanState();
if (this.isAgenda()) {
this._workSpace.renderAgendaLayout(viewModel)
}
}
initExpressions(fields) {
this._dataAccessors = new _appointment_data_accessor.AppointmentDataAccessor(fields, Boolean((0, _config.default)().forceIsoDateParsing), this.option("dateSerializationFormat"))
}
updateExpression(name, value) {
this._dataAccessors.updateExpression(name, value)
}
initEditing() {
const editing = this.option("editing");
this.editing = {
allowAdding: Boolean(editing),
allowUpdating: Boolean(editing),
allowDeleting: Boolean(editing),
allowResizing: Boolean(editing),
allowDragging: Boolean(editing)
};
if ((0, _type.isObject)(editing)) {
this.editing = (0, _extend.extend)(this.editing, editing)
}
this.editing.allowDragging = this.editing.allowDragging && this.editing.allowUpdating;
this.editing.allowResizing = this.editing.allowResizing && this.editing.allowUpdating;
const isReadOnly = Object.values(Object.assign({}, this.editing, {
form: void 0,
popup: void 0
})).every(value => !value);
this.$element().toggleClass("dx-scheduler-readonly", isReadOnly)
}
_dispose() {
var _this$resourceManager2, _this$appointmentTool, _this$recurrenceDialo;
null === (_this$resourceManager2 = this.resourceManager) || void 0 === _this$resourceManager2 || _this$resourceManager2.dispose();
null === (_this$appointmentTool = this.appointmentTooltip) || void 0 === _this$appointmentTool || _this$appointmentTool.dispose();
null === (_this$recurrenceDialo = this.recurrenceDialog) || void 0 === _this$recurrenceDialo || _this$recurrenceDialo.hide(RECURRENCE_EDITING_MODE_CANCEL);
this.hideAppointmentPopup();
this.hideAppointmentTooltip();
this.asyncTemplatesTimers.forEach(clearTimeout);
this.asyncTemplatesTimers = [];
_index3.macroTaskArray.dispose();
super._dispose()
}
initActions() {
this.actions = {
onAppointmentAdding: this._createActionByOption(StoreEventNames_ADDING),
onAppointmentAdded: this._createActionByOption(StoreEventNames_ADDED),
onAppointmentUpdating: this._createActionByOption(StoreEventNames_UPDATING),
onAppointmentUpdated: this._createActionByOption(StoreEventNames_UPDATED),
onAppointmentDeleting: this._createActionByOption(StoreEventNames_DELETING),
onAppointmentDeleted: this._createActionByOption(StoreEventNames_DELETED),
onAppointmentFormOpening: this._createActionByOption("onAppointmentFormOpening"),
onAppointmentTooltipShowing: this._createActionByOption("onAppointmentTooltipShowing")
}
}
getAppointmentRenderedAction() {
return this._createActionByOption("onAppointmentRendered", {
excludeValidators: ["disabled", "readOnly"]
})
}
_renderFocusTarget() {
return (0, _common.noop)()
}
updateA11yStatus() {
const dateRange = this._workSpace.getDateRange();
const indicatorTime = this.option("showCurrentTimeIndicator") ? (0, _index2.getToday)(this.option("indicatorTime"), this.timeZoneCalculator) : void 0;
const label = (0, _a11y_status_text.getA11yStatusText)(this.currentView, dateRange[0], dateRange[1], this._layoutManager.filteredItems.length, indicatorTime);
this.setAria({
label: label
});
this.a11yStatus.text(label)
}
renderA11yStatus() {
this.a11yStatus = (0, _a11y_status_render.createA11yStatusContainer)();
this.a11yStatus.prependTo(this.$element());
this.setAria({
role: "group"
})
}
initMarkupOnResourceLoaded() {
if (!this._disposed) {
this.initMarkupCore();
this.reloadDataSource()
}
}
_initMarkup() {
super._initMarkup();
this.renderA11yStatus();
this.renderMainContainer();
this.renderHeader();
this.toggleAdaptiveClass();
this._layoutManager = new _appointments_layout_manager.default(this);
if (this.option("_newAppointments")) {
const appointmentsConfig = {
tabIndex: this.option("tabIndex"),
currentView: this.option("currentView"),
appointmentTemplate: this.getViewOption("appointmentTemplate"),
appointmentCollectorTemplate: this.getViewOption("appointmentCollectorTemplate"),
onAppointmentRendered: e => {
this.appointmentRenderedAction({
appointmentElement: e.element,
appointmentData: e.appointmentData,
targetedAppointmentData: e.targetedAppointmentData
})
},
getResourceManager: () => this.resourceManager,
getAppointmentDataSource: () => this.appointmentDataSource,
getDataAccessor: () => this._dataAccessors,
getStartViewDate: () => this.getStartViewDate(),
getSortedAppointments: () => this._layoutManager.sortedItems,
isVirtualScrolling: () => this.isVirtualScrolling(),
scrollTo: this.scrollTo.bind(this)
};
this._appointments = this._createComponent(" ", _appointments.Appointments, appointmentsConfig)
} else {
this._appointments = this._createComponent(" ", _m_appointment_collection.default, this.appointmentsConfig());
this._appointments.option("itemTemplate", this.getAppointmentTemplate("appointmentTemplate"))
}
this.appointmentTooltip = new(this.option("adaptivityEnabled") ? _m_mobile_tooltip_strategy.MobileTooltipStrategy : _m_desktop_tooltip_strategy.DesktopTooltipStrategy)(this.getAppointmentTooltipOptions());
this.createAppointmentPopupForm();
if (this.isDataSourceLoaded() || this._isDataSourceLoading()) {
this.initMarkupCore();
this._dataSourceChangedHandler(this._dataSource.items());
this._fireContentReadyAction()
} else {
const groups = this.getViewOption("groups");
if (null !== groups && void 0 !== groups && groups.length) {
this.resourceManager.loadGroupResources(groups, true).then(() => this.initMarkupOnResourceLoaded())
} else {
this.initMarkupOnResourceLoaded()
}
}
}
createAppointmentPopupForm() {
var _this$appointmentPopu;
if (this.appointmentForm) {
this.appointmentForm.dispose()
}
this.appointmentForm = this.createAppointmentForm();
null === (_this$appointmentPopu = this.appointmentPopup) || void 0 === _this$appointmentPopu || _this$appointmentPopu.dispose();
this.appointmentPopup = this.createAppointmentPopup(this.appointmentForm)
}
renderMainContainer() {
this.mainContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-container");
this.$element().append(this.mainContainer)
}
createAppointmentForm() {
const scheduler = {
getResourceById: () => this.resourceManager.resourceById,
getDataAccessors: () => this._dataAccessors,
createComponent: (element, component, options) => this._createComponent(element, component, options),
getEditingConfig: () => this.editing,
getResourceManager: () => this.resourceManager,
getFirstDayOfWeek: () => this.option("firstDayOfWeek"),
getStartDayHour: () => this.option("startDayHour"),
getCalculatedEndDate: startDateWithStartHour => this._workSpace.calculateEndDate(startDateWithStartHour),
getTimeZoneCalculator: () => this.timeZoneCalculator
};
return new _m_form.AppointmentForm(scheduler)
}
createAppointmentPopup(form) {
const scheduler = {
getElement: () => this.$element(),
createComponent: (element, component, options) => this._createComponent(element, component, options),
focus: () => this.focus(),
getResourceManager: () => this.resourceManager,
getEditingConfig: () => this.editing,
getTimeZoneCalculator: () => this.timeZoneCalculator,
getDataAccessors: () => this._dataAccessors,
getAppointmentFormOpening: () => this.actions.onAppointmentFormOpening,
processActionResult: (arg, canceled) => this.processActionResult(arg, canceled),
addAppointment: appointment => this.addAppointment(appointment),
updateAppointment: (sourceAppointment, updatedAppointment) => this.updateAppointment(sourceAppointment, updatedAppointment)
};
return new _m_popup.AppointmentPopup(scheduler, form)
}
scrollToAppointment(appointment) {
const adapter = new _appointment_adapter.AppointmentAdapter(appointment, this._dataAccessors);
const {
startDate: startDate,
endDate: endDate,
allDay: allDay
} = adapter;
if (!startDate) {
return
}
const startTime = startDate.getTime();
const endTime = endDate ? endDate.getTime() : startTime;
const dayInMs = toMs("day");
const inAllDayRow = allDay || endTime - startTime >= dayInMs;
const appointmentGroupValues = (0, _appointment_groups_utils.getAppointmentGroupValues)(appointment, this.resourceManager.resources);
this._workSpace.updateScrollPosition(startDate, appointmentGroupValues, inAllDayRow)
}
getAppointmentTooltipOptions() {
return {
createComponent: this._createComponent.bind(this),
container: this.$element(),
getScrollableContainer: this.getWorkSpaceScrollableContainer.bind(this),
addDefaultTemplates: this._templateManager.addDefaultTemplates.bind(this._templateManager),
getAppointmentTemplate: this.getAppointmentTemplate.bind(this),
showAppointmentPopup: this.showAppointmentPopup.bind(this),
checkAndDeleteAppointment: this.checkAndDeleteAppointment.bind(this),
isAppointmentInAllDayPanel: this.isAppointmentInAllDayPanel.bind(this),
createFormattedDateText: (appointment, targetedAppointment, format) => this.fire("createFormattedDateText", appointment, targetedAppointment, format),
getAppointmentDisabled: appointment => this._dataAccessors.get("disabled", appointment),
onItemContextMenu: this._createActionByOption("onAppointmentContextMenu"),
createEventArgs: this._createEventArgs.bind(this)
}
}
_createEventArgs(e) {
const config = {
itemData: e.itemData.appointment,
itemElement: e.itemElement,
targetedAppointment: e.itemData.targetedAppointment
};
return (0, _extend.extend)({}, this.fire("mapAppointmentFields", config), {
component: e.component,
element: e.element,
event: e.event,
model: e.model
})
}
checkAndDeleteAppointment(appointment, targetedAppointment) {
const targetedAdapter = new _appointment_adapter.AppointmentAdapter(targetedAppointment, this._dataAccessors);
const deletingOptions = this.fireOnAppointmentDeleting(appointment, targetedAdapter);
this.checkRecurringAppointment(appointment, targetedAppointment, targetedAdapter.startDate, () => {
this.processDeleteAppointment(appointment, deletingOptions)
}, true)
}
getExtraAppointmentTooltipOptions() {
return {
rtlEnabled: this.option("rtlEnabled"),
focusStateEnabled: this.option("focusStateEnabled"),
editing: this.option("editing"),
offset: this.option("_appointmentTooltipOffset")
}
}
isAppointmentInAllDayPanel(appointmentData) {
const workSpace = this._workSpace;
const itTakesAllDay = this.appointmentTakesAllDay(appointmentData);
return itTakesAllDay && workSpace.supportAllDayRow() && workSpace.option("showAllDayPanel")
}
initMarkupCore() {
this.readyToRenderAppointments = (0, _window.hasWindow)();
this._workSpace && this.cleanWorkSpace();
this.renderWorkSpace();
if (this.option("_newAppointments")) {
this._appointments.option("$allDayContainer", this._workSpace.getAllDayContainer())
} else {
this._appointments.option({
fixedContainer: this._workSpace.getFixedContainer(),
allDayContainer: this._workSpace.getAllDayContainer()
})
}
this.waitAsyncTemplate(() => {
var _this$workSpaceRecalc2;
return null === (_this$workSpaceRecalc2 = this.workSpaceRecalculation) || void 0 === _this$workSpaceRecalc2 ? void 0 : _this$workSpaceRecalc2.resolve()
});
this.createAppointmentDataSource();
this.setRemoteFilterIfNeeded();
this.validateKeyFieldIfAgendaExist();
this.updateA11yStatus()
}
isDataSourceLoaded() {
var _this$_dataSource2;
return null === (_this$_dataSource2 = this._dataSource) || void 0 === _this$_dataSource2 ? void 0 : _this$_dataSource2.isLoaded()
}
_render() {
var _this$getWorkSpace;
null === (_this$getWorkSpace = this.getWorkSpace()) || void 0 === _this$getWorkSpace || _this$getWorkSpace.updateHeaderEmptyCellWidth();
super._render()
}
renderHeader() {
var _toolbarOptions$items;
const toolbarOptions = this.option("toolbar");
const isHeaderShown = Boolean(toolbarOptions.visible ?? (null === (_toolbarOptions$items = toolbarOptions.items) || void 0 === _toolbarOptions$items ? void 0 : _toolbarOptions$items.length));
if (isHeaderShown) {
const $header = (0, _renderer.default)(" ").appendTo(this.mainContainer);
const headerOptions = this.headerConfig();
this.header = this._createComponent($header, _m_header.SchedulerHeader, headerOptions)
}
}
headerConfig() {
return {
currentView: this.currentView,
views: this.views,
currentDate: this.getViewOption("currentDate"),
min: this.getViewOption("min"),
max: this.getViewOption("max"),
indicatorTime: this.option("indicatorTime"),
startViewDate: this.getStartViewDate(),
tabIndex: this.option("tabIndex"),
focusStateEnabled: this.option("focusStateEnabled"),
useDropDownViewSwitcher: this.option("useDropDownViewSwitcher"),
firstDayOfWeek: this.getFirstDayOfWeek(),
toolbar: this.option("toolbar"),
customizeDateNavigatorText: this.option("customizeDateNavigatorText"),
onCurrentViewChange: name => {
this.option("currentView", name)
},
onCurrentDateChange: date => {
this.option("currentDate", date)
}
}
}
appointmentsConfig() {
const config = {
getResourceManager: () => this.resourceManager,
getAppointmentDataSource: () => this.appointmentDataSource,
getSortedAppointments: () => this._layoutManager.sortedItems,
scrollTo: this.scrollTo.bind(this),
dataAccessors: this._dataAccessors,
notifyScheduler: this.notifyScheduler,
onItemRendered: this.getAppointmentRenderedAction(),
onItemClick: this._createActionByOption("onAppointmentClick"),
onItemContextMenu: this._createActionByOption("onAppointmentContextMenu"),
onAppointmentDblClick: this._createActionByOption("onAppointmentDblClick"),
tabIndex: this.option("tabIndex"),
focusStateEnabled: this.option("focusStateEnabled"),
allowDrag: this.allowDragging(),
allowDelete: this.editing.allowUpdating && this.editing.allowDeleting,
allowResize: this.allowResizing(),
allowAllDayResize: this.allowAllDayResizing(),
rtlEnabled: this.option("rtlEnabled"),
groups: this.getViewOption("groups"),
groupByDate: this.getViewOption("groupByDate"),
timeZoneCalculator: this.timeZoneCalculator,
getResizableStep: () => this._workSpace ? this._workSpace.positionHelper.getResizableStep() : 0,
getDOMElementsMetaData: () => {
var _this$_workSpace;
return null === (_this$_workSpace = this._workSpace) || void 0 === _this$_workSpace ? void 0 : _this$_workSpace.getDOMElementsMetaData()
},
getViewDataProvider: () => {
var _this$_workSpace2;
return null === (_this$_workSpace2 = this._workSpace) || void 0 === _this$_workSpace2 ? void 0 : _this$_workSpace2.viewDataProvider
},
isVerticalGroupedWorkSpace: () => this._workSpace.isVerticalGroupedWorkSpace(),
isDateAndTimeView: () => (0, _index2.isDateAndTimeView)(this._workSpace.type),
onContentReady: () => {
var _this$_workSpace3;
null === (_this$_workSpace3 = this._workSpace) || void 0 === _this$_workSpace3 || _this$_workSpace3.option("allDayExpanded", this.isAllDayExpanded())
}
};
return config
}
renderWorkSpace() {
const currentViewOptions = this.currentView;
if (!currentViewOptions) {
return
}
if (this.isAgenda()) {
this.renderAgendaWorkspace()
} else {
this.renderGridWorkspace()
}
this.recalculateWorkspace();
if (currentViewOptions.startDate) {
this.updateOption("header", "currentDate", this._workSpace.getHeaderDate())
}
}
renderGridWorkspace() {
if (this.readyToRenderAppointments) {
this.toggleSmallClass();
Promise.resolve().then(() => {
var _this$_workSpace4;
this.toggleSmallClass();
null === (_this$_workSpace4 = this._workSpace) || void 0 === _this$_workSpace4 || _this$_workSpace4.updateHeaderEmptyCellWidth()
})
}
const $workSpace = (0, _renderer.default)(" ").appendTo(this.mainContainer);
const currentViewType = this.currentView.type;
const workSpaceComponent = VIEWS_CONFIG[currentViewType].workSpace;
const workSpaceConfig = this.workSpaceConfig(this.currentView);
this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
this.allowDragging() && this._workSpace.initDragBehavior(this, this.all);
this._workSpace.attachTablesEvents();
this._workSpace.getWorkArea().append(this._appointments.$element())
}
renderAgendaWorkspace() {
const $workSpace = (0, _renderer.default)(" ").appendTo(this.mainContainer);
const workSpaceConfig = this.workSpaceConfig(this.currentView);
const workSpaceComponent = VIEWS_CONFIG.agenda.workSpace;
this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
this._workSpace.getWorkArea().append(this._appointments.$element())
}
recalculateWorkspace() {
this.workSpaceRecalculation = new _deferred.Deferred;
(0, _visibility_change.triggerResizeEvent)(this._workSpace.$element());
this.waitAsyncTemplate(() => {
this._workSpace.renderCurrentDateTimeLineAndShader()
})
}
workSpaceConfig(currentViewOptions) {
const scrolling = this.getViewOption("scrolling");
const isVirtualScrolling = "virtual" === scrolling.mode;
const horizontalVirtualScrollingAllowed = isVirtualScrolling && (!(0, _type.isDefined)(scrolling.orientation) || ["horizontal", "both"].includes(scrolling.orientation));
const crossScrollingEnabled = this.option("crossScrollingEnabled") || horizontalVirtualScrollingAllowed || (0, _index2.isTimelineView)(currentViewOptions.type);
const result = (0, _extend.extend)({
resources: this.option("resources"),
getResourceManager: () => this.resourceManager,
getFilteredItems: () => this._layoutManager.filteredItems,
noDataText: this.option("noDataText") || _message.default.format("dxCollectionWidget-noDataText"),
firstDayOfWeek: this.option("firstDayOfWeek"),
startDayHour: this.option("startDayHour"),
endDayHour: this.option("endDayHour"),
viewOffset: this.getViewOffsetMs(),
tabIndex: this.option("tabIndex"),
accessKey: this.option("accessKey"),
focusStateEnabled: this.option("focusStateEnabled"),
cellDuration: this.option("cellDuration"),
showAllDayPanel: this.option("showAllDayPanel"),
showCurrentTimeIndicator: this.option("showCurrentTimeIndicator"),
indicatorTime: this.option("indicatorTime"),
indicatorUpdateInterval: this.option("indicatorUpdateInterval"),
shadeUntilCurrentTime: this.option("shadeUntilCurrentTime"),
crossScrollingEnabled: crossScrollingEnabled,
dataCellTemplate: this.option("dataCellTemplate"),
timeCellTemplate: this.option("timeCellTemplate"),
resourceCellTemplate: this.option("resourceCellTemplate"),
dateCellTemplate: this.option("dateCellTemplate"),
allowMultipleCellSelection: this.option("allowMultipleCellSelection"),
selectedCellData: this.option("selectedCellData"),
onSelectionChanged: args => {
this.option("selectedCellData", args.selectedCellData)
},
groupByDate: this.getViewOption("groupByDate"),
scrolling: scrolling,
draggingMode: this.option("_draggingMode"),
timeZoneCalculator: this.timeZoneCalculator,
schedulerHeight: this.option("height"),
schedulerWidth: this.option("width"),
allDayPanelMode: this.option("allDayPanelMode"),
onSelectedCellsClick: this.showAddAppointmentPopup.bind(this),
renderAppointments: () => {
this.renderAppointments()
},
onShowAllDayPanel: value => this.option("showAllDayPanel", value),
getHeaderHeight: () => _m_utils.utils.DOM.getHeaderHeight(this.header),
onScrollEnd: () => this._appointments.updateResizableArea(),
renovateRender: this.isRenovatedRender(isVirtualScrolling)
}, currentViewOptions);
result.notifyScheduler = this.notifyScheduler;
result.groups = this.resourceManager.groupResources();
result.onCellClick = this._createActionByOption("onCellClick");
result.onCellContextMenu = this._createActionByOption("onCellContextMenu");
result.currentDate = this.getViewOption("currentDate");
result.hoursInterval = result.cellDuration / 60;
result.allDayExpanded = false;
result.dataCellTemplate = result.dataCellTemplate ? this._getTemplate(result.dataCellTemplate) : null;
result.timeCellTemplate = result.timeCellTemplate ? this._getTemplate(result.timeCellTemplate) : null;
result.resourceCellTemplate = result.resourceCellTemplate ? this._getTemplate(result.resourceCellTemplate) : null;
result.dateCellTemplate = result.dateCellTemplate ? this._getTemplate(result.dateCellTemplate) : null;
return result
}
isRenovatedRender(isVirtualScrolling) {
return this.option("renovateRender") && (0, _window.hasWindow)() || isVirtualScrolling
}
waitAsyncTemplate(callback) {
if (this._options.silent("templatesRenderAsynchronously")) {
const timer = setTimeout(() => {
callback();
clearTimeout(timer)
});
this.asyncTemplatesTimers.push(timer)
} else {
callback()
}
}
getAppointmentTemplate(optionName) {
var _this$currentView;
if (null !== (_this$currentView = this.currentView) && void 0 !== _this$currentView && _this$currentView[optionName]) {
return this._getTemplate(this.currentView[optionName])
}
return this._getTemplateByOption(optionName)
}
updateOption(viewName, optionName, value) {
if ("header" === viewName) {
var _this$header2;
null === (_this$header2 = this.header) || void 0 === _this$header2 || _this$header2.option(optionName, value)
} else {
var _this$_workSpace5;
null === (_this$_workSpace5 = this._workSpace) || void 0 === _this$_workSpace5 || _this$_workSpace5.option(optionName, value)
}
}
refreshWorkSpace() {
this.cleanWorkSpace();
delete this._workSpace;
this.renderWorkSpace();
if (this.readyToRenderAppointments) {
if (this.option("_newAppointments")) {
this._appointments.option("$allDayContainer", this._workSpace.getAllDayContainer())
} else {
this._appointments.option({
fixedContainer: this._workSpace.getFixedContainer(),
allDayContainer: this._workSpace.getAllDayContainer()
})
}
this.waitAsyncTemplate(() => this.workSpaceRecalculation.resolve())
}
}
cleanWorkSpace() {
this._appointments.$element().detach();
this._workSpace._dispose();
this._workSpace.$element().remove();
this.option("selectedCellData", [])
}
getWorkSpaceScrollable() {
return this._workSpace.getScrollable()
}
getWorkSpaceScrollableContainer() {
return this._workSpace.getScrollableContainer()
}
getWorkSpace() {
return this._workSpace
}
getHeader() {
return this.header
}
cleanPopup() {
var _this$appointmentPopu2;
null === (_this$appointmentPopu2 = this.appointmentPopup) || void 0 === _this$appointmentPopu2 || _this$appointmentPopu2.dispose()
}
checkRecurringAppointment(rawAppointment, singleAppointment, exceptionDate, callback, isDeleted, isPopupEditing, dragEvent, recurrenceEditMode) {
const recurrenceRule = this._dataAccessors.get("recurrenceRule", rawAppointment);
if (!(0, _validate_rule.validateRRule)(recurrenceRule) || !this.editing.allowUpdating) {
callback();
return
}
const editMode = recurrenceEditMode || this.option("recurrenceEditMode");
switch (editMode) {
case "series":
callback();
break;
case "occurrence":
this.excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent);
break;
default:
if (dragEvent) {
dragEvent.cancel = new _deferred.Deferred
}
this.showRecurrenceChangeConfirm(isDeleted).done(editingMode => {
editingMode === RECURRENCE_EDITING_MODE_SERIES && callback();
editingMode === RECURRENCE_EDITING_MODE_OCCURRENCE && this.excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent)
}).fail(() => this._appointments.moveAppointmentBack(dragEvent))
}
}
excludeAppointmentFromSeries(rawAppointment, newRawAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent) {
const appointment = (0, _index2.excludeFromRecurrence)(rawAppointment, exceptionDate, this._dataAccessors);
const singleRawAppointment = Object.assign({}, newRawAppointment);
delete singleRawAppointment[this._dataAccessors.expr.recurrenceExceptionExpr];
delete singleRawAppointment[this._dataAccessors.expr.recurrenceRuleExpr];
const keyPropertyName = this.appointmentDataSource.keyName;
delete singleRawAppointment[keyPropertyName];
const canCreateNewAppointment = !isDeleted && !isPopupEditing;
if (canCreateNewAppointment) {
this.addAppointment(singleRawAppointment)
}
if (isPopupEditing) {
this.appointmentPopup.show(singleRawAppointment, {
onSave: newAppointment => {
this.updateAppointment(rawAppointment, appointment.source);
return (0, _deferred.when)(this.addAppointment(newAppointment)).done(() => this.scrollToAppointment(newAppointment))
},
title: _message.default.format("dxScheduler-editPopupTitle"),
readOnly: Boolean(appointment.source) && appointment.disabled
});
this.editAppointmentData = rawAppointment
} else {
this.updateAppointmentCore(rawAppointment, appointment.source, () => {
this._appointments.moveAppointmentBack(dragEvent)
}, dragEvent)
}
}
createRecurrenceException(appointment, exceptionDate) {
const result = [];
if (appointment.recurrenceException) {
result.push(appointment.recurrenceException)
}
result.push(this.getSerializedDate(exceptionDate, appointment.startDate, appointment.allDay));
return result.join()
}
getSerializedDate(date, startDate, isAllDay) {
isAllDay && date.setHours(startDate.getHours(), startDate.getMinutes(), startDate.getSeconds(), startDate.getMilliseconds());
return _date_serialization.default.serializeDate(date, "yyyyMMddTHHmmssZ")
}
showRecurrenceChangeConfirm(isDeleted) {
const title = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteTitle" : "dxScheduler-confirmRecurrenceEditTitle");
const message = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteMessage" : "dxScheduler-confirmRecurrenceEditMessage");
const seriesText = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteSeries" : "dxScheduler-confirmRecurrenceEditSeries");
const occurrenceText = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteOccurrence" : "dxScheduler-confirmRecurrenceEditOccurrence");
this.recurrenceDialog = (0, _dialog.custom)({
title: title,
messageHtml: message,
showCloseButton: true,
showTitle: true,
buttons: [{
text: seriesText,
onClick: () => RECURRENCE_EDITING_MODE_SERIES
}, {
text: occurrenceText,
onClick: () => RECURRENCE_EDITING_MODE_OCCURRENCE
}],
popupOptions: {
wrapperAttr: {
class: POPUP_DIALOG_CLASS
},
onHidden: () => {
var _this$_appointments;
null === (_this$_appointments = this._appointments) || void 0 === _this$_appointments || _this$_appointments.focus()
}
}
});
return this.recurrenceDialog.show()
}
getUpdatedData(rawAppointment) {
const viewOffset = this.getViewOffsetMs();
const getConvertedFromGrid = date => {
if (!date) {
return
}
const result = this.timeZoneCalculator.createDate(date, "fromGrid");
return _date3.dateUtilsTs.addOffsets(result, -viewOffset)
};
const targetCell = this.getTargetCellData();
const appointment = new _appointment_adapter.AppointmentAdapter(rawAppointment, this._dataAccessors);
const cellStartDate = getConvertedFromGrid(targetCell.startDate);
const cellEndDate = getConvertedFromGrid(targetCell.endDate);
let appointmentStartDate = new Date(appointment.startDate);
appointmentStartDate = _date3.dateUtilsTs.addOffsets(appointmentStartDate, -viewOffset);
let appointmentEndDate = new Date(appointment.endDate);
appointmentEndDate = _date3.dateUtilsTs.addOffsets(appointmentEndDate, -viewOffset);
let resultedStartDate = cellStartDate ?? appointmentStartDate;
if (!_date3.dateUtilsTs.isValidDate(appointmentStartDate)) {
appointmentStartDate = resultedStartDate
}
if (!_date3.dateUtilsTs.isValidDate(appointmentEndDate)) {
appointmentEndDate = cellEndDate
}
const duration = appointmentEndDate.getTime() - appointmentStartDate.getTime();
const isKeepAppointmentHours = this._workSpace.keepOriginalHours() && _date3.dateUtilsTs.isValidDate(appointment.startDate) && _date3.dateUtilsTs.isValidDate(cellStartDate);
if (isKeepAppointmentHours) {
const startDate = this.timeZoneCalculator.createDate(appointmentStartDate, "toGrid");
const timeInMs = startDate.getTime() - _date2.default.trimTime(startDate).getTime();
const targetCellStartDate = _date3.dateUtilsTs.addOffsets(targetCell.startDate, -viewOffset);
resultedStartDate = new Date(_date2.default.trimTime(targetCellStartDate).getTime() + timeInMs);
resultedStartDate = this.timeZoneCalculator.createDate(resultedStartDate, "fromGrid")
}
const result = new _appointment_adapter.AppointmentAdapter({}, this._dataAccessors);
if (void 0 !== targetCell.allDay) {
result.allDay = targetCell.allDay
}
result.startDate = resultedStartDate;
let resultedEndDate = new Date(resultedStartDate.getTime() + duration);
if (this.appointmentTakesAllDay(rawAppointment) && !result.allDay && this._workSpace.supportAllDayRow()) {
resultedEndDate = this._workSpace.calculateEndDate(resultedStartDate)
}
if (appointment.allDay && !this._workSpace.supportAllDayRow() && !this._workSpace.keepOriginalHours()) {
const dateCopy = new Date(resultedStartDate);
dateCopy.setHours(0);
resultedEndDate = new Date(dateCopy.getTime() + duration);
if (0 !== resultedEndDate.getHours()) {
resultedEndDate.setHours(this.getViewOption("endDayHour"))
}
}
result.startDate = _date3.dateUtilsTs.addOffsets(result.startDate, viewOffset);
result.endDate = _date3.dateUtilsTs.addOffsets(resultedEndDate, viewOffset);
const rawResult = result.source;
(0, _appointment_groups_utils.setAppointmentGroupValues)(rawResult, this.resourceManager.resourceById, targetCell.groups);
return rawResult
}
getTargetedAppointment(appointment, element) {
const settings = _m_utils.utils.dataAccessors.getAppointmentSettings(element);
return (0, _get_targeted_appointment.getTargetedAppointment)(appointment, settings, this._dataAccessors, this.resourceManager)
}
subscribe(subject, action) {
this.subscribes[subject] = _m_subscribes.default[subject] = action
}
fire(subject) {
const callback = this.subscribes[subject];
if (!(0, _type.isFunction)(callback)) {
throw _ui.default.Error("E1031", subject)
}
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key]
}
return callback.call(this, ...args)
}
getTargetCellData() {
return this._workSpace.getDataByDroppableCell()
}
updateAppointmentCore(target, rawAppointment, onUpdatePrevented, dragEvent) {
const updatingOptions = {
newData: rawAppointment,
oldData: (0, _extend.extend)({}, target),
cancel: false
};
const performFailAction = function(err) {
if (onUpdatePrevented) {
onUpdatePrevented.call(this)
}
if (err && "Error" === err.name) {
throw err
}
}.bind(this);
this.actions[StoreEventNames_UPDATING](updatingOptions);
if (dragEvent && !(0, _type.isDeferred)(dragEvent.cancel)) {
dragEvent.cancel = new _deferred.Deferred
}
if ((0, _type.isPromise)(updatingOptions.cancel) && dragEvent) {
this.updatingAppointments.add(target)
}
return this.processActionResult(updatingOptions, function(canceled) {
let deferred = new _deferred.Deferred;
if (!canceled) {
this.expandAllDayPanel(rawAppointment);
try {
deferred = this.appointmentDataSource.update(target, rawAppointment).done(() => {
null === dragEvent || void 0 === dragEvent || dragEvent.cancel.resolve(false)
}).always(storeAppointment => {
this.updatingAppointments.delete(target);
this.onDataPromiseCompleted(StoreEventNames_UPDATED, storeAppointment)
}).fail(() => performFailAction())
} catch (err) {
performFailAction(err);
this.updatingAppointments.delete(target);
deferred.resolve()
}
} else {
performFailAction();
this.updatingAppointments.delete(target);
deferred.resolve()
}
return deferred.promise()
})
}
processActionResult(actionOptions, callback) {
const deferred = new _deferred.Deferred;
const resolveCallback = callbackResult => {
(0, _deferred.when)((0, _deferred.fromPromise)(callbackResult)).always(deferred.resolve)
};
if ((0, _type.isPromise)(actionOptions.cancel)) {
(0, _deferred.when)((0, _deferred.fromPromise)(actionOptions.cancel)).always(cancel => {
if (!(0, _type.isDefined)(cancel)) {
cancel = "rejected" === actionOptions.cancel.state()
}
resolveCallback(callback.call(this, cancel))
})
} else {
resolveCallback(callback.call(this, actionOptions.cancel))
}
return deferred.promise()
}
expandAllDayPanel(appointment) {
if (!this.isAllDayExpanded() && this.appointmentTakesAllDay(appointment)) {
this.updateOption("workSpace", "allDayExpanded", true)
}
}
onDataPromiseCompleted(handlerName, storeAppointment, appointment) {
const args = {
appointmentData: appointment || storeAppointment
};
if (storeAppointment instanceof Error) {
args.error = storeAppointment
} else {
this.appointmentPopup.visible && this.appointmentPopup.hide()
}
this.actions[handlerName](args);
this._fireContentReadyAction()
}
getAppointmentsInstance() {
return this._appointments
}
getLayoutManager() {
return this._layoutManager
}
getActions() {
return this.actions
}
appointmentTakesAllDay(rawAppointment) {
const appointment = new _appointment_adapter.AppointmentAdapter(rawAppointment, this._dataAccessors);
return (0, _index2.isAppointmentTakesAllDay)(appointment, this.getViewOption("allDayPanelMode"))
}
dayHasAppointment(day, rawAppointment, trimTime) {
const getConvertedToTimeZone = date => this.timeZoneCalculator.createDate(date, "toGrid");
const appointment = new _appointment_adapter.AppointmentAdapter(rawAppointment, this._dataAccessors);
let startDate = new Date(appointment.startDate);
let endDate = new Date(appointment.endDate);
startDate = getConvertedToTimeZone(startDate);
endDate = getConvertedToTimeZone(endDate);
if (day.getTime() === endDate.getTime()) {
return startDate.getTime() === endDate.getTime()
}
if (trimTime) {
day = _date2.default.trimTime(day);
startDate = _date2.default.trimTime(startDate);
endDate = _date2.default.trimTime(endDate)
}
const dayTimeStamp = day.getTime();
const startDateTimeStamp = startDate.getTime();
const endDateTimeStamp = endDate.getTime();
return startDateTimeStamp <= dayTimeStamp && dayTimeStamp <= endDateTimeStamp
}
getStartViewDate() {
var _this$_workSpace6;
return null === (_this$_workSpace6 = this._workSpace) || void 0 === _this$_workSpace6 ? void 0 : _this$_workSpace6.getStartViewDate()
}
getEndViewDate() {
return this._workSpace.getEndViewDate()
}
showAddAppointmentPopup(cellData, cellGroups) {
const appointmentAdapter = new _appointment_adapter.AppointmentAdapter({}, this._dataAccessors);
appointmentAdapter.allDay = Boolean(cellData.allDay);
appointmentAdapter.startDate = cellData.startDateUTC;
appointmentAdapter.endDate = cellData.endDateUTC;
const resultAppointment = (0, _extend.extend)(appointmentAdapter.source, cellGroups);
this.showAppointmentPopup(resultAppointment, true)
}
showAppointmentPopup(rawAppointment, createNewAppointment, rawTargetedAppointment) {
const newRawTargetedAppointment = Object.assign({}, rawTargetedAppointment);
if (newRawTargetedAppointment) {
delete newRawTargetedAppointment.displayStartDate;
delete newRawTargetedAppointment.displayEndDate
}
const newTargetedAppointment = (0, _extend.extend)({}, rawAppointment, newRawTargetedAppointment);
const isCreateAppointment = createNewAppointment ?? (0, _type.isEmptyObject)(rawAppointment);
if ((0, _type.isEmptyObject)(rawAppointment)) {
rawAppointment = this.createPopupAppointment()
}
if (isCreateAppointment) {
delete this.editAppointmentData;
if (this.editing.allowAdding) {
this.appointmentPopup.show(rawAppointment, {
onSave: appointment => (0, _deferred.when)(this.addAppointment(appointment)).done(() => this.scrollToAppointment(appointment)),
title: _message.default.format("dxScheduler-newPopupTitle"),
readOnly: false
})
}
} else {
const startDate = this._dataAccessors.get("startDate", newRawTargetedAppointment || rawAppointment);
this.checkRecurringAppointment(rawAppointment, newTargetedAppointment, startDate, () => {
this.editAppointmentData = rawAppointment;
const adapter = new _appointment_adapter.AppointmentAdapter(rawAppointment, this._dataAccessors);
const isDisabled = Boolean(adapter.source) && adapter.disabled;
const readOnly = isDisabled || !this.editing.allowUpdating;
this.appointmentPopup.show(rawAppointment, {
onSave: appointment => (0, _deferred.when)(this.updateAppointment(rawAppointment, appointment)).done(() => this.scrollToAppointment(appointment)),
title: _message.default.format("dxScheduler-editPopupTitle"),
readOnly: readOnly
})
}, false, true)
}
}
createPopupAppointment() {
const result = {};
const toMs = _date2.default.dateToMilliseconds;
const startDate = new Date(this.option("currentDate"));
const endDate = new Date(startDate.getTime() + this.option("cellDuration") * toMs("minute"));
this._dataAccessors.set("startDate", result, startDate);
this._dataAccessors.set("endDate", result, endDate);
return result
}
hideAppointmentPopup(saveChanges) {
var _this$appointmentPopu3;
if (null !== (_this$appointmentPopu3 = this.appointmentPopup) && void 0 !== _this$appointmentPopu3 && _this$appointmentPopu3.visible) {
saveChanges && this.appointmentPopup.saveChangesAsync();
this.appointmentPopup.hide()
}
}
showAppointmentTooltip(appointment, element, targetedAppointment) {
if (appointment) {
const settings = _m_utils.utils.dataAccessors.getAppointmentSettings(element);
const appointmentConfig = {
itemData: targetedAppointment ?? appointment,
groupIndex: null === settings || void 0 === settings ? void 0 : settings.groupIndex
};
const info = {
appointment: appointment,
targetedAppointment: targetedAppointment,
color: this.resourceManager.getAppointmentColor(appointmentConfig)
};
this.showAppointmentTooltipCore(element, [info])
}
}
showAppointmentTooltipCore(target, data, options) {
const arg = {
cancel: false,
appointments: data.map(item => ({
appointmentData: item.appointment,
currentAppointmentData: Object.assign({}, item.targetedAppointment),
color: item.color
})),
targetElement: (0, _element.getPublicElement)(target)
};
this._createActionByOption("onAppointmentTooltipShowing")(arg);
if (this.appointmentTooltip.isAlreadyShown(target)) {
this.hideAppointmentTooltip()
} else {
this.processActionResult(arg, canceled => {
!canceled && this.appointmentTooltip.show(target, data, Object.assign({}, this.getExtraAppointmentTooltipOptions(), options))
})
}
}
hideAppointmentTooltip() {
var _this$appointmentTool2;
null === (_this$appointmentTool2 = this.appointmentTooltip) || void 0 === _this$appointmentTool2 || _this$appointmentTool2.hide()
}
scrollTo(date, groupValuesOrOptions, allDay) {
let groupValues;
let allDayValue;
let align = "center";
if (this.isScrollOptionsObject(groupValuesOrOptions)) {
groupValues = groupValuesOrOptions.group;
allDayValue = groupValuesOrOptions.allDay;
align = groupValuesOrOptions.alignInView ?? "center"
} else {
groupValues = groupValuesOrOptions;
allDayValue = allDay
}
this._workSpace.scrollTo(date, groupValues, allDayValue, true, align)
}
isScrollOptionsObject(options) {
return Boolean(options) && "object" === typeof options && ("alignInView" in options || "allDay" in options || "group" in options)
}
isHorizontalVirtualScrolling() {
const scrolling = this.option("scrolling");
const {
orientation: orientation,
mode: mode
} = scrolling;
const isVirtualScrolling = "virtual" === mode;
return isVirtualScrolling && ("horizontal" === orientation || "both" === orientation)
}
addAppointment(rawAppointment) {
const appointment = new _appointment_adapter.AppointmentAdapter(rawAppointment, this._dataAccessors);
appointment.text = appointment.text || "";
const serializedAppointment = appointment.serialize().source;
const addingOptions = {
appointmentData: serializedAppointment,
cancel: false
};
this.actions[StoreEventNames_ADDING](addingOptions);
return this.processActionResult(addingOptions, canceled => {
if (canceled) {
return (new _deferred.Deferred).resolve()
}
this.expandAllDayPanel(serializedAppointment);
return this.appointmentDataSource.add(serializedAppointment).always(storeAppointment => this.onDataPromiseCompleted(StoreEventNames_ADDED, storeAppointment))
})
}
updateAppointment(target, appointment) {
return this.updateAppointmentCore(target, appointment)
}
deleteAppointment(rawAppointment) {
const deletingOptions = this.fireOnAppointmentDeleting(rawAppointment);
this.processDeleteAppointment(rawAppointment, deletingOptions)
}
fireOnAppointmentDeleting(rawAppointment, targetedAppointmentData) {
const deletingOptions = {
appointmentData: rawAppointment,
targetedAppointmentData: targetedAppointmentData,
cancel: false
};
this.actions[StoreEventNames_DELETING](deletingOptions);
return deletingOptions
}
processDeleteAppointment(rawAppointment, deletingOptions) {
this.processActionResult(deletingOptions, function(canceled) {
if (!canceled) {
this.appointmentDataSource.remove(rawAppointment).always(storeAppointment => this.onDataPromiseCompleted(StoreEventNames_DELETED, storeAppointment, rawAppointment))
}
})
}
deleteRecurrence(appointment, date, recurrenceEditMode) {
if ("string" === typeof date) {
date = new Date(date)
}
this.checkRecurringAppointment(appointment, {}, date, () => {
this.processDeleteAppointment(appointment, {
cancel: false
})
}, true, false, null, recurrenceEditMode)
}
focus() {
if (this.editAppointmentData) {
this._appointments.focus()
} else {
this._workSpace.focus()
}
}
getFirstDayOfWeek() {
return (0, _type.isDefined)(this.getViewOption("firstDayOfWeek")) ? this.getViewOption("firstDayOfWeek") : _date.default.firstDayOfWeekIndex()
}
validateKeyFieldIfAgendaExist() {
if (!this.appointmentDataSource.isDataSourceInit) {
return
}
const hasAgendaView = this.hasAgendaView();
const isKeyNotExist = !this.appointmentDataSource.keyName;
if (hasAgendaView && isKeyNotExist) {
_ui.default.log("W1023")
}
}
_getDragBehavior() {
return this._workSpace.dragBehavior
}
_isAppointmentBeingUpdated(appointmentData) {
return this.updatingAppointments.has(appointmentData)
}
getViewOffsetMs() {
const offsetFromOptions = this.getViewOption("offset");
return this.normalizeViewOffsetValue(offsetFromOptions)
}
normalizeViewOffsetValue(viewOffset) {
var _this$currentView2;
if (!(0, _type.isDefined)(viewOffset) || (null === (_this$currentView2 = this.currentView) || void 0 === _this$currentView2 ? void 0 : _this$currentView2.type) === _constants_view.VIEWS.AGENDA) {
return 0
}
return viewOffset * toMs("minute")
}
}
Scheduler.include(_data_helper.default);
(0, _component_registrator.default)("dxScheduler", Scheduler);
exports.default = Scheduler
},
58713(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _message = _interopRequireDefault(__webpack_require__( /*! ../../common/core/localization/message */ 4671));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 64553));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 41380));
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 52576);
var _get_delta_time = __webpack_require__( /*! ./appointments/resizing/get_delta_time */ 334);
var _get_date_text = __webpack_require__( /*! ./appointments_new/utils/get_date_text */ 4995);
var _constants = __webpack_require__( /*! ./constants */ 25307);
var _m_utils = __webpack_require__( /*! ./m_utils */ 5327);
var _base = __webpack_require__( /*! ./r1/utils/base */ 44611);
var _appointment_adapter = __webpack_require__( /*! ./utils/appointment_adapter/appointment_adapter */ 36791);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const toMs = _date.default.dateToMilliseconds;
const isAllDay = (scheduler, appointmentData) => {
const adapter = new _appointment_adapter.AppointmentAdapter(appointmentData, scheduler._dataAccessors);
if (_constants.VERTICAL_VIEW_TYPES.includes(scheduler.currentView.type)) {
return (0, _base.isAppointmentTakesAllDay)(adapter, scheduler.option("allDayPanelMode"))
}
return adapter.allDay
};
const subscribes = {
isCurrentViewAgenda() {
return "agenda" === this.currentView.type
},
getOption(name) {
return this.option(name)
},
isVirtualScrolling() {
return this.isVirtualScrolling()
},
isGroupedByDate() {
return this.getWorkSpace().isGroupedByDate()
},
showAppointmentTooltip(options) {
const targetedAppointment = this.getTargetedAppointment(options.data, options.target);
this.showAppointmentTooltip(options.data, options.target, targetedAppointment)
},
hideAppointmentTooltip() {
this.hideAppointmentTooltip()
},
showEditAppointmentPopup(options) {
const targetedData = this.getTargetedAppointment(options.data, options.target);
this.showAppointmentPopup(options.data, false, targetedData)
},
updateAppointmentAfterResize(options) {
const {
info: info
} = _m_utils.utils.dataAccessors.getAppointmentSettings(options.$appointment);
const {
startDate: startDate
} = info.sourceAppointment;
this.checkRecurringAppointment(options.target, options.data, startDate, () => {
this.updateAppointmentCore(options.target, options.data, function() {
this._appointments.moveAppointmentBack()
})
})
},
getUpdatedData(rawAppointment) {
return this.getUpdatedData(rawAppointment)
},
updateAppointmentAfterDrag(_ref) {
let {
event: event,
element: element,
rawAppointment: rawAppointment,
isDropToTheSameCell: isDropToTheSameCell,
isDropToSelfScheduler: isDropToSelfScheduler
} = _ref;
const {
info: info
} = _m_utils.utils.dataAccessors.getAppointmentSettings(element);
const targetedRawAppointment = (0, _extend.extend)({}, rawAppointment, this.getUpdatedData(rawAppointment));
const fromAllDay = Boolean(rawAppointment.allDay);
const toAllDay = Boolean(targetedRawAppointment.allDay);
const isDropBetweenAllDay = this._workSpace.supportAllDayRow() && fromAllDay !== toAllDay;
const isDragAndDropBetweenComponents = event.fromComponent !== event.toComponent;
const onCancel = () => {
this._appointments.moveAppointmentBack(event)
};
if (!isDropToSelfScheduler && isDragAndDropBetweenComponents) {
return
}
if (isDropToSelfScheduler && (!isDropToTheSameCell || isDragAndDropBetweenComponents || isDropBetweenAllDay)) {
this.checkRecurringAppointment(rawAppointment, targetedRawAppointment, info.sourceAppointment.startDate, () => {
this.updateAppointmentCore(rawAppointment, targetedRawAppointment, onCancel, event)
}, void 0, void 0, event)
} else {
onCancel()
}
},
onDeleteButtonPress(options) {
const targetedData = this.getTargetedAppointment(options.data, (0, _renderer.default)(options.target));
this.checkAndDeleteAppointment(options.data, targetedData);
this.hideAppointmentTooltip()
},
createFormattedDateText(appointment, targetedAppointmentRaw, format) {
const targetedAppointment = Object.assign({}, appointment, targetedAppointmentRaw);
const adapter = new _appointment_adapter.AppointmentAdapter(targetedAppointment, this._dataAccessors);
const startDate = targetedAppointment.displayStartDate || this.timeZoneCalculator.createDate(adapter.startDate, "toGrid");
const endDate = targetedAppointment.displayEndDate || this.timeZoneCalculator.createDate(adapter.endDate, "toGrid");
const formatType = format ?? (0, _get_date_text.getDateFormatType)(startDate, endDate, adapter.allDay, this.currentView.type);
return {
text: adapter.text || _message.default.format("dxScheduler-noSubject"),
formatDate: (0, _get_date_text.getDateText)(startDate, endDate, formatType)
}
},
getResizableAppointmentArea(options) {
const {
allDay: allDay
} = options;
const groups = this.getViewOption("groups");
if (null !== groups && void 0 !== groups && groups.length) {
if (allDay || "month" === this.currentView.type) {
const horizontalGroupBounds = this._workSpace.getGroupBounds(options.coordinates);
return {
left: horizontalGroupBounds.left,
right: horizontalGroupBounds.right,
top: 0,
bottom: 0
}
}
if (!allDay && _constants.VERTICAL_VIEW_TYPES.includes(this.currentView.type) && this._workSpace.isVerticalGroupedWorkSpace()) {
const verticalGroupBounds = this._workSpace.getGroupBounds(options.coordinates);
return {
left: 0,
right: 0,
top: verticalGroupBounds.top,
bottom: verticalGroupBounds.bottom
}
}
}
return
},
needRecalculateResizableArea() {
return this.getWorkSpace().needRecalculateResizableArea()
},
isAllDay(appointmentData) {
return isAllDay(this, appointmentData)
},
getDeltaTime(e, initialSize, itemData) {
return (0, _get_delta_time.getDeltaTime)(e, initialSize, {
viewType: this.currentView.type,
cellSize: {
width: this.getWorkSpace().getCellWidth(),
height: this.getWorkSpace().getCellHeight()
},
cellDurationInMinutes: this.getWorkSpace().option("cellDuration"),
resizableStep: this.getWorkSpace().positionHelper.getResizableStep(),
isAllDayPanel: isAllDay(this, itemData)
})
},
getCellWidth() {
return this.getWorkSpace().getCellWidth()
},
getCellHeight() {
return this.getWorkSpace().getCellHeight()
},
needCorrectAppointmentDates() {
return !["month", "timelineMonth"].includes(this.currentView.type)
},
getRenderingStrategyDirection() {
return _constants.VERTICAL_VIEW_TYPES.includes(this.currentView.type) ? "vertical" : "horizontal"
},
updateAppointmentEndDate(options) {
const {
endDate: endDate
} = options;
const endDayHour = this.getViewOption("endDayHour");
const startDayHour = this.getViewOption("startDayHour");
let updatedEndDate = endDate;
if (endDate.getHours() >= endDayHour) {
updatedEndDate.setHours(endDayHour, 0, 0, 0)
} else if (!options.isSameDate && startDayHour > 0 && 60 * endDate.getHours() + endDate.getMinutes() < 60 * startDayHour) {
updatedEndDate = new Date(updatedEndDate.getTime() - toMs("day"));
updatedEndDate.setHours(endDayHour, 0, 0, 0)
}
return updatedEndDate
},
renderCompactAppointments(options) {
return this._compactAppointmentsHelper.render(options)
},
clearCompactAppointments() {
this._compactAppointmentsHelper.clear()
},
getGroupCount() {
return this._workSpace._getGroupCount()
},
mapAppointmentFields(config) {
const {
itemData: itemData,
itemElement: itemElement,
targetedAppointment: targetedAppointment
} = config;
const targetedData = targetedAppointment || this.getTargetedAppointment(itemData, itemElement);
return {
appointmentData: config.itemData,
appointmentElement: config.itemElement,
targetedAppointmentData: targetedData
}
},
dayHasAppointment(day, appointment, trimTime) {
return this.dayHasAppointment(day, appointment, trimTime)
},
getLayoutManager() {
return this._layoutManager
},
getAgendaVerticalStepHeight() {
return this.getWorkSpace().getAgendaVerticalStepHeight()
},
getAgendaDuration() {
return this.getViewOption("agendaDuration")
},
getStartViewDate() {
return this.getStartViewDate()
},
getEndViewDate() {
return this.getEndViewDate()
},
forceMaxAppointmentPerCell() {
return this.forceMaxAppointmentPerCell()
},
getTargetedAppointmentData(appointment, element) {
return this.getTargetedAppointment(appointment, element)
},
getEndDayHour() {
return this._workSpace.option("endDayHour") || this.option("endDayHour")
},
getStartDayHour() {
return this._workSpace.option("startDayHour") || this.option("startDayHour")
},
getViewOffsetMs() {
return this.getViewOffsetMs()
},
isAdaptive() {
return this.option("adaptivityEnabled")
},
removeDroppableCellClass() {
this._workSpace.removeDroppableCellClass()
}
};
exports.default = subscribes
},
92201(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../core/dom_adapter */ 64960));
var _element = __webpack_require__( /*! ../../core/element */ 61404);
var _element_data = __webpack_require__( /*! ../../core/element_data */ 74663);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 64553));
var _type = __webpack_require__( /*! ../../core/utils/type */ 11528);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.default = {
tableCreator: new class {
constructor() {
this.VERTICAL = "vertical";
this.HORIZONTAL = "horizontal"
}
insertAllDayRow(allDayElements, tableBody, index) {
if (allDayElements[index]) {
let row = allDayElements[index].find("tr");
if (!row.length) {
row = (0, _renderer.default)(_dom_adapter.default.createElement("tr"));
row.append(allDayElements[index].get(0))
}
tableBody.appendChild(row.get ? row.get(0) : row)
}
}
makeTable(options) {
const tableBody = _dom_adapter.default.createElement("tbody");
const templateCallbacks = [];
let row;
const rowCountInGroup = options.groupCount ? options.rowCount / options.groupCount : options.rowCount;
let allDayElementIndex = 0;
const {
allDayElements: allDayElements
} = options;
const {
groupIndex: groupIndex
} = options;
const {
rowCount: rowCount
} = options;
(0, _renderer.default)(options.container).append(tableBody);
if (allDayElements) {
this.insertAllDayRow(allDayElements, tableBody, 0);
allDayElementIndex++
}
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
row = _dom_adapter.default.createElement("tr");
tableBody.appendChild(row);
const isLastRowInGroup = (rowIndex + 1) % rowCountInGroup === 0;
if (options.rowClass) {
row.className = options.rowClass
}
for (let columnIndex = 0; columnIndex < options.cellCount; columnIndex++) {
var _options$setAdditiona;
const td = _dom_adapter.default.createElement("td");
row.appendChild(td);
if (options.cellClass) {
if ((0, _type.isFunction)(options.cellClass)) {
td.className = options.cellClass(rowIndex, columnIndex)
} else {
td.className = options.cellClass
}
}
let cellDataObject;
let dataKey;
let dataValue;
if (options.getCellData) {
cellDataObject = options.getCellData(td, rowIndex, columnIndex, groupIndex);
dataKey = cellDataObject.key;
dataValue = cellDataObject.value;
dataKey && (0, _element_data.data)(td, dataKey, dataValue)
}
null === (_options$setAdditiona = options.setAdditionalClasses) || void 0 === _options$setAdditiona || _options$setAdditiona.call(options, (0, _renderer.default)(td), dataValue);
if (options.cellTemplate && options.cellTemplate.render) {
const additionalTemplateData = options.getTemplateData ? options.getTemplateData(rowIndex) : {};
const templateOptions = {
model: Object.assign({
text: options.getCellText ? options.getCellText(rowIndex, columnIndex) : "",
date: options.getCellDate ? options.getCellDate(rowIndex) : void 0
}, additionalTemplateData),
container: (0, _element.getPublicElement)((0, _renderer.default)(td)),
index: rowIndex * options.cellCount + columnIndex
};
if (dataValue) {
if (dataValue.startDate) {
templateOptions.model.startDate = dataValue.startDate
}
if (dataValue.endDate) {
templateOptions.model.endDate = dataValue.endDate
}
if (dataValue.groups) {
templateOptions.model.groups = dataValue.groups
}
if (dataValue.allDay) {
templateOptions.model.allDay = dataValue.allDay
}
}
templateCallbacks.push(options.cellTemplate.render.bind(options.cellTemplate, templateOptions))
} else if (options.getCellText) {
(0, _renderer.default)(" ").text(options.getCellText(rowIndex, columnIndex)).addClass(options.getCellTextClass).appendTo((0, _renderer.default)(td))
}
}
if (allDayElements && isLastRowInGroup) {
this.insertAllDayRow(allDayElements, tableBody, allDayElementIndex);
allDayElementIndex++
}
}
return templateCallbacks
}
makeGroupedTable(type, groups, cssClasses, cellCount, cellTemplate, rowCount, groupByDate) {
let rows = [];
if (type === this.VERTICAL) {
rows = this.makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount)
} else {
rows = this.makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate)
}
return rows
}
makeGroupedTableFromJSON(tree, config) {
let table;
const cellStorage = [];
let rowIndex = 0;
config = config || {};
const cellTag = config.cellTag || "td";
const {
groupTableClass: groupTableClass
} = config;
const {
groupRowClass: groupRowClass
} = config;
const {
groupCellClass: groupCellClass
} = config;
const {
groupCellCustomContent: groupCellCustomContent
} = config;
function getChildCount(item) {
if (item.children) {
return item.children.length
}
return 0
}
function createCell(text, childCount, index, node) {
const cell = {
element: _dom_adapter.default.createElement(cellTag),
childCount: childCount
};
if (groupCellClass) {
cell.element.className = groupCellClass
}
const cellText = _dom_adapter.default.createTextNode(text);
if ("function" === typeof groupCellCustomContent) {
groupCellCustomContent(cell.element, cellText, index, node)
} else {
cell.element.appendChild(cellText)
}
return cell
}! function() {
table = _dom_adapter.default.createElement("table");
if (groupTableClass) {
table.className = groupTableClass
}
}();
! function generateCells(groupNodes) {
for (let i = 0; i < groupNodes.length; i++) {
const childCount = getChildCount(groupNodes[i]);
const cell = createCell(groupNodes[i].resourceText, childCount, i, groupNodes[i]);
if (!cellStorage[rowIndex]) {
cellStorage[rowIndex] = []
}
cellStorage[rowIndex].push(cell);
if (childCount) {
generateCells(groupNodes[i].children)
} else {
rowIndex++
}
}
}(tree);
void cellStorage.forEach(cells => {
const row = _dom_adapter.default.createElement("tr");
if (groupRowClass) {
row.className = groupRowClass
}
const rowspans = [];
for (let i = cells.length - 1; i >= 0; i--) {
const prev = cells[i + 1];
let rowspan = cells[i].childCount;
if (prev && prev.childCount) {
rowspan *= prev.childCount
}
rowspans.push(rowspan)
}
rowspans.reverse();
cells.forEach((cell, index) => {
if (rowspans[index]) {
cell.element.setAttribute("rowSpan", rowspans[index])
}
row.appendChild(cell.element)
});
table.appendChild(row)
});
return table
}
makeFlexGroupedRowCells(group, repeatCount, cssClasses, cellTemplate) {
let repeatByDate = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1;
const cells = [];
const {
items: items
} = group;
const itemCount = items.length;
for (let i = 0; i < repeatCount * repeatByDate; i++) {
for (let j = 0; j < itemCount; j++) {
let $container = (0, _renderer.default)(" ");
const cell = {};
if (cellTemplate && cellTemplate.render) {
const templateOptions = {
model: items[j],
container: (0, _element.getPublicElement)($container),
index: i * itemCount + j
};
if (group.data) {
templateOptions.model.data = group.data[j]
}
cell.template = cellTemplate.render.bind(cellTemplate, templateOptions)
} else {
$container.text(items[j].text).attr("title", items[j].text).addClass("dx-scheduler-group-header-content");
$container = (0, _renderer.default)(" ").append($container)
}
const cssClass = (0, _type.isFunction)(cssClasses.groupHeaderClass) ? cssClasses.groupHeaderClass(j) : cssClasses.groupHeaderClass;
cell.element = $container.addClass(cssClass);
cells.push(cell)
}
}
return cells
}
makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount) {
const cellTemplates = [];
let repeatCount = 1;
const cellsArray = [];
const cellIterator = function(cell) {
if (cell.template) {
cellTemplates.push(cell.template)
}
};
for (let i = 0; i < groups.length; i++) {
if (i > 0) {
repeatCount = groups[i - 1].items.length * repeatCount
}
const cells = this.makeFlexGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate);
cells.forEach(cellIterator);
cellsArray.push(cells)
}
const rows = [];
const groupCount = cellsArray.length;
for (let i = 0; i < groupCount; i++) {
rows.push((0, _renderer.default)(" ").addClass(cssClasses.groupHeaderRowClass))
}
for (let i = groupCount - 1; i >= 0; i--) {
const currentColumnLength = cellsArray[i].length;
for (let j = 0; j < currentColumnLength; j++) {
rows[i].append(cellsArray[i][j].element)
}
}
return {
elements: (0, _renderer.default)(" ").addClass("dx-scheduler-group-flex-container").append(rows),
cellTemplates: cellTemplates
}
}
makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) {
let repeatCount = 1;
const groupCount = groups.length;
const rows = [];
const cellTemplates = [];
const repeatByDate = groupByDate ? cellCount : 1;
const cellIterator = function(cell) {
if (cell.template) {
cellTemplates.push(cell.template)
}
return cell.element
};
for (let i = 0; i < groupCount; i++) {
if (i > 0) {
repeatCount = groups[i - 1].items.length * repeatCount
}
const cells = this.makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate, repeatByDate);
rows.push((0, _renderer.default)(" ").addClass(cssClasses.groupRowClass).append(cells.map(cellIterator)))
}
const maxCellCount = rows[groupCount - 1].find("th").length;
for (let j = 0; j < groupCount; j++) {
const $cell = rows[j].find("th");
let colspan = maxCellCount / $cell.length;
if (!groupByDate) {
colspan *= cellCount
}
if (colspan > 1 && 1 === repeatByDate || groupByDate && groupCount > 1) {
$cell.attr("colSpan", colspan)
}
}
return {
elements: rows,
cellTemplates: cellTemplates
}
}
makeGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate) {
repeatByDate = repeatByDate || 1;
repeatCount *= repeatByDate;
const cells = [];
const {
items: items
} = group;
const itemCount = items.length;
for (let i = 0; i < repeatCount; i++) {
for (let j = 0; j < itemCount; j++) {
let $container = (0, _renderer.default)("");
const cell = {};
if (cellTemplate && cellTemplate.render) {
const templateOptions = {
model: items[j],
container: (0, _element.getPublicElement)($container),
index: i * itemCount + j
};
if (group.data) {
templateOptions.model.data = group.data[j]
}
cell.template = cellTemplate.render.bind(cellTemplate, templateOptions)
} else {
$container.text(items[j].text);
$container = (0, _renderer.default)(" ").append($container)
}
$container.addClass(cssClasses.groupHeaderContentClass);
let cssClass;
if ((0, _type.isFunction)(cssClasses.groupHeaderClass)) {
cssClass = cssClasses.groupHeaderClass(j)
} else {
cssClass = cssClasses.groupHeaderClass
}
cell.element = (0, _renderer.default)(" ").addClass(cssClass).append($container);
cells.push(cell)
}
}
return cells
}
}
}
},
5327(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.utils = void 0;
var _element = __webpack_require__( /*! ../../core/element */ 61404);
var _renderer = (e = __webpack_require__( /*! ../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
var _size = __webpack_require__( /*! ../../core/utils/size */ 57653);
var _constants = __webpack_require__( /*! ./constants */ 25307);
exports.utils = {
dataAccessors: {
getAppointmentSettings: element => (0, _renderer.default)(element).data(_constants.APPOINTMENT_SETTINGS_KEY)
},
DOM: {
getHeaderHeight: header => header ? header._$element && parseInt((0, _size.getOuterHeight)(header._$element), 10) : 0
},
renovation: {
renderComponent: (widget, parentElement, componentClass, componentName, viewModel) => {
let component = widget[componentName];
if (!component) {
const container = (0, _element.getPublicElement)(parentElement);
component = widget._createComponent(container, componentClass, viewModel);
widget[componentName] = component
} else {
const $element = component.$element();
const elementStyle = $element.get(0).style;
const {
height: height
} = elementStyle;
const {
width: width
} = elementStyle;
component.option(viewModel);
if (height) {
(0, _size.setHeight)($element, height)
}
if (width) {
(0, _size.setWidth)($element, width)
}
}
}
}
}
},
18648(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _errors = _interopRequireDefault(__webpack_require__( /*! ../../core/errors */ 87129));
var _date = __webpack_require__( /*! ../core/utils/date */ 55594);
var _index = __webpack_require__( /*! ../scheduler/utils/index */ 80356);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 41380));
var _global_cache = __webpack_require__( /*! ./global_cache */ 23710);
var _timezone_list = _interopRequireDefault(__webpack_require__( /*! ./timezones/timezone_list */ 95053));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const timeZoneListSet = new Set(_timezone_list.default.value);
const toMs = _date2.default.dateToMilliseconds;
const offsetFormatRegexp = /^GMT(?:[+-]\d{2}:\d{2})?$/;
const getTimezoneOffsetChangeInMinutes = (startDate, endDate, updatedStartDate, updatedEndDate) => getDaylightOffset(updatedStartDate, updatedEndDate) - getDaylightOffset(startDate, endDate);
const getDaylightOffset = (startDate, endDate) => new Date(startDate).getTimezoneOffset() - new Date(endDate).getTimezoneOffset();
const getDaylightOffsetInMs = (startDate, endDate) => getDaylightOffset(startDate, endDate) * toMs("minute");
const calculateTimezoneByValue = function(timeZone) {
let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
if (!timeZone) {
return
}
const isValidTimezone = timeZoneListSet.has(timeZone);
if (!isValidTimezone) {
_errors.default.log("W0009", timeZone);
return
}
const dateObj = new Date(date);
if (!_date.dateUtilsTs.isValidDate(dateObj)) {
return
}
if (isEqualLocalTimeZone(timeZone)) {
return -dateObj.getTimezoneOffset() / 60
}
return function(timeZone) {
let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
const offset = getStringOffset(timeZone, date);
if (void 0 === offset) {
return
}
if ("GMT" === offset) {
return 0
}
const isMinus = "-" === offset.substring(3, 4);
const hours = offset.substring(4, 6);
const minutes = offset.substring(7, 9);
const result = parseInt(hours, 10) + parseInt(minutes, 10) / 60;
return isMinus ? -result : result
}(timeZone, dateObj)
};
const getStringOffset = function(timeZone) {
let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
let result = "";
try {
var _dateTimeFormat$forma;
const dateTimeFormat = _global_cache.globalCache.timezones.memo(`intl${timeZone}`, () => new Intl.DateTimeFormat("en-US", {
timeZone: timeZone,
timeZoneName: "longOffset"
}));
result = (null === (_dateTimeFormat$forma = dateTimeFormat.formatToParts(date).find(_ref => {
let {
type: type
} = _ref;
return "timeZoneName" === type
})) || void 0 === _dateTimeFormat$forma ? void 0 : _dateTimeFormat$forma.value) ?? ""
} catch (e) {
_errors.default.log("W0009", timeZone);
return
}
const isSupportedFormat = offsetFormatRegexp.test(result);
if (!isSupportedFormat) {
_errors.default.log("W0009", timeZone);
return
}
return result
};
const getTimezoneTitle = function(timeZone) {
let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
if (!_date.dateUtilsTs.isValidDate(date)) {
return ""
}
const tzNamePart = timeZone.replace(/\//g, " - ").replace(/_/g, " ");
const offset = getStringOffset(timeZone, date);
if (void 0 === offset) {
return
}
const offsetNamePart = (offset => {
if ("GMT" === offset) {
return `${offset} +00:00`
}
return offset.replace("GMT", "GMT ")
})(offset);
return `(${offsetNamePart}) ${tzNamePart}`
};
const _getDaylightOffsetByTimezone = (startDate, endDate, timeZone) => {
const startDayOffset = calculateTimezoneByValue(timeZone, startDate);
const endDayOffset = calculateTimezoneByValue(timeZone, endDate);
if (void 0 === startDayOffset || void 0 === endDayOffset) {
return 0
}
return startDayOffset - endDayOffset
};
const isTimezoneChangeInDate = date => {
const startDayDate = new Date(new Date(date).setHours(0, 0, 0, 0));
const endDayDate = new Date(new Date(date).setHours(23, 59, 59, 0));
return startDayDate.getTimezoneOffset() - endDayDate.getTimezoneOffset() !== 0
};
const getClientTimezoneOffset = function() {
let date = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Date;
return 6e4 * date.getTimezoneOffset()
};
const getMachineTimezoneName = () => _global_cache.globalCache.timezones.memo("localTimezone", () => _date2.default.getMachineTimezoneName());
const isEqualLocalTimeZone = timeZoneName => {
const localTimeZoneName = getMachineTimezoneName();
if (localTimeZoneName && localTimeZoneName === timeZoneName) {
return true
}
return false
};
const utils = {
getDaylightOffset: getDaylightOffset,
getDaylightOffsetInMs: getDaylightOffsetInMs,
getTimezoneOffsetChangeInMinutes: getTimezoneOffsetChangeInMinutes,
getTimezoneOffsetChangeInMs: (startDate, endDate, updatedStartDate, updatedEndDate) => getTimezoneOffsetChangeInMinutes(startDate, endDate, updatedStartDate, updatedEndDate) * toMs("minute"),
calculateTimezoneByValue: calculateTimezoneByValue,
getCorrectedDateByDaylightOffsets: (convertedOriginalStartDate, convertedDate, date, timeZone, startDateTimezone) => {
const daylightOffsetByCommonTimezone = _getDaylightOffsetByTimezone(convertedOriginalStartDate, convertedDate, timeZone);
const daylightOffsetByAppointmentTimezone = _getDaylightOffsetByTimezone(convertedOriginalStartDate, convertedDate, startDateTimezone);
const diff = daylightOffsetByCommonTimezone - daylightOffsetByAppointmentTimezone;
return new Date(date.getTime() - diff * toMs("hour"))
},
isSameAppointmentDates: (startDate, endDate) => {
endDate = new Date(endDate.getTime() - 1);
return _date2.default.sameDate(startDate, endDate)
},
correctRecurrenceExceptionByTimezone: (exception, exceptionByStartDate) => {
const timezoneOffset = (exception.getTimezoneOffset() - exceptionByStartDate.getTimezoneOffset()) / 60;
return new Date(exception.getTime() + timezoneOffset * toMs("hour"))
},
getClientTimezoneOffset: getClientTimezoneOffset,
getDiffBetweenClientTimezoneOffsets: function() {
let firstDate = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Date;
let secondDate = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
return getClientTimezoneOffset(firstDate) - getClientTimezoneOffset(secondDate)
},
createUTCDateWithLocalOffset: date => {
if (!date) {
return date
}
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()))
},
createDateFromUTCWithLocalOffset: date => new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()),
isTimezoneChangeInDate: isTimezoneChangeInDate,
getDateWithoutTimezoneChange: date => {
const clonedDate = new Date(date);
if (isTimezoneChangeInDate(clonedDate)) {
const result = new Date(clonedDate);
return new Date(result.setDate(result.getDate() + 1))
}
return clonedDate
},
getMachineTimezoneName: getMachineTimezoneName,
isEqualLocalTimeZone: isEqualLocalTimeZone,
addOffsetsWithoutDST: function(date) {
for (var _len = arguments.length, offsets = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
offsets[_key - 1] = arguments[_key]
}
const newDate = _date.dateUtilsTs.addOffsets(date, ...offsets);
const daylightShift = getDaylightOffsetInMs(date, newDate);
if (!daylightShift) {
return newDate
}
const correctLocalDate = _date.dateUtilsTs.addOffsets(newDate, -daylightShift);
const daylightSecondShift = getDaylightOffsetInMs(newDate, correctLocalDate);
return !daylightSecondShift ? correctLocalDate : newDate
},
getTimeZones: function() {
let date = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Date;
let timeZones = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _timezone_list.default.value;
return timeZones.map(timezoneId => ({
id: timezoneId,
title: getTimezoneTitle(timezoneId, date),
offset: calculateTimezoneByValue(timezoneId, date)
}))
},
getTimeZonesCache: () => _global_cache.globalCache.timezones.get("timeZonesCache") ?? [],
cacheTimeZones: async () => _global_cache.globalCache.timezones.memo("timeZonesCachePromise", () => _index.macroTaskArray.map(_timezone_list.default.value, timezoneId => ({
id: timezoneId,
title: getTimezoneTitle(timezoneId, new Date)
}), 10).then(data => _global_cache.globalCache.timezones.memo("timeZonesCache", () => data))),
isLocalTimeMidnightDST: date => {
const startDayDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
return 1 === startDayDate.getHours()
}
};
exports.default = utils
},
83061(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _const = __webpack_require__( /*! ../const */ 52728);
var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 48661);
class AllDayPanelCell extends _index.BaseInfernoComponent {
render() {
const {
className: className,
viewContext: viewContext,
dataCellTemplate: dataCellTemplate,
endDate: endDate,
groupIndex: groupIndex,
groups: groups,
index: index,
isFirstGroupCell: isFirstGroupCell,
isFocused: isFocused,
isLastGroupCell: isLastGroupCell,
isSelected: isSelected,
startDate: startDate
} = this.props;
return (0, _inferno.createComponentVNode)(2, _date_table_cell_base.DateTableCellBase, {
className: `${_const.ALL_DAY_PANEL_CELL_CLASS} ${className}`,
viewContext: viewContext,
startDate: startDate,
endDate: endDate,
groups: groups,
groupIndex: groupIndex,
allDay: true,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
index: index,
dataCellTemplate: dataCellTemplate,
isSelected: isSelected,
isFocused: isFocused
})
}
}
exports.AllDayPanelCell = AllDayPanelCell;
AllDayPanelCell.defaultProps = _date_table_cell_base.DateTableCallBaseDefaultProps
},
49673(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayTable = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _const = __webpack_require__( /*! ../const */ 52728);
var _all_day_panel_table_body = __webpack_require__( /*! ./all_day_panel_table_body */ 99552);
var _layout_props = __webpack_require__( /*! ./layout_props */ 76322);
var _table = __webpack_require__( /*! ./table */ 46189);
class AllDayTable extends _index.InfernoWrapperComponent {
constructor() {
super(...arguments);
this.allDayPanelData = null
}
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
getAllDayPanelData() {
if (null !== this.allDayPanelData) {
return this.allDayPanelData
}
this.allDayPanelData = this.props.viewData.groupedData[0].allDayPanel;
return this.allDayPanelData
}
componentWillUpdate(nextProps) {
super.componentWillUpdate();
if (this.props.viewData !== nextProps.viewData) {
this.allDayPanelData = null
}
}
render() {
const {
viewData: viewData,
viewContext: viewContext,
width: width,
tableRef: tableRef,
dataCellTemplate: dataCellTemplate
} = this.props;
const allDayPanelData = this.getAllDayPanelData();
return (0, _inferno.createComponentVNode)(2, _table.Table, {
className: "dx-scheduler-all-day-table",
height: allDayPanelData ? void 0 : _const.DefaultSizes.allDayPanelHeight,
width: width,
tableRef: tableRef,
children: (0, _inferno.createComponentVNode)(2, _all_day_panel_table_body.AllDayPanelTableBody, {
viewData: allDayPanelData ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.viewData,
viewContext: viewContext,
leftVirtualCellWidth: viewData.leftVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: viewData.rightVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.rightVirtualCellWidth,
leftVirtualCellCount: viewData.leftVirtualCellCount,
rightVirtualCellCount: viewData.rightVirtualCellCount,
dataCellTemplate: dataCellTemplate
})
})
}
}
exports.AllDayTable = AllDayTable;
AllDayTable.defaultProps = _layout_props.LayoutDefaultProps
},
99552(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelTableBodyDefaultProps = exports.AllDayPanelTableBody = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _render_utils = __webpack_require__( /*! ../../../../core/r1/utils/render_utils */ 71312);
var _all_day_panel_cell = __webpack_require__( /*! ./all_day_panel_cell */ 83061);
var _row = __webpack_require__( /*! ./row */ 21541);
const AllDayPanelTableBodyDefaultProps = exports.AllDayPanelTableBodyDefaultProps = {
viewData: [],
isVerticalGroupOrientation: false,
className: "",
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0
};
class AllDayPanelTableBody extends _index.BaseInfernoComponent {
render() {
const {
className: className,
viewData: viewData,
viewContext: viewContext,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth,
leftVirtualCellCount: leftVirtualCellCount,
rightVirtualCellCount: rightVirtualCellCount,
isVerticalGroupOrientation: isVerticalGroupOrientation,
dataCellTemplate: dataCellTemplate
} = this.props;
const classes = (0, _render_utils.combineClasses)({
"dx-scheduler-all-day-table-row": true,
[className ?? ""]: Boolean(className)
});
return (0, _inferno.createComponentVNode)(2, _row.Row, {
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth,
leftVirtualCellCount: leftVirtualCellCount,
rightVirtualCellCount: rightVirtualCellCount,
className: classes,
children: viewData.map(_ref => {
let {
endDate: endDate,
groupIndex: cellGroupIndex,
groups: groups,
index: cellIndex,
isFirstGroupCell: isFirstGroupCell,
isFocused: isFocused,
isLastGroupCell: isLastGroupCell,
isSelected: isSelected,
key: key,
startDate: startDate
} = _ref;
return (0, _inferno.createComponentVNode)(2, _all_day_panel_cell.AllDayPanelCell, {
viewContext: viewContext,
isFirstGroupCell: !isVerticalGroupOrientation && isFirstGroupCell,
isLastGroupCell: !isVerticalGroupOrientation && isLastGroupCell,
startDate: startDate,
endDate: endDate,
groups: groups,
groupIndex: cellGroupIndex,
index: cellIndex,
dataCellTemplate: dataCellTemplate,
isSelected: isSelected ?? false,
isFocused: isFocused ?? false
}, key)
})
})
}
}
exports.AllDayPanelTableBody = AllDayPanelTableBody;
AllDayPanelTableBody.defaultProps = AllDayPanelTableBodyDefaultProps
},
4011(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelTitle = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _message = (e = __webpack_require__( /*! ../../../../../common/core/localization/message */ 4671), e && e.__esModule ? e : {
default: e
});
var e;
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
class AllDayPanelTitle extends _index.InfernoWrapperComponent {
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
render() {
const text = _message.default.format("dxScheduler-allDay");
return (0, _inferno.createVNode)(1, "div", "dx-scheduler-all-day-title", text, 0)
}
}
exports.AllDayPanelTitle = AllDayPanelTitle;
AllDayPanelTitle.defaultProps = {}
},
85409(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CellBaseDefaultProps = exports.CellBase = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
const CellBaseDefaultProps = exports.CellBaseDefaultProps = {
className: "",
isFirstGroupCell: false,
isLastGroupCell: false,
startDate: new Date,
endDate: new Date,
allDay: false,
text: "",
index: 0,
contentTemplateProps: {
data: {},
index: 0
}
};
class CellBase extends _index.BaseInfernoComponent {
render() {
const {
className: className,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
children: children,
ariaLabel: ariaLabel
} = this.props;
const classes = _index2.renderUtils.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, className);
return (0, _inferno.createVNode)(1, "td", classes, children, 0, {
"aria-label": ariaLabel
})
}
}
exports.CellBase = CellBase;
CellBase.defaultProps = CellBaseDefaultProps
},
35689(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateHeaderDefaultProps = exports.DateHeader = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _date_header_cell = __webpack_require__( /*! ./date_header_cell */ 60932);
var _row = __webpack_require__( /*! ./row */ 21541);
const {
isMaterialBased: isMaterialBased
} = _index2.themeUtils.getThemeType();
const DateHeaderDefaultProps = exports.DateHeaderDefaultProps = {
groupOrientation: "horizontal",
groupByDate: false,
groups: []
};
class DateHeader extends _index.BaseInfernoComponent {
render() {
const {
viewContext: viewContext,
dateCellTemplate: dateCellTemplate,
dateHeaderData: {
dataMap: dataMap,
leftVirtualCellCount: leftVirtualCellCount,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellCount: rightVirtualCellCount,
rightVirtualCellWidth: rightVirtualCellWidth
},
groupByDate: groupByDate,
groupOrientation: groupOrientation,
groups: groups
} = this.props;
const isHorizontalGrouping = (0, _index2.isHorizontalGroupingApplied)(groups.length, groupOrientation) && !groupByDate;
return (0, _inferno.createFragment)(dataMap.map((dateHeaderRow, rowIndex) => (0, _inferno.createComponentVNode)(2, _row.Row, {
className: "dx-scheduler-header-row",
leftVirtualCellWidth: leftVirtualCellWidth,
leftVirtualCellCount: leftVirtualCellCount,
rightVirtualCellWidth: rightVirtualCellWidth,
rightVirtualCellCount: rightVirtualCellCount,
isHeaderRow: true,
children: dateHeaderRow.map(_ref => {
let {
colSpan: colSpan,
endDate: endDate,
groupIndex: groupIndex,
groups: cellGroups,
index: index,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
key: key,
startDate: startDate,
text: text,
today: today
} = _ref;
return (0, _inferno.createComponentVNode)(2, _date_header_cell.DateHeaderCell, {
viewContext: viewContext,
startDate: startDate,
endDate: endDate,
groups: isHorizontalGrouping ? cellGroups : void 0,
groupIndex: isHorizontalGrouping ? groupIndex : void 0,
today: today ?? false,
isWeekDayCell: false,
isTimeCellTemplate: false,
index: index,
text: text,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
dateCellTemplate: dateCellTemplate,
colSpan: colSpan,
splitText: isMaterialBased
}, key)
})
}, rowIndex.toString())), 0)
}
}
exports.DateHeader = DateHeader;
DateHeader.defaultProps = DateHeaderDefaultProps
},
60932(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateHeaderCellDefaultProps = exports.DateHeaderCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../../../scheduler/r1/components/templates/index */ 17855);
var _render_utils = __webpack_require__( /*! ../../../../core/r1/utils/render_utils */ 71312);
var _index3 = __webpack_require__( /*! ../../utils/index */ 34396);
var _cell = __webpack_require__( /*! ./cell */ 85409);
var _date_header_text = __webpack_require__( /*! ./date_header_text */ 85872);
const DateHeaderCellDefaultProps = exports.DateHeaderCellDefaultProps = Object.assign({}, _cell.CellBaseDefaultProps, {
today: false,
colSpan: 1,
isWeekDayCell: false,
splitText: false,
isTimeCellTemplate: false
});
class DateHeaderCell extends _index.BaseInfernoComponent {
render() {
const {
viewContext: {
view: {
type: viewType
},
crossScrollingEnabled: crossScrollingEnabled
},
colSpan: colSpan,
dateCellTemplate: dateCellTemplate,
groupIndex: groupIndex,
groups: groups,
index: index,
isTimeCellTemplate: isTimeCellTemplate,
splitText: splitText,
startDate: startDate,
text: text,
timeCellTemplate: timeCellTemplate,
className: className,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
isWeekDayCell: isWeekDayCell,
today: today
} = this.props;
const cellSizeHorizontalClass = _index3.renderUtils.getCellSizeHorizontalClass(viewType, crossScrollingEnabled);
const cellClasses = (0, _render_utils.combineClasses)({
"dx-scheduler-header-panel-cell": true,
[cellSizeHorizontalClass]: true,
"dx-scheduler-header-panel-current-time-cell": today,
"dx-scheduler-header-panel-week-cell": isWeekDayCell,
[className ?? ""]: Boolean(className)
});
const classes = _index3.renderUtils.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, cellClasses);
const useTemplate = !isTimeCellTemplate && Boolean(dateCellTemplate) || isTimeCellTemplate && Boolean(timeCellTemplate);
const children = useTemplate ? (0, _inferno.createFragment)([isTimeCellTemplate && (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: timeCellTemplate,
templateProps: {
data: {
date: startDate,
text: text,
groups: groups,
groupIndex: groupIndex
},
index: index
}
}), !isTimeCellTemplate && (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: dateCellTemplate,
templateProps: {
data: {
date: startDate,
text: text,
groups: groups,
groupIndex: groupIndex
},
index: index
}
})], 0) : (0, _inferno.createComponentVNode)(2, _date_header_text.DateHeaderText, {
splitText: splitText,
text: text
});
return (0, _inferno.createVNode)(1, "th", classes, children, 0, {
colspan: colSpan,
title: text
})
}
}
exports.DateHeaderCell = DateHeaderCell;
DateHeaderCell.defaultProps = DateHeaderCellDefaultProps
},
85872(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateHeaderText = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
class DateHeaderText extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.textCache = null
}
getTextParts() {
if (null !== this.textCache) {
return this.textCache
}
const {
text: text
} = this.props;
this.textCache = text ? text.split(" ") : [""];
return this.textCache
}
componentWillUpdate(nextProps) {
if (this.props.text !== nextProps.text) {
this.textCache = null
}
}
render() {
const {
splitText: splitText,
text: text
} = this.props;
const textParts = this.getTextParts();
return (0, _inferno.createFragment)(splitText ? textParts.map(part => (0, _inferno.createVNode)(1, "div", "dx-scheduler-header-panel-cell-date", (0, _inferno.createVNode)(1, "span", null, part, 0), 2)) : text, 0)
}
}
exports.DateHeaderText = DateHeaderText;
DateHeaderText.defaultProps = {
text: "",
splitText: false
}
},
74282(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableDefaultProps = exports.DateTable = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _date_table_body = __webpack_require__( /*! ./date_table_body */ 28201);
var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 48661);
var _layout_props = __webpack_require__( /*! ./layout_props */ 76322);
var _table = __webpack_require__( /*! ./table */ 46189);
const _excluded = ["viewData", "viewContext", "tableRef", "addDateTableClass", "width", "cellTemplate", "dataCellTemplate", "groupOrientation", "addVerticalSizesClassToRows"];
const DateTableDefaultProps = exports.DateTableDefaultProps = Object.assign({}, _layout_props.LayoutDefaultProps, {
cellTemplate: _date_table_cell_base.DateTableCellBase
});
class DateTable extends _index.InfernoWrapperComponent {
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
render() {
const _this$props = this.props,
{
viewData: viewData,
viewContext: viewContext,
tableRef: tableRef,
addDateTableClass: addDateTableClass,
width: width,
cellTemplate: cellTemplate,
dataCellTemplate: dataCellTemplate,
groupOrientation: groupOrientation,
addVerticalSizesClassToRows: addVerticalSizesClassToRows
} = _this$props,
restProps = function(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue
}
t[n] = r[n]
}
}
return t
}(_this$props, _excluded);
const classes = addDateTableClass ? "dx-scheduler-date-table" : void 0;
const topVirtualRowHeight = viewData.topVirtualRowHeight ?? 0;
const bottomVirtualRowHeight = viewData.bottomVirtualRowHeight ?? 0;
const leftVirtualCellWidth = viewData.leftVirtualCellWidth ?? 0;
const rightVirtualCellWidth = viewData.rightVirtualCellWidth ?? 0;
const virtualCellsCount = viewData.groupedData[0].dateTable[0].cells.length;
return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _table.Table, Object.assign({}, restProps, {
tableRef: tableRef,
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth,
leftVirtualCellCount: viewData.leftVirtualCellCount,
rightVirtualCellCount: viewData.rightVirtualCellCount,
virtualCellsCount: virtualCellsCount,
className: classes,
width: width,
children: (0, _inferno.createComponentVNode)(2, _date_table_body.DateTableBody, {
viewData: viewData,
viewContext: viewContext,
cellTemplate: cellTemplate,
dataCellTemplate: dataCellTemplate,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth,
groupOrientation: groupOrientation,
addVerticalSizesClassToRows: addVerticalSizesClassToRows,
topVirtualRowHeight: _date_table_body.DateTableBodyDefaultProps.topVirtualRowHeight,
bottomVirtualRowHeight: _date_table_body.DateTableBodyDefaultProps.bottomVirtualRowHeight,
addDateTableClass: _date_table_body.DateTableBodyDefaultProps.addDateTableClass
})
})))
}
}
exports.DateTable = DateTable;
DateTable.defaultProps = DateTableDefaultProps
},
28201(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableBodyDefaultProps = exports.DateTableBody = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../../../scheduler/r1/components/templates/index */ 17855);
var _render_utils = __webpack_require__( /*! ../../../../core/r1/utils/render_utils */ 71312);
var _const = __webpack_require__( /*! ../const */ 52728);
var _all_day_panel_table_body = __webpack_require__( /*! ./all_day_panel_table_body */ 99552);
var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 48661);
var _layout_props = __webpack_require__( /*! ./layout_props */ 76322);
var _row = __webpack_require__( /*! ./row */ 21541);
const DateTableBodyDefaultProps = exports.DateTableBodyDefaultProps = Object.assign({}, _layout_props.LayoutDefaultProps, {
cellTemplate: _date_table_cell_base.DateTableCellBase
});
class DateTableBody extends _index.BaseInfernoComponent {
render() {
const {
viewData: viewData,
viewContext: viewContext,
addVerticalSizesClassToRows: addVerticalSizesClassToRows,
cellTemplate: cellTemplate,
dataCellTemplate: dataCellTemplate
} = this.props;
const rowClasses = (0, _render_utils.combineClasses)({
[_const.DATE_TABLE_ROW_CLASS]: true,
"dx-scheduler-cell-sizes-vertical": addVerticalSizesClassToRows
});
return (0, _inferno.createFragment)(viewData.groupedData.map(_ref => {
let {
allDayPanel: allDayPanel,
dateTable: dateTable,
isGroupedAllDayPanel: isGroupedAllDayPanel,
key: fragmentKey
} = _ref;
return (0, _inferno.createFragment)([isGroupedAllDayPanel && (0, _inferno.createComponentVNode)(2, _all_day_panel_table_body.AllDayPanelTableBody, {
viewData: allDayPanel ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.viewData,
viewContext: viewContext,
dataCellTemplate: dataCellTemplate,
isVerticalGroupOrientation: true,
leftVirtualCellWidth: viewData.leftVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: viewData.rightVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.rightVirtualCellWidth,
leftVirtualCellCount: viewData.leftVirtualCellCount,
rightVirtualCellCount: viewData.rightVirtualCellCount
}), dateTable.map(_ref2 => {
let {
cells: cells,
key: rowKey
} = _ref2;
return (0, _inferno.createComponentVNode)(2, _row.Row, {
className: rowClasses,
leftVirtualCellWidth: viewData.leftVirtualCellWidth ?? _row.RowDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: viewData.rightVirtualCellWidth ?? _row.RowDefaultProps.rightVirtualCellWidth,
leftVirtualCellCount: viewData.leftVirtualCellCount,
rightVirtualCellCount: viewData.rightVirtualCellCount,
children: cells.map(_ref3 => {
let {
key: cellKey,
endDate: endDate,
isFirstDayMonthHighlighting: isFirstDayMonthHighlighting,
groupIndex: cellGroupIndex,
groups: groups,
index: cellIndex,
isFirstGroupCell: isFirstGroupCell,
isFocused: isFocused,
isLastGroupCell: isLastGroupCell,
isSelected: isSelected,
otherMonth: otherMonth,
startDate: startDate,
text: text,
today: today
} = _ref3;
return (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: cellTemplate,
templateProps: {
key: cellKey,
viewContext: viewContext,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
startDate: startDate,
endDate: endDate,
groups: groups,
groupIndex: cellGroupIndex,
index: cellIndex,
dataCellTemplate: dataCellTemplate,
text: text,
today: today,
otherMonth: otherMonth,
isFirstDayMonthHighlighting: isFirstDayMonthHighlighting,
isSelected: isSelected,
isFocused: isFocused
}
})
})
}, rowKey)
})], 0, fragmentKey)
}), 0)
}
}
exports.DateTableBody = DateTableBody;
DateTableBody.defaultProps = DateTableBodyDefaultProps
},
48661(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableCellBase = exports.DateTableCallBaseDefaultProps = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../../../scheduler/r1/components/templates/index */ 17855);
var _render_utils = __webpack_require__( /*! ../../../../core/r1/utils/render_utils */ 71312);
var _index3 = __webpack_require__( /*! ../../utils/index */ 34396);
var _const = __webpack_require__( /*! ../const */ 52728);
var _cell = __webpack_require__( /*! ./cell */ 85409);
const DateTableCallBaseDefaultProps = exports.DateTableCallBaseDefaultProps = Object.assign({}, _cell.CellBaseDefaultProps, {
otherMonth: false,
today: false,
isFirstDayMonthHighlighting: false,
isSelected: false,
isFocused: false
});
class DateTableCellBase extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.dataCellTemplateProps = null
}
getDataCellTemplateProps() {
if (null !== this.dataCellTemplateProps) {
return this.dataCellTemplateProps
}
const {
allDay: allDay,
contentTemplateProps: contentTemplateProps,
endDate: endDate,
groupIndex: groupIndex,
groups: groups,
index: index,
startDate: startDate
} = this.props;
this.dataCellTemplateProps = {
data: Object.assign({
startDate: startDate,
endDate: endDate,
groups: groups,
groupIndex: groups ? groupIndex : void 0,
text: "",
allDay: Boolean(allDay) || void 0
}, null === contentTemplateProps || void 0 === contentTemplateProps ? void 0 : contentTemplateProps.data),
index: index
};
return this.dataCellTemplateProps
}
componentWillUpdate(nextProps) {
if (this.props.allDay !== nextProps.allDay || this.props.contentTemplateProps !== nextProps.contentTemplateProps || this.props.endDate !== nextProps.endDate || this.props.groupIndex !== nextProps.groupIndex || this.props.groups !== nextProps.groups || this.props.index !== nextProps.index || this.props.startDate !== nextProps.startDate) {
this.dataCellTemplateProps = null
}
}
render() {
const {
viewContext: viewContext,
allDay: allDay,
className: className,
isFocused: isFocused,
isSelected: isSelected,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
dataCellTemplate: dataCellTemplate,
children: children
} = this.props;
const {
view: {
type: viewType
},
crossScrollingEnabled: crossScrollingEnabled
} = viewContext;
const cellSizeHorizontalClass = _index3.renderUtils.getCellSizeHorizontalClass(viewType, crossScrollingEnabled);
const cellSizeVerticalClass = _index3.renderUtils.getCellSizeVerticalClass(Boolean(allDay));
const classes = (0, _render_utils.combineClasses)({
[cellSizeHorizontalClass]: true,
[cellSizeVerticalClass]: true,
[_const.DATE_TABLE_CELL_CLASS]: !allDay,
"dx-state-focused": isSelected,
"dx-scheduler-focused-cell": isFocused,
[className ?? ""]: true
});
const ariaLabel = isSelected ? "Add appointment" : void 0;
const dataCellTemplateProps = this.getDataCellTemplateProps();
return (0, _inferno.createComponentVNode)(2, _cell.CellBase, {
className: classes,
viewContext: viewContext,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
ariaLabel: ariaLabel,
startDate: _cell.CellBaseDefaultProps.startDate,
endDate: _cell.CellBaseDefaultProps.endDate,
index: _cell.CellBaseDefaultProps.index,
children: (0, _inferno.createFragment)(dataCellTemplate ? (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: dataCellTemplate,
templateProps: {
index: dataCellTemplateProps.index,
data: dataCellTemplateProps.data
}
}) : children, 0)
})
}
}
exports.DateTableCellBase = DateTableCellBase;
DateTableCellBase.defaultProps = DateTableCallBaseDefaultProps
},
31055(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelDefaultProps = exports.GroupPanel = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _constants = __webpack_require__( /*! ../../../constants */ 25307);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _group_panel_horizontal = __webpack_require__( /*! ./group_panel_horizontal */ 4130);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 3234);
var _group_panel_vertical = __webpack_require__( /*! ./group_panel_vertical */ 75816);
const GroupPanelDefaultProps = exports.GroupPanelDefaultProps = Object.assign({}, _group_panel_props.GroupPanelBaseDefaultProps, {
groups: [],
groupOrientation: _constants.VERTICAL_GROUP_ORIENTATION
});
class GroupPanel extends _index.InfernoWrapperComponent {
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
render() {
const {
className: className,
viewContext: viewContext,
elementRef: elementRef,
groupPanelData: groupPanelData,
height: height,
resourceCellTemplate: resourceCellTemplate,
groupOrientation: groupOrientation,
groups: groups,
styles: styles
} = this.props;
const isVerticalLayout = (0, _index2.isVerticalGroupingApplied)(groups.length, groupOrientation);
const Layout = isVerticalLayout ? _group_panel_vertical.GroupPanelVertical : _group_panel_horizontal.GroupPanelHorizontal;
return (0, _inferno.createComponentVNode)(2, Layout, {
viewContext: viewContext,
height: height,
resourceCellTemplate: resourceCellTemplate,
className: className,
groupPanelData: groupPanelData,
elementRef: elementRef,
styles: styles,
groups: GroupPanelDefaultProps.groups,
groupOrientation: GroupPanelDefaultProps.groupOrientation,
groupByDate: GroupPanelDefaultProps.groupByDate
})
}
}
exports.GroupPanel = GroupPanel;
GroupPanel.defaultProps = GroupPanelDefaultProps
},
4130(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelHorizontal = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _group_panel_horizontal_row = __webpack_require__( /*! ./group_panel_horizontal_row */ 6305);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 3234);
class GroupPanelHorizontal extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.groupPanelItems = null
}
getGroupPanelItems() {
if (null !== this.groupPanelItems) {
return this.groupPanelItems
}
const {
groupPanelData: {
baseColSpan: baseColSpan,
groupPanelItems: groupPanelItems
}
} = this.props;
const colSpans = groupPanelItems.reduceRight((currentColSpans, groupsRow, idx) => {
const nextColSpans = currentColSpans;
const currentLevelGroupCount = groupsRow.length;
const previousColSpan = idx === groupPanelItems.length - 1 ? baseColSpan : currentColSpans[idx + 1];
const previousLevelGroupCount = idx === groupPanelItems.length - 1 ? currentLevelGroupCount : groupPanelItems[idx + 1].length;
const groupCountDiff = previousLevelGroupCount / currentLevelGroupCount;
nextColSpans[idx] = groupCountDiff * previousColSpan;
return nextColSpans
}, [...new Array(groupPanelItems.length)]);
this.groupPanelItems = groupPanelItems.map((groupsRenderRow, index) => {
const colSpan = colSpans[index];
return groupsRenderRow.map(groupItem => Object.assign({}, groupItem, {
colSpan: colSpan
}))
});
return this.groupPanelItems
}
componentWillUpdate(nextProps) {
if (this.props.groupPanelData !== nextProps.groupPanelData) {
this.groupPanelItems = null
}
}
render() {
const {
resourceCellTemplate: resourceCellTemplate
} = this.props;
const groupPanelItems = this.getGroupPanelItems();
return (0, _inferno.createFragment)(groupPanelItems.map(group => (0, _inferno.createComponentVNode)(2, _group_panel_horizontal_row.GroupPanelHorizontalRow, {
groupItems: group,
cellTemplate: resourceCellTemplate
}, group[0].key)), 0)
}
}
exports.GroupPanelHorizontal = GroupPanelHorizontal;
GroupPanelHorizontal.defaultProps = _group_panel_props.GroupPanelBaseDefaultProps
},
91117(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelHorizontalCellDefaultProps = exports.GroupPanelHorizontalCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../../../scheduler/r1/components/templates/index */ 17855);
var _render_utils = __webpack_require__( /*! ../../../../core/r1/utils/render_utils */ 71312);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 3234);
const GroupPanelHorizontalCellDefaultProps = exports.GroupPanelHorizontalCellDefaultProps = Object.assign({}, _group_panel_props.GroupPanelCellDefaultProps, {
isFirstGroupCell: false,
isLastGroupCell: false,
colSpan: 1
});
class GroupPanelHorizontalCell extends _index.BaseInfernoComponent {
render() {
const {
cellTemplate: cellTemplate,
colSpan: colSpan,
color: color,
data: data,
id: id,
index: index,
text: text,
className: className,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell
} = this.props;
const classes = (0, _render_utils.combineClasses)({
"dx-scheduler-group-header": true,
"dx-scheduler-first-group-cell": isFirstGroupCell,
"dx-scheduler-last-group-cell": isLastGroupCell,
[className ?? ""]: Boolean(className)
});
return (0, _inferno.createVNode)(1, "th", classes, (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-header-content", cellTemplate ? (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: cellTemplate,
templateProps: {
data: {
data: data,
id: id,
color: color,
text: text
},
index: index
}
}) : (0, _inferno.createVNode)(1, "div", null, text, 0), 0), 2, {
colspan: colSpan
})
}
}
exports.GroupPanelHorizontalCell = GroupPanelHorizontalCell;
GroupPanelHorizontalCell.defaultProps = GroupPanelHorizontalCellDefaultProps
},
6305(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelHorizontalRow = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _group_panel_horizontal_cell = __webpack_require__( /*! ./group_panel_horizontal_cell */ 91117);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 3234);
class GroupPanelHorizontalRow extends _index.BaseInfernoComponent {
render() {
const {
cellTemplate: cellTemplate,
className: className,
groupItems: groupItems
} = this.props;
return (0, _inferno.createVNode)(1, "tr", `dx-scheduler-group-row ${className}`, groupItems.map((_ref, index) => {
let {
colSpan: colSpan,
color: color,
data: data,
id: id,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
key: key,
text: text
} = _ref;
return (0, _inferno.createComponentVNode)(2, _group_panel_horizontal_cell.GroupPanelHorizontalCell, {
text: text,
id: id,
data: data,
index: index,
color: color,
colSpan: colSpan ?? _group_panel_horizontal_cell.GroupPanelHorizontalCellDefaultProps.colSpan,
isFirstGroupCell: Boolean(isFirstGroupCell),
isLastGroupCell: Boolean(isLastGroupCell),
cellTemplate: cellTemplate
}, key)
}), 0)
}
}
exports.GroupPanelHorizontalRow = GroupPanelHorizontalRow;
GroupPanelHorizontalRow.defaultProps = _group_panel_props.GroupPanelRowDefaultProps
},
3234(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelRowDefaultProps = exports.GroupPanelCellDefaultProps = exports.GroupPanelBaseDefaultProps = void 0;
exports.GroupPanelBaseDefaultProps = {
groupPanelData: {
groupPanelItems: [],
baseColSpan: 1
},
groupByDate: false,
styles: {}
};
exports.GroupPanelCellDefaultProps = {
id: 0,
text: "",
data: {
id: 0
},
className: ""
};
exports.GroupPanelRowDefaultProps = {
groupItems: [],
className: ""
}
},
75816(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelVertical = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 3234);
var _group_panel_vertical_row = __webpack_require__( /*! ./group_panel_vertical_row */ 73783);
class GroupPanelVertical extends _index.BaseInfernoComponent {
render() {
const {
className: className,
elementRef: elementRef,
groupPanelData: groupPanelData,
resourceCellTemplate: resourceCellTemplate,
height: height,
styles: styles
} = this.props;
const style = (0, _index.normalizeStyles)(_index2.renderUtils.addHeightToStyle(height, styles));
return (0, _inferno.createVNode)(1, "div", className, (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-flex-container", groupPanelData.groupPanelItems.map(group => (0, _inferno.createComponentVNode)(2, _group_panel_vertical_row.GroupPanelVerticalRow, {
groupItems: group,
cellTemplate: resourceCellTemplate
}, group[0].key)), 0), 2, {
style: style
}, null, elementRef)
}
}
exports.GroupPanelVertical = GroupPanelVertical;
GroupPanelVertical.defaultProps = _group_panel_props.GroupPanelBaseDefaultProps
},
47231(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelVerticalCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../../../scheduler/r1/components/templates/index */ 17855);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 3234);
class GroupPanelVerticalCell extends _index.BaseInfernoComponent {
render() {
const {
className: className,
data: data,
id: id,
color: color,
text: text,
index: index,
cellTemplate: cellTemplate
} = this.props;
return (0, _inferno.createVNode)(1, "div", `dx-scheduler-group-header ${className}`, cellTemplate ? (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: cellTemplate,
templateProps: {
data: {
data: data,
id: id,
color: color,
text: text
},
index: index
}
}) : (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-header-content", text, 0), 0)
}
}
exports.GroupPanelVerticalCell = GroupPanelVerticalCell;
GroupPanelVerticalCell.defaultProps = _group_panel_props.GroupPanelCellDefaultProps
},
73783(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelVerticalRow = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 3234);
var _group_panel_vertical_cell = __webpack_require__( /*! ./group_panel_vertical_cell */ 47231);
class GroupPanelVerticalRow extends _index.BaseInfernoComponent {
render() {
const {
className: className,
groupItems: groupItems,
cellTemplate: cellTemplate
} = this.props;
return (0, _inferno.createVNode)(1, "div", `dx-scheduler-group-row ${className}`, groupItems.map((_ref, index) => {
let {
color: color,
data: data,
id: id,
key: key,
text: text
} = _ref;
return (0, _inferno.createComponentVNode)(2, _group_panel_vertical_cell.GroupPanelVerticalCell, {
text: text,
id: id,
data: data,
index: index,
color: color,
cellTemplate: cellTemplate
}, key)
}), 0)
}
}
exports.GroupPanelVerticalRow = GroupPanelVerticalRow;
GroupPanelVerticalRow.defaultProps = _group_panel_props.GroupPanelRowDefaultProps
},
21339(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _ordinary_cell = __webpack_require__( /*! ./ordinary_cell */ 12802);
class HeaderCell extends _index.BaseInfernoComponent {
render() {
const {
children: children,
className: className,
colSpan: colSpan,
styles: styles
} = this.props;
return (0, _inferno.createVNode)(1, "th", className, children, 0, {
style: (0, _index.normalizeStyles)(styles),
colspan: colSpan
})
}
}
exports.HeaderCell = HeaderCell;
HeaderCell.defaultProps = _ordinary_cell.OrdinaryCellDefaultProps
},
20025(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelDefaultProps = exports.HeaderPanel = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../../../scheduler/r1/components/templates/index */ 17855);
var _index3 = __webpack_require__( /*! ../../utils/index */ 34396);
var _date_header = __webpack_require__( /*! ./date_header */ 35689);
var _group_panel = __webpack_require__( /*! ./group_panel */ 31055);
const HeaderPanelDefaultProps = exports.HeaderPanelDefaultProps = Object.assign({}, _group_panel.GroupPanelDefaultProps, {
isRenderDateHeader: true,
dateHeaderTemplate: _date_header.DateHeader
});
class HeaderPanel extends _index.InfernoWrapperComponent {
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
render() {
const {
viewContext: viewContext,
dateHeaderData: dateHeaderData,
groupByDate: groupByDate,
groupOrientation: groupOrientation,
groupPanelData: groupPanelData,
groups: groups,
isRenderDateHeader: isRenderDateHeader,
dateCellTemplate: dateCellTemplate,
dateHeaderTemplate: dateHeaderTemplate,
resourceCellTemplate: resourceCellTemplate,
timeCellTemplate: timeCellTemplate
} = this.props;
const isHorizontalGrouping = (0, _index3.isHorizontalGroupingApplied)(groups.length, groupOrientation);
return (0, _inferno.createVNode)(1, "thead", null, [isHorizontalGrouping && !groupByDate && (0, _inferno.createComponentVNode)(2, _group_panel.GroupPanel, {
viewContext: viewContext,
groupPanelData: groupPanelData,
groups: groups,
groupByDate: groupByDate,
groupOrientation: groupOrientation,
resourceCellTemplate: resourceCellTemplate
}), isRenderDateHeader && (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: dateHeaderTemplate,
templateProps: {
viewContext: viewContext,
groupByDate: groupByDate,
dateHeaderData: dateHeaderData,
groupOrientation: groupOrientation,
groups: groups,
dateCellTemplate: dateCellTemplate,
timeCellTemplate: timeCellTemplate
}
}), groupByDate && (0, _inferno.createComponentVNode)(2, _group_panel.GroupPanel, {
viewContext: viewContext,
groupPanelData: groupPanelData,
groups: groups,
groupByDate: groupByDate,
groupOrientation: groupOrientation,
resourceCellTemplate: resourceCellTemplate
})], 0)
}
}
exports.HeaderPanel = HeaderPanel;
HeaderPanel.defaultProps = HeaderPanelDefaultProps
},
76322(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LayoutDefaultProps = void 0;
exports.LayoutDefaultProps = {
viewData: {
groupedData: [],
leftVirtualCellCount: 0,
rightVirtualCellCount: 0,
topVirtualRowCount: 0,
bottomVirtualRowCount: 0
},
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0,
topVirtualRowHeight: 0,
bottomVirtualRowHeight: 0,
addDateTableClass: true,
addVerticalSizesClassToRows: true
}
},
12802(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OrdinaryCellDefaultProps = exports.OrdinaryCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
const OrdinaryCellDefaultProps = exports.OrdinaryCellDefaultProps = {};
class OrdinaryCell extends _index.BaseInfernoComponent {
render() {
const {
children: children,
className: className,
colSpan: colSpan,
styles: styles
} = this.props;
return (0, _inferno.createVNode)(1, "td", className, children, 0, {
style: (0, _index.normalizeStyles)(styles),
colspan: colSpan
})
}
}
exports.OrdinaryCell = OrdinaryCell;
OrdinaryCell.defaultProps = OrdinaryCellDefaultProps
},
21541(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RowDefaultProps = exports.Row = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _virtual_cell = __webpack_require__( /*! ./virtual_cell */ 46033);
const RowDefaultProps = exports.RowDefaultProps = {
className: "",
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0,
isHeaderRow: false
};
class Row extends _index.BaseInfernoComponent {
render() {
const {
children: children,
className: className,
isHeaderRow: isHeaderRow,
leftVirtualCellCount: leftVirtualCellCount,
leftVirtualCellWidth: leftVirtualCellWidth = RowDefaultProps.leftVirtualCellWidth,
rightVirtualCellCount: rightVirtualCellCount,
rightVirtualCellWidth: rightVirtualCellWidth = RowDefaultProps.rightVirtualCellWidth,
styles: styles
} = this.props;
const hasLeftVirtualCell = Boolean(leftVirtualCellCount);
const hasRightVirtualCell = Boolean(rightVirtualCellCount);
return (0, _inferno.createVNode)(1, "tr", className, [hasLeftVirtualCell && null != leftVirtualCellCount && (0, _index2.splitNumber)(leftVirtualCellCount, 1e3).map(colSpan => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, {
width: leftVirtualCellWidth * (colSpan / leftVirtualCellCount),
colSpan: colSpan,
isHeaderCell: isHeaderRow ?? _virtual_cell.VirtualCellDefaultProps.isHeaderCell
})), children, hasRightVirtualCell && null != rightVirtualCellCount && (0, _index2.splitNumber)(rightVirtualCellCount, 1e3).map(colSpan => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, {
width: rightVirtualCellWidth * (colSpan / rightVirtualCellCount),
colSpan: colSpan,
isHeaderCell: isHeaderRow ?? _virtual_cell.VirtualCellDefaultProps.isHeaderCell
}))], 0, {
style: (0, _index.normalizeStyles)(styles)
})
}
}
exports.Row = Row;
Row.defaultProps = RowDefaultProps
},
46189(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TableDefaultProps = exports.Table = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _virtual_row = __webpack_require__( /*! ./virtual_row */ 4053);
const TableDefaultProps = exports.TableDefaultProps = {
topVirtualRowHeight: 0,
bottomVirtualRowHeight: 0,
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0,
virtualCellsCount: 0
};
class Table extends _index.BaseInfernoComponent {
getResultStyles() {
const {
height: height,
width: width,
styles: styles
} = this.props;
const heightAdded = _index2.renderUtils.addHeightToStyle(height, styles);
return _index2.renderUtils.addWidthToStyle(width, heightAdded)
}
render() {
const {
className: className,
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight,
children: children,
leftVirtualCellCount: leftVirtualCellCount,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellCount: rightVirtualCellCount,
rightVirtualCellWidth: rightVirtualCellWidth,
tableRef: tableRef,
virtualCellsCount: virtualCellsCount
} = this.props;
const hasTopVirtualRow = Boolean(topVirtualRowHeight);
const hasBottomVirtualRow = Boolean(bottomVirtualRowHeight);
const resultStyles = this.getResultStyles();
return (0, _inferno.createVNode)(1, "table", className, (0, _inferno.createVNode)(1, "tbody", null, [hasTopVirtualRow && (0, _inferno.createComponentVNode)(2, _virtual_row.VirtualRow, {
height: topVirtualRowHeight,
cellsCount: virtualCellsCount ?? _virtual_row.VirtualRowDefaultProps.cellsCount,
leftVirtualCellWidth: leftVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.rightVirtualCellWidth,
leftVirtualCellCount: leftVirtualCellCount,
rightVirtualCellCount: rightVirtualCellCount
}), children, hasBottomVirtualRow && (0, _inferno.createComponentVNode)(2, _virtual_row.VirtualRow, {
height: bottomVirtualRowHeight,
cellsCount: virtualCellsCount ?? _virtual_row.VirtualRowDefaultProps.cellsCount,
leftVirtualCellWidth: leftVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.rightVirtualCellWidth,
leftVirtualCellCount: leftVirtualCellCount,
rightVirtualCellCount: rightVirtualCellCount
})], 0), 2, {
style: (0, _index.normalizeStyles)(resultStyles),
"aria-hidden": true
}, null, tableRef)
}
}
exports.Table = Table;
Table.defaultProps = TableDefaultProps
},
88332(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimePanelCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../../../scheduler/r1/components/templates/index */ 17855);
var _render_utils = __webpack_require__( /*! ../../../../core/r1/utils/render_utils */ 71312);
var _index3 = __webpack_require__( /*! ../../utils/index */ 34396);
var _cell = __webpack_require__( /*! ./cell */ 85409);
class TimePanelCell extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.timeCellTemplateProps = null
}
getTimeCellTemplateProps() {
if (null !== this.timeCellTemplateProps) {
return this.timeCellTemplateProps
}
const {
groupIndex: groupIndex,
groups: groups,
index: index,
startDate: startDate,
text: text
} = this.props;
this.timeCellTemplateProps = {
data: {
date: startDate,
groups: groups,
groupIndex: groupIndex,
text: text
},
index: index
};
return this.timeCellTemplateProps
}
componentWillUpdate(nextProps) {
if (this.props.groupIndex !== nextProps.groupIndex || this.props.groups !== nextProps.groups || this.props.index !== nextProps.index || this.props.startDate !== nextProps.startDate || this.props.text !== nextProps.text) {
this.timeCellTemplateProps = null
}
}
render() {
const {
className: className,
viewContext: viewContext,
highlighted: highlighted,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
text: text,
timeCellTemplate: timeCellTemplate
} = this.props;
const cellSizeVerticalClass = _index3.renderUtils.getCellSizeVerticalClass(false);
const classes = (0, _render_utils.combineClasses)({
"dx-scheduler-time-panel-cell": true,
[cellSizeVerticalClass]: true,
"dx-scheduler-time-panel-current-time-cell": Boolean(highlighted),
[className ?? ""]: true
});
const timeCellTemplateProps = this.getTimeCellTemplateProps();
return (0, _inferno.createComponentVNode)(2, _cell.CellBase, {
className: classes,
viewContext: viewContext,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
startDate: _cell.CellBaseDefaultProps.startDate,
endDate: _cell.CellBaseDefaultProps.endDate,
index: _cell.CellBaseDefaultProps.index,
children: timeCellTemplate ? (0, _inferno.createComponentVNode)(2, _index2.PublicTemplate, {
template: timeCellTemplate,
templateProps: {
index: timeCellTemplateProps.index,
data: timeCellTemplateProps.data
}
}) : (0, _inferno.createVNode)(1, "div", null, text, 0)
})
}
}
exports.TimePanelCell = TimePanelCell;
TimePanelCell.defaultProps = _cell.CellBaseDefaultProps
},
2302(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimePanelTableDefaultProps = exports.TimePanelTable = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _all_day_panel_title = __webpack_require__( /*! ./all_day_panel_title */ 4011);
var _cell = __webpack_require__( /*! ./cell */ 85409);
var _row = __webpack_require__( /*! ./row */ 21541);
var _table = __webpack_require__( /*! ./table */ 46189);
var _time_panel_cell = __webpack_require__( /*! ./time_panel_cell */ 88332);
const _excluded = ["timePanelData", "viewContext", "tableRef", "timeCellTemplate"];
const TimePanelTableDefaultProps = exports.TimePanelTableDefaultProps = {
timePanelData: {
groupedData: [],
leftVirtualCellCount: 0,
rightVirtualCellCount: 0,
topVirtualRowCount: 0,
bottomVirtualRowCount: 0
}
};
class TimePanelTable extends _index.InfernoWrapperComponent {
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
render() {
const _this$props = this.props,
{
timePanelData: timePanelData,
viewContext: viewContext,
tableRef: tableRef,
timeCellTemplate: timeCellTemplate
} = _this$props,
restProps = function(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue
}
t[n] = r[n]
}
}
return t
}(_this$props, _excluded);
const {
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight
} = timePanelData;
return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _table.Table, Object.assign({}, restProps, {
className: "dx-scheduler-time-panel",
topVirtualRowHeight: topVirtualRowHeight ?? 0,
bottomVirtualRowHeight: bottomVirtualRowHeight ?? 0,
virtualCellsCount: 1,
tableRef: tableRef,
children: timePanelData.groupedData.map(_ref => {
let {
dateTable: dateTable,
groupIndex: groupIndex,
isGroupedAllDayPanel: isGroupedAllDayPanel,
key: fragmentKey
} = _ref;
return (0, _inferno.createFragment)([isGroupedAllDayPanel && (0, _inferno.createComponentVNode)(2, _row.Row, {
leftVirtualCellWidth: _row.RowDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: _row.RowDefaultProps.rightVirtualCellWidth,
children: (0, _inferno.createComponentVNode)(2, _cell.CellBase, {
className: "dx-scheduler-time-panel-title-cell",
viewContext: viewContext,
startDate: _cell.CellBaseDefaultProps.startDate,
endDate: _cell.CellBaseDefaultProps.endDate,
index: _cell.CellBaseDefaultProps.index,
children: (0, _inferno.createComponentVNode)(2, _all_day_panel_title.AllDayPanelTitle)
})
}), dateTable.map(_ref2 => {
let {
groups: groups,
highlighted: highlighted,
index: cellIndex,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
key: key,
startDate: startDate,
text: text
} = _ref2;
return (0, _inferno.createComponentVNode)(2, _row.Row, {
className: "dx-scheduler-time-panel-row",
leftVirtualCellWidth: _row.RowDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: _row.RowDefaultProps.rightVirtualCellWidth,
children: (0, _inferno.createComponentVNode)(2, _time_panel_cell.TimePanelCell, {
viewContext: viewContext,
startDate: startDate,
endDate: _cell.CellBaseDefaultProps.endDate,
text: text,
groups: groups,
groupIndex: groupIndex,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
index: cellIndex,
timeCellTemplate: timeCellTemplate,
highlighted: highlighted
})
}, key)
})], 0, fragmentKey)
})
})))
}
}
exports.TimePanelTable = TimePanelTable;
TimePanelTable.defaultProps = TimePanelTableDefaultProps
},
46033(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VirtualCellDefaultProps = exports.VirtualCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _header_cell = __webpack_require__( /*! ./header_cell */ 21339);
var _ordinary_cell = __webpack_require__( /*! ./ordinary_cell */ 12802);
const VirtualCellDefaultProps = exports.VirtualCellDefaultProps = {
width: 0,
isHeaderCell: false
};
class VirtualCell extends _index.BaseInfernoComponent {
render() {
const {
colSpan: colSpan,
isHeaderCell: isHeaderCell,
className: className = "",
width: width,
styles: styles
} = this.props;
const modifiedStyles = _index2.renderUtils.addWidthToStyle(width, styles);
const Cell = isHeaderCell ? _header_cell.HeaderCell : _ordinary_cell.OrdinaryCell;
return (0, _inferno.createComponentVNode)(2, Cell, {
className: `dx-scheduler-virtual-cell ${className}`,
styles: modifiedStyles,
colSpan: colSpan
})
}
}
exports.VirtualCell = VirtualCell;
VirtualCell.defaultProps = VirtualCellDefaultProps
},
4053(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VirtualRowDefaultProps = exports.VirtualRow = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _row = __webpack_require__( /*! ./row */ 21541);
var _virtual_cell = __webpack_require__( /*! ./virtual_cell */ 46033);
const VirtualRowDefaultProps = exports.VirtualRowDefaultProps = Object.assign({}, _row.RowDefaultProps, {
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0,
cellsCount: 1
});
class VirtualRow extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.virtualCells = null
}
getVirtualCells() {
if (null !== this.virtualCells) {
return this.virtualCells
}
const {
cellsCount: cellsCount
} = this.props;
this.virtualCells = [...Array(cellsCount)];
return this.virtualCells
}
componentWillUpdate(nextProps) {
if (this.props.cellsCount !== nextProps.cellsCount) {
this.virtualCells = null
}
}
render() {
const {
className: className,
leftVirtualCellCount: leftVirtualCellCount,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellCount: rightVirtualCellCount,
rightVirtualCellWidth: rightVirtualCellWidth,
styles: styles,
height: height
} = this.props;
const classes = `dx-scheduler-virtual-row ${className}`;
const modifiedStyles = _index2.renderUtils.addHeightToStyle(height, styles);
const virtualCells = this.getVirtualCells();
return (0, _inferno.createComponentVNode)(2, _row.Row, {
className: classes,
styles: modifiedStyles,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth,
leftVirtualCellCount: leftVirtualCellCount,
rightVirtualCellCount: rightVirtualCellCount,
children: virtualCells.map((_, index) => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, {
width: _virtual_cell.VirtualCellDefaultProps.width,
isHeaderCell: _virtual_cell.VirtualCellDefaultProps.isHeaderCell,
className: "dx-scheduler-cell-sizes-horizontal"
}, index.toString()))
})
}
}
exports.VirtualRow = VirtualRow;
VirtualRow.defaultProps = VirtualRowDefaultProps
},
52728(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DefaultSizes = exports.DATE_TABLE_ROW_CLASS = exports.DATE_TABLE_CELL_CLASS = exports.ALL_DAY_PANEL_CELL_CLASS = void 0;
exports.DefaultSizes = {
allDayPanelHeight: 25
};
exports.DATE_TABLE_CELL_CLASS = "dx-scheduler-date-table-cell";
exports.DATE_TABLE_ROW_CLASS = "dx-scheduler-date-table-row";
exports.ALL_DAY_PANEL_CELL_CLASS = "dx-scheduler-all-day-table-cell"
},
19747(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AllDayPanelTitleComponent", {
enumerable: true,
get: function() {
return _all_day_panel_title.AllDayPanelTitleComponent
}
});
Object.defineProperty(exports, "AllDayTableComponent", {
enumerable: true,
get: function() {
return _all_day_table.AllDayTableComponent
}
});
Object.defineProperty(exports, "DateTableComponent", {
enumerable: true,
get: function() {
return _date_table.DateTableComponent
}
});
Object.defineProperty(exports, "DateTableMonthComponent", {
enumerable: true,
get: function() {
return _date_table_month.DateTableMonthComponent
}
});
Object.defineProperty(exports, "GroupPanelComponent", {
enumerable: true,
get: function() {
return _group_panel.GroupPanelComponent
}
});
Object.defineProperty(exports, "HeaderPanelComponent", {
enumerable: true,
get: function() {
return _header_panel.HeaderPanelComponent
}
});
Object.defineProperty(exports, "HeaderPanelTimelineComponent", {
enumerable: true,
get: function() {
return _header_panel_timeline.HeaderPanelTimelineComponent
}
});
Object.defineProperty(exports, "TimePanelComponent", {
enumerable: true,
get: function() {
return _time_panel.TimePanelComponent
}
});
var _all_day_panel_title = __webpack_require__( /*! ./wrappers/all_day_panel_title */ 83562);
var _all_day_table = __webpack_require__( /*! ./wrappers/all_day_table */ 63273);
var _date_table = __webpack_require__( /*! ./wrappers/date_table */ 97641);
var _date_table_month = __webpack_require__( /*! ./wrappers/date_table_month */ 71212);
var _group_panel = __webpack_require__( /*! ./wrappers/group_panel */ 74290);
var _header_panel = __webpack_require__( /*! ./wrappers/header_panel */ 87286);
var _header_panel_timeline = __webpack_require__( /*! ./wrappers/header_panel_timeline */ 96774);
var _time_panel = __webpack_require__( /*! ./wrappers/time_panel */ 54322)
},
40802(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableMonth = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _date_table = __webpack_require__( /*! ../base/date_table */ 74282);
var _date_table_month_cell = __webpack_require__( /*! ./date_table_month_cell */ 83725);
const _excluded = ["viewData", "viewContext", "addDateTableClass", "addVerticalSizesClassToRows", "dataCellTemplate", "groupOrientation", "tableRef", "width"];
class DateTableMonth extends _index.InfernoWrapperComponent {
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
render() {
const _this$props = this.props,
{
viewData: viewData,
viewContext: viewContext,
addDateTableClass: addDateTableClass,
addVerticalSizesClassToRows: addVerticalSizesClassToRows,
dataCellTemplate: dataCellTemplate,
groupOrientation: groupOrientation,
tableRef: tableRef,
width: width
} = _this$props,
restProps = function(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue
}
t[n] = r[n]
}
}
return t
}(_this$props, _excluded);
return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _date_table.DateTable, Object.assign({}, restProps, {
viewData: viewData,
viewContext: viewContext,
groupOrientation: groupOrientation,
addDateTableClass: addDateTableClass,
dataCellTemplate: dataCellTemplate,
cellTemplate: _date_table_month_cell.DateTableMonthCell,
tableRef: tableRef,
addVerticalSizesClassToRows: addVerticalSizesClassToRows,
width: width
})))
}
}
exports.DateTableMonth = DateTableMonth;
DateTableMonth.defaultProps = _date_table.DateTableDefaultProps
},
83725(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableMonthCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _render_utils = __webpack_require__( /*! ../../../../core/r1/utils/render_utils */ 71312);
var _date_table_cell_base = __webpack_require__( /*! ../base/date_table_cell_base */ 48661);
class DateTableMonthCell extends _index.BaseInfernoComponent {
constructor() {
super(...arguments);
this.contentTemplateProps = null
}
getContentTemplateProps() {
if (null !== this.contentTemplateProps) {
return this.contentTemplateProps
}
const {
index: index,
text: text
} = this.props;
this.contentTemplateProps = {
data: {
text: text
},
index: index
};
return this.contentTemplateProps
}
componentWillUpdate(nextProps) {
if (this.props.index !== nextProps.index || this.props.text !== nextProps.text) {
this.contentTemplateProps = null
}
}
render() {
const {
viewContext: viewContext,
dataCellTemplate: dataCellTemplate,
endDate: endDate,
groupIndex: groupIndex,
groups: groups,
index: index,
isFirstGroupCell: isFirstGroupCell,
isFocused: isFocused,
isLastGroupCell: isLastGroupCell,
isSelected: isSelected,
startDate: startDate,
text: text,
className: className,
isFirstDayMonthHighlighting: isFirstDayMonthHighlighting,
otherMonth: otherMonth,
today: today
} = this.props;
const classes = (0, _render_utils.combineClasses)({
"dx-scheduler-date-table-other-month": Boolean(otherMonth),
"dx-scheduler-date-table-current-date": Boolean(today),
"dx-scheduler-date-table-first-of-month": Boolean(isFirstDayMonthHighlighting),
[className ?? ""]: Boolean(className)
});
const contentTemplateProps = this.getContentTemplateProps();
return (0, _inferno.createComponentVNode)(2, _date_table_cell_base.DateTableCellBase, {
className: classes,
viewContext: viewContext,
dataCellTemplate: dataCellTemplate,
startDate: startDate,
endDate: endDate,
text: text,
groups: groups,
groupIndex: groupIndex,
index: index,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
isSelected: isSelected,
isFocused: isFocused,
contentTemplateProps: contentTemplateProps,
children: (0, _inferno.createVNode)(1, "div", "dx-scheduler-date-table-cell-text", text, 0)
})
}
}
exports.DateTableMonthCell = DateTableMonthCell;
DateTableMonthCell.defaultProps = _date_table_cell_base.DateTableCallBaseDefaultProps
},
17855(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PublicTemplate", {
enumerable: true,
get: function() {
return _public_template.PublicTemplate
}
});
var _public_template = __webpack_require__( /*! ./public_template */ 52303)
},
52303(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PublicTemplate = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _common = __webpack_require__( /*! ../../../../../core/utils/common */ 17781);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 10632);
exports.PublicTemplate = _ref => {
let {
template: template,
templateProps: templateProps,
renderOptions: renderOptions
} = _ref;
if (void 0 === template) {
return (0, _inferno.createFragment)()
}
const templateFn = (0, _index.getTemplate)(template);
const templatePropsWithComparer = Object.assign({}, templateProps, {
data: Object.assign({}, templateProps.data ?? {}, {
isEqual: (null === renderOptions || void 0 === renderOptions ? void 0 : renderOptions.propsComparer) ?? _common.equalByValue
})
});
return null === templateFn || void 0 === templateFn ? void 0 : templateFn(templatePropsWithComparer)
}
},
30737(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimelineDateHeaderLayout = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _themes = __webpack_require__( /*! ../../../../scheduler/r1/utils/themes */ 3108);
var _index2 = __webpack_require__( /*! ../../utils/index */ 34396);
var _date_header = __webpack_require__( /*! ../base/date_header */ 35689);
var _date_header_cell = __webpack_require__( /*! ../base/date_header_cell */ 60932);
var _row = __webpack_require__( /*! ../base/row */ 21541);
const {
isMaterialBased: isMaterialBased
} = (0, _themes.getThemeType)();
class TimelineDateHeaderLayout extends _index.BaseInfernoComponent {
render() {
const {
viewContext: viewContext,
groupByDate: groupByDate,
groupOrientation: groupOrientation,
groups: groups,
dateHeaderData: dateHeaderData,
dateCellTemplate: dateCellTemplate,
timeCellTemplate: timeCellTemplate
} = this.props;
const {
dataMap: dataMap,
isMonthDateHeader: isMonthDateHeader,
leftVirtualCellCount: leftVirtualCellCount,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellCount: rightVirtualCellCount,
rightVirtualCellWidth: rightVirtualCellWidth,
weekDayLeftVirtualCellCount: weekDayLeftVirtualCellCount,
weekDayLeftVirtualCellWidth: weekDayLeftVirtualCellWidth,
weekDayRightVirtualCellCount: weekDayRightVirtualCellCount,
weekDayRightVirtualCellWidth: weekDayRightVirtualCellWidth
} = dateHeaderData;
const isHorizontalGrouping = (0, _index2.isHorizontalGroupingApplied)(groups.length, groupOrientation) && !groupByDate;
return (0, _inferno.createFragment)(dataMap.map((dateHeaderRow, rowIndex) => {
const rowsCount = dataMap.length;
const isTimeCellTemplate = rowsCount - 1 === rowIndex;
const isWeekDayRow = rowsCount > 1 && 0 === rowIndex;
const splitText = isMaterialBased && (isMonthDateHeader || isWeekDayRow);
let validLeftVirtualCellCount = leftVirtualCellCount;
let validRightVirtualCellCount = rightVirtualCellCount;
let validRightVirtualCellWidth = rightVirtualCellWidth;
let validLeftVirtualCellWidth = leftVirtualCellWidth;
if (isWeekDayRow) {
validLeftVirtualCellCount = weekDayLeftVirtualCellCount;
validRightVirtualCellCount = weekDayRightVirtualCellCount;
validRightVirtualCellWidth = weekDayRightVirtualCellWidth;
validLeftVirtualCellWidth = weekDayLeftVirtualCellWidth
}
return (0, _inferno.createComponentVNode)(2, _row.Row, {
className: "dx-scheduler-header-row",
leftVirtualCellWidth: validLeftVirtualCellWidth ?? _row.RowDefaultProps.leftVirtualCellWidth,
leftVirtualCellCount: validLeftVirtualCellCount,
rightVirtualCellWidth: validRightVirtualCellWidth ?? _row.RowDefaultProps.rightVirtualCellWidth,
rightVirtualCellCount: validRightVirtualCellCount,
children: dateHeaderRow.map(_ref => {
let {
colSpan: colSpan,
endDate: endDate,
groupIndex: groupIndex,
groups: cellGroups,
index: index,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
key: key,
startDate: startDate,
text: text,
today: today
} = _ref;
return (0, _inferno.createComponentVNode)(2, _date_header_cell.DateHeaderCell, {
viewContext: viewContext,
startDate: startDate,
endDate: endDate,
groups: isHorizontalGrouping ? cellGroups : void 0,
groupIndex: isHorizontalGrouping ? groupIndex : void 0,
today: today ?? _date_header_cell.DateHeaderCellDefaultProps.today,
index: index,
text: text,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
isWeekDayCell: isWeekDayRow,
colSpan: colSpan,
splitText: splitText,
dateCellTemplate: dateCellTemplate,
timeCellTemplate: timeCellTemplate,
isTimeCellTemplate: isTimeCellTemplate
}, key)
})
}, rowIndex.toString())
}), 0)
}
}
exports.TimelineDateHeaderLayout = TimelineDateHeaderLayout;
TimelineDateHeaderLayout.defaultProps = _date_header.DateHeaderDefaultProps
},
66921(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelTimeline = void 0;
var _inferno = __webpack_require__( /*! inferno */ 76231);
var _index = __webpack_require__( /*! ../../../../core/r1/runtime/inferno/index */ 6257);
var _header_panel = __webpack_require__( /*! ../base/header_panel */ 20025);
var _date_header_timeline = __webpack_require__( /*! ./date_header_timeline */ 30737);
class HeaderPanelTimeline extends _index.InfernoWrapperComponent {
createEffects() {
return [(0, _index.createReRenderEffect)()]
}
render() {
const {
viewContext: viewContext,
dateCellTemplate: dateCellTemplate,
dateHeaderData: dateHeaderData,
groupByDate: groupByDate,
groupOrientation: groupOrientation,
groupPanelData: groupPanelData,
groups: groups,
isRenderDateHeader: isRenderDateHeader,
resourceCellTemplate: resourceCellTemplate,
timeCellTemplate: timeCellTemplate
} = this.props;
return (0, _inferno.createComponentVNode)(2, _header_panel.HeaderPanel, {
viewContext: viewContext,
dateHeaderData: dateHeaderData,
groupPanelData: groupPanelData,
groupByDate: groupByDate,
groups: groups,
groupOrientation: groupOrientation,
isRenderDateHeader: isRenderDateHeader,
dateHeaderTemplate: _date_header_timeline.TimelineDateHeaderLayout,
resourceCellTemplate: resourceCellTemplate,
dateCellTemplate: dateCellTemplate,
timeCellTemplate: timeCellTemplate
})
}
}
exports.HeaderPanelTimeline = HeaderPanelTimeline;
HeaderPanelTimeline.defaultProps = _header_panel.HeaderPanelDefaultProps
},
83562(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelTitleComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 84766);
var _all_day_panel_title = __webpack_require__( /*! ../base/all_day_panel_title */ 4011);
class AllDayPanelTitleComponent extends _index.ComponentWrapper {
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: [],
props: []
}
}
get _viewComponent() {
return _all_day_panel_title.AllDayPanelTitle
}
}
exports.AllDayPanelTitleComponent = AllDayPanelTitleComponent;
(0, _component_registrator.default)("dxAllDayPanelTitle", AllDayPanelTitleComponent)
},
63273(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayTableComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _all_day_panel_table = __webpack_require__( /*! ../../../../scheduler/r1/components/base/all_day_panel_table */ 49673);
var _date_table = __webpack_require__( /*! ./date_table */ 97641);
class AllDayTableComponent extends _date_table.DateTableComponent {
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: ["dataCellTemplate"],
props: ["viewData", "viewContext", "groupOrientation", "leftVirtualCellWidth", "rightVirtualCellWidth", "topVirtualRowHeight", "bottomVirtualRowHeight", "addDateTableClass", "addVerticalSizesClassToRows", "width", "dataCellTemplate"]
}
}
get _viewComponent() {
return _all_day_panel_table.AllDayTable
}
}
exports.AllDayTableComponent = AllDayTableComponent;
(0, _component_registrator.default)("dxAllDayTable", AllDayTableComponent)
},
97641(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 84766);
var _date_table = __webpack_require__( /*! ../base/date_table */ 74282);
class DateTableComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = Object.assign({}, this._optionsByReference, {
dataCellTemplate: true
})
}
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: ["cellTemplate", "dataCellTemplate"],
props: ["viewData", "viewContext", "cellTemplate", "groupOrientation", "leftVirtualCellWidth", "rightVirtualCellWidth", "topVirtualRowHeight", "bottomVirtualRowHeight", "addDateTableClass", "addVerticalSizesClassToRows", "width", "dataCellTemplate"]
}
}
get _viewComponent() {
return _date_table.DateTable
}
}
exports.DateTableComponent = DateTableComponent;
(0, _component_registrator.default)("dxDateTableLayoutBase", DateTableComponent)
},
71212(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableMonthComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _date_table_month = __webpack_require__( /*! ../month/date_table_month */ 40802);
var _date_table = __webpack_require__( /*! ./date_table */ 97641);
class DateTableMonthComponent extends _date_table.DateTableComponent {
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: ["cellTemplate", "dataCellTemplate"],
props: ["viewData", "viewContext", "cellTemplate", "groupOrientation", "leftVirtualCellWidth", "rightVirtualCellWidth", "topVirtualRowHeight", "bottomVirtualRowHeight", "addDateTableClass", "addVerticalSizesClassToRows", "width", "dataCellTemplate"]
}
}
get _viewComponent() {
return _date_table_month.DateTableMonth
}
}
exports.DateTableMonthComponent = DateTableMonthComponent;
(0, _component_registrator.default)("dxMonthDateTableLayout", DateTableMonthComponent)
},
74290(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 84766);
var _group_panel = __webpack_require__( /*! ../base/group_panel */ 31055);
class GroupPanelComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = Object.assign({}, this._optionsByReference, {
resourceCellTemplate: true
})
}
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: ["resourceCellTemplate"],
props: ["viewContext", "groups", "groupOrientation", "groupPanelData", "groupByDate", "height", "className", "resourceCellTemplate"]
}
}
get _viewComponent() {
return _group_panel.GroupPanel
}
}
exports.GroupPanelComponent = GroupPanelComponent;
(0, _component_registrator.default)("dxGroupPanel", GroupPanelComponent)
},
87286(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 84766);
var _header_panel = __webpack_require__( /*! ../base/header_panel */ 20025);
class HeaderPanelComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = Object.assign({}, this._optionsByReference, {
dateHeaderData: true,
resourceCellTemplate: true,
dateCellTemplate: true,
timeCellTemplate: true
})
}
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: ["dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "resourceCellTemplate"],
props: ["viewContext", "dateHeaderData", "isRenderDateHeader", "dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "groups", "groupOrientation", "groupPanelData", "groupByDate", "height", "className", "resourceCellTemplate"]
}
}
get _viewComponent() {
return _header_panel.HeaderPanel
}
}
exports.HeaderPanelComponent = HeaderPanelComponent;
(0, _component_registrator.default)("dxHeaderPanelLayout", HeaderPanelComponent)
},
96774(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelTimelineComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _header_panel_timeline = __webpack_require__( /*! ../timeline/header_panel_timeline */ 66921);
var _header_panel = __webpack_require__( /*! ./header_panel */ 87286);
class HeaderPanelTimelineComponent extends _header_panel.HeaderPanelComponent {
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: ["dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "resourceCellTemplate"],
props: ["viewContext", "dateHeaderData", "isRenderDateHeader", "dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "groups", "groupOrientation", "groupPanelData", "groupByDate", "height", "className", "resourceCellTemplate"]
}
}
get _viewComponent() {
return _header_panel_timeline.HeaderPanelTimeline
}
}
exports.HeaderPanelTimelineComponent = HeaderPanelTimelineComponent;
(0, _component_registrator.default)("dxTimelineHeaderPanelLayout", HeaderPanelTimelineComponent)
},
54322(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimePanelComponent = void 0;
var _component_registrator = (e = __webpack_require__( /*! ../../../../../core/component_registrator */ 92848), e && e.__esModule ? e : {
default: e
});
var e;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 84766);
var _time_panel_table = __webpack_require__( /*! ../base/time_panel_table */ 2302);
class TimePanelComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = Object.assign({}, this._optionsByReference, {
timeCellTemplate: true
})
}
get _propsInfo() {
return {
twoWay: [],
allowNull: [],
elements: [],
templates: ["timeCellTemplate"],
props: ["viewContext", "groupOrientation", "timePanelData", "timeCellTemplate"]
}
}
get _viewComponent() {
return _time_panel_table.TimePanelTable
}
}
exports.TimePanelComponent = TimePanelComponent;
(0, _component_registrator.default)("dxTimePanelTableLayout", TimePanelComponent)
},
89755(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.combineRemoteFilter = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _date_serialization = (e = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 71051), e && e.__esModule ? e : {
default: e
});
var e;
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 52576);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _index = __webpack_require__( /*! ../utils/index */ 34396);
const FilterPosition_dateFilter = 0,
FilterPosition_userFilter = 1;
class RemoteFilterCombiner {
constructor(options) {
this.options = options
}
get dataAccessors() {
return this.options.dataAccessors
}
get dataSourceFilter() {
return this.options.dataSourceFilter
}
get dateSerializationFormat() {
return this.options.dateSerializationFormat
}
get forceIsoDateParsing() {
return (0, _type.isDefined)(this.options.forceIsoDateParsing) ? this.options.forceIsoDateParsing : true
}
makeDateFilter(min, max) {
const {
startDateExpr: startDateExpr,
endDateExpr: endDateExpr,
recurrenceRuleExpr: recurrenceRuleExpr
} = this.dataAccessors.expr;
const dateFilter = [
[
[endDateExpr, ">=", min],
[startDateExpr, "<", max]
], "or", [recurrenceRuleExpr, "startswith", "freq"], "or", [
[endDateExpr, min],
[startDateExpr, min]
]
];
if (!recurrenceRuleExpr) {
dateFilter.splice(1, 2)
}
return dateFilter
}
combineFilters(dateFilter, userFilter) {
const combinedFilter = [];
if (dateFilter) {
combinedFilter.push(dateFilter)
}
if (userFilter) {
combinedFilter.push(userFilter)
}
return this.serializeRemoteFilter(combinedFilter)
}
serializeRemoteFilter(combinedFilter) {
if (!Array.isArray(combinedFilter)) {
return combinedFilter
}
const {
startDateExpr: startDateExpr,
endDateExpr: endDateExpr
} = this.dataAccessors.expr;
const filter = (0, _extend.extend)([], combinedFilter);
if ((0, _type.isString)(filter[0])) {
if (this.forceIsoDateParsing && filter.length > 1) {
if (filter[0] === startDateExpr || filter[0] === endDateExpr) {
const lastFilterValue = filter[filter.length - 1];
filter[filter.length - 1] = _date_serialization.default.serializeDate(new Date(lastFilterValue), this.dateSerializationFormat)
}
}
}
for (let i = 0; i < filter.length; i += 1) {
filter[i] = this.serializeRemoteFilter(filter[i])
}
return filter
}
getUserFilter(dateFilter) {
if (!this.dataSourceFilter || (0, _common.equalByValue)(this.dataSourceFilter, dateFilter)) {
return
}
const containsDateFilter = this.dataSourceFilter.length > 0 && (0, _common.equalByValue)(this.dataSourceFilter[FilterPosition_dateFilter], dateFilter);
const userFilter = containsDateFilter ? this.dataSourceFilter[FilterPosition_userFilter] : this.dataSourceFilter;
return userFilter
}
combine(min, max) {
const [trimMin, trimMax] = (0, _index.getDatesWithoutTime)(min, max);
const dateFilter = this.makeDateFilter(trimMin, trimMax);
const userFilter = this.getUserFilter(dateFilter);
const combinedFilter = this.combineFilters(dateFilter, userFilter);
return combinedFilter
}
}
exports.combineRemoteFilter = options => new RemoteFilterCombiner(options).combine(options.min, options.max)
},
25109(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimeZoneCalculator = void 0;
var _date = (e = __webpack_require__( /*! ../../../../core/utils/date */ 41380), e && e.__esModule ? e : {
default: e
});
var e;
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 55594);
const toMs = _date.default.dateToMilliseconds;
exports.TimeZoneCalculator = class {
constructor(options) {
this.options = options
}
createDate(sourceDate, path, appointmentTimeZone) {
const date = new Date(sourceDate);
switch (path) {
case "toAppointment":
return this.getConvertedDate(date, appointmentTimeZone, false);
case "fromAppointment":
return this.getConvertedDate(date, appointmentTimeZone, true);
case "toGrid":
return this.getConvertedDate(date, void 0, false);
case "fromGrid":
return this.getConvertedDate(date, void 0, true);
default:
throw new Error("not specified pathTimeZoneConversion")
}
}
getOffsets(date, appointmentTimezone) {
const clientOffset = -this.getClientOffset(date) / _date.default.dateToMilliseconds("hour");
const commonOffset = this.getCommonOffset(date);
const appointmentOffset = this.getAppointmentOffset(date, appointmentTimezone);
return {
client: clientOffset,
common: !(0, _type.isDefined)(commonOffset) ? clientOffset : commonOffset,
appointment: "number" !== typeof appointmentOffset ? clientOffset : appointmentOffset
}
}
getOriginStartDateOffsetInMs(date, timezone, isUTCDate) {
const offsetInHours = this.getOffsetInHours(date, timezone, isUTCDate);
return 36e5 * offsetInHours
}
getOffsetInHours(date, timezone, isUTCDate) {
const {
client: client,
appointment: appointment,
common: common
} = this.getOffsets(date, timezone);
if (Boolean(timezone) && isUTCDate) {
return appointment - client
}
if (Boolean(timezone) && !isUTCDate) {
return appointment - common
}
if (!timezone && isUTCDate) {
return common - client
}
return 0
}
getClientOffset(date) {
return this.options.getClientOffset(date)
}
getCommonOffset(date) {
return this.options.tryGetCommonOffset(date)
}
getAppointmentOffset(date, appointmentTimezone) {
return this.options.tryGetAppointmentOffset(date, appointmentTimezone)
}
getConvertedDate(date, appointmentTimezone, isBack) {
const newDate = new Date(date.getTime());
const offsets = this.getOffsets(newDate, appointmentTimezone);
const targetOffsetName = appointmentTimezone ? "appointment" : "common";
const direction = isBack ? -1 : 1;
return _date2.dateUtilsTs.addOffsets(newDate, direction * toMs("hour") * offsets[targetOffsetName], -direction * toMs("hour") * offsets.client)
}
}
},
97777(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "TimeZoneCalculator", {
enumerable: true,
get: function() {
return _calculator.TimeZoneCalculator
}
});
Object.defineProperty(exports, "createTimeZoneCalculator", {
enumerable: true,
get: function() {
return _utils.createTimeZoneCalculator
}
});
var _calculator = __webpack_require__( /*! ./calculator */ 25109);
var _utils = __webpack_require__( /*! ./utils */ 88476)
},
88476(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createTimeZoneCalculator = void 0;
var _m_utils_time_zone = (e = __webpack_require__( /*! ../../m_utils_time_zone */ 18648), e && e.__esModule ? e : {
default: e
});
var e;
var _calculator = __webpack_require__( /*! ./calculator */ 25109);
exports.createTimeZoneCalculator = currentTimeZone => new _calculator.TimeZoneCalculator({
timeZone: currentTimeZone,
getClientOffset: date => _m_utils_time_zone.default.getClientTimezoneOffset(date),
tryGetCommonOffset: date => _m_utils_time_zone.default.calculateTimezoneByValue(currentTimeZone, date),
tryGetAppointmentOffset: (date, appointmentTimezone) => _m_utils_time_zone.default.calculateTimezoneByValue(appointmentTimezone, date)
})
},
64722(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = exports.calculateRows = void 0;
var _m_utils_time_zone = (e = __webpack_require__( /*! ../../m_utils_time_zone */ 18648), e && e.__esModule ? e : {
default: e
});
var e;
var _base = __webpack_require__( /*! ./base */ 44611);
exports.calculateStartViewDate = (currentDate, startDayHour) => {
const validCurrentDate = new Date(currentDate);
return (0, _base.setOptionHour)(validCurrentDate, startDayHour)
};
const getDayStart = date => new Date(date).setUTCHours(0, 0, 0, 0);
exports.calculateRows = (appointments, agendaDuration, currentDate, groupCount) => {
const dayMs = getDayStart(_m_utils_time_zone.default.createUTCDateWithLocalOffset(currentDate));
const intervalsStartMap = new Map;
const result = Array.from({
length: groupCount || 1
}, () => new Array(agendaDuration).fill(0));
for (let i = 0; i < agendaDuration; i += 1) {
const day = new Date(dayMs);
intervalsStartMap.set(day.setUTCDate(day.getUTCDate() + i), i)
}
appointments.forEach(appointment => {
const appointmentStart = getDayStart(appointment.startDateUTC);
const intervalIndex = intervalsStartMap.get(appointmentStart);
if (void 0 !== intervalIndex) {
result[appointment.groupIndex][intervalIndex] += 1
}
});
return result
}
},
44611(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.splitNumber = exports.setOptionHour = exports.isVerticalGroupingApplied = exports.isTimelineView = exports.isHorizontalView = exports.isHorizontalGroupingApplied = exports.isGroupingByDate = exports.isFirstCellInMonthWithIntervalCount = exports.isDateInRange = exports.isDateAndTimeView = exports.isDataOnWeekend = exports.isAppointmentTakesAllDay = exports.getWeekendsCount = exports.getViewStartByOptions = exports.getVerticalGroupCountClass = exports.getValidCellDateForLocalTimeFormat = exports.getTotalRowCountByCompleteData = exports.getTotalCellCountByCompleteData = exports.getToday = exports.getStartViewDateWithoutDST = exports.getStartViewDateTimeOffset = exports.getSkippedHoursInRange = exports.getOverflowIndicatorColor = exports.getKeyByGroup = exports.getIsGroupedAllDayPanel = exports.getHorizontalGroupCount = exports.getHeaderCellText = exports.getGroupPanelData = exports.getDisplayedRowCount = exports.getDisplayedCellCount = exports.getDatesWithoutTime = exports.getCellDuration = exports.getCalculatedFirstDayOfWeek = exports.getAppointmentKey = exports.extendGroupItemsForGroupingByDate = exports.calculateViewStartDate = exports.calculateIsGroupedAllDayPanel = exports.calculateDayDuration = exports.calculateCellIndex = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/date */ 38662));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 41380));
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _date3 = __webpack_require__( /*! ../../../core/utils/date */ 55594);
var _constants = __webpack_require__( /*! ../../constants */ 25307);
var _m_classes = __webpack_require__( /*! ../../m_classes */ 80126);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 18648));
var _constants_view = __webpack_require__( /*! ../../utils/options/constants_view */ 43582);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const toMs = _date2.default.dateToMilliseconds;
exports.getDatesWithoutTime = (min, max) => {
const newMin = _date2.default.trimTime(new Date(min));
const newMax = _date2.default.trimTime(new Date(max));
newMax.setDate(newMax.getDate() + 1);
return [newMin, newMax]
};
exports.isAppointmentTakesAllDay = (appointmentAdapter, allDayPanelMode) => {
const {
startDate: startDate,
endDate: endDate,
allDay: allDay
} = appointmentAdapter;
switch (allDayPanelMode) {
case "hidden":
return false;
case "allDay":
return allDay;
default:
if (allDay) {
return true
}
if (!(0, _type.isDefined)(endDate)) {
return false
}
return ((startDate, endDate) => Math.floor((endDate.getTime() - startDate.getTime()) / toMs("hour")))(startDate, endDate) >= 24
}
};
exports.getAppointmentKey = geometry => {
const {
left: left,
top: top,
width: width,
height: height
} = geometry;
return `${left}-${top}-${width}-${height}`
};
exports.getOverflowIndicatorColor = (color, colors) => !colors.length || 0 === colors.filter(item => item !== color).length ? color : void 0;
exports.getVerticalGroupCountClass = groups => {
switch (null === groups || void 0 === groups ? void 0 : groups.length) {
case 1:
return _m_classes.VERTICAL_GROUP_COUNT_CLASSES[0];
case 2:
return _m_classes.VERTICAL_GROUP_COUNT_CLASSES[1];
case 3:
return _m_classes.VERTICAL_GROUP_COUNT_CLASSES[2];
default:
return
}
};
exports.setOptionHour = (date, optionHour) => {
const nextDate = new Date(date);
if (!(0, _type.isDefined)(optionHour)) {
return nextDate
}
nextDate.setHours(optionHour, optionHour % 1 * 60, 0, 0);
return nextDate
};
const calculateDayDuration = (startDayHour, endDayHour) => endDayHour - startDayHour;
exports.calculateDayDuration = calculateDayDuration;
const getStartViewDateTimeOffset = (startViewDate, startDayHour) => {
const validStartDayHour = Math.floor(startDayHour);
const isDSTChange = _m_utils_time_zone.default.isTimezoneChangeInDate(startViewDate);
if (isDSTChange && validStartDayHour !== startViewDate.getHours()) {
return _date2.default.dateToMilliseconds("hour")
}
return 0
};
exports.getStartViewDateTimeOffset = getStartViewDateTimeOffset;
exports.getValidCellDateForLocalTimeFormat = (date, _ref) => {
let {
startViewDate: startViewDate,
startDayHour: startDayHour,
cellIndexShift: cellIndexShift,
viewOffset: viewOffset
} = _ref;
const originDate = _date3.dateUtilsTs.addOffsets(date, -viewOffset);
const localTimeZoneChangedInOriginDate = _m_utils_time_zone.default.isTimezoneChangeInDate(originDate);
if (!localTimeZoneChangedInOriginDate) {
return date
}
const startViewDateWithoutDST = new Date(new Date(startViewDate).setDate(startViewDate.getDate() + 2));
const startViewDateOffset = getStartViewDateTimeOffset(startViewDate, startDayHour);
return _date3.dateUtilsTs.addOffsets(startViewDateWithoutDST, viewOffset, cellIndexShift, -startViewDateOffset)
};
const getTotalCellCountByCompleteData = completeData => completeData[completeData.length - 1].length;
exports.getTotalCellCountByCompleteData = getTotalCellCountByCompleteData;
exports.getDisplayedCellCount = (displayedCellCount, completeData) => displayedCellCount ?? getTotalCellCountByCompleteData(completeData);
exports.getHeaderCellText = (headerIndex, date, headerCellTextFormat, getDateForHeaderText, additionalOptions) => {
const validDate = getDateForHeaderText(headerIndex, date, additionalOptions);
return _date.default.format(validDate, headerCellTextFormat)
};
const isVerticalGroupingApplied = (groupCount, groupOrientation) => groupOrientation === _constants.VERTICAL_GROUP_ORIENTATION && groupCount > 0;
exports.isVerticalGroupingApplied = isVerticalGroupingApplied;
exports.getHorizontalGroupCount = (groupCount, groupOrientation) => {
const isVerticalGrouping = isVerticalGroupingApplied(groupCount, groupOrientation);
return isVerticalGrouping ? 1 : groupCount
};
const TIMELINE_VIEWS = [_constants_view.VIEWS.TIMELINE_DAY, _constants_view.VIEWS.TIMELINE_WEEK, _constants_view.VIEWS.TIMELINE_WORK_WEEK, _constants_view.VIEWS.TIMELINE_MONTH];
exports.isTimelineView = viewType => Boolean(viewType && TIMELINE_VIEWS.includes(viewType));
exports.isDateAndTimeView = viewType => viewType !== _constants_view.VIEWS.TIMELINE_MONTH && viewType !== _constants_view.VIEWS.MONTH;
exports.isHorizontalView = viewType => {
switch (viewType) {
case _constants_view.VIEWS.TIMELINE_DAY:
case _constants_view.VIEWS.TIMELINE_WEEK:
case _constants_view.VIEWS.TIMELINE_WORK_WEEK:
case _constants_view.VIEWS.TIMELINE_MONTH:
case _constants_view.VIEWS.MONTH:
return true;
default:
return false
}
};
const isDateInRange = (date, startDate, endDate, diff) => diff > 0 ? _date2.default.dateInRange(date, startDate, new Date(endDate.getTime() - 1)) : _date2.default.dateInRange(date, endDate, startDate, "date");
exports.isDateInRange = isDateInRange;
exports.isFirstCellInMonthWithIntervalCount = (cellDate, intervalCount) => 1 === cellDate.getDate() && intervalCount > 1;
exports.getViewStartByOptions = (startDate, currentDate, intervalDuration, startViewDate) => {
if (!startDate) {
return new Date(currentDate)
}
let currentStartDate = _date2.default.trimTime(startViewDate);
const diff = currentStartDate.getTime() <= currentDate.getTime() ? 1 : -1;
let endDate = new Date(currentStartDate.getTime() + intervalDuration * diff);
while (!isDateInRange(currentDate, currentStartDate, endDate, diff)) {
currentStartDate = endDate;
endDate = new Date(currentStartDate.getTime() + intervalDuration * diff)
}
return diff > 0 ? currentStartDate : endDate
};
exports.calculateIsGroupedAllDayPanel = (groupCount, groupOrientation, isAllDayPanelVisible) => isVerticalGroupingApplied(groupCount, groupOrientation) && isAllDayPanelVisible;
exports.calculateViewStartDate = startDateOption => startDateOption;
exports.getCellDuration = (viewType, startDayHour, endDayHour, hoursInterval) => {
switch (viewType) {
case "month":
return 36e5 * calculateDayDuration(startDayHour, endDayHour);
case "timelineMonth":
return _date2.default.dateToMilliseconds("day");
default:
return 36e5 * hoursInterval
}
};
exports.calculateCellIndex = (rowIndex, columnIndex, rowCount) => columnIndex * rowCount + rowIndex;
const getTotalRowCountByCompleteData = completeData => completeData.length;
exports.getTotalRowCountByCompleteData = getTotalRowCountByCompleteData;
exports.getDisplayedRowCount = (displayedRowCount, completeData) => displayedRowCount ?? getTotalRowCountByCompleteData(completeData);
exports.getStartViewDateWithoutDST = (startViewDate, startDayHour) => {
const newStartViewDate = _m_utils_time_zone.default.getDateWithoutTimezoneChange(startViewDate);
newStartViewDate.setHours(startDayHour);
return newStartViewDate
};
exports.getIsGroupedAllDayPanel = (hasAllDayRow, isVerticalGrouping) => hasAllDayRow && isVerticalGrouping;
exports.getKeyByGroup = (groupIndex, isVerticalGrouping) => {
if (isVerticalGrouping && void 0 !== groupIndex) {
return groupIndex.toString()
}
return "0"
};
exports.getToday = (indicatorTime, timeZoneCalculator) => {
const todayDate = indicatorTime ?? new Date;
return (null === timeZoneCalculator || void 0 === timeZoneCalculator ? void 0 : timeZoneCalculator.createDate(todayDate, "toGrid")) || todayDate
};
exports.getCalculatedFirstDayOfWeek = firstDayOfWeekOption => (0, _type.isDefined)(firstDayOfWeekOption) ? firstDayOfWeekOption : _date.default.firstDayOfWeekIndex();
const isHorizontalGroupingApplied = (groupCount, groupOrientation) => groupOrientation === _constants.HORIZONTAL_GROUP_ORIENTATION && groupCount > 0;
exports.isHorizontalGroupingApplied = isHorizontalGroupingApplied;
exports.isGroupingByDate = (groupCount, groupOrientation, groupByDate) => {
const isHorizontalGrouping = isHorizontalGroupingApplied(groupCount, groupOrientation);
return groupByDate && isHorizontalGrouping
};
exports.getSkippedHoursInRange = (startDate, endDate, allDay, viewDataProvider) => {
const isAllDay = allDay && !viewDataProvider.viewType.includes("timeline");
let result = 0;
const currentDate = new Date(startDate);
currentDate.setDate(currentDate.getDate() + 1);
currentDate.setHours(0, 0, 0, 0);
const endDateWithStartHour = new Date(endDate);
endDateWithStartHour.setHours(0, 0, 0, 0);
const {
startDayHour: startDayHour,
endDayHour: endDayHour
} = viewDataProvider.getViewOptions();
const dayHours = isAllDay ? 24 : endDayHour - startDayHour;
while (currentDate < endDateWithStartHour) {
if (viewDataProvider.isSkippedDate(currentDate)) {
result += dayHours
}
currentDate.setDate(currentDate.getDate() + 1)
}
const startDateHours = startDate.getHours();
const endDateHours = endDate.getHours() + endDate.getTime() % 36e5 / 36e5;
if (viewDataProvider.isSkippedDate(startDate)) {
switch (true) {
case isAllDay:
result += 24;
break;
case startDateHours < startDayHour:
result += dayHours;
break;
case startDateHours < endDayHour:
result += endDayHour - startDateHours
}
}
if (viewDataProvider.isSkippedDate(endDate)) {
switch (true) {
case isAllDay:
result += 24;
break;
case endDateHours > endDayHour:
result += dayHours;
break;
case endDateHours > startDayHour:
result += endDateHours - startDayHour
}
}
return result
};
exports.isDataOnWeekend = date => {
const day = date.getDay();
return 6 === day || 0 === day
};
exports.getWeekendsCount = days => 2 * Math.floor(days / 7);
const extendGroupItemsForGroupingByDate = (groupRenderItems, columnCountPerGroup) => [...new Array(columnCountPerGroup)].reduce((currentGroupItems, _, index) => groupRenderItems.map((groupsRow, rowIndex) => {
const currentRow = currentGroupItems[rowIndex] || [];
return [...currentRow, ...groupsRow.map((item, columnIndex) => Object.assign({}, item, {
key: `${item.key}_group_by_date_${index}`,
isFirstGroupCell: 0 === columnIndex,
isLastGroupCell: columnIndex === groupsRow.length - 1
}))]
}), []);
exports.extendGroupItemsForGroupingByDate = extendGroupItemsForGroupingByDate;
const stringifyId = id => (0, _type.isObject)(id) ? JSON.stringify(id) : String(id);
exports.getGroupPanelData = (groupResources, columnCountPerGroup, groupByDate, baseColSpan) => {
let repeatCount = 1;
let groupPanelItems = groupResources.map(group => {
const result = [];
const {
resourceName: resourceName,
resourceIndex: resourceIndex,
items: items,
data: data
} = group;
for (let i = 0; i < repeatCount; i += 1) {
result.push(...items.map((_ref2, index) => {
let {
id: id,
text: text,
color: color
} = _ref2;
return {
id: id,
text: text,
color: color,
key: `${i}_${resourceIndex}_${stringifyId(id)}`,
resourceName: resourceName,
data: null === data || void 0 === data ? void 0 : data[index]
}
}))
}
repeatCount *= items.length;
return result
}).filter(group => group.length);
if (groupByDate) {
groupPanelItems = extendGroupItemsForGroupingByDate(groupPanelItems, columnCountPerGroup)
}
return {
groupPanelItems: groupPanelItems,
baseColSpan: baseColSpan
}
};
exports.splitNumber = (value, splitValue) => Array.from({
length: Math.ceil(value / splitValue)
}, (_, index) => Math.min(value - splitValue * index, splitValue))
},
69082(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = void 0;
var _base = __webpack_require__( /*! ./base */ 44611);
exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalDuration) => {
const firstViewDate = (0, _base.getViewStartByOptions)(startDate, currentDate, intervalDuration, startDate);
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
}
},
98090(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.excludeFromRecurrence = void 0;
var _date_serialization = (e = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 71051), e && e.__esModule ? e : {
default: e
});
var e;
var _appointment_adapter = __webpack_require__( /*! ../../utils/appointment_adapter/appointment_adapter */ 36791);
const createRecurrenceException = (appointmentAdapter, exceptionDate) => {
const result = [];
if (appointmentAdapter.recurrenceException) {
result.push(appointmentAdapter.recurrenceException)
}
result.push(((date, startDate, isAllDay) => {
if (isAllDay) {
date.setHours(startDate.getHours(), startDate.getMinutes(), startDate.getSeconds(), startDate.getMilliseconds())
}
return _date_serialization.default.serializeDate(date, "yyyyMMddTHHmmssZ")
})(exceptionDate, appointmentAdapter.startDate, appointmentAdapter.allDay));
return result.join()
};
exports.excludeFromRecurrence = (appointment, exceptionDate, dataAccessors) => {
const appointmentAdapter = new _appointment_adapter.AppointmentAdapter(Object.assign({}, appointment), dataAccessors);
appointmentAdapter.recurrenceException = createRecurrenceException(appointmentAdapter, exceptionDate);
return appointmentAdapter
}
},
28524(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.formatWeekdayAndDay = exports.formatWeekday = void 0;
var _date = (e = __webpack_require__( /*! ../../../../common/core/localization/date */ 38662), e && e.__esModule ? e : {
default: e
});
var e;
const formatWeekday = date => _date.default.getDayNames("abbreviated")[date.getDay()];
exports.formatWeekday = formatWeekday;
exports.formatWeekdayAndDay = date => `${formatWeekday(date)} ${_date.default.format(date,"day")}`
},
34396(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.agendaUtils = void 0;
Object.defineProperty(exports, "calculateCellIndex", {
enumerable: true,
get: function() {
return _base.calculateCellIndex
}
});
Object.defineProperty(exports, "calculateDayDuration", {
enumerable: true,
get: function() {
return _base.calculateDayDuration
}
});
Object.defineProperty(exports, "calculateIsGroupedAllDayPanel", {
enumerable: true,
get: function() {
return _base.calculateIsGroupedAllDayPanel
}
});
Object.defineProperty(exports, "calculateViewStartDate", {
enumerable: true,
get: function() {
return _base.calculateViewStartDate
}
});
exports.dayUtils = void 0;
Object.defineProperty(exports, "excludeFromRecurrence", {
enumerable: true,
get: function() {
return _exclude_from_recurrence.excludeFromRecurrence
}
});
Object.defineProperty(exports, "extendGroupItemsForGroupingByDate", {
enumerable: true,
get: function() {
return _base.extendGroupItemsForGroupingByDate
}
});
Object.defineProperty(exports, "formatWeekday", {
enumerable: true,
get: function() {
return _format_weekday.formatWeekday
}
});
Object.defineProperty(exports, "formatWeekdayAndDay", {
enumerable: true,
get: function() {
return _format_weekday.formatWeekdayAndDay
}
});
Object.defineProperty(exports, "getAppointmentKey", {
enumerable: true,
get: function() {
return _base.getAppointmentKey
}
});
Object.defineProperty(exports, "getCalculatedFirstDayOfWeek", {
enumerable: true,
get: function() {
return _base.getCalculatedFirstDayOfWeek
}
});
Object.defineProperty(exports, "getCellDuration", {
enumerable: true,
get: function() {
return _base.getCellDuration
}
});
Object.defineProperty(exports, "getDatesWithoutTime", {
enumerable: true,
get: function() {
return _base.getDatesWithoutTime
}
});
Object.defineProperty(exports, "getDisplayedCellCount", {
enumerable: true,
get: function() {
return _base.getDisplayedCellCount
}
});
Object.defineProperty(exports, "getDisplayedRowCount", {
enumerable: true,
get: function() {
return _base.getDisplayedRowCount
}
});
Object.defineProperty(exports, "getGroupPanelData", {
enumerable: true,
get: function() {
return _base.getGroupPanelData
}
});
Object.defineProperty(exports, "getHeaderCellText", {
enumerable: true,
get: function() {
return _base.getHeaderCellText
}
});
Object.defineProperty(exports, "getHorizontalGroupCount", {
enumerable: true,
get: function() {
return _base.getHorizontalGroupCount
}
});
Object.defineProperty(exports, "getIsGroupedAllDayPanel", {
enumerable: true,
get: function() {
return _base.getIsGroupedAllDayPanel
}
});
Object.defineProperty(exports, "getKeyByGroup", {
enumerable: true,
get: function() {
return _base.getKeyByGroup
}
});
Object.defineProperty(exports, "getOverflowIndicatorColor", {
enumerable: true,
get: function() {
return _base.getOverflowIndicatorColor
}
});
Object.defineProperty(exports, "getSkippedHoursInRange", {
enumerable: true,
get: function() {
return _base.getSkippedHoursInRange
}
});
Object.defineProperty(exports, "getStartViewDateTimeOffset", {
enumerable: true,
get: function() {
return _base.getStartViewDateTimeOffset
}
});
Object.defineProperty(exports, "getStartViewDateWithoutDST", {
enumerable: true,
get: function() {
return _base.getStartViewDateWithoutDST
}
});
Object.defineProperty(exports, "getToday", {
enumerable: true,
get: function() {
return _base.getToday
}
});
Object.defineProperty(exports, "getTotalCellCountByCompleteData", {
enumerable: true,
get: function() {
return _base.getTotalCellCountByCompleteData
}
});
Object.defineProperty(exports, "getTotalRowCountByCompleteData", {
enumerable: true,
get: function() {
return _base.getTotalRowCountByCompleteData
}
});
Object.defineProperty(exports, "getValidCellDateForLocalTimeFormat", {
enumerable: true,
get: function() {
return _base.getValidCellDateForLocalTimeFormat
}
});
Object.defineProperty(exports, "getVerticalGroupCountClass", {
enumerable: true,
get: function() {
return _base.getVerticalGroupCountClass
}
});
Object.defineProperty(exports, "getViewStartByOptions", {
enumerable: true,
get: function() {
return _base.getViewStartByOptions
}
});
Object.defineProperty(exports, "getWeekendsCount", {
enumerable: true,
get: function() {
return _base.getWeekendsCount
}
});
Object.defineProperty(exports, "isAppointmentTakesAllDay", {
enumerable: true,
get: function() {
return _base.isAppointmentTakesAllDay
}
});
Object.defineProperty(exports, "isDataOnWeekend", {
enumerable: true,
get: function() {
return _base.isDataOnWeekend
}
});
Object.defineProperty(exports, "isDateAndTimeView", {
enumerable: true,
get: function() {
return _base.isDateAndTimeView
}
});
Object.defineProperty(exports, "isDateInRange", {
enumerable: true,
get: function() {
return _base.isDateInRange
}
});
Object.defineProperty(exports, "isFirstCellInMonthWithIntervalCount", {
enumerable: true,
get: function() {
return _base.isFirstCellInMonthWithIntervalCount
}
});
Object.defineProperty(exports, "isGroupingByDate", {
enumerable: true,
get: function() {
return _base.isGroupingByDate
}
});
Object.defineProperty(exports, "isHorizontalGroupingApplied", {
enumerable: true,
get: function() {
return _base.isHorizontalGroupingApplied
}
});
Object.defineProperty(exports, "isHorizontalView", {
enumerable: true,
get: function() {
return _base.isHorizontalView
}
});
Object.defineProperty(exports, "isTimelineView", {
enumerable: true,
get: function() {
return _base.isTimelineView
}
});
Object.defineProperty(exports, "isVerticalGroupingApplied", {
enumerable: true,
get: function() {
return _base.isVerticalGroupingApplied
}
});
exports.renderUtils = exports.monthUtils = void 0;
Object.defineProperty(exports, "setOptionHour", {
enumerable: true,
get: function() {
return _base.setOptionHour
}
});
Object.defineProperty(exports, "splitNumber", {
enumerable: true,
get: function() {
return _base.splitNumber
}
});
exports.workWeekUtils = exports.weekUtils = exports.timelineWeekUtils = exports.timelineMonthUtils = exports.themeUtils = void 0;
var _themes = __webpack_require__( /*! ../../../scheduler/r1/utils/themes */ 3108);
var _agenda = __webpack_require__( /*! ./agenda */ 64722);
var _day = __webpack_require__( /*! ./day */ 69082);
var _month = __webpack_require__( /*! ./month */ 82722);
var _render = __webpack_require__( /*! ./render */ 33930);
var _timeline_month = __webpack_require__( /*! ./timeline_month */ 98616);
var _timeline_week = __webpack_require__( /*! ./timeline_week */ 13516);
var _week = __webpack_require__( /*! ./week */ 3962);
var _work_week = __webpack_require__( /*! ./work_week */ 19442);
var _base = __webpack_require__( /*! ./base */ 44611);
var _exclude_from_recurrence = __webpack_require__( /*! ./exclude_from_recurrence */ 98090);
var _format_weekday = __webpack_require__( /*! ./format_weekday */ 28524);
exports.agendaUtils = {
calculateStartViewDate: _agenda.calculateStartViewDate,
calculateRows: _agenda.calculateRows
};
exports.dayUtils = {
calculateStartViewDate: _day.calculateStartViewDate
};
exports.weekUtils = {
getIntervalDuration: _week.getIntervalDuration,
getTimePanelCellText: _week.getTimePanelCellText,
calculateStartViewDate: _week.calculateStartViewDate,
calculateViewStartDate: _week.calculateViewStartDate
};
exports.workWeekUtils = {
calculateStartViewDate: _work_week.calculateStartViewDate
};
exports.monthUtils = {
getViewStartByOptions: _month.getViewStartByOptions,
getCellText: _month.getCellText,
calculateCellIndex: _month.calculateCellIndex,
calculateStartViewDate: _month.calculateStartViewDate
};
exports.timelineWeekUtils = {
getDateForHeaderText: _timeline_week.getDateForHeaderText
};
exports.timelineMonthUtils = {
calculateStartViewDate: _timeline_month.calculateStartViewDate
};
exports.renderUtils = {
addToStyles: _render.addToStyles,
addWidthToStyle: _render.addWidthToStyle,
addHeightToStyle: _render.addHeightToStyle,
getGroupCellClasses: _render.getGroupCellClasses,
getCellSizeHorizontalClass: _render.getCellSizeHorizontalClass,
getCellSizeVerticalClass: _render.getCellSizeVerticalClass
};
exports.themeUtils = {
getThemeType: _themes.getThemeType
}
},
82722(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getViewStartByOptions = exports.getCellText = exports.calculateStartViewDate = exports.calculateCellIndex = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/date */ 38662));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 41380));
var _base = __webpack_require__( /*! ./base */ 44611);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.calculateCellIndex = (rowIndex, columnIndex, _, columnCount) => rowIndex * columnCount + columnIndex;
const getViewStartByOptions = (startDate, currentDate, intervalCount, startViewDate) => {
if (!startDate) {
return new Date(currentDate)
}
let currentStartDate = new Date(startViewDate);
const validStartViewDate = new Date(startViewDate);
const diff = currentStartDate.getTime() <= currentDate.getTime() ? 1 : -1;
let endDate = new Date(new Date(validStartViewDate.setMonth(validStartViewDate.getMonth() + diff * intervalCount)));
while (!(0, _base.isDateInRange)(currentDate, currentStartDate, endDate, diff)) {
currentStartDate = new Date(endDate);
if (diff > 0) {
currentStartDate.setDate(1)
}
endDate = new Date(new Date(endDate.setMonth(endDate.getMonth() + diff * intervalCount)))
}
return diff > 0 ? currentStartDate : endDate
};
exports.getViewStartByOptions = getViewStartByOptions;
exports.getCellText = (date, intervalCount) => {
if ((0, _base.isFirstCellInMonthWithIntervalCount)(date, intervalCount)) {
const monthName = _date.default.getMonthNames("abbreviated")[date.getMonth()];
return [monthName, _date.default.format(date, "day")].join(" ")
}
return _date.default.format(date, "dd")
};
exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalCount, firstDayOfWeekOption) => {
const viewStart = getViewStartByOptions(startDate, currentDate, intervalCount, _date2.default.getFirstMonthDate(startDate));
const firstMonthDate = _date2.default.getFirstMonthDate(viewStart);
const firstDayOfWeek = (0, _base.getCalculatedFirstDayOfWeek)(firstDayOfWeekOption);
const firstViewDate = _date2.default.getFirstWeekDate(firstMonthDate, firstDayOfWeek);
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
}
},
33930(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGroupCellClasses = exports.getCellSizeVerticalClass = exports.getCellSizeHorizontalClass = exports.addWidthToStyle = exports.addToStyles = exports.addHeightToStyle = void 0;
var _render_utils = __webpack_require__( /*! ../../../core/r1/utils/render_utils */ 71312);
const addToStyles = (options, style) => {
const nextStyle = style ?? {};
const result = Object.assign({}, nextStyle);
options.forEach(_ref => {
let {
attr: attr,
value: value
} = _ref;
result[attr] = value || nextStyle[attr]
});
return result
};
exports.addToStyles = addToStyles;
exports.addWidthToStyle = (value, style) => {
const width = value ? `${value}px` : "";
return addToStyles([{
attr: "width",
value: width
}], style)
};
exports.addHeightToStyle = (value, style) => {
const height = value ? `${value}px` : "";
return addToStyles([{
attr: "height",
value: height
}], style)
};
exports.getGroupCellClasses = function() {
let isFirstGroupCell = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
let isLastGroupCell = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
let className = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "";
return (0, _render_utils.combineClasses)({
"dx-scheduler-first-group-cell": isFirstGroupCell,
"dx-scheduler-last-group-cell": isLastGroupCell,
[className]: true
})
};
exports.getCellSizeHorizontalClass = (viewType, crossScrollingEnabled) => {
switch (viewType) {
case "day":
case "week":
case "workWeek":
case "month":
return crossScrollingEnabled ? "dx-scheduler-cell-sizes-horizontal" : "";
default:
return "dx-scheduler-cell-sizes-horizontal"
}
};
exports.getCellSizeVerticalClass = isAllDayCell => !isAllDayCell ? "dx-scheduler-cell-sizes-vertical" : ""
},
3108(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getThemeType = void 0;
var _themes = __webpack_require__( /*! ../../../../ui/themes */ 52071);
exports.getThemeType = () => {
const theme = (0, _themes.current)();
return {
isCompact: (0, _themes.isCompact)(theme),
isMaterial: (0, _themes.isMaterial)(theme),
isFluent: (0, _themes.isFluent)(theme),
isMaterialBased: (0, _themes.isMaterialBased)(theme)
}
}
},
98616(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = void 0;
var _date = (e = __webpack_require__( /*! ../../../../core/utils/date */ 41380), e && e.__esModule ? e : {
default: e
});
var e;
var _base = __webpack_require__( /*! ./base */ 44611);
var _month = __webpack_require__( /*! ./month */ 82722);
exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalCount) => {
const firstViewDate = _date.default.getFirstMonthDate((0, _month.getViewStartByOptions)(startDate, currentDate, intervalCount, _date.default.getFirstMonthDate(startDate)));
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
}
},
13516(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDateForHeaderText = void 0;
var _base = __webpack_require__( /*! ./base */ 44611);
exports.getDateForHeaderText = (index, date, _ref) => {
let {
startDayHour: startDayHour,
startViewDate: startViewDate,
cellCountInDay: cellCountInDay,
interval: interval,
viewOffset: viewOffset
} = _ref;
return (0, _base.getValidCellDateForLocalTimeFormat)(date, {
startViewDate: startViewDate,
startDayHour: startDayHour,
cellIndexShift: index % cellCountInDay * interval,
viewOffset: viewOffset
})
}
},
3962(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getValidStartDate = exports.getTimePanelCellText = exports.getIntervalDuration = exports.calculateViewStartDate = exports.calculateStartViewDate = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../common/core/localization/date */ 38662));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 41380));
var _base = __webpack_require__( /*! ./base */ 44611);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.getTimePanelCellText = (rowIndex, date, startViewDate, cellDuration, startDayHour, viewOffset) => {
if (rowIndex % 2 !== 0) {
return ""
}
const validTimeDate = (0, _base.getValidCellDateForLocalTimeFormat)(date, {
startViewDate: startViewDate,
startDayHour: startDayHour,
cellIndexShift: Math.round(cellDuration) * rowIndex,
viewOffset: viewOffset
});
return _date.default.format(validTimeDate, "shorttime")
};
exports.getIntervalDuration = intervalCount => 7 * _date2.default.dateToMilliseconds("day") * intervalCount;
const getValidStartDate = (startDate, firstDayOfWeek) => startDate ? _date2.default.getFirstWeekDate(startDate, firstDayOfWeek) : void 0;
exports.getValidStartDate = getValidStartDate;
exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalDuration, firstDayOfWeekOption) => {
const firstDayOfWeek = (0, _base.getCalculatedFirstDayOfWeek)(firstDayOfWeekOption);
const viewStart = (0, _base.getViewStartByOptions)(startDate, currentDate, intervalDuration, getValidStartDate(startDate, firstDayOfWeek));
const firstViewDate = _date2.default.getFirstWeekDate(viewStart, firstDayOfWeek);
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
};
exports.calculateViewStartDate = (startDateOption, firstDayOfWeek) => {
const validFirstDayOfWeek = firstDayOfWeek ?? _date.default.firstDayOfWeekIndex();
return _date2.default.getFirstWeekDate(startDateOption, validFirstDayOfWeek)
}
},
19442(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = void 0;
var _date = (e = __webpack_require__( /*! ../../../../core/utils/date */ 41380), e && e.__esModule ? e : {
default: e
});
var e;
var _base = __webpack_require__( /*! ./base */ 44611);
var _week = __webpack_require__( /*! ./week */ 3962);
exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalDuration, firstDayOfWeek) => {
const viewStart = (0, _base.getViewStartByOptions)(startDate, currentDate, intervalDuration, (0, _week.getValidStartDate)(startDate, firstDayOfWeek));
const firstViewDate = _date.default.getFirstWeekDate(viewStart, firstDayOfWeek);
if ((0, _base.isDataOnWeekend)(firstViewDate)) {
const currentDay = firstViewDate.getDay();
const distance = (8 - currentDay) % 7;
firstViewDate.setDate(firstViewDate.getDate() + distance)
}
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
}
},
57872(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parseRecurrenceRule = exports.getRecurrenceString = exports.getDateByAsciiString = exports.getAsciiStringByDate = void 0;
const getAsciiStringByDate = date => `${date.getUTCFullYear()+`0${date.getUTCMonth()+1}`.slice(-2)+`0${date.getUTCDate()}`.slice(-2)}T${`0${date.getUTCHours()}`.slice(-2)}${`0${date.getUTCMinutes()}`.slice(-2)}${`0${date.getUTCSeconds()}`.slice(-2)}Z`;
exports.getAsciiStringByDate = getAsciiStringByDate;
exports.getRecurrenceString = rule => {
if (!(null !== rule && void 0 !== rule && rule.freq)) {
return
}
const result = Object.entries(rule).reduce((acc, _ref) => {
let [field, value] = _ref;
if ("freq" === field || "interval" === field && value < 2) {
return acc
}
if ("until" === field) {
return `${acc}${field}=${getAsciiStringByDate(value)};`
}
return `${acc}${field}=${value};`
}, `freq=${rule.freq};`);
return result.substring(0, result.length - 1).toUpperCase()
};
const getDateByAsciiString = exceptionText => {
if ("string" !== typeof exceptionText) {
return exceptionText
}
const result = (value = exceptionText, /(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2}))?(Z)?/.exec(value));
var value;
if (!result) {
return null
}
const [year, month, date, hours, minutes, seconds, isUtc] = (parseResult => {
const isUtc = void 0 !== parseResult[8];
parseResult.shift();
if (void 0 === parseResult[3]) {
parseResult.splice(3)
} else {
parseResult.splice(3, 1);
parseResult.splice(6)
}
parseResult.unshift("");
return [parseInt(parseResult[1], 10), parseInt(parseResult[2], 10) - 1, parseInt(parseResult[3], 10), parseInt(parseResult[4], 10) || 0, parseInt(parseResult[5], 10) || 0, parseInt(parseResult[6], 10) || 0, isUtc]
})(result);
if (isUtc) {
return new Date(Date.UTC(year, month, date, hours, minutes, seconds))
}
return new Date(year, month, date, hours, minutes, seconds)
};
exports.getDateByAsciiString = getDateByAsciiString;
exports.parseRecurrenceRule = recurrenceRule => {
const emptyRule = {
interval: 1
};
if (!recurrenceRule) {
return emptyRule
}
const ruleParts = recurrenceRule.split(";");
const ruleObject = ruleParts.reduce((result, part) => {
const rule = part.split("=");
const ruleName = rule[0].toLowerCase();
const ruleValue = rule[1];
switch (ruleName) {
case "count":
case "interval": {
const value = parseInt(ruleValue, 10);
if (!isNaN(value)) {
result[ruleName] = value
}
break
}
default:
result[ruleName] = ruleValue
}
return result
}, emptyRule);
if (ruleObject.freq && ruleObject.until) {
ruleObject.until = getDateByAsciiString(ruleObject.until)
}
return ruleObject
}
},
2165(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.daysFromByDayRule = void 0;
const isString = str => Boolean(str);
exports.daysFromByDayRule = rule => {
let result = [];
if (rule.byday) {
if (Array.isArray(rule.byday)) {
result = rule.byday
} else {
result = rule.byday.split(",")
}
}
return result.map(item => {
const match = /[A-Za-z]+/.exec(item);
return match && String(match[0])
}).filter(isString)
}
},
25152(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validateRRuleObject = exports.validateRRule = void 0;
var _errors = (e = __webpack_require__( /*! ../../../core/errors */ 87129), e && e.__esModule ? e : {
default: e
});
var e;
var _m_iterator = __webpack_require__( /*! ../../core/utils/m_iterator */ 26044);
var _base = __webpack_require__( /*! ./base */ 57872);
var _days_from_by_day_rule = __webpack_require__( /*! ./days_from_by_day_rule */ 2165);
const loggedWarnings = [];
const ruleNames = ["freq", "interval", "byday", "byweekno", "byyearday", "bymonth", "bymonthday", "count", "until", "byhour", "byminute", "bysecond", "bysetpos", "wkst"];
const freqNames = ["DAILY", "WEEKLY", "MONTHLY", "YEARLY", "SECONDLY", "MINUTELY", "HOURLY"];
const days = {
SU: 0,
MO: 1,
TU: 2,
WE: 3,
TH: 4,
FR: 5,
SA: 6
};
const validateRRuleObject = (rule, recurrence) => {
if ((rule => {
let brokenRuleExists = false;
(0, _m_iterator.each)(rule, ruleName => {
if (!ruleNames.includes(ruleName)) {
brokenRuleExists = true;
return false
}
return
});
return brokenRuleExists
})(rule) || !rule.freq || !freqNames.includes(rule.freq) || (rule => {
const {
count: count
} = rule;
return Boolean(count && "string" === typeof count)
})(rule) || (rule => {
const {
interval: interval
} = rule;
return Boolean(interval && "string" === typeof interval)
})(rule) || (rule => {
const byDay = rule.byday;
const daysByRule = (0, _days_from_by_day_rule.daysFromByDayRule)(rule);
let brokenDaysExist = false;
if ("" === byDay) {
brokenDaysExist = true
}(0, _m_iterator.each)(daysByRule, (_, day) => {
if (!Object.prototype.hasOwnProperty.call(days, day)) {
brokenDaysExist = true;
return false
}
return
});
return brokenDaysExist
})(rule) || (rule => {
const byMonthDay = rule.bymonthday;
return Boolean(byMonthDay && isNaN(parseInt(byMonthDay, 10)))
})(rule) || (rule => {
const byMonth = rule.bymonth;
return Boolean(byMonth && isNaN(parseInt(byMonth, 10)))
})(rule) || (rule => {
const {
until: until
} = rule;
return void 0 !== until && !(until instanceof Date)
})(rule)) {
(recurrence => {
if (!loggedWarnings.includes(recurrence)) {
_errors.default.log("W0006", recurrence);
loggedWarnings.push(recurrence)
}
})(recurrence);
return false
}
return true
};
exports.validateRRuleObject = validateRRuleObject;
exports.validateRRule = ruleString => {
if (!ruleString) {
return false
}
const rule = (0, _base.parseRecurrenceRule)(ruleString);
const isValid = validateRRuleObject(rule, ruleString);
return isValid
}
},
13367(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SchedulerOptionsBaseWidget = void 0;
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.widget */ 11118));
var _m_extend = __webpack_require__( /*! ../core/utils/m_extend */ 96298);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ./m_utils_time_zone */ 18648));
var _constants = __webpack_require__( /*! ./utils/options/constants */ 46912);
var _utils = __webpack_require__( /*! ./utils/options/utils */ 41940);
var _index = __webpack_require__( /*! ./utils/options_validator/index */ 49240);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class SchedulerOptionsBaseWidget extends _ui.default {
constructor() {
super(...arguments);
this.views = []
}
_init() {
super._init();
this.optionsValidator = new _index.SchedulerOptionsValidator;
this.optionsValidatorErrorHandler = new _index.SchedulerOptionsValidatorErrorsHandler
}
_getDefaultOptions() {
const options = super._getDefaultOptions();
return (0, _m_extend.extend)(true, options, Object.assign({}, _constants.DEFAULT_SCHEDULER_OPTIONS, _constants.DEFAULT_SCHEDULER_INTERNAL_OPTIONS, _constants.DEFAULT_SCHEDULER_INTEGRATION_OPTIONS))
}
_defaultOptionsRules() {
const rules = super._defaultOptionsRules();
return rules.concat(_constants.DEFAULT_SCHEDULER_OPTIONS_RULES)
}
updateViews() {
const views = this.option("views") ?? [];
this.views = (0, _utils.getViews)(views);
this.currentView = (0, _utils.getCurrentView)(this.option("currentView") ?? "", views)
}
_initMarkup() {
super._initMarkup();
this.updateViews();
this.validateOptions()
}
schedulerOptionChanged(args) {
switch (args.name) {
case "currentView":
case "views":
this.updateViews()
}
this.validateOptions()
}
validateOptions() {
const currentViewOptions = Object.assign({}, this.option(), {
startDayHour: this.getViewOption("startDayHour"),
endDayHour: this.getViewOption("endDayHour"),
offset: this.getViewOption("offset"),
cellDuration: this.getViewOption("cellDuration")
});
const validationResult = this.optionsValidator.validate(currentViewOptions);
this.optionsValidatorErrorHandler.handleValidationResult(validationResult)
}
getTimeZone() {
return (this.option("timeZone") || _m_utils_time_zone.default.getMachineTimezoneName()) ?? "Etc/UTC"
}
getViewOption(optionName) {
var _this$currentView;
const viewOptionValue = null === (_this$currentView = this.currentView) || void 0 === _this$currentView ? void 0 : _this$currentView[optionName];
const optionValue = viewOptionValue ?? this.option(optionName);
return (0, _utils.getViewOption)(optionName, optionValue)
}
hasAgendaView() {
return this.views.some(view => "agenda" === view.type || "agenda" === view.name)
}
}
exports.SchedulerOptionsBaseWidget = SchedulerOptionsBaseWidget
},
51930(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = (e = __webpack_require__( /*! ../../../core/renderer */ 64553), e && e.__esModule ? e : {
default: e
});
var e;
exports.default = class {
constructor(workSpace) {
this.workSpace = workSpace;
this.$container = this.workSpace._dateTableScrollable.$content()
}
render() {
this.initShaderElements();
this.renderShader();
this.shader.forEach(shader => {
this.$container.append(shader)
})
}
initShaderElements() {
this.$shader = this.createShader();
this.shader = [];
this.shader.push(this.$shader)
}
renderShader() {}
createShader() {
return (0, _renderer.default)("").addClass("dx-scheduler-date-time-shader")
}
clean() {
if (this.$container) {
this.$container.find(".dx-scheduler-date-time-shader").remove()
}
}
}
},
35577(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _position = __webpack_require__( /*! ../../../core/utils/position */ 41639);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _current_time_shader = (e = __webpack_require__( /*! ./current_time_shader */ 51930), e && e.__esModule ? e : {
default: e
});
var e;
class HorizontalCurrentTimeShader extends _current_time_shader.default {
renderShader() {
const groupCount = this.workSpace._isHorizontalGroupedWorkSpace() ? this.workSpace._getGroupCount() : 1;
for (let i = 0; i < groupCount; i += 1) {
const isFirstShader = 0 === i;
const $shader = isFirstShader ? this.$shader : this.createShader();
if (this.workSpace.isGroupedByDate()) {
this.customizeGroupedByDateShader($shader, i)
} else {
this.customizeShader($shader, i)
}
if (!isFirstShader) {
this.shader.push($shader)
}
}
}
customizeShader($shader, groupIndex) {
const shaderWidth = this.workSpace.getIndicationWidth();
this.applyShaderWidth($shader, shaderWidth);
if (groupIndex >= 1) {
const {
workSpace: workSpace
} = this;
const indicationWidth = workSpace._getCellCount() * workSpace.getCellWidth();
$shader.css("left", indicationWidth)
} else {
$shader.css("left", 0)
}
}
applyShaderWidth($shader, width) {
const maxWidth = (0, _position.getBoundingRect)(this.$container.get(0)).width;
if (width > 0) {
(0, _size.setWidth)($shader, Math.min(width, maxWidth))
}
}
customizeGroupedByDateShader($shader, groupIndex) {
const cellCount = this.workSpace.getIndicationCellCount();
const integerPart = Math.floor(cellCount);
const fractionPart = cellCount - integerPart;
const isFirstShaderPart = 0 === groupIndex;
const {
workSpace: workSpace
} = this;
const shaderWidth = isFirstShaderPart ? workSpace.getIndicationWidth() : fractionPart * workSpace.getCellWidth();
let shaderLeft = 0;
this.applyShaderWidth($shader, shaderWidth);
if (isFirstShaderPart) {
shaderLeft = workSpace._getCellCount() * workSpace.getCellWidth() * groupIndex
} else {
shaderLeft = workSpace.getCellWidth() * integerPart * workSpace._getGroupCount() + groupIndex * workSpace.getCellWidth()
}
$shader.css("left", shaderLeft)
}
}
exports.default = HorizontalCurrentTimeShader
},
25167(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _current_time_shader = _interopRequireDefault(__webpack_require__( /*! ./current_time_shader */ 51930));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class VerticalCurrentTimeShader extends _current_time_shader.default {
renderShader() {
let shaderHeight = this.getShaderHeight();
const maxHeight = this.getShaderMaxHeight();
const isSolidShader = shaderHeight > maxHeight;
if (shaderHeight > maxHeight) {
shaderHeight = maxHeight
}(0, _size.setHeight)(this.$shader, shaderHeight);
const groupCount = this.workSpace._getGroupCount() || 1;
if (this.workSpace.isGroupedByDate()) {
this.renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader)
} else {
this.renderShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader)
}
}
renderShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader) {
for (let i = 0; i < groupCount; i += 1) {
const shaderWidth = this.getShaderWidth();
this.renderTopShader(this.$shader, shaderHeight, shaderWidth, i);
if (!isSolidShader) {
this.renderBottomShader(this.$shader, maxHeight, shaderHeight, shaderWidth, i)
}
this.renderAllDayShader(shaderWidth, i)
}
}
renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader) {
const shaderWidth = this.getShaderWidth();
const bottomShaderWidth = shaderHeight < 0 ? shaderWidth : shaderWidth - this.workSpace.getCellWidth();
const normalizedShaderHeight = Math.max(shaderHeight, 0);
this.renderTopShader(this.$shader, normalizedShaderHeight, shaderWidth * groupCount, 0);
if (!isSolidShader) {
this.renderBottomShader(this.$shader, maxHeight, normalizedShaderHeight, bottomShaderWidth * groupCount + this.workSpace.getCellWidth(), 0)
}
this.renderAllDayShader(shaderWidth * groupCount, 0)
}
renderTopShader($shader, height, width, i) {
this.$topShader = (0, _renderer.default)(" ").addClass("dx-scheduler-date-time-shader-top");
if (width) {
(0, _size.setWidth)(this.$topShader, width)
}
if (height) {
(0, _size.setHeight)(this.$topShader, height)
}
this.$topShader.css("marginTop", this.getShaderTopOffset(i));
this.$topShader.css("left", this.getShaderOffset(i, width));
$shader.append(this.$topShader)
}
renderBottomShader($shader, maxHeight, height, width, i) {
this.$bottomShader = (0, _renderer.default)(" ").addClass("dx-scheduler-date-time-shader-bottom");
const shaderWidth = height < 0 ? width : width - this.workSpace.getCellWidth();
const shaderHeight = height < 0 ? maxHeight : maxHeight - height;
(0, _size.setWidth)(this.$bottomShader, shaderWidth);
(0, _size.setHeight)(this.$bottomShader, shaderHeight);
this.$bottomShader.css("left", this.getShaderOffset(i, width - this.workSpace.getCellWidth()));
$shader.append(this.$bottomShader)
}
renderAllDayShader(shaderWidth, i) {
if (this.workSpace.option("showAllDayPanel")) {
this.$allDayIndicator = (0, _renderer.default)(" ").addClass("dx-scheduler-date-time-shader-all-day");
(0, _size.setHeight)(this.$allDayIndicator, this.workSpace.getAllDayHeight());
(0, _size.setWidth)(this.$allDayIndicator, shaderWidth);
this.$allDayIndicator.css("left", this.getShaderOffset(i, shaderWidth));
this.workSpace._$allDayPanel.prepend(this.$allDayIndicator)
}
}
getShaderOffset(i, width) {
return this.workSpace.getGroupedStrategy().getShaderOffset(i, width)
}
getShaderTopOffset(i) {
return this.workSpace.getGroupedStrategy().getShaderTopOffset(i)
}
getShaderHeight() {
return this.workSpace.getGroupedStrategy().getShaderHeight()
}
getShaderMaxHeight() {
return this.workSpace.getGroupedStrategy().getShaderMaxHeight()
}
getShaderWidth() {
return this.workSpace.getGroupedStrategy().getShaderWidth()
}
clean() {
var _this$workSpace;
super.clean();
if (null !== (_this$workSpace = this.workSpace) && void 0 !== _this$workSpace && _this$workSpace._$allDayPanel) {
this.workSpace._$allDayPanel.find(".dx-scheduler-date-time-shader-all-day").remove()
}
}
}
exports.default = VerticalCurrentTimeShader
},
95053(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.default = {
value: ["Etc/GMT+12", "Etc/GMT+11", "Pacific/Midway", "Pacific/Niue", "Pacific/Pago_Pago", "Pacific/Samoa", "US/Samoa", "Etc/GMT+10", "HST", "Pacific/Honolulu", "Pacific/Johnston", "Pacific/Rarotonga", "Pacific/Tahiti", "US/Hawaii", "Pacific/Marquesas", "America/Adak", "America/Atka", "Etc/GMT+9", "Pacific/Gambier", "US/Aleutian", "America/Anchorage", "America/Juneau", "America/Metlakatla", "America/Nome", "America/Sitka", "America/Yakutat", "Etc/GMT+8", "Pacific/Pitcairn", "US/Alaska", "America/Creston", "America/Dawson_Creek", "America/Dawson", "America/Ensenada", "America/Fort_Nelson", "America/Hermosillo", "America/Los_Angeles", "America/Phoenix", "America/Santa_Isabel", "America/Tijuana", "America/Vancouver", "America/Whitehorse", "Canada/Pacific", "Canada/Yukon", "Etc/GMT+7", "Mexico/BajaNorte", "MST", "PST8PDT", "US/Arizona", "US/Pacific", "America/Belize", "America/Boise", "America/Cambridge_Bay", "America/Chihuahua", "America/Costa_Rica", "America/Denver", "America/Edmonton", "America/El_Salvador", "America/Guatemala", "America/Inuvik", "America/Managua", "America/Mazatlan", "America/Monterrey", "America/Ojinaga", "America/Regina", "America/Shiprock", "America/Swift_Current", "America/Tegucigalpa", "America/Yellowknife", "Canada/Mountain", "Canada/Saskatchewan", "Chile/EasterIsland", "Etc/GMT+6", "Mexico/BajaSur", "MST7MDT", "Navajo", "Pacific/Easter", "Pacific/Galapagos", "US/Mountain", "America/Atikokan", "America/Bahia_Banderas", "America/Bogota", "America/Cancun", "America/Cayman", "America/Chicago", "America/Coral_Harbour", "America/Eirunepe", "America/Guayaquil", "America/Indiana/Knox", "America/Indiana/Tell_City", "America/Jamaica", "America/Knox_IN", "America/Lima", "America/Matamoros", "America/Menominee", "America/Merida", "America/Mexico_City", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Panama", "America/Porto_Acre", "America/Rainy_River", "America/Rankin_Inlet", "America/Resolute", "America/Rio_Branco", "America/Winnipeg", "Brazil/Acre", "Canada/Central", "CST6CDT", "EST", "Etc/GMT+5", "Jamaica", "Mexico/General", "US/Central", "US/Indiana-Starke", "America/Anguilla", "America/Antigua", "America/Aruba", "America/Asuncion", "America/Barbados", "America/Blanc-Sablon", "America/Boa_Vista", "America/Campo_Grande", "America/Caracas", "America/Cuiaba", "America/Curacao", "America/Detroit", "America/Dominica", "America/Fort_Wayne", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guyana", "America/Havana", "America/Indiana/Indianapolis", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Indianapolis", "America/Iqaluit", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Louisville", "America/Lower_Princes", "America/Manaus", "America/Marigot", "America/Martinique", "America/Montreal", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Pangnirtung", "America/Port_of_Spain", "America/Port-au-Prince", "America/Porto_Velho", "America/Puerto_Rico", "America/Santiago", "America/Santo_Domingo", "America/St_Barthelemy", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Thunder_Bay", "America/Toronto", "America/Tortola", "America/Virgin", "Brazil/West", "Canada/Eastern", "Chile/Continental", "Cuba", "EST5EDT", "Etc/GMT+4", "US/East-Indiana", "US/Eastern", "US/Michigan", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/ComodRivadavia", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Bahia", "America/Belem", "America/Buenos_Aires", "America/Catamarca", "America/Cayenne", "America/Cordoba", "America/Fortaleza", "America/Glace_Bay", "America/Goose_Bay", "America/Halifax", "America/Jujuy", "America/Maceio", "America/Mendoza", "America/Moncton", "America/Montevideo", "America/Paramaribo", "America/Punta_Arenas", "America/Recife", "America/Rosario", "America/Santarem", "America/Sao_Paulo", "America/Thule", "Antarctica/Palmer", "Antarctica/Rothera", "Atlantic/Bermuda", "Atlantic/Stanley", "Brazil/East", "Canada/Atlantic", "Etc/GMT+3", "America/St_Johns", "Canada/Newfoundland", "America/Godthab", "America/Miquelon", "America/Noronha", "America/Nuuk", "Atlantic/South_Georgia", "Brazil/DeNoronha", "Etc/GMT+2", "Atlantic/Cape_Verde", "Etc/GMT+1", "Africa/Abidjan", "Africa/Accra", "Africa/Bamako", "Africa/Banjul", "Africa/Bissau", "Africa/Conakry", "Africa/Dakar", "Africa/Freetown", "Africa/Lome", "Africa/Monrovia", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Sao_Tome", "Africa/Timbuktu", "America/Danmarkshavn", "America/Scoresbysund", "Atlantic/Azores", "Atlantic/Reykjavik", "Atlantic/St_Helena", "Etc/GMT-0", "Etc/GMT", "Etc/GMT+0", "Etc/GMT0", "Etc/Greenwich", "Etc/UCT", "Etc/Universal", "Etc/UTC", "Etc/Zulu", "GMT-0", "GMT", "GMT+0", "GMT0", "Greenwich", "Iceland", "UCT", "Universal", "UTC", "Zulu", "Africa/Algiers", "Africa/Bangui", "Africa/Brazzaville", "Africa/Casablanca", "Africa/Douala", "Africa/El_Aaiun", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Luanda", "Africa/Malabo", "Africa/Ndjamena", "Africa/Niamey", "Africa/Porto-Novo", "Africa/Tunis", "Atlantic/Canary", "Atlantic/Faeroe", "Atlantic/Faroe", "Atlantic/Madeira", "Eire", "Etc/GMT-1", "Europe/Belfast", "Europe/Dublin", "Europe/Guernsey", "Europe/Isle_of_Man", "Europe/Jersey", "Europe/Lisbon", "Europe/London", "GB-Eire", "GB", "Portugal", "WET", "Africa/Blantyre", "Africa/Bujumbura", "Africa/Cairo", "Africa/Ceuta", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Khartoum", "Africa/Kigali", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Tripoli", "Africa/Windhoek", "Antarctica/Troll", "Arctic/Longyearbyen", "Atlantic/Jan_Mayen", "CET", "Egypt", "Etc/GMT-2", "Europe/Amsterdam", "Europe/Andorra", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Budapest", "Europe/Busingen", "Europe/Copenhagen", "Europe/Gibraltar", "Europe/Kaliningrad", "Europe/Ljubljana", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Monaco", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Rome", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Skopje", "Europe/Stockholm", "Europe/Tirane", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zurich", "Libya", "MET", "Poland", "Africa/Addis_Ababa", "Africa/Asmara", "Africa/Asmera", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Juba", "Africa/Kampala", "Africa/Mogadishu", "Africa/Nairobi", "Antarctica/Syowa", "Asia/Aden", "Asia/Amman", "Asia/Baghdad", "Asia/Bahrain", "Asia/Beirut", "Asia/Damascus", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Istanbul", "Asia/Jerusalem", "Asia/Kuwait", "Asia/Nicosia", "Asia/Qatar", "Asia/Riyadh", "Asia/Tel_Aviv", "EET", "Etc/GMT-3", "Europe/Athens", "Europe/Bucharest", "Europe/Chisinau", "Europe/Helsinki", "Europe/Istanbul", "Europe/Kiev", "Europe/Kirov", "Europe/Mariehamn", "Europe/Minsk", "Europe/Moscow", "Europe/Nicosia", "Europe/Riga", "Europe/Simferopol", "Europe/Sofia", "Europe/Tallinn", "Europe/Tiraspol", "Europe/Uzhgorod", "Europe/Vilnius", "Europe/Zaporozhye", "Indian/Antananarivo", "Indian/Comoro", "Indian/Mayotte", "Israel", "Turkey", "W-SU", "Asia/Baku", "Asia/Dubai", "Asia/Muscat", "Asia/Tbilisi", "Asia/Yerevan", "Etc/GMT-4", "Europe/Astrakhan", "Europe/Samara", "Europe/Saratov", "Europe/Ulyanovsk", "Europe/Volgograd", "Indian/Mahe", "Indian/Mauritius", "Indian/Reunion", "Asia/Kabul", "Asia/Tehran", "Iran", "Antarctica/Mawson", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Ashkhabad", "Asia/Atyrau", "Asia/Dushanbe", "Asia/Karachi", "Asia/Oral", "Asia/Qyzylorda", "Asia/Samarkand", "Asia/Tashkent", "Asia/Yekaterinburg", "Etc/GMT-5", "Indian/Kerguelen", "Indian/Maldives", "Asia/Calcutta", "Asia/Colombo", "Asia/Kolkata", "Asia/Kathmandu", "Asia/Katmandu", "Antarctica/Vostok", "Asia/Almaty", "Asia/Bishkek", "Asia/Dacca", "Asia/Dhaka", "Asia/Kashgar", "Asia/Omsk", "Asia/Qostanay", "Asia/Thimbu", "Asia/Thimphu", "Asia/Urumqi", "Etc/GMT-6", "Indian/Chagos", "Asia/Rangoon", "Asia/Yangon", "Indian/Cocos", "Antarctica/Davis", "Asia/Bangkok", "Asia/Barnaul", "Asia/Ho_Chi_Minh", "Asia/Hovd", "Asia/Jakarta", "Asia/Krasnoyarsk", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Saigon", "Asia/Tomsk", "Asia/Vientiane", "Etc/GMT-7", "Indian/Christmas", "Antarctica/Casey", "Asia/Brunei", "Asia/Choibalsan", "Asia/Chongqing", "Asia/Chungking", "Asia/Harbin", "Asia/Hong_Kong", "Asia/Irkutsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Macao", "Asia/Macau", "Asia/Makassar", "Asia/Manila", "Asia/Shanghai", "Asia/Singapore", "Asia/Taipei", "Asia/Ujung_Pandang", "Asia/Ulaanbaatar", "Asia/Ulan_Bator", "Australia/Perth", "Australia/West", "Etc/GMT-8", "Hongkong", "PRC", "ROC", "Singapore", "Australia/Eucla", "Asia/Chita", "Asia/Dili", "Asia/Jayapura", "Asia/Khandyga", "Asia/Pyongyang", "Asia/Seoul", "Asia/Tokyo", "Asia/Yakutsk", "Etc/GMT-9", "Japan", "Pacific/Palau", "ROK", "Australia/Adelaide", "Australia/Broken_Hill", "Australia/Darwin", "Australia/North", "Australia/South", "Australia/Yancowinna", "Antarctica/DumontDUrville", "Asia/Ust-Nera", "Asia/Vladivostok", "Australia/ACT", "Australia/Brisbane", "Australia/Canberra", "Australia/Currie", "Australia/Hobart", "Australia/Lindeman", "Australia/Melbourne", "Australia/NSW", "Australia/Queensland", "Australia/Sydney", "Australia/Tasmania", "Australia/Victoria", "Etc/GMT-10", "Pacific/Chuuk", "Pacific/Guam", "Pacific/Port_Moresby", "Pacific/Saipan", "Pacific/Truk", "Pacific/Yap", "Australia/LHI", "Australia/Lord_Howe", "Antarctica/Macquarie", "Asia/Magadan", "Asia/Sakhalin", "Asia/Srednekolymsk", "Etc/GMT-11", "Pacific/Bougainville", "Pacific/Efate", "Pacific/Guadalcanal", "Pacific/Kosrae", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pohnpei", "Pacific/Ponape", "Antarctica/McMurdo", "Antarctica/South_Pole", "Asia/Anadyr", "Asia/Kamchatka", "Etc/GMT-12", "Kwajalein", "NZ", "Pacific/Auckland", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Nauru", "Pacific/Tarawa", "Pacific/Wake", "Pacific/Wallis", "NZ-CHAT", "Pacific/Chatham", "Etc/GMT-13", "Pacific/Apia", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Tongatapu", "Etc/GMT-14", "Pacific/Kiritimati"]
}
},
93048(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DesktopTooltipStrategy = void 0;
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _m_support = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/m_support */ 85991));
var _m_tooltip = _interopRequireDefault(__webpack_require__( /*! ../../ui/m_tooltip */ 3504));
var _m_tooltip_strategy_base = __webpack_require__( /*! ./m_tooltip_strategy_base */ 32789);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class DesktopTooltipStrategy extends _m_tooltip_strategy_base.TooltipStrategyBase {
prepareBeforeVisibleChanged(dataList) {
this.tooltip.option("position", {
my: "bottom",
at: "top",
boundary: this.getBoundary(dataList),
offset: this.extraOptions.offset,
collision: "fit flipfit"
})
}
getBoundary(dataList) {
return this._options.isAppointmentInAllDayPanel(dataList[0].appointment) ? this._options.container : this._options.getScrollableContainer()
}
onShown() {
super.onShown();
if (this.extraOptions.isButtonClick) {
this.list.focus();
this.list.option("focusedElement", null)
}
}
createListOption(target, dataList) {
const result = super.createListOption(target, dataList);
result.showScrollbar = _m_support.default.touch ? "always" : "onHover";
return result
}
createTooltip(target, dataList) {
const tooltipElement = this.createTooltipElement("dx-scheduler-appointment-tooltip-wrapper");
const tooltip = this._options.createComponent(tooltipElement, _m_tooltip.default, {
target: target,
maxHeight: 200,
rtlEnabled: this.extraOptions.rtlEnabled,
onShown: this.onShown.bind(this),
contentTemplate: this.getContentTemplate(dataList),
wrapperAttr: {
class: "dx-scheduler-appointment-tooltip-wrapper"
},
_loopFocus: this.extraOptions._loopFocus
});
tooltip.setAria({
role: "dialog",
label: _message.default.format("dxScheduler-appointmentListAriaLabel")
});
return tooltip
}
onListRender(e) {
return this.extraOptions.dragBehavior && this.extraOptions.dragBehavior(e)
}
onListItemContextMenu(e) {
const contextMenuEventArgs = this._options.createEventArgs(e);
this._options.onItemContextMenu(contextMenuEventArgs)
}
}
exports.DesktopTooltipStrategy = DesktopTooltipStrategy
},
96588(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MobileTooltipStrategy = void 0;
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 3104);
var _ui = (e = __webpack_require__( /*! ../../../ui/overlay/ui.overlay */ 89132), e && e.__esModule ? e : {
default: e
});
var e;
var _m_tooltip_strategy_base = __webpack_require__( /*! ./m_tooltip_strategy_base */ 32789);
const CLASS_slidePanel = "dx-scheduler-overlay-panel",
CLASS_scrollableContent = ".dx-scrollable-content";
const MAX_HEIGHT_PHONE = 250,
MAX_HEIGHT_TABLET = "90%",
MAX_HEIGHT_DEFAULT = "auto";
const MAX_WIDTH_PHONE = "100%",
MAX_WIDTH_TABLET = "80%";
const animationConfig = {
show: {
type: "slide",
duration: 300,
from: {
position: {
my: "top",
at: "bottom",
of: (0, _window.getWindow)()
}
},
to: {
position: {
my: "center",
at: "center",
of: (0, _window.getWindow)()
}
}
},
hide: {
type: "slide",
duration: 300,
to: {
position: {
my: "top",
at: "bottom",
of: (0, _window.getWindow)()
}
},
from: {
position: {
my: "center",
at: "center",
of: (0, _window.getWindow)()
}
}
}
};
class MobileTooltipStrategy extends _m_tooltip_strategy_base.TooltipStrategyBase {
shouldUseTarget() {
return false
}
setTooltipConfig() {
const isTabletWidth = (0, _size.getWidth)((0, _window.getWindow)()) > 700;
const listHeight = (0, _size.getOuterHeight)(this.list.$element().find(CLASS_scrollableContent));
this.tooltip.option(isTabletWidth ? (listHeight => {
const currentMaxHeight = .9 * (0, _size.getHeight)((0, _window.getWindow)());
return {
shading: true,
width: MAX_WIDTH_TABLET,
height: listHeight > currentMaxHeight ? MAX_HEIGHT_TABLET : MAX_HEIGHT_DEFAULT,
position: {
my: "center",
at: "center",
of: (0, _window.getWindow)()
}
}
})(listHeight) : (listHeight => ({
shading: false,
width: MAX_WIDTH_PHONE,
height: listHeight > MAX_HEIGHT_PHONE ? MAX_HEIGHT_PHONE : MAX_HEIGHT_DEFAULT,
position: {
my: "bottom",
at: "bottom",
of: (0, _window.getWindow)()
}
}))(listHeight))
}
async onShowing() {
this.tooltip.option("height", MAX_HEIGHT_DEFAULT);
this.setTooltipConfig();
await Promise.all([...this.asyncTemplatePromises]);
this.setTooltipConfig()
}
createTooltip(target, dataList) {
const element = this.createTooltipElement(CLASS_slidePanel);
return this._options.createComponent(element, _ui.default, {
target: (0, _window.getWindow)(),
hideOnOutsideClick: true,
animation: animationConfig,
onShowing: () => this.onShowing(),
onShown: this.onShown.bind(this),
contentTemplate: this.getContentTemplate(dataList),
wrapperAttr: {
class: CLASS_slidePanel
}
})
}
}
exports.MobileTooltipStrategy = MobileTooltipStrategy
},
32789(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TooltipStrategyBase = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _function_template = __webpack_require__( /*! ../../../core/templates/function_template */ 38699);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 64973));
var _promise = __webpack_require__( /*! ../../core/utils/promise */ 51413);
var _list = _interopRequireDefault(__webpack_require__( /*! ../../ui/list/list.edit */ 71442));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
exports.TooltipStrategyBase = class {
constructor(options) {
this.asyncTemplatePromises = new Set;
this.tooltip = null;
this._options = options;
this.extraOptions = null
}
show(target, dataList, extraOptions) {
if (this.canShowTooltip(dataList)) {
this.hide();
this.extraOptions = extraOptions;
this.showCore(target, dataList)
}
}
showCore(target, dataList) {
const describedByValue = (0, _type.isRenderer)(target) && target.attr("aria-describedby");
if (!this.tooltip) {
this.tooltip = this.createTooltip(target, dataList)
} else {
this.shouldUseTarget() && this.tooltip.option("target", target);
this.list.option("dataSource", dataList)
}
this.prepareBeforeVisibleChanged(dataList);
this.tooltip.option("visible", true);
describedByValue && target.attr("aria-describedby", describedByValue)
}
prepareBeforeVisibleChanged(dataList) {}
isDeletingAllowed(appointment) {
const {
editing: editing
} = this.extraOptions;
const disabled = this._options.getAppointmentDisabled(appointment);
const isDeletingAllowed = true === editing || true === (null === editing || void 0 === editing ? void 0 : editing.allowDeleting);
return !disabled && isDeletingAllowed
}
getContentTemplate(dataList) {
return container => {
var _this$list$registerKe, _this$list, _this$list$registerKe2, _this$list2;
const listElement = (0, _renderer.default)(" ");
(0, _renderer.default)(container).append(listElement);
this.list = this.createList(listElement, dataList);
null === (_this$list$registerKe = (_this$list = this.list).registerKeyHandler) || void 0 === _this$list$registerKe || _this$list$registerKe.call(_this$list, "escape", () => {
this.hide();
this.tooltip.option("target").focus()
});
null === (_this$list$registerKe2 = (_this$list2 = this.list).registerKeyHandler) || void 0 === _this$list$registerKe2 || _this$list$registerKe2.call(_this$list2, "del", () => {
const {
focusedElement: focusedElement
} = this.list.option();
if (!focusedElement) {
return
}
const {
appointment: appointment,
targetedAppointment: targetedAppointment
} = this.list._getItemData(focusedElement);
if (!appointment) {
return
}
if (this.isDeletingAllowed(appointment)) {
this.hide();
this._options.checkAndDeleteAppointment(appointment, targetedAppointment)
}
})
}
}
isAlreadyShown(target) {
if (this.tooltip && this.tooltip.option("visible")) {
return this.tooltip.option("target")[0] === target[0]
}
return
}
onShown() {
this.list.option("focusStateEnabled", this.extraOptions.focusStateEnabled)
}
dispose() {}
hide() {
if (this.tooltip) {
this.tooltip.option("visible", false)
}
}
shouldUseTarget() {
return true
}
createTooltip(target, dataList) {}
canShowTooltip(dataList) {
if (!dataList.length) {
return false
}
return true
}
createListOption(dataList) {
return {
dataSource: dataList,
onContentReady: this.onListRender.bind(this),
onItemClick: e => this.onListItemClick(e),
onItemContextMenu: this.onListItemContextMenu.bind(this),
itemTemplate: (item, index) => this.renderTemplate(item.appointment, item.targetedAppointment, index, item.color),
_swipeEnabled: false,
pageLoadMode: "scrollBottom"
}
}
onListRender(e) {}
createTooltipElement(wrapperClass) {
return (0, _renderer.default)(" ").appendTo(this._options.container).addClass(wrapperClass)
}
createList(listElement, dataList) {
return this._options.createComponent(listElement, _list.default, this.createListOption(dataList))
}
renderTemplate(appointment, targetedAppointment, index, color) {
const itemListContent = this.createItemListContent(appointment, targetedAppointment, color);
this._options.addDefaultTemplates({
appointmentTooltip: new _function_template.FunctionTemplate(options => {
const $container = (0, _renderer.default)(options.container);
$container.append(itemListContent);
return $container
})
});
const template = this._options.getAppointmentTemplate("appointmentTooltipTemplate");
return this.createFunctionTemplate(template, appointment, targetedAppointment, index)
}
createFunctionTemplate(template, appointmentData, targetedAppointmentData, index) {
const isButtonClicked = Boolean(this.extraOptions.isButtonClick);
return new _function_template.FunctionTemplate(options => {
const {
promise: promise,
resolve: resolve
} = (0, _promise.createPromise)();
this.asyncTemplatePromises.add(promise);
return template.render({
model: {
appointmentData: appointmentData,
targetedAppointmentData: targetedAppointmentData,
isButtonClicked: isButtonClicked
},
container: options.container,
index: index,
onRendered: () => {
this.asyncTemplatePromises.delete(promise);
resolve()
}
})
})
}
onListItemClick(e) {
this.hide();
this.extraOptions.clickEvent && this.extraOptions.clickEvent(e);
this._options.showAppointmentPopup(e.itemData.appointment, false, e.itemData.targetedAppointment)
}
onListItemContextMenu(e) {}
createItemListContent(appointment, targetedAppointment, color) {
const $itemElement = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item");
$itemElement.append(this.createItemListMarker(color));
$itemElement.append(this.createItemListInfo(this._options.createFormattedDateText(appointment, targetedAppointment)));
if (this.isDeletingAllowed(appointment)) {
$itemElement.append(this.createDeleteButton(appointment, targetedAppointment))
}
return $itemElement
}
createItemListMarker(color) {
const $marker = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item-marker");
const $markerBody = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item-marker-body");
$marker.append($markerBody);
color.then(value => {
if (value) {
$markerBody.css("background", value)
}
});
return $marker
}
createItemListInfo(object) {
const result = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item-content");
const $title = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item-content-subject").text(object.text);
const $date = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item-content-date").text(object.formatDate);
return result.append($title).append($date)
}
createDeleteButton(appointment, targetedAppointment) {
const $container = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item-delete-button-container");
const $deleteButton = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item-delete-button");
$container.append($deleteButton);
this._options.createComponent($deleteButton, _button.default, {
icon: "trash",
stylingMode: "text",
onClick: e => {
this.hide();
e.event.stopPropagation();
this._options.checkAndDeleteAppointment(appointment, targetedAppointment)
}
});
return $container
}
}
},
36791(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentAdapter = void 0;
var _m_object = __webpack_require__( /*! ../../../core/utils/m_object */ 86005);
class AppointmentAdapter {
constructor(source, dataAccessors) {
this.source = source;
this.dataAccessors = dataAccessors
}
get startDate() {
return this.dataAccessors.get("startDate", this.source)
}
set startDate(value) {
this.dataAccessors.set("startDate", this.source, value)
}
get endDate() {
return this.dataAccessors.get("endDate", this.source)
}
set endDate(value) {
this.dataAccessors.set("endDate", this.source, value)
}
get allDay() {
return this.dataAccessors.get("allDay", this.source)
}
set allDay(value) {
this.dataAccessors.set("allDay", this.source, value)
}
get text() {
return this.dataAccessors.get("text", this.source) ?? ""
}
set text(value) {
this.dataAccessors.set("text", this.source, value)
}
get description() {
return this.dataAccessors.get("description", this.source) ?? ""
}
set description(value) {
this.dataAccessors.set("description", this.source, value)
}
get startDateTimeZone() {
return this.dataAccessors.get("startDateTimeZone", this.source)
}
get endDateTimeZone() {
return this.dataAccessors.get("endDateTimeZone", this.source)
}
get recurrenceRule() {
return this.dataAccessors.get("recurrenceRule", this.source)
}
set recurrenceRule(value) {
this.dataAccessors.set("recurrenceRule", this.source, value)
}
get recurrenceException() {
return this.dataAccessors.get("recurrenceException", this.source)
}
set recurrenceException(value) {
this.dataAccessors.set("recurrenceException", this.source, value)
}
get disabled() {
return this.dataAccessors.get("disabled", this.source)
}
get duration() {
const {
startDate: startDate,
endDate: endDate
} = this;
return endDate && startDate ? endDate.getTime() - startDate.getTime() : 0
}
get isRecurrent() {
return this.dataAccessors.isRecurrent(this.source)
}
clone() {
return new AppointmentAdapter((0, _m_object.deepExtendArraySafe)({}, this.source, false, false, false, true), this.dataAccessors)
}
serialize() {
this.dataAccessors.set("startDate", this.source, this.dataAccessors.get("startDate", this.source));
this.dataAccessors.set("endDate", this.source, this.dataAccessors.get("endDate", this.source));
return this
}
getCalculatedDates(timeZoneCalculator, path) {
return {
startDate: timeZoneCalculator.createDate(this.startDate, path, this.startDateTimeZone),
endDate: timeZoneCalculator.createDate(this.endDate, path, this.endDateTimeZone)
}
}
calculateDates(timeZoneCalculator, path) {
const {
startDate: startDate,
endDate: endDate
} = this.getCalculatedDates(timeZoneCalculator, path);
if (this.startDate) {
this.startDate = startDate
}
if (this.endDate) {
this.endDate = endDate
}
return this
}
}
exports.AppointmentAdapter = AppointmentAdapter
},
94077(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentDataAccessor = void 0;
var _data = __webpack_require__( /*! ../../../../core/utils/data */ 31e3);
var _date_serialization = (e = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 71051), e && e.__esModule ? e : {
default: e
});
var e;
var _validate_rule = __webpack_require__( /*! ../../recurrence/validate_rule */ 25152);
var _data_accessor = __webpack_require__( /*! ./data_accessor */ 83811);
class AppointmentDataAccessor extends _data_accessor.DataAccessor {
constructor(fields) {
let forceIsoDateParsing = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true;
let dateSerializationFormat = arguments.length > 2 ? arguments[2] : void 0;
super();
this.forceIsoDateParsing = forceIsoDateParsing;
this.dateSerializationFormat = dateSerializationFormat;
this.expr = Object.assign({}, fields);
this.updateExpressions(fields)
}
getCommonAccessExpressions(expr) {
return {
getter: (0, _data.compileGetter)(expr),
setter: (0, _data.compileSetter)(expr)
}
}
getDateFieldAccessExpressions(expr) {
const {
getter: commonGetter,
setter: commonSetter
} = this.getCommonAccessExpressions(expr);
let serializationFormatCache;
return {
getter: object => {
const date = this.forceIsoDateParsing ? _date_serialization.default.deserializeDate(commonGetter(object)) : commonGetter(object);
return void 0 === date ? date : new Date(date)
},
setter: (object, value) => {
if (this.dateSerializationFormat) {
serializationFormatCache = this.dateSerializationFormat
} else if (this.forceIsoDateParsing && !serializationFormatCache) {
const oldValue = commonGetter(object);
serializationFormatCache = _date_serialization.default.getDateSerializationFormat(oldValue)
}
const newValue = _date_serialization.default.serializeDate(value, serializationFormatCache);
commonSetter(object, newValue)
}
}
}
getBooleanFieldAccessExpressions(expr) {
const {
getter: commonGetter,
setter: setter
} = this.getCommonAccessExpressions(expr);
return {
getter: object => Boolean(commonGetter(object)),
setter: setter
}
}
getAccessExpressions(name, expr) {
switch (true) {
case field = name, "allDay" === field || "disabled" === field:
return this.getBooleanFieldAccessExpressions(expr);
case (field => "startDate" === field || "endDate" === field)(name):
return this.getDateFieldAccessExpressions(expr);
default:
return this.getCommonAccessExpressions(expr)
}
var field
}
updateExpression(field, expr) {
const name = field.replace("Expr", "");
if (!expr) {
delete this.getter[name];
delete this.setter[name];
delete this.expr[field];
return
}
const {
getter: getter,
setter: setter
} = this.getAccessExpressions(name, expr);
this.getter[name] = getter;
this.setter[name] = setter;
this.expr[field] = expr
}
isRecurrent(appointment) {
const recurrenceRule = this.get("recurrenceRule", appointment);
const isRecurrent = (0, _validate_rule.validateRRule)(recurrenceRule);
return isRecurrent
}
}
exports.AppointmentDataAccessor = AppointmentDataAccessor
},
5450(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getResourceIndex = exports.getAppointmentResourceAccessor = void 0;
var _data = __webpack_require__( /*! ../../../../core/utils/data */ 31e3);
var _m_array = __webpack_require__( /*! ../../../core/utils/m_array */ 28601);
const getResourceIndex = config => config.fieldExpr ?? config.field ?? "";
exports.getResourceIndex = getResourceIndex;
exports.getAppointmentResourceAccessor = config => {
const indexExpr = getResourceIndex(config);
const getter = (0, _data.compileGetter)(indexExpr);
const setter = (0, _data.compileSetter)(indexExpr);
return {
idsGetter: item => (0, _m_array.wrapToArray)(getter(item) ?? []),
idsSetter: (item, ids) => setter(item, ids)
}
}
},
83811(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DataAccessor = void 0;
var _m_type = __webpack_require__( /*! ../../../core/utils/m_type */ 39918);
exports.DataAccessor = class {
constructor() {
this.getter = {};
this.setter = {}
}
updateExpressions(fields) {
Object.entries(fields).forEach(_ref => {
let [key, value] = _ref;
return this.updateExpression(key, value)
})
}
get(field, obj) {
if (this.getter[field]) {
return this.getter[field](obj)
}
return
}
set(field, obj, value) {
if (this.setter[field]) {
this.setter[field](obj, value)
}
return this
}
has(field) {
return (0, _m_type.isDefined)(this.getter[field])
}
}
},
72044(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ResourceDataAccessor = void 0;
var _data = __webpack_require__( /*! ../../../../core/utils/data */ 31e3);
var _data_accessor = __webpack_require__( /*! ./data_accessor */ 83811);
class ResourceDataAccessor extends _data_accessor.DataAccessor {
constructor(config) {
super();
this.idExpr = config.valueExpr ?? "id";
this.textExpr = config.displayExpr ?? "text";
this.colorExpr = config.colorExpr ?? "color";
this.updateExpressions({
idExpr: this.idExpr,
textExpr: this.textExpr,
colorExpr: this.colorExpr
})
}
updateExpression(field, expr) {
const name = field.replace("Expr", "");
if (!expr) {
delete this.getter[name];
delete this.setter[name];
return
}
this.getter[name] = (0, _data.compileGetter)(expr);
this.setter[name] = (0, _data.compileSetter)(expr)
}
}
exports.ResourceDataAccessor = ResourceDataAccessor
},
31985(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTargetedAppointmentFromInfo = exports.getTargetedAppointment = void 0;
var _appointment_groups_utils = __webpack_require__( /*! ./resource_manager/appointment_groups_utils */ 11649);
var _group_utils = __webpack_require__( /*! ./resource_manager/group_utils */ 76131);
const getTargetedAppointmentFromInfo = function(rawAppointment, settings, dataAccessor, resourceManager) {
let usePartialDates = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : false;
const {
info: info
} = settings;
const rawTargetedAppointment = Object.assign({}, rawAppointment);
dataAccessor.set("startDate", rawTargetedAppointment, new Date(info.sourceAppointment.startDate));
dataAccessor.set("endDate", rawTargetedAppointment, new Date(info.sourceAppointment.endDate));
const displayDates = usePartialDates && "partialDates" in info ? info.partialDates : info.appointment;
rawTargetedAppointment.displayStartDate = new Date(displayDates.startDate);
rawTargetedAppointment.displayEndDate = new Date(displayDates.endDate);
((rawAppointment, settings, resourceManager) => {
const {
groups: groups,
resourceById: resourceById,
groupsLeafs: groupsLeafs
} = resourceManager;
if (groups.length) {
const cellGroups = (0, _group_utils.getLeafGroupValues)(groupsLeafs, settings.groupIndex);
(0, _appointment_groups_utils.setAppointmentGroupValues)(rawAppointment, resourceById, cellGroups)
}
})(rawTargetedAppointment, settings, resourceManager);
return rawTargetedAppointment
};
exports.getTargetedAppointmentFromInfo = getTargetedAppointmentFromInfo;
exports.getTargetedAppointment = (rawAppointment, settings, dataAccessor, resourceManager) => {
const startDate = dataAccessor.get("startDate", rawAppointment);
const endDate = dataAccessor.get("endDate", rawAppointment);
if (!("info" in settings)) {
return Object.assign({}, rawAppointment, {
displayStartDate: startDate,
displayEndDate: endDate
})
}
return getTargetedAppointmentFromInfo(rawAppointment, settings, dataAccessor, resourceManager)
}
},
80356(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "macroTaskArray", {
enumerable: true,
get: function() {
return _index.default
}
});
var _index = (e = __webpack_require__( /*! ./macro_task_array/index */ 4203), e && e.__esModule ? e : {
default: e
});
var e
},
24862(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isAgendaWorkspaceComponent = function(component) {
return "dxSchedulerAgenda" === component.NAME
}
},
28740(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isSchedulerComponent = function(component) {
return "dxScheduler" === component.NAME
}
},
85935(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Loader = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 17781);
var _data_source = (e = __webpack_require__( /*! ../../../../data/data_source */ 47283), e && e.__esModule ? e : {
default: e
});
var e;
var _utils = __webpack_require__( /*! ./utils */ 29379);
exports.Loader = class {
constructor(config, dataSourceOptions) {
this.items = [];
this.data = [];
this.unsubscribe = _common.noop;
this.dataSource = (0, _utils.normalizeDataSource)(config.dataSource, dataSourceOptions);
this.isSharedDataSource = config.dataSource instanceof _data_source.default;
this.addDataSourceHandlers()
}
onInit() {
if (this.isLoaded()) {
var _this$dataSource;
this.applyChanges((null === (_this$dataSource = this.dataSource) || void 0 === _this$dataSource ? void 0 : _this$dataSource.items()) ?? [])
}
}
isLoaded() {
var _this$dataSource2;
return Boolean(null === (_this$dataSource2 = this.dataSource) || void 0 === _this$dataSource2 ? void 0 : _this$dataSource2.isLoaded())
}
addDataSourceHandlers() {
const onChange = this.onChange.bind(this);
const onLoadingChanged = this.onLoadingChanged.bind(this);
const onLoadError = this.onLoadError.bind(this);
const {
dataSource: dataSource
} = this;
if (dataSource) {
dataSource.on("changed", onChange);
dataSource.on("loadingChanged", onLoadingChanged);
dataSource.on("loadError", onLoadError);
this.unsubscribe = () => {
dataSource.off("changed", onChange);
dataSource.off("loadingChanged", onLoadingChanged);
dataSource.off("loadError", onLoadError)
}
}
}
async load() {
let forceReload = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
if (this.dataSource && (forceReload || !this.dataSource.isLoaded() && !this.loadingStatePromise)) {
this.loadingStatePromise = this.loadingStatePromise && !forceReload ? this.loadingStatePromise : (0, _utils.loadResource)(this.dataSource, forceReload)
}
await this.loadingStatePromise
}
onLoadingChanged(isLoading) {
if (!isLoading && this.isLoaded()) {
var _this$dataSource3;
this.applyChanges((null === (_this$dataSource3 = this.dataSource) || void 0 === _this$dataSource3 ? void 0 : _this$dataSource3.items()) ?? [])
}
}
applyChanges(items) {
if (items && items !== this.data) {
this.data = items;
this.items = this.onLoadTransform(this.data)
}
}
dispose() {
if (this.dataSource) {
if (this.isSharedDataSource) {
this.unsubscribe();
this.unsubscribe = _common.noop
} else {
this.dataSource.dispose()
}
this.data = [];
this.items = []
}
}
}
},
9440(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ResourceLoader = void 0;
var _appointment_resource_data_accessor = __webpack_require__( /*! ../data_accessor/appointment_resource_data_accessor */ 5450);
var _resource_data_accessor = __webpack_require__( /*! ../data_accessor/resource_data_accessor */ 72044);
var _loader = __webpack_require__( /*! ./loader */ 85935);
class ResourceLoader extends _loader.Loader {
constructor(config) {
super(config, {
pageSize: 0
});
const accessor = (0, _appointment_resource_data_accessor.getAppointmentResourceAccessor)(config);
this.idsGetter = accessor.idsGetter;
this.idsSetter = accessor.idsSetter;
this.dataAccessor = new _resource_data_accessor.ResourceDataAccessor(config);
this.allowMultiple = Boolean(config.allowMultiple);
this.useColorAsDefault = Boolean(config.useColorAsDefault);
this.resourceIndex = String((0, _appointment_resource_data_accessor.getResourceIndex)(config));
this.resourceName = config.label;
this.icon = config.icon;
this.onInit()
}
onLoadTransform(items) {
return items.map(item => ({
id: this.dataAccessor.get("id", item),
text: this.dataAccessor.get("text", item),
color: this.dataAccessor.get("color", item)
}))
}
applyChanges(items) {
super.applyChanges(items)
}
onLoadError() {}
onChange() {}
}
exports.ResourceLoader = ResourceLoader
},
29379(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normalizeDataSource = exports.loadResource = void 0;
var _data_source = (e = __webpack_require__( /*! ../../../../data/data_source */ 47283), e && e.__esModule ? e : {
default: e
});
var e;
var _m_utils = __webpack_require__( /*! ../../../data/data_source/m_utils */ 23923);
exports.normalizeDataSource = function(dataSourceOptions) {
let options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if (!dataSourceOptions) {
return
}
if (dataSourceOptions instanceof _data_source.default) {
return dataSourceOptions
}
const result = Object.assign({}, (0, _m_utils.normalizeDataSourceOptions)(dataSourceOptions, {}), options);
return new _data_source.default(result)
};
exports.loadResource = async function(dataSource) {
let forceReload = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
if (!dataSource) {
return []
}
if (forceReload) {
return new Promise((resolve, reject) => {
dataSource.reload().then(resolve, reject)
})
}
if (dataSource.isLoaded()) {
return dataSource.items()
}
return new Promise((resolve, reject) => {
dataSource.load().then(resolve, reject)
})
}
},
8710(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.macroTaskIdSet = exports.default = void 0;
const macroTaskIdSet = exports.macroTaskIdSet = new Set;
exports.default = {
schedule: async (callback, macroTaskTimeoutMs) => new Promise(resolve => {
const taskId = setTimeout(() => {
callback();
macroTaskIdSet.delete(taskId);
resolve()
}, macroTaskTimeoutMs);
macroTaskIdSet.add(taskId)
}),
dispose: () => {
Array.from(macroTaskIdSet).forEach(id => {
clearTimeout(id);
macroTaskIdSet.delete(id)
})
}
}
},
4203(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _dispatcher = (e = __webpack_require__( /*! ./dispatcher */ 8710), e && e.__esModule ? e : {
default: e
});
var e;
var _methods = __webpack_require__( /*! ./methods */ 57);
exports.default = {
forEach: _methods.macroTaskArrayForEach,
map: _methods.macroTaskArrayMap,
dispose: _dispatcher.default.dispose
}
},
57(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.macroTaskArrayMap = exports.macroTaskArrayForEach = exports.DEFAULT_STEPS_VALUE = exports.DEFAULT_MACRO_TASK_TIMEOUT = void 0;
var _dispatcher = (e = __webpack_require__( /*! ./dispatcher */ 8710), e && e.__esModule ? e : {
default: e
});
var e;
const DEFAULT_STEPS_VALUE = exports.DEFAULT_STEPS_VALUE = 100;
const DEFAULT_MACRO_TASK_TIMEOUT = exports.DEFAULT_MACRO_TASK_TIMEOUT = 0;
const macroTaskArrayForEach = async function(array, callback) {
let step = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : DEFAULT_STEPS_VALUE;
let macroTaskTimeoutMs = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : DEFAULT_MACRO_TASK_TIMEOUT;
const promises = [];
const batchesCount = Math.ceil(array.length / step);
for (let batchIdx = 0; batchIdx < batchesCount; batchIdx += 1) {
const scheduledTask = _dispatcher.default.schedule(() => {
const startIdx = batchIdx * step;
const maxIdx = startIdx + step;
for (let idx = startIdx; idx < maxIdx && void 0 !== array[idx]; idx += 1) {
callback(array[idx])
}
}, macroTaskTimeoutMs);
promises.push(scheduledTask)
}
await Promise.all(promises)
};
exports.macroTaskArrayForEach = macroTaskArrayForEach;
exports.macroTaskArrayMap = async function(array, callback) {
let step = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : DEFAULT_STEPS_VALUE;
let macroTaskTimeoutMs = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : DEFAULT_MACRO_TASK_TIMEOUT;
const result = [];
await macroTaskArrayForEach(array, item => {
result.push(callback(item))
}, step, macroTaskTimeoutMs);
return result
}
},
46912(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DEFAULT_SCHEDULER_OPTIONS_RULES = exports.DEFAULT_SCHEDULER_OPTIONS = exports.DEFAULT_SCHEDULER_INTERNAL_OPTIONS = exports.DEFAULT_SCHEDULER_INTEGRATION_OPTIONS = exports.DEFAULT_ICONS_SHOW_MODE = void 0;
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../../core/devices */ 65951));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 64553));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 41380));
var _themes = __webpack_require__( /*! ../../../../ui/themes */ 52071);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const DEFAULT_ICONS_SHOW_MODE = exports.DEFAULT_ICONS_SHOW_MODE = "main";
const DEFAULT_SCHEDULER_OPTIONS = exports.DEFAULT_SCHEDULER_OPTIONS = {
views: ["day", "week"],
currentView: "day",
currentDate: _date.default.trimTime(new Date),
min: void 0,
max: void 0,
dateSerializationFormat: void 0,
firstDayOfWeek: void 0,
groups: [],
resources: [],
dataSource: null,
customizeDateNavigatorText: void 0,
appointmentTemplate: "item",
appointmentCollectorTemplate: "appointmentCollector",
dataCellTemplate: void 0,
timeCellTemplate: void 0,
resourceCellTemplate: void 0,
dateCellTemplate: void 0,
startDayHour: 0,
endDayHour: 24,
offset: 0,
editing: {
allowAdding: true,
allowDeleting: true,
allowDragging: true,
allowResizing: true,
allowUpdating: true,
allowTimeZoneEditing: false,
form: {
iconsShowMode: DEFAULT_ICONS_SHOW_MODE
},
popup: {}
},
showAllDayPanel: true,
showCurrentTimeIndicator: true,
shadeUntilCurrentTime: false,
indicatorUpdateInterval: 3e5,
recurrenceEditMode: "dialog",
cellDuration: 30,
maxAppointmentsPerCell: "auto",
selectedCellData: [],
groupByDate: false,
onAppointmentRendered: void 0,
onAppointmentClick: void 0,
onAppointmentDblClick: void 0,
onAppointmentContextMenu: void 0,
onCellClick: void 0,
onCellContextMenu: void 0,
onAppointmentAdding: void 0,
onAppointmentAdded: void 0,
onAppointmentUpdating: void 0,
onAppointmentUpdated: void 0,
onAppointmentDeleting: void 0,
onAppointmentDeleted: void 0,
onAppointmentFormOpening: void 0,
onAppointmentTooltipShowing: void 0,
appointmentTooltipTemplate: "appointmentTooltip",
crossScrollingEnabled: false,
useDropDownViewSwitcher: false,
startDateExpr: "startDate",
endDateExpr: "endDate",
textExpr: "text",
descriptionExpr: "description",
allDayExpr: "allDay",
recurrenceRuleExpr: "recurrenceRule",
recurrenceExceptionExpr: "recurrenceException",
remoteFiltering: false,
timeZone: "",
startDateTimeZoneExpr: "startDateTimeZone",
endDateTimeZoneExpr: "endDateTimeZone",
noDataText: "",
adaptivityEnabled: false,
scrolling: {
mode: "standard"
},
allDayPanelMode: "all",
toolbar: {
disabled: false,
multiline: false,
items: [{
location: "before",
name: "dateNavigator"
}, {
location: "after",
name: "viewSwitcher",
locateInMenu: "auto"
}]
}
};
exports.DEFAULT_SCHEDULER_INTERNAL_OPTIONS = {
indicatorTime: void 0,
renovateRender: true,
editing: Object.assign({}, DEFAULT_SCHEDULER_OPTIONS.editing, {
popup: {}
}),
_draggingMode: "outlook",
_appointmentTooltipOffset: {
x: 0,
y: 0
},
appointmentPopupTemplate: "appointmentPopup",
disabledExpr: "disabled",
visibleExpr: "visible",
allowMultipleCellSelection: true
};
exports.DEFAULT_SCHEDULER_INTEGRATION_OPTIONS = {
integrationOptions: {
useDeferUpdateForTemplates: false
}
};
exports.DEFAULT_SCHEDULER_OPTIONS_RULES = [{
device: () => "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator(),
options: {
focusStateEnabled: true
}
}, {
device: () => !_devices.default.current().generic,
options: {
useDropDownViewSwitcher: true,
editing: {
allowDragging: false,
allowResizing: false
}
}
}, {
device: () => (0, _themes.isMaterialBased)(),
options: {
useDropDownViewSwitcher: true,
dateCellTemplate: (data, _, element) => {
const {
text: text = ""
} = data;
text.split(" ").forEach((word, wordIndex) => {
const span = (0, _renderer.default)(" ").text(word).addClass("dx-scheduler-header-panel-cell-date");
(0, _renderer.default)(element).append(span);
if (!wordIndex) {
(0, _renderer.default)(element).append(" ")
}
})
}
}
}, {
device: () => (0, _themes.isMaterial)(),
options: {
_appointmentTooltipOffset: {
x: 0,
y: 11
}
}
}]
},
43582(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VIEW_TYPES = exports.VIEWS = exports.DEFAULT_VIEW_OPTIONS = void 0;
const VIEWS = exports.VIEWS = {
DAY: "day",
WEEK: "week",
WORK_WEEK: "workWeek",
MONTH: "month",
TIMELINE_DAY: "timelineDay",
TIMELINE_WEEK: "timelineWeek",
TIMELINE_WORK_WEEK: "timelineWorkWeek",
TIMELINE_MONTH: "timelineMonth",
AGENDA: "agenda"
};
exports.VIEW_TYPES = Object.values(VIEWS);
const WEEKENDS = [0, 6];
const getView = function(type, groupOrientation) {
let skippedDays = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
return {
groupOrientation: groupOrientation,
intervalCount: 1,
type: type,
skippedDays: skippedDays
}
};
exports.DEFAULT_VIEW_OPTIONS = {
day: getView("day", "horizontal"),
week: getView("week", "horizontal"),
workWeek: getView("workWeek", "horizontal", WEEKENDS),
month: getView("month", "horizontal"),
timelineDay: getView("timelineDay", "vertical"),
timelineWeek: getView("timelineWeek", "vertical"),
timelineWorkWeek: getView("timelineWorkWeek", "vertical", WEEKENDS),
timelineMonth: getView("timelineMonth", "vertical"),
agenda: {
agendaDuration: 7,
intervalCount: 1,
skippedDays: [],
type: "agenda"
}
}
},
41940(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getCurrentView = function(currentView, views) {
const viewsProps = getViews(views);
const currentViewProps = viewsProps.find(view => [view.name, view.type].includes(currentView));
return currentViewProps ?? _constants_view.DEFAULT_VIEW_OPTIONS[currentView] ?? viewsProps[0] ?? _constants_view.DEFAULT_VIEW_OPTIONS[_constants_view.VIEW_TYPES[0]]
};
exports.parseDateOption = exports.parseCurrentDate = exports.getViews = exports.getViewOption = void 0;
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _m_date = __webpack_require__( /*! ../../../core/utils/m_date */ 66570);
var _m_date_serialization = __webpack_require__( /*! ../../../core/utils/m_date_serialization */ 62897);
var _m_extend = __webpack_require__( /*! ../../../core/utils/m_extend */ 96298);
var _constants_view = __webpack_require__( /*! ./constants_view */ 43582);
const isKnownView = view => _constants_view.VIEW_TYPES.includes((0, _type.isObject)(view) ? view.type : view);
const isExistedView = view => Boolean(view);
const normalizeView = view => (0, _type.isObject)(view) ? (0, _m_extend.extend)({}, _constants_view.DEFAULT_VIEW_OPTIONS[view.type], view) : _constants_view.DEFAULT_VIEW_OPTIONS[view];
const getViews = views => views.filter(isKnownView).map(normalizeView).filter(isExistedView);
exports.getViews = getViews;
const parseDateOption = date => date ? new Date(_m_date_serialization.dateSerialization.deserializeDate(date)) : void 0;
exports.parseDateOption = parseDateOption;
const parseCurrentDate = date => {
const deserialized = parseDateOption(date);
return _m_date.dateUtils.trimTime(deserialized)
};
exports.parseCurrentDate = parseCurrentDate;
exports.getViewOption = (optionName, currentOptionValue) => {
if (!(optionName => ["currentDate", "min", "max"].includes(optionName))(optionName)) {
return currentOptionValue
}
const date = "currentDate" === optionName ? parseCurrentDate(currentOptionValue) : parseDateOption(currentOptionValue);
return date
}
},
28580(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _validation_functions = __webpack_require__( /*! ./validation_functions */ 11407);
Object.keys(_validation_functions).forEach(function(key) {
if ("default" === key || "__esModule" === key) {
return
}
if (key in exports && exports[key] === _validation_functions[key]) {
return
}
Object.defineProperty(exports, key, {
enumerable: true,
get: function() {
return _validation_functions[key]
}
})
});
var _validator_rules = __webpack_require__( /*! ./validator_rules */ 44226);
Object.keys(_validator_rules).forEach(function(key) {
if ("default" === key || "__esModule" === key) {
return
}
if (key in exports && exports[key] === _validator_rules[key]) {
return
}
Object.defineProperty(exports, key, {
enumerable: true,
get: function() {
return _validator_rules[key]
}
})
})
},
11407(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lessThan = exports.isInteger = exports.inRange = exports.greaterThan = exports.divisibleBy = void 0;
exports.isInteger = value => Number.isInteger(value);
exports.greaterThan = function(value, minimalValue) {
let strict = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true;
return strict ? value > minimalValue : value >= minimalValue
};
exports.lessThan = function(value, maximalValue) {
let strict = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true;
return strict ? value < maximalValue : value <= maximalValue
};
exports.inRange = (value, _ref) => {
let [from, to] = _ref;
return value >= from && value <= to
};
exports.divisibleBy = (value, divider) => value % divider === 0
},
44226(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mustBeLessThan = exports.mustBeInteger = exports.mustBeInRange = exports.mustBeGreaterThan = exports.mustBeDivisibleBy = void 0;
var _index = __webpack_require__( /*! ../core/index */ 30378);
var _validation_functions = __webpack_require__( /*! ./validation_functions */ 11407);
exports.mustBeInteger = (0, _index.createValidatorRule)("mustBeInteger", value => (0, _validation_functions.isInteger)(value));
exports.mustBeGreaterThan = function(minimalValue) {
let strict = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true;
return (0, _index.createValidatorRule)("mustBeGreaterThan", value => (0, _validation_functions.greaterThan)(value, minimalValue, strict))
};
exports.mustBeLessThan = function(maximalValue) {
let strict = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true;
return (0, _index.createValidatorRule)("mustBeLessThan", value => (0, _validation_functions.lessThan)(value, maximalValue, strict))
};
exports.mustBeInRange = range => (0, _index.createValidatorRule)("mustBeInRange", value => (0, _validation_functions.inRange)(value, range));
exports.mustBeDivisibleBy = divider => (0, _index.createValidatorRule)("mustBeDivisibleBy", value => (0, _validation_functions.divisibleBy)(value, divider))
},
30378(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
OptionsValidator: true,
OptionsValidatorErrorHandler: true,
Validator: true
};
Object.defineProperty(exports, "OptionsValidator", {
enumerable: true,
get: function() {
return _options_validator.OptionsValidator
}
});
Object.defineProperty(exports, "OptionsValidatorErrorHandler", {
enumerable: true,
get: function() {
return _options_validator_error_handler.OptionsValidatorErrorHandler
}
});
Object.defineProperty(exports, "Validator", {
enumerable: true,
get: function() {
return _validator.Validator
}
});
var _options_validator = __webpack_require__( /*! ./options_validator */ 43121);
var _options_validator_error_handler = __webpack_require__( /*! ./options_validator_error_handler */ 61063);
var _types = __webpack_require__( /*! ./types */ 78535);
Object.keys(_types).forEach(function(key) {
if ("default" === key || "__esModule" === key) {
return
}
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) {
return
}
if (key in exports && exports[key] === _types[key]) {
return
}
Object.defineProperty(exports, key, {
enumerable: true,
get: function() {
return _types[key]
}
})
});
var _validator = __webpack_require__( /*! ./validator */ 47676);
var _validator_rules = __webpack_require__( /*! ./validator_rules */ 93396);
Object.keys(_validator_rules).forEach(function(key) {
if ("default" === key || "__esModule" === key) {
return
}
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) {
return
}
if (key in exports && exports[key] === _validator_rules[key]) {
return
}
Object.defineProperty(exports, key, {
enumerable: true,
get: function() {
return _validator_rules[key]
}
})
})
},
43121(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OptionsValidator = void 0;
exports.OptionsValidator = class {
constructor(validators) {
this.validators = validators
}
validate(options) {
const errors = Object.entries(this.validators).reduce((result, _ref) => {
let [validatorName, validator] = _ref;
const validatorResult = validator.validate(options);
if (true !== validatorResult) {
result[validatorName] = validatorResult
}
return result
}, {});
return Object.keys(errors).length > 0 ? errors : true
}
}
},
61063(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OptionsValidatorErrorHandler = void 0;
exports.OptionsValidatorErrorHandler = class {
constructor(validatorNameToErrorCodeMap, globalErrorHandler) {
this.validatorNameToErrorCodeMap = validatorNameToErrorCodeMap;
this.globalErrorHandler = globalErrorHandler
}
handleValidationResult(optionsValidatorResult) {
if (true === optionsValidatorResult) {
return
}
const warningsMap = new Map;
const errorsMap = new Map;
Object.entries(optionsValidatorResult).forEach(_ref => {
let [validatorName, validatorErrorRecord] = _ref;
const errorCode = this.validatorNameToErrorCodeMap[validatorName];
if (!errorCode) {
return
}
const logMap = errorCode.startsWith("E") ? errorsMap : warningsMap;
Object.values(validatorErrorRecord).forEach(validatorError => {
const uniqueKey = ((errorCode, validatorError) => {
if ("boolean" === typeof validatorError || !Array.isArray(validatorError.arguments)) {
return errorCode
}
return `${errorCode}${JSON.stringify(validatorError.arguments)}`
})(errorCode, validatorError);
const args = (validatorError => "boolean" === typeof validatorError || !Array.isArray(validatorError.arguments) ? [] : validatorError.arguments)(validatorError);
logMap.set(uniqueKey, {
errorCode: errorCode,
args: args
})
})
});
Array.from(warningsMap).forEach(value => {
const [, {
errorCode: errorCode,
args: args
}] = value;
this.globalErrorHandler.logError(errorCode, ...args)
});
Array.from(errorsMap).forEach((value, idx) => {
const [, {
errorCode: errorCode,
args: args
}] = value;
const isLastErrorCode = idx === errorsMap.size - 1;
if (!isLastErrorCode) {
this.globalErrorHandler.logError(errorCode, ...args)
} else {
this.globalErrorHandler.throwError(errorCode, ...args)
}
})
}
}
},
78535(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.REDUNDANT_EXPORT = void 0;
exports.REDUNDANT_EXPORT = void 0
},
47676(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Validator = void 0;
exports.Validator = class {
constructor(valueSelector, rules) {
this.valueSelector = valueSelector;
this.rules = rules
}
validate(options) {
const value = this.valueSelector(options);
const errors = this.rules.reduce((result, rule) => {
const validationResult = rule(value);
if (true !== validationResult) {
result[rule.name] = validationResult
}
return result
}, {});
return Object.keys(errors).length ? errors : true
}
}
},
93396(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createValidatorRule = void 0;
exports.createValidatorRule = (name, ruleFunc) => {
Object.defineProperty(ruleFunc, "name", {
value: name,
writable: false
});
return ruleFunc
}
},
49240(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "SchedulerOptionsValidator", {
enumerable: true,
get: function() {
return _options_validator.SchedulerOptionsValidator
}
});
Object.defineProperty(exports, "SchedulerOptionsValidatorErrorsHandler", {
enumerable: true,
get: function() {
return _options_validator_errors_handler.SchedulerOptionsValidatorErrorsHandler
}
});
var _options_validator = __webpack_require__( /*! ./options_validator */ 62923);
var _options_validator_errors_handler = __webpack_require__( /*! ./options_validator_errors_handler */ 4450)
},
62923(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SchedulerOptionsValidator = void 0;
var _index = __webpack_require__( /*! ./common/index */ 28580);
var _index2 = __webpack_require__( /*! ./core/index */ 30378);
var _validator_rules = __webpack_require__( /*! ./validator_rules */ 17238);
class SchedulerOptionsValidator extends _index2.OptionsValidator {
constructor() {
super({
startDayHour: new _index2.Validator(_ref => {
let {
startDayHour: startDayHour
} = _ref;
return startDayHour
}, [_index.mustBeInteger, (0, _index.mustBeInRange)([0, 24])]),
endDayHour: new _index2.Validator(_ref2 => {
let {
endDayHour: endDayHour
} = _ref2;
return endDayHour
}, [_index.mustBeInteger, (0, _index.mustBeInRange)([0, 24])]),
offset: new _index2.Validator(_ref3 => {
let {
offset: offset
} = _ref3;
return offset
}, [_index.mustBeInteger, (0, _index.mustBeInRange)([-1440, 1440]), (0, _index.mustBeDivisibleBy)(5)]),
cellDuration: new _index2.Validator(_ref4 => {
let {
cellDuration: cellDuration
} = _ref4;
return cellDuration
}, [_index.mustBeInteger, (0, _index.mustBeGreaterThan)(0)]),
startDayHourAndEndDayHour: new _index2.Validator(options => options, [_validator_rules.endDayHourMustBeGreaterThanStartDayHour]),
cellDurationAndVisibleInterval: new _index2.Validator(options => options, [_validator_rules.visibleIntervalMustBeDivisibleByCellDuration, _validator_rules.cellDurationMustBeLessThanVisibleInterval]),
views: new _index2.Validator(options => options.views, [_validator_rules.allViewsHasCorrectType])
})
}
}
exports.SchedulerOptionsValidator = SchedulerOptionsValidator
},
4450(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SchedulerOptionsValidatorErrorsHandler = void 0;
var _ui = (e = __webpack_require__( /*! ../../../../ui/widget/ui.errors */ 35185), e && e.__esModule ? e : {
default: e
});
var e;
var _index = __webpack_require__( /*! ./core/index */ 30378);
const GLOBAL_ERROR_HANDLER = {
logError: function(errorCode) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key]
}
_ui.default.log(errorCode, ...args)
},
throwError: function(errorCode) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2]
}
throw _ui.default.Error(errorCode, ...args)
}
};
class SchedulerOptionsValidatorErrorsHandler extends _index.OptionsValidatorErrorHandler {
constructor() {
super({
startDayHour: "E1058",
endDayHour: "E1058",
startDayHourAndEndDayHour: "E1058",
offset: "E1061",
cellDuration: "E1062",
cellDurationAndVisibleInterval: "E1062",
views: "W0008"
}, GLOBAL_ERROR_HANDLER)
}
}
exports.SchedulerOptionsValidatorErrorsHandler = SchedulerOptionsValidatorErrorsHandler
},
17238(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.visibleIntervalMustBeDivisibleByCellDuration = exports.endDayHourMustBeGreaterThanStartDayHour = exports.cellDurationMustBeLessThanVisibleInterval = exports.allViewsHasCorrectType = void 0;
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 11528);
var _constants_view = __webpack_require__( /*! ../options/constants_view */ 43582);
var _index = __webpack_require__( /*! ./common/index */ 28580);
var _index2 = __webpack_require__( /*! ./core/index */ 30378);
exports.endDayHourMustBeGreaterThanStartDayHour = (0, _index2.createValidatorRule)("endDayHourGreaterThanStartDayHour", _ref => {
let {
startDayHour: startDayHour,
endDayHour: endDayHour
} = _ref;
return (0, _index.greaterThan)(endDayHour, startDayHour)
});
exports.visibleIntervalMustBeDivisibleByCellDuration = (0, _index2.createValidatorRule)("visibleIntervalMustBeDivisibleByCellDuration", _ref2 => {
let {
cellDuration: cellDuration,
startDayHour: startDayHour,
endDayHour: endDayHour
} = _ref2;
const visibleInterval = 60 * (endDayHour - startDayHour);
return (0, _index.divisibleBy)(visibleInterval, cellDuration)
});
exports.cellDurationMustBeLessThanVisibleInterval = (0, _index2.createValidatorRule)("cellDurationMustBeLessThanVisibleInterval", _ref3 => {
let {
cellDuration: cellDuration,
startDayHour: startDayHour,
endDayHour: endDayHour
} = _ref3;
const visibleInterval = 60 * (endDayHour - startDayHour);
return (0, _index.lessThan)(cellDuration, visibleInterval, false)
});
exports.allViewsHasCorrectType = (0, _index2.createValidatorRule)("allViewsHasCorrectType", views => {
const incorrectViewTypes = views.reduce((result, view) => {
const viewType = (0, _type.isObject)(view) ? view.type : view;
const isValidView = Boolean(viewType && _constants_view.VIEW_TYPES.includes(viewType));
if (!isValidView) {
result.push(`'${viewType}'`)
}
return result
}, []);
return incorrectViewTypes.length ? {
arguments: [incorrectViewTypes.join(", ")]
} : true
})
},
80915(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.reduceResourcesTree = void 0;
const filterGroupTree = (resourceById, appointments, node) => {
if (!((resourceById, appointments, node) => {
const resource = resourceById[node.resourceIndex];
const value = node.grouped[node.resourceIndex];
return appointments.some(appointment => resource.idsGetter(appointment.itemData).includes(value))
})(resourceById, appointments, node)) {
return
}
return Object.assign({}, node, {
children: node.children.length ? node.children.map(childrenNode => filterGroupTree(resourceById, appointments, childrenNode)).filter(Boolean) : []
})
};
exports.reduceResourcesTree = (resourceById, groupsTree, appointments) => groupsTree.map(node => filterGroupTree(resourceById, appointments, node)).filter(Boolean)
},
97310(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPaintedResource = exports.getAppointmentColor = void 0;
var _appointment_groups_utils = __webpack_require__( /*! ./appointment_groups_utils */ 11649);
var _group_utils = __webpack_require__( /*! ./group_utils */ 76131);
const getPaintedResource = (resources, appointmentGroups, groups) => {
const assignedResources = resources.filter(resource => appointmentGroups.includes(resource.resourceIndex));
const defaultColorResource = assignedResources.find(resource => resource.useColorAsDefault);
if (defaultColorResource) {
return defaultColorResource
}
const assignedGroups = groups.filter(group => appointmentGroups.includes(group));
const availableGroupedResources = assignedGroups.map(group => assignedResources.find(resource => resource.resourceIndex === group)).filter(Boolean);
return availableGroupedResources.length ? availableGroupedResources.at(-1) : assignedResources.at(-1)
};
exports.getPaintedResource = getPaintedResource;
exports.getAppointmentColor = async (resources, groupsLeafs, groups, appointmentConfig) => {
const {
groupIndex: groupIndex,
itemData: itemData
} = appointmentConfig;
const appointmentGroupValues = (0, _appointment_groups_utils.getAppointmentGroupValues)(itemData, resources);
const appointmentGroups = Object.keys(appointmentGroupValues);
const paintedResource = getPaintedResource(resources, appointmentGroups, groups);
if (!paintedResource) {
return
}
await paintedResource.load();
const leafGroupValue = (0, _group_utils.getLeafGroupValues)(groupsLeafs, groupIndex);
const resourceValues = paintedResource.idsGetter(itemData);
const resourceId = leafGroupValue[paintedResource.resourceIndex] ?? resourceValues[0];
return ((resource, resourceId) => {
var _getResourceItemById;
return null === (_getResourceItemById = (0, _appointment_groups_utils.getResourceItemById)(resource, resourceId)) || void 0 === _getResourceItemById ? void 0 : _getResourceItemById.color
})(paintedResource, resourceId)
}
},
11649(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setAppointmentGroupValues = exports.groupAppointmentsByGroupLeafs = exports.getSafeGroupValues = exports.getResourceItemById = exports.getRawAppointmentGroupValues = exports.getAppointmentResources = exports.getAppointmentGroupValues = exports.getAppointmentGroupIndex = void 0;
var _m_array = __webpack_require__( /*! ../../../core/utils/m_array */ 28601);
var _m_common = __webpack_require__( /*! ../../../core/utils/m_common */ 39315);
const getResourceItemById = (resource, resourceId) => resource.items.find(item => (0, _m_common.equalByValue)(item.id, resourceId));
exports.getResourceItemById = getResourceItemById;
const getAppointmentGroupValues = (rawAppointment, resources) => resources.reduce((result, resource) => {
const ids = resource.idsGetter(rawAppointment);
if (ids.length) {
result[resource.resourceIndex] = ids
}
return result
}, {});
exports.getAppointmentGroupValues = getAppointmentGroupValues;
exports.getRawAppointmentGroupValues = (rawAppointment, resources) => resources.reduce((result, resource) => {
const ids = resource.idsGetter(rawAppointment);
if (ids.length) {
result[resource.resourceIndex] = resource.allowMultiple ? ids : ids[0]
}
return result
}, {});
exports.getSafeGroupValues = groupValues => Object.entries(groupValues).reduce((result, _ref) => {
let [key, value] = _ref;
result[key] = (0, _m_array.wrapToArray)(value);
return result
}, {});
exports.getAppointmentResources = (appointmentGroupValues, resourceById) => Object.entries(appointmentGroupValues).reduce((result, _ref2) => {
let [resourceIndex, resourceIds] = _ref2;
const resource = resourceById[resourceIndex];
const values = resourceIds.map(id => {
var _getResourceItemById;
return null === (_getResourceItemById = getResourceItemById(resource, id)) || void 0 === _getResourceItemById ? void 0 : _getResourceItemById.text
}).filter(Boolean);
if (values.length) {
result.push({
label: resource.resourceName,
values: values
})
}
return result
}, []);
exports.setAppointmentGroupValues = function(item, resourceById) {
let groups = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
Object.entries(groups).forEach(_ref3 => {
let [resourceIndex, resourceId] = _ref3;
const resource = resourceById[resourceIndex];
const value = resource.allowMultiple ? [resourceId] : resourceId;
resource.idsSetter(item, value)
})
};
exports.getAppointmentGroupIndex = (appointmentGroupValues, groupLeafs) => groupLeafs.filter(leaf => Object.entries(leaf.grouped).every(_ref4 => {
var _appointmentGroupValu;
let [resourceIndex, resourceId] = _ref4;
return null === (_appointmentGroupValu = appointmentGroupValues[resourceIndex]) || void 0 === _appointmentGroupValu ? void 0 : _appointmentGroupValu.includes(resourceId)
})).map(leaf => leaf.groupIndex);
exports.groupAppointmentsByGroupLeafs = (resourceById, groupLeafs, appointments) => {
if (!groupLeafs.length) {
return [appointments]
}
return groupLeafs.map(leaf => appointments.filter(item => {
const appointmentGroupValues = getAppointmentGroupValues(item, Object.values(resourceById));
return Object.entries(leaf.grouped).every(_ref5 => {
var _appointmentGroupValu2;
let [resourceIndex, resourceId] = _ref5;
return null === (_appointmentGroupValu2 = appointmentGroupValues[resourceIndex]) || void 0 === _appointmentGroupValu2 ? void 0 : _appointmentGroupValu2.includes(resourceId)
})
}))
}
},
76131(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.groupResources = exports.getResourcesByGroupIndex = exports.getLeafGroupValues = exports.getGroupTexts = exports.getAllGroupValues = void 0;
exports.groupResources = (resourceById, groups) => {
if (!groups.length || 0 === Object.keys(resourceById).length) {
return {
groupTree: [],
groupLeafs: []
}
}
const head = [{}];
let leafs = head;
groups.filter(group => resourceById[group]).forEach(group => {
const resource = resourceById[group];
const nodes = resource.items.map(item => ({
resourceText: item.text,
resourceIndex: resource.resourceIndex,
grouped: {
[resource.resourceIndex]: item.id
},
children: []
}));
const nextLeafs = [];
leafs.forEach(leaf => {
leaf.children = nodes.map(node => Object.assign({}, node, {
grouped: Object.assign({}, node.grouped, leaf.grouped)
}));
nextLeafs.push(...leaf.children)
});
leafs = nextLeafs
});
const groupLeafs = leafs.map((leaf, index) => Object.assign({}, leaf, {
groupIndex: index
}));
return {
groupTree: head[0].children,
groupLeafs: groupLeafs
}
};
exports.getAllGroupValues = groupsLeafs => groupsLeafs.map(group => group.grouped);
const getLeafGroupValues = (groupsLeafs, groupIndex) => {
var _groupsLeafs$find;
return (null === (_groupsLeafs$find = groupsLeafs.find(group => group.groupIndex === groupIndex)) || void 0 === _groupsLeafs$find ? void 0 : _groupsLeafs$find.grouped) ?? {}
};
exports.getLeafGroupValues = getLeafGroupValues;
exports.getGroupTexts = (groups, groupsLeafs, resourceById, groupIndex) => {
const leafGroups = getLeafGroupValues(groupsLeafs, groupIndex);
const textPath = groups.map(resourceIndex => {
var _resource$items$find;
const resourceId = leafGroups[resourceIndex];
const resource = resourceById[resourceIndex];
return null === resource || void 0 === resource || null === (_resource$items$find = resource.items.find(item => item.id === resourceId)) || void 0 === _resource$items$find ? void 0 : _resource$items$find.text
}).filter(Boolean);
return textPath
};
exports.getResourcesByGroupIndex = (groupsLeafs, resourceById, groupIndex) => {
const leafGroups = getLeafGroupValues(groupsLeafs, groupIndex);
return Object.entries(resourceById).filter(_ref => {
let [resourceIndex] = _ref;
return void 0 !== leafGroups[resourceIndex]
}).map(_ref2 => {
let [resourceIndex, resource] = _ref2;
return Object.assign({}, resource, {
items: resource.items.filter(item => item.id === leafGroups[resourceIndex])
})
})
}
},
42409(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ResourceManager = void 0;
var _appointment_resource_data_accessor = __webpack_require__( /*! ../data_accessor/appointment_resource_data_accessor */ 5450);
var _resource_loader = __webpack_require__( /*! ../loader/resource_loader */ 9440);
var _appointment_color_utils = __webpack_require__( /*! ./appointment_color_utils */ 97310);
var _appointment_groups_utils = __webpack_require__( /*! ./appointment_groups_utils */ 11649);
var _group_utils = __webpack_require__( /*! ./group_utils */ 76131);
exports.ResourceManager = class {
constructor(config) {
this.resources = [];
this.resourceById = {};
this.groups = [];
this.groupsLeafs = [];
this.groupsTree = [];
null === config || void 0 === config || config.filter(_appointment_resource_data_accessor.getResourceIndex).forEach(item => {
const loader = new _resource_loader.ResourceLoader(item);
this.resourceById[loader.resourceIndex] = loader;
this.resources.push(loader)
})
}
async load(groupsToLoad) {
let forceReload = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
await Promise.all(groupsToLoad.map(group => {
var _this$resourceById$gr;
return null === (_this$resourceById$gr = this.resourceById[group]) || void 0 === _this$resourceById$gr ? void 0 : _this$resourceById$gr.load(forceReload)
}))
}
async loadGroupResources() {
let groups = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
let forceReload = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
await this.load(groups, forceReload);
const {
groupTree: groupTree,
groupLeafs: groupLeafs
} = (0, _group_utils.groupResources)(this.resourceById, groups);
this.groups = groups;
this.groupsLeafs = groupLeafs;
this.groupsTree = groupTree
}
groupCount() {
return this.groupsLeafs.length
}
groupResources() {
return this.groups.map(group => this.resourceById[group]).filter(Boolean)
}
async loadAppointmentsResources(items) {
let forceReload = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
const groupsToLoad = Object.keys(this.resourceById).filter(resourceIndex => !this.resourceById[resourceIndex].isLoaded() && items.some(item => this.resourceById[resourceIndex].idsGetter(item).length > 0));
await this.load(groupsToLoad, forceReload)
}
async getAppointmentColor(appointmentConfig) {
return (0, _appointment_color_utils.getAppointmentColor)(this.resources, this.groupsLeafs, this.groups, appointmentConfig)
}
async getAppointmentResourcesValues(appointment) {
const appointmentGroups = (0, _appointment_groups_utils.getAppointmentGroupValues)(appointment, this.resources);
const groups = Object.keys(appointmentGroups);
await this.load(groups);
return (0, _appointment_groups_utils.getAppointmentResources)(appointmentGroups, this.resourceById)
}
dispose() {
Object.values(this.resourceById).forEach(item => item.dispose())
}
}
},
67673(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _filter_appointments = __webpack_require__( /*! ./filtration/filter_appointments */ 12206);
var _generate_agenda_view_model = __webpack_require__( /*! ./generate_view_model/generate_agenda_view_model */ 46040);
var _generate_grid_view_model = __webpack_require__( /*! ./generate_view_model/generate_grid_view_model */ 57196);
var _option_manager = __webpack_require__( /*! ./generate_view_model/options/option_manager */ 25644);
var _get_appointment_info = __webpack_require__( /*! ./get_appointment_info */ 673);
var _prepare_appointments = __webpack_require__( /*! ./preparation/prepare_appointments */ 90174);
exports.default = class {
get filteredItems() {
return this._filteredItems
}
get sortedItems() {
return this._sortedItems
}
constructor(schedulerStore) {
this.schedulerStore = schedulerStore;
this.preparedItems = [];
this._filteredItems = [];
this._sortedItems = []
}
prepareAppointments(items) {
this.preparedItems = (0, _prepare_appointments.prepareAppointments)(this.schedulerStore, items)
}
filterAppointments() {
this._filteredItems = (0, _filter_appointments.filterAppointments)(this.schedulerStore, this.preparedItems)
}
hasAllDayAppointments() {
return this._filteredItems.filter(item => item.isAllDayPanelOccupied).length > 0
}
generateViewModel() {
const viewType = this.schedulerStore.currentView.type;
if ("agenda" === viewType) {
const viewModel = (0, _generate_agenda_view_model.generateAgendaViewModel)(this.schedulerStore, this._filteredItems);
return viewModel.map(item => Object.assign({}, item, {
isAgendaModel: true,
info: (0, _get_appointment_info.getAgendaAppointmentInfo)(item)
}))
}
const optionManager = new _option_manager.OptionManager(this.schedulerStore);
this._sortedItems = (0, _generate_grid_view_model.sortAppointments)(optionManager, this._filteredItems);
const viewModel = (0, _generate_grid_view_model.generateGridViewModel)(this.schedulerStore, optionManager, this._sortedItems);
const isSkipResizing = appointment => appointment.isAllDayPanelOccupied && "day" === viewType && 1 === this.schedulerStore.currentView.intervalCount;
const toCollectedItem = item => ({
itemData: item.itemData,
allDay: item.isAllDayPanelOccupied,
groupIndex: item.groupIndex,
width: item.width,
height: item.height,
info: (0, _get_appointment_info.getAppointmentInfo)(item)
});
return viewModel.map(item => {
if (item.items.length) {
return {
itemData: item.itemData,
allDay: item.isAllDayPanelOccupied,
groupIndex: item.groupIndex,
sortedIndex: item.sortedIndex,
top: item.top,
left: item.left,
width: item.width,
height: item.height,
isCompact: item.isCompact,
items: item.items.map(toCollectedItem)
}
}
return (item => ({
itemData: item.itemData,
allDay: item.isAllDayPanelOccupied,
groupIndex: item.groupIndex,
sortedIndex: item.sortedIndex,
direction: item.direction,
level: item.level,
maxLevel: item.maxLevel,
empty: item.empty,
top: item.top,
left: item.left,
height: item.height,
width: item.width,
reduced: item.reduced,
partIndex: item.partIndex,
partTotalCount: item.partCount,
rowIndex: item.rowIndex,
columnIndex: item.columnIndex,
skipResizing: isSkipResizing(item),
info: (0, _get_appointment_info.getAppointmentInfo)(item)
}))(item)
})
}
}
},
90349(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getCompareOptions = void 0;
var _m_utils_time_zone = (e = __webpack_require__( /*! ../../m_utils_time_zone */ 18648), e && e.__esModule ? e : {
default: e
});
var e;
exports.getCompareOptions = schedulerStore => {
const workspace = schedulerStore.getWorkSpace();
const dateRange = workspace.getDateRange();
const compareOptions = {
startDayHour: schedulerStore.getViewOption("startDayHour"),
endDayHour: schedulerStore.getViewOption("endDayHour"),
min: _m_utils_time_zone.default.createUTCDateWithLocalOffset(dateRange[0]).getTime(),
max: _m_utils_time_zone.default.createUTCDateWithLocalOffset(dateRange[1]).getTime(),
skippedDays: schedulerStore.currentView.skippedDays
};
return compareOptions
}
},
44442(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isAppointmentMatchedIntervals = void 0;
exports.isAppointmentMatchedIntervals = (_ref, intervals) => {
let {
startDate: startDate,
endDate: endDate
} = _ref;
const intersectionIntervalIndex = intervals.findIndex(_ref2 => {
let {
max: max
} = _ref2;
return startDate < max
});
if (-1 === intersectionIntervalIndex) {
return false
}
const intervalStartDate = intervals[intersectionIntervalIndex].min;
return startDate >= intervalStartDate || endDate > intervalStartDate
}
},
31597(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shiftIntervals = void 0;
exports.shiftIntervals = (intervals, viewOffset) => intervals.map(interval => Object.assign({}, interval, {
min: interval.min + viewOffset,
max: interval.max + viewOffset
}))
},
85588(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.splitIntervalByDay = void 0;
var _m_date = __webpack_require__( /*! ../../../core/utils/m_date */ 66570);
exports.splitIntervalByDay = _ref => {
let {
startDayHour: startDayHour,
endDayHour: endDayHour,
min: min,
max: max,
skippedDays: skippedDays
} = _ref;
if (endDayHour < startDayHour) {
return []
}
const startTime = _m_date.dateUtils.dateTimeFromDecimal(startDayHour);
const endTime = _m_date.dateUtils.dateTimeFromDecimal(endDayHour);
const normalizedMin = new Date(min);
normalizedMin.setUTCHours(startTime.hours, startTime.minutes, 0, 0);
const normalizedMax = new Date(max - 1);
normalizedMax.setUTCHours(endTime.hours, endTime.minutes, 0, 0);
const time = normalizedMin;
const maxTime = normalizedMax;
const result = [];
while (time < maxTime) {
if (!skippedDays.includes(time.getUTCDay())) {
const intervalMax = new Date(time);
intervalMax.setUTCHours(endTime.hours, endTime.minutes, 0, 0);
result.push({
min: time.getTime(),
max: intervalMax.getTime()
})
}
time.setUTCDate(time.getUTCDate() + 1)
}
return result
}
},
28032(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.trimInterval = void 0;
exports.trimInterval = _ref => {
let {
min: min,
max: max
} = _ref;
const maxMinusDay = new Date(max - 1).setUTCHours(0, 0, 0, 0);
const maxMinusDayDate = new Date(maxMinusDay);
return {
min: new Date(min).setUTCHours(0, 0, 0, 0),
max: maxMinusDayDate.setDate(maxMinusDayDate.getDate() + 1)
}
}
},
12206(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.filterAppointments = void 0;
var _get_compare_options = __webpack_require__( /*! ../common/get_compare_options */ 90349);
var _add_all_day_panel_occupation = __webpack_require__( /*! ./utils/add_all_day_panel_occupation */ 13646);
var _filter_by_attributes = __webpack_require__( /*! ./utils/filter_by_attributes/filter_by_attributes */ 79248);
var _filter_by_intervals = __webpack_require__( /*! ./utils/filter_by_intervals/filter_by_intervals */ 46582);
var _get_filter_options = __webpack_require__( /*! ./utils/get_filter_options/get_filter_options */ 77652);
var _split_by_group_index = __webpack_require__( /*! ./utils/split_by_group_index */ 41702);
var _split_by_recurrence = __webpack_require__( /*! ./utils/split_by_recurrence/split_by_recurrence */ 98710);
exports.filterAppointments = (schedulerStore, appointments) => {
const compareOptions = (0, _get_compare_options.getCompareOptions)(schedulerStore);
const options = (0, _get_filter_options.getFilterOptions)(schedulerStore, compareOptions);
const step1 = (0, _add_all_day_panel_occupation.addAllDayPanelOccupation)(appointments, options);
const step2 = (0, _filter_by_attributes.filterByAttributes)(step1, options);
const step3 = (0, _split_by_recurrence.splitByRecurrence)(step2, options);
const step4 = (0, _filter_by_intervals.filterByIntervals)(step3, options);
const step5 = (appointments => appointments.map(appointment => Object.assign({}, appointment, {
duration: appointment.endDateUTC - appointment.startDateUTC
})))(step4);
const step6 = (0, _split_by_group_index.splitByGroupIndex)(step5, options);
const step7 = (appointments => appointments.map(appointment => Object.assign({}, appointment, {
datesBeforeSplit: {
startDateUTC: appointment.startDateUTC,
endDateUTC: appointment.endDateUTC
}
})))(step6);
return step7
}
},
13646(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addAllDayPanelOccupation = void 0;
var _base = __webpack_require__( /*! ../../../r1/utils/base */ 44611);
exports.addAllDayPanelOccupation = (appointments, _ref) => {
let {
supportAllDayPanel: supportAllDayPanel,
allDayPanelMode: allDayPanelMode
} = _ref;
return appointments.map(appointment => {
const isAllDayPanelOccupied = supportAllDayPanel && (0, _base.isAppointmentTakesAllDay)({
allDay: appointment.allDay,
startDate: new Date(appointment.source.startDate),
endDate: new Date(appointment.source.endDate)
}, allDayPanelMode);
return Object.assign({}, appointment, {
isAllDayPanelOccupied: isAllDayPanelOccupied
})
})
}
},
79248(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.filterByAttributes = void 0;
var _is_appointment_matched_resources = __webpack_require__( /*! ./is_appointment_matched_resources */ 98281);
exports.filterByAttributes = (appointments, _ref) => {
let {
resourceManager: resourceManager,
showAllDayPanel: showAllDayPanel,
supportAllDayPanel: supportAllDayPanel
} = _ref;
return appointments.filter(appointment => {
if (!appointment.visible) {
return false
}
const allDayPanelAppointmentHidden = Boolean(supportAllDayPanel && !showAllDayPanel && appointment.isAllDayPanelOccupied);
if (allDayPanelAppointmentHidden) {
return false
}
const resources = resourceManager.groupResources();
return (0, _is_appointment_matched_resources.isAppointmentMatchedResources)(appointment.itemData, resources)
})
}
},
98281(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isAppointmentMatchedResources = void 0;
var _common = __webpack_require__( /*! ../../../../../../core/utils/common */ 17781);
var _appointment_groups_utils = __webpack_require__( /*! ../../../../utils/resource_manager/appointment_groups_utils */ 11649);
exports.isAppointmentMatchedResources = (appointment, groupsResources) => {
if (0 === groupsResources.length) {
return true
}
const appointmentGroupValues = (0, _appointment_groups_utils.getAppointmentGroupValues)(appointment, groupsResources);
return groupsResources.every(resource => {
const value = appointmentGroupValues[resource.resourceIndex];
return null === value || void 0 === value ? void 0 : value.some(id => resource.items.some(item => (0, _common.equalByValue)(id, item.id)))
})
}
},
46582(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.filterByIntervals = void 0;
var _is_appointment_matched_intervals = __webpack_require__( /*! ../../../common/is_appointment_matched_intervals */ 44442);
exports.filterByIntervals = (appointments, options) => appointments.filter(appointment => {
const intervals = ((appointment, _ref) => {
let {
allDayIntervals: allDayIntervals,
regularIntervals: regularIntervals,
isDateTimeView: isDateTimeView
} = _ref;
if (isDateTimeView && appointment.allDay && !appointment.isAllDayPanelOccupied) {
return regularIntervals.map(interval => ({
min: new Date(interval.min).setUTCHours(0, 0, 0, 0),
max: interval.max
}))
}
return appointment.allDay || appointment.isAllDayPanelOccupied ? allDayIntervals : regularIntervals
})(appointment, options);
const startDate = appointment.startDateUTC;
const endDate = appointment.allDay ? appointment.endDateUTC + 1 : appointment.endDateUTC;
return (0, _is_appointment_matched_intervals.isAppointmentMatchedIntervals)({
startDate: startDate,
endDate: endDate
}, intervals)
})
},
77652(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getFilterOptions = void 0;
var _shift_intervals = __webpack_require__( /*! ../../../common/shift_intervals */ 31597);
var _get_visible_date_time_intervals = __webpack_require__( /*! ./get_visible_date_time_intervals */ 98243);
const VIEWS_WITH_ALL_DAY_PANEL = ["day", "week", "workWeek"];
const DATE_TIME_VIEWS = ["day", "week", "workWeek", "timelineDay", "timelineWeek", "timelineWorkWeek"];
exports.getFilterOptions = (schedulerStore, compareOptions) => {
const viewOffset = schedulerStore.getViewOffsetMs();
const viewType = schedulerStore.currentView.type;
const supportAllDayPanel = VIEWS_WITH_ALL_DAY_PANEL.includes(viewType);
const isDateTimeView = DATE_TIME_VIEWS.includes(viewType);
return {
allDayPanelMode: schedulerStore.getViewOption("allDayPanelMode"),
supportAllDayPanel: supportAllDayPanel,
isDateTimeView: isDateTimeView,
showAllDayPanel: schedulerStore.option("showAllDayPanel"),
resourceManager: schedulerStore.resourceManager,
timeZone: schedulerStore.getTimeZone(),
dataAccessor: schedulerStore._dataAccessors,
firstDayOfWeek: schedulerStore.option("firstDayOfWeek"),
allDayIntervals: (0, _shift_intervals.shiftIntervals)((0, _get_visible_date_time_intervals.getVisibleDateTimeIntervals)(compareOptions, true), viewOffset),
regularIntervals: (0, _shift_intervals.shiftIntervals)((0, _get_visible_date_time_intervals.getVisibleDateTimeIntervals)(compareOptions, false), viewOffset)
}
}
},
98243(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getVisibleDateTimeIntervals = void 0;
var _split_interval_by_days = __webpack_require__( /*! ../../../common/split_interval_by_days */ 85588);
exports.getVisibleDateTimeIntervals = (_ref, isDateViewOnly) => {
let {
startDayHour: startDayHour,
endDayHour: endDayHour,
min: min,
max: max,
skippedDays: skippedDays
} = _ref;
if (isDateViewOnly || 0 === startDayHour && 24 === endDayHour) {
return (intervals => {
if (0 === intervals.length) {
return []
}
return intervals.reduce((result, interval) => {
const last = result[result.length - 1];
if (last.max === interval.min) {
last.max = interval.max;
return result
}
result.push(interval);
return result
}, [{
min: intervals[0].min,
max: intervals[0].min
}])
})((0, _split_interval_by_days.splitIntervalByDay)({
startDayHour: 0,
endDayHour: 24,
min: min,
max: max,
skippedDays: skippedDays
}))
}
return (0, _split_interval_by_days.splitIntervalByDay)({
startDayHour: startDayHour,
endDayHour: endDayHour,
min: min,
max: max,
skippedDays: skippedDays
})
}
},
41702(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.splitByGroupIndex = void 0;
var _appointment_groups_utils = __webpack_require__( /*! ../../../utils/resource_manager/appointment_groups_utils */ 11649);
exports.splitByGroupIndex = (appointments, _ref) => {
let {
resourceManager: resourceManager
} = _ref;
return appointments.reduce((result, appointment) => {
if (0 === resourceManager.groupsLeafs.length) {
result.push(Object.assign({}, appointment, {
groupIndex: 0
}));
return result
}
const groupValues = (0, _appointment_groups_utils.getAppointmentGroupValues)(appointment.itemData, resourceManager.resources);
const groupIndexes = (0, _appointment_groups_utils.getAppointmentGroupIndex)(groupValues, resourceManager.groupsLeafs);
groupIndexes.forEach(groupIndex => {
result.push(Object.assign({}, appointment, {
groupIndex: groupIndex
}))
});
return result
}, [])
}
},
47824(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.generateRecurrenceUTCDates = void 0;
var _date = __webpack_require__( /*! ../../../../../core/utils/date */ 55594);
var _rrule = __webpack_require__( /*! rrule */ 27692);
var _base = __webpack_require__( /*! ../../../../recurrence/base */ 57872);
var _get_date_information = __webpack_require__( /*! ./get_date_information */ 98861);
const WEEK_DAY_NUMBERS = [6, 0, 1, 2, 3, 4, 5];
exports.generateRecurrenceUTCDates = (appointment, _ref) => {
let {
firstDayOfWeek: firstDayOfWeek,
interval: interval,
timeZone: timeZone,
startDateTimeZone: startDateTimeZone
} = _ref;
if (!appointment.hasRecurrenceRule || !appointment.recurrenceRule) {
return [appointment.source.startDate]
}
const startDateOffset = (0, _get_date_information.getDateOffsetMs)(appointment.source.startDate, startDateTimeZone);
const targetOffset = (0, _get_date_information.getDateOffsetMs)(appointment.source.startDate, timeZone);
const startDateOffsetBase = startDateTimeZone ? startDateOffset - targetOffset : targetOffset;
const duration = appointment.source.endDate - appointment.source.startDate;
const start = appointment.source.startDate + startDateOffsetBase;
const min = interval.min - duration - targetOffset + startDateOffsetBase;
const max = interval.max - targetOffset + startDateOffsetBase;
const rule = (0, _base.parseRecurrenceRule)(appointment.recurrenceRule);
const ruleOptions = _rrule.RRule.parseString(appointment.recurrenceRule);
ruleOptions.dtstart = new Date(start);
if (!ruleOptions.wkst && firstDayOfWeek) {
ruleOptions.wkst = WEEK_DAY_NUMBERS[firstDayOfWeek]
}
if (rule.until) {
const untilOffset = (0, _get_date_information.getDateOffsetMs)(rule.until.getTime(), timeZone);
ruleOptions.until = _date.dateUtilsTs.addOffsets(rule.until, untilOffset)
}
const rRuleSet = new _rrule.RRuleSet;
const rRule = new _rrule.RRule(ruleOptions);
rRuleSet.rrule(rRule);
return rRuleSet.between(new Date(min), new Date(max), true).map(date => date.getTime() - startDateOffsetBase)
}
},
25833(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAppointmentRecurrenceOccurrences = void 0;
var _base = __webpack_require__( /*! ../../../../recurrence/base */ 57872);
var _generate_recurrence_utc_dates = __webpack_require__( /*! ./generate_recurrence_utc_dates */ 47824);
var _get_date_information = __webpack_require__( /*! ./get_date_information */ 98861);
exports.getAppointmentRecurrenceOccurrences = (appointment, _ref) => {
let {
firstDayOfWeek: firstDayOfWeek,
interval: interval,
timeZone: timeZone
} = _ref;
const {
source: {
startDate: startDateMsBase,
endDate: endDateMsBase
},
startDateTimeZone: startDateTimeZone,
endDateTimeZone: endDateTimeZone
} = appointment;
if (!appointment.hasRecurrenceRule) {
const startDateInfo = (0, _get_date_information.getDateInformation)(startDateMsBase, timeZone);
const endDateInfo = (0, _get_date_information.getDateInformation)(endDateMsBase, timeZone);
const [startDateFix, endDateFix] = ((startDateInfo, endDateInfo) => {
switch (true) {
case startDateInfo.isUnreachableTime && endDateInfo.isUnreachableTime:
return [startDateInfo.deltaMs, startDateInfo.deltaMs];
case startDateInfo.isUnreachableTime:
return [startDateInfo.deltaMs, 0];
case endDateInfo.isUnreachableTime:
return [0, endDateInfo.deltaMs];
case endDateInfo.isDoubleTimeStart:
return [0, -endDateInfo.deltaMs];
default:
return [0, 0]
}
})(startDateInfo, endDateInfo);
return [Object.assign({}, appointment, {
startDateUTC: startDateMsBase + startDateFix + startDateInfo.offsetMs,
endDateUTC: endDateMsBase + endDateFix + endDateInfo.offsetMs
})]
}
const duration = endDateMsBase - startDateMsBase;
const dates = (0, _generate_recurrence_utc_dates.generateRecurrenceUTCDates)(appointment, {
firstDayOfWeek: firstDayOfWeek,
interval: interval,
timeZone: timeZone,
startDateTimeZone: startDateTimeZone
});
const startDateOffsetBase = (0, _get_date_information.getDateOffsetMs)(startDateMsBase, timeZone);
const startDateAppointmentOffsetBase = (0, _get_date_information.getDateOffsetMs)(startDateMsBase, startDateTimeZone);
const endDateAppointmentOffsetBase = (0, _get_date_information.getDateOffsetMs)(endDateMsBase, endDateTimeZone);
const exceptionDates = new Set(appointment.hasRecurrenceRule && appointment.recurrenceException ? appointment.recurrenceException.split(",").map(date => (0, _base.getDateByAsciiString)(date)).map(date => date ? date.getTime() : 0) : []);
return dates.map(startDateMs => {
const endDateMs = startDateMs + duration;
const startDateInfo = (0, _get_date_information.getDateInformation)(startDateMs, timeZone);
const startDateAppointmentOffset = (0, _get_date_information.getDateOffsetMs)(startDateMs, startDateTimeZone);
const startChange = startDateOffsetBase - startDateInfo.offsetMs;
const startAppointmentChange = startDateAppointmentOffsetBase - startDateAppointmentOffset;
const startDateDSTChange = startDateTimeZone ? startAppointmentChange : startChange;
const endDateInfo = (0, _get_date_information.getDateInformation)(endDateMs, timeZone);
const endDateAppointmentOffset = (0, _get_date_information.getDateOffsetMs)(endDateMs, endDateTimeZone);
const endChange = startDateOffsetBase - endDateInfo.offsetMs;
const endAppointmentChange = endDateAppointmentOffsetBase - endDateAppointmentOffset;
const endDateDSTChange = endDateTimeZone ? endAppointmentChange : endChange;
const [startDateFix, endDateFix] = ((startDateInfo, endDateInfo) => {
switch (true) {
case startDateInfo.isUnreachableTime:
return [startDateInfo.deltaMs, startDateInfo.deltaMs];
case endDateInfo.isUnreachableTime:
return [0, endDateInfo.deltaMs];
default:
return [0, 0]
}
})(startDateInfo, endDateInfo);
const sourceStartDate = startDateMs + startDateDSTChange;
const sourceEndDate = endDateMs + endDateDSTChange;
return Object.assign({}, appointment, {
source: {
startDate: sourceStartDate,
endDate: sourceEndDate
},
startDateUTC: sourceStartDate + startDateFix + startDateInfo.offsetMs,
endDateUTC: sourceEndDate + endDateFix + endDateInfo.offsetMs
})
}).filter(item => !exceptionDates.has(item.source.startDate))
}
},
98861(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDateOffsetMs = exports.getDateInformation = exports.findDSTOfDay = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../../../core/utils/date */ 41380));
var _global_cache = __webpack_require__( /*! ../../../../global_cache */ 23710);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../../../m_utils_time_zone */ 18648));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const toMs = _date.default.dateToMilliseconds;
const getOffsetHours = _m_utils_time_zone.default.calculateTimezoneByValue;
const HOUR_MS = toMs("hour");
const roundToHour = date => Math.round(date / HOUR_MS) * HOUR_MS;
const findDSTOfDay = (date, timeZone) => {
const minDate = new Date(date).setUTCHours(0, 0, 0, 0);
return _global_cache.globalCache.DST.memo(`${minDate}${timeZone}`, () => {
const min = roundToHour(minDate - HOUR_MS);
const max = roundToHour(minDate + toMs("day") + HOUR_MS);
const minOffset = getOffsetHours(timeZone, min) ?? 0;
const maxOffset = getOffsetHours(timeZone, max) ?? 0;
if (minOffset === maxOffset) {
return [-date, minOffset * HOUR_MS, maxOffset * HOUR_MS]
}
let left = min;
let right = max;
while (right - left > HOUR_MS / 3) {
const mid = left + (right - left) / 2;
const offset = getOffsetHours(timeZone, roundToHour(mid));
if (offset === minOffset) {
left = mid
} else {
right = mid
}
}
return [roundToHour(left) + HOUR_MS, minOffset * HOUR_MS, maxOffset * HOUR_MS]
})
};
exports.findDSTOfDay = findDSTOfDay;
const getDateInformation = (date, timeZone) => {
const [targetDST, beforeDSTOffset, afterDSTOffset] = findDSTOfDay(date, timeZone);
const deltaMs = afterDSTOffset - beforeDSTOffset;
const condition = deltaMs > 0 ? date < targetDST + deltaMs : date < targetDST;
return {
offsetMs: condition ? beforeDSTOffset : afterDSTOffset,
isUnreachableTime: deltaMs > 0 && date >= targetDST && date < targetDST + deltaMs,
isDoubleTimeStart: date === targetDST,
deltaMs: deltaMs
}
};
exports.getDateInformation = getDateInformation;
exports.getDateOffsetMs = (date, timeZone) => timeZone ? getDateInformation(date, timeZone).offsetMs : 0
},
98710(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.splitByRecurrence = void 0;
var _get_appointment_recurrence_occurrences = __webpack_require__( /*! ./get_appointment_recurrence_occurrences */ 25833);
exports.splitByRecurrence = (entities, _ref) => {
let {
timeZone: timeZone,
firstDayOfWeek: firstDayOfWeek,
allDayIntervals: allDayIntervals,
regularIntervals: regularIntervals
} = _ref;
return entities.reduce((acc, appointment) => {
const intervals = appointment.allDay || appointment.isAllDayPanelOccupied ? allDayIntervals : regularIntervals;
const recurrenceInterval = {
min: intervals[0].min,
max: intervals[intervals.length - 1].max
};
const occurrences = (0, _get_appointment_recurrence_occurrences.getAppointmentRecurrenceOccurrences)(appointment, {
firstDayOfWeek: firstDayOfWeek,
interval: recurrenceInterval,
timeZone: timeZone
});
acc.push(...occurrences);
return acc
}, [])
}
},
46040(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.generateAgendaViewModel = void 0;
var _get_compare_options = __webpack_require__( /*! ../common/get_compare_options */ 90349);
var _split_interval_by_days = __webpack_require__( /*! ../common/split_interval_by_days */ 85588);
var _add_last_in_group = __webpack_require__( /*! ./steps/add_last_in_group */ 6238);
var _add_sorted_index = __webpack_require__( /*! ./steps/add_sorted_index */ 84988);
var _sorting = __webpack_require__( /*! ./steps/sorting */ 12628);
var _split_by_parts = __webpack_require__( /*! ./steps/split_by_parts/split_by_parts */ 89959);
exports.generateAgendaViewModel = (schedulerStore, items) => {
const height = schedulerStore.fire("getAgendaVerticalStepHeight");
const compareOptions = (0, _get_compare_options.getCompareOptions)(schedulerStore);
const intervals = (0, _split_interval_by_days.splitIntervalByDay)(Object.assign({}, compareOptions, {
startDayHour: 0,
endDayHour: 24
}));
let entities = (0, _split_by_parts.splitByParts)(items, intervals);
entities = (entities => entities.map(entity => Object.assign({}, entity, {
datesAfterSplit: {
startDateUTC: entity.startDateUTC,
endDateUTC: entity.endDateUTC
}
})))(entities);
entities = ((entities, height) => entities.map(entity => Object.assign({}, entity, {
height: height,
width: "100%"
})))(entities, height);
entities = (0, _sorting.sortByStartDate)(entities);
entities = (0, _sorting.sortByGroupIndex)(entities);
entities = (0, _add_last_in_group.addLastInGroup)(entities);
return (0, _add_sorted_index.addSortedIndex)(entities)
}
},
57196(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sortAppointments = exports.generateGridViewModel = void 0;
var _add_collector = __webpack_require__( /*! ./steps/add_collector/add_collector */ 58607);
var _add_direction = __webpack_require__( /*! ./steps/add_direction */ 16665);
var _add_emptiness = __webpack_require__( /*! ./steps/add_emptiness */ 27602);
var _add_geometry = __webpack_require__( /*! ./steps/add_geometry/add_geometry */ 84181);
var _add_position = __webpack_require__( /*! ./steps/add_position */ 68825);
var _add_sorted_index = __webpack_require__( /*! ./steps/add_sorted_index */ 84988);
var _expand_all_day = __webpack_require__( /*! ./steps/expand_all_day */ 56295);
var _group_by_group_index = __webpack_require__( /*! ./steps/group_by_group_index */ 6332);
var _maybe_split = __webpack_require__( /*! ./steps/maybe_split */ 88779);
var _snap_to_cells = __webpack_require__( /*! ./steps/snap_to_cells */ 5146);
var _sorting = __webpack_require__( /*! ./steps/sorting */ 12628);
var _split_by_parts = __webpack_require__( /*! ./steps/split_by_parts/split_by_parts */ 89959);
var _virtual_screen_crop = __webpack_require__( /*! ./steps/virtual_screen_crop */ 29983);
var _virtual_screen_filter = __webpack_require__( /*! ./steps/virtual_screen_filter */ 84751);
exports.sortAppointments = (optionManager, items) => {
const {
isMonthView: isMonthView,
hasAllDayPanel: hasAllDayPanel,
viewOffset: viewOffset,
compareOptions: {
endDayHour: endDayHour
}
} = optionManager.options;
const step2 = (0, _maybe_split.maybeSplit)(items, hasAllDayPanel, (entities, panelName) => {
const byGroup = (0, _group_by_group_index.groupByGroupIndex)(entities);
const positionInsideGroup = byGroup.map(group => {
(0, _sorting.sortByDuration)(group);
(0, _sorting.sortByStartDate)(group);
const innerStep0 = isMonthView || "allDayPanel" === panelName ? (0, _expand_all_day.expandAllDayAllDayPanel)(group, endDayHour, viewOffset) : (0, _expand_all_day.expandAllDayRegularPanel)(group);
const innerStep1 = (0, _split_by_parts.splitByParts)(innerStep0, optionManager.getSplitIntervals(panelName));
(0, _sorting.sortByDuration)(innerStep1);
(0, _sorting.sortByStartDate)(innerStep1);
(0, _sorting.sortByGroupIndex)(innerStep1);
const innerStep2 = (0, _add_position.addPosition)(innerStep1, optionManager.getCells(panelName));
const innerStep3 = isMonthView || "allDayPanel" === panelName ? (0, _snap_to_cells.snapToCells)(innerStep2, optionManager.getCells(panelName)) : innerStep2;
const innerStep4 = (0, _add_collector.addCollector)(innerStep3, optionManager.getCollectorOptions(panelName));
return innerStep4
});
return positionInsideGroup.flat()
});
const step3 = (0, _add_sorted_index.addSortedIndex)(step2);
return step3
};
exports.generateGridViewModel = (schedulerStore, optionManager, items) => {
const {
viewOrientation: viewOrientation,
isMonthView: isMonthView,
isAdaptivityEnabled: isAdaptivityEnabled,
isTimelineView: isTimelineView,
hasAllDayPanel: hasAllDayPanel,
isVirtualScrolling: isVirtualScrolling
} = optionManager.options;
const {
viewDataProvider: viewDataProvider
} = schedulerStore._workSpace;
const step4 = (0, _virtual_screen_filter.filterByVirtualScreen)(items, viewDataProvider, isVirtualScrolling);
const step5 = (0, _maybe_split.maybeSplit)(step4, hasAllDayPanel, (entities, panelName) => {
const innerStep = (0, _add_geometry.addGeometry)(entities, optionManager.getGeometryOptions(panelName));
return innerStep
});
const step6 = (0, _virtual_screen_crop.cropByVirtualScreen)(step5, optionManager.getVirtualCropOptions());
const step7 = (0, _add_direction.addDirection)(step6, "horizontal", viewOrientation);
const step8 = (0, _add_emptiness.addEmptiness)(step7, {
isTimelineView: isTimelineView,
isAdaptivityEnabled: isAdaptivityEnabled,
isMonthView: isMonthView
});
return step8
}
},
52253(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getCollectorSize = void 0;
const getPxValue = function() {
let value = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
let defaultValue = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
if (!value.endsWith("px")) {
return defaultValue
}
return parseInt(value, 10) || defaultValue
};
exports.getCollectorSize = (cellSize, collectorCSS, defaultCollectorWidth) => {
const parsedSize = {
height: getPxValue(collectorCSS.height, 20),
width: getPxValue(collectorCSS.width, defaultCollectorWidth),
marginRight: getPxValue(collectorCSS.marginRight),
marginLeft: getPxValue(collectorCSS.marginLeft),
marginTop: getPxValue(collectorCSS.marginTop),
marginBottom: getPxValue(collectorCSS.marginBottom)
};
const marginHeight = parsedSize.marginTop + parsedSize.marginBottom;
const marginWidth = parsedSize.marginLeft + parsedSize.marginRight;
const height = Math.max(20, parsedSize.height);
const width = Math.max(20, parsedSize.width || cellSize.width - marginWidth);
return {
collectorSize: {
width: width,
height: height
},
collectorWithMarginsSize: {
width: width + marginWidth,
height: height + marginHeight
}
}
}
},
62041(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGroupSize = void 0;
exports.getGroupSize = _ref => {
let {
cellSize: cellSize,
cellDurationMinutes: cellDurationMinutes,
endDayHour: endDayHour,
startDayHour: startDayHour,
cells: cells,
intervals: intervals,
viewType: viewType,
isAllDayPanel: isAllDayPanel
} = _ref;
switch (viewType) {
case "month":
case "timelineMonth": {
const intervalDaysCount = cells.filter(cell => 0 === cell.rowIndex).length;
return {
width: cellSize.width * intervalDaysCount,
height: cellSize.height * intervals.length
}
}
case "timelineDay":
case "timelineWeek":
case "timelineWorkWeek":
return {
width: cellSize.width * cells.length, height: cellSize.height
};
case "day":
case "week":
case "workWeek":
return {
width: isAllDayPanel ? cellSize.width * cells.length : cellSize.width * intervals.length, height: cellSize.height * (endDayHour - startDayHour) * (60 / cellDurationMinutes)
};
default:
return cellSize
}
}
},
64565(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMaxLevel = void 0;
var _swap_by_view_orientation = __webpack_require__( /*! ../steps/add_geometry/swap_by_view_orientation */ 44175);
var _get_min_appointment_size = __webpack_require__( /*! ./get_min_appointment_size */ 16270);
exports.getMaxLevel = _ref => {
let {
maxAppointmentsPerCell: maxAppointmentsPerCell,
cellSize: cellSize,
collectorSize: collectorSize,
viewOrientation: viewOrientation,
isTimelineView: isTimelineView,
isAdaptivityEnabled: isAdaptivityEnabled
} = _ref;
switch (maxAppointmentsPerCell) {
case "auto": {
if (isAdaptivityEnabled && "horizontal" === viewOrientation) {
return 0
}
const cellSizeY = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(cellSize, viewOrientation).sizeY;
const isSmallCell = cellSizeY < 30;
if (isSmallCell) {
return 0
}
const defaultAppointmentSize = (0, _get_min_appointment_size.getDefaultAppointmentSize)({
isTimelineView: isTimelineView,
isAdaptivityEnabled: isAdaptivityEnabled,
viewOrientation: viewOrientation
});
const minAbstractSize = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(defaultAppointmentSize, viewOrientation);
const collectorSizeY = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(collectorSize, viewOrientation).sizeY;
const calculated = Math.floor(Math.max(0, cellSizeY - collectorSizeY) / minAbstractSize.sizeY);
return Math.max(calculated, isAdaptivityEnabled ? 0 : 1)
}
case "unlimited":
return -1;
default:
return parseInt(String(maxAppointmentsPerCell), 10)
}
}
},
16270(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMinAppointmentSize = exports.getDefaultAppointmentSize = void 0;
var _themes = __webpack_require__( /*! ../../../../../ui/themes */ 52071);
const getMinAppointmentHeightByTheme = () => (0, _themes.isCompact)((0, _themes.current)()) ? 18 : 20;
exports.getMinAppointmentSize = options => {
const {
isTimelineView: isTimelineView,
isAdaptivityEnabled: isAdaptivityEnabled,
isMonthView: isMonthView,
isAllDayAppointment: isAllDayAppointment
} = options;
if (isAdaptivityEnabled) {
return {
width: 30,
height: 30
}
}
if (isTimelineView) {
return {
width: 40,
height: 35
}
}
const height = isMonthView || isAllDayAppointment ? getMinAppointmentHeightByTheme() : 12;
return {
width: 40,
height: height
}
};
exports.getDefaultAppointmentSize = _ref => {
let {
isTimelineView: isTimelineView,
isAdaptivityEnabled: isAdaptivityEnabled,
viewOrientation: viewOrientation
} = _ref;
if (isAdaptivityEnabled) {
return {
width: 30,
height: 30
}
}
return {
width: "vertical" === viewOrientation ? 50 : 40,
height: isTimelineView ? 60 : getMinAppointmentHeightByTheme()
}
}
},
55647(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMinutesCellIntervals = void 0;
var _split_interval_by_days = __webpack_require__( /*! ../../common/split_interval_by_days */ 85588);
exports.getMinutesCellIntervals = _ref => {
let {
intervals: intervals,
startDayHour: startDayHour,
endDayHour: endDayHour,
durationMinutes: durationMinutes,
skippedDays: skippedDays
} = _ref;
return intervals.reduce((result, interval, rowIndex) => {
const dayIntervals = (0, _split_interval_by_days.splitIntervalByDay)(Object.assign({}, interval, {
startDayHour: startDayHour,
endDayHour: endDayHour,
skippedDays: skippedDays
}));
let columnIndex = 0;
((intervals, skippedDays) => intervals.filter(item => !skippedDays.includes(new Date(item.min).getUTCDay())))(dayIntervals, skippedDays).forEach(dayInterval => {
const date = new Date(dayInterval.min);
while (date.getTime() < dayInterval.max) {
const min = date.getTime();
let max = date.setUTCMinutes(date.getUTCMinutes() + durationMinutes);
if (date.getUTCHours() > endDayHour) {
date.setUTCDate(date.getUTCDate() + 1);
date.setUTCHours(startDayHour, 0, 0, 0);
max = date.getTime()
}
result.push({
min: min,
max: max,
rowIndex: rowIndex,
columnIndex: columnIndex,
cellIndex: result.length
});
columnIndex += 1
}
});
return result
}, [])
}
},
17945(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMonthIntervals = void 0;
var _shift_intervals = __webpack_require__( /*! ../../common/shift_intervals */ 31597);
var _trim_interval = __webpack_require__( /*! ../../common/trim_interval */ 28032);
var _get_one_day_cell_intervals = __webpack_require__( /*! ./get_one_day_cell_intervals */ 99119);
const _excluded = ["startDayHour", "endDayHour", "skippedDays"];
exports.getMonthIntervals = (_ref, viewOffset, isTimeline) => {
let {
startDayHour: startDayHour,
endDayHour: endDayHour,
skippedDays: skippedDays
} = _ref, dateInterval = function(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue
}
t[n] = r[n]
}
}
return t
}(_ref, _excluded);
const trimmedInterval = (0, _trim_interval.trimInterval)(dateInterval);
const intervals = isTimeline ? [trimmedInterval] : (intervals => {
const result = [];
const date = new Date(intervals.min);
while (date.getTime() < intervals.max) {
const min = date.getTime();
date.setUTCDate(date.getUTCDate() + 7);
result.push({
min: min,
max: date.getTime()
})
}
return result
})(trimmedInterval);
const croppedIntervals = ((intervals, startDayHour, endDayHour) => intervals.map(item => Object.assign({}, item, {
min: new Date(item.min).setUTCHours(startDayHour, 0, 0, 0),
max: new Date(item.max - 1).setUTCHours(endDayHour, 0, 0, 0)
})))(intervals, startDayHour, endDayHour);
const shiftedIntervals = (0, _shift_intervals.shiftIntervals)(croppedIntervals, viewOffset);
const cells = (0, _get_one_day_cell_intervals.getOneDayCellIntervals)({
intervals: intervals,
startDayHour: startDayHour,
endDayHour: endDayHour,
skippedDays: skippedDays
});
const shiftedCells = (0, _shift_intervals.shiftIntervals)(cells, viewOffset);
return {
cells: shiftedCells,
dayIntervals: shiftedCells,
intervals: shiftedIntervals
}
}
},
99119(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getOneDayCellIntervals = void 0;
var _split_interval_by_days = __webpack_require__( /*! ../../common/split_interval_by_days */ 85588);
exports.getOneDayCellIntervals = _ref => {
let {
intervals: intervals,
startDayHour: startDayHour,
endDayHour: endDayHour,
skippedDays: skippedDays
} = _ref;
return intervals.reduce((result, interval, rowIndex) => {
const cells = (0, _split_interval_by_days.splitIntervalByDay)(Object.assign({}, interval, {
startDayHour: startDayHour,
endDayHour: endDayHour,
skippedDays: skippedDays
}));
let columnIndex = 0;
cells.forEach(cell => {
result.push({
min: cell.min,
max: cell.max,
rowIndex: rowIndex,
columnIndex: columnIndex,
cellIndex: result.length
});
columnIndex += 1
});
return result
}, [])
}
},
62125(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPanelCollectorOptions = void 0;
var _get_collector_size = __webpack_require__( /*! ./get_collector_size */ 52253);
var _get_max_level = __webpack_require__( /*! ./get_max_level */ 64565);
const UNLIMITED_COLLECTOR_SIZES = {
collectorSize: {
width: 0,
height: 0
},
collectorWithMarginsSize: {
width: 0,
height: 0
}
};
exports.getPanelCollectorOptions = (schedulerStore, _ref) => {
var _DOMMetaData$dateTabl;
let {
alwaysReserveSpaceForCollector: alwaysReserveSpaceForCollector,
isTimelineView: isTimelineView,
viewOrientation: viewOrientation,
isAdaptivityEnabled: isAdaptivityEnabled,
collectorCSS: collectorCSS,
DOMMetaData: DOMMetaData,
panelName: panelName
} = _ref;
const allDayPanelCellDOM = DOMMetaData.allDayPanelCellsMeta[0] || DOMMetaData.dateTableCellsMeta[0][0];
const regularPanelCellDOM = (null === (_DOMMetaData$dateTabl = DOMMetaData.dateTableCellsMeta[1]) || void 0 === _DOMMetaData$dateTabl ? void 0 : _DOMMetaData$dateTabl[0]) || DOMMetaData.dateTableCellsMeta[0][0];
const cellDOM = "allDayPanel" === panelName ? allDayPanelCellDOM : regularPanelCellDOM;
const allDayPanelCellSize = {
width: allDayPanelCellDOM.width ?? 0,
height: allDayPanelCellDOM.height ?? 0
};
const cellSize = {
width: cellDOM.width ?? 0,
height: cellDOM.height ?? 0
};
const maxAppointmentsPerCell = schedulerStore.getViewOption("maxAppointmentsPerCell");
const collectorSizes = "unlimited" === maxAppointmentsPerCell && !alwaysReserveSpaceForCollector ? UNLIMITED_COLLECTOR_SIZES : (0, _get_collector_size.getCollectorSize)(cellSize, collectorCSS, !isAdaptivityEnabled && "allDayPanel" === panelName ? .75 * cellSize.width : 0);
const maxLevelOptions = {
maxAppointmentsPerCell: maxAppointmentsPerCell,
cellSize: cellSize,
collectorSize: collectorSizes.collectorWithMarginsSize,
viewOrientation: viewOrientation,
isTimelineView: isTimelineView,
isAdaptivityEnabled: isAdaptivityEnabled
};
const maxLevel = (0, _get_max_level.getMaxLevel)(maxLevelOptions);
const minLevel = "vertical" === viewOrientation ? 1 : (0, _get_max_level.getMaxLevel)(Object.assign({}, maxLevelOptions, {
maxAppointmentsPerCell: "auto"
}));
return {
allDayPanelCellSize: allDayPanelCellSize,
cellSize: cellSize,
collectorSizes: collectorSizes,
maxLevel: maxLevel,
minLevel: minLevel
}
}
},
64390(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getViewModelOptions = void 0;
var _get_compare_options = __webpack_require__( /*! ../../common/get_compare_options */ 90349);
const configByView = {
day: {
isTimelineView: false,
isMonthView: false,
viewOrientation: "vertical"
},
week: {
isTimelineView: false,
isMonthView: false,
viewOrientation: "vertical"
},
workWeek: {
isTimelineView: false,
isMonthView: false,
viewOrientation: "vertical"
},
month: {
isTimelineView: false,
isMonthView: true,
viewOrientation: "horizontal"
},
timelineDay: {
isTimelineView: true,
isMonthView: false,
viewOrientation: "horizontal"
},
timelineWeek: {
isTimelineView: true,
isMonthView: false,
viewOrientation: "horizontal"
},
timelineWorkWeek: {
isTimelineView: true,
isMonthView: false,
viewOrientation: "horizontal"
},
timelineMonth: {
isTimelineView: true,
isMonthView: true,
viewOrientation: "horizontal"
}
};
exports.getViewModelOptions = schedulerStore => {
const viewOffset = schedulerStore.getViewOffsetMs();
const {
groupOrientation: groupOrientation,
type: type
} = schedulerStore.currentView;
const groupCount = schedulerStore.resourceManager.groupCount();
const isGroupByDate = Boolean(groupCount && "horizontal" === groupOrientation && schedulerStore.getViewOption("groupByDate"));
const compareOptions = (0, _get_compare_options.getCompareOptions)(schedulerStore);
const {
isTimelineView: isTimelineView,
isMonthView: isMonthView,
viewOrientation: viewOrientation
} = configByView[type];
const isRTLEnabled = Boolean(schedulerStore.option("rtlEnabled"));
const isAdaptivityEnabled = Boolean(schedulerStore.option("adaptivityEnabled"));
const cellDurationMinutes = schedulerStore.getViewOption("cellDuration");
const allDayPanelMode = schedulerStore.getViewOption("allDayPanelMode");
const showAllDayPanel = schedulerStore.getViewOption("showAllDayPanel");
const isVirtualScrolling = schedulerStore.isVirtualScrolling();
return {
type: type,
viewOffset: viewOffset,
groupOrientation: groupOrientation,
isGroupByDate: isGroupByDate,
groupCount: groupCount,
compareOptions: compareOptions,
isTimelineView: isTimelineView,
isMonthView: isMonthView,
viewOrientation: viewOrientation,
isRTLEnabled: isRTLEnabled,
isAdaptivityEnabled: isAdaptivityEnabled,
cellDurationMinutes: cellDurationMinutes,
hasAllDayPanel: showAllDayPanel && "hidden" !== allDayPanelMode && "vertical" === viewOrientation,
isVirtualScrolling: isVirtualScrolling
}
}
},
79837(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getWeekIntervals = void 0;
var _shift_intervals = __webpack_require__( /*! ../../common/shift_intervals */ 31597);
var _split_interval_by_days = __webpack_require__( /*! ../../common/split_interval_by_days */ 85588);
var _trim_interval = __webpack_require__( /*! ../../common/trim_interval */ 28032);
var _get_minutes_cell_intervals = __webpack_require__( /*! ./get_minutes_cell_intervals */ 55647);
const _excluded = ["startDayHour", "endDayHour"];
exports.getWeekIntervals = (compareOptions, cellDurationMinutes, viewOffset, isTimeline) => {
const dateInterval = function(r, e) {
if (null == r) {
return {}
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue
}
t[n] = r[n]
}
}
return t
}(compareOptions, _excluded);
const trimmedInterval = (0, _trim_interval.trimInterval)(dateInterval);
const splitIntervals = (0, _split_interval_by_days.splitIntervalByDay)(compareOptions);
const intervals = isTimeline ? [trimmedInterval] : splitIntervals;
const shiftedIntervals = (0, _shift_intervals.shiftIntervals)(intervals, viewOffset);
const shiftedSplitIntervals = (0, _shift_intervals.shiftIntervals)(splitIntervals, viewOffset);
const cells = (0, _get_minutes_cell_intervals.getMinutesCellIntervals)(Object.assign({}, compareOptions, {
intervals: intervals,
durationMinutes: cellDurationMinutes
}));
const shiftedCells = (0, _shift_intervals.shiftIntervals)(cells, viewOffset);
return {
cells: shiftedCells,
dayIntervals: shiftedSplitIntervals,
intervals: shiftedIntervals
}
}
},
25644(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OptionManager = void 0;
var _global_cache = __webpack_require__( /*! ../../../global_cache */ 23710);
var _get_group_size = __webpack_require__( /*! ./get_group_size */ 62041);
var _get_month_intervals = __webpack_require__( /*! ./get_month_intervals */ 17945);
var _get_panel_collector_options = __webpack_require__( /*! ./get_panel_collector_options */ 62125);
var _get_view_model_options = __webpack_require__( /*! ./get_view_model_options */ 64390);
var _get_week_intervals = __webpack_require__( /*! ./get_week_intervals */ 79837);
exports.OptionManager = class {
constructor(schedulerStore) {
this.schedulerStore = schedulerStore;
this.cache = new _global_cache.Cache;
this.options = (0, _get_view_model_options.getViewModelOptions)(schedulerStore)
}
getPanelOptions(panelName) {
const workspace = this.schedulerStore.getWorkSpace();
const panelDOMSize = workspace.getPanelDOMSize("vertical" === this.options.groupOrientation ? "regularPanel" : panelName);
return this.cache.memo(`${panelDOMSize.width}.${panelDOMSize.height}.${panelName}`, () => {
const {
type: type,
viewOffset: viewOffset,
groupOrientation: groupOrientation,
viewOrientation: nativeViewOrientation,
isGroupByDate: isGroupByDate,
groupCount: groupCount,
compareOptions: compareOptions,
isMonthView: isMonthView,
isRTLEnabled: isRTLEnabled,
isAdaptivityEnabled: isAdaptivityEnabled,
cellDurationMinutes: cellDurationMinutes,
isTimelineView: isTimelineView,
hasAllDayPanel: hasAllDayPanel
} = this.options;
const viewOrientation = "allDayPanel" === panelName ? "horizontal" : nativeViewOrientation;
const isCompactCollector = isAdaptivityEnabled || "vertical" === viewOrientation;
const collectorCSS = workspace.getCollectorDimension(isCompactCollector, panelName);
const {
allDayPanelCellSize: allDayPanelCellSize,
cellSize: cellSize,
collectorSizes: collectorSizes,
maxLevel: maxLevel,
minLevel: minLevel
} = (0, _get_panel_collector_options.getPanelCollectorOptions)(this.schedulerStore, {
alwaysReserveSpaceForCollector: "month" === type,
isTimelineView: isTimelineView,
viewOrientation: viewOrientation,
isAdaptivityEnabled: isAdaptivityEnabled,
collectorCSS: collectorCSS,
DOMMetaData: workspace.getDOMElementsMetaData(),
panelName: panelName
});
const {
cells: cells,
dayIntervals: dayIntervals,
intervals: intervals
} = ((compareOptions, cellDurationMinutes, viewOffset, isTimeline, isMonthView, panelName) => {
switch (true) {
case isMonthView:
return (0, _get_month_intervals.getMonthIntervals)(compareOptions, viewOffset, isTimeline);
case "allDayPanel" === panelName:
return (0, _get_month_intervals.getMonthIntervals)(compareOptions, viewOffset, true);
default:
return (0, _get_week_intervals.getWeekIntervals)(compareOptions, cellDurationMinutes, viewOffset, isTimeline)
}
})(compareOptions, cellDurationMinutes, viewOffset, isTimelineView || "allDayPanel" === panelName, isMonthView, panelName);
const groupByDateSplitIntervals = "vertical" === viewOrientation ? dayIntervals : cells;
const splitIntervals = isGroupByDate ? groupByDateSplitIntervals : intervals;
const geometryOptions = Object.assign({
intervals: intervals,
cells: cells,
maxAppointmentsPerCell: maxLevel,
hasAllDayPanel: hasAllDayPanel,
viewOrientation: viewOrientation,
groupOrientation: groupOrientation,
isGroupByDate: isGroupByDate,
isTimelineView: isTimelineView,
isRTLEnabled: isRTLEnabled,
isAdaptivityEnabled: isAdaptivityEnabled,
allDayPanelCellSize: allDayPanelCellSize,
cellSize: cellSize,
collectorPosition: "vertical" === viewOrientation ? "end" : "start"
}, collectorSizes, {
groupCount: groupCount,
groupSize: (0, _get_group_size.getGroupSize)(Object.assign({}, compareOptions, {
cellSize: cellSize,
cellDurationMinutes: cellDurationMinutes,
intervals: intervals,
cells: cells,
viewType: type,
isAllDayPanel: "allDayPanel" === panelName
})),
panelSize: panelDOMSize
});
const collectorOptions = {
cells: cells,
minLevel: minLevel,
maxLevel: maxLevel,
collectBy: "horizontal" === viewOrientation ? "byOccupation" : "byStartDate",
isCompact: isCompactCollector
};
return {
splitIntervals: splitIntervals,
cells: cells,
collectorOptions: collectorOptions,
geometryOptions: geometryOptions
}
})
}
getSplitIntervals(panelName) {
return this.getPanelOptions(panelName).splitIntervals
}
getCells(panelName) {
return this.getPanelOptions(panelName).cells
}
getCollectorOptions(panelName) {
return this.getPanelOptions(panelName).collectorOptions
}
getGeometryOptions(panelName) {
return this.getPanelOptions(panelName).geometryOptions
}
getVirtualCropOptions() {
const {
cellSize: cellSize,
panelSize: panelSize
} = this.getPanelOptions("regularPanel").geometryOptions;
const {
positionHelper: positionHelper,
virtualScrollingDispatcher: virtualScrollingDispatcher
} = this.schedulerStore.getWorkSpace();
const {
hasAllDayPanel: hasAllDayPanel,
groupCount: groupCount,
groupOrientation: groupOrientation,
isVirtualScrolling: isVirtualScrolling,
isRTLEnabled: isRTLEnabled
} = this.options;
const {
cellCountInsideLeftVirtualCell: cellCountInsideLeftVirtualCell,
cellCountInsideRightVirtualCell: cellCountInsideRightVirtualCell,
cellCountInsideTopVirtualRow: cellCountInsideTopVirtualRow
} = virtualScrollingDispatcher;
const hVirtualItemsCount = isRTLEnabled ? cellCountInsideRightVirtualCell : cellCountInsideLeftVirtualCell;
const isVerticalGrouping = groupCount > 0 && "vertical" === groupOrientation;
const isGroupedAllDayPanel = isVerticalGrouping && hasAllDayPanel;
return {
isVirtualScrolling: isVirtualScrolling,
getVirtualScreen: groupIndex => this.cache.memo(`virtualScreen${groupIndex}`, () => {
const left = hVirtualItemsCount * cellSize.width;
const top = cellCountInsideTopVirtualRow * cellSize.height;
const right = Math.round(positionHelper.getHorizontalMax(groupIndex)) || 1 / 0;
const bottom = positionHelper.getVerticalMax({
groupIndex: groupIndex,
isVirtualScrolling: isVirtualScrolling,
showAllDayPanel: hasAllDayPanel,
supportAllDayRow: hasAllDayPanel,
isGroupedAllDayPanel: isGroupedAllDayPanel,
isVerticalGrouping: isVerticalGrouping
});
return {
left: isRTLEnabled ? panelSize.width - right : left,
right: isRTLEnabled ? panelSize.width - left : right,
top: top,
bottom: bottom
}
})
}
}
}
},
58607(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addCollector = void 0;
var _add_collector_by_level = __webpack_require__( /*! ./add_collector_by_level */ 50522);
var _add_level = __webpack_require__( /*! ./add_level */ 77678);
exports.addCollector = (entities, options) => {
const step1 = (0, _add_level.addLevel)(entities, options);
const step2 = (0, _add_collector_by_level.addCollectorByLevel)(step1, options);
return step2
}
},
50522(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addCollectorByLevel = void 0;
var _split_by_condition = __webpack_require__( /*! ./split_by_condition */ 42120);
const addEmptyCollector = entities => entities.map(entity => Object.assign({}, entity, {
items: [],
isCompact: false
}));
exports.addCollectorByLevel = (entities, _ref) => {
let {
cells: cells,
isCompact: isCompact,
maxLevel: maxLevel,
collectBy: collectBy
} = _ref;
if (maxLevel < 0) {
return addEmptyCollector(entities)
}
const groupByCell = "byStartDate" === collectBy ? ((entities, cellsCount) => entities.reduce((result, entity) => {
result[entity.cellIndex].push(entity);
return result
}, Array.from({
length: cellsCount
}, () => [])))(entities, cells.length) : ((entities, cells, maxLevel) => entities.reduce((result, entity) => {
result[entity.cellIndex].push(entity);
for (let i = entity.cellIndex + 1; i <= entity.endCellIndex; i += 1) {
if (entity.level >= maxLevel) {
result[i].push(Object.assign({}, entity, {
cellIndex: i,
endCellIndex: i,
startDateUTC: cells[i].min,
endDateUTC: cells[i].max,
columnIndex: cells[i].columnIndex,
rowIndex: cells[i].rowIndex
}))
}
}
return result
}, Array.from({
length: cells.length
}, () => [])))(entities, cells, maxLevel);
return groupByCell.reduce((result, cellEntities) => {
const [free, collected] = (0, _split_by_condition.splitByCondition)(cellEntities, item => item.level < maxLevel);
result.push(...addEmptyCollector(free));
if (collected.length > 0) {
result.push(Object.assign({}, collected[0], {
items: collected,
isCompact: isCompact
}))
}
return result
}, [])
}
},
77678(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addLevel = void 0;
exports.addLevel = (entities, _ref) => {
let {
minLevel: minLevel,
maxLevel: maxLevel
} = _ref;
const minMaxLevel = -1 === maxLevel ? 0 : Math.min(minLevel, maxLevel);
let levelsEndDate = [];
let stack = [];
return entities.map(entity => {
const entityEndDate = entity.endDateUTC === entity.startDateUTC ? entity.endDateUTC + 1 : entity.endDateUTC;
const index = levelsEndDate.findIndex(endDate => entity.startDateUTC >= endDate);
const level = -1 === index ? levelsEndDate.length : index;
const extended = Object.assign({}, entity, {
level: level,
maxLevel: minMaxLevel,
inStackWithCollector: false
});
const isIntersectWithPrevious = levelsEndDate.some(endDate => entity.startDateUTC < endDate);
if (isIntersectWithPrevious) {
levelsEndDate[level] = entityEndDate;
stack.push(extended);
stack.forEach(item => {
item.maxLevel = -1 === maxLevel ? levelsEndDate.length : (value = levelsEndDate.length, min = minMaxLevel, max = maxLevel, Math.min(Math.max(value, min), max));
var value, min, max;
item.inStackWithCollector = -1 !== maxLevel && levelsEndDate.length > maxLevel
})
} else {
extended.maxLevel = minMaxLevel;
extended.inStackWithCollector = -1 !== maxLevel && levelsEndDate.length > maxLevel;
levelsEndDate = [entityEndDate];
stack = [extended]
}
return extended
})
}
},
42120(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.splitByCondition = void 0;
exports.splitByCondition = (arr, condition) => {
const result = [
[],
[]
];
arr.forEach(item => {
if (condition(item)) {
result[0].push(item)
} else {
result[1].push(item)
}
});
return result
}
},
16665(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addDirection = void 0;
exports.addDirection = (entities, allDayPanelDirection, regularPanelDirection) => entities.map(entity => Object.assign({}, entity, {
direction: entity.isAllDayPanelOccupied ? allDayPanelDirection : regularPanelDirection
}))
},
27602(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addEmptiness = void 0;
var _get_min_appointment_size = __webpack_require__( /*! ../options/get_min_appointment_size */ 16270);
exports.addEmptiness = (entities, options) => entities.map(entity => {
const minSize = (0, _get_min_appointment_size.getMinAppointmentSize)(Object.assign({}, options, {
isAllDayAppointment: entity.allDay
}));
return Object.assign({}, entity, {
empty: !entity.isAllDayPanelOccupied && (entity.height < minSize.height || entity.width < minSize.width)
})
})
},
20620(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addAdaptivityGeometryInsideInterval = void 0;
var _swap_by_view_orientation = __webpack_require__( /*! ./swap_by_view_orientation */ 44175);
exports.addAdaptivityGeometryInsideInterval = (entity, _ref) => {
let {
cellSize: cellSize,
collectorSize: collectorSize,
collectorWithMarginsSize: collectorWithMarginsSize,
viewOrientation: viewOrientation
} = _ref;
const cellAbstractSize = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(cellSize, viewOrientation);
const topInsideCell = entity.isAllDayPanelOccupied || "vertical" === viewOrientation ? (cellSize.height - collectorWithMarginsSize.height) / 2 : cellSize.height - 40;
const leftInsideCell = (cellSize.width - collectorWithMarginsSize.width) / 2;
const abstractGeometry = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)({
top: topInsideCell,
left: leftInsideCell,
width: collectorSize.width,
height: collectorSize.height
}, viewOrientation);
abstractGeometry.offsetX += entity.columnIndex * cellAbstractSize.sizeX;
const geometry = (0, _swap_by_view_orientation.getRealSizeByViewOrientation)(abstractGeometry, viewOrientation);
const items = entity.items.map(item => Object.assign({}, item, {
width: cellSize.width,
height: cellSize.height
}));
return Object.assign({}, entity, geometry, {
items: items
})
}
},
84181(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addGeometry = void 0;
var _add_adaptivity_geometry_inside_interval = __webpack_require__( /*! ./add_adaptivity_geometry_inside_interval */ 20620);
var _add_geometry_inside_interval = __webpack_require__( /*! ./add_geometry_inside_interval */ 92442);
var _add_grouping_offset = __webpack_require__( /*! ./add_grouping_offset */ 12744);
exports.addGeometry = (entities, options) => entities.map(rawEntity => {
const {
isAdaptivityEnabled: isAdaptivityEnabled,
maxAppointmentsPerCell: maxAppointmentsPerCell
} = options;
const entity = isAdaptivityEnabled && 0 === maxAppointmentsPerCell ? (0, _add_adaptivity_geometry_inside_interval.addAdaptivityGeometryInsideInterval)(rawEntity, options) : (0, _add_geometry_inside_interval.addGeometryInsideInterval)(rawEntity, options);
((entity, _ref2) => {
let {
cellSize: cellSize,
viewOrientation: viewOrientation,
isTimelineView: isTimelineView
} = _ref2;
switch (true) {
case "horizontal" === viewOrientation && !isTimelineView:
entity.top += entity.rowIndex * cellSize.height;
break;
case "horizontal" === viewOrientation && isTimelineView:
case "vertical" === viewOrientation:
entity.left += entity.rowIndex * cellSize.width
}
})(entity, options);
(0, _add_grouping_offset.addGroupingOffset)(entity, options);
((entity, _ref) => {
let {
panelSize: panelSize,
isRTLEnabled: isRTLEnabled
} = _ref;
if (isRTLEnabled) {
const deltaWidth = entity.items.length ? 0 : entity.width;
entity.left = panelSize.width - entity.left - deltaWidth
}
})(entity, options);
return entity
})
},
92442(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addGeometryInsideInterval = void 0;
var _get_appointment_collector_geometry = __webpack_require__( /*! ./get_appointment_collector_geometry */ 17310);
var _get_appointment_geometry = __webpack_require__( /*! ./get_appointment_geometry */ 87022);
exports.addGeometryInsideInterval = (entity, options) => {
if (entity.items.length) {
const entityGeometry = (0, _get_appointment_collector_geometry.getAppointmentCollectorGeometry)(entity, options);
const items = entity.items.map(item => {
const size = (0, _get_appointment_geometry.getAppointmentGeometry)(Object.assign({}, entity, item), options);
return Object.assign({}, item, {
width: size.width,
height: size.height
})
});
return Object.assign({}, entity, entityGeometry, {
items: items
})
}
const entityGeometry = (0, _get_appointment_geometry.getAppointmentGeometry)(entity, options);
return Object.assign({}, entity, entityGeometry, {
items: []
})
}
},
12744(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addGroupingOffset = void 0;
exports.addGroupingOffset = (entity, _ref) => {
let {
groupCount: groupCount,
groupOrientation: groupOrientation,
viewOrientation: viewOrientation,
hasAllDayPanel: hasAllDayPanel,
isGroupByDate: isGroupByDate,
allDayPanelCellSize: allDayPanelCellSize,
cellSize: cellSize,
groupSize: groupSize
} = _ref;
if (groupCount) {
switch (true) {
case "horizontal" === groupOrientation && isGroupByDate:
entity.left += (groupCount - 1) * cellSize.width * ("horizontal" === viewOrientation ? entity.columnIndex : entity.rowIndex) + cellSize.width * entity.groupIndex;
break;
case "horizontal" === groupOrientation:
entity.left += entity.groupIndex * groupSize.width;
break;
default:
entity.top += entity.groupIndex * groupSize.height + (entity.groupIndex + Number(!entity.isAllDayPanelOccupied)) * Number(hasAllDayPanel) * allDayPanelCellSize.height
}
}
}
},
77967(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAppointmentY = exports.getAppointmentX = void 0;
const getInsideCellX = (date, _ref, cellSizeX) => {
let {
min: min,
max: max
} = _ref;
const cellDuration = max - min;
const startTimeDelta = date - min;
return 0 === cellDuration ? 0 : startTimeDelta * cellSizeX / cellDuration
};
exports.getAppointmentX = (entity, cellSize, cells) => {
const startX = getInsideCellX(entity.startDateUTC, cells[entity.cellIndex], cellSize.sizeX);
const endX = getInsideCellX(entity.endDateUTC, cells[entity.endCellIndex], cellSize.sizeX);
const offsetX = entity.columnIndex * cellSize.sizeX + startX;
const sizeX = (entity.endCellIndex - entity.cellIndex) * cellSize.sizeX + endX - startX;
return {
offsetX: offsetX,
sizeX: sizeX
}
};
exports.getAppointmentY = (entity, cellSize, collectorSizeY, collectorPosition) => {
if (entity.isAllDayPanelOccupied && !entity.inStackWithCollector) {
const sizeY = 0 === entity.maxLevel ? cellSize.sizeY - collectorSizeY : (cellSize.sizeY - collectorSizeY) / entity.maxLevel;
const offsetY = entity.level * sizeY;
return {
sizeY: sizeY,
offsetY: offsetY
}
}
const maxSizeY = cellSize.sizeY - collectorSizeY;
const sizeY = 0 === entity.maxLevel ? maxSizeY : maxSizeY / entity.maxLevel;
let offsetY = entity.level * sizeY;
if ("start" === collectorPosition) {
offsetY += collectorSizeY
}
return {
sizeY: sizeY,
offsetY: offsetY
}
}
},
17310(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAppointmentCollectorGeometry = void 0;
var _swap_by_view_orientation = __webpack_require__( /*! ./swap_by_view_orientation */ 44175);
exports.getAppointmentCollectorGeometry = (entity, _ref) => {
let {
collectorPosition: collectorPosition,
cellSize: cellSize,
collectorSize: collectorSize,
collectorWithMarginsSize: collectorWithMarginsSize,
viewOrientation: viewOrientation
} = _ref;
const collectorAbstractSize = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(collectorSize, viewOrientation);
const cellAbstractSize = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(cellSize, viewOrientation);
const abstractGeometry = {
offsetX: entity.columnIndex * cellAbstractSize.sizeX,
offsetY: "start" === collectorPosition ? 0 : cellAbstractSize.sizeY - (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(collectorWithMarginsSize, viewOrientation).sizeY,
sizeY: collectorAbstractSize.sizeY,
sizeX: collectorAbstractSize.sizeX
};
const entityGeometry = (0, _swap_by_view_orientation.getRealSizeByViewOrientation)(abstractGeometry, viewOrientation);
return entityGeometry
}
},
87022(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAppointmentGeometry = void 0;
var _get_appointment_abstract_geometry = __webpack_require__( /*! ./get_appointment_abstract_geometry */ 77967);
var _swap_by_view_orientation = __webpack_require__( /*! ./swap_by_view_orientation */ 44175);
exports.getAppointmentGeometry = (entity, _ref) => {
let {
collectorPosition: collectorPosition,
cellSize: cellSize,
collectorWithMarginsSize: collectorWithMarginsSize,
viewOrientation: viewOrientation,
cells: cells
} = _ref;
const cellAbstractSize = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(cellSize, viewOrientation);
const collectorFullAbstractSize = (0, _swap_by_view_orientation.getAbstractSizeByViewOrientation)(collectorWithMarginsSize, viewOrientation);
const abstractGeometry = Object.assign({}, (0, _get_appointment_abstract_geometry.getAppointmentX)(entity, cellAbstractSize, cells), (0, _get_appointment_abstract_geometry.getAppointmentY)(entity, cellAbstractSize, collectorFullAbstractSize.sizeY, collectorPosition));
const entityGeometry = (0, _swap_by_view_orientation.getRealSizeByViewOrientation)(abstractGeometry, viewOrientation);
return entityGeometry
}
},
44175(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAbstractSizeByViewOrientation = function(size, viewOrientation) {
const abstractSize = {
sizeY: "horizontal" === viewOrientation ? size.height : size.width,
sizeX: "horizontal" === viewOrientation ? size.width : size.height
};
if (!("top" in size && "left" in size)) {
return abstractSize
}
return Object.assign({}, abstractSize, {
offsetY: "horizontal" === viewOrientation ? size.top : size.left,
offsetX: "horizontal" === viewOrientation ? size.left : size.top
})
};
exports.getRealSizeByViewOrientation = function(size, viewOrientation) {
const realSize = {
height: "horizontal" === viewOrientation ? size.sizeY : size.sizeX,
width: "horizontal" === viewOrientation ? size.sizeX : size.sizeY
};
if (!("offsetY" in size && "offsetX" in size)) {
return realSize
}
return Object.assign({}, realSize, {
top: "horizontal" === viewOrientation ? size.offsetY : size.offsetX,
left: "horizontal" === viewOrientation ? size.offsetX : size.offsetY
})
}
},
6238(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addLastInGroup = void 0;
const getDayStart = date => new Date(date).setUTCHours(0, 0, 0, 0);
exports.addLastInGroup = entities => {
if (0 === entities.length) {
return entities
}
let nextGroupIndex = entities[0].groupIndex;
let nextStartDate = getDayStart(entities[0].startDateUTC);
return entities.map((entity, index) => {
const nextEntity = entities[index + 1];
if (!nextEntity) {
return Object.assign({}, entity, {
isLastInGroup: true
})
}
const trimDate = nextEntity && getDayStart(nextEntity.startDateUTC);
if (nextGroupIndex !== nextEntity.groupIndex || nextStartDate !== trimDate) {
nextGroupIndex = nextEntity.groupIndex;
nextStartDate = trimDate;
return Object.assign({}, entity, {
isLastInGroup: true
})
}
return Object.assign({}, entity, {
isLastInGroup: false
})
})
}
},
68825(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addPosition = void 0;
var _binary_search_cell_index = __webpack_require__( /*! ./binary_search_cell_index */ 51602);
exports.addPosition = (entities, cells) => entities.map(entity => {
const cellIndex = (0, _binary_search_cell_index.binarySearchCellIndex)(cells, entity.startDateUTC);
let endCellIndex = cellIndex;
while (endCellIndex < cells.length - 1 && entity.endDateUTC > cells[endCellIndex].max && entity.endDateUTC >= cells[endCellIndex + 1].min) {
endCellIndex += 1
}
return Object.assign({}, entity, {
startDateUTC: Math.max(entity.startDateUTC, cells[cellIndex].min),
endDateUTC: Math.min(entity.endDateUTC, cells[endCellIndex].max),
cellIndex: cellIndex,
endCellIndex: endCellIndex,
rowIndex: cells[cellIndex].rowIndex,
columnIndex: cells[cellIndex].columnIndex
})
})
},
84988(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addSortedIndex = void 0;
exports.addSortedIndex = entities => entities.map((entity, index) => Object.assign({}, entity, {
sortedIndex: index
}))
},
51602(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.binarySearchCellIndex = void 0;
exports.binarySearchCellIndex = (cells, targetDate) => {
let left = 0;
let right = cells.length - 1;
while (left <= right) {
const mid = Math.floor((left + right) / 2);
const cell = cells[mid];
if (targetDate >= cell.min && targetDate < cell.max) {
return mid
}
if (targetDate < cell.min) {
right = mid - 1
} else {
left = mid + 1
}
}
return Math.min(left, cells.length - 1)
}
},
56295(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.expandAllDayRegularPanel = exports.expandAllDayAllDayPanel = void 0;
var _m_date = __webpack_require__( /*! ../../../../core/utils/m_date */ 66570);
const toMs = _m_date.dateUtils.dateToMilliseconds;
const MINUTE_MS = toMs("minute");
const DAY_MS = toMs("day");
const getDayInterval = (date, viewOffsetMs) => {
const trimmedDate = new Date(date).setUTCHours(0, 0, 0, 0);
const startOfDay = trimmedDate + viewOffsetMs;
const endOfDay = trimmedDate + DAY_MS + viewOffsetMs;
return {
min: startOfDay,
max: endOfDay
}
};
const getShiftedStartDate = (startDate, viewOffsetMs) => {
const {
min: min,
max: max
} = getDayInterval(startDate, viewOffsetMs);
switch (true) {
case startDate > max - MINUTE_MS:
return max;
case startDate < min:
return min - DAY_MS;
default:
return min
}
};
const getShiftedEndDate = (endDate, viewOffsetMs) => {
const {
min: min,
max: max
} = getDayInterval(endDate, viewOffsetMs);
switch (true) {
case endDate >= max:
return max + DAY_MS - MINUTE_MS;
case endDate < min:
return min - MINUTE_MS;
default:
return max - MINUTE_MS
}
};
exports.expandAllDayAllDayPanel = (entities, endDayHour, viewOffsetMs) => entities.map(entity => {
if (!entity.allDay) {
return entity
}
if (0 === viewOffsetMs) {
const minStartDate = new Date(entity.startDateUTC).setUTCHours(endDayHour, 0, 0, 0) - MINUTE_MS;
const maxEndDate = new Date(entity.endDateUTC).setUTCHours(endDayHour, 0, 0, 0) - MINUTE_MS;
return Object.assign({}, entity, {
startDateUTC: Math.min(entity.startDateUTC, minStartDate),
endDateUTC: maxEndDate
})
}
return Object.assign({}, entity, {
startDateUTC: getShiftedStartDate(entity.startDateUTC, viewOffsetMs),
endDateUTC: getShiftedEndDate(entity.endDateUTC, viewOffsetMs)
})
});
exports.expandAllDayRegularPanel = entities => entities.map(entity => {
if (!entity.allDay) {
return entity
}
const startDate = new Date(entity.startDateUTC);
const endDate = new Date(entity.endDateUTC);
endDate.setDate(endDate.getDate() + 1);
return Object.assign({}, entity, {
endDateUTC: endDate.setUTCHours(startDate.getUTCHours(), startDate.getUTCMinutes(), startDate.getUTCSeconds(), startDate.getUTCMilliseconds())
})
})
},
6332(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.groupByGroupIndex = void 0;
exports.groupByGroupIndex = entities => {
const result = [];
entities.forEach(entity => {
result[entity.groupIndex] = result[entity.groupIndex] || [];
result[entity.groupIndex].push(entity)
});
return result.map(group => group || [])
}
},
88779(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.maybeSplit = void 0;
var _split_by_condition = __webpack_require__( /*! ./add_collector/split_by_condition */ 42120);
exports.maybeSplit = (entities, shouldSplit, callback) => {
if (shouldSplit) {
const [allDayEntities, regularEntities] = (0, _split_by_condition.splitByCondition)(entities, entity => entity.isAllDayPanelOccupied);
const allDayPanel = callback(allDayEntities, "allDayPanel");
const regularPanel = callback(regularEntities, "regularPanel");
return ((a, b) => {
const result = [];
let i = 0;
let j = 0;
while (i < a.length && j < b.length) {
if (a[i].startDateUTC <= b[j].startDateUTC) {
result.push(a[i]);
i += 1
} else {
result.push(b[j]);
j += 1
}
}
while (i < a.length) {
result.push(a[i]);
i += 1
}
while (j < b.length) {
result.push(b[j]);
j += 1
}
return result
})(allDayPanel, regularPanel)
}
return callback(entities, "regularPanel")
}
},
5146(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.snapToCells = void 0;
exports.snapToCells = function(entities, cells) {
let isSnapToCell = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true;
if (!isSnapToCell) {
return entities
}
return entities.map(entity => {
const {
cellIndex: cellIndex,
endCellIndex: endCellIndex
} = entity;
return Object.assign({}, entity, {
startDateUTC: cells[cellIndex].min,
endDateUTC: cells[endCellIndex].max,
duration: cells[endCellIndex].max - cells[cellIndex].min
})
})
}
},
12628(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sortByStartDate = exports.sortByGroupIndex = exports.sortByDuration = void 0;
exports.sortByGroupIndex = entities => entities.sort((a, b) => a.groupIndex - b.groupIndex);
exports.sortByDuration = entities => entities.sort((a, b) => b.duration - a.duration);
exports.sortByStartDate = entities => entities.sort((a, b) => a.startDateUTC - b.startDateUTC)
},
61766(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getNextIntervalStartDate = void 0;
exports.getNextIntervalStartDate = intervals => {
const minDate = new Date(intervals[intervals.length - 1].min);
const maxDate = new Date(intervals[intervals.length - 1].max);
const isTheSameHours = minDate.getUTCHours() === maxDate.getUTCHours() && minDate.getUTCMinutes() === maxDate.getUTCMinutes() && minDate.getUTCSeconds() === maxDate.getUTCSeconds() && minDate.getUTCMilliseconds() === maxDate.getUTCMilliseconds();
if (isTheSameHours) {
return maxDate.getTime()
}
const nextDate = new Date(maxDate.getTime() - 1);
nextDate.setUTCDate(nextDate.getUTCDate() + 1);
nextDate.setUTCHours(minDate.getUTCHours(), minDate.getUTCMinutes(), minDate.getUTCSeconds(), minDate.getUTCMilliseconds());
return nextDate.getTime()
}
},
99985(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPrevIntervalEndDate = void 0;
exports.getPrevIntervalEndDate = intervals => {
const minDate = new Date(intervals[0].min);
const maxDate = new Date(intervals[0].max);
const isTheSameHours = maxDate.getUTCHours() === minDate.getUTCHours() && maxDate.getUTCMinutes() === minDate.getUTCMinutes() && maxDate.getUTCSeconds() === minDate.getUTCSeconds() && maxDate.getUTCMilliseconds() === minDate.getUTCMilliseconds();
if (isTheSameHours) {
return minDate.getTime()
}
const prevDate = new Date(minDate.getTime());
prevDate.setUTCHours(maxDate.getUTCHours(), maxDate.getUTCMinutes(), maxDate.getUTCSeconds(), maxDate.getUTCMilliseconds());
if (prevDate < minDate) {
return prevDate.getTime()
}
return prevDate.setUTCDate(prevDate.getUTCDate() - 1)
}
},
89959(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.splitByParts = void 0;
var _get_next_interval_start_date = __webpack_require__( /*! ./get_next_interval_start_date */ 61766);
var _get_prev_interval_end_date = __webpack_require__( /*! ./get_prev_interval_end_date */ 99985);
const getSingleReduced = (isStartOnPrevInterval, isEndOnNextInterval) => {
switch (true) {
case isStartOnPrevInterval && isEndOnNextInterval:
return "body";
case isStartOnPrevInterval:
return "tail";
case isEndOnNextInterval:
return "head";
default:
return
}
};
const getReduced = (isFirstItem, isLastItem, isStartOnPrevInterval, isEndOnNextInterval) => {
switch (true) {
case isFirstItem && !isStartOnPrevInterval:
return "head";
case isLastItem && !isEndOnNextInterval:
return "tail";
default:
return "body"
}
};
const cropEntityByInterval = (entity, interval) => {
const startDate = entity.startDateUTC < interval.min ? interval.min : entity.startDateUTC;
const endDate = entity.endDateUTC > interval.max ? interval.max : entity.endDateUTC;
return Object.assign({}, entity, {
startDateUTC: startDate,
endDateUTC: endDate,
duration: endDate - startDate
})
};
exports.splitByParts = (entities, intervals) => {
const prevIntervalEndDate = (0, _get_prev_interval_end_date.getPrevIntervalEndDate)(intervals);
const nextIntervalStartDate = (0, _get_next_interval_start_date.getNextIntervalStartDate)(intervals);
return entities.reduce((result, entity) => {
const startIndex = intervals.findIndex(_ref => {
let {
max: max
} = _ref;
return entity.startDateUTC < max
});
if (-1 === startIndex) {
return result
}
const endIndex = ((intervals, endDateMs) => {
const lastIdx = intervals.length - 1;
for (let idx = 0; idx < lastIdx; idx += 1) {
const nextInterval = intervals[idx + 1];
if (nextInterval.min >= endDateMs) {
return idx
}
}
return lastIdx
})(intervals, entity.endDateUTC);
const partCount = endIndex - startIndex + 1;
const isStartOnPrevView = entity.startDateUTC < prevIntervalEndDate;
const isEndOnNextView = entity.endDateUTC > nextIntervalStartDate;
if (partCount <= 1) {
result.push(Object.assign({}, cropEntityByInterval(entity, intervals[startIndex]), {
partIndex: 0,
partCount: 0,
reduced: getSingleReduced(isStartOnPrevView, isEndOnNextView)
}))
} else {
const parts = Array.from({
length: partCount
}).map((_, partIndex) => {
const isFirstIdx = 0 === partIndex;
const isLastIdx = partIndex === partCount - 1;
return Object.assign({}, cropEntityByInterval(entity, intervals[startIndex + partIndex]), {
partIndex: partIndex,
partCount: partCount,
reduced: getReduced(isFirstIdx, isLastIdx, isStartOnPrevView, isEndOnNextView)
})
});
result.push(...parts)
}
return result
}, [])
}
},
29983(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cropByVirtualScreen = void 0;
exports.cropByVirtualScreen = (entities, _ref) => {
let {
isVirtualScrolling: isVirtualScrolling,
getVirtualScreen: getVirtualScreen
} = _ref;
if (!isVirtualScrolling) {
return entities
}
return entities.reduce((acc, item) => {
const screen = getVirtualScreen(item.groupIndex);
const isInsideVirtualScreen = !(item.left + item.width < screen.left || item.left > screen.right || item.top + item.height < screen.top || item.top > screen.bottom);
if (isInsideVirtualScreen) {
const right = item.left + item.width;
const bottom = item.top + item.height;
const left = Math.max(screen.left, item.left);
const top = Math.max(screen.top, item.top);
const width = Math.min(screen.right, right) - left;
const height = Math.min(screen.bottom, bottom) - top;
acc.push(Object.assign({}, item, {
left: left,
width: width,
top: top,
height: height
}))
}
return acc
}, [])
}
},
84751(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.filterByVirtualScreen = void 0;
var _m_utils_time_zone = (e = __webpack_require__( /*! ../../../m_utils_time_zone */ 18648), e && e.__esModule ? e : {
default: e
});
var e;
var _is_appointment_matched_intervals = __webpack_require__( /*! ../../common/is_appointment_matched_intervals */ 44442);
exports.filterByVirtualScreen = (entities, viewDataProvider, isVirtualScrolling) => {
if (!isVirtualScrolling) {
return entities
}
const groupsInfo = viewDataProvider.getCompletedGroupsInfo();
const groupIntervalsMap = new Map;
groupsInfo.forEach(group => {
groupIntervalsMap.set(group.groupIndex, {
min: _m_utils_time_zone.default.createUTCDateWithLocalOffset(group.startDate).getTime(),
max: _m_utils_time_zone.default.createUTCDateWithLocalOffset(group.endDate).getTime()
})
});
return entities.filter(appointment => {
const groupInterval = groupIntervalsMap.get(appointment.groupIndex);
if (!groupInterval) {
return false
}
if (appointment.isAllDayPanelOccupied) {
return true
}
return (0, _is_appointment_matched_intervals.isAppointmentMatchedIntervals)({
startDate: appointment.startDateUTC,
endDate: appointment.endDateUTC
}, [groupInterval])
})
}
},
673(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAppointmentInfo = exports.getAgendaAppointmentInfo = void 0;
var _m_utils_time_zone = (e = __webpack_require__( /*! ../m_utils_time_zone */ 18648), e && e.__esModule ? e : {
default: e
});
var e;
const getAppointmentInfo = item => {
const appointment = {
allDay: item.allDay,
startDate: _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(new Date(item.datesBeforeSplit.startDateUTC)),
endDate: _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(new Date(item.datesBeforeSplit.endDateUTC))
};
const source = {
allDay: item.allDay,
startDate: new Date(item.source.startDate),
endDate: new Date(item.source.endDate)
};
return {
appointment: appointment,
sourceAppointment: source
}
};
exports.getAppointmentInfo = getAppointmentInfo;
exports.getAgendaAppointmentInfo = item => Object.assign({}, getAppointmentInfo(item), {
partialDates: {
allDay: item.allDay,
startDate: _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(new Date(item.datesAfterSplit.startDateUTC)),
endDate: _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(new Date(item.datesAfterSplit.endDateUTC))
}
})
},
61526(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentDataSource = void 0;
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 87739);
const STORE_EVENTS_updating = "updating",
STORE_EVENTS_push = "push";
exports.AppointmentDataSource = class {
constructor(dataSource) {
this.setDataSource(dataSource);
this.updatedAppointmentKeys = []
}
get keyName() {
const store = this.dataSource.store();
return store.key()
}
get isDataSourceInit() {
return Boolean(this.dataSource)
}
getStoreKey(target) {
const store = this.dataSource.store();
return store.keyOf(target)
}
setDataSource(dataSource) {
this.dataSource = dataSource;
this.cleanState();
this.initStoreChangeHandlers()
}
initStoreChangeHandlers() {
const {
dataSource: dataSource
} = this;
const store = null === dataSource || void 0 === dataSource ? void 0 : dataSource.store();
if (store) {
store.on(STORE_EVENTS_updating, key => {
const keyName = store.key();
if (keyName) {
this.updatedAppointmentKeys.push({
key: keyName,
value: key
})
} else {
this.updatedAppointment = key
}
});
store.on(STORE_EVENTS_push, pushItems => {
const items = dataSource.items();
const keyName = store.key();
pushItems.forEach(pushItem => {
const itemExists = 0 !== items.filter(item => item[keyName] === pushItem.key).length;
if (itemExists) {
this.updatedAppointmentKeys.push({
key: keyName,
value: pushItem.key
})
} else {
const {
data: data
} = pushItem;
data && items.push(data)
}
});
dataSource.load()
})
}
}
getUpdatedAppointment() {
return this.updatedAppointment
}
getUpdatedAppointmentKeys() {
return this.updatedAppointmentKeys
}
cleanState() {
this.updatedAppointment = null;
this.updatedAppointmentKeys = []
}
add(rawAppointment) {
return this.dataSource.store().insert(rawAppointment).done(() => this.dataSource.load())
}
update(target, data) {
const key = this.getStoreKey(target);
const d = new _deferred.Deferred;
this.dataSource.store().update(key, data).done(result => this.dataSource.load().done(() => d.resolve(result)).fail(d.reject)).fail(d.reject);
return d.promise()
}
remove(rawAppointment) {
const key = this.getStoreKey(rawAppointment);
return this.dataSource.store().remove(key).done(() => this.dataSource.load())
}
destroy() {
var _this$dataSource;
const store = null === (_this$dataSource = this.dataSource) || void 0 === _this$dataSource ? void 0 : _this$dataSource.store();
if (store) {
store.off(STORE_EVENTS_updating);
store.off(STORE_EVENTS_push)
}
}
}
},
90174(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.prepareAppointments = void 0;
var _get_minimal_appointments = __webpack_require__( /*! ./utils/get_minimal_appointments */ 23241);
var _replace_incorrect_end_date = __webpack_require__( /*! ./utils/replace_incorrect_end_date */ 25453);
exports.prepareAppointments = (schedulerStore, items) => {
const cellDurationInMinutes = schedulerStore.getViewOption("cellDuration");
const dataAccessors = schedulerStore._dataAccessors;
const safeItems = (0, _replace_incorrect_end_date.replaceIncorrectEndDate)(items, cellDurationInMinutes, dataAccessors);
return (0, _get_minimal_appointments.getMinimalAppointments)(safeItems, {
dataAccessors: dataAccessors,
timeZoneCalculator: schedulerStore.timeZoneCalculator
})
}
},
23241(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMinimalAppointments = void 0;
var _type = __webpack_require__( /*! ../../../../../core/utils/type */ 11528);
exports.getMinimalAppointments = (safeItems, _ref) => {
let {
dataAccessors: dataAccessors
} = _ref;
return safeItems.map(rawAppointment => {
const startDateMs = dataAccessors.get("startDate", rawAppointment).getTime();
const startDateTimeZone = dataAccessors.get("startDateTimeZone", rawAppointment);
const endDateMs = dataAccessors.get("endDate", rawAppointment).getTime();
const endDateTimeZone = dataAccessors.get("endDateTimeZone", rawAppointment);
const rawVisible = dataAccessors.get("visible", rawAppointment);
const visible = (0, _type.isDefined)(rawVisible) ? Boolean(rawVisible) : true;
return {
allDay: dataAccessors.get("allDay", rawAppointment),
startDateTimeZone: startDateTimeZone,
endDateTimeZone: endDateTimeZone,
source: {
startDate: startDateMs,
endDate: endDateMs
},
recurrenceRule: dataAccessors.get("recurrenceRule", rawAppointment),
recurrenceException: dataAccessors.get("recurrenceException", rawAppointment),
hasRecurrenceRule: dataAccessors.isRecurrent(rawAppointment),
visible: visible,
disabled: dataAccessors.get("disabled", rawAppointment),
itemData: rawAppointment
}
})
}
},
25453(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.replaceIncorrectEndDate = void 0;
var _date = __webpack_require__( /*! ../../../../core/utils/date */ 55594);
var _m_date = __webpack_require__( /*! ../../../../core/utils/m_date */ 66570);
const toMs = _m_date.dateUtils.dateToMilliseconds;
exports.replaceIncorrectEndDate = (rawAppointments, appointmentMinDuration, dataAccessors) => {
if (!rawAppointments) {
return []
}
return rawAppointments.reduce((result, rawAppointment) => {
const startDate = dataAccessors.get("startDate", rawAppointment);
const endDate = dataAccessors.get("endDate", rawAppointment);
if (!_date.dateUtilsTs.isValidDate(startDate)) {
return result
}
const isEndDateIncorrect = !_date.dateUtilsTs.isValidDate(endDate) || startDate.getTime() > endDate.getTime();
if (isEndDateIncorrect) {
const isAllDay = dataAccessors.get("allDay", rawAppointment);
const correctedEndDate = isAllDay ? _m_date.dateUtils.setToDayEnd(new Date(startDate)) : new Date(startDate.getTime() + appointmentMinDuration * toMs("minute"));
dataAccessors.set("endDate", rawAppointment, correctedEndDate)
}
result.push(rawAppointment);
return result
}, [])
}
},
79674(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.WORK_SPACE_BORDER_PX = void 0;
exports.WORK_SPACE_BORDER_PX = 1
},
39979(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMaxAllowedPosition = exports.getGroupWidth = exports.getCellWidth = exports.getCellHeight = exports.getAllDayHeight = exports.PositionHelper = void 0;
const getCellSize = DOMMetaData => {
const {
dateTableCellsMeta: dateTableCellsMeta
} = DOMMetaData;
const length = null === dateTableCellsMeta || void 0 === dateTableCellsMeta ? void 0 : dateTableCellsMeta.length;
if (!length) {
return {
width: 0,
height: 0
}
}
const cellIndex = length > 1 ? 1 : 0;
const cellSize = dateTableCellsMeta[cellIndex][0];
return {
width: cellSize.width,
height: cellSize.height
}
};
const getCellHeight = DOMMetaData => getCellSize(DOMMetaData).height;
exports.getCellHeight = getCellHeight;
const getCellWidth = DOMMetaData => getCellSize(DOMMetaData).width;
exports.getCellWidth = getCellWidth;
const getAllDayHeight = (showAllDayPanel, isVerticalGrouping, DOMMetaData) => {
if (!showAllDayPanel) {
return 0
}
if (isVerticalGrouping) {
const {
dateTableCellsMeta: dateTableCellsMeta
} = DOMMetaData;
const length = null === dateTableCellsMeta || void 0 === dateTableCellsMeta ? void 0 : dateTableCellsMeta.length;
return length ? dateTableCellsMeta[0][0].height : 0
}
const {
allDayPanelCellsMeta: allDayPanelCellsMeta
} = DOMMetaData;
return null !== allDayPanelCellsMeta && void 0 !== allDayPanelCellsMeta && allDayPanelCellsMeta.length ? allDayPanelCellsMeta[0].height : 0
};
exports.getAllDayHeight = getAllDayHeight;
const getMaxAllowedPosition = (groupIndex, viewDataProvider, rtlEnabled, DOMMetaData) => {
const validGroupIndex = groupIndex || 0;
return ((groupIndex, viewDataProvider, rtlEnabled, DOMMetaData) => {
const {
dateTableCellsMeta: dateTableCellsMeta
} = DOMMetaData;
const firstRow = dateTableCellsMeta[0];
if (!firstRow) {
return 0
}
const {
columnIndex: columnIndex
} = viewDataProvider.getLastGroupCellPosition(groupIndex);
const cellPosition = firstRow[columnIndex];
if (!cellPosition) {
return 0
}
return !rtlEnabled ? cellPosition.left + cellPosition.width : cellPosition.left
})(validGroupIndex, viewDataProvider, rtlEnabled, DOMMetaData)
};
exports.getMaxAllowedPosition = getMaxAllowedPosition;
exports.getGroupWidth = (groupIndex, viewDataProvider, options) => {
const {
isVirtualScrolling: isVirtualScrolling,
rtlEnabled: rtlEnabled,
DOMMetaData: DOMMetaData
} = options;
const cellWidth = getCellWidth(DOMMetaData);
let result = viewDataProvider.getCellCount(options) * cellWidth;
if (isVirtualScrolling) {
const groupedData = viewDataProvider.groupedDataMap.dateTableGroupedMap;
const groupLength = groupedData[groupIndex][0].length;
result = groupLength * cellWidth
}
const position = getMaxAllowedPosition(groupIndex, viewDataProvider, rtlEnabled, DOMMetaData);
const currentPosition = position[groupIndex];
if (currentPosition) {
if (rtlEnabled) {
result = currentPosition - position[groupIndex + 1]
} else if (0 === groupIndex) {
result = currentPosition
} else {
result = currentPosition - position[groupIndex - 1]
}
}
return result
};
exports.PositionHelper = class {
get viewDataProvider() {
return this.options.viewDataProvider
}
get rtlEnabled() {
return this.options.rtlEnabled
}
get isGroupedByDate() {
return this.options.isGroupedByDate
}
get groupCount() {
return this.options.groupCount
}
get DOMMetaData() {
return this.options.getDOMMetaDataCallback()
}
constructor(options) {
this.options = options;
this.groupStrategy = this.options.isVerticalGrouping ? new GroupStrategyBase(this.options) : new GroupStrategyHorizontal(this.options)
}
getHorizontalMax(groupIndex) {
const getMaxPosition = groupIndex => getMaxAllowedPosition(groupIndex, this.viewDataProvider, this.rtlEnabled, this.DOMMetaData);
if (this.isGroupedByDate) {
const viewPortGroupCount = this.viewDataProvider.getViewPortGroupCount();
return Math.max(getMaxPosition(groupIndex), getMaxPosition(viewPortGroupCount - 1))
}
return getMaxPosition(groupIndex)
}
getResizableStep() {
const cellWidth = getCellWidth(this.DOMMetaData);
if (this.isGroupedByDate) {
return this.groupCount * cellWidth
}
return cellWidth
}
getVerticalMax(options) {
return this.groupStrategy.getVerticalMax(options)
}
getOffsetByAllDayPanel(options) {
return this.groupStrategy.getOffsetByAllDayPanel(options)
}
getGroupTop(options) {
return this.groupStrategy.getGroupTop(options)
}
};
class GroupStrategyBase {
constructor(options) {
this.options = options
}
get viewDataProvider() {
return this.options.viewDataProvider
}
get isGroupedByDate() {
return this.options.isGroupedByDate
}
get rtlEnabled() {
return this.options.rtlEnabled
}
get groupCount() {
return this.options.groupCount
}
get DOMMetaData() {
return this.options.getDOMMetaDataCallback()
}
getOffsetByAllDayPanel(_ref) {
let {
groupIndex: groupIndex,
supportAllDayRow: supportAllDayRow,
showAllDayPanel: showAllDayPanel
} = _ref;
let result = 0;
if (supportAllDayRow && showAllDayPanel) {
const allDayPanelHeight = getAllDayHeight(showAllDayPanel, true, this.DOMMetaData);
result = allDayPanelHeight * (groupIndex + 1)
}
return result
}
getVerticalMax(options) {
let maxAllowedPosition = this.getMaxAllowedVerticalPosition(Object.assign({}, options, {
viewDataProvider: this.viewDataProvider,
rtlEnabled: this.rtlEnabled,
DOMMetaData: this.DOMMetaData
}));
maxAllowedPosition += this.getOffsetByAllDayPanel(options);
return maxAllowedPosition
}
getGroupTop(_ref2) {
let {
groupIndex: groupIndex,
showAllDayPanel: showAllDayPanel,
isGroupedAllDayPanel: isGroupedAllDayPanel
} = _ref2;
const rowCount = this.viewDataProvider.getRowCountInGroup(groupIndex);
const maxVerticalPosition = this.getMaxAllowedVerticalPosition({
groupIndex: groupIndex,
viewDataProvider: this.viewDataProvider,
showAllDayPanel: showAllDayPanel,
isGroupedAllDayPanel: isGroupedAllDayPanel,
isVerticalGrouping: true,
DOMMetaData: this.DOMMetaData
});
return maxVerticalPosition - getCellHeight(this.DOMMetaData) * rowCount
}
getAllDayHeight(showAllDayPanel) {
return getAllDayHeight(showAllDayPanel, true, this.DOMMetaData)
}
getMaxAllowedVerticalPosition(_ref3) {
let {
groupIndex: groupIndex,
showAllDayPanel: showAllDayPanel,
isGroupedAllDayPanel: isGroupedAllDayPanel
} = _ref3;
const {
rowIndex: rowIndex
} = this.viewDataProvider.getLastGroupCellPosition(groupIndex);
const {
dateTableCellsMeta: dateTableCellsMeta
} = this.DOMMetaData;
const lastGroupRow = dateTableCellsMeta[rowIndex];
if (!lastGroupRow) {
return 0
}
let result = lastGroupRow[0].top + lastGroupRow[0].height;
if (isGroupedAllDayPanel) {
result -= (groupIndex + 1) * this.getAllDayHeight(showAllDayPanel)
}
return result
}
}
class GroupStrategyHorizontal extends GroupStrategyBase {
getOffsetByAllDayPanel() {
return 0
}
getVerticalMax(options) {
const {
isVirtualScrolling: isVirtualScrolling,
groupIndex: groupIndex
} = options;
const correctedGroupIndex = isVirtualScrolling ? groupIndex : 0;
return this.getMaxAllowedVerticalPosition(Object.assign({}, options, {
groupIndex: correctedGroupIndex
}))
}
getGroupTop() {
return 0
}
getAllDayHeight(showAllDayPanel) {
return getAllDayHeight(showAllDayPanel, false, this.DOMMetaData)
}
}
},
11129(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/date */ 38662));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 64960));
var _element = __webpack_require__( /*! ../../../core/element */ 61404);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 17781);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 21274);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _widget = __webpack_require__( /*! ../../core/widget/widget */ 89275);
var _m_classes = __webpack_require__( /*! ../m_classes */ 80126);
var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 92201));
var _index = __webpack_require__( /*! ../r1/utils/index */ 34396);
var _constants_view = __webpack_require__( /*! ../utils/options/constants_view */ 43582);
var _agenda_group_utils = __webpack_require__( /*! ../utils/resource_manager/agenda_group_utils */ 80915);
var _m_work_space = _interopRequireDefault(__webpack_require__( /*! ./m_work_space */ 45277));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const {
tableCreator: tableCreator
} = _m_table_creator.default;
class SchedulerAgenda extends _m_work_space.default {
constructor() {
super(...arguments);
this.rows = []
}
_activeStateUnit() {
return _widget.EMPTY_ACTIVE_STATE_UNIT
}
get type() {
return _constants_view.VIEWS.AGENDA
}
getStartViewDate() {
return this.startViewDate
}
_init() {
super._init()
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
agendaDuration: 7,
rowHeight: 60,
noDataText: ""
})
}
_optionChanged(args) {
const {
name: name
} = args;
const {
value: value
} = args;
switch (name) {
case "agendaDuration":
break;
case "noDataText":
case "rowHeight":
this.recalculateAgenda(this.rows);
break;
case "groups":
if (!(null !== value && void 0 !== value && value.length)) {
if (this._$groupTable) {
this._$groupTable.remove();
this._$groupTable = null;
this.detachGroupCountClass()
}
} else if (!this._$groupTable) {
this.initGroupTable();
this._dateTableScrollable.$content().prepend(this._$groupTable)
}
super._optionChanged(args);
break;
default:
super._optionChanged(args)
}
}
_renderFocusState() {
return (0, _common.noop)()
}
_renderFocusTarget() {
return (0, _common.noop)()
}
_cleanFocusState() {
return (0, _common.noop)()
}
supportAllDayRow() {
return false
}
isVerticalGroupedWorkSpace() {
return false
}
getElementClass() {
return "dx-scheduler-agenda"
}
getRowCount() {
return this.option("agendaDuration")
}
_getCellCount() {
return 1
}
getTimePanelRowCount() {
return this.option("agendaDuration")
}
renderAllDayPanel() {
return (0, _common.noop)()
}
updateAllDayVisibility() {
return (0, _common.noop)()
}
initWorkSpaceUnits() {
this.initGroupTable();
this.$timePanel = (0, _renderer.default)("").attr("aria-hidden", true).addClass(_m_classes.TIME_PANEL_CLASS);
this._$dateTable = (0, _renderer.default)("").attr("aria-hidden", true).addClass(_m_classes.DATE_TABLE_CLASS);
this._$dateTableScrollableContent = (0, _renderer.default)("").addClass("dx-scheduler-date-table-scrollable-content");
this.$dateTableContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-date-table-container")
}
initGroupTable() {
const groups = this.option("groups");
if (null !== groups && void 0 !== groups && groups.length) {
this._$groupTable = (0, _renderer.default)(" ").attr("aria-hidden", true).addClass("dx-scheduler-group-table")
}
}
renderView() {
this.startViewDate = _index.agendaUtils.calculateStartViewDate(this.option("currentDate"), this.option("startDayHour"));
this.rows = []
}
recalculateAgenda(rows) {
let cellTemplates = [];
this.cleanView();
if (this.rowsIsEmpty(rows)) {
this.renderNoData();
return
}
this.rows = rows;
if (this._$groupTable) {
cellTemplates = this.renderGroupHeader();
this.setGroupHeaderCellsHeight()
}
this.renderTimePanel();
this.renderDateTable();
this.applyCellTemplates(cellTemplates);
this._dateTableScrollable.update()
}
renderNoData() {
this.$noDataContainer = (0, _renderer.default)("").addClass("dx-scheduler-agenda-nodata").html(this.option("noDataText"));
this._dateTableScrollable.$content().append(this.$noDataContainer)
}
setTableSizes() {
return (0, _common.noop)()
}
toggleHorizontalScrollClass() {
return (0, _common.noop)()
}
createCrossScrollingConfig(argument) {
return (0, _common.noop)()
}
setGroupHeaderCellsHeight() {
const $cells = this.getGroupHeaderCells().filter((_, element) => !element.getAttribute("rowSpan"));
const rows = this.removeEmptyRows(this.rows);
if (!rows.length) {
return
}
for (let i = 0; i < $cells.length; i++) {
const $cellContent = $cells.eq(i).find(".dx-scheduler-group-header-content");
(0, _size.setOuterHeight)($cellContent, this.getGroupRowHeight(rows[i]))
}
}
rowsIsEmpty(rows) {
let result = true;
for (let i = 0; i < rows.length; i++) {
const groupRow = rows[i];
for (let j = 0; j < groupRow.length; j++) {
if (groupRow[j]) {
result = false;
break
}
}
}
return result
}
attachGroupCountClass() {
const className = (0, _index.getVerticalGroupCountClass)(this.option("groups"));
this.$element().addClass(className)
}
removeEmptyRows(rows) {
const result = [];
const isEmpty = function(data) {
return !data.some(value => value > 0)
};
for (let i = 0; i < rows.length; i++) {
if (rows[i].length && !isEmpty(rows[i])) {
result.push(rows[i])
}
}
return result
}
getGroupHeaderContainer() {
return this._$groupTable
}
makeGroupRows() {
const resourceManager = this.option("getResourceManager")();
const allAppointments = this.option("getFilteredItems")();
const tree = (0, _agenda_group_utils.reduceResourcesTree)(resourceManager.resourceById, resourceManager.groupsTree, allAppointments);
const cellTemplate = this.option("resourceCellTemplate");
const getGroupHeaderContentClass = _m_classes.GROUP_HEADER_CONTENT_CLASS;
const cellTemplates = [];
const table = tableCreator.makeGroupedTableFromJSON(tree, {
cellTag: "th",
groupTableClass: "dx-scheduler-group-table",
groupRowClass: _m_classes.GROUP_ROW_CLASS,
groupCellClass: this.getGroupHeaderClass(),
groupCellCustomContent(cell, cellTextElement, index, node) {
const container = _dom_adapter.default.createElement("div");
container.className = getGroupHeaderContentClass;
const value = node.grouped[node.resourceIndex];
const resource = resourceManager.resourceById[node.resourceIndex];
const resourceData = null === resource || void 0 === resource ? void 0 : resource.data.find(rItem => resource.dataAccessor.get("id", rItem) === value);
const resourceItem = null === resource || void 0 === resource ? void 0 : resource.items.find(rItem => rItem.id === value);
if (null !== cellTemplate && void 0 !== cellTemplate && cellTemplate.render) {
cellTemplates.push(cellTemplate.render.bind(cellTemplate, {
model: {
data: resourceData,
id: value,
color: null === resourceItem || void 0 === resourceItem ? void 0 : resourceItem.color,
text: cellTextElement.textContent
},
container: (0, _element.getPublicElement)((0, _renderer.default)(container)),
index: index
}))
} else {
const contentWrapper = _dom_adapter.default.createElement("div");
contentWrapper.appendChild(cellTextElement);
container.appendChild(contentWrapper)
}
cell.appendChild(container)
},
cellTemplate: cellTemplate
});
return {
elements: (0, _renderer.default)(table).find(`.${_m_classes.GROUP_ROW_CLASS}`),
cellTemplates: cellTemplates
}
}
cleanView() {
this._$dateTable.empty();
this.$timePanel.empty();
if (this._$groupTable) {
this._$groupTable.empty()
}
if (this.$noDataContainer) {
this.$noDataContainer.empty();
this.$noDataContainer.remove();
delete this.$noDataContainer
}
}
createWorkSpaceElements() {
this.createWorkSpaceStaticElements()
}
createWorkSpaceStaticElements() {
this.$dateTableContainer.append(this._$dateTable);
this._dateTableScrollable.$content().append(this._$dateTableScrollableContent);
if (this._$groupTable) {
this._$dateTableScrollableContent.prepend(this._$groupTable)
}
this._$dateTableScrollableContent.append(this.$timePanel, this.$dateTableContainer);
this.$element().append(this._dateTableScrollable.$element())
}
renderDateTable() {
this.renderTableBody({
container: (0, _element.getPublicElement)(this._$dateTable),
rowClass: _m_classes.DATE_TABLE_ROW_CLASS,
cellClass: this.getDateTableCellClass()
})
}
attachTablesEvents() {
return (0, _common.noop)()
}
attachEvents() {
return (0, _common.noop)()
}
isIndicationAvailable() {
return false
}
prepareCellTemplateOptions(text, date, rowIndex, $cell) {
const leaf = this.resourceManager.groupsLeafs[rowIndex];
const groups = (null === leaf || void 0 === leaf ? void 0 : leaf.grouped) ?? {};
const groupIndex = null === leaf || void 0 === leaf ? void 0 : leaf.groupIndex;
return {
model: {
text: text,
date: date,
groups: groups,
groupIndex: groupIndex
},
container: (0, _element.getPublicElement)($cell),
index: rowIndex
}
}
renderTableBody(options, delayCellTemplateRendering) {
const cellTemplates = [];
const cellTemplateOpt = options.cellTemplate;
this.$rows = [];
let i;
const fillTableBody = function(rowIndex, rowSize) {
if (rowSize) {
let date;
let cellDateNumber;
let cellDayName;
const $row = (0, _renderer.default)(" ");
const $td = (0, _renderer.default)("| ");
(0, _size.setHeight)($td, this.getRowHeight(rowSize));
if (options.getStartDate) {
var _options$getStartDate;
date = null === (_options$getStartDate = options.getStartDate) || void 0 === _options$getStartDate ? void 0 : _options$getStartDate.call(options, rowIndex);
cellDateNumber = _date.default.format(date, "d");
cellDayName = _date.default.format(date, _index.formatWeekday)
}
if (null !== cellTemplateOpt && void 0 !== cellTemplateOpt && cellTemplateOpt.render) {
const templateOptions = this.prepareCellTemplateOptions(`${cellDateNumber} ${cellDayName}`, date, i, $td);
cellTemplates.push(cellTemplateOpt.render.bind(cellTemplateOpt, templateOptions))
} else if (cellDateNumber && cellDayName) {
$td.addClass("dx-scheduler-agenda-date").text(`${cellDateNumber} ${cellDayName}`)
}
if (options.rowClass) {
$row.addClass(options.rowClass)
}
if (options.cellClass) {
$td.addClass(options.cellClass)
}
$row.append($td);
this.$rows.push($row)
}
}.bind(this);
for (i = 0; i < this.rows.length; i++) {
(0, _iterator.each)(this.rows[i], fillTableBody);
this.setLastRowClass()
}(0, _renderer.default)(options.container).append((0, _renderer.default)(" | ").append(this.$rows));
this.applyCellTemplates(cellTemplates)
}
setLastRowClass() {
if (this.rows.length > 1 && this.$rows.length) {
const $lastRow = this.$rows[this.$rows.length - 1];
$lastRow.addClass("dx-scheduler-date-table-last-row")
}
}
renderTimePanel() {
this.renderTableBody({
container: (0, _element.getPublicElement)(this.$timePanel),
rowCount: this.getTimePanelRowCount(),
cellCount: 1,
rowClass: "dx-scheduler-time-panel-row",
cellClass: "dx-scheduler-time-panel-cell",
cellTemplate: this.option("dateCellTemplate"),
getStartDate: this.getTimePanelStartDate.bind(this)
})
}
getTimePanelStartDate(rowIndex) {
const current = new Date(this.option("currentDate"));
const cellDate = new Date(current.setDate(current.getDate() + rowIndex));
return cellDate
}
getRowHeight(rowSize) {
const baseHeight = this.option("rowHeight");
const innerOffset = 5 * (rowSize - 1);
return rowSize ? baseHeight * rowSize + innerOffset + 20 : 0
}
getGroupRowHeight(groupRows) {
if (!groupRows) {
return
}
let result = 0;
for (let i = 0; i < groupRows.length; i++) {
result += this.getRowHeight(groupRows[i])
}
return result
}
renderAgendaLayout(appointments) {
this.renderView();
const rows = _index.agendaUtils.calculateRows(appointments, this.option("agendaDuration"), this.getStartViewDate(), this.resourceManager.groupCount());
this.recalculateAgenda(rows)
}
getAgendaVerticalStepHeight() {
return this.option("rowHeight")
}
getEndViewDate() {
const currentDate = new Date(this.option("currentDate"));
const agendaDuration = this.option("agendaDuration");
currentDate.setHours(this.option("endDayHour"));
const result = currentDate.setDate(currentDate.getDate() + agendaDuration - 1) - 6e4;
return new Date(result)
}
getEndViewDateByEndDayHour() {
return this.getEndViewDate()
}
updateScrollPosition(date) {
const newDate = this.timeZoneCalculator.createDate(date, "toGrid");
const bounds = this.getVisibleBounds();
const startDateHour = newDate.getHours();
const startDateMinutes = newDate.getMinutes();
if (this.needUpdateScrollPosition(startDateHour, startDateMinutes, bounds, newDate)) {
this.scrollTo(newDate)
}
}
needUpdateScrollPosition(hours, minutes, bounds, newData) {
let isUpdateNeeded = false;
if (hours < bounds.top.hours || hours > bounds.bottom.hours) {
isUpdateNeeded = true
}
if (hours === bounds.top.hours && minutes < bounds.top.minutes) {
isUpdateNeeded = true
}
if (hours === bounds.bottom.hours && minutes > bounds.top.minutes) {
isUpdateNeeded = true
}
return isUpdateNeeded
}
renovatedRenderSupported() {
return false
}
getTotalViewDuration() {
return _date2.default.dateToMilliseconds("day") * this.option("intervalCount")
}
getDOMElementsMetaData() {
return {
dateTableCellsMeta: [
[{}]
],
allDayPanelCellsMeta: [{}]
}
}
}(0, _component_registrator.default)("dxSchedulerAgenda", SchedulerAgenda);
exports.default = SchedulerAgenda
},
46380(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CellsSelectionController = void 0;
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 34396);
exports.CellsSelectionController = class {
handleArrowClick(options) {
const {
key: key,
focusedCellPosition: focusedCellPosition,
edgeIndices: edgeIndices,
getCellDataByPosition: getCellDataByPosition,
isAllDayPanelCell: isAllDayPanelCell
} = options;
let nextCellIndices;
switch (key) {
case "down":
nextCellIndices = this.getCellFromNextRowPosition(focusedCellPosition, "next", edgeIndices);
break;
case "up":
nextCellIndices = this.getCellFromNextRowPosition(focusedCellPosition, "prev", edgeIndices);
break;
case "left":
nextCellIndices = this.getCellFromNextColumnPosition(Object.assign({}, options, {
direction: "prev"
}));
break;
case "right":
nextCellIndices = this.getCellFromNextColumnPosition(Object.assign({}, options, {
direction: "next"
}))
}
const currentCellData = getCellDataByPosition(nextCellIndices.rowIndex, nextCellIndices.columnIndex, isAllDayPanelCell);
return this.moveToCell(Object.assign({}, options, {
currentCellData: currentCellData
}))
}
getCellFromNextRowPosition(focusedCellPosition, direction, edgeIndices) {
const {
columnIndex: columnIndex,
rowIndex: rowIndex
} = focusedCellPosition;
const deltaPosition = "next" === direction ? 1 : -1;
const nextRowIndex = rowIndex + deltaPosition;
const validRowIndex = nextRowIndex >= 0 && nextRowIndex <= edgeIndices.lastRowIndex ? nextRowIndex : rowIndex;
return {
columnIndex: columnIndex,
rowIndex: validRowIndex
}
}
getCellFromNextColumnPosition(options) {
const {
focusedCellPosition: focusedCellPosition,
direction: direction,
edgeIndices: edgeIndices,
isRTL: isRTL,
isGroupedByDate: isGroupedByDate,
groupCount: groupCount,
isMultiSelection: isMultiSelection,
viewType: viewType
} = options;
const {
columnIndex: columnIndex,
rowIndex: rowIndex
} = focusedCellPosition;
const {
firstColumnIndex: firstColumnIndex,
lastColumnIndex: lastColumnIndex,
firstRowIndex: firstRowIndex,
lastRowIndex: lastRowIndex
} = edgeIndices;
const step = isGroupedByDate && isMultiSelection ? groupCount : 1;
const sign = isRTL ? -1 : 1;
const deltaColumnIndex = "next" === direction ? sign * step : -1 * sign * step;
const nextColumnIndex = columnIndex + deltaColumnIndex;
const isValidColumnIndex = nextColumnIndex >= firstColumnIndex && nextColumnIndex <= lastColumnIndex;
if (isValidColumnIndex) {
return {
columnIndex: nextColumnIndex,
rowIndex: rowIndex
}
}
return (0, _index.isDateAndTimeView)(viewType) ? focusedCellPosition : this.processEdgeCell({
nextColumnIndex: nextColumnIndex,
rowIndex: rowIndex,
columnIndex: columnIndex,
firstColumnIndex: firstColumnIndex,
lastColumnIndex: lastColumnIndex,
firstRowIndex: firstRowIndex,
lastRowIndex: lastRowIndex,
step: step
})
}
processEdgeCell(options) {
const {
nextColumnIndex: nextColumnIndex,
rowIndex: rowIndex,
columnIndex: columnIndex,
firstColumnIndex: firstColumnIndex,
lastColumnIndex: lastColumnIndex,
firstRowIndex: firstRowIndex,
lastRowIndex: lastRowIndex,
step: step
} = options;
let validColumnIndex = nextColumnIndex;
let validRowIndex = rowIndex;
const isLeftEdgeCell = nextColumnIndex < firstColumnIndex;
const isRightEdgeCell = nextColumnIndex > lastColumnIndex;
if (isLeftEdgeCell) {
const columnIndexInNextRow = lastColumnIndex - (step - columnIndex % step - 1);
const nextRowIndex = rowIndex - 1;
const isValidRowIndex = nextRowIndex >= firstRowIndex;
validRowIndex = isValidRowIndex ? nextRowIndex : rowIndex;
validColumnIndex = isValidRowIndex ? columnIndexInNextRow : columnIndex
}
if (isRightEdgeCell) {
const columnIndexInNextRow = firstColumnIndex + columnIndex % step;
const nextRowIndex = rowIndex + 1;
const isValidRowIndex = nextRowIndex <= lastRowIndex;
validRowIndex = isValidRowIndex ? nextRowIndex : rowIndex;
validColumnIndex = isValidRowIndex ? columnIndexInNextRow : columnIndex
}
return {
columnIndex: validColumnIndex,
rowIndex: validRowIndex
}
}
moveToCell(options) {
const {
isMultiSelection: isMultiSelection,
isMultiSelectionAllowed: isMultiSelectionAllowed,
focusedCellData: focusedCellData,
currentCellData: currentCellData
} = options;
const isValidMultiSelection = isMultiSelection && isMultiSelectionAllowed;
const nextFocusedCellData = isValidMultiSelection ? this.getNextCellData(currentCellData, focusedCellData) : currentCellData;
return nextFocusedCellData
}
getNextCellData(nextFocusedCellData, focusedCellData, isVirtualCell) {
if (isVirtualCell) {
return focusedCellData
}
const isValidNextFocusedCell = this.isValidNextFocusedCell(nextFocusedCellData, focusedCellData);
return isValidNextFocusedCell ? nextFocusedCellData : focusedCellData
}
isValidNextFocusedCell(nextFocusedCellData, focusedCellData) {
if (!focusedCellData) {
return true
}
const {
groupIndex: groupIndex,
allDay: allDay
} = focusedCellData;
const {
groupIndex: nextGroupIndex,
allDay: nextAllDay
} = nextFocusedCellData;
return groupIndex === nextGroupIndex && allDay === nextAllDay
}
}
},
37331(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.default = class {
constructor(viewDataProvider) {
this.viewDataProvider = viewDataProvider;
this.focusedCell = null;
this.selectedCells = null;
this.firstSelectedCell = null;
this.prevFocusedCell = null;
this.prevSelectedCells = null
}
getFocusedCell() {
const {
focusedCell: focusedCell
} = this;
if (!focusedCell) {
return
}
const {
groupIndex: groupIndex,
startDate: startDate,
allDay: allDay
} = focusedCell;
const cellInfo = {
groupIndex: groupIndex,
startDate: startDate,
isAllDay: allDay,
index: focusedCell.index
};
const cellPosition = this.viewDataProvider.findCellPositionInMap(cellInfo);
return {
coordinates: cellPosition,
cellData: focusedCell
}
}
setFocusedCell(rowIndex, columnIndex, isAllDay) {
if (rowIndex >= 0) {
const cell = this.viewDataProvider.getCellData(rowIndex, columnIndex, isAllDay);
this.focusedCell = cell
}
}
setSelectedCells(lastCellCoordinates) {
let firstCellCoordinates = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0;
const {
viewDataProvider: viewDataProvider
} = this;
const {
rowIndex: lastRowIndex,
columnIndex: lastColumnIndex,
allDay: isLastCellAllDay
} = lastCellCoordinates;
if (lastRowIndex < 0) {
return
}
const firstCell = firstCellCoordinates ? viewDataProvider.getCellData(firstCellCoordinates.rowIndex, firstCellCoordinates.columnIndex, firstCellCoordinates.allDay) : this.firstSelectedCell;
const lastCell = viewDataProvider.getCellData(lastRowIndex, lastColumnIndex, isLastCellAllDay);
this.firstSelectedCell = firstCell;
this.selectedCells = this.viewDataProvider.getCellsBetween(firstCell, lastCell)
}
setSelectedCellsByData(selectedCellsData) {
this.selectedCells = selectedCellsData
}
getSelectedCells() {
return this.selectedCells
}
releaseSelectedAndFocusedCells() {
this.releaseSelectedCells();
this.releaseFocusedCell()
}
releaseSelectedCells() {
this.prevSelectedCells = this.selectedCells;
this.prevFirstSelectedCell = this.firstSelectedCell;
this.selectedCells = null;
this.firstSelectedCell = null
}
releaseFocusedCell() {
this.prevFocusedCell = this.focusedCell;
this.focusedCell = null
}
restoreSelectedAndFocusedCells() {
this.selectedCells = this.selectedCells || this.prevSelectedCells;
this.focusedCell = this.focusedCell || this.prevFocusedCell;
this.firstSelectedCell = this.firstSelectedCell || this.prevFirstSelectedCell;
this.prevSelectedCells = null;
this.prevFirstSelectedCell = null;
this.prevFocusedCell = null
}
clearSelectedAndFocusedCells() {
this.prevSelectedCells = null;
this.selectedCells = null;
this.prevFocusedCell = null;
this.focusedCell = null
}
}
},
90214(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 17781);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _position = __webpack_require__( /*! ../../../core/utils/position */ 41639);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 3104);
var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 19747);
var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 34396);
var _m_classes = __webpack_require__( /*! ../m_classes */ 80126);
var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 92201));
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 18648));
var _current_time_shader_horizontal = _interopRequireDefault(__webpack_require__( /*! ../shaders/current_time_shader_horizontal */ 35577));
var _m_work_space_indicator = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_indicator */ 6523));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const {
tableCreator: tableCreator
} = _m_table_creator.default;
const toMs = _date.default.dateToMilliseconds;
class SchedulerTimeline extends _m_work_space_indicator.default {
constructor() {
super(...arguments);
this.viewDirection = "horizontal"
}
get verticalGroupTableClass() {
return "dx-scheduler-group-table"
}
get renovatedHeaderPanelComponent() {
return _index.HeaderPanelTimelineComponent
}
getGroupTableWidth() {
return this.$sidebarTable ? (0, _size.getOuterWidth)(this.$sidebarTable) : 0
}
getTotalRowCount(groupCount) {
if (this._isHorizontalGroupedWorkSpace()) {
return this.getRowCount()
}
groupCount = groupCount || 1;
return this.getRowCount() * groupCount
}
getFormat() {
return "shorttime"
}
getWorkSpaceHeight() {
if (this.option("crossScrollingEnabled") && (0, _window.hasWindow)()) {
return (0, _position.getBoundingRect)(this._$dateTable.get(0)).height
}
return (0, _position.getBoundingRect)(this.$element().get(0)).height
}
dateTableScrollableConfig() {
const config = super.dateTableScrollableConfig();
const timelineConfig = {
direction: "horizontal"
};
return this.option("crossScrollingEnabled") ? config : (0, _extend.extend)(config, timelineConfig)
}
needCreateCrossScrolling() {
return true
}
headerScrollableConfig() {
const config = super.headerScrollableConfig();
return (0, _extend.extend)(config, {
scrollByContent: true
})
}
supportAllDayRow() {
return false
}
getGroupHeaderContainer() {
if (this._isHorizontalGroupedWorkSpace()) {
return this._$thead
}
return this.$sidebarTable
}
insertAllDayRowsIntoDateTable() {
return false
}
needRenderWeekHeader() {
return false
}
incrementDate(date) {
date.setDate(date.getDate() + 1)
}
getIndicationCellCount() {
const timeDiff = this.getTimeDiff();
return this.calculateDurationInCells(timeDiff)
}
getTimeDiff() {
let today = this.getToday();
const date = this.getIndicationFirstViewDate();
const startViewDate = this.getStartViewDate();
const dayLightOffset = _m_utils_time_zone.default.getDaylightOffsetInMs(startViewDate, today);
if (dayLightOffset) {
today = new Date(today.getTime() + dayLightOffset)
}
return today.getTime() - date.getTime()
}
calculateDurationInCells(timeDiff) {
const today = this.getToday();
const differenceInDays = Math.floor(timeDiff / toMs("day"));
let duration = (timeDiff - differenceInDays * toMs("day") - this.option("startDayHour") * toMs("hour")) / this.getCellDuration();
if (today.getHours() > this.option("endDayHour")) {
duration = this.getCellCountInDay()
}
if (duration < 0) {
duration = 0
}
return differenceInDays * this.getCellCountInDay() + duration
}
getIndicationWidth() {
if (this.isGroupedByDate()) {
const cellCount = this.getIndicationCellCount();
const integerPart = Math.floor(cellCount);
const fractionPart = cellCount - integerPart;
return this.getCellWidth() * (integerPart * this._getGroupCount() + fractionPart)
}
return this.getIndicationCellCount() * this.getCellWidth()
}
isVerticalShader() {
return false
}
isCurrentTimeHeaderCell() {
return false
}
setTableSizes() {
super.setTableSizes();
const minHeight = this.getWorkSpaceMinHeight();
(0, _size.setHeight)(this.$sidebarTable, minHeight);
(0, _size.setHeight)(this._$dateTable, minHeight);
this.virtualScrollingDispatcher.updateDimensions()
}
getWorkSpaceMinHeight() {
let minHeight = this.getWorkSpaceHeight();
const workspaceContainerHeight = (0, _size.getOuterHeight)(this._$flexContainer, true);
if (minHeight < workspaceContainerHeight) {
minHeight = workspaceContainerHeight
}
return minHeight
}
getCellCoordinatesByIndex(index) {
return {
columnIndex: index % this._getCellCount(),
rowIndex: 0
}
}
getCellElementByPosition(cellCoordinates, groupIndex) {
const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex);
return this._$dateTable.find("tr").eq(indexes.rowIndex).find("td").eq(indexes.columnIndex)
}
getWorkSpaceWidth() {
return (0, _size.getOuterWidth)(this._$dateTable, true)
}
getIndicationFirstViewDate() {
return _date.default.trimTime(new Date(this.getStartViewDate()))
}
getIntervalBetween(currentDate, allDay) {
const startDayHour = this.option("startDayHour");
const endDayHour = this.option("endDayHour");
const firstViewDate = this.getStartViewDate();
const firstViewDateTime = firstViewDate.getTime();
const hiddenInterval = (24 - endDayHour + startDayHour) * toMs("hour");
const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate);
const apptStart = currentDate.getTime();
const fullInterval = apptStart - firstViewDateTime - timeZoneOffset;
const fullDays = Math.floor(fullInterval / toMs("day"));
const tailDuration = fullInterval - fullDays * toMs("day");
let tailDelta = 0;
const cellCount = this.getCellCountInDay() * (fullDays - this.getWeekendsCount(fullDays));
const gapBeforeAppt = apptStart - _date.default.trimTime(new Date(currentDate)).getTime();
let result = cellCount * this.option("hoursInterval") * toMs("hour");
if (!allDay) {
const hour = currentDate.getHours();
switch (true) {
case hour < startDayHour:
tailDelta = tailDuration - hiddenInterval + gapBeforeAppt;
break;
case hour >= startDayHour && hour < endDayHour:
tailDelta = tailDuration;
break;
case hour >= endDayHour:
tailDelta = tailDuration - (gapBeforeAppt - endDayHour * toMs("hour"));
break;
case !fullDays:
result = fullInterval
}
result += tailDelta
}
return result
}
getWeekendsCount(argument) {
return 0
}
getAllDayContainer() {
return null
}
getTimePanelWidth() {
return 0
}
getIntervalDuration(allDay) {
return this.getCellDuration()
}
getCellMinWidth() {
return 0
}
getWorkSpaceLeftOffset() {
return 0
}
renderRAllDayPanel() {}
renderRTimeTable() {}
renderGroupAllDayPanel() {}
generateRenderOptions(argument) {
const options = super.generateRenderOptions(true);
return Object.assign({}, options, {
isGenerateWeekDaysHeaderData: this.needRenderWeekHeader(),
getDateForHeaderText: _index2.timelineWeekUtils.getDateForHeaderText
})
}
_init() {
super._init();
this.$element().addClass("dx-scheduler-timeline");
this.$sidebarTable = (0, _renderer.default)("").addClass("dx-scheduler-group-table")
}
getDefaultGroupStrategy() {
return "vertical"
}
toggleGroupingDirectionClass() {
this.$element().toggleClass("dx-scheduler-work-space-horizontal-grouped", this._isHorizontalGroupedWorkSpace())
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
groupOrientation: "vertical"
})
}
createWorkSpaceElements() {
this.createWorkSpaceScrollableElements()
}
updateAllDayVisibility() {
return (0, _common.noop)()
}
getDateHeaderTemplate() {
return this.option("timeCellTemplate")
}
renderView() {
let groupCellTemplates;
if (!this.isRenovatedRender()) {
groupCellTemplates = this.renderGroupHeader()
}
this.renderWorkSpace();
if (this.isRenovatedRender()) {
this.virtualScrollingDispatcher.updateDimensions()
}
this._shader = new _current_time_shader_horizontal.default(this);
this.$sidebarTable.appendTo(this._sidebarScrollable.$content());
if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) {
this.renderRGroupPanel()
}
this.updateHeaderEmptyCellWidth();
this.applyCellTemplates(groupCellTemplates)
}
setHorizontalGroupHeaderCellsHeight() {
return (0, _common.noop)()
}
getTimePanelCells() {
return this.$element().find(".dx-scheduler-header-panel-cell:not(.dx-scheduler-header-panel-week-cell)")
}
getCurrentTimePanelCellIndices() {
const columnCountPerGroup = this._getCellCount();
const today = this.getToday();
const index = this.getCellIndexByDate(today);
const {
columnIndex: currentTimeColumnIndex
} = this.getCellCoordinatesByIndex(index);
if (void 0 === currentTimeColumnIndex) {
return []
}
const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? this._getGroupCount() : 1;
return [...new Array(horizontalGroupCount)].map((_, groupIndex) => columnCountPerGroup * groupIndex + currentTimeColumnIndex)
}
renderTimePanel() {
return (0, _common.noop)()
}
renderAllDayPanel() {
return (0, _common.noop)()
}
createAllDayPanelElements() {
return (0, _common.noop)()
}
renderDateHeader() {
const $headerRow = super.renderDateHeader();
if (this.needRenderWeekHeader()) {
const firstViewDate = new Date(this.getStartViewDate());
let currentDate = new Date(firstViewDate);
const $cells = [];
const groupCount = this._getGroupCount();
const cellCountInDay = this.getCellCountInDay();
const colSpan = this.isGroupedByDate() ? cellCountInDay * groupCount : cellCountInDay;
const cellTemplate = this.option("dateCellTemplate");
const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? groupCount : 1;
const cellsInGroup = this.viewDataProvider.viewDataGenerator.daysInInterval * this.option("intervalCount");
const cellsCount = cellsInGroup * horizontalGroupCount;
for (let templateIndex = 0; templateIndex < cellsCount; templateIndex++) {
const $th = (0, _renderer.default)(" ");
const text = (0, _index2.formatWeekdayAndDay)(currentDate);
if (cellTemplate) {
const templateOptions = {
model: Object.assign({
text: text,
date: new Date(currentDate)
}, this.getGroupsForDateHeaderTemplate(templateIndex, colSpan)),
container: $th,
index: templateIndex
};
cellTemplate.render(templateOptions)
} else {
$th.text(text)
}
$th.addClass("dx-scheduler-header-panel-cell").addClass("dx-scheduler-header-panel-week-cell").attr("colSpan", colSpan);
$cells.push($th);
if (templateIndex % cellsInGroup === cellsInGroup - 1) {
currentDate = new Date(firstViewDate)
} else {
this.incrementDate(currentDate)
}
}
const $row = (0, _renderer.default)(" | ").addClass("dx-scheduler-header-row").append($cells);
$headerRow.before($row)
}
}
renderIndicator(height, rtlOffset, $container, groupCount) {
let $indicator;
const width = this.getIndicationWidth();
if ("vertical" === this.option("groupOrientation")) {
$indicator = this.createIndicator($container);
(0, _size.setHeight)($indicator, (0, _position.getBoundingRect)($container.get(0)).height);
$indicator.css("left", rtlOffset ? rtlOffset - width : width)
} else {
for (let i = 0; i < groupCount; i++) {
const offset = this.isGroupedByDate() ? i * this.getCellWidth() : this._getCellCount() * this.getCellWidth() * i;
$indicator = this.createIndicator($container);
(0, _size.setHeight)($indicator, (0, _position.getBoundingRect)($container.get(0)).height);
$indicator.css("left", rtlOffset ? rtlOffset - width - offset : width + offset)
}
}
}
makeGroupRows(groups, groupByDate) {
const tableCreatorStrategy = "vertical" === this.option("groupOrientation") ? tableCreator.VERTICAL : tableCreator.HORIZONTAL;
return tableCreator.makeGroupedTable(tableCreatorStrategy, groups, {
groupRowClass: _m_classes.GROUP_ROW_CLASS,
groupHeaderRowClass: _m_classes.GROUP_ROW_CLASS,
groupHeaderClass: this.getGroupHeaderClass.bind(this),
groupHeaderContentClass: _m_classes.GROUP_HEADER_CONTENT_CLASS
}, this._getCellCount() || 1, this.option("resourceCellTemplate"), this.getTotalRowCount(this._getGroupCount()), groupByDate)
}
setCurrentTimeCells() {
const timePanelCells = this.getTimePanelCells();
const currentTimeCellIndices = this.getCurrentTimePanelCellIndices();
currentTimeCellIndices.forEach(timePanelCellIndex => {
timePanelCells.eq(timePanelCellIndex).addClass(_m_classes.HEADER_CURRENT_TIME_CELL_CLASS)
})
}
}(0, _component_registrator.default)("dxSchedulerTimeline", SchedulerTimeline);
exports.default = SchedulerTimeline
},
52515(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _constants_view = __webpack_require__( /*! ../utils/options/constants_view */ 43582);
var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 90214));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class SchedulerTimelineDay extends _m_timeline.default {
get type() {
return _constants_view.VIEWS.TIMELINE_DAY
}
getElementClass() {
return "dx-scheduler-timeline-day"
}
needRenderWeekHeader() {
return this.isWorkSpaceWithCount()
}
}(0, _component_registrator.default)("dxSchedulerTimelineDay", SchedulerTimelineDay);
exports.default = SchedulerTimelineDay
},
23791(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 19747);
var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 34396);
var _constants_view = __webpack_require__( /*! ../utils/options/constants_view */ 43582);
var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 90214));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class SchedulerTimelineMonth extends _m_timeline.default {
constructor() {
super(...arguments);
this.viewDirection = "horizontal"
}
get type() {
return _constants_view.VIEWS.TIMELINE_MONTH
}
get renovatedHeaderPanelComponent() {
return _index.HeaderPanelComponent
}
renderView() {
super.renderView();
this.updateScrollable()
}
getElementClass() {
return "dx-scheduler-timeline-month"
}
getDateHeaderTemplate() {
return this.option("dateCellTemplate")
}
calculateDurationInCells(timeDiff) {
return timeDiff / this.getCellDuration()
}
isIndicatorVisible() {
return true
}
getFormat() {
return _index2.formatWeekdayAndDay
}
getIntervalBetween(currentDate) {
const firstViewDate = this.getStartViewDate();
const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate);
return currentDate.getTime() - (firstViewDate.getTime() - 36e5 * this.option("startDayHour")) - timeZoneOffset
}
getViewStartByOptions() {
return _index2.monthUtils.getViewStartByOptions(this.option("startDate"), this.option("currentDate"), this.option("intervalCount"), _date.default.getFirstMonthDate(this.option("startDate")))
}
generateRenderOptions() {
const options = super.generateRenderOptions(true);
return Object.assign({}, options, {
getDateForHeaderText: (_, date) => date
})
}
keepOriginalHours() {
return true
}
}(0, _component_registrator.default)("dxSchedulerTimelineMonth", SchedulerTimelineMonth);
exports.default = SchedulerTimelineMonth
},
10621(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _constants_view = __webpack_require__( /*! ../utils/options/constants_view */ 43582);
var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 90214));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class SchedulerTimelineWeek extends _m_timeline.default {
get type() {
return _constants_view.VIEWS.TIMELINE_WEEK
}
getElementClass() {
return "dx-scheduler-timeline-week"
}
needRenderWeekHeader() {
return true
}
incrementDate(date) {
date.setDate(date.getDate() + 1)
}
}
exports.default = SchedulerTimelineWeek;
(0, _component_registrator.default)("dxSchedulerTimelineWeek", SchedulerTimelineWeek)
},
64063(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 92848));
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 34396);
var _constants_view = __webpack_require__( /*! ../utils/options/constants_view */ 43582);
var _m_timeline_week = _interopRequireDefault(__webpack_require__( /*! ./m_timeline_week */ 10621));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class SchedulerTimelineWorkWeek extends _m_timeline_week.default {
get type() {
return _constants_view.VIEWS.TIMELINE_WORK_WEEK
}
constructor() {
super(...arguments);
this.getWeekendsCount = _index.getWeekendsCount
}
getElementClass() {
return "dx-scheduler-timeline-work-week"
}
incrementDate(date) {
const day = date.getDay();
if (5 === day) {
date.setDate(date.getDate() + 2)
}
super.incrementDate(date)
}
}(0, _component_registrator.default)("dxSchedulerTimelineWorkWeek", SchedulerTimelineWorkWeek);
exports.default = SchedulerTimelineWorkWeek
},
65874(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VirtualScrollingRenderer = exports.VirtualScrollingDispatcher = void 0;
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/events/core/events_engine */ 92774));
var _index = __webpack_require__( /*! ../../../common/core/events/utils/index */ 98834);
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 64960));
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 3104);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const DOCUMENT_SCROLL_EVENT_NAMESPACE = (0, _index.addNamespace)("scroll", "dxSchedulerVirtualScrolling");
const scrollingOrientations_vertical = "vertical",
scrollingOrientations_horizontal = "horizontal",
scrollingOrientations_both = "both",
scrollingOrientations_none = "none";
const DefaultScrollingOrientation = scrollingOrientations_both;
exports.VirtualScrollingDispatcher = class {
constructor(options) {
this.options = options;
if (options) {
this.rowHeightValue = this.getCellHeight();
this.cellWidthValue = this.getCellWidth();
this.createVirtualScrollingBase()
}
}
get isRTL() {
return this.options.isRTL()
}
get verticalVirtualScrolling() {
return this.verticalVirtualScrollingValue
}
set verticalVirtualScrolling(value) {
this.verticalVirtualScrollingValue = value
}
get horizontalVirtualScrolling() {
return this.horizontalVirtualScrollingValue
}
set horizontalVirtualScrolling(value) {
this.horizontalVirtualScrollingValue = value
}
get document() {
return _dom_adapter.default.getDocument()
}
get height() {
return this.options.getSchedulerHeight()
}
get width() {
return this.options.getSchedulerWidth()
}
get rowHeight() {
return this.rowHeightValue
}
set rowHeight(value) {
this.rowHeightValue = value
}
get outlineCount() {
return this.options.getScrolling().outlineCount
}
get cellWidth() {
return this.cellWidthValue
}
set cellWidth(value) {
this.cellWidthValue = value
}
get viewportWidth() {
const width = this.width && this.options.getViewWidth();
return width > 0 ? width : this.options.getWindowWidth()
}
get viewportHeight() {
const height = this.height && this.options.getViewHeight();
return height > 0 ? height : this.options.getWindowHeight()
}
get cellCountInsideTopVirtualRow() {
var _this$verticalScrolli;
return (null === (_this$verticalScrolli = this.verticalScrollingState) || void 0 === _this$verticalScrolli ? void 0 : _this$verticalScrolli.virtualItemCountBefore) || 0
}
get cellCountInsideLeftVirtualCell() {
var _this$horizontalScrol;
return (null === (_this$horizontalScrol = this.horizontalScrollingState) || void 0 === _this$horizontalScrol ? void 0 : _this$horizontalScrol.virtualItemCountBefore) || 0
}
get cellCountInsideRightVirtualCell() {
var _this$horizontalScrol2;
return (null === (_this$horizontalScrol2 = this.horizontalScrollingState) || void 0 === _this$horizontalScrol2 ? void 0 : _this$horizontalScrol2.virtualItemCountAfter) || 0
}
get topVirtualRowsCount() {
return this.cellCountInsideTopVirtualRow > 0 ? 1 : 0
}
get leftVirtualCellsCount() {
const virtualItemsCount = !this.isRTL ? this.cellCountInsideLeftVirtualCell : this.cellCountInsideRightVirtualCell;
return Math.ceil(virtualItemsCount / 1e3)
}
get virtualRowOffset() {
var _this$verticalScrolli2;
return (null === (_this$verticalScrolli2 = this.verticalScrollingState) || void 0 === _this$verticalScrolli2 ? void 0 : _this$verticalScrolli2.virtualItemSizeBefore) || 0
}
get virtualCellOffset() {
var _this$horizontalScrol3;
return (null === (_this$horizontalScrol3 = this.horizontalScrollingState) || void 0 === _this$horizontalScrol3 ? void 0 : _this$horizontalScrol3.virtualItemSizeBefore) || 0
}
get scrollingState() {
var _this$verticalVirtual, _this$horizontalVirtu;
return {
vertical: null === (_this$verticalVirtual = this.verticalVirtualScrolling) || void 0 === _this$verticalVirtual ? void 0 : _this$verticalVirtual.state,
horizontal: null === (_this$horizontalVirtu = this.horizontalVirtualScrolling) || void 0 === _this$horizontalVirtu ? void 0 : _this$horizontalVirtu.state
}
}
get verticalScrollingState() {
return this.scrollingState.vertical
}
get horizontalScrollingState() {
return this.scrollingState.horizontal
}
get scrollingOrientation() {
const scrolling = this.options.getScrolling();
if ("standard" === scrolling.mode) {
return scrollingOrientations_none
}
return scrolling.orientation || DefaultScrollingOrientation
}
get verticalScrollingAllowed() {
return this.scrollingOrientation === scrollingOrientations_vertical || this.scrollingOrientation === scrollingOrientations_both
}
get horizontalScrollingAllowed() {
return this.scrollingOrientation === scrollingOrientations_horizontal || this.scrollingOrientation === scrollingOrientations_both
}
setViewOptions(options) {
this.options = options;
if (this.verticalVirtualScrolling) {
this.verticalVirtualScrolling.options = options;
this.verticalVirtualScrolling.itemSize = this.rowHeight;
this.verticalVirtualScrolling.viewportSize = this.viewportHeight
}
if (this.horizontalVirtualScrolling) {
this.horizontalVirtualScrolling.options = options;
this.verticalVirtualScrolling.itemSize = this.cellWidth;
this.verticalVirtualScrolling.viewportSize = this.viewportWidth
}
}
getRenderState() {
var _this$verticalVirtual2, _this$horizontalVirtu2;
const verticalRenderState = (null === (_this$verticalVirtual2 = this.verticalVirtualScrolling) || void 0 === _this$verticalVirtual2 ? void 0 : _this$verticalVirtual2.getRenderState()) || {};
const horizontalRenderState = (null === (_this$horizontalVirtu2 = this.horizontalVirtualScrolling) || void 0 === _this$horizontalVirtu2 ? void 0 : _this$horizontalVirtu2.getRenderState()) || {};
return Object.assign({}, verticalRenderState, horizontalRenderState)
}
getCellHeight() {
const cellHeight = this.options.getCellHeight();
const result = cellHeight > 0 ? cellHeight : 50;
return Math.floor(result)
}
getCellWidth() {
let cellWidth = this.options.getCellWidth();
const minCellWidth = this.options.getCellMinWidth();
if (!cellWidth || cellWidth < minCellWidth) {
cellWidth = minCellWidth
}
const result = cellWidth > 0 ? cellWidth : 1;
return Math.floor(result)
}
calculateCoordinatesByDataAndPosition(cellData, position, date, isCalculateTime, isVerticalDirectionView) {
const {
rowIndex: rowIndex,
columnIndex: columnIndex
} = position;
const {
startDate: startDate,
endDate: endDate,
allDay: allDay
} = cellData;
const timeToScroll = date.getTime();
const cellStartTime = startDate.getTime();
const cellEndTime = endDate.getTime();
const scrollInCell = allDay || !isCalculateTime ? 0 : (timeToScroll - cellStartTime) / (cellEndTime - cellStartTime);
const cellWidth = this.getCellWidth();
const rowHeight = this.getCellHeight();
const top = isVerticalDirectionView ? (rowIndex + scrollInCell) * rowHeight : rowIndex * rowHeight;
let left = isVerticalDirectionView ? columnIndex * cellWidth : (columnIndex + scrollInCell) * cellWidth;
if (this.isRTL) {
left = this.options.getScrollableOuterWidth() - left
}
return {
top: top,
left: left
}
}
dispose() {
if (this.onScrollHandler) {
_events_engine.default.off(this.document, DOCUMENT_SCROLL_EVENT_NAMESPACE, this.onScrollHandler)
}
}
createVirtualScrolling() {
const isVerticalVirtualScrollingCreated = Boolean(this.verticalVirtualScrolling);
const isHorizontalVirtualScrollingCreated = Boolean(this.horizontalVirtualScrolling);
if (this.verticalScrollingAllowed !== isVerticalVirtualScrollingCreated || this.horizontalScrollingAllowed !== isHorizontalVirtualScrollingCreated) {
this.rowHeightValue = this.getCellHeight();
this.cellWidthValue = this.getCellWidth();
this.createVirtualScrollingBase()
}
}
createVirtualScrollingBase() {
if (this.verticalScrollingAllowed) {
this.verticalVirtualScrolling = new VerticalVirtualScrolling(Object.assign({}, this.options, {
viewportHeight: this.viewportHeight,
rowHeight: this.rowHeight,
outlineCount: this.outlineCount
}))
}
if (this.horizontalScrollingAllowed) {
this.horizontalVirtualScrolling = new HorizontalVirtualScrolling(Object.assign({}, this.options, {
viewportWidth: this.viewportWidth,
cellWidth: this.cellWidth,
outlineCount: this.outlineCount
}))
}
}
isAttachWindowScrollEvent() {
return (this.horizontalScrollingAllowed || this.verticalScrollingAllowed) && !this.height
}
attachScrollableEvents() {
if (this.isAttachWindowScrollEvent()) {
this.attachWindowScroll()
}
}
attachWindowScroll() {
const window = (0, _window.getWindow)();
this.onScrollHandler = this.options.createAction(() => {
const {
scrollX: scrollX,
scrollY: scrollY
} = window;
if (scrollX >= 10 || scrollY >= 10) {
this.handleOnScrollEvent({
left: scrollX,
top: scrollY
})
}
});
_events_engine.default.on(this.document, DOCUMENT_SCROLL_EVENT_NAMESPACE, this.onScrollHandler)
}
handleOnScrollEvent(scrollPosition) {
if (scrollPosition) {
var _this$verticalVirtual3, _this$horizontalVirtu3;
const {
left: left,
top: top
} = scrollPosition;
const verticalStateChanged = (0, _type.isDefined)(top) && (null === (_this$verticalVirtual3 = this.verticalVirtualScrolling) || void 0 === _this$verticalVirtual3 ? void 0 : _this$verticalVirtual3.updateState(top));
const horizontalStateChanged = (0, _type.isDefined)(left) && (null === (_this$horizontalVirtu3 = this.horizontalVirtualScrolling) || void 0 === _this$horizontalVirtu3 ? void 0 : _this$horizontalVirtu3.updateState(left));
if (verticalStateChanged || horizontalStateChanged) {
var _this$options$updateR, _this$options;
null === (_this$options$updateR = (_this$options = this.options).updateRender) || void 0 === _this$options$updateR || _this$options$updateR.call(_this$options)
}
}
}
updateDimensions(isForce) {
const cellHeight = this.getCellHeight();
const needUpdateVertical = this.verticalScrollingAllowed && cellHeight !== this.rowHeight;
if ((needUpdateVertical || isForce) && this.verticalVirtualScrolling) {
this.rowHeight = cellHeight;
this.verticalVirtualScrolling.viewportSize = this.viewportHeight;
this.verticalVirtualScrolling.reinitState(cellHeight, isForce)
}
const cellWidth = this.getCellWidth();
const needUpdateHorizontal = this.horizontalScrollingAllowed && cellWidth !== this.cellWidth;
if ((needUpdateHorizontal || isForce) && this.horizontalVirtualScrolling) {
this.cellWidth = cellWidth;
this.horizontalVirtualScrolling.viewportSize = this.viewportWidth;
this.horizontalVirtualScrolling.reinitState(cellWidth, isForce)
}
if (needUpdateVertical || needUpdateHorizontal) {
var _this$options$updateG, _this$options2;
null === (_this$options$updateG = (_this$options2 = this.options).updateGrid) || void 0 === _this$options$updateG || _this$options$updateG.call(_this$options2)
}
}
};
class VirtualScrollingBase {
constructor(options) {
this.options = options;
this.stateValue = this.defaultState;
this.viewportSize = this.options.viewportSize;
this.itemSizeValue = this.options.itemSize;
this.positionValue = -1;
this.itemSizeChanged = false;
this.updateState(0)
}
get itemSize() {
return this.itemSizeValue
}
set itemSize(value) {
this.itemSizeChanged = this.itemSizeValue !== value;
this.itemSizeValue = value
}
get state() {
return this.stateValue
}
set state(value) {
this.stateValue = value
}
get startIndex() {
return this.state.startIndex
}
get pageSize() {
return Math.ceil(this.viewportSize / this.itemSize)
}
get outlineCount() {
return (0, _type.isDefined)(this.options.outlineCount) ? this.options.outlineCount : Math.floor(this.pageSize / 2)
}
get groupCount() {
return this.options.getGroupCount()
}
get isVerticalGrouping() {
return this.options.isVerticalGrouping()
}
get defaultState() {
return {
prevPosition: 0,
startIndex: -1,
itemCount: 0,
virtualItemCountBefore: 0,
virtualItemCountAfter: 0,
outlineCountBefore: 0,
outlineCountAfter: 0,
virtualItemSizeBefore: 0,
virtualItemSizeAfter: 0,
outlineSizeBefore: 0,
outlineSizeAfter: 0
}
}
get maxScrollPosition() {
return this.getTotalItemCount() * this.itemSize - this.viewportSize
}
get position() {
return this.positionValue
}
set position(value) {
this.positionValue = value
}
needUpdateState(position) {
const {
prevPosition: prevPosition,
startIndex: startIndex
} = this.state;
const isFirstInitialization = startIndex < 0;
if (isFirstInitialization) {
return true
}
let isStartIndexChanged = false;
if (this.validateAndSavePosition(position)) {
if (0 === position || position === this.maxScrollPosition) {
return true
}
const currentPosition = prevPosition;
const currentItemsCount = Math.floor(currentPosition / this.itemSize);
const itemsCount = Math.floor(position / this.itemSize);
isStartIndexChanged = Math.abs(currentItemsCount - itemsCount) >= this.outlineCount
}
return isStartIndexChanged
}
validateAndSavePosition(position) {
if (!(0, _type.isDefined)(position)) {
return false
}
const result = this.position !== position;
this.position = position;
return result
}
correctPosition(position) {
return position >= 0 ? Math.min(position, this.maxScrollPosition) : -1
}
updateState(position, isForce) {
position = this.correctPosition(position);
if (!this.needUpdateState(position) && !isForce) {
return false
}
const itemsInfoBefore = this.calcItemInfoBefore(position);
const itemsDeltaBefore = this.calcItemDeltaBefore(itemsInfoBefore);
const {
outlineCountAfter: outlineCountAfter,
virtualItemCountAfter: virtualItemCountAfter,
itemCountWithAfter: itemCountWithAfter
} = this.calcItemInfoAfter(itemsDeltaBefore);
const {
virtualItemCountBefore: virtualItemCountBefore,
outlineCountBefore: outlineCountBefore
} = itemsInfoBefore;
const itemCount = outlineCountBefore + itemCountWithAfter + outlineCountAfter;
const itemCountBefore = Math.floor(position / this.itemSize);
this.state.prevPosition = itemCountBefore * this.itemSize;
this.state.startIndex = itemCountBefore - outlineCountBefore;
this.state.virtualItemCountBefore = virtualItemCountBefore;
this.state.outlineCountBefore = outlineCountBefore;
this.state.itemCount = itemCount;
this.state.outlineCountAfter = outlineCountAfter;
this.state.virtualItemCountAfter = virtualItemCountAfter;
this.updateStateCore();
return true
}
reinitState(itemSize, isForceUpdate) {
const {
position: position
} = this;
this.itemSize = itemSize;
this.updateState(0, isForceUpdate);
if (position > 0) {
this.updateState(position, isForceUpdate)
}
}
calcItemInfoBefore(position) {
let virtualItemCountBefore = Math.floor(position / this.itemSize);
const outlineCountBefore = Math.min(virtualItemCountBefore, this.outlineCount);
virtualItemCountBefore -= outlineCountBefore;
return {
virtualItemCountBefore: virtualItemCountBefore,
outlineCountBefore: outlineCountBefore
}
}
calcItemDeltaBefore(itemInfoBefore) {
const {
virtualItemCountBefore: virtualItemCountBefore,
outlineCountBefore: outlineCountBefore
} = itemInfoBefore;
const totalItemCount = this.getTotalItemCount();
return totalItemCount - virtualItemCountBefore - outlineCountBefore
}
getTotalItemCount() {
throw "getTotalItemCount method should be implemented"
}
getRenderState() {
throw "getRenderState method should be implemented"
}
calcItemInfoAfter(itemsDeltaBefore) {
const itemCountWithAfter = itemsDeltaBefore >= this.pageSize ? this.pageSize : itemsDeltaBefore;
let virtualItemCountAfter = itemsDeltaBefore - itemCountWithAfter;
const outlineCountAfter = virtualItemCountAfter > 0 ? Math.min(virtualItemCountAfter, this.outlineCount) : 0;
if (virtualItemCountAfter > 0) {
virtualItemCountAfter -= outlineCountAfter
}
return {
virtualItemCountAfter: virtualItemCountAfter,
outlineCountAfter: outlineCountAfter,
itemCountWithAfter: itemCountWithAfter
}
}
updateStateCore() {
const {
state: state
} = this;
const {
virtualItemCountBefore: virtualItemCountBefore
} = state;
const {
virtualItemCountAfter: virtualItemCountAfter
} = state;
const {
outlineCountBefore: outlineCountBefore
} = state;
const {
outlineCountAfter: outlineCountAfter
} = state;
const prevVirtualItemSizeBefore = state.virtualItemSizeBefore;
const prevVirtualItemSizeAfter = state.virtualItemSizeAfter;
const prevOutlineSizeBefore = state.outlineSizeBefore;
const prevOutlineSizeAfter = state.outlineSizeAfter;
const virtualItemSizeBefore = this.itemSize * virtualItemCountBefore;
const virtualItemSizeAfter = this.itemSize * virtualItemCountAfter;
const outlineSizeBefore = this.itemSize * outlineCountBefore;
const outlineSizeAfter = this.itemSize * outlineCountAfter;
const prevVirtualSizeBefore = prevVirtualItemSizeBefore + prevOutlineSizeBefore;
const virtualSizeBefore = virtualItemSizeBefore + outlineSizeBefore;
const prevVirtualSizeAfter = prevVirtualItemSizeAfter + prevOutlineSizeAfter;
const virtualSizeAfter = virtualItemSizeAfter + outlineSizeAfter;
const isAppend = prevVirtualSizeBefore < virtualSizeBefore;
const isPrepend = prevVirtualSizeAfter < virtualSizeAfter;
const needAddItems = this.itemSizeChanged || isAppend || isPrepend;
if (needAddItems) {
this.updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter)
}
}
updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter) {
const {
state: state
} = this;
state.virtualItemSizeBefore = virtualItemSizeBefore;
state.virtualItemSizeAfter = virtualItemSizeAfter
}
}
class VerticalVirtualScrolling extends VirtualScrollingBase {
constructor(options) {
super(Object.assign({}, options, {
itemSize: options.rowHeight,
viewportSize: options.viewportHeight
}))
}
get prevTopPosition() {
return this.state.prevPosition
}
get rowCount() {
return this.state.itemCount
}
get topVirtualRowCount() {
return this.state.virtualItemCountBefore
}
get bottomVirtualRowCount() {
return this.state.virtualItemCountAfter
}
getTotalItemCount() {
return this.options.getTotalRowCount(this.groupCount, this.isVerticalGrouping)
}
getRenderState() {
return {
topVirtualRowHeight: this.state.virtualItemSizeBefore,
bottomVirtualRowHeight: this.state.virtualItemSizeAfter,
startRowIndex: this.state.startIndex,
rowCount: this.state.itemCount,
startIndex: this.state.startIndex
}
}
}
class HorizontalVirtualScrolling extends VirtualScrollingBase {
constructor(options) {
super(Object.assign({}, options, {
itemSize: options.cellWidth,
viewportSize: options.viewportWidth
}))
}
get isRTL() {
return this.options.isRTL()
}
getTotalItemCount() {
return this.options.getTotalCellCount(this.groupCount, this.isVerticalGrouping)
}
getRenderState() {
return {
leftVirtualCellWidth: this.state.virtualItemSizeBefore,
rightVirtualCellWidth: this.state.virtualItemSizeAfter,
startCellIndex: this.state.startIndex,
cellCount: this.state.itemCount,
cellWidth: this.itemSize
}
}
updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter) {
if (!this.isRTL) {
super.updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter)
} else {
const {
state: state
} = this;
state.virtualItemSizeAfter = virtualItemSizeBefore;
state.virtualItemSizeBefore = virtualItemSizeAfter;
state.startIndex = this.getTotalItemCount() - this.startIndex - this.state.itemCount
}
}
}
exports.VirtualScrollingRenderer = class {
constructor(workspaceValue) {
this.workspaceValue = workspaceValue;
this.renderAppointmentTimeoutID = null
}
getRenderTimeout() {
return 15
}
get workspace() {
return this.workspaceValue
}
updateRender() {
this._renderGrid();
this.renderAppointments()
}
_renderGrid() {
this.workspace.renderWorkSpace(false)
}
renderAppointments() {
const renderTimeout = this.getRenderTimeout();
if (renderTimeout >= 0) {
clearTimeout(this.renderAppointmentTimeoutID);
this.renderAppointmentTimeoutID = setTimeout(() => this.workspace.renderAppointments(), renderTimeout)
} else {
this.workspace.renderAppointments()
}
}
}
},
45277(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _translator = __webpack_require__( /*! ../../../common/core/animation/translator */ 88603);
var _click = __webpack_require__( /*! ../../../common/core/events/click */ 64044);
var _contextmenu = __webpack_require__( /*! ../../../common/core/events/contextmenu */ 80248);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/events/core/events_engine */ 92774));
var _drag = __webpack_require__( /*! ../../../common/core/events/drag */ 59144);
var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/events/pointer */ 89797));
var _index = __webpack_require__( /*! ../../../common/core/events/utils/index */ 98834);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../common/core/localization/message */ 4671));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 64960));
var _element = __webpack_require__( /*! ../../../core/element */ 61404);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 64553));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 17781);
var _data = __webpack_require__( /*! ../../../core/utils/data */ 31e3);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 41380));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 52576);
var _position = __webpack_require__( /*! ../../../core/utils/position */ 41639);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 57653);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 3104);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.errors */ 35185));
var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 11118));
var _scroll = __webpack_require__( /*! ../../core/utils/scroll */ 11371);
var _index2 = __webpack_require__( /*! ../../scheduler/r1/components/index */ 19747);
var _index3 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 34396);
var _scrollable = _interopRequireDefault(__webpack_require__( /*! ../../ui/scroll_view/scrollable */ 85326));
var _constants = __webpack_require__( /*! ../constants */ 25307);
var _global_cache = __webpack_require__( /*! ../global_cache */ 23710);
var _m_appointment_drag_behavior = _interopRequireDefault(__webpack_require__( /*! ../m_appointment_drag_behavior */ 80621));
var _m_classes = __webpack_require__( /*! ../m_classes */ 80126);
var _m_compact_appointments_helper = __webpack_require__( /*! ../m_compact_appointments_helper */ 64787);
var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 92201));
var _m_utils = __webpack_require__( /*! ../m_utils */ 5327);
var _current_time_shader_vertical = _interopRequireDefault(__webpack_require__( /*! ../shaders/current_time_shader_vertical */ 25167));
var _appointment_groups_utils = __webpack_require__( /*! ../utils/resource_manager/appointment_groups_utils */ 11649);
var _group_utils = __webpack_require__( /*! ../utils/resource_manager/group_utils */ 76131);
var _m_position_helper = __webpack_require__( /*! ./helpers/m_position_helper */ 39979);
var _m_cells_selection_controller = __webpack_require__( /*! ./m_cells_selection_controller */ 46380);
var _m_cells_selection_state = _interopRequireDefault(__webpack_require__( /*! ./m_cells_selection_state */ 37331));
var _m_virtual_scrolling = __webpack_require__( /*! ./m_virtual_scrolling */ 65874);
var _m_work_space_grouped_strategy_horizontal = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_grouped_strategy_horizontal */ 24005));
var _m_work_space_grouped_strategy_vertical = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_grouped_strategy_vertical */ 16259));
var _m_view_data_provider = _interopRequireDefault(__webpack_require__( /*! ./view_model/m_view_data_provider */ 6051));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const {
tableCreator: tableCreator
} = _m_table_creator.default;
const {
abstract: abstract
} = _ui2.default;
const toMs = _date.default.dateToMilliseconds;
const ALL_DAY_TABLE_CELL_CLASS = "dx-scheduler-all-day-table-cell";
const DATE_TABLE_CELL_CLASS = "dx-scheduler-date-table-cell";
const SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.down, "dxSchedulerWorkSpace");
const DragEventNames = {
ENTER: (0, _index.addNamespace)(_drag.enter, "dxSchedulerDateTable"),
DROP: (0, _index.addNamespace)(_drag.drop, "dxSchedulerDateTable"),
LEAVE: (0, _index.addNamespace)(_drag.leave, "dxSchedulerDateTable")
};
const SCHEDULER_CELL_DXCLICK_EVENT_NAME = (0, _index.addNamespace)(_click.name, "dxSchedulerDateTable");
const SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.down, "dxSchedulerDateTable");
const SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.up, "dxSchedulerDateTable");
const SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.move, "dxSchedulerDateTable");
const DAY_MS = toMs("day");
const HOUR_MS = toMs("hour");
const DRAG_AND_DROP_SELECTOR = `.${_m_classes.DATE_TABLE_CLASS} td, .dx-scheduler-all-day-table td`;
const CELL_SELECTOR = `.${DATE_TABLE_CELL_CLASS}, .${ALL_DAY_TABLE_CELL_CLASS}`;
const DEFAULT_WORKSPACE_RENDER_OPTIONS = {
renderComponents: {
header: true,
timePanel: true,
dateTable: true,
allDayPanel: true
},
generateNewData: true
};
class SchedulerWorkSpace extends _ui2.default {
constructor() {
super(...arguments);
this.viewDirection = "vertical"
}
_activeStateUnit() {
return CELL_SELECTOR
}
get type() {
return ""
}
get viewDataProvider() {
if (!this.viewDataProviderValue) {
this.viewDataProviderValue = new _m_view_data_provider.default(this.type)
}
return this.viewDataProviderValue
}
get cache() {
if (!this.cacheValue) {
this.cacheValue = new _global_cache.Cache
}
return this.cacheValue
}
get resourceManager() {
return this.option("getResourceManager")()
}
get cellsSelectionState() {
if (!this.cellsSelectionStateValue) {
this.cellsSelectionStateValue = new _m_cells_selection_state.default(this.viewDataProvider);
const selectedCellsOption = this.option("selectedCellData");
if ((null === selectedCellsOption || void 0 === selectedCellsOption ? void 0 : selectedCellsOption.length) > 0) {
const validSelectedCells = selectedCellsOption.map(selectedCell => {
const {
groups: groups
} = selectedCell;
if (!groups || 0 === this._getGroupCount()) {
return Object.assign({}, selectedCell, {
groupIndex: 0
})
}
const groupIndex = this.getGroupIndexByGroupValues(groups);
return Object.assign({}, selectedCell, {
groupIndex: groupIndex
})
});
this.cellsSelectionStateValue.setSelectedCellsByData(validSelectedCells)
}
}
return this.cellsSelectionStateValue
}
get cellsSelectionController() {
if (!this.cellsSelectionControllerValue) {
this.cellsSelectionControllerValue = new _m_cells_selection_controller.CellsSelectionController
}
return this.cellsSelectionControllerValue
}
get isAllDayPanelVisible() {
return this.isShowAllDayPanel() && this.supportAllDayRow()
}
get verticalGroupTableClass() {
return "dx-scheduler-work-space-vertical-group-table"
}
get renovatedHeaderPanelComponent() {
return _index2.HeaderPanelComponent
}
get timeZoneCalculator() {
return this.option("timeZoneCalculator")
}
get isDefaultDraggingMode() {
return "default" === this.option("draggingMode")
}
notifyObserver(funcName, args) {
this.invoke(funcName, ...args)
}
invoke(funcName) {
const notifyScheduler = this.option("notifyScheduler");
if (!notifyScheduler) {
return
}
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key]
}
return notifyScheduler.invoke(funcName, ...args)
}
_supportedKeys() {
const clickHandler = function(e) {
e.preventDefault();
e.stopPropagation();
const selectedCells = this.getSelectedCellsData();
if (null !== selectedCells && void 0 !== selectedCells && selectedCells.length) {
const selectedCellsElement = selectedCells.map(cellData => this.getCellByData(cellData)).filter(cell => Boolean(cell));
e.target = selectedCellsElement;
this.showPopup = true;
this.cellClickAction({
event: e,
cellElement: (0, _renderer.default)(selectedCellsElement),
cellData: selectedCells[0]
})
}
};
const onArrowPressed = (e, key) => {
var _this$cellsSelectionS;
e.preventDefault();
e.stopPropagation();
const focusedCellData = null === (_this$cellsSelectionS = this.cellsSelectionState.getFocusedCell()) || void 0 === _this$cellsSelectionS ? void 0 : _this$cellsSelectionS.cellData;
if (focusedCellData) {
const isAllDayPanelCell = focusedCellData.allDay && !this.isVerticalGroupedWorkSpace();
const isMultiSelection = e.shiftKey;
const isMultiSelectionAllowed = this.option("allowMultipleCellSelection");
const isRTL = this.isRTL();
const groupCount = this._getGroupCount();
const isGroupedByDate = this.isGroupedByDate();
const isHorizontalGrouping = this._isHorizontalGroupedWorkSpace();
const focusedCellPosition = this.viewDataProvider.findCellPositionInMap(Object.assign({}, focusedCellData, {
isAllDay: focusedCellData.allDay
}));
const edgeIndices = isHorizontalGrouping && isMultiSelection && !isGroupedByDate ? this.viewDataProvider.getGroupEdgeIndices(focusedCellData.groupIndex, isAllDayPanelCell) : this.viewDataProvider.getViewEdgeIndices(isAllDayPanelCell);
const nextCellData = this.cellsSelectionController.handleArrowClick({
focusedCellPosition: focusedCellPosition,
edgeIndices: edgeIndices,
isRTL: isRTL,
isGroupedByDate: isGroupedByDate,
groupCount: groupCount,
isMultiSelection: isMultiSelection,
isMultiSelectionAllowed: isMultiSelectionAllowed,
viewType: this.type,
key: key,
getCellDataByPosition: this.viewDataProvider.getCellData.bind(this.viewDataProvider),
isAllDayPanelCell: isAllDayPanelCell,
focusedCellData: focusedCellData
});
this.processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection && isMultiSelectionAllowed)
}
};
return (0, _extend.extend)(super._supportedKeys(), {
enter: clickHandler,
space: clickHandler,
downArrow: e => {
onArrowPressed(e, "down")
},
upArrow: e => {
onArrowPressed(e, "up")
},
rightArrow: e => {
onArrowPressed(e, "right")
},
leftArrow: e => {
onArrowPressed(e, "left")
}
})
}
isRTL() {
return this.option("rtlEnabled")
}
moveToCell($cell, isMultiSelection) {
if (!(0, _type.isDefined)($cell) || !$cell.length) {
return
}
const isMultiSelectionAllowed = this.option("allowMultipleCellSelection");
const currentCellData = this.getFullCellData($cell);
const focusedCell = this.cellsSelectionState.getFocusedCell();
if (!focusedCell) {
return
}
const focusedCellData = focusedCell.cellData;
const nextFocusedCellData = this.cellsSelectionController.moveToCell({
isMultiSelection: isMultiSelection,
isMultiSelectionAllowed: isMultiSelectionAllowed,
currentCellData: currentCellData,
focusedCellData: focusedCellData,
isVirtualCell: $cell.hasClass(_m_classes.VIRTUAL_CELL_CLASS)
});
this.processNextSelectedCell(nextFocusedCellData, focusedCellData, isMultiSelectionAllowed && isMultiSelection)
}
processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection) {
const nextCellPosition = this.viewDataProvider.findCellPositionInMap({
startDate: nextCellData.startDate,
groupIndex: nextCellData.groupIndex,
isAllDay: nextCellData.allDay,
index: nextCellData.index
});
if (!this.viewDataProvider.isSameCell(focusedCellData, nextCellData)) {
const $cell = nextCellData.allDay && !this.isVerticalGroupedWorkSpace() ? this.domGetAllDayPanelCell(nextCellPosition.columnIndex) : this.domGetDateCell(nextCellPosition);
const isNextCellAllDay = nextCellData.allDay;
this.setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell);
this._dateTableScrollable.scrollToElement($cell)
}
}
setSelectedCellsStateAndUpdateSelection(isAllDay, cellPosition, isMultiSelection, $nextFocusedCell) {
const nextCellCoordinates = {
rowIndex: cellPosition.rowIndex,
columnIndex: cellPosition.columnIndex,
allDay: isAllDay
};
this.cellsSelectionState.setFocusedCell(nextCellCoordinates.rowIndex, nextCellCoordinates.columnIndex, isAllDay);
if (isMultiSelection) {
this.cellsSelectionState.setSelectedCells(nextCellCoordinates)
} else {
this.cellsSelectionState.setSelectedCells(nextCellCoordinates, nextCellCoordinates)
}
this.updateCellsSelection();
this.updateSelectedCellDataOption(this.getSelectedCellsData(), $nextFocusedCell)
}
hasAllDayClass($cell) {
return $cell.hasClass(ALL_DAY_TABLE_CELL_CLASS)
}
_focusInHandler(e) {
const $target = (0, _renderer.default)(e.target);
const $focusTarget = this._focusTarget();
const isTargetInsideWorkspace = $target.is($focusTarget) || $target.closest($focusTarget).length > 0;
if (isTargetInsideWorkspace && this.isCellClick) {
delete this.isCellClick;
delete this.contextMenuHandled;
super._focusInHandler.apply(this, arguments);
this.cellsSelectionState.restoreSelectedAndFocusedCells();
if (!this.cellsSelectionState.getFocusedCell()) {
const cellCoordinates = {
columnIndex: 0,
rowIndex: 0,
allDay: this.isVerticalGroupedWorkSpace() && this.isAllDayPanelVisible
};
this.cellsSelectionState.setFocusedCell(cellCoordinates.rowIndex, cellCoordinates.columnIndex, cellCoordinates.allDay);
this.cellsSelectionState.setSelectedCells(cellCoordinates, cellCoordinates)
}
this.updateCellsSelection();
this.updateSelectedCellDataOption(this.getSelectedCellsData())
}
}
_focusOutHandler() {
super._focusOutHandler.apply(this, arguments);
if (!this.contextMenuHandled && !this._disposed) {
this.cellsSelectionState.releaseSelectedAndFocusedCells();
this.viewDataProvider.updateViewData(this.generateRenderOptions());
this.updateCellsSelection()
}
}
_focusTarget() {
return this.$element()
}
isVerticalGroupedWorkSpace() {
var _this$option;
return Boolean(null === (_this$option = this.option("groups")) || void 0 === _this$option ? void 0 : _this$option.length) && "vertical" === this.option("groupOrientation")
}
_isHorizontalGroupedWorkSpace() {
var _this$option2;
return Boolean(null === (_this$option2 = this.option("groups")) || void 0 === _this$option2 ? void 0 : _this$option2.length) && "horizontal" === this.option("groupOrientation")
}
isWorkSpaceWithCount() {
return this.option("intervalCount") > 1
}
isWorkspaceWithOddCells() {
return .5 === this.option("hoursInterval") && !this.isVirtualScrolling()
}
getRealGroupOrientation() {
return this.isVerticalGroupedWorkSpace() ? "vertical" : "horizontal"
}
createRAllDayPanelElements() {
this._$allDayPanel = (0, _renderer.default)(" | | |