");
(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);
this.callBase()
},
_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: () => "",
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.default = {
HorizontalHeadersArea: HorizontalHeadersArea,
VerticalHeadersArea: VerticalHeadersArea
}
},
16564:
/*!******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/local_store/m_local_store.js ***!
\******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.LocalStore = void 0;
var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377));
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576);
var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617);
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434));
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/array_store */ 26562));
var _custom_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/custom_store */ 88036));
var _data_source = __webpack_require__( /*! ../../../../data/data_source/data_source */ 85273);
var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687));
var _utils = __webpack_require__( /*! ../../../../data/utils */ 16454);
var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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)
}
}))
}
const addHierarchyItem = 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
};
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 = addHierarchyItem(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.default && 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
}
},
61550:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/m_widget.js ***!
\*************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.PivotGrid = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _element = __webpack_require__( /*! ../../../core/element */ 6415);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _string = __webpack_require__( /*! ../../../core/utils/string */ 68752);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _click = __webpack_require__( /*! ../../../events/click */ 95429);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008));
var _context_menu = _interopRequireDefault(__webpack_require__( /*! ../../../ui/context_menu */ 10042));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 51495));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390));
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 60082));
var _m_chart_integration = __webpack_require__( /*! ./chart_integration/m_chart_integration */ 85654);
var _m_data_area = _interopRequireDefault(__webpack_require__( /*! ./data_area/m_data_area */ 64318));
var _m_data_controller = _interopRequireDefault(__webpack_require__( /*! ./data_controller/m_data_controller */ 9517));
var _m_export = __webpack_require__( /*! ./export/m_export */ 75705);
var _m_field_chooser = __webpack_require__( /*! ./field_chooser/m_field_chooser */ 12086);
var _m_field_chooser_base = __webpack_require__( /*! ./field_chooser/m_field_chooser_base */ 16491);
var _m_fields_area = __webpack_require__( /*! ./fields_area/m_fields_area */ 70513);
var _m_headers_area = _interopRequireDefault(__webpack_require__( /*! ./headers_area/m_headers_area */ 95578));
var _m_widget_utils = __webpack_require__( /*! ./m_widget_utils */ 28580);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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
}
const PivotGrid = exports.PivotGrid = _ui2.default.inherit({
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
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,
indicatorSrc: "",
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")
}
}
})
},
_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")
}));
const expandValueChanging = that.option("onExpandValueChanging");
if (expandValueChanging) {
that._dataController.expandValueChanging.add((e => {
expandValueChanging(e)
}))
}
},
_init() {
this.callBase();
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._fieldChooserPopup.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":
that.callBase(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;
that.callBase(args);
that.resize();
break;
default:
that.callBase(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: _common.noop,
_needDelayResizing(cellsInfo) {
const cellsCount = cellsInfo.length * (cellsInfo.length ? cellsInfo[0].length : 0);
return cellsCount > 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._fieldChooserPopup.$content().dxPivotGridFieldChooser("applyChanges");
that._fieldChooserPopup.hide()
}
}
}, {
toolbar: "bottom",
location: "after",
widget: "dxButton",
options: {
text: _message.default.format("Cancel"),
onClick() {
that._fieldChooserPopup.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,
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._fieldChooserPopup) {
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._fieldChooserPopup.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: _m_utils.default.renderNoDataText,
_renderLoadPanel: _m_utils.default.renderLoadPanel,
_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() {
this.callBase.apply(this, arguments);
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");
that._createComponent(that.$element(), _m_field_chooser_base.FieldChooserBase, {
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")
});
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()) {
this.callBase()
}
},
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);
that.callBase.apply(that, arguments);
if (that._dataController) {
that._dataController.dispose()
}
},
_tableElement() {
return this.$element().find("table").first()
},
addWidgetPrefix: className => `dx-pivotgrid-${className}`,
resize() {
this.updateDimensions()
},
isReady() {
return this.callBase() && !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);
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((0, _size.getHeight)(that._dataArea.headElement()), (0, _size.getHeight)(columnAreaCell), descriptionCellHeight) + bordersWidth)
}
const scrollBarWidth = that._dataArea.getScrollbarWidth();
const correctDataTableHeight = (0, _size.getHeight)(that._dataArea.tableElement()) - (0, _size.getHeight)(that._dataArea.headElement());
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")
});
that._columnsArea.updateScrollableOptions({
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)
}
}).inherit(_m_export.ExportController).include(_m_chart_integration.ChartIntegrationMixin);
(0, _component_registrator.default)("dxPivotGrid", PivotGrid);
exports.default = {
PivotGrid: PivotGrid
}
},
28580:
/*!*******************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/m_widget_utils.js ***!
\*******************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateScrollbarWidth = void 0;
exports.capitalizeFirstLetter = capitalizeFirstLetter;
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 _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _ajax = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/ajax */ 37208));
var _call_once = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/call_once */ 39618));
var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../data/array_store */ 26562));
var _data_source = __webpack_require__( /*! ../../../data/data_source/data_source */ 85273);
var _format_helper = _interopRequireDefault(__webpack_require__( /*! ../../../format_helper */ 30343));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
var _const = __webpack_require__( /*! ./const */ 18813);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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) {
const item = data[i];
if (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 dimensions = options[axisName];
let expandLevel = 0;
const expandedPaths = ("columns" === axisName ? options.columnExpandedPaths : options.rowExpandedPaths) || [];
if (options.headerName === axisName) {
expandLevel = options.path.length
} else if (options.headerName && options.headerName !== axisName && options.oppositePath) {
expandLevel = options.oppositePath.length
} else {
(0, _iterator.each)(expandedPaths, ((_, path) => {
expandLevel = Math.max(expandLevel, path.length)
}))
}
while (dimensions[expandLevel + 1] && dimensions[expandLevel].expanded) {
expandLevel += 1
}
return expandLevel
}
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 (undefined) {
d = undefined[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
}
};
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1)
}
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,
capitalizeFirstLetter: capitalizeFirstLetter,
getScrollbarWidth: getScrollbarWidth,
calculateScrollbarWidth: calculateScrollbarWidth
}
},
2166:
/*!********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/remote_store/m_remote_store.js ***!
\********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.RemoteStore = void 0;
var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434));
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _data_source = __webpack_require__( /*! ../../../../data/data_source/data_source */ 85273);
var _utils = __webpack_require__( /*! ../../../../data/data_source/utils */ 9234);
var _m_widget_utils = function(e, r) {
if (!r && e && e.__esModule) {
return e
}
if (null === e || "object" != typeof e && "function" != typeof e) {
return {
default: e
}
}
var t = _getRequireWildcardCache(r);
if (t && t.has(e)) {
return t.get(e)
}
var n = {
__proto__: null
},
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var u in e) {
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]
}
}
return n.default = e, t && t.set(e, n), n
}(__webpack_require__( /*! ../m_widget_utils */ 28580));
var _m_remote_store_utils = __webpack_require__( /*! ./m_remote_store_utils */ 98413);
function _getRequireWildcardCache(e) {
if ("function" != typeof WeakMap) {
return null
}
var r = new WeakMap,
t = new WeakMap;
return (_getRequireWildcardCache = function(e) {
return e ? t : r
})(e)
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function createGroupingOptions(dimensionOptions, useSortOrder) {
const groupingOptions = [];
(0, _iterator.each)(dimensionOptions, ((index, dimensionOption) => {
groupingOptions.push({
selector: dimensionOption.dataField,
groupInterval: dimensionOption.groupInterval,
desc: useSortOrder && "desc" === dimensionOption.sortOrder,
isExpanded: index < dimensionOptions.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) {
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,_m_widget_utils.capitalizeFirstLetter)(groupInterval)}`
}
return selector
}(field);
const isExcludedFilterType = "exclude" === 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)) {
const parseLevelsRecursive = field.levels && 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(filter1, filter2) {
let mergedFilter;
const notEmpty = function(filter) {
return filter && filter.length
};
if (notEmpty(filter1) && notEmpty(filter2)) {
mergedFilter = [filter1, "and", filter2]
} else {
mergedFilter = notEmpty(filter1) ? filter1 : filter2
}
return mergedFilter
}
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 (fields || []).filter((f => f.filterValues && 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 getExpandedPathSliceFilter(options, dimensionName, level, firstCollapsedFieldIndex) {
const result = [];
const startSliceIndex = level > firstCollapsedFieldIndex ? 0 : firstCollapsedFieldIndex;
const fields = options.headerName !== dimensionName ? options[dimensionName].slice(startSliceIndex, level) : [];
const paths = "rows" === dimensionName ? options.rowExpandedPaths : options.columnExpandedPaths;
(0, _iterator.each)(fields, ((index, field) => {
const filterValues = [];
(0, _iterator.each)(paths, ((_, path) => {
path = path.slice(startSliceIndex, level);
if (index < path.length) {
const filterValue = path[index];
if (!filterValues.includes(filterValue)) {
filterValues.push(filterValue)
}
}
}));
if (filterValues.length) {
result.push((0, _extend.extend)({}, field, {
filterType: "include",
filterValues: filterValues
}))
}
}));
return result
}
function getGrandTotalRequest(options, dimensionName, expandedIndex, expandedLevel, commonFilters, firstCollapsedFieldIndex) {
const expandedPaths = ("columns" === dimensionName ? options.columnExpandedPaths : options.rowExpandedPaths) || [];
const oppositeDimensionName = "columns" === dimensionName ? "rows" : "columns";
const fields = options[dimensionName];
const result = [];
let newOptions;
if (expandedPaths.length) {
for (let i = expandedIndex; i < expandedLevel + 1; i += 1) {
newOptions = {
filters: commonFilters.concat(getExpandedPathSliceFilter(options, dimensionName, i, firstCollapsedFieldIndex))
};
newOptions[dimensionName] = fields.slice(expandedIndex, i + 1);
newOptions[oppositeDimensionName] = [];
result.push((0, _extend.extend)({}, options, newOptions))
}
} else {
newOptions = {
filters: commonFilters
};
newOptions[dimensionName] = fields.slice(expandedIndex, expandedLevel + 1);
newOptions[oppositeDimensionName] = [];
result.push((0, _extend.extend)({}, options, newOptions))
}
result[0].includeTotalSummary = true;
return result
}
function getFirstCollapsedIndex(fields) {
let firstCollapsedIndex = 0;
(0, _iterator.each)(fields, ((index, field) => {
if (!field.expanded) {
firstCollapsedIndex = index;
return false
}
return
}));
return firstCollapsedIndex
}
function getRequestsData(options) {
const rowExpandedLevel = (0, _m_widget_utils.getExpandedLevel)(options, "rows");
const columnExpandedLevel = (0, _m_widget_utils.getExpandedLevel)(options, "columns");
let filters = options.filters || [];
const columnExpandedIndex = getExpandedIndex(options, "columns");
const firstCollapsedColumnIndex = getFirstCollapsedIndex(options.columns);
const firstCollapsedRowIndex = getFirstCollapsedIndex(options.rows);
const rowExpandedIndex = getExpandedIndex(options, "rows");
let data = [];
filters = filters.concat(getFiltersForDimension(options.rows)).concat(getFiltersForDimension(options.columns)).concat(function(options) {
return (0, _m_widget_utils.getFiltersByPath)(options[options.headerName], options.path).concat((0, _m_widget_utils.getFiltersByPath)(options["rows" === options.headerName ? "columns" : "rows"], options.oppositePath || []))
}(options));
const columnTotalsOptions = getGrandTotalRequest(options, "columns", columnExpandedIndex, columnExpandedLevel, filters, firstCollapsedColumnIndex);
if (options.rows.length && options.columns.length) {
if ("rows" !== options.headerName) {
data = data.concat(columnTotalsOptions)
}
for (let i = rowExpandedIndex; i < rowExpandedLevel + 1; i += 1) {
const rows = options.rows.slice(rowExpandedIndex, i + 1);
const rowFilterByExpandedPaths = getExpandedPathSliceFilter(options, "rows", i, firstCollapsedRowIndex);
for (let j = columnExpandedIndex; j < columnExpandedLevel + 1; j += 1) {
const preparedOptions = (0, _extend.extend)({}, options, {
columns: options.columns.slice(columnExpandedIndex, j + 1),
rows: rows,
filters: filters.concat(getExpandedPathSliceFilter(options, "columns", j, firstCollapsedColumnIndex)).concat(rowFilterByExpandedPaths)
});
data.push(preparedOptions)
}
}
} else {
data = options.columns.length ? columnTotalsOptions : getGrandTotalRequest(options, "rows", rowExpandedIndex, rowExpandedLevel, filters, firstCollapsedRowIndex)
}
return data
}
function prepareFields(fields) {
(0, _iterator.each)(fields || [], ((_, field) => {
const {
levels: levels
} = field;
if (levels) {
prepareFields(levels)
}(0, _m_widget_utils.setDefaultFieldValueFormatting)(field)
}))
}
const RemoteStore = exports.RemoteStore = _class.default.inherit({
ctor(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 requestsData = getRequestsData(options);
const deferreds = [];
prepareFields(options.rows);
prepareFields(options.columns);
prepareFields(options.filters);
(0, _iterator.each)(requestsData, ((_, dataItem) => {
deferreds.push(that._store.load(function(options, externalFilterExpr, hasRows) {
let filterExpressions = createFilterExpressions(options.filters);
const groupingOptions = createGroupingOptions(options.rows, options.rowTake).concat(createGroupingOptions(options.columns, options.columnTake));
const loadOptions = {
groupSummary: [],
totalSummary: [],
group: groupingOptions.length ? groupingOptions : void 0,
take: groupingOptions.length ? void 0 : 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
}
if (externalFilterExpr) {
filterExpressions = mergeFilters(filterExpressions, externalFilterExpr)
}
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
}(dataItem, that.filter(), options.rows.length)))
}));
_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 (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) => {
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 = rowItem && rowItem.index || result.grandTotalRowIndex;
const currentColumnIndex = columnItem && columnItem.index || result.grandTotalColumnIndex;
(0, _iterator.each)(item && item.summary || [], ((i, summary) => {
setValue(result.values, summary, currentRowIndex, currentColumnIndex, i)
}))
}));
return result
}(normalizedArguments.data, normalizedArguments.extra, requestsData[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() {
return this._dataSource.filter.apply(this._dataSource, arguments)
},
supportPaging: () => 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 => store.load((0, _extend.extend)({}, loadOptions, {
filter: mergeFilters(filterExp, loadOptions.filter),
select: params.customColumns
}))
})
}
});
exports.default = {
RemoteStore: RemoteStore
}
},
98413:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/remote_store/m_remote_store_utils.js ***!
\**************************************************************************************************************/
function(__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
}
},
71442:
/*!************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/sortable/m_sortable.js ***!
\************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.Sortable = void 0;
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../../core/component_registrator */ 99393));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349));
var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_component */ 13046));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374));
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479);
var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994));
var _drag = __webpack_require__( /*! ../../../../events/drag */ 23174);
var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611);
var _swatch_container = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/swatch_container */ 92591));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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
}
const Sortable = exports.Sortable = _dom_component.default.inherit({
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
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() {
this.callBase();
this._attachEventHandlers()
},
_render() {
this.callBase();
this.$element().addClass("dx-sortable-old")
},
_dispose() {
this.callBase.apply(this, arguments);
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:
that.callBase(args)
}
},
_useTemplates: () => false
});
(0, _component_registrator.default)("dxSortableOld", Sortable);
exports.default = {
Sortable: Sortable
}
},
42717:
/*!**************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/summary_display_modes/m_summary_display_modes.js ***!
\**************************************************************************************************************************/
function(__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 */ 13306);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _m_widget_utils = function(e, r) {
if (!r && e && e.__esModule) {
return e
}
if (null === e || "object" != typeof e && "function" != typeof e) {
return {
default: e
}
}
var t = _getRequireWildcardCache(r);
if (t && t.has(e)) {
return t.get(e)
}
var n = {
__proto__: null
},
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var u in e) {
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]
}
}
return n.default = e, t && t.set(e, n), n
}(__webpack_require__( /*! ../m_widget_utils */ 28580));
function _getRequireWildcardCache(e) {
if ("function" != typeof WeakMap) {
return null
}
var r = new WeakMap,
t = new WeakMap;
return (_getRequireWildcardCache = function(e) {
return e ? t : r
})(e)
}
const ROW = "row";
const NULL = null;
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 createPercentVariationExp = 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 absVar !== NULL && prevValue ? absVar / prevValue : 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 = createPercentVariationExp(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
}
},
79755:
/*!****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/xmla_store/m_xmla_store.js ***!
\****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.XmlaStore = void 0;
var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576);
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479);
var _string = __webpack_require__( /*! ../../../../core/utils/string */ 68752);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201);
var _errors = __webpack_require__( /*! ../../../../data/errors */ 18438);
var _language_codes = __webpack_require__( /*! ../../../../localization/language_codes */ 9821);
var _m_widget_utils = function(e, r) {
if (!r && e && e.__esModule) {
return e
}
if (null === e || "object" != typeof e && "function" != typeof e) {
return {
default: e
}
}
var t = _getRequireWildcardCache(r);
if (t && t.has(e)) {
return t.get(e)
}
var n = {
__proto__: null
},
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var u in e) {
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]
}
}
return n.default = e, t && t.set(e, n), n
}(__webpack_require__( /*! ../m_widget_utils */ 28580));
function _getRequireWildcardCache(e) {
if ("function" != typeof WeakMap) {
return null
}
var r = new WeakMap,
t = new WeakMap;
return (_getRequireWildcardCache = function(e) {
return e ? t : r
})(e)
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const window = (0, _window.getWindow)();
const XmlaStore = exports.XmlaStore = _class.default.inherit(function() {
const discover = ' {2}{0}{1}{0}{3}';
const mdx = "SELECT {2} FROM {0} {1} CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS";
const mdxFilterSelect = "(SELECT {0} FROM {1})";
const mdxSubset = "Subset({0}, {1}, {2})";
const mdxOrder = "Order({0}, {1}, {2})";
const mdxWith = "{0} {1} as {2}";
const mdxSlice = "WHERE ({0})";
const mdxNonEmpty = "NonEmpty({0}, {1})";
const mdxAxis = "{0} DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME, MEMBER_VALUE ON {1}";
const mdxCrossJoin = "CrossJoin({0})";
const mdxSet = "{{0}}";
function 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 new _errors.errors.Error("E4023", text)
}
} catch (e) {
deferred.reject({
statusText: e.message,
stack: e.stack,
responseText: text
})
}
deferred.resolve(xml)
}));
return deferred
}
function getLocaleIdProperty() {
const languageId = (0, _language_codes.getLanguageId)();
if (void 0 !== languageId) {
return (0, _string.format)(" {0}", languageId)
}
return ""
}
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 crossJoinElements(elements) {
const elementsString = elements.join(",");
return elements.length > 1 ? (0, _string.format)(mdxCrossJoin, elementsString) : elementsString
}
function 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)(mdxSet, arg);
if (take) {
const sortBy = (field.hierarchyName || field.dataField) + ("displayText" === field.sortBy ? ".MEMBER_CAPTION" : ".MEMBER_VALUE");
arg = (0, _string.format)(mdxOrder, arg, sortBy, "desc" === field.sortOrder ? "DESC" : "ASC")
}
crossJoinArgs.push(arg)
}
}
return crossJoinElements(crossJoinArgs)
}
function 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 = generateCrossJoin(path, expandLevel, expandAllCount, expandIndex, slicePath, options, axisName, take);
if (!take && !totalsOnly) {
crossJoin = (0, _string.format)(mdxNonEmpty, crossJoin, cellsString)
}
crossJoins.push(crossJoin)
} while (dimensions[dimensionIndex] && dimensions[dimensionIndex + 1] && dimensions[dimensionIndex].expanded)
}
function declare(expression, withArray, name, type) {
name = name || `[DX_Set_${withArray.length}]`;
type = type || "set";
withArray.push((0, _string.format)(mdxWith, type, name, expression));
return name
}
function 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)(mdxSet, 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);
fillCrossJoins(crossJoins, [], expandLevel, expandIndex, path, options, axisName, cellsString, "rows" === axisName ? options.rowTake : options.columnTake, options.totalsOnly);
(0, _iterator.each)(expandedPaths, ((_, expandedPath) => {
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)(mdxSubset, 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)(mdxSubset, expression, options.columnSkip > 0 ? options.columnSkip + 1 : 0, options.columnSkip > 0 ? options.columnTake : options.columnTake + 1)
}
const axisSet = `[DX_${axisName}]`;
result.push(declare(expression, withArray, axisSet));
if (options.totalsOnly) {
result.push(declare(`COUNT(${axisSet})`, withArray, `[DX_${axisName}_count]`, "member"))
}
}
if ("columns" === axisName && cells.length && !options.skipValues) {
result.push(cellsString)
}
return (0, _string.format)(mdxAxis, crossJoinElements(result), axisName)
}
function 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)(mdxSet, filterExpression.join(","));
if ("exclude" === field.filterType) {
filterStringExpression = `Except(${getAllMembers(field)},${filterStringExpression})`
}
filterMembers.push(filterStringExpression)
}
}));
return filterMembers.length ? crossJoinElements(filterMembers) : ""
}
function 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)(mdx, function(columnsFilter, rowsFilter, filter, cubeName) {
let from = `[${cubeName}]`;
(0, _iterator.each)([columnsFilter, rowsFilter, filter], ((_, filter) => {
if (filter) {
from = (0, _string.format)(mdxFilterSelect, `${filter}on 0`, from)
}
}));
return from
}(generateAxisFieldsFilter(columns), generateAxisFieldsFilter(rows), generateAxisFieldsFilter(filters || []), cubeName), slice.length ? (0, _string.format)(mdxSlice, slice.join(",")) : "", select)
}
return mdxString
}
function prepareDataFields(withArray, valueFields) {
return (0, _iterator.map)(valueFields, (cell => {
if ((0, _type.isString)(cell.expression)) {
declare(cell.expression, withArray, cell.dataField, "member")
}
return cell.dataField
}))
}
function 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}.${preparePathValue(value,dimension.dataField)}`)
}
}))
}
function 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 = prepareDataFields(withArray, values);
parseOptions.measureCount = options.skipValues ? 1 : values.length;
parseOptions.visibleLevels = {};
if (options.headerName && options.path) {
addSlices(slice, options, options.headerName, options.path)
}
if (options.headerName && options.oppositePath) {
addSlices(slice, options, "rows" === options.headerName ? "columns" : "rows", options.oppositePath)
}
if (columns.length || dataFields.length) {
axisStrings.push(generateAxisMdx(options, "columns", dataFields, withArray, parseOptions))
}
if (rows.length) {
axisStrings.push(generateAxisMdx(options, "rows", dataFields, withArray, parseOptions))
}
return generateMdxCore(axisStrings, withArray, columns, rows, options.filters, slice, cubeName, options)
}
function 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}.${preparePathValue(value,field.dataField)}`)
}))
}
function getNumber(str) {
return parseInt(str, 10)
}
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 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 ? getNodeText(valueElement) : "#N/A";
const value = parseFloat(text);
const isNumeric = text - value + 1 > 0;
const cellOrdinal = getNumber(xmlCell.getAttribute("CellOrdinal"));
if (errorElements.length) {
errorDictionary[getNodeText(errorElements[0].getElementsByTagName("ErrorCode")[0])] = getNodeText(errorElements[0].getElementsByTagName("Description")[0])
}
cellsOriginal[cellOrdinal] = {
value: isNumeric ? 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
}
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 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
}
function 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, getVisibleChildren(children[i], visibleLevels))
}
}
}
return result
}
function 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 = function(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 = getItem(hash, member.parentName);
children = parentItem.children = parentItem.children || []
}
const currentItem = 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
}(dataIndex, member, parentItem)
}))
}));
const parentItem = {
children: result
};
parentItem.children = getVisibleChildren(parentItem, visibleLevels);
const grandTotalIndex = function(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 = getVisibleChildren(parentItem, visibleLevels)
} else if (0 === parentItem.children.length) {
grandTotalIndex = 0
}
return grandTotalIndex
}(parentItem, visibleLevels);
(0, _m_widget_utils.foreachTree)(parentItem.children, (items => {
const item = items[0];
const children = 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
}
function 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 = new _errors.errors.Error("E4000", description);
_errors.errors.log("E4000", description);
return error
}
return null
}
function parseResult(xml, parseOptions) {
const dataSource = {
columns: [],
rows: []
};
const {
measureCount: measureCount
} = parseOptions;
const axes = function(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: (valueText = getFirstChildText(tuple, "MEMBER_VALUE"), (0, _type.isNumeric)(valueText) ? parseFloat(valueText) : valueText),
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
}
var valueText
}))
}
}));
while (axes.length < 2) {
axes.push([
[{
level: 0
}]
])
}
return axes
}(xml, parseOptions.skipValues);
dataSource.grandTotalColumnIndex = fillDataSourceAxes(dataSource.columns, axes[0], measureCount, parseOptions.visibleLevels);
dataSource.grandTotalRowIndex = fillDataSourceAxes(dataSource.rows, axes[1], void 0, parseOptions.visibleLevels);
dataSource.values = parseCells(xml, axes, measureCount);
return dataSource
}
function 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
}
function parseStringWithUnicodeSymbols(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, " ")
}
function sendQuery(storeOptions, mdxString) {
mdxString = (0, _renderer.default)(" ").text(mdxString).html();
return execXMLA(storeOptions, (0, _string.format)(' {0}{1}TrueMicrosoft SQL Server Management Studio3600{2}', mdxString, storeOptions.catalog, getLocaleIdProperty()))
}
return {
ctor(options) {
this._options = options
},
getFields() {
const options = this._options;
const {
catalog: catalog
} = options;
const {
cube: cube
} = options;
const localeIdProperty = getLocaleIdProperty();
const dimensionsRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_DIMENSIONS", localeIdProperty));
const measuresRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_MEASURES", localeIdProperty));
const hierarchiesRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_HIERARCHIES", localeIdProperty));
const levelsRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_LEVELS", localeIdProperty));
const result = new _deferred.Deferred;
(0, _deferred.when)(dimensionsRequest, measuresRequest, hierarchiesRequest, levelsRequest).then(((dimensionsResponse, measuresResponse, hierarchiesResponse, levelsResponse) => {
execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_MEASUREGROUPS", localeIdProperty)).done((measureGroupsResponse => {
const dimensions = function(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
}(dimensionsResponse);
const hierarchies = parseDiscoverRowSet(hierarchiesResponse, "HIERARCHY", dimensions);
const levels = parseDiscoverRowSet(levelsResponse, "LEVEL", dimensions);
const measureGroups = function(xml) {
const measureGroups = {};
(0, _iterator.each)(xml.getElementsByTagName("row"), ((_, row) => {
measureGroups[getFirstChildText(row, "MEASUREGROUP_NAME")] = getFirstChildText(row, "MEASUREGROUP_CAPTION")
}));
return measureGroups
}(measureGroupsResponse);
const fields = 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 = generateMDX(options, storeOptions.cube, parseOptions);
let rowCountMdx;
if (options.rowSkip || options.rowTake || options.columnTake || options.columnSkip) {
rowCountMdx = generateMDX((0, _extend.extend)({}, options, {
totalsOnly: true,
rowSkip: null,
rowTake: null,
columnSkip: null,
columnTake: null
}), storeOptions.cube, {})
}
const load = () => {
if (mdxString) {
(0, _deferred.when)(sendQuery(storeOptions, mdxString), rowCountMdx && sendQuery(storeOptions, rowCountMdx)).done(((executeXml, rowCountXml) => {
const error = checkError(executeXml) || rowCountXml && checkError(rowCountXml);
if (!error) {
const response = parseResult(executeXml, parseOptions);
if (rowCountXml) {
! function(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 = 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] || {}
}
}
}(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: () => true,
getDrillDownItems(options, params) {
const result = new _deferred.Deferred;
const storeOptions = this._options;
const mdxString = function(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 = prepareDataFields(withArray, values);
const {
maxRowCount: maxRowCount
} = params;
const customColumns = params.customColumns || [];
const customColumnsString = customColumns.length > 0 ? ` return ${customColumns.join(",")}` : "";
createDrillDownAxisSlice(slice, columns, params.columnPath || []);
createDrillDownAxisSlice(slice, rows, params.rowPath || []);
if (columns.length || dataFields.length) {
axisStrings.push([`${dataFields[params.dataIndex]||dataFields[0]} on 0`])
}
const coreMDX = generateMdxCore(axisStrings, withArray, columns, rows, options.filters, slice, cubeName);
return coreMDX ? `drillthrough${maxRowCount>0?` maxrows ${maxRowCount}`:""}${coreMDX}${customColumnsString}` : coreMDX
}(options, storeOptions.cube, params);
if (mdxString) {
(0, _deferred.when)(sendQuery(storeOptions, mdxString)).done((executeXml => {
const error = checkError(executeXml);
if (!error) {
result.resolve(function(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] || parseStringWithUnicodeSymbols(tagName);
item[name] = getNodeText(children[j])
}
result.push(item)
}
return result
}(executeXml))
} else {
result.reject(error)
}
})).fail(result.reject)
} else {
result.resolve([])
}
return result
},
key: _common.noop,
filter: _common.noop
}
}()).include(_m_widget_utils.storeDrillDownMixin);
exports.default = {
XmlaStore: XmlaStore
}
},
26686:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/data_controller/m_data_controller.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TreeListDataController = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576);
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _m_data_controller = __webpack_require__( /*! ../../../grids/grid_core/data_controller/m_data_controller */ 72119);
var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../data_source_adapter/m_data_source_adapter */ 22821));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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
}
})
},
22821:
/*!*********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/data_source_adapter/m_data_source_adapter.js ***!
\*********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576);
var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617);
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/array_store */ 26562));
var _array_utils = __webpack_require__( /*! ../../../../data/array_utils */ 60637);
var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687));
var _store_helper = _interopRequireDefault(__webpack_require__( /*! ../../../../data/store_helper */ 99236));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688));
var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/data_source_adapter/m_data_source_adapter */ 30945));
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_utils */ 60082));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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
}
}
_loadParentsOrChildren(data, options, needChildren) {
var _options$storeLoadOpt, _options$loadOptions;
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 (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 && options.fullData.length > options.data.length) {
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)
}
}
let DataSourceAdapterTreeListType = DataSourceAdapterTreeList;
exports.default = {
extend(extender) {
DataSourceAdapterTreeListType = extender(DataSourceAdapterTreeListType)
},
create: component => new DataSourceAdapterTreeListType(component)
}
},
17629:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/editing/m_editing.js ***!
\*********************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
__webpack_require__( /*! ../module_not_extended/editor_factory */ 29900);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374));
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688));
var _m_editing = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing */ 22324);
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_utils */ 60082));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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) {
if (void 0 !== parentKey && parentKey !== this.option("rootValue")) {
change.insertAfterKey = parentKey
} 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 rowIndex + 1
}
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
}
}
})
},
79873:
/*!************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_columns_controller.js ***!
\************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _m_columns_controller = __webpack_require__( /*! ../../grids/grid_core/columns_controller/m_columns_controller */ 10279);
var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
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
}
})
},
12500:
/*!**********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_core.js ***!
\**********************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _m_modules = (obj = __webpack_require__( /*! ../../grids/grid_core/m_modules */ 15943), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
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)
}
}
}
})
},
50226:
/*!***********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_focus.js ***!
\***********************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _m_focus = __webpack_require__( /*! ../../grids/grid_core/focus/m_focus */ 5325);
var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
_m_core.default.registerModule("focus", _extends({}, _m_focus.focusModule, {
extenders: _extends({}, _m_focus.focusModule.extenders, {
controllers: _extends({}, _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()
}
}
})
})
}))
},
94907:
/*!***************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_grid_view.js ***!
\***************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_grid_view = __webpack_require__( /*! ../../grids/grid_core/views/m_grid_view */ 28016);
var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class TreeListResizingController extends _m_grid_view.ResizingController {
_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: _extends({}, _m_grid_view.gridViewModule.controllers, {
resizing: TreeListResizingController
}),
views: _m_grid_view.gridViewModule.views
})
},
38886:
/*!*************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_keyboard_navigation.js ***!
\*************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _m_keyboard_navigation = __webpack_require__( /*! ../../grids/grid_core/keyboard_navigation/m_keyboard_navigation */ 31822);
var _scrollable_a11y = __webpack_require__( /*! ../../grids/grid_core/keyboard_navigation/scrollable_a11y */ 91355);
var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_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)
}
}
}
}
}
}))
},
31580:
/*!*******************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_master_detail.js ***!
\*******************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _m_master_detail = __webpack_require__( /*! ../../grids/grid_core/master_detail/m_master_detail */ 82802);
var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_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)
}
}
}
}
}))
},
13477:
/*!*******************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_state_storing.js ***!
\*******************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_state_storing = __webpack_require__( /*! ../../grids/grid_core/state_storing/m_state_storing */ 12440);
var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
_m_core.default.registerModule("stateStoring", _extends({}, _m_state_storing.stateStoringModule, {
extenders: _extends({}, _m_state_storing.stateStoringModule.extenders, {
controllers: _extends({}, _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
}
}
})
})
}))
},
99751:
/*!****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_validating.js ***!
\****************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_validating = __webpack_require__( /*! ../../grids/grid_core/validating/m_validating */ 39830);
var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_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
}
})
},
26058:
/*!***********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_virtual_scrolling.js ***!
\***********************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _m_virtual_scrolling = __webpack_require__( /*! ../../grids/grid_core/virtual_scrolling/m_virtual_scrolling */ 92018);
var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ./data_source_adapter/m_data_source_adapter */ 22821));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 12500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const oldDefaultOptions = _m_virtual_scrolling.virtualScrollingModule.defaultOptions;
_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", _extends({}, _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)
}))
}
}))
},
1977:
/*!************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_widget.js ***!
\************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _m_widget_base = (obj = __webpack_require__( /*! ./m_widget_base */ 14126), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
__webpack_require__( /*! ./m_state_storing */ 13477);
__webpack_require__( /*! ./module_not_extended/column_chooser */ 92026);
__webpack_require__( /*! ./m_master_detail */ 31580);
__webpack_require__( /*! ./editing/m_editing */ 17629);
__webpack_require__( /*! ./module_not_extended/editing_row_based */ 64757);
__webpack_require__( /*! ./module_not_extended/editing_form_based */ 45998);
__webpack_require__( /*! ./module_not_extended/editing_cell_based */ 7446);
__webpack_require__( /*! ./m_validating */ 99751);
__webpack_require__( /*! ./m_virtual_scrolling */ 26058);
__webpack_require__( /*! ./module_not_extended/filter_row */ 98439);
__webpack_require__( /*! ./module_not_extended/header_filter */ 26763);
__webpack_require__( /*! ./module_not_extended/filter_sync */ 1440);
__webpack_require__( /*! ./module_not_extended/filter_builder */ 49248);
__webpack_require__( /*! ./module_not_extended/filter_panel */ 86737);
__webpack_require__( /*! ./module_not_extended/pager */ 84214);
__webpack_require__( /*! ./module_not_extended/columns_resizing_reordering */ 43468);
__webpack_require__( /*! ./module_not_extended/column_fixing */ 50776);
__webpack_require__( /*! ./module_not_extended/adaptivity */ 43301);
__webpack_require__( /*! ./selection/m_selection */ 91445);
__webpack_require__( /*! ./module_not_extended/search */ 1272);
__webpack_require__( /*! ./m_keyboard_navigation */ 38886);
__webpack_require__( /*! ./module_not_extended/virtual_columns */ 75188);
__webpack_require__( /*! ./m_focus */ 50226);
__webpack_require__( /*! ./module_not_extended/row_dragging */ 31937);
exports.default = _m_widget_base.default
},
14126:
/*!*****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_widget_base.js ***!
\*****************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
__webpack_require__( /*! ./module_not_extended/column_headers */ 25052);
__webpack_require__( /*! ./m_columns_controller */ 79873);
__webpack_require__( /*! ./data_controller/m_data_controller */ 26686);
__webpack_require__( /*! ./module_not_extended/sorting */ 7138);
__webpack_require__( /*! ./rows/m_rows */ 31397);
__webpack_require__( /*! ./module_not_extended/context_menu */ 87454);
__webpack_require__( /*! ./module_not_extended/error_handling */ 84973);
__webpack_require__( /*! ./m_grid_view */ 94907);
__webpack_require__( /*! ./module_not_extended/header_panel */ 37980);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 60082));
var _m_widget_base = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_widget_base */ 67880));
var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 12500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
_m_core.default.registerModulesOrder(["stateStoring", "columns", "selection", "editorFactory", "columnChooser", "editingRowBased", "editingFormBased", "editingCellBased", "editing", "grouping", "masterDetail", "validating", "adaptivity", "data", "virtualScrolling", "columnHeaders", "filterRow", "headerPanel", "headerFilter", "sorting", "search", "rows", "pager", "columnsResizingReordering", "contextMenu", "keyboardNavigation", "errorHandling", "summary", "columnFixing", "export", "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) {
super.focus();
if ((0, _type.isDefined)(element)) {
this.getController("keyboardNavigation").focus(element)
}
}
}(0, _component_registrator.default)("dxTreeList", TreeList);
exports.default = TreeList
},
43301:
/*!**********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/adaptivity.js ***!
\**********************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_adaptivity = __webpack_require__( /*! ../../../grids/grid_core/adaptivity/m_adaptivity */ 18107);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("adaptivity", _m_adaptivity.adaptivityModule)
},
92026:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/column_chooser.js ***!
\**************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_column_chooser = __webpack_require__( /*! ../../../grids/grid_core/column_chooser/m_column_chooser */ 71184);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("columnChooser", _m_column_chooser.columnChooserModule)
},
50776:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/column_fixing.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_column_fixing = __webpack_require__( /*! ../../../grids/grid_core/column_fixing/m_column_fixing */ 53424);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("columnFixing", _m_column_fixing.columnFixingModule)
},
25052:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/column_headers.js ***!
\**************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_column_headers = __webpack_require__( /*! ../../../grids/grid_core/column_headers/m_column_headers */ 14509);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("columnHeaders", _m_column_headers.columnHeadersModule)
},
43468:
/*!***************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/columns_resizing_reordering.js ***!
\***************************************************************************************************************************/
function(__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 */ 49505);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("columnsResizingReordering", _m_columns_resizing_reordering.columnsResizingReorderingModule)
},
87454:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/context_menu.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_context_menu = __webpack_require__( /*! ../../../grids/grid_core/context_menu/m_context_menu */ 69823);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("contextMenu", _m_context_menu.contextMenuModule)
},
7446:
/*!******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editing_cell_based.js ***!
\******************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editing_cell_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_cell_based */ 68802);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("editingCellBased", _m_editing_cell_based.editingCellBasedModule)
},
45998:
/*!******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editing_form_based.js ***!
\******************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editing_form_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_form_based */ 99211);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("editingFormBased", _m_editing_form_based.editingFormBasedModule)
},
64757:
/*!*****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editing_row_based.js ***!
\*****************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editing_row_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_row_based */ 55597);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("editingRowBased", _m_editing_row_based.editingRowBasedModule)
},
29900:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editor_factory.js ***!
\**************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_editor_factory = __webpack_require__( /*! ../../../grids/grid_core/editor_factory/m_editor_factory */ 80070);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("editorFactory", _m_editor_factory.editorFactoryModule)
},
84973:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/error_handling.js ***!
\**************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_error_handling = __webpack_require__( /*! ../../../grids/grid_core/error_handling/m_error_handling */ 31152);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("errorHandling", _m_error_handling.errorHandlingModule)
},
49248:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_builder.js ***!
\**************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_builder = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_builder */ 62690);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("filterBuilder", _m_filter_builder.filterBuilderModule)
},
86737:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_panel.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_panel = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_panel */ 4062);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("filterPanel", _m_filter_panel.filterPanelModule)
},
98439:
/*!**********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_row.js ***!
\**********************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_row = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_row */ 12302);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("filterRow", _m_filter_row.filterRowModule)
},
1440:
/*!***********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_sync.js ***!
\***********************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_filter_sync = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_sync */ 14407);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("filterSync", _m_filter_sync.filterSyncModule)
},
26763:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/header_filter.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_header_filter = __webpack_require__( /*! ../../../grids/grid_core/header_filter/m_header_filter */ 68796);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("headerFilter", _m_header_filter.headerFilterModule)
},
37980:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/header_panel.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_header_panel = __webpack_require__( /*! ../../../grids/grid_core/header_panel/m_header_panel */ 92468);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("headerPanel", _m_header_panel.headerPanelModule)
},
84214:
/*!*****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/pager.js ***!
\*****************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_pager = __webpack_require__( /*! ../../../grids/grid_core/pager/m_pager */ 3990);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("pager", _m_pager.pagerModule)
},
31937:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/row_dragging.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_row_dragging = __webpack_require__( /*! ../../../grids/grid_core/row_dragging/m_row_dragging */ 88351);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("rowDragging", _m_row_dragging.rowDraggingModule)
},
1272:
/*!******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/search.js ***!
\******************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_search = __webpack_require__( /*! ../../../grids/grid_core/search/m_search */ 92021);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("search", _m_search.searchModule)
},
7138:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/sorting.js ***!
\*******************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_sorting = __webpack_require__( /*! ../../../grids/grid_core/sorting/m_sorting */ 11590);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("sorting", _m_sorting.sortingModule)
},
75188:
/*!***************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/virtual_columns.js ***!
\***************************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _m_virtual_columns = __webpack_require__( /*! ../../../grids/grid_core/virtual_columns/m_virtual_columns */ 87482);
var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
_m_core.default.registerModule("virtualColumns", _m_virtual_columns.virtualColumnsModule)
},
31397:
/*!***************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/rows/m_rows.js ***!
\***************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374));
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994));
var _remove = __webpack_require__( /*! ../../../../events/remove */ 29007);
var _m_rows_view = __webpack_require__( /*! ../../../grids/grid_core/views/m_rows_view */ 35095);
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const createIcon = function(hasIcon, isExpanded) {
const $iconElement = (0, _renderer.default)(" ").addClass("dx-treelist-empty-space");
if (hasIcon) {
$iconElement.toggleClass("dx-treelist-expanded", isExpanded).toggleClass("dx-treelist-collapsed", !isExpanded).append((0, _renderer.default)(" "))
}
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($iconContainer, options) {
const {
row: row
} = options;
const {
level: level
} = row;
for (let i = 0; i <= level; i++) {
$iconContainer.append(createIcon(i === level && row.node.hasChildren, row.isExpanded))
}
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.setAria("expanded", row.isExpanded, $rowElement)
}
}
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
}
})
},
91445:
/*!*************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/selection/m_selection.js ***!
\*************************************************************************************************/
function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576);
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _m_selection = __webpack_require__( /*! ../../../grids/grid_core/selection/m_selection */ 17969);
var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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;
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) {
if ("multiple" === that.option("selection.mode")) {
that.renderSelectAll(options.container, options.model)
}
renderingTemplate.render(options)
}
}
} else {
resultTemplate = renderingTemplate
}
return resultTemplate
}
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($iconContainer, options) {
super._renderIcons.apply(this, arguments);
if (!options.row.isNewRow && "multiple" === this.option("selection.mode")) {
this._selectionController.renderSelectCheckBoxContainer($iconContainer, 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)
}
}
}
}
}
}))
},
86988:
/*!***********************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/m_draggable.js ***!
\***********************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _position = _interopRequireDefault(__webpack_require__( /*! ../animation/position */ 49387));
var _translator = __webpack_require__( /*! ../animation/translator */ 31648);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../core/component_registrator */ 99393));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../core/dom_adapter */ 73349));
var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../core/dom_component */ 13046));
var _element = __webpack_require__( /*! ../core/element */ 6415);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../core/renderer */ 68374));
var _empty_template = __webpack_require__( /*! ../core/templates/empty_template */ 10688);
var _common = __webpack_require__( /*! ../core/utils/common */ 20576);
var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../core/utils/extend */ 13306);
var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 78008);
var _position2 = __webpack_require__( /*! ../core/utils/position */ 37518);
var _size = __webpack_require__( /*! ../core/utils/size */ 58664);
var _string = __webpack_require__( /*! ../core/utils/string */ 68752);
var _type = __webpack_require__( /*! ../core/utils/type */ 35922);
var _view_port = __webpack_require__( /*! ../core/utils/view_port */ 77695);
var _window = __webpack_require__( /*! ../core/utils/window */ 58201);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../events/core/events_engine */ 55994));
var _drag = __webpack_require__( /*! ../events/drag */ 23174);
var _pointer = _interopRequireDefault(__webpack_require__( /*! ../events/pointer */ 93786));
var _index = __webpack_require__( /*! ../events/utils/index */ 39611);
var _m_animator = _interopRequireDefault(__webpack_require__( /*! ./ui/scroll_view/m_animator */ 13707));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
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
}
}
const ScrollAnimator = _m_animator.default.inherit({
ctor(strategy) {
this.callBase();
this._strategy = strategy
},
_step() {
const horizontalScrollHelper = this._strategy._horizontalScrollHelper;
const verticalScrollHelper = this._strategy._verticalScrollHelper;
horizontalScrollHelper && horizontalScrollHelper.scrollByStep();
verticalScrollHelper && verticalScrollHelper.scrollByStep()
}
});
const Draggable = _dom_component.default.inherit({
reset: _common.noop,
dragMove: _common.noop,
dragEnter: _common.noop,
dragLeave: _common.noop,
dragEnd(sourceEvent) {
const sourceDraggable = this._getSourceDraggable();
sourceDraggable._fireRemoveEvent(sourceEvent);
return (0, _deferred.Deferred)().resolve()
},
_fireRemoveEvent: _common.noop,
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
onDragStart: null,
onDragMove: null,
onDragEnd: null,
onDragEnter: null,
onDragLeave: null,
onDragCancel: null,
onCancelByEsc: false,
onDrop: null,
immediate: true,
dragDirection: "both",
boundary: void 0,
boundOffset: 0,
allowMoveByClick: false,
itemData: null,
container: void 0,
dragTemplate: void 0,
contentTemplate: "content",
handle: "",
filter: "",
clone: false,
autoScroll: true,
scrollSpeed: 30,
scrollSensitivity: 60,
group: void 0,
data: void 0
})
},
_setOptionsByReference() {
this.callBase.apply(this, arguments);
(0, _extend.extend)(this._optionsByReference, {
component: true,
group: true,
itemData: true,
data: true
})
},
_init() {
this.callBase();
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() {
return this._$dragElement && 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()) {
this._$dragElement.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)(e && 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 = this.option("dragDirection");
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) {
const handle = this.option("handle");
const $target = (0, _renderer.default)(event.originalEvent && 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")(_extends({}, 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) {
this._$dragElement && this._$dragElement.toggleClass(this._addWidgetPrefix("dragging"), value)
},
_toggleDragSourceClass(value, $element) {
const $sourceElement = $element || this._$sourceElement;
$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 = this.option("container");
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 = this.callBase.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: () => "content",
_initTemplates() {
if (!this.option("contentTemplate")) {
return
}
this._templateManager.addDefaultTemplates({
content: new _empty_template.EmptyTemplate
});
this.callBase.apply(this, arguments)
},
_render() {
this.callBase();
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:
this.callBase(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() {
this.callBase();
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
},
75500:
/*!**********************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/m_sortable.js ***!
\**********************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _fx = _interopRequireDefault(__webpack_require__( /*! ../animation/fx */ 87209));
var _translator = __webpack_require__( /*! ../animation/translator */ 31648);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../core/component_registrator */ 99393));
var _element = __webpack_require__( /*! ../core/element */ 6415);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../core/renderer */ 68374));
var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../core/utils/extend */ 13306);
var _position = __webpack_require__( /*! ../core/utils/position */ 37518);
var _size = __webpack_require__( /*! ../core/utils/size */ 58664);
var _window = __webpack_require__( /*! ../core/utils/window */ 58201);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../events/core/events_engine */ 55994));
var _m_draggable = _interopRequireDefault(__webpack_require__( /*! ./m_draggable */ 86988));
var _type = __webpack_require__( /*! ../core/utils/type */ 35922);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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 = _fx.default.off ? "" : `transform ${config.duration}ms ${config.easing}`
};
const stopAnimation = element => {
if (!element) {
return
}
element.style.transform = "";
element.style.transition = ""
};
const Sortable = _m_draggable.default.inherit({
_init() {
this.callBase();
this._sourceScrollHandler = this._handleSourceScroll.bind(this);
this._sourceScrollableInfo = null
},
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
clone: true,
filter: "> *",
itemOrientation: "vertical",
dropFeedbackMode: "push",
allowDropInsideItem: false,
allowReordering: true,
moveItemOnDrop: false,
onDragChange: null,
onAdd: null,
onRemove: null,
onReorder: null,
onPlaceholderPrepared: null,
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) => items.slice(0, index).reverse().filter(isElementVisible)[0],
_dragStartHandler(e) {
this.callBase.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) {
this.callBase.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");
sortable && sortable.update()
}
}
}
}
},
_dragLeaveHandler() {
this.callBase.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() {
let $placeholderContainer;
if (this._isIndicateMode()) {
$placeholderContainer = (0, _renderer.default)(" ").addClass(this._addWidgetPrefix("placeholder")).insertBefore(this._getSourceDraggable()._$dragElement)
}
this._$placeholderElement = $placeholderContainer;
return $placeholderContainer
},
_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 = that.option("rtlEnabled");
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 = this.callBase.apply(this, arguments);
args.model.fromIndex = this._getElementIndex($element);
return args
},
_togglePlaceholder(value) {
this._$placeholderElement && this._$placeholderElement.toggle(value)
},
_isVerticalOrientation() {
return "vertical" === this.option("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 $item = (0, _renderer.default)(itemElement);
const isVertical = this._isVerticalOrientation();
let width = "";
let height = "";
$placeholderElement.toggleClass(this._addWidgetPrefix("placeholder-inside"), dropInsideItem);
if (isVertical || dropInsideItem) {
width = (0, _size.getOuterWidth)($item)
}
if (!isVertical || dropInsideItem) {
height = (0, _size.getOuterHeight)($item)
}
width = this._makeWidthCorrection($item, 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)(this.callBase.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)(this.callBase.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 "itemOrientation":
case "allowDropInsideItem":
case "moveItemOnDrop":
case "dropFeedbackMode":
case "itemPoints":
case "animation":
case "allowReordering":
case "fromIndexOffset":
case "offset":
case "draggableElementSize":
case "autoUpdate":
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;
default:
this.callBase(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, 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;
this.callBase.apply(this, arguments);
if (!this._isIndicateMode()) {
$sourceElement && $sourceElement.toggleClass(this._addWidgetPrefix("source-hidden"), value)
}
},
_dispose() {
this.reset();
this.callBase()
},
_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
},
25387:
/*!**********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointment_popup/m_form.js ***!
\**********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentForm = exports.APPOINTMENT_FORM_GROUP_NAMES = void 0;
__webpack_require__( /*! ../m_recurrence_editor */ 70184);
__webpack_require__( /*! ../../../ui/text_area */ 51237);
__webpack_require__( /*! ../../../ui/tag_box */ 31362);
__webpack_require__( /*! ../../../ui/switch */ 31609);
__webpack_require__( /*! ../../../ui/select_box */ 78665);
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _data_source = _interopRequireDefault(__webpack_require__( /*! ../../../data/data_source */ 33546));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _form = _interopRequireDefault(__webpack_require__( /*! ../../../ui/form */ 17737));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
var _m_expression_utils = __webpack_require__( /*! ../../scheduler/m_expression_utils */ 30906);
var _index = __webpack_require__( /*! ../../scheduler/r1/semaphore/index */ 66803);
var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const APPOINTMENT_FORM_GROUP_NAMES = exports.APPOINTMENT_FORM_GROUP_NAMES = {
Main: "mainGroup",
Recurrence: "recurrenceGroup"
};
const E2E_TEST_CLASSES_form = "e2e-dx-scheduler-form",
E2E_TEST_CLASSES_textEditor = "e2e-dx-scheduler-form-text",
E2E_TEST_CLASSES_descriptionEditor = "e2e-dx-scheduler-form-description",
E2E_TEST_CLASSES_startDateEditor = "e2e-dx-scheduler-form-start-date",
E2E_TEST_CLASSES_endDateEditor = "e2e-dx-scheduler-form-end-date",
E2E_TEST_CLASSES_startDateTimeZoneEditor = "e2e-dx-scheduler-form-start-date-timezone",
E2E_TEST_CLASSES_endDateTimeZoneEditor = "e2e-dx-scheduler-form-end-date-timezone",
E2E_TEST_CLASSES_allDaySwitch = "e2e-dx-scheduler-form-all-day-switch",
E2E_TEST_CLASSES_recurrenceSwitch = "e2e-dx-scheduler-form-recurrence-switch";
const getStylingModeFunc = () => (0, _themes.isFluent)((0, _themes.current)()) ? "filled" : void 0;
exports.AppointmentForm = class {
constructor(scheduler) {
this.scheduler = scheduler;
this.form = null;
this.semaphore = new _index.Semaphore
}
get dxForm() {
return this.form
}
set readOnly(value) {
this.form.option("readOnly", value);
const {
recurrenceRuleExpr: recurrenceRuleExpr
} = this.scheduler.getDataAccessors().expr;
const recurrenceEditor = this.form.getEditor(recurrenceRuleExpr);
null === recurrenceEditor || void 0 === recurrenceEditor || recurrenceEditor.option("readOnly", value)
}
get formData() {
return this.form.option("formData")
}
set formData(value) {
this.form.option("formData", value)
}
create(triggerResize, changeSize, formData) {
const {
allowTimeZoneEditing: allowTimeZoneEditing
} = this.scheduler.getEditingConfig();
const dataAccessors = this.scheduler.getDataAccessors();
const {
expr: expr
} = dataAccessors;
const isRecurrence = !!_m_expression_utils.ExpressionUtils.getField(dataAccessors, "recurrenceRule", formData);
const colSpan = isRecurrence ? 1 : 2;
const mainItems = [...this._createMainItems(expr, triggerResize, changeSize, allowTimeZoneEditing), ...this.scheduler.createResourceEditorModel()];
changeSize(isRecurrence);
const items = [{
itemType: "group",
name: APPOINTMENT_FORM_GROUP_NAMES.Main,
colCountByScreen: {
lg: 2,
xs: 1
},
colSpan: colSpan,
items: mainItems
}, {
itemType: "group",
name: APPOINTMENT_FORM_GROUP_NAMES.Recurrence,
visible: isRecurrence,
colSpan: colSpan,
items: this._createRecurrenceEditor(expr)
}];
const element = (0, _renderer.default)(" ");
this.scheduler.createComponent(element, _form.default, {
items: items,
showValidationSummary: true,
scrollingEnabled: true,
colCount: "auto",
colCountByScreen: {
lg: 2,
xs: 1
},
formData: formData,
showColonAfterLabel: false,
labelLocation: "top",
onInitialized: e => {
this.form = e.component
},
customizeItem: e => {
if (this.form && "group" === e.itemType) {
const dataExprs = this.scheduler.getDataAccessors().expr;
const startDate = new Date(this.formData[dataExprs.startDateExpr]);
const endDate = new Date(this.formData[dataExprs.endDateExpr]);
const startTimeZoneEditor = e.items.find((i => i.dataField === dataExprs.startDateTimeZoneExpr));
const endTimeZoneEditor = e.items.find((i => i.dataField === dataExprs.endDateTimeZoneExpr));
if (startTimeZoneEditor) {
startTimeZoneEditor.editorOptions.dataSource = this.createTimeZoneDataSource(startDate)
}
if (endTimeZoneEditor) {
endTimeZoneEditor.editorOptions.dataSource = this.createTimeZoneDataSource(endDate)
}
}
},
screenByWidth: width => width < 600 || "desktop" !== _devices.default.current().deviceType ? "xs" : "lg",
elementAttr: {
class: E2E_TEST_CLASSES_form
}
})
}
createTimeZoneDataSource(date) {
return new _data_source.default({
store: _m_utils_time_zone.default.getTimeZones(date),
paginate: true,
pageSize: 10
})
}
_createAppointmentAdapter(rawAppointment) {
return (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.scheduler.getDataAccessors())
}
_dateBoxValueChanged(args, dateExpr, isNeedCorrect) {
((editor, value, previousValue) => {
const isCurrentDateCorrect = null === value || !!value;
const isPreviousDateCorrect = null === previousValue || !!previousValue;
if (!isCurrentDateCorrect && isPreviousDateCorrect) {
editor.option("value", previousValue)
}
})(args.component, args.value, args.previousValue);
const value = _date_serialization.default.deserializeDate(args.value);
const previousValue = _date_serialization.default.deserializeDate(args.previousValue);
const dateEditor = this.form.getEditor(dateExpr);
const dateValue = _date_serialization.default.deserializeDate(dateEditor.option("value"));
if (this.semaphore.isFree() && dateValue && value && isNeedCorrect(dateValue, value)) {
const duration = previousValue ? dateValue.getTime() - previousValue.getTime() : 0;
dateEditor.option("value", new Date(value.getTime() + duration))
}
}
_createTimezoneEditor(timeZoneExpr, secondTimeZoneExpr, visibleIndex, colSpan, isMainTimeZone, cssClass) {
let visible = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : false;
const noTzTitle = _message.default.format("dxScheduler-noTimezoneTitle");
return {
name: this.normalizeEditorName(timeZoneExpr),
dataField: timeZoneExpr,
editorType: "dxSelectBox",
visibleIndex: visibleIndex,
colSpan: colSpan,
cssClass: cssClass,
label: {
text: " "
},
editorOptions: {
displayExpr: "title",
valueExpr: "id",
placeholder: noTzTitle,
searchEnabled: true,
onValueChanged: args => {
const {
form: form
} = this;
const secondTimezoneEditor = form.getEditor(secondTimeZoneExpr);
if (isMainTimeZone) {
secondTimezoneEditor.option("value", args.value)
}
}
},
visible: visible
}
}
_createDateBoxItems(dataExprs, allowTimeZoneEditing) {
const colSpan = allowTimeZoneEditing ? 2 : 1;
const firstDayOfWeek = this.scheduler.getFirstDayOfWeek();
return [this.createDateBoxEditor(dataExprs.startDateExpr, colSpan, firstDayOfWeek, "dxScheduler-editorLabelStartDate", E2E_TEST_CLASSES_startDateEditor, (args => {
this._dateBoxValueChanged(args, dataExprs.endDateExpr, ((endValue, startValue) => endValue < startValue))
})), this._createTimezoneEditor(dataExprs.startDateTimeZoneExpr, dataExprs.endDateTimeZoneExpr, 1, colSpan, true, E2E_TEST_CLASSES_startDateTimeZoneEditor, allowTimeZoneEditing), this.createDateBoxEditor(dataExprs.endDateExpr, colSpan, firstDayOfWeek, "dxScheduler-editorLabelEndDate", E2E_TEST_CLASSES_endDateEditor, (args => {
this._dateBoxValueChanged(args, dataExprs.startDateExpr, ((startValue, endValue) => endValue < startValue))
})), this._createTimezoneEditor(dataExprs.endDateTimeZoneExpr, dataExprs.startDateTimeZoneExpr, 3, colSpan, false, E2E_TEST_CLASSES_endDateTimeZoneEditor, allowTimeZoneEditing)]
}
_changeFormItemDateType(name, groupName, isAllDay) {
const editorPath = this.getEditorPath(name, groupName);
const itemEditorOptions = this.form.itemOption(editorPath).editorOptions;
const type = isAllDay ? "date" : "datetime";
const newEditorOption = _extends({}, itemEditorOptions, {
type: type
});
this.form.itemOption(editorPath, "editorOptions", newEditorOption)
}
_createMainItems(dataExprs, triggerResize, changeSize, allowTimeZoneEditing) {
return [{
name: this.normalizeEditorName(dataExprs.textExpr),
dataField: dataExprs.textExpr,
cssClass: E2E_TEST_CLASSES_textEditor,
editorType: "dxTextBox",
colSpan: 2,
label: {
text: _message.default.format("dxScheduler-editorLabelTitle")
},
editorOptions: {
stylingMode: getStylingModeFunc()
}
}, {
itemType: "group",
colSpan: 2,
colCountByScreen: {
lg: 2,
xs: 1
},
items: this._createDateBoxItems(dataExprs, allowTimeZoneEditing)
}, {
itemType: "group",
colSpan: 2,
colCountByScreen: {
lg: 2,
xs: 2
},
items: [{
name: this.normalizeEditorName(dataExprs.allDayExpr),
dataField: dataExprs.allDayExpr,
cssClass: `dx-appointment-form-switch ${E2E_TEST_CLASSES_allDaySwitch}`,
editorType: "dxSwitch",
label: {
text: _message.default.format("dxScheduler-allDay"),
location: "right"
},
editorOptions: {
onValueChanged: args => {
const {
value: value
} = args;
const startDateEditor = this.form.getEditor(dataExprs.startDateExpr);
const endDateEditor = this.form.getEditor(dataExprs.endDateExpr);
const startDate = _date_serialization.default.deserializeDate(startDateEditor.option("value"));
if (this.semaphore.isFree() && startDate) {
if (value) {
const allDayStartDate = _date.default.trimTime(startDate);
startDateEditor.option("value", new Date(allDayStartDate));
endDateEditor.option("value", new Date(allDayStartDate))
} else {
const startDateWithStartHour = ((startDate, startDayHour) => new Date(new Date(startDate).setHours(startDayHour)))(startDate, this.scheduler.getStartDayHour());
const endDate = this.scheduler.getCalculatedEndDate(startDateWithStartHour);
startDateEditor.option("value", startDateWithStartHour);
endDateEditor.option("value", endDate)
}
}
this._changeFormItemDateType(dataExprs.startDateExpr, "Main", value);
this._changeFormItemDateType(dataExprs.endDateExpr, "Main", value)
}
}
}, {
editorType: "dxSwitch",
dataField: "repeat",
cssClass: `dx-appointment-form-switch ${E2E_TEST_CLASSES_recurrenceSwitch}`,
name: "visibilityChanged",
label: {
text: _message.default.format("dxScheduler-editorLabelRecurrence"),
location: "right"
},
editorOptions: {
onValueChanged: args => {
const {
form: form
} = this;
const colSpan = args.value ? 1 : 2;
form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Main, "colSpan", colSpan);
form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Recurrence, "colSpan", colSpan);
((recurrenceRuleExpr, value, form) => {
var _form$getEditor;
form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Recurrence, "visible", value);
null === (_form$getEditor = form.getEditor(recurrenceRuleExpr)) || void 0 === _form$getEditor || _form$getEditor.changeValueByVisibility(value)
})(dataExprs.recurrenceRuleExpr, args.value, form);
changeSize(args.value);
triggerResize()
}
}
}]
}, {
itemType: "empty",
colSpan: 2
}, {
name: this.normalizeEditorName(dataExprs.descriptionExpr),
dataField: dataExprs.descriptionExpr,
cssClass: E2E_TEST_CLASSES_descriptionEditor,
editorType: "dxTextArea",
colSpan: 2,
label: {
text: _message.default.format("dxScheduler-editorLabelDescription")
},
editorOptions: {
stylingMode: getStylingModeFunc()
}
}, {
itemType: "empty",
colSpan: 2
}]
}
_createRecurrenceEditor(dataExprs) {
return [{
name: this.normalizeEditorName(dataExprs.recurrenceRuleExpr),
dataField: dataExprs.recurrenceRuleExpr,
editorType: "dxRecurrenceEditor",
editorOptions: {
firstDayOfWeek: this.scheduler.getFirstDayOfWeek(),
timeZoneCalculator: this.scheduler.getTimeZoneCalculator(),
getStartDateTimeZone: () => this._createAppointmentAdapter(this.formData).startDateTimeZone
},
label: {
text: " ",
visible: false
}
}]
}
setEditorsType(allDay) {
const {
startDateExpr: startDateExpr,
endDateExpr: endDateExpr
} = this.scheduler.getDataAccessors().expr;
const startDateItemPath = this.getEditorPath(startDateExpr, "Main");
const endDateItemPath = this.getEditorPath(endDateExpr, "Main");
const startDateFormItem = this.form.itemOption(startDateItemPath);
const endDateFormItem = this.form.itemOption(endDateItemPath);
if (startDateFormItem && endDateFormItem) {
const startDateEditorOptions = startDateFormItem.editorOptions;
const endDateEditorOptions = endDateFormItem.editorOptions;
startDateEditorOptions.type = endDateEditorOptions.type = allDay ? "date" : "datetime";
this.form.itemOption(startDateItemPath, "editorOptions", startDateEditorOptions);
this.form.itemOption(endDateItemPath, "editorOptions", endDateEditorOptions)
}
}
updateRecurrenceEditorStartDate(date, expression) {
const options = {
startDate: date
};
this.setEditorOptions(expression, "Recurrence", options)
}
setEditorOptions(name, groupName, options) {
const editorPath = this.getEditorPath(name, groupName);
const editor = this.form.itemOption(editorPath);
editor && this.form.itemOption(editorPath, "editorOptions", (0, _extend.extend)({}, editor.editorOptions, options))
}
setTimeZoneEditorDataSource(date, name) {
const dataSource = this.createTimeZoneDataSource(date);
this.setEditorOptions(name, "Main", {
dataSource: dataSource
})
}
updateFormData(formData) {
this.semaphore.take();
this.form.option("formData", formData);
const dataAccessors = this.scheduler.getDataAccessors();
const {
expr: expr
} = dataAccessors;
const rawStartDate = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", formData);
const rawEndDate = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "endDate", formData);
const allDay = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "allDay", formData);
const startDate = new Date(rawStartDate);
const endDate = new Date(rawEndDate);
this.setTimeZoneEditorDataSource(startDate, expr.startDateTimeZoneExpr);
this.setTimeZoneEditorDataSource(endDate, expr.endDateTimeZoneExpr);
this.updateRecurrenceEditorStartDate(startDate, expr.recurrenceRuleExpr);
this.setEditorsType(allDay);
this.semaphore.release()
}
createDateBoxEditor(dataField, colSpan, firstDayOfWeek, label, cssClass, onValueChanged) {
return {
editorType: "dxDateBox",
name: this.normalizeEditorName(dataField),
dataField: dataField,
colSpan: colSpan,
cssClass: cssClass,
label: {
text: _message.default.format(label)
},
validationRules: [{
type: "required"
}],
editorOptions: {
stylingMode: getStylingModeFunc(),
width: "100%",
calendarOptions: {
firstDayOfWeek: firstDayOfWeek
},
onValueChanged: onValueChanged,
useMaskBehavior: true
}
}
}
getEditorPath(name, groupName) {
const normalizedName = this.normalizeEditorName(name);
return `${APPOINTMENT_FORM_GROUP_NAMES[groupName]}.${normalizedName}`
}
normalizeEditorName(name) {
return name ? name.replace(/\./g, "_") : name
}
}
},
77135:
/*!***********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointment_popup/m_popup.js ***!
\***********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentPopup = exports.ACTION_TO_APPOINTMENT = void 0;
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _visibility_change = __webpack_require__( /*! ../../../events/visibility_change */ 80506);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 51495));
var _m_expression_utils = __webpack_require__( /*! ../../scheduler/m_expression_utils */ 30906);
var _index = __webpack_require__( /*! ../../scheduler/r1/appointment_popup/index */ 30695);
var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734);
var _m_loading = __webpack_require__( /*! ../m_loading */ 28066);
var _m_utils = __webpack_require__( /*! ../resources/m_utils */ 31359);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
const DAY_IN_MS = toMs("day");
const POPUP_CONFIG = {
height: "auto",
maxHeight: "100%",
showCloseButton: false,
showTitle: false,
preventScrollEvents: false,
enableBodyScroll: false,
defaultOptionsRules: [{
device: () => _devices.default.current().android,
options: {
showTitle: false
}
}],
_ignorePreventScrollEventsDeprecation: true
};
const ACTION_TO_APPOINTMENT = exports.ACTION_TO_APPOINTMENT = {
CREATE: 0,
UPDATE: 1,
EXCLUDE_FROM_SERIES: 2
};
exports.AppointmentPopup = class {
constructor(scheduler, form) {
this.scheduler = scheduler;
this.form = form;
this.popup = null;
this.state = {
action: null,
lastEditData: null,
saveChangesLocker: false,
appointment: {
data: null
}
}
}
get visible() {
return this.popup ? this.popup.option("visible") : false
}
show(appointment, config) {
this.state.appointment.data = appointment;
this.state.action = config.action;
this.state.excludeInfo = config.excludeInfo;
if (!this.popup) {
const popupConfig = this._createPopupConfig();
this.popup = this._createPopup(popupConfig)
}
this.popup.option("toolbarItems", (0, _index.getPopupToolbarItems)(config.isToolbarVisible, (e => this._doneButtonClickHandler(e))));
this.popup.show()
}
hide() {
this.popup.hide()
}
dispose() {
var _this$popup;
null === (_this$popup = this.popup) || void 0 === _this$popup || _this$popup.$element().remove()
}
_createPopup(options) {
const popupElement = (0, _renderer.default)(" ").addClass("dx-scheduler-appointment-popup").appendTo(this.scheduler.getElement());
return this.scheduler.createComponent(popupElement, _ui.default, options)
}
_createPopupConfig() {
return _extends({}, POPUP_CONFIG, {
onHiding: () => this.scheduler.focus(),
contentTemplate: () => this._createPopupContent(),
onShowing: e => this._onShowing(e),
wrapperAttr: {
class: "dx-scheduler-appointment-popup"
}
})
}
_onShowing(e) {
this._updateForm();
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()
}
}))
}
_createPopupContent() {
this._createForm();
return this.form.dxForm.$element()
}
_createFormData(rawAppointment) {
const appointment = this._createAppointmentAdapter(rawAppointment);
const dataAccessors = this.scheduler.getDataAccessors();
const resources = this.scheduler.getResources();
const normalizedResources = (0, _m_utils.getNormalizedResources)(rawAppointment, dataAccessors, resources);
return _extends({}, rawAppointment, normalizedResources, {
repeat: !!appointment.recurrenceRule
})
}
_createForm() {
const rawAppointment = this.state.appointment.data;
const formData = this._createFormData(rawAppointment);
this.form.create(this.triggerResize.bind(this), this.changeSize.bind(this), formData)
}
_isReadOnly(rawAppointment) {
const appointment = this._createAppointmentAdapter(rawAppointment);
if (rawAppointment && appointment.disabled) {
return true
}
if (this.state.action === ACTION_TO_APPOINTMENT.CREATE) {
return false
}
return !this.scheduler.getEditingConfig().allowUpdating
}
_createAppointmentAdapter(rawAppointment) {
return (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.scheduler.getDataAccessors(), this.scheduler.getTimeZoneCalculator())
}
_updateForm() {
const {
data: data
} = this.state.appointment;
const appointment = this._createAppointmentAdapter(this._createFormData(data));
if (appointment.startDate) {
appointment.startDate = appointment.calculateStartDate("toAppointment")
}
if (appointment.endDate) {
appointment.endDate = appointment.calculateEndDate("toAppointment")
}
const formData = appointment.clone().source();
this.form.readOnly = this._isReadOnly(formData);
this.form.updateFormData(formData)
}
triggerResize() {
if (this.popup) {
(0, _visibility_change.triggerResizeEvent)(this.popup.$element())
}
}
changeSize(isRecurrence) {
if (this.popup) {
const isFullScreen = (0, _index.isPopupFullScreenNeeded)();
const maxWidth = isFullScreen ? "100%" : (0, _index.getMaxWidth)(isRecurrence);
this.popup.option("fullScreen", isFullScreen);
this.popup.option("maxWidth", maxWidth)
}
}
updatePopupFullScreenMode() {
if (this.form.dxForm && this.visible) {
const {
formData: formData
} = this.form;
const dataAccessors = this.scheduler.getDataAccessors();
const isRecurrence = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "recurrenceRule", formData);
this.changeSize(isRecurrence)
}
}
saveChangesAsync(isShowLoadPanel) {
const deferred = new _deferred.Deferred;
const validation = this.form.dxForm.validate();
isShowLoadPanel && this._showLoadPanel();
(0, _deferred.when)(validation && validation.complete || validation).done((validation => {
if (validation && !validation.isValid) {
(0, _m_loading.hide)();
deferred.resolve(false);
return
}
const {
repeat: repeat
} = this.form.formData;
const adapter = this._createAppointmentAdapter(this.form.formData);
const clonedAdapter = adapter.clone({
pathTimeZone: "fromAppointment"
});
const shouldClearRecurrenceRule = !repeat && !!clonedAdapter.recurrenceRule;
this._addMissingDSTTime(adapter, clonedAdapter);
if (shouldClearRecurrenceRule) {
clonedAdapter.recurrenceRule = ""
}
const appointment = clonedAdapter.source();
delete appointment.repeat;
switch (this.state.action) {
case ACTION_TO_APPOINTMENT.CREATE:
this.scheduler.addAppointment(appointment).done(deferred.resolve);
break;
case ACTION_TO_APPOINTMENT.UPDATE:
this.scheduler.updateAppointment(this.state.appointment.data, appointment).done(deferred.resolve);
break;
case ACTION_TO_APPOINTMENT.EXCLUDE_FROM_SERIES:
this.scheduler.updateAppointment(this.state.excludeInfo.sourceAppointment, this.state.excludeInfo.updatedAppointment);
this.scheduler.addAppointment(appointment).done(deferred.resolve)
}
deferred.done((() => {
(0, _m_loading.hide)();
this.state.lastEditData = appointment
}))
}));
return deferred.promise()
}
_doneButtonClickHandler(e) {
e.cancel = true;
this.saveEditDataAsync()
}
saveEditDataAsync() {
const deferred = new _deferred.Deferred;
if (this._tryLockSaveChanges()) {
(0, _deferred.when)(this.saveChangesAsync(true)).done((() => {
if (this.state.lastEditData) {
const adapter = this._createAppointmentAdapter(this.state.lastEditData);
const {
startDate: startDate,
endDate: endDate,
allDay: allDay
} = adapter;
const startTime = startDate.getTime();
const endTime = endDate.getTime();
const inAllDayRow = allDay || endTime - startTime >= DAY_IN_MS;
const dataAccessors = this.scheduler.getDataAccessors();
const resourceList = this.scheduler.getResources();
const normalizedResources = (0, _m_utils.getNormalizedResources)(this.state.lastEditData, dataAccessors, resourceList);
this.scheduler.updateScrollPosition(startDate, normalizedResources, inAllDayRow);
this.state.lastEditData = null
}
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 * toMs("hour")) : clonedDate
}
}
},
92823:
/*!****************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_appointment_data_provider.js ***!
\****************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentDataProvider = void 0;
var _config = (obj = __webpack_require__( /*! ../../../../core/config */ 80209), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ../../../scheduler/r1/filterting/index */ 7884);
var _m_appointment_data_source = __webpack_require__( /*! ./m_appointment_data_source */ 93074);
var _m_appointment_filter = __webpack_require__( /*! ./m_appointment_filter */ 30256);
const FilterStrategies_virtual = "virtual",
FilterStrategies_standard = "standard";
exports.AppointmentDataProvider = class {
constructor(options) {
this.options = options;
this.dataSource = this.options.dataSource;
this.dataAccessors = this.options.dataAccessors;
this.timeZoneCalculator = this.options.timeZoneCalculator;
this.appointmentDataSource = new _m_appointment_data_source.AppointmentDataSource(this.dataSource);
this.initFilterStrategy()
}
get keyName() {
return this.appointmentDataSource.keyName
}
get isDataSourceInit() {
return !!this.dataSource
}
get filterStrategyName() {
return this.options.getIsVirtualScrolling() ? FilterStrategies_virtual : FilterStrategies_standard
}
getFilterStrategy() {
if (!this.filterStrategy || this.filterStrategy.strategyName !== this.filterStrategyName) {
this.initFilterStrategy()
}
return this.filterStrategy
}
initFilterStrategy() {
const filterOptions = {
resources: this.options.resources,
dataAccessors: this.dataAccessors,
startDayHour: this.options.startDayHour,
endDayHour: this.options.endDayHour,
viewOffset: this.options.viewOffset,
showAllDayPanel: this.options.showAllDayPanel,
timeZoneCalculator: this.options.timeZoneCalculator,
loadedResources: this.options.getLoadedResources,
supportAllDayRow: this.options.getSupportAllDayRow,
viewType: this.options.getViewType,
viewDirection: this.options.getViewDirection,
dateRange: this.options.getDateRange,
groupCount: this.options.getGroupCount,
viewDataProvider: this.options.getViewDataProvider,
allDayPanelMode: this.options.allDayPanelMode
};
this.filterStrategy = this.filterStrategyName === FilterStrategies_virtual ? new _m_appointment_filter.AppointmentFilterVirtualStrategy(filterOptions) : new _m_appointment_filter.AppointmentFilterBaseStrategy(filterOptions)
}
setDataSource(dataSource) {
this.dataSource = dataSource;
this.initFilterStrategy();
this.appointmentDataSource.setDataSource(this.dataSource)
}
updateDataAccessors(dataAccessors) {
this.dataAccessors = dataAccessors;
this.initFilterStrategy()
}
filter(preparedItems) {
return this.getFilterStrategy().filter(preparedItems)
}
filterByDate(min, max, remoteFiltering, dateSerializationFormat) {
if (!this.dataSource || !remoteFiltering) {
return
}
const dataSourceFilter = this.dataSource.filter();
const filter = (0, _index.combineRemoteFilter)({
dataSourceFilter: dataSourceFilter,
dataAccessors: this.dataAccessors,
min: min,
max: max,
dateSerializationFormat: dateSerializationFormat,
forceIsoDateParsing: (0, _config.default)().forceIsoDateParsing
});
this.dataSource.filter(filter)
}
hasAllDayAppointments(filteredItems, preparedItems) {
return this.getFilterStrategy().hasAllDayAppointments(filteredItems, preparedItems)
}
filterLoadedAppointments(filterOption, preparedItems) {
return this.getFilterStrategy().filterLoadedAppointments(filterOption, preparedItems)
}
calculateAppointmentEndDate(isAllDay, startDate) {
return this.getFilterStrategy().calculateAppointmentEndDate(isAllDay, startDate)
}
cleanState() {
this.appointmentDataSource.cleanState()
}
getUpdatedAppointment() {
return this.appointmentDataSource._updatedAppointment
}
getUpdatedAppointmentKeys() {
return this.appointmentDataSource._updatedAppointmentKeys
}
add(rawAppointment) {
return this.appointmentDataSource.add(rawAppointment)
}
update(target, rawAppointment) {
return this.appointmentDataSource.update(target, rawAppointment)
}
remove(rawAppointment) {
return this.appointmentDataSource.remove(rawAppointment)
}
destroy() {
this.appointmentDataSource.destroy()
}
}
},
93074:
/*!**************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_appointment_data_source.js ***!
\**************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentDataSource = void 0;
var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754);
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 !!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 = this._dataSource;
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)
}
}
}
},
30256:
/*!*********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_appointment_filter.js ***!
\*********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentFilterVirtualStrategy = exports.AppointmentFilterBaseStrategy = void 0;
var _array = __webpack_require__( /*! ../../../../core/utils/array */ 89386);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687));
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734);
var _m_recurrence = __webpack_require__( /*! ../../m_recurrence */ 38227);
var _m_utils = __webpack_require__( /*! ../../resources/m_utils */ 31359);
var _m_utils2 = __webpack_require__( /*! ./m_utils */ 55523);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
const FilterStrategies_virtual = "virtual",
FilterStrategies_standard = "standard";
class AppointmentFilterBaseStrategy {
constructor(options) {
this.options = options;
this.dataAccessors = this.options.dataAccessors;
this._init()
}
get strategyName() {
return FilterStrategies_standard
}
get timeZoneCalculator() {
return this.options.timeZoneCalculator
}
get viewStartDayHour() {
return this.options.startDayHour
}
get viewEndDayHour() {
return this.options.endDayHour
}
get timezone() {
return this.options.timezone
}
get firstDayOfWeek() {
return this.options.firstDayOfWeek
}
get showAllDayPanel() {
return this.options.showAllDayPanel
}
get loadedResources() {
return this._resolveOption("loadedResources")
}
get supportAllDayRow() {
return this._resolveOption("supportAllDayRow")
}
get viewType() {
return this._resolveOption("viewType")
}
get viewDirection() {
return this._resolveOption("viewDirection")
}
get dateRange() {
return this._resolveOption("dateRange")
}
get groupCount() {
return this._resolveOption("groupCount")
}
get viewDataProvider() {
return this._resolveOption("viewDataProvider")
}
get allDayPanelMode() {
return this._resolveOption("allDayPanelMode")
}
_resolveOption(name) {
const result = this.options[name];
return "function" === typeof result ? result() : result
}
_init() {
this.setDataAccessors(this.dataAccessors)
}
filter(preparedItems) {
const [min, max] = this.dateRange;
const {
viewOffset: viewOffset
} = this.options;
const allDay = !this.showAllDayPanel && this.supportAllDayRow ? false : void 0;
return this.filterLoadedAppointments({
startDayHour: this.viewStartDayHour,
endDayHour: this.viewEndDayHour,
viewOffset: viewOffset,
viewStartDayHour: this.viewStartDayHour,
viewEndDayHour: this.viewEndDayHour,
min: min,
max: max,
resources: this.loadedResources,
allDay: allDay,
supportMultiDayAppointments: (0, _index.isTimelineView)(this.viewType),
firstDayOfWeek: this.firstDayOfWeek
}, preparedItems)
}
hasAllDayAppointments(filteredItems, preparedItems) {
const adapters = filteredItems.map((item => (0, _m_appointment_adapter.createAppointmentAdapter)(item, this.dataAccessors, this.timeZoneCalculator)));
let result = false;
(0, _iterator.each)(adapters, ((_, item) => {
if ((0, _index.getAppointmentTakesAllDay)(item, this.allDayPanelMode)) {
result = true;
return false
}
}));
return result
}
setDataAccessors(dataAccessors) {
this.dataAccessors = dataAccessors
}
_createAllDayAppointmentFilter() {
return [
[appointment => (0, _index.getAppointmentTakesAllDay)(appointment, this.allDayPanelMode)]
]
}
_createCombinedFilter(filterOptions) {
const min = new Date(filterOptions.min);
const max = new Date(filterOptions.max);
const {
startDayHour: startDayHour,
endDayHour: endDayHour,
viewOffset: viewOffset,
viewStartDayHour: viewStartDayHour,
viewEndDayHour: viewEndDayHour,
resources: resources,
firstDayOfWeek: firstDayOfWeek,
checkIntersectViewport: checkIntersectViewport,
supportMultiDayAppointments: supportMultiDayAppointments
} = filterOptions;
const [trimMin, trimMax] = (0, _index.getDatesWithoutTime)(min, max);
const useRecurrence = (0, _type.isDefined)(this.dataAccessors.getter.recurrenceRule);
return [
[appointment => {
const appointmentVisible = appointment.visible ?? true;
if (!appointmentVisible) {
return false
}
const {
allDay: isAllDay,
hasRecurrenceRule: hasRecurrenceRule
} = appointment;
const startDate = _date2.dateUtilsTs.addOffsets(appointment.startDate, [-viewOffset]);
const endDate = _date2.dateUtilsTs.addOffsets(appointment.endDate, [-viewOffset]);
const appointmentTakesAllDay = (0, _index.getAppointmentTakesAllDay)(appointment, this.allDayPanelMode);
if (!hasRecurrenceRule) {
if (!(endDate >= trimMin && startDate < trimMax || _date.default.sameDate(endDate, trimMin) && _date.default.sameDate(startDate, trimMin))) {
return false
}
}
const appointmentTakesSeveralDays = (0, _m_utils2.getAppointmentTakesSeveralDays)(appointment);
const isLongAppointment = appointmentTakesSeveralDays || appointmentTakesAllDay;
if (null !== resources && void 0 !== resources && resources.length && !this._filterAppointmentByResources(appointment.rawAppointment, resources)) {
return false
}
if (appointmentTakesAllDay && false === filterOptions.allDay) {
return false
}
if (hasRecurrenceRule) {
const recurrenceException = (0, _m_utils2.getRecurrenceException)(appointment, this.timeZoneCalculator, this.timezone);
if (!this._filterAppointmentByRRule(_extends({}, appointment, {
recurrenceException: recurrenceException,
allDay: appointmentTakesAllDay
}), min, max, startDayHour, endDayHour, firstDayOfWeek)) {
return false
}
}
if (!isAllDay && supportMultiDayAppointments && isLongAppointment) {
if (endDate < min && (!useRecurrence || useRecurrence && !hasRecurrenceRule)) {
return false
}
}
if (!isAllDay && (0, _type.isDefined)(startDayHour) && (!useRecurrence || !filterOptions.isVirtualScrolling)) {
if (!(0, _m_utils2.compareDateWithStartDayHour)(startDate, endDate, startDayHour, appointmentTakesAllDay, appointmentTakesSeveralDays)) {
return false
}
}
if (!isAllDay && (0, _type.isDefined)(endDayHour)) {
if (!(0, _m_utils2.compareDateWithEndDayHour)({
startDate: startDate,
endDate: endDate,
startDayHour: startDayHour,
endDayHour: endDayHour,
viewOffset: viewOffset,
viewStartDayHour: viewStartDayHour,
viewEndDayHour: viewEndDayHour,
allDay: appointmentTakesAllDay,
severalDays: appointmentTakesSeveralDays,
min: min,
max: max,
checkIntersectViewport: checkIntersectViewport
})) {
return false
}
}
if (!isAllDay && (!isLongAppointment || supportMultiDayAppointments)) {
if (endDate < min && useRecurrence && !hasRecurrenceRule) {
return false
}
}
return true
}]
]
}
_createAppointmentFilter(filterOptions) {
return this._createCombinedFilter(filterOptions)
}
_filterAppointmentByResources(appointment, resources) {
const checkAppointmentResourceValues = (resourceName, resourceIndex) => {
const resourceGetter = this.dataAccessors.resources.getter[resourceName];
let resource;
if ((0, _type.isFunction)(resourceGetter)) {
resource = resourceGetter(appointment)
}
const appointmentResourceValues = (0, _array.wrapToArray)(resource);
const resourceData = (0, _iterator.map)(resources[resourceIndex].items, (_ref => {
let {
id: id
} = _ref;
return id
}));
for (let i = 0; i < appointmentResourceValues.length; i++) {
if ((0, _index.hasResourceValue)(resourceData, appointmentResourceValues[i])) {
return true
}
}
return false
};
let result = false;
for (let i = 0; i < resources.length; i++) {
const resourceName = resources[i].name;
result = checkAppointmentResourceValues(resourceName, i);
if (!result) {
return false
}
}
return result
}
_filterAppointmentByRRule(appointment, min, max, startDayHour, endDayHour, firstDayOfWeek) {
const {
recurrenceRule: recurrenceRule
} = appointment;
const {
recurrenceException: recurrenceException
} = appointment;
const {
allDay: allDay
} = appointment;
let result = true;
const appointmentStartDate = appointment.startDate;
const appointmentEndDate = appointment.endDate;
const recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)();
if (allDay || (0, _m_utils2._appointmentPartInInterval)(appointmentStartDate, appointmentEndDate, startDayHour, endDayHour)) {
const [trimMin, trimMax] = (0, _index.getDatesWithoutTime)(min, max);
min = trimMin;
max = new Date(trimMax.getTime() - toMs("minute"))
}
if (recurrenceRule && !recurrenceProcessor.isValidRecurrenceRule(recurrenceRule)) {
result = appointmentEndDate > min && appointmentStartDate <= max
}
if (result && recurrenceProcessor.isValidRecurrenceRule(recurrenceRule)) {
const {
viewOffset: viewOffset
} = this.options;
result = recurrenceProcessor.hasRecurrence({
rule: recurrenceRule,
exception: recurrenceException,
start: appointmentStartDate,
end: appointmentEndDate,
min: _date2.dateUtilsTs.addOffsets(min, [viewOffset]),
max: _date2.dateUtilsTs.addOffsets(max, [viewOffset]),
firstDayOfWeek: firstDayOfWeek,
appointmentTimezoneOffset: this.timeZoneCalculator.getOriginStartDateOffsetInMs(appointmentStartDate, appointment.startDateTimeZone, false)
})
}
return result
}
filterLoadedAppointments(filterOptions, preparedItems) {
const filteredItems = this.filterPreparedItems(filterOptions, preparedItems);
return filteredItems.map((_ref2 => {
let {
rawAppointment: rawAppointment
} = _ref2;
return rawAppointment
}))
}
filterPreparedItems(filterOptions, preparedItems) {
const combinedFilter = this._createAppointmentFilter(filterOptions);
return (0, _query.default)(preparedItems).filter(combinedFilter).toArray()
}
filterAllDayAppointments(preparedItems) {
const combinedFilter = this._createAllDayAppointmentFilter();
return (0, _query.default)(preparedItems).filter(combinedFilter).toArray().map((_ref3 => {
let {
rawAppointment: rawAppointment
} = _ref3;
return rawAppointment
}))
}
}
exports.AppointmentFilterBaseStrategy = AppointmentFilterBaseStrategy;
exports.AppointmentFilterVirtualStrategy = class extends AppointmentFilterBaseStrategy {
get strategyName() {
return FilterStrategies_virtual
}
get resources() {
return this.options.resources
}
filter(preparedItems) {
const {
viewOffset: viewOffset
} = this.options;
const hourMs = toMs("hour");
const isCalculateStartAndEndDayHour = (0, _index.isDateAndTimeView)(this.viewType);
const checkIntersectViewport = isCalculateStartAndEndDayHour && "horizontal" === this.viewDirection;
const isAllDayWorkspace = !this.supportAllDayRow;
const showAllDayAppointments = this.showAllDayPanel || isAllDayWorkspace;
const endViewDate = this.viewDataProvider.getLastViewDateByEndDayHour(this.viewEndDayHour);
const shiftedEndViewDate = _date2.dateUtilsTs.addOffsets(endViewDate, [viewOffset]);
const filterOptions = [];
const groupsInfo = this.viewDataProvider.getCompletedGroupsInfo();
groupsInfo.forEach((item => {
const {
groupIndex: groupIndex
} = item;
const groupStartDate = item.startDate;
const groupEndDate = new Date(Math.min(item.endDate.getTime(), shiftedEndViewDate.getTime()));
const startDayHour = isCalculateStartAndEndDayHour ? groupStartDate.getHours() : this.viewStartDayHour;
const endDayHour = isCalculateStartAndEndDayHour ? startDayHour + groupStartDate.getMinutes() / 60 + (groupEndDate.getTime() - groupStartDate.getTime()) / hourMs : this.viewEndDayHour;
const resources = this._getPrerenderFilterResources(groupIndex);
const hasAllDayPanel = this.viewDataProvider.hasGroupAllDayPanel(groupIndex);
const supportAllDayAppointment = isAllDayWorkspace || !!showAllDayAppointments && hasAllDayPanel;
filterOptions.push({
isVirtualScrolling: true,
startDayHour: startDayHour,
endDayHour: endDayHour,
viewOffset: viewOffset,
viewStartDayHour: this.viewStartDayHour,
viewEndDayHour: this.viewEndDayHour,
min: _date2.dateUtilsTs.addOffsets(groupStartDate, [-viewOffset]),
max: _date2.dateUtilsTs.addOffsets(groupEndDate, [-viewOffset]),
supportMultiDayAppointments: (0, _index.isTimelineView)(this.viewType),
allDay: supportAllDayAppointment,
resources: resources,
firstDayOfWeek: this.firstDayOfWeek,
checkIntersectViewport: checkIntersectViewport
})
}));
return this.filterLoadedAppointments({
filterOptions: filterOptions,
groupCount: this.groupCount
}, preparedItems)
}
filterPreparedItems(_ref4, preparedItems) {
let {
filterOptions: filterOptions,
groupCount: groupCount
} = _ref4;
const combinedFilters = [];
let itemsToFilter = preparedItems;
const needPreFilter = groupCount > 0;
if (needPreFilter) {
itemsToFilter = itemsToFilter.filter((_ref5 => {
let {
rawAppointment: rawAppointment
} = _ref5;
for (let i = 0; i < filterOptions.length; ++i) {
const {
resources: resources
} = filterOptions[i];
if (this._filterAppointmentByResources(rawAppointment, resources)) {
return true
}
}
}))
}
filterOptions.forEach((option => {
combinedFilters.length && combinedFilters.push("or");
const filter = this._createAppointmentFilter(option);
combinedFilters.push(filter)
}));
return (0, _query.default)(itemsToFilter).filter(combinedFilters).toArray()
}
hasAllDayAppointments(filteredItems, preparedItems) {
return this.filterAllDayAppointments(preparedItems).length > 0
}
_getPrerenderFilterResources(groupIndex) {
const cellGroup = this.viewDataProvider.getCellsGroup(groupIndex);
return (0, _m_utils.getResourcesDataByGroups)(this.loadedResources, this.resources, [cellGroup])
}
}
},
55523:
/*!********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_utils.js ***!
\********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sortAppointmentsByStartDate = exports.replaceWrongEndDate = exports.getRecurrenceException = exports.getAppointmentTakesSeveralDays = exports.compareDateWithStartDayHour = exports.compareDateWithEndDayHour = exports._isEndDateWrong = exports._convertRecurrenceException = exports._appointmentPartInInterval = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434));
var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date.default.dateToMilliseconds;
exports.compareDateWithStartDayHour = (startDate, endDate, startDayHour, allDay, severalDays) => {
const startTime = _date.default.dateTimeFromDecimal(startDayHour);
const result = startDate.getHours() >= startTime.hours && startDate.getMinutes() >= startTime.minutes || endDate.getHours() === startTime.hours && endDate.getMinutes() > startTime.minutes || endDate.getHours() > startTime.hours || severalDays || allDay;
return result
};
exports.compareDateWithEndDayHour = options => {
const {
startDate: startDate,
endDate: endDate,
startDayHour: startDayHour,
endDayHour: endDayHour,
viewStartDayHour: viewStartDayHour,
viewEndDayHour: viewEndDayHour,
allDay: allDay,
severalDays: severalDays,
min: min,
max: max,
checkIntersectViewport: checkIntersectViewport
} = options;
const hiddenInterval = (24 - viewEndDayHour + viewStartDayHour) * toMs("hour");
const apptDuration = endDate.getTime() - startDate.getTime();
const delta = (hiddenInterval - apptDuration) / toMs("hour");
const apptStartHour = startDate.getHours();
const apptStartMinutes = startDate.getMinutes();
let result;
const endTime = _date.default.dateTimeFromDecimal(endDayHour);
const startTime = _date.default.dateTimeFromDecimal(startDayHour);
const apptIntersectViewport = startDate < max && endDate > min;
result = checkIntersectViewport && apptIntersectViewport || apptStartHour < endTime.hours || apptStartHour === endTime.hours && apptStartMinutes < endTime.minutes || allDay && startDate <= max || severalDays && apptIntersectViewport && (apptStartHour < endTime.hours || 60 * endDate.getHours() + endDate.getMinutes() > 60 * startTime.hours);
if (apptDuration < hiddenInterval) {
if (apptStartHour > endTime.hours && apptStartMinutes > endTime.minutes && delta <= apptStartHour - endDayHour) {
result = false
}
}
return result
};
exports.getAppointmentTakesSeveralDays = adapter => !_date.default.sameDate(adapter.startDate, adapter.endDate);
const _isEndDateWrong = (startDate, endDate) => !endDate || isNaN(endDate.getTime()) || startDate.getTime() > endDate.getTime();
exports._isEndDateWrong = _isEndDateWrong;
exports._appointmentPartInInterval = (startDate, endDate, startDayHour, endDayHour) => {
const apptStartDayHour = startDate.getHours();
const apptEndDayHour = endDate.getHours();
return apptStartDayHour <= startDayHour && apptEndDayHour <= endDayHour && apptEndDayHour >= startDayHour || apptEndDayHour >= endDayHour && apptStartDayHour <= endDayHour && apptStartDayHour >= startDayHour
};
exports.getRecurrenceException = (appointmentAdapter, timeZoneCalculator, timeZone) => {
const {
recurrenceException: recurrenceException
} = appointmentAdapter;
if (recurrenceException) {
const exceptions = recurrenceException.split(",");
for (let i = 0; i < exceptions.length; i++) {
exceptions[i] = _convertRecurrenceException(exceptions[i], appointmentAdapter.startDate, timeZoneCalculator, timeZone)
}
return exceptions.join()
}
return recurrenceException
};
const _convertRecurrenceException = (exceptionString, startDate, timeZoneCalculator, timeZone) => {
exceptionString = exceptionString.replace(/\s/g, "");
const getConvertedToTimeZone = date => timeZoneCalculator.createDate(date, {
path: "toGrid"
});
const exceptionDate = _date_serialization.default.deserializeDate(exceptionString);
const convertedStartDate = getConvertedToTimeZone(startDate);
let convertedExceptionDate = getConvertedToTimeZone(exceptionDate);
convertedExceptionDate = _m_utils_time_zone.default.correctRecurrenceExceptionByTimezone(convertedExceptionDate, convertedStartDate, timeZone);
exceptionString = _date_serialization.default.serializeDate(convertedExceptionDate, "yyyyMMddTHHmmss");
return exceptionString
};
exports._convertRecurrenceException = _convertRecurrenceException;
exports.replaceWrongEndDate = (rawAppointment, startDate, endDate, appointmentDuration, dataAccessors) => {
if (_isEndDateWrong(startDate, endDate)) {
const isAllDay = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "allDay", rawAppointment);
const calculatedEndDate = ((isAllDay, startDate) => {
if (isAllDay) {
return _date.default.setToDayEnd(new Date(startDate))
}
return new Date(startDate.getTime() + appointmentDuration * toMs("minute"))
})(isAllDay, startDate);
dataAccessors.setter.endDate(rawAppointment, calculatedEndDate)
}
};
exports.sortAppointmentsByStartDate = (appointments, dataAccessors) => {
appointments.sort(((a, b) => {
const firstDate = new Date(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", a.settings || a));
const secondDate = new Date(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", b.settings || b));
return Math.sign(firstDate.getTime() - secondDate.getTime())
}))
}
},
99423:
/*!************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_appointment.js ***!
\************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Appointment = exports.AgendaAppointment = void 0;
var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_component */ 13046));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../events/pointer */ 93786));
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _resizable = _interopRequireDefault(__webpack_require__( /*! ../../../ui/resizable */ 46743));
var _m_tooltip = __webpack_require__( /*! ../../ui/tooltip/m_tooltip */ 63508);
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
var _m_expression_utils = __webpack_require__( /*! ../m_expression_utils */ 30906);
var _m_recurrence = __webpack_require__( /*! ../m_recurrence */ 38227);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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")
}
_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(subject, args) {
const observer = this.option("observer");
if (observer) {
observer.fire(subject, args)
}
}
invoke(funcName) {
const observer = this.option("observer");
if (observer) {
return observer.fire.apply(observer, arguments)
}
}
_optionChanged(args) {
switch (args.name) {
case "data":
case "groupIndex":
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._renderEmptyClass();
this._renderReducedAppointment();
this._renderAllDayClass();
this._renderDragSourceClass();
this._renderDirection();
this.$element().data("dxAppointmentStartDate", this.option("startDate"));
const text = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "text", this.rawAppointment);
this.$element().attr("title", text);
this.$element().attr("role", "button");
this._renderRecurrenceClass();
this._renderResizable();
this._setResourceColor()
}
_setResourceColor() {
const appointmentConfig = {
itemData: this.rawAppointment,
groupIndex: this.option("groupIndex"),
groups: this.option("groups")
};
const deferredColor = this.option("getAppointmentColor")(appointmentConfig);
deferredColor.done((color => {
if (color) {
this.coloredElement.css("backgroundColor", color);
this.coloredElement.addClass(_m_classes.APPOINTMENT_HAS_RESOURCE_COLOR_CLASS)
}
}))
}
_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());
const endDate = this._getEndDate();
const tooltipLabel = _message.default.format("dxScheduler-editorLabelEndDate");
const tooltipText = [tooltipLabel, ": ", _date.default.format(endDate, "monthAndDay"), ", ", _date.default.format(endDate, "year")].join("");
_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: tooltipText
})
}));
_events_engine.default.off($icon, REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME);
_events_engine.default.on($icon, REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME, (() => {
(0, _m_tooltip.hide)()
}))
}
_getEndDate() {
const result = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "endDate", this.rawAppointment);
if (result) {
return new Date(result)
}
return result
}
_renderAllDayClass() {
this.$element().toggleClass(_m_classes.ALL_DAY_APPOINTMENT_CLASS, !!this.option("allDay"))
}
_renderDragSourceClass() {
this.$element().toggleClass(_m_classes.APPOINTMENT_DRAG_SOURCE_CLASS, !!this.option("isDragSource"))
}
_renderRecurrenceClass() {
const rule = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "recurrenceRule", this.rawAppointment);
if ((0, _m_recurrence.getRecurrenceProcessor)().isValidRecurrenceRule(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);
exports.AgendaAppointment = class extends Appointment {
get coloredElement() {
return this.$element().find(`.${_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_MARKER}`)
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
createPlainResourceListAsync: new _deferred.Deferred
})
}
_renderResourceList(container, list) {
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();
const createPlainResourceListAsync = this.option("createPlainResourceListAsync");
createPlainResourceListAsync(this.rawAppointment).done((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);
this._renderResourceList(container, list)
}))
}
}
},
16993:
/*!***********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_appointment_collection.js ***!
\***********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _element = __webpack_require__( /*! ../../../core/element */ 6415);
var _element_data = __webpack_require__( /*! ../../../core/element_data */ 97906);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _array = __webpack_require__( /*! ../../../core/utils/array */ 89386);
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _dom = __webpack_require__( /*! ../../../core/utils/dom */ 3532);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _object = __webpack_require__( /*! ../../../core/utils/object */ 48013);
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _double_click = __webpack_require__( /*! ../../../events/double_click */ 85272);
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.edit */ 11050));
var _date2 = __webpack_require__( /*! ../../core/utils/date */ 24321);
var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734);
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_expression_utils = __webpack_require__( /*! ../m_expression_utils */ 30906);
var _m_recurrence = __webpack_require__( /*! ../m_recurrence */ 38227);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880));
var _m_utils = __webpack_require__( /*! ./data_provider/m_utils */ 55523);
var _m_appointment = __webpack_require__( /*! ./m_appointment */ 99423);
var _m_appointment_layout = __webpack_require__( /*! ./m_appointment_layout */ 72417);
var _m_core = __webpack_require__( /*! ./resizing/m_core */ 71687);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const DBLCLICK_EVENT_NAME = (0, _index.addNamespace)(_double_click.name, "dxSchedulerAppointment");
const toMs = _date.default.dateToMilliseconds;
class SchedulerAppointments extends _uiCollection_widget.default {
get isAgendaView() {
return this.invoke("isCurrentViewAgenda")
}
get isVirtualScrolling() {
return this.invoke("isVirtualScrolling")
}
get appointmentDataProvider() {
return this.option("getAppointmentDataProvider")()
}
constructor(element, options) {
super(element, options);
this._virtualAppointments = {}
}
option(optionName, value) {
return super.option(...arguments)
}
notifyObserver(subject, args) {
const observer = this.option("observer");
if (observer) {
observer.fire(subject, args)
}
}
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]
}
const observer = this.option("observer");
if (observer) {
return observer.fire.apply(observer, arguments)
}
}
_dispose() {
clearTimeout(this._appointmentClickTimeout);
super._dispose()
}
_supportedKeys() {
const parent = super._supportedKeys();
const currentAppointment = this._$currentAppointment;
return (0, _extend.extend)(parent, {
escape: function() {
if (this.resizeOccur) {
var _currentAppointment$d, _currentAppointment$d2, _currentAppointment$d3;
this.moveAppointmentBack();
this.resizeOccur = false;
null === (_currentAppointment$d = currentAppointment.dxResizable("instance")) || void 0 === _currentAppointment$d || _currentAppointment$d._detachEventHandlers();
null === (_currentAppointment$d2 = currentAppointment.dxResizable("instance")) || void 0 === _currentAppointment$d2 || _currentAppointment$d2._attachEventHandlers();
null === (_currentAppointment$d3 = currentAppointment.dxResizable("instance")) || void 0 === _currentAppointment$d3 || _currentAppointment$d3._toggleResizingClass(false)
}
}.bind(this),
del: function(e) {
if (this.option("allowDelete")) {
e.preventDefault();
const data = this._getItemData(e.target);
this.notifyObserver("onDeleteButtonPress", {
data: data,
target: e.target
})
}
}.bind(this),
tab: function(e) {
const appointments = this._getAccessAppointments();
const focusedAppointment = appointments.filter(".dx-state-focused");
let index = focusedAppointment.data(_m_constants.APPOINTMENT_SETTINGS_KEY).sortedIndex;
const lastIndex = appointments.length - 1;
if (index > 0 && e.shiftKey || index < lastIndex && !e.shiftKey) {
e.preventDefault();
e.shiftKey ? index-- : index++;
const $nextAppointment = this._getAppointmentByIndex(index);
this._resetTabIndex($nextAppointment);
_events_engine.default.trigger($nextAppointment, "focus")
}
}
})
}
_getAppointmentByIndex(sortedIndex) {
const appointments = this._getAccessAppointments();
return appointments.filter(((_, $item) => (0, _element_data.data)($item, _m_constants.APPOINTMENT_SETTINGS_KEY).sortedIndex === sortedIndex)).eq(0)
}
_getAccessAppointments() {
return this._itemElements().filter(":visible").not(".dx-state-disabled")
}
_resetTabIndex($appointment) {
this._focusTarget().attr("tabIndex", -1);
$appointment.attr("tabIndex", this.option("tabIndex"))
}
_moveFocus() {}
_focusTarget() {
return this._itemElements()
}
_renderFocusTarget() {
const $appointment = this._getAppointmentByIndex(0);
this._resetTabIndex($appointment)
}
_focusInHandler(e) {
super._focusInHandler(e);
this._$currentAppointment = (0, _renderer.default)(e.target);
this.option("focusedElement", (0, _element.getPublicElement)((0, _renderer.default)(e.target)))
}
_focusOutHandler(e) {
const $appointment = this._getAppointmentByIndex(0);
this.option("focusedElement", (0, _element.getPublicElement)($appointment));
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,
_collectorOffset: 0,
groups: [],
resources: []
})
}
_optionChanged(args) {
switch (args.name) {
case "items":
this._cleanFocusState();
this._clearDropDownItems();
this._clearDropDownItemsElements();
this._repaintAppointments(args.value);
this._renderDropDownAppointments();
this._attachAppointmentsEvents();
break;
case "fixedContainer":
case "allDayContainer":
case "onAppointmentDblClick":
case "allowDelete":
break;
case "allowDrag":
case "allowResize":
case "allowAllDayResize":
this._invalidate();
break;
case "focusedElement":
this._resetTabIndex((0, _renderer.default)(args.value));
super._optionChanged(args);
break;
case "focusStateEnabled":
this._clearDropDownItemsElements();
this._renderDropDownAppointments();
super._optionChanged(args);
break;
default:
super._optionChanged(args)
}
}
_isAllDayAppointment(appointment) {
return appointment.settings.length && appointment.settings[0].allDay || false
}
_isRepaintAppointment(appointment) {
return !(0, _type.isDefined)(appointment.needRepaint) || true === appointment.needRepaint
}
_isRepaintAll(appointments) {
if (this.isAgendaView) {
return true
}
for (let i = 0; i < appointments.length; i++) {
if (!this._isRepaintAppointment(appointments[i])) {
return false
}
}
return true
}
_applyFragment(fragment, allDay) {
if (fragment.children().length > 0) {
this._getAppointmentContainer(allDay).append(fragment)
}
}
_onEachAppointment(appointment, index, container, isRepaintAll) {
const repaintAppointment = () => {
appointment.needRepaint = false;
this._clearItem(appointment);
this._renderItem(index, appointment, container)
};
if (true === (null === appointment || void 0 === appointment ? void 0 : appointment.needRemove)) {
this._clearItem(appointment)
} else if (isRepaintAll || this._isRepaintAppointment(appointment)) {
repaintAppointment()
}
}
_repaintAppointments(appointments) {
this._renderByFragments((($commonFragment, $allDayFragment) => {
const isRepaintAll = this._isRepaintAll(appointments);
if (isRepaintAll) {
this._getAppointmentContainer(true).html("");
this._getAppointmentContainer(false).html("")
}!appointments.length && this._cleanItemContainer();
appointments.forEach(((appointment, index) => {
const container = this._isAllDayAppointment(appointment) ? $allDayFragment : $commonFragment;
this._onEachAppointment(appointment, index, container, isRepaintAll)
}))
}))
}
_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))
}
}
_attachAppointmentsEvents() {
this._attachClickEvent();
this._attachHoldEvent();
this._attachContextMenuEvent();
this._attachAppointmentDblClick();
this._renderFocusState();
this._attachFeedbackEvents();
this._attachHoverEvents()
}
_clearItem(item) {
const $items = this._findItemElementByItem(item.itemData);
if (!$items.length) {
return
}(0, _iterator.each)($items, ((_, $item) => {
$item.detach();
$item.remove()
}))
}
_clearDropDownItems() {
this._virtualAppointments = {}
}
_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()
}
this._virtualAppointments = {}
}
_clean() {
super._clean();
delete this._$currentAppointment;
delete this._initialSize;
delete this._initialCoordinates
}
_init() {
super._init();
this.$element().addClass("dx-scheduler-scrollable-appointments");
this._preventSingleAppointmentClick = false
}
_renderAppointmentTemplate($container, appointment, model) {
var _this$_currentAppoint;
const config = {
isAllDay: appointment.allDay,
isRecurrence: appointment.recurrenceRule,
html: (0, _type.isPlainObject)(appointment) && appointment.html ? appointment.html : void 0
};
const formatText = this.invoke("getTextAndFormatDate", model.appointmentData, (null === (_this$_currentAppoint = this._currentAppointmentSettings) || void 0 === _this$_currentAppoint ? void 0 : _this$_currentAppoint.agendaSettings) || model.targetedAppointmentData, "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 ("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) {
const {
itemData: itemData
} = item;
const $items = [];
for (let i = 0; i < item.settings.length; i++) {
const setting = item.settings[i];
this._currentAppointmentSettings = setting;
const $item = super._renderItem(index, itemData, container);
$item.data(_m_constants.APPOINTMENT_SETTINGS_KEY, setting);
$items.push($item)
}
return $items
}
_getItemContent($itemFrame) {
$itemFrame.data(_m_constants.APPOINTMENT_SETTINGS_KEY, this._currentAppointmentSettings);
const $itemContent = super._getItemContent($itemFrame);
return $itemContent
}
_createItemByTemplate(itemTemplate, renderArgs) {
const {
itemData: itemData,
container: container,
index: index
} = renderArgs;
return itemTemplate.render({
model: {
appointmentData: itemData,
targetedAppointmentData: this.invoke("getTargetedAppointmentData", itemData, (0, _renderer.default)(container).parent())
},
container: container,
index: index
})
}
_getAppointmentContainer(allDay) {
const $allDayContainer = this.option("allDayContainer");
let $container = this.itemsContainer().not($allDayContainer);
if (allDay && $allDayContainer) {
$container = $allDayContainer
}
return $container
}
_postprocessRenderItem(args) {
this._renderAppointment(args.itemElement, this._currentAppointmentSettings)
}
_renderAppointment(element, settings) {
element.data(_m_constants.APPOINTMENT_SETTINGS_KEY, settings);
this._applyResourceDataAttr(element);
const rawAppointment = this._getItemData(element);
const geometry = this.invoke("getAppointmentGeometry", settings);
const allowResize = this.option("allowResize") && (!(0, _type.isDefined)(settings.skipResizing) || (0, _type.isString)(settings.skipResizing));
const allowDrag = this.option("allowDrag");
const {
allDay: allDay
} = settings;
this.invoke("setCellDataCacheAlias", this._currentAppointmentSettings, geometry);
if (settings.virtual) {
const appointmentConfig = {
itemData: rawAppointment,
groupIndex: settings.groupIndex,
groups: this.option("groups")
};
const deferredColor = this.option("getAppointmentColor")(appointmentConfig);
this._processVirtualAppointment(settings, element, rawAppointment, deferredColor)
} else {
var _settings$info;
const config = {
data: rawAppointment,
groupIndex: settings.groupIndex,
observer: this.option("observer"),
geometry: geometry,
direction: settings.direction || "vertical",
allowResize: allowResize,
allowDrag: allowDrag,
allDay: allDay,
reduced: settings.appointmentReduced,
isCompact: settings.isCompact,
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(rawAppointment, settings),
groups: this.option("groups"),
getAppointmentColor: this.option("getAppointmentColor"),
getResourceDataAccessors: this.option("getResourceDataAccessors")
};
if (this.isAgendaView) {
const agendaResourceProcessor = this.option("getAgendaResourceProcessor")();
config.createPlainResourceListAsync = rawAppointment => agendaResourceProcessor.createListAsync(rawAppointment)
}
this._createComponent(element, this.isAgendaView ? _m_appointment.AgendaAppointment : _m_appointment.Appointment, _extends({}, config, {
dataAccessors: this.option("dataAccessors"),
getResizableStep: this.option("getResizableStep")
}))
}
}
_applyResourceDataAttr($appointment) {
const dataAccessors = this.option("getResourceDataAccessors")();
const rawAppointment = this._getItemData($appointment);
(0, _iterator.each)(dataAccessors.getter, (key => {
const value = dataAccessors.getter[key](rawAppointment);
if ((0, _type.isDefined)(value)) {
const prefix = `data-${(0,_common.normalizeKey)(key.toLowerCase())}-`;
(0, _array.wrapToArray)(value).forEach((value => $appointment.attr(prefix + (0, _common.normalizeKey)(value), true)))
}
}))
}
_resizableConfig(appointmentData, itemSetting) {
return {
area: this._calculateResizableArea(itemSetting, appointmentData),
onResizeStart: function(e) {
this.resizeOccur = true;
this._$currentAppointment = (0, _renderer.default)(e.element);
if (this.invoke("needRecalculateResizableArea")) {
const updatedArea = this._calculateResizableArea(this._$currentAppointment.data(_m_constants.APPOINTMENT_SETTINGS_KEY), this._$currentAppointment.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)(this._$currentAppointment)
}.bind(this),
onResizeEnd: function(e) {
this.resizeOccur = false;
this._resizeEndHandler(e)
}.bind(this)
}
}
_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("dxAppointmentSettings");
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.option("dataAccessors"), this.option("timeZoneCalculator"))
}
resizeAllDay(e) {
const $element = (0, _renderer.default)(e.element);
const timeZoneCalculator = this.option("timeZoneCalculator");
const dataAccessors = this.option("dataAccessors");
return (0, _m_core.getAppointmentDateRange)({
handles: e.handles,
appointmentSettings: $element.data("dxAppointmentSettings"),
isVerticalViewDirection: this.option("isVerticalViewDirection")(),
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: dataAccessors,
rtlEnabled: this.option("rtlEnabled"),
DOMMetaData: this.option("getDOMElementsMetaData")(),
viewOffset: this.invoke("getViewOffsetMs")
})
}
updateResizedAppointment($element, dateRange, dataAccessors, timeZoneCalculator) {
const sourceAppointment = this._getItemData($element);
const modifiedAppointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(sourceAppointment, dataAccessors, timeZoneCalculator).clone();
modifiedAppointmentAdapter.startDate = new Date(dateRange.startDate);
modifiedAppointmentAdapter.endDate = new Date(dateRange.endDate);
this.notifyObserver("updateAppointmentAfterResize", {
target: sourceAppointment,
data: modifiedAppointmentAdapter.clone({
pathTimeZone: "fromGrid"
}).source(),
$appointment: $element
})
}
_getEndResizeAppointmentStartDate(e, rawAppointment, appointmentInfo) {
const timeZoneCalculator = this.option("timeZoneCalculator");
const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.option("dataAccessors"), timeZoneCalculator);
let {
startDate: startDate
} = appointmentInfo;
const recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)();
const {
recurrenceRule: recurrenceRule,
startDateTimeZone: startDateTimeZone
} = appointmentAdapter;
const isAllDay = this.invoke("isAllDay", rawAppointment);
const isRecurrent = recurrenceProcessor.isValidRecurrenceRule(recurrenceRule);
if (!e.handles.top && !isRecurrent && !isAllDay) {
startDate = timeZoneCalculator.createDate(appointmentAdapter.startDate, {
appointmentTimeZone: startDateTimeZone,
path: "toGrid"
})
}
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
}
_processVirtualAppointment(appointmentSetting, $appointment, appointmentData, color) {
const virtualAppointment = appointmentSetting.virtual;
const virtualGroupIndex = virtualAppointment.index;
if (!(0, _type.isDefined)(this._virtualAppointments[virtualGroupIndex])) {
this._virtualAppointments[virtualGroupIndex] = {
coordinates: {
top: virtualAppointment.top,
left: virtualAppointment.left
},
items: {
data: [],
colors: [],
settings: []
},
isAllDay: !!virtualAppointment.isAllDay,
buttonColor: color
}
}
appointmentSetting.targetedAppointmentData = this.invoke("getTargetedAppointmentData", appointmentData, $appointment);
this._virtualAppointments[virtualGroupIndex].items.settings.push(appointmentSetting);
this._virtualAppointments[virtualGroupIndex].items.data.push(appointmentData);
this._virtualAppointments[virtualGroupIndex].items.colors.push(color);
$appointment.remove()
}
_renderContentImpl() {
super._renderContentImpl();
this._renderDropDownAppointments()
}
_renderDropDownAppointments() {
this._renderByFragments((($commonFragment, $allDayFragment) => {
(0, _iterator.each)(this._virtualAppointments, (groupIndex => {
const virtualGroup = this._virtualAppointments[groupIndex];
const virtualItems = virtualGroup.items;
const virtualCoordinates = virtualGroup.coordinates;
const $fragment = virtualGroup.isAllDay ? $allDayFragment : $commonFragment;
const {
left: left
} = virtualCoordinates;
const buttonWidth = this.invoke("getDropDownAppointmentWidth", virtualGroup.isAllDay);
const buttonHeight = this.invoke("getDropDownAppointmentHeight");
const rtlOffset = this.option("rtlEnabled") ? buttonWidth : 0;
this.notifyObserver("renderCompactAppointments", {
$container: $fragment,
coordinates: {
top: virtualCoordinates.top,
left: left + rtlOffset
},
items: virtualItems,
buttonColor: virtualGroup.buttonColor,
width: buttonWidth - this.option("_collectorOffset"),
height: buttonHeight,
onAppointmentClick: this.option("onItemClick"),
allowDrag: this.option("allowDrag"),
cellWidth: this.invoke("getCellWidth"),
isCompact: this.invoke("isAdaptive") || this._isGroupCompact(virtualGroup)
})
}))
}))
}
_isGroupCompact(virtualGroup) {
return !virtualGroup.isAllDay && this.invoke("supportCompactDropDownAppointments")
}
_sortAppointmentsByStartDate(appointments) {
return (0, _m_utils.sortAppointmentsByStartDate)(appointments, this.option("dataAccessors"))
}
_processRecurrenceAppointment(appointment, index, skipLongAppointments) {
const recurrenceRule = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "recurrenceRule", appointment);
const result = {
parts: [],
indexes: []
};
if (recurrenceRule) {
const dates = appointment.settings || appointment;
const startDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "startDate", dates));
const startDateTimeZone = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "startDateTimeZone", appointment);
const endDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "endDate", dates));
const appointmentDuration = endDate.getTime() - startDate.getTime();
const recurrenceException = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "recurrenceException", appointment);
const startViewDate = this.invoke("getStartViewDate");
const endViewDate = this.invoke("getEndViewDate");
const timezoneCalculator = this.option("timeZoneCalculator");
const recurrentDates = (0, _m_recurrence.getRecurrenceProcessor)().generateDates({
rule: recurrenceRule,
exception: recurrenceException,
start: startDate,
end: endDate,
min: startViewDate,
max: endViewDate,
appointmentTimezoneOffset: timezoneCalculator.getOriginStartDateOffsetInMs(startDate, startDateTimeZone, false)
});
const recurrentDateCount = appointment.settings ? 1 : recurrentDates.length;
for (let i = 0; i < recurrentDateCount; i++) {
const appointmentPart = (0, _extend.extend)({}, appointment, true);
if (recurrentDates[i]) {
const appointmentSettings = this._applyStartDateToObj(recurrentDates[i], {});
this._applyEndDateToObj(new Date(recurrentDates[i].getTime() + appointmentDuration), appointmentSettings);
appointmentPart.settings = appointmentSettings
} else {
appointmentPart.settings = dates
}
result.parts.push(appointmentPart);
if (!skipLongAppointments) {
this._processLongAppointment(appointmentPart, result)
}
}
result.indexes.push(index)
}
return result
}
_processLongAppointment(appointment, result) {
const parts = this.splitAppointmentByDay(appointment);
const partCount = parts.length;
const endViewDate = this.invoke("getEndViewDate").getTime();
const startViewDate = this.invoke("getStartViewDate").getTime();
const timeZoneCalculator = this.option("timeZoneCalculator");
result = result || {
parts: []
};
if (partCount > 1) {
(0, _extend.extend)(appointment, parts[0]);
for (let i = 1; i < partCount; i++) {
let startDate = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "startDate", parts[i].settings).getTime();
startDate = timeZoneCalculator.createDate(startDate, {
path: "toGrid"
});
if (startDate < endViewDate && startDate > startViewDate) {
result.parts.push(parts[i])
}
}
}
return result
}
_reduceRecurrenceAppointments(recurrenceIndexes, appointments) {
(0, _iterator.each)(recurrenceIndexes, ((i, index) => {
appointments.splice(index - i, 1)
}))
}
_combineAppointments(appointments, additionalAppointments) {
if (additionalAppointments.length) {
appointments.push(...additionalAppointments)
}
this._sortAppointmentsByStartDate(appointments)
}
_applyStartDateToObj(startDate, obj) {
_m_expression_utils.ExpressionUtils.setField(this.option("dataAccessors"), "startDate", obj, startDate);
return obj
}
_applyEndDateToObj(endDate, obj) {
_m_expression_utils.ExpressionUtils.setField(this.option("dataAccessors"), "endDate", obj, endDate);
return obj
}
moveAppointmentBack(dragEvent) {
const $appointment = this._$currentAppointment;
const size = this._initialSize;
const coords = this._initialCoordinates;
if (dragEvent) {
this._removeDragSourceClassFromDraggedAppointment();
if ((0, _type.isDeferred)(dragEvent.cancel)) {
dragEvent.cancel.resolve(true)
} else {
dragEvent.cancel = true
}
}
if ($appointment && !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() {
if (this._$currentAppointment) {
const focusedElement = (0, _element.getPublicElement)(this._$currentAppointment);
this.option("focusedElement", focusedElement);
_events_engine.default.trigger(focusedElement, "focus")
}
}
splitAppointmentByDay(appointment) {
const dates = appointment.settings || appointment;
const dataAccessors = this.option("dataAccessors");
const originalStartDate = new Date(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", dates));
let startDate = _date.default.makeDate(originalStartDate);
let endDate = _date.default.makeDate(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "endDate", dates));
const maxAllowedDate = this.invoke("getEndViewDate");
const startDayHour = this.invoke("getStartDayHour");
const endDayHour = this.invoke("getEndDayHour");
const timeZoneCalculator = this.option("timeZoneCalculator");
const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, dataAccessors, timeZoneCalculator);
const appointmentIsLong = (0, _m_utils.getAppointmentTakesSeveralDays)(adapter);
const result = [];
startDate = timeZoneCalculator.createDate(startDate, {
path: "toGrid"
});
endDate = timeZoneCalculator.createDate(endDate, {
path: "toGrid"
});
if (startDate.getHours() <= endDayHour && startDate.getHours() >= startDayHour && !appointmentIsLong) {
result.push(this._applyStartDateToObj(new Date(startDate), {
appointmentData: appointment
}));
startDate.setDate(startDate.getDate() + 1)
}
while (appointmentIsLong && startDate.getTime() < endDate.getTime() && startDate < maxAllowedDate) {
const currentStartDate = new Date(startDate);
const currentEndDate = new Date(startDate);
this._checkStartDate(currentStartDate, originalStartDate, startDayHour);
this._checkEndDate(currentEndDate, endDate, endDayHour);
const appointmentData = (0, _object.deepExtendArraySafe)({}, appointment, true);
const appointmentSettings = {};
this._applyStartDateToObj(currentStartDate, appointmentSettings);
this._applyEndDateToObj(currentEndDate, appointmentSettings);
appointmentData.settings = appointmentSettings;
result.push(appointmentData);
startDate = _date.default.trimTime(startDate);
startDate.setDate(startDate.getDate() + 1);
startDate.setHours(startDayHour)
}
return result
}
_checkStartDate(currentDate, originalDate, startDayHour) {
if (!_date.default.sameDate(currentDate, originalDate) || currentDate.getHours() <= startDayHour) {
currentDate.setHours(startDayHour, 0, 0, 0)
} else {
currentDate.setHours(originalDate.getHours(), originalDate.getMinutes(), originalDate.getSeconds(), originalDate.getMilliseconds())
}
}
_checkEndDate(currentDate, originalDate, endDayHour) {
if (!_date.default.sameDate(currentDate, originalDate) || currentDate.getHours() > endDayHour) {
currentDate.setHours(endDayHour, 0, 0, 0)
} else {
currentDate.setHours(originalDate.getHours(), originalDate.getMinutes(), originalDate.getSeconds(), originalDate.getMilliseconds())
}
}
_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(_m_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
},
72417:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_appointment_layout.js ***!
\*******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createAppointmentLayout = exports.createAgendaAppointmentLayout = void 0;
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const allDayText = ` ${_message.default.format("dxScheduler-allDay")}: `;
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`).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`).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
}
},
70325:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_cell_position_calculator.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CellPositionCalculator = void 0;
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _date = __webpack_require__( /*! ../../core/utils/date */ 24321);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class BaseStrategy {
constructor(options) {
this.isVirtualScrolling = false;
this.options = options
}
get DOMMetaData() {
return this.options.DOMMetaData
}
get appointments() {
return this.options.dateSettings
}
get viewDataProvider() {
return this.options.viewDataProvider
}
get positionHelper() {
return this.options.positionHelper
}
get startViewDate() {
return this.options.startViewDate
}
get viewStartDayHour() {
return this.options.viewStartDayHour
}
get viewEndDayHour() {
return this.options.viewEndDayHour
}
get cellDuration() {
return this.options.cellDuration
}
get getPositionShift() {
return this.options.getPositionShiftCallback
}
get groupCount() {
return this.options.groupCount
}
get rtlEnabled() {
return this.options.rtlEnabled
}
get isVerticalGrouping() {
return this.options.isVerticalGroupOrientation
}
get showAllDayPanel() {
return this.options.showAllDayPanel
}
get supportAllDayRow() {
return this.options.supportAllDayRow
}
get isGroupedAllDayPanel() {
return this.options.isGroupedAllDayPanel
}
calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) {
const result = [];
this.appointments.forEach(((dateSetting, index) => {
const coordinates = this.getCoordinateInfos({
appointment: dateSetting,
groupIndices: groupIndices,
isAllDayRowAppointment: isAllDayRowAppointment,
isRecurrentAppointment: isRecurrentAppointment
});
coordinates.forEach((item => {
!!item && result.push(this._prepareObject(item, index))
}))
}));
return result
}
getCoordinateInfos(options) {
const {
appointment: appointment,
isAllDayRowAppointment: isAllDayRowAppointment,
groupIndices: groupIndices,
recurrent: recurrent
} = options;
const {
startDate: startDate
} = appointment;
const groupIndex = !recurrent ? appointment.source.groupIndex : void 0;
return this.getCoordinatesByDateInGroup(startDate, groupIndices, isAllDayRowAppointment, groupIndex)
}
_prepareObject(position, dateSettingIndex) {
position.dateSettingIndex = dateSettingIndex;
return {
coordinates: position,
dateSettingIndex: dateSettingIndex
}
}
getCoordinatesByDate(date, groupIndex, inAllDayRow) {
const validGroupIndex = groupIndex || 0;
const cellInfo = {
groupIndex: validGroupIndex,
startDate: date,
isAllDay: inAllDayRow
};
const positionByMap = this.viewDataProvider.findCellPositionInMap(cellInfo, true);
if (!positionByMap) {
return
}
const position = this.getCellPosition(positionByMap, inAllDayRow && !this.isVerticalGrouping);
const groupEdgeIndices = this.viewDataProvider.getGroupEdgeIndices(validGroupIndex);
const {
top: vMin
} = this.getCellPosition({
columnIndex: positionByMap.columnIndex,
rowIndex: groupEdgeIndices.firstRowIndex
}, inAllDayRow && !this.isVerticalGrouping);
const timeShift = inAllDayRow ? 0 : this.getTimeShiftRatio(positionByMap, date);
const shift = this.getPositionShift(timeShift, inAllDayRow);
const horizontalHMax = this.positionHelper.getHorizontalMax(validGroupIndex, date);
const verticalMax = this.positionHelper.getVerticalMax({
groupIndex: validGroupIndex,
isVirtualScrolling: this.isVirtualScrolling,
showAllDayPanel: this.showAllDayPanel,
supportAllDayRow: this.supportAllDayRow,
isGroupedAllDayPanel: this.isGroupedAllDayPanel,
isVerticalGrouping: this.isVerticalGrouping
});
return {
positionByMap: positionByMap,
cellPosition: position.left + shift.cellPosition,
top: position.top + shift.top,
left: position.left + shift.left,
rowIndex: position.rowIndex,
columnIndex: position.columnIndex,
hMax: horizontalHMax,
vMax: verticalMax,
vMin: vMin,
groupIndex: validGroupIndex
}
}
getCoordinatesByDateInGroup(startDate, groupIndices, inAllDayRow, groupIndex) {
const result = [];
if (this.viewDataProvider.isSkippedDate(startDate)) {
return result
}
let validGroupIndices = [groupIndex];
if (!(0, _type.isDefined)(groupIndex)) {
validGroupIndices = this.groupCount ? groupIndices : [0]
}
validGroupIndices.forEach((groupIndex => {
const coordinates = this.getCoordinatesByDate(startDate, groupIndex, inAllDayRow);
if (coordinates) {
result.push(coordinates)
}
}));
return result
}
getCellPosition(cellCoordinates, isAllDayPanel) {
const {
dateTableCellsMeta: dateTableCellsMeta,
allDayPanelCellsMeta: allDayPanelCellsMeta
} = this.DOMMetaData;
const {
columnIndex: columnIndex,
rowIndex: rowIndex
} = cellCoordinates;
const position = isAllDayPanel ? allDayPanelCellsMeta[columnIndex] : dateTableCellsMeta[rowIndex][columnIndex];
const validPosition = _extends({}, position);
if (this.rtlEnabled) {
validPosition.left += position.width
}
if (validPosition) {
validPosition.rowIndex = cellCoordinates.rowIndex;
validPosition.columnIndex = cellCoordinates.columnIndex
}
return validPosition
}
getTimeShiftRatio(positionByMap, appointmentDate) {
const {
cellDuration: cellDuration,
viewOffset: viewOffset
} = this.options;
const {
rowIndex: rowIndex,
columnIndex: columnIndex
} = positionByMap;
const matchedCell = this.viewDataProvider.viewDataMap.dateTableMap[rowIndex][columnIndex];
const matchedCellStartDate = _date.dateUtilsTs.addOffsets(matchedCell.cellData.startDate, [-viewOffset]);
const result = (appointmentDate.getTime() - matchedCellStartDate.getTime()) / cellDuration;
return result % 1
}
}
class VirtualStrategy extends BaseStrategy {
constructor() {
super(...arguments);
this.isVirtualScrolling = true
}
calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) {
const appointments = isAllDayRowAppointment ? this.appointments : this.appointments.filter((_ref => {
let {
source: source,
startDate: startDate,
endDate: endDate
} = _ref;
return this.viewDataProvider.isGroupIntersectDateInterval(source.groupIndex, startDate, endDate)
}));
if (isRecurrentAppointment) {
return this.createRecurrentAppointmentInfos(appointments, isAllDayRowAppointment)
}
return super.calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment)
}
createRecurrentAppointmentInfos(dateSettings, isAllDayRowAppointment) {
const result = [];
dateSettings.forEach(((_ref2, index) => {
let {
source: source,
startDate: startDate
} = _ref2;
const coordinate = this.getCoordinatesByDate(startDate, source.groupIndex, isAllDayRowAppointment);
if (coordinate) {
result.push(this._prepareObject(coordinate, index))
}
}));
return result
}
}
exports.CellPositionCalculator = class {
constructor(options) {
this.options = options
}
calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) {
const strategy = this.options.isVirtualScrolling ? new VirtualStrategy(this.options) : new BaseStrategy(this.options);
return strategy.calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment)
}
}
},
24099:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_settings_generator.js ***!
\*******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateGeneratorVirtualStrategy = exports.DateGeneratorBaseStrategy = exports.AppointmentSettingsGenerator = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _date2 = __webpack_require__( /*! ../../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734);
var _m_expression_utils = __webpack_require__( /*! ../m_expression_utils */ 30906);
var _m_recurrence = __webpack_require__( /*! ../m_recurrence */ 38227);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880));
var _m_utils = __webpack_require__( /*! ../resources/m_utils */ 31359);
var _m_cell_position_calculator = __webpack_require__( /*! ./m_cell_position_calculator */ 70325);
var _m_text_utils = __webpack_require__( /*! ./m_text_utils */ 18775);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
class DateGeneratorBaseStrategy {
constructor(options) {
this.options = options
}
get rawAppointment() {
return this.options.rawAppointment
}
get timeZoneCalculator() {
return this.options.timeZoneCalculator
}
get viewDataProvider() {
return this.options.viewDataProvider
}
get appointmentTakesAllDay() {
return this.options.appointmentTakesAllDay
}
get supportAllDayRow() {
return this.options.supportAllDayRow
}
get isAllDayRowAppointment() {
return this.options.isAllDayRowAppointment
}
get timeZone() {
return this.options.timeZone
}
get dateRange() {
return this.options.dateRange
}
get firstDayOfWeek() {
return this.options.firstDayOfWeek
}
get viewStartDayHour() {
return this.options.viewStartDayHour
}
get viewEndDayHour() {
return this.options.viewEndDayHour
}
get endViewDate() {
return this.options.endViewDate
}
get viewType() {
return this.options.viewType
}
get isGroupedByDate() {
return this.options.isGroupedByDate
}
get isVerticalOrientation() {
return this.options.isVerticalGroupOrientation
}
get dataAccessors() {
return this.options.dataAccessors
}
get loadedResources() {
return this.options.loadedResources
}
get isDateAppointment() {
return !(0, _index.isDateAndTimeView)(this.viewType) && this.appointmentTakesAllDay
}
getIntervalDuration() {
return this.appointmentTakesAllDay ? this.options.allDayIntervalDuration : this.options.intervalDuration
}
generate(appointmentAdapter) {
const {
isRecurrent: isRecurrent
} = appointmentAdapter;
const itemGroupIndices = this._getGroupIndices(this.rawAppointment);
let appointmentList = this._createAppointments(appointmentAdapter, itemGroupIndices);
appointmentList = this._getProcessedByAppointmentTimeZone(appointmentList, appointmentAdapter);
if (this._canProcessNotNativeTimezoneDates(appointmentAdapter)) {
appointmentList = this._getProcessedNotNativeTimezoneDates(appointmentList, appointmentAdapter)
}
let dateSettings = this._createGridAppointmentList(appointmentList, appointmentAdapter);
const firstViewDates = this._getAppointmentsFirstViewDate(dateSettings);
dateSettings = this._fillNormalizedStartDate(dateSettings, firstViewDates);
dateSettings = this._cropAppointmentsByStartDayHour(dateSettings, firstViewDates);
dateSettings = this._fillNormalizedEndDate(dateSettings, this.rawAppointment);
if (this._needSeparateLongParts()) {
dateSettings = this._separateLongParts(dateSettings, appointmentAdapter)
}
dateSettings = this.shiftSourceAppointmentDates(dateSettings);
return {
dateSettings: dateSettings,
itemGroupIndices: itemGroupIndices,
isRecurrent: isRecurrent
}
}
shiftSourceAppointmentDates(dateSettings) {
const {
viewOffset: viewOffset
} = this.options;
return dateSettings.map((item => _extends({}, item, {
source: _extends({}, item.source, {
startDate: _date2.dateUtilsTs.addOffsets(item.source.startDate, [viewOffset]),
endDate: _date2.dateUtilsTs.addOffsets(item.source.endDate, [viewOffset])
})
})))
}
_getProcessedByAppointmentTimeZone(appointmentList, appointment) {
const hasAppointmentTimeZone = !(0, _type.isEmptyObject)(appointment.startDateTimeZone) || !(0, _type.isEmptyObject)(appointment.endDateTimeZone);
if (hasAppointmentTimeZone) {
const appointmentOffsets = {
startDate: this.timeZoneCalculator.getOffsets(appointment.startDate, appointment.startDateTimeZone),
endDate: this.timeZoneCalculator.getOffsets(appointment.endDate, appointment.endDateTimeZone)
};
appointmentList.forEach((a => {
const sourceOffsets_startDate = this.timeZoneCalculator.getOffsets(a.startDate, appointment.startDateTimeZone),
sourceOffsets_endDate = this.timeZoneCalculator.getOffsets(a.endDate, appointment.endDateTimeZone);
const startDateOffsetDiff = appointmentOffsets.startDate.appointment - sourceOffsets_startDate.appointment;
const endDateOffsetDiff = appointmentOffsets.endDate.appointment - sourceOffsets_endDate.appointment;
if (sourceOffsets_startDate.appointment !== sourceOffsets_startDate.common) {
a.startDate = new Date(a.startDate.getTime() + startDateOffsetDiff * toMs("hour"))
}
if (sourceOffsets_endDate.appointment !== sourceOffsets_endDate.common) {
a.endDate = new Date(a.endDate.getTime() + endDateOffsetDiff * toMs("hour"))
}
}))
}
return appointmentList
}
_createAppointments(appointment, groupIndices) {
let appointments = this._createRecurrenceAppointments(appointment, groupIndices);
if (!appointment.isRecurrent && 0 === appointments.length) {
appointments.push({
startDate: appointment.startDate,
endDate: appointment.endDate
})
}
appointments = appointments.map((item => {
var _item$endDate;
const resultEndTime = null === (_item$endDate = item.endDate) || void 0 === _item$endDate ? void 0 : _item$endDate.getTime();
if (item.startDate.getTime() === resultEndTime) {
item.endDate.setTime(resultEndTime + toMs("minute"))
}
return _extends({}, item, {
exceptionDate: new Date(item.startDate)
})
}));
return appointments
}
_canProcessNotNativeTimezoneDates(appointment) {
const isTimeZoneSet = !(0, _type.isEmptyObject)(this.timeZone);
if (!isTimeZoneSet) {
return false
}
if (!appointment.isRecurrent) {
return false
}
return !_m_utils_time_zone.default.isEqualLocalTimeZone(this.timeZone, appointment.startDate)
}
_getProcessedNotNativeDateIfCrossDST(date, offset) {
if (offset < 0) {
const newDate = new Date(date);
const newDateMinusOneHour = new Date(newDate);
newDateMinusOneHour.setHours(newDateMinusOneHour.getHours() - 1);
const newDateOffset = this.timeZoneCalculator.getOffsets(newDate).common;
const newDateMinusOneHourOffset = this.timeZoneCalculator.getOffsets(newDateMinusOneHour).common;
if (newDateOffset !== newDateMinusOneHourOffset) {
return 0
}
}
return offset
}
_getCommonOffset(date) {
return this.timeZoneCalculator.getOffsets(date).common
}
_getProcessedNotNativeTimezoneDates(appointmentList, appointment) {
return appointmentList.map((item => {
let diffStartDateOffset = this._getCommonOffset(appointment.startDate) - this._getCommonOffset(item.startDate);
let diffEndDateOffset = this._getCommonOffset(appointment.endDate) - this._getCommonOffset(item.endDate);
if (0 === diffStartDateOffset && 0 === diffEndDateOffset) {
return item
}
diffStartDateOffset = this._getProcessedNotNativeDateIfCrossDST(item.startDate, diffStartDateOffset);
diffEndDateOffset = this._getProcessedNotNativeDateIfCrossDST(item.endDate, diffEndDateOffset);
const newStartDate = new Date(item.startDate.getTime() + diffStartDateOffset * toMs("hour"));
let newEndDate = new Date(item.endDate.getTime() + diffEndDateOffset * toMs("hour"));
const testNewStartDate = this.timeZoneCalculator.createDate(newStartDate, {
path: "toGrid"
});
const testNewEndDate = this.timeZoneCalculator.createDate(newEndDate, {
path: "toGrid"
});
if (appointment.duration > testNewEndDate.getTime() - testNewStartDate.getTime()) {
newEndDate = new Date(newStartDate.getTime() + appointment.duration)
}
return _extends({}, item, {
startDate: newStartDate,
endDate: newEndDate,
exceptionDate: new Date(newStartDate)
})
}))
}
_needSeparateLongParts() {
return this.isVerticalOrientation ? this.isGroupedByDate : this.isGroupedByDate && this.appointmentTakesAllDay
}
normalizeEndDateByViewEnd(rawAppointment, endDate) {
let result = new Date(endDate.getTime());
const isAllDay = (0, _index.isDateAndTimeView)(this.viewType) && this.appointmentTakesAllDay;
if (!isAllDay) {
const roundedEndViewDate = _date.default.roundToHour(this.endViewDate);
if (result > roundedEndViewDate) {
result = roundedEndViewDate
}
}
const endDayHour = this.viewEndDayHour;
const allDay = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", rawAppointment);
const currentViewEndTime = new Date(new Date(endDate.getTime()).setHours(endDayHour, 0, 0, 0));
if (result.getTime() > currentViewEndTime.getTime() || allDay && result.getHours() < endDayHour) {
result = currentViewEndTime
}
return result
}
_fillNormalizedEndDate(dateSettings, rawAppointment) {
return dateSettings.map((item => _extends({}, item, {
normalizedEndDate: this.normalizeEndDateByViewEnd(rawAppointment, item.endDate)
})))
}
_separateLongParts(gridAppointmentList, appointmentAdapter) {
let result = [];
gridAppointmentList.forEach((gridAppointment => {
const maxDate = new Date(this.dateRange[1]);
const {
startDate: startDate,
normalizedEndDate: endDateOfPart
} = gridAppointment;
const longStartDateParts = _date.default.getDatesOfInterval(startDate, endDateOfPart, {
milliseconds: this.getIntervalDuration()
});
const list = longStartDateParts.filter((startDatePart => new Date(startDatePart) < maxDate)).map((date => {
const endDate = new Date(new Date(date).setMilliseconds(appointmentAdapter.duration));
const normalizedEndDate = this.normalizeEndDateByViewEnd(this.rawAppointment, endDate);
return {
startDate: date,
endDate: endDate,
normalizedEndDate: normalizedEndDate,
source: gridAppointment.source
}
}));
result = result.concat(list)
}));
return result
}
_createGridAppointmentList(appointmentList, appointmentAdapter) {
return appointmentList.map((source => {
const offsetDifference = appointmentAdapter.startDate.getTimezoneOffset() - source.startDate.getTimezoneOffset();
if (0 !== offsetDifference && this._canProcessNotNativeTimezoneDates(appointmentAdapter)) {
source.startDate = _date2.dateUtilsTs.addOffsets(source.startDate, [offsetDifference * toMs("minute")]);
source.endDate = _date2.dateUtilsTs.addOffsets(source.endDate, [offsetDifference * toMs("minute")]);
source.exceptionDate = new Date(source.startDate)
}
const duration = source.endDate.getTime() - source.startDate.getTime();
const startDate = this.timeZoneCalculator.createDate(source.startDate, {
path: "toGrid"
});
const endDate = _date2.dateUtilsTs.addOffsets(startDate, [duration]);
return {
startDate: startDate,
endDate: endDate,
allDay: appointmentAdapter.allDay || false,
source: source
}
}))
}
_createExtremeRecurrenceDates(groupIndex) {
let startViewDate = this.appointmentTakesAllDay ? _date.default.trimTime(this.dateRange[0]) : this.dateRange[0];
let endViewDateByEndDayHour = this.dateRange[1];
if (this.timeZone) {
startViewDate = this.timeZoneCalculator.createDate(startViewDate, {
path: "fromGrid"
});
endViewDateByEndDayHour = this.timeZoneCalculator.createDate(endViewDateByEndDayHour, {
path: "fromGrid"
});
const daylightOffset = _m_utils_time_zone.default.getDaylightOffsetInMs(startViewDate, endViewDateByEndDayHour);
if (daylightOffset) {
endViewDateByEndDayHour = new Date(endViewDateByEndDayHour.getTime() + daylightOffset)
}
}
return [startViewDate, endViewDateByEndDayHour]
}
_createRecurrenceOptions(appointment, groupIndex) {
const {
viewOffset: viewOffset
} = this.options;
const originalAppointmentStartDate = _date2.dateUtilsTs.addOffsets(appointment.startDate, [viewOffset]);
const originalAppointmentEndDate = _date2.dateUtilsTs.addOffsets(appointment.endDate, [viewOffset]);
const [minRecurrenceDate, maxRecurrenceDate] = this._createExtremeRecurrenceDates(groupIndex);
const shiftedMinRecurrenceDate = _date2.dateUtilsTs.addOffsets(minRecurrenceDate, [viewOffset]);
const shiftedMaxRecurrenceDate = _date2.dateUtilsTs.addOffsets(maxRecurrenceDate, [viewOffset]);
return {
rule: appointment.recurrenceRule,
exception: appointment.recurrenceException,
min: shiftedMinRecurrenceDate,
max: shiftedMaxRecurrenceDate,
firstDayOfWeek: this.firstDayOfWeek,
start: originalAppointmentStartDate,
end: originalAppointmentEndDate,
appointmentTimezoneOffset: this.timeZoneCalculator.getOriginStartDateOffsetInMs(originalAppointmentStartDate, appointment.rawAppointment.startDateTimeZone, true),
getPostProcessedException: date => {
if ((0, _type.isEmptyObject)(this.timeZone) || _m_utils_time_zone.default.isEqualLocalTimeZone(this.timeZone, date)) {
return date
}
const appointmentOffset = this.timeZoneCalculator.getOffsets(originalAppointmentStartDate).common;
const exceptionAppointmentOffset = this.timeZoneCalculator.getOffsets(date).common;
let diff = appointmentOffset - exceptionAppointmentOffset;
diff = this._getProcessedNotNativeDateIfCrossDST(date, diff);
return new Date(date.getTime() - diff * _date.default.dateToMilliseconds("hour"))
}
}
}
_createRecurrenceAppointments(appointment, groupIndices) {
const {
duration: duration
} = appointment;
const {
viewOffset: viewOffset
} = this.options;
const option = this._createRecurrenceOptions(appointment);
const generatedStartDates = (0, _m_recurrence.getRecurrenceProcessor)().generateDates(option);
return generatedStartDates.map((date => {
const utcDate = _m_utils_time_zone.default.createUTCDateWithLocalOffset(date);
utcDate.setTime(utcDate.getTime() + duration);
const endDate = _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(utcDate);
return {
startDate: new Date(date),
endDate: endDate
}
})).map((_ref => {
let {
startDate: startDate,
endDate: endDate
} = _ref;
return {
startDate: _date2.dateUtilsTs.addOffsets(startDate, [-viewOffset]),
endDate: _date2.dateUtilsTs.addOffsets(endDate, [-viewOffset])
}
}))
}
_getAppointmentsFirstViewDate(appointments) {
const {
viewOffset: viewOffset
} = this.options;
return appointments.map((appointment => {
const tableFirstDate = this._getAppointmentFirstViewDate(_extends({}, appointment, {
startDate: _date2.dateUtilsTs.addOffsets(appointment.startDate, [viewOffset]),
endDate: _date2.dateUtilsTs.addOffsets(appointment.endDate, [viewOffset])
}));
if (!tableFirstDate) {
return appointment.startDate
}
const firstDate = _date2.dateUtilsTs.addOffsets(tableFirstDate, [-viewOffset]);
return firstDate > appointment.startDate ? firstDate : appointment.startDate
}))
}
_fillNormalizedStartDate(appointments, firstViewDates, rawAppointment) {
return appointments.map(((item, idx) => _extends({}, item, {
startDate: this._getAppointmentResultDate({
appointment: item,
rawAppointment: rawAppointment,
startDate: new Date(item.startDate),
startDayHour: this.viewStartDayHour,
firstViewDate: firstViewDates[idx]
})
})))
}
_cropAppointmentsByStartDayHour(appointments, firstViewDates) {
return appointments.filter(((appointment, idx) => {
if (!firstViewDates[idx]) {
return false
}
if (this.appointmentTakesAllDay) {
return true
}
return appointment.endDate > appointment.startDate
}))
}
_getAppointmentResultDate(options) {
const {
appointment: appointment,
startDayHour: startDayHour,
firstViewDate: firstViewDate
} = options;
let {
startDate: startDate
} = options;
let resultDate;
if (this.appointmentTakesAllDay) {
resultDate = _date.default.normalizeDate(startDate, firstViewDate)
} else {
if (startDate < firstViewDate) {
startDate = firstViewDate
}
resultDate = _date.default.normalizeDate(appointment.startDate, startDate)
}
return !this.isDateAppointment ? _date.default.roundDateByStartDayHour(resultDate, startDayHour) : resultDate
}
_getAppointmentFirstViewDate(appointment) {
const groupIndex = appointment.source.groupIndex || 0;
const {
startDate: startDate,
endDate: endDate
} = appointment;
if (this.isAllDayRowAppointment || appointment.allDay) {
return this.viewDataProvider.findAllDayGroupCellStartDate(groupIndex)
}
return this.viewDataProvider.findGroupCellStartDate(groupIndex, startDate, endDate, this.isDateAppointment)
}
_getGroupIndices(rawAppointment) {
let result = [];
if (rawAppointment && this.loadedResources.length) {
const tree = (0, _m_utils.createResourcesTree)(this.loadedResources);
result = (0, _m_utils.getResourceTreeLeaves)(((field, action) => (0, _m_utils.getDataAccessors)(this.options.dataAccessors.resources, field, action)), tree, rawAppointment)
}
return result
}
}
exports.DateGeneratorBaseStrategy = DateGeneratorBaseStrategy;
class DateGeneratorVirtualStrategy extends DateGeneratorBaseStrategy {
get groupCount() {
return (0, _index.getGroupCount)(this.loadedResources)
}
_createRecurrenceAppointments(appointment, groupIndices) {
const {
duration: duration
} = appointment;
const result = [];
const validGroupIndices = this.groupCount ? groupIndices : [0];
validGroupIndices.forEach((groupIndex => {
const option = this._createRecurrenceOptions(appointment, groupIndex);
const generatedStartDates = (0, _m_recurrence.getRecurrenceProcessor)().generateDates(option);
const recurrentInfo = generatedStartDates.map((date => {
const startDate = new Date(date);
const utcDate = _m_utils_time_zone.default.createUTCDateWithLocalOffset(date);
utcDate.setTime(utcDate.getTime() + duration);
const endDate = _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(utcDate);
return {
startDate: startDate,
endDate: endDate,
groupIndex: groupIndex
}
}));
result.push(...recurrentInfo)
}));
return result
}
_updateGroupIndices(appointments, groupIndices) {
const result = [];
groupIndices.forEach((groupIndex => {
const groupStartDate = this.viewDataProvider.getGroupStartDate(groupIndex);
if (groupStartDate) {
appointments.forEach((appointment => {
const appointmentCopy = (0, _extend.extend)({}, appointment);
appointmentCopy.groupIndex = groupIndex;
result.push(appointmentCopy)
}))
}
}));
return result
}
_getGroupIndices(resources) {
var _groupIndices;
let groupIndices = super._getGroupIndices(resources);
const viewDataGroupIndices = this.viewDataProvider.getGroupIndices();
if (!(null !== (_groupIndices = groupIndices) && void 0 !== _groupIndices && _groupIndices.length)) {
groupIndices = [0]
}
return groupIndices.filter((groupIndex => -1 !== viewDataGroupIndices.indexOf(groupIndex)))
}
_createAppointments(appointment, groupIndices) {
const appointments = super._createAppointments(appointment, groupIndices);
return !appointment.isRecurrent ? this._updateGroupIndices(appointments, groupIndices) : appointments
}
}
exports.DateGeneratorVirtualStrategy = DateGeneratorVirtualStrategy;
exports.AppointmentSettingsGenerator = class {
constructor(options) {
this.options = options;
this.appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(this.rawAppointment, this.dataAccessors, this.timeZoneCalculator)
}
get rawAppointment() {
return this.options.rawAppointment
}
get dataAccessors() {
return this.options.dataAccessors
}
get timeZoneCalculator() {
return this.options.timeZoneCalculator
}
get isAllDayRowAppointment() {
return this.options.appointmentTakesAllDay && this.options.supportAllDayRow
}
get groups() {
return this.options.groups
}
get dateSettingsStrategy() {
const options = _extends({}, this.options, {
isAllDayRowAppointment: this.isAllDayRowAppointment
});
return this.options.isVirtualScrolling ? new DateGeneratorVirtualStrategy(options) : new DateGeneratorBaseStrategy(options)
}
create() {
const {
dateSettings: dateSettings,
itemGroupIndices: itemGroupIndices,
isRecurrent: isRecurrent
} = this._generateDateSettings();
const cellPositions = this._calculateCellPositions(dateSettings, itemGroupIndices);
const result = this._prepareAppointmentInfos(dateSettings, cellPositions, isRecurrent);
return result
}
_generateDateSettings() {
return this.dateSettingsStrategy.generate(this.appointmentAdapter)
}
_calculateCellPositions(dateSettings, itemGroupIndices) {
const cellPositionCalculator = new _m_cell_position_calculator.CellPositionCalculator(_extends({}, this.options, {
dateSettings: dateSettings
}));
return cellPositionCalculator.calculateCellPositions(itemGroupIndices, this.isAllDayRowAppointment, this.appointmentAdapter.isRecurrent)
}
_prepareAppointmentInfos(dateSettings, cellPositions, isRecurrent) {
const infos = [];
cellPositions.forEach((_ref2 => {
let {
coordinates: coordinates,
dateSettingIndex: dateSettingIndex
} = _ref2;
const dateSetting = dateSettings[dateSettingIndex];
const dateText = this._getAppointmentDateText(dateSetting);
const info = {
appointment: dateSetting,
sourceAppointment: dateSetting.source,
dateText: dateText,
isRecurrent: isRecurrent
};
infos.push(_extends({}, coordinates, {
info: info
}))
}));
return infos
}
_getAppointmentDateText(sourceAppointment) {
const {
startDate: startDate,
endDate: endDate,
allDay: allDay
} = sourceAppointment;
return (0, _m_text_utils.createFormattedDateText)({
startDate: startDate,
endDate: endDate,
allDay: allDay,
format: "TIME"
})
}
}
},
18775:
/*!***********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_text_utils.js ***!
\***********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getFormatType = exports.formatDates = exports.createFormattedDateText = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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 "DATE"
}
if (isDateAndTimeView && _date.default.sameDate(startDate, endDate)) {
return "TIME"
}
return "DATETIME"
};
exports.getFormatType = getFormatType;
const formatDates = (startDate, endDate, formatType) => {
const isSameDate = startDate.getDate() === endDate.getDate();
switch (formatType) {
case "DATETIME":
return [_date2.default.format(startDate, "monthandday"), " ", _date2.default.format(startDate, "shorttime"), " - ", isSameDate ? "" : `${_date2.default.format(endDate,"monthandday")} `, _date2.default.format(endDate, "shorttime")].join("");
case "TIME":
return `${_date2.default.format(startDate,"shorttime")} - ${_date2.default.format(endDate,"shorttime")}`;
case "DATE":
return `${_date2.default.format(startDate,"monthandday")}${isSameDate?"":` - ${_date2.default.format(endDate,"monthandday")}`}`
}
};
exports.formatDates = formatDates
},
62386:
/*!*********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_view_model_generator.js ***!
\*********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentViewModelGenerator = void 0;
var _date = __webpack_require__( /*! ../../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_strategy_agenda = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_agenda */ 87241));
var _m_strategy_horizontal = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_horizontal */ 50323));
var _m_strategy_horizontal_month = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_horizontal_month */ 92888));
var _m_strategy_horizontal_month_line = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_horizontal_month_line */ 24049));
var _m_strategy_vertical = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_vertical */ 20523));
var _m_strategy_week = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_week */ 25410));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const RENDERING_STRATEGIES = {
horizontal: _m_strategy_horizontal.default,
horizontalMonth: _m_strategy_horizontal_month.default,
horizontalMonthLine: _m_strategy_horizontal_month_line.default,
vertical: _m_strategy_vertical.default,
week: _m_strategy_week.default,
agenda: _m_strategy_agenda.default
};
exports.AppointmentViewModelGenerator = class {
initRenderingStrategy(options) {
const RenderingStrategy = RENDERING_STRATEGIES[options.appointmentRenderingStrategyName];
this.renderingStrategy = new RenderingStrategy(options)
}
generate(filteredItems, options) {
const {
viewOffset: viewOffset
} = options;
const appointments = filteredItems ? filteredItems.slice() : [];
this.initRenderingStrategy(options);
const renderingStrategy = this.getRenderingStrategy();
const positionMap = renderingStrategy.createTaskPositionMap(appointments);
const shiftedViewModel = this.postProcess(appointments, positionMap);
const viewModel = this.unshiftViewModelAppointmentsByViewOffset(shiftedViewModel, viewOffset);
return {
positionMap: positionMap,
viewModel: viewModel
}
}
postProcess(filteredItems, positionMap) {
const renderingStrategy = this.getRenderingStrategy();
return filteredItems.map(((data, index) => {
if (!renderingStrategy.keepAppointmentSettings()) {
delete data.settings
}
const appointmentSettings = positionMap[index];
appointmentSettings.forEach((item => {
item.direction = "vertical" === renderingStrategy.getDirection() && !item.allDay ? "vertical" : "horizontal"
}));
const item = {
itemData: data,
settings: appointmentSettings
};
item.needRepaint = true;
item.needRemove = false;
return item
}))
}
makeRenovatedViewModels(viewModel, supportAllDayRow, isVerticalGrouping) {
const strategy = this.getRenderingStrategy();
const regularViewModels = [];
const allDayViewModels = [];
const compactOptions = [];
const isAllDayPanel = supportAllDayRow && !isVerticalGrouping;
viewModel.forEach((_ref => {
let {
itemData: itemData,
settings: settings
} = _ref;
settings.forEach((options => {
const item = this.prepareViewModel(options, strategy, itemData);
if (options.isCompact) {
compactOptions.push({
compactViewModel: options.virtual,
appointmentViewModel: item
})
} else if (options.allDay && isAllDayPanel) {
allDayViewModels.push(item)
} else {
regularViewModels.push(item)
}
}))
}));
const compactViewModels = this.prepareCompactViewModels(compactOptions, supportAllDayRow);
const result = _extends({
allDay: allDayViewModels,
regular: regularViewModels
}, compactViewModels);
return result
}
prepareViewModel(options, strategy, itemData) {
const geometry = strategy.getAppointmentGeometry(options);
const viewModel = {
key: (0, _index.getAppointmentKey)(geometry),
appointment: itemData,
geometry: _extends({}, geometry, {
leftVirtualWidth: options.leftVirtualWidth,
topVirtualHeight: options.topVirtualHeight
}),
info: _extends({}, options.info, {
allDay: options.allDay,
direction: options.direction,
appointmentReduced: options.appointmentReduced,
groupIndex: options.groupIndex
})
};
return viewModel
}
getCompactViewModelFrame(compactViewModel) {
return {
isAllDay: !!compactViewModel.isAllDay,
isCompact: compactViewModel.isCompact,
groupIndex: compactViewModel.groupIndex,
geometry: {
left: compactViewModel.left,
top: compactViewModel.top,
width: compactViewModel.width,
height: compactViewModel.height
},
items: {
colors: [],
data: [],
settings: []
}
}
}
prepareCompactViewModels(compactOptions, supportAllDayRow) {
const regularCompact = {};
const allDayCompact = {};
compactOptions.forEach((_ref2 => {
let {
compactViewModel: compactViewModel,
appointmentViewModel: appointmentViewModel
} = _ref2;
const {
index: index,
isAllDay: isAllDay
} = compactViewModel;
const viewModel = isAllDay && supportAllDayRow ? allDayCompact : regularCompact;
if (!viewModel[index]) {
viewModel[index] = this.getCompactViewModelFrame(compactViewModel)
}
const {
settings: settings,
data: data,
colors: colors
} = viewModel[index].items;
settings.push(appointmentViewModel);
data.push(appointmentViewModel.appointment);
colors.push(appointmentViewModel.info.resourceColor)
}));
const toArray = items => Object.keys(items).map((key => _extends({
key: key
}, items[key])));
const allDayViewModels = toArray(allDayCompact);
const regularViewModels = toArray(regularCompact);
return {
allDayCompact: allDayViewModels,
regularCompact: regularViewModels
}
}
getRenderingStrategy() {
return this.renderingStrategy
}
unshiftViewModelAppointmentsByViewOffset(viewModel, viewOffset) {
const processedAppointments = new Set;
for (const model of viewModel) {
for (const setting of model.settings ?? []) {
var _setting$info;
const appointment = null === setting || void 0 === setting || null === (_setting$info = setting.info) || void 0 === _setting$info ? void 0 : _setting$info.appointment;
if (appointment && !processedAppointments.has(appointment)) {
appointment.startDate = _date.dateUtilsTs.addOffsets(appointment.startDate, [viewOffset]);
appointment.endDate = _date.dateUtilsTs.addOffsets(appointment.endDate, [viewOffset]);
appointment.normalizedEndDate = _date.dateUtilsTs.addOffsets(appointment.normalizedEndDate, [viewOffset]);
processedAppointments.add(appointment)
}
}
}
return viewModel
}
}
},
66040:
/*!****************************************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_appointments_positioning_strategy_adaptive.js ***!
\****************************************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _m_appointments_positioning_strategy_base = (obj = __webpack_require__( /*! ./m_appointments_positioning_strategy_base */ 72115), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
class AdaptivePositioningStrategy extends _m_appointments_positioning_strategy_base.default {
getDropDownAppointmentWidth(intervalCount, isAllDay) {
return this.getDropDownButtonAdaptiveSize()
}
getDropDownButtonAdaptiveSize() {
return 28
}
getCollectorTopOffset(allDay) {
const renderingStrategy = this._renderingStrategy;
if (renderingStrategy.allDaySupported() && allDay) {
return (renderingStrategy.allDayHeight - renderingStrategy.getDropDownButtonAdaptiveSize()) / 2
}
return this._renderingStrategy.cellHeight - 40
}
getCollectorLeftOffset() {
const collectorWidth = this._renderingStrategy.getDropDownAppointmentWidth();
return (this._renderingStrategy.cellWidth - collectorWidth) / 2
}
getAppointmentDefaultOffset() {
return 35
}
getDynamicAppointmentCountPerCell() {
const renderingStrategy = this._renderingStrategy;
if (renderingStrategy.allDaySupported()) {
return {
allDay: 0,
simple: this._calculateDynamicAppointmentCountPerCell() || this._getAppointmentMinCount()
}
}
return 0
}
getDropDownAppointmentHeight() {
return 28
}
_getAppointmentMinCount() {
return 0
}
_getAppointmentDefaultWidth() {
const renderingStrategy = this._renderingStrategy;
if (renderingStrategy.allDaySupported()) {
return 30
}
return super._getAppointmentDefaultWidth()
}
_calculateDynamicAppointmentCountPerCell() {
return Math.floor(this._renderingStrategy._getAppointmentMaxWidth() / this._renderingStrategy._getAppointmentDefaultWidth())
}
}
exports.default = AdaptivePositioningStrategy
},
72115:
/*!************************************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_appointments_positioning_strategy_base.js ***!
\************************************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
exports.default = class {
constructor(renderingStrategy) {
this._renderingStrategy = renderingStrategy
}
getDropDownAppointmentWidth(intervalCount, isAllDay) {
if (isAllDay || !(0, _type.isDefined)(isAllDay)) {
return 75 * this._renderingStrategy.cellWidth / 100
}
return 24
}
getCollectorTopOffset(allDay) {
return 3
}
getCollectorLeftOffset() {
return 3
}
getAppointmentDefaultOffset() {
if (this._renderingStrategy._isCompactTheme()) {
return 22
}
return this._renderingStrategy.appointmentOffset
}
getDynamicAppointmentCountPerCell() {
const renderingStrategy = this._renderingStrategy;
const {
cellHeight: cellHeight
} = renderingStrategy;
const allDayCount = Math.floor((cellHeight - renderingStrategy._getAppointmentDefaultOffset()) / renderingStrategy._getAppointmentDefaultHeight()) || this._getAppointmentMinCount();
if (renderingStrategy.allDaySupported()) {
return {
allDay: "vertical" === renderingStrategy.groupOrientation ? allDayCount : this._renderingStrategy.appointmentCountPerCell,
simple: this._calculateDynamicAppointmentCountPerCell() || this._getAppointmentMinCount()
}
}
return allDayCount
}
getDropDownAppointmentHeight() {
return
}
_getAppointmentMinCount() {
return 1
}
_calculateDynamicAppointmentCountPerCell() {
return Math.floor(this._renderingStrategy._getAppointmentMaxWidth() / 50)
}
_getAppointmentDefaultWidth() {
return 40
}
}
},
87241:
/*!*************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_agenda.js ***!
\*************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479);
var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734);
var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906);
var _m_utils = __webpack_require__( /*! ../../resources/m_utils */ 31359);
var _m_utils2 = __webpack_require__( /*! ../data_provider/m_utils */ 55523);
var _m_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_base */ 64173));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class AgendaRenderingStrategy extends _m_strategy_base.default {
get instance() {
return this.options.instance
}
get agendaDuration() {
return this.options.agendaDuration
}
getAppointmentMinSize() {}
getDeltaTime() {}
keepAppointmentSettings() {
return true
}
getAppointmentGeometry(geometry) {
return geometry
}
groupAppointmentByResources(appointments) {
const groups = this.instance._getCurrentViewOption("groups");
const config = {
loadedResources: this.options.loadedResources,
resources: this.options.resources,
dataAccessors: this.dataAccessors.resources
};
return (0, _m_utils.groupAppointmentsByResources)(config, appointments, groups)
}
createTaskPositionMap(appointments) {
let height;
let appointmentsByResources;
this.calculateRows(appointments, this.agendaDuration, this.currentDate);
if (appointments.length) {
height = this.instance.fire("getAgendaVerticalStepHeight");
appointmentsByResources = this.groupAppointmentByResources(appointments);
let groupedAppts = [];
(0, _iterator.each)(appointmentsByResources, ((i, appts) => {
let additionalAppointments = [];
let recurrentIndexes = [];
(0, _iterator.each)(appts, ((index, appointment) => {
const recurrenceBatch = this.instance.getAppointmentsInstance()._processRecurrenceAppointment(appointment, index);
let appointmentBatch = null;
if (!recurrenceBatch.indexes.length) {
appointmentBatch = this.instance.getAppointmentsInstance()._processLongAppointment(appointment);
additionalAppointments = additionalAppointments.concat(appointmentBatch.parts)
}
additionalAppointments = additionalAppointments.concat(recurrenceBatch.parts);
recurrentIndexes = recurrentIndexes.concat(recurrenceBatch.indexes)
}));
this.instance.getAppointmentsInstance()._reduceRecurrenceAppointments(recurrentIndexes, appts);
this.instance.getAppointmentsInstance()._combineAppointments(appts, additionalAppointments);
groupedAppts = groupedAppts.concat(appts)
}));
Array.prototype.splice.apply(appointments, [0, appointments.length].concat(groupedAppts))
}
const result = [];
let sortedIndex = 0;
appointments.forEach(((appt, index) => {
result.push([{
height: height,
width: "100%",
sortedIndex: sortedIndex++,
groupIndex: this._calculateGroupIndex(index, appointmentsByResources),
agendaSettings: appt.settings
}]);
delete appt.settings
}));
return result
}
_calculateGroupIndex(apptIndex, appointmentsByResources) {
let resultInd;
let counter = 0;
for (const i in appointmentsByResources) {
const countApptInGroup = appointmentsByResources[i].length;
if (apptIndex >= counter && apptIndex < counter + countApptInGroup) {
resultInd = Number(i);
break
}
counter += countApptInGroup
}
return resultInd
}
_getDeltaWidth(args, initialSize) {}
_getAppointmentMaxWidth() {
return this.cellWidth
}
_needVerifyItemSize() {
return false
}
_getAppointmentParts(geometry, settings) {}
_reduceMultiWeekAppointment() {}
calculateAppointmentHeight() {
return 0
}
calculateAppointmentWidth() {
return 0
}
isAppointmentGreaterThan(etalon, comparisonParameters) {}
isAllDay() {
return false
}
_sortCondition() {}
_rowCondition(a, b) {}
_columnCondition(a, b) {}
_findIndexByKey(arr, iKey, jKey, iValue, jValue) {}
_markAppointmentAsVirtual() {}
getDropDownAppointmentWidth() {}
getCollectorLeftOffset() {}
getCollectorTopOffset() {}
replaceWrongAppointmentEndDate(rawAppointment, startDate, endDate) {
const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.dataAccessors, this.timeZoneCalculator);
(0, _m_utils2.replaceWrongEndDate)(adapter, startDate, endDate, this.cellDuration, this.dataAccessors)
}
calculateRows(appointments, agendaDuration, currentDate, needClearSettings) {
this._rows = [];
currentDate = _date.default.trimTime(new Date(currentDate));
const groupedAppointments = this.groupAppointmentByResources(appointments);
(0, _iterator.each)(groupedAppointments, ((_, currentAppointments) => {
const groupResult = [];
const appts = {
indexes: [],
parts: []
};
if (!currentAppointments.length) {
this._rows.push([]);
return true
}(0, _iterator.each)(currentAppointments, ((index, appointment) => {
const startDate = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "startDate", appointment);
const endDate = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "endDate", appointment);
this.replaceWrongAppointmentEndDate(appointment, startDate, endDate);
needClearSettings && delete appointment.settings;
const result = this.instance.getAppointmentsInstance()._processRecurrenceAppointment(appointment, index, false);
appts.parts = appts.parts.concat(result.parts);
appts.indexes = appts.indexes.concat(result.indexes)
}));
this.instance.getAppointmentsInstance()._reduceRecurrenceAppointments(appts.indexes, currentAppointments);
currentAppointments.push(...appts.parts);
const appointmentCount = currentAppointments.length;
for (let i = 0; i < agendaDuration; i++) {
const day = new Date(currentDate);
day.setMilliseconds(day.getMilliseconds() + 864e5 * i);
if (void 0 === groupResult[i]) {
groupResult[i] = 0
}
for (let j = 0; j < appointmentCount; j++) {
const appointmentData = currentAppointments[j].settings || currentAppointments[j];
const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(currentAppointments[j], this.dataAccessors, this.timeZoneCalculator);
const appointmentIsLong = (0, _m_utils2.getAppointmentTakesSeveralDays)(adapter);
const appointmentIsRecurrence = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "recurrenceRule", currentAppointments[j]);
if (this.instance.fire("dayHasAppointment", day, appointmentData, true) || !appointmentIsRecurrence && appointmentIsLong && this.instance.fire("dayHasAppointment", day, currentAppointments[j], true)) {
groupResult[i] += 1
}
}
}
this._rows.push(groupResult)
}));
return this._rows
}
_iterateRow(row, obj, index) {
for (let i = 0; i < row.length; i++) {
obj.counter += row[i];
if (obj.counter >= index) {
obj.indexInRow = i;
break
}
}
}
getDateByIndex(index, rows, startViewDate) {
const obj = {
counter: 0,
indexInRow: 0
};
index++;
for (let i = 0; i < rows.length; i++) {
this._iterateRow(rows[i], obj, index);
if (obj.indexInRow) {
break
}
}
return new Date(new Date(startViewDate).setDate(startViewDate.getDate() + obj.indexInRow))
}
getAppointmentDataCalculator() {
return ($appointment, originalStartDate) => {
const apptIndex = $appointment.index();
const startViewDate = this.instance.getStartViewDate();
const calculatedStartDate = this.getDateByIndex(apptIndex, this._rows, startViewDate);
const wrappedOriginalStartDate = new Date(originalStartDate);
return {
startDate: new Date(calculatedStartDate.setHours(wrappedOriginalStartDate.getHours(), wrappedOriginalStartDate.getMinutes(), wrappedOriginalStartDate.getSeconds(), wrappedOriginalStartDate.getMilliseconds()))
}
}
}
}
exports.default = AgendaRenderingStrategy
},
64173:
/*!***********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_base.js ***!
\***********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811);
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _m_expression_utils = __webpack_require__( /*! ../../../scheduler/m_expression_utils */ 30906);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
var _m_settings_generator = __webpack_require__( /*! ../m_settings_generator */ 24099);
var _m_appointments_positioning_strategy_adaptive = _interopRequireDefault(__webpack_require__( /*! ./m_appointments_positioning_strategy_adaptive */ 66040));
var _m_appointments_positioning_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_appointments_positioning_strategy_base */ 72115));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
exports.default = class {
constructor(options) {
this.options = options;
this._initPositioningStrategy()
}
get isAdaptive() {
return this.options.adaptivityEnabled
}
get rtlEnabled() {
return this.options.rtlEnabled
}
get startDayHour() {
return this.options.startDayHour
}
get endDayHour() {
return this.options.endDayHour
}
get maxAppointmentsPerCell() {
return this.options.maxAppointmentsPerCell
}
get cellWidth() {
return this.options.cellWidth
}
get cellHeight() {
return this.options.cellHeight
}
get allDayHeight() {
return this.options.allDayHeight
}
get resizableStep() {
return this.options.resizableStep
}
get isGroupedByDate() {
return this.options.isGroupedByDate
}
get visibleDayDuration() {
return this.options.visibleDayDuration
}
get viewStartDayHour() {
return this.options.viewStartDayHour
}
get viewEndDayHour() {
return this.options.viewEndDayHour
}
get cellDuration() {
return this.options.cellDuration
}
get cellDurationInMinutes() {
return this.options.cellDurationInMinutes
}
get leftVirtualCellCount() {
return this.options.leftVirtualCellCount
}
get topVirtualCellCount() {
return this.options.topVirtualCellCount
}
get positionHelper() {
return this.options.positionHelper
}
get showAllDayPanel() {
return this.options.showAllDayPanel
}
get isGroupedAllDayPanel() {
return this.options.isGroupedAllDayPanel
}
get groupOrientation() {
return this.options.groupOrientation
}
get rowCount() {
return this.options.rowCount
}
get groupCount() {
return this.options.groupCount
}
get currentDate() {
return this.options.currentDate
}
get appointmentCountPerCell() {
return this.options.appointmentCountPerCell
}
get appointmentOffset() {
return this.options.appointmentOffset
}
get allowResizing() {
return this.options.allowResizing
}
get allowAllDayResizing() {
return this.options.allowAllDayResizing
}
get viewDataProvider() {
return this.options.viewDataProvider
}
get dataAccessors() {
return this.options.dataAccessors
}
get timeZoneCalculator() {
return this.options.timeZoneCalculator
}
get intervalCount() {
return this.options.intervalCount
}
get allDayPanelMode() {
return this.options.allDayPanelMode
}
get isVirtualScrolling() {
return this.options.isVirtualScrolling
}
_correctCollectorCoordinatesInAdaptive(coordinates, isAllDay) {
coordinates.top += this.getCollectorTopOffset(isAllDay);
coordinates.left += this.getCollectorLeftOffset()
}
_initPositioningStrategy() {
this._positioningStrategy = this.isAdaptive ? new _m_appointments_positioning_strategy_adaptive.default(this) : new _m_appointments_positioning_strategy_base.default(this)
}
getPositioningStrategy() {
return this._positioningStrategy
}
getAppointmentMinSize() {
return 2
}
keepAppointmentSettings() {
return false
}
getDeltaTime(args, initialSize, appointment) {}
getAppointmentGeometry(coordinates) {
return coordinates
}
needCorrectAppointmentDates() {
return true
}
getDirection() {
return "horizontal"
}
createTaskPositionMap(items, skipSorting) {
delete this._maxAppointmentCountPerCell;
const length = null === items || void 0 === items ? void 0 : items.length;
if (!length) {
return
}
const map = [];
for (let i = 0; i < length; i++) {
let coordinates = this._getItemPosition(items[i]);
if (coordinates.length && this.rtlEnabled) {
coordinates = this._correctRtlCoordinates(coordinates)
}
coordinates.forEach((item => {
item.leftVirtualCellCount = this.leftVirtualCellCount;
item.topVirtualCellCount = this.topVirtualCellCount;
item.leftVirtualWidth = this.leftVirtualCellCount * this.cellWidth;
item.topVirtualHeight = this.topVirtualCellCount * this.cellHeight
}));
map.push(coordinates)
}
const positionArray = this._getSortedPositions(map);
const resultPositions = this._getResultPositions(positionArray);
return this._getExtendedPositionMap(map, resultPositions)
}
_getDeltaWidth(args, initialSize) {
const intervalWidth = this.resizableStep || this.getAppointmentMinSize();
const initialWidth = initialSize.width;
return Math.round((args.width - initialWidth) / intervalWidth)
}
_correctRtlCoordinates(coordinates) {
const width = coordinates[0].width || this._getAppointmentMaxWidth();
coordinates.forEach((coordinate => {
if (!coordinate.appointmentReduced) {
coordinate.left -= width
}
}));
return coordinates
}
_getAppointmentMaxWidth() {
return this.cellWidth
}
_getItemPosition(initialAppointment) {
const appointment = this.shiftAppointmentByViewOffset(initialAppointment);
const position = this.generateAppointmentSettings(appointment);
const allDay = this.isAllDay(appointment);
let result = [];
for (let j = 0; j < position.length; j++) {
const height = this.calculateAppointmentHeight(appointment, position[j]);
const width = this.calculateAppointmentWidth(appointment, position[j]);
let resultWidth = width;
let appointmentReduced = null;
let multiWeekAppointmentParts = [];
let initialRowIndex = position[j].rowIndex;
let initialColumnIndex = position[j].columnIndex;
if (this._needVerifyItemSize() || allDay) {
const currentMaxAllowedPosition = position[j].hMax;
if (this.isAppointmentGreaterThan(currentMaxAllowedPosition, {
left: position[j].left,
width: width
})) {
appointmentReduced = "head";
initialRowIndex = position[j].rowIndex;
initialColumnIndex = position[j].columnIndex;
resultWidth = this._reduceMultiWeekAppointment(width, {
left: position[j].left,
right: currentMaxAllowedPosition
});
multiWeekAppointmentParts = this._getAppointmentParts({
sourceAppointmentWidth: width,
reducedWidth: resultWidth,
height: height
}, position[j]);
if (this.rtlEnabled) {
position[j].left = currentMaxAllowedPosition
}
}
}(0, _extend.extend)(position[j], {
height: height,
width: resultWidth,
allDay: allDay,
rowIndex: initialRowIndex,
columnIndex: initialColumnIndex,
appointmentReduced: appointmentReduced
});
result = this._getAppointmentPartsPosition(multiWeekAppointmentParts, position[j], result)
}
return result
}
_getAppointmentPartsPosition(appointmentParts, position, result) {
if (appointmentParts.length) {
appointmentParts.unshift(position);
result = result.concat(appointmentParts)
} else {
result.push(position)
}
return result
}
getAppointmentSettingsGenerator(rawAppointment) {
return new _m_settings_generator.AppointmentSettingsGenerator(_extends({
rawAppointment: rawAppointment,
appointmentTakesAllDay: this.isAppointmentTakesAllDay(rawAppointment),
getPositionShiftCallback: this.getPositionShift.bind(this)
}, this.options))
}
generateAppointmentSettings(rawAppointment) {
return this.getAppointmentSettingsGenerator(rawAppointment).create()
}
isAppointmentTakesAllDay(rawAppointment) {
const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.dataAccessors, this.timeZoneCalculator);
return (0, _index.getAppointmentTakesAllDay)(adapter, this.allDayPanelMode)
}
_getAppointmentParts(geometry, settings) {
return []
}
_getCompactAppointmentParts(appointmentWidth) {
const cellWidth = this.cellWidth || this.getAppointmentMinSize();
return Math.round(appointmentWidth / cellWidth)
}
_reduceMultiWeekAppointment(sourceAppointmentWidth, bound) {
if (this.rtlEnabled) {
sourceAppointmentWidth = Math.floor(bound.left - bound.right)
} else {
sourceAppointmentWidth = bound.right - Math.floor(bound.left)
}
return sourceAppointmentWidth
}
calculateAppointmentHeight(appointment, position) {
return 0
}
calculateAppointmentWidth(appointment, position) {
return 0
}
isAppointmentGreaterThan(etalon, comparisonParameters) {
let result = comparisonParameters.left + comparisonParameters.width - etalon;
if (this.rtlEnabled) {
result = etalon + comparisonParameters.width - comparisonParameters.left
}
return result > this.cellWidth / 2
}
isAllDay(appointment) {
return false
}
cropAppointmentWidth(width, cellWidth) {
return this.isGroupedByDate ? cellWidth : width
}
_getSortedPositions(positionList, skipSorting) {
const result = [];
const round = value => Math.round(100 * value) / 100;
const createItem = (rowIndex, columnIndex, top, left, bottom, right, position, allDay) => ({
i: rowIndex,
j: columnIndex,
top: round(top),
left: round(left),
bottom: round(bottom),
right: round(right),
cellPosition: position,
allDay: allDay
});
for (let rowIndex = 0, rowCount = positionList.length; rowIndex < rowCount; rowIndex++) {
for (let columnIndex = 0, cellCount = positionList[rowIndex].length; columnIndex < cellCount; columnIndex++) {
const {
top: top,
left: left,
height: height,
width: width,
cellPosition: cellPosition,
allDay: allDay
} = positionList[rowIndex][columnIndex];
result.push(createItem(rowIndex, columnIndex, top, left, top + height, left + width, cellPosition, allDay))
}
}
return result.sort(((a, b) => this._sortCondition(a, b)))
}
_sortCondition(a, b) {}
_getConditions(a, b) {
const isSomeEdge = this._isSomeEdge(a, b);
return {
columnCondition: isSomeEdge || this._normalizeCondition(a.left, b.left),
rowCondition: isSomeEdge || this._normalizeCondition(a.top, b.top),
cellPositionCondition: isSomeEdge || this._normalizeCondition(a.cellPosition, b.cellPosition)
}
}
_rowCondition(a, b) {
const conditions = this._getConditions(a, b);
return conditions.columnCondition || conditions.rowCondition
}
_columnCondition(a, b) {
const conditions = this._getConditions(a, b);
return conditions.rowCondition || conditions.columnCondition
}
_isSomeEdge(a, b) {
return a.i === b.i && a.j === b.j
}
_normalizeCondition(first, second) {
const result = first - second;
return Math.abs(result) > 1 ? result : 0
}
_isItemsCross(firstItem, secondItem) {
const areItemsInTheSameTable = !!firstItem.allDay === !!secondItem.allDay;
const areItemsAllDay = firstItem.allDay && secondItem.allDay;
if (areItemsInTheSameTable) {
const orientation = this._getOrientation(areItemsAllDay);
return this._checkItemsCrossing(firstItem, secondItem, orientation)
}
return false
}
_checkItemsCrossing(firstItem, secondItem, orientation) {
const firstItemSide1 = Math.floor(firstItem[orientation[0]]);
const firstItemSide2 = Math.floor(firstItem[orientation[1]]);
const secondItemSide1 = Math.ceil(secondItem[orientation[0]]);
const secondItemSide2 = Math.ceil(secondItem[orientation[1]]);
const isItemCross = Math.abs(firstItem[orientation[2]] - secondItem[orientation[2]]) <= 1;
return isItemCross && (firstItemSide1 <= secondItemSide1 && firstItemSide2 > secondItemSide1 || firstItemSide1 < secondItemSide2 && firstItemSide2 >= secondItemSide2 || firstItemSide1 === secondItemSide1 && firstItemSide2 === secondItemSide2)
}
_getOrientation(isAllDay) {
return isAllDay ? ["left", "right", "top"] : ["top", "bottom", "left"]
}
_getResultPositions(sortedArray) {
const result = [];
let i;
let sortedIndex = 0;
let currentItem;
let indexes;
let itemIndex;
let maxIndexInStack = 0;
let stack = {};
const findFreeIndex = (indexes, index) => {
const isFind = indexes.some((item => item === index));
if (isFind) {
return findFreeIndex(indexes, ++index)
}
return index
};
const createItem = (currentItem, index) => {
const currentIndex = index || 0;
return {
index: currentIndex,
i: currentItem.i,
j: currentItem.j,
left: currentItem.left,
right: currentItem.right,
top: currentItem.top,
bottom: currentItem.bottom,
allDay: currentItem.allDay,
sortedIndex: this._skipSortedIndex(currentIndex) ? null : sortedIndex++
}
};
const startNewStack = currentItem => {
stack.items = [createItem(currentItem)];
stack.left = currentItem.left;
stack.right = currentItem.right;
stack.top = currentItem.top;
stack.bottom = currentItem.bottom;
stack.allDay = currentItem.allDay
};
const pushItemsInResult = items => {
items.forEach((item => {
result.push({
index: item.index,
count: maxIndexInStack + 1,
i: item.i,
j: item.j,
sortedIndex: item.sortedIndex
})
}))
};
for (i = 0; i < sortedArray.length; i++) {
currentItem = sortedArray[i];
indexes = [];
if (!stack.items) {
startNewStack(currentItem)
} else if (this._isItemsCross(stack, currentItem)) {
stack.items.forEach((item => {
if (this._isItemsCross(item, currentItem)) {
indexes.push(item.index)
}
}));
itemIndex = indexes.length ? findFreeIndex(indexes, 0) : 0;
stack.items.push(createItem(currentItem, itemIndex));
maxIndexInStack = Math.max(itemIndex, maxIndexInStack);
stack.left = Math.min(stack.left, currentItem.left);
stack.right = Math.max(stack.right, currentItem.right);
stack.top = Math.min(stack.top, currentItem.top);
stack.bottom = Math.max(stack.bottom, currentItem.bottom);
stack.allDay = currentItem.allDay
} else {
pushItemsInResult(stack.items);
stack = {};
startNewStack(currentItem);
maxIndexInStack = 0
}
}
if (stack.items) {
pushItemsInResult(stack.items)
}
return result.sort(((a, b) => {
const columnCondition = a.j - b.j;
const rowCondition = a.i - b.i;
return rowCondition || columnCondition
}))
}
_skipSortedIndex(index) {
return index > this._getMaxAppointmentCountPerCell() - 1
}
_findIndexByKey(arr, iKey, jKey, iValue, jValue) {
let result = 0;
for (let i = 0, len = arr.length; i < len; i++) {
if (arr[i][iKey] === iValue && arr[i][jKey] === jValue) {
result = i;
break
}
}
return result
}
_getExtendedPositionMap(map, positions) {
let positionCounter = 0;
const result = [];
for (let i = 0, mapLength = map.length; i < mapLength; i++) {
const resultString = [];
for (let j = 0, itemLength = map[i].length; j < itemLength; j++) {
map[i][j].index = positions[positionCounter].index;
map[i][j].sortedIndex = positions[positionCounter].sortedIndex;
map[i][j].count = positions[positionCounter++].count;
resultString.push(map[i][j]);
this._checkLongCompactAppointment(map[i][j], resultString)
}
result.push(resultString)
}
return result
}
_checkLongCompactAppointment(item, result) {
this._splitLongCompactAppointment(item, result);
return result
}
_splitLongCompactAppointment(item, result) {
const appointmentCountPerCell = this._getMaxAppointmentCountPerCellByType(item.allDay);
let compactCount = 0;
if (void 0 !== appointmentCountPerCell && item.index > appointmentCountPerCell - 1) {
item.isCompact = true;
compactCount = this._getCompactAppointmentParts(item.width);
for (let k = 1; k < compactCount; k++) {
const compactPart = (0, _extend.extend)(true, {}, item);
compactPart.left = this._getCompactLeftCoordinate(item.left, k);
compactPart.columnIndex += k;
compactPart.sortedIndex = null;
result.push(compactPart)
}
}
return result
}
_adjustDurationByDaylightDiff(duration, startDate, endDate) {
const {
viewOffset: viewOffset
} = this.options;
const originalStartDate = _date2.dateUtilsTs.addOffsets(startDate, [viewOffset]);
const originalEndDate = _date2.dateUtilsTs.addOffsets(endDate, [viewOffset]);
const daylightDiff = _m_utils_time_zone.default.getDaylightOffset(originalStartDate, originalEndDate);
const correctedDuration = this._needAdjustDuration(daylightDiff) ? this._calculateDurationByDaylightDiff(duration, daylightDiff) : duration;
return correctedDuration <= Math.abs(daylightDiff) ? duration : correctedDuration
}
_needAdjustDuration(diff) {
return 0 !== diff
}
_calculateDurationByDaylightDiff(duration, diff) {
return duration + diff * toMs("minute")
}
_getCollectorLeftOffset(isAllDay) {
if (isAllDay || !this.isApplyCompactAppointmentOffset()) {
return 0
}
const dropDownButtonWidth = this.getDropDownAppointmentWidth(this.intervalCount, isAllDay);
const rightOffset = this._isCompactTheme() ? 1 : 5;
return this.cellWidth - dropDownButtonWidth - rightOffset
}
_markAppointmentAsVirtual(coordinates) {
let isAllDay = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
const countFullWidthAppointmentInCell = this._getMaxAppointmentCountPerCellByType(isAllDay);
if (coordinates.count - countFullWidthAppointmentInCell > 0) {
const {
top: top,
left: left
} = coordinates;
const compactRender = this.isAdaptive || !isAllDay && this.supportCompactDropDownAppointments();
coordinates.virtual = {
left: left + this._getCollectorLeftOffset(isAllDay),
top: top,
width: this.getDropDownAppointmentWidth(this.intervalCount, isAllDay),
height: this.getDropDownAppointmentHeight(),
index: this._generateAppointmentCollectorIndex(coordinates, isAllDay),
isAllDay: isAllDay,
groupIndex: coordinates.groupIndex,
isCompact: compactRender
}
}
}
isApplyCompactAppointmentOffset() {
return this.supportCompactDropDownAppointments()
}
supportCompactDropDownAppointments() {
return true
}
_generateAppointmentCollectorIndex(_ref, isAllDay) {
let {
groupIndex: groupIndex,
rowIndex: rowIndex,
columnIndex: columnIndex
} = _ref;
return `${groupIndex}-${rowIndex}-${columnIndex}-${isAllDay}`
}
_getMaxAppointmentCountPerCellByType(isAllDay) {
const appointmentCountPerCell = this._getMaxAppointmentCountPerCell();
if ((0, _type.isObject)(appointmentCountPerCell)) {
return isAllDay ? appointmentCountPerCell.allDay : appointmentCountPerCell.simple
}
return appointmentCountPerCell
}
getDropDownAppointmentWidth(intervalCount, isAllDay) {
return this.getPositioningStrategy().getDropDownAppointmentWidth(intervalCount, isAllDay)
}
getDropDownAppointmentHeight() {
return this.getPositioningStrategy().getDropDownAppointmentHeight()
}
getDropDownButtonAdaptiveSize() {
return 28
}
getCollectorTopOffset(allDay) {
return this.getPositioningStrategy().getCollectorTopOffset(allDay)
}
getCollectorLeftOffset() {
return this.getPositioningStrategy().getCollectorLeftOffset()
}
getAppointmentDataCalculator() {}
getVerticalAppointmentHeight(cellHeight, currentAppointmentCountInCell, maxAppointmentsPerCell) {
let resultMaxAppointmentsPerCell = maxAppointmentsPerCell;
if ((0, _type.isNumeric)(this.maxAppointmentsPerCell)) {
const dynamicAppointmentCountPerCell = this._getDynamicAppointmentCountPerCell();
const maxAppointmentCountDisplayedInCell = dynamicAppointmentCountPerCell.allDay || dynamicAppointmentCountPerCell;
const maxAppointmentsCount = Math.max(currentAppointmentCountInCell, maxAppointmentCountDisplayedInCell);
resultMaxAppointmentsPerCell = Math.min(maxAppointmentsCount, maxAppointmentsPerCell)
}
return cellHeight / resultMaxAppointmentsPerCell
}
_customizeCoordinates(coordinates, cellHeight, appointmentCountPerCell, topOffset, isAllDay) {
const {
index: index,
count: count
} = coordinates;
const appointmentHeight = this.getVerticalAppointmentHeight(cellHeight, count, appointmentCountPerCell);
const appointmentTop = coordinates.top + index * appointmentHeight;
const top = appointmentTop + topOffset;
const {
width: width
} = coordinates;
const {
left: left
} = coordinates;
if (coordinates.isCompact) {
this.isAdaptive && this._correctCollectorCoordinatesInAdaptive(coordinates, isAllDay);
this._markAppointmentAsVirtual(coordinates, isAllDay)
}
return {
height: appointmentHeight,
width: width,
top: top,
left: left,
empty: this._isAppointmentEmpty(cellHeight, width)
}
}
_isAppointmentEmpty(height, width) {
return height < this._getAppointmentMinHeight() || width < this._getAppointmentMinWidth()
}
_calculateGeometryConfig(coordinates) {
const overlappingMode = this.maxAppointmentsPerCell;
const offsets = this._getOffsets();
const appointmentDefaultOffset = this._getAppointmentDefaultOffset();
let appointmentCountPerCell = this._getAppointmentCount(overlappingMode, coordinates);
let ratio = this._getDefaultRatio(coordinates, appointmentCountPerCell);
let maxHeight = this._getMaxHeight();
if (!(0, _type.isNumeric)(appointmentCountPerCell)) {
appointmentCountPerCell = coordinates.count;
ratio = (maxHeight - offsets.unlimited) / maxHeight
}
let topOffset = (1 - ratio) * maxHeight;
if ("auto" === overlappingMode || (0, _type.isNumeric)(overlappingMode)) {
ratio = 1;
maxHeight -= appointmentDefaultOffset;
topOffset = appointmentDefaultOffset
}
return {
height: ratio * maxHeight,
appointmentCountPerCell: appointmentCountPerCell,
offset: topOffset
}
}
_getAppointmentCount(overlappingMode, coordinates) {}
_getDefaultRatio(coordinates, appointmentCountPerCell) {}
_getOffsets() {}
_getMaxHeight() {}
_needVerifyItemSize() {
return false
}
_getMaxAppointmentCountPerCell() {
if (!this._maxAppointmentCountPerCell) {
const overlappingMode = this.maxAppointmentsPerCell;
let appointmentCountPerCell;
if ((0, _type.isNumeric)(overlappingMode)) {
appointmentCountPerCell = overlappingMode
}
if ("auto" === overlappingMode) {
appointmentCountPerCell = this._getDynamicAppointmentCountPerCell()
}
if ("unlimited" === overlappingMode) {
appointmentCountPerCell = void 0
}
this._maxAppointmentCountPerCell = appointmentCountPerCell
}
return this._maxAppointmentCountPerCell
}
_getDynamicAppointmentCountPerCell() {
return this.getPositioningStrategy().getDynamicAppointmentCountPerCell()
}
allDaySupported() {
return false
}
_isCompactTheme() {
return "compact" === ((0, _themes.current)() || "").split(".").pop()
}
_getAppointmentDefaultOffset() {
return this.getPositioningStrategy().getAppointmentDefaultOffset()
}
_getAppointmentDefaultHeight() {
return this._getAppointmentHeightByTheme()
}
_getAppointmentMinHeight() {
return this._getAppointmentDefaultHeight()
}
_getAppointmentHeightByTheme() {
return this._isCompactTheme() ? 18 : 20
}
_getAppointmentDefaultWidth() {
return this.getPositioningStrategy()._getAppointmentDefaultWidth()
}
_getAppointmentMinWidth() {
return this._getAppointmentDefaultWidth()
}
_needVerticalGroupBounds(allDay) {
return false
}
_needHorizontalGroupBounds() {
return false
}
getAppointmentDurationInMs(apptStartDate, apptEndDate, allDay) {
if (allDay) {
const appointmentDuration = apptEndDate.getTime() - apptStartDate.getTime();
const ceilQuantityOfDays = Math.ceil(appointmentDuration / toMs("day"));
return ceilQuantityOfDays * this.visibleDayDuration
}
const msInHour = toMs("hour");
const trimmedStartDate = _date.default.trimTime(apptStartDate);
const trimmedEndDate = _date.default.trimTime(apptEndDate);
const deltaDate = trimmedEndDate - trimmedStartDate;
const quantityOfDays = deltaDate / toMs("day") + 1;
const dayVisibleHours = this.endDayHour - this.startDayHour;
const appointmentDayHours = dayVisibleHours * quantityOfDays;
const startHours = (apptStartDate - trimmedStartDate) / msInHour;
const apptStartDelta = Math.max(0, startHours - this.startDayHour);
const endHours = Math.max(0, (apptEndDate - trimmedEndDate) / msInHour - this.startDayHour);
const apptEndDelta = Math.max(0, dayVisibleHours - endHours);
const result = (appointmentDayHours - (apptStartDelta + apptEndDelta)) * msInHour;
return result
}
getPositionShift(timeShift, isAllDay) {
return {
top: timeShift * this.cellHeight,
left: 0,
cellPosition: 0
}
}
shiftAppointmentByViewOffset(appointment) {
const {
viewOffset: viewOffset
} = this.options;
const startDateField = this.dataAccessors.expr.startDateExpr;
const endDateField = this.dataAccessors.expr.endDateExpr;
let startDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "startDate", appointment));
startDate = _date2.dateUtilsTs.addOffsets(startDate, [-viewOffset]);
let endDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "endDate", appointment));
endDate = _date2.dateUtilsTs.addOffsets(endDate, [-viewOffset]);
return _extends({}, appointment, {
[startDateField]: startDate,
[endDateField]: endDate
})
}
}
},
50323:
/*!*****************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_horizontal.js ***!
\*****************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906);
var _m_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_base */ 64173));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date.default.dateToMilliseconds;
class HorizontalRenderingStrategy extends _m_strategy_base.default {
_needVerifyItemSize() {
return true
}
calculateAppointmentWidth(appointment, position) {
const cellWidth = this.cellWidth || this.getAppointmentMinSize();
const allDay = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", appointment);
const {
startDate: startDate,
endDate: endDate,
normalizedEndDate: normalizedEndDate
} = position.info.appointment;
let duration = this.getAppointmentDurationInMs(startDate, normalizedEndDate, allDay);
duration = this._adjustDurationByDaylightDiff(duration, startDate, normalizedEndDate);
const cellDuration = this.cellDurationInMinutes * toMs("minute");
const skippedHours = (0, _index.getSkippedHoursInRange)(startDate, endDate, appointment.allDay, this.viewDataProvider);
const durationInCells = (duration - skippedHours * toMs("hour")) / cellDuration;
const width = this.cropAppointmentWidth(durationInCells * cellWidth, cellWidth);
return width
}
_needAdjustDuration(diff) {
return diff < 0
}
getAppointmentGeometry(coordinates) {
const result = this._customizeAppointmentGeometry(coordinates);
return super.getAppointmentGeometry(result)
}
_customizeAppointmentGeometry(coordinates) {
const config = this._calculateGeometryConfig(coordinates);
return this._customizeCoordinates(coordinates, config.height, config.appointmentCountPerCell, config.offset)
}
_getOffsets() {
return {
unlimited: 0,
auto: 0
}
}
_getCompactLeftCoordinate(itemLeft, index) {
const cellWidth = this.cellWidth || this.getAppointmentMinSize();
return itemLeft + cellWidth * index
}
_getMaxHeight() {
return this.cellHeight || this.getAppointmentMinSize()
}
_getAppointmentCount(overlappingMode, coordinates) {
return this._getMaxAppointmentCountPerCellByType(false)
}
_getAppointmentDefaultHeight() {
return 60
}
_getAppointmentMinHeight() {
return 35
}
_sortCondition(a, b) {
return this._columnCondition(a, b)
}
_getOrientation() {
return ["left", "right", "top"]
}
getDropDownAppointmentWidth(intervalCount, isAllDay) {
return this.cellWidth - 4
}
getDeltaTime(args, initialSize) {
let deltaTime = 0;
const deltaWidth = args.width - initialSize.width;
deltaTime = toMs("minute") * Math.round(deltaWidth / this.cellWidth * this.cellDurationInMinutes);
return deltaTime
}
isAllDay(appointmentData) {
return _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", appointmentData)
}
_isItemsCross(firstItem, secondItem) {
const orientation = this._getOrientation();
return this._checkItemsCrossing(firstItem, secondItem, orientation)
}
getPositionShift(timeShift) {
const positionShift = super.getPositionShift(timeShift);
let left = this.cellWidth * timeShift;
if (this.rtlEnabled) {
left *= -1
}
left += positionShift.left;
return {
top: 0,
left: left,
cellPosition: left
}
}
supportCompactDropDownAppointments() {
return false
}
}
exports.default = HorizontalRenderingStrategy
},
92888:
/*!***********************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_horizontal_month.js ***!
\***********************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _m_position_helper = __webpack_require__( /*! ../../workspaces/helpers/m_position_helper */ 94654);
var _m_strategy_horizontal_month_line = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_horizontal_month_line */ 24049));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
class HorizontalMonthRenderingStrategy extends _m_strategy_horizontal_month_line.default {
get endViewDate() {
return this.options.endViewDate
}
get adaptivityEnabled() {
return this.options.adaptivityEnabled
}
get DOMMetaData() {
return this.options.DOMMetaData
}
_getLeftPosition(settings) {
const fullWeekAppointmentWidth = this.getGroupWidth(settings.groupIndex);
return this._calculateMultiWeekAppointmentLeftOffset(settings.hMax, fullWeekAppointmentWidth)
}
_getChunkCount(fullChunksWidth, firstChunkWidth, weekWidth, settings) {
const {
groupIndex: groupIndex,
info: {
appointment: {
startDate: startDate
}
}
} = settings;
const rawFullChunksWidth = fullChunksWidth - firstChunkWidth + weekWidth;
const allChunksCount = Math.ceil(rawFullChunksWidth / weekWidth);
const viewRowIndex = this._tryGetRowIndexInView(startDate);
if (void 0 !== viewRowIndex) {
const viewChunksCount = this.viewDataProvider.getRowCountInGroup(groupIndex);
const allowedChunksCount = viewChunksCount - viewRowIndex;
return allChunksCount <= allowedChunksCount ? allChunksCount : allowedChunksCount
}
return allChunksCount
}
_tryGetRowIndexInView(positionStartDate) {
var _this$options$dataRan;
const columnsCount = this.viewDataProvider.getColumnsCount();
if ((null === (_this$options$dataRan = this.options.dataRange) || void 0 === _this$options$dataRan ? void 0 : _this$options$dataRan.length) < 1 || !columnsCount) {
return
}
const [startViewDate] = this.options.dateRange;
const dayDurationMs = toMs("day");
const timeFromStart = positionStartDate.getTime() - startViewDate.getTime();
return Math.floor(timeFromStart / dayDurationMs / columnsCount)
}
_getChunkWidths(geometry, settings, weekWidth) {
const firstChunkWidth = geometry.reducedWidth;
const fullChunksWidth = Math.floor(geometry.sourceAppointmentWidth);
const widthWithoutFirstChunk = fullChunksWidth - firstChunkWidth;
return [firstChunkWidth, fullChunksWidth, widthWithoutFirstChunk]
}
_getTailChunkSettings(withoutFirstChunkWidth, weekWidth, leftPosition) {
const tailChunkWidth = withoutFirstChunkWidth % weekWidth || weekWidth;
const rtlPosition = leftPosition + (weekWidth - tailChunkWidth);
const tailChunkLeftPosition = this.rtlEnabled ? rtlPosition : leftPosition;
return [tailChunkWidth, tailChunkLeftPosition]
}
_getAppointmentParts(geometry, settings) {
const result = [];
const weekWidth = Math.round(this.getGroupWidth(settings.groupIndex));
const [firstChunkWidth, fullChunksWidth, withoutFirstChunkWidth] = this._getChunkWidths(geometry, settings, weekWidth);
const leftPosition = this._getLeftPosition(settings);
const {
endDate: endDate
} = settings.info.appointment;
const hasTailChunk = this.endViewDate > endDate;
const chunkCount = this._getChunkCount(fullChunksWidth, firstChunkWidth, weekWidth, settings);
const [tailChunkWidth, tailChunkLeftPosition] = this._getTailChunkSettings(withoutFirstChunkWidth, weekWidth, leftPosition);
for (let chunkIndex = 1; chunkIndex < chunkCount; chunkIndex++) {
const topPosition = settings.top + this.cellHeight * chunkIndex;
const isTailChunk = hasTailChunk && chunkIndex === chunkCount - 1;
result.push(_extends({}, settings, {
top: topPosition,
left: isTailChunk ? tailChunkLeftPosition : leftPosition,
height: geometry.height,
width: isTailChunk ? tailChunkWidth : weekWidth,
appointmentReduced: isTailChunk ? "tail" : "body",
rowIndex: ++settings.rowIndex,
columnIndex: 0
}))
}
return result
}
_calculateMultiWeekAppointmentLeftOffset(max, width) {
return this.rtlEnabled ? max : max - width
}
getGroupWidth(groupIndex) {
return (0, _m_position_helper.getGroupWidth)(groupIndex, this.viewDataProvider, {
intervalCount: this.options.intervalCount,
currentDate: this.options.currentDate,
viewType: this.options.viewType,
hoursInterval: this.options.hoursInterval,
startDayHour: this.options.startDayHour,
endDayHour: this.options.endDayHour,
isVirtualScrolling: this.isVirtualScrolling,
rtlEnabled: this.rtlEnabled,
DOMMetaData: this.DOMMetaData
})
}
_getAppointmentDefaultHeight() {
return this._getAppointmentHeightByTheme()
}
_getAppointmentMinHeight() {
return this._getAppointmentDefaultHeight()
}
createTaskPositionMap(items) {
return super.createTaskPositionMap(items, true)
}
_getSortedPositions(map) {
return super._getSortedPositions(map, true)
}
_getDefaultRatio() {
return .6
}
_getOffsets() {
return {
unlimited: 26,
auto: 30
}
}
getDropDownAppointmentWidth(intervalCount, isAllDay) {
if (this.adaptivityEnabled) {
return this.getDropDownButtonAdaptiveSize()
}
const offset = intervalCount > 1 ? 60 : 36;
return this.cellWidth - offset
}
needCorrectAppointmentDates() {
return false
}
_needVerticalGroupBounds() {
return false
}
_needHorizontalGroupBounds() {
return true
}
}
exports.default = HorizontalMonthRenderingStrategy
},
24049:
/*!****************************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_horizontal_month_line.js ***!
\****************************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687));
var _m_utils = __webpack_require__( /*! ../data_provider/m_utils */ 55523);
var _m_strategy_horizontal = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_horizontal */ 50323));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class HorizontalMonthLineRenderingStrategy extends _m_strategy_horizontal.default {
calculateAppointmentWidth(_, position) {
const {
startDate: startDateWithTime,
normalizedEndDate: normalizedEndDate
} = position.info.appointment;
const startDate = _date.default.trimTime(startDateWithTime);
const cellWidth = this.cellWidth || this.getAppointmentMinSize();
const duration = Math.ceil(this._getDurationInDays(startDate, normalizedEndDate));
let width = this.cropAppointmentWidth(duration * cellWidth, cellWidth);
if (this.isVirtualScrolling) {
const skippedDays = this.viewDataProvider.getSkippedDaysCount(position.groupIndex, startDate, normalizedEndDate, duration);
width -= skippedDays * cellWidth
}
return width
}
_columnCondition(a, b) {
const conditions = this._getConditions(a, b);
return conditions.rowCondition || conditions.columnCondition || conditions.cellPositionCondition
}
_getDurationInDays(startDate, endDate) {
const adjustedDuration = this._adjustDurationByDaylightDiff(endDate.getTime() - startDate.getTime(), startDate, endDate);
return adjustedDuration / _date.default.dateToMilliseconds("day") || 1
}
getDeltaTime(args, initialSize) {
return 864e5 * this._getDeltaWidth(args, initialSize)
}
isAllDay() {
return false
}
createTaskPositionMap(items, skipSorting) {
if (!skipSorting) {
(0, _m_utils.sortAppointmentsByStartDate)(items, this.dataAccessors)
}
return super.createTaskPositionMap(items)
}
_getSortedPositions(map, skipSorting) {
let result = super._getSortedPositions(map);
if (!skipSorting) {
result = (0, _query.default)(result).sortBy("top").thenBy("left").thenBy("cellPosition").thenBy("i").toArray()
}
return result
}
needCorrectAppointmentDates() {
return false
}
getPositionShift(timeShift) {
return {
top: 0,
left: 0,
cellPosition: timeShift * this.cellWidth
}
}
}
exports.default = HorizontalMonthLineRenderingStrategy
},
20523:
/*!***************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_vertical.js ***!
\***************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _math = __webpack_require__( /*! ../../../../core/utils/math */ 60810);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734);
var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
var _m_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_base */ 64173));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
class VerticalRenderingStrategy extends _m_strategy_base.default {
getDeltaTime(args, initialSize, appointment) {
let deltaTime = 0;
if (this.isAllDay(appointment)) {
deltaTime = this._getDeltaWidth(args, initialSize) * toMs("day")
} else {
const deltaHeight = args.height - initialSize.height;
deltaTime = toMs("minute") * Math.round(deltaHeight / this.cellHeight * this.cellDurationInMinutes)
}
return deltaTime
}
_correctCollectorCoordinatesInAdaptive(coordinates, isAllDay) {
if (isAllDay) {
super._correctCollectorCoordinatesInAdaptive(coordinates, isAllDay)
} else if (0 === this._getMaxAppointmentCountPerCellByType()) {
const {
cellHeight: cellHeight
} = this;
const {
cellWidth: cellWidth
} = this;
coordinates.top += (cellHeight - this.getDropDownButtonAdaptiveSize()) / 2;
coordinates.left += (cellWidth - this.getDropDownButtonAdaptiveSize()) / 2
}
}
getAppointmentGeometry(coordinates) {
let geometry = null;
if (coordinates.allDay) {
geometry = this._getAllDayAppointmentGeometry(coordinates)
} else {
geometry = this.isAdaptive && coordinates.isCompact ? this._getAdaptiveGeometry(coordinates) : this._getVerticalAppointmentGeometry(coordinates)
}
return super.getAppointmentGeometry(geometry)
}
_getAdaptiveGeometry(coordinates) {
const config = this._calculateGeometryConfig(coordinates);
return this._customizeCoordinates(coordinates, config.height, config.appointmentCountPerCell, config.offset)
}
_getItemPosition(initialAppointment) {
const allDay = this.isAllDay(initialAppointment);
if (allDay) {
return super._getItemPosition(initialAppointment)
}
const appointment = super.shiftAppointmentByViewOffset(initialAppointment);
const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this.dataAccessors, this.timeZoneCalculator);
const isRecurring = !!adapter.recurrenceRule;
const appointmentStartDate = adapter.calculateStartDate("toGrid");
const appointmentEndDate = adapter.calculateEndDate("toGrid");
const appointmentDuration = appointmentEndDate - appointmentStartDate;
const appointmentBeginInCurrentView = this.options.startViewDate < appointmentStartDate;
const isAppointmentTakesSeveralDays = !_m_utils_time_zone.default.isSameAppointmentDates(appointmentStartDate, appointmentEndDate);
const settings = this.generateAppointmentSettings(appointment);
let result = [];
for (let j = 0; j < settings.length; j++) {
const currentSetting = settings[j];
const height = this.calculateAppointmentHeight(appointment, currentSetting);
const width = this.calculateAppointmentWidth(appointment, currentSetting);
let resultHeight = height;
let appointmentReduced = null;
let multiDaysAppointmentParts = [];
const currentMaxAllowedPosition = currentSetting.vMax;
if (this._isMultiViewAppointment(currentSetting, height) || isAppointmentTakesSeveralDays && !isRecurring) {
const trimmedStartDate = _date.default.trimTime(appointmentStartDate);
const trimmedSettingStartDate = _date.default.trimTime(currentSetting.info.appointment.startDate);
const reduceHead = trimmedStartDate <= trimmedSettingStartDate || isRecurring;
if (reduceHead) {
resultHeight = this._reduceMultiDayAppointment(height, {
top: currentSetting.top,
bottom: currentMaxAllowedPosition
});
multiDaysAppointmentParts = this._getAppointmentParts({
sourceAppointmentHeight: height,
reducedHeight: resultHeight,
width: width
}, currentSetting)
}
const {
startDate: currentSettingStartDate,
normalizedEndDate: currentSettingNormalizedEndDate
} = currentSetting.info.appointment;
const currentSettingDuration = currentSettingNormalizedEndDate - currentSettingStartDate;
const hasNextParts = currentSettingDuration < appointmentDuration;
appointmentReduced = hasNextParts ? appointmentBeginInCurrentView ? "head" : "body" : appointmentBeginInCurrentView ? "head" : "tail"
}(0, _extend.extend)(currentSetting, {
height: resultHeight,
width: width,
allDay: allDay,
appointmentReduced: appointmentReduced
});
result = this._getAppointmentPartsPosition(multiDaysAppointmentParts, currentSetting, result)
}
return result
}
_isMultiViewAppointment(_ref, height) {
let {
vMax: vMax,
top: top
} = _ref;
const fullAppointmentHeight = (0, _math.roundFloatPart)(height, 2);
const remainingHeight = (0, _math.roundFloatPart)(vMax - top, 2);
return fullAppointmentHeight > remainingHeight
}
_reduceMultiDayAppointment(sourceAppointmentHeight, bound) {
return Math.min(sourceAppointmentHeight, bound.bottom - Math.floor(bound.top))
}
_getGroupHeight() {
return this.cellHeight * this.rowCount
}
_getGroupTopOffset(appointmentSettings) {
const {
groupIndex: groupIndex
} = appointmentSettings;
const groupTop = Math.max(0, this.positionHelper.getGroupTop({
groupIndex: groupIndex,
showAllDayPanel: this.showAllDayPanel,
isGroupedAllDayPanel: this.isGroupedAllDayPanel
}));
const allDayPanelOffset = this.positionHelper.getOffsetByAllDayPanel({
groupIndex: groupIndex,
supportAllDayRow: this.allDaySupported(),
showAllDayPanel: this.showAllDayPanel
});
const appointmentGroupTopOffset = appointmentSettings.top - groupTop - allDayPanelOffset;
return appointmentGroupTopOffset
}
_getTailHeight(appointmentGeometry, appointmentSettings) {
if (!this.isVirtualScrolling) {
return appointmentGeometry.sourceAppointmentHeight - appointmentGeometry.reducedHeight
}
const appointmentGroupTopOffset = this._getGroupTopOffset(appointmentSettings);
const {
sourceAppointmentHeight: sourceAppointmentHeight
} = appointmentGeometry;
const groupHeight = this._getGroupHeight();
const tailHeight = appointmentGroupTopOffset + sourceAppointmentHeight - groupHeight;
return tailHeight
}
_getAppointmentParts(appointmentGeometry, appointmentSettings) {
const {
width: width
} = appointmentGeometry;
const result = [];
let currentPartTop = Math.max(0, this.positionHelper.getGroupTop({
groupIndex: appointmentSettings.groupIndex,
showAllDayPanel: this.showAllDayPanel,
isGroupedAllDayPanel: this.isGroupedAllDayPanel
}));
const cellsDiff = this.isGroupedByDate ? this.groupCount : 1;
const offset = this.cellWidth * cellsDiff;
const allDayPanelOffset = this.positionHelper.getOffsetByAllDayPanel({
groupIndex: appointmentSettings.groupIndex,
supportAllDayRow: this.allDaySupported(),
showAllDayPanel: this.showAllDayPanel
});
currentPartTop += allDayPanelOffset;
const minHeight = this.getAppointmentMinSize();
const {
hMax: hMax,
vMax: vMax,
vMin: vMin
} = appointmentSettings;
const maxHeight = this.isVirtualScrolling ? vMax : vMax - vMin;
const hasTailPart = this.options.endViewDate > appointmentSettings.info.appointment.endDate;
let left = Math.round(appointmentSettings.left + offset);
let tailHeight = this._getTailHeight(appointmentGeometry, appointmentSettings);
let {
columnIndex: columnIndex
} = appointmentSettings;
while (tailHeight > 0 && left < hMax) {
tailHeight = Math.max(minHeight, tailHeight);
columnIndex += cellsDiff;
const height = Math.min(tailHeight, maxHeight);
result.push(_extends({}, appointmentSettings, {
top: currentPartTop,
left: left,
height: height,
width: width,
appointmentReduced: "body",
rowIndex: 0,
columnIndex: columnIndex
}));
left += offset;
tailHeight -= maxHeight
}
if (hasTailPart && result.length > 0) {
result[result.length - 1].appointmentReduced = "tail"
}
return result
}
_getMinuteHeight() {
return this.cellHeight / this.cellDurationInMinutes
}
_getCompactLeftCoordinate(itemLeft, index) {
const cellWidth = this.cellWidth || this.getAppointmentMinSize();
return itemLeft + (1 + cellWidth) * index
}
_getVerticalAppointmentGeometry(coordinates) {
const config = this._calculateVerticalGeometryConfig(coordinates);
return this._customizeVerticalCoordinates(coordinates, config.width, config.appointmentCountPerCell, config.offset)
}
_customizeVerticalCoordinates(coordinates, width, appointmentCountPerCell, topOffset, isAllDay) {
const appointmentWidth = Math.max(width / appointmentCountPerCell, width / coordinates.count);
const {
height: height
} = coordinates;
const appointmentLeft = coordinates.left + coordinates.index * appointmentWidth;
const {
top: top
} = coordinates;
if (coordinates.isCompact) {
this._markAppointmentAsVirtual(coordinates, isAllDay)
}
return {
height: height,
width: appointmentWidth,
top: top,
left: appointmentLeft,
empty: this._isAppointmentEmpty(height, width)
}
}
_calculateVerticalGeometryConfig(coordinates) {
const overlappingMode = this.maxAppointmentsPerCell;
const offsets = this._getOffsets();
const appointmentDefaultOffset = this._getAppointmentDefaultOffset();
let appointmentCountPerCell = this._getAppointmentCount(overlappingMode, coordinates);
let ratio = this._getDefaultRatio(coordinates, appointmentCountPerCell);
let maxWidth = this._getMaxWidth();
if (!appointmentCountPerCell) {
appointmentCountPerCell = coordinates.count;
ratio = (maxWidth - offsets.unlimited) / maxWidth
}
let topOffset = (1 - ratio) * maxWidth;
if ("auto" === overlappingMode || (0, _type.isNumeric)(overlappingMode)) {
ratio = 1;
maxWidth -= appointmentDefaultOffset;
topOffset = 0
}
return {
width: ratio * maxWidth,
appointmentCountPerCell: appointmentCountPerCell,
offset: topOffset
}
}
_getMaxWidth() {
return this.cellWidth
}
isAllDay(appointmentData) {
return (0, _index.getAppointmentTakesAllDay)((0, _m_appointment_adapter.createAppointmentAdapter)(appointmentData, this.dataAccessors, this.timeZoneCalculator), this.allDayPanelMode)
}
_getAppointmentMaxWidth() {
return this.cellWidth - this._getAppointmentDefaultOffset()
}
calculateAppointmentWidth(appointment, position) {
if (!this.isAllDay(appointment)) {
return 0
}
const {
startDate: startDateWithTime,
endDate: endDate,
normalizedEndDate: normalizedEndDate
} = position.info.appointment;
const startDate = _date.default.trimTime(startDateWithTime);
const cellWidth = this.cellWidth || this.getAppointmentMinSize();
const durationInHours = (normalizedEndDate.getTime() - startDate.getTime()) / toMs("hour");
const skippedHours = (0, _index.getSkippedHoursInRange)(startDate, endDate, appointment.allDay, this.viewDataProvider);
let width = Math.ceil((durationInHours - skippedHours) / 24) * cellWidth;
width = this.cropAppointmentWidth(width, cellWidth);
return width
}
calculateAppointmentHeight(appointment, position) {
if (this.isAllDay(appointment)) {
return 0
}
const {
startDate: startDate,
normalizedEndDate: normalizedEndDate
} = position.info.appointment;
const allDay = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", appointment);
const duration = this.getAppointmentDurationInMs(startDate, normalizedEndDate, allDay);
const skippedMinutes = 60 * (0, _index.getSkippedHoursInRange)(startDate, normalizedEndDate, appointment.allDay, this.viewDataProvider);
const durationInMinutes = this._adjustDurationByDaylightDiff(duration, startDate, normalizedEndDate) / toMs("minute") - skippedMinutes;
const height = durationInMinutes * this._getMinuteHeight();
return height
}
getDirection() {
return "vertical"
}
_sortCondition(a, b) {
if (!!a.allDay !== !!b.allDay) {
return a.allDay ? 1 : -1
}
const isAllDay = a.allDay && b.allDay;
return "vertical" === this.groupOrientation && isAllDay ? this._columnCondition(a, b) : this._rowCondition(a, b)
}
allDaySupported() {
return true
}
_getAllDayAppointmentGeometry(coordinates) {
const config = this._calculateGeometryConfig(coordinates);
return this._customizeCoordinates(coordinates, config.height, config.appointmentCountPerCell, config.offset, true)
}
_calculateGeometryConfig(coordinates) {
if (!this.allowResizing || !this.allowAllDayResizing) {
coordinates.skipResizing = true
}
const config = super._calculateGeometryConfig(coordinates);
const minAppointmentCountPerCell = Math.min(config.appointmentCountPerCell, this._getDynamicAppointmentCountPerCell().allDay);
if (coordinates.allDay && coordinates.count <= minAppointmentCountPerCell) {
config.offset = 0
}
return config
}
_getAppointmentCount(overlappingMode, coordinates) {
return "auto" !== overlappingMode && 1 === coordinates.count && !(0, _type.isNumeric)(overlappingMode) ? coordinates.count : this._getMaxAppointmentCountPerCellByType(coordinates.allDay)
}
_getDefaultRatio(coordinates, appointmentCountPerCell) {
return coordinates.count > this.appointmentCountPerCell ? .65 : 1
}
_getOffsets() {
return {
unlimited: 5,
auto: 20
}
}
_getMaxHeight() {
return this.allDayHeight || this.getAppointmentMinSize()
}
_needVerticalGroupBounds(allDay) {
return !allDay
}
_needHorizontalGroupBounds() {
return false
}
getPositionShift(timeShift, isAllDay) {
if (!isAllDay && this.isAdaptive && 0 === this._getMaxAppointmentCountPerCellByType(isAllDay)) {
return {
top: 0,
left: 0,
cellPosition: 0
}
}
return super.getPositionShift(timeShift, isAllDay)
}
}
exports.default = VerticalRenderingStrategy
},
25410:
/*!***********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_week.js ***!
\***********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _m_strategy_vertical = (obj = __webpack_require__( /*! ./m_strategy_vertical */ 20523), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
class WeekAppointmentRenderingStrategy extends _m_strategy_vertical.default {
isApplyCompactAppointmentOffset() {
if (this.isAdaptive && 0 === this._getMaxAppointmentCountPerCellByType()) {
return false
}
return this.supportCompactDropDownAppointments()
}
}
exports.default = WeekAppointmentRenderingStrategy
},
71687:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/resizing/m_core.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAppointmentDateRange = void 0;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const getAppointmentLeftCell = options => {
const {
cellHeight: cellHeight,
cellWidth: cellWidth,
viewDataProvider: viewDataProvider,
relativeAppointmentRect: relativeAppointmentRect,
appointmentSettings: appointmentSettings,
rtlEnabled: rtlEnabled
} = options;
const cellRowIndex = Math.floor(relativeAppointmentRect.top / cellHeight);
const cellColumnIndex = Math.round(relativeAppointmentRect.left / cellWidth);
const leftCell = viewDataProvider.getCellData(cellRowIndex, cellColumnIndex, appointmentSettings.allDay, rtlEnabled);
return leftCell
};
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 {
positionByMap: positionByMap
} = appointmentSettings;
const {
height: cellHeight,
width: cellWidth
} = DOMMetaTable[positionByMap.rowIndex][positionByMap.columnIndex];
const cellCountInRow = DOMMetaTable[positionByMap.rowIndex].length;
return {
cellWidth: cellWidth,
cellHeight: cellHeight,
cellCountInRow: cellCountInRow
}
})(options);
const considerTime = !options.isDateAndTimeView || appointmentSettings.allDay;
const extendedOptions = _extends({}, options, cellInfo, {
considerTime: considerTime,
relativeAppointmentRect: relativeAppointmentRect
});
return !options.rtlEnabled ? (options => {
const {
cellWidth: cellWidth,
cellCountInRow: cellCountInRow,
relativeAppointmentRect: relativeAppointmentRect,
viewDataProvider: viewDataProvider,
appointmentSettings: appointmentSettings,
handles: handles
} = options;
const appointmentFirstCell = getAppointmentLeftCell(options);
const appointmentCellsAmount = Math.round(relativeAppointmentRect.width / cellWidth);
const appointmentLastCellIndex = appointmentFirstCell.index + (appointmentCellsAmount - 1);
const {
sourceAppointment: sourceAppointment
} = appointmentSettings.info;
const {
allDay: allDay
} = appointmentSettings.info.appointment;
if (handles.left) {
return {
startDate: appointmentFirstCell.startDate,
endDate: appointmentFirstCell.startDate > sourceAppointment.endDate ? appointmentFirstCell.startDate : sourceAppointment.endDate
}
}
const appointmentRowIndex = Math.floor(appointmentLastCellIndex / cellCountInRow);
const appointmentColumnIndex = appointmentLastCellIndex % cellCountInRow;
const appointmentLastCell = viewDataProvider.getCellData(appointmentRowIndex, appointmentColumnIndex, allDay);
const endDate = !options.considerTime ? appointmentLastCell.endDate : appointmentLastCell.startDate;
return {
startDate: endDate < sourceAppointment.startDate ? endDate : sourceAppointment.startDate,
endDate: endDate
}
})(extendedOptions) : (options => {
const {
viewDataProvider: viewDataProvider,
cellCountInRow: cellCountInRow,
appointmentSettings: appointmentSettings,
handles: handles,
cellWidth: cellWidth,
relativeAppointmentRect: relativeAppointmentRect
} = options;
const appointmentLastCell = getAppointmentLeftCell(options);
const {
sourceAppointment: sourceAppointment
} = appointmentSettings.info;
const {
allDay: allDay
} = appointmentSettings.info.appointment;
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 = viewDataProvider.getCellData(appointmentRowIndex, appointmentFirstCellIndex, allDay, true);
return {
startDate: appointmentFirstCell.startDate,
endDate: appointmentFirstCell.startDate > sourceAppointment.endDate ? appointmentFirstCell.startDate : sourceAppointment.endDate
}
}
const endDate = !options.considerTime ? appointmentLastCell.endDate : appointmentLastCell.startDate;
return {
startDate: endDate < sourceAppointment.startDate ? endDate : sourceAppointment.startDate,
endDate: endDate
}
})(extendedOptions)
}
},
79427:
/*!********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/base/m_widget_observer.js ***!
\********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _ui = (obj = __webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
class WidgetObserver extends _ui.default {
notifyObserver(subject, args) {
const observer = this.option("observer");
if (observer) {
observer.fire(subject, args)
}
}
invoke() {
const observer = this.option("observer");
if (observer) {
return observer.fire.apply(observer, arguments)
}
}
}
exports.default = WidgetObserver
},
20332:
/*!***************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_calendar.js ***!
\***************************************************************************************/
function(__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 */ 99393));
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _calendar = _interopRequireDefault(__webpack_require__( /*! ../../../ui/calendar */ 26559));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popover/ui.popover */ 17287));
var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 51495));
var _ui3 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/scroll_view/ui.scrollable */ 41183));
var _ui4 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class SchedulerCalendar extends _ui4.default {
show(target) {
if (!this._isMobileLayout()) {
this._overlay.option("target", target)
}
this._overlay.show()
}
hide() {
this._overlay.hide()
}
_keyboardHandler(opts) {
var _this$_calendar;
null === (_this$_calendar = this._calendar) || void 0 === _this$_calendar || _this$_calendar._keyboardHandler(opts)
}
_init() {
super._init();
this.$element()
}
_render() {
super._render();
this._renderOverlay()
}
_renderOverlay() {
this.$element().addClass("dx-scheduler-navigator-calendar-popover");
const isMobileLayout = this._isMobileLayout();
const overlayType = isMobileLayout ? _ui2.default : _ui.default;
this._overlay = this._createComponent(this.$element(), overlayType, {
contentTemplate: () => this._createOverlayContent(),
onShown: () => this._calendar.focus(),
defaultOptionsRules: [{
device: () => isMobileLayout,
options: {
fullScreen: true,
showCloseButton: false,
toolbarItems: [{
shortcut: "cancel"
}],
_ignorePreventScrollEventsDeprecation: true,
preventScrollEvents: false,
enableBodyScroll: false
}
}]
})
}
_createOverlayContent() {
const result = (0, _renderer.default)(" ").addClass("dx-scheduler-navigator-calendar");
this._calendar = this._createComponent(result, _calendar.default, this._getCalendarOptions());
if (this._isMobileLayout()) {
const scrollable = this._createScrollable(result);
return scrollable.$element()
}
return result
}
_createScrollable(content) {
const result = this._createComponent(" ", _ui3.default, {
height: "auto",
direction: "both"
});
result.$content().append(content);
return result
}
_optionChanged(_ref) {
var _this$_calendar2;
let {
name: name,
value: value
} = _ref;
if ("value" === name) {
null === (_this$_calendar2 = this._calendar) || void 0 === _this$_calendar2 || _this$_calendar2.option("value", value)
}
}
_getCalendarOptions() {
return {
value: this.option("value"),
min: this.option("min"),
max: this.option("max"),
firstDayOfWeek: this.option("firstDayOfWeek"),
focusStateEnabled: this.option("focusStateEnabled"),
onValueChanged: this.option("onValueChanged"),
skipFocusCheck: true,
tabIndex: this.option("tabIndex")
}
}
_isMobileLayout() {
return !_devices.default.current().generic
}
}
exports.default = SchedulerCalendar;
(0, _component_registrator.default)("dxSchedulerCalendarPopup", SchedulerCalendar)
},
76310:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_date_navigator.js ***!
\*********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDateNavigator = void 0;
var _date = (obj = __webpack_require__( /*! ../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const {
trimTime: trimTime
} = _date.default;
exports.getDateNavigator = (header, item) => {
const items = [getPreviousButtonOptions(header), getCalendarButtonOptions(header), getNextButtonOptions(header)];
const stylingMode = (0, _themes.isMaterialBased)() ? "text" : "contained";
return _extends({
widget: "dxButtonGroup",
cssClass: "dx-scheduler-navigator",
options: {
items: items,
stylingMode: stylingMode,
selectionMode: "none",
onItemClick: e => {
e.itemData.clickHandler(e)
}
}
}, item)
};
const getPreviousButtonOptions = header => ({
key: "previous",
icon: "chevronprev",
elementAttr: {
class: "dx-scheduler-navigator-previous"
},
clickHandler: () => header._updateDateByDirection(-1),
onContentReady: e => {
const previousButton = e.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))
}))
}
});
const getCalendarButtonOptions = header => ({
key: "calendar",
text: header.captionText,
elementAttr: {
class: "dx-scheduler-navigator-caption"
},
clickHandler: e => header._showCalendar(e),
onContentReady: e => {
const calendarButton = e.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)
}))
}
});
const getNextButtonOptions = header => ({
key: "next",
icon: "chevronnext",
elementAttr: {
class: "dx-scheduler-navigator-next"
},
clickHandler: () => header._updateDateByDirection(1),
onContentReady: e => {
const nextButton = e.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))
}))
}
});
const isPreviousButtonDisabled = header => {
let min = header.option("min");
if (!min) {
return false
}
min = new Date(min);
const caption = header._getCaption();
min = trimTime(min);
const previousDate = header._getNextDate(-1, caption.endDate);
return previousDate < min
};
const isNextButtonDisabled = header => {
let max = header.option("max");
if (!max) {
return false
}
max = new Date(max);
const caption = header._getCaption();
max = max.setHours(23, 59, 59);
const nextDate = header._getNextDate(1, caption.startDate);
return nextDate > max
}
},
5757:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_header.js ***!
\*************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SchedulerHeader = void 0;
__webpack_require__( /*! ../../../ui/button_group */ 28236);
__webpack_require__( /*! ../../../ui/drop_down_button */ 45231);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530));
var _errors = _interopRequireDefault(__webpack_require__( /*! ../../../core/errors */ 17381));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _toolbar = _interopRequireDefault(__webpack_require__( /*! ../../../ui/toolbar */ 71042));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390));
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_calendar = _interopRequireDefault(__webpack_require__( /*! ./m_calendar */ 20332));
var _m_date_navigator = __webpack_require__( /*! ./m_date_navigator */ 76310);
var _m_utils = __webpack_require__( /*! ./m_utils */ 31047);
var _m_view_switcher = __webpack_require__( /*! ./m_view_switcher */ 93327);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class SchedulerHeader extends _ui.default {
get views() {
return this.option("views")
}
get captionText() {
return this._getCaption().text
}
get intervalOptions() {
const step = (0, _m_utils.getStep)(this.currentView);
const intervalCount = this.option("intervalCount");
const firstDayOfWeek = this.option("firstDayOfWeek");
const agendaDuration = this.option("agendaDuration");
return {
step: step,
intervalCount: intervalCount,
firstDayOfWeek: firstDayOfWeek,
agendaDuration: agendaDuration
}
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
_useShortDateFormat: !_devices.default.real().generic || _devices.default.isSimulator()
})
}
_createEventMap() {
this.eventMap = new Map([
["currentView", [view => {
this.currentView = _index.viewsUtils.getCurrentView((0, _m_utils.getViewName)(view), this.option("views"))
}]],
["items", [this.repaint.bind(this)]],
["views", [_m_utils.validateViews]],
["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)]]
])
}
_addEvent(name, event) {
if (!this.eventMap.has(name)) {
this.eventMap.set(name, [])
}
const events = this.eventMap.get(name);
this.eventMap.set(name, [...events, event])
}
_optionChanged(args) {
const {
name: name,
value: value
} = args;
if (this.eventMap.has(name)) {
const events = this.eventMap.get(name);
events.forEach((event => {
event(value)
}))
}
}
_init() {
super._init();
this._createEventMap();
this.$element().addClass("dx-scheduler-header");
this.currentView = _index.viewsUtils.getCurrentView((0, _m_utils.getViewName)(this.option("currentView")), this.option("views"))
}
_render() {
super._render();
this._createEventMap();
this._renderToolbar()
}
_renderToolbar() {
const config = this._createToolbarConfig();
const toolbarElement = (0, _renderer.default)(" ");
toolbarElement.appendTo(this.$element());
this._toolbar = this._createComponent(toolbarElement, _toolbar.default, config)
}
_createToolbarConfig() {
const items = this.option("items");
const parsedItems = items.map((element => this._parseItem(element)));
return {
items: parsedItems
}
}
_parseItem(item) {
const isDefaultElement = this._isDefaultItem(item);
if (isDefaultElement) {
const defaultElementType = item.defaultElement;
switch (defaultElementType) {
case "viewSwitcher":
if (this.option("useDropDownViewSwitcher")) {
return (0, _m_view_switcher.getDropDownViewSwitcher)(this, item)
}
return (0, _m_view_switcher.getViewSwitcher)(this, item);
case "dateNavigator":
this._renderCalendar();
return (0, _m_date_navigator.getDateNavigator)(this, item);
default:
_errors.default.log(`Unknown default element type: ${defaultElementType}`)
}
}
return item
}
_callEvent(event, arg) {
if (this.eventMap.has(event)) {
const events = this.eventMap.get(event);
events.forEach((event => event(arg)))
}
}
_updateCurrentView(view) {
const onCurrentViewChange = this.option("onCurrentViewChange");
onCurrentViewChange(view.name);
this._callEvent("currentView", view)
}
_updateCalendarValueAndCurrentDate(date) {
this._updateCurrentDate(date);
this._calendar.option("value", date)
}
_updateCurrentDate(date) {
const onCurrentDateChange = this.option("onCurrentDateChange");
onCurrentDateChange(date);
this._callEvent("currentDate", date)
}
_renderCalendar() {
this._calendar = this._createComponent(" ", _m_calendar.default, {
value: this.option("currentDate"),
min: this.option("min"),
max: this.option("max"),
firstDayOfWeek: this.option("firstDayOfWeek"),
focusStateEnabled: this.option("focusStateEnabled"),
tabIndex: this.option("tabIndex"),
onValueChanged: e => {
this._updateCurrentDate(e.value);
this._calendar.hide()
}
});
this._calendar.$element().appendTo(this.$element())
}
_getCalendarOptionUpdater(name) {
return value => {
if (this._calendar) {
this._calendar.option(name, value)
}
}
}
_getNextDate(direction) {
let initialDate = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
const date = initialDate ?? this.option("currentDate");
const options = _extends({}, this.intervalOptions, {
date: date
});
return (0, _m_utils.getNextIntervalDate)(options, direction)
}
_isMonth() {
const {
currentView: currentView
} = this;
return "month" === (0, _m_utils.getViewType)(currentView)
}
_getDisplayedDate() {
const startViewDate = this.option("startViewDate");
if (this._isMonth()) {
return (0, _m_utils.nextWeek)(startViewDate)
}
return new Date(startViewDate)
}
_getCaption() {
let date = this.option("currentDate");
if (this.option("startViewDate")) {
date = this._getDisplayedDate()
}
date = _date.default.trimTime(date);
const options = _extends({}, this.intervalOptions, {
date: date
});
const customizationFunction = this.option("customizeDateNavigatorText");
const useShortDateFormat = this.option("_useShortDateFormat");
return (0, _m_utils.getCaption)(options, useShortDateFormat, customizationFunction)
}
_updateDateByDirection(direction) {
const date = this._getNextDate(direction);
this._updateCalendarValueAndCurrentDate(date)
}
_showCalendar(e) {
this._calendar.show(e.element)
}
_hideCalendar() {
this._calendar.hide()
}
_isDefaultItem(item) {
return Object.prototype.hasOwnProperty.call(item, "defaultElement")
}
}
exports.SchedulerHeader = SchedulerHeader;
(0, _component_registrator.default)("dxSchedulerHeader", SchedulerHeader)
},
31047:
/*!************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_utils.js ***!
\************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validateViews = exports.nextWeek = exports.isOneView = exports.getViewType = exports.getViewText = exports.getViewName = exports.getStep = exports.getNextIntervalDate = exports.getCaption = exports.formatViews = void 0;
var _errors = _interopRequireDefault(__webpack_require__( /*! ../../../core/errors */ 17381));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _inflector = __webpack_require__( /*! ../../../core/utils/inflector */ 78008);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const {
correctDateWithUnitBeginning: getPeriodStart,
getFirstWeekDate: getWeekStart,
getLastMonthDay: getLastMonthDay,
addDateInterval: addDateInterval
} = _date.default;
const {
format: formatDate
} = _date2.default;
const MS_DURATION = {
milliseconds: 1
};
const DAY_DURATION = {
days: 1
};
const WEEK_DURATION = {
days: 7
};
const nextDay = date => addDateInterval(date, DAY_DURATION, 1);
const nextWeek = date => addDateInterval(date, WEEK_DURATION, 1);
exports.nextWeek = nextWeek;
const isWeekend = date => 6 === date.getDay() || 0 === 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":
const firstWeekDay = getWeekStart(date, firstDayOfWeek);
return (firstDayOfWeek => {
let date = new Date(firstDayOfWeek);
while (isWeekend(date)) {
date = nextDay(date)
}
return date
})(firstWeekDay);
case "agenda":
return new Date(date)
}
};
const getIntervalEndDate = (startDate, options) => {
const {
intervalCount: intervalCount,
step: step,
agendaDuration: agendaDuration
} = options;
let periodStartDate;
let periodEndDate;
let nextPeriodStartDate = new Date(startDate);
for (let i = 0; i < intervalCount; i++) {
periodStartDate = nextPeriodStartDate;
periodEndDate = getPeriodEndDate(periodStartDate, step, agendaDuration);
nextPeriodStartDate = getNextPeriodStartDate(periodEndDate, step)
}
return periodEndDate
};
const getPeriodEndDate = (currentPeriodStartDate, step, agendaDuration) => {
let date;
switch (step) {
case "day":
date = nextDay(currentPeriodStartDate);
break;
case "week":
date = nextWeek(currentPeriodStartDate);
break;
case "month":
date = (date => {
const days = getLastMonthDay(date);
return addDateInterval(date, {
days: days
}, 1)
})(currentPeriodStartDate);
break;
case "workWeek":
date = (workWeekStart => {
let date = new Date(workWeekStart);
let workDaysCount = 0;
while (workDaysCount < 5) {
if (!isWeekend(date)) {
workDaysCount++
}
date = nextDay(date)
}
return date
})(currentPeriodStartDate);
break;
case "agenda":
date = ((date, agendaDuration) => addDateInterval(date, {
days: agendaDuration
}, 1))(currentPeriodStartDate, agendaDuration)
}
return (date => addDateInterval(date, MS_DURATION, -1))(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;
switch (step) {
case "day":
dayDuration = 1 * intervalCount;
break;
case "week":
case "workWeek":
dayDuration = 7 * intervalCount;
break;
case "agenda":
dayDuration = agendaDuration;
break;
case "month":
return getNextMonthDate(date, intervalCount, direction)
}
return addDateInterval(date, {
days: dayDuration
}, direction)
};
const getNextMonthDate = (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
};
const getDateMonthFormatter = isShort => {
const monthType = isShort ? "abbreviated" : "wide";
const months = _date2.default.getMonthNames(monthType);
return date => {
const day = formatDate(date, "day");
const month = months[date.getMonth()];
return `${day} ${month}`
}
};
const formatMonthYear = date => {
const months = _date2.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 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 (_date.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 (_date.default.sameMonth(startDate, endDate)) {
return formatDate(startDate, "monthandyear")
}
const isSameYear = _date.default.sameYear(startDate, endDate);
const firstDateText = isSameYear ? _date2.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
} = (options => {
const startDate = getIntervalStartDate(options);
const endDate = getIntervalEndDate(startDate, options);
return {
startDate: startDate,
endDate: endDate
}
})(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"
};
exports.getStep = view => STEP_MAP[getViewType(view)];
const getViewType = view => {
if ((0, _type.isObject)(view) && view.type) {
return view.type
}
return view
};
exports.getViewType = getViewType;
const getViewName = view => {
if ((0, _type.isObject)(view)) {
return view.name ? view.name : view.type
}
return view
};
exports.getViewName = getViewName;
const getViewText = view => {
if (view.name) {
return view.name
}
const viewName = (0, _inflector.camelize)(view.type || view, true);
return _message.default.format(`dxScheduler-switcher${viewName}`)
};
exports.getViewText = getViewText;
const validateViews = views => {
views.forEach((view => {
const viewType = getViewType(view);
if (!(view => Object.values(_m_constants.VIEWS).includes(view))(viewType)) {
_errors.default.log("W0008", viewType)
}
}))
};
exports.validateViews = validateViews;
exports.formatViews = views => {
validateViews(views);
return views.map((view => {
const text = getViewText(view);
const type = getViewType(view);
const name = getViewName(view);
return {
text: text,
name: name,
view: {
text: text,
type: type,
name: name
}
}
}))
};
exports.isOneView = (views, selectedView) => 1 === views.length && views[0].name === selectedView
},
93327:
/*!********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_view_switcher.js ***!
\********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getViewSwitcher = exports.getDropDownViewSwitcher = void 0;
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
var _m_utils = __webpack_require__( /*! ./m_utils */ 31047);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const getViewsAndSelectedView = header => {
const views = (0, _m_utils.formatViews)(header.views);
let selectedView = (0, _m_utils.getViewName)(header.currentView);
const isSelectedViewInViews = views.some((view => view.name === selectedView));
selectedView = isSelectedViewInViews ? selectedView : void 0;
return {
selectedView: selectedView,
views: views
}
};
exports.getViewSwitcher = (header, item) => {
const {
selectedView: selectedView,
views: views
} = getViewsAndSelectedView(header);
const stylingMode = (0, _themes.isFluent)() ? "outlined" : "contained";
return _extends({
widget: "dxButtonGroup",
locateInMenu: "auto",
cssClass: "dx-scheduler-view-switcher",
options: {
items: views,
keyExpr: "name",
selectedItemKeys: [selectedView],
stylingMode: stylingMode,
onItemClick: e => {
const {
view: view
} = e.itemData;
header._updateCurrentView(view)
},
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 oneView = (0, _m_utils.isOneView)(views, selectedView);
return _extends({
widget: "dxDropDownButton",
locateInMenu: "never",
cssClass: "dx-scheduler-view-switcher",
options: {
items: views,
useSelectMode: true,
keyExpr: "name",
selectedItemKey: selectedView,
displayExpr: "text",
showArrowIcon: !oneView,
elementAttr: {
class: "dx-scheduler-view-switcher-dropdown-button"
},
onItemClick: e => {
const {
view: view
} = e.itemData;
header._updateCurrentView(view)
},
onContentReady: e => {
const viewSwitcher = e.component;
header._addEvent("currentView", (view => {
const views = (0, _m_utils.formatViews)(header.views);
if ((0, _m_utils.isOneView)(views, view)) {
header.repaint()
}
viewSwitcher.option("selectedItemKey", (0, _m_utils.getViewName)(view))
}))
},
dropDownOptions: {
onShowing: e => {
if (oneView) {
e.cancel = true
}
},
width: "max-content",
_wrapperClassExternal: "dx-scheduler-view-switcher-dropdown-button-content"
}
}
}, item)
}
},
72734:
/*!*******************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_appointment_adapter.js ***!
\*******************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.createAppointmentAdapter = void 0;
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306);
var _object = __webpack_require__( /*! ../../core/utils/object */ 48013);
var _ui = (obj = __webpack_require__( /*! ../../ui/widget/ui.errors */ 96688), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _m_expression_utils = __webpack_require__( /*! ./m_expression_utils */ 30906);
var _m_recurrence = __webpack_require__( /*! ./m_recurrence */ 38227);
const PROPERTY_NAMES_startDate = "startDate",
PROPERTY_NAMES_endDate = "endDate",
PROPERTY_NAMES_allDay = "allDay",
PROPERTY_NAMES_text = "text",
PROPERTY_NAMES_description = "description",
PROPERTY_NAMES_startDateTimeZone = "startDateTimeZone",
PROPERTY_NAMES_endDateTimeZone = "endDateTimeZone",
PROPERTY_NAMES_recurrenceRule = "recurrenceRule",
PROPERTY_NAMES_recurrenceException = "recurrenceException",
PROPERTY_NAMES_disabled = "disabled";
class AppointmentAdapter {
constructor(rawAppointment, dataAccessors, timeZoneCalculator, options) {
this.rawAppointment = rawAppointment;
this.dataAccessors = dataAccessors;
this.timeZoneCalculator = timeZoneCalculator;
this.options = options
}
get duration() {
return this.endDate ? this.endDate - this.startDate : 0
}
get startDate() {
const result = this.getField(PROPERTY_NAMES_startDate);
return void 0 === result ? result : new Date(result)
}
set startDate(value) {
this.setField(PROPERTY_NAMES_startDate, value)
}
get endDate() {
const result = this.getField(PROPERTY_NAMES_endDate);
return void 0 === result ? result : new Date(result)
}
set endDate(value) {
this.setField(PROPERTY_NAMES_endDate, value)
}
get allDay() {
return this.getField(PROPERTY_NAMES_allDay)
}
set allDay(value) {
this.setField(PROPERTY_NAMES_allDay, value)
}
get text() {
return this.getField(PROPERTY_NAMES_text)
}
set text(value) {
this.setField(PROPERTY_NAMES_text, value)
}
get description() {
return this.getField(PROPERTY_NAMES_description)
}
set description(value) {
this.setField(PROPERTY_NAMES_description, value)
}
get startDateTimeZone() {
return this.getField(PROPERTY_NAMES_startDateTimeZone)
}
get endDateTimeZone() {
return this.getField(PROPERTY_NAMES_endDateTimeZone)
}
get recurrenceRule() {
return this.getField(PROPERTY_NAMES_recurrenceRule)
}
set recurrenceRule(value) {
this.setField(PROPERTY_NAMES_recurrenceRule, value)
}
get recurrenceException() {
return this.getField(PROPERTY_NAMES_recurrenceException)
}
set recurrenceException(value) {
this.setField(PROPERTY_NAMES_recurrenceException, value)
}
get disabled() {
return !!this.getField(PROPERTY_NAMES_disabled)
}
get isRecurrent() {
return (0, _m_recurrence.getRecurrenceProcessor)().isValidRecurrenceRule(this.recurrenceRule)
}
getField(property) {
return _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, property, this.rawAppointment)
}
setField(property, value) {
return _m_expression_utils.ExpressionUtils.setField(this.dataAccessors, property, this.rawAppointment, value)
}
calculateStartDate(pathTimeZoneConversion) {
if (!this.startDate || isNaN(this.startDate.getTime())) {
throw _ui.default.Error("E1032", this.text)
}
return this.calculateDate(this.startDate, this.startDateTimeZone, pathTimeZoneConversion)
}
calculateEndDate(pathTimeZoneConversion) {
return this.calculateDate(this.endDate, this.endDateTimeZone, pathTimeZoneConversion)
}
calculateDate(date, appointmentTimeZone, pathTimeZoneConversion) {
if (!date) {
return
}
return this.timeZoneCalculator.createDate(date, {
appointmentTimeZone: appointmentTimeZone,
path: pathTimeZoneConversion
})
}
clone() {
let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0;
const result = new AppointmentAdapter((0, _object.deepExtendArraySafe)({}, this.rawAppointment), this.dataAccessors, this.timeZoneCalculator, options);
if (null !== options && void 0 !== options && options.pathTimeZone) {
result.startDate = result.calculateStartDate(options.pathTimeZone);
result.endDate = result.calculateEndDate(options.pathTimeZone)
}
return result
}
source() {
let serializeDate = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
if (serializeDate) {
const clonedAdapter = this.clone();
clonedAdapter.startDate = this.startDate;
clonedAdapter.endDate = this.endDate;
return clonedAdapter.source()
}
return (0, _extend.extend)({}, this.rawAppointment)
}
}
exports.default = AppointmentAdapter;
exports.createAppointmentAdapter = (rawAppointment, dataAccessors, timeZoneCalculator, options) => new AppointmentAdapter(rawAppointment, dataAccessors, timeZoneCalculator, options)
},
54915:
/*!*************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_appointment_drag_behavior.js ***!
\*************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306);
var _draggable = _interopRequireDefault(__webpack_require__( /*! ../../ui/draggable */ 42160));
var _m_constants = __webpack_require__( /*! ./m_constants */ 6324);
var _is_scheduler_component = __webpack_require__( /*! ./utils/is_scheduler_component */ 79456);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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("dxAppointmentSettings").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) {
const itemElement = e.event.data && e.event.data.itemElement || e.itemElement;
return (0, _renderer.default)(itemElement)
}
onDragEnd(event) {
const element = this.getAppointmentElement(event);
const rawAppointment = this.appointments._getItemData(element);
const container = this.appointments._getAppointmentContainer(this.isAllDay(element));
container.append(element);
const newCellIndex = this.workspace.getDroppableCellIndex();
const oldCellIndex = this.workspace.getCellIndexByCoordinates(this.initialPosition);
this.appointments.notifyObserver("updateAppointmentAfterDrag", {
event: event,
element: element,
rawAppointment: rawAppointment,
newCellIndex: newCellIndex,
oldCellIndex: oldCellIndex
})
}
onDragCancel() {
this.removeDroppableClasses()
}
getItemData(appointmentElement) {
const dataFromTooltip = (0, _renderer.default)(appointmentElement).data(_m_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(_m_constants.LIST_ITEM_DATA_KEY);
return itemData && itemData.settings || []
}
createDragStartHandler(options, appointmentDragging) {
return e => {
e.itemData = this.getItemData(e.itemElement);
e.itemSettings = this.getItemSettings(e.itemElement);
appointmentDragging.onDragStart && appointmentDragging.onDragStart(e);
if (!e.cancel) {
options.onDragStart(e)
}
}
}
createDragMoveHandler(options, appointmentDragging) {
return e => {
appointmentDragging.onDragMove && appointmentDragging.onDragMove(e);
if (!e.cancel) {
options.onDragMove(e)
}
}
}
createDragEndHandler(options, appointmentDragging) {
return e => {
const updatedData = this.appointments.invoke("getUpdatedData", e.itemData);
this.appointmentInfo = null;
e.toItemData = (0, _extend.extend)({}, e.itemData, updatedData);
appointmentDragging.onDragEnd && appointmentDragging.onDragEnd(e);
if (!e.cancel) {
options.onDragEnd(e);
if (e.fromComponent !== e.toComponent) {
appointmentDragging.onRemove && appointmentDragging.onRemove(e)
}
}
if (true === e.cancel) {
this.removeDroppableClasses()
}
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) {
appointmentDragging.onAdd && appointmentDragging.onAdd(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()
}
}
},
43919:
/*!***************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_appointments_layout_manager.js ***!
\***************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _common = __webpack_require__( /*! ../../core/utils/common */ 20576);
var _date = (obj = __webpack_require__( /*! ../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ../scheduler/r1/utils/index */ 94084);
var _m_view_model_generator = __webpack_require__( /*! ./appointments/m_view_model_generator */ 62386);
var _m_position_helper = __webpack_require__( /*! ./workspaces/helpers/m_position_helper */ 94654);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
exports.default = class {
constructor(instance) {
this.instance = instance;
this.appointmentViewModel = new _m_view_model_generator.AppointmentViewModelGenerator
}
get appointmentRenderingStrategyName() {
return (0, _index.getAppointmentRenderingStrategyName)(this.instance.currentViewType)
}
getCellDimensions(options) {
if (this.instance._workSpace) {
return {
width: this.instance._workSpace.getCellWidth(),
height: this.instance._workSpace.getCellHeight(),
allDayHeight: this.instance._workSpace.getAllDayHeight()
}
}
return
}
_getRenderingStrategyOptions() {
const workspace = this.instance.getWorkSpace();
const {
virtualScrollingDispatcher: virtualScrollingDispatcher
} = this.instance.getWorkSpace();
const {
cellCountInsideLeftVirtualCell: cellCountInsideLeftVirtualCell,
cellCountInsideTopVirtualRow: cellCountInsideTopVirtualRow
} = virtualScrollingDispatcher;
const groupCount = (0, _index.getGroupCount)(this.instance.option("loadedResources"));
const DOMMetaData = workspace.getDOMElementsMetaData();
const allDayHeight = (0, _m_position_helper.getAllDayHeight)(workspace.option("showAllDayPanel"), workspace._isVerticalGroupedWorkSpace(), DOMMetaData);
const rowCount = workspace._getRowCount();
const {
positionHelper: positionHelper,
viewDataProvider: viewDataProvider
} = workspace;
const visibleDayDuration = viewDataProvider.getVisibleDayDuration(workspace.option("startDayHour"), workspace.option("endDayHour"), workspace.option("hoursInterval"));
const cellDuration = (0, _index.getCellDuration)(workspace.type, workspace.option("startDayHour"), workspace.option("endDayHour"), workspace.option("hoursInterval"));
return {
resources: this.instance.option("resources"),
loadedResources: this.instance.option("loadedResources"),
getAppointmentColor: this.instance.createGetAppointmentColor(),
dataAccessors: this.instance._dataAccessors,
appointmentRenderingStrategyName: this.appointmentRenderingStrategyName,
adaptivityEnabled: this.instance.option("adaptivityEnabled"),
rtlEnabled: this.instance.option("rtlEnabled"),
startDayHour: this.instance._getCurrentViewOption("startDayHour"),
endDayHour: this.instance._getCurrentViewOption("endDayHour"),
viewOffset: this.instance._getCurrentViewOption("offset") * toMs("minute"),
maxAppointmentsPerCell: this.instance._getCurrentViewOption("maxAppointmentsPerCell"),
currentDate: this.instance.option("currentDate"),
isVirtualScrolling: this.instance.isVirtualScrolling(),
leftVirtualCellCount: cellCountInsideLeftVirtualCell,
topVirtualCellCount: cellCountInsideTopVirtualRow,
intervalCount: workspace.option("intervalCount"),
hoursInterval: workspace.option("hoursInterval"),
showAllDayPanel: workspace.option("showAllDayPanel"),
isGroupedAllDayPanel: workspace.isGroupedAllDayPanel(),
groups: this.instance._getCurrentViewOption("groups"),
groupCount: groupCount,
rowCount: rowCount,
appointmentCountPerCell: this.instance.option("_appointmentCountPerCell"),
appointmentOffset: this.instance.option("_appointmentOffset"),
allowResizing: this.instance._allowResizing(),
allowAllDayResizing: this.instance._allowAllDayResizing(),
startViewDate: workspace.getStartViewDate(),
groupOrientation: workspace._getRealGroupOrientation(),
cellWidth: (0, _m_position_helper.getCellWidth)(DOMMetaData),
cellHeight: (0, _m_position_helper.getCellHeight)(DOMMetaData),
allDayHeight: allDayHeight,
resizableStep: positionHelper.getResizableStep(),
visibleDayDuration: visibleDayDuration,
allDayPanelMode: this.instance._getCurrentViewOption("allDayPanelMode"),
timeZoneCalculator: this.instance.timeZoneCalculator,
timeZone: this.instance.option("timeZone"),
firstDayOfWeek: this.instance.getFirstDayOfWeek(),
viewStartDayHour: this.instance._getCurrentViewOption("startDayHour"),
viewEndDayHour: this.instance._getCurrentViewOption("endDayHour"),
viewType: workspace.type,
endViewDate: workspace.getEndViewDate(),
positionHelper: positionHelper,
isGroupedByDate: workspace.isGroupedByDate(),
cellDuration: cellDuration,
cellDurationInMinutes: workspace.option("cellDuration"),
viewDataProvider: workspace.viewDataProvider,
supportAllDayRow: workspace.supportAllDayRow(),
dateRange: workspace.getDateRange(),
intervalDuration: workspace.getIntervalDuration(),
allDayIntervalDuration: workspace.getIntervalDuration(true),
isVerticalGroupOrientation: workspace.isVerticalOrientation(),
DOMMetaData: DOMMetaData,
instance: this.instance,
agendaDuration: workspace.option("agendaDuration")
}
}
createAppointmentsMap(items) {
const renderingStrategyOptions = this._getRenderingStrategyOptions();
const {
viewModel: viewModel,
positionMap: positionMap
} = this.appointmentViewModel.generate(items, renderingStrategyOptions);
this._positionMap = positionMap;
return viewModel
}
_isDataChanged(data) {
const {
appointmentDataProvider: appointmentDataProvider
} = this.instance;
const updatedData = appointmentDataProvider.getUpdatedAppointment();
return updatedData === data || appointmentDataProvider.getUpdatedAppointmentKeys().some((item => data[item.key] === item.value))
}
_isAppointmentShouldAppear(currentAppointment, sourceAppointment) {
return currentAppointment.needRepaint && sourceAppointment.needRemove
}
_isSettingChanged(settings, sourceSetting) {
if (settings.length !== sourceSetting.length) {
return true
}
const createSettingsToCompare = (settings, index) => {
const currentSetting = settings[index];
const leftVirtualCellCount = currentSetting.leftVirtualCellCount || 0;
const topVirtualCellCount = currentSetting.topVirtualCellCount || 0;
const columnIndex = currentSetting.columnIndex + leftVirtualCellCount;
const rowIndex = currentSetting.rowIndex + topVirtualCellCount;
const hMax = currentSetting.reduced ? currentSetting.hMax : void 0;
const vMax = currentSetting.reduced ? currentSetting.vMax : void 0;
return _extends({}, currentSetting, {
columnIndex: columnIndex,
rowIndex: rowIndex,
positionByMap: void 0,
topVirtualCellCount: void 0,
leftVirtualCellCount: void 0,
leftVirtualWidth: void 0,
topVirtualHeight: void 0,
hMax: hMax,
vMax: vMax,
info: {}
})
};
for (let i = 0; i < settings.length; i++) {
const newSettings = createSettingsToCompare(settings, i);
const oldSettings = createSettingsToCompare(sourceSetting, i);
if (oldSettings) {
oldSettings.sortedIndex = newSettings.sortedIndex
}
if (!(0, _common.equalByValue)(newSettings, oldSettings)) {
return true
}
}
return false
}
_getAssociatedSourceAppointment(currentAppointment, sourceAppointments) {
for (let i = 0; i < sourceAppointments.length; i++) {
const item = sourceAppointments[i];
if (item.itemData === currentAppointment.itemData) {
return item
}
}
return null
}
_getDeletedAppointments(currentAppointments, sourceAppointments) {
const result = [];
for (let i = 0; i < sourceAppointments.length; i++) {
const sourceAppointment = sourceAppointments[i];
const currentAppointment = this._getAssociatedSourceAppointment(sourceAppointment, currentAppointments);
if (!currentAppointment) {
sourceAppointment.needRemove = true;
result.push(sourceAppointment)
}
}
return result
}
getRepaintedAppointments(currentAppointments, sourceAppointments) {
if (0 === sourceAppointments.length || "agenda" === this.appointmentRenderingStrategyName) {
return currentAppointments
}
currentAppointments.forEach((appointment => {
const sourceAppointment = this._getAssociatedSourceAppointment(appointment, sourceAppointments);
if (sourceAppointment) {
const isDataChanged = this._isDataChanged(appointment.itemData);
const isSettingChanged = this._isSettingChanged(appointment.settings, sourceAppointment.settings);
const isAppointmentShouldAppear = this._isAppointmentShouldAppear(appointment, sourceAppointment);
appointment.needRepaint = isDataChanged || isSettingChanged || isAppointmentShouldAppear
}
}));
return currentAppointments.concat(this._getDeletedAppointments(currentAppointments, sourceAppointments))
}
getRenderingStrategyInstance() {
const renderingStrategy = this.appointmentViewModel.getRenderingStrategy();
if (!renderingStrategy) {
const options = this._getRenderingStrategyOptions();
this.appointmentViewModel.initRenderingStrategy(options)
}
return this.appointmentViewModel.getRenderingStrategy()
}
}
},
43600:
/*!*******************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_classes.js ***!
\*******************************************************************************/
function(__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",
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"]
},
38088:
/*!***************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_compact_appointments_helper.js ***!
\***************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CompactAppointmentsHelper = void 0;
var _translator = __webpack_require__( /*! ../../animation/translator */ 31648);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _function_template = __webpack_require__( /*! ../../core/templates/function_template */ 68494);
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754);
var _position = __webpack_require__( /*! ../../core/utils/position */ 37518);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109));
var _button = _interopRequireDefault(__webpack_require__( /*! ../../ui/button */ 63008));
var _index = __webpack_require__( /*! ../scheduler/r1/utils/index */ 94084);
var _m_appointment_adapter = __webpack_require__( /*! ./m_appointment_adapter */ 72734);
var _m_constants = __webpack_require__( /*! ./m_constants */ 6324);
var _m_data_structures = __webpack_require__( /*! ./m_data_structures */ 98865);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
exports.CompactAppointmentsHelper = class {
constructor(instance) {
this.instance = instance;
this.elements = []
}
render(options) {
const {
isCompact: isCompact,
items: items,
buttonColor: buttonColor
} = options;
const template = this._createTemplate(items.data.length, isCompact);
const button = this._createCompactButton(template, options);
const $button = button.$element();
this._makeBackgroundColor($button, items.colors, buttonColor);
this._makeBackgroundDarker($button);
this.elements.push($button);
$button.data("items", this._createTooltipInfos(items));
return $button
}
clear() {
this.elements.forEach((button => {
button.detach();
button.remove()
}));
this.elements = []
}
_createTooltipInfos(items) {
return items.data.map(((appointment, index) => {
var _items$settings;
const targetedAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this.instance._dataAccessors, this.instance.timeZoneCalculator).clone();
if ((null === (_items$settings = items.settings) || void 0 === _items$settings ? void 0 : _items$settings.length) > 0) {
const {
info: info
} = items.settings[index];
targetedAdapter.startDate = info.sourceAppointment.startDate;
targetedAdapter.endDate = info.sourceAppointment.endDate
}
return new _m_data_structures.AppointmentTooltipInfo(appointment, targetedAdapter.source(), items.colors[index], items.settings[index])
}))
}
_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),
dropDownAppointmentTemplate: this.instance.option().dropDownAppointmentTemplate,
isButtonClick: 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: `.${_m_constants.LIST_ITEM_CLASS}`,
isSetCursorOffset: true,
initialPosition: initialPosition,
getItemData: itemElement => {
var _$$data;
return null === (_$$data = (0, _renderer.default)(itemElement).data(_m_constants.LIST_ITEM_DATA_KEY)) || void 0 === _$$data ? void 0 : _$$data.appointment
},
getItemSettings: (_, event) => event.itemSettings
};
workSpace._createDragBehaviorBase($element, $schedulerElement, options)
}
}
_getCollectorOffset(width, cellWidth) {
return cellWidth - width - this._getCollectorRightOffset()
}
_getCollectorRightOffset() {
return this.instance.getRenderingStrategyInstance()._isCompactTheme() ? 1 : 5
}
_makeBackgroundDarker(button) {
button.css("boxShadow", `inset ${(0,_position.getBoundingRect)(button.get(0)).width}px 0 0 0 rgba(0, 0, 0, 0.3)`)
}
_makeBackgroundColor($button, colors, color) {
_deferred.when.apply(null, colors).done(function() {
this._makeBackgroundColorCore($button, color, [...arguments])
}.bind(this))
}
_makeBackgroundColorCore($button, color, itemColors) {
color && color.done((color => {
const backgroundColor = (0, _index.getOverflowIndicatorColor)(color, itemColors);
if (backgroundColor) {
$button.css("backgroundColor", backgroundColor)
}
}))
}
_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)
})
}
_createCompactButtonElement(_ref) {
let {
isCompact: isCompact,
$container: $container,
coordinates: coordinates
} = _ref;
const result = (0, _renderer.default)(" ").addClass("dx-scheduler-appointment-collector").toggleClass("dx-scheduler-appointment-collector-compact", isCompact).appendTo($container);
this._setPosition(result, coordinates);
return result
}
_renderTemplate(template, items, isCompact) {
return new _function_template.FunctionTemplate((options => template.render({
model: {
appointmentCount: items.data.length,
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")
}
}
},
6324:
/*!*********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_constants.js ***!
\*********************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VIEWS = 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.HORIZONTAL_GROUP_ORIENTATION = "horizontal";
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"
}
},
98865:
/*!***************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_data_structures.js ***!
\***************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppointmentTooltipInfo = void 0;
exports.AppointmentTooltipInfo = class {
constructor(appointment) {
let targetedAppointment = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0;
let color = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
let settings = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : [];
this.appointment = appointment;
this.targetedAppointment = targetedAppointment;
this.color = color;
this.settings = settings
}
}
},
90006:
/*!************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_date_adapter.js ***!
\************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = (obj = __webpack_require__( /*! ../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
const toMs = _date.default.dateToMilliseconds;
class DateAdapterCore {
constructor(source) {
this._source = new Date(source.getTime ? source.getTime() : source)
}
get source() {
return this._source
}
result() {
return this._source
}
getTimezoneOffset() {
let format = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0;
const value = this._source.getTimezoneOffset();
if ("minute" === format) {
return value * toMs("minute")
}
return value
}
getTime() {
return this._source.getTime()
}
setTime(value) {
this._source.setTime(value);
return this
}
addTime(value) {
this._source.setTime(this._source.getTime() + value);
return this
}
setMinutes(value) {
this._source.setMinutes(value);
return this
}
addMinutes(value) {
this._source.setMinutes(this._source.getMinutes() + value);
return this
}
subtractMinutes(value) {
this._source.setMinutes(this._source.getMinutes() - value);
return this
}
}
exports.default = date => new DateAdapterCore(date)
},
30906:
/*!****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_expression_utils.js ***!
\****************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExpressionUtils = void 0;
var _type = __webpack_require__( /*! ../../core/utils/type */ 35922);
exports.ExpressionUtils = {
getField: (dataAccessors, field, obj) => {
if (!(0, _type.isDefined)(dataAccessors.getter[field])) {
return
}
return dataAccessors.getter[field](obj)
},
setField: (dataAccessors, field, obj, value) => {
if (!(0, _type.isDefined)(dataAccessors.setter[field])) {
return
}
dataAccessors.setter[field](obj, value);
return obj
}
}
},
28066:
/*!*******************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_loading.js ***!
\*******************************************************************************/
function(__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 = createLoadPanel(options);
return loading.show()
};
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754);
var _view_port = __webpack_require__( /*! ../../core/utils/view_port */ 77695);
var _load_panel = _interopRequireDefault(__webpack_require__( /*! ../../ui/load_panel */ 97218));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
let loading = null;
const createLoadPanel = function(options) {
return new _load_panel.default((0, _renderer.default)("").appendTo(options && options.container || (0, _view_port.value)()), options)
};
const removeLoadPanel = function() {
if (!loading) {
return
}
loading.$element().remove();
loading = null
}
},
38227:
/*!**********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_recurrence.js ***!
\**********************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRecurrenceProcessor = getRecurrenceProcessor;
var _errors = _interopRequireDefault(__webpack_require__( /*! ../../core/errors */ 17381));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198));
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479);
var _rrule = __webpack_require__( /*! rrule */ 98919);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ./m_utils_time_zone */ 57880));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date.default.dateToMilliseconds;
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 loggedWarnings = [];
const RRULE_BROKEN_TIMEZONES = ["Etc/GMT-13", "MIT", "Pacific/Apia", "Pacific/Enderbury", "Pacific/Tongatapu", "Etc/GMT-14", "Pacific/Kiritimati"];
let recurrence = null;
function getRecurrenceProcessor() {
if (!recurrence) {
recurrence = new RecurrenceProcessor
}
return recurrence
}
class RecurrenceProcessor {
constructor() {
this.rRule = null;
this.rRuleSet = null;
this.validator = new RecurrenceValidator
}
generateDates(options) {
const recurrenceRule = this.evalRecurrenceRule(options.rule);
const {
rule: rule
} = recurrenceRule;
if (!recurrenceRule.isValid || !rule.freq) {
return []
}
const rruleIntervalParams = this._createRruleIntervalParams(options);
this._initializeRRule(options, rruleIntervalParams.startIntervalDate, rule.until);
return this.rRuleSet.between(rruleIntervalParams.minViewDate, rruleIntervalParams.maxViewDate, true).filter((date => date.getTime() + rruleIntervalParams.appointmentDuration >= rruleIntervalParams.minViewTime)).map((date => this._convertRruleResult(rruleIntervalParams, options, date)))
}
_createRruleIntervalParams(options) {
const {
start: start,
min: min,
max: max,
appointmentTimezoneOffset: appointmentTimezoneOffset
} = options;
const clientOffsets_startDate = _m_utils_time_zone.default.getClientTimezoneOffset(start),
clientOffsets_minViewDate = _m_utils_time_zone.default.getClientTimezoneOffset(min),
clientOffsets_maxViewDate = _m_utils_time_zone.default.getClientTimezoneOffset(max);
const duration = options.end ? options.end.getTime() - options.start.getTime() : 0;
const startIntervalDate = _m_utils_time_zone.default.setOffsetsToDate(options.start, [-clientOffsets_startDate, appointmentTimezoneOffset]);
const minViewTime = options.min.getTime() - clientOffsets_minViewDate + appointmentTimezoneOffset;
const minViewDate = new Date(minViewTime - duration);
const maxViewDate = _m_utils_time_zone.default.setOffsetsToDate(options.max, [-clientOffsets_maxViewDate, appointmentTimezoneOffset]);
const startDateDSTDifferenceMs = _m_utils_time_zone.default.getDiffBetweenClientTimezoneOffsets(options.start, startIntervalDate);
const switchToSummerTime = startDateDSTDifferenceMs < 0;
return {
startIntervalDate: startIntervalDate,
minViewTime: minViewTime,
minViewDate: minViewDate,
maxViewDate: maxViewDate,
startIntervalDateDSTShift: switchToSummerTime ? 0 : startDateDSTDifferenceMs,
appointmentDuration: duration
}
}
_convertRruleResult(rruleIntervalParams, options, rruleDate) {
const convertedBackDate = _m_utils_time_zone.default.setOffsetsToDate(rruleDate, [...this._getLocalMachineOffset(rruleDate), -options.appointmentTimezoneOffset, rruleIntervalParams.startIntervalDateDSTShift]);
const convertedDateDSTShift = _m_utils_time_zone.default.getDiffBetweenClientTimezoneOffsets(convertedBackDate, rruleDate);
const switchToSummerTime = convertedDateDSTShift < 0;
const resultDate = _m_utils_time_zone.default.setOffsetsToDate(convertedBackDate, [convertedDateDSTShift]);
const resultDateDSTShift = _m_utils_time_zone.default.getDiffBetweenClientTimezoneOffsets(resultDate, convertedBackDate);
if (resultDateDSTShift && switchToSummerTime) {
return new Date(resultDate.getTime() + resultDateDSTShift)
}
return resultDate
}
_getLocalMachineOffset(rruleDate) {
const machineTimezoneOffset = _m_utils_time_zone.default.getClientTimezoneOffset(rruleDate);
const machineTimezoneName = _date.default.getMachineTimezoneName();
const result = [machineTimezoneOffset];
const isTimezoneOffsetInBrokenRange = machineTimezoneOffset / 36e5 <= -13;
const isTimezoneNameInBrokenNames = !machineTimezoneName || RRULE_BROKEN_TIMEZONES.some((timezone => machineTimezoneName.includes(timezone)));
if (isTimezoneOffsetInBrokenRange && isTimezoneNameInBrokenNames) {
result.push(-864e5)
}
return result
}
hasRecurrence(options) {
return !!this.generateDates(options).length
}
evalRecurrenceRule(rule) {
const result = {
rule: {},
isValid: false
};
if (rule) {
result.rule = this._parseRecurrenceRule(rule);
result.isValid = this.validator.validateRRule(result.rule, rule)
}
return result
}
isValidRecurrenceRule(rule) {
return this.evalRecurrenceRule(rule).isValid
}
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 = item.match(/[A-Za-z]+/);
return !!match && match[0]
})).filter((item => !!item))
}
getAsciiStringByDate(date) {
const currentOffset = date.getTimezoneOffset() * toMs("minute");
const offsetDate = new Date(date.getTime() + currentOffset);
return `${offsetDate.getFullYear()+`0${offsetDate.getMonth()+1}`.slice(-2)+`0${offsetDate.getDate()}`.slice(-2)}T${`0${offsetDate.getHours()}`.slice(-2)}${`0${offsetDate.getMinutes()}`.slice(-2)}${`0${offsetDate.getSeconds()}`.slice(-2)}Z`
}
getRecurrenceString(object) {
if (!object || !object.freq) {
return
}
let result = "";
for (const field in object) {
let value = object[field];
if ("interval" === field && value < 2) {
continue
}
if ("until" === field) {
value = this.getAsciiStringByDate(value)
}
result += `${field}=${value};`
}
result = result.substring(0, result.length - 1);
return result.toUpperCase()
}
_parseExceptionToRawArray(value) {
return value.match(/(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2}))?(Z)?/)
}
getDateByAsciiString(exceptionText) {
if ("string" !== typeof exceptionText) {
return exceptionText
}
const result = this._parseExceptionToRawArray(exceptionText);
if (!result) {
return null
}
const [year, month, date, hours, minutes, seconds, isUtc] = this._createDateTuple(result);
if (isUtc) {
return new Date(Date.UTC(year, month, date, hours, minutes, seconds))
}
return new Date(year, month, date, hours, minutes, seconds)
}
_dispose() {
if (this.rRuleSet) {
delete this.rRuleSet;
this.rRuleSet = null
}
if (this.rRule) {
delete this.rRule;
this.rRule = null
}
}
_getTimeZoneOffset() {
return (new Date).getTimezoneOffset()
}
_initializeRRule(options, startDateUtc, until) {
const ruleOptions = _rrule.RRule.parseString(options.rule);
const {
firstDayOfWeek: firstDayOfWeek
} = options;
ruleOptions.dtstart = startDateUtc;
if (!ruleOptions.wkst && firstDayOfWeek) {
const weekDayNumbers = [6, 0, 1, 2, 3, 4, 5];
ruleOptions.wkst = weekDayNumbers[firstDayOfWeek]
}
if (until) {
ruleOptions.until = _m_utils_time_zone.default.setOffsetsToDate(until, [-_m_utils_time_zone.default.getClientTimezoneOffset(until), options.appointmentTimezoneOffset])
}
this._createRRule(ruleOptions);
if (options.exception) {
const exceptionStrings = options.exception;
const exceptionDates = exceptionStrings.split(",").map((rule => this.getDateByAsciiString(rule)));
exceptionDates.forEach((date => {
if (options.getPostProcessedException) {
date = options.getPostProcessedException(date)
}
const utcDate = _m_utils_time_zone.default.setOffsetsToDate(date, [-_m_utils_time_zone.default.getClientTimezoneOffset(date), options.appointmentTimezoneOffset]);
this.rRuleSet.exdate(utcDate)
}))
}
}
_createRRule(ruleOptions) {
this._dispose();
this.rRuleSet = new _rrule.RRuleSet;
this.rRule = new _rrule.RRule(ruleOptions);
this.rRuleSet.rrule(this.rRule)
}
_parseRecurrenceRule(recurrence) {
const ruleObject = {};
const ruleParts = recurrence.split(";");
for (let i = 0, len = ruleParts.length; i < len; i++) {
const rule = ruleParts[i].split("=");
const ruleName = rule[0].toLowerCase();
const ruleValue = rule[1];
ruleObject[ruleName] = ruleValue
}
const count = parseInt(ruleObject.count);
if (!isNaN(count)) {
ruleObject.count = count
}
if (ruleObject.interval) {
const interval = parseInt(ruleObject.interval);
if (!isNaN(interval)) {
ruleObject.interval = interval
}
} else {
ruleObject.interval = 1
}
if (ruleObject.freq && ruleObject.until) {
ruleObject.until = this.getDateByAsciiString(ruleObject.until)
}
return ruleObject
}
_createDateTuple(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[1]--;
parseResult.unshift(null);
return [parseInt(parseResult[1]), parseInt(parseResult[2]), parseInt(parseResult[3]), parseInt(parseResult[4]) || 0, parseInt(parseResult[5]) || 0, parseInt(parseResult[6]) || 0, isUtc]
}
}
class RecurrenceValidator {
validateRRule(rule, recurrence) {
if (this._brokenRuleNameExists(rule) || !freqNames.includes(rule.freq) || this._wrongCountRule(rule) || this._wrongIntervalRule(rule) || this._wrongDayOfWeek(rule) || this._wrongByMonthDayRule(rule) || this._wrongByMonth(rule) || this._wrongUntilRule(rule)) {
this._logBrokenRule(recurrence);
return false
}
return true
}
_wrongUntilRule(rule) {
let wrongUntil = false;
const {
until: until
} = rule;
if (void 0 !== until && !(until instanceof Date)) {
wrongUntil = true
}
return wrongUntil
}
_wrongCountRule(rule) {
let wrongCount = false;
const {
count: count
} = rule;
if (count && "string" === typeof count) {
wrongCount = true
}
return wrongCount
}
_wrongByMonthDayRule(rule) {
let wrongByMonthDay = false;
const byMonthDay = rule.bymonthday;
if (byMonthDay && isNaN(parseInt(byMonthDay))) {
wrongByMonthDay = true
}
return wrongByMonthDay
}
_wrongByMonth(rule) {
let wrongByMonth = false;
const byMonth = rule.bymonth;
if (byMonth && isNaN(parseInt(byMonth))) {
wrongByMonth = true
}
return wrongByMonth
}
_wrongIntervalRule(rule) {
let wrongInterval = false;
const {
interval: interval
} = rule;
if (interval && "string" === typeof interval) {
wrongInterval = true
}
return wrongInterval
}
_wrongDayOfWeek(rule) {
const byDay = rule.byday;
const daysByRule = getRecurrenceProcessor().daysFromByDayRule(rule);
let brokenDaysExist = false;
if ("" === byDay) {
brokenDaysExist = true
}(0, _iterator.each)(daysByRule, ((_, day) => {
if (!Object.prototype.hasOwnProperty.call(days, day)) {
brokenDaysExist = true;
return false
}
return
}));
return brokenDaysExist
}
_brokenRuleNameExists(rule) {
let brokenRuleExists = false;
(0, _iterator.each)(rule, (ruleName => {
if (!ruleNames.includes(ruleName)) {
brokenRuleExists = true;
return false
}
return
}));
return brokenRuleExists
}
_logBrokenRule(recurrence) {
if (!loggedWarnings.includes(recurrence)) {
_errors.default.log("W0006", recurrence);
loggedWarnings.push(recurrence)
}
}
}
},
70184:
/*!*****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_recurrence_editor.js ***!
\*****************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
__webpack_require__( /*! ../../ui/radio_group */ 14305);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../core/component_registrator */ 99393));
var _guid = _interopRequireDefault(__webpack_require__( /*! ../../core/guid */ 73176));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306);
var _type = __webpack_require__( /*! ../../core/utils/type */ 35922);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../localization/date */ 91500));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109));
var _button_group = _interopRequireDefault(__webpack_require__( /*! ../../ui/button_group */ 28236));
var _date_box = _interopRequireDefault(__webpack_require__( /*! ../../ui/date_box */ 29589));
var _editor = _interopRequireDefault(__webpack_require__( /*! ../../ui/editor/editor */ 96452));
var _form = _interopRequireDefault(__webpack_require__( /*! ../../ui/form */ 17737));
var _number_box = _interopRequireDefault(__webpack_require__( /*! ../../ui/number_box */ 34171));
var _themes = __webpack_require__( /*! ../../ui/themes */ 75811);
var _index = __webpack_require__( /*! ../scheduler/r1/timezone_calculator/index */ 6155);
var _m_recurrence = __webpack_require__( /*! ./m_recurrence */ 38227);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const REPEAT_END_EDITOR = "dx-recurrence-repeat-end";
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._recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)();
this._recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)();
this._recurrenceRule = this._recurrenceProcessor.evalRecurrenceRule(rule).rule
}
makeRules(string) {
this._recurrenceRule = this._recurrenceProcessor.evalRecurrenceRule(string).rule
}
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 this._recurrenceProcessor.getRecurrenceString(this._recurrenceRule)
}
getRules() {
return this._recurrenceRule
}
getDaysFromByDayRule() {
return this._recurrenceProcessor.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 : _date2.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)
}
getEditorByField(fieldName) {
let editor = this.getRecurrenceForm().getEditor(fieldName);
if (!(0, _type.isDefined)(editor)) {
switch (fieldName) {
case "byday":
editor = this._weekEditor;
break;
case "count":
editor = this._repeatCountEditor;
break;
case "until":
editor = this._repeatUntilDate
}
}
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",
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: 70,
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 = _date2.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 = _date2.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: 70,
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 [{
dataField: "repeatEnd",
editorType: "dxRadioGroup",
editorOptions: {
items: repeatEndTypes,
value: repeatType,
valueExpr: "type",
field: "repeatEnd",
itemTemplate: itemData => {
if ("count" === itemData.type) {
return this._renderRepeatCountEditor()
}
if ("until" === itemData.type) {
return this._renderRepeatUntilEditor()
}
return this._renderDefaultRepeatEnd()
},
layout: "vertical",
elementAttr: {
class: "dx-recurrence-radiogroup-repeat-type"
},
onValueChanged: args => this._repeatEndValueChangedHandler(args)
},
label: {
text: _message.default.format("dxScheduler-recurrenceEnd")
}
}]
}
_renderEditors($container) {
this._recurrenceForm = this._createComponent($container, _form.default, {
items: this._editors,
showValidationSummary: false,
scrollingEnabled: true,
showColonAfterLabel: false,
labelLocation: "top"
});
this._disableRepeatEndParts()
}
_setAriaDescribedBy(editor, $label) {
const labelId = `label-${new _guid.default}`;
editor.setAria("describedby", labelId);
editor.setAria("id", labelId, $label)
}
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)
}
_renderDefaultRepeatEnd() {
const $editorTemplate = (0, _renderer.default)(" ").addClass(REPEAT_END_EDITOR + "-wrapper");
(0, _renderer.default)(" ").text(_message.default.format("dxScheduler-recurrenceNever")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorTemplate);
return $editorTemplate
}
_repeatEndValueChangedHandler(args) {
const {
value: value
} = args;
this._disableRepeatEndParts(value);
if ("until" === value) {
this._recurrenceRule.makeRule(value, this._getUntilValue())
}
if ("count" === value) {
this._recurrenceRule.makeRule(value, this._repeatCountEditor.option("value"))
}
if ("never" === value) {
this._recurrenceRule.makeRule("count", "");
this._recurrenceRule.makeRule("until", "")
}
this._changeEditorValue()
}
_disableRepeatEndParts() {
let value = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this._recurrenceRule.getRepeatEndRule();
if ("until" === value) {
this._repeatCountEditor.option("disabled", true);
this._repeatUntilDate.option("disabled", false)
}
if ("count" === value) {
this._repeatCountEditor.option("disabled", false);
this._repeatUntilDate.option("disabled", true)
}
if ("never" === value) {
this._repeatCountEditor.option("disabled", true);
this._repeatUntilDate.option("disabled", true)
}
}
_renderRepeatCountEditor() {
const repeatCount = this._recurrenceRule.getRules().count || 1;
const $editorWrapper = (0, _renderer.default)(" ").addClass(REPEAT_END_EDITOR + "-wrapper");
(0, _renderer.default)(" ").text(_message.default.format("dxScheduler-recurrenceAfter")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorWrapper);
this._$repeatCountEditor = (0, _renderer.default)(" ").addClass("dx-recurrence-numberbox-repeat-count").appendTo($editorWrapper);
(0, _renderer.default)(" ").text(_message.default.format("dxScheduler-recurrenceRepeatCount")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorWrapper);
this._repeatCountEditor = this._createComponent(this._$repeatCountEditor, _number_box.default, {
stylingMode: getStylingModeFunc(),
field: "count",
format: "#",
width: 70,
min: 1,
showSpinButtons: true,
useLargeSpinButtons: false,
value: repeatCount,
onValueChanged: this._repeatCountValueChangeHandler.bind(this)
});
return $editorWrapper
}
_repeatCountValueChangeHandler(args) {
if ("count" === this._recurrenceRule.getRepeatEndRule()) {
const {
value: value
} = args;
this._recurrenceRule.makeRule("count", value);
this._changeEditorValue()
}
}
_formatUntilDate(date) {
if (this._recurrenceRule.getRules().until && _date.default.sameDate(this._recurrenceRule.getRules().until, date)) {
return date
}
return _date.default.setToDayEnd(date)
}
_renderRepeatUntilEditor() {
const repeatUntil = this._getUntilValue();
const $editorWrapper = (0, _renderer.default)(" ").addClass(REPEAT_END_EDITOR + "-wrapper");
(0, _renderer.default)(" ").text(_message.default.format("dxScheduler-recurrenceOn")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorWrapper);
this._$repeatDateEditor = (0, _renderer.default)(" ").addClass("dx-recurrence-datebox-until-date").appendTo($editorWrapper);
this._repeatUntilDate = this._createComponent(this._$repeatDateEditor, _date_box.default, {
stylingMode: getStylingModeFunc(),
field: "until",
value: repeatUntil,
type: "date",
onValueChanged: this._repeatUntilValueChangeHandler.bind(this),
calendarOptions: {
firstDayOfWeek: this._getFirstDayOfWeek()
},
useMaskBehavior: true
});
return $editorWrapper
}
_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 ? _index.PathTimeZoneConversion.fromAppointmentToSource : _index.PathTimeZoneConversion.fromGridToSource;
const dateInLocaleTimeZone = this.option("timeZoneCalculator").createDate(dateInTimeZone, {
path: path,
appointmentTimeZone: appointmentTimeZone
});
this._recurrenceRule.makeRule("until", dateInLocaleTimeZone);
this._changeEditorValue()
}
}
_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$_repeatCountEdi, _this$_weekEditor, _this$_repeatUntilDat;
switch (args.name) {
case "readOnly":
null === (_this$_recurrenceForm = this._recurrenceForm) || void 0 === _this$_recurrenceForm || _this$_recurrenceForm.option("readOnly", args.value);
null === (_this$_repeatCountEdi = this._repeatCountEditor) || void 0 === _this$_repeatCountEdi || _this$_repeatCountEdi.option("readOnly", args.value);
null === (_this$_weekEditor = this._weekEditor) || void 0 === _this$_weekEditor || _this$_weekEditor.option("readOnly", args.value);
null === (_this$_repeatUntilDat = this._repeatUntilDate) || void 0 === _this$_repeatUntilDat || _this$_repeatUntilDat.option("readOnly", args.value);
super._optionChanged(args);
break;
case "value":
this._recurrenceRule.makeRules(args.value);
this._changeRepeatIntervalLabel();
this._disableRepeatEndParts();
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 = _date2.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._$repeatDateEditor) {
this._repeatUntilDate.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._repeatCountEditor.option("value", count)
}
_changeRepeatUntilValue() {
this._repeatUntilDate.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 ? _index.PathTimeZoneConversion.fromSourceToAppointment : _index.PathTimeZoneConversion.fromSourceToGrid;
return this.option("timeZoneCalculator").createDate(untilDate, {
path: path,
appointmentTimeZone: appointmentTimeZone
})
}
toggle() {
this._freqEditor.focus()
}
setAria() {
if (this._switchEditor) {
this._switchEditor.setAria(arguments.length <= 0 ? void 0 : arguments[0], arguments.length <= 1 ? void 0 : arguments[1])
}
}
}(0, _component_registrator.default)("dxRecurrenceEditor", RecurrenceEditor);
exports.default = RecurrenceEditor
},
97468:
/*!*********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_scheduler.js ***!
\*********************************************************************************/
function(__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 */ 99393));
var _config = _interopRequireDefault(__webpack_require__( /*! ../../core/config */ 80209));
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../core/devices */ 20530));
var _element = __webpack_require__( /*! ../../core/element */ 6415);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _bindable_template = __webpack_require__( /*! ../../core/templates/bindable_template */ 93280);
var _empty_template = __webpack_require__( /*! ../../core/templates/empty_template */ 10688);
var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/callbacks */ 44504));
var _common = __webpack_require__( /*! ../../core/utils/common */ 20576);
var _data = __webpack_require__( /*! ../../core/utils/data */ 47617);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date_serialization */ 69434));
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479);
var _position = __webpack_require__( /*! ../../core/utils/position */ 37518);
var _type = __webpack_require__( /*! ../../core/utils/type */ 35922);
var _window = __webpack_require__( /*! ../../core/utils/window */ 58201);
var _data_helper = _interopRequireDefault(__webpack_require__( /*! ../../data_helper */ 53305));
var _visibility_change = __webpack_require__( /*! ../../events/visibility_change */ 80506);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../localization/date */ 91500));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109));
var _dialog = __webpack_require__( /*! ../../ui/dialog */ 15029);
var _themes = __webpack_require__( /*! ../../ui/themes */ 75811);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.errors */ 96688));
var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.widget */ 14390));
var _date3 = __webpack_require__( /*! ../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../scheduler/r1/timezone_calculator/index */ 6155);
var _index2 = __webpack_require__( /*! ../scheduler/r1/utils/index */ 94084);
var _m_form = __webpack_require__( /*! ./appointment_popup/m_form */ 25387);
var _m_popup = __webpack_require__( /*! ./appointment_popup/m_popup */ 77135);
var _m_appointment_data_provider = __webpack_require__( /*! ./appointments/data_provider/m_appointment_data_provider */ 92823);
var _m_appointment_collection = _interopRequireDefault(__webpack_require__( /*! ./appointments/m_appointment_collection */ 16993));
var _m_header = __webpack_require__( /*! ./header/m_header */ 5757);
var _m_appointment_adapter = __webpack_require__( /*! ./m_appointment_adapter */ 72734);
var _m_appointments_layout_manager = _interopRequireDefault(__webpack_require__( /*! ./m_appointments_layout_manager */ 43919));
var _m_compact_appointments_helper = __webpack_require__( /*! ./m_compact_appointments_helper */ 38088);
var _m_constants = __webpack_require__( /*! ./m_constants */ 6324);
var _m_data_structures = __webpack_require__( /*! ./m_data_structures */ 98865);
var _m_expression_utils = __webpack_require__( /*! ./m_expression_utils */ 30906);
var _m_loading = __webpack_require__( /*! ./m_loading */ 28066);
var _m_recurrence = __webpack_require__( /*! ./m_recurrence */ 38227);
var _m_subscribes = _interopRequireDefault(__webpack_require__( /*! ./m_subscribes */ 86681));
var _m_utils = __webpack_require__( /*! ./m_utils */ 84110);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ./m_utils_time_zone */ 57880));
var _index3 = __webpack_require__( /*! ./options_validator/index */ 18397);
var _m_agenda_resource_processor = __webpack_require__( /*! ./resources/m_agenda_resource_processor */ 547);
var _m_utils2 = __webpack_require__( /*! ./resources/m_utils */ 31359);
var _m_desktop_tooltip_strategy = __webpack_require__( /*! ./tooltip_strategies/m_desktop_tooltip_strategy */ 48158);
var _m_mobile_tooltip_strategy = __webpack_require__( /*! ./tooltip_strategies/m_mobile_tooltip_strategy */ 60737);
var _m_agenda = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_agenda */ 32316));
var _m_timeline_day = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_day */ 10356));
var _m_timeline_month = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_month */ 91274));
var _m_timeline_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_week */ 32414));
var _m_timeline_work_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_work_week */ 23855));
var _m_work_space_day = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_day */ 74228));
var _m_work_space_month = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_month */ 50011));
var _m_work_space_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_week */ 36828));
var _m_work_space_work_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_work_week */ 29544));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
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_OCCURENCE = "editOccurence",
RECURRENCE_EDITING_MODE_CANCEL = "cancel";
class Scheduler extends _ui2.default {
_getDefaultOptions() {
const defaultOptions = (0, _extend.extend)(super._getDefaultOptions(), {
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: [],
loadedResources: [],
resourceLoaderMap: new Map,
dataSource: null,
customizeDateNavigatorText: void 0,
appointmentTemplate: "item",
dropDownAppointmentTemplate: "dropDownAppointment",
appointmentCollectorTemplate: "appointmentCollector",
dataCellTemplate: null,
timeCellTemplate: null,
resourceCellTemplate: null,
dateCellTemplate: null,
startDayHour: 0,
endDayHour: 24,
offset: 0,
editing: {
allowAdding: true,
allowDeleting: true,
allowDragging: true,
allowResizing: true,
allowUpdating: true,
allowTimeZoneEditing: false
},
showAllDayPanel: true,
showCurrentTimeIndicator: true,
shadeUntilCurrentTime: false,
indicatorUpdateInterval: 3e5,
indicatorTime: void 0,
recurrenceEditMode: "dialog",
cellDuration: 30,
maxAppointmentsPerCell: "auto",
selectedCellData: [],
groupByDate: false,
onAppointmentRendered: null,
onAppointmentClick: null,
onAppointmentDblClick: null,
onAppointmentContextMenu: null,
onCellClick: null,
onCellContextMenu: null,
onAppointmentAdding: null,
onAppointmentAdded: null,
onAppointmentUpdating: null,
onAppointmentUpdated: null,
onAppointmentDeleting: null,
onAppointmentDeleted: null,
onAppointmentFormOpening: null,
onAppointmentTooltipShowing: null,
appointmentTooltipTemplate: "appointmentTooltip",
appointmentPopupTemplate: "appointmentPopup",
crossScrollingEnabled: false,
useDropDownViewSwitcher: false,
startDateExpr: "startDate",
endDateExpr: "endDate",
textExpr: "text",
descriptionExpr: "description",
allDayExpr: "allDay",
recurrenceRuleExpr: "recurrenceRule",
recurrenceExceptionExpr: "recurrenceException",
disabledExpr: "disabled",
remoteFiltering: false,
timeZone: "",
startDateTimeZoneExpr: "startDateTimeZone",
endDateTimeZoneExpr: "endDateTimeZone",
noDataText: _message.default.format("dxCollectionWidget-noDataText"),
adaptivityEnabled: false,
allowMultipleCellSelection: true,
scrolling: {
mode: "standard"
},
allDayPanelMode: "all",
renovateRender: true,
_draggingMode: "outlook",
_appointmentTooltipOffset: {
x: 0,
y: 0
},
_appointmentTooltipButtonsPosition: "bottom",
_appointmentTooltipOpenButtonText: _message.default.format("dxScheduler-openAppointment"),
_appointmentCountPerCell: 2,
_collectorOffset: 0,
_appointmentOffset: 26,
toolbar: [{
location: "before",
defaultElement: "dateNavigator"
}, {
location: "after",
defaultElement: "viewSwitcher"
}]
});
return (0, _extend.extend)(true, defaultOptions, {
integrationOptions: {
useDeferUpdateForTemplates: false
}
})
}
get filteredItems() {
if (!this._filteredItems) {
this._filteredItems = []
}
return this._filteredItems
}
set filteredItems(value) {
this._filteredItems = value
}
get preparedItems() {
if (!this._preparedItems) {
this._preparedItems = []
}
return this._preparedItems
}
set preparedItems(value) {
this._preparedItems = value
}
get currentView() {
return _index2.viewsUtils.getCurrentView(this.option("currentView"), this.option("views"))
}
get currentViewType() {
return (0, _type.isObject)(this.currentView) ? this.currentView.type : this.currentView
}
get timeZoneCalculator() {
if (!this._timeZoneCalculator) {
this._timeZoneCalculator = (0, _index.createTimeZoneCalculator)(this.option("timeZone"))
}
return this._timeZoneCalculator
}
_setDeprecatedOptions() {
super._setDeprecatedOptions();
(0, _extend.extend)(this._deprecatedOptions, {
dropDownAppointmentTemplate: {
since: "19.2",
message: "appointmentTooltipTemplate"
}
})
}
_defaultOptionsRules() {
return super._defaultOptionsRules().concat([{
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, index, element) {
const {
text: text
} = data;
text.split(" ").forEach(((text, index) => {
const span = (0, _renderer.default)(" ").text(text).addClass("dx-scheduler-header-panel-cell-date");
(0, _renderer.default)(element).append(span);
if (!index) {
(0, _renderer.default)(element).append(" ")
}
}))
},
_appointmentTooltipButtonsPosition: "top",
_appointmentTooltipOpenButtonText: null,
_appointmentCountPerCell: 1,
_collectorOffset: 20,
_appointmentOffset: 30
}
}, {
device: () => (0, _themes.isMaterial)(),
options: {
_appointmentTooltipOffset: {
x: 0,
y: 11
}
}
}])
}
_postponeDataSourceLoading(promise) {
this.postponedOperations.add("_reloadDataSource", this._reloadDataSource.bind(this), promise)
}
_postponeResourceLoading() {
const whenLoaded = this.postponedOperations.add("loadResources", (() => {
const groups = this._getCurrentViewOption("groups");
return (0, _m_utils2.loadResources)(groups, this.option("resources"), this.option("resourceLoaderMap"))
}));
const resolveCallbacks = new _deferred.Deferred;
whenLoaded.done((resources => {
this.option("loadedResources", resources);
resolveCallbacks.resolve(resources)
}));
this._postponeDataSourceLoading(whenLoaded);
return resolveCallbacks.promise()
}
_optionChanged(args) {
var _this$_header, _this$_header2, _this$_header4;
this.validateOptions();
let {
value: value
} = args;
const {
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);
break;
case "currentDate":
value = this._dateOption(name);
value = _date.default.trimTime(new Date(value));
this.option("selectedCellData", []);
this._workSpace.option(name, new Date(value));
null === (_this$_header = this._header) || void 0 === _this$_header || _this$_header.option(name, new Date(value));
null === (_this$_header2 = this._header) || void 0 === _this$_header2 || _this$_header2.option("startViewDate", this.getStartViewDate());
this._appointments.option("items", []);
this._filterAppointmentsByDate();
this._postponeDataSourceLoading();
break;
case "dataSource":
this._initDataSource();
this.appointmentDataProvider.setDataSource(this._dataSource);
this._postponeResourceLoading().done((() => {
this._filterAppointmentsByDate();
this._updateOption("workSpace", "showAllDayPanel", this.option("showAllDayPanel"))
}));
break;
case "min":
case "max":
value = this._dateOption(name);
this._updateOption("header", name, new Date(value));
this._updateOption("workSpace", name, new Date(value));
break;
case "views":
if (this._getCurrentViewOptions()) {
this.repaint()
} else {
var _this$_header3;
null === (_this$_header3 = this._header) || void 0 === _this$_header3 || _this$_header3.option(name, value)
}
break;
case "useDropDownViewSwitcher":
null === (_this$_header4 = this._header) || void 0 === _this$_header4 || _this$_header4.option(name, value);
break;
case "currentView":
this._appointments.option({
items: [],
allowDrag: this._allowDragging(),
allowResize: this._allowResizing(),
itemTemplate: this._getAppointmentTemplate("appointmentTemplate")
});
this._postponeResourceLoading().done((resources => {
var _this$_header5;
this._refreshWorkSpace(resources);
null === (_this$_header5 = this._header) || void 0 === _this$_header5 || _this$_header5.option(this._headerConfig());
this._filterAppointmentsByDate();
this._appointments.option("allowAllDayResize", "day" !== value)
}));
this.postponedOperations.callPostponedOperations();
break;
case "appointmentTemplate":
this._appointments.option("itemTemplate", value);
break;
case "dateCellTemplate":
case "resourceCellTemplate":
case "dataCellTemplate":
case "timeCellTemplate":
this.repaint();
break;
case "groups":
this._postponeResourceLoading().done((resources => {
this._refreshWorkSpace(resources);
this._filterAppointmentsByDate()
}));
break;
case "resources":
this._dataAccessors.resources = (0, _m_utils2.createExpressions)(this.option("resources"));
this.agendaResourceProcessor.initializeState(this.option("resources"));
this.updateInstances();
this.option("resourceLoaderMap").clear();
this._postponeResourceLoading().done((resources => {
this._appointments.option("items", []);
this._refreshWorkSpace(resources);
this._filterAppointmentsByDate();
this._createAppointmentPopupForm()
}));
break;
case "startDayHour":
case "endDayHour":
this.updateInstances();
this._appointments.option("items", []);
this._updateOption("workSpace", name, value);
this._appointments.repaint();
this._filterAppointmentsByDate();
this._postponeDataSourceLoading();
break;
case "offset":
this.updateInstances();
this._appointments.option("items", []);
this._updateOption("workSpace", "viewOffset", this.normalizeViewOffsetValue(value));
this._appointments.repaint();
this._filterAppointmentsByDate();
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":
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._workSpace.option(name, value);
break;
case "crossScrollingEnabled":
this._postponeResourceLoading().done((resources => {
this._appointments.option("items", []);
this._refreshWorkSpace(resources);
if (this._readyToRenderAppointments) {
this._appointments.option("items", this._getAppointmentsToRepaint())
}
}));
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._getAppointmentsToRepaint())
}
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 = this._editing;
this._bringEditingModeToAppointments(editing);
this.hideAppointmentTooltip();
this._cleanPopup();
break
}
case "showAllDayPanel":
this.updateInstances();
this.repaint();
break;
case "showCurrentTimeIndicator":
case "indicatorTime":
case "indicatorUpdateInterval":
case "shadeUntilCurrentTime":
case "groupByDate":
this._updateOption("workSpace", name, value);
this.repaint();
break;
case "appointmentDragging":
case "appointmentTooltipTemplate":
case "appointmentPopupTemplate":
case "recurrenceEditMode":
case "remoteFiltering":
case "timeZone":
this.updateInstances();
this.repaint();
break;
case "dropDownAppointmentTemplate":
case "appointmentCollectorTemplate":
case "_appointmentTooltipOffset":
case "_appointmentTooltipButtonsPosition":
case "_appointmentTooltipOpenButtonText":
case "_appointmentCountPerCell":
case "_collectorOffset":
case "_appointmentOffset":
this.repaint();
break;
case "dateSerializationFormat":
case "maxAppointmentsPerCell":
break;
case "startDateExpr":
case "endDateExpr":
case "startDateTimeZoneExpr":
case "endDateTimeZoneExpr":
case "textExpr":
case "descriptionExpr":
case "allDayExpr":
case "recurrenceRuleExpr":
case "recurrenceExceptionExpr":
case "disabledExpr":
this._updateExpression(name, value);
this.appointmentDataProvider.updateDataAccessors(this._dataAccessors);
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.updateInstances();
this._updateOption("workSpace", args.fullName, value);
break;
case "renovateRender":
this._updateOption("workSpace", name, value);
break;
case "_draggingMode":
this._workSpace.option("draggingMode", value);
break;
case "toolbar":
this._header ? this._header.option("items", value) : this.repaint();
break;
case "loadedResources":
case "resourceLoaderMap":
break;
default:
super._optionChanged(args)
}
}
_dateOption(optionName) {
const optionValue = this._getCurrentViewOption(optionName);
return _date_serialization.default.deserializeDate(optionValue)
}
_getSerializationFormat(optionName) {
const value = this._getCurrentViewOption(optionName);
if ("number" === typeof value) {
return "number"
}
if (!(0, _type.isString)(value)) {
return
}
return _date_serialization.default.getDateSerializationFormat(value)
}
_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.getLayoutManager().appointmentRenderingStrategyName
}
_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.currentViewType || this.currentView.intervalCount > 1
}
_isAllDayExpanded() {
return this.option("showAllDayPanel") && this.appointmentDataProvider.hasAllDayAppointments(this.filteredItems, this.preparedItems)
}
_getTimezoneOffsetByOption(date) {
return _m_utils_time_zone.default.calculateTimezoneByValue(this.option("timeZone"), date)
}
_filterAppointmentsByDate() {
const dateRange = this._workSpace.getDateRange();
const startDate = this.timeZoneCalculator.createDate(dateRange[0], {
path: "fromGrid"
});
const endDate = this.timeZoneCalculator.createDate(dateRange[1], {
path: "fromGrid"
});
this.appointmentDataProvider.filterByDate(startDate, endDate, this.option("remoteFiltering"), this.option("dateSerializationFormat"))
}
_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$_workSpaceRecal;
null === (_this$_workSpaceRecal = this._workSpaceRecalculation) || void 0 === _this$_workSpaceRecal || _this$_workSpaceRecal.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.filteredItems && workspace) {
if (isForce || !isFixedHeight || !isFixedWidth) {
workspace.option("allDayExpanded", this._isAllDayExpanded());
workspace._dimensionChanged();
const appointments = this.getLayoutManager().createAppointmentsMap(this.filteredItems);
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._initExpressions({
startDate: this.option("startDateExpr"),
endDate: this.option("endDateExpr"),
startDateTimeZone: this.option("startDateTimeZoneExpr"),
endDateTimeZone: this.option("endDateTimeZoneExpr"),
allDay: this.option("allDayExpr"),
text: this.option("textExpr"),
description: this.option("descriptionExpr"),
recurrenceRule: this.option("recurrenceRuleExpr"),
recurrenceException: this.option("recurrenceExceptionExpr"),
disabled: this.option("disabledExpr")
});
super._init();
this._initAllDayPanel();
this._initDataSource();
this._customizeDataSourceLoadOptions();
this.$element().addClass("dx-scheduler");
this._initEditing();
this.updateInstances();
this._initActions();
this._compactAppointmentsHelper = new _m_compact_appointments_helper.CompactAppointmentsHelper(this);
this._asyncTemplatesTimers = [];
this._dataSourceLoadedCallback = (0, _callbacks.default)();
this._subscribes = _m_subscribes.default;
this.agendaResourceProcessor = new _m_agenda_resource_processor.AgendaResourceProcessor(this.option("resources"));
this._optionsValidator = new _index3.SchedulerOptionsValidator;
this._optionsValidatorErrorHandler = new _index3.SchedulerOptionsValidatorErrorsHandler
}
createAppointmentDataProvider() {
var _this$appointmentData;
null === (_this$appointmentData = this.appointmentDataProvider) || void 0 === _this$appointmentData || _this$appointmentData.destroy();
this.appointmentDataProvider = new _m_appointment_data_provider.AppointmentDataProvider({
dataSource: this._dataSource,
dataAccessors: this._dataAccessors,
timeZoneCalculator: this.timeZoneCalculator,
dateSerializationFormat: this.option("dateSerializationFormat"),
resources: this.option("resources"),
startDayHour: this._getCurrentViewOption("startDayHour"),
endDayHour: this._getCurrentViewOption("endDayHour"),
viewOffset: this.getViewOffsetMs(),
appointmentDuration: this._getCurrentViewOption("cellDuration"),
allDayPanelMode: this._getCurrentViewOption("allDayPanelMode"),
showAllDayPanel: this.option("showAllDayPanel"),
getLoadedResources: () => this.option("loadedResources"),
getIsVirtualScrolling: () => this.isVirtualScrolling(),
getSupportAllDayRow: () => this._workSpace.supportAllDayRow(),
getViewType: () => this._workSpace.type,
getViewDirection: () => this._workSpace.viewDirection,
getDateRange: () => this._workSpace.getDateRange(),
getGroupCount: () => this._workSpace._getGroupCount(),
getViewDataProvider: () => this._workSpace.viewDataProvider
})
}
updateInstances() {
this._timeZoneCalculator = null;
if (this.getWorkSpace()) {
this.createAppointmentDataProvider()
}
}
_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()
}
_updatePreparedItems(items) {
this.preparedItems = (0, _index2.getPreparedDataItems)(items, this._dataAccessors, this._getCurrentViewOption("cellDuration"), this.timeZoneCalculator)
}
_dataSourceChangedHandler(result) {
if (this._readyToRenderAppointments) {
this._workSpaceRecalculation.done((() => {
this._updatePreparedItems(result);
this._renderAppointments();
this.getWorkSpace().onDataSourceChanged(this.filteredItems)
}))
}
}
isVirtualScrolling() {
var _currentViewOptions$s;
const workspace = this.getWorkSpace();
if (workspace) {
return workspace.isVirtualScrolling()
}
const currentViewOptions = this._getCurrentViewOptions();
const scrolling = this.option("scrolling");
return "virtual" === (null === scrolling || void 0 === scrolling ? void 0 : scrolling.mode) || "virtual" === (null === currentViewOptions || void 0 === currentViewOptions || null === (_currentViewOptions$s = currentViewOptions.scrolling) || void 0 === _currentViewOptions$s ? void 0 : _currentViewOptions$s.mode)
}
_filterAppointments() {
this.filteredItems = this.appointmentDataProvider.filter(this.preparedItems)
}
_renderAppointments() {
const workspace = this.getWorkSpace();
this._filterAppointments();
workspace.option("allDayExpanded", this._isAllDayExpanded());
let viewModel = [];
if (this._isVisible()) {
viewModel = this._getAppointmentsToRepaint()
}
this._appointments.option("items", viewModel);
this.appointmentDataProvider.cleanState()
}
_getAppointmentsToRepaint() {
const layoutManager = this.getLayoutManager();
const appointmentsMap = layoutManager.createAppointmentsMap(this.filteredItems);
return layoutManager.getRepaintedAppointments(appointmentsMap, this.getAppointmentsInstance().option("items"))
}
_initExpressions(fields) {
this._dataAccessors = _m_utils.utils.dataAccessors.create(fields, this._dataAccessors, (0, _config.default)().forceIsoDateParsing, this.option("dateSerializationFormat"));
this._dataAccessors.resources = (0, _m_utils2.createExpressions)(this.option("resources"))
}
_updateExpression(name, value) {
const exprObj = {};
exprObj[name.replace("Expr", "")] = value;
this._initExpressions(exprObj)
}
getResourceDataAccessors() {
return this._dataAccessors.resources
}
_initEditing() {
const editing = this.option("editing");
this._editing = {
allowAdding: !!editing,
allowUpdating: !!editing,
allowDeleting: !!editing,
allowResizing: !!editing,
allowDragging: !!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;
this.$element().toggleClass("dx-scheduler-readonly", this._isReadOnly())
}
_isReadOnly() {
let result = true;
const editing = this._editing;
for (const prop in editing) {
if (Object.prototype.hasOwnProperty.call(editing, prop)) {
result = result && !editing[prop]
}
}
return result
}
_dispose() {
var _this$_recurrenceDial;
this._appointmentTooltip && this._appointmentTooltip.dispose();
null === (_this$_recurrenceDial = this._recurrenceDialog) || void 0 === _this$_recurrenceDial || _this$_recurrenceDial.hide(RECURRENCE_EDITING_MODE_CANCEL);
this.hideAppointmentPopup();
this.hideAppointmentTooltip();
this._asyncTemplatesTimers.forEach(clearTimeout);
this._asyncTemplatesTimers = [];
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)()
}
_initMarkup() {
super._initMarkup();
this._renderMainContainer();
this._renderHeader();
this._layoutManager = new _m_appointments_layout_manager.default(this);
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.option("loadedResources"));
this._dataSourceChangedHandler(this._dataSource.items());
this._fireContentReadyAction()
} else {
const groups = this._getCurrentViewOption("groups");
(0, _m_utils2.loadResources)(groups, this.option("resources"), this.option("resourceLoaderMap")).done((resources => {
this.option("loadedResources", resources);
this._initMarkupCore(resources);
this._reloadDataSource()
}))
}
}
_createAppointmentPopupForm() {
var _this$_appointmentPop;
if (this._appointmentForm) {
var _this$_appointmentFor;
null === (_this$_appointmentFor = this._appointmentForm.form) || void 0 === _this$_appointmentFor || _this$_appointmentFor.dispose()
}
this._appointmentForm = this.createAppointmentForm();
null === (_this$_appointmentPop = this._appointmentPopup) || void 0 === _this$_appointmentPop || _this$_appointmentPop.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 = {
createResourceEditorModel: () => (0, _m_utils2.createResourceEditorModel)(this.option("resources"), this.option("loadedResources")),
getDataAccessors: () => this._dataAccessors,
createComponent: (element, component, options) => this._createComponent(element, component, options),
getEditingConfig: () => this._editing,
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(),
getResources: () => this.option("resources"),
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),
updateScrollPosition: (startDate, resourceItem, inAllDayRow) => {
this._workSpace.updateScrollPosition(startDate, resourceItem, inAllDayRow)
}
};
return new _m_popup.AppointmentPopup(scheduler, form)
}
_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("getTextAndFormatDate", appointment, targetedAppointment, format),
getAppointmentDisabled: appointment => (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this._dataAccessors, this.timeZoneCalculator).disabled,
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 = (0, _m_appointment_adapter.createAppointmentAdapter)(targetedAppointment, this._dataAccessors, this.timeZoneCalculator);
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(resources) {
this._readyToRenderAppointments = (0, _window.hasWindow)();
this._workSpace && this._cleanWorkspace();
this._renderWorkSpace(resources);
this._appointments.option({
fixedContainer: this._workSpace.getFixedContainer(),
allDayContainer: this._workSpace.getAllDayContainer()
});
this._waitAsyncTemplate((() => {
var _this$_workSpaceRecal2;
return null === (_this$_workSpaceRecal2 = this._workSpaceRecalculation) || void 0 === _this$_workSpaceRecal2 ? void 0 : _this$_workSpaceRecal2.resolve()
}));
this.createAppointmentDataProvider();
this._filterAppointmentsByDate();
this._validateKeyFieldIfAgendaExist()
}
_isDataSourceLoaded() {
return this._dataSource && this._dataSource.isLoaded()
}
_render() {
var _this$getWorkSpace;
this._toggleSmallClass();
this._toggleAdaptiveClass();
null === (_this$getWorkSpace = this.getWorkSpace()) || void 0 === _this$getWorkSpace || _this$getWorkSpace.updateHeaderEmptyCellWidth();
super._render()
}
_renderHeader() {
if (0 !== this.option("toolbar").length) {
const $header = (0, _renderer.default)(" ").appendTo(this._mainContainer);
this._header = this._createComponent($header, _m_header.SchedulerHeader, this._headerConfig())
}
}
_headerConfig() {
const currentViewOptions = this._getCurrentViewOptions();
const countConfig = this._getViewCountConfig();
const result = (0, _extend.extend)({
firstDayOfWeek: this.getFirstDayOfWeek(),
currentView: this.option("currentView"),
isAdaptive: this.option("adaptivityEnabled"),
tabIndex: this.option("tabIndex"),
focusStateEnabled: this.option("focusStateEnabled"),
rtlEnabled: this.option("rtlEnabled"),
useDropDownViewSwitcher: this.option("useDropDownViewSwitcher"),
customizeDateNavigatorText: this.option("customizeDateNavigatorText"),
agendaDuration: currentViewOptions.agendaDuration || 7
}, currentViewOptions);
result.intervalCount = countConfig.intervalCount;
result.views = this.option("views");
result.min = new Date(this._dateOption("min"));
result.max = new Date(this._dateOption("max"));
result.currentDate = _date.default.trimTime(new Date(this._dateOption("currentDate")));
result.onCurrentViewChange = name => {
this.option("currentView", name)
};
result.onCurrentDateChange = date => {
this.option("currentDate", date)
};
result.items = this.option("toolbar");
result.startViewDate = this.getStartViewDate();
result.todayDate = () => {
const result = this.timeZoneCalculator.createDate(new Date, {
path: "toGrid"
});
return result
};
return result
}
_appointmentsConfig() {
const config = {
getResources: () => this.option("resources"),
getResourceDataAccessors: this.getResourceDataAccessors.bind(this),
getAgendaResourceProcessor: () => this.agendaResourceProcessor,
getAppointmentColor: this.createGetAppointmentColor(),
getAppointmentDataProvider: () => this.appointmentDataProvider,
dataAccessors: this._dataAccessors,
observer: this,
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"),
currentView: this.currentView,
groups: this._getCurrentViewOption("groups"),
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
},
isVerticalViewDirection: () => "vertical" === this.getRenderingStrategyInstance().getDirection(),
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
}
getCollectorOffset() {
if (this._workSpace.needApplyCollectorOffset() && !this.option("adaptivityEnabled")) {
return this.option("_collectorOffset")
}
return 0
}
getAppointmentDurationInMinutes() {
return this._getCurrentViewOption("cellDuration")
}
_getCurrentViewType() {
return this.currentViewType
}
_renderWorkSpace(groups) {
var _this$_header6;
this._readyToRenderAppointments && this._toggleSmallClass();
const $workSpace = (0, _renderer.default)(" ").appendTo(this._mainContainer);
const countConfig = this._getViewCountConfig();
const workSpaceComponent = VIEWS_CONFIG[this._getCurrentViewType()].workSpace;
const workSpaceConfig = this._workSpaceConfig(groups, countConfig);
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());
this._recalculateWorkspace();
countConfig.startDate && (null === (_this$_header6 = this._header) || void 0 === _this$_header6 ? void 0 : _this$_header6.option("currentDate", this._workSpace._getHeaderDate()));
this._appointments.option("_collectorOffset", this.getCollectorOffset())
}
_getViewCountConfig() {
const currentView = this.option("currentView");
const view = this._getViewByName(currentView);
const viewCount = view && view.intervalCount || 1;
const startDate = view && view.startDate || null;
return {
intervalCount: viewCount,
startDate: startDate
}
}
_getViewByName(name) {
const views = this.option("views");
for (let i = 0; i < views.length; i++) {
if (views[i].name === name || views[i].type === name || views[i] === name) {
return views[i]
}
}
}
_recalculateWorkspace() {
this._workSpaceRecalculation = new _deferred.Deferred;
this._waitAsyncTemplate((() => {
(0, _visibility_change.triggerResizeEvent)(this._workSpace.$element());
this._workSpace.renderCurrentDateTimeLineAndShader()
}))
}
_workSpaceConfig(groups, countConfig) {
var _currentViewOptions$s2;
const currentViewOptions = this._getCurrentViewOptions();
const scrolling = this.option("scrolling");
const isVirtualScrolling = "virtual" === scrolling.mode || "virtual" === (null === (_currentViewOptions$s2 = currentViewOptions.scrolling) || void 0 === _currentViewOptions$s2 ? void 0 : _currentViewOptions$s2.mode);
const horizontalVirtualScrollingAllowed = isVirtualScrolling && (!(0, _type.isDefined)(scrolling.orientation) || ["horizontal", "both"].filter((item => {
var _currentViewOptions$s3;
return scrolling.orientation === item || (null === (_currentViewOptions$s3 = currentViewOptions.scrolling) || void 0 === _currentViewOptions$s3 ? void 0 : _currentViewOptions$s3.orientation) === item
})).length > 0);
const crossScrollingEnabled = this.option("crossScrollingEnabled") || horizontalVirtualScrollingAllowed || (0, _index2.isTimelineView)(this.currentViewType);
const result = (0, _extend.extend)({
resources: this.option("resources"),
loadedResources: this.option("loadedResources"),
getFilteredItems: () => this.filteredItems,
getResourceDataAccessors: this.getResourceDataAccessors.bind(this),
noDataText: this.option("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"),
allDayExpanded: this._appointments.option("items"),
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._getCurrentViewOption("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),
onRenderAppointments: this._renderAppointments.bind(this),
onShowAllDayPanel: value => this.option("showAllDayPanel", value),
getHeaderHeight: () => _m_utils.utils.DOM.getHeaderHeight(this._header),
onScrollEnd: () => this._appointments.updateResizableArea(),
renovateRender: this._isRenovatedRender(isVirtualScrolling)
}, currentViewOptions);
result.observer = this;
result.intervalCount = countConfig.intervalCount;
result.startDate = countConfig.startDate;
result.groups = groups;
result.onCellClick = this._createActionByOption("onCellClick");
result.onCellContextMenu = this._createActionByOption("onCellContextMenu");
result.currentDate = _date.default.trimTime(new Date(this._dateOption("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;
result.getAppointmentDataProvider = () => this.appointmentDataProvider;
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()
}
}
_getCurrentViewOptions() {
return this.currentView
}
_getCurrentViewOption(optionName) {
if (this.currentView && void 0 !== this.currentView[optionName]) {
return this.currentView[optionName]
}
return this.option(optionName)
}
_getAppointmentTemplate(optionName) {
const currentViewOptions = this._getCurrentViewOptions();
if (currentViewOptions && currentViewOptions[optionName]) {
return this._getTemplate(currentViewOptions[optionName])
}
return this._getTemplateByOption(optionName)
}
_updateOption(viewName, optionName, value) {
const currentViewOptions = this._getCurrentViewOptions();
if (!currentViewOptions || !(0, _type.isDefined)(currentViewOptions[optionName])) {
this[`_${viewName}`].option(optionName, value)
}
}
_refreshWorkSpace(groups) {
this._cleanWorkspace();
delete this._workSpace;
this._renderWorkSpace(groups);
if (this._readyToRenderAppointments) {
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$_appointmentPop2;
null === (_this$_appointmentPop2 = this._appointmentPopup) || void 0 === _this$_appointmentPop2 || _this$_appointmentPop2.dispose()
}
_checkRecurringAppointment(rawAppointment, singleAppointment, exceptionDate, callback, isDeleted, isPopupEditing, dragEvent, recurrenceEditMode) {
const recurrenceRule = _m_expression_utils.ExpressionUtils.getField(this._dataAccessors, "recurrenceRule", rawAppointment);
if (!(0, _m_recurrence.getRecurrenceProcessor)().evalRecurrenceRule(recurrenceRule).isValid || !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_OCCURENCE && 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, this._timeZoneCalculator);
const singleRawAppointment = _extends({}, newRawAppointment);
delete singleRawAppointment[this._dataAccessors.expr.recurrenceExceptionExpr];
delete singleRawAppointment[this._dataAccessors.expr.recurrenceRuleExpr];
const keyPropertyName = this.appointmentDataProvider.keyName;
delete singleRawAppointment[keyPropertyName];
const canCreateNewAppointment = !isDeleted && !isPopupEditing;
if (canCreateNewAppointment) {
this.addAppointment(singleRawAppointment)
}
if (isPopupEditing) {
this._appointmentPopup.show(singleRawAppointment, {
isToolbarVisible: true,
action: _m_popup.ACTION_TO_APPOINTMENT.EXCLUDE_FROM_SERIES,
excludeInfo: {
sourceAppointment: rawAppointment,
updatedAppointment: appointment.source()
}
});
this._editAppointmentData = rawAppointment
} else {
this._updateAppointment(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_OCCURENCE
}],
popupOptions: {
wrapperAttr: {
class: "dx-dialog"
}
}
});
return this._recurrenceDialog.show()
}
_getUpdatedData(rawAppointment) {
const viewOffset = this.getViewOffsetMs();
const getConvertedFromGrid = date => {
if (!date) {
return
}
const result = this.timeZoneCalculator.createDate(date, {
path: "fromGrid"
});
return _date3.dateUtilsTs.addOffsets(result, [-viewOffset])
};
const isValidDate = date => !isNaN(new Date(date).getTime());
const targetCell = this.getTargetCellData();
const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator);
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 (!isValidDate(appointmentStartDate)) {
appointmentStartDate = resultedStartDate
}
if (!isValidDate(appointmentEndDate)) {
appointmentEndDate = cellEndDate
}
const duration = appointmentEndDate.getTime() - appointmentStartDate.getTime();
const isKeepAppointmentHours = this._workSpace.keepOriginalHours() && isValidDate(appointment.startDate) && isValidDate(cellStartDate);
if (isKeepAppointmentHours) {
const startDate = this.timeZoneCalculator.createDate(appointmentStartDate, {
path: "toGrid"
});
const timeInMs = startDate.getTime() - _date.default.trimTime(startDate).getTime();
const targetCellStartDate = _date3.dateUtilsTs.addOffsets(targetCell.startDate, [-viewOffset]);
resultedStartDate = new Date(_date.default.trimTime(targetCellStartDate).getTime() + timeInMs);
resultedStartDate = this.timeZoneCalculator.createDate(resultedStartDate, {
path: "fromGrid"
})
}
const result = (0, _m_appointment_adapter.createAppointmentAdapter)({}, this._dataAccessors, this.timeZoneCalculator);
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._getCurrentViewOption("endDayHour"))
}
}
result.startDate = _date3.dateUtilsTs.addOffsets(result.startDate, [viewOffset]);
result.endDate = _date3.dateUtilsTs.addOffsets(resultedEndDate, [viewOffset]);
const rawResult = result.source();
(0, _m_utils2.setResourceToAppointment)(this.option("resources"), this.getResourceDataAccessors(), rawResult, targetCell.groups);
return rawResult
}
getTargetedAppointment(appointment, element) {
const settings = _m_utils.utils.dataAccessors.getAppointmentSettings(element);
const info = _m_utils.utils.dataAccessors.getAppointmentInfo(element);
const appointmentIndex = (0, _renderer.default)(element).data(this._appointments._itemIndexKey());
const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this._dataAccessors, this.timeZoneCalculator);
const targetedAdapter = adapter.clone();
if (this._isAgenda() && adapter.isRecurrent) {
const {
agendaSettings: agendaSettings
} = settings;
targetedAdapter.startDate = _m_expression_utils.ExpressionUtils.getField(this._dataAccessors, "startDate", agendaSettings);
targetedAdapter.endDate = _m_expression_utils.ExpressionUtils.getField(this._dataAccessors, "endDate", agendaSettings)
} else if (settings) {
targetedAdapter.startDate = info ? info.sourceAppointment.startDate : adapter.startDate;
targetedAdapter.endDate = info ? info.sourceAppointment.endDate : adapter.endDate
}
const rawTargetedAppointment = targetedAdapter.source();
if (element) {
this.setTargetedAppointmentResources(rawTargetedAppointment, element, appointmentIndex)
}
if (info) {
rawTargetedAppointment.displayStartDate = new Date(info.appointment.startDate);
rawTargetedAppointment.displayEndDate = new Date(info.appointment.endDate)
}
return rawTargetedAppointment
}
subscribe(subject, action) {
this._subscribes[subject] = _m_subscribes.default[subject] = action
}
fire(subject) {
const callback = this._subscribes[subject];
const args = Array.prototype.slice.call(arguments);
if (!(0, _type.isFunction)(callback)) {
throw _ui.default.Error("E1031", subject)
}
return callback.apply(this, args.slice(1))
}
getTargetCellData() {
return this._workSpace.getDataByDroppableCell()
}
_updateAppointment(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
}
return this._processActionResult(updatingOptions, (function(canceled) {
let deferred = new _deferred.Deferred;
if (!canceled) {
this._expandAllDayPanel(rawAppointment);
try {
deferred = this.appointmentDataProvider.update(target, rawAppointment).done((() => {
dragEvent && dragEvent.cancel.resolve(false)
})).always((storeAppointment => this._onDataPromiseCompleted(StoreEventNames_UPDATED, storeAppointment))).fail((() => performFailAction()))
} catch (err) {
performFailAction(err);
deferred.resolve()
}
} else {
performFailAction();
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._workSpace.option("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
}
getRenderingStrategyInstance() {
return this.getLayoutManager().getRenderingStrategyInstance()
}
getActions() {
return this._actions
}
appointmentTakesAllDay(rawAppointment) {
const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator);
return (0, _index2.getAppointmentTakesAllDay)(appointment, this._getCurrentViewOption("allDayPanelMode"))
}
dayHasAppointment(day, rawAppointment, trimTime) {
const getConvertedToTimeZone = date => this.timeZoneCalculator.createDate(date, {
path: "toGrid"
});
const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator);
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 = _date.default.trimTime(day);
startDate = _date.default.trimTime(startDate);
endDate = _date.default.trimTime(endDate)
}
const dayTimeStamp = day.getTime();
const startDateTimeStamp = startDate.getTime();
const endDateTimeStamp = endDate.getTime();
return startDateTimeStamp <= dayTimeStamp && dayTimeStamp <= endDateTimeStamp
}
setTargetedAppointmentResources(rawAppointment, element, appointmentIndex) {
const groups = this._getCurrentViewOption("groups");
if (null !== groups && void 0 !== groups && groups.length) {
const resourcesSetter = this.getResourceDataAccessors().setter;
const workSpace = this._workSpace;
let getGroups;
let setResourceCallback;
if (this._isAgenda()) {
getGroups = function() {
const apptSettings = this.getLayoutManager()._positionMap[appointmentIndex];
return (0, _m_utils2.getCellGroups)(apptSettings[0].groupIndex, this.getWorkSpace().option("groups"))
};
setResourceCallback = function(_, group) {
resourcesSetter[group.name](rawAppointment, group.id)
}
} else {
getGroups = function() {
const setting = _m_utils.utils.dataAccessors.getAppointmentSettings(element) || {};
return workSpace.getCellDataByCoordinates({
left: setting.left,
top: setting.top
}).groups
};
setResourceCallback = function(field, value) {
resourcesSetter[field](rawAppointment, value)
}
}(0, _iterator.each)(getGroups.call(this), setResourceCallback)
}
}
getStartViewDate() {
var _this$_workSpace4;
return null === (_this$_workSpace4 = this._workSpace) || void 0 === _this$_workSpace4 ? void 0 : _this$_workSpace4.getStartViewDate()
}
getEndViewDate() {
return this._workSpace.getEndViewDate()
}
showAddAppointmentPopup(cellData, cellGroups) {
const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)({}, this._dataAccessors, this.timeZoneCalculator);
appointmentAdapter.allDay = cellData.allDay;
appointmentAdapter.startDate = this.timeZoneCalculator.createDate(cellData.startDate, {
path: "fromGrid"
});
appointmentAdapter.endDate = this.timeZoneCalculator.createDate(cellData.endDate, {
path: "fromGrid"
});
const resultAppointment = (0, _extend.extend)(appointmentAdapter.source(), cellGroups);
this.showAppointmentPopup(resultAppointment, true)
}
showAppointmentPopup(rawAppointment, createNewAppointment, rawTargetedAppointment) {
const newRawTargetedAppointment = _extends({}, rawTargetedAppointment);
if (newRawTargetedAppointment) {
delete newRawTargetedAppointment.displayStartDate;
delete newRawTargetedAppointment.displayEndDate
}
const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(newRawTargetedAppointment || rawAppointment, this._dataAccessors, this.timeZoneCalculator);
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;
this._editing.allowAdding && this._appointmentPopup.show(rawAppointment, {
isToolbarVisible: true,
action: _m_popup.ACTION_TO_APPOINTMENT.CREATE
})
} else {
this._checkRecurringAppointment(rawAppointment, newTargetedAppointment, appointment.startDate, (() => {
this._editAppointmentData = rawAppointment;
this._appointmentPopup.show(rawAppointment, {
isToolbarVisible: this._editing.allowUpdating,
action: _m_popup.ACTION_TO_APPOINTMENT.UPDATE
})
}), false, true)
}
}
createPopupAppointment() {
const result = {};
const toMs = _date.default.dateToMilliseconds;
const startDate = new Date(this.option("currentDate"));
const endDate = new Date(startDate.getTime() + this.option("cellDuration") * toMs("minute"));
_m_expression_utils.ExpressionUtils.setField(this._dataAccessors, "startDate", result, startDate);
_m_expression_utils.ExpressionUtils.setField(this._dataAccessors, "endDate", result, endDate);
return result
}
hideAppointmentPopup(saveChanges) {
var _this$_appointmentPop3;
if (null !== (_this$_appointmentPop3 = this._appointmentPopup) && void 0 !== _this$_appointmentPop3 && _this$_appointmentPop3.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,
groups: this.option("groups")
};
const getAppointmentColor = this.createGetAppointmentColor();
const deferredColor = getAppointmentColor(appointmentConfig);
const info = new _m_data_structures.AppointmentTooltipInfo(appointment, targetedAppointment, deferredColor);
this.showAppointmentTooltipCore(element, [info])
}
}
createGetAppointmentColor() {
return appointmentConfig => {
const resourceConfig = {
resources: this.option("resources"),
dataAccessors: this.getResourceDataAccessors(),
loadedResources: this.option("loadedResources"),
resourceLoaderMap: this.option("resourceLoaderMap")
};
return (0, _m_utils2.getAppointmentColor)(resourceConfig, appointmentConfig)
}
}
showAppointmentTooltipCore(target, data, options) {
const arg = {
cancel: false,
appointments: data.map((item => {
const result = {
appointmentData: item.appointment,
currentAppointmentData: _extends({}, item.targetedAppointment),
color: item.color
};
if (item.settings.info) {
const {
startDate: startDate,
endDate: endDate
} = item.settings.info.appointment;
result.currentAppointmentData.displayStartDate = startDate;
result.currentAppointmentData.displayEndDate = endDate
}
return result
})),
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, _extends({}, this._getExtraAppointmentTooltipOptions(), options))
}))
}
}
hideAppointmentTooltip() {
this._appointmentTooltip && this._appointmentTooltip.hide()
}
scrollToTime(hours, minutes, date) {
_ui.default.log("W0002", "dxScheduler", "scrollToTime", "21.1", 'Use the "scrollTo" method instead');
this._workSpace.scrollToTime(hours, minutes, date)
}
scrollTo(date, groups, allDay) {
this._workSpace.scrollTo(date, groups, allDay)
}
_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 = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator);
appointment.text = appointment.text || "";
const serializedAppointment = appointment.source(true);
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.appointmentDataProvider.add(serializedAppointment).always((storeAppointment => this._onDataPromiseCompleted(StoreEventNames_ADDED, storeAppointment)))
}))
}
updateAppointment(target, appointment) {
return this._updateAppointment(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.appointmentDataProvider.remove(rawAppointment).always((storeAppointment => this._onDataPromiseCompleted(StoreEventNames_DELETED, storeAppointment, rawAppointment)))
}
}))
}
deleteRecurrence(appointment, date, recurrenceEditMode) {
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.option("firstDayOfWeek")) ? this.option("firstDayOfWeek") : _date2.default.firstDayOfWeekIndex()
}
_validateKeyFieldIfAgendaExist() {
if (!this.appointmentDataProvider.isDataSourceInit) {
return
}
const hasAgendaView = !!this._getViewByName("agenda");
const isKeyExist = !!this.appointmentDataProvider.keyName;
if (hasAgendaView && !isKeyExist) {
_ui.default.log("W1023")
}
}
_getDragBehavior() {
return this._workSpace.dragBehavior
}
getViewOffsetMs() {
const offsetFromOptions = this._getCurrentViewOption("offset");
return this.normalizeViewOffsetValue(offsetFromOptions)
}
normalizeViewOffsetValue(viewOffset) {
if (!(0, _type.isDefined)(viewOffset) || this.currentViewType === _m_constants.VIEWS.AGENDA) {
return 0
}
return viewOffset * toMs("minute")
}
validateOptions() {
const currentViewOptions = _extends({}, this.option(), {
startDayHour: this._getCurrentViewOption("startDayHour"),
endDayHour: this._getCurrentViewOption("endDayHour"),
offset: this._getCurrentViewOption("offset"),
cellDuration: this._getCurrentViewOption("cellDuration")
});
const validationResult = this._optionsValidator.validate(currentViewOptions);
this._optionsValidatorErrorHandler.handleValidationResult(validationResult)
}
}
Scheduler.include(_data_helper.default);
(0, _component_registrator.default)("dxScheduler", Scheduler);
exports.default = Scheduler
},
86681:
/*!**********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_subscribes.js ***!
\**********************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479);
var _type = __webpack_require__( /*! ../../core/utils/type */ 35922);
var _m_text_utils = __webpack_require__( /*! ./appointments/m_text_utils */ 18775);
var _m_appointment_adapter = __webpack_require__( /*! ./m_appointment_adapter */ 72734);
var _m_classes = __webpack_require__( /*! ./m_classes */ 43600);
var _m_utils = __webpack_require__( /*! ./m_utils */ 84110);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date.default.dateToMilliseconds;
const subscribes = {
isCurrentViewAgenda() {
return "agenda" === this.currentViewType
},
currentViewUpdated(currentView) {
this.option("currentView", currentView)
},
currentDateUpdated(date) {
this.option("currentDate", date)
},
getOption(name) {
return this.option(name)
},
getWorkspaceOption(name) {
return this.getWorkSpace().option(name)
},
isVirtualScrolling() {
return this.isVirtualScrolling()
},
setCellDataCacheAlias(appointment, geometry) {
this._workSpace.setCellDataCacheAlias(appointment, geometry)
},
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 = _m_utils.utils.dataAccessors.getAppointmentInfo(options.$appointment);
const {
exceptionDate: exceptionDate
} = info.sourceAppointment;
this._checkRecurringAppointment(options.target, options.data, exceptionDate, (() => {
this._updateAppointment(options.target, options.data, (function() {
this._appointments.moveAppointmentBack()
}))
}))
},
getUpdatedData(rawAppointment) {
return this._getUpdatedData(rawAppointment)
},
updateAppointmentAfterDrag(_ref) {
let {
event: event,
element: element,
rawAppointment: rawAppointment,
newCellIndex: newCellIndex,
oldCellIndex: oldCellIndex
} = _ref;
const info = _m_utils.utils.dataAccessors.getAppointmentInfo(element);
const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator);
const targetedAppointment = (0, _m_appointment_adapter.createAppointmentAdapter)((0, _extend.extend)({}, rawAppointment, this._getUpdatedData(rawAppointment)), this._dataAccessors, this.timeZoneCalculator);
const targetedRawAppointment = targetedAppointment.source();
const becomeAllDay = targetedAppointment.allDay;
const wasAllDay = appointment.allDay;
const movedBetweenAllDayAndSimple = this._workSpace.supportAllDayRow() && (wasAllDay && !becomeAllDay || !wasAllDay && becomeAllDay);
const isDragAndDropBetweenComponents = event.fromComponent !== event.toComponent;
if (-1 === newCellIndex) {
if (!isDragAndDropBetweenComponents) {
this._appointments.moveAppointmentBack(event)
}
return
}
if (newCellIndex !== oldCellIndex || isDragAndDropBetweenComponents || movedBetweenAllDayAndSimple) {
this._checkRecurringAppointment(rawAppointment, targetedRawAppointment, info.sourceAppointment.exceptionDate, (() => {
this._updateAppointment(rawAppointment, targetedRawAppointment, (function() {
this._appointments.moveAppointmentBack(event)
}), event)
}), void 0, void 0, event)
} else {
this._appointments.moveAppointmentBack(event)
}
},
onDeleteButtonPress(options) {
const targetedData = this.getTargetedAppointment(options.data, (0, _renderer.default)(options.target));
this.checkAndDeleteAppointment(options.data, targetedData);
this.hideAppointmentTooltip()
},
getTextAndFormatDate(appointmentRaw, targetedAppointmentRaw, format) {
const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointmentRaw, this._dataAccessors, this.timeZoneCalculator);
const targetedAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(targetedAppointmentRaw || appointmentRaw, this._dataAccessors, this.timeZoneCalculator);
const startDate = this.timeZoneCalculator.createDate(targetedAdapter.startDate, {
path: "toGrid"
});
const endDate = this.timeZoneCalculator.createDate(targetedAdapter.endDate, {
path: "toGrid"
});
const formatType = format || (0, _m_text_utils.getFormatType)(startDate, endDate, targetedAdapter.allDay, "month" !== this.currentViewType);
return {
text: targetedAdapter.text || appointmentAdapter.text,
formatDate: (0, _m_text_utils.formatDates)(startDate, endDate, formatType)
}
},
_createAppointmentTitle(data) {
if ((0, _type.isPlainObject)(data)) {
return data.text
}
return String(data)
},
getResizableAppointmentArea(options) {
const {
allDay: allDay
} = options;
const groups = this._getCurrentViewOption("groups");
if (groups && groups.length) {
if (allDay || this.getLayoutManager().getRenderingStrategyInstance()._needHorizontalGroupBounds()) {
const horizontalGroupBounds = this._workSpace.getGroupBounds(options.coordinates);
return {
left: horizontalGroupBounds.left,
right: horizontalGroupBounds.right,
top: 0,
bottom: 0
}
}
if (this.getLayoutManager().getRenderingStrategyInstance()._needVerticalGroupBounds(allDay) && 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()
},
getAppointmentGeometry(settings) {
return this.getLayoutManager().getRenderingStrategyInstance().getAppointmentGeometry(settings)
},
isAllDay(appointmentData) {
return this.getLayoutManager().getRenderingStrategyInstance().isAllDay(appointmentData)
},
getDeltaTime(e, initialSize, itemData) {
return this.getLayoutManager().getRenderingStrategyInstance().getDeltaTime(e, initialSize, itemData)
},
getDropDownAppointmentWidth(isAllDay) {
return this.getLayoutManager().getRenderingStrategyInstance().getDropDownAppointmentWidth(this._getViewCountConfig().intervalCount, isAllDay)
},
getDropDownAppointmentHeight() {
return this.getLayoutManager().getRenderingStrategyInstance().getDropDownAppointmentHeight()
},
getCellWidth() {
return this.getWorkSpace().getCellWidth()
},
getCellHeight() {
return this.getWorkSpace().getCellHeight()
},
getMaxAppointmentCountPerCellByType(isAllDay) {
return this.getRenderingStrategyInstance()._getMaxAppointmentCountPerCellByType(isAllDay)
},
needCorrectAppointmentDates() {
return this.getRenderingStrategyInstance().needCorrectAppointmentDates()
},
getRenderingStrategyDirection() {
return this.getRenderingStrategyInstance().getDirection()
},
updateAppointmentEndDate(options) {
const {
endDate: endDate
} = options;
const endDayHour = this._getCurrentViewOption("endDayHour");
const startDayHour = this._getCurrentViewOption("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) {
this._compactAppointmentsHelper.render(options)
},
clearCompactAppointments() {
this._compactAppointmentsHelper.clear()
},
supportCompactDropDownAppointments() {
return this.getLayoutManager().getRenderingStrategyInstance().supportCompactDropDownAppointments()
},
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._getCurrentViewOption("agendaDuration")
},
getStartViewDate() {
return this.getStartViewDate()
},
getEndViewDate() {
return this.getEndViewDate()
},
forceMaxAppointmentPerCell() {
return this.forceMaxAppointmentPerCell()
},
onAgendaReady(rows) {
const $appts = this.getAppointmentsInstance()._itemElements();
let total = 0;
const applyClass = function(_, count) {
const index = count + total - 1;
$appts.eq(index).addClass(_m_classes.AGENDA_LAST_IN_DATE_APPOINTMENT_CLASS);
total += count
};
for (let i = 0; i < rows.length; i++) {
(0, _iterator.each)(rows[i], applyClass)
}
},
getTimezone() {
return this._getTimezoneOffsetByOption()
},
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
},
82215:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_table_creator.js ***!
\*************************************************************************************/
function(__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 */ 73349));
var _element = __webpack_require__( /*! ../../core/element */ 6415);
var _element_data = __webpack_require__( /*! ../../core/element_data */ 97906);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _type = __webpack_require__( /*! ../../core/utils/type */ 35922);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
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: _extends({
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(type, data, config) {
let table;
const cellStorage = [];
let rowIndex = 0;
config = config || {};
const cellTag = config.cellTag || "td";
const childrenField = config.childrenField || "children";
const titleField = config.titleField || "title";
const {
groupTableClass: groupTableClass
} = config;
const {
groupRowClass: groupRowClass
} = config;
const {
groupCellClass: groupCellClass
} = config;
const {
groupCellCustomContent: groupCellCustomContent
} = config;
function getChildCount(item) {
if (item[childrenField]) {
return item[childrenField].length
}
return 0
}
function createCell(text, childCount, index, data) {
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, data)
} else {
cell.element.appendChild(cellText)
}
return cell
}! function() {
table = _dom_adapter.default.createElement("table");
if (groupTableClass) {
table.className = groupTableClass
}
}();
! function generateCells(data) {
for (let i = 0; i < data.length; i++) {
const childCount = getChildCount(data[i]);
const cell = createCell(data[i][titleField], childCount, i, data[i]);
if (!cellStorage[rowIndex]) {
cellStorage[rowIndex] = []
}
cellStorage[rowIndex].push(cell);
if (childCount) {
generateCells(data[i][childrenField])
} else {
rowIndex++
}
}
}(data);
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
}
}
}
},
84110:
/*!*****************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_utils.js ***!
\*****************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.utils = void 0;
var _element = __webpack_require__( /*! ../../core/element */ 6415);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374));
var _data = __webpack_require__( /*! ../../core/utils/data */ 47617);
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date_serialization */ 69434));
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479);
var _size = __webpack_require__( /*! ../../core/utils/size */ 58664);
var _m_constants = __webpack_require__( /*! ./m_constants */ 6324);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const utils = exports.utils = {
dataAccessors: {
getAppointmentSettings: element => (0, _renderer.default)(element).data(_m_constants.APPOINTMENT_SETTINGS_KEY),
getAppointmentInfo: element => {
const settings = utils.dataAccessors.getAppointmentSettings(element);
return null === settings || void 0 === settings ? void 0 : settings.info
},
create: (fields, currentDataAccessors, forceIsoDateParsing, dateSerializationFormat) => {
const dataAccessors = currentDataAccessors ? _extends({}, currentDataAccessors) : {
getter: {},
setter: {},
expr: {}
};
(0, _iterator.each)(fields, ((name, expr) => {
if (expr) {
const getter = (0, _data.compileGetter)(expr);
const setter = (0, _data.compileSetter)(expr);
let dateGetter;
let dateSetter;
let serializationFormat;
if (field = name, "startDate" === field || "endDate" === field) {
dateGetter = object => {
let value = getter(object);
if (forceIsoDateParsing) {
value = _date_serialization.default.deserializeDate(value)
}
return value
};
dateSetter = (object, value) => {
if (dateSerializationFormat) {
serializationFormat = dateSerializationFormat
} else if (forceIsoDateParsing && !serializationFormat) {
const oldValue = getter(object);
serializationFormat = _date_serialization.default.getDateSerializationFormat(oldValue)
}
const newValue = _date_serialization.default.serializeDate(value, serializationFormat);
setter(object, newValue)
}
}
dataAccessors.getter[name] = dateGetter || getter;
dataAccessors.setter[name] = dateSetter || setter;
dataAccessors.expr[`${name}Expr`] = expr
} else {
delete dataAccessors.getter[name];
delete dataAccessors.setter[name];
delete dataAccessors.expr[`${name}Expr`]
}
var field
}));
return dataAccessors
}
},
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)
}
}
}
}
}
},
57880:
/*!***************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_utils_time_zone.js ***!
\***************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _errors = _interopRequireDefault(__webpack_require__( /*! ../../core/errors */ 17381));
var _date = __webpack_require__( /*! ../core/utils/date */ 24321);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198));
var _m_date_adapter = _interopRequireDefault(__webpack_require__( /*! ./m_date_adapter */ 90006));
var _m_utils_timezones_data = _interopRequireDefault(__webpack_require__( /*! ./timezones/m_utils_timezones_data */ 23778));
var _timezone_list = _interopRequireDefault(__webpack_require__( /*! ./timezones/timezone_list */ 99740));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date2.default.dateToMilliseconds;
const offsetFormatRegexp = /^GMT(?:[+-]\d{2}:\d{2})?$/;
const createUTCDate = date => new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes()));
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 isValidDate = date => date instanceof Date && !isNaN(date.valueOf());
const calculateTimezoneByValue = function(timeZone) {
let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
if (!timeZone) {
return
}
const isValidTimezone = _timezone_list.default.value.includes(timeZone);
if (!isValidTimezone) {
_errors.default.log("W0009", timeZone);
return
}
if (!isValidDate(date)) {
return
}
let result = function(timezone) {
let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
const customTimezones = _m_utils_timezones_data.default.getTimeZonesOld();
if (0 === customTimezones.length) {
return
}
const dateUtc = createUTCDate(date);
return _m_utils_timezones_data.default.getTimeZoneOffsetById(timezone, dateUtc.getTime())
}(timeZone, date);
if (void 0 === result) {
result = 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, date)
}
return result
};
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 = 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 (!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 hasDSTInLocalTimeZone = () => {
const [startDate, endDate] = getExtremeDates();
return startDate.getTimezoneOffset() !== endDate.getTimezoneOffset()
};
const getOffset = date => -date.getTimezoneOffset() / 60;
const getDateAndMoveHourBack = dateStamp => new Date(dateStamp - toMs("hour"));
const isEqualLocalTimeZoneByDeclaration = (timeZoneName, date) => {
const customTimezones = _m_utils_timezones_data.default.getTimeZonesOld();
const targetTimezoneData = customTimezones.filter((tz => tz.id === timeZoneName));
if (1 === targetTimezoneData.length) {
return ((timeZoneName, date) => {
const year = date.getFullYear();
const configTuple = _m_utils_timezones_data.default.getTimeZoneDeclarationTuple(timeZoneName, year);
const [summerTime, winterTime] = configTuple;
const noDSTInTargetTimeZone = configTuple.length < 2;
if (noDSTInTargetTimeZone) {
const targetTimeZoneOffset = _m_utils_timezones_data.default.getTimeZoneOffsetById(timeZoneName, date);
const localTimeZoneOffset = getOffset(date);
if (targetTimeZoneOffset !== localTimeZoneOffset) {
return false
}
return !hasDSTInLocalTimeZone()
}
const localSummerOffset = getOffset(new Date(summerTime.date));
const localWinterOffset = getOffset(new Date(winterTime.date));
if (localSummerOffset !== summerTime.offset) {
return false
}
if (localSummerOffset === getOffset(getDateAndMoveHourBack(summerTime.date))) {
return false
}
if (localWinterOffset !== winterTime.offset) {
return false
}
if (localWinterOffset === getOffset(getDateAndMoveHourBack(winterTime.date))) {
return false
}
return true
})(timeZoneName, date)
}
return false
};
const getExtremeDates = () => {
const nowDate = new Date(Date.now());
const startDate = new Date;
const endDate = new Date;
startDate.setFullYear(nowDate.getFullYear(), 0, 1);
endDate.setFullYear(nowDate.getFullYear(), 6, 1);
return [startDate, endDate]
};
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: function(exception, exceptionByStartDate, timeZone, startDateTimeZone) {
let isBackConversion = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : false;
let timezoneOffset = (exception.getTimezoneOffset() - exceptionByStartDate.getTimezoneOffset()) / 60;
if (startDateTimeZone) {
timezoneOffset = _getDaylightOffsetByTimezone(exceptionByStartDate, exception, startDateTimeZone)
} else if (timeZone) {
timezoneOffset = _getDaylightOffsetByTimezone(exceptionByStartDate, exception, timeZone)
}
return new Date(exception.getTime() + (isBackConversion ? -1 : 1) * 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 null
}
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()))
},
createDateFromUTCWithLocalOffset: date => {
const result = (0, _m_date_adapter.default)(date);
const timezoneOffsetBeforeInMin = result.getTimezoneOffset();
result.addTime(result.getTimezoneOffset("minute"));
result.subtractMinutes(timezoneOffsetBeforeInMin - result.getTimezoneOffset());
return result.source
},
createUTCDate: createUTCDate,
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
},
hasDSTInLocalTimeZone: hasDSTInLocalTimeZone,
isEqualLocalTimeZone: function(timeZoneName) {
let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date;
if (Intl) {
const localTimeZoneName = Intl.DateTimeFormat().resolvedOptions().timeZone;
if (localTimeZoneName === timeZoneName) {
return true
}
}
return isEqualLocalTimeZoneByDeclaration(timeZoneName, date)
},
isEqualLocalTimeZoneByDeclaration: isEqualLocalTimeZoneByDeclaration,
getTimeZones: function() {
let date = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Date;
return _timezone_list.default.value.map((tz => ({
offset: calculateTimezoneByValue(tz, date),
title: getTimezoneTitle(tz, date),
id: tz
})))
},
setOffsetsToDate: (targetDate, offsetsArray) => {
const newDateMs = offsetsArray.reduce(((result, offset) => result + offset), targetDate.getTime());
return new Date(newDateMs)
},
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
}
};
exports.default = utils
},
39146:
/*!****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/common/index.js ***!
\****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _validation_functions = __webpack_require__( /*! ./validation_functions */ 52257);
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 */ 63974);
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]
}
})
}))
},
52257:
/*!*******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/common/validation_functions.js ***!
\*******************************************************************************************************************/
function(__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
},
63974:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/common/validator_rules.js ***!
\**************************************************************************************************************/
function(__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 */ 28410);
var _validation_functions = __webpack_require__( /*! ./validation_functions */ 52257);
exports.mustBeInteger = (0, _index.createValidatorRule)("mustBeInteger", (value => (0, _validation_functions.isInteger)(value) || `${value} must be an integer.`));
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) || `${value} must be ${strict?">":">="} than ${minimalValue}.`))
};
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) || `${value} must be ${strict?"<":"<="} than ${maximalValue}.`))
};
exports.mustBeInRange = range => (0, _index.createValidatorRule)("mustBeInRange", (value => (0, _validation_functions.inRange)(value, range) || `${value} must be in range [${range[0]}, ${range[1]}].`));
exports.mustBeDivisibleBy = divider => (0, _index.createValidatorRule)("mustBeDivisibleBy", (value => (0, _validation_functions.divisibleBy)(value, divider) || `${value} must be divisible by ${divider}.`))
},
28410:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/index.js ***!
\**************************************************************************************************/
function(__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 */ 88942);
var _options_validator_error_handler = __webpack_require__( /*! ./options_validator_error_handler */ 2572);
var _types = __webpack_require__( /*! ./types */ 56007);
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 */ 61614);
var _validator_rules = __webpack_require__( /*! ./validator_rules */ 28396);
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]
}
})
}))
},
88942:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/options_validator.js ***!
\**************************************************************************************************************/
function(__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
}
}
},
2572:
/*!****************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/options_validator_error_handler.js ***!
\****************************************************************************************************************************/
function(__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 uniqErrorCodes = Object.keys(optionsValidatorResult).reduce(((set, validatorName) => {
const errorCode = this.validatorNameToErrorCodeMap[validatorName];
if (errorCode) {
set.add(errorCode)
}
return set
}), new Set);
const errorCodeArray = [...uniqErrorCodes];
errorCodeArray.forEach(((errorCode, idx) => {
const isLastErrorCode = idx === errorCodeArray.length - 1;
if (!isLastErrorCode) {
this.globalErrorHandler.logError(errorCode)
} else {
this.globalErrorHandler.throwError(errorCode)
}
}))
}
}
},
56007:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/types.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.REDUNDANT_EXPORT = void 0;
exports.REDUNDANT_EXPORT = void 0
},
61614:
/*!******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/validator.js ***!
\******************************************************************************************************/
function(__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
}
}
},
28396:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/validator_rules.js ***!
\************************************************************************************************************/
function(__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
}
},
18397:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/index.js ***!
\*********************************************************************************************/
function(__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 */ 8226);
var _options_validator_errors_handler = __webpack_require__( /*! ./options_validator_errors_handler */ 39452)
},
8226:
/*!*********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/options_validator.js ***!
\*********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SchedulerOptionsValidator = void 0;
var _index = __webpack_require__( /*! ./common/index */ 39146);
var _index2 = __webpack_require__( /*! ./core/index */ 28410);
var _validator_rules = __webpack_require__( /*! ./validator_rules */ 1603);
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])
})
}
}
exports.SchedulerOptionsValidator = SchedulerOptionsValidator
},
39452:
/*!************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/options_validator_errors_handler.js ***!
\************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SchedulerOptionsValidatorErrorsHandler = void 0;
var _ui = (obj = __webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ./core/index */ 28410);
const GLOBAL_ERROR_HANDLER = {
logError: errorCode => {
_ui.default.log(errorCode)
},
throwError: errorCode => {
throw _ui.default.Error(errorCode)
}
};
class SchedulerOptionsValidatorErrorsHandler extends _index.OptionsValidatorErrorHandler {
constructor() {
super({
startDayHour: "E1058",
endDayHour: "E1058",
startDayHourAndEndDayHour: "E1058",
offset: "E1061",
cellDuration: "E1062",
cellDurationAndVisibleInterval: "E1062"
}, GLOBAL_ERROR_HANDLER)
}
}
exports.SchedulerOptionsValidatorErrorsHandler = SchedulerOptionsValidatorErrorsHandler
},
1603:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/validator_rules.js ***!
\*******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.visibleIntervalMustBeDivisibleByCellDuration = exports.endDayHourMustBeGreaterThanStartDayHour = exports.cellDurationMustBeLessThanVisibleInterval = void 0;
var _index = __webpack_require__( /*! ./common/index */ 39146);
var _index2 = __webpack_require__( /*! ./core/index */ 28410);
exports.endDayHourMustBeGreaterThanStartDayHour = (0, _index2.createValidatorRule)("endDayHourGreaterThanStartDayHour", (_ref => {
let {
startDayHour: startDayHour,
endDayHour: endDayHour
} = _ref;
return (0, _index.greaterThan)(endDayHour, startDayHour) || `endDayHour: ${endDayHour} must be greater that startDayHour: ${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) || `endDayHour - startDayHour: ${visibleInterval} (minutes), must be divisible by cellDuration: ${cellDuration} (minutes).`
}));
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) || `endDayHour - startDayHour: ${visibleInterval} (minutes), must be greater or equal the cellDuration: ${cellDuration} (minutes).`
}))
},
62059:
/*!*************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/appointment_popup/config.js ***!
\*************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isPopupFullScreenNeeded = exports.getPopupToolbarItems = exports.getPopupSize = exports.getMaxWidth = exports.defaultAnimation = exports.POPUP_WIDTH = void 0;
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../../core/devices */ 20530));
var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664);
var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const POPUP_WIDTH = exports.POPUP_WIDTH = {
DEFAULT: 485,
RECURRENCE: 970,
FULLSCREEN: 1e3,
MOBILE: {
DEFAULT: 350,
FULLSCREEN: 500
}
};
exports.defaultAnimation = {
show: {
type: "pop",
duration: 300,
from: {
scale: .55
}
},
hide: {
type: "pop",
duration: 300,
to: {
opacity: 0,
scale: .55
},
from: {
opacity: 1,
scale: 1
}
}
};
const isMobile = () => "desktop" !== _devices.default.current().deviceType;
const TOOLBAR_LOCATION_AFTER = "after",
TOOLBAR_LOCATION_BEFORE = "before";
exports.getPopupToolbarItems = (allowUpdating, doneClick) => {
const result = [];
const buttonsConfig = {
doneButton: {
shortcut: "done",
options: {
text: _message.default.format("Done")
},
location: TOOLBAR_LOCATION_AFTER
},
cancelButton: {
shortcut: "cancel",
location: "ios" === _devices.default.current().platform ? TOOLBAR_LOCATION_BEFORE : TOOLBAR_LOCATION_AFTER
}
};
if (allowUpdating) {
result.push(_extends({}, buttonsConfig.doneButton, {
onClick: doneClick
}))
}
result.push(buttonsConfig.cancelButton);
return result
};
const isPopupFullScreenNeeded = () => {
const window = (0, _window.getWindow)();
const width = window && (0, _size.getWidth)(window);
if (width) {
return isMobile() ? width < POPUP_WIDTH.MOBILE.FULLSCREEN : width < POPUP_WIDTH.FULLSCREEN
}
return false
};
exports.isPopupFullScreenNeeded = isPopupFullScreenNeeded;
const getMaxWidth = isRecurrence => {
if (isMobile()) {
return POPUP_WIDTH.MOBILE.DEFAULT
}
return isRecurrence ? POPUP_WIDTH.RECURRENCE : POPUP_WIDTH.DEFAULT
};
exports.getMaxWidth = getMaxWidth;
exports.getPopupSize = isRecurrence => ({
fullScreen: isPopupFullScreenNeeded(),
maxWidth: getMaxWidth(isRecurrence)
})
},
30695:
/*!************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/appointment_popup/index.js ***!
\************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "POPUP_WIDTH", {
enumerable: true,
get: function() {
return _config.POPUP_WIDTH
}
});
Object.defineProperty(exports, "defaultAnimation", {
enumerable: true,
get: function() {
return _config.defaultAnimation
}
});
Object.defineProperty(exports, "getMaxWidth", {
enumerable: true,
get: function() {
return _config.getMaxWidth
}
});
Object.defineProperty(exports, "getPopupSize", {
enumerable: true,
get: function() {
return _config.getPopupSize
}
});
Object.defineProperty(exports, "getPopupToolbarItems", {
enumerable: true,
get: function() {
return _config.getPopupToolbarItems
}
});
Object.defineProperty(exports, "isPopupFullScreenNeeded", {
enumerable: true,
get: function() {
return _config.isPopupFullScreenNeeded
}
});
var _config = __webpack_require__( /*! ./config */ 62059)
},
94460:
/*!***********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_cell.js ***!
\***********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _const = __webpack_require__( /*! ../const */ 6186);
var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 75582);
class AllDayPanelCell extends _inferno2.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;
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
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: DataCellTemplateComponent,
isSelected: isSelected,
isFocused: isFocused
})
}
}
exports.AllDayPanelCell = AllDayPanelCell;
AllDayPanelCell.defaultProps = _date_table_cell_base.DateTableCallBaseDefaultProps
},
35947:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_table.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayTable = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _const = __webpack_require__( /*! ../const */ 6186);
var _all_day_panel_table_body = __webpack_require__( /*! ./all_day_panel_table_body */ 28698);
var _layout_props = __webpack_require__( /*! ./layout_props */ 21487);
var _table = __webpack_require__( /*! ./table */ 1475);
class AllDayTable extends _inferno2.InfernoWrapperComponent {
constructor() {
super(...arguments);
this.allDayPanelData = null
}
createEffects() {
return [(0, _inferno2.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();
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
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: DataCellTemplateComponent
})
})
}
}
exports.AllDayTable = AllDayTable;
AllDayTable.defaultProps = _layout_props.LayoutDefaultProps
},
28698:
/*!*****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_table_body.js ***!
\*****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelTableBodyDefaultProps = exports.AllDayPanelTableBody = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _all_day_panel_cell = __webpack_require__( /*! ./all_day_panel_cell */ 94460);
var _row = __webpack_require__( /*! ./row */ 56449);
const AllDayPanelTableBodyDefaultProps = exports.AllDayPanelTableBodyDefaultProps = {
viewData: [],
isVerticalGroupOrientation: false,
className: "",
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0
};
class AllDayPanelTableBody extends _inferno2.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 = _index2.renderUtils.combineClasses({
"dx-scheduler-all-day-table-row": true,
[className ?? ""]: !!className
});
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
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: DataCellTemplateComponent,
isSelected: isSelected ?? false,
isFocused: isFocused ?? false
}, key)
}))
})
}
}
exports.AllDayPanelTableBody = AllDayPanelTableBody;
AllDayPanelTableBody.defaultProps = AllDayPanelTableBodyDefaultProps
},
84501:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_title.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelTitle = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _message = (obj = __webpack_require__( /*! ../../../../../localization/message */ 28109), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
class AllDayPanelTitle extends _inferno2.InfernoWrapperComponent {
createEffects() {
return [(0, _inferno2.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 = {}
},
42654:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/cell.js ***!
\*********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CellBaseDefaultProps = exports.CellBase = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../utils/index */ 94084);
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 _inferno2.BaseInfernoComponent {
render() {
const {
className: className,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
children: children,
ariaLabel: ariaLabel
} = this.props;
const classes = _index.renderUtils.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, className);
return (0, _inferno.createVNode)(1, "td", classes, children, 0, {
"aria-label": ariaLabel
})
}
}
exports.CellBase = CellBase;
CellBase.defaultProps = CellBaseDefaultProps
},
1889:
/*!****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_header.js ***!
\****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateHeaderDefaultProps = exports.DateHeader = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _date_header_cell = __webpack_require__( /*! ./date_header_cell */ 65186);
var _row = __webpack_require__( /*! ./row */ 56449);
const {
isMaterialBased: isMaterialBased
} = _index2.themeUtils.getThemeType();
const DateHeaderDefaultProps = exports.DateHeaderDefaultProps = {
groupOrientation: "horizontal",
groupByDate: false,
groups: []
};
class DateHeader extends _inferno2.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, groupOrientation) && !groupByDate;
const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate);
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: DateCellTemplateComponent,
colSpan: colSpan,
splitText: isMaterialBased
}, key)
}))
}, rowIndex.toString()))), 0)
}
}
exports.DateHeader = DateHeader;
DateHeader.defaultProps = DateHeaderDefaultProps
},
65186:
/*!*********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_header_cell.js ***!
\*********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateHeaderCellDefaultProps = exports.DateHeaderCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _cell = __webpack_require__( /*! ./cell */ 42654);
var _date_header_text = __webpack_require__( /*! ./date_header_text */ 98911);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const DateHeaderCellDefaultProps = exports.DateHeaderCellDefaultProps = _extends({}, _cell.CellBaseDefaultProps, {
today: false,
colSpan: 1,
isWeekDayCell: false,
splitText: false,
isTimeCellTemplate: false
});
class DateHeaderCell extends _inferno2.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 = _index2.renderUtils.getCellSizeHorizontalClass(viewType, crossScrollingEnabled);
const cellClasses = _index2.renderUtils.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 ?? ""]: !!className
});
const classes = _index2.renderUtils.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, cellClasses);
const useTemplate = !isTimeCellTemplate && !!dateCellTemplate || isTimeCellTemplate && !!timeCellTemplate;
const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate);
const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate);
const children = useTemplate ? (0, _inferno.createFragment)([isTimeCellTemplate && TimeCellTemplateComponent && TimeCellTemplateComponent({
data: {
date: startDate,
text: text,
groups: groups,
groupIndex: groupIndex
},
index: index
}), !isTimeCellTemplate && DateCellTemplateComponent && DateCellTemplateComponent({
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
},
98911:
/*!*********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_header_text.js ***!
\*********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateHeaderText = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
class DateHeaderText extends _inferno2.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
}
},
69997:
/*!***************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_table.js ***!
\***************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableDefaultProps = exports.DateTable = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _date_table_body = __webpack_require__( /*! ./date_table_body */ 23287);
var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 75582);
var _layout_props = __webpack_require__( /*! ./layout_props */ 21487);
var _table = __webpack_require__( /*! ./table */ 1475);
const _excluded = ["viewData", "viewContext", "tableRef", "addDateTableClass", "width", "cellTemplate", "dataCellTemplate", "groupOrientation", "addVerticalSizesClassToRows"];
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const DateTableDefaultProps = exports.DateTableDefaultProps = _extends({}, _layout_props.LayoutDefaultProps, {
cellTemplate: _date_table_cell_base.DateTableCellBase
});
class DateTable extends _inferno2.InfernoWrapperComponent {
createEffects() {
return [(0, _inferno2.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(source, excluded) {
if (null == source) {
return {}
}
var target = {};
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (excluded.indexOf(key) >= 0) {
continue
}
target[key] = source[key]
}
}
return target
}(_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;
const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate);
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _table.Table, _extends({}, 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: CellTemplateComponent,
dataCellTemplate: DataCellTemplateComponent,
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
},
23287:
/*!********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_table_body.js ***!
\********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableBodyDefaultProps = exports.DateTableBody = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _const = __webpack_require__( /*! ../const */ 6186);
var _all_day_panel_table_body = __webpack_require__( /*! ./all_day_panel_table_body */ 28698);
var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 75582);
var _layout_props = __webpack_require__( /*! ./layout_props */ 21487);
var _row = __webpack_require__( /*! ./row */ 56449);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const DateTableBodyDefaultProps = exports.DateTableBodyDefaultProps = _extends({}, _layout_props.LayoutDefaultProps, {
cellTemplate: _date_table_cell_base.DateTableCellBase
});
class DateTableBody extends _inferno2.BaseInfernoComponent {
render() {
const {
viewData: viewData,
viewContext: viewContext,
addVerticalSizesClassToRows: addVerticalSizesClassToRows,
cellTemplate: cellTemplate,
dataCellTemplate: dataCellTemplate
} = this.props;
const rowClasses = _index2.renderUtils.combineClasses({
[_const.DATE_TABLE_ROW_CLASS]: true,
"dx-scheduler-cell-sizes-vertical": addVerticalSizesClassToRows
});
const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate);
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
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: DataCellTemplateComponent,
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,
firstDayOfMonth: firstDayOfMonth,
groupIndex: cellGroupIndex,
groups: groups,
index: cellIndex,
isFirstGroupCell: isFirstGroupCell,
isFocused: isFocused,
isLastGroupCell: isLastGroupCell,
isSelected: isSelected,
otherMonth: otherMonth,
startDate: startDate,
text: text,
today: today
} = _ref3;
return CellTemplateComponent({
key: cellKey,
viewContext: viewContext,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
startDate: startDate,
endDate: endDate,
groups: groups,
groupIndex: cellGroupIndex,
index: cellIndex,
dataCellTemplate: DataCellTemplateComponent,
text: text,
today: today,
otherMonth: otherMonth,
firstDayOfMonth: firstDayOfMonth,
isSelected: isSelected,
isFocused: isFocused
})
}))
}, rowKey)
}))], 0, fragmentKey)
})), 0)
}
}
exports.DateTableBody = DateTableBody;
DateTableBody.defaultProps = DateTableBodyDefaultProps
},
75582:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_table_cell_base.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableCellBase = exports.DateTableCallBaseDefaultProps = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _const = __webpack_require__( /*! ../const */ 6186);
var _cell = __webpack_require__( /*! ./cell */ 42654);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const DateTableCallBaseDefaultProps = exports.DateTableCallBaseDefaultProps = _extends({}, _cell.CellBaseDefaultProps, {
otherMonth: false,
today: false,
firstDayOfMonth: false,
isSelected: false,
isFocused: false
});
class DateTableCellBase extends _inferno2.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: _extends({
startDate: startDate,
endDate: endDate,
groups: groups,
groupIndex: groups ? groupIndex : void 0,
text: "",
allDay: !!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 = _index2.renderUtils.getCellSizeHorizontalClass(viewType, crossScrollingEnabled);
const cellSizeVerticalClass = _index2.renderUtils.getCellSizeVerticalClass(!!allDay);
const classes = _index2.renderUtils.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();
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
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)([!DataCellTemplateComponent && children, !!DataCellTemplateComponent && DataCellTemplateComponent({
index: dataCellTemplateProps.index,
data: dataCellTemplateProps.data
})], 0)
})
}
}
exports.DateTableCellBase = DateTableCellBase;
DateTableCellBase.defaultProps = DateTableCallBaseDefaultProps
},
14225:
/*!****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel.js ***!
\****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelDefaultProps = exports.GroupPanel = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _const = __webpack_require__( /*! ../../const */ 4907);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _group_panel_horizontal = __webpack_require__( /*! ./group_panel_horizontal */ 3104);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725);
var _group_panel_vertical = __webpack_require__( /*! ./group_panel_vertical */ 10405);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const GroupPanelDefaultProps = exports.GroupPanelDefaultProps = _extends({}, _group_panel_props.GroupPanelBaseDefaultProps, {
groups: [],
groupOrientation: _const.VERTICAL_GROUP_ORIENTATION
});
class GroupPanel extends _inferno2.InfernoWrapperComponent {
createEffects() {
return [(0, _inferno2.createReRenderEffect)()]
}
render() {
const {
className: className,
viewContext: viewContext,
elementRef: elementRef,
groupPanelData: groupPanelData,
height: height,
resourceCellTemplate: resourceCellTemplate,
groupOrientation: groupOrientation,
groups: groups,
styles: styles
} = this.props;
const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate);
const isVerticalLayout = (0, _index2.isVerticalGroupingApplied)(groups, groupOrientation);
const Layout = isVerticalLayout ? _group_panel_vertical.GroupPanelVertical : _group_panel_horizontal.GroupPanelHorizontal;
return (0, _inferno.createComponentVNode)(2, Layout, {
viewContext: viewContext,
height: height,
resourceCellTemplate: ResourceCellTemplateComponent,
className: className,
groupPanelData: groupPanelData,
elementRef: elementRef,
styles: styles,
groups: GroupPanelDefaultProps.groups,
groupOrientation: GroupPanelDefaultProps.groupOrientation,
groupByDate: GroupPanelDefaultProps.groupByDate
})
}
}
exports.GroupPanel = GroupPanel;
GroupPanel.defaultProps = GroupPanelDefaultProps
},
3104:
/*!***************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_horizontal.js ***!
\***************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelHorizontal = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _group_panel_horizontal_row = __webpack_require__( /*! ./group_panel_horizontal_row */ 14292);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class GroupPanelHorizontal extends _inferno2.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 => _extends({}, 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();
const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate);
return (0, _inferno.createFragment)(groupPanelItems.map((group => (0, _inferno.createComponentVNode)(2, _group_panel_horizontal_row.GroupPanelHorizontalRow, {
groupItems: group,
cellTemplate: ResourceCellTemplateComponent
}, group[0].key))), 0)
}
}
exports.GroupPanelHorizontal = GroupPanelHorizontal;
GroupPanelHorizontal.defaultProps = _group_panel_props.GroupPanelBaseDefaultProps
},
62734:
/*!********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_horizontal_cell.js ***!
\********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelHorizontalCellDefaultProps = exports.GroupPanelHorizontalCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const GroupPanelHorizontalCellDefaultProps = exports.GroupPanelHorizontalCellDefaultProps = _extends({}, _group_panel_props.GroupPanelCellDefaultProps, {
isFirstGroupCell: false,
isLastGroupCell: false,
colSpan: 1
});
class GroupPanelHorizontalCell extends _inferno2.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 = _index2.renderUtils.combineClasses({
"dx-scheduler-group-header": true,
"dx-scheduler-first-group-cell": isFirstGroupCell,
"dx-scheduler-last-group-cell": isLastGroupCell,
[className ?? ""]: !!className
});
const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate);
return (0, _inferno.createVNode)(1, "th", classes, (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-header-content", CellTemplateComponent ? CellTemplateComponent({
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
},
14292:
/*!*******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_horizontal_row.js ***!
\*******************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelHorizontalRow = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _group_panel_horizontal_cell = __webpack_require__( /*! ./group_panel_horizontal_cell */ 62734);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725);
class GroupPanelHorizontalRow extends _inferno2.BaseInfernoComponent {
render() {
const {
cellTemplate: cellTemplate,
className: className,
groupItems: groupItems
} = this.props;
const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate);
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: !!isFirstGroupCell,
isLastGroupCell: !!isLastGroupCell,
cellTemplate: CellTemplateComponent
}, key)
})), 0)
}
}
exports.GroupPanelHorizontalRow = GroupPanelHorizontalRow;
GroupPanelHorizontalRow.defaultProps = _group_panel_props.GroupPanelRowDefaultProps
},
33725:
/*!**********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_props.js ***!
\**********************************************************************************************************/
function(__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: ""
}
},
10405:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_vertical.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelVertical = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725);
var _group_panel_vertical_row = __webpack_require__( /*! ./group_panel_vertical_row */ 15394);
class GroupPanelVertical extends _inferno2.BaseInfernoComponent {
render() {
const {
className: className,
elementRef: elementRef,
groupPanelData: groupPanelData,
resourceCellTemplate: resourceCellTemplate,
height: height,
styles: styles
} = this.props;
const style = (0, _inferno2.normalizeStyles)(_index2.renderUtils.addHeightToStyle(height, styles));
const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate);
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: ResourceCellTemplateComponent
}, group[0].key))), 0), 2, {
style: style
}, null, elementRef)
}
}
exports.GroupPanelVertical = GroupPanelVertical;
GroupPanelVertical.defaultProps = _group_panel_props.GroupPanelBaseDefaultProps
},
52369:
/*!******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_vertical_cell.js ***!
\******************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelVerticalCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725);
class GroupPanelVerticalCell extends _inferno2.BaseInfernoComponent {
render() {
const {
className: className,
data: data,
id: id,
color: color,
text: text,
index: index,
cellTemplate: cellTemplate
} = this.props;
const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate);
return (0, _inferno.createVNode)(1, "div", `dx-scheduler-group-header ${className}`, CellTemplateComponent ? CellTemplateComponent({
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
},
15394:
/*!*****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_vertical_row.js ***!
\*****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelVerticalRow = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725);
var _group_panel_vertical_cell = __webpack_require__( /*! ./group_panel_vertical_cell */ 52369);
class GroupPanelVerticalRow extends _inferno2.BaseInfernoComponent {
render() {
const {
className: className,
groupItems: groupItems,
cellTemplate: cellTemplate
} = this.props;
const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate);
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: CellTemplateComponent
}, key)
})), 0)
}
}
exports.GroupPanelVerticalRow = GroupPanelVerticalRow;
GroupPanelVerticalRow.defaultProps = _group_panel_props.GroupPanelRowDefaultProps
},
38885:
/*!****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/header_cell.js ***!
\****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _ordinary_cell = __webpack_require__( /*! ./ordinary_cell */ 98349);
class HeaderCell extends _inferno2.BaseInfernoComponent {
render() {
const {
children: children,
className: className,
colSpan: colSpan,
styles: styles
} = this.props;
return (0, _inferno.createVNode)(1, "th", className, children, 0, {
style: (0, _inferno2.normalizeStyles)(styles),
colSpan: colSpan
})
}
}
exports.HeaderCell = HeaderCell;
HeaderCell.defaultProps = _ordinary_cell.OrdinaryCellDefaultProps
},
69667:
/*!*****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/header_panel.js ***!
\*****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelDefaultProps = exports.HeaderPanel = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _date_header = __webpack_require__( /*! ./date_header */ 1889);
var _group_panel = __webpack_require__( /*! ./group_panel */ 14225);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const HeaderPanelDefaultProps = exports.HeaderPanelDefaultProps = _extends({}, _group_panel.GroupPanelDefaultProps, {
isRenderDateHeader: true,
dateHeaderTemplate: _date_header.DateHeader
});
class HeaderPanel extends _inferno2.InfernoWrapperComponent {
createEffects() {
return [(0, _inferno2.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, _index2.isHorizontalGroupingApplied)(groups, groupOrientation);
const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate);
const DateHeaderTemplateComponent = (0, _index.getTemplate)(dateHeaderTemplate);
const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate);
const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate);
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: ResourceCellTemplateComponent
}), isRenderDateHeader && DateHeaderTemplateComponent({
viewContext: viewContext,
groupByDate: groupByDate,
dateHeaderData: dateHeaderData,
groupOrientation: groupOrientation,
groups: groups,
dateCellTemplate: DateCellTemplateComponent,
timeCellTemplate: TimeCellTemplateComponent
}), groupByDate && (0, _inferno.createComponentVNode)(2, _group_panel.GroupPanel, {
viewContext: viewContext,
groupPanelData: groupPanelData,
groups: groups,
groupByDate: groupByDate,
groupOrientation: groupOrientation,
resourceCellTemplate: ResourceCellTemplateComponent
})], 0)
}
}
exports.HeaderPanel = HeaderPanel;
HeaderPanel.defaultProps = HeaderPanelDefaultProps
},
21487:
/*!*****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/layout_props.js ***!
\*****************************************************************************************************/
function(__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
}
},
98349:
/*!******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/ordinary_cell.js ***!
\******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OrdinaryCellDefaultProps = exports.OrdinaryCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
const OrdinaryCellDefaultProps = exports.OrdinaryCellDefaultProps = {};
class OrdinaryCell extends _inferno2.BaseInfernoComponent {
render() {
const {
children: children,
className: className,
colSpan: colSpan,
styles: styles
} = this.props;
return (0, _inferno.createVNode)(1, "td", className, children, 0, {
style: (0, _inferno2.normalizeStyles)(styles),
colSpan: colSpan
})
}
}
exports.OrdinaryCell = OrdinaryCell;
OrdinaryCell.defaultProps = OrdinaryCellDefaultProps
},
56449:
/*!********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/row.js ***!
\********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RowDefaultProps = exports.Row = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../utils/index */ 94084);
var _virtual_cell = __webpack_require__( /*! ./virtual_cell */ 73966);
const RowDefaultProps = exports.RowDefaultProps = {
className: "",
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0,
isHeaderRow: false
};
class Row extends _inferno2.BaseInfernoComponent {
render() {
const {
children: children,
className: className,
isHeaderRow: isHeaderRow,
leftVirtualCellCount: leftVirtualCellCount,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellCount: rightVirtualCellCount,
rightVirtualCellWidth: rightVirtualCellWidth,
styles: styles
} = this.props;
const hasLeftVirtualCell = !!leftVirtualCellCount;
const hasRightVirtualCell = !!rightVirtualCellCount;
return (0, _inferno.createVNode)(1, "tr", className, [hasLeftVirtualCell && null != leftVirtualCellCount && (0, _index.splitNumber)(leftVirtualCellCount, 1e3).map(((colSpan, index) => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, {
className: `left-virtual-cell-${index}`,
width: leftVirtualCellWidth * (colSpan / leftVirtualCellCount),
colSpan: colSpan,
isHeaderCell: isHeaderRow ?? _virtual_cell.VirtualCellDefaultProps.isHeaderCell
}))), children, hasRightVirtualCell && null != rightVirtualCellCount && (0, _index.splitNumber)(rightVirtualCellCount, 1e3).map(((colSpan, index) => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, {
className: `right-virtual-cell-${index}`,
width: rightVirtualCellWidth * (colSpan / rightVirtualCellCount),
colSpan: colSpan,
isHeaderCell: isHeaderRow ?? _virtual_cell.VirtualCellDefaultProps.isHeaderCell
})))], 0, {
style: (0, _inferno2.normalizeStyles)(styles)
})
}
}
exports.Row = Row;
Row.defaultProps = RowDefaultProps
},
1475:
/*!**********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/table.js ***!
\**********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TableDefaultProps = exports.Table = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../utils/index */ 94084);
var _virtual_row = __webpack_require__( /*! ./virtual_row */ 50830);
const TableDefaultProps = exports.TableDefaultProps = {
topVirtualRowHeight: 0,
bottomVirtualRowHeight: 0,
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0,
virtualCellsCount: 0
};
class Table extends _inferno2.BaseInfernoComponent {
getResultStyles() {
const {
height: height,
width: width,
styles: styles
} = this.props;
const heightAdded = _index.renderUtils.addHeightToStyle(height, styles);
return _index.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 = !!topVirtualRowHeight;
const hasBottomVirtualRow = !!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, _inferno2.normalizeStyles)(resultStyles)
}, null, tableRef)
}
}
exports.Table = Table;
Table.defaultProps = TableDefaultProps
},
16400:
/*!********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/time_panel_cell.js ***!
\********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimePanelCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _cell = __webpack_require__( /*! ./cell */ 42654);
class TimePanelCell extends _inferno2.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 = _index2.renderUtils.getCellSizeVerticalClass(false);
const classes = _index2.renderUtils.combineClasses({
"dx-scheduler-time-panel-cell": true,
[cellSizeVerticalClass]: true,
"dx-scheduler-time-panel-current-time-cell": !!highlighted,
[className ?? ""]: true
});
const timeCellTemplateProps = this.getTimeCellTemplateProps();
const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate);
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: TimeCellTemplateComponent ? TimeCellTemplateComponent({
index: timeCellTemplateProps.index,
data: timeCellTemplateProps.data
}) : (0, _inferno.createVNode)(1, "div", null, text, 0)
})
}
}
exports.TimePanelCell = TimePanelCell;
TimePanelCell.defaultProps = _cell.CellBaseDefaultProps
},
71630:
/*!*********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/time_panel_table.js ***!
\*********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimePanelTableDefaultProps = exports.TimePanelTable = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _all_day_panel_title = __webpack_require__( /*! ./all_day_panel_title */ 84501);
var _cell = __webpack_require__( /*! ./cell */ 42654);
var _row = __webpack_require__( /*! ./row */ 56449);
var _table = __webpack_require__( /*! ./table */ 1475);
var _time_panel_cell = __webpack_require__( /*! ./time_panel_cell */ 16400);
const _excluded = ["timePanelData", "viewContext", "tableRef", "timeCellTemplate"];
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const TimePanelTableDefaultProps = exports.TimePanelTableDefaultProps = {
timePanelData: {
groupedData: [],
leftVirtualCellCount: 0,
rightVirtualCellCount: 0,
topVirtualRowCount: 0,
bottomVirtualRowCount: 0
}
};
class TimePanelTable extends _inferno2.InfernoWrapperComponent {
createEffects() {
return [(0, _inferno2.createReRenderEffect)()]
}
render() {
const _this$props = this.props,
{
timePanelData: timePanelData,
viewContext: viewContext,
tableRef: tableRef,
timeCellTemplate: timeCellTemplate
} = _this$props,
restProps = function(source, excluded) {
if (null == source) {
return {}
}
var target = {};
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (excluded.indexOf(key) >= 0) {
continue
}
target[key] = source[key]
}
}
return target
}(_this$props, _excluded);
const {
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight
} = timePanelData;
const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate);
return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _table.Table, _extends({}, 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: TimeCellTemplateComponent,
highlighted: highlighted
})
}, key)
}))], 0, fragmentKey)
}))
})))
}
}
exports.TimePanelTable = TimePanelTable;
TimePanelTable.defaultProps = TimePanelTableDefaultProps
},
73966:
/*!*****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/virtual_cell.js ***!
\*****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VirtualCellDefaultProps = exports.VirtualCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../utils/index */ 94084);
var _header_cell = __webpack_require__( /*! ./header_cell */ 38885);
var _ordinary_cell = __webpack_require__( /*! ./ordinary_cell */ 98349);
const VirtualCellDefaultProps = exports.VirtualCellDefaultProps = {
width: 0,
isHeaderCell: false
};
class VirtualCell extends _inferno2.BaseInfernoComponent {
render() {
const {
colSpan: colSpan,
isHeaderCell: isHeaderCell,
width: width,
styles: styles
} = this.props;
const modifiedStyles = _index.renderUtils.addWidthToStyle(width, styles);
const Cell = isHeaderCell ? _header_cell.HeaderCell : _ordinary_cell.OrdinaryCell;
return (0, _inferno.createComponentVNode)(2, Cell, {
className: "dx-scheduler-virtual-cell",
styles: modifiedStyles,
colSpan: colSpan
})
}
}
exports.VirtualCell = VirtualCell;
VirtualCell.defaultProps = VirtualCellDefaultProps
},
50830:
/*!****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/virtual_row.js ***!
\****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VirtualRowDefaultProps = exports.VirtualRow = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../utils/index */ 94084);
var _row = __webpack_require__( /*! ./row */ 56449);
var _virtual_cell = __webpack_require__( /*! ./virtual_cell */ 73966);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const VirtualRowDefaultProps = exports.VirtualRowDefaultProps = _extends({}, _row.RowDefaultProps, {
leftVirtualCellWidth: 0,
rightVirtualCellWidth: 0,
cellsCount: 1
});
class VirtualRow extends _inferno2.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 = _index.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
}, index.toString())))
})
}
}
exports.VirtualRow = VirtualRow;
VirtualRow.defaultProps = VirtualRowDefaultProps
},
6186:
/*!*****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/const.js ***!
\*****************************************************************************************/
function(__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"
},
42515:
/*!*****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/index.js ***!
\*****************************************************************************************/
function(__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 */ 26426);
var _all_day_table = __webpack_require__( /*! ./wrappers/all_day_table */ 43422);
var _date_table = __webpack_require__( /*! ./wrappers/date_table */ 66225);
var _date_table_month = __webpack_require__( /*! ./wrappers/date_table_month */ 22478);
var _group_panel = __webpack_require__( /*! ./wrappers/group_panel */ 42523);
var _header_panel = __webpack_require__( /*! ./wrappers/header_panel */ 56108);
var _header_panel_timeline = __webpack_require__( /*! ./wrappers/header_panel_timeline */ 73725);
var _time_panel = __webpack_require__( /*! ./wrappers/time_panel */ 64608)
},
47710:
/*!**********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/month/date_table_month.js ***!
\**********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableMonth = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _date_table = __webpack_require__( /*! ../base/date_table */ 69997);
var _date_table_month_cell = __webpack_require__( /*! ./date_table_month_cell */ 73081);
const _excluded = ["viewData", "viewContext", "addDateTableClass", "addVerticalSizesClassToRows", "dataCellTemplate", "groupOrientation", "tableRef", "width"];
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class DateTableMonth extends _inferno2.InfernoWrapperComponent {
createEffects() {
return [(0, _inferno2.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(source, excluded) {
if (null == source) {
return {}
}
var target = {};
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (excluded.indexOf(key) >= 0) {
continue
}
target[key] = source[key]
}
}
return target
}(_this$props, _excluded);
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _date_table.DateTable, _extends({}, restProps, {
viewData: viewData,
viewContext: viewContext,
groupOrientation: groupOrientation,
addDateTableClass: addDateTableClass,
dataCellTemplate: DataCellTemplateComponent,
cellTemplate: _date_table_month_cell.DateTableMonthCell,
tableRef: tableRef,
addVerticalSizesClassToRows: addVerticalSizesClassToRows,
width: width
})))
}
}
exports.DateTableMonth = DateTableMonth;
DateTableMonth.defaultProps = _date_table.DateTableDefaultProps
},
73081:
/*!***************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/month/date_table_month_cell.js ***!
\***************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableMonthCell = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _date_table_cell_base = __webpack_require__( /*! ../base/date_table_cell_base */ 75582);
class DateTableMonthCell extends _inferno2.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,
firstDayOfMonth: firstDayOfMonth,
otherMonth: otherMonth,
today: today
} = this.props;
const classes = _index2.renderUtils.combineClasses({
"dx-scheduler-date-table-other-month": !!otherMonth,
"dx-scheduler-date-table-current-date": !!today,
"dx-scheduler-date-table-first-of-month": !!firstDayOfMonth,
[className ?? ""]: !!className
});
const contentTemplateProps = this.getContentTemplateProps();
const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate);
return (0, _inferno.createComponentVNode)(2, _date_table_cell_base.DateTableCellBase, {
className: classes,
viewContext: viewContext,
dataCellTemplate: DataCellTemplateComponent,
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
},
99099:
/*!*****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/timeline/date_header_timeline.js ***!
\*****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimelineDateHeaderLayout = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _themes = __webpack_require__( /*! ../../../../scheduler/r1/utils/themes */ 52821);
var _index2 = __webpack_require__( /*! ../../utils/index */ 94084);
var _date_header = __webpack_require__( /*! ../base/date_header */ 1889);
var _date_header_cell = __webpack_require__( /*! ../base/date_header_cell */ 65186);
var _row = __webpack_require__( /*! ../base/row */ 56449);
const {
isMaterialBased: isMaterialBased
} = (0, _themes.getThemeType)();
class TimelineDateHeaderLayout extends _inferno2.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, groupOrientation) && !groupByDate;
const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate);
const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate);
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: DateCellTemplateComponent,
timeCellTemplate: TimeCellTemplateComponent,
isTimeCellTemplate: isTimeCellTemplate
}, key)
}))
}, rowIndex.toString())
})), 0)
}
}
exports.TimelineDateHeaderLayout = TimelineDateHeaderLayout;
TimelineDateHeaderLayout.defaultProps = _date_header.DateHeaderDefaultProps
},
51519:
/*!******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/timeline/header_panel_timeline.js ***!
\******************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelTimeline = void 0;
var _inferno = __webpack_require__( /*! inferno */ 65414);
var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219);
var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587);
var _header_panel = __webpack_require__( /*! ../base/header_panel */ 69667);
var _date_header_timeline = __webpack_require__( /*! ./date_header_timeline */ 99099);
class HeaderPanelTimeline extends _inferno2.InfernoWrapperComponent {
createEffects() {
return [(0, _inferno2.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;
const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate);
const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate);
const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate);
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: ResourceCellTemplateComponent,
dateCellTemplate: DateCellTemplateComponent,
timeCellTemplate: TimeCellTemplateComponent
})
}
}
exports.HeaderPanelTimeline = HeaderPanelTimeline;
HeaderPanelTimeline.defaultProps = _header_panel.HeaderPanelDefaultProps
},
26426:
/*!****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/all_day_panel_title.js ***!
\****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayPanelTitleComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789);
var _all_day_panel_title = __webpack_require__( /*! ../base/all_day_panel_title */ 84501);
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)
},
43422:
/*!**********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/all_day_table.js ***!
\**********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AllDayTableComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _all_day_panel_table = __webpack_require__( /*! ../../../../scheduler/r1/components/base/all_day_panel_table */ 35947);
var _date_table = __webpack_require__( /*! ./date_table */ 66225);
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)
},
66225:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/date_table.js ***!
\*******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789);
var _date_table = __webpack_require__( /*! ../base/date_table */ 69997);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class DateTableComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = _extends({}, 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)
},
22478:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/date_table_month.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateTableMonthComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _date_table_month = __webpack_require__( /*! ../month/date_table_month */ 47710);
var _date_table = __webpack_require__( /*! ./date_table */ 66225);
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)
},
42523:
/*!********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/group_panel.js ***!
\********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupPanelComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789);
var _group_panel = __webpack_require__( /*! ../base/group_panel */ 14225);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class GroupPanelComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = _extends({}, 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)
},
56108:
/*!*********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/header_panel.js ***!
\*********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789);
var _header_panel = __webpack_require__( /*! ../base/header_panel */ 69667);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class HeaderPanelComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = _extends({}, 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)
},
73725:
/*!******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/header_panel_timeline.js ***!
\******************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HeaderPanelTimelineComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _header_panel_timeline = __webpack_require__( /*! ../timeline/header_panel_timeline */ 51519);
var _header_panel = __webpack_require__( /*! ./header_panel */ 56108);
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)
},
64608:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/time_panel.js ***!
\*******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimePanelComponent = void 0;
var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789);
var _time_panel_table = __webpack_require__( /*! ../base/time_panel_table */ 71630);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class TimePanelComponent extends _index.ComponentWrapper {
_setOptionsByReference() {
super._setOptionsByReference();
this._optionsByReference = _extends({}, 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)
},
4907:
/*!******************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/const.js ***!
\******************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VIEW_TYPES = exports.VERTICAL_GROUP_ORIENTATION = exports.TIMELINE_VIEWS = exports.HORIZONTAL_GROUP_ORIENTATION = void 0;
exports.VERTICAL_GROUP_ORIENTATION = "vertical";
exports.HORIZONTAL_GROUP_ORIENTATION = "horizontal";
exports.TIMELINE_VIEWS = {
timelineDay: true,
timelineWeek: true,
timelineWorkWeek: true,
timelineMonth: true
};
exports.VIEW_TYPES = ["day", "week", "workWeek", "month", "timelineDay", "timelineWeek", "timelineWorkWeek", "timelineMonth", "agenda"]
},
7884:
/*!*****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/filterting/index.js ***!
\*****************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "combineRemoteFilter", {
enumerable: true,
get: function() {
return _remote.combineRemoteFilter
}
});
var _remote = __webpack_require__( /*! ./remote */ 19206)
},
19206:
/*!******************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/filterting/remote.js ***!
\******************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.combineRemoteFilter = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576);
var _date_serialization = (obj = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306);
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _index = __webpack_require__( /*! ../utils/index */ 94084);
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)
},
66803:
/*!****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/semaphore/index.js ***!
\****************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Semaphore = void 0;
exports.Semaphore = class {
constructor() {
this.counter = 0
}
isFree() {
return 0 === this.counter
}
take() {
this.counter += 1
}
release() {
this.counter -= 1;
if (this.counter < 0) {
this.counter = 0
}
}
}
},
71353:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/calculator.js ***!
\*******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimeZoneCalculator = void 0;
var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _const = __webpack_require__( /*! ./const */ 45360);
const toMs = _date.default.dateToMilliseconds;
exports.TimeZoneCalculator = class {
constructor(options) {
this.options = options
}
createDate(sourceDate, info) {
const date = new Date(sourceDate);
switch (info.path) {
case _const.PathTimeZoneConversion.fromSourceToAppointment:
return this.getConvertedDate(date, info.appointmentTimeZone, true, false);
case _const.PathTimeZoneConversion.fromAppointmentToSource:
return this.getConvertedDate(date, info.appointmentTimeZone, true, true);
case _const.PathTimeZoneConversion.fromSourceToGrid:
return this.getConvertedDate(date, info.appointmentTimeZone, false, false);
case _const.PathTimeZoneConversion.fromGridToSource:
return this.getConvertedDate(date, info.appointmentTimeZone, false, 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
}
}
getConvertedDateByOffsets(date, clientOffset, targetOffset, isBack) {
const direction = isBack ? -1 : 1;
const resultDate = new Date(date);
return _date2.dateUtilsTs.addOffsets(resultDate, [direction * (toMs("hour") * targetOffset), -direction * (toMs("hour") * clientOffset)])
}
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 (!!timezone && isUTCDate) {
return appointment - client
}
if (!!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, useAppointmentTimeZone, isBack) {
const newDate = new Date(date.getTime());
const offsets = this.getOffsets(newDate, appointmentTimezone);
if (useAppointmentTimeZone && !!appointmentTimezone) {
return this.getConvertedDateByOffsets(date, offsets.client, offsets.appointment, isBack)
}
return this.getConvertedDateByOffsets(date, offsets.client, offsets.common, isBack)
}
}
},
45360:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/const.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PathTimeZoneConversion = void 0;
var PathTimeZoneConversion;
! function(PathTimeZoneConversion) {
PathTimeZoneConversion.fromSourceToAppointment = "toAppointment";
PathTimeZoneConversion.fromAppointmentToSource = "fromAppointment";
PathTimeZoneConversion.fromSourceToGrid = "toGrid";
PathTimeZoneConversion.fromGridToSource = "fromGrid"
}(PathTimeZoneConversion || (exports.PathTimeZoneConversion = PathTimeZoneConversion = {}))
},
6155:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/index.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PathTimeZoneConversion", {
enumerable: true,
get: function() {
return _const.PathTimeZoneConversion
}
});
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 */ 71353);
var _const = __webpack_require__( /*! ./const */ 45360);
var _utils = __webpack_require__( /*! ./utils */ 21741)
},
21741:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/utils.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createTimeZoneCalculator = void 0;
var _m_utils_time_zone = (obj = __webpack_require__( /*! ../../m_utils_time_zone */ 57880), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _calculator = __webpack_require__( /*! ./calculator */ 71353);
exports.createTimeZoneCalculator = currentTimeZone => new _calculator.TimeZoneCalculator({
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)
})
},
49372:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/agenda.js ***!
\*************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = void 0;
var _base = __webpack_require__( /*! ./base */ 33053);
exports.calculateStartViewDate = (currentDate, startDayHour) => {
const validCurrentDate = new Date(currentDate);
return (0, _base.setOptionHour)(validCurrentDate, startDayHour)
}
},
33053:
/*!***********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/base.js ***!
\***********************************************************************************/
function(__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.hasResourceValue = 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.getGroupCount = exports.getDisplayedRowCount = exports.getDisplayedCellCount = exports.getDatesWithoutTime = exports.getCellDuration = exports.getCalculatedFirstDayOfWeek = exports.getAppointmentTakesAllDay = exports.getAppointmentRenderingStrategyName = exports.getAppointmentKey = exports.extendGroupItemsForGroupingByDate = exports.calculateViewStartDate = exports.calculateIsGroupedAllDayPanel = exports.calculateDayDuration = exports.calculateCellIndex = void 0;
var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500));
var _date3 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _m_classes = __webpack_require__( /*! ../../m_classes */ 43600);
var _m_constants = __webpack_require__( /*! ../../m_constants */ 6324);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
var _const = __webpack_require__( /*! ../const */ 4907);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
exports.getDatesWithoutTime = (min, max) => {
const newMin = _date.default.trimTime(min);
const newMax = _date.default.trimTime(max);
newMax.setDate(newMax.getDate() + 1);
return [newMin, newMax]
};
exports.getAppointmentRenderingStrategyName = viewType => {
const {
renderingStrategy: renderingStrategy
} = {
day: {
renderingStrategy: "vertical"
},
week: {
renderingStrategy: "week"
},
workWeek: {
renderingStrategy: "week"
},
month: {
renderingStrategy: "horizontalMonth"
},
timelineDay: {
renderingStrategy: "horizontal"
},
timelineWeek: {
renderingStrategy: "horizontal"
},
timelineWorkWeek: {
renderingStrategy: "horizontal"
},
timelineMonth: {
renderingStrategy: "horizontalMonthLine"
},
agenda: {
renderingStrategy: "agenda"
}
} [viewType];
return renderingStrategy
};
exports.getAppointmentTakesAllDay = (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.hasResourceValue = (resourceValues, itemValue) => (0, _type.isDefined)(resourceValues.find((value => (0, _common.equalByValue)(value, itemValue))));
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 _date.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 _date2.default.format(validDate, headerCellTextFormat)
};
const isVerticalGroupingApplied = (groups, groupOrientation) => groupOrientation === _const.VERTICAL_GROUP_ORIENTATION && !!groups.length;
exports.isVerticalGroupingApplied = isVerticalGroupingApplied;
const getGroupCount = groups => {
let result = 0;
for (let i = 0, len = groups.length; i < len; i += 1) {
if (!i) {
result = groups[i].items.length
} else {
result *= groups[i].items.length
}
}
return result
};
exports.getGroupCount = getGroupCount;
exports.getHorizontalGroupCount = (groups, groupOrientation) => {
const groupCount = getGroupCount(groups) || 1;
const isVerticalGrouping = isVerticalGroupingApplied(groups, groupOrientation);
return isVerticalGrouping ? 1 : groupCount
};
exports.isTimelineView = viewType => !!_const.TIMELINE_VIEWS[viewType];
exports.isDateAndTimeView = viewType => viewType !== _m_constants.VIEWS.TIMELINE_MONTH && viewType !== _m_constants.VIEWS.MONTH;
exports.isHorizontalView = viewType => {
switch (viewType) {
case _m_constants.VIEWS.TIMELINE_DAY:
case _m_constants.VIEWS.TIMELINE_WEEK:
case _m_constants.VIEWS.TIMELINE_WORK_WEEK:
case _m_constants.VIEWS.TIMELINE_MONTH:
case _m_constants.VIEWS.MONTH:
return true;
default:
return false
}
};
const isDateInRange = (date, startDate, endDate, diff) => diff > 0 ? _date.default.dateInRange(date, startDate, new Date(endDate.getTime() - 1)) : _date.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 = _date.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 = (groups, groupOrientation, isAllDayPanelVisible) => isVerticalGroupingApplied(groups, groupOrientation) && isAllDayPanelVisible;
exports.calculateViewStartDate = startDateOption => startDateOption;
exports.getCellDuration = (viewType, startDayHour, endDayHour, hoursInterval) => {
switch (viewType) {
case "month":
return 36e5 * calculateDayDuration(startDayHour, endDayHour);
case "timelineMonth":
return _date.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 && !!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, {
path: "toGrid"
})) || todayDate
};
exports.getCalculatedFirstDayOfWeek = firstDayOfWeekOption => (0, _type.isDefined)(firstDayOfWeekOption) ? firstDayOfWeekOption : _date2.default.firstDayOfWeekIndex();
const isHorizontalGroupingApplied = (groups, groupOrientation) => groupOrientation === _const.HORIZONTAL_GROUP_ORIENTATION && !!groups.length;
exports.isHorizontalGroupingApplied = isHorizontalGroupingApplied;
exports.isGroupingByDate = (groups, groupOrientation, groupByDate) => {
const isHorizontalGrouping = isHorizontalGroupingApplied(groups, 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)) {
if (isAllDay) {
result += 24
} else if (startDateHours < startDayHour) {
result += dayHours
} else if (startDateHours < endDayHour) {
result += endDayHour - startDateHours
}
}
if (viewDataProvider.isSkippedDate(endDate)) {
if (isAllDay) {
result += 24
} else if (endDateHours > endDayHour) {
result += dayHours
} else if (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) => _extends({}, item, {
key: `${item.key}_group_by_date_${index}`,
isFirstGroupCell: 0 === columnIndex,
isLastGroupCell: columnIndex === groupsRow.length - 1
})))]
}))), []);
exports.extendGroupItemsForGroupingByDate = extendGroupItemsForGroupingByDate;
exports.getGroupPanelData = (groups, columnCountPerGroup, groupByDate, baseColSpan) => {
let repeatCount = 1;
let groupPanelItems = groups.map((group => {
const result = [];
const {
name: resourceName,
items: items,
data: data
} = group;
for (let iterator = 0; iterator < repeatCount; iterator += 1) {
result.push(...items.map(((_ref2, index) => {
let {
id: id,
text: text,
color: color
} = _ref2;
return {
id: id,
text: text,
color: color,
key: `${iterator}_${resourceName}_${id}`,
resourceName: resourceName,
data: null === data || void 0 === data ? void 0 : data[index]
}
})))
}
repeatCount *= items.length;
return result
}));
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)))
},
60961:
/*!***********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/data.js ***!
\***********************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.resolveDataItems = exports.getPreparedDataItems = void 0;
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _m_utils = __webpack_require__( /*! ../../appointments/data_provider/m_utils */ 55523);
var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734);
exports.getPreparedDataItems = (dataItems, dataAccessors, cellDurationInMinutes, timeZoneCalculator) => {
const result = [];
null === dataItems || void 0 === dataItems || dataItems.forEach((rawAppointment => {
var _recurrenceRule$match;
const startDate = new Date(dataAccessors.getter.startDate(rawAppointment));
const endDate = new Date(dataAccessors.getter.endDate(rawAppointment));
(0, _m_utils.replaceWrongEndDate)(rawAppointment, startDate, endDate, cellDurationInMinutes, dataAccessors);
const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, dataAccessors, timeZoneCalculator);
const comparableStartDate = adapter.startDate && adapter.calculateStartDate("toGrid");
const comparableEndDate = adapter.endDate && adapter.calculateEndDate("toGrid");
const regex = new RegExp("freq", "gi");
const recurrenceRule = adapter.recurrenceRule;
const hasRecurrenceRule = !!(null !== recurrenceRule && void 0 !== recurrenceRule && null !== (_recurrenceRule$match = recurrenceRule.match(regex)) && void 0 !== _recurrenceRule$match && _recurrenceRule$match.length);
const visible = (0, _type.isDefined)(rawAppointment.visible) ? !!rawAppointment.visible : true;
if (comparableStartDate && comparableEndDate) {
result.push({
allDay: !!adapter.allDay,
startDate: comparableStartDate,
startDateTimeZone: rawAppointment.startDateTimeZone,
endDate: comparableEndDate,
endDateTimeZone: rawAppointment.endDateTimeZone,
recurrenceRule: adapter.recurrenceRule,
recurrenceException: adapter.recurrenceException,
hasRecurrenceRule: hasRecurrenceRule,
visible: visible,
rawAppointment: rawAppointment
})
}
}));
return result
};
exports.resolveDataItems = options => Array.isArray(options) ? options : options.data
},
44246:
/*!**********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/day.js ***!
\**********************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = void 0;
var _base = __webpack_require__( /*! ./base */ 33053);
exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalDuration) => {
const firstViewDate = (0, _base.getViewStartByOptions)(startDate, currentDate, intervalDuration, startDate);
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
}
},
33597:
/*!******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/exclude_from_recurrence.js ***!
\******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.excludeFromRecurrence = void 0;
var _date_serialization = (obj = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
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, timeZoneCalculator) => {
const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(_extends({}, appointment), dataAccessors, timeZoneCalculator);
appointmentAdapter.recurrenceException = createRecurrenceException(appointmentAdapter, exceptionDate);
return appointmentAdapter
}
},
29927:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/format_weekday.js ***!
\*********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.formatWeekdayAndDay = exports.formatWeekday = void 0;
var _date = (obj = __webpack_require__( /*! ../../../../localization/date */ 91500), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
const formatWeekday = date => _date.default.getDayNames("abbreviated")[date.getDay()];
exports.formatWeekday = formatWeekday;
exports.formatWeekdayAndDay = date => `${formatWeekday(date)} ${_date.default.format(date,"day")}`
},
94084:
/*!************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/index.js ***!
\************************************************************************************/
function(__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, "getAppointmentRenderingStrategyName", {
enumerable: true,
get: function() {
return _base.getAppointmentRenderingStrategyName
}
});
Object.defineProperty(exports, "getAppointmentTakesAllDay", {
enumerable: true,
get: function() {
return _base.getAppointmentTakesAllDay
}
});
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, "getGroupCount", {
enumerable: true,
get: function() {
return _base.getGroupCount
}
});
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, "getPreparedDataItems", {
enumerable: true,
get: function() {
return _data.getPreparedDataItems
}
});
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, "hasResourceValue", {
enumerable: true,
get: function() {
return _base.hasResourceValue
}
});
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.viewsUtils = exports.timelineWeekUtils = exports.timelineMonthUtils = exports.themeUtils = void 0;
var _themes = __webpack_require__( /*! ../../../scheduler/r1/utils/themes */ 52821);
var _agenda = __webpack_require__( /*! ./agenda */ 49372);
var _day = __webpack_require__( /*! ./day */ 44246);
var _month = __webpack_require__( /*! ./month */ 6076);
var _render = __webpack_require__( /*! ./render */ 52183);
var _timeline_month = __webpack_require__( /*! ./timeline_month */ 28413);
var _timeline_week = __webpack_require__( /*! ./timeline_week */ 15311);
var _views = __webpack_require__( /*! ./views */ 62556);
var _week = __webpack_require__( /*! ./week */ 47085);
var _work_week = __webpack_require__( /*! ./work_week */ 92637);
var _base = __webpack_require__( /*! ./base */ 33053);
var _data = __webpack_require__( /*! ./data */ 60961);
var _exclude_from_recurrence = __webpack_require__( /*! ./exclude_from_recurrence */ 33597);
var _format_weekday = __webpack_require__( /*! ./format_weekday */ 29927);
exports.agendaUtils = {
calculateStartViewDate: _agenda.calculateStartViewDate
};
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.viewsUtils = {
getCurrentView: _views.getCurrentView
};
exports.renderUtils = {
addToStyles: _render.addToStyles,
addWidthToStyle: _render.addWidthToStyle,
addHeightToStyle: _render.addHeightToStyle,
getGroupCellClasses: _render.getGroupCellClasses,
combineClasses: _render.combineClasses,
getCellSizeHorizontalClass: _render.getCellSizeHorizontalClass,
getCellSizeVerticalClass: _render.getCellSizeVerticalClass
};
exports.themeUtils = {
getThemeType: _themes.getThemeType
}
},
6076:
/*!************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/month.js ***!
\************************************************************************************/
function(__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__( /*! ../../../../core/utils/date */ 91198));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500));
var _base = __webpack_require__( /*! ./base */ 33053);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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 = _date2.default.getMonthNames("abbreviated")[date.getMonth()];
return [monthName, _date2.default.format(date, "day")].join(" ")
}
return _date2.default.format(date, "dd")
};
exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalCount, firstDayOfWeekOption) => {
const viewStart = getViewStartByOptions(startDate, currentDate, intervalCount, _date.default.getFirstMonthDate(startDate));
const firstMonthDate = _date.default.getFirstMonthDate(viewStart);
const firstDayOfWeek = (0, _base.getCalculatedFirstDayOfWeek)(firstDayOfWeekOption);
const firstViewDate = _date.default.getFirstWeekDate(firstMonthDate, firstDayOfWeek);
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
}
},
52183:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/render.js ***!
\*************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGroupCellClasses = exports.getCellSizeVerticalClass = exports.getCellSizeHorizontalClass = exports.combineClasses = exports.addWidthToStyle = exports.addToStyles = exports.addHeightToStyle = void 0;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const addToStyles = (options, style) => {
const nextStyle = style ?? {};
const result = _extends({}, 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)
};
const combineClasses = classesMap => Object.keys(classesMap).filter((cssClass => !!cssClass && classesMap[cssClass])).join(" ");
exports.combineClasses = combineClasses;
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 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" : ""
},
52821:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/themes.js ***!
\*************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getThemeType = void 0;
var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811);
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)
}
}
},
28413:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/timeline_month.js ***!
\*********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = void 0;
var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _base = __webpack_require__( /*! ./base */ 33053);
var _month = __webpack_require__( /*! ./month */ 6076);
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)
}
},
15311:
/*!********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/timeline_week.js ***!
\********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDateForHeaderText = void 0;
var _base = __webpack_require__( /*! ./base */ 33053);
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
})
}
},
62556:
/*!************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/views.js ***!
\************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getCurrentView = void 0;
var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922);
var _const = __webpack_require__( /*! ../const */ 4907);
exports.getCurrentView = (currentView, views) => {
let currentViewProps = views.find((view => {
const names = (0, _type.isObject)(view) ? [view.name, view.type] : [view];
if (names.includes(currentView)) {
return true
}
return false
}));
if (void 0 === currentViewProps) {
if (_const.VIEW_TYPES.includes(currentView)) {
currentViewProps = currentView
} else {
[currentViewProps] = views
}
}
return currentViewProps
}
},
47085:
/*!***********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/week.js ***!
\***********************************************************************************/
function(__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__( /*! ../../../../core/utils/date */ 91198));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500));
var _base = __webpack_require__( /*! ./base */ 33053);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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 _date2.default.format(validTimeDate, "shorttime")
};
exports.getIntervalDuration = intervalCount => 7 * _date.default.dateToMilliseconds("day") * intervalCount;
const getValidStartDate = (startDate, firstDayOfWeek) => startDate ? _date.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 = _date.default.getFirstWeekDate(viewStart, firstDayOfWeek);
return (0, _base.setOptionHour)(firstViewDate, startDayHour)
};
exports.calculateViewStartDate = (startDateOption, firstDayOfWeek) => {
const validFirstDayOfWeek = firstDayOfWeek ?? _date2.default.firstDayOfWeekIndex();
return _date.default.getFirstWeekDate(startDateOption, validFirstDayOfWeek)
}
},
92637:
/*!****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/work_week.js ***!
\****************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.calculateStartViewDate = void 0;
var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _base = __webpack_require__( /*! ./base */ 33053);
var _week = __webpack_require__( /*! ./week */ 47085);
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)
}
},
547:
/*!***********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/resources/m_agenda_resource_processor.js ***!
\***********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AgendaResourceProcessor = void 0;
var _array = __webpack_require__( /*! ../../../core/utils/array */ 89386);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _m_utils = __webpack_require__( /*! ./m_utils */ 31359);
class PromiseItem {
constructor(rawAppointment, promise) {
this.rawAppointment = rawAppointment;
this.promise = promise
}
}
exports.AgendaResourceProcessor = class {
get resourceDeclarations() {
return this._resourceDeclarations
}
set resourceDeclarations(value) {
this._resourceDeclarations = value;
this.isLoaded = false;
this.isLoading = false;
this.resourceMap.clear();
this.appointmentPromiseQueue = []
}
constructor() {
let resourceDeclarations = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
this._resourceDeclarations = resourceDeclarations;
this.isLoaded = false;
this.isLoading = false;
this.resourceMap = new Map;
this.appointmentPromiseQueue = []
}
_pushAllResources() {
this.appointmentPromiseQueue.forEach((_ref => {
let {
promise: promise,
rawAppointment: rawAppointment
} = _ref;
const result = [];
this.resourceMap.forEach(((resource, fieldName) => {
const item = {
label: resource.label,
values: []
};
if (fieldName in rawAppointment) {
(0, _array.wrapToArray)(rawAppointment[fieldName]).forEach((value => item.values.push(resource.map.get(value))))
}
if (item.values.length) {
result.push(item)
}
}));
promise.resolve(result)
}));
this.appointmentPromiseQueue = []
}
_onPullResource(fieldName, valueName, displayName, label, items) {
const map = new Map;
items.forEach((item => map.set(item[valueName], item[displayName])));
this.resourceMap.set(fieldName, {
label: label,
map: map
})
}
_hasResourceDeclarations(resources) {
if (0 === resources.length) {
this.appointmentPromiseQueue.forEach((_ref2 => {
let {
promise: promise
} = _ref2;
return promise.resolve([])
}));
this.appointmentPromiseQueue = [];
return false
}
return true
}
_tryPullResources(resources, resultAsync) {
if (!this.isLoading) {
this.isLoading = true;
const promises = [];
resources.forEach((resource => {
const promise = (new _deferred.Deferred).done((items => this._onPullResource((0, _m_utils.getFieldExpr)(resource), (0, _m_utils.getValueExpr)(resource), (0, _m_utils.getDisplayExpr)(resource), resource.label, items)));
promises.push(promise);
const dataSource = (0, _m_utils.getWrappedDataSource)(resource.dataSource);
if (dataSource.isLoaded()) {
promise.resolve(dataSource.items())
} else {
dataSource.load().done((list => promise.resolve(list))).fail((() => promise.reject()))
}
}));
_deferred.when.apply(null, promises).done((() => {
this.isLoaded = true;
this.isLoading = false;
this._pushAllResources()
})).fail((() => resultAsync.reject()))
}
}
initializeState() {
let resourceDeclarations = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
this.resourceDeclarations = resourceDeclarations
}
createListAsync(rawAppointment) {
const resultAsync = new _deferred.Deferred;
this.appointmentPromiseQueue.push(new PromiseItem(rawAppointment, resultAsync));
if (this._hasResourceDeclarations(this.resourceDeclarations)) {
if (this.isLoaded) {
this._pushAllResources()
} else {
this._tryPullResources(this.resourceDeclarations, resultAsync)
}
}
return resultAsync.promise()
}
}
},
31359:
/*!***************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/resources/m_utils.js ***!
\***************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setResourceToAppointment = exports.reduceResourcesTree = exports.loadResources = exports.isResourceMultiple = exports.groupAppointmentsByResourcesCore = exports.groupAppointmentsByResources = exports.getWrappedDataSource = exports.getValueExpr = exports.getResourcesDataByGroups = exports.getResourceTreeLeaves = exports.getResourceColor = exports.getResourceByField = exports.getPathToLeaf = exports.getPaintedResources = exports.getOrLoadResourceItem = exports.getNormalizedResources = exports.getGroupsObjectFromGroupsArray = exports.getFieldExpr = exports.getDisplayExpr = exports.getDataAccessors = exports.getCellGroups = exports.getAppointmentColor = exports.getAllGroups = exports.filterResources = exports.createResourcesTree = exports.createResourceEditorModel = exports.createReducedResourcesTree = exports.createExpressions = void 0;
var _array = __webpack_require__( /*! ../../../core/utils/array */ 89386);
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _object = __webpack_require__( /*! ../../../core/utils/object */ 48013);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _data_source = __webpack_require__( /*! ../../../data/data_source/data_source */ 85273);
var _utils = __webpack_require__( /*! ../../../data/data_source/utils */ 9234);
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const getValueExpr = resource => resource.valueExpr || "id";
exports.getValueExpr = getValueExpr;
const getDisplayExpr = resource => resource.displayExpr || "text";
exports.getDisplayExpr = getDisplayExpr;
const getFieldExpr = resource => resource.fieldExpr || resource.field;
exports.getFieldExpr = getFieldExpr;
const getWrappedDataSource = dataSource => {
if (dataSource instanceof _data_source.DataSource) {
return dataSource
}
const result = _extends({}, (0, _utils.normalizeDataSourceOptions)(dataSource), {
pageSize: 0
});
if (!Array.isArray(dataSource)) {
result.filter = dataSource.filter
}
return new _data_source.DataSource(result)
};
exports.getWrappedDataSource = getWrappedDataSource;
const createResourcesTree = groups => {
let leafIndex = 0;
const make = (group, groupIndex, result, parent) => {
result = result || [];
for (let itemIndex = 0; itemIndex < group.items.length; itemIndex++) {
var _group$data;
const currentGroupItem = group.items[itemIndex];
const resultItem = {
name: group.name,
value: currentGroupItem.id,
title: currentGroupItem.text,
data: null === (_group$data = group.data) || void 0 === _group$data ? void 0 : _group$data[itemIndex],
children: [],
parent: parent || null
};
const nextGroupIndex = groupIndex + 1;
if (groups[nextGroupIndex]) {
make(groups[nextGroupIndex], nextGroupIndex, resultItem.children, resultItem)
}
if (!resultItem.children.length) {
resultItem.leafIndex = leafIndex;
leafIndex++
}
result.push(resultItem)
}
return result
};
return make(groups[0], 0)
};
exports.createResourcesTree = createResourcesTree;
const getPathToLeaf = (leafIndex, groups) => {
const tree = createResourcesTree(groups);
const findLeafByIndex = (data, index) => {
for (let i = 0; i < data.length; i++) {
if (data[i].leafIndex === index) {
return data[i]
}
const leaf = findLeafByIndex(data[i].children, index);
if (leaf) {
return leaf
}
}
};
const makeBranch = (leaf, result) => {
result = result || [];
result.push(leaf.value);
if (leaf.parent) {
makeBranch(leaf.parent, result)
}
return result
};
const leaf = findLeafByIndex(tree, leafIndex);
return makeBranch(leaf).reverse()
};
exports.getPathToLeaf = getPathToLeaf;
const getCellGroups = (groupIndex, groups) => {
const result = [];
if ((0, _index.getGroupCount)(groups)) {
if (groupIndex < 0) {
return
}
const path = getPathToLeaf(groupIndex, groups);
for (let i = 0; i < groups.length; i++) {
result.push({
name: groups[i].name,
id: path[i]
})
}
}
return result
};
exports.getCellGroups = getCellGroups;
const getGroupsObjectFromGroupsArray = groupsArray => groupsArray.reduce(((currentGroups, _ref) => {
let {
name: name,
id: id
} = _ref;
return _extends({}, currentGroups, {
[name]: id
})
}), {});
exports.getGroupsObjectFromGroupsArray = getGroupsObjectFromGroupsArray;
exports.getAllGroups = groups => {
const groupCount = (0, _index.getGroupCount)(groups);
return [...new Array(groupCount)].map(((_, groupIndex) => {
const groupsArray = getCellGroups(groupIndex, groups);
return getGroupsObjectFromGroupsArray(groupsArray)
}))
};
const getResourceByField = (fieldName, loadedResources) => {
for (let i = 0; i < loadedResources.length; i++) {
const resource = loadedResources[i];
if (resource.name === fieldName) {
return resource.data
}
}
return []
};
exports.getResourceByField = getResourceByField;
exports.createResourceEditorModel = (resources, loadedResources) => resources.map((resource => {
const dataField = getFieldExpr(resource);
const dataSource = getResourceByField(dataField, loadedResources);
return {
editorOptions: {
dataSource: dataSource.length ? dataSource : getWrappedDataSource(resource.dataSource),
displayExpr: getDisplayExpr(resource),
valueExpr: getValueExpr(resource),
stylingMode: (0, _themes.isFluent)((0, _themes.current)()) ? "filled" : "outlined"
},
dataField: dataField,
editorType: resource.allowMultiple ? "dxTagBox" : "dxSelectBox",
label: {
text: resource.label || dataField
}
}
}));
const isResourceMultiple = (resources, resourceField) => {
const resource = resources.find((resource => {
const field = getFieldExpr(resource);
return field === resourceField
}));
return !!(null !== resource && void 0 !== resource && resource.allowMultiple)
};
exports.isResourceMultiple = isResourceMultiple;
const filterResources = (resources, fields) => resources.filter((resource => {
const field = getFieldExpr(resource);
return fields.indexOf(field) > -1
}));
exports.filterResources = filterResources;
const getPaintedResources = (resources, groups) => {
const newGroups = groups || [];
const result = resources.find((resource => resource.useColorAsDefault));
if (result) {
return result
}
const newResources = newGroups.length ? filterResources(resources, newGroups) : resources;
return newResources[newResources.length - 1]
};
exports.getPaintedResources = getPaintedResources;
const getOrLoadResourceItem = (resources, resourceLoaderMap, field, value) => {
const result = new _deferred.Deferred;
resources.filter((resource => getFieldExpr(resource) === field && (0, _type.isDefined)(resource.dataSource))).forEach((resource => {
const wrappedDataSource = getWrappedDataSource(resource.dataSource);
const valueExpr = getValueExpr(resource);
if (!resourceLoaderMap.has(field)) {
resourceLoaderMap.set(field, wrappedDataSource.load())
}
resourceLoaderMap.get(field).done((data => {
const getter = (0, _data.compileGetter)(valueExpr);
const filteredData = data.filter((resource => (0, _common.equalByValue)(getter(resource), value)));
result.resolve(filteredData[0])
})).fail((() => {
resourceLoaderMap.delete(field);
result.reject()
}))
}));
return result.promise()
};
exports.getOrLoadResourceItem = getOrLoadResourceItem;
const getDataAccessors = (dataAccessors, fieldName, type) => {
const actions = dataAccessors[type];
return actions[fieldName]
};
exports.getDataAccessors = getDataAccessors;
exports.groupAppointmentsByResources = function(config, appointments) {
let groups = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
let result = {
0: appointments
};
if (groups.length && config.loadedResources.length) {
result = groupAppointmentsByResourcesCore(config, appointments, config.loadedResources)
}
let totalResourceCount = 0;
config.loadedResources.forEach(((resource, index) => {
if (!index) {
totalResourceCount = resource.items.length
} else {
totalResourceCount *= resource.items.length
}
}));
for (let index = 0; index < totalResourceCount; index++) {
const key = index.toString();
if (result[key]) {
continue
}
result[key] = []
}
return result
};
const groupAppointmentsByResourcesCore = (config, appointments, resources) => {
const tree = createResourcesTree(resources);
const result = {};
appointments.forEach((appointment => {
const treeLeaves = getResourceTreeLeaves(((field, action) => getDataAccessors(config.dataAccessors, field, action)), tree, appointment);
for (let i = 0; i < treeLeaves.length; i++) {
if (!result[treeLeaves[i]]) {
result[treeLeaves[i]] = []
}
result[treeLeaves[i]].push((0, _object.deepExtendArraySafe)({}, appointment, true))
}
}));
return result
};
exports.groupAppointmentsByResourcesCore = groupAppointmentsByResourcesCore;
const getResourceTreeLeaves = (getDataAccessors, tree, rawAppointment, result) => {
result = result || [];
for (let i = 0; i < tree.length; i++) {
if (!hasGroupItem(getDataAccessors, rawAppointment, tree[i].name, tree[i].value)) {
continue
}
if ((0, _type.isDefined)(tree[i].leafIndex)) {
result.push(tree[i].leafIndex)
}
if (tree[i].children) {
getResourceTreeLeaves(getDataAccessors, tree[i].children, rawAppointment, result)
}
}
return result
};
exports.getResourceTreeLeaves = getResourceTreeLeaves;
const hasGroupItem = (getDataAccessors, rawAppointment, groupName, itemValue) => {
const resourceValue = getDataAccessors(groupName, "getter")(rawAppointment);
return (0, _index.hasResourceValue)((0, _array.wrapToArray)(resourceValue), itemValue)
};
exports.createReducedResourcesTree = (loadedResources, getDataAccessors, appointments) => {
const tree = createResourcesTree(loadedResources);
return reduceResourcesTree(getDataAccessors, tree, appointments)
};
const reduceResourcesTree = (getDataAccessors, tree, existingAppointments, _result) => {
_result = _result ? _result.children : [];
tree.forEach(((node, index) => {
let ok = false;
const resourceName = node.name;
const resourceValue = node.value;
const resourceTitle = node.title;
const resourceData = node.data;
const resourceGetter = getDataAccessors(resourceName, "getter");
existingAppointments.forEach((appointment => {
if (!ok) {
const resourceFromAppointment = resourceGetter(appointment);
if (Array.isArray(resourceFromAppointment)) {
if (resourceFromAppointment.includes(resourceValue)) {
_result.push({
name: resourceName,
value: resourceValue,
title: resourceTitle,
data: resourceData,
children: []
});
ok = true
}
} else if (resourceFromAppointment === resourceValue) {
_result.push({
name: resourceName,
value: resourceValue,
title: resourceTitle,
data: resourceData,
children: []
});
ok = true
}
}
}));
if (ok && node.children && node.children.length) {
reduceResourcesTree(getDataAccessors, node.children, existingAppointments, _result[index])
}
}));
return _result
};
exports.reduceResourcesTree = reduceResourcesTree;
exports.getResourcesDataByGroups = (loadedResources, resources, groups) => {
if (!groups || !groups.length) {
return loadedResources
}
const fieldNames = {};
const currentResourcesData = [];
groups.forEach((group => {
(0, _iterator.each)(group, ((name, value) => {
fieldNames[name] = value
}))
}));
const resourceData = loadedResources.filter((_ref2 => {
let {
name: name
} = _ref2;
return (0, _type.isDefined)(fieldNames[name])
}));
resourceData.forEach((data => currentResourcesData.push((0, _extend.extend)({}, data))));
currentResourcesData.forEach((currentResource => {
const {
items: items,
data: data,
name: resourceName
} = currentResource;
const resource = filterResources(resources, [resourceName])[0] || {};
const valueExpr = getValueExpr(resource);
const filteredItems = [];
const filteredData = [];
groups.filter((group => (0, _type.isDefined)(group[resourceName]))).forEach((group => {
(0, _iterator.each)(group, ((name, value) => {
if (!filteredItems.filter((item => item.id === value && item[valueExpr] === name)).length) {
const currentItems = items.filter((item => item.id === value));
const currentData = data.filter((item => item[valueExpr] === value));
filteredItems.push(...currentItems);
filteredData.push(...currentData)
}
}))
}));
currentResource.items = filteredItems;
currentResource.data = filteredData
}));
return currentResourcesData
};
exports.setResourceToAppointment = (resources, dataAccessors, appointment, groups) => {
const resourcesSetter = dataAccessors.setter;
for (const name in groups) {
const resourceData = groups[name];
const value = isResourceMultiple(resources, name) ? (0, _array.wrapToArray)(resourceData) : resourceData;
resourcesSetter[name](appointment, value)
}
};
const getResourceColor = (resources, resourceLoaderMap, field, value) => {
const result = new _deferred.Deferred;
const resource = filterResources(resources, [field])[0] || {};
const colorExpr = resource.colorExpr || "color";
const colorGetter = (0, _data.compileGetter)(colorExpr);
getOrLoadResourceItem(resources, resourceLoaderMap, field, value).done((resource => result.resolve(colorGetter(resource)))).fail((() => result.reject()));
return result.promise()
};
exports.getResourceColor = getResourceColor;
exports.getAppointmentColor = (resourceConfig, appointmentConfig) => {
const {
resources: resources,
dataAccessors: dataAccessors,
loadedResources: loadedResources,
resourceLoaderMap: resourceLoaderMap
} = resourceConfig;
const {
groupIndex: groupIndex,
groups: groups,
itemData: itemData
} = appointmentConfig;
const paintedResources = getPaintedResources(resources || [], groups);
if (paintedResources) {
const field = getFieldExpr(paintedResources);
const cellGroups = getCellGroups(groupIndex, loadedResources);
const resourcesDataAccessors = getDataAccessors(dataAccessors, field, "getter");
const resourceValues = (0, _array.wrapToArray)(resourcesDataAccessors(itemData));
let groupId = resourceValues[0];
for (let i = 0; i < cellGroups.length; i++) {
if (cellGroups[i].name === field) {
groupId = cellGroups[i].id;
break
}
}
return getResourceColor(resources, resourceLoaderMap, field, groupId)
}
return (new _deferred.Deferred).resolve().promise()
};
exports.createExpressions = function() {
let resources = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
const result = {
getter: {},
setter: {}
};
resources.forEach((resource => {
const field = getFieldExpr(resource);
result.getter[field] = (0, _data.compileGetter)(field);
result.setter[field] = (0, _data.compileSetter)(field)
}));
return result
};
exports.loadResources = (groups, resources, resourceLoaderMap) => {
const result = new _deferred.Deferred;
const deferreds = [];
const newGroups = groups || [];
const newResources = resources || [];
let loadedResources = [];
filterResources(newResources, newGroups).forEach((resource => {
const deferred = new _deferred.Deferred;
const name = getFieldExpr(resource);
deferreds.push(deferred);
const dataSourcePromise = getWrappedDataSource(resource.dataSource).load();
resourceLoaderMap.set(name, dataSourcePromise);
dataSourcePromise.done((data => {
const items = ((resource, data) => {
const valueGetter = (0, _data.compileGetter)(getValueExpr(resource));
const displayGetter = (0, _data.compileGetter)(getDisplayExpr(resource));
return data.map((item => {
const result = {
id: valueGetter(item),
text: displayGetter(item)
};
if (item.color) {
result.color = item.color
}
return result
}))
})(resource, data);
deferred.resolve({
name: name,
items: items,
data: data
})
})).fail((() => deferred.reject()))
}));
if (!deferreds.length) {
return result.resolve(loadedResources)
}
_deferred.when.apply(null, deferreds).done((function() {
for (var _len = arguments.length, resources = new Array(_len), _key = 0; _key < _len; _key++) {
resources[_key] = arguments[_key]
}
const hasEmpty = resources.some((r => 0 === r.items.length));
loadedResources = hasEmpty ? [] : resources;
result.resolve(loadedResources)
})).fail((() => result.reject()));
return result.promise()
};
exports.getNormalizedResources = (rawAppointment, dataAccessors, resources) => {
const result = {};
(0, _iterator.each)(dataAccessors.resources.getter, (fieldName => {
const value = dataAccessors.resources.getter[fieldName](rawAppointment);
if ((0, _type.isDefined)(value)) {
const isMultiple = isResourceMultiple(resources, fieldName);
const resourceValue = isMultiple ? (0, _array.wrapToArray)(value) : value;
result[fieldName] = resourceValue
}
}));
return result
}
},
60544:
/*!***************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/shaders/m_current_time_shader.js ***!
\***************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = (obj = __webpack_require__( /*! ../../../core/renderer */ 68374), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
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() {
this._$container && this._$container.find(".dx-scheduler-date-time-shader").remove()
}
}
},
65295:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/shaders/m_current_time_shader_horizontal.js ***!
\**************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _m_current_time_shader = (obj = __webpack_require__( /*! ./m_current_time_shader */ 60544), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
class HorizontalCurrentTimeShader extends _m_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)
}!isFirstShader && this._shader.push($shader)
}
}
_customizeShader($shader, groupIndex) {
const shaderWidth = this._workSpace.getIndicationWidth();
this._applyShaderWidth($shader, shaderWidth);
if (groupIndex >= 1) {
const workSpace = this._workSpace;
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 > maxWidth) {
width = maxWidth
}
if (width > 0) {
(0, _size.setWidth)($shader, width)
}
}
_customizeGroupedByDateShader($shader, groupIndex) {
const cellCount = this._workSpace.getIndicationCellCount();
const integerPart = Math.floor(cellCount);
const fractionPart = cellCount - integerPart;
const isFirstShaderPart = 0 === groupIndex;
const workSpace = this._workSpace;
const shaderWidth = isFirstShaderPart ? workSpace.getIndicationWidth() : fractionPart * workSpace.getCellWidth();
let shaderLeft;
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
},
11029:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/shaders/m_current_time_shader_vertical.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _m_current_time_shader = _interopRequireDefault(__webpack_require__( /*! ./m_current_time_shader */ 60544));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class VerticalCurrentTimeShader extends _m_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++) {
const shaderWidth = this._getShaderWidth(i);
this._renderTopShader(this._$shader, shaderHeight, shaderWidth, i);
!isSolidShader && this._renderBottomShader(this._$shader, maxHeight, shaderHeight, shaderWidth, i);
this._renderAllDayShader(shaderWidth, i)
}
}
_renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader) {
const shaderWidth = this._getShaderWidth(0);
let bottomShaderWidth = shaderWidth - this._workSpace.getCellWidth();
if (shaderHeight < 0) {
shaderHeight = 0;
bottomShaderWidth = shaderWidth
}
this._renderTopShader(this._$shader, shaderHeight, shaderWidth * groupCount, 0);
!isSolidShader && this._renderBottomShader(this._$shader, maxHeight, shaderHeight, 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(i) {
return this._workSpace.getGroupedStrategy().getShaderWidth(i)
}
clean() {
super.clean();
this._workSpace && this._workSpace._$allDayPanel && this._workSpace._$allDayPanel.find(".dx-scheduler-date-time-shader-all-day").remove()
}
}
exports.default = VerticalCurrentTimeShader
},
23778:
/*!******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/timezones/m_utils_timezones_data.js ***!
\******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _math = __webpack_require__( /*! ../../../core/utils/math */ 60810);
var _config = (obj = __webpack_require__( /*! ../../../core/config */ 80209), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
const parseTimezone = timeZoneConfig => {
const {
offsets: offsets
} = timeZoneConfig;
const {
offsetIndices: offsetIndices
} = timeZoneConfig;
const {
untils: untils
} = timeZoneConfig;
const offsetList = offsets.split("|").map((value => parseInt(value)));
const offsetIndexList = offsetIndices.split("").map((value => parseInt(value)));
const dateList = (value = untils, value.split("|").map((until => {
if ("Infinity" === until) {
return null
}
return 1e3 * parseInt(until, 36)
}))).map((accumulator = 0, value => accumulator += value));
var accumulator;
var value;
return {
offsetList: offsetList,
offsetIndexList: offsetIndexList,
dateList: dateList
}
};
const tzCache = new class {
constructor() {
this.map = new Map
}
tryGet(id) {
if (!this.map.get(id)) {
const config = timeZoneDataUtils.getTimezoneById(id);
if (!config) {
return false
}
const timeZoneInfo = parseTimezone(config);
this.map.set(id, timeZoneInfo)
}
return this.map.get(id)
}
};
const timeZoneDataUtils = {
_tzCache: tzCache,
getTimeZonesOld: () => (0, _config.default)().timezones ?? [],
formatOffset(offset) {
const hours = Math.floor(offset);
const minutesInDecimal = offset - hours;
const signString = (0, _math.sign)(offset) >= 0 ? "+" : "-";
const hoursString = `0${Math.abs(hours)}`.slice(-2);
const minutesString = minutesInDecimal > 0 ? ":" + 60 * minutesInDecimal : ":00";
return signString + hoursString + minutesString
},
formatId: id => id.split("/").join(" - ").split("_").join(" "),
getTimezoneById(id) {
if (!id) {
return
}
const tzList = this.getTimeZonesOld();
for (let i = 0; i < tzList.length; i++) {
const currentId = tzList[i].id;
if (currentId === id) {
return tzList[i]
}
}
return
},
getTimeZoneOffsetById(id, timestamp) {
const timeZoneInfo = tzCache.tryGet(id);
return timeZoneInfo ? this.getUtcOffset(timeZoneInfo, timestamp) : void 0
},
getTimeZoneDeclarationTuple(id, year) {
const timeZoneInfo = tzCache.tryGet(id);
return timeZoneInfo ? this.getTimeZoneDeclarationTupleCore(timeZoneInfo, year) : []
},
getTimeZoneDeclarationTupleCore(timeZoneInfo, year) {
const {
offsetList: offsetList
} = timeZoneInfo;
const {
offsetIndexList: offsetIndexList
} = timeZoneInfo;
const {
dateList: dateList
} = timeZoneInfo;
const tupleResult = [];
for (let i = 0; i < dateList.length; i++) {
const currentDate = dateList[i];
const currentYear = new Date(currentDate).getFullYear();
if (currentYear === year) {
const offset = offsetList[offsetIndexList[i + 1]];
tupleResult.push({
date: currentDate,
offset: -offset / 60
})
}
if (currentYear > year) {
break
}
}
return tupleResult
},
getUtcOffset(timeZoneInfo, dateTimeStamp) {
const {
offsetList: offsetList
} = timeZoneInfo;
const {
offsetIndexList: offsetIndexList
} = timeZoneInfo;
const {
dateList: dateList
} = timeZoneInfo;
const lastIntervalStartIndex = dateList.length - 1 - 1;
let index = lastIntervalStartIndex;
while (index >= 0 && dateTimeStamp < dateList[index]) {
index--
}
const offset = offsetList[offsetIndexList[index + 1]];
return -offset / 60 || offset
}
};
exports.default = timeZoneDataUtils
},
99740:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/timezones/timezone_list.js ***!
\*********************************************************************************************/
function(__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"]
}
},
48158:
/*!*******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/tooltip_strategies/m_desktop_tooltip_strategy.js ***!
\*******************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DesktopTooltipStrategy = void 0;
var _support = __webpack_require__( /*! ../../../core/utils/support */ 60137);
var _m_tooltip = (obj = __webpack_require__( /*! ../../ui/m_tooltip */ 58933), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _m_tooltip_strategy_base = __webpack_require__( /*! ./m_tooltip_strategy_base */ 98558);
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 = _support.touch ? "always" : "onHover";
return result
}
_createTooltip(target, dataList) {
const tooltip = this._createTooltipElement("dx-scheduler-appointment-tooltip-wrapper");
return this._options.createComponent(tooltip, _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"
}
})
}
_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
},
60737:
/*!******************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/tooltip_strategies/m_mobile_tooltip_strategy.js ***!
\******************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MobileTooltipStrategy = void 0;
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _ui = (obj = __webpack_require__( /*! ../../../ui/overlay/ui.overlay */ 89799), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _m_tooltip_strategy_base = __webpack_require__( /*! ./m_tooltip_strategy_base */ 98558);
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
},
98558:
/*!****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/tooltip_strategies/m_tooltip_strategy_base.js ***!
\****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TooltipStrategyBase = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _function_template = __webpack_require__( /*! ../../../core/templates/function_template */ 68494);
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008));
var _promise = __webpack_require__( /*! ../../core/utils/promise */ 17301);
var _m_list = _interopRequireDefault(__webpack_require__( /*! ../../ui/list/m_list.edit */ 36646));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
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) {
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)
}
_prepareBeforeVisibleChanged(dataList) {}
_getContentTemplate(dataList) {
return container => {
const listElement = (0, _renderer.default)(" ");
(0, _renderer.default)(container).append(listElement);
this._list = this._createList(listElement, dataList)
}
}
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, _m_list.default, this._createListOption(dataList))
}
_renderTemplate(appointment, targetedAppointment, index, color) {
const itemListContent = this._createItemListContent(appointment, targetedAppointment, color);
this._options.addDefaultTemplates({
[this._getItemListTemplateName()]: new _function_template.FunctionTemplate((options => {
const $container = (0, _renderer.default)(options.container);
$container.append(itemListContent);
return $container
}))
});
const template = this._options.getAppointmentTemplate(`${this._getItemListTemplateName()}Template`);
return this._createFunctionTemplate(template, appointment, targetedAppointment, index)
}
_createFunctionTemplate(template, appointmentData, targetedAppointmentData, index) {
const isButtonClicked = !!this._extraOptions.isButtonClick;
const isEmptyDropDownAppointmentTemplate = this._isEmptyDropDownAppointmentTemplate();
return new _function_template.FunctionTemplate((options => {
const {
promise: promise,
resolve: resolve
} = (0, _promise.createPromise)();
this.asyncTemplatePromises.add(promise);
return template.render({
model: isEmptyDropDownAppointmentTemplate ? {
appointmentData: appointmentData,
targetedAppointmentData: targetedAppointmentData,
isButtonClicked: isButtonClicked
} : appointmentData,
container: options.container,
index: index,
onRendered: () => {
this.asyncTemplatePromises.delete(promise);
resolve()
}
})
}))
}
_getItemListTemplateName() {
return this._isEmptyDropDownAppointmentTemplate() ? "appointmentTooltip" : "dropDownAppointment"
}
_isEmptyDropDownAppointmentTemplate() {
return !this._extraOptions.dropDownAppointmentTemplate || "dropDownAppointment" === this._extraOptions.dropDownAppointmentTemplate
}
_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 {
editing: editing
} = this._extraOptions;
const $itemElement = (0, _renderer.default)(" ").addClass("dx-tooltip-appointment-item");
$itemElement.append(this._createItemListMarker(color));
$itemElement.append(this._createItemListInfo(this._options.createFormattedDateText(appointment, targetedAppointment)));
const disabled = this._options.getAppointmentDisabled(appointment);
if (!disabled && (editing && true === editing.allowDeleting || true === editing)) {
$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 && color.done((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
}
}
},
79456:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/utils/is_scheduler_component.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isSchedulerComponent = function(component) {
return component.NAME === schedulerComponentName
};
const schedulerComponentName = "dxScheduler"
},
7836:
/*!**************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/const.js ***!
\**************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.WORK_SPACE_BORDER_PX = void 0;
exports.WORK_SPACE_BORDER_PX = 1
},
94654:
/*!**********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/helpers/m_position_helper.js ***!
\**********************************************************************************************************/
function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMaxAllowedPosition = exports.getGroupWidth = exports.getCellWidth = exports.getCellHeight = exports.getAllDayHeight = exports.PositionHelper = void 0;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
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(_extends({}, 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(_extends({}, options, {
groupIndex: correctedGroupIndex
}))
}
getGroupTop() {
return 0
}
_getAllDayHeight(showAllDayPanel) {
return getAllDayHeight(showAllDayPanel, false, this.DOMMetaData)
}
}
},
32316:
/*!*****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_agenda.js ***!
\*****************************************************************************************/
function(__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 */ 99393));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _element = __webpack_require__( /*! ../../../core/element */ 6415);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 82215));
var _m_utils = __webpack_require__( /*! ../resources/m_utils */ 31359);
var _m_work_space = _interopRequireDefault(__webpack_require__( /*! ./m_work_space */ 48377));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const {
tableCreator: tableCreator
} = _m_table_creator.default;
class SchedulerAgenda extends _m_work_space.default {
get type() {
return _m_constants.VIEWS.AGENDA
}
get renderingStrategy() {
return this.invoke("getLayoutManager").getRenderingStrategyInstance()
}
get appointmentDataProvider() {
return this.option("getAppointmentDataProvider")()
}
getStartViewDate() {
return this._startViewDate
}
_init() {
super._init();
this._activeStateUnit = void 0
}
_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 (!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"
}
_calculateStartViewDate() {
return _index.agendaUtils.calculateStartViewDate(this.option("currentDate"), this.option("startDayHour"))
}
_getRowCount() {
return this.option("agendaDuration")
}
_getCellCount() {
return 1
}
_getTimePanelRowCount() {
return this.option("agendaDuration")
}
_renderAllDayPanel() {
return (0, _common.noop)()
}
_toggleAllDayVisibility() {
return (0, _common.noop)()
}
_initWorkSpaceUnits() {
this._initGroupTable();
this._$timePanel = (0, _renderer.default)(" ").addClass(_m_classes.TIME_PANEL_CLASS);
this._$dateTable = (0, _renderer.default)("").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 (groups && groups.length) {
this._$groupTable = (0, _renderer.default)(" ").addClass("dx-scheduler-group-table")
}
}
_renderView() {
this._startViewDate = this._calculateStartViewDate();
this._rows = [];
this._initPositionHelper()
}
_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.invoke("onAgendaReady", rows);
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 = [];
for (let i = 0; i < rows.length; i++) {
if (rows[i].length && !(data = rows[i], !data.some((value => value > 0)))) {
result.push(rows[i])
}
}
var data;
return result
}
_getGroupHeaderContainer() {
return this._$groupTable
}
_makeGroupRows() {
const tree = (0, _m_utils.createReducedResourcesTree)(this.option("loadedResources"), ((field, action) => (0, _m_utils.getDataAccessors)(this.option("getResourceDataAccessors")(), field, action)), this.option("getFilteredItems")());
const cellTemplate = this.option("resourceCellTemplate");
const getGroupHeaderContentClass = _m_classes.GROUP_HEADER_CONTENT_CLASS;
const cellTemplates = [];
const table = tableCreator.makeGroupedTableFromJSON(tableCreator.VERTICAL, tree, {
cellTag: "th",
groupTableClass: "dx-scheduler-group-table",
groupRowClass: _m_classes.GROUP_ROW_CLASS,
groupCellClass: this._getGroupHeaderClass(),
groupCellCustomContent(cell, cellTextElement, index, data) {
const container = _dom_adapter.default.createElement("div");
container.className = getGroupHeaderContentClass;
if (cellTemplate && cellTemplate.render) {
cellTemplates.push(cellTemplate.render.bind(cellTemplate, {
model: {
data: data.data,
id: data.value,
color: data.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)()
}
_cleanCellDataCache() {
return (0, _common.noop)()
}
isIndicationAvailable() {
return false
}
_prepareCellTemplateOptions(text, date, rowIndex, $cell) {
const groupsOpt = this.option("groups");
const groups = {};
const isGroupedView = !!groupsOpt.length;
const path = isGroupedView && (0, _m_utils.getPathToLeaf)(rowIndex, groupsOpt) || [];
path.forEach(((resourceValue, resourceIndex) => {
const resourceName = groupsOpt[resourceIndex].name;
groups[resourceName] = resourceValue
}));
const groupIndex = isGroupedView ? this._getGroupIndexByResourceId(groups) : void 0;
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) {
date = options.getStartDate && options.getStartDate(rowIndex);
cellDateNumber = _date2.default.format(date, "d");
cellDayName = _date2.default.format(date, _index.formatWeekday)
}
if (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
}
_calculateRows(appointments) {
return this.renderingStrategy.calculateRows(appointments, this.option("agendaDuration"), this.option("currentDate"))
}
onDataSourceChanged(appointments) {
super.onDataSourceChanged();
this._renderView();
const rows = this._calculateRows(appointments);
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()
}
getCellDataByCoordinates() {
return {
startDate: null,
endDate: null
}
}
updateScrollPosition(date) {
const newDate = this.timeZoneCalculator.createDate(date, {
path: "toGrid"
});
const bounds = this.getVisibleBounds();
const startDateHour = newDate.getHours();
const startDateMinutes = newDate.getMinutes();
if (this.needUpdateScrollPosition(startDateHour, startDateMinutes, bounds, newDate)) {
this.scrollToTime(startDateHour, startDateMinutes, 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
}
_setSelectedCellsByCellData() {}
_getIntervalDuration() {
return _date.default.dateToMilliseconds("day") * this.option("intervalCount")
}
getDOMElementsMetaData() {
return {
dateTableCellsMeta: [
[{}]
],
allDayPanelCellsMeta: [{}]
}
}
}(0, _component_registrator.default)("dxSchedulerAgenda", SchedulerAgenda);
exports.default = SchedulerAgenda
},
14553:
/*!****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_cache.js ***!
\****************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Cache = void 0;
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
exports.Cache = class {
constructor() {
this._cache = new Map
}
get size() {
return this._cache.size
}
clear() {
this._cache.clear()
}
get(name, callback) {
if (!this._cache.has(name) && callback) {
this.set(name, callback())
}
return this._cache.get(name)
}
set(name, value) {
(0, _type.isDefined)(value) && this._cache.set(name, value)
}
}
},
78151:
/*!*************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_cells_selection_controller.js ***!
\*************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CellsSelectionController = void 0;
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
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(_extends({}, options, {
direction: "prev"
}));
break;
case "right":
nextCellIndices = this.getCellFromNextColumnPosition(_extends({}, options, {
direction: "next"
}))
}
const currentCellData = getCellDataByPosition(nextCellIndices.rowIndex, nextCellIndices.columnIndex, isAllDayPanelCell);
return this.moveToCell(_extends({}, 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
}
}
},
20191:
/*!********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_cells_selection_state.js ***!
\********************************************************************************************************/
function(__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
}
get viewDataProvider() {
return this._viewDataProvider
}
get focusedCell() {
const focusedCell = this._focusedCell;
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 = this._viewDataProvider;
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
}
}
},
92297:
/*!*******************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline.js ***!
\*******************************************************************************************/
function(__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 */ 99393));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515);
var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 82215));
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880));
var _m_current_time_shader_horizontal = _interopRequireDefault(__webpack_require__( /*! ../shaders/m_current_time_shader_horizontal */ 65295));
var _m_work_space_indicator = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_indicator */ 34623));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
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
}
}
_getCellByCoordinates(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) {
if (currentDate.getHours() < startDayHour) {
tailDelta = tailDuration - hiddenInterval + gapBeforeAppt
} else if (currentDate.getHours() >= startDayHour && currentDate.getHours() < endDayHour) {
tailDelta = tailDuration
} else if (currentDate.getHours() >= startDayHour && currentDate.getHours() >= endDayHour) {
tailDelta = tailDuration - (gapBeforeAppt - endDayHour * toMs("hour"))
} else if (!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
}
scrollToTime(hours, minutes, date) {
const coordinates = this._getScrollCoordinates(hours, minutes, date);
const scrollable = this.getScrollable();
const offset = this.option("rtlEnabled") ? (0, _position.getBoundingRect)(this.getScrollableContainer().get(0)).width : 0;
if (this.option("templatesRenderAsynchronously")) {
setTimeout((() => {
scrollable.scrollBy({
left: coordinates.left - scrollable.scrollLeft() - offset,
top: 0
})
}))
} else {
scrollable.scrollBy({
left: coordinates.left - scrollable.scrollLeft() - offset,
top: 0
})
}
}
renderRAllDayPanel() {}
renderRTimeTable() {}
_renderGroupAllDayPanel() {}
generateRenderOptions(argument) {
const options = super.generateRenderOptions(true);
return _extends({}, 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()
}
_toggleAllDayVisibility() {
return (0, _common.noop)()
}
_changeAllDayVisibility() {
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 _m_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: _extends({
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)
}))
}
_cleanCurrentTimeCells() {
this.$element().find(`.${_m_classes.HEADER_CURRENT_TIME_CELL_CLASS}`).removeClass(_m_classes.HEADER_CURRENT_TIME_CELL_CLASS)
}
}(0, _component_registrator.default)("dxSchedulerTimeline", SchedulerTimeline);
exports.default = SchedulerTimeline
},
10356:
/*!***********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_day.js ***!
\***********************************************************************************************/
function(__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 */ 99393));
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 92297));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class SchedulerTimelineDay extends _m_timeline.default {
get type() {
return _m_constants.VIEWS.TIMELINE_DAY
}
_getElementClass() {
return "dx-scheduler-timeline-day"
}
_needRenderWeekHeader() {
return this._isWorkSpaceWithCount()
}
}(0, _component_registrator.default)("dxSchedulerTimelineDay", SchedulerTimelineDay);
exports.default = SchedulerTimelineDay
},
91274:
/*!*************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_month.js ***!
\*************************************************************************************************/
function(__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 */ 99393));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515);
var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 92297));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class SchedulerTimelineMonth extends _m_timeline.default {
constructor() {
super(...arguments);
this.viewDirection = "horizontal"
}
get type() {
return _m_constants.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 _extends({}, options, {
getDateForHeaderText: (_, date) => date
})
}
keepOriginalHours() {
return true
}
}(0, _component_registrator.default)("dxSchedulerTimelineMonth", SchedulerTimelineMonth);
exports.default = SchedulerTimelineMonth
},
32414:
/*!************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_week.js ***!
\************************************************************************************************/
function(__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 */ 99393));
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 92297));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class SchedulerTimelineWeek extends _m_timeline.default {
get type() {
return _m_constants.VIEWS.TIMELINE_WEEK
}
_getElementClass() {
return "dx-scheduler-timeline-week"
}
_getHeaderPanelCellWidth($headerRow) {
return (0, _position.getBoundingRect)($headerRow.children().first().get(0)).width
}
_needRenderWeekHeader() {
return true
}
_incrementDate(date) {
date.setDate(date.getDate() + 1)
}
}
exports.default = SchedulerTimelineWeek;
(0, _component_registrator.default)("dxSchedulerTimelineWeek", SchedulerTimelineWeek)
},
23855:
/*!*****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_work_week.js ***!
\*****************************************************************************************************/
function(__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 */ 99393));
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_timeline_week = _interopRequireDefault(__webpack_require__( /*! ./m_timeline_week */ 32414));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class SchedulerTimelineWorkWeek extends _m_timeline_week.default {
get type() {
return _m_constants.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
},
33350:
/*!****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_virtual_scrolling.js ***!
\****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.VirtualScrollingRenderer = exports.VirtualScrollingDispatcher = void 0;
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
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._rowHeight = this.getCellHeight();
this._cellWidth = this.getCellWidth();
this._createVirtualScrollingBase()
}
}
get isRTL() {
return this.options.isRTL()
}
get verticalVirtualScrolling() {
return this._verticalVirtualScrolling
}
set verticalVirtualScrolling(value) {
this._verticalVirtualScrolling = value
}
get horizontalVirtualScrolling() {
return this._horizontalVirtualScrolling
}
set horizontalVirtualScrolling(value) {
this._horizontalVirtualScrolling = value
}
get document() {
return _dom_adapter.default.getDocument()
}
get height() {
return this.options.getSchedulerHeight()
}
get width() {
return this.options.getSchedulerWidth()
}
get rowHeight() {
return this._rowHeight
}
set rowHeight(value) {
this._rowHeight = value
}
get outlineCount() {
return this.options.getScrolling().outlineCount
}
get cellWidth() {
return this._cellWidth
}
set cellWidth(value) {
this._cellWidth = 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 _extends({}, 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 = !!this.verticalVirtualScrolling;
const isHorizontalVirtualScrollingCreated = !!this.horizontalVirtualScrolling;
if (this.verticalScrollingAllowed !== isVerticalVirtualScrollingCreated || this.horizontalScrollingAllowed !== isHorizontalVirtualScrollingCreated) {
this._rowHeight = this.getCellHeight();
this._cellWidth = this.getCellWidth();
this._createVirtualScrollingBase()
}
}
_createVirtualScrollingBase() {
if (this.verticalScrollingAllowed) {
this.verticalVirtualScrolling = new VerticalVirtualScrolling(_extends({}, this.options, {
viewportHeight: this.viewportHeight,
rowHeight: this.rowHeight,
outlineCount: this.outlineCount
}))
}
if (this.horizontalScrollingAllowed) {
this.horizontalVirtualScrolling = new HorizontalVirtualScrolling(_extends({}, 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._state = this.defaultState;
this.viewportSize = this.options.viewportSize;
this._itemSize = this.options.itemSize;
this._position = -1;
this._itemSizeChanged = false;
this.updateState(0)
}
get itemSize() {
return this._itemSize
}
set itemSize(value) {
this._itemSizeChanged = this._itemSize !== value;
this._itemSize = value
}
get state() {
return this._state
}
set state(value) {
this._state = 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._position
}
set position(value) {
this._position = 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(_extends({}, 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(_extends({}, 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(_workspace) {
this._workspace = _workspace;
this._renderAppointmentTimeoutID = null
}
getRenderTimeout() {
return 15
}
get workspace() {
return this._workspace
}
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.updateAppointments()), renderTimeout)
} else {
this.workspace.updateAppointments()
}
}
}
},
48377:
/*!*********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space.js ***!
\*********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648);
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _element = __webpack_require__( /*! ../../../core/element */ 6415);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _click = __webpack_require__( /*! ../../../events/click */ 95429);
var _contextmenu = __webpack_require__( /*! ../../../events/contextmenu */ 49166);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _drag = __webpack_require__( /*! ../../../events/drag */ 23174);
var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../events/pointer */ 93786));
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/scroll_view/ui.scrollable */ 41183));
var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688));
var _scroll = __webpack_require__( /*! ../../core/utils/scroll */ 97944);
var _index2 = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515);
var _index3 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_widget_observer = _interopRequireDefault(__webpack_require__( /*! ../base/m_widget_observer */ 79427));
var _m_appointment_drag_behavior = _interopRequireDefault(__webpack_require__( /*! ../m_appointment_drag_behavior */ 54915));
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 82215));
var _m_utils = __webpack_require__( /*! ../m_utils */ 84110);
var _m_utils2 = __webpack_require__( /*! ../resources/m_utils */ 31359);
var _m_current_time_shader_vertical = _interopRequireDefault(__webpack_require__( /*! ../shaders/m_current_time_shader_vertical */ 11029));
var _m_position_helper = __webpack_require__( /*! ./helpers/m_position_helper */ 94654);
var _m_cache = __webpack_require__( /*! ./m_cache */ 14553);
var _m_cells_selection_controller = __webpack_require__( /*! ./m_cells_selection_controller */ 78151);
var _m_cells_selection_state = _interopRequireDefault(__webpack_require__( /*! ./m_cells_selection_state */ 20191));
var _m_virtual_scrolling = __webpack_require__( /*! ./m_virtual_scrolling */ 33350);
var _m_work_space_grouped_strategy_horizontal = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_grouped_strategy_horizontal */ 48854));
var _m_work_space_grouped_strategy_vertical = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_grouped_strategy_vertical */ 2862));
var _m_view_data_provider = _interopRequireDefault(__webpack_require__( /*! ./view_model/m_view_data_provider */ 52974));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const {
tableCreator: tableCreator
} = _m_table_creator.default;
const {
abstract: abstract
} = _m_widget_observer.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 _m_widget_observer.default {
constructor() {
super(...arguments);
this.viewDirection = "vertical"
}
get type() {
return ""
}
get viewDataProvider() {
if (!this._viewDataProvider) {
this._viewDataProvider = new _m_view_data_provider.default(this.type)
}
return this._viewDataProvider
}
get cache() {
if (!this._cache) {
this._cache = new _m_cache.Cache
}
return this._cache
}
get cellsSelectionState() {
if (!this._cellsSelectionState) {
this._cellsSelectionState = 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 _extends({}, selectedCell, {
groupIndex: 0
})
}
const groupIndex = this._getGroupIndexByResourceId(groups);
return _extends({}, selectedCell, {
groupIndex: groupIndex
})
}));
this._cellsSelectionState.setSelectedCellsByData(validSelectedCells)
}
}
return this._cellsSelectionState
}
get cellsSelectionController() {
if (!this._cellsSelectionController) {
this._cellsSelectionController = new _m_cells_selection_controller.CellsSelectionController
}
return this._cellsSelectionController
}
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")
}
_supportedKeys() {
const clickHandler = function(e) {
e.preventDefault();
e.stopPropagation();
const selectedCells = this.cellsSelectionState.getSelectedCells();
if (null !== selectedCells && void 0 !== selectedCells && selectedCells.length) {
const selectedCellsElement = selectedCells.map((cellData => this._getCellByData(cellData))).filter((cell => !!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.focusedCell) || 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(_extends({}, 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 focusedCellData = this.cellsSelectionState.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._dom_getAllDayPanelCell(nextCellPosition.columnIndex) : this._dom_getDateCell(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.cellsSelectionState.getSelectedCells(), $nextFocusedCell)
}
_hasAllDayClass($cell) {
return $cell.hasClass(ALL_DAY_TABLE_CELL_CLASS)
}
_focusInHandler(e) {
if ((0, _renderer.default)(e.target).is(this._focusTarget()) && false !== this._isCellClick) {
delete this._isCellClick;
delete this._contextMenuHandled;
super._focusInHandler.apply(this, arguments);
this.cellsSelectionState.restoreSelectedAndFocusedCells();
if (!this.cellsSelectionState.focusedCell) {
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.cellsSelectionState.getSelectedCells())
}
}
_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 !!(null !== (_this$option = this.option("groups")) && void 0 !== _this$option && _this$option.length) && "vertical" === this.option("groupOrientation")
}
_isHorizontalGroupedWorkSpace() {
var _this$option2;
return !!(null !== (_this$option2 = this.option("groups")) && void 0 !== _this$option2 && _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)("").addClass("dx-scheduler-all-day-panel");
this._$allDayTitle = (0, _renderer.default)(" ").appendTo(this._$headerPanelEmptyCell)
}
_dateTableScrollableConfig() {
let config = {
useKeyboard: false,
bounceEnabled: false,
updateManually: true,
onScroll: () => {
var _this$_groupedStrateg;
null === (_this$_groupedStrateg = this._groupedStrategy.cache) || void 0 === _this$_groupedStrateg || _this$_groupedStrateg.clear()
}
};
if (this._needCreateCrossScrolling()) {
config = (0, _extend.extend)(config, this._createCrossScrollingConfig(config))
}
if (this.isVirtualScrolling() && (this.virtualScrollingDispatcher.horizontalScrollingAllowed || this.virtualScrollingDispatcher.height)) {
const currentOnScroll = config.onScroll;
config = _extends({}, config, {
onScroll: e => {
null === currentOnScroll || void 0 === currentOnScroll || currentOnScroll(e);
this.virtualScrollingDispatcher.handleOnScrollEvent(null === e || void 0 === e ? void 0 : e.scrollOffset)
}
})
}
return config
}
_createCrossScrollingConfig(_ref) {
let {
onScroll: onScroll
} = _ref;
return {
direction: "both",
onScroll: event => {
null === onScroll || void 0 === onScroll || onScroll();
this._scrollSync.sidebar({
top: event.scrollOffset.top
});
this._scrollSync.header({
left: event.scrollOffset.left
})
},
onEnd: () => {
this.option("onScrollEnd")()
}
}
}
_headerScrollableConfig() {
return {
useKeyboard: false,
showScrollbar: "never",
direction: "horizontal",
useNative: false,
updateManually: true,
bounceEnabled: false,
onScroll: event => {
this._scrollSync.dateTable({
left: event.scrollOffset.left
})
}
}
}
_visibilityChanged(visible) {
this.cache.clear();
if (visible) {
this._updateGroupTableHeight()
}
if (visible && this._needCreateCrossScrolling()) {
this._setTableSizes()
}
}
_setTableSizes() {
this.cache.clear();
this._attachTableClasses();
let cellWidth = this.getCellWidth();
if (cellWidth < this.getCellMinWidth()) {
cellWidth = this.getCellMinWidth()
}
const minWidth = this.getWorkSpaceMinWidth();
const groupCount = this._getGroupCount();
const totalCellCount = this._getTotalCellCount(groupCount);
let width = cellWidth * totalCellCount;
if (width < minWidth) {
width = minWidth
}(0, _size.setWidth)(this._$headerPanel, width);
(0, _size.setWidth)(this._$dateTable, width);
if (this._$allDayTable) {
(0, _size.setWidth)(this._$allDayTable, width)
}
this._attachHeaderTableClasses();
this._updateGroupTableHeight();
this._updateScrollable()
}
getWorkSpaceMinWidth() {
return this._groupedStrategy.getWorkSpaceMinWidth()
}
_dimensionChanged() {
if (!this._isVisible()) {
return
}
if (this.option("crossScrollingEnabled")) {
this._setTableSizes()
}
this.updateHeaderEmptyCellWidth();
this._updateScrollable();
this.cache.clear()
}
_needCreateCrossScrolling() {
return this.option("crossScrollingEnabled")
}
_getElementClass() {
return (0, _common.noop)()
}
_getRowCount() {
return this.viewDataProvider.getRowCount({
intervalCount: this.option("intervalCount"),
currentDate: this.option("currentDate"),
viewType: this.type,
hoursInterval: this.option("hoursInterval"),
startDayHour: this.option("startDayHour"),
endDayHour: this.option("endDayHour")
})
}
_getCellCount() {
return this.viewDataProvider.getCellCount({
intervalCount: this.option("intervalCount"),
currentDate: this.option("currentDate"),
viewType: this.type,
hoursInterval: this.option("hoursInterval"),
startDayHour: this.option("startDayHour"),
endDayHour: this.option("endDayHour")
})
}
isRenovatedRender() {
return this.renovatedRenderSupported() && this.option("renovateRender")
}
_isVirtualModeOn() {
return "virtual" === this.option("scrolling.mode")
}
isVirtualScrolling() {
return this.isRenovatedRender() && this._isVirtualModeOn()
}
_initVirtualScrolling() {
if (this.virtualScrollingDispatcher) {
this.virtualScrollingDispatcher.dispose();
this.virtualScrollingDispatcher = null
}
this.virtualScrollingDispatcher = new _m_virtual_scrolling.VirtualScrollingDispatcher(this._getVirtualScrollingDispatcherOptions());
this.virtualScrollingDispatcher.attachScrollableEvents();
this.renderer = new _m_virtual_scrolling.VirtualScrollingRenderer(this)
}
onDataSourceChanged(argument) {}
isGroupedAllDayPanel() {
return (0, _index3.calculateIsGroupedAllDayPanel)(this.option("groups"), this.option("groupOrientation"), this.isAllDayPanelVisible)
}
generateRenderOptions(isProvideVirtualCellsWidth) {
var _this$_getToday;
const groupCount = this._getGroupCount();
const groupOrientation = groupCount > 0 ? this.option("groupOrientation") : this._getDefaultGroupStrategy();
const options = _extends({
groupByDate: this.option("groupByDate"),
startRowIndex: 0,
startCellIndex: 0,
groupOrientation: groupOrientation,
today: null === (_this$_getToday = this._getToday) || void 0 === _this$_getToday ? void 0 : _this$_getToday.call(this),
groups: this.option("groups"),
isProvideVirtualCellsWidth: isProvideVirtualCellsWidth,
isAllDayPanelVisible: this.isAllDayPanelVisible,
selectedCells: this.cellsSelectionState.getSelectedCells(),
focusedCell: this.cellsSelectionState.focusedCell,
headerCellTextFormat: this._getFormat(),
getDateForHeaderText: (_, date) => date,
viewOffset: this.option("viewOffset"),
startDayHour: this.option("startDayHour"),
endDayHour: this.option("endDayHour"),
cellDuration: this.getCellDuration(),
viewType: this.type,
intervalCount: this.option("intervalCount"),
hoursInterval: this.option("hoursInterval"),
currentDate: this.option("currentDate"),
startDate: this.option("startDate"),
firstDayOfWeek: this.option("firstDayOfWeek"),
showCurrentTimeIndicator: this.option("showCurrentTimeIndicator")
}, this.virtualScrollingDispatcher.getRenderState());
return options
}
renovatedRenderSupported() {
return true
}
_updateGroupTableHeight() {
if (this._isVerticalGroupedWorkSpace() && (0, _window.hasWindow)()) {
this._setHorizontalGroupHeaderCellsHeight()
}
}
updateHeaderEmptyCellWidth() {
if ((0, _window.hasWindow)() && this._isRenderHeaderPanelEmptyCell()) {
const timePanelWidth = this.getTimePanelWidth();
const groupPanelWidth = this.getGroupTableWidth();
this._$headerPanelEmptyCell.css("width", timePanelWidth + groupPanelWidth)
}
}
_isGroupsSpecified(resources) {
var _this$option3;
return (null === (_this$option3 = this.option("groups")) || void 0 === _this$option3 ? void 0 : _this$option3.length) && resources
}
_getGroupIndexByResourceId(id) {
const groups = this.option("groups");
const resourceTree = (0, _m_utils2.createResourcesTree)(groups);
if (!resourceTree.length) {
return 0
}
return this._getGroupIndexRecursively(resourceTree, id)
}
_getGroupIndexRecursively(resourceTree, id) {
const currentKey = resourceTree[0].name;
const currentValue = id[currentKey];
return resourceTree.reduce(((prevIndex, _ref2) => {
let {
leafIndex: leafIndex,
value: value,
children: children
} = _ref2;
const areValuesEqual = currentValue === value;
if (areValuesEqual && void 0 !== leafIndex) {
return leafIndex
}
if (areValuesEqual) {
return this._getGroupIndexRecursively(children, id)
}
return prevIndex
}), 0)
}
_getViewStartByOptions() {
return (0, _index3.getViewStartByOptions)(this.option("startDate"), this.option("currentDate"), this._getIntervalDuration(), this.option("startDate") ? this._calculateViewStartDate() : void 0)
}
_getIntervalDuration() {
return this.viewDataProvider.getIntervalDuration(this.option("intervalCount"))
}
_getHeaderDate() {
return this.getStartViewDate()
}
_calculateViewStartDate() {
return (0, _index3.calculateViewStartDate)(this.option("startDate"))
}
_firstDayOfWeek() {
return this.viewDataProvider.getFirstDayOfWeek(this.option("firstDayOfWeek"))
}
_attachEvents() {
this._createSelectionChangedAction();
this._attachClickEvent();
this._attachContextMenuEvent()
}
_attachClickEvent() {
const that = this;
const pointerDownAction = this._createAction((e => {
that._pointerDownHandler(e.event)
}));
this._createCellClickAction();
const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`;
const $element = this.$element();
_events_engine.default.off($element, SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME);
_events_engine.default.off($element, SCHEDULER_CELL_DXCLICK_EVENT_NAME);
_events_engine.default.on($element, SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME, (e => {
if ((0, _index.isMouseEvent)(e) && e.which > 1) {
e.preventDefault();
return
}
pointerDownAction({
event: e
})
}));
_events_engine.default.on($element, SCHEDULER_CELL_DXCLICK_EVENT_NAME, cellSelector, (e => {
const $cell = (0, _renderer.default)(e.target);
that._cellClickAction({
event: e,
cellElement: (0, _element.getPublicElement)($cell),
cellData: that.getCellData($cell)
})
}))
}
_createCellClickAction() {
this._cellClickAction = this._createActionByOption("onCellClick", {
afterExecute: e => this._cellClickHandler(e.args[0].event)
})
}
_createSelectionChangedAction() {
this._selectionChangedAction = this._createActionByOption("onSelectionChanged")
}
_cellClickHandler(argument) {
if (this._showPopup) {
delete this._showPopup;
this._handleSelectedCellsClick()
}
}
_pointerDownHandler(e) {
const $target = (0, _renderer.default)(e.target);
if (!$target.hasClass(DATE_TABLE_CELL_CLASS) && !$target.hasClass(ALL_DAY_TABLE_CELL_CLASS)) {
this._isCellClick = false;
return
}
this._isCellClick = true;
if ($target.hasClass("dx-scheduler-focused-cell")) {
this._showPopup = true
} else {
const cellCoordinates = this._getCoordinatesByCell($target);
const isAllDayCell = this._hasAllDayClass($target);
this._setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target)
}
}
_handleSelectedCellsClick() {
const selectedCells = this.cellsSelectionState.getSelectedCells();
const firstCellData = selectedCells[0];
const lastCellData = selectedCells[selectedCells.length - 1];
const result = {
startDate: firstCellData.startDate,
endDate: lastCellData.endDate
};
if (void 0 !== lastCellData.allDay) {
result.allDay = lastCellData.allDay
}
this.option("onSelectedCellsClick")(result, lastCellData.groups)
}
_attachContextMenuEvent() {
this._createContextMenuAction();
const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`;
const $element = this.$element();
const eventName = (0, _index.addNamespace)(_contextmenu.name, this.NAME);
_events_engine.default.off($element, eventName, cellSelector);
_events_engine.default.on($element, eventName, cellSelector, this._contextMenuHandler.bind(this))
}
_contextMenuHandler(e) {
const $cell = (0, _renderer.default)(e.target);
this._contextMenuAction({
event: e,
cellElement: (0, _element.getPublicElement)($cell),
cellData: this.getCellData($cell)
});
this._contextMenuHandled = true
}
_createContextMenuAction() {
this._contextMenuAction = this._createActionByOption("onCellContextMenu")
}
_getGroupHeaderContainer() {
if (this._isVerticalGroupedWorkSpace()) {
return this._$groupTable
}
return this._$thead
}
_getDateHeaderContainer() {
return this._$thead
}
_getCalculateHeaderCellRepeatCount() {
return this._groupedStrategy.calculateHeaderCellRepeatCount()
}
_updateScrollable() {
var _this$_headerScrollab, _this$_sidebarScrolla;
this._dateTableScrollable.update();
null === (_this$_headerScrollab = this._headerScrollable) || void 0 === _this$_headerScrollab || _this$_headerScrollab.update();
null === (_this$_sidebarScrolla = this._sidebarScrollable) || void 0 === _this$_sidebarScrolla || _this$_sidebarScrolla.update()
}
_getTimePanelRowCount() {
return this._getCellCountInDay()
}
_getCellCountInDay() {
const hoursInterval = this.option("hoursInterval");
const startDayHour = this.option("startDayHour");
const endDayHour = this.option("endDayHour");
return this.viewDataProvider.getCellCountInDay(startDayHour, endDayHour, hoursInterval)
}
_getTotalCellCount(groupCount) {
return this._groupedStrategy.getTotalCellCount(groupCount)
}
_getTotalRowCount(groupCount, includeAllDayPanelRows) {
let result = this._groupedStrategy.getTotalRowCount(groupCount);
if (includeAllDayPanelRows && this.isAllDayPanelVisible) {
result += groupCount
}
return result
}
_getGroupIndex(rowIndex, columnIndex) {
return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex)
}
calculateEndDate(startDate) {
const {
viewDataGenerator: viewDataGenerator
} = this.viewDataProvider;
return viewDataGenerator.calculateEndDate(startDate, viewDataGenerator.getInterval(this.option("hoursInterval")), this.option("endDayHour"))
}
_getGroupCount() {
return (0, _index3.getGroupCount)(this.option("groups"))
}
_attachTablesEvents() {
const element = this.$element();
this._attachDragEvents(element);
this._attachPointerEvents(element)
}
_detachDragEvents(element) {
_events_engine.default.off(element, DragEventNames.ENTER);
_events_engine.default.off(element, DragEventNames.LEAVE);
_events_engine.default.off(element, DragEventNames.DROP)
}
_attachDragEvents(element) {
this._detachDragEvents(element);
_events_engine.default.on(element, DragEventNames.ENTER, DRAG_AND_DROP_SELECTOR, {
checkDropTarget: (target, event) => !this._isOutsideScrollable(target, event)
}, (e => {
if (!this.preventDefaultDragging) {
this.removeDroppableCellClass();
(0, _renderer.default)(e.target).addClass("dx-scheduler-date-table-droppable-cell")
}
}));
_events_engine.default.on(element, DragEventNames.LEAVE, (() => {
if (!this.preventDefaultDragging) {
this.removeDroppableCellClass()
}
}));
_events_engine.default.on(element, DragEventNames.DROP, DRAG_AND_DROP_SELECTOR, (() => {
var _this$dragBehavior, _this$dragBehavior$dr;
if (!this.dragBehavior) {
return
}
if (!(null !== (_this$dragBehavior = this.dragBehavior) && void 0 !== _this$dragBehavior && _this$dragBehavior.dragBetweenComponentsPromise)) {
this.dragBehavior.removeDroppableClasses();
return
}
null === (_this$dragBehavior$dr = this.dragBehavior.dragBetweenComponentsPromise) || void 0 === _this$dragBehavior$dr || _this$dragBehavior$dr.then((() => {
this.dragBehavior.removeDroppableClasses()
}))
}))
}
_attachPointerEvents(element) {
let isPointerDown = false;
_events_engine.default.off(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME);
_events_engine.default.off(element, SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME);
_events_engine.default.on(element, SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME, DRAG_AND_DROP_SELECTOR, (e => {
if ((0, _index.isMouseEvent)(e) && 1 === e.which) {
isPointerDown = true;
this.$element().addClass("dx-scheduler-work-space-mouse-selection");
_events_engine.default.off(_dom_adapter.default.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME);
_events_engine.default.on(_dom_adapter.default.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME, (() => {
isPointerDown = false;
this.$element().removeClass("dx-scheduler-work-space-mouse-selection")
}))
}
}));
_events_engine.default.on(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME, DRAG_AND_DROP_SELECTOR, (e => {
if (isPointerDown && this._dateTableScrollable && !this._dateTableScrollable.option("scrollByContent")) {
e.preventDefault();
e.stopPropagation();
this._moveToCell((0, _renderer.default)(e.target), true)
}
}))
}
_getFormat() {
return abstract()
}
getWorkArea() {
return this._$dateTableContainer
}
getScrollable() {
return this._dateTableScrollable
}
getScrollableScrollTop() {
return this._dateTableScrollable.scrollTop()
}
getGroupedScrollableScrollTop(allDay) {
return this._groupedStrategy.getScrollableScrollTop(allDay)
}
getScrollableScrollLeft() {
return this._dateTableScrollable.scrollLeft()
}
getScrollableOuterWidth() {
return this._dateTableScrollable.scrollWidth()
}
getScrollableContainer() {
return (0, _renderer.default)(this._dateTableScrollable.container())
}
getHeaderPanelHeight() {
return this._$headerPanel && (0, _size.getOuterHeight)(this._$headerPanel, true)
}
getTimePanelWidth() {
return this._$timePanel && (0, _position.getBoundingRect)(this._$timePanel.get(0)).width
}
getGroupTableWidth() {
return this._$groupTable ? (0, _size.getOuterWidth)(this._$groupTable) : 0
}
getWorkSpaceLeftOffset() {
return this._groupedStrategy.getLeftOffset()
}
_getCellCoordinatesByIndex(index) {
const columnIndex = Math.floor(index / this._getRowCount());
const rowIndex = index - this._getRowCount() * columnIndex;
return {
columnIndex: columnIndex,
rowIndex: rowIndex
}
}
_getDateGenerationOptions() {
var _this$viewDataProvide;
return {
startDayHour: this.option("startDayHour"),
endDayHour: this.option("endDayHour"),
isWorkView: this.viewDataProvider.viewDataGenerator.isWorkView,
interval: null === (_this$viewDataProvide = this.viewDataProvider.viewDataGenerator) || void 0 === _this$viewDataProvide ? void 0 : _this$viewDataProvide.getInterval(this.option("hoursInterval")),
startViewDate: this.getStartViewDate(),
firstDayOfWeek: this._firstDayOfWeek()
}
}
_getIntervalBetween(currentDate, allDay) {
const firstViewDate = this.getStartViewDate();
const startDayTime = this.option("startDayHour") * HOUR_MS;
const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate);
const fullInterval = currentDate.getTime() - firstViewDate.getTime() - timeZoneOffset;
const days = this._getDaysOfInterval(fullInterval, startDayTime);
const weekendsCount = this._getWeekendsCount(days);
let result = (days - weekendsCount) * DAY_MS;
if (!allDay) {
const {
hiddenInterval: hiddenInterval
} = this.viewDataProvider;
const visibleDayDuration = this.getVisibleDayDuration();
result = fullInterval - days * hiddenInterval - weekendsCount * visibleDayDuration
}
return result
}
_getWeekendsCount(argument) {
return 0
}
_getDaysOfInterval(fullInterval, startDayTime) {
return Math.floor((fullInterval + startDayTime) / DAY_MS)
}
_updateIndex(index) {
return index * this._getRowCount()
}
_getDroppableCell() {
return this._getDateTables().find(".dx-scheduler-date-table-droppable-cell")
}
_getWorkSpaceWidth() {
return this.cache.get("workspaceWidth", (() => {
if (this._needCreateCrossScrolling()) {
return (0, _position.getBoundingRect)(this._$dateTable.get(0)).width
}
const totalWidth = (0, _position.getBoundingRect)(this.$element().get(0)).width;
const timePanelWidth = this.getTimePanelWidth();
const groupTableWidth = this.getGroupTableWidth();
return totalWidth - timePanelWidth - groupTableWidth
}))
}
_getCellByCoordinates(cellCoordinates, groupIndex, inAllDayRow) {
const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow);
return this._dom_getDateCell(indexes)
}
_dom_getDateCell(position) {
return this._$dateTable.find("tr:not(.dx-scheduler-virtual-row)").eq(position.rowIndex).find(`td:not(.${_m_classes.VIRTUAL_CELL_CLASS})`).eq(position.columnIndex)
}
_dom_getAllDayPanelCell(columnIndex) {
return this._$allDayPanel.find("tr").eq(0).find("td").eq(columnIndex)
}
_getCells(allDay, direction) {
const cellClass = allDay ? ALL_DAY_TABLE_CELL_CLASS : DATE_TABLE_CELL_CLASS;
if ("vertical" === direction) {
let result = [];
for (let i = 1;; i++) {
const cells = this.$element().find(`tr .${cellClass}:nth-child(${i})`);
if (!cells.length) {
break
}
result = result.concat(cells.toArray())
}
return (0, _renderer.default)(result)
}
return this.$element().find(`.${cellClass}`)
}
_getFirstAndLastDataTableCell() {
const selector = this.isVirtualScrolling() ? `.${DATE_TABLE_CELL_CLASS}, .${_m_classes.VIRTUAL_CELL_CLASS}` : `.${DATE_TABLE_CELL_CLASS}`;
const $cells = this.$element().find(selector);
return [$cells[0], $cells[$cells.length - 1]]
}
_getAllCells(allDay) {
if (this._isVerticalGroupedWorkSpace()) {
return this._$dateTable.find(`td:not(.${_m_classes.VIRTUAL_CELL_CLASS})`)
}
const cellClass = allDay && this.supportAllDayRow() ? ALL_DAY_TABLE_CELL_CLASS : DATE_TABLE_CELL_CLASS;
return this.$element().find(`.${cellClass}`)
}
_setHorizontalGroupHeaderCellsHeight() {
const {
height: height
} = (0, _position.getBoundingRect)(this._$dateTable.get(0));
(0, _size.setOuterHeight)(this._$groupTable, height)
}
_getGroupHeaderCells() {
return this.$element().find(".dx-scheduler-group-header")
}
_getScrollCoordinates(hours, minutes, date, groupIndex, allDay) {
const currentDate = date || new Date(this.option("currentDate"));
const startDayHour = this.option("startDayHour");
const endDayHour = this.option("endDayHour");
if (hours < startDayHour) {
hours = startDayHour
}
if (hours >= endDayHour) {
hours = endDayHour - 1
}
currentDate.setHours(hours, minutes, 0, 0);
const cell = this.viewDataProvider.findGlobalCellPosition(currentDate, groupIndex, allDay);
const {
position: position,
cellData: cellData
} = cell;
return this.virtualScrollingDispatcher.calculateCoordinatesByDataAndPosition(cellData, position, currentDate, (0, _index3.isDateAndTimeView)(this.type), "vertical" === this.viewDirection)
}
_isOutsideScrollable(target, event) {
const $dateTableScrollableElement = this._dateTableScrollable.$element();
const scrollableSize = (0, _position.getBoundingRect)($dateTableScrollableElement.get(0));
const window = (0, _window.getWindow)();
const isTargetInAllDayPanel = !(0, _renderer.default)(target).closest($dateTableScrollableElement).length;
const isOutsideHorizontalScrollable = event.pageX < scrollableSize.left || event.pageX > scrollableSize.left + scrollableSize.width + (window.scrollX || 0);
const isOutsideVerticalScrollable = event.pageY < scrollableSize.top || event.pageY > scrollableSize.top + scrollableSize.height + (window.scrollY || 0);
if (isTargetInAllDayPanel && !isOutsideHorizontalScrollable) {
return false
}
return isOutsideVerticalScrollable || isOutsideHorizontalScrollable
}
setCellDataCache(cellCoordinates, groupIndex, $cell) {
const key = JSON.stringify({
rowIndex: cellCoordinates.rowIndex,
columnIndex: cellCoordinates.columnIndex,
groupIndex: groupIndex
});
this.cache.set(key, this.getCellData($cell))
}
setCellDataCacheAlias(appointment, geometry) {
const key = JSON.stringify({
rowIndex: appointment.rowIndex,
columnIndex: appointment.columnIndex,
groupIndex: appointment.groupIndex
});
const aliasKey = JSON.stringify({
top: geometry.top,
left: geometry.left
});
this.cache.set(aliasKey, this.cache.get(key))
}
supportAllDayRow() {
return true
}
keepOriginalHours() {
return false
}
_filterCellDataFields(cellData) {
return (0, _extend.extend)(true, {}, {
startDate: cellData.startDate,
endDate: cellData.endDate,
groups: cellData.groups,
groupIndex: cellData.groupIndex,
allDay: cellData.allDay
})
}
getCellData($cell) {
const cellData = this._getFullCellData($cell) || {};
return this._filterCellDataFields(cellData)
}
_getFullCellData($cell) {
const currentCell = $cell[0];
if (currentCell) {
return this._getDataByCell($cell)
}
return
}
_getVirtualRowOffset() {
return this.virtualScrollingDispatcher.virtualRowOffset
}
_getVirtualCellOffset() {
return this.virtualScrollingDispatcher.virtualCellOffset
}
_getDataByCell($cell) {
const rowIndex = $cell.parent().index() - this.virtualScrollingDispatcher.topVirtualRowsCount;
const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount;
const {
viewDataProvider: viewDataProvider
} = this;
const isAllDayCell = this._hasAllDayClass($cell);
const cellData = viewDataProvider.getCellData(rowIndex, columnIndex, isAllDayCell);
return cellData || void 0
}
isGroupedByDate() {
return this.option("groupByDate") && this._isHorizontalGroupedWorkSpace() && this._getGroupCount() > 0
}
getCellIndexByDate(date, inAllDayRow) {
const {
viewDataGenerator: viewDataGenerator
} = this.viewDataProvider;
const timeInterval = inAllDayRow ? 864e5 : viewDataGenerator.getInterval(this.option("hoursInterval"));
const startViewDateOffset = (0, _index3.getStartViewDateTimeOffset)(this.getStartViewDate(), this.option("startDayHour"));
const dateTimeStamp = this._getIntervalBetween(date, inAllDayRow) + startViewDateOffset;
let index = Math.floor(dateTimeStamp / timeInterval);
if (inAllDayRow) {
index = this._updateIndex(index)
}
if (index < 0) {
index = 0
}
return index
}
getDroppableCellIndex() {
const $droppableCell = this._getDroppableCell();
const $row = $droppableCell.parent();
const rowIndex = $row.index();
return rowIndex * $row.find("td").length + $droppableCell.index()
}
getDataByDroppableCell() {
const cellData = this.getCellData((0, _renderer.default)(this._getDroppableCell()));
const {
allDay: allDay
} = cellData;
const {
startDate: startDate
} = cellData;
const {
endDate: endDate
} = cellData;
return {
startDate: startDate,
endDate: endDate,
allDay: allDay,
groups: cellData.groups
}
}
getDateRange() {
return [this.getStartViewDate(), this.getEndViewDateByEndDayHour()]
}
getCellMinWidth() {
return 75
}
getRoundedCellWidth(groupIndex, startIndex, cellCount) {
if (groupIndex < 0 || !(0, _window.hasWindow)()) {
return 0
}
const $row = this.$element().find(`.${_m_classes.DATE_TABLE_ROW_CLASS}`).eq(0);
let width = 0;
const $cells = $row.find(`.${DATE_TABLE_CELL_CLASS}`);
const totalCellCount = this._getCellCount() * groupIndex;
cellCount = cellCount || this._getCellCount();
if (!(0, _type.isDefined)(startIndex)) {
startIndex = totalCellCount
}
for (let i = startIndex; i < totalCellCount + cellCount; i++) {
const element = (0, _renderer.default)($cells).eq(i).get(0);
const elementWidth = element ? (0, _position.getBoundingRect)(element).width : 0;
width += elementWidth
}
return width / (totalCellCount + cellCount - startIndex)
}
getCellWidth() {
return (0, _m_position_helper.getCellWidth)(this.getDOMElementsMetaData())
}
getCellHeight() {
return (0, _m_position_helper.getCellHeight)(this.getDOMElementsMetaData())
}
getAllDayHeight() {
return (0, _m_position_helper.getAllDayHeight)(this.option("showAllDayPanel"), this._isVerticalGroupedWorkSpace(), this.getDOMElementsMetaData())
}
getMaxAllowedPosition(groupIndex) {
return (0, _m_position_helper.getMaxAllowedPosition)(groupIndex, this.viewDataProvider, this.option("rtlEnabled"), this.getDOMElementsMetaData())
}
getAllDayOffset() {
return this._groupedStrategy.getAllDayOffset()
}
getCellIndexByCoordinates(coordinates, allDay) {
const {
horizontalScrollingState: horizontalScrollingState,
verticalScrollingState: verticalScrollingState
} = this.virtualScrollingDispatcher;
const cellCount = (null === horizontalScrollingState || void 0 === horizontalScrollingState ? void 0 : horizontalScrollingState.itemCount) ?? this._getTotalCellCount(this._getGroupCount());
const cellWidth = this.getCellWidth();
const cellHeight = allDay ? this.getAllDayHeight() : this.getCellHeight();
const leftCoordinateOffset = (null === horizontalScrollingState || void 0 === horizontalScrollingState ? void 0 : horizontalScrollingState.virtualItemSizeBefore) ?? 0;
const topCoordinateOffset = (null === verticalScrollingState || void 0 === verticalScrollingState ? void 0 : verticalScrollingState.virtualItemSizeBefore) ?? 0;
const topIndex = Math.floor(Math.floor(coordinates.top - topCoordinateOffset) / Math.floor(cellHeight));
let leftIndex = (coordinates.left - leftCoordinateOffset) / cellWidth;
leftIndex = Math.floor(leftIndex + .05);
if (this._isRTL()) {
leftIndex = cellCount - leftIndex - 1
}
return cellCount * topIndex + leftIndex
}
getStartViewDate() {
return this.viewDataProvider.getStartViewDate()
}
getEndViewDate() {
return this.viewDataProvider.getLastCellEndDate()
}
getEndViewDateByEndDayHour() {
return this.viewDataProvider.getLastViewDateByEndDayHour(this.option("endDayHour"))
}
getCellDuration() {
return (0, _index3.getCellDuration)(this.type, this.option("startDayHour"), this.option("endDayHour"), this.option("hoursInterval"))
}
getIntervalDuration(allDay) {
return allDay ? toMs("day") : this.getCellDuration()
}
getVisibleDayDuration() {
const startDayHour = this.option("startDayHour");
const endDayHour = this.option("endDayHour");
const hoursInterval = this.option("hoursInterval");
return this.viewDataProvider.getVisibleDayDuration(startDayHour, endDayHour, hoursInterval)
}
getGroupBounds(coordinates) {
const groupBounds = this._groupedStrategy instanceof _m_work_space_grouped_strategy_vertical.default ? this.getGroupBoundsVertical(coordinates.groupIndex) : this.getGroupBoundsHorizontal(coordinates);
return this._isRTL() ? this.getGroupBoundsRtlCorrection(groupBounds) : groupBounds
}
getGroupBoundsVertical(groupIndex) {
const $firstAndLastCells = this._getFirstAndLastDataTableCell();
return this._groupedStrategy.getGroupBoundsOffset(groupIndex, $firstAndLastCells)
}
getGroupBoundsHorizontal(coordinates) {
const cellCount = this._getCellCount();
const $cells = this._getCells();
const cellWidth = this.getCellWidth();
const {
groupedDataMap: groupedDataMap
} = this.viewDataProvider;
return this._groupedStrategy.getGroupBoundsOffset(cellCount, $cells, cellWidth, coordinates, groupedDataMap)
}
getGroupBoundsRtlCorrection(groupBounds) {
const cellWidth = this.getCellWidth();
return _extends({}, groupBounds, {
left: groupBounds.right - 2 * cellWidth,
right: groupBounds.left + 2 * cellWidth
})
}
needRecalculateResizableArea() {
return this._isVerticalGroupedWorkSpace() && 0 !== this.getScrollable().scrollTop()
}
getCellDataByCoordinates(coordinates, allDay) {
const key = JSON.stringify({
top: coordinates.top,
left: coordinates.left
});
return this.cache.get(key, (() => {
const $cells = this._getCells(allDay);
const cellIndex = this.getCellIndexByCoordinates(coordinates, allDay);
const $cell = $cells.eq(cellIndex);
return this.getCellData($cell)
}))
}
getVisibleBounds() {
const result = {};
const $scrollable = this.getScrollable().$element();
const cellHeight = this.getCellHeight();
const scrolledCellCount = this.getScrollableScrollTop() / cellHeight;
const totalCellCount = scrolledCellCount + (0, _size.getHeight)($scrollable) / cellHeight;
result.top = {
hours: Math.floor(scrolledCellCount * this.option("hoursInterval")) + this.option("startDayHour"),
minutes: scrolledCellCount % 2 ? 30 : 0
};
result.bottom = {
hours: Math.floor(totalCellCount * this.option("hoursInterval")) + this.option("startDayHour"),
minutes: Math.floor(totalCellCount) % 2 ? 30 : 0
};
return result
}
updateScrollPosition(date, groups) {
let allDay = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false;
const newDate = this.timeZoneCalculator.createDate(date, {
path: "toGrid"
});
const inAllDayRow = allDay && this.isAllDayPanelVisible;
if (this.needUpdateScrollPosition(newDate, groups, inAllDayRow)) {
this.scrollTo(newDate, groups, inAllDayRow, false)
}
}
needUpdateScrollPosition(date, groups, inAllDayRow) {
const cells = this._getCellsInViewport(inAllDayRow);
const groupIndex = this._isGroupsSpecified(groups) ? this._getGroupIndexByResourceId(groups) : 0;
const time = date.getTime();
const trimmedTime = _date.default.trimTime(date).getTime();
return cells.reduce(((currentResult, cell) => {
const {
startDate: cellStartDate,
endDate: cellEndDate,
groupIndex: cellGroupIndex
} = this.getCellData(cell);
const cellStartTime = cellStartDate.getTime();
const cellEndTime = cellEndDate.getTime();
if ((!inAllDayRow && cellStartTime <= time && time < cellEndTime || inAllDayRow && trimmedTime === cellStartTime) && groupIndex === cellGroupIndex) {
return false
}
return currentResult
}), true)
}
_getCellsInViewport(inAllDayRow) {
const $scrollable = this.getScrollable().$element();
const cellHeight = this.getCellHeight();
const cellWidth = this.getCellWidth();
const totalColumnCount = this._getTotalCellCount(this._getGroupCount());
const scrollableScrollTop = this.getScrollableScrollTop();
const scrollableScrollLeft = this.getScrollableScrollLeft();
const fullScrolledRowCount = scrollableScrollTop / cellHeight - this.virtualScrollingDispatcher.topVirtualRowsCount;
let scrolledRowCount = Math.floor(fullScrolledRowCount);
if (scrollableScrollTop % cellHeight !== 0) {
scrolledRowCount += 1
}
const fullScrolledColumnCount = scrollableScrollLeft / cellWidth;
let scrolledColumnCount = Math.floor(fullScrolledColumnCount);
if (scrollableScrollLeft % cellWidth !== 0) {
scrolledColumnCount += 1
}
const rowCount = Math.floor(fullScrolledRowCount + (0, _size.getHeight)($scrollable) / cellHeight);
const columnCount = Math.floor(fullScrolledColumnCount + (0, _size.getWidth)($scrollable) / cellWidth);
const $cells = this._getAllCells(inAllDayRow);
const result = [];
$cells.each((function(index) {
const $cell = (0, _renderer.default)(this);
const columnIndex = index % totalColumnCount;
const rowIndex = index / totalColumnCount;
if (scrolledColumnCount <= columnIndex && columnIndex < columnCount && scrolledRowCount <= rowIndex && rowIndex < rowCount) {
result.push($cell)
}
}));
return result
}
scrollToTime(hours, minutes, date) {
if (!this._isValidScrollDate(date)) {
return
}
const coordinates = this._getScrollCoordinates(hours, minutes, date);
const scrollable = this.getScrollable();
scrollable.scrollBy({
top: coordinates.top - scrollable.scrollTop(),
left: 0
})
}
scrollTo(date, groups) {
let allDay = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false;
let throwWarning = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : true;
if (!this._isValidScrollDate(date, throwWarning)) {
return
}
const groupIndex = this._getGroupCount() && groups ? this._getGroupIndexByResourceId(groups) : 0;
const isScrollToAllDay = allDay && this.isAllDayPanelVisible;
const coordinates = this._getScrollCoordinates(date.getHours(), date.getMinutes(), date, groupIndex, isScrollToAllDay);
const scrollable = this.getScrollable();
const $scrollable = scrollable.$element();
const cellWidth = this.getCellWidth();
const offset = this.option("rtlEnabled") ? cellWidth : 0;
const scrollableHeight = (0, _size.getHeight)($scrollable);
const scrollableWidth = (0, _size.getWidth)($scrollable);
const cellHeight = this.getCellHeight();
const xShift = (scrollableWidth - cellWidth) / 2;
const yShift = (scrollableHeight - cellHeight) / 2;
const left = coordinates.left - scrollable.scrollLeft() - xShift - offset;
let top = coordinates.top - scrollable.scrollTop() - yShift;
if (isScrollToAllDay && !this._isVerticalGroupedWorkSpace()) {
top = 0
}
if (this.option("templatesRenderAsynchronously")) {
setTimeout((() => {
scrollable.scrollBy({
left: left,
top: top
})
}))
} else {
scrollable.scrollBy({
left: left,
top: top
})
}
}
_isValidScrollDate(date) {
let throwWarning = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true;
const min = this.getStartViewDate();
const max = this.getEndViewDate();
if (date < min || date > max) {
throwWarning && _ui2.default.log("W1008", date);
return false
}
return true
}
needApplyCollectorOffset() {
return false
}
removeDroppableCellClass($cellElement) {
const $cell = $cellElement || this._getDroppableCell();
null === $cell || void 0 === $cell || $cell.removeClass("dx-scheduler-date-table-droppable-cell")
}
_getCoordinatesByCell($cell) {
const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount;
let rowIndex = $cell.parent().index();
const isAllDayCell = this._hasAllDayClass($cell);
const isVerticalGrouping = this._isVerticalGroupedWorkSpace();
if (!(isAllDayCell && !isVerticalGrouping)) {
rowIndex -= this.virtualScrollingDispatcher.topVirtualRowsCount
}
return {
rowIndex: rowIndex,
columnIndex: columnIndex
}
}
_isShowAllDayPanel() {
return this.option("showAllDayPanel")
}
_getTimePanelCells() {
return this.$element().find(".dx-scheduler-time-panel-cell")
}
_getRDateTableProps() {
return {
viewData: this.viewDataProvider.viewData,
viewContext: this.getR1ComponentsViewContext(),
dataCellTemplate: this.option("dataCellTemplate"),
addDateTableClass: !this.option("crossScrollingEnabled") || this.isVirtualScrolling(),
groupOrientation: this.option("groupOrientation"),
addVerticalSizesClassToRows: false
}
}
getR1ComponentsViewContext() {
return {
view: {
type: this.type
},
crossScrollingEnabled: !!this.option("crossScrollingEnabled")
}
}
_updateSelectedCellDataOption(selectedCellData, $nextFocusedCell) {
const correctedSelectedCellData = selectedCellData.map((_ref3 => {
let {
startDate: startDate,
endDate: endDate,
allDay: allDay,
groupIndex: groupIndex,
groups: groups
} = _ref3;
return {
startDate: startDate,
endDate: endDate,
allDay: allDay,
groupIndex: groupIndex,
groups: groups
}
}));
this.option("selectedCellData", correctedSelectedCellData);
this._selectionChangedAction({
selectedCellData: correctedSelectedCellData
})
}
_getCellByData(cellData) {
const {
startDate: startDate,
groupIndex: groupIndex,
allDay: allDay,
index: index
} = cellData;
const position = this.viewDataProvider.findCellPositionInMap({
startDate: startDate,
groupIndex: groupIndex,
isAllDay: allDay,
index: index
});
if (!position) {
return
}
return allDay && !this._isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(position.columnIndex) : this._dom_getDateCell(position)
}
getDOMElementsMetaData() {
return this.cache.get("cellElementsMeta", (() => ({
dateTableCellsMeta: this._getDateTableDOMElementsInfo(),
allDayPanelCellsMeta: this._getAllDayPanelDOMElementsInfo()
})))
}
_getDateTableDOMElementsInfo() {
const dateTableCells = this._getAllCells(false);
if (!dateTableCells.length || !(0, _window.hasWindow)()) {
return [
[{}]
]
}
const dateTable = this._getDateTable();
const dateTableRect = (0, _position.getBoundingRect)(dateTable.get(0));
const columnsCount = this.viewDataProvider.getColumnsCount();
const result = [];
dateTableCells.each(((index, cell) => {
const rowIndex = Math.floor(index / columnsCount);
if (result.length === rowIndex) {
result.push([])
}
this._addCellMetaData(result[rowIndex], cell, dateTableRect)
}));
return result
}
_getAllDayPanelDOMElementsInfo() {
const result = [];
if (this.isAllDayPanelVisible && !this._isVerticalGroupedWorkSpace() && (0, _window.hasWindow)()) {
const allDayCells = this._getAllCells(true);
if (!allDayCells.length) {
return [{}]
}
const allDayAppointmentContainer = this._$allDayPanel;
const allDayPanelRect = (0, _position.getBoundingRect)(allDayAppointmentContainer.get(0));
allDayCells.each(((_, cell) => {
this._addCellMetaData(result, cell, allDayPanelRect)
}))
}
return result
}
_addCellMetaData(cellMetaDataArray, cell, parentRect) {
const cellRect = (0, _position.getBoundingRect)(cell);
cellMetaDataArray.push({
left: cellRect.left - parentRect.left,
top: cellRect.top - parentRect.top,
width: cellRect.width,
height: cellRect.height
})
}
_oldRender_getAllDayCellData(groupIndex) {
return (cell, rowIndex, columnIndex) => {
const validColumnIndex = columnIndex % this._getCellCount();
const options = this._getDateGenerationOptions(true);
let startDate = this.viewDataProvider.viewDataGenerator.getDateByCellIndices(options, rowIndex, validColumnIndex, this._getCellCountInDay());
startDate = _date.default.trimTime(startDate);
let validGroupIndex = groupIndex || 0;
if (this.isGroupedByDate()) {
validGroupIndex = Math.floor(columnIndex % this._getGroupCount())
} else if (this._isHorizontalGroupedWorkSpace()) {
validGroupIndex = Math.floor(columnIndex / this._getCellCount())
}
const data = {
startDate: startDate,
endDate: startDate,
allDay: true,
groupIndex: validGroupIndex
};
const groupsArray = (0, _m_utils2.getCellGroups)(validGroupIndex, this.option("groups"));
if (groupsArray.length) {
data.groups = (0, _m_utils2.getGroupsObjectFromGroupsArray)(groupsArray)
}
return {
key: "dxCellData",
value: data
}
}
}
renderRWorkSpace() {
let {
header: header,
timePanel: timePanel,
dateTable: dateTable,
allDayPanel: allDayPanel
} = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : DEFAULT_WORKSPACE_RENDER_OPTIONS.renderComponents;
if (header) {
this.renderRHeaderPanel()
}
if (timePanel) {
this.renderRTimeTable()
}
if (dateTable) {
this.renderRDateTable()
}
if (allDayPanel) {
this.renderRAllDayPanel()
}
}
renderRDateTable() {
_m_utils.utils.renovation.renderComponent(this, this._$dateTable, _index2.DateTableComponent, "renovatedDateTable", this._getRDateTableProps())
}
renderRGroupPanel() {
var _this$option4;
const options = {
viewContext: this.getR1ComponentsViewContext(),
groups: this.option("groups"),
groupOrientation: this.option("groupOrientation"),
groupByDate: this.isGroupedByDate(),
resourceCellTemplate: this.option("resourceCellTemplate"),
className: this.verticalGroupTableClass,
groupPanelData: this.viewDataProvider.getGroupPanelData(this.generateRenderOptions())
};
if (null !== (_this$option4 = this.option("groups")) && void 0 !== _this$option4 && _this$option4.length) {
this._attachGroupCountClass();
_m_utils.utils.renovation.renderComponent(this, this._getGroupHeaderContainer(), _index2.GroupPanelComponent, "renovatedGroupPanel", options)
} else {
this._detachGroupCountClass()
}
}
renderRAllDayPanel() {
const visible = this.isAllDayPanelVisible && !this.isGroupedAllDayPanel();
if (visible) {
var _this$virtualScrollin;
this._toggleAllDayVisibility(false);
const options = _extends({
viewData: this.viewDataProvider.viewData,
viewContext: this.getR1ComponentsViewContext(),
dataCellTemplate: this.option("dataCellTemplate"),
startCellIndex: 0
}, (null === (_this$virtualScrollin = this.virtualScrollingDispatcher.horizontalVirtualScrolling) || void 0 === _this$virtualScrollin ? void 0 : _this$virtualScrollin.getRenderState()) || {});
_m_utils.utils.renovation.renderComponent(this, this._$allDayTable, _index2.AllDayTableComponent, "renovatedAllDayPanel", options);
_m_utils.utils.renovation.renderComponent(this, this._$allDayTitle, _index2.AllDayPanelTitleComponent, "renovatedAllDayPanelTitle", {})
}
this._toggleAllDayVisibility(true)
}
renderRTimeTable() {
_m_utils.utils.renovation.renderComponent(this, this._$timePanel, _index2.TimePanelComponent, "renovatedTimePanel", {
viewContext: this.getR1ComponentsViewContext(),
timePanelData: this.viewDataProvider.timePanelData,
timeCellTemplate: this.option("timeCellTemplate"),
groupOrientation: this.option("groupOrientation")
})
}
renderRHeaderPanel() {
var _this$option5;
let isRenderDateHeader = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : true;
if (null !== (_this$option5 = this.option("groups")) && void 0 !== _this$option5 && _this$option5.length) {
this._attachGroupCountClass()
} else {
this._detachGroupCountClass()
}
_m_utils.utils.renovation.renderComponent(this, this._$thead, this.renovatedHeaderPanelComponent, "renovatedHeaderPanel", {
viewContext: this.getR1ComponentsViewContext(),
dateHeaderData: this.viewDataProvider.dateHeaderData,
groupPanelData: this.viewDataProvider.getGroupPanelData(this.generateRenderOptions()),
dateCellTemplate: this.option("dateCellTemplate"),
timeCellTemplate: this.option("timeCellTemplate"),
groups: this.option("groups"),
groupByDate: this.isGroupedByDate(),
groupOrientation: this.option("groupOrientation"),
resourceCellTemplate: this.option("resourceCellTemplate"),
isRenderDateHeader: isRenderDateHeader
})
}
initDragBehavior(scheduler) {
if (!this.dragBehavior && scheduler) {
this.dragBehavior = new _m_appointment_drag_behavior.default(scheduler);
const $rootElement = (0, _renderer.default)(scheduler.element());
this._createDragBehavior(this.getWorkArea(), $rootElement);
if (!this._isVerticalGroupedWorkSpace()) {
this._createDragBehavior(this._$allDayPanel, $rootElement)
}
}
}
_createDragBehavior($targetElement, $rootElement) {
const options = {
getItemData: (itemElement, appointments) => appointments._getItemData(itemElement),
getItemSettings: $itemElement => $itemElement.data(_m_constants.APPOINTMENT_SETTINGS_KEY)
};
this._createDragBehaviorBase($targetElement, $rootElement, options)
}
_createDragBehaviorBase(targetElement, rootElement, options) {
const container = this.$element().find(`.${_m_classes.FIXED_CONTAINER_CLASS}`);
this.dragBehavior.addTo(targetElement, createDragBehaviorConfig(container, rootElement, this.isDefaultDraggingMode, this.dragBehavior, (() => {
if (!this.isDefaultDraggingMode) {
this.preventDefaultDragging = false
}
}), (() => {
if (!this.isDefaultDraggingMode) {
this.preventDefaultDragging = true
}
}), (() => this._getDroppableCell()), (() => this._getDateTables()), (() => this.removeDroppableCellClass()), (() => this.getCellWidth()), options))
}
_isRenderHeaderPanelEmptyCell() {
return this._isVerticalGroupedWorkSpace()
}
_dispose() {
super._dispose();
this.virtualScrollingDispatcher.dispose()
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
currentDate: new Date,
intervalCount: 1,
startDate: null,
firstDayOfWeek: void 0,
startDayHour: 0,
endDayHour: 24,
viewOffset: 0,
hoursInterval: .5,
activeStateEnabled: true,
hoverStateEnabled: true,
groups: [],
showAllDayPanel: true,
allDayExpanded: false,
onCellClick: null,
crossScrollingEnabled: false,
dataCellTemplate: null,
timeCellTemplate: null,
resourceCellTemplate: null,
dateCellTemplate: null,
allowMultipleCellSelection: true,
indicatorTime: new Date,
indicatorUpdateInterval: 5 * toMs("minute"),
shadeUntilCurrentTime: true,
groupOrientation: "horizontal",
selectedCellData: [],
groupByDate: false,
scrolling: {
mode: "standard"
},
allDayPanelMode: "all",
renovateRender: true,
height: void 0,
draggingMode: "outlook",
onScrollEnd: () => {},
getHeaderHeight: void 0,
onRenderAppointments: () => {},
onShowAllDayPanel: () => {},
onSelectedCellsClick: () => {},
timeZoneCalculator: void 0,
schedulerHeight: void 0,
schedulerWidth: void 0
})
}
_optionChanged(args) {
switch (args.name) {
case "startDayHour":
case "endDayHour":
case "viewOffset":
case "dateCellTemplate":
case "resourceCellTemplate":
case "dataCellTemplate":
case "timeCellTemplate":
case "hoursInterval":
case "firstDayOfWeek":
case "currentDate":
case "startDate":
this._cleanWorkSpace();
break;
case "groups":
this._cleanView();
this._removeAllDayElements();
this._initGrouping();
this.repaint();
break;
case "groupOrientation":
this._initGroupedStrategy();
this._createAllDayPanelElements();
this._removeAllDayElements();
this._cleanWorkSpace();
this._toggleGroupByDateClass();
break;
case "showAllDayPanel":
if (this._isVerticalGroupedWorkSpace()) {
this._cleanView();
this._removeAllDayElements();
this._initGrouping();
this.repaint()
} else if (!this.isRenovatedRender()) {
this._toggleAllDayVisibility(true)
} else {
this.renderWorkSpace()
}
break;
case "allDayExpanded":
this._changeAllDayVisibility();
this._attachTablesEvents();
this._updateScrollable();
break;
case "onSelectionChanged":
this._createSelectionChangedAction();
break;
case "onCellClick":
this._createCellClickAction();
break;
case "onCellContextMenu":
this._attachContextMenuEvent();
break;
case "intervalCount":
this._cleanWorkSpace();
this._toggleWorkSpaceCountClass();
break;
case "groupByDate":
this._cleanWorkSpace();
this._toggleGroupByDateClass();
break;
case "crossScrollingEnabled":
this._toggleHorizontalScrollClass();
this._dateTableScrollable.option(this._dateTableScrollableConfig());
break;
case "allDayPanelMode":
this.updateShowAllDayPanel();
this.updateAppointments();
break;
case "width":
super._optionChanged(args);
this._dimensionChanged();
break;
case "timeZoneCalculator":
case "allowMultipleCellSelection":
case "selectedCellData":
break;
case "renovateRender":
case "scrolling":
this.repaint();
break;
case "schedulerHeight":
case "schedulerWidth":
this.virtualScrollingDispatcher.updateDimensions(true);
break;
default:
super._optionChanged(args)
}
}
updateShowAllDayPanel() {
const isHiddenAllDayPanel = "hidden" === this.option("allDayPanelMode");
this.option("onShowAllDayPanel")(!isHiddenAllDayPanel)
}
_getVirtualScrollingDispatcherOptions() {
return {
getCellHeight: this.getCellHeight.bind(this),
getCellWidth: this.getCellWidth.bind(this),
getCellMinWidth: this.getCellMinWidth.bind(this),
isRTL: this._isRTL.bind(this),
getSchedulerHeight: () => this.option("schedulerHeight"),
getSchedulerWidth: () => this.option("schedulerWidth"),
getViewHeight: () => this.$element().height ? this.$element().height() : (0, _size.getHeight)(this.$element()),
getViewWidth: () => this.$element().width ? this.$element().width() : (0, _size.getWidth)(this.$element()),
getWindowHeight: () => (0, _window.getWindow)().innerHeight,
getWindowWidth: () => (0, _window.getWindow)().innerWidth,
getScrolling: () => this.option("scrolling"),
getScrollableOuterWidth: this.getScrollableOuterWidth.bind(this),
getScrollable: this.getScrollable.bind(this),
createAction: this._createAction.bind(this),
updateRender: this.updateRender.bind(this),
updateGrid: this.updateGrid.bind(this),
getGroupCount: this._getGroupCount.bind(this),
isVerticalGrouping: this._isVerticalGroupedWorkSpace.bind(this),
getTotalRowCount: this._getTotalRowCount.bind(this),
getTotalCellCount: this._getTotalCellCount.bind(this)
}
}
_cleanWorkSpace() {
this._cleanView();
this._toggleGroupedClass();
this._toggleWorkSpaceWithOddCells();
this.virtualScrollingDispatcher.updateDimensions(true);
this._renderView();
this.option("crossScrollingEnabled") && this._setTableSizes();
this.cache.clear()
}
_init() {
this._scrollSync = {};
this._viewDataProvider = null;
this._cellsSelectionState = null;
this._activeStateUnit = CELL_SELECTOR;
super._init();
this._initGrouping();
this._toggleHorizontalScrollClass();
this._toggleWorkSpaceCountClass();
this._toggleGroupByDateClass();
this._toggleWorkSpaceWithOddCells();
this.$element().addClass("dx-scheduler-work-space").addClass(this._getElementClass())
}
_initPositionHelper() {
this.positionHelper = new _m_position_helper.PositionHelper({
key: this.option("key"),
viewDataProvider: this.viewDataProvider,
viewStartDayHour: this.option("startDayHour"),
viewEndDayHour: this.option("endDayHour"),
cellDuration: this.getCellDuration(),
groupedStrategy: this._groupedStrategy,
isGroupedByDate: this.isGroupedByDate(),
rtlEnabled: this.option("rtlEnabled"),
startViewDate: this.getStartViewDate(),
isVerticalGrouping: this._isVerticalGroupedWorkSpace(),
groupCount: this._getGroupCount(),
isVirtualScrolling: this.isVirtualScrolling(),
getDOMMetaDataCallback: this.getDOMElementsMetaData.bind(this)
})
}
_initGrouping() {
this._initGroupedStrategy();
this._toggleGroupingDirectionClass();
this._toggleGroupByDateClass()
}
isVerticalOrientation() {
var _this$option6;
const orientation = null !== (_this$option6 = this.option("groups")) && void 0 !== _this$option6 && _this$option6.length ? this.option("groupOrientation") : this._getDefaultGroupStrategy();
return "vertical" === orientation
}
_initGroupedStrategy() {
const Strategy = this.isVerticalOrientation() ? _m_work_space_grouped_strategy_vertical.default : _m_work_space_grouped_strategy_horizontal.default;
this._groupedStrategy = new Strategy(this)
}
_getDefaultGroupStrategy() {
return "horizontal"
}
_toggleHorizontalScrollClass() {
this.$element().toggleClass("dx-scheduler-work-space-both-scrollbar", this.option("crossScrollingEnabled"))
}
_toggleGroupByDateClass() {
this.$element().toggleClass("dx-scheduler-work-space-group-by-date", this.isGroupedByDate())
}
_toggleWorkSpaceCountClass() {
this.$element().toggleClass("dx-scheduler-work-space-count", this._isWorkSpaceWithCount())
}
_toggleWorkSpaceWithOddCells() {
this.$element().toggleClass("dx-scheduler-work-space-odd-cells", this._isWorkspaceWithOddCells())
}
_toggleGroupingDirectionClass() {
this.$element().toggleClass("dx-scheduler-work-space-vertical-grouped", this._isVerticalGroupedWorkSpace())
}
_getDateTableCellClass(rowIndex, columnIndex) {
const cellClass = `${DATE_TABLE_CELL_CLASS} dx-scheduler-cell-sizes-horizontal dx-scheduler-cell-sizes-vertical`;
return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, columnIndex + 1, rowIndex, columnIndex)
}
_getGroupHeaderClass(i) {
return this._groupedStrategy.addAdditionalGroupCellClasses("dx-scheduler-group-header", i + 1)
}
_initWorkSpaceUnits() {
this._$headerPanelContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-header-panel-container");
this._$headerTablesContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-header-tables-container");
this._$headerPanel = (0, _renderer.default)(" ");
this._$thead = (0, _renderer.default)("").appendTo(this._$headerPanel);
this._$headerPanelEmptyCell = (0, _renderer.default)("").addClass("dx-scheduler-header-panel-empty-cell");
this._$allDayTable = (0, _renderer.default)(" ");
this._$fixedContainer = (0, _renderer.default)("").addClass(_m_classes.FIXED_CONTAINER_CLASS);
this._$allDayContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-all-day-appointments");
this._$dateTableScrollableContent = (0, _renderer.default)(" ").addClass("dx-scheduler-date-table-scrollable-content");
this._$sidebarScrollableContent = (0, _renderer.default)(" ").addClass("dx-scheduler-side-bar-scrollable-content");
this._initAllDayPanelElements();
if (this.isRenovatedRender()) {
this.createRAllDayPanelElements()
} else {
this._createAllDayPanelElements()
}
this._$timePanel = (0, _renderer.default)(" ").addClass(_m_classes.TIME_PANEL_CLASS);
this._$dateTable = (0, _renderer.default)("");
this._$dateTableContainer = (0, _renderer.default)("").addClass("dx-scheduler-date-table-container");
this._$groupTable = (0, _renderer.default)(" ").addClass("dx-scheduler-work-space-vertical-group-table")
}
_initAllDayPanelElements() {
this._allDayTitles = [];
this._allDayTables = [];
this._allDayPanels = []
}
_initDateTableScrollable() {
const $dateTableScrollable = (0, _renderer.default)(" ").addClass("dx-scheduler-date-table-scrollable");
this._dateTableScrollable = this._createComponent($dateTableScrollable, _ui.default, this._dateTableScrollableConfig());
this._scrollSync.dateTable = (0, _scroll.getMemoizeScrollTo)((() => this._dateTableScrollable))
}
_createWorkSpaceElements() {
if (this.option("crossScrollingEnabled")) {
this._createWorkSpaceScrollableElements()
} else {
this._createWorkSpaceStaticElements()
}
}
_createWorkSpaceStaticElements() {
this._$dateTableContainer.append(this._$dateTable);
if (this._isVerticalGroupedWorkSpace()) {
this._$dateTableContainer.append(this._$allDayContainer);
this._$dateTableScrollableContent.append(this._$groupTable, this._$timePanel, this._$dateTableContainer);
this._dateTableScrollable.$content().append(this._$dateTableScrollableContent);
this._$headerTablesContainer.append(this._$headerPanel)
} else {
var _this$_$allDayPanel;
this._$dateTableScrollableContent.append(this._$timePanel, this._$dateTableContainer);
this._dateTableScrollable.$content().append(this._$dateTableScrollableContent);
this._$headerTablesContainer.append(this._$headerPanel, this._$allDayPanel);
null === (_this$_$allDayPanel = this._$allDayPanel) || void 0 === _this$_$allDayPanel || _this$_$allDayPanel.append(this._$allDayContainer, this._$allDayTable)
}
this._appendHeaderPanelEmptyCellIfNecessary();
this._$headerPanelContainer.append(this._$headerTablesContainer);
this.$element().append(this._$fixedContainer, this._$headerPanelContainer, this._dateTableScrollable.$element())
}
_createWorkSpaceScrollableElements() {
this.$element().append(this._$fixedContainer);
this._$flexContainer = (0, _renderer.default)(" ").addClass("dx-scheduler-work-space-flex-container");
this._createHeaderScrollable();
this._headerScrollable.$content().append(this._$headerPanel);
this._appendHeaderPanelEmptyCellIfNecessary();
this._$headerPanelContainer.append(this._$headerTablesContainer);
this.$element().append(this._$headerPanelContainer);
this.$element().append(this._$flexContainer);
this._createSidebarScrollable();
this._$flexContainer.append(this._dateTableScrollable.$element());
this._$dateTableContainer.append(this._$dateTable);
this._$dateTableScrollableContent.append(this._$dateTableContainer);
this._dateTableScrollable.$content().append(this._$dateTableScrollableContent);
if (this._isVerticalGroupedWorkSpace()) {
this._$dateTableContainer.append(this._$allDayContainer);
this._$sidebarScrollableContent.append(this._$groupTable, this._$timePanel)
} else {
var _this$_$allDayPanel2;
this._headerScrollable.$content().append(this._$allDayPanel);
null === (_this$_$allDayPanel2 = this._$allDayPanel) || void 0 === _this$_$allDayPanel2 || _this$_$allDayPanel2.append(this._$allDayContainer, this._$allDayTable);
this._$sidebarScrollableContent.append(this._$timePanel)
}
this._sidebarScrollable.$content().append(this._$sidebarScrollableContent)
}
_appendHeaderPanelEmptyCellIfNecessary() {
this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell)
}
_createHeaderScrollable() {
const $headerScrollable = (0, _renderer.default)(" ").addClass("dx-scheduler-header-scrollable").appendTo(this._$headerTablesContainer);
this._headerScrollable = this._createComponent($headerScrollable, _ui.default, this._headerScrollableConfig());
this._scrollSync.header = (0, _scroll.getMemoizeScrollTo)((() => this._headerScrollable))
}
_createSidebarScrollable() {
const $timePanelScrollable = (0, _renderer.default)(" ").addClass("dx-scheduler-sidebar-scrollable").appendTo(this._$flexContainer);
this._sidebarScrollable = this._createComponent($timePanelScrollable, _ui.default, {
useKeyboard: false,
showScrollbar: "never",
direction: "vertical",
useNative: false,
updateManually: true,
bounceEnabled: false,
onScroll: event => {
this._scrollSync.dateTable({
top: event.scrollOffset.top
})
}
});
this._scrollSync.sidebar = (0, _scroll.getMemoizeScrollTo)((() => this._sidebarScrollable))
}
_attachTableClasses() {
this._addTableClass(this._$dateTable, _m_classes.DATE_TABLE_CLASS);
if (this._isVerticalGroupedWorkSpace()) {
const groupCount = this._getGroupCount();
for (let i = 0; i < groupCount; i++) {
this._addTableClass(this._allDayTables[i], "dx-scheduler-all-day-table")
}
} else if (!this.isRenovatedRender()) {
this._addTableClass(this._$allDayTable, "dx-scheduler-all-day-table")
}
}
_attachHeaderTableClasses() {
this._addTableClass(this._$headerPanel, "dx-scheduler-header-panel")
}
_addTableClass($el, className) {
$el && !$el.hasClass(className) && $el.addClass(className)
}
_initMarkup() {
this.cache.clear();
this._initWorkSpaceUnits();
this._initVirtualScrolling();
this._initDateTableScrollable();
this._createWorkSpaceElements();
super._initMarkup();
if (!this.option("crossScrollingEnabled")) {
this._attachTableClasses();
this._attachHeaderTableClasses()
}
this._toggleGroupedClass();
this._renderView();
this._attachEvents()
}
_render() {
super._render();
this._renderDateTimeIndication();
this._setIndicationUpdateInterval()
}
_toggleGroupedClass() {
this.$element().toggleClass("dx-scheduler-work-space-grouped", this._getGroupCount() > 0)
}
_renderView() {
if (this.isRenovatedRender()) {
if (this._isVerticalGroupedWorkSpace()) {
this.renderRGroupPanel()
}
} else {
this._applyCellTemplates(this._renderGroupHeader())
}
this.renderWorkSpace();
if (this.isRenovatedRender()) {
this.virtualScrollingDispatcher.updateDimensions()
}
this._updateGroupTableHeight();
this.updateHeaderEmptyCellWidth();
this._shader = new _m_current_time_shader_vertical.default(this)
}
updateCellsSelection() {
const renderOptions = this.generateRenderOptions();
this.viewDataProvider.updateViewData(renderOptions);
this.renderRWorkSpace({
timePanel: true,
dateTable: true,
allDayPanel: true
})
}
_renderDateTimeIndication() {
return (0, _common.noop)()
}
renderCurrentDateTimeLineAndShader() {
return (0, _common.noop)()
}
renderCurrentDateTimeIndication() {
return (0, _common.noop)()
}
_setIndicationUpdateInterval() {
return (0, _common.noop)()
}
_detachGroupCountClass() {
[..._m_classes.VERTICAL_GROUP_COUNT_CLASSES].forEach((className => {
this.$element().removeClass(className)
}))
}
_attachGroupCountClass() {
const className = this._groupedStrategy.getGroupCountClass(this.option("groups"));
this.$element().addClass(className)
}
_getDateHeaderTemplate() {
return this.option("dateCellTemplate")
}
_toggleAllDayVisibility(isUpdateScrollable) {
const showAllDayPanel = this._isShowAllDayPanel();
this.$element().toggleClass("dx-scheduler-work-space-all-day", showAllDayPanel);
this._changeAllDayVisibility();
isUpdateScrollable && this._updateScrollable()
}
_changeAllDayVisibility() {
this.cache.clear();
this.$element().toggleClass("dx-scheduler-work-space-all-day-collapsed", !this.option("allDayExpanded") && this._isShowAllDayPanel())
}
_getDateTables() {
return this._$dateTable.add(this._$allDayTable)
}
_getDateTable() {
return this._$dateTable
}
_removeAllDayElements() {
this._$allDayTable && this._$allDayTable.remove();
this._$allDayTitle && this._$allDayTitle.remove()
}
_cleanView() {
var _this$_shader;
this.cache.clear();
this._cleanTableWidths();
this.cellsSelectionState.clearSelectedAndFocusedCells();
if (!this.isRenovatedRender()) {
var _this$_$allDayTable, _this$_$sidebarTable;
this._$thead.empty();
this._$dateTable.empty();
this._$timePanel.empty();
this._$groupTable.empty();
null === (_this$_$allDayTable = this._$allDayTable) || void 0 === _this$_$allDayTable || _this$_$allDayTable.empty();
null === (_this$_$sidebarTable = this._$sidebarTable) || void 0 === _this$_$sidebarTable || _this$_$sidebarTable.empty()
}
null === (_this$_shader = this._shader) || void 0 === _this$_shader || _this$_shader.clean();
delete this._interval
}
_clean() {
_events_engine.default.off(_dom_adapter.default.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME);
this._disposeRenovatedComponents();
super._clean()
}
_cleanTableWidths() {
this._$headerPanel.css("width", "");
this._$dateTable.css("width", "");
this._$allDayTable && this._$allDayTable.css("width", "")
}
_disposeRenovatedComponents() {
var _this$renovatedAllDay, _this$renovatedDateTa, _this$renovatedTimePa, _this$renovatedGroupP, _this$renovatedHeader;
null === (_this$renovatedAllDay = this.renovatedAllDayPanel) || void 0 === _this$renovatedAllDay || _this$renovatedAllDay.dispose();
this.renovatedAllDayPanel = void 0;
null === (_this$renovatedDateTa = this.renovatedDateTable) || void 0 === _this$renovatedDateTa || _this$renovatedDateTa.dispose();
this.renovatedDateTable = void 0;
null === (_this$renovatedTimePa = this.renovatedTimePanel) || void 0 === _this$renovatedTimePa || _this$renovatedTimePa.dispose();
this.renovatedTimePanel = void 0;
null === (_this$renovatedGroupP = this.renovatedGroupPanel) || void 0 === _this$renovatedGroupP || _this$renovatedGroupP.dispose();
this.renovatedGroupPanel = void 0;
null === (_this$renovatedHeader = this.renovatedHeaderPanel) || void 0 === _this$renovatedHeader || _this$renovatedHeader.dispose();
this.renovatedHeaderPanel = void 0
}
getGroupedStrategy() {
return this._groupedStrategy
}
getFixedContainer() {
return this._$fixedContainer
}
getAllDayContainer() {
return this._$allDayContainer
}
updateRender() {
this.renderer.updateRender()
}
updateGrid() {
this.renderer._renderGrid()
}
updateAppointments() {
var _this$dragBehavior2;
this.option("onRenderAppointments")();
null === (_this$dragBehavior2 = this.dragBehavior) || void 0 === _this$dragBehavior2 || _this$dragBehavior2.updateDragSource()
}
_createAllDayPanelElements() {
const groupCount = this._getGroupCount();
if (this._isVerticalGroupedWorkSpace() && 0 !== groupCount) {
for (let i = 0; i < groupCount; i++) {
const $allDayTitle = (0, _renderer.default)(" ").addClass("dx-scheduler-all-day-title").text(_message.default.format("dxScheduler-allDay"));
this._allDayTitles.push($allDayTitle);
this._$allDayTable = (0, _renderer.default)(" ");
this._allDayTables.push(this._$allDayTable);
this._$allDayPanel = (0, _renderer.default)("").addClass("dx-scheduler-all-day-panel").append(this._$allDayTable);
this._allDayPanels.push(this._$allDayPanel)
}
} else {
this._$allDayTitle = (0, _renderer.default)(" ").addClass("dx-scheduler-all-day-title").text(_message.default.format("dxScheduler-allDay")).appendTo(this.$element());
this._$allDayTable = (0, _renderer.default)(" ");
this._$allDayPanel = (0, _renderer.default)("").addClass("dx-scheduler-all-day-panel").append(this._$allDayTable)
}
}
renderWorkSpace() {
let {
generateNewData: generateNewData,
renderComponents: renderComponents
} = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : DEFAULT_WORKSPACE_RENDER_OPTIONS;
this.cache.clear();
this.viewDataProvider.update(this.generateRenderOptions(), generateNewData);
if (this.isRenovatedRender()) {
this.renderRWorkSpace(renderComponents)
} else {
this._renderDateHeader();
this._renderTimePanel();
this._renderGroupAllDayPanel();
this._renderDateTable();
this._renderAllDayPanel()
}
this._initPositionHelper()
}
_renderGroupHeader() {
const $container = this._getGroupHeaderContainer();
const groupCount = this._getGroupCount();
let cellTemplates = [];
if (groupCount) {
const groupRows = this._makeGroupRows(this.option("groups"), this.option("groupByDate"));
this._attachGroupCountClass();
$container.append(groupRows.elements);
cellTemplates = groupRows.cellTemplates
} else {
this._detachGroupCountClass()
}
return cellTemplates
}
_applyCellTemplates(templates) {
null === templates || void 0 === templates || templates.forEach((template => {
template()
}))
}
_makeGroupRows(groups, groupByDate) {
const tableCreatorStrategy = this._isVerticalGroupedWorkSpace() ? tableCreator.VERTICAL : tableCreator.HORIZONTAL;
return tableCreator.makeGroupedTable(tableCreatorStrategy, groups, {
groupHeaderRowClass: _m_classes.GROUP_ROW_CLASS,
groupRowClass: _m_classes.GROUP_ROW_CLASS,
groupHeaderClass: this._getGroupHeaderClass.bind(this),
groupHeaderContentClass: _m_classes.GROUP_HEADER_CONTENT_CLASS
}, this._getCellCount() || 1, this.option("resourceCellTemplate"), this._getGroupCount(), groupByDate)
}
_renderDateHeader() {
const container = this._getDateHeaderContainer();
const $headerRow = (0, _renderer.default)(" ").addClass("dx-scheduler-header-row");
const count = this._getCellCount();
const cellTemplate = this._getDateHeaderTemplate();
const repeatCount = this._getCalculateHeaderCellRepeatCount();
const templateCallbacks = [];
const groupByDate = this.isGroupedByDate();
if (!groupByDate) {
for (let rowIndex = 0; rowIndex < repeatCount; rowIndex++) {
for (let columnIndex = 0; columnIndex < count; columnIndex++) {
const templateIndex = rowIndex * count + columnIndex;
this._renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks)
}
}
container.append($headerRow)
} else {
const colSpan = groupByDate ? this._getGroupCount() : 1;
for (let columnIndex = 0; columnIndex < count; columnIndex++) {
const templateIndex = columnIndex * repeatCount;
const cellElement = this._renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks);
cellElement.attr("colSpan", colSpan)
}
container.prepend($headerRow)
}
this._applyCellTemplates(templateCallbacks);
return $headerRow
}
_renderDateHeaderTemplate(container, panelCellIndex, templateIndex, cellTemplate, templateCallbacks) {
const validTemplateIndex = this.isGroupedByDate() ? Math.floor(templateIndex / this._getGroupCount()) : templateIndex;
const {
completeDateHeaderMap: completeDateHeaderMap
} = this.viewDataProvider;
const {
text: text,
startDate: date
} = completeDateHeaderMap[completeDateHeaderMap.length - 1][validTemplateIndex];
const $cell = (0, _renderer.default)("").addClass(this._getHeaderPanelCellClass(panelCellIndex)).attr("title", text);
if (null !== cellTemplate && void 0 !== cellTemplate && cellTemplate.render) {
templateCallbacks.push(cellTemplate.render.bind(cellTemplate, {
model: _extends({
text: text,
date: date
}, this._getGroupsForDateHeaderTemplate(templateIndex)),
index: templateIndex,
container: (0, _element.getPublicElement)($cell)
}))
} else {
$cell.text(text)
}
container.append($cell);
return $cell
}
_getGroupsForDateHeaderTemplate(templateIndex) {
let indexMultiplier = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
let groupIndex;
let groups;
if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) {
groupIndex = this._getGroupIndex(0, templateIndex * indexMultiplier);
const groupsArray = (0, _m_utils2.getCellGroups)(groupIndex, this.option("groups"));
groups = (0, _m_utils2.getGroupsObjectFromGroupsArray)(groupsArray)
}
return {
groups: groups,
groupIndex: groupIndex
}
}
_getHeaderPanelCellClass(i) {
return this._groupedStrategy.addAdditionalGroupCellClasses("dx-scheduler-header-panel-cell dx-scheduler-cell-sizes-horizontal", i + 1, void 0, void 0, this.isGroupedByDate())
}
_renderAllDayPanel(index) {
let cellCount = this._getCellCount();
if (!this._isVerticalGroupedWorkSpace()) {
cellCount *= this._getGroupCount() || 1
}
const cellTemplates = this._renderTableBody({
container: this._allDayPanels.length ? (0, _element.getPublicElement)(this._allDayTables[index]) : (0, _element.getPublicElement)(this._$allDayTable),
rowCount: 1,
cellCount: cellCount,
cellClass: this._getAllDayPanelCellClass.bind(this),
rowClass: "dx-scheduler-all-day-table-row",
cellTemplate: this.option("dataCellTemplate"),
getCellData: this._oldRender_getAllDayCellData(index),
groupIndex: index
}, true);
this._toggleAllDayVisibility(true);
this._applyCellTemplates(cellTemplates)
}
_renderGroupAllDayPanel() {
if (this._isVerticalGroupedWorkSpace()) {
const groupCount = this._getGroupCount();
for (let i = 0; i < groupCount; i++) {
this._renderAllDayPanel(i)
}
}
}
_getAllDayPanelCellClass(i, j) {
const cellClass = `${ALL_DAY_TABLE_CELL_CLASS} dx-scheduler-cell-sizes-horizontal`;
return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, j + 1)
}
_renderTimePanel() {
const repeatCount = this._groupedStrategy.calculateTimeCellRepeatCount();
const getData = (rowIndex, field) => {
let allDayPanelsCount = 0;
if (this.isAllDayPanelVisible) {
allDayPanelsCount = 1
}
if (this.isGroupedAllDayPanel()) {
allDayPanelsCount = Math.ceil((rowIndex + 1) / this._getRowCount())
}
const validRowIndex = rowIndex + allDayPanelsCount;
return this.viewDataProvider.completeTimePanelMap[validRowIndex][field]
};
this._renderTableBody({
container: (0, _element.getPublicElement)(this._$timePanel),
rowCount: this._getTimePanelRowCount() * repeatCount,
cellCount: 1,
cellClass: this._getTimeCellClass.bind(this),
rowClass: "dx-scheduler-time-panel-row",
cellTemplate: this.option("timeCellTemplate"),
getCellText: rowIndex => getData(rowIndex, "text"),
getCellDate: rowIndex => getData(rowIndex, "startDate"),
groupCount: this._getGroupCount(),
allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayTitles : void 0,
getTemplateData: (rowIndex => {
if (!this._isVerticalGroupedWorkSpace()) {
return {}
}
const groupIndex = this._getGroupIndex(rowIndex, 0);
const groupsArray = (0, _m_utils2.getCellGroups)(groupIndex, this.option("groups"));
const groups = (0, _m_utils2.getGroupsObjectFromGroupsArray)(groupsArray);
return {
groupIndex: groupIndex,
groups: groups
}
}).bind(this)
})
}
_getTimeCellClass(i) {
const cellClass = "dx-scheduler-time-panel-cell dx-scheduler-cell-sizes-vertical";
return this._isVerticalGroupedWorkSpace() ? this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i, i) : cellClass
}
_renderDateTable() {
const groupCount = this._getGroupCount();
this._renderTableBody({
container: (0, _element.getPublicElement)(this._$dateTable),
rowCount: this._getTotalRowCount(groupCount),
cellCount: this._getTotalCellCount(groupCount),
cellClass: this._getDateTableCellClass.bind(this),
rowClass: _m_classes.DATE_TABLE_ROW_CLASS,
cellTemplate: this.option("dataCellTemplate"),
getCellData: (_, rowIndex, columnIndex) => {
const isGroupedAllDayPanel = this.isGroupedAllDayPanel();
let validRowIndex = rowIndex;
if (isGroupedAllDayPanel) {
const rowCount = this._getRowCount();
const allDayPanelsCount = Math.ceil(rowIndex / rowCount);
validRowIndex += allDayPanelsCount
}
const {
cellData: cellData
} = this.viewDataProvider.viewDataMap.dateTableMap[validRowIndex][columnIndex];
return {
value: this._filterCellDataFields(cellData),
fullValue: cellData,
key: "dxCellData"
}
},
allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayPanels : void 0,
groupCount: groupCount,
groupByDate: this.option("groupByDate")
})
}
_insertAllDayRowsIntoDateTable() {
return this._groupedStrategy.insertAllDayRowsIntoDateTable()
}
_renderTableBody(options, delayCellTemplateRendering) {
let result = [];
if (!delayCellTemplateRendering) {
this._applyCellTemplates(tableCreator.makeTable(options))
} else {
result = tableCreator.makeTable(options)
}
return result
}
}
const createDragBehaviorConfig = (container, rootElement, isDefaultDraggingMode, dragBehavior, enableDefaultDragging, disableDefaultDragging, getDroppableCell, getDateTables, removeDroppableCellClass, getCellWidth, options) => {
const state = {
dragElement: void 0,
itemData: void 0
};
const isItemDisabled = () => {
const {
itemData: itemData
} = state;
if (itemData) {
const getter = (0, _data.compileGetter)("disabled");
return getter(itemData)
}
return true
};
const cursorOffset = options.isSetCursorOffset ? () => {
const $dragElement = (0, _renderer.default)(state.dragElement);
return {
x: (0, _size.getWidth)($dragElement) / 2,
y: (0, _size.getHeight)($dragElement) / 2
}
} : void 0;
return {
container: container,
dragTemplate: () => state.dragElement,
onDragStart: e => {
if (!isDefaultDraggingMode) {
disableDefaultDragging()
}
const canceled = e.cancel;
const {
event: event
} = e;
const $itemElement = (0, _renderer.default)(e.itemElement);
const appointments = e.component._appointments;
state.itemData = options.getItemData(e.itemElement, appointments);
const settings = options.getItemSettings($itemElement, e);
const {
initialPosition: initialPosition
} = options;
if (!isItemDisabled()) {
event.data = event.data || {};
if (!canceled) {
if (!settings.isCompact) {
dragBehavior.updateDragSource(state.itemData, settings)
}
state.dragElement = ((itemData, settings, appointments) => {
const appointmentIndex = appointments.option("items").length;
settings.isCompact = false;
settings.virtual = false;
const items = appointments._renderItem(appointmentIndex, {
itemData: itemData,
settings: [settings]
});
return items[0]
})(state.itemData, settings, appointments);
event.data.itemElement = state.dragElement;
event.data.initialPosition = initialPosition ?? (0, _translator.locate)((0, _renderer.default)(state.dragElement));
event.data.itemData = state.itemData;
event.data.itemSettings = settings;
dragBehavior.onDragStart(event.data);
(0, _translator.resetPosition)((0, _renderer.default)(state.dragElement))
}
}
},
onDragMove: () => {
if (isDefaultDraggingMode) {
return
}
const elements = (() => {
const appointmentWidth = (0, _size.getWidth)(state.dragElement);
const cellWidth = getCellWidth();
const isWideAppointment = appointmentWidth > cellWidth;
const isNarrowAppointment = appointmentWidth <= 10;
const dragElementContainer = (0, _renderer.default)(state.dragElement).parent().get(0);
const boundingRect = (0, _position.getBoundingRect)(dragElementContainer);
const newX = boundingRect.left;
const newY = boundingRect.top;
if (isWideAppointment) {
return _dom_adapter.default.elementsFromPoint(newX + 10, newY + 10, dragElementContainer)
}
if (isNarrowAppointment) {
return _dom_adapter.default.elementsFromPoint(newX, newY, dragElementContainer)
}
return _dom_adapter.default.elementsFromPoint(newX + appointmentWidth / 2, newY + 10, dragElementContainer)
})();
const isMoveUnderControl = !!elements.find((el => el === rootElement.get(0)));
const dateTables = getDateTables();
const droppableCell = elements.find((el => {
const {
classList: classList
} = el;
const isCurrentSchedulerElement = 1 === dateTables.find(el).length;
return isCurrentSchedulerElement && (classList.contains(DATE_TABLE_CELL_CLASS) || classList.contains(ALL_DAY_TABLE_CELL_CLASS))
}));
if (droppableCell) {
if (!getDroppableCell().is(droppableCell)) {
removeDroppableCellClass()
}(0, _renderer.default)(droppableCell).addClass("dx-scheduler-date-table-droppable-cell")
} else if (!isMoveUnderControl) {
removeDroppableCellClass()
}
},
onDragEnd: e => {
var _state$dragElement;
if (!isDefaultDraggingMode) {
enableDefaultDragging()
}
if (!isItemDisabled()) {
dragBehavior.onDragEnd(e)
}
null === (_state$dragElement = state.dragElement) || void 0 === _state$dragElement || _state$dragElement.remove();
removeDroppableCellClass()
},
cursorOffset: cursorOffset,
filter: options.filter
}
};
exports.default = SchedulerWorkSpace
},
74228:
/*!*************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_day.js ***!
\*************************************************************************************************/
function(__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 */ 99393));
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_work_space_vertical = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_vertical */ 2986));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class SchedulerWorkSpaceDay extends _m_work_space_vertical.default {
get type() {
return _m_constants.VIEWS.DAY
}
_getElementClass() {
return "dx-scheduler-work-space-day"
}
_renderDateHeader() {
return 1 === this.option("intervalCount") ? null : super._renderDateHeader()
}
renderRHeaderPanel() {
if (1 === this.option("intervalCount")) {
super.renderRHeaderPanel(false)
} else {
super.renderRHeaderPanel(true)
}
}
}(0, _component_registrator.default)("dxSchedulerWorkSpaceDay", SchedulerWorkSpaceDay);
exports.default = SchedulerWorkSpaceDay
},
48854:
/*!*************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_grouped_strategy_horizontal.js ***!
\*************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _const = __webpack_require__( /*! ../../scheduler/workspaces/const */ 7836);
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
exports.default = class {
constructor(_workSpace) {
this._workSpace = _workSpace
}
prepareCellIndexes(cellCoordinates, groupIndex, inAllDay) {
const groupByDay = this._workSpace.isGroupedByDate();
if (!groupByDay) {
return {
rowIndex: cellCoordinates.rowIndex,
columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace._getCellCount()
}
}
return {
rowIndex: cellCoordinates.rowIndex,
columnIndex: cellCoordinates.columnIndex * this._workSpace._getGroupCount() + groupIndex
}
}
getGroupIndex(rowIndex, columnIndex) {
const groupByDay = this._workSpace.isGroupedByDate();
const groupCount = this._workSpace._getGroupCount();
if (groupByDay) {
return columnIndex % groupCount
}
return Math.floor(columnIndex / this._workSpace._getCellCount())
}
calculateHeaderCellRepeatCount() {
return this._workSpace._getGroupCount() || 1
}
insertAllDayRowsIntoDateTable() {
return false
}
getTotalCellCount(groupCount) {
groupCount = groupCount || 1;
return this._workSpace._getCellCount() * groupCount
}
getTotalRowCount() {
return this._workSpace._getRowCount()
}
calculateTimeCellRepeatCount() {
return 1
}
getWorkSpaceMinWidth() {
const workSpaceElementWidth = (0, _position.getBoundingRect)(this._workSpace.$element().get(0)).width;
return workSpaceElementWidth - this._workSpace.getTimePanelWidth() - 2 * _const.WORK_SPACE_BORDER_PX
}
getAllDayOffset() {
return this._workSpace.getAllDayHeight()
}
getGroupCountClass(groups) {
return
}
getLeftOffset() {
return this._workSpace.getTimePanelWidth()
}
_createGroupBoundOffset(startCell, endCell, cellWidth) {
const extraOffset = cellWidth / 2;
const startOffset = startCell ? startCell.offset().left - extraOffset : 0;
const endOffset = endCell ? endCell.offset().left + cellWidth + extraOffset : 0;
return {
left: startOffset,
right: endOffset,
top: 0,
bottom: 0
}
}
_getGroupedByDateBoundOffset($cells, cellWidth) {
const lastCellIndex = $cells.length - 1;
const startCell = $cells.eq(0);
const endCell = $cells.eq(lastCellIndex);
return this._createGroupBoundOffset(startCell, endCell, cellWidth)
}
getGroupBoundsOffset(cellCount, $cells, cellWidth, coordinates, groupedDataMap) {
if (this._workSpace.isGroupedByDate()) {
return this._getGroupedByDateBoundOffset($cells, cellWidth)
}
let startCell;
let endCell;
const cellIndex = this._workSpace.getCellIndexByCoordinates(coordinates);
const groupIndex = coordinates.groupIndex || Math.floor(cellIndex / cellCount);
const currentCellGroup = groupedDataMap.dateTableGroupedMap[groupIndex];
if (currentCellGroup) {
const groupRowLength = currentCellGroup[0].length;
const groupStartPosition = currentCellGroup[0][0].position;
const groupEndPosition = currentCellGroup[0][groupRowLength - 1].position;
startCell = $cells.eq(groupStartPosition.columnIndex);
endCell = $cells.eq(groupEndPosition.columnIndex)
}
return this._createGroupBoundOffset(startCell, endCell, cellWidth)
}
shiftIndicator($indicator, height, rtlOffset, groupIndex) {
const offset = this._getIndicatorOffset(groupIndex);
const horizontalOffset = rtlOffset ? rtlOffset - offset : offset;
$indicator.css("left", horizontalOffset);
$indicator.css("top", height)
}
_getIndicatorOffset(groupIndex) {
const groupByDay = this._workSpace.isGroupedByDate();
return groupByDay ? this._calculateGroupByDateOffset(groupIndex) : this._calculateOffset(groupIndex)
}
_calculateOffset(groupIndex) {
const indicatorStartPosition = this._workSpace.getIndicatorOffset(groupIndex);
const offset = this._workSpace._getCellCount() * this._workSpace.getRoundedCellWidth(groupIndex - 1, 0) * groupIndex;
return indicatorStartPosition + offset
}
_calculateGroupByDateOffset(groupIndex) {
return this._workSpace.getIndicatorOffset(0) * this._workSpace._getGroupCount() + this._workSpace.getRoundedCellWidth(groupIndex - 1, 0) * groupIndex
}
getShaderOffset(i, width) {
const offset = this._workSpace._getCellCount() * this._workSpace.getRoundedCellWidth(i - 1) * i;
return this._workSpace.option("rtlEnabled") ? (0, _position.getBoundingRect)(this._workSpace._dateTableScrollable.$content().get(0)).width - offset - this._workSpace.getTimePanelWidth() - width : offset
}
getShaderTopOffset(i) {
return -this.getShaderMaxHeight() * (i > 0 ? 1 : 0)
}
getShaderHeight() {
const height = this._workSpace.getIndicationHeight();
return height
}
getShaderMaxHeight() {
return (0, _position.getBoundingRect)(this._workSpace._dateTableScrollable.$content().get(0)).height
}
getShaderWidth(i) {
return this._workSpace.getIndicationWidth(i)
}
getScrollableScrollTop(allDay) {
return !allDay ? this._workSpace.getScrollable().scrollTop() : 0
}
addAdditionalGroupCellClasses(cellClass, index, i, j) {
let applyUnconditionally = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : false;
cellClass = this._addLastGroupCellClass(cellClass, index, applyUnconditionally);
return this._addFirstGroupCellClass(cellClass, index, applyUnconditionally)
}
_addLastGroupCellClass(cellClass, index, applyUnconditionally) {
if (applyUnconditionally) {
return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}`
}
const groupByDate = this._workSpace.isGroupedByDate();
if (groupByDate) {
if (index % this._workSpace._getGroupCount() === 0) {
return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}`
}
} else if (index % this._workSpace._getCellCount() === 0) {
return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}`
}
return cellClass
}
_addFirstGroupCellClass(cellClass, index, applyUnconditionally) {
if (applyUnconditionally) {
return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}`
}
const groupByDate = this._workSpace.isGroupedByDate();
if (groupByDate) {
if ((index - 1) % this._workSpace._getGroupCount() === 0) {
return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}`
}
} else if ((index - 1) % this._workSpace._getCellCount() === 0) {
return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}`
}
return cellClass
}
}
},
2862:
/*!***********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.js ***!
\***********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _const = __webpack_require__( /*! ../../scheduler/workspaces/const */ 7836);
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
var _m_cache = __webpack_require__( /*! ./m_cache */ 14553);
exports.default = class {
constructor(_workSpace) {
this._workSpace = _workSpace;
this.cache = new _m_cache.Cache
}
prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow) {
let rowIndex = cellCoordinates.rowIndex + groupIndex * this._workSpace._getRowCount();
if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) {
rowIndex += groupIndex;
if (!inAllDayRow) {
rowIndex += 1
}
}
return {
rowIndex: rowIndex,
columnIndex: cellCoordinates.columnIndex
}
}
getGroupIndex(rowIndex) {
return Math.floor(rowIndex / this._workSpace._getRowCount())
}
calculateHeaderCellRepeatCount() {
return 1
}
insertAllDayRowsIntoDateTable() {
return this._workSpace.option("showAllDayPanel")
}
getTotalCellCount() {
return this._workSpace._getCellCount()
}
getTotalRowCount() {
return this._workSpace._getRowCount() * this._workSpace._getGroupCount()
}
calculateTimeCellRepeatCount() {
return this._workSpace._getGroupCount() || 1
}
getWorkSpaceMinWidth() {
let minWidth = this._workSpace._getWorkSpaceWidth();
const workSpaceElementWidth = (0, _position.getBoundingRect)(this._workSpace.$element().get(0)).width;
const workspaceContainerWidth = workSpaceElementWidth - this._workSpace.getTimePanelWidth() - this._workSpace.getGroupTableWidth() - 2 * _const.WORK_SPACE_BORDER_PX;
if (minWidth < workspaceContainerWidth) {
minWidth = workspaceContainerWidth
}
return minWidth
}
getAllDayOffset() {
return 0
}
getGroupCountClass(groups) {
return (0, _index.getVerticalGroupCountClass)(groups)
}
getLeftOffset() {
return this._workSpace.getTimePanelWidth() + this._workSpace.getGroupTableWidth()
}
getGroupBoundsOffset(groupIndex, _ref) {
let [$firstCell, $lastCell] = _ref;
return this.cache.get(`groupBoundsOffset${groupIndex}`, (() => {
const startDayHour = this._workSpace.option("startDayHour");
const endDayHour = this._workSpace.option("endDayHour");
const hoursInterval = this._workSpace.option("hoursInterval");
const dayHeight = (0, _index.calculateDayDuration)(startDayHour, endDayHour) / hoursInterval * this._workSpace.getCellHeight();
const scrollTop = this.getScrollableScrollTop();
const headerRowHeight = (0, _position.getBoundingRect)(this._workSpace._$headerPanelContainer.get(0)).height;
let topOffset = groupIndex * dayHeight + headerRowHeight + this._workSpace.option("getHeaderHeight")() - scrollTop;
if (this._workSpace.option("showAllDayPanel") && this._workSpace.supportAllDayRow()) {
topOffset += this._workSpace.getCellHeight() * (groupIndex + 1)
}
const bottomOffset = topOffset + dayHeight;
const {
left: left
} = $firstCell.getBoundingClientRect();
const {
right: right
} = $lastCell.getBoundingClientRect();
this._groupBoundsOffset = {
left: left,
right: right,
top: topOffset,
bottom: bottomOffset
};
return this._groupBoundsOffset
}))
}
shiftIndicator($indicator, height, rtlOffset, i) {
const offset = this._workSpace.getIndicatorOffset(0);
const tableOffset = this._workSpace.option("crossScrollingEnabled") ? 0 : this._workSpace.getGroupTableWidth();
const horizontalOffset = rtlOffset ? rtlOffset - offset : offset;
let verticalOffset = this._workSpace._getRowCount() * this._workSpace.getCellHeight() * i;
if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) {
verticalOffset += this._workSpace.getAllDayHeight() * (i + 1)
}
$indicator.css("left", horizontalOffset + tableOffset);
$indicator.css("top", height + verticalOffset)
}
getShaderOffset(i, width) {
const offset = this._workSpace.option("crossScrollingEnabled") ? 0 : this._workSpace.getGroupTableWidth();
return this._workSpace.option("rtlEnabled") ? (0, _position.getBoundingRect)(this._$container.get(0)).width - offset - this._workSpace.getWorkSpaceLeftOffset() - width : offset
}
getShaderTopOffset(i) {
return 0
}
getShaderHeight() {
let height = this._workSpace.getIndicationHeight();
if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) {
height += this._workSpace.getCellHeight()
}
return height
}
getShaderMaxHeight() {
let height = this._workSpace._getRowCount() * this._workSpace.getCellHeight();
if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) {
height += this._workSpace.getCellHeight()
}
return height
}
getShaderWidth() {
return this._workSpace.getIndicationWidth(0)
}
getScrollableScrollTop() {
return this._workSpace.getScrollable().scrollTop()
}
addAdditionalGroupCellClasses(cellClass, index, i, j) {
cellClass = this._addLastGroupCellClass(cellClass, i + 1);
return this._addFirstGroupCellClass(cellClass, i + 1)
}
_addLastGroupCellClass(cellClass, index) {
if (index % this._workSpace._getRowCount() === 0) {
return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}`
}
return cellClass
}
_addFirstGroupCellClass(cellClass, index) {
if ((index - 1) % this._workSpace._getRowCount() === 0) {
return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}`
}
return cellClass
}
}
},
34623:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_indicator.js ***!
\*******************************************************************************************************/
function(__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 */ 99393));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _date2 = __webpack_require__( /*! ../../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_classes = __webpack_require__( /*! ../m_classes */ 43600);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880));
var _m_work_space = _interopRequireDefault(__webpack_require__( /*! ./m_work_space */ 48377));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date.default.dateToMilliseconds;
class SchedulerWorkSpaceIndicator extends _m_work_space.default {
_getToday() {
const viewOffset = this.option("viewOffset");
const today = (0, _index.getToday)(this.option("indicatorTime"), this.timeZoneCalculator);
return _date2.dateUtilsTs.addOffsets(today, [-viewOffset])
}
isIndicationOnView() {
if (this.option("showCurrentTimeIndicator")) {
const today = this._getToday();
const endViewDate = _date.default.trimTime(this.getEndViewDate());
return _date.default.dateInRange(today, this.getStartViewDate(), new Date(endViewDate.getTime() + toMs("day")))
}
return false
}
isIndicationAvailable() {
if (!(0, _window.hasWindow)()) {
return false
}
const today = this._getToday();
return today >= _date.default.trimTime(new Date(this.getStartViewDate()))
}
isIndicatorVisible() {
const today = this._getToday();
const endViewDate = new Date(this.getEndViewDate().getTime() + toMs("minute") - 1);
const firstViewDate = new Date(this.getStartViewDate());
firstViewDate.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());
endViewDate.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());
return _date.default.dateInRange(today, firstViewDate, endViewDate)
}
_renderIndicator(height, rtlOffset, $container, groupCount) {
const groupedByDate = this.isGroupedByDate();
const repeatCount = groupedByDate ? 1 : groupCount;
for (let i = 0; i < repeatCount; i++) {
const $indicator = this._createIndicator($container);
(0, _size.setWidth)($indicator, groupedByDate ? this.getCellWidth() * groupCount : this.getCellWidth());
this._groupedStrategy.shiftIndicator($indicator, height, rtlOffset, i)
}
}
_createIndicator($container) {
const $indicator = (0, _renderer.default)("").addClass("dx-scheduler-date-time-indicator");
$container.append($indicator);
return $indicator
}
_getRtlOffset(width) {
return this.option("rtlEnabled") ? (0, _position.getBoundingRect)(this._dateTableScrollable.$content().get(0)).width - this.getTimePanelWidth() - width : 0
}
_setIndicationUpdateInterval() {
if (!this.option("showCurrentTimeIndicator") || 0 === this.option("indicatorUpdateInterval")) {
return
}
this._clearIndicatorUpdateInterval();
this._indicatorInterval = setInterval((() => {
this.renderCurrentDateTimeIndication()
}), this.option("indicatorUpdateInterval"))
}
_clearIndicatorUpdateInterval() {
if (this._indicatorInterval) {
clearInterval(this._indicatorInterval);
delete this._indicatorInterval
}
}
_isVerticalShader() {
return true
}
getIndicationWidth(groupIndex) {
const maxWidth = this.getCellWidth() * this._getCellCount();
let difference = this._getIndicatorDuration();
if (difference > this._getCellCount()) {
difference = this._getCellCount()
}
const width = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference);
return maxWidth < width ? maxWidth : width
}
getIndicatorOffset(groupIndex) {
const difference = this._getIndicatorDuration() - 1;
const offset = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference);
return offset
}
_getIndicatorDuration() {
const today = this._getToday();
const firstViewDate = new Date(this.getStartViewDate());
let timeDiff = today.getTime() - firstViewDate.getTime();
if ("workWeek" === this.option("type")) {
timeDiff -= this._getWeekendsCount(Math.round(timeDiff / toMs("day"))) * toMs("day")
}
return Math.ceil((timeDiff + 1) / toMs("day"))
}
getIndicationHeight() {
const today = _m_utils_time_zone.default.getDateWithoutTimezoneChange(this._getToday());
const cellHeight = this.getCellHeight();
const date = new Date(this.getStartViewDate());
if (this.isIndicationOnView()) {
date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate())
}
const duration = today.getTime() - date.getTime();
const cellCount = duration / this.getCellDuration();
return cellCount * cellHeight
}
_dispose() {
this._clearIndicatorUpdateInterval();
super._dispose.apply(this, arguments)
}
renderCurrentDateTimeIndication() {
this.renderCurrentDateTimeLineAndShader();
if (this.isRenovatedRender()) {
this.renderWorkSpace({
generateNewData: true,
renderComponents: {
header: true,
timePanel: true
}
})
}
}
renderCurrentDateTimeLineAndShader() {
var _this$_shader;
this._cleanDateTimeIndicator();
null === (_this$_shader = this._shader) || void 0 === _this$_shader || _this$_shader.clean();
this._renderDateTimeIndication()
}
_isCurrentTimeHeaderCell(headerIndex) {
if (this.isIndicationOnView()) {
const {
completeDateHeaderMap: completeDateHeaderMap
} = this.viewDataProvider;
const date = completeDateHeaderMap[completeDateHeaderMap.length - 1][headerIndex].startDate;
return _date.default.sameDate(date, this._getToday())
}
return false
}
_getHeaderPanelCellClass(i) {
const cellClass = super._getHeaderPanelCellClass(i);
if (this._isCurrentTimeHeaderCell(i)) {
return `${cellClass} ${_m_classes.HEADER_CURRENT_TIME_CELL_CLASS}`
}
return cellClass
}
_cleanView() {
super._cleanView();
this._cleanDateTimeIndicator()
}
_dimensionChanged() {
super._dimensionChanged();
this.renderCurrentDateTimeLineAndShader()
}
_cleanDateTimeIndicator() {
this.$element().find(".dx-scheduler-date-time-indicator").remove()
}
_cleanWorkSpace() {
super._cleanWorkSpace();
this._renderDateTimeIndication();
this._setIndicationUpdateInterval()
}
_optionChanged(args) {
switch (args.name) {
case "showCurrentTimeIndicator":
case "indicatorTime":
this._cleanWorkSpace();
break;
case "indicatorUpdateInterval":
this._setIndicationUpdateInterval();
break;
case "showAllDayPanel":
case "allDayExpanded":
case "crossScrollingEnabled":
super._optionChanged(args);
this.renderCurrentDateTimeIndication();
break;
case "shadeUntilCurrentTime":
this.renderCurrentDateTimeIndication();
break;
default:
super._optionChanged(args)
}
}
_getDefaultOptions() {
return (0, _extend.extend)(super._getDefaultOptions(), {
showCurrentTimeIndicator: true,
indicatorTime: new Date,
indicatorUpdateInterval: 5 * toMs("minute"),
shadeUntilCurrentTime: true
})
}
_getCurrentTimePanelCellIndices() {
const rowCountPerGroup = this._getTimePanelRowCount();
const today = this._getToday();
const index = this.getCellIndexByDate(today);
const {
rowIndex: currentTimeRowIndex
} = this._getCellCoordinatesByIndex(index);
if (void 0 === currentTimeRowIndex) {
return []
}
let cellIndices;
if (0 === currentTimeRowIndex) {
cellIndices = [currentTimeRowIndex]
} else {
cellIndices = currentTimeRowIndex % 2 === 0 ? [currentTimeRowIndex - 1, currentTimeRowIndex] : [currentTimeRowIndex, currentTimeRowIndex + 1]
}
const verticalGroupCount = this._isVerticalGroupedWorkSpace() ? this._getGroupCount() : 1;
return [...new Array(verticalGroupCount)].reduce(((currentIndices, _, groupIndex) => [...currentIndices, ...cellIndices.map((cellIndex => rowCountPerGroup * groupIndex + cellIndex))]), [])
}
_renderDateTimeIndication() {
if (!this.isIndicationAvailable()) {
return
}
if (this.option("shadeUntilCurrentTime")) {
this._shader.render()
}
if (!this.isIndicationOnView() || !this.isIndicatorVisible()) {
return
}
const groupCount = this._getGroupCount() || 1;
const $container = this._dateTableScrollable.$content();
const height = this.getIndicationHeight();
const rtlOffset = this._getRtlOffset(this.getCellWidth());
this._renderIndicator(height, rtlOffset, $container, groupCount);
if (!this.isRenovatedRender()) {
this._setCurrentTimeCells()
}
}
_setCurrentTimeCells() {
const timePanelCells = this._getTimePanelCells();
const currentTimeCellIndices = this._getCurrentTimePanelCellIndices();
currentTimeCellIndices.forEach((timePanelCellIndex => {
timePanelCells.eq(timePanelCellIndex).addClass("dx-scheduler-time-panel-current-time-cell")
}))
}
_cleanCurrentTimeCells() {
this.$element().find(".dx-scheduler-time-panel-current-time-cell").removeClass("dx-scheduler-time-panel-current-time-cell")
}
}(0, _component_registrator.default)("dxSchedulerWorkSpace", SchedulerWorkSpaceIndicator);
exports.default = SchedulerWorkSpaceIndicator
},
50011:
/*!***************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_month.js ***!
\***************************************************************************************************/
function(__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 */ 99393));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515);
var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_utils = __webpack_require__( /*! ../m_utils */ 84110);
var _m_work_space_indicator = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_indicator */ 34623));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
class SchedulerWorkSpaceMonth extends _m_work_space_indicator.default {
get type() {
return _m_constants.VIEWS.MONTH
}
_getElementClass() {
return "dx-scheduler-work-space-month"
}
_getFormat() {
return _index2.formatWeekday
}
_getIntervalBetween(currentDate) {
const firstViewDate = this.getStartViewDate();
const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate);
return currentDate.getTime() - (firstViewDate.getTime() - 36e5 * this.option("startDayHour")) - timeZoneOffset
}
_getDateGenerationOptions() {
return _extends({}, super._getDateGenerationOptions(), {
cellCountInDay: 1
})
}
getCellWidth() {
return this.cache.get("cellWidth", (() => {
let averageWidth = 0;
const cells = this._getCells().slice(0, 7);
cells.each(((index, element) => {
averageWidth += (0, _window.hasWindow)() ? (0, _position.getBoundingRect)(element).width : 0
}));
return 0 === cells.length ? void 0 : averageWidth / 7
}))
}
_insertAllDayRowsIntoDateTable() {
return false
}
_getCellCoordinatesByIndex(index) {
const rowIndex = Math.floor(index / this._getCellCount());
const columnIndex = index - this._getCellCount() * rowIndex;
return {
rowIndex: rowIndex,
columnIndex: columnIndex
}
}
_needCreateCrossScrolling() {
return this.option("crossScrollingEnabled") || this._isVerticalGroupedWorkSpace()
}
_getViewStartByOptions() {
return _index2.monthUtils.getViewStartByOptions(this.option("startDate"), this.option("currentDate"), this.option("intervalCount"), _date.default.getFirstMonthDate(this.option("startDate")))
}
_updateIndex(index) {
return index
}
isIndicationAvailable() {
return false
}
getIntervalDuration() {
return toMs("day")
}
getTimePanelWidth() {
return 0
}
supportAllDayRow() {
return false
}
keepOriginalHours() {
return true
}
getWorkSpaceLeftOffset() {
return 0
}
needApplyCollectorOffset() {
return true
}
_getHeaderDate() {
return this._getViewStartByOptions()
}
scrollToTime() {
return (0, _common.noop)()
}
renderRAllDayPanel() {}
renderRTimeTable() {}
renderRDateTable() {
_m_utils.utils.renovation.renderComponent(this, this._$dateTable, _index.DateTableMonthComponent, "renovatedDateTable", this._getRDateTableProps())
}
_createWorkSpaceElements() {
if (this._isVerticalGroupedWorkSpace()) {
this._createWorkSpaceScrollableElements()
} else {
super._createWorkSpaceElements()
}
}
_toggleAllDayVisibility() {
return (0, _common.noop)()
}
_changeAllDayVisibility() {
return (0, _common.noop)()
}
_renderTimePanel() {
return (0, _common.noop)()
}
_renderAllDayPanel() {
return (0, _common.noop)()
}
_setMonthClassesToCell($cell, data) {
$cell.toggleClass("dx-scheduler-date-table-current-date", data.isCurrentDate).toggleClass("dx-scheduler-date-table-first-of-month", data.firstDayOfMonth).toggleClass("dx-scheduler-date-table-other-month", data.otherMonth)
}
_createAllDayPanelElements() {}
_renderTableBody(options) {
options.getCellText = (rowIndex, columnIndex) => {
const date = this.viewDataProvider.completeViewDataMap[rowIndex][columnIndex].startDate;
return _index2.monthUtils.getCellText(date, this.option("intervalCount"))
};
options.getCellTextClass = "dx-scheduler-date-table-cell-text";
options.setAdditionalClasses = this._setMonthClassesToCell.bind(this);
super._renderTableBody(options)
}
}(0, _component_registrator.default)("dxSchedulerWorkSpaceMonth", SchedulerWorkSpaceMonth);
exports.default = SchedulerWorkSpaceMonth
},
2986:
/*!******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_vertical.js ***!
\******************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_work_space_indicator = (obj = __webpack_require__( /*! ./m_work_space_indicator */ 34623), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class SchedulerWorkspaceVertical extends _m_work_space_indicator.default {
_getFormat() {
return _index.formatWeekdayAndDay
}
generateRenderOptions() {
const options = super.generateRenderOptions();
return _extends({}, options, {
isGenerateTimePanelData: true
})
}
_isRenderHeaderPanelEmptyCell() {
return true
}
}
exports.default = SchedulerWorkspaceVertical
},
36828:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_week.js ***!
\**************************************************************************************************/
function(__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 */ 99393));
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_work_space_vertical = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_vertical */ 2986));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class SchedulerWorkSpaceWeek extends _m_work_space_vertical.default {
get type() {
return _m_constants.VIEWS.WEEK
}
_getElementClass() {
return "dx-scheduler-work-space-week"
}
_calculateViewStartDate() {
return _index.weekUtils.calculateViewStartDate(this.option("startDate"), this._firstDayOfWeek())
}
}(0, _component_registrator.default)("dxSchedulerWorkSpaceWeek", SchedulerWorkSpaceWeek);
exports.default = SchedulerWorkSpaceWeek
},
29544:
/*!*******************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_work_week.js ***!
\*******************************************************************************************************/
function(__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 */ 99393));
var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084);
var _m_constants = __webpack_require__( /*! ../m_constants */ 6324);
var _m_work_space_week = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_week */ 36828));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class SchedulerWorkSpaceWorkWeek extends _m_work_space_week.default {
get type() {
return _m_constants.VIEWS.WORK_WEEK
}
constructor() {
super(...arguments);
this._getWeekendsCount = _index.getWeekendsCount
}
_getElementClass() {
return "dx-scheduler-work-space-work-week"
}
}(0, _component_registrator.default)("dxSchedulerWorkSpaceWorkWeek", SchedulerWorkSpaceWorkWeek);
exports.default = SchedulerWorkSpaceWorkWeek
},
11706:
/*!************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_date_header_data_generator.js ***!
\************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DateHeaderDataGenerator = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _m_constants = __webpack_require__( /*! ../../../scheduler/m_constants */ 6324);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
const _excluded = ["startDate", "endDate", "isFirstGroupCell", "isLastGroupCell"];
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
exports.DateHeaderDataGenerator = class {
constructor(_viewDataGenerator) {
this._viewDataGenerator = _viewDataGenerator
}
getCompleteDateHeaderMap(options, completeViewDataMap) {
const {
isGenerateWeekDaysHeaderData: isGenerateWeekDaysHeaderData
} = options;
const result = [];
if (isGenerateWeekDaysHeaderData) {
const weekDaysRow = this._generateWeekDaysHeaderRowMap(options, completeViewDataMap);
result.push(weekDaysRow)
}
const dateRow = this._generateHeaderDateRow(options, completeViewDataMap);
result.push(dateRow);
return result
}
_generateWeekDaysHeaderRowMap(options, completeViewDataMap) {
const {
isGroupedByDate: isGroupedByDate,
groups: groups,
groupOrientation: groupOrientation,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval,
isHorizontalGrouping: isHorizontalGrouping,
intervalCount: intervalCount,
viewOffset: viewOffset
} = options;
const cellCountInDay = this._viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval);
const horizontalGroupCount = (0, _index.getHorizontalGroupCount)(groups, groupOrientation);
const index = completeViewDataMap[0][0].allDay ? 1 : 0;
const colSpan = isGroupedByDate ? horizontalGroupCount * cellCountInDay : cellCountInDay;
const groupCount = (0, _index.getGroupCount)(groups);
const datesRepeatCount = isHorizontalGrouping && !isGroupedByDate ? groupCount : 1;
const daysInGroup = this._viewDataGenerator.daysInInterval * intervalCount;
const daysInView = daysInGroup * datesRepeatCount;
const weekDaysRow = [];
for (let dayIndex = 0; dayIndex < daysInView; dayIndex += 1) {
const cell = completeViewDataMap[index][dayIndex * colSpan];
const shiftedStartDate = _m_utils_time_zone.default.addOffsetsWithoutDST(cell.startDate, -viewOffset);
weekDaysRow.push(_extends({}, cell, {
colSpan: colSpan,
text: (0, _index.formatWeekdayAndDay)(shiftedStartDate),
isFirstGroupCell: false,
isLastGroupCell: false
}))
}
return weekDaysRow
}
_generateHeaderDateRow(options, completeViewDataMap) {
const {
today: today,
isGroupedByDate: isGroupedByDate,
groupOrientation: groupOrientation,
groups: groups,
headerCellTextFormat: headerCellTextFormat,
getDateForHeaderText: getDateForHeaderText,
interval: interval,
startViewDate: startViewDate,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval,
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
viewOffset: viewOffset
} = options;
const horizontalGroupCount = (0, _index.getHorizontalGroupCount)(groups, groupOrientation);
const index = completeViewDataMap[0][0].allDay ? 1 : 0;
const colSpan = isGroupedByDate ? horizontalGroupCount : 1;
const isVerticalGrouping = "vertical" === groupOrientation;
const cellCountInGroupRow = this._viewDataGenerator.getCellCount({
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
hoursInterval: hoursInterval,
startDayHour: startDayHour,
endDayHour: endDayHour
});
const cellCountInDay = this._viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval);
const slicedByColumnsData = isGroupedByDate ? completeViewDataMap[index].filter(((_, columnIndex) => columnIndex % horizontalGroupCount === 0)) : completeViewDataMap[index];
const shouldShiftDatesForHeaderText = !(0, _index.isTimelineView)(viewType) || viewType === _m_constants.VIEWS.TIMELINE_MONTH;
return slicedByColumnsData.map(((_ref, idx) => {
let {
startDate: startDate,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell
} = _ref, restProps = function(source, excluded) {
if (null == source) {
return {}
}
var target = {};
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (excluded.indexOf(key) >= 0) {
continue
}
target[key] = source[key]
}
}
return target
}(_ref, _excluded);
const shiftedStartDate = _m_utils_time_zone.default.addOffsetsWithoutDST(startDate, -viewOffset);
const shiftedStartDateForHeaderText = shouldShiftDatesForHeaderText ? shiftedStartDate : startDate;
const text = (0, _index.getHeaderCellText)(idx % cellCountInGroupRow, shiftedStartDateForHeaderText, headerCellTextFormat, getDateForHeaderText, {
interval: interval,
startViewDate: startViewDate,
startDayHour: startDayHour,
cellCountInDay: cellCountInDay,
viewOffset: viewOffset
});
return _extends({}, restProps, {
startDate: startDate,
text: text,
today: _date.default.sameDate(shiftedStartDate, today),
colSpan: colSpan,
isFirstGroupCell: isGroupedByDate || isFirstGroupCell && !isVerticalGrouping,
isLastGroupCell: isGroupedByDate || isLastGroupCell && !isVerticalGrouping
})
}))
}
generateDateHeaderData(completeDateHeaderMap, completeViewDataMap, options) {
const {
isGenerateWeekDaysHeaderData: isGenerateWeekDaysHeaderData,
cellWidth: cellWidth,
isProvideVirtualCellsWidth: isProvideVirtualCellsWidth,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval,
isMonthDateHeader: isMonthDateHeader
} = options;
const dataMap = [];
let weekDayRowConfig = {};
const validCellWidth = cellWidth || 0;
if (isGenerateWeekDaysHeaderData) {
weekDayRowConfig = this._generateDateHeaderDataRow(options, completeDateHeaderMap, completeViewDataMap, this._viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval), 0, validCellWidth);
dataMap.push(weekDayRowConfig.dateRow)
}
const datesRowConfig = this._generateDateHeaderDataRow(options, completeDateHeaderMap, completeViewDataMap, 1, isGenerateWeekDaysHeaderData ? 1 : 0, validCellWidth);
dataMap.push(datesRowConfig.dateRow);
return {
dataMap: dataMap,
leftVirtualCellWidth: isProvideVirtualCellsWidth ? datesRowConfig.leftVirtualCellWidth : void 0,
rightVirtualCellWidth: isProvideVirtualCellsWidth ? datesRowConfig.rightVirtualCellWidth : void 0,
leftVirtualCellCount: datesRowConfig.leftVirtualCellCount,
rightVirtualCellCount: datesRowConfig.rightVirtualCellCount,
weekDayLeftVirtualCellWidth: weekDayRowConfig.leftVirtualCellWidth,
weekDayRightVirtualCellWidth: weekDayRowConfig.rightVirtualCellWidth,
weekDayLeftVirtualCellCount: weekDayRowConfig.leftVirtualCellCount,
weekDayRightVirtualCellCount: weekDayRowConfig.rightVirtualCellCount,
isMonthDateHeader: isMonthDateHeader
}
}
_generateDateHeaderDataRow(options, completeDateHeaderMap, completeViewDataMap, baseColSpan, rowIndex, cellWidth) {
const {
startCellIndex: startCellIndex,
cellCount: cellCount,
isProvideVirtualCellsWidth: isProvideVirtualCellsWidth,
groups: groups,
groupOrientation: groupOrientation,
isGroupedByDate: isGroupedByDate
} = options;
const horizontalGroupCount = (0, _index.getHorizontalGroupCount)(groups, groupOrientation);
const colSpan = isGroupedByDate ? horizontalGroupCount * baseColSpan : baseColSpan;
const leftVirtualCellCount = Math.floor(startCellIndex / colSpan);
const displayedCellCount = (0, _index.getDisplayedCellCount)(cellCount, completeViewDataMap);
const actualCellCount = Math.ceil((startCellIndex + displayedCellCount) / colSpan);
const totalCellCount = (0, _index.getTotalCellCountByCompleteData)(completeViewDataMap);
const dateRow = completeDateHeaderMap[rowIndex].slice(leftVirtualCellCount, actualCellCount);
const finalLeftVirtualCellCount = leftVirtualCellCount * colSpan;
const finalLeftVirtualCellWidth = finalLeftVirtualCellCount * cellWidth;
const finalRightVirtualCellCount = totalCellCount - actualCellCount * colSpan;
const finalRightVirtualCellWidth = finalRightVirtualCellCount * cellWidth;
return {
dateRow: dateRow,
leftVirtualCellCount: finalLeftVirtualCellCount,
leftVirtualCellWidth: isProvideVirtualCellsWidth ? finalLeftVirtualCellWidth : void 0,
rightVirtualCellCount: finalRightVirtualCellCount,
rightVirtualCellWidth: isProvideVirtualCellsWidth ? finalRightVirtualCellWidth : void 0
}
}
}
},
69033:
/*!***********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_grouped_data_map_provider.js ***!
\***********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GroupedDataMapProvider = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
exports.GroupedDataMapProvider = class {
constructor(viewDataGenerator, viewDataMap, completeViewDataMap, viewOptions) {
this.groupedDataMap = viewDataGenerator.generateGroupedDataMap(viewDataMap);
this.completeViewDataMap = completeViewDataMap;
this._viewOptions = viewOptions
}
getGroupStartDate(groupIndex) {
var _firstRow$;
const firstRow = this.getFirstGroupRow(groupIndex);
return (null === firstRow || void 0 === firstRow || null === (_firstRow$ = firstRow[0]) || void 0 === _firstRow$ || null === (_firstRow$ = _firstRow$.cellData) || void 0 === _firstRow$ ? void 0 : _firstRow$.startDate) ?? null
}
getGroupEndDate(groupIndex) {
const lastRow = this.getLastGroupRow(groupIndex);
if (lastRow) {
const lastColumnIndex = lastRow.length - 1;
const {
cellData: cellData
} = lastRow[lastColumnIndex];
const {
endDate: endDate
} = cellData;
return endDate
}
}
findGroupCellStartDate(groupIndex, startDate, endDate, isFindByDate) {
const groupData = this.getGroupFromDateTableGroupMap(groupIndex);
const checkCellStartDate = (rowIndex, columnIndex) => {
const {
cellData: cellData
} = groupData[rowIndex][columnIndex];
let {
startDate: secondMin,
endDate: secondMax
} = cellData;
if (isFindByDate) {
secondMin = _date.default.trimTime(secondMin);
secondMax = _date.default.setToDayEnd(secondMin)
}
if (_date.default.intervalsOverlap({
firstMin: startDate,
firstMax: endDate,
secondMin: secondMin,
secondMax: secondMax
})) {
return secondMin
}
};
const startDateVerticalSearch = (() => {
const cellCount = groupData[0].length;
for (let columnIndex = 0; columnIndex < cellCount; ++columnIndex) {
for (let rowIndex = 0; rowIndex < groupData.length; ++rowIndex) {
const result = checkCellStartDate(rowIndex, columnIndex);
if (result) {
return result
}
}
}
})();
const startDateHorizontalSearch = (() => {
for (let rowIndex = 0; rowIndex < groupData.length; ++rowIndex) {
const row = groupData[rowIndex];
for (let columnIndex = 0; columnIndex < row.length; ++columnIndex) {
const result = checkCellStartDate(rowIndex, columnIndex);
if (result) {
return result
}
}
}
})();
return startDateVerticalSearch > startDateHorizontalSearch ? startDateHorizontalSearch : startDateVerticalSearch
}
findAllDayGroupCellStartDate(groupIndex) {
var _groupedData$;
const groupedData = this.getGroupFromDateTableGroupMap(groupIndex);
const cellData = null === groupedData || void 0 === groupedData || null === (_groupedData$ = groupedData[0]) || void 0 === _groupedData$ || null === (_groupedData$ = _groupedData$[0]) || void 0 === _groupedData$ ? void 0 : _groupedData$.cellData;
return (null === cellData || void 0 === cellData ? void 0 : cellData.startDate) ?? null
}
findCellPositionInMap(cellInfo, isAppointmentRender) {
const {
groupIndex: groupIndex,
startDate: startDate,
isAllDay: isAllDay,
index: index
} = cellInfo;
const {
allDayPanelGroupedMap: allDayPanelGroupedMap,
dateTableGroupedMap: dateTableGroupedMap
} = this.groupedDataMap;
const {
viewOffset: viewOffset
} = this._viewOptions;
const rows = isAllDay && !this._viewOptions.isVerticalGrouping ? allDayPanelGroupedMap[groupIndex] ? [allDayPanelGroupedMap[groupIndex]] : [] : dateTableGroupedMap[groupIndex] || [];
for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
const row = rows[rowIndex];
for (let columnIndex = 0; columnIndex < row.length; columnIndex += 1) {
const cell = row[columnIndex];
const originCellData = cell.cellData;
const cellData = isAppointmentRender ? _extends({}, originCellData, {
startDate: _date2.dateUtilsTs.addOffsets(cell.cellData.startDate, [-viewOffset]),
endDate: _date2.dateUtilsTs.addOffsets(cell.cellData.endDate, [-viewOffset])
}) : originCellData;
if (this._isSameGroupIndexAndIndex(cellData, groupIndex, index)) {
if (this.isStartDateInCell(startDate, isAllDay, cellData, originCellData)) {
return cell.position
}
}
}
}
return
}
isStartDateInCell(startDate, inAllDayRow, _ref, _ref2) {
let {
startDate: cellStartDate,
endDate: cellEndDate,
allDay: cellAllDay
} = _ref;
let {
startDate: originCellStartDate,
endDate: originCellEndDate
} = _ref2;
const {
viewType: viewType
} = this._viewOptions;
const cellSecondIntervalOffset = this.getCellSecondIntervalOffset(originCellStartDate, originCellEndDate);
const isCellCoversTwoIntervals = 0 !== cellSecondIntervalOffset;
switch (true) {
case !(0, _index.isDateAndTimeView)(viewType):
case inAllDayRow && cellAllDay:
return _date.default.sameDate(startDate, cellStartDate);
case !inAllDayRow && !isCellCoversTwoIntervals:
return startDate >= cellStartDate && startDate < cellEndDate;
case !inAllDayRow && isCellCoversTwoIntervals:
return this.isStartDateInTwoIntervalsCell(startDate, cellSecondIntervalOffset, cellStartDate, cellEndDate);
default:
return false
}
}
getCellSecondIntervalOffset(cellStartDate, cellEndDate) {
const nextHourCellStartDate = _date2.dateUtilsTs.addOffsets(cellStartDate, [toMs("hour")]);
const cellTimezoneDiff = _m_utils_time_zone.default.getDaylightOffset(cellStartDate, cellEndDate);
const cellNextHourTimezoneDiff = _m_utils_time_zone.default.getDaylightOffset(cellStartDate, nextHourCellStartDate);
const isDSTInsideCell = 0 !== cellTimezoneDiff;
const isWinterTimezoneNextHour = cellNextHourTimezoneDiff < 0;
return !isDSTInsideCell && isWinterTimezoneNextHour ? Math.abs(cellNextHourTimezoneDiff * toMs("minute")) : 0
}
isStartDateInTwoIntervalsCell(startDate, secondIntervalOffset, cellStartDate, cellEndDate) {
const nextIntervalCellStartDate = _date2.dateUtilsTs.addOffsets(cellStartDate, [secondIntervalOffset]);
const nextIntervalCellEndDate = _date2.dateUtilsTs.addOffsets(cellEndDate, [secondIntervalOffset]);
const isInOriginInterval = startDate >= cellStartDate && startDate < cellEndDate;
const isInSecondInterval = startDate >= nextIntervalCellStartDate && startDate < nextIntervalCellEndDate;
return isInOriginInterval || isInSecondInterval
}
_isSameGroupIndexAndIndex(cellData, groupIndex, index) {
return cellData.groupIndex === groupIndex && (void 0 === index || cellData.index === index)
}
getCellsGroup(groupIndex) {
const {
dateTableGroupedMap: dateTableGroupedMap
} = this.groupedDataMap;
const groupData = dateTableGroupedMap[groupIndex];
if (groupData) {
const {
cellData: cellData
} = groupData[0][0];
return cellData.groups
}
}
getCompletedGroupsInfo() {
const {
dateTableGroupedMap: dateTableGroupedMap
} = this.groupedDataMap;
return dateTableGroupedMap.map((groupData => {
const firstCell = groupData[0][0];
const {
allDay: allDay,
groupIndex: groupIndex
} = firstCell.cellData;
return {
allDay: allDay,
groupIndex: groupIndex,
startDate: this.getGroupStartDate(groupIndex),
endDate: this.getGroupEndDate(groupIndex)
}
})).filter((_ref3 => {
let {
startDate: startDate
} = _ref3;
return !!startDate
}))
}
getGroupIndices() {
return this.getCompletedGroupsInfo().map((_ref4 => {
let {
groupIndex: groupIndex
} = _ref4;
return groupIndex
}))
}
getGroupFromDateTableGroupMap(groupIndex) {
const {
dateTableGroupedMap: dateTableGroupedMap
} = this.groupedDataMap;
return dateTableGroupedMap[groupIndex]
}
getFirstGroupRow(groupIndex) {
const groupedData = this.getGroupFromDateTableGroupMap(groupIndex);
if (groupedData) {
const {
cellData: cellData
} = groupedData[0][0];
return !cellData.allDay ? groupedData[0] : groupedData[1]
}
}
getLastGroupRow(groupIndex) {
const {
dateTableGroupedMap: dateTableGroupedMap
} = this.groupedDataMap;
const groupedData = dateTableGroupedMap[groupIndex];
if (groupedData) {
const lastRowIndex = groupedData.length - 1;
return groupedData[lastRowIndex]
}
}
getLastGroupCellPosition(groupIndex) {
const groupRow = this.getLastGroupRow(groupIndex);
return null === groupRow || void 0 === groupRow ? void 0 : groupRow[(null === groupRow || void 0 === groupRow ? void 0 : groupRow.length) - 1].position
}
getRowCountInGroup(groupIndex) {
const groupRow = this.getLastGroupRow(groupIndex);
const cellAmount = groupRow.length;
const lastCellData = groupRow[cellAmount - 1].cellData;
const lastCellIndex = lastCellData.index;
return (lastCellIndex + 1) / groupRow.length
}
}
},
45512:
/*!***********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_time_panel_data_generator.js ***!
\***********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimePanelDataGenerator = void 0;
var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _math = __webpack_require__( /*! ../../../core/utils/math */ 11390);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
const _excluded = ["allDay", "startDate", "endDate", "groups", "groupIndex", "isFirstGroupCell", "isLastGroupCell", "index"];
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
exports.TimePanelDataGenerator = class {
constructor(_viewDataGenerator) {
this._viewDataGenerator = _viewDataGenerator
}
getCompleteTimePanelMap(options, completeViewDataMap) {
const {
startViewDate: startViewDate,
cellDuration: cellDuration,
startDayHour: startDayHour,
isVerticalGrouping: isVerticalGrouping,
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
hoursInterval: hoursInterval,
endDayHour: endDayHour,
viewOffset: viewOffset,
today: today,
showCurrentTimeIndicator: showCurrentTimeIndicator
} = options;
const rowsCount = completeViewDataMap.length - 1;
const realEndViewDate = completeViewDataMap[rowsCount][completeViewDataMap[rowsCount].length - 1].endDate;
const rowCountInGroup = this._viewDataGenerator.getRowCount({
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
hoursInterval: hoursInterval,
startDayHour: startDayHour,
endDayHour: endDayHour
});
const cellCountInGroupRow = this._viewDataGenerator.getCellCount({
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
hoursInterval: hoursInterval,
startDayHour: startDayHour,
endDayHour: endDayHour
});
let allDayRowsCount = 0;
let usualCellIndex = 0;
return completeViewDataMap.map(((row, index) => {
const _row$ = row[0],
{
allDay: allDay,
startDate: startDate,
groups: groups,
groupIndex: groupIndex,
isFirstGroupCell: isFirstGroupCell,
isLastGroupCell: isLastGroupCell,
index: cellIndex
} = _row$,
restCellProps = function(source, excluded) {
if (null == source) {
return {}
}
var target = {};
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (excluded.indexOf(key) >= 0) {
continue
}
target[key] = source[key]
}
}
return target
}(_row$, _excluded);
const highlighted = allDay ? false : this.isTimeCellShouldBeHighlighted(today, viewOffset, {
startViewDate: startViewDate,
realEndViewDate: realEndViewDate,
showCurrentTimeIndicator: showCurrentTimeIndicator
}, {
date: startDate,
index: usualCellIndex,
duration: Math.round(cellDuration),
isFirst: 0 === usualCellIndex,
isLast: this.isLastCellInGroup(completeViewDataMap, index)
});
if (allDay) {
allDayRowsCount += 1;
usualCellIndex = 0
} else {
usualCellIndex += 1
}
const timeIndex = (index - allDayRowsCount) % rowCountInGroup;
return _extends({}, restCellProps, {
startDate: startDate,
allDay: allDay,
highlighted: highlighted,
text: _index.weekUtils.getTimePanelCellText(timeIndex, startDate, startViewDate, cellDuration, startDayHour, viewOffset),
groups: isVerticalGrouping ? groups : void 0,
groupIndex: isVerticalGrouping ? groupIndex : void 0,
isFirstGroupCell: isVerticalGrouping && isFirstGroupCell,
isLastGroupCell: isVerticalGrouping && isLastGroupCell,
index: Math.floor(cellIndex / cellCountInGroupRow)
})
}))
}
generateTimePanelData(completeTimePanelMap, options) {
const {
startRowIndex: startRowIndex,
rowCount: rowCount,
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight,
isGroupedAllDayPanel: isGroupedAllDayPanel,
isVerticalGrouping: isVerticalGrouping,
isAllDayPanelVisible: isAllDayPanelVisible
} = options;
const indexDifference = isVerticalGrouping || !isAllDayPanelVisible ? 0 : 1;
const correctedStartRowIndex = startRowIndex + indexDifference;
const displayedRowCount = (0, _index.getDisplayedRowCount)(rowCount, completeTimePanelMap);
const timePanelMap = completeTimePanelMap.slice(correctedStartRowIndex, correctedStartRowIndex + displayedRowCount);
const timePanelData = {
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight,
isGroupedAllDayPanel: isGroupedAllDayPanel
};
const {
previousGroupedData: groupedData
} = this._generateTimePanelDataFromMap(timePanelMap, isVerticalGrouping);
timePanelData.groupedData = groupedData;
return timePanelData
}
_generateTimePanelDataFromMap(timePanelMap, isVerticalGrouping) {
return timePanelMap.reduce(((_ref, cellData) => {
let {
previousGroupIndex: previousGroupIndex,
previousGroupedData: previousGroupedData
} = _ref;
const currentGroupIndex = cellData.groupIndex;
if (currentGroupIndex !== previousGroupIndex) {
previousGroupedData.push({
dateTable: [],
isGroupedAllDayPanel: (0, _index.getIsGroupedAllDayPanel)(!!cellData.allDay, isVerticalGrouping),
groupIndex: currentGroupIndex,
key: (0, _index.getKeyByGroup)(currentGroupIndex, isVerticalGrouping)
})
}
if (cellData.allDay) {
previousGroupedData[previousGroupedData.length - 1].allDayPanel = cellData
} else {
previousGroupedData[previousGroupedData.length - 1].dateTable.push(cellData)
}
return {
previousGroupIndex: currentGroupIndex,
previousGroupedData: previousGroupedData
}
}), {
previousGroupIndex: -1,
previousGroupedData: []
})
}
isTimeCellShouldBeHighlighted(today, viewOffset, _ref2, cellData) {
let {
startViewDate: startViewDate,
realEndViewDate: realEndViewDate,
showCurrentTimeIndicator: showCurrentTimeIndicator
} = _ref2;
const realToday = _date2.dateUtilsTs.addOffsets(today, [viewOffset]);
const realStartViewDate = _date2.dateUtilsTs.addOffsets(startViewDate, [viewOffset]);
if (!showCurrentTimeIndicator || realToday < realStartViewDate || realToday >= realEndViewDate) {
return false
}
const realTodayTimeMs = this.getLocalDateTimeInMs(realToday);
const [startMs, endMs] = this.getHighlightedInterval(cellData);
return startMs < endMs ? realTodayTimeMs >= startMs && realTodayTimeMs < endMs : realTodayTimeMs >= startMs && realTodayTimeMs < toMs("day") || realTodayTimeMs >= 0 && realTodayTimeMs < endMs
}
getHighlightedInterval(_ref3) {
let {
date: date,
index: index,
duration: duration,
isFirst: isFirst,
isLast: isLast
} = _ref3;
const cellTimeMs = this.getLocalDateTimeInMs(date);
const isEvenCell = index % 2 === 0;
switch (true) {
case isFirst || isLast && !isEvenCell:
return [cellTimeMs, (0, _math.shiftIntegerByModule)(cellTimeMs + duration, toMs("day"))];
case isEvenCell:
return [(0, _math.shiftIntegerByModule)(cellTimeMs - duration, toMs("day")), (0, _math.shiftIntegerByModule)(cellTimeMs + duration, toMs("day"))];
default:
return [cellTimeMs, (0, _math.shiftIntegerByModule)(cellTimeMs + 2 * duration, toMs("day"))]
}
}
getLocalDateTimeInMs(date) {
const dateUtcMs = date.getTime() - date.getTimezoneOffset() * toMs("minute");
return (0, _math.shiftIntegerByModule)(dateUtcMs, toMs("day"))
}
isLastCellInGroup(completeViewDataMap, index) {
if (index === completeViewDataMap.length - 1) {
return true
}
const {
groupIndex: currentGroupIndex
} = completeViewDataMap[index][0];
const {
groupIndex: nextGroupIndex,
allDay: nextAllDay
} = completeViewDataMap[index + 1][0];
return nextAllDay || nextGroupIndex !== currentGroupIndex
}
}
},
29964:
/*!***************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_utils.js ***!
\***************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.alignToFirstDayOfWeek = alignToFirstDayOfWeek;
exports.alignToLastDayOfWeek = alignToLastDayOfWeek;
exports.calculateAlignedWeeksBetweenDates = function(fromDate, toDate, firstDayOfWeek) {
const alignedFromDate = alignToFirstDayOfWeek(fromDate, firstDayOfWeek);
const alignedToDate = alignToLastDayOfWeek(toDate, firstDayOfWeek);
const weekCount = calculateDaysBetweenDates(alignedFromDate, alignedToDate) / DAYS_IN_WEEK;
return Math.max(weekCount, 6)
};
exports.calculateDaysBetweenDates = calculateDaysBetweenDates;
exports.getViewDataGeneratorByViewType = void 0;
var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _m_constants = __webpack_require__( /*! ../../m_constants */ 6324);
var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407);
var _m_view_data_generator_day = __webpack_require__( /*! ./m_view_data_generator_day */ 54947);
var _m_view_data_generator_month = __webpack_require__( /*! ./m_view_data_generator_month */ 24562);
var _m_view_data_generator_timeline_month = __webpack_require__( /*! ./m_view_data_generator_timeline_month */ 49738);
var _m_view_data_generator_week = __webpack_require__( /*! ./m_view_data_generator_week */ 98097);
var _m_view_data_generator_work_week = __webpack_require__( /*! ./m_view_data_generator_work_week */ 4277);
const DAYS_IN_WEEK = 7;
const MS_IN_DAY = 864e5;
exports.getViewDataGeneratorByViewType = viewType => {
switch (viewType) {
case _m_constants.VIEWS.MONTH:
return new _m_view_data_generator_month.ViewDataGeneratorMonth;
case _m_constants.VIEWS.TIMELINE_MONTH:
return new _m_view_data_generator_timeline_month.ViewDataGeneratorTimelineMonth;
case _m_constants.VIEWS.DAY:
case _m_constants.VIEWS.TIMELINE_DAY:
return new _m_view_data_generator_day.ViewDataGeneratorDay;
case _m_constants.VIEWS.WEEK:
case _m_constants.VIEWS.TIMELINE_WEEK:
return new _m_view_data_generator_week.ViewDataGeneratorWeek;
case _m_constants.VIEWS.WORK_WEEK:
case _m_constants.VIEWS.TIMELINE_WORK_WEEK:
return new _m_view_data_generator_work_week.ViewDataGeneratorWorkWeek;
default:
return new _m_view_data_generator.ViewDataGenerator
}
};
function alignToFirstDayOfWeek(date, firstDayOfWeek) {
const newDate = new Date(date);
let dayDiff = newDate.getDay() - firstDayOfWeek;
if (dayDiff < 0) {
dayDiff += DAYS_IN_WEEK
}
newDate.setDate(newDate.getDate() - dayDiff);
return newDate
}
function alignToLastDayOfWeek(date, firstDayOfWeek) {
const newDate = alignToFirstDayOfWeek(date, firstDayOfWeek);
newDate.setDate(newDate.getDate() + DAYS_IN_WEEK - 1);
return newDate
}
function calculateDaysBetweenDates(fromDate, toDate) {
const msDiff = _date.default.trimTime(toDate).getTime() - _date.default.trimTime(fromDate).getTime();
return Math.round(msDiff / MS_IN_DAY) + 1
}
},
31407:
/*!*****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator.js ***!
\*****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewDataGenerator = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_constants = __webpack_require__( /*! ../../m_constants */ 6324);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
var _m_utils = __webpack_require__( /*! ../../resources/m_utils */ 31359);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const toMs = _date.default.dateToMilliseconds;
exports.ViewDataGenerator = class {
constructor() {
this.daysInInterval = 1;
this.isWorkView = false;
this.tableAllDay = false
}
isSkippedDate(date) {
return false
}
_calculateStartViewDate(options) {}
getStartViewDate(options) {
return this._calculateStartViewDate(options)
}
getCompleteViewDataMap(options) {
const {
groups: groups,
isGroupedByDate: isGroupedByDate,
isHorizontalGrouping: isHorizontalGrouping,
isVerticalGrouping: isVerticalGrouping,
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval
} = options;
this._setVisibilityDates(options);
this.setHiddenInterval(startDayHour, endDayHour, hoursInterval);
const groupsList = (0, _m_utils.getAllGroups)(groups);
const cellCountInGroupRow = this.getCellCount({
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval
});
const rowCountInGroup = this.getRowCount({
intervalCount: intervalCount,
currentDate: currentDate,
viewType: viewType,
hoursInterval: hoursInterval,
startDayHour: startDayHour,
endDayHour: endDayHour
});
let viewDataMap = [];
const allDayPanelData = this._generateAllDayPanelData(options, rowCountInGroup, cellCountInGroupRow);
const viewCellsData = this._generateViewCellsData(options, rowCountInGroup, cellCountInGroupRow);
if (allDayPanelData) {
viewDataMap.push(allDayPanelData)
}
viewDataMap.push(...viewCellsData);
if (isHorizontalGrouping && !isGroupedByDate) {
viewDataMap = this._transformViewDataMapForHorizontalGrouping(viewDataMap, groupsList)
}
if (isVerticalGrouping) {
viewDataMap = this._transformViewDataMapForVerticalGrouping(viewDataMap, groupsList)
}
if (isGroupedByDate) {
viewDataMap = this._transformViewDataMapForGroupingByDate(viewDataMap, groupsList)
}
return this._addKeysToCells(viewDataMap)
}
_transformViewDataMapForHorizontalGrouping(viewDataMap, groupsList) {
const result = viewDataMap.map((row => row.slice()));
groupsList.slice(1).forEach(((groups, index) => {
const groupIndex = index + 1;
viewDataMap.forEach(((row, rowIndex) => {
const nextGroupRow = row.map((cellData => _extends({}, cellData, {
groups: groups,
groupIndex: groupIndex
})));
result[rowIndex].push(...nextGroupRow)
}))
}));
return result
}
_transformViewDataMapForVerticalGrouping(viewDataMap, groupsList) {
const result = viewDataMap.map((row => row.slice()));
groupsList.slice(1).forEach(((groups, index) => {
const groupIndex = index + 1;
const nextGroupMap = viewDataMap.map((cellsRow => {
const nextRow = cellsRow.map((cellData => _extends({}, cellData, {
groupIndex: groupIndex,
groups: groups
})));
return nextRow
}));
result.push(...nextGroupMap)
}));
return result
}
_transformViewDataMapForGroupingByDate(viewDataMap, groupsList) {
const correctedGroupList = groupsList.slice(1);
const correctedGroupCount = correctedGroupList.length;
const result = viewDataMap.map((cellsRow => {
const groupedByDateCellsRow = cellsRow.reduce(((currentRow, cell) => {
const rowWithCurrentCell = [...currentRow, _extends({}, cell, {
isFirstGroupCell: true,
isLastGroupCell: 0 === correctedGroupCount
}), ...correctedGroupList.map(((groups, index) => _extends({}, cell, {
groups: groups,
groupIndex: index + 1,
isFirstGroupCell: false,
isLastGroupCell: index === correctedGroupCount - 1
})))];
return rowWithCurrentCell
}), []);
return groupedByDateCellsRow
}));
return result
}
_addKeysToCells(viewDataMap) {
const totalColumnCount = viewDataMap[0].length;
const {
currentViewDataMap: result
} = viewDataMap.reduce(((_ref, row, rowIndex) => {
let {
allDayPanelsCount: allDayPanelsCount,
currentViewDataMap: currentViewDataMap
} = _ref;
const isAllDay = row[0].allDay;
const keyBase = (rowIndex - allDayPanelsCount) * totalColumnCount;
const currentAllDayPanelsCount = isAllDay ? allDayPanelsCount + 1 : allDayPanelsCount;
currentViewDataMap[rowIndex].forEach(((cell, columnIndex) => {
cell.key = keyBase + columnIndex
}));
return {
allDayPanelsCount: currentAllDayPanelsCount,
currentViewDataMap: currentViewDataMap
}
}), {
allDayPanelsCount: 0,
currentViewDataMap: viewDataMap
});
return result
}
generateViewDataMap(completeViewDataMap, options) {
const {
rowCount: rowCount,
startCellIndex: startCellIndex,
startRowIndex: startRowIndex,
cellCount: cellCount,
isVerticalGrouping: isVerticalGrouping,
isAllDayPanelVisible: isAllDayPanelVisible
} = options;
const sliceCells = (row, rowIndex, startIndex, count) => {
const sliceToIndex = void 0 !== count ? startIndex + count : void 0;
return row.slice(startIndex, sliceToIndex).map(((cellData, columnIndex) => ({
cellData: cellData,
position: {
rowIndex: rowIndex,
columnIndex: columnIndex
}
})))
};
let correctedStartRowIndex = startRowIndex;
let allDayPanelMap = [];
if (this._isStandaloneAllDayPanel(isVerticalGrouping, isAllDayPanelVisible)) {
correctedStartRowIndex++;
allDayPanelMap = sliceCells(completeViewDataMap[0], 0, startCellIndex, cellCount)
}
const displayedRowCount = (0, _index.getDisplayedRowCount)(rowCount, completeViewDataMap);
const dateTableMap = completeViewDataMap.slice(correctedStartRowIndex, correctedStartRowIndex + displayedRowCount).map(((row, rowIndex) => sliceCells(row, rowIndex, startCellIndex, cellCount)));
return {
allDayPanelMap: allDayPanelMap,
dateTableMap: dateTableMap
}
}
_isStandaloneAllDayPanel(isVerticalGrouping, isAllDayPanelVisible) {
return !isVerticalGrouping && isAllDayPanelVisible
}
getViewDataFromMap(completeViewDataMap, viewDataMap, options) {
const {
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight,
leftVirtualCellWidth: leftVirtualCellWidth,
rightVirtualCellWidth: rightVirtualCellWidth,
cellCount: cellCount,
rowCount: rowCount,
startRowIndex: startRowIndex,
startCellIndex: startCellIndex,
isProvideVirtualCellsWidth: isProvideVirtualCellsWidth,
isGroupedAllDayPanel: isGroupedAllDayPanel,
isVerticalGrouping: isVerticalGrouping,
isAllDayPanelVisible: isAllDayPanelVisible
} = options;
const {
allDayPanelMap: allDayPanelMap,
dateTableMap: dateTableMap
} = viewDataMap;
const {
groupedData: groupedData
} = dateTableMap.reduce(((_ref2, cellsRow) => {
let {
previousGroupIndex: previousGroupIndex,
groupedData: groupedData
} = _ref2;
const cellDataRow = cellsRow.map((_ref3 => {
let {
cellData: cellData
} = _ref3;
return cellData
}));
const firstCell = cellDataRow[0];
const isAllDayRow = firstCell.allDay;
const currentGroupIndex = firstCell.groupIndex;
if (currentGroupIndex !== previousGroupIndex) {
groupedData.push({
dateTable: [],
isGroupedAllDayPanel: (0, _index.getIsGroupedAllDayPanel)(!!isAllDayRow, isVerticalGrouping),
groupIndex: currentGroupIndex,
key: (0, _index.getKeyByGroup)(currentGroupIndex, isVerticalGrouping)
})
}
if (isAllDayRow) {
groupedData[groupedData.length - 1].allDayPanel = cellDataRow
} else {
groupedData[groupedData.length - 1].dateTable.push({
cells: cellDataRow,
key: cellDataRow[0].key - startCellIndex
})
}
return {
groupedData: groupedData,
previousGroupIndex: currentGroupIndex
}
}), {
previousGroupIndex: -1,
groupedData: []
});
if (this._isStandaloneAllDayPanel(isVerticalGrouping, isAllDayPanelVisible)) {
groupedData[0].allDayPanel = allDayPanelMap.map((_ref4 => {
let {
cellData: cellData
} = _ref4;
return cellData
}))
}
const totalCellCount = (0, _index.getTotalCellCountByCompleteData)(completeViewDataMap);
const totalRowCount = (0, _index.getTotalRowCountByCompleteData)(completeViewDataMap);
const displayedCellCount = (0, _index.getDisplayedCellCount)(cellCount, completeViewDataMap);
const displayedRowCount = (0, _index.getDisplayedRowCount)(rowCount, completeViewDataMap);
return {
groupedData: groupedData,
topVirtualRowHeight: topVirtualRowHeight,
bottomVirtualRowHeight: bottomVirtualRowHeight,
leftVirtualCellWidth: isProvideVirtualCellsWidth ? leftVirtualCellWidth : void 0,
rightVirtualCellWidth: isProvideVirtualCellsWidth ? rightVirtualCellWidth : void 0,
isGroupedAllDayPanel: isGroupedAllDayPanel,
leftVirtualCellCount: startCellIndex,
rightVirtualCellCount: void 0 === cellCount ? 0 : totalCellCount - startCellIndex - displayedCellCount,
topVirtualRowCount: startRowIndex,
bottomVirtualRowCount: totalRowCount - startRowIndex - displayedRowCount
}
}
_generateViewCellsData(options, rowCount, cellCountInGroupRow) {
const viewCellsData = [];
for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
viewCellsData.push(this._generateCellsRow(options, false, rowIndex, rowCount, cellCountInGroupRow))
}
return viewCellsData
}
_generateAllDayPanelData(options, rowCount, columnCount) {
if (!options.isAllDayPanelVisible) {
return null
}
return this._generateCellsRow(options, true, 0, rowCount, columnCount)
}
_generateCellsRow(options, allDay, rowIndex, rowCount, columnCount) {
const cellsRow = [];
for (let columnIndex = 0; columnIndex < columnCount; ++columnIndex) {
const cellDataValue = this.getCellData(rowIndex, columnIndex, options, allDay);
cellDataValue.index = rowIndex * columnCount + columnIndex;
cellDataValue.isFirstGroupCell = this._isFirstGroupCell(rowIndex, columnIndex, options, rowCount, columnCount);
cellDataValue.isLastGroupCell = this._isLastGroupCell(rowIndex, columnIndex, options, rowCount, columnCount);
cellsRow.push(cellDataValue)
}
return cellsRow
}
getCellData(rowIndex, columnIndex, options, allDay) {
return allDay ? this.prepareAllDayCellData(options, rowIndex, columnIndex) : this.prepareCellData(options, rowIndex, columnIndex)
}
prepareCellData(options, rowIndex, columnIndex) {
const {
groups: groups,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval
} = options;
const groupsList = (0, _m_utils.getAllGroups)(groups);
const startDate = this.getDateByCellIndices(options, rowIndex, columnIndex, this.getCellCountInDay(startDayHour, endDayHour, hoursInterval));
const endDate = this.getCellEndDate(startDate, options);
const data = {
startDate: startDate,
endDate: endDate,
allDay: this.tableAllDay,
groupIndex: 0
};
if (groupsList.length > 0) {
data.groups = groupsList[0]
}
return data
}
prepareAllDayCellData(options, rowIndex, columnIndex) {
const data = this.prepareCellData(_extends({}, options, {
viewOffset: 0
}), rowIndex, columnIndex);
const {
viewOffset: viewOffset
} = options;
const startDate = _date.default.trimTime(data.startDate);
const shiftedStartDate = _date2.dateUtilsTs.addOffsets(startDate, [viewOffset]);
return _extends({}, data, {
startDate: shiftedStartDate,
endDate: shiftedStartDate,
allDay: true
})
}
getDateByCellIndices(options, rowIndex, columnIndex, cellCountInDay) {
let {
startViewDate: startViewDate
} = options;
const {
startDayHour: startDayHour,
interval: interval,
firstDayOfWeek: firstDayOfWeek,
intervalCount: intervalCount,
viewOffset: viewOffset
} = options;
const isStartViewDateDuringDST = startViewDate.getHours() !== Math.floor(startDayHour);
if (isStartViewDateDuringDST) {
const dateWithCorrectHours = (0, _index.getStartViewDateWithoutDST)(startViewDate, startDayHour);
startViewDate = new Date(dateWithCorrectHours.getTime() - toMs("day"))
}
const columnCountBase = this.getCellCount(options);
const rowCountBase = this.getRowCount(options);
const cellIndex = this._calculateCellIndex(rowIndex, columnIndex, rowCountBase, columnCountBase);
const millisecondsOffset = this.getMillisecondsOffset(cellIndex, interval, cellCountInDay);
const offsetByCount = this.isWorkView ? this.getTimeOffsetByColumnIndex(columnIndex, this.getFirstDayOfWeek(firstDayOfWeek), columnCountBase, intervalCount) : 0;
const startViewDateTime = startViewDate.getTime();
const currentDate = new Date(startViewDateTime + millisecondsOffset + offsetByCount + viewOffset);
const timeZoneDifference = isStartViewDateDuringDST ? 0 : _date.default.getTimezonesDifference(startViewDate, currentDate);
currentDate.setTime(currentDate.getTime() + timeZoneDifference);
return currentDate
}
getMillisecondsOffset(cellIndex, interval, cellCountInDay) {
const dayIndex = Math.floor(cellIndex / cellCountInDay);
const realHiddenInterval = dayIndex * this.hiddenInterval;
return interval * cellIndex + realHiddenInterval
}
getTimeOffsetByColumnIndex(columnIndex, firstDayOfWeek, columnCount, intervalCount) {
const firstDayOfWeekDiff = Math.max(0, firstDayOfWeek - 1);
const columnsInWeek = columnCount / intervalCount;
const weekendCount = Math.floor((columnIndex + firstDayOfWeekDiff) / columnsInWeek);
return 2 * weekendCount * toMs("day")
}
calculateEndDate(startDate, interval, endDayHour) {
return this.getCellEndDate(startDate, {
interval: interval
})
}
_calculateCellIndex(rowIndex, columnIndex, rowCount, columnCountBase) {
return (0, _index.calculateCellIndex)(rowIndex, columnIndex, rowCount)
}
generateGroupedDataMap(viewDataMap) {
const {
allDayPanelMap: allDayPanelMap,
dateTableMap: dateTableMap
} = viewDataMap;
const {
previousGroupedDataMap: dateTableGroupedMap
} = dateTableMap.reduce(((previousOptions, cellsRow) => {
const {
previousGroupedDataMap: previousGroupedDataMap,
previousRowIndex: previousRowIndex,
previousGroupIndex: previousGroupIndex
} = previousOptions;
const {
groupIndex: currentGroupIndex
} = cellsRow[0].cellData;
const currentRowIndex = currentGroupIndex === previousGroupIndex ? previousRowIndex + 1 : 0;
cellsRow.forEach((cell => {
const {
groupIndex: groupIndex
} = cell.cellData;
if (!previousGroupedDataMap[groupIndex]) {
previousGroupedDataMap[groupIndex] = []
}
if (!previousGroupedDataMap[groupIndex][currentRowIndex]) {
previousGroupedDataMap[groupIndex][currentRowIndex] = []
}
previousGroupedDataMap[groupIndex][currentRowIndex].push(cell)
}));
return {
previousGroupedDataMap: previousGroupedDataMap,
previousRowIndex: currentRowIndex,
previousGroupIndex: currentGroupIndex
}
}), {
previousGroupedDataMap: [],
previousRowIndex: -1,
previousGroupIndex: -1
});
const allDayPanelGroupedMap = [];
null === allDayPanelMap || void 0 === allDayPanelMap || allDayPanelMap.forEach((cell => {
const {
groupIndex: groupIndex
} = cell.cellData;
if (!allDayPanelGroupedMap[groupIndex]) {
allDayPanelGroupedMap[groupIndex] = []
}
allDayPanelGroupedMap[groupIndex].push(cell)
}));
return {
allDayPanelGroupedMap: allDayPanelGroupedMap,
dateTableGroupedMap: dateTableGroupedMap
}
}
_isFirstGroupCell(rowIndex, columnIndex, options, rowCount, columnCount) {
const {
groupOrientation: groupOrientation,
groups: groups,
isGroupedByDate: isGroupedByDate
} = options;
const groupCount = (0, _index.getGroupCount)(groups);
if (isGroupedByDate) {
return columnIndex % groupCount === 0
}
if (groupOrientation === _m_constants.HORIZONTAL_GROUP_ORIENTATION) {
return columnIndex % columnCount === 0
}
return rowIndex % rowCount === 0
}
_isLastGroupCell(rowIndex, columnIndex, options, rowCount, columnCount) {
const {
groupOrientation: groupOrientation,
groups: groups,
isGroupedByDate: isGroupedByDate
} = options;
const groupCount = (0, _index.getGroupCount)(groups);
if (isGroupedByDate) {
return (columnIndex + 1) % groupCount === 0
}
if (groupOrientation === _m_constants.HORIZONTAL_GROUP_ORIENTATION) {
return (columnIndex + 1) % columnCount === 0
}
return (rowIndex + 1) % rowCount === 0
}
markSelectedAndFocusedCells(viewDataMap, renderOptions) {
const {
selectedCells: selectedCells,
focusedCell: focusedCell
} = renderOptions;
if (!selectedCells && !focusedCell) {
return viewDataMap
}
const {
allDayPanelMap: allDayPanelMap,
dateTableMap: dateTableMap
} = viewDataMap;
const nextDateTableMap = dateTableMap.map((row => this._markSelectedAndFocusedCellsInRow(row, selectedCells, focusedCell)));
const nextAllDayMap = this._markSelectedAndFocusedCellsInRow(allDayPanelMap, selectedCells, focusedCell);
return {
allDayPanelMap: nextAllDayMap,
dateTableMap: nextDateTableMap
}
}
_markSelectedAndFocusedCellsInRow(dataRow, selectedCells, focusedCell) {
return dataRow.map((cell => {
const {
index: index,
groupIndex: groupIndex,
allDay: allDay,
startDate: startDate
} = cell.cellData;
const indexInSelectedCells = selectedCells.findIndex((_ref5 => {
let {
index: selectedCellIndex,
groupIndex: selectedCellGroupIndex,
allDay: selectedCellAllDay,
startDate: selectedCellStartDate
} = _ref5;
return groupIndex === selectedCellGroupIndex && (index === selectedCellIndex || void 0 === selectedCellIndex && startDate.getTime() === selectedCellStartDate.getTime()) && !!allDay === !!selectedCellAllDay
}));
const isFocused = !!focusedCell && index === focusedCell.cellData.index && groupIndex === focusedCell.cellData.groupIndex && allDay === focusedCell.cellData.allDay;
if (!isFocused && -1 === indexInSelectedCells) {
return cell
}
return _extends({}, cell, {
cellData: _extends({}, cell.cellData, {
isSelected: indexInSelectedCells > -1,
isFocused: isFocused
})
})
}))
}
getInterval(hoursInterval) {
return hoursInterval * toMs("hour")
}
_getIntervalDuration(intervalCount) {
return toMs("day") * intervalCount
}
_setVisibilityDates(options) {}
getCellCountInDay(startDayHour, endDayHour, hoursInterval) {
const result = (0, _index.calculateDayDuration)(startDayHour, endDayHour) / hoursInterval;
return Math.ceil(result)
}
getCellCount(options) {
const {
intervalCount: intervalCount,
viewType: viewType,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval
} = options;
const cellCountInDay = this.getCellCountInDay(startDayHour, endDayHour, hoursInterval);
const columnCountInDay = (0, _index.isHorizontalView)(viewType) ? cellCountInDay : 1;
return this.daysInInterval * intervalCount * columnCountInDay
}
getRowCount(options) {
const {
viewType: viewType,
startDayHour: startDayHour,
endDayHour: endDayHour,
hoursInterval: hoursInterval
} = options;
const cellCountInDay = this.getCellCountInDay(startDayHour, endDayHour, hoursInterval);
const rowCountInDay = !(0, _index.isHorizontalView)(viewType) ? cellCountInDay : 1;
return rowCountInDay
}
setHiddenInterval(startDayHour, endDayHour, hoursInterval) {
this.hiddenInterval = toMs("day") - this.getVisibleDayDuration(startDayHour, endDayHour, hoursInterval)
}
getVisibleDayDuration(startDayHour, endDayHour, hoursInterval) {
const cellCountInDay = this.getCellCountInDay(startDayHour, endDayHour, hoursInterval);
return hoursInterval * cellCountInDay * toMs("hour")
}
getFirstDayOfWeek(firstDayOfWeekOption) {
return firstDayOfWeekOption
}
getCellEndDate(cellStartDate, options) {
const durationMs = Math.round(options.interval);
return _m_utils_time_zone.default.addOffsetsWithoutDST(cellStartDate, durationMs)
}
}
},
54947:
/*!*********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_day.js ***!
\*********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewDataGeneratorDay = void 0;
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407);
class ViewDataGeneratorDay extends _m_view_data_generator.ViewDataGenerator {
_calculateStartViewDate(options) {
return _index.dayUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, this._getIntervalDuration(options.intervalCount))
}
}
exports.ViewDataGeneratorDay = ViewDataGeneratorDay
},
24562:
/*!***********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_month.js ***!
\***********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewDataGeneratorMonth = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500));
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
var _m_utils = __webpack_require__( /*! ./m_utils */ 29964);
var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date.default.dateToMilliseconds;
class ViewDataGeneratorMonth extends _m_view_data_generator.ViewDataGenerator {
constructor() {
super(...arguments);
this.tableAllDay = void 0
}
getCellData(rowIndex, columnIndex, options, allDay) {
const {
indicatorTime: indicatorTime,
timeZoneCalculator: timeZoneCalculator,
intervalCount: intervalCount,
viewOffset: viewOffset
} = options;
const data = super.getCellData(rowIndex, columnIndex, options, false);
const startDate = _m_utils_time_zone.default.addOffsetsWithoutDST(data.startDate, -viewOffset);
data.today = this.isCurrentDate(startDate, indicatorTime, timeZoneCalculator);
data.otherMonth = this.isOtherMonth(startDate, this._minVisibleDate, this._maxVisibleDate);
data.firstDayOfMonth = (0, _index.isFirstCellInMonthWithIntervalCount)(startDate, intervalCount);
data.text = _index.monthUtils.getCellText(startDate, intervalCount);
return data
}
isCurrentDate(date, indicatorTime, timeZoneCalculator) {
return _date.default.sameDate(date, (0, _index.getToday)(indicatorTime, timeZoneCalculator))
}
isOtherMonth(cellDate, minDate, maxDate) {
return !_date.default.dateInRange(cellDate, minDate, maxDate, "date")
}
_calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount) {
return _index.monthUtils.calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount)
}
calculateEndDate(startDate, interval, endDayHour) {
return (0, _index.setOptionHour)(startDate, endDayHour)
}
getInterval() {
return toMs("day")
}
_calculateStartViewDate(options) {
return _index.monthUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, options.intervalCount, this.getFirstDayOfWeek(options.firstDayOfWeek))
}
_setVisibilityDates(options) {
const {
intervalCount: intervalCount,
startDate: startDate,
currentDate: currentDate
} = options;
const firstMonthDate = _date.default.getFirstMonthDate(startDate);
const viewStart = _index.monthUtils.getViewStartByOptions(startDate, currentDate, intervalCount, firstMonthDate);
this._minVisibleDate = new Date(viewStart.setDate(1));
const nextMonthDate = new Date(viewStart.setMonth(viewStart.getMonth() + intervalCount));
this._maxVisibleDate = new Date(nextMonthDate.setDate(0))
}
getCellCount() {
return 7
}
getRowCount(options) {
const startDate = new Date(options.currentDate);
startDate.setDate(1);
const endDate = new Date(startDate);
endDate.setMonth(endDate.getMonth() + options.intervalCount);
endDate.setDate(0);
return (0, _m_utils.calculateAlignedWeeksBetweenDates)(startDate, endDate, options.firstDayOfWeek ?? _date2.default.firstDayOfWeekIndex())
}
getCellCountInDay() {
return 1
}
setHiddenInterval() {
this.hiddenInterval = 0
}
getCellEndDate(cellStartDate, options) {
const {
startDayHour: startDayHour,
endDayHour: endDayHour
} = options;
const durationMs = (endDayHour - startDayHour) * toMs("hour");
return _m_utils_time_zone.default.addOffsetsWithoutDST(cellStartDate, durationMs)
}
}
exports.ViewDataGeneratorMonth = ViewDataGeneratorMonth
},
49738:
/*!********************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_timeline_month.js ***!
\********************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewDataGeneratorTimelineMonth = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const toMs = _date.default.dateToMilliseconds;
class ViewDataGeneratorTimelineMonth extends _m_view_data_generator.ViewDataGenerator {
_calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount) {
return _index.monthUtils.calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount)
}
calculateEndDate(startDate, interval, endDayHour) {
return (0, _index.setOptionHour)(startDate, endDayHour)
}
getInterval() {
return toMs("day")
}
_calculateStartViewDate(options) {
return _index.timelineMonthUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, options.intervalCount)
}
getCellCount(options) {
const {
intervalCount: intervalCount
} = options;
const currentDate = new Date(options.currentDate);
let cellCount = 0;
for (let i = 1; i <= intervalCount; i++) {
cellCount += new Date(currentDate.getFullYear(), currentDate.getMonth() + i, 0).getDate()
}
return cellCount
}
setHiddenInterval() {
this.hiddenInterval = 0
}
getCellEndDate(cellStartDate, options) {
const {
startDayHour: startDayHour,
endDayHour: endDayHour
} = options;
const durationMs = (endDayHour - startDayHour) * toMs("hour");
return _m_utils_time_zone.default.addOffsetsWithoutDST(cellStartDate, durationMs)
}
}
exports.ViewDataGeneratorTimelineMonth = ViewDataGeneratorTimelineMonth
},
98097:
/*!**********************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_week.js ***!
\**********************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewDataGeneratorWeek = void 0;
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407);
class ViewDataGeneratorWeek extends _m_view_data_generator.ViewDataGenerator {
constructor() {
super(...arguments);
this.daysInInterval = 7
}
_getIntervalDuration(intervalCount) {
return _index.weekUtils.getIntervalDuration(intervalCount)
}
_calculateStartViewDate(options) {
return _index.weekUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, this._getIntervalDuration(options.intervalCount), this.getFirstDayOfWeek(options.firstDayOfWeek))
}
}
exports.ViewDataGeneratorWeek = ViewDataGeneratorWeek
},
4277:
/*!***************************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_work_week.js ***!
\***************************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewDataGeneratorWorkWeek = void 0;
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_view_data_generator_week = __webpack_require__( /*! ./m_view_data_generator_week */ 98097);
class ViewDataGeneratorWorkWeek extends _m_view_data_generator_week.ViewDataGeneratorWeek {
constructor() {
super(...arguments);
this.daysInInterval = 5;
this.isWorkView = true
}
isSkippedDate(date) {
return (0, _index.isDataOnWeekend)(date)
}
_calculateStartViewDate(options) {
return _index.workWeekUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, this._getIntervalDuration(options.intervalCount), this.getFirstDayOfWeek(options.firstDayOfWeek))
}
getFirstDayOfWeek(firstDayOfWeekOption) {
return firstDayOfWeekOption || 0
}
}
exports.ViewDataGeneratorWorkWeek = ViewDataGeneratorWorkWeek
},
52974:
/*!****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_provider.js ***!
\****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198));
var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321);
var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084);
var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880));
var _m_date_header_data_generator = __webpack_require__( /*! ./m_date_header_data_generator */ 11706);
var _m_grouped_data_map_provider = __webpack_require__( /*! ./m_grouped_data_map_provider */ 69033);
var _m_time_panel_data_generator = __webpack_require__( /*! ./m_time_panel_data_generator */ 45512);
var _m_utils = __webpack_require__( /*! ./m_utils */ 29964);
const _excluded = ["groups", "groupOrientation", "groupByDate", "isAllDayPanelVisible", "viewOffset"];
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
exports.default = class {
constructor(viewType) {
this.viewType = viewType;
this.viewDataGenerator = (0, _m_utils.getViewDataGeneratorByViewType)(viewType);
this.viewData = {};
this.completeViewDataMap = [];
this.completeDateHeaderMap = [];
this.viewDataMap = {};
this._groupedDataMapProvider = null
}
get groupedDataMap() {
return this._groupedDataMapProvider.groupedDataMap
}
get hiddenInterval() {
return this.viewDataGenerator.hiddenInterval
}
isSkippedDate(date) {
return this.viewDataGenerator.isSkippedDate(date)
}
update(options, isGenerateNewViewData) {
this.viewDataGenerator = (0, _m_utils.getViewDataGeneratorByViewType)(options.viewType);
const {
viewDataGenerator: viewDataGenerator
} = this;
const dateHeaderDataGenerator = new _m_date_header_data_generator.DateHeaderDataGenerator(viewDataGenerator);
const timePanelDataGenerator = new _m_time_panel_data_generator.TimePanelDataGenerator(viewDataGenerator);
const renderOptions = this._transformRenderOptions(options);
renderOptions.interval = this.viewDataGenerator.getInterval(renderOptions.hoursInterval);
this._options = renderOptions;
if (isGenerateNewViewData) {
this.completeViewDataMap = viewDataGenerator.getCompleteViewDataMap(renderOptions);
this.completeDateHeaderMap = dateHeaderDataGenerator.getCompleteDateHeaderMap(renderOptions, this.completeViewDataMap);
if (renderOptions.isGenerateTimePanelData) {
this.completeTimePanelMap = timePanelDataGenerator.getCompleteTimePanelMap(renderOptions, this.completeViewDataMap)
}
}
this.viewDataMap = viewDataGenerator.generateViewDataMap(this.completeViewDataMap, renderOptions);
this.updateViewData(renderOptions);
this._groupedDataMapProvider = new _m_grouped_data_map_provider.GroupedDataMapProvider(this.viewDataGenerator, this.viewDataMap, this.completeViewDataMap, {
isVerticalGrouping: renderOptions.isVerticalGrouping,
viewType: renderOptions.viewType,
viewOffset: options.viewOffset
});
this.dateHeaderData = dateHeaderDataGenerator.generateDateHeaderData(this.completeDateHeaderMap, this.completeViewDataMap, renderOptions);
if (renderOptions.isGenerateTimePanelData) {
this.timePanelData = timePanelDataGenerator.generateTimePanelData(this.completeTimePanelMap, renderOptions)
}
}
createGroupedDataMapProvider() {
this._groupedDataMapProvider = new _m_grouped_data_map_provider.GroupedDataMapProvider(this.viewDataGenerator, this.viewDataMap, this.completeViewDataMap, {
isVerticalGrouping: this._options.isVerticalGrouping,
viewType: this._options.viewType
})
}
updateViewData(options) {
const renderOptions = this._transformRenderOptions(options);
this.viewDataMapWithSelection = this.viewDataGenerator.markSelectedAndFocusedCells(this.viewDataMap, renderOptions);
this.viewData = this.viewDataGenerator.getViewDataFromMap(this.completeViewDataMap, this.viewDataMapWithSelection, renderOptions)
}
_transformRenderOptions(renderOptions) {
const {
groups: groups,
groupOrientation: groupOrientation,
groupByDate: groupByDate,
isAllDayPanelVisible: isAllDayPanelVisible,
viewOffset: viewOffset
} = renderOptions, restOptions = function(source, excluded) {
if (null == source) {
return {}
}
var target = {};
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (excluded.indexOf(key) >= 0) {
continue
}
target[key] = source[key]
}
}
return target
}(renderOptions, _excluded);
return _extends({}, restOptions, {
startViewDate: this.viewDataGenerator._calculateStartViewDate(renderOptions),
isVerticalGrouping: (0, _index.isVerticalGroupingApplied)(groups, groupOrientation),
isHorizontalGrouping: (0, _index.isHorizontalGroupingApplied)(groups, groupOrientation),
isGroupedByDate: (0, _index.isGroupingByDate)(groups, groupOrientation, groupByDate),
isGroupedAllDayPanel: (0, _index.calculateIsGroupedAllDayPanel)(groups, groupOrientation, isAllDayPanelVisible),
groups: groups,
groupOrientation: groupOrientation,
isAllDayPanelVisible: isAllDayPanelVisible,
viewOffset: viewOffset
})
}
getGroupPanelData(options) {
const renderOptions = this._transformRenderOptions(options);
if (renderOptions.groups.length > 0) {
const cellCount = this.getCellCount(renderOptions);
return (0, _index.getGroupPanelData)(renderOptions.groups, cellCount, renderOptions.isGroupedByDate, renderOptions.isGroupedByDate ? 1 : cellCount)
}
return
}
getGroupStartDate(groupIndex) {
return this._groupedDataMapProvider.getGroupStartDate(groupIndex)
}
getGroupEndDate(groupIndex) {
return this._groupedDataMapProvider.getGroupEndDate(groupIndex)
}
findGroupCellStartDate(groupIndex, startDate, endDate) {
let isFindByDate = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : false;
return this._groupedDataMapProvider.findGroupCellStartDate(groupIndex, startDate, endDate, isFindByDate)
}
findAllDayGroupCellStartDate(groupIndex) {
return this._groupedDataMapProvider.findAllDayGroupCellStartDate(groupIndex)
}
findCellPositionInMap(cellInfo) {
let isAppointmentRender = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
return this._groupedDataMapProvider.findCellPositionInMap(cellInfo, isAppointmentRender)
}
hasAllDayPanel() {
const {
viewData: viewData
} = this.viewDataMap;
const {
allDayPanel: allDayPanel
} = viewData.groupedData[0];
return !viewData.isGroupedAllDayPanel && (null === allDayPanel || void 0 === allDayPanel ? void 0 : allDayPanel.length) > 0
}
getCellsGroup(groupIndex) {
return this._groupedDataMapProvider.getCellsGroup(groupIndex)
}
getCompletedGroupsInfo() {
return this._groupedDataMapProvider.getCompletedGroupsInfo()
}
getGroupIndices() {
return this._groupedDataMapProvider.getGroupIndices()
}
getLastGroupCellPosition(groupIndex) {
return this._groupedDataMapProvider.getLastGroupCellPosition(groupIndex)
}
getRowCountInGroup(groupIndex) {
return this._groupedDataMapProvider.getRowCountInGroup(groupIndex)
}
getCellData(rowIndex, columnIndex, isAllDay, rtlEnabled) {
const row = isAllDay && !this._options.isVerticalGrouping ? this.viewDataMap.allDayPanelMap : this.viewDataMap.dateTableMap[rowIndex];
const actualColumnIndex = !rtlEnabled ? columnIndex : row.length - 1 - columnIndex;
const {
cellData: cellData
} = row[actualColumnIndex];
return cellData
}
getCellsByGroupIndexAndAllDay(groupIndex, allDay) {
const rowsPerGroup = this._getRowCountWithAllDayRows();
const isShowAllDayPanel = this._options.isAllDayPanelVisible;
const firstRowInGroup = this._options.isVerticalGrouping ? groupIndex * rowsPerGroup : 0;
const lastRowInGroup = this._options.isVerticalGrouping ? (groupIndex + 1) * rowsPerGroup - 1 : rowsPerGroup;
const correctedFirstRow = isShowAllDayPanel && !allDay ? firstRowInGroup + 1 : firstRowInGroup;
const correctedLastRow = allDay ? correctedFirstRow : lastRowInGroup;
return this.completeViewDataMap.slice(correctedFirstRow, correctedLastRow + 1).map((row => row.filter((_ref => {
let {
groupIndex: currentGroupIndex
} = _ref;
return groupIndex === currentGroupIndex
}))))
}
getCellCountWithGroup(groupIndex) {
let rowIndex = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
const {
dateTableGroupedMap: dateTableGroupedMap
} = this.groupedDataMap;
return dateTableGroupedMap.filter(((_, index) => index <= groupIndex)).reduce(((previous, row) => previous + row[rowIndex].length), 0)
}
hasGroupAllDayPanel(groupIndex) {
var _this$groupedDataMap$2;
if (this._options.isVerticalGrouping) {
var _this$groupedDataMap$;
return !!(null !== (_this$groupedDataMap$ = this.groupedDataMap.dateTableGroupedMap[groupIndex]) && void 0 !== _this$groupedDataMap$ && _this$groupedDataMap$[0][0].cellData.allDay)
}
return (null === (_this$groupedDataMap$2 = this.groupedDataMap.allDayPanelGroupedMap[groupIndex]) || void 0 === _this$groupedDataMap$2 ? void 0 : _this$groupedDataMap$2.length) > 0
}
isGroupIntersectDateInterval(groupIndex, startDate, endDate) {
const groupStartDate = this.getGroupStartDate(groupIndex);
const groupEndDate = this.getGroupEndDate(groupIndex);
return startDate < groupEndDate && endDate > groupStartDate
}
findGlobalCellPosition(date) {
let groupIndex = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
let allDay = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false;
const {
completeViewDataMap: completeViewDataMap
} = this;
const showAllDayPanel = this._options.isAllDayPanelVisible;
for (let rowIndex = 0; rowIndex < completeViewDataMap.length; rowIndex += 1) {
const currentRow = completeViewDataMap[rowIndex];
for (let columnIndex = 0; columnIndex < currentRow.length; columnIndex += 1) {
const cellData = currentRow[columnIndex];
const {
startDate: currentStartDate,
endDate: currentEndDate,
groupIndex: currentGroupIndex,
allDay: currentAllDay
} = cellData;
if (groupIndex === currentGroupIndex && allDay === !!currentAllDay && this._compareDatesAndAllDay(date, currentStartDate, currentEndDate, allDay)) {
return {
position: {
columnIndex: columnIndex,
rowIndex: showAllDayPanel && !this._options.isVerticalGrouping ? rowIndex - 1 : rowIndex
},
cellData: cellData
}
}
}
}
return
}
_compareDatesAndAllDay(date, cellStartDate, cellEndDate, allDay) {
return allDay ? _date.default.sameDate(date, cellStartDate) : date >= cellStartDate && date < cellEndDate
}
getSkippedDaysCount(groupIndex, startDate, endDate, daysCount) {
const {
dateTableGroupedMap: dateTableGroupedMap
} = this._groupedDataMapProvider.groupedDataMap;
const groupedData = dateTableGroupedMap[groupIndex];
let includedDays = 0;
for (let rowIndex = 0; rowIndex < groupedData.length; rowIndex += 1) {
for (let columnIndex = 0; columnIndex < groupedData[rowIndex].length; columnIndex += 1) {
const cell = groupedData[rowIndex][columnIndex].cellData;
if (startDate.getTime() < cell.endDate.getTime() && endDate.getTime() > cell.startDate.getTime()) {
includedDays += 1
}
}
}
const lastCell = groupedData[groupedData.length - 1][groupedData[0].length - 1].cellData;
const lastCellStart = _date.default.trimTime(lastCell.startDate);
const daysAfterView = Math.floor((endDate.getTime() - lastCellStart.getTime()) / _date.default.dateToMilliseconds("day"));
const deltaDays = daysAfterView > 0 ? daysAfterView : 0;
return daysCount - includedDays - deltaDays
}
getColumnsCount() {
const {
dateTableMap: dateTableMap
} = this.viewDataMap;
return dateTableMap ? dateTableMap[0].length : 0
}
getViewEdgeIndices(isAllDayPanel) {
if (isAllDayPanel) {
return {
firstColumnIndex: 0,
lastColumnIndex: this.viewDataMap.allDayPanelMap.length - 1,
firstRowIndex: 0,
lastRowIndex: 0
}
}
return {
firstColumnIndex: 0,
lastColumnIndex: this.viewDataMap.dateTableMap[0].length - 1,
firstRowIndex: 0,
lastRowIndex: this.viewDataMap.dateTableMap.length - 1
}
}
getGroupEdgeIndices(groupIndex, isAllDay) {
const groupedDataMap = this.groupedDataMap.dateTableGroupedMap[groupIndex];
const cellsCount = groupedDataMap[0].length;
const rowsCount = groupedDataMap.length;
const firstColumnIndex = groupedDataMap[0][0].position.columnIndex;
const lastColumnIndex = groupedDataMap[0][cellsCount - 1].position.columnIndex;
if (isAllDay) {
return {
firstColumnIndex: firstColumnIndex,
lastColumnIndex: lastColumnIndex,
firstRowIndex: 0,
lastRowIndex: 0
}
}
return {
firstColumnIndex: firstColumnIndex,
lastColumnIndex: lastColumnIndex,
firstRowIndex: groupedDataMap[0][0].position.rowIndex,
lastRowIndex: groupedDataMap[rowsCount - 1][0].position.rowIndex
}
}
isSameCell(firstCellData, secondCellData) {
const {
startDate: firstStartDate,
groupIndex: firstGroupIndex,
allDay: firstAllDay,
index: firstIndex
} = firstCellData;
const {
startDate: secondStartDate,
groupIndex: secondGroupIndex,
allDay: secondAllDay,
index: secondIndex
} = secondCellData;
return firstStartDate.getTime() === secondStartDate.getTime() && firstGroupIndex === secondGroupIndex && firstAllDay === secondAllDay && firstIndex === secondIndex
}
getLastViewDate() {
const {
completeViewDataMap: completeViewDataMap
} = this;
const rowsCount = completeViewDataMap.length - 1;
return completeViewDataMap[rowsCount][completeViewDataMap[rowsCount].length - 1].endDate
}
getStartViewDate() {
return this._options.startViewDate
}
getIntervalDuration(intervalCount) {
return this.viewDataGenerator._getIntervalDuration(intervalCount)
}
getLastCellEndDate() {
const lastEndDate = new Date(this.getLastViewDate().getTime() - _date.default.dateToMilliseconds("minute"));
return _date2.dateUtilsTs.addOffsets(lastEndDate, [-this._options.viewOffset])
}
getLastViewDateByEndDayHour(endDayHour) {
const lastCellEndDate = this.getLastCellEndDate();
const endTime = _date.default.dateTimeFromDecimal(endDayHour);
const endDateOfLastViewCell = new Date(lastCellEndDate.setHours(endTime.hours, endTime.minutes));
return this._adjustEndDateByDaylightDiff(lastCellEndDate, endDateOfLastViewCell)
}
_adjustEndDateByDaylightDiff(startDate, endDate) {
const daylightDiff = _m_utils_time_zone.default.getDaylightOffsetInMs(startDate, endDate);
const endDateOfLastViewCell = new Date(endDate.getTime() - daylightDiff);
return new Date(endDateOfLastViewCell.getTime() - _date.default.dateToMilliseconds("minute"))
}
getCellCountInDay(startDayHour, endDayHour, hoursInterval) {
return this.viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval)
}
getCellCount(options) {
return this.viewDataGenerator.getCellCount(options)
}
getRowCount(options) {
return this.viewDataGenerator.getRowCount(options)
}
getVisibleDayDuration(startDayHour, endDayHour, hoursInterval) {
return this.viewDataGenerator.getVisibleDayDuration(startDayHour, endDayHour, hoursInterval)
}
_getRowCountWithAllDayRows() {
const allDayRowCount = this._options.isAllDayPanelVisible ? 1 : 0;
return this.getRowCount(this._options) + allDayRowCount
}
getFirstDayOfWeek(firstDayOfWeekOption) {
return this.viewDataGenerator.getFirstDayOfWeek(firstDayOfWeekOption)
}
setViewOptions(options) {
this._options = this._transformRenderOptions(options)
}
getViewOptions() {
return this._options
}
getViewPortGroupCount() {
const {
dateTableGroupedMap: dateTableGroupedMap
} = this.groupedDataMap;
return (null === dateTableGroupedMap || void 0 === dateTableGroupedMap ? void 0 : dateTableGroupedMap.length) || 0
}
getCellsBetween(first, last) {
const [firstCell, lastCell] = this.normalizeCellsOrder(first, last);
const {
index: firstIdx
} = firstCell;
const {
index: lastIdx
} = lastCell;
const cellMatrix = this.getCellsByGroupIndexAndAllDay(firstCell.groupIndex ?? 0, lastCell.allDay ?? false);
return (0, _index.isHorizontalView)(this.viewType) ? this.getCellsBetweenHorizontalView(cellMatrix, firstIdx, lastIdx) : this.getCellsBetweenVerticalView(cellMatrix, firstIdx, lastIdx)
}
getCellsBetweenHorizontalView(cellMatrix, firstIdx, lastIdx) {
return cellMatrix.reduce(((result, row) => result.concat(row.filter((_ref2 => {
let {
index: index
} = _ref2;
return firstIdx <= index && index <= lastIdx
})))), [])
}
getCellsBetweenVerticalView(cellMatrix, firstIdx, lastIdx) {
var _cellMatrix$;
const result = [];
const matrixHeight = cellMatrix.length;
const matrixWidth = (null === (_cellMatrix$ = cellMatrix[0]) || void 0 === _cellMatrix$ ? void 0 : _cellMatrix$.length) ?? 0;
let inSegment = false;
for (let columnIdx = 0; columnIdx < matrixWidth; columnIdx += 1) {
for (let rowIdx = 0; rowIdx < matrixHeight; rowIdx += 1) {
const cell = cellMatrix[rowIdx][columnIdx];
const {
index: cellIdx
} = cell;
if (cellIdx === firstIdx) {
inSegment = true
}
if (inSegment) {
result.push(cell)
}
if (cellIdx === lastIdx) {
return result
}
}
}
return result
}
normalizeCellsOrder(firstSelectedCell, lastSelectedCell) {
return firstSelectedCell.startDate > lastSelectedCell.startDate ? [lastSelectedCell, firstSelectedCell] : [firstSelectedCell, lastSelectedCell]
}
}
},
69505:
/*!********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.base_view.js ***!
\********************************************************************************************/
function(__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 */ 73349));
var _element = __webpack_require__( /*! ../../../core/element */ 6415);
var _element_data = __webpack_require__( /*! ../../../core/element_data */ 97906);
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _click = __webpack_require__( /*! ../../../events/click */ 95429);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _hover = __webpack_require__( /*! ../../../events/hover */ 24028);
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const {
abstract: abstract
} = _ui.default;
const CALENDAR_DXCLICK_EVENT_NAME = (0, _index.addNamespace)(_click.name, "dxCalendar");
const CALENDAR_DXHOVERSTART_EVENT_NAME = (0, _index.addNamespace)(_hover.start, "dxCalendar");
const CURRENT_DATE_TEXT = {
month: _message.default.format("dxCalendar-currentDay"),
year: _message.default.format("dxCalendar-currentMonth"),
decade: _message.default.format("dxCalendar-currentYear"),
century: _message.default.format("dxCalendar-currentYearRange")
};
const SELECTION_MODE_single = "single",
SELECTION_MODE_multiple = "multiple",
SELECTION_MODE_range = "range";
const BaseView = _ui.default.inherit({
_getViewName: () => "base",
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
date: new Date,
focusStateEnabled: false,
cellTemplate: null,
disabledDates: null,
onCellClick: null,
onCellHover: null,
onWeekNumberClick: null,
rowCount: 3,
colCount: 4,
allowValueSelection: true,
_todayDate: () => new Date
})
},
_initMarkup() {
this.callBase();
this._renderImpl()
},
_renderImpl() {
this.$element().append(this._createTable());
this._createDisabledDatesHandler();
this._renderBody();
this._renderContouredDate();
this._renderValue();
this._renderRange();
this._renderEvents();
this._updateTableAriaLabel()
},
_getLocalizedWidgetName() {
const localizedWidgetName = _message.default.format("dxCalendar-ariaWidgetName");
return localizedWidgetName
},
_getSingleModeAriaLabel() {
const {
value: value
} = this.option();
const localizedWidgetName = this._getLocalizedWidgetName();
const formattedDate = _date2.default.format(value, "date");
const selectedDatesText = _message.default.format("dxCalendar-selectedDate", formattedDate);
const ariaLabel = `${localizedWidgetName}. ${selectedDatesText}`;
return ariaLabel
},
_getRangeModeAriaLabel() {
const {
value: value
} = this.option();
const localizedWidgetName = this._getLocalizedWidgetName();
const [startDate, endDate] = value;
const formattedStartDate = _date2.default.format(startDate, "date");
const formattedEndDate = _date2.default.format(endDate, "date");
const selectedDatesText = startDate && endDate ? _message.default.format("dxCalendar-selectedDateRange", formattedStartDate, formattedEndDate) : _message.default.format("dxCalendar-selectedDate", formattedStartDate ?? formattedEndDate);
const ariaLabel = `${localizedWidgetName}. ${selectedDatesText}`;
return ariaLabel
},
_getMultipleModeAriaLabel() {
const ariaLabel = this._getLocalizedWidgetName();
return ariaLabel
},
_getTableAriaLabel() {
const {
value: value,
selectionMode: selectionMode
} = this.option();
const isValueEmpty = !value || Array.isArray(value) && !value.filter(Boolean).length;
if (isValueEmpty) {
return this._getLocalizedWidgetName()
}
switch (selectionMode) {
case SELECTION_MODE_single:
return this._getSingleModeAriaLabel();
case SELECTION_MODE_range:
return this._getRangeModeAriaLabel();
case SELECTION_MODE_multiple:
return this._getMultipleModeAriaLabel()
}
},
_updateTableAriaLabel() {
const label = this._getTableAriaLabel();
this.setAria({
label: label
}, this._$table)
},
_createTable() {
this._$table = (0, _renderer.default)(" ");
this.setAria({
role: "grid"
}, this._$table);
return this._$table
},
_renderBody() {
this.$body = (0, _renderer.default)("").appendTo(this._$table);
const rowData = {
cellDate: this._getFirstCellData(),
prevCellDate: null
};
for (let rowIndex = 0, rowCount = this.option("rowCount"); rowIndex < rowCount; rowIndex++) {
rowData.row = this._createRow();
for (let colIndex = 0, colCount = this.option("colCount"); colIndex < colCount; colIndex++) {
this._renderCell(rowData, colIndex)
}
this._renderWeekNumberCell(rowData)
}
},
_createRow() {
const row = _dom_adapter.default.createElement("tr");
this.setAria("role", "row", (0, _renderer.default)(row));
this.$body.get(0).appendChild(row);
return row
},
_createCell(cellDate, cellIndex) {
const cell = _dom_adapter.default.createElement("td");
const $cell = (0, _renderer.default)(cell);
cell.className = this._getClassNameByDate(cellDate, cellIndex);
cell.setAttribute("data-value", _date_serialization.default.serializeDate(cellDate, _date.default.getShortDateFormat()));
(0, _element_data.data)(cell, "dxDateValueKey", cellDate);
this.setAria({
role: "gridcell",
selected: false,
label: this.getCellAriaLabel(cellDate)
}, $cell);
return {
cell: cell,
$cell: $cell
}
},
_renderCell(params, cellIndex) {
const {
cellDate: cellDate,
prevCellDate: prevCellDate,
row: row
} = params;
if (prevCellDate) {
_date.default.fixTimezoneGap(prevCellDate, cellDate)
}
params.prevCellDate = cellDate;
const {
cell: cell,
$cell: $cell
} = this._createCell(cellDate, cellIndex);
const cellTemplate = this.option("cellTemplate");
(0, _renderer.default)(row).append(cell);
if (cellTemplate) {
cellTemplate.render(this._prepareCellTemplateData(cellDate, cellIndex, $cell))
} else {
cell.innerHTML = this._getCellText(cellDate)
}
params.cellDate = this._getNextCellData(cellDate)
},
_getClassNameByDate(cellDate, cellIndex) {
let className = "dx-calendar-cell";
if (this._isTodayCell(cellDate)) {
className += " dx-calendar-today"
}
if (this._isDateOutOfRange(cellDate) || this.isDateDisabled(cellDate)) {
className += " dx-calendar-empty-cell"
}
if (this._isOtherView(cellDate)) {
className += " dx-calendar-other-view"
}
if (this.option("selectionMode") === SELECTION_MODE_range) {
if (0 === cellIndex) {
className += " dx-calendar-cell-start-in-row"
}
if (cellIndex === this.option("colCount") - 1) {
className += " dx-calendar-cell-end-in-row"
}
if (this._isStartDayOfMonth(cellDate)) {
className += " dx-calendar-cell-start"
}
if (this._isEndDayOfMonth(cellDate)) {
className += " dx-calendar-cell-end"
}
}
return className
},
_prepareCellTemplateData(cellDate, cellIndex, $cell) {
const isDateCell = cellDate instanceof Date;
const text = isDateCell ? this._getCellText(cellDate) : cellDate;
const date = isDateCell ? cellDate : void 0;
const view = this._getViewName();
return {
model: {
text: text,
date: date,
view: view
},
container: (0, _element.getPublicElement)($cell),
index: cellIndex
}
},
_renderEvents() {
this._createCellClickAction();
_events_engine.default.off(this._$table, CALENDAR_DXCLICK_EVENT_NAME);
_events_engine.default.on(this._$table, CALENDAR_DXCLICK_EVENT_NAME, "td:not(.dx-calendar-week-number-cell)", (e => {
if (!(0, _renderer.default)(e.currentTarget).hasClass("dx-calendar-empty-cell")) {
this._cellClickAction({
event: e,
value: (0, _renderer.default)(e.currentTarget).data("dxDateValueKey")
})
}
}));
const {
selectionMode: selectionMode
} = this.option();
_events_engine.default.off(this._$table, CALENDAR_DXHOVERSTART_EVENT_NAME);
if (selectionMode === SELECTION_MODE_range) {
this._createCellHoverAction();
_events_engine.default.on(this._$table, CALENDAR_DXHOVERSTART_EVENT_NAME, "td:not(.dx-calendar-week-number-cell)", (e => {
if (!(0, _renderer.default)(e.currentTarget).hasClass("dx-calendar-empty-cell")) {
this._cellHoverAction({
event: e,
value: (0, _renderer.default)(e.currentTarget).data("dxDateValueKey")
})
}
}))
}
if (selectionMode !== SELECTION_MODE_single) {
this._createWeekNumberCellClickAction();
_events_engine.default.on(this._$table, CALENDAR_DXCLICK_EVENT_NAME, ".dx-calendar-week-number-cell", (e => {
const $row = (0, _renderer.default)(e.currentTarget).closest("tr");
const firstDateInRow = $row.find(".dx-calendar-cell").first().data("dxDateValueKey");
const lastDateInRow = $row.find(".dx-calendar-cell").last().data("dxDateValueKey");
const rowDates = [..._date.default.getDatesOfInterval(firstDateInRow, lastDateInRow, 864e5), lastDateInRow];
this._weekNumberCellClickAction({
event: e,
rowDates: rowDates
})
}))
}
},
_createCellClickAction() {
this._cellClickAction = this._createActionByOption("onCellClick")
},
_createCellHoverAction() {
this._cellHoverAction = this._createActionByOption("onCellHover")
},
_createWeekNumberCellClickAction() {
this._weekNumberCellClickAction = this._createActionByOption("onWeekNumberClick")
},
_createDisabledDatesHandler() {
const disabledDates = this.option("disabledDates");
this._disabledDatesHandler = Array.isArray(disabledDates) ? this._getDefaultDisabledDatesHandler(disabledDates) : disabledDates || _common.noop
},
_getDefaultDisabledDatesHandler: () => _common.noop,
_isTodayCell: abstract,
_isDateOutOfRange: abstract,
isDateDisabled(cellDate) {
const dateParts = {
date: cellDate,
view: this._getViewName()
};
return this._disabledDatesHandler(dateParts)
},
_isOtherView: abstract,
_isStartDayOfMonth: abstract,
_isEndDayOfMonth: abstract,
_getCellText: abstract,
_getFirstCellData: abstract,
_getNextCellData: abstract,
_renderContouredDate(contouredDate) {
if (!this.option("focusStateEnabled")) {
return
}
contouredDate = contouredDate || this.option("contouredDate");
const $oldContouredCell = this._getContouredCell();
const $newContouredCell = this._getCellByDate(contouredDate);
$oldContouredCell.removeClass("dx-calendar-contoured-date");
if (contouredDate) {
$newContouredCell.addClass("dx-calendar-contoured-date")
}
},
_getContouredCell() {
return this._$table.find(".dx-calendar-contoured-date")
},
_renderValue() {
if (!this.option("allowValueSelection")) {
return
}
let value = this.option("value");
if (!Array.isArray(value)) {
value = [value]
}
this._updateSelectedClass(value)
},
_updateSelectedClass(value) {
var _this$_$selectedCells;
if (this._isRangeMode() && !this._isMonthView()) {
return
}
null === (_this$_$selectedCells = this._$selectedCells) || void 0 === _this$_$selectedCells || _this$_$selectedCells.forEach(($cell => {
$cell.removeClass("dx-calendar-selected-date")
}));
this._$selectedCells = value.map((value => this._getCellByDate(value)));
this._$selectedCells.forEach(($cell => {
$cell.addClass("dx-calendar-selected-date")
}))
},
_renderRange() {
var _this$_$rangeCells, _this$_$hoveredRangeC, _this$_$rangeStartHov, _this$_$rangeEndHover, _this$_$rangeStartDat, _this$_$rangeEndDateC, _this$_$rangeStartDat2, _this$_$rangeEndDateC2;
const {
allowValueSelection: allowValueSelection,
value: value,
range: range
} = this.option();
if (!allowValueSelection || !this._isRangeMode() || !this._isMonthView()) {
return
}
null === (_this$_$rangeCells = this._$rangeCells) || void 0 === _this$_$rangeCells || _this$_$rangeCells.forEach(($cell => {
$cell.removeClass("dx-calendar-cell-in-range")
}));
null === (_this$_$hoveredRangeC = this._$hoveredRangeCells) || void 0 === _this$_$hoveredRangeC || _this$_$hoveredRangeC.forEach(($cell => {
$cell.removeClass("dx-calendar-cell-range-hover")
}));
null === (_this$_$rangeStartHov = this._$rangeStartHoverCell) || void 0 === _this$_$rangeStartHov || _this$_$rangeStartHov.removeClass("dx-calendar-cell-range-hover-start");
null === (_this$_$rangeEndHover = this._$rangeEndHoverCell) || void 0 === _this$_$rangeEndHover || _this$_$rangeEndHover.removeClass("dx-calendar-cell-range-hover-end");
null === (_this$_$rangeStartDat = this._$rangeStartDateCell) || void 0 === _this$_$rangeStartDat || _this$_$rangeStartDat.removeClass("dx-calendar-range-start-date");
null === (_this$_$rangeEndDateC = this._$rangeEndDateCell) || void 0 === _this$_$rangeEndDateC || _this$_$rangeEndDateC.removeClass("dx-calendar-range-end-date");
this._$rangeCells = range.map((value => this._getCellByDate(value)));
this._$rangeStartDateCell = this._getCellByDate(value[0]);
this._$rangeEndDateCell = this._getCellByDate(value[1]);
this._$rangeCells.forEach(($cell => {
$cell.addClass("dx-calendar-cell-in-range")
}));
null === (_this$_$rangeStartDat2 = this._$rangeStartDateCell) || void 0 === _this$_$rangeStartDat2 || _this$_$rangeStartDat2.addClass("dx-calendar-range-start-date");
null === (_this$_$rangeEndDateC2 = this._$rangeEndDateCell) || void 0 === _this$_$rangeEndDateC2 || _this$_$rangeEndDateC2.addClass("dx-calendar-range-end-date")
},
_renderHoveredRange() {
var _this$_$hoveredRangeC2, _this$_$rangeStartHov2, _this$_$rangeEndHover2, _this$_$rangeStartHov3, _this$_$rangeEndHover3;
const {
allowValueSelection: allowValueSelection,
hoveredRange: hoveredRange
} = this.option();
if (!allowValueSelection || !this._isRangeMode() || !this._isMonthView()) {
return
}
null === (_this$_$hoveredRangeC2 = this._$hoveredRangeCells) || void 0 === _this$_$hoveredRangeC2 || _this$_$hoveredRangeC2.forEach(($cell => {
$cell.removeClass("dx-calendar-cell-range-hover")
}));
null === (_this$_$rangeStartHov2 = this._$rangeStartHoverCell) || void 0 === _this$_$rangeStartHov2 || _this$_$rangeStartHov2.removeClass("dx-calendar-cell-range-hover-start");
null === (_this$_$rangeEndHover2 = this._$rangeEndHoverCell) || void 0 === _this$_$rangeEndHover2 || _this$_$rangeEndHover2.removeClass("dx-calendar-cell-range-hover-end");
this._$hoveredRangeCells = hoveredRange.map((value => this._getCellByDate(value)));
this._$rangeStartHoverCell = this._getCellByDate(hoveredRange[0]);
this._$rangeEndHoverCell = this._getCellByDate(hoveredRange[hoveredRange.length - 1]);
this._$hoveredRangeCells.forEach(($cell => {
$cell.addClass("dx-calendar-cell-range-hover")
}));
null === (_this$_$rangeStartHov3 = this._$rangeStartHoverCell) || void 0 === _this$_$rangeStartHov3 || _this$_$rangeStartHov3.addClass("dx-calendar-cell-range-hover-start");
null === (_this$_$rangeEndHover3 = this._$rangeEndHoverCell) || void 0 === _this$_$rangeEndHover3 || _this$_$rangeEndHover3.addClass("dx-calendar-cell-range-hover-end")
},
_isMonthView() {
return "month" === this.option("zoomLevel")
},
_isRangeMode() {
return this.option("selectionMode") === SELECTION_MODE_range
},
_getCurrentDateFormat: () => null,
getCellAriaLabel(date) {
const viewName = this._getViewName();
const isToday = this._isTodayCell(date);
const format = this._getCurrentDateFormat();
const dateRangeText = format ? _date2.default.format(date, format) : this._getCellText(date);
const ariaLabel = isToday ? `${dateRangeText}. ${CURRENT_DATE_TEXT[viewName]}` : dateRangeText;
return ariaLabel
},
_getFirstAvailableDate() {
let date = this.option("date");
const min = this.option("min");
date = _date.default.getViewFirstCellDate(this._getViewName(), date);
return new Date(min && date < min ? min : date)
},
_getCellByDate: abstract,
isBoundary: abstract,
_optionChanged(args) {
const {
name: name,
value: value
} = args;
switch (name) {
case "value":
this._renderValue();
this._updateTableAriaLabel();
break;
case "range":
this._renderRange();
break;
case "hoveredRange":
this._renderHoveredRange();
break;
case "contouredDate":
this._renderContouredDate(value);
break;
case "onCellClick":
this._createCellClickAction();
break;
case "onCellHover":
this._createCellHoverAction();
break;
case "min":
case "max":
case "disabledDates":
case "cellTemplate":
case "selectionMode":
this._invalidate();
break;
case "_todayDate":
this._renderBody();
break;
default:
this.callBase(args)
}
}
});
exports.default = BaseView
},
49782:
/*!**********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.js ***!
\**********************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _fx = _interopRequireDefault(__webpack_require__( /*! ../../../animation/fx */ 87209));
var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648);
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530));
var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../core/guid */ 73176));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _function_template = __webpack_require__( /*! ../../../core/templates/function_template */ 68494);
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _math = __webpack_require__( /*! ../../../core/utils/math */ 60810);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _swipeable = _interopRequireDefault(__webpack_require__( /*! ../../../events/gesture/swipeable */ 66894));
var _hover = __webpack_require__( /*! ../../../events/hover */ 24028);
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008));
var _editor = _interopRequireDefault(__webpack_require__( /*! ../../../ui/editor/editor */ 96452));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
var _m_calendarMultipleSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.multiple.selection.strategy */ 37427));
var _m_calendar = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.navigator */ 35506));
var _m_calendarRangeSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.range.selection.strategy */ 96218));
var _m_calendarSingleSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.single.selection.strategy */ 99324));
var _m_calendar2 = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.views */ 48928));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const CALENDAR_DXHOVEREND_EVENT_NAME = (0, _index.addNamespace)(_hover.end, "dxCalendar");
const LEVEL_COMPARE_MAP = {
month: 3,
year: 2,
decade: 1,
century: 0
};
const ZOOM_LEVEL_MONTH = "month",
ZOOM_LEVEL_YEAR = "year",
ZOOM_LEVEL_DECADE = "decade",
ZOOM_LEVEL_CENTURY = "century";
const SELECTION_STRATEGIES = {
SingleSelection: _m_calendarSingleSelection.default,
MultipleSelection: _m_calendarMultipleSelection.default,
RangeSelection: _m_calendarRangeSelection.default
};
const Calendar = _editor.default.inherit({
_activeStateUnit: ".dx-calendar-cell",
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
hoverStateEnabled: true,
activeStateEnabled: true,
currentDate: new Date,
value: null,
dateSerializationFormat: void 0,
min: new Date(1e3, 0),
max: new Date(3e3, 0),
firstDayOfWeek: void 0,
viewsCount: 1,
zoomLevel: ZOOM_LEVEL_MONTH,
maxZoomLevel: ZOOM_LEVEL_MONTH,
minZoomLevel: ZOOM_LEVEL_CENTURY,
selectionMode: "single",
selectWeekOnClick: true,
showTodayButton: false,
showWeekNumbers: false,
weekNumberRule: "auto",
cellTemplate: "cell",
disabledDates: null,
onCellClick: null,
onContouredChanged: null,
skipFocusCheck: false,
_todayDate: () => new Date
})
},
_defaultOptionsRules() {
return this.callBase().concat([{
device: () => "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator(),
options: {
focusStateEnabled: true
}
}])
},
_supportedKeys() {
return (0, _extend.extend)(this.callBase(), {
rightArrow(e) {
e.preventDefault();
if ((0, _index.isCommandKeyPressed)(e)) {
this._waitRenderView(1)
} else {
this._moveCurrentDateByOffset(1 * this._getRtlCorrection())
}
},
leftArrow(e) {
e.preventDefault();
if ((0, _index.isCommandKeyPressed)(e)) {
this._waitRenderView(-1)
} else {
this._moveCurrentDateByOffset(-1 * this._getRtlCorrection())
}
},
upArrow(e) {
e.preventDefault();
if ((0, _index.isCommandKeyPressed)(e)) {
this._navigateUp()
} else {
if (_fx.default.isAnimating(this._view.$element())) {
return
}
this._moveCurrentDateByOffset(-1 * this._view.option("colCount"))
}
},
downArrow(e) {
e.preventDefault();
if ((0, _index.isCommandKeyPressed)(e)) {
this._navigateDown()
} else {
if (_fx.default.isAnimating(this._view.$element())) {
return
}
this._moveCurrentDateByOffset(1 * this._view.option("colCount"))
}
},
home(e) {
e.preventDefault();
const zoomLevel = this.option("zoomLevel");
const currentDate = this.option("currentDate");
const min = this._dateOption("min");
if (this._view.isDateDisabled(currentDate)) {
return
}
const date = _date.default.sameView(zoomLevel, currentDate, min) ? min : _date.default.getViewFirstCellDate(zoomLevel, currentDate);
this._moveToClosestAvailableDate(date)
},
end(e) {
e.preventDefault();
const zoomLevel = this.option("zoomLevel");
const currentDate = this.option("currentDate");
const max = this._dateOption("max");
if (this._view.isDateDisabled(currentDate)) {
return
}
const date = _date.default.sameView(zoomLevel, currentDate, max) ? max : _date.default.getViewLastCellDate(zoomLevel, currentDate);
this._moveToClosestAvailableDate(date)
},
pageUp(e) {
e.preventDefault();
this._waitRenderView(-1 * this._getRtlCorrection())
},
pageDown(e) {
e.preventDefault();
this._waitRenderView(1 * this._getRtlCorrection())
},
tab: _common.noop,
enter: this._enterKeyHandler
})
},
_enterKeyHandler(e) {
if (!this._isMaxZoomLevel()) {
this._navigateDown()
} else if (!this._view.isDateDisabled(this.option("currentDate"))) {
const value = this._updateTimeComponent(this.option("currentDate"));
this._selectionStrategy.selectValue(value, e)
}
},
_getSerializationFormat(optionName) {
const value = this.option(optionName || "value");
if (this.option("dateSerializationFormat")) {
return this.option("dateSerializationFormat")
}
if ((0, _type.isNumeric)(value)) {
return "number"
}
if (!(0, _type.isString)(value)) {
return
}
return _date_serialization.default.getDateSerializationFormat(value)
},
_convertToDate: value => _date_serialization.default.deserializeDate(value),
_dateValue(value, event) {
if (event) {
if ("keydown" === event.type) {
const cellElement = this._view._getContouredCell().get(0);
event.target = cellElement
}
this._saveValueChangeEvent(event)
}
this._dateOption("value", value)
},
_dateOption(optionName, optionValue) {
const isArray = "value" === optionName && !this._isSingleMode();
const value = this.option("value");
if (1 === arguments.length) {
return isArray ? (value ?? []).map((value => this._convertToDate(value))) : this._convertToDate(this.option(optionName))
}
const serializationFormat = this._getSerializationFormat(optionName);
const serializedValue = isArray ? (null === optionValue || void 0 === optionValue ? void 0 : optionValue.map((value => _date_serialization.default.serializeDate(value, serializationFormat)))) || [] : _date_serialization.default.serializeDate(optionValue, serializationFormat);
this.option(optionName, serializedValue)
},
_isSingleMode() {
return "single" === this.option("selectionMode")
},
_shiftDate(zoomLevel, date, offset, reverse) {
switch (zoomLevel) {
case ZOOM_LEVEL_MONTH:
date.setDate(date.getDate() + offset * reverse);
break;
case ZOOM_LEVEL_YEAR:
date.setMonth(date.getMonth() + offset * reverse);
break;
case ZOOM_LEVEL_DECADE:
date.setFullYear(date.getFullYear() + offset * reverse);
break;
case ZOOM_LEVEL_CENTURY:
date.setFullYear(date.getFullYear() + 10 * offset * reverse)
}
},
_moveCurrentDateByOffset(offset) {
const baseDate = this.option("currentDate");
let currentDate = new Date(baseDate);
const zoomLevel = this.option("zoomLevel");
this._shiftDate(zoomLevel, currentDate, offset, 1);
const maxDate = this._getMaxDate();
const minDate = this._getMinDate();
let isDateForwardInNeighborView = this._areDatesInNeighborView(zoomLevel, currentDate, baseDate);
let isDateForwardInRange = (0, _math.inRange)(currentDate, minDate, maxDate) && isDateForwardInNeighborView;
const dateForward = new Date(currentDate);
while (isDateForwardInRange) {
if (!this._view.isDateDisabled(dateForward)) {
currentDate = dateForward;
break
}
this._shiftDate(zoomLevel, dateForward, offset, 1);
isDateForwardInNeighborView = this._areDatesInNeighborView(zoomLevel, dateForward, baseDate);
isDateForwardInRange = (0, _math.inRange)(dateForward, minDate, maxDate) && isDateForwardInNeighborView
}
if (this._view.isDateDisabled(baseDate) || this._view.isDateDisabled(currentDate)) {
const direction = offset > 0 ? 1 : -1;
const isViewDisabled = 1 === direction ? this._isNextViewDisabled() : this._isPrevViewDisabled();
if (!isViewDisabled) {
this._waitRenderView(direction)
} else {
this._moveToClosestAvailableDate(currentDate)
}
} else {
this._skipNavigate = true;
this.option("currentDate", currentDate)
}
},
_isNextViewDisabled() {
return this._navigator._nextButton.option("disabled")
},
_isPrevViewDisabled() {
return this._navigator._prevButton.option("disabled")
},
_areDatesInSameView(zoomLevel, date1, date2) {
switch (zoomLevel) {
case ZOOM_LEVEL_MONTH:
return date1.getMonth() === date2.getMonth();
case ZOOM_LEVEL_YEAR:
return date1.getYear() === date2.getYear();
case ZOOM_LEVEL_DECADE:
return parseInt(date1.getYear() / 10) === parseInt(date2.getYear() / 10);
case ZOOM_LEVEL_CENTURY:
return parseInt(date1.getYear() / 100) === parseInt(date2.getYear() / 100)
}
},
_areDatesInNeighborView(zoomLevel, date1, date2) {
switch (zoomLevel) {
case ZOOM_LEVEL_MONTH:
return ((a, b) => {
const abs = Math.abs(a - b);
return Math.min(abs, 12 - abs)
})(date1.getMonth(), date2.getMonth()) <= 1;
case ZOOM_LEVEL_YEAR:
return Math.abs(date1.getYear() - date2.getYear()) <= 1;
case ZOOM_LEVEL_DECADE:
return Math.abs(date1.getYear() - date2.getYear()) <= 10;
case ZOOM_LEVEL_CENTURY:
return Math.abs(date1.getYear() - date2.getYear()) <= 100
}
},
_moveToClosestAvailableDate() {
let baseDate = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.option("currentDate");
let currentDate = new Date(baseDate);
const zoomLevel = this.option("zoomLevel");
const isCurrentDateAvailable = !this._isDateNotAvailable(currentDate);
let isDateForwardAvailable = isCurrentDateAvailable;
let isDateBackwardAvailable = isCurrentDateAvailable;
let isDateForwardInStartView;
let isDateBackwardInStartView;
const dateForward = new Date(currentDate);
const dateBackward = new Date(currentDate);
do {
if (isDateForwardAvailable) {
currentDate = dateForward;
break
}
if (isDateBackwardAvailable) {
currentDate = dateBackward;
break
}
this._shiftDate(zoomLevel, dateForward, 1, 1);
this._shiftDate(zoomLevel, dateBackward, 1, -1);
isDateForwardInStartView = this._areDatesInSameView(zoomLevel, dateForward, baseDate);
isDateBackwardInStartView = this._areDatesInSameView(zoomLevel, dateBackward, baseDate);
isDateForwardAvailable = isDateForwardInStartView && !this._isDateNotAvailable(dateForward);
isDateBackwardAvailable = isDateBackwardInStartView && !this._isDateNotAvailable(dateBackward)
} while (isDateForwardInStartView || isDateBackwardInStartView);
this.option("currentDate", currentDate)
},
_isDateNotAvailable(date) {
const maxDate = this._getMaxDate();
const minDate = this._getMinDate();
return !(0, _math.inRange)(date, minDate, maxDate) || this._view.isDateDisabled(date)
},
_init() {
this.callBase();
this._initSelectionStrategy();
this._correctZoomLevel();
this._initCurrentDate();
this._initActions()
},
_initSelectionStrategy() {
const strategyName = this._getSelectionStrategyName();
const strategy = SELECTION_STRATEGIES[strategyName];
if (!this._selectionStrategy || this._selectionStrategy.NAME !== strategyName) {
this._selectionStrategy = new strategy(this)
}
},
_refreshSelectionStrategy() {
this._initSelectionStrategy();
this._selectionStrategy.restoreValue();
this._refresh()
},
_getSelectionStrategyName() {
const selectionMode = this.option("selectionMode");
switch (selectionMode) {
case "multiple":
return "MultipleSelection";
case "range":
return "RangeSelection";
default:
return "SingleSelection"
}
},
_correctZoomLevel() {
const minZoomLevel = this.option("minZoomLevel");
const maxZoomLevel = this.option("maxZoomLevel");
const zoomLevel = this.option("zoomLevel");
if (LEVEL_COMPARE_MAP[maxZoomLevel] < LEVEL_COMPARE_MAP[minZoomLevel]) {
return
}
if (LEVEL_COMPARE_MAP[zoomLevel] > LEVEL_COMPARE_MAP[maxZoomLevel]) {
this.option("zoomLevel", maxZoomLevel)
} else if (LEVEL_COMPARE_MAP[zoomLevel] < LEVEL_COMPARE_MAP[minZoomLevel]) {
this.option("zoomLevel", minZoomLevel)
}
},
_initCurrentDate() {
const currentDate = this._getNormalizedDate(this._selectionStrategy.getDefaultCurrentDate()) ?? this._getNormalizedDate(this.option("currentDate"));
this.option("currentDate", currentDate)
},
_getNormalizedDate(date) {
date = _date.default.normalizeDate(date, this._getMinDate(), this._getMaxDate());
return (0, _type.isDefined)(date) ? this._getDate(date) : date
},
_initActions() {
this._cellClickAction = this._createActionByOption("onCellClick");
this._onContouredChanged = this._createActionByOption("onContouredChanged")
},
_initTemplates() {
this._templateManager.addDefaultTemplates({
cell: new _function_template.FunctionTemplate((options => {
const data = options.model;
(0, _renderer.default)(options.container).append((0, _renderer.default)("").text(data && data.text || String(data)))
}))
});
this.callBase()
},
_updateCurrentDate(date) {
if (_fx.default.isAnimating(this._$viewsWrapper)) {
_fx.default.stop(this._$viewsWrapper, true)
}
const min = this._getMinDate();
const max = this._getMaxDate();
if (min > max) {
this.option("currentDate", new Date);
return
}
const normalizedDate = this._getNormalizedDate(date);
if (date.getTime() !== normalizedDate.getTime()) {
this.option("currentDate", new Date(normalizedDate));
return
}
let offset = this._getViewsOffset(this._view.option("date"), normalizedDate);
if (0 !== offset && !this._isMaxZoomLevel() && this._isOtherViewCellClicked) {
offset = 0
}
if (this._view && 0 !== offset && !this._suppressNavigation) {
if (this._additionalView) {
if (offset > 2 || offset < -1) {
this._refreshViews();
this._setViewContoured(normalizedDate);
this._updateAriaId(normalizedDate);
this._renderNavigator()
} else if (1 === offset && this._skipNavigate) {
this._setViewContoured(normalizedDate);
this._updateAriaId(normalizedDate)
} else {
this._navigate(offset, normalizedDate)
}
} else {
this._navigate(offset, normalizedDate)
}
} else {
this._renderNavigator();
this._setViewContoured(normalizedDate);
this._updateAriaId(normalizedDate)
}
this._skipNavigate = false
},
_isAdditionalViewDate(date) {
if (!this._additionalView) {
return false
}
return date >= this._additionalView._getFirstAvailableDate()
},
_getActiveView(date) {
return this._isAdditionalViewDate(date) ? this._additionalView : this._view
},
_setViewContoured(date) {
if (this.option("skipFocusCheck") || (0, _renderer.default)(this._$viewsWrapper).is(":focus")) {
var _this$_additionalView;
this._view.option("contouredDate", null);
null === (_this$_additionalView = this._additionalView) || void 0 === _this$_additionalView || _this$_additionalView.option("contouredDate", null);
const view = this._isAdditionalViewDate(date) ? this._additionalView : this._view;
view.option("contouredDate", date)
}
},
_getMinDate() {
const _rangeMin = this.option("_rangeMin");
if (_rangeMin) {
return _rangeMin
}
if (this.min) {
return this.min
}
this.min = this._dateOption("min") || new Date(1e3, 0);
return this.min
},
_getMaxDate() {
const _rangeMax = this.option("_rangeMax");
if (_rangeMax) {
return _rangeMax
}
if (this.max) {
return this.max
}
this.max = this._dateOption("max") || new Date(3e3, 0);
return this.max
},
_getViewsOffset(startDate, endDate) {
const zoomLevel = this.option("zoomLevel");
if (zoomLevel === ZOOM_LEVEL_MONTH) {
return this._getMonthsOffset(startDate, endDate)
}
let zoomCorrection;
switch (zoomLevel) {
case ZOOM_LEVEL_CENTURY:
zoomCorrection = 100;
break;
case ZOOM_LEVEL_DECADE:
zoomCorrection = 10;
break;
default:
zoomCorrection = 1
}
return parseInt(endDate.getFullYear() / zoomCorrection) - parseInt(startDate.getFullYear() / zoomCorrection)
},
_getMonthsOffset(startDate, endDate) {
const yearOffset = endDate.getFullYear() - startDate.getFullYear();
const monthOffset = endDate.getMonth() - startDate.getMonth();
return 12 * yearOffset + monthOffset
},
_waitRenderView(offset) {
if (this._alreadyViewRender) {
return
}
this._alreadyViewRender = true;
const date = this._getDateByOffset(offset * this._getRtlCorrection());
this._moveToClosestAvailableDate(date);
this._waitRenderViewTimeout = setTimeout((() => {
this._alreadyViewRender = false
}))
},
_getRtlCorrection() {
return this.option("rtlEnabled") ? -1 : 1
},
_getDateByOffset(offset, date) {
date = this._getDate(date ?? this.option("currentDate"));
const currentDay = date.getDate();
const difference = _date.default.getDifferenceInMonth(this.option("zoomLevel")) * offset;
date.setDate(1);
date.setMonth(date.getMonth() + difference);
const lastDay = _date.default.getLastMonthDate(date).getDate();
date.setDate(currentDay > lastDay ? lastDay : currentDay);
return date
},
_focusTarget() {
return this._$viewsWrapper
},
_focusEventTarget() {
return this.$element()
},
_initMarkup() {
this._renderSubmitElement();
const $element = this.$element();
$element.addClass("dx-calendar");
$element.toggleClass("dx-calendar-range", "range" === this.option("selectionMode"));
this._renderBody();
$element.append(this.$body);
this._renderViews();
this._renderNavigator();
this.callBase();
this._renderEvents();
$element.prepend(this._navigator.$element());
this._renderSwipeable();
this._renderFooter();
this._selectionStrategy.updateAriaSelected();
this._updateAriaId();
this._updateNavigatorLabels();
this.setAria("role", "application");
this._moveToClosestAvailableDate()
},
_render() {
this.callBase();
this._setViewContoured(this.option("currentDate"))
},
_renderBody() {
if (!this._$viewsWrapper) {
this.$body = (0, _renderer.default)("").addClass("dx-calendar-body");
this._$viewsWrapper = (0, _renderer.default)(" ").addClass("dx-calendar-views-wrapper");
this.$body.append(this._$viewsWrapper)
}
},
_setAriaReadonly: _common.noop,
_getKeyboardListeners() {
return this.callBase().concat([this._view])
},
_renderViews() {
this.$element().addClass(`dx-calendar-view-${this.option("zoomLevel")}`);
const {
currentDate: currentDate,
viewsCount: viewsCount
} = this.option();
this.$element().toggleClass("dx-calendar-multiview", viewsCount > 1);
this._view = this._renderSpecificView(currentDate);
if ((0, _window.hasWindow)()) {
const beforeDate = this._getDateByOffset(-1, currentDate);
this._beforeView = this._isViewAvailable(beforeDate) ? this._renderSpecificView(beforeDate) : null;
const afterDate = this._getDateByOffset(viewsCount, currentDate);
afterDate.setDate(1);
this._afterView = this._isViewAvailable(afterDate) ? this._renderSpecificView(afterDate) : null
}
if (viewsCount > 1) {
this._additionalView = this._renderSpecificView(this._getDateByOffset(1, currentDate))
}
this._translateViews()
},
_renderSpecificView(date) {
const {
zoomLevel: zoomLevel
} = this.option();
const specificView = _m_calendar2.default[zoomLevel];
const $view = (0, _renderer.default)(" ").appendTo(this._$viewsWrapper);
const config = this._viewConfig(date);
const view = this._createComponent($view, specificView, config);
return view
},
_viewConfig(date) {
let disabledDates = this.option("disabledDates");
disabledDates = (0, _type.isFunction)(disabledDates) ? this._injectComponent(disabledDates.bind(this)) : disabledDates;
return _extends({}, this._selectionStrategy.getViewOptions(), {
date: date,
min: this._getMinDate(),
max: this._getMaxDate(),
firstDayOfWeek: this.option("firstDayOfWeek") ?? _date2.default.firstDayOfWeekIndex(),
showWeekNumbers: this.option("showWeekNumbers"),
selectWeekOnClick: this.option("selectWeekOnClick"),
weekNumberRule: this.option("weekNumberRule"),
zoomLevel: this.option("zoomLevel"),
tabIndex: void 0,
focusStateEnabled: this.option("focusStateEnabled"),
hoverStateEnabled: this.option("hoverStateEnabled"),
disabledDates: disabledDates,
onCellClick: this._cellClickHandler.bind(this),
cellTemplate: this._getTemplateByOption("cellTemplate"),
allowValueSelection: this._isMaxZoomLevel(),
_todayDate: this.option("_todayDate")
})
},
_renderEvents() {
_events_engine.default.off(this._$viewsWrapper, CALENDAR_DXHOVEREND_EVENT_NAME);
if ("range" === this.option("selectionMode")) {
_events_engine.default.on(this._$viewsWrapper, CALENDAR_DXHOVEREND_EVENT_NAME, null, (() => {
this._updateViewsOption("hoveredRange", [])
}))
}
},
_injectComponent(func) {
const that = this;
return function(params) {
(0, _extend.extend)(params, {
component: that
});
return func(params)
}
},
_isViewAvailable(date) {
const zoomLevel = this.option("zoomLevel");
const min = _date.default.getViewMinBoundaryDate(zoomLevel, this._getMinDate());
const max = _date.default.getViewMaxBoundaryDate(zoomLevel, this._getMaxDate());
return _date.default.dateInRange(date, min, max)
},
_translateViews() {
const {
viewsCount: viewsCount
} = this.option();
(0, _translator.move)(this._view.$element(), {
left: 0,
top: 0
});
this._moveViewElement(this._beforeView, -1);
this._moveViewElement(this._afterView, viewsCount);
this._moveViewElement(this._additionalView, 1)
},
_moveViewElement(view, coefficient) {
view && (0, _translator.move)(view.$element(), {
left: this._getViewPosition(coefficient),
top: 0
})
},
_getViewPosition(coefficient) {
const rtlCorrection = this.option("rtlEnabled") ? -1 : 1;
return 100 * coefficient * rtlCorrection + "%"
},
_cellClickHandler(e) {
const zoomLevel = this.option("zoomLevel");
const nextView = _date.default.getViewDown(zoomLevel);
const isMaxZoomLevel = this._isMaxZoomLevel();
if (nextView && !isMaxZoomLevel) {
this._navigateDown(e.event.currentTarget)
} else {
const newValue = this._updateTimeComponent(e.value);
this._selectionStrategy.selectValue(newValue, e.event);
this._cellClickAction(e)
}
},
_updateTimeComponent(date) {
const result = new Date(date);
const currentValue = this._dateOption("value");
if (currentValue && this._isSingleMode()) {
result.setHours(currentValue.getHours());
result.setMinutes(currentValue.getMinutes());
result.setSeconds(currentValue.getSeconds());
result.setMilliseconds(currentValue.getMilliseconds())
}
return result
},
_isMaxZoomLevel() {
return this.option("zoomLevel") === this.option("maxZoomLevel")
},
_navigateDown(cell) {
const zoomLevel = this.option("zoomLevel");
if (this._isMaxZoomLevel()) {
return
}
const nextView = _date.default.getViewDown(zoomLevel);
if (!nextView) {
return
}
let newCurrentDate = this._view.option("contouredDate") || this._view.option("date");
if (cell) {
newCurrentDate = (0, _renderer.default)(cell).data("dxDateValueKey")
}
this._isOtherViewCellClicked = true;
this.option("currentDate", newCurrentDate);
this.option("zoomLevel", nextView);
this._isOtherViewCellClicked = false;
this._renderNavigator();
this._animateShowView();
this._moveToClosestAvailableDate();
this._setViewContoured(this._getNormalizedDate(this.option("currentDate")))
},
_renderNavigator() {
if (!this._navigator) {
this._navigator = new _m_calendar.default((0, _renderer.default)(" "), this._navigatorConfig())
}
this._navigator.option("text", this._getViewsCaption(this._view, this._additionalView));
this._updateButtonsVisibility()
},
_navigatorConfig() {
const {
focusStateEnabled: focusStateEnabled,
rtlEnabled: rtlEnabled
} = this.option();
return {
text: this._getViewsCaption(this._view, this._additionalView),
onClick: this._navigatorClickHandler.bind(this),
onCaptionClick: this._navigateUp.bind(this),
focusStateEnabled: focusStateEnabled,
rtlEnabled: rtlEnabled,
tabIndex: void 0
}
},
_navigatorClickHandler(e) {
const {
currentDate: currentDate,
viewsCount: viewsCount
} = this.option();
let offset = e.direction;
if (viewsCount > 1) {
const additionalViewActive = this._isAdditionalViewDate(currentDate);
const shouldDoubleOffset = additionalViewActive && offset < 0 || !additionalViewActive && offset > 0;
if (shouldDoubleOffset) {
offset *= 2
}
}
const newCurrentDate = this._getDateByOffset(offset, currentDate);
this._moveToClosestAvailableDate(newCurrentDate)
},
_navigateUp() {
const zoomLevel = this.option("zoomLevel");
const nextView = _date.default.getViewUp(zoomLevel);
if (!nextView || this._isMinZoomLevel(zoomLevel)) {
return
}
this.option("zoomLevel", nextView);
this._renderNavigator();
this._animateShowView();
this._moveToClosestAvailableDate();
this._setViewContoured(this._getNormalizedDate(this.option("currentDate")))
},
_isMinZoomLevel(zoomLevel) {
const min = this._getMinDate();
const max = this._getMaxDate();
return _date.default.sameView(zoomLevel, min, max) || this.option("minZoomLevel") === zoomLevel
},
_updateButtonsVisibility() {
this._navigator.toggleButton("next", !(0, _type.isDefined)(this._afterView));
this._navigator.toggleButton("prev", !(0, _type.isDefined)(this._beforeView))
},
_renderSwipeable() {
if (!this._swipeable) {
this._swipeable = this._createComponent(this.$element(), _swipeable.default, {
onStart: this._swipeStartHandler.bind(this),
onUpdated: this._swipeUpdateHandler.bind(this),
onEnd: this._swipeEndHandler.bind(this),
itemSizeFunc: this._viewWidth.bind(this)
})
}
},
_swipeStartHandler(e) {
_fx.default.stop(this._$viewsWrapper, true);
const {
viewsCount: viewsCount
} = this.option();
this._toggleGestureCoverCursor("grabbing");
e.event.maxLeftOffset = this._getRequiredView("next") ? 1 / viewsCount : 0;
e.event.maxRightOffset = this._getRequiredView("prev") ? 1 / viewsCount : 0
},
_toggleGestureCoverCursor(cursor) {
(0, _renderer.default)(".dx-gesture-cover").css("cursor", cursor)
},
_getRequiredView(name) {
let view;
const isRtl = this.option("rtlEnabled");
if ("next" === name) {
view = isRtl ? this._beforeView : this._afterView
} else if ("prev" === name) {
view = isRtl ? this._afterView : this._beforeView
}
return view
},
_swipeUpdateHandler(e) {
const {
offset: offset
} = e.event;
(0, _translator.move)(this._$viewsWrapper, {
left: offset * this._viewWidth(),
top: 0
});
this._updateNavigatorCaption(offset)
},
_swipeEndHandler(e) {
this._toggleGestureCoverCursor("auto");
const {
currentDate: currentDate,
rtlEnabled: rtlEnabled
} = this.option();
const {
targetOffset: targetOffset
} = e.event;
const moveOffset = !targetOffset ? 0 : targetOffset / Math.abs(targetOffset);
const isAdditionalViewActive = this._isAdditionalViewDate(currentDate);
const shouldDoubleOffset = isAdditionalViewActive && (rtlEnabled ? -1 === moveOffset : 1 === moveOffset);
if (0 === moveOffset) {
this._animateWrapper(0, 250);
return
}
const offset = -moveOffset * this._getRtlCorrection() * (shouldDoubleOffset ? 2 : 1);
let date = this._getDateByOffset(offset);
if (this._isDateInInvalidRange(date)) {
if (moveOffset >= 0) {
date = new Date(this._getMinDate())
} else {
date = new Date(this._getMaxDate())
}
}
this.option("currentDate", date)
},
_viewWidth() {
if (!this._viewWidthValue) {
this._viewWidthValue = (0, _size.getWidth)(this.$element()) / this.option("viewsCount")
}
return this._viewWidthValue
},
_updateNavigatorCaption(offset) {
offset *= this._getRtlCorrection();
const isMultiView = this.option("viewsCount") > 1;
let view;
let additionalView;
if (offset > .5 && this._beforeView) {
view = this._beforeView;
additionalView = isMultiView && this._view
} else if (offset < -.5 && this._afterView) {
view = isMultiView ? this._additionalView : this._afterView;
additionalView = isMultiView ? this._afterView : null
} else {
view = this._view;
additionalView = isMultiView ? this._additionalView : null
}
this._navigator.option("text", this._getViewsCaption(view, additionalView))
},
_getViewsCaption(view, additionalView) {
let caption = view.getNavigatorCaption();
const {
viewsCount: viewsCount
} = this.option();
if (viewsCount > 1 && additionalView) {
const additionalViewCaption = additionalView.getNavigatorCaption();
caption = `${caption} - ${additionalViewCaption}`
}
return caption
},
_isDateInInvalidRange(date) {
if (this._view.isBoundary(date)) {
return
}
const min = this._getMinDate();
const max = this._getMaxDate();
const normalizedDate = _date.default.normalizeDate(date, min, max);
return normalizedDate === min || normalizedDate === max
},
_renderFooter() {
const showTodayButton = this.option("showTodayButton");
if (showTodayButton) {
const $todayButton = this._createComponent((0, _renderer.default)(" "), _button.default, {
focusStateEnabled: this.option("focusStateEnabled"),
text: _message.default.format("dxCalendar-todayButtonText"),
onClick: args => {
this._toTodayView(args)
},
type: (0, _themes.isFluent)() ? "normal" : "default",
stylingMode: (0, _themes.isFluent)() ? "outlined" : "text",
integrationOptions: {}
}).$element().addClass("dx-calendar-today-button");
this._$footer = (0, _renderer.default)(" ").addClass("dx-calendar-footer").append($todayButton);
this.$element().append(this._$footer)
}
this.$element().toggleClass("dx-calendar-with-footer", showTodayButton)
},
_renderSubmitElement() {
this._$submitElement = (0, _renderer.default)(" ").attr("type", "hidden").appendTo(this.$element());
this._setSubmitValue(this.option("value"))
},
_setSubmitValue(value) {
const dateValue = this._convertToDate(value);
this._getSubmitElement().val(_date_serialization.default.serializeDate(dateValue, "yyyy-MM-dd"))
},
_getSubmitElement() {
return this._$submitElement
},
_animateShowView() {
_fx.default.stop(this._view.$element(), true);
this._popAnimationView(this._view, .6, 1, 250);
if (this.option("viewsCount") > 1) {
_fx.default.stop(this._additionalView.$element(), true);
this._popAnimationView(this._additionalView, .6, 1, 250)
}
},
_popAnimationView: (view, from, to, duration) => _fx.default.animate(view.$element(), {
type: "pop",
from: {
scale: from,
opacity: from
},
to: {
scale: to,
opacity: to
},
duration: duration
}),
_navigate(offset, value) {
if (0 !== offset && 1 !== Math.abs(offset) && this._isViewAvailable(value)) {
const newView = this._renderSpecificView(value);
if (offset > 0) {
this._afterView && this._afterView.$element().remove();
this._afterView = newView
} else {
this._beforeView && this._beforeView.$element().remove();
this._beforeView = newView
}
this._translateViews()
}
const rtlCorrection = this._getRtlCorrection();
const offsetSign = offset > 0 ? 1 : offset < 0 ? -1 : 0;
const endPosition = -rtlCorrection * offsetSign * this._viewWidth();
const viewsWrapperPosition = this._$viewsWrapper.position().left;
if (viewsWrapperPosition !== endPosition) {
if (this._preventViewChangeAnimation) {
this._wrapperAnimationEndHandler(offset, value)
} else {
this._animateWrapper(endPosition, 250).done(this._wrapperAnimationEndHandler.bind(this, offset, value))
}
}
},
_animateWrapper(to, duration) {
return _fx.default.animate(this._$viewsWrapper, {
type: "slide",
from: {
left: this._$viewsWrapper.position().left
},
to: {
left: to
},
duration: duration
})
},
_getDate: value => new Date(value),
_toTodayView(args) {
const today = new Date;
if (this._isMaxZoomLevel()) {
this._selectionStrategy.selectValue(today, args.event);
return
}
this._preventViewChangeAnimation = true;
this.option("zoomLevel", this.option("maxZoomLevel"));
this._selectionStrategy.selectValue(today, args.event);
this._animateShowView();
this._preventViewChangeAnimation = false
},
_wrapperAnimationEndHandler(offset, newDate) {
this._rearrangeViews(offset);
this._translateViews();
this._resetLocation();
this._renderNavigator();
this._setViewContoured(newDate);
this._updateAriaId(newDate);
this._selectionStrategy.updateAriaSelected()
},
_rearrangeViews(offset) {
var _this$viewToRemoveKey;
if (0 === offset) {
return
}
const {
viewsCount: viewsCount
} = this.option();
let viewOffset;
let viewToCreateKey;
let viewToRemoveKey;
let viewBeforeCreateKey;
let viewAfterRemoveKey;
if (offset < 0) {
viewOffset = 1;
viewToCreateKey = "_beforeView";
viewToRemoveKey = "_afterView";
viewBeforeCreateKey = "_view";
viewAfterRemoveKey = 1 === viewsCount ? "_view" : "_additionalView"
} else {
viewOffset = -1;
viewToCreateKey = "_afterView";
viewToRemoveKey = "_beforeView";
viewBeforeCreateKey = 1 === viewsCount ? "_view" : "_additionalView";
viewAfterRemoveKey = "_view"
}
if (!this[viewToCreateKey]) {
return
}
const destinationDate = this[viewToCreateKey].option("date");
null === (_this$viewToRemoveKey = this[viewToRemoveKey]) || void 0 === _this$viewToRemoveKey || _this$viewToRemoveKey.$element().remove();
this[viewToRemoveKey] = this._renderSpecificView(this._getDateByOffset(viewOffset * viewsCount, destinationDate));
this[viewAfterRemoveKey].$element().remove();
if (1 === viewsCount) {
this[viewAfterRemoveKey] = this[viewToCreateKey]
} else {
this[viewAfterRemoveKey] = this[viewBeforeCreateKey];
this[viewBeforeCreateKey] = this[viewToCreateKey]
}
const dateByOffset = this._getDateByOffset(-viewOffset, destinationDate);
this[viewToCreateKey] = this._isViewAvailable(dateByOffset) ? this._renderSpecificView(dateByOffset) : null
},
_resetLocation() {
(0, _translator.move)(this._$viewsWrapper, {
left: 0,
top: 0
})
},
_clean() {
this.callBase();
this._clearViewWidthCache();
delete this._$viewsWrapper;
delete this._navigator;
delete this._$footer
},
_clearViewWidthCache() {
delete this._viewWidthValue
},
_disposeViews() {
this._view.$element().remove();
this._beforeView && this._beforeView.$element().remove();
this._additionalView && this._additionalView.$element().remove();
this._afterView && this._afterView.$element().remove();
delete this._view;
delete this._additionalView;
delete this._beforeView;
delete this._afterView;
delete this._skipNavigate
},
_dispose() {
clearTimeout(this._waitRenderViewTimeout);
this.callBase()
},
_refreshViews() {
this._resetActiveState();
this._disposeViews();
this._renderViews()
},
_visibilityChanged() {
this._translateViews()
},
_shouldSkipFocusEvent(event) {
const {
target: target,
relatedTarget: relatedTarget
} = event;
return (0, _renderer.default)(target).parents(".dx-calendar").length && (0, _renderer.default)(relatedTarget).parents(".dx-calendar").length
},
_focusInHandler(event) {
if ((0, _renderer.default)(event.target).is(this._$viewsWrapper)) {
this._setViewContoured(this.option("currentDate"))
}
if (this._shouldSkipFocusEvent(event)) {
return
}
this.callBase.apply(this, arguments);
this._toggleFocusClass(true, this.$element())
},
_focusOutHandler(event) {
if ((0, _renderer.default)(event.target).is(this._$viewsWrapper)) {
var _this$_additionalView2;
this._view.option("contouredDate", null);
null === (_this$_additionalView2 = this._additionalView) || void 0 === _this$_additionalView2 || _this$_additionalView2.option("contouredDate", null)
}
if (this._shouldSkipFocusEvent(event)) {
return
}
this.callBase.apply(this, arguments);
this._toggleFocusClass(false, this.$element())
},
_updateViewsOption(optionName, newValue) {
var _this$_additionalView3, _this$_beforeView, _this$_afterView;
this._view.option(optionName, newValue);
null === (_this$_additionalView3 = this._additionalView) || void 0 === _this$_additionalView3 || _this$_additionalView3.option(optionName, newValue);
null === (_this$_beforeView = this._beforeView) || void 0 === _this$_beforeView || _this$_beforeView.option(optionName, newValue);
null === (_this$_afterView = this._afterView) || void 0 === _this$_afterView || _this$_afterView.option(optionName, newValue)
},
_setViewsMinOption(min) {
this._restoreViewsMinMaxOptions();
this.option("_rangeMin", this._convertToDate(min));
this._updateViewsOption("min", this._getMinDate())
},
_setViewsMaxOption(max) {
this._restoreViewsMinMaxOptions();
this.option("_rangeMax", this._convertToDate(max));
this._updateViewsOption("max", this._getMaxDate())
},
_restoreViewsMinMaxOptions() {
this._resetActiveState();
this.option({
_rangeMin: null,
_rangeMax: null
});
this._updateViewsOption("min", this._getMinDate());
this._updateViewsOption("max", this._getMaxDate())
},
_updateNavigatorLabels() {
let zoomLevel = this.option("zoomLevel");
zoomLevel = zoomLevel.charAt(0).toUpperCase() + zoomLevel.slice(1);
const captionButtonText = this._navigator._caption.option("text");
const localizedPrevButtonLabel = _message.default.format(`dxCalendar-previous${zoomLevel}ButtonLabel`);
const localizedCaptionLabel = _message.default.format(`dxCalendar-caption${zoomLevel}Label`);
const localizedNextButtonLabel = _message.default.format(`dxCalendar-next${zoomLevel}ButtonLabel`);
this.setAria("label", localizedPrevButtonLabel, this._navigator._prevButton.$element());
this.setAria("label", `${captionButtonText}. ${localizedCaptionLabel}`, this._navigator._caption.$element());
this.setAria("label", localizedNextButtonLabel, this._navigator._nextButton.$element())
},
_updateAriaSelected(value, previousValue) {
previousValue.forEach((item => {
this.setAria("selected", false, this._view._getCellByDate(item))
}));
value.forEach((item => {
this.setAria("selected", true, this._view._getCellByDate(item))
}));
if (this.option("viewsCount") > 1) {
previousValue.forEach((item => {
this.setAria("selected", false, this._additionalView._getCellByDate(item))
}));
value.forEach((item => {
this.setAria("selected", true, this._additionalView._getCellByDate(item))
}))
}
},
_updateAriaId(value) {
value = value ?? this.option("currentDate");
const ariaId = `dx-${new _guid.default}`;
const view = this._getActiveView(value);
const $newCell = view._getCellByDate(value);
this.setAria("id", ariaId, $newCell);
this.setAria("activedescendant", ariaId);
this._onContouredChanged(ariaId)
},
_suppressingNavigation(callback, args) {
this._suppressNavigation = true;
callback.apply(this, args);
delete this._suppressNavigation
},
_optionChanged(args) {
const {
value: value,
previousValue: previousValue
} = args;
switch (args.name) {
case "width":
this.callBase(args);
this._clearViewWidthCache();
break;
case "min":
case "max":
this.min = void 0;
this.max = void 0;
this._suppressingNavigation(this._updateCurrentDate, [this.option("currentDate")]);
this._refreshViews();
this._renderNavigator();
break;
case "selectionMode":
this._refreshSelectionStrategy();
this._initCurrentDate();
break;
case "selectWeekOnClick":
case "_todayDate":
case "showWeekNumbers":
case "weekNumberRule":
this._refreshViews();
break;
case "firstDayOfWeek":
this._refreshViews();
this._updateButtonsVisibility();
break;
case "focusStateEnabled":
case "disabledDates":
case "dateSerializationFormat":
case "cellTemplate":
case "showTodayButton":
this._invalidate();
break;
case "currentDate":
this.setAria("id", void 0, this._view._getCellByDate(previousValue));
this._updateCurrentDate(value);
break;
case "zoomLevel":
this.$element().removeClass(`dx-calendar-view-${previousValue}`);
this._correctZoomLevel();
this._refreshViews();
this._renderNavigator();
this._updateAriaId();
this._updateNavigatorLabels();
break;
case "minZoomLevel":
case "maxZoomLevel":
this._correctZoomLevel();
this._updateButtonsVisibility();
break;
case "value":
this._selectionStrategy.processValueChanged(value, previousValue);
this._setSubmitValue(value);
this.callBase(args);
break;
case "viewsCount":
this._refreshViews();
this._renderNavigator();
break;
case "onCellClick":
this._view.option("onCellClick", value);
break;
case "onContouredChanged":
this._onContouredChanged = this._createActionByOption("onContouredChanged");
break;
case "skipFocusCheck":
break;
default:
this.callBase(args)
}
},
getContouredDate() {
return this._view.option("contouredDate")
}
});
(0, _component_registrator.default)("dxCalendar", Calendar);
exports.default = Calendar
},
37427:
/*!**************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.multiple.selection.strategy.js ***!
\**************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _m_calendarSelection = (obj = __webpack_require__( /*! ./m_calendar.selection.strategy */ 49427), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
class CalendarMultiSelectionStrategy extends _m_calendarSelection.default {
constructor(component) {
super(component);
this.NAME = "MultiSelection"
}
getViewOptions() {
return {
value: this.dateOption("value"),
range: [],
selectionMode: "multiple",
onWeekNumberClick: this._shouldHandleWeekNumberClick() ? this._weekNumberClickHandler.bind(this) : null
}
}
selectValue(selectedValue, e) {
const value = [...this.dateOption("value")];
const alreadySelectedIndex = value.findIndex((date => (null === date || void 0 === date ? void 0 : date.toDateString()) === selectedValue.toDateString()));
if (alreadySelectedIndex > -1) {
value.splice(alreadySelectedIndex, 1)
} else {
value.push(selectedValue)
}
this.skipNavigate();
this._updateCurrentDate(selectedValue);
this._currentDateChanged = true;
this.dateValue(value, e)
}
updateAriaSelected(value, previousValue) {
value ?? (value = this.dateOption("value"));
previousValue ?? (previousValue = []);
super.updateAriaSelected(value, previousValue)
}
getDefaultCurrentDate() {
const dates = this.dateOption("value").filter((value => value));
return this._getLowestDateInArray(dates)
}
restoreValue() {
this.calendar.option("value", [])
}
_weekNumberClickHandler(_ref) {
let {
rowDates: rowDates,
event: event
} = _ref;
const selectedDates = rowDates.filter((date => !this._isDateDisabled(date)));
this.dateValue(selectedDates, event)
}
}
exports.default = CalendarMultiSelectionStrategy
},
35506:
/*!********************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.navigator.js ***!
\********************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008));
var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811);
var _widget = _interopRequireDefault(__webpack_require__( /*! ../widget */ 79371));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
class Navigator extends _widget.default {
_getDefaultOptions() {
return _extends({}, super._getDefaultOptions(), {
onClick: void 0,
onCaptionClick: void 0,
type: "normal",
stylingMode: "outlined",
text: ""
})
}
_defaultOptionsRules() {
return super._defaultOptionsRules().concat([{
device: () => (0, _themes.isMaterial)(),
options: {
type: "default",
stylingMode: "text"
}
}, {
device: () => (0, _themes.isFluent)(),
options: {
type: "normal",
stylingMode: "text"
}
}])
}
_init() {
super._init();
this._initActions()
}
_initActions() {
this._clickAction = this._createActionByOption("onClick");
this._captionClickAction = this._createActionByOption("onCaptionClick")
}
_initMarkup() {
super._initMarkup();
(0, _renderer.default)(this.element()).addClass("dx-calendar-navigator");
this._renderButtons();
this._renderCaption()
}
_renderButtons() {
const {
rtlEnabled: rtlEnabled,
type: type,
stylingMode: stylingMode,
focusStateEnabled: focusStateEnabled
} = this.option();
this._prevButton = this._createComponent((0, _renderer.default)(" "), _button.default, {
focusStateEnabled: focusStateEnabled,
icon: rtlEnabled ? "chevronright" : "chevronleft",
onClick: e => {
this._clickAction({
direction: -1,
event: e
})
},
type: type,
stylingMode: stylingMode,
integrationOptions: {}
});
const $prevButton = (0, _renderer.default)(this._prevButton.element()).addClass("dx-calendar-navigator-previous-view").addClass("dx-calendar-navigator-previous-month");
this._nextButton = this._createComponent((0, _renderer.default)(" "), _button.default, {
focusStateEnabled: focusStateEnabled,
icon: rtlEnabled ? "chevronleft" : "chevronright",
onClick: e => {
this._clickAction({
direction: 1,
event: e
})
},
type: type,
stylingMode: stylingMode,
integrationOptions: {}
});
const $nextButton = (0, _renderer.default)(this._nextButton.element()).addClass("dx-calendar-navigator-next-view").addClass("dx-calendar-navigator-next-month");
this._caption = this._createComponent((0, _renderer.default)(" ").addClass("dx-calendar-caption-button"), _button.default, {
focusStateEnabled: focusStateEnabled,
onClick: e => {
this._captionClickAction({
event: e
})
},
type: type,
stylingMode: stylingMode,
template: (_, content) => {
const {
text: text
} = this.option();
const viewCaptionTexts = text.split(" - ");
viewCaptionTexts.forEach((captionText => {
(0, _renderer.default)(content).append((0, _renderer.default)(" ").addClass("dx-button-text").text(captionText))
}))
},
integrationOptions: {}
});
const $caption = this._caption.$element();
this.$element().append($prevButton, $caption, $nextButton)
}
_renderCaption() {
var _this$_caption;
null === (_this$_caption = this._caption) || void 0 === _this$_caption || _this$_caption.option("text", this.option("text"))
}
toggleButton(buttonPrefix, value) {
const buttonName = `_${buttonPrefix}Button`;
const button = this[buttonName];
if (button) {
button.option("disabled", value);
button.$element().toggleClass("dx-calendar-disabled-navigator-link", value)
}
}
_optionChanged(args) {
if ("text" === args.name) {
this._renderCaption()
} else {
super._optionChanged(args)
}
}
}
exports.default = Navigator
},
96218:
/*!***********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.range.selection.strategy.js ***!
\***********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _m_calendarSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.selection.strategy */ 49427));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
class CalendarRangeSelectionStrategy extends _m_calendarSelection.default {
constructor(component) {
super(component);
this.NAME = "RangeSelection"
}
getViewOptions() {
const value = this._getValue();
const range = this._getDaysInRange(value[0], value[1]);
return {
value: value,
range: range,
selectionMode: "range",
onCellHover: this._cellHoverHandler.bind(this),
onWeekNumberClick: this._shouldHandleWeekNumberClick() ? this._weekNumberClickHandler.bind(this) : null
}
}
selectValue(selectedValue, e) {
const [startDate, endDate] = this._getValue();
this.skipNavigate();
this._updateCurrentDate(selectedValue);
this._currentDateChanged = true;
if (true === this.calendar.option("_allowChangeSelectionOrder")) {
this.calendar._valueSelected = true;
if ("startDate" === this.calendar.option("_currentSelection")) {
if (this.calendar._convertToDate(selectedValue) > this.calendar._convertToDate(endDate)) {
this.dateValue([selectedValue, null], e)
} else {
this.dateValue([selectedValue, endDate], e)
}
} else if (this.calendar._convertToDate(selectedValue) >= this.calendar._convertToDate(startDate)) {
this.dateValue([startDate, selectedValue], e)
} else {
this.dateValue([selectedValue, null], e)
}
} else if (!startDate || endDate) {
this.dateValue([selectedValue, null], e)
} else {
this.dateValue(startDate < selectedValue ? [startDate, selectedValue] : [selectedValue, startDate], e)
}
}
updateAriaSelected(value, previousValue) {
value ?? (value = this._getValue());
previousValue ?? (previousValue = []);
super.updateAriaSelected(value, previousValue)
}
processValueChanged(value, previousValue) {
super.processValueChanged(value, previousValue);
const range = this._getRange();
this._updateViewsOption("range", range)
}
getDefaultCurrentDate() {
const {
_allowChangeSelectionOrder: _allowChangeSelectionOrder,
_currentSelection: _currentSelection
} = this.calendar.option();
const value = this.dateOption("value");
if (_allowChangeSelectionOrder) {
if ("startDate" === _currentSelection && value[0]) {
return value[0]
}
if ("endDate" === _currentSelection && value[1]) {
return value[1]
}
}
const dates = value.filter((value => value));
return this._getLowestDateInArray(dates)
}
restoreValue() {
this.calendar.option("value", [null, null])
}
_getValue() {
const value = this.dateOption("value");
if (!value.length) {
return value
}
let [startDate, endDate] = value;
if (startDate && endDate && startDate > endDate) {
[startDate, endDate] = [endDate, startDate]
}
return [startDate, endDate]
}
_getRange() {
const [startDate, endDate] = this._getValue();
return this._getDaysInRange(startDate, endDate)
}
_getDaysInRange(startDate, endDate) {
if (!startDate || !endDate) {
return []
}
const {
currentDate: currentDate,
viewsCount: viewsCount
} = this.calendar.option();
const isAdditionalViewDate = this.calendar._isAdditionalViewDate(currentDate);
const firstDateInViews = _date.default.getFirstMonthDate(_date.default.addDateInterval(currentDate, "month", isAdditionalViewDate ? -2 : -1));
const lastDateInViews = _date.default.getLastMonthDate(_date.default.addDateInterval(currentDate, "month", isAdditionalViewDate ? 1 : viewsCount));
const rangeStartDate = new Date(Math.max(firstDateInViews, startDate));
const rangeEndDate = new Date(Math.min(lastDateInViews, endDate));
return [..._date.default.getDatesOfInterval(rangeStartDate, rangeEndDate, 864e5), rangeEndDate]
}
_cellHoverHandler(e) {
const isMaxZoomLevel = this._isMaxZoomLevel();
const [startDate, endDate] = this._getValue();
const {
_allowChangeSelectionOrder: _allowChangeSelectionOrder,
_currentSelection: _currentSelection
} = this.calendar.option();
if (isMaxZoomLevel) {
const skipHoveredRange = _allowChangeSelectionOrder && "startDate" === _currentSelection;
if (startDate && !endDate && !skipHoveredRange) {
if (e.value > startDate) {
this._updateViewsOption("hoveredRange", this._getDaysInRange(startDate, e.value));
return
}
} else if (!startDate && endDate && !(_allowChangeSelectionOrder && "endDate" === _currentSelection)) {
if (e.value < endDate) {
this._updateViewsOption("hoveredRange", this._getDaysInRange(e.value, endDate));
return
}
} else if (startDate && endDate) {
if ("startDate" === _currentSelection && e.value < startDate) {
this._updateViewsOption("hoveredRange", this._getDaysInRange(e.value, startDate));
return
}
if ("endDate" === _currentSelection && e.value > endDate) {
this._updateViewsOption("hoveredRange", this._getDaysInRange(endDate, e.value));
return
}
}
this._updateViewsOption("hoveredRange", [])
}
}
_weekNumberClickHandler(_ref) {
let {
rowDates: rowDates,
event: event
} = _ref;
const selectedDates = rowDates.filter((date => !this._isDateDisabled(date)));
const value = selectedDates.length ? [selectedDates[0], selectedDates[selectedDates.length - 1]] : [null, null];
this.dateValue(value, event)
}
}
exports.default = CalendarRangeSelectionStrategy
},
49427:
/*!*****************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.selection.strategy.js ***!
\*****************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _date = (obj = __webpack_require__( /*! ../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
exports.default = class {
constructor(component) {
this.calendar = component
}
dateOption(optionName) {
return this.calendar._dateOption(optionName)
}
dateValue(value, e) {
this.calendar._dateValue(value, e)
}
skipNavigate() {
this.calendar._skipNavigate = true
}
updateAriaSelected(value, previousValue) {
this.calendar._updateAriaSelected(value, previousValue);
if (value[0] && this.calendar.option("currentDate").getTime() === value[0].getTime()) {
this.calendar._updateAriaId(value[0])
}
}
processValueChanged(value, previousValue) {
var _value, _previousValue;
if ((0, _type.isDefined)(value) && !Array.isArray(value)) {
value = [value]
}
if ((0, _type.isDefined)(previousValue) && !Array.isArray(previousValue)) {
previousValue = [previousValue]
}
value = (null === (_value = value) || void 0 === _value ? void 0 : _value.map((item => this._convertToDate(item)))) || [];
previousValue = (null === (_previousValue = previousValue) || void 0 === _previousValue ? void 0 : _previousValue.map((item => this._convertToDate(item)))) || [];
this._updateViewsValue(value);
this.updateAriaSelected(value, previousValue);
if (!this._currentDateChanged) {
this.calendar._initCurrentDate()
}
this._currentDateChanged = false
}
_isDateDisabled(date) {
const min = this.calendar._dateOption("min");
const max = this.calendar._dateOption("max");
const isLessThanMin = (0, _type.isDefined)(min) && date < min && !_date.default.sameDate(min, date);
const isBiggerThanMax = (0, _type.isDefined)(max) && date > max && !_date.default.sameDate(max, date);
return this.calendar._view.isDateDisabled(date) || isLessThanMin || isBiggerThanMax
}
_getLowestDateInArray(dates) {
if (dates.length) {
return new Date(Math.min(...dates))
}
}
_convertToDate(value) {
return this.calendar._convertToDate(value)
}
_isMaxZoomLevel() {
return this.calendar._isMaxZoomLevel()
}
_updateViewsOption(optionName, optionValue) {
this.calendar._updateViewsOption(optionName, optionValue)
}
_updateViewsValue(value) {
this._updateViewsOption("value", value)
}
_updateCurrentDate(value) {
this.calendar.option("currentDate", value ?? new Date)
}
_shouldHandleWeekNumberClick() {
const {
selectionMode: selectionMode,
selectWeekOnClick: selectWeekOnClick
} = this.calendar.option();
return selectWeekOnClick && "single" !== selectionMode
}
}
},
99324:
/*!************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.single.selection.strategy.js ***!
\************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _m_calendarSelection = (obj = __webpack_require__( /*! ./m_calendar.selection.strategy */ 49427), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
class CalendarSingleSelectionStrategy extends _m_calendarSelection.default {
constructor(component) {
super(component);
this.NAME = "SingleSelection"
}
getViewOptions() {
return {
value: this.dateOption("value"),
range: [],
selectionMode: "single"
}
}
selectValue(selectedValue, e) {
this.skipNavigate();
this.dateValue(selectedValue, e)
}
updateAriaSelected(value, previousValue) {
value ?? (value = [this.dateOption("value")]);
previousValue ?? (previousValue = []);
super.updateAriaSelected(value, previousValue)
}
getDefaultCurrentDate() {
return this.dateOption("value")
}
restoreValue() {
this.calendar.option("value", null)
}
_updateViewsValue(value) {
this._updateViewsOption("value", value[0])
}
}
exports.default = CalendarSingleSelectionStrategy
},
48928:
/*!****************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.views.js ***!
\****************************************************************************************/
function(__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 */ 73349));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198));
var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500));
var _m_calendar = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.base_view */ 69505));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const Views = {
month: _m_calendar.default.inherit({
_getViewName: () => "month",
_getCurrentDateFormat: () => "longdate",
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
firstDayOfWeek: 0,
rowCount: 6,
colCount: 7
})
},
_renderImpl() {
this.callBase();
this._renderHeader()
},
_renderBody() {
this.callBase();
this._$table.find(".dx-calendar-other-view").addClass("dx-calendar-other-month")
},
_renderFocusTarget: _common.noop,
_renderHeader() {
const $headerRow = (0, _renderer.default)("");
const $header = (0, _renderer.default)("").append($headerRow);
this._$table.prepend($header);
for (let colIndex = 0, colCount = this.option("colCount"); colIndex < colCount; colIndex++) {
this._renderHeaderCell(colIndex, $headerRow)
}
if (this.option("showWeekNumbers")) {
this._renderWeekHeaderCell($headerRow)
}
},
_renderHeaderCell(cellIndex, $headerRow) {
const {
firstDayOfWeek: firstDayOfWeek
} = this.option();
const {
full: fullCaption,
abbreviated: abbrCaption
} = this._getDayCaption(firstDayOfWeek + cellIndex);
const $cell = (0, _renderer.default)("").attr({
scope: "col",
abbr: fullCaption
}).text(abbrCaption);
$headerRow.append($cell)
},
_renderWeekHeaderCell($headerRow) {
const $weekNumberHeaderCell = (0, _renderer.default)(" | ").attr({
scope: "col",
abbr: "WeekNumber",
class: "dx-week-number-header"
});
$headerRow.prepend($weekNumberHeaderCell)
},
_renderWeekNumberCell(rowData) {
const {
showWeekNumbers: showWeekNumbers,
cellTemplate: cellTemplate,
selectionMode: selectionMode,
selectWeekOnClick: selectWeekOnClick
} = this.option();
if (!showWeekNumbers) {
return
}
const weekNumber = this._getWeekNumber(rowData.prevCellDate);
const cell = _dom_adapter.default.createElement("td");
const $cell = (0, _renderer.default)(cell);
cell.className = "dx-calendar-week-number-cell";
if ("single" !== selectionMode && selectWeekOnClick) {
$cell.addClass("dx-calendar-week-selection")
}
if (cellTemplate) {
cellTemplate.render(this._prepareCellTemplateData(weekNumber, -1, $cell))
} else {
cell.innerHTML = weekNumber
}
rowData.row.prepend(cell);
this.setAria({
role: "gridcell",
label: `Week ${weekNumber}`
}, $cell)
},
_getWeekNumber(date) {
const {
weekNumberRule: weekNumberRule,
firstDayOfWeek: firstDayOfWeek
} = this.option();
if ("auto" === weekNumberRule) {
return _date.default.getWeekNumber(date, firstDayOfWeek, 1 === firstDayOfWeek ? "firstFourDays" : "firstDay")
}
return _date.default.getWeekNumber(date, firstDayOfWeek, weekNumberRule)
},
getNavigatorCaption() {
return _date2.default.format(this.option("date"), "monthandyear")
},
_isTodayCell(cellDate) {
const today = this.option("_todayDate")();
return _date.default.sameDate(cellDate, today)
},
_isDateOutOfRange(cellDate) {
const minDate = this.option("min");
const maxDate = this.option("max");
return !_date.default.dateInRange(cellDate, minDate, maxDate, "date")
},
_isOtherView(cellDate) {
return cellDate.getMonth() !== this.option("date").getMonth()
},
_isStartDayOfMonth(cellDate) {
return _date.default.sameDate(cellDate, _date.default.getFirstMonthDate(this.option("date")))
},
_isEndDayOfMonth(cellDate) {
return _date.default.sameDate(cellDate, _date.default.getLastMonthDate(this.option("date")))
},
_getCellText: cellDate => _date2.default.format(cellDate, "d"),
_getDayCaption(day) {
const daysInWeek = this.option("colCount");
const dayIndex = day % daysInWeek;
return {
full: _date2.default.getDayNames()[dayIndex],
abbreviated: _date2.default.getDayNames("abbreviated")[dayIndex]
}
},
_getFirstCellData() {
const {
firstDayOfWeek: firstDayOfWeek
} = this.option();
const firstDay = _date.default.getFirstMonthDate(this.option("date"));
let firstMonthDayOffset = firstDayOfWeek - firstDay.getDay();
const daysInWeek = this.option("colCount");
if (firstMonthDayOffset >= 0) {
firstMonthDayOffset -= daysInWeek
}
firstDay.setDate(firstDay.getDate() + firstMonthDayOffset);
return firstDay
},
_getNextCellData(date) {
date = new Date(date);
date.setDate(date.getDate() + 1);
return date
},
_getCellByDate(date) {
return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(date,_date.default.getShortDateFormat())}']`)
},
isBoundary(date) {
return _date.default.sameMonthAndYear(date, this.option("min")) || _date.default.sameMonthAndYear(date, this.option("max"))
},
_getDefaultDisabledDatesHandler: disabledDates => function(args) {
const isDisabledDate = disabledDates.some((item => _date.default.sameDate(item, args.date)));
if (isDisabledDate) {
return true
}
}
}),
year: _m_calendar.default.inherit({
_getViewName: () => "year",
_getCurrentDateFormat: () => "monthandyear",
_isTodayCell(cellDate) {
const today = this.option("_todayDate")();
return _date.default.sameMonthAndYear(cellDate, today)
},
_isDateOutOfRange(cellDate) {
return !_date.default.dateInRange(cellDate, _date.default.getFirstMonthDate(this.option("min")), _date.default.getLastMonthDate(this.option("max")))
},
_isOtherView: () => false,
_isStartDayOfMonth: () => false,
_isEndDayOfMonth: () => false,
_getCellText: cellDate => _date2.default.getMonthNames("abbreviated")[cellDate.getMonth()],
_getFirstCellData() {
const currentDate = this.option("date");
const data = new Date(currentDate);
data.setDate(1);
data.setMonth(0);
return data
},
_getNextCellData(date) {
date = new Date(date);
date.setMonth(date.getMonth() + 1);
return date
},
_getCellByDate(date) {
const foundDate = new Date(date);
foundDate.setDate(1);
return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(foundDate,_date.default.getShortDateFormat())}']`)
},
getNavigatorCaption() {
return _date2.default.format(this.option("date"), "yyyy")
},
isBoundary(date) {
return _date.default.sameYear(date, this.option("min")) || _date.default.sameYear(date, this.option("max"))
},
_renderWeekNumberCell: _common.noop
}),
decade: _m_calendar.default.inherit({
_getViewName: () => "decade",
_isTodayCell(cellDate) {
const today = this.option("_todayDate")();
return _date.default.sameYear(cellDate, today)
},
_isDateOutOfRange(cellDate) {
const min = this.option("min");
const max = this.option("max");
return !_date.default.dateInRange(cellDate.getFullYear(), min && min.getFullYear(), max && max.getFullYear())
},
_isOtherView(cellDate) {
const date = new Date(cellDate);
date.setMonth(1);
return !_date.default.sameDecade(date, this.option("date"))
},
_isStartDayOfMonth: () => false,
_isEndDayOfMonth: () => false,
_getCellText: cellDate => _date2.default.format(cellDate, "yyyy"),
_getFirstCellData() {
const year = _date.default.getFirstYearInDecade(this.option("date")) - 1;
return _date.default.createDateWithFullYear(year, 0, 1)
},
_getNextCellData(date) {
date = new Date(date);
date.setFullYear(date.getFullYear() + 1);
return date
},
getNavigatorCaption() {
const currentDate = this.option("date");
const firstYearInDecade = _date.default.getFirstYearInDecade(currentDate);
const startDate = new Date(currentDate);
const endDate = new Date(currentDate);
startDate.setFullYear(firstYearInDecade);
endDate.setFullYear(firstYearInDecade + 9);
return `${_date2.default.format(startDate,"yyyy")}-${_date2.default.format(endDate,"yyyy")}`
},
_isValueOnCurrentView: (currentDate, value) => _date.default.sameDecade(currentDate, value),
_getCellByDate(date) {
const foundDate = new Date(date);
foundDate.setDate(1);
foundDate.setMonth(0);
return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(foundDate,_date.default.getShortDateFormat())}']`)
},
isBoundary(date) {
return _date.default.sameDecade(date, this.option("min")) || _date.default.sameDecade(date, this.option("max"))
},
_renderWeekNumberCell: _common.noop
}),
century: _m_calendar.default.inherit({
_getViewName: () => "century",
_isTodayCell(cellDate) {
const today = this.option("_todayDate")();
return _date.default.sameDecade(cellDate, today)
},
_isDateOutOfRange(cellDate) {
const decade = _date.default.getFirstYearInDecade(cellDate);
const minDecade = _date.default.getFirstYearInDecade(this.option("min"));
const maxDecade = _date.default.getFirstYearInDecade(this.option("max"));
return !_date.default.dateInRange(decade, minDecade, maxDecade)
},
_isOtherView(cellDate) {
const date = new Date(cellDate);
date.setMonth(1);
return !_date.default.sameCentury(date, this.option("date"))
},
_isStartDayOfMonth: () => false,
_isEndDayOfMonth: () => false,
_getCellText(cellDate) {
const startDate = _date2.default.format(cellDate, "yyyy");
const endDate = new Date(cellDate);
endDate.setFullYear(endDate.getFullYear() + 9);
return `${startDate} - ${_date2.default.format(endDate,"yyyy")}`
},
_getFirstCellData() {
const decade = _date.default.getFirstDecadeInCentury(this.option("date")) - 10;
return _date.default.createDateWithFullYear(decade, 0, 1)
},
_getNextCellData(date) {
date = new Date(date);
date.setFullYear(date.getFullYear() + 10);
return date
},
_getCellByDate(date) {
const foundDate = new Date(date);
foundDate.setDate(1);
foundDate.setMonth(0);
foundDate.setFullYear(_date.default.getFirstYearInDecade(foundDate));
return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(foundDate,_date.default.getShortDateFormat())}']`)
},
getNavigatorCaption() {
const currentDate = this.option("date");
const firstDecadeInCentury = _date.default.getFirstDecadeInCentury(currentDate);
const startDate = new Date(currentDate);
const endDate = new Date(currentDate);
startDate.setFullYear(firstDecadeInCentury);
endDate.setFullYear(firstDecadeInCentury + 99);
return `${_date2.default.format(startDate,"yyyy")}-${_date2.default.format(endDate,"yyyy")}`
},
isBoundary(date) {
return _date.default.sameCentury(date, this.option("min")) || _date.default.sameCentury(date, this.option("max"))
},
_renderWeekNumberCell: _common.noop
})
};
exports.default = Views
},
12825:
/*!*******************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/async.js ***!
\*******************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.async */ 25970));
_interopRequireDefault(__webpack_require__( /*! ./edit */ 48302));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const TypedCollectionWidget = _uiCollection_widget.default;
exports.default = TypedCollectionWidget
},
24924:
/*!******************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/base.js ***!
\******************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.base */ 19982));
_interopRequireDefault(__webpack_require__( /*! ../widget */ 79371));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const TypedCollectionWidget = _uiCollection_widget.default;
exports.default = TypedCollectionWidget
},
48302:
/*!******************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/edit.js ***!
\******************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.edit */ 11050));
_interopRequireDefault(__webpack_require__( /*! ./base */ 24924));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const TypedCollectionWidget = _uiCollection_widget.default;
exports.default = TypedCollectionWidget
},
16200:
/*!**************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/hierarchical.js ***!
\**************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/hierarchical_collection/ui.hierarchical_collection_widget */ 65810));
_interopRequireDefault(__webpack_require__( /*! ./edit */ 48302));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const TypedCollectionWidget = _ui.default;
exports.default = TypedCollectionWidget
},
11803:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/live_update.js ***!
\*************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.live_update */ 69010));
_interopRequireDefault(__webpack_require__( /*! ./edit */ 48302));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const TypedCollectionWidget = _uiCollection_widget.default;
exports.default = TypedCollectionWidget
},
88895:
/*!***************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.async.js ***!
\***************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _m_collection_widget = (obj = __webpack_require__( /*! ./m_collection_widget.edit */ 61032), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
const AsyncCollectionWidget = _m_collection_widget.default.inherit({
_initMarkup() {
this._deferredItems = [];
this.callBase()
},
_renderItemContent(args) {
const renderContentDeferred = (0, _deferred.Deferred)();
const itemDeferred = (0, _deferred.Deferred)();
this._deferredItems[args.index] = itemDeferred;
const $itemContent = this.callBase.call(this, args);
itemDeferred.done((() => {
renderContentDeferred.resolve($itemContent)
}));
return renderContentDeferred.promise()
},
_onItemTemplateRendered(itemTemplate, renderArgs) {
return () => {
this._deferredItems[renderArgs.index].resolve()
}
},
_postProcessRenderItems: _common.noop,
_renderItemsAsync() {
const d = (0, _deferred.Deferred)();
_deferred.when.apply(this, this._deferredItems).done((() => {
this._postProcessRenderItems();
d.resolve()
}));
return d.promise()
},
_clean() {
this.callBase();
this._deferredItems = []
}
});
exports.default = AsyncCollectionWidget
},
75900:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.base.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _action = _interopRequireDefault(__webpack_require__( /*! ../../../core/action */ 62414));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _element = __webpack_require__( /*! ../../../core/element */ 6415);
var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../core/guid */ 73176));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _bindable_template = __webpack_require__( /*! ../../../core/templates/bindable_template */ 93280);
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _template_manager = __webpack_require__( /*! ../../../core/utils/template_manager */ 69697);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _data_helper = _interopRequireDefault(__webpack_require__( /*! ../../../data_helper */ 53305));
var _click = __webpack_require__( /*! ../../../events/click */ 95429);
var _contextmenu = __webpack_require__( /*! ../../../events/contextmenu */ 49166);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _hold = _interopRequireDefault(__webpack_require__( /*! ../../../events/hold */ 11699));
var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../events/pointer */ 93786));
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _selectors = __webpack_require__( /*! ../../../ui/widget/selectors */ 31421);
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390));
var _m_item = _interopRequireDefault(__webpack_require__( /*! ./m_item */ 1893));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
};
return _extends.apply(this, arguments)
}
const ITEM_CLASS = "dx-item";
const ITEM_PATH_REGEX = /^([^.]+\[\d+\]\.)+([\w.]+)$/;
const CollectionWidget = _ui.default.inherit({
_activeStateUnit: `.${ITEM_CLASS}`,
_supportedKeys() {
const move = function(location, e) {
if (!(0, _index.isCommandKeyPressed)(e)) {
e.preventDefault();
e.stopPropagation();
this._moveFocus(location, e)
}
};
return (0, _extend.extend)(this.callBase(), {
space: function(e) {
e.preventDefault();
this._enterKeyHandler(e)
},
enter: this._enterKeyHandler,
leftArrow: move.bind(this, "left"),
rightArrow: move.bind(this, "right"),
upArrow: move.bind(this, "up"),
downArrow: move.bind(this, "down"),
pageUp: move.bind(this, "up"),
pageDown: move.bind(this, "down"),
home: move.bind(this, "first"),
end: move.bind(this, "last")
})
},
_enterKeyHandler(e) {
const $itemElement = (0, _renderer.default)(this.option("focusedElement"));
if (!$itemElement.length) {
return
}
const itemData = this._getItemData($itemElement);
if (null !== itemData && void 0 !== itemData && itemData.onClick) {
this._itemEventHandlerByHandler($itemElement, itemData.onClick, {
event: e
})
}
this._itemClickHandler((0, _extend.extend)({}, e, {
target: $itemElement.get(0),
currentTarget: $itemElement.get(0)
}))
},
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
selectOnFocus: false,
loopItemFocus: true,
items: [],
itemTemplate: "item",
onItemRendered: null,
onItemClick: null,
onItemHold: null,
itemHoldTimeout: 750,
onItemContextMenu: null,
onFocusedItemChanged: null,
noDataText: _message.default.format("dxCollectionWidget-noDataText"),
encodeNoDataText: false,
dataSource: null,
_dataController: null,
_itemAttributes: {},
itemTemplateProperty: "template",
focusOnSelectedItem: true,
focusedElement: null,
displayExpr: void 0,
disabledExpr: data => data ? data.disabled : void 0,
visibleExpr: data => data ? data.visible : void 0
})
},
_init() {
this._compileDisplayGetter();
this._initDataController();
this.callBase();
this._cleanRenderedItems();
this._refreshDataSource()
},
_compileDisplayGetter() {
const displayExpr = this.option("displayExpr");
this._displayGetter = displayExpr ? (0, _data.compileGetter)(this.option("displayExpr")) : void 0
},
_initTemplates() {
this._initItemsFromMarkup();
this._initDefaultItemTemplate();
this.callBase()
},
_getAnonymousTemplateName: () => "item",
_initDefaultItemTemplate() {
const fieldsMap = this._getFieldsMap();
this._templateManager.addDefaultTemplates({
item: new _bindable_template.BindableTemplate((($container, data) => {
if ((0, _type.isPlainObject)(data)) {
this._prepareDefaultItemTemplate(data, $container)
} else {
if (fieldsMap && (0, _type.isFunction)(fieldsMap.text)) {
data = fieldsMap.text(data)
}
$container.text(String((0, _common.ensureDefined)(data, "")))
}
}), this._getBindableFields(), this.option("integrationOptions.watchMethod"), fieldsMap)
})
},
_getBindableFields: () => ["text", "html"],
_getFieldsMap() {
if (this._displayGetter) {
return {
text: this._displayGetter
}
}
},
_prepareDefaultItemTemplate(data, $container) {
if ((0, _type.isDefined)(data.text)) {
$container.text(data.text)
}
if ((0, _type.isDefined)(data.html)) {
$container.html(data.html)
}
},
_initItemsFromMarkup() {
const rawItems = (0, _template_manager.findTemplates)(this.$element(), "dxItem");
if (!rawItems.length || this.option("items").length) {
return
}
const items = rawItems.map((_ref => {
let {
element: element,
options: options
} = _ref;
const isTemplateRequired = /\S/.test(element.innerHTML) && !options.template;
if (isTemplateRequired) {
options.template = this._prepareItemTemplate(element)
} else {
(0, _renderer.default)(element).remove()
}
return options
}));
this.option("items", items)
},
_prepareItemTemplate(item) {
const templateId = "tmpl-" + new _guid.default;
const $template = (0, _renderer.default)(item).detach().clone().removeAttr("data-options").addClass("dx-template-wrapper");
this._saveTemplate(templateId, $template);
return templateId
},
_dataSourceOptions: () => ({
paginate: false
}),
_cleanRenderedItems() {
this._renderedItemsCount = 0
},
_focusTarget() {
return this.$element()
},
_focusInHandler(e) {
this.callBase.apply(this, arguments);
if (!this._isFocusTarget(e.target)) {
return
}
const $focusedElement = (0, _renderer.default)(this.option("focusedElement"));
if ($focusedElement.length) {
this._setFocusedItem($focusedElement)
} else {
const $activeItem = this._getActiveItem();
if ($activeItem.length) {
this.option("focusedElement", (0, _element.getPublicElement)($activeItem))
}
}
},
_focusOutHandler() {
this.callBase.apply(this, arguments);
const $target = (0, _renderer.default)(this.option("focusedElement"));
this._updateFocusedItemState($target, false)
},
_findActiveTarget($element) {
return $element.find(this._activeStateUnit)
},
_getActiveItem(last) {
const $focusedElement = (0, _renderer.default)(this.option("focusedElement"));
if ($focusedElement.length) {
return $focusedElement
}
let index = this.option("focusOnSelectedItem") ? this.option("selectedIndex") : 0;
const activeElements = this._getActiveElement();
const lastIndex = activeElements.length - 1;
if (index < 0) {
index = last ? lastIndex : 0
}
return activeElements.eq(index)
},
_moveFocus(location) {
const $items = this._getAvailableItems();
let $newTarget;
switch (location) {
case "pageup":
case "up":
$newTarget = this._prevItem($items);
break;
case "pagedown":
case "down":
$newTarget = this._nextItem($items);
break;
case "right":
$newTarget = this.option("rtlEnabled") ? this._prevItem($items) : this._nextItem($items);
break;
case "left":
$newTarget = this.option("rtlEnabled") ? this._nextItem($items) : this._prevItem($items);
break;
case "first":
$newTarget = $items.first();
break;
case "last":
$newTarget = $items.last();
break;
default:
return false
}
if (0 !== $newTarget.length) {
this.option("focusedElement", (0, _element.getPublicElement)($newTarget))
}
},
_getVisibleItems($itemElements) {
$itemElements = $itemElements || this._itemElements();
return $itemElements.filter(":visible")
},
_getAvailableItems($itemElements) {
return this._getVisibleItems($itemElements)
},
_prevItem($items) {
const $target = this._getActiveItem();
const targetIndex = $items.index($target);
const $last = $items.last();
let $item = (0, _renderer.default)($items[targetIndex - 1]);
const loop = this.option("loopItemFocus");
if (0 === $item.length && loop) {
$item = $last
}
return $item
},
_nextItem($items) {
const $target = this._getActiveItem(true);
const targetIndex = $items.index($target);
const $first = $items.first();
let $item = (0, _renderer.default)($items[targetIndex + 1]);
const loop = this.option("loopItemFocus");
if (0 === $item.length && loop) {
$item = $first
}
return $item
},
_selectFocusedItem($target) {
this.selectItem($target)
},
_updateFocusedItemState(target, isFocused, needCleanItemId) {
const $target = (0, _renderer.default)(target);
if ($target.length) {
this._refreshActiveDescendant();
this._refreshItemId($target, needCleanItemId);
this._toggleFocusClass(isFocused, $target)
}
this._updateParentActiveDescendant()
},
_refreshActiveDescendant($target) {
this.setAria("activedescendant", (0, _type.isDefined)(this.option("focusedElement")) ? this.getFocusedItemId() : null, $target)
},
_refreshItemId($target, needCleanItemId) {
if (!needCleanItemId && this.option("focusedElement")) {
this.setAria("id", this.getFocusedItemId(), $target)
} else {
this.setAria("id", null, $target)
}
},
_isDisabled: $element => $element && "true" === (0, _renderer.default)($element).attr("aria-disabled"),
_setFocusedItem($target) {
if (!$target || !$target.length) {
return
}
this._updateFocusedItemState($target, true);
this.onFocusedItemChanged(this.getFocusedItemId());
const {
selectOnFocus: selectOnFocus
} = this.option();
const isTargetDisabled = this._isDisabled($target);
if (selectOnFocus && !isTargetDisabled) {
this._selectFocusedItem($target)
}
},
_findItemElementByItem(item) {
let result = (0, _renderer.default)();
const that = this;
this.itemElements().each((function() {
const $item = (0, _renderer.default)(this);
if ($item.data(that._itemDataKey()) === item) {
result = $item;
return false
}
}));
return result
},
_getIndexByItem(item) {
return this.option("items").indexOf(item)
},
_itemOptionChanged(item, property, value, oldValue) {
const $item = this._findItemElementByItem(item);
if (!$item.length) {
return
}
if (!this.constructor.ItemClass.getInstance($item).setDataField(property, value)) {
this._refreshItem($item, item)
}
const isDisabling = "disabled" === property && value;
if (isDisabling) {
this._resetItemFocus($item)
}
},
_resetItemFocus($item) {
if ($item.is(this.option("focusedElement"))) {
this.option("focusedElement", null)
}
},
_refreshItem($item) {
const itemData = this._getItemData($item);
const index = $item.data(this._itemIndexKey());
this._renderItem(this._renderedItemsCount + index, itemData, null, $item)
},
_updateParentActiveDescendant: _common.noop,
_optionChanged(args) {
if ("items" === args.name) {
const matches = args.fullName.match(ITEM_PATH_REGEX);
if (matches && matches.length) {
const property = matches[matches.length - 1];
const itemPath = args.fullName.replace(`.${property}`, "");
const item = this.option(itemPath);
this._itemOptionChanged(item, property, args.value, args.previousValue);
return
}
}
switch (args.name) {
case "items":
case "_itemAttributes":
case "itemTemplateProperty":
case "useItemTextAsTitle":
this._cleanRenderedItems();
this._invalidate();
break;
case "dataSource":
this._refreshDataSource();
this._renderEmptyMessage();
break;
case "noDataText":
case "encodeNoDataText":
this._renderEmptyMessage();
break;
case "itemTemplate":
case "visibleExpr":
case "disabledExpr":
this._invalidate();
break;
case "onItemRendered":
this._createItemRenderAction();
break;
case "onItemClick":
case "selectOnFocus":
case "loopItemFocus":
case "focusOnSelectedItem":
break;
case "onItemHold":
case "itemHoldTimeout":
this._attachHoldEvent();
break;
case "onItemContextMenu":
this._attachContextMenuEvent();
break;
case "onFocusedItemChanged":
this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged");
break;
case "focusedElement":
this._updateFocusedItemState(args.previousValue, false, true);
this._setFocusedItem((0, _renderer.default)(args.value));
break;
case "displayExpr":
this._compileDisplayGetter();
this._initDefaultItemTemplate();
this._invalidate();
break;
default:
this.callBase(args)
}
},
_invalidate() {
this.option("focusedElement", null);
return this.callBase.apply(this, arguments)
},
_loadNextPage() {
this._expectNextPageLoading();
return this._dataController.loadNextPage()
},
_expectNextPageLoading() {
this._startIndexForAppendedItems = 0
},
_expectLastItemLoading() {
this._startIndexForAppendedItems = -1
},
_forgetNextPageLoading() {
this._startIndexForAppendedItems = null
},
_dataSourceChangedHandler(newItems) {
const items = this.option("items");
if (this._initialized && items && this._shouldAppendItems()) {
this._renderedItemsCount = items.length;
if (!this._isLastPage() || -1 !== this._startIndexForAppendedItems) {
this.option().items = items.concat(newItems.slice(this._startIndexForAppendedItems))
}
this._forgetNextPageLoading();
this._refreshContent()
} else {
this.option("items", newItems.slice())
}
},
_refreshContent() {
this._prepareContent();
this._renderContent()
},
_dataSourceLoadErrorHandler() {
this._forgetNextPageLoading();
this.option("items", this.option("items"))
},
_shouldAppendItems() {
return null != this._startIndexForAppendedItems && this._allowDynamicItemsAppend()
},
_allowDynamicItemsAppend: () => false,
_clean() {
this._cleanFocusState();
this._cleanItemContainer();
this._inkRipple && delete this._inkRipple;
this._resetActiveState()
},
_cleanItemContainer() {
(0, _renderer.default)(this._itemContainer()).empty()
},
_dispose() {
this.callBase();
clearTimeout(this._itemFocusTimeout)
},
_refresh() {
this._cleanRenderedItems();
this.callBase.apply(this, arguments)
},
_itemContainer() {
return this.$element()
},
_itemClass: () => ITEM_CLASS,
_itemContentClass() {
return this._itemClass() + "-content"
},
_selectedItemClass: () => "dx-item-selected",
_itemResponseWaitClass: () => "dx-item-response-wait",
_itemSelector() {
return `.${this._itemClass()}`
},
_itemDataKey: () => "dxItemData",
_itemIndexKey: () => "dxItemIndex",
_itemElements() {
return this._itemContainer().find(this._itemSelector())
},
_initMarkup() {
this.callBase();
this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged");
this.$element().addClass("dx-collection");
this._prepareContent()
},
_prepareContent: (0, _common.deferRenderer)((function() {
this._renderContentImpl()
})),
_renderContent() {
this._fireContentReadyAction()
},
_render() {
this.callBase();
this._attachClickEvent();
this._attachHoldEvent();
this._attachContextMenuEvent()
},
_getPointerEvent: () => _pointer.default.down,
_attachClickEvent() {
const itemSelector = this._itemSelector();
const pointerEvent = this._getPointerEvent();
const clickEventNamespace = (0, _index.addNamespace)(_click.name, this.NAME);
const pointerEventNamespace = (0, _index.addNamespace)(pointerEvent, this.NAME);
const pointerAction = new _action.default((args => {
const {
event: event
} = args;
this._itemPointerDownHandler(event)
}));
_events_engine.default.off(this._itemContainer(), clickEventNamespace, itemSelector);
_events_engine.default.off(this._itemContainer(), pointerEventNamespace, itemSelector);
_events_engine.default.on(this._itemContainer(), clickEventNamespace, itemSelector, (e => this._itemClickHandler(e)));
_events_engine.default.on(this._itemContainer(), pointerEventNamespace, itemSelector, (e => {
pointerAction.execute({
element: (0, _renderer.default)(e.target),
event: e
})
}))
},
_itemClickHandler(e, args, config) {
this._itemDXEventHandler(e, "onItemClick", args, config)
},
_itemPointerDownHandler(e) {
if (!this.option("focusStateEnabled")) {
return
}
this._itemFocusHandler = function() {
clearTimeout(this._itemFocusTimeout);
this._itemFocusHandler = null;
if (e.isDefaultPrevented()) {
return
}
const $target = (0, _renderer.default)(e.target);
const $closestItem = $target.closest(this._itemElements());
const $closestFocusable = this._closestFocusable($target);
if ($closestItem.length && this._isFocusTarget(null === $closestFocusable || void 0 === $closestFocusable ? void 0 : $closestFocusable.get(0))) {
this.option("focusedElement", (0, _element.getPublicElement)($closestItem))
}
}.bind(this);
this._itemFocusTimeout = setTimeout(this._forcePointerDownFocus.bind(this))
},
_closestFocusable($target) {
if ($target.is(_selectors.focusable)) {
return $target
}
$target = $target.parent();
while ($target.length && !_dom_adapter.default.isDocument($target.get(0)) && !_dom_adapter.default.isDocumentFragment($target.get(0))) {
if ($target.is(_selectors.focusable)) {
return $target
}
$target = $target.parent()
}
},
_forcePointerDownFocus() {
this._itemFocusHandler && this._itemFocusHandler()
},
_updateFocusState() {
this.callBase.apply(this, arguments);
this._forcePointerDownFocus()
},
_attachHoldEvent() {
const $itemContainer = this._itemContainer();
const itemSelector = this._itemSelector();
const eventName = (0, _index.addNamespace)(_hold.default.name, this.NAME);
_events_engine.default.off($itemContainer, eventName, itemSelector);
_events_engine.default.on($itemContainer, eventName, itemSelector, {
timeout: this._getHoldTimeout()
}, this._itemHoldHandler.bind(this))
},
_getHoldTimeout() {
return this.option("itemHoldTimeout")
},
_shouldFireHoldEvent() {
return this.hasActionSubscription("onItemHold")
},
_itemHoldHandler(e) {
if (this._shouldFireHoldEvent()) {
this._itemDXEventHandler(e, "onItemHold")
} else {
e.cancel = true
}
},
_attachContextMenuEvent() {
const $itemContainer = this._itemContainer();
const itemSelector = this._itemSelector();
const eventName = (0, _index.addNamespace)(_contextmenu.name, this.NAME);
_events_engine.default.off($itemContainer, eventName, itemSelector);
_events_engine.default.on($itemContainer, eventName, itemSelector, this._itemContextMenuHandler.bind(this))
},
_shouldFireContextMenuEvent() {
return this.hasActionSubscription("onItemContextMenu")
},
_itemContextMenuHandler(e) {
if (this._shouldFireContextMenuEvent()) {
this._itemDXEventHandler(e, "onItemContextMenu")
} else {
e.cancel = true
}
},
_renderContentImpl() {
const items = this.option("items") || [];
if (this._renderedItemsCount) {
this._renderItems(items.slice(this._renderedItemsCount))
} else {
this._renderItems(items)
}
},
_renderItems(items) {
if (items.length) {
(0, _iterator.each)(items, ((index, itemData) => {
this._renderItem(this._renderedItemsCount + index, itemData)
}))
}
this._renderEmptyMessage()
},
_getItemsContainer() {
return this._itemContainer()
},
_setAttributes($element) {
const attributes = _extends({}, this.option("_itemAttributes"));
const {
class: customClassValue
} = attributes;
if (customClassValue) {
const currentClassValue = $element.get(0).className;
attributes.class = [currentClassValue, customClassValue].join(" ")
}
$element.attr(attributes)
},
_renderItem(index, itemData, $container, $itemToReplace) {
const itemIndex = (null === index || void 0 === index ? void 0 : index.item) ?? index;
$container = $container || this._getItemsContainer();
const $itemFrame = this._renderItemFrame(itemIndex, itemData, $container, $itemToReplace);
this._setElementData($itemFrame, itemData, itemIndex);
this._setAttributes($itemFrame);
this._attachItemClickEvent(itemData, $itemFrame);
const $itemContent = this._getItemContent($itemFrame);
const renderContentPromise = this._renderItemContent({
index: itemIndex,
itemData: itemData,
container: (0, _element.getPublicElement)($itemContent),
contentClass: this._itemContentClass(),
defaultTemplateName: this.option("itemTemplate")
});
const that = this;
(0, _deferred.when)(renderContentPromise).done(($itemContent => {
that._postprocessRenderItem({
itemElement: $itemFrame,
itemContent: $itemContent,
itemData: itemData,
itemIndex: itemIndex
});
that._executeItemRenderAction(index, itemData, (0, _element.getPublicElement)($itemFrame))
}));
return $itemFrame
},
_getItemContent($itemFrame) {
const $itemContent = $itemFrame.find(".dx-item-content-placeholder");
$itemContent.removeClass("dx-item-content-placeholder");
return $itemContent
},
_attachItemClickEvent(itemData, $itemElement) {
if (!itemData || !itemData.onClick) {
return
}
_events_engine.default.on($itemElement, _click.name, (e => {
this._itemEventHandlerByHandler($itemElement, itemData.onClick, {
event: e
})
}))
},
_renderItemContent(args) {
const itemTemplateName = this._getItemTemplateName(args);
const itemTemplate = this._getTemplate(itemTemplateName);
this._addItemContentClasses(args);
const $templateResult = (0, _renderer.default)(this._createItemByTemplate(itemTemplate, args));
if (!$templateResult.hasClass("dx-template-wrapper")) {
return args.container
}
return this._renderItemContentByNode(args, $templateResult)
},
_renderItemContentByNode(args, $node) {
(0, _renderer.default)(args.container).replaceWith($node);
args.container = (0, _element.getPublicElement)($node);
this._addItemContentClasses(args);
return $node
},
_addItemContentClasses(args) {
const classes = [ITEM_CLASS + "-content", args.contentClass];
(0, _renderer.default)(args.container).addClass(classes.join(" "))
},
_appendItemToContainer($container, $itemFrame, index) {
$itemFrame.appendTo($container)
},
_renderItemFrame(index, itemData, $container, $itemToReplace) {
const $itemFrame = (0, _renderer.default)("");
new this.constructor.ItemClass($itemFrame, this._itemOptions(), itemData || {});
if ($itemToReplace && $itemToReplace.length) {
$itemToReplace.replaceWith($itemFrame)
} else {
this._appendItemToContainer.call(this, $container, $itemFrame, index)
}
if (this.option("useItemTextAsTitle")) {
const displayValue = this._displayGetter ? this._displayGetter(itemData) : itemData;
$itemFrame.attr("title", displayValue)
}
return $itemFrame
},
_itemOptions() {
const that = this;
return {
watchMethod: () => that.option("integrationOptions.watchMethod"),
owner: that,
fieldGetter(field) {
const expr = that.option(`${field}Expr`);
const getter = (0, _data.compileGetter)(expr);
return getter
}
}
},
_postprocessRenderItem: _common.noop,
_executeItemRenderAction(index, itemData, itemElement) {
this._getItemRenderAction()({
itemElement: itemElement,
itemIndex: index,
itemData: itemData
})
},
_setElementData(element, data, index) {
element.addClass([ITEM_CLASS, this._itemClass()].join(" ")).data(this._itemDataKey(), data).data(this._itemIndexKey(), index)
},
_createItemRenderAction() {
return this._itemRenderAction = this._createActionByOption("onItemRendered", {
element: this.element(),
excludeValidators: ["disabled", "readOnly"],
category: "rendering"
})
},
_getItemRenderAction() {
return this._itemRenderAction || this._createItemRenderAction()
},
_getItemTemplateName(args) {
const data = args.itemData;
const templateProperty = args.templateProperty || this.option("itemTemplateProperty");
const template = data && data[templateProperty];
return template || args.defaultTemplateName
},
_createItemByTemplate(itemTemplate, renderArgs) {
return itemTemplate.render({
model: renderArgs.itemData,
container: renderArgs.container,
index: renderArgs.index,
onRendered: this._onItemTemplateRendered(itemTemplate, renderArgs)
})
},
_onItemTemplateRendered: () => _common.noop,
_emptyMessageContainer() {
return this._itemContainer()
},
_renderEmptyMessage(items) {
items = items || this.option("items");
const noDataText = this.option("noDataText");
const hideNoData = !noDataText || items && items.length || this._dataController.isLoading();
if (hideNoData && this._$noData) {
this._$noData.remove();
this._$noData = null;
this.setAria("label", void 0)
}
if (!hideNoData) {
this._$noData = this._$noData || (0, _renderer.default)(" ").addClass("dx-empty-message");
this._$noData.appendTo(this._emptyMessageContainer());
if (this.option("encodeNoDataText")) {
this._$noData.text(noDataText)
} else {
this._$noData.html(noDataText)
}
}
this.$element().toggleClass("dx-empty-collection", !hideNoData)
},
_itemDXEventHandler(dxEvent, handlerOptionName, actionArgs, actionConfig) {
this._itemEventHandler(dxEvent.target, handlerOptionName, (0, _extend.extend)(actionArgs, {
event: dxEvent
}), actionConfig)
},
_itemEventHandler(initiator, handlerOptionName, actionArgs, actionConfig) {
const action = this._createActionByOption(handlerOptionName, (0, _extend.extend)({
validatingTargetName: "itemElement"
}, actionConfig));
return this._itemEventHandlerImpl(initiator, action, actionArgs)
},
_itemEventHandlerByHandler(initiator, handler, actionArgs, actionConfig) {
const action = this._createAction(handler, (0, _extend.extend)({
validatingTargetName: "itemElement"
}, actionConfig));
return this._itemEventHandlerImpl(initiator, action, actionArgs)
},
_itemEventHandlerImpl(initiator, action, actionArgs) {
const $itemElement = this._closestItemElement((0, _renderer.default)(initiator));
const args = (0, _extend.extend)({}, actionArgs);
return action((0, _extend.extend)(actionArgs, this._extendActionArgs($itemElement), args))
},
_extendActionArgs($itemElement) {
return {
itemElement: (0, _element.getPublicElement)($itemElement),
itemIndex: this._itemElements().index($itemElement),
itemData: this._getItemData($itemElement)
}
},
_closestItemElement($element) {
return (0, _renderer.default)($element).closest(this._itemSelector())
},
_getItemData(itemElement) {
return (0, _renderer.default)(itemElement).data(this._itemDataKey())
},
_getSummaryItemsSize(dimension, items, includeMargin) {
let result = 0;
if (items) {
(0, _iterator.each)(items, ((_, item) => {
if ("width" === dimension) {
result += (0, _size.getOuterWidth)(item, includeMargin || false)
} else if ("height" === dimension) {
result += (0, _size.getOuterHeight)(item, includeMargin || false)
}
}))
}
return result
},
getFocusedItemId() {
if (!this._focusedItemId) {
this._focusedItemId = `dx-${new _guid.default}`
}
return this._focusedItemId
},
itemElements() {
return this._itemElements()
},
itemsContainer() {
return this._itemContainer()
}
}).include(_data_helper.default);
CollectionWidget.ItemClass = _m_item.default;
exports.default = CollectionWidget
},
61032:
/*!**************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.edit.js ***!
\**************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
var _data_source = __webpack_require__( /*! ../../../data/data_source/data_source */ 85273);
var _utils = __webpack_require__( /*! ../../../data/data_source/utils */ 9234);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688));
var _m_selection = _interopRequireDefault(__webpack_require__( /*! ../../ui/selection/m_selection */ 23397));
var _m_collection_widget = _interopRequireDefault(__webpack_require__( /*! ./m_collection_widget.base */ 75900));
var _m_collection_widgetEditStrategy = _interopRequireDefault(__webpack_require__( /*! ./m_collection_widget.edit.strategy.plain */ 42464));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const indexExists = function(index) {
return -1 !== index
};
const CollectionWidget = _m_collection_widget.default.inherit({
_setOptionsByReference() {
this.callBase();
(0, _extend.extend)(this._optionsByReference, {
selectedItem: true
})
},
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
selectionMode: "none",
selectionRequired: false,
selectByClick: true,
selectedItems: [],
selectedItemKeys: [],
maxFilterLengthInRequest: 1500,
keyExpr: null,
selectedIndex: -1,
selectedItem: null,
onSelectionChanged: null,
onItemReordered: null,
onItemDeleting: null,
onItemDeleted: null
})
},
ctor(element, options) {
this._userOptions = options || {};
this.callBase(element, options)
},
_init() {
this._initEditStrategy();
this.callBase();
this._initKeyGetter();
this._initSelectionModule()
},
_initKeyGetter() {
this._keyGetter = (0, _data.compileGetter)(this.option("keyExpr"))
},
_getKeysByItems(selectedItems) {
return this._editStrategy.getKeysByItems(selectedItems)
},
_getItemsByKeys(selectedItemKeys, selectedItems) {
return this._editStrategy.getItemsByKeys(selectedItemKeys, selectedItems)
},
_getKeyByIndex(index) {
return this._editStrategy.getKeyByIndex(index)
},
_getIndexByKey(key) {
return this._editStrategy.getIndexByKey(key)
},
_getIndexByItemData(itemData) {
return this._editStrategy.getIndexByItemData(itemData)
},
_isKeySpecified() {
return !!this._dataController.key()
},
_getCombinedFilter() {
return this._dataController.filter()
},
key() {
if (this.option("keyExpr")) {
return this.option("keyExpr")
}
return this._dataController.key()
},
keyOf(item) {
let key = item;
if (this.option("keyExpr")) {
key = this._keyGetter(item)
} else if (this._dataController.store()) {
key = this._dataController.keyOf(item)
}
return key
},
_nullValueSelectionSupported: () => false,
_initSelectionModule() {
const that = this;
const {
itemsGetter: itemsGetter
} = that._editStrategy;
this._selection = new _m_selection.default({
allowNullValue: this._nullValueSelectionSupported(),
mode: this.option("selectionMode"),
maxFilterLengthInRequest: this.option("maxFilterLengthInRequest"),
equalByReference: !this._isKeySpecified(),
onSelectionChanged(args) {
if (args.addedItemKeys.length || args.removedItemKeys.length) {
that.option("selectedItems", that._getItemsByKeys(args.selectedItemKeys, args.selectedItems));
that._updateSelectedItems(args)
}
},
filter: that._getCombinedFilter.bind(that),
totalCount() {
const items = that.option("items");
const totalCount = that._dataController.totalCount();
return totalCount >= 0 ? totalCount : that._getItemsCount(items)
},
key: that.key.bind(that),
keyOf: that.keyOf.bind(that),
load(options) {
var _dataController$loadO;
const dataController = that._dataController;
options.customQueryParams = null === (_dataController$loadO = dataController.loadOptions()) || void 0 === _dataController$loadO ? void 0 : _dataController$loadO.customQueryParams;
options.userData = dataController.userData();
if (dataController.store()) {
return dataController.loadFromStore(options).done((loadResult => {
if (that._disposed) {
return
}
const items = (0, _utils.normalizeLoadResult)(loadResult).data;
dataController.applyMapFunction(items)
}))
}
return (0, _deferred.Deferred)().resolve(this.plainItems())
},
dataFields: () => that._dataController.select(),
plainItems: itemsGetter.bind(that._editStrategy)
})
},
_getItemsCount(items) {
return items.reduce(((itemsCount, item) => itemsCount + (item.items ? this._getItemsCount(item.items) : 1)), 0)
},
_initEditStrategy() {
const Strategy = _m_collection_widgetEditStrategy.default;
this._editStrategy = new Strategy(this)
},
_getSelectedItemIndices(keys) {
const that = this;
const indices = [];
keys = keys || this._selection.getSelectedItemKeys();
that._editStrategy.beginCache();
(0, _iterator.each)(keys, ((_, key) => {
const selectedIndex = that._getIndexByKey(key);
if (indexExists(selectedIndex)) {
indices.push(selectedIndex)
}
}));
that._editStrategy.endCache();
return indices
},
_initMarkup() {
this._rendering = true;
if (!this._dataController.isLoading()) {
this._syncSelectionOptions().done((() => this._normalizeSelectedItems()))
}
this.callBase()
},
_render() {
this.callBase();
this._rendering = false
},
_fireContentReadyAction() {
this._rendering = false;
this._rendered = true;
this.callBase.apply(this, arguments)
},
_syncSelectionOptions(byOption) {
byOption = byOption || this._chooseSelectOption();
let selectedItem;
let selectedIndex;
let selectedItemKeys;
let selectedItems;
switch (byOption) {
case "selectedIndex":
selectedItem = this._editStrategy.getItemDataByIndex(this.option("selectedIndex"));
if ((0, _type.isDefined)(selectedItem)) {
this._setOptionWithoutOptionChange("selectedItems", [selectedItem]);
this._setOptionWithoutOptionChange("selectedItem", selectedItem);
this._setOptionWithoutOptionChange("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem]))
} else {
this._setOptionWithoutOptionChange("selectedItems", []);
this._setOptionWithoutOptionChange("selectedItemKeys", []);
this._setOptionWithoutOptionChange("selectedItem", null)
}
break;
case "selectedItems":
selectedItems = this.option("selectedItems") || [];
selectedIndex = selectedItems.length ? this._editStrategy.getIndexByItemData(selectedItems[0]) : -1;
if (this.option("selectionRequired") && !indexExists(selectedIndex)) {
return this._syncSelectionOptions("selectedIndex")
}
this._setOptionWithoutOptionChange("selectedItem", selectedItems[0]);
this._setOptionWithoutOptionChange("selectedIndex", selectedIndex);
this._setOptionWithoutOptionChange("selectedItemKeys", this._editStrategy.getKeysByItems(selectedItems));
break;
case "selectedItem":
selectedItem = this.option("selectedItem");
selectedIndex = this._editStrategy.getIndexByItemData(selectedItem);
if (this.option("selectionRequired") && !indexExists(selectedIndex)) {
return this._syncSelectionOptions("selectedIndex")
}
if ((0, _type.isDefined)(selectedItem)) {
this._setOptionWithoutOptionChange("selectedItems", [selectedItem]);
this._setOptionWithoutOptionChange("selectedIndex", selectedIndex);
this._setOptionWithoutOptionChange("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem]))
} else {
this._setOptionWithoutOptionChange("selectedItems", []);
this._setOptionWithoutOptionChange("selectedItemKeys", []);
this._setOptionWithoutOptionChange("selectedIndex", -1)
}
break;
case "selectedItemKeys":
selectedItemKeys = this.option("selectedItemKeys");
if (this.option("selectionRequired")) {
const selectedItemIndex = this._getIndexByKey(selectedItemKeys[0]);
if (!indexExists(selectedItemIndex)) {
return this._syncSelectionOptions("selectedIndex")
}
}
return this._selection.setSelection(selectedItemKeys)
}
return (0, _deferred.Deferred)().resolve().promise()
},
_chooseSelectOption() {
let optionName = "selectedIndex";
const isOptionDefined = function(optionName) {
const optionValue = this.option(optionName);
const length = (0, _type.isDefined)(optionValue) && optionValue.length;
return length || optionName in this._userOptions
}.bind(this);
if (isOptionDefined("selectedItems")) {
optionName = "selectedItems"
} else if (isOptionDefined("selectedItem")) {
optionName = "selectedItem"
} else if (isOptionDefined("selectedItemKeys")) {
optionName = "selectedItemKeys"
}
return optionName
},
_compareKeys(oldKeys, newKeys) {
if (oldKeys.length !== newKeys.length) {
return false
}
for (let i = 0; i < newKeys.length; i++) {
if (oldKeys[i] !== newKeys[i]) {
return false
}
}
return true
},
_normalizeSelectedItems() {
if ("none" === this.option("selectionMode")) {
this._setOptionWithoutOptionChange("selectedItems", []);
this._syncSelectionOptions("selectedItems")
} else if ("single" === this.option("selectionMode")) {
const newSelection = this.option("selectedItems");
if (newSelection.length > 1 || !newSelection.length && this.option("selectionRequired") && this.option("items") && this.option("items").length) {
const currentSelection = this._selection.getSelectedItems();
let normalizedSelection = void 0 === newSelection[0] ? currentSelection[0] : newSelection[0];
if (void 0 === normalizedSelection) {
normalizedSelection = this._editStrategy.itemsGetter()[0]
}
if (this.option("grouped") && normalizedSelection && normalizedSelection.items) {
normalizedSelection.items = [normalizedSelection.items[0]]
}
this._selection.setSelection(this._getKeysByItems([normalizedSelection]));
this._setOptionWithoutOptionChange("selectedItems", [normalizedSelection]);
return this._syncSelectionOptions("selectedItems")
}
this._selection.setSelection(this._getKeysByItems(newSelection))
} else {
const newKeys = this._getKeysByItems(this.option("selectedItems"));
const oldKeys = this._selection.getSelectedItemKeys();
if (!this._compareKeys(oldKeys, newKeys)) {
this._selection.setSelection(newKeys)
}
}
return (0, _deferred.Deferred)().resolve().promise()
},
_itemClickHandler(e) {
let itemSelectPromise = (0, _deferred.Deferred)().resolve();
const {
callBase: callBase
} = this;
this._createAction((e => {
itemSelectPromise = this._itemSelectHandler(e.event) ?? itemSelectPromise
}), {
validatingTargetName: "itemElement"
})({
itemElement: (0, _renderer.default)(e.currentTarget),
event: e
});
itemSelectPromise.always((() => {
callBase.apply(this, arguments)
}))
},
_itemSelectHandler(e) {
var _itemSelectPromise;
let itemSelectPromise;
if (!this.option("selectByClick")) {
return
}
const $itemElement = e.currentTarget;
if (this.isItemSelected($itemElement)) {
this.unselectItem(e.currentTarget)
} else {
itemSelectPromise = this.selectItem(e.currentTarget)
}
return null === (_itemSelectPromise = itemSelectPromise) || void 0 === _itemSelectPromise ? void 0 : _itemSelectPromise.promise()
},
_selectedItemElement(index) {
return this._itemElements().eq(index)
},
_postprocessRenderItem(args) {
if ("none" !== this.option("selectionMode")) {
const $itemElement = (0, _renderer.default)(args.itemElement);
const normalizedItemIndex = this._editStrategy.getNormalizedIndex($itemElement);
const isItemSelected = this._isItemSelected(normalizedItemIndex);
this._processSelectableItem($itemElement, isItemSelected)
}
},
_processSelectableItem($itemElement, isSelected) {
$itemElement.toggleClass(this._selectedItemClass(), isSelected);
this._setAriaSelectionAttribute($itemElement, String(isSelected))
},
_updateSelectedItems(args) {
const that = this;
const {
addedItemKeys: addedItemKeys
} = args;
const {
removedItemKeys: removedItemKeys
} = args;
if (that._rendered && (addedItemKeys.length || removedItemKeys.length)) {
const selectionChangePromise = that._selectionChangePromise;
if (!that._rendering) {
const addedSelection = [];
let normalizedIndex;
const removedSelection = [];
that._editStrategy.beginCache();
for (let i = 0; i < addedItemKeys.length; i++) {
normalizedIndex = that._getIndexByKey(addedItemKeys[i]);
addedSelection.push(normalizedIndex);
that._addSelection(normalizedIndex)
}
for (let i = 0; i < removedItemKeys.length; i++) {
normalizedIndex = that._getIndexByKey(removedItemKeys[i]);
removedSelection.push(normalizedIndex);
that._removeSelection(normalizedIndex)
}
that._editStrategy.endCache();
that._updateSelection(addedSelection, removedSelection)
}(0, _deferred.when)(selectionChangePromise).done((() => {
that._fireSelectionChangeEvent(args.addedItems, args.removedItems)
}))
}
},
_fireSelectionChangeEvent(addedItems, removedItems) {
this._createActionByOption("onSelectionChanged", {
excludeValidators: ["disabled", "readOnly"]
})({
addedItems: addedItems,
removedItems: removedItems
})
},
_updateSelection: _common.noop,
_setAriaSelectionAttribute($target, value) {
this.setAria("selected", value, $target)
},
_removeSelection(normalizedIndex) {
const $itemElement = this._editStrategy.getItemElement(normalizedIndex);
if (indexExists(normalizedIndex)) {
this._processSelectableItem($itemElement, false);
_events_engine.default.triggerHandler($itemElement, "stateChanged", false)
}
},
_addSelection(normalizedIndex) {
const $itemElement = this._editStrategy.getItemElement(normalizedIndex);
if (indexExists(normalizedIndex)) {
this._processSelectableItem($itemElement, true);
_events_engine.default.triggerHandler($itemElement, "stateChanged", true)
}
},
_isItemSelected(index) {
const key = this._getKeyByIndex(index);
return this._selection.isItemSelected(key, {
checkPending: true
})
},
_optionChanged(args) {
switch (args.name) {
case "selectionMode":
this._invalidate();
break;
case "dataSource":
if (!args.value || Array.isArray(args.value) && !args.value.length) {
this.option("selectedItemKeys", [])
}
this.callBase(args);
break;
case "selectedIndex":
case "selectedItem":
case "selectedItems":
case "selectedItemKeys":
this._syncSelectionOptions(args.name).done((() => this._normalizeSelectedItems()));
break;
case "keyExpr":
this._initKeyGetter();
break;
case "selectionRequired":
this._normalizeSelectedItems();
break;
case "selectByClick":
case "onSelectionChanged":
case "onItemDeleting":
case "onItemDeleted":
case "onItemReordered":
case "maxFilterLengthInRequest":
break;
default:
this.callBase(args)
}
},
_clearSelectedItems() {
this._setOptionWithoutOptionChange("selectedItems", []);
this._syncSelectionOptions("selectedItems")
},
_waitDeletingPrepare($itemElement) {
if ($itemElement.data("dxItemDeleting")) {
return (0, _deferred.Deferred)().resolve().promise()
}
$itemElement.data("dxItemDeleting", true);
const deferred = (0, _deferred.Deferred)();
const deletingActionArgs = {
cancel: false
};
const deletePromise = this._itemEventHandler($itemElement, "onItemDeleting", deletingActionArgs, {
excludeValidators: ["disabled", "readOnly"]
});
(0, _deferred.when)(deletePromise).always((function(value) {
const deletePromiseExists = !deletePromise;
const deletePromiseResolved = !deletePromiseExists && "resolved" === deletePromise.state();
const argumentsSpecified = !!arguments.length;
const shouldDelete = deletePromiseExists || deletePromiseResolved && !argumentsSpecified || deletePromiseResolved && value;
(0, _deferred.when)((0, _deferred.fromPromise)(deletingActionArgs.cancel)).always((() => {
$itemElement.data("dxItemDeleting", false)
})).done((cancel => {
shouldDelete && !cancel ? deferred.resolve() : deferred.reject()
})).fail(deferred.reject)
}));
return deferred.promise()
},
_deleteItemFromDS($item) {
const dataController = this._dataController;
const deferred = (0, _deferred.Deferred)();
const disabledState = this.option("disabled");
const dataStore = dataController.store();
if (!dataStore) {
return (0, _deferred.Deferred)().resolve().promise()
}
if (!dataStore.remove) {
throw _ui.default.Error("E1011")
}
this.option("disabled", true);
dataStore.remove(dataController.keyOf(this._getItemData($item))).done((key => {
if (void 0 !== key) {
deferred.resolve()
} else {
deferred.reject()
}
})).fail((() => {
deferred.reject()
}));
deferred.always((() => {
this.option("disabled", disabledState)
}));
return deferred
},
_tryRefreshLastPage() {
const deferred = (0, _deferred.Deferred)();
if (this._isLastPage() || this.option("grouped")) {
deferred.resolve()
} else {
this._refreshLastPage().done((() => {
deferred.resolve()
}))
}
return deferred.promise()
},
_refreshLastPage() {
this._expectLastItemLoading();
return this._dataController.load()
},
_updateSelectionAfterDelete(index) {
const key = this._getKeyByIndex(index);
this._selection.deselect([key])
},
_updateIndicesAfterIndex(index) {
const itemElements = this._itemElements();
for (let i = index + 1; i < itemElements.length; i++) {
(0, _renderer.default)(itemElements[i]).data(this._itemIndexKey(), i - 1)
}
},
_simulateOptionChange(optionName) {
const optionValue = this.option(optionName);
if (optionValue instanceof _data_source.DataSource) {
return
}
this._optionChangedAction({
name: optionName,
fullName: optionName,
value: optionValue
})
},
isItemSelected(itemElement) {
return this._isItemSelected(this._editStrategy.getNormalizedIndex(itemElement))
},
selectItem(itemElement) {
if ("none" === this.option("selectionMode")) {
return
}
const itemIndex = this._editStrategy.getNormalizedIndex(itemElement);
if (!indexExists(itemIndex)) {
return
}
const key = this._getKeyByIndex(itemIndex);
if (this._selection.isItemSelected(key)) {
return
}
if ("single" === this.option("selectionMode")) {
return this._selection.setSelection([key])
}
const selectedItemKeys = this.option("selectedItemKeys") || [];
return this._selection.setSelection([...selectedItemKeys, key], [key])
},
unselectItem(itemElement) {
const itemIndex = this._editStrategy.getNormalizedIndex(itemElement);
if (!indexExists(itemIndex)) {
return
}
const selectedItemKeys = this._selection.getSelectedItemKeys();
if (this.option("selectionRequired") && selectedItemKeys.length <= 1) {
return
}
const key = this._getKeyByIndex(itemIndex);
if (!this._selection.isItemSelected(key, {
checkPending: true
})) {
return
}
this._selection.deselect([key])
},
_deleteItemElementByIndex(index) {
this._updateSelectionAfterDelete(index);
this._updateIndicesAfterIndex(index);
this._editStrategy.deleteItemAtIndex(index)
},
_afterItemElementDeleted($item, deletedActionArgs) {
const changingOption = this._dataController.getDataSource() ? "dataSource" : "items";
this._simulateOptionChange(changingOption);
this._itemEventHandler($item, "onItemDeleted", deletedActionArgs, {
beforeExecute() {
$item.remove()
},
excludeValidators: ["disabled", "readOnly"]
});
this._renderEmptyMessage()
},
deleteItem(itemElement) {
const that = this;
const deferred = (0, _deferred.Deferred)();
const $item = this._editStrategy.getItemElement(itemElement);
const index = this._editStrategy.getNormalizedIndex(itemElement);
const itemResponseWaitClass = this._itemResponseWaitClass();
if (indexExists(index)) {
this._waitDeletingPrepare($item).done((() => {
$item.addClass(itemResponseWaitClass);
const deletedActionArgs = that._extendActionArgs($item);
that._deleteItemFromDS($item).done((() => {
that._deleteItemElementByIndex(index);
that._afterItemElementDeleted($item, deletedActionArgs);
that._tryRefreshLastPage().done((() => {
deferred.resolveWith(that)
}))
})).fail((() => {
$item.removeClass(itemResponseWaitClass);
deferred.rejectWith(that)
}))
})).fail((() => {
deferred.rejectWith(that)
}))
} else {
deferred.rejectWith(that)
}
return deferred.promise()
},
reorderItem(itemElement, toItemElement) {
const deferred = (0, _deferred.Deferred)();
const that = this;
const strategy = this._editStrategy;
const $movingItem = strategy.getItemElement(itemElement);
const $destinationItem = strategy.getItemElement(toItemElement);
const movingIndex = strategy.getNormalizedIndex(itemElement);
const destinationIndex = strategy.getNormalizedIndex(toItemElement);
const changingOption = this._dataController.getDataSource() ? "dataSource" : "items";
const canMoveItems = indexExists(movingIndex) && indexExists(destinationIndex) && movingIndex !== destinationIndex;
if (canMoveItems) {
deferred.resolveWith(this)
} else {
deferred.rejectWith(this)
}
return deferred.promise().done((function() {
$destinationItem[strategy.itemPlacementFunc(movingIndex, destinationIndex)]($movingItem);
strategy.moveItemAtIndexToIndex(movingIndex, destinationIndex);
this._updateIndicesAfterIndex(movingIndex);
that.option("selectedItems", that._getItemsByKeys(that._selection.getSelectedItemKeys(), that._selection.getSelectedItems()));
if ("items" === changingOption) {
that._simulateOptionChange(changingOption)
}
that._itemEventHandler($movingItem, "onItemReordered", {
fromIndex: strategy.getIndex(movingIndex),
toIndex: strategy.getIndex(destinationIndex)
}, {
excludeValidators: ["disabled", "readOnly"]
})
}))
}
});
exports.default = CollectionWidget
},
91889:
/*!***********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.edit.strategy.js ***!
\***********************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _class = _interopRequireDefault(__webpack_require__( /*! ../../../core/class */ 38377));
var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const {
abstract: abstract
} = _class.default;
const EditStrategy = _class.default.inherit({
ctor(collectionWidget) {
this._collectionWidget = collectionWidget
},
getIndexByItemData: abstract,
getItemDataByIndex: abstract,
getKeysByItems: abstract,
getItemsByKeys: abstract,
itemsGetter: abstract,
getKeyByIndex(index) {
const resultIndex = this._denormalizeItemIndex(index);
return this.getKeysByItems([this.getItemDataByIndex(resultIndex)])[0]
},
_equalKeys(key1, key2) {
if (this._collectionWidget._isKeySpecified()) {
return (0, _common.equalByValue)(key1, key2)
}
return key1 === key2
},
beginCache() {
this._cache = {}
},
endCache() {
this._cache = null
},
getIndexByKey: abstract,
getNormalizedIndex(value) {
if (this._isNormalizedItemIndex(value)) {
return value
}
if (this._isItemIndex(value)) {
return this._normalizeItemIndex(value)
}
if (this._isNode(value)) {
return this._getNormalizedItemIndex(value)
}
return this._normalizeItemIndex(this.getIndexByItemData(value))
},
getIndex(value) {
if (this._isNormalizedItemIndex(value)) {
return this._denormalizeItemIndex(value)
}
if (this._isItemIndex(value)) {
return value
}
if (this._isNode(value)) {
return this._denormalizeItemIndex(this._getNormalizedItemIndex(value))
}
return this.getIndexByItemData(value)
},
getItemElement(value) {
if (this._isNormalizedItemIndex(value)) {
return this._getItemByNormalizedIndex(value)
}
if (this._isItemIndex(value)) {
return this._getItemByNormalizedIndex(this._normalizeItemIndex(value))
}
if (this._isNode(value)) {
return (0, _renderer.default)(value)
}
const normalizedItemIndex = this._normalizeItemIndex(this.getIndexByItemData(value));
return this._getItemByNormalizedIndex(normalizedItemIndex)
},
_isNode: el => _dom_adapter.default.isNode(el && (0, _type.isRenderer)(el) ? el.get(0) : el),
deleteItemAtIndex: abstract,
itemPlacementFunc(movingIndex, destinationIndex) {
return this._itemsFromSameParent(movingIndex, destinationIndex) && movingIndex < destinationIndex ? "after" : "before"
},
moveItemAtIndexToIndex: abstract,
_isNormalizedItemIndex: index => "number" === typeof index && Math.round(index) === index,
_isItemIndex: abstract,
_getNormalizedItemIndex: abstract,
_normalizeItemIndex: abstract,
_denormalizeItemIndex: abstract,
_getItemByNormalizedIndex: abstract,
_itemsFromSameParent: abstract
});
exports.default = EditStrategy
},
42464:
/*!*****************************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.edit.strategy.plain.js ***!
\*****************************************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _m_collection_widgetEdit = (obj = __webpack_require__( /*! ./m_collection_widget.edit.strategy */ 91889), obj && obj.__esModule ? obj : {
default: obj
});
var obj;
const PlainEditStrategy = _m_collection_widgetEdit.default.inherit({
_getPlainItems() {
return this._collectionWidget.option("items") || []
},
getIndexByItemData(itemData) {
const keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
if (keyOf) {
return this.getIndexByKey(keyOf(itemData))
}
return this._getPlainItems().indexOf(itemData)
},
getItemDataByIndex(index) {
return this._getPlainItems()[index]
},
deleteItemAtIndex(index) {
this._getPlainItems().splice(index, 1)
},
itemsGetter() {
return this._getPlainItems()
},
getKeysByItems(items) {
const keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
let result = items;
if (keyOf) {
result = [];
for (let i = 0; i < items.length; i++) {
result.push(keyOf(items[i]))
}
}
return result
},
getIndexByKey(key) {
const cache = this._cache;
const keys = cache && cache.keys || this.getKeysByItems(this._getPlainItems());
if (cache && !cache.keys) {
cache.keys = keys
}
if ("object" === typeof key) {
for (let i = 0, {
length: length
} = keys; i < length; i++) {
if (this._equalKeys(key, keys[i])) {
return i
}
}
} else {
return keys.indexOf(key)
}
return -1
},
getItemsByKeys: (keys, items) => (items || keys).slice(),
moveItemAtIndexToIndex(movingIndex, destinationIndex) {
const items = this._getPlainItems();
const movedItemData = items[movingIndex];
items.splice(movingIndex, 1);
items.splice(destinationIndex, 0, movedItemData)
},
_isItemIndex: index => "number" === typeof index && Math.round(index) === index,
_getNormalizedItemIndex(itemElement) {
return this._collectionWidget._itemElements().index(itemElement)
},
_normalizeItemIndex: index => index,
_denormalizeItemIndex: index => index,
_getItemByNormalizedIndex(index) {
return index > -1 ? this._collectionWidget._itemElements().eq(index) : null
},
_itemsFromSameParent: () => true
});
exports.default = PlainEditStrategy
},
85736:
/*!*********************************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.live_update.js ***!
\*********************************************************************************************************/
function(__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 */ 73349));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _array_compare = __webpack_require__( /*! ../../../core/utils/array_compare */ 34671);
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _array_utils = __webpack_require__( /*! ../../../data/array_utils */ 60637);
var _utils = __webpack_require__( /*! ../../../data/utils */ 16454);
var _m_collection_widget = _interopRequireDefault(__webpack_require__( /*! ./m_collection_widget.edit */ 61032));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const PRIVATE_KEY_FIELD = "__dx_key__";
exports.default = _m_collection_widget.default.inherit({
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
repaintChangesOnly: false
})
},
ctor() {
var _this$_dataController;
this.callBase.apply(this, arguments);
this._customizeStoreLoadOptions = e => {
const dataController = this._dataController;
if (dataController.getDataSource() && !this._dataController.isLoaded()) {
this._correctionIndex = 0
}
if (this._correctionIndex && e.storeLoadOptions) {
e.storeLoadOptions.skip += this._correctionIndex
}
};
null === (_this$_dataController = this._dataController) || void 0 === _this$_dataController || _this$_dataController.on("customizeStoreLoadOptions", this._customizeStoreLoadOptions)
},
reload() {
this._correctionIndex = 0
},
_init() {
this.callBase();
this._refreshItemsCache();
this._correctionIndex = 0
},
_findItemElementByKey(key) {
let result = (0, _renderer.default)();
const keyExpr = this.key();
this.itemElements().each(((_, item) => {
const $item = (0, _renderer.default)(item);
const itemData = this._getItemData($item);
if (keyExpr ? (0, _utils.keysEqual)(keyExpr, this.keyOf(itemData), key) : this._isItemEquals(itemData, key)) {
result = $item;
return false
}
}));
return result
},
_dataSourceChangedHandler(newItems, e) {
if (null !== e && void 0 !== e && e.changes) {
this._modifyByChanges(e.changes)
} else {
this.callBase(newItems, e);
this._refreshItemsCache()
}
},
_isItemEquals(item1, item2) {
if (item1 && item1.__dx_key__) {
item1 = item1.data
}
try {
return JSON.stringify(item1) === JSON.stringify(item2)
} catch (e) {
return item1 === item2
}
},
_isItemStrictEquals(item1, item2) {
return this._isItemEquals(item1, item2)
},
_shouldAddNewGroup(changes, items) {
let result = false;
if (this.option("grouped")) {
if (!changes.length) {
result = true
}(0, _iterator.each)(changes, ((i, change) => {
if ("insert" === change.type) {
result = true;
(0, _iterator.each)(items, ((_, item) => {
if (void 0 !== change.data.key && change.data.key === item.key) {
result = false;
return false
}
}))
}
}))
}
return result
},
_partialRefresh() {
if (this.option("repaintChangesOnly")) {
const keyOf = data => {
if (data && void 0 !== data.__dx_key__) {
return data.__dx_key__
}
return this.keyOf(data)
};
const result = (0, _array_compare.findChanges)(this._itemsCache, this._editStrategy.itemsGetter(), keyOf, this._isItemStrictEquals.bind(this));
if (result && this._itemsCache.length && !this._shouldAddNewGroup(result, this._itemsCache)) {
this._modifyByChanges(result, true);
this._renderEmptyMessage();
return true
}
this._refreshItemsCache()
}
return false
},
_refreshItemsCache() {
if (this.option("repaintChangesOnly")) {
const items = this._editStrategy.itemsGetter();
try {
this._itemsCache = (0, _extend.extend)(true, [], items);
if (!this.key()) {
this._itemsCache = this._itemsCache.map(((itemCache, index) => ({
[PRIVATE_KEY_FIELD]: items[index],
data: itemCache
})))
}
} catch (e) {
this._itemsCache = (0, _extend.extend)([], items)
}
}
},
_dispose() {
this._dataController.off("customizeStoreLoadOptions", this._customizeStoreLoadOptions);
this.callBase()
},
_updateByChange(keyInfo, items, change, isPartialRefresh) {
if (isPartialRefresh) {
this._renderItem(change.index, change.data, null, this._findItemElementByKey(change.key))
} else {
const changedItem = items[(0, _array_utils.indexByKey)(keyInfo, items, change.key)];
if (changedItem) {
(0, _array_utils.update)(keyInfo, items, change.key, change.data).done((() => {
this._renderItem(items.indexOf(changedItem), changedItem, null, this._findItemElementByKey(change.key))
}))
}
}
},
_insertByChange(keyInfo, items, change, isPartialRefresh) {
(0, _deferred.when)(isPartialRefresh || (0, _array_utils.insert)(keyInfo, items, change.data, change.index)).done((() => {
this._beforeItemElementInserted(change);
this._renderItem(change.index ?? items.length, change.data);
this._afterItemElementInserted();
this._correctionIndex++
}))
},
_updateSelectionAfterRemoveByChange(removeIndex) {
const selectedIndex = this.option("selectedIndex");
if (selectedIndex > removeIndex) {
this.option("selectedIndex", selectedIndex - 1)
} else if (selectedIndex === removeIndex && 1 === this.option("selectedItems").length) {
this.option("selectedItems", [])
} else {
this._normalizeSelectedItems()
}
},
_beforeItemElementInserted(change) {
const selectedIndex = this.option("selectedIndex");
if (change.index <= selectedIndex) {
this.option("selectedIndex", selectedIndex + 1)
}
},
_afterItemElementInserted: _common.noop,
_removeByChange(keyInfo, items, change, isPartialRefresh) {
const index = isPartialRefresh ? change.index : (0, _array_utils.indexByKey)(keyInfo, items, change.key);
const removedItem = isPartialRefresh ? change.oldItem : items[index];
if (removedItem) {
const $removedItemElement = this._findItemElementByKey(change.key);
const deletedActionArgs = this._extendActionArgs($removedItemElement);
this._waitDeletingPrepare($removedItemElement).done((() => {
if (isPartialRefresh) {
this._updateIndicesAfterIndex(index - 1);
this._afterItemElementDeleted($removedItemElement, deletedActionArgs);
this._updateSelectionAfterRemoveByChange(index)
} else {
this._deleteItemElementByIndex(index);
this._afterItemElementDeleted($removedItemElement, deletedActionArgs)
}
}));
this._correctionIndex--
}
},
_modifyByChanges(changes, isPartialRefresh) {
const items = this._editStrategy.itemsGetter();
const keyInfo = {
key: this.key.bind(this),
keyOf: this.keyOf.bind(this)
};
const dataController = this._dataController;
const paginate = dataController.paginate();
const group = dataController.group();
if (paginate || group) {
changes = changes.filter((item => "insert" !== item.type || void 0 !== item.index))
}
changes.forEach((change => this[`_${change.type}ByChange`](keyInfo, items, change, isPartialRefresh)));
this._renderedItemsCount = items.length;
this._refreshItemsCache();
this._fireContentReadyAction()
},
_appendItemToContainer($container, $itemFrame, index) {
const nextSiblingElement = $container.children(this._itemSelector()).get(index);
_dom_adapter.default.insertElement($container.get(0), $itemFrame.get(0), nextSiblingElement)
},
_optionChanged(args) {
switch (args.name) {
case "items": {
const isItemsUpdated = this._partialRefresh(args.value);
if (!isItemsUpdated) {
this.callBase(args)
}
break
}
case "dataSource":
if (!this.option("repaintChangesOnly") || !args.value) {
this.option("items", [])
}
this.callBase(args);
break;
case "repaintChangesOnly":
break;
default:
this.callBase(args)
}
}
})
},
30136:
/*!*******************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_data_controller.js ***!
\*******************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576);
var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754);
const DataControllerMock = {
load: () => (0, _deferred.Deferred)().reject(),
loadSingle: () => (0, _deferred.Deferred)().reject(),
loadFromStore: () => (0, _deferred.Deferred)().reject(),
loadNextPage: () => (0, _deferred.Deferred)().reject(),
loadOptions: _common.noop,
userData: _common.noop,
cancel: _common.noop,
cancelAll: _common.noop,
filter: _common.noop,
addSearchFilter: _common.noop,
group: _common.noop,
paginate: _common.noop,
pageSize: _common.noop,
pageIndex: _common.noop,
resetDataSourcePageIndex: _common.noop,
totalCount: _common.noop,
isLastPage: _common.noop,
isLoading: _common.noop,
isLoaded: _common.noop,
searchValue: _common.noop,
searchOperation: _common.noop,
searchExpr: _common.noop,
select: _common.noop,
key: _common.noop,
keyOf: _common.noop,
store: _common.noop,
items: _common.noop,
applyMapFunction: _common.noop,
getDataSource: _common.noop,
reload: _common.noop,
on: _common.noop,
off: _common.noop
};
exports.default = class {
constructor(dataSource) {
if (!dataSource) {
return DataControllerMock
}
this._dataSource = dataSource
}
load() {
return this._dataSource.load()
}
loadSingle(propName, propValue) {
if (arguments.length < 2) {
propValue = propName;
propName = this.key()
}
return this._dataSource.loadSingle(propName, propValue)
}
loadFromStore(loadOptions) {
return this.store().load(loadOptions)
}
loadNextPage() {
this.pageIndex(1 + this.pageIndex());
return this.load()
}
loadOptions() {
return this._dataSource.loadOptions()
}
userData() {
return this._dataSource._userData
}
cancel(operationId) {
this._dataSource.cancel(operationId)
}
cancelAll() {
this._dataSource.cancelAll()
}
filter(filter) {
return this._dataSource.filter(filter)
}
addSearchFilter(storeLoadOptions) {
this._dataSource._addSearchFilter(storeLoadOptions)
}
group(group) {
return this._dataSource.group(group)
}
paginate() {
return this._dataSource.paginate()
}
pageSize() {
return this._dataSource._pageSize
}
pageIndex(pageIndex) {
return this._dataSource.pageIndex(pageIndex)
}
resetDataSourcePageIndex() {
if (this.pageIndex()) {
this.pageIndex(0);
this.load()
}
}
totalCount() {
return this._dataSource.totalCount()
}
isLastPage() {
return this._dataSource.isLastPage() || !this._dataSource._pageSize
}
isLoading() {
return this._dataSource.isLoading()
}
isLoaded() {
return this._dataSource.isLoaded()
}
searchValue(value) {
if (!arguments.length) {
return this._dataSource.searchValue()
}
return this._dataSource.searchValue(value)
}
searchOperation(operation) {
return this._dataSource.searchOperation(operation)
}
searchExpr(expr) {
if (!arguments.length) {
return this._dataSource.searchExpr()
}
return this._dataSource.searchExpr(expr)
}
select() {
return this._dataSource.select(...arguments)
}
key() {
return this._dataSource.key()
}
keyOf(item) {
return this.store().keyOf(item)
}
store() {
return this._dataSource.store()
}
items() {
return this._dataSource.items()
}
applyMapFunction(data) {
return this._dataSource._applyMapFunction(data)
}
getDataSource() {
return this._dataSource || null
}
reload() {
return this._dataSource.reload()
}
on(event, handler) {
this._dataSource.on(event, handler)
}
off(event, handler) {
this._dataSource.off(event, handler)
}
}
},
1893:
/*!********************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_item.js ***!
\********************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _class = _interopRequireDefault(__webpack_require__( /*! ../../../core/class */ 38377));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479);
var _public_component = __webpack_require__( /*! ../../../core/utils/public_component */ 9321);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const CollectionItem = _class.default.inherit({
ctor($element, options, rawData) {
this._$element = $element;
this._options = options;
this._rawData = rawData;
(0, _public_component.attachInstanceToElement)($element, this, this._dispose);
this._render()
},
_render() {
const $placeholder = (0, _renderer.default)(" ").addClass("dx-item-content-placeholder");
this._$element.append($placeholder);
this._watchers = [];
this._renderWatchers()
},
_renderWatchers() {
this._startWatcher("disabled", this._renderDisabled.bind(this));
this._startWatcher("visible", this._renderVisible.bind(this))
},
_startWatcher(field, render) {
const rawData = this._rawData;
const exprGetter = this._options.fieldGetter(field);
const watcher = function(watchMethod, fn, callback) {
const filteredCallback = function() {
let oldValue;
return function(value) {
if (oldValue !== value) {
callback(value, oldValue);
oldValue = value
}
}
}();
return {
dispose: watchMethod(fn, filteredCallback),
force() {
filteredCallback(fn())
}
}
}(this._options.watchMethod(), (() => exprGetter(rawData)), ((value, oldValue) => {
this._dirty = true;
render(value, oldValue)
}));
this._watchers.push(watcher)
},
setDataField() {
this._dirty = false;
(0, _iterator.each)(this._watchers, ((_, watcher) => {
watcher.force()
}));
if (this._dirty) {
return true
}
},
_renderDisabled(value, oldValue) {
this._$element.toggleClass("dx-state-disabled", !!value);
this._$element.attr("aria-disabled", !!value);
this._updateOwnerFocus(value)
},
_updateOwnerFocus(isDisabled) {
const ownerComponent = this._options.owner;
if (ownerComponent && isDisabled) {
ownerComponent._resetItemFocus(this._$element)
}
},
_renderVisible(value, oldValue) {
this._$element.toggleClass("dx-state-invisible", void 0 !== value && !value)
},
_dispose() {
(0, _iterator.each)(this._watchers, ((_, watcher) => {
watcher.dispose()
}))
}
});
CollectionItem.getInstance = function($element) {
return (0, _public_component.getInstanceByElement)($element, this)
};
exports.default = CollectionItem
},
29844:
/*!************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/color_box/m_color_box.js ***!
\************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _color = _interopRequireDefault(__webpack_require__( /*! ../../../color */ 52752));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _m_drop_down_editor = _interopRequireDefault(__webpack_require__( /*! ../../ui/drop_down_editor/m_drop_down_editor */ 81605));
var _m_color_view = _interopRequireDefault(__webpack_require__( /*! ./m_color_view */ 6522));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const colorEditorPrototype = _m_color_view.default.prototype;
const colorUtils = {
makeTransparentBackground: colorEditorPrototype._makeTransparentBackground.bind(colorEditorPrototype),
makeRgba: colorEditorPrototype._makeRgba.bind(colorEditorPrototype)
};
const ColorBox = _m_drop_down_editor.default.inherit({
_supportedKeys() {
const arrowHandler = function(e) {
e.stopPropagation();
if (this.option("opened")) {
e.preventDefault();
return true
}
};
return (0, _extend.extend)(this.callBase(), {
enter: this._enterKeyHandler,
leftArrow: arrowHandler,
rightArrow: arrowHandler,
upArrow: function(e) {
if (!this.option("opened")) {
e.preventDefault();
return false
}
if (e.altKey) {
this.close();
return false
}
return true
},
downArrow: function(e) {
if (!this.option("opened") && !e.altKey) {
e.preventDefault();
return false
}
if (!this.option("opened") && e.altKey) {
this._validatedOpening();
return false
}
return true
}
})
},
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
editAlphaChannel: false,
applyValueMode: "useButtons",
keyStep: 1,
fieldTemplate: null,
buttonsLocation: "bottom after"
})
},
_popupHidingHandler() {
this.callBase();
if ("useButtons" === this.option("applyValueMode")) {
this._updateColorViewValue(this.option("value"))
}
},
_popupConfig() {
return (0, _extend.extend)(this.callBase(), {
width: ""
})
},
_contentReadyHandler() {
this._createColorView();
this._addPopupBottomClasses()
},
_addPopupBottomClasses() {
const $popupBottom = this._popup.bottomToolbar();
if ($popupBottom) {
$popupBottom.addClass("dx-colorview-container-cell").addClass("dx-colorview-button-cell").find(".dx-toolbar-items-container").addClass("dx-colorview-buttons-container");
$popupBottom.find(".dx-popup-done").addClass("dx-colorview-apply-button");
$popupBottom.find(".dx-popup-cancel").addClass("dx-colorview-cancel-button")
}
},
_createColorView() {
this._popup.$overlayContent().addClass("dx-colorbox-overlay");
const $colorView = (0, _renderer.default)(" ").appendTo(this._popup.$content());
this._colorView = this._createComponent($colorView, _m_color_view.default, this._colorViewConfig())
},
_applyNewColor(value) {
this.option("value", value);
if (value) {
colorUtils.makeTransparentBackground(this._$colorResultPreview, value)
}
if (this._colorViewEnterKeyPressed) {
this.close();
this._colorViewEnterKeyPressed = false
}
},
_colorViewConfig() {
const that = this;
return {
value: that.option("value"),
matchValue: that.option("value"),
editAlphaChannel: that.option("editAlphaChannel"),
applyValueMode: that.option("applyValueMode"),
focusStateEnabled: that.option("focusStateEnabled"),
stylingMode: this.option("stylingMode"),
target: this._input(),
onEnterKeyPressed(_ref) {
let {
event: event
} = _ref;
that._colorViewEnterKeyPressed = true;
if (that._colorView.option("value") !== that.option("value")) {
that._saveValueChangeEvent(event);
that._applyNewColor(that._colorView.option("value"));
that.close()
}
},
onValueChanged(_ref2) {
let {
event: event,
value: value,
previousValue: previousValue
} = _ref2;
const instantlyMode = "instantly" === that.option("applyValueMode");
const isOldValue = colorUtils.makeRgba(value) === previousValue;
const changesApplied = instantlyMode || that._colorViewEnterKeyPressed;
const valueCleared = that._shouldSaveEmptyValue;
if (isOldValue || !changesApplied || valueCleared) {
return
}
if (event) {
that._saveValueChangeEvent(event)
}
that._applyNewColor(value)
}
}
},
_enterKeyHandler(e) {
const newValue = this._input().val();
const {
value: value,
editAlphaChannel: editAlphaChannel
} = this.option();
const oldValue = value && editAlphaChannel ? colorUtils.makeRgba(value) : value;
if (!newValue) {
return false
}
const color = new _color.default(newValue);
if (color.colorIsInvalid) {
this._input().val(oldValue);
return
}
if (newValue !== oldValue) {
this._applyColorFromInput(newValue);
this._saveValueChangeEvent(e);
this.option("value", this.option("editAlphaChannel") ? colorUtils.makeRgba(newValue) : newValue)
}
if (this._colorView) {
const colorViewValue = this._colorView.option("value");
if (value !== colorViewValue) {
this._saveValueChangeEvent(e);
this.option("value", colorViewValue)
}
}
this.close();
return false
},
_applyButtonHandler(e) {
this._saveValueChangeEvent(e.event);
this._applyNewColor(this._colorView.option("value"));
this.callBase()
},
_cancelButtonHandler() {
this._resetInputValue();
this.callBase()
},
_getKeyboardListeners() {
return this.callBase().concat([this._colorView])
},
_init() {
this.callBase()
},
_initMarkup() {
this.$element().addClass("dx-colorbox");
this.callBase()
},
_renderInput() {
this.callBase();
this._input().addClass("dx-colorbox-input");
this._renderColorPreview()
},
_renderColorPreview() {
this.$element().wrapInner((0, _renderer.default)(" ").addClass("dx-colorbox-input-container"));
this._$colorBoxInputContainer = this.$element().children().eq(0);
this._$colorResultPreview = (0, _renderer.default)(" ").addClass("dx-colorbox-color-result-preview").appendTo(this._$textEditorInputContainer);
if (!this.option("value")) {
this._$colorBoxInputContainer.addClass("dx-colorbox-color-is-not-defined")
} else {
colorUtils.makeTransparentBackground(this._$colorResultPreview, this.option("value"))
}
},
_renderValue() {
const {
value: value,
editAlphaChannel: editAlphaChannel
} = this.option();
const shouldConvertToColor = value && editAlphaChannel;
const text = shouldConvertToColor ? colorUtils.makeRgba(value) : value;
this.option("text", text);
return this.callBase()
},
_resetInputValue() {
const $input = this._input();
const value = this.option("value");
$input.val(value);
this._updateColorViewValue(value)
},
_updateColorViewValue(value) {
if (this._colorView) {
this._colorView.option({
value: value,
matchValue: value
})
}
},
_valueChangeEventHandler(e) {
let value = this._input().val();
if (value) {
value = this._applyColorFromInput(value);
this._updateColorViewValue(value)
}
this.callBase(e, value)
},
_applyColorFromInput(value) {
const {
editAlphaChannel: editAlphaChannel
} = this.option();
const newColor = new _color.default(value);
if (newColor.colorIsInvalid) {
this._resetInputValue();
return this.option("value")
}
if (editAlphaChannel) {
return colorUtils.makeRgba(value)
}
return value
},
_clean() {
this.callBase();
delete this._shouldSaveEmptyValue
},
_optionChanged(args) {
const {
value: value
} = args;
const {
name: name
} = args;
switch (name) {
case "value":
this._$colorBoxInputContainer.toggleClass("dx-colorbox-color-is-not-defined", !value);
if (value) {
colorUtils.makeTransparentBackground(this._$colorResultPreview, value)
} else {
this._$colorResultPreview.removeAttr("style")
}
if (null === value) {
this._shouldSaveEmptyValue = true
}
this._updateColorViewValue(value);
this._shouldSaveEmptyValue = false;
this.callBase(args);
break;
case "applyButtonText":
case "cancelButtonText":
this.callBase(args);
this._popup && this._addPopupBottomClasses();
break;
case "editAlphaChannel":
case "keyStep":
if (this._colorView) {
this._colorView.option(name, value)
}
break;
default:
this.callBase(args)
}
}
});
(0, _component_registrator.default)("dxColorBox", ColorBox);
exports.default = ColorBox
},
6522:
/*!*************************************************************************************!*\
!*** ./artifacts/transpiled-renovation-npm/__internal/ui/color_box/m_color_view.js ***!
\*************************************************************************************/
function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648);
var _color = _interopRequireDefault(__webpack_require__( /*! ../../../color */ 52752));
var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393));
var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530));
var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../core/guid */ 73176));
var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374));
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306);
var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664);
var _click = __webpack_require__( /*! ../../../events/click */ 95429);
var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994));
var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611);
var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109));
var _draggable = _interopRequireDefault(__webpack_require__( /*! ../../../ui/draggable */ 42160));
var _editor = _interopRequireDefault(__webpack_require__( /*! ../../../ui/editor/editor */ 96452));
var _number_box = _interopRequireDefault(__webpack_require__( /*! ../../../ui/number_box */ 34171));
var _text_box = _interopRequireDefault(__webpack_require__( /*! ../../../ui/text_box */ 29837));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
}
}
const COLOR_VIEW_PALETTE_GRADIENT_CLASS = "dx-colorview-palette-gradient";
const COLOR_VIEW_PALETTE_GRADIENT_WHITE_CLASS = "dx-colorview-palette-gradient-white";
const COLOR_VIEW_PALETTE_GRADIENT_BLACK_CLASS = "dx-colorview-palette-gradient-black";
const COLOR_VIEW_COLOR_PREVIEW = "dx-colorview-color-preview";
const COLOR_VIEW_COLOR_PREVIEW_COLOR_CURRENT = "dx-colorview-color-preview-color-current";
const COLOR_VIEW_COLOR_PREVIEW_COLOR_NEW = "dx-colorview-color-preview-color-new";
const ColorView = _editor.default.inherit({
_supportedKeys() {
const isRTL = this.option("rtlEnabled");
const that = this;
const getHorizontalPaletteStep = function(e) {
let step = 100 / that._paletteWidth;
if (e.shiftKey) {
step *= that.option("keyStep")
}
step = step > 1 ? step : 1;
return Math.round(step)
};
const updateHorizontalPaletteValue = function(step) {
let value = that._currentColor.hsv.s + step;
if (value > 100) {
value = 100
} else if (value < 0) {
value = 0
}
that._currentColor.hsv.s = value;
updatePaletteValue()
};
const getVerticalPaletteStep = function(e) {
let step = 100 / that._paletteHeight;
if (e.shiftKey) {
step *= that.option("keyStep")
}
step = step > 1 ? step : 1;
return Math.round(step)
};
const updateVerticalPaletteValue = function(step) {
let value = that._currentColor.hsv.v + step;
if (value > 100) {
value = 100
} else if (value < 0) {
value = 0
}
that._currentColor.hsv.v = value;
updatePaletteValue()
};
function updatePaletteValue() {
that._placePaletteHandle();
that._updateColorFromHsv(that._currentColor.hsv.h, that._currentColor.hsv.s, that._currentColor.hsv.v)
}
const getHueScaleStep = function(e) {
let step = 360 / (that._hueScaleWrapperHeight - that._hueScaleHandleHeight);
if (e.shiftKey) {
step *= that.option("keyStep")
}
step = step > 1 ? step : 1;
return step
};
const updateHueScaleValue = function(step) {
that._currentColor.hsv.h += step;
that._placeHueScaleHandle();
const handleLocation = (0, _translator.locate)(that._$hueScaleHandle);
that._updateColorHue(handleLocation.top + that._hueScaleHandleHeight / 2)
};
const getAlphaScaleStep = function(e) {
let step = 1 / that._alphaChannelScaleWorkWidth;
if (e.shiftKey) {
step *= that.option("keyStep")
}
step = step > .01 ? step : .01;
step = isRTL ? -step : step;
return step
};
const updateAlphaScaleValue = function(step) {
that._currentColor.a += step;
that._placeAlphaChannelHandle();
const handleLocation = (0, _translator.locate)(that._$alphaChannelHandle);
that._calculateColorTransparencyByScaleWidth(handleLocation.left + that._alphaChannelHandleWidth / 2)
};
return (0, _extend.extend)(this.callBase(), {
upArrow(e) {
e.preventDefault();
e.stopPropagation();
if ((0, _index.isCommandKeyPressed)(e)) {
if (this._currentColor.hsv.h <= 360 && !this._isTopColorHue) {
this._saveValueChangeEvent(e);
updateHueScaleValue(getHueScaleStep(e))
}
} else if (this._currentColor.hsv.v < 100) {
this._saveValueChangeEvent(e);
updateVerticalPaletteValue(getVerticalPaletteStep(e))
}
},
downArrow(e) {
e.preventDefault();
e.stopPropagation();
if ((0, _index.isCommandKeyPressed)(e)) {
if (this._currentColor.hsv.h >= 0) {
if (this._isTopColorHue) {
this._currentColor.hsv.h = 360
}
this._saveValueChangeEvent(e);
updateHueScaleValue(-getHueScaleStep(e))
}
} else if (this._currentColor.hsv.v > 0) {
this._saveValueChangeEvent(e);
updateVerticalPaletteValue(-getVerticalPaletteStep(e))
}
},
rightArrow(e) {
e.preventDefault();
e.stopPropagation();
if ((0, _index.isCommandKeyPressed)(e)) {
if (isRTL ? this._currentColor.a < 1 : this._currentColor.a > 0 && this.option("editAlphaChannel")) {
this._saveValueChangeEvent(e);
updateAlphaScaleValue(-getAlphaScaleStep(e))
}
} else if (this._currentColor.hsv.s < 100) {
this._saveValueChangeEvent(e);
updateHorizontalPaletteValue(getHorizontalPaletteStep(e))
}
},
leftArrow(e) {
e.preventDefault();
e.stopPropagation();
if ((0, _index.isCommandKeyPressed)(e)) {
if (isRTL ? this._currentColor.a > 0 : this._currentColor.a < 1 && this.option("editAlphaChannel")) {
this._saveValueChangeEvent(e);
updateAlphaScaleValue(getAlphaScaleStep(e))
}
} else if (this._currentColor.hsv.s > 0) {
this._saveValueChangeEvent(e);
updateHorizontalPaletteValue(-getHorizontalPaletteStep(e))
}
},
enter(e) {
this._fireEnterKeyPressed(e)
}
})
},
_getDefaultOptions() {
return (0, _extend.extend)(this.callBase(), {
value: null,
matchValue: null,
onEnterKeyPressed: void 0,
editAlphaChannel: false,
keyStep: 1,
stylingMode: void 0
})
},
_defaultOptionsRules() {
return this.callBase().concat([{
device: () => "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator(),
options: {
focusStateEnabled: true
}
}])
},
_init() {
this.callBase();
this._initColorAndOpacity();
this._initEnterKeyPressedAction()
},
_initEnterKeyPressedAction() {
this._onEnterKeyPressedAction = this._createActionByOption("onEnterKeyPressed")
},
_fireEnterKeyPressed(e) {
if (!this._onEnterKeyPressedAction) {
return
}
this._onEnterKeyPressedAction({
event: e
})
},
_initColorAndOpacity() {
this._setCurrentColor(this.option("value"))
},
_setCurrentColor(value) {
value = value || "#000000";
const newColor = new _color.default(value);
if (!newColor.colorIsInvalid) {
if (!this._currentColor || this._makeRgba(this._currentColor) !== this._makeRgba(newColor)) {
this._currentColor = newColor;
if (this._$currentColor) {
this._makeTransparentBackground(this._$currentColor, newColor)
}
}
} else {
if (!this._currentColor) {
this._currentColor = new _color.default("#000000")
}
this.option("value", this._currentColor.baseColor)
}
},
_setBaseColor(value) {
const color = value || "#000000";
const newColor = new _color.default(color);
if (!newColor.colorIsInvalid) {
const isBaseColorChanged = this._makeRgba(this.option("matchValue") !== this._makeRgba(newColor));
if (isBaseColorChanged) {
if (this._$baseColor) {
this._makeTransparentBackground(this._$baseColor, newColor)
}
}
}
},
_initMarkup() {
this.callBase();
this.$element().addClass("dx-colorview");
this._renderColorPickerContainer()
},
_render() {
this.callBase();
this._renderPalette();
this._renderHueScale();
this._renderControlsContainer();
this._renderControls();
this._renderAlphaChannelElements()
},
_makeTransparentBackground($el, color) {
if (!(color instanceof _color.default)) {
color = new _color.default(color)
}
$el.css("backgroundColor", this._makeRgba(color))
},
_makeRgba(color) {
if (!(color instanceof _color.default)) {
color = new _color.default(color)
}
return `rgba(${[color.r,color.g,color.b,color.a].join(", ")})`
},
_renderValue() {
this.callBase(this.option("editAlphaChannel") ? this._makeRgba(this._currentColor) : this.option("value"))
},
_renderColorPickerContainer() {
const $parent = this.$element();
this._$colorPickerContainer = (0, _renderer.default)(" ").addClass("dx-colorview-container").appendTo($parent);
this._renderHtmlRows()
},
_renderHtmlRows(updatedOption) {
const $renderedRows = this._$colorPickerContainer.find(".dx-colorview-container-row");
const renderedRowsCount = $renderedRows.length;
const rowCount = this.option("editAlphaChannel") ? 2 : 1;
let delta = renderedRowsCount - rowCount;
if (delta > 0) {
$renderedRows.eq(-1).remove()
}
if (delta < 0) {
delta = Math.abs(delta);
const rows = [];
let i;
for (i = 0; i < delta; i++) {
rows.push((0, _renderer.default)(" ").addClass("dx-colorview-container-row"))
}
if (renderedRowsCount) {
for (i = 0; i < rows.length; i++) {
$renderedRows.eq(0).after(rows[i])
}
} else {
this._$colorPickerContainer.append(rows)
}
}
},
_renderHtmlCellInsideRow: (index, $rowParent, additionalClass) => (0, _renderer.default)(" ").addClass("dx-colorview-container-cell").addClass(additionalClass).appendTo($rowParent.find(".dx-colorview-container-row").eq(index)),
_renderPalette() {
const $paletteCell = this._renderHtmlCellInsideRow(0, this._$colorPickerContainer, "dx-colorview-palette-cell");
const $paletteGradientWhite = (0, _renderer.default)(" | | | | |