@dlh.io/bideux 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +90 -0
  3. package/dist/all.d.ts +14 -0
  4. package/dist/all.js +15 -0
  5. package/dist/all.js.map +1 -0
  6. package/dist/chunk-62IQGXLW.js +11470 -0
  7. package/dist/chunk-62IQGXLW.js.map +1 -0
  8. package/dist/chunk-75CRTQK7.js +315 -0
  9. package/dist/chunk-75CRTQK7.js.map +1 -0
  10. package/dist/chunk-FVO6E22Z.js +225 -0
  11. package/dist/chunk-FVO6E22Z.js.map +1 -0
  12. package/dist/chunk-GRITOB4M.js +337 -0
  13. package/dist/chunk-GRITOB4M.js.map +1 -0
  14. package/dist/chunk-HPFHIZWO.js +40 -0
  15. package/dist/chunk-HPFHIZWO.js.map +1 -0
  16. package/dist/chunk-IMNUQGHE.js +2864 -0
  17. package/dist/chunk-IMNUQGHE.js.map +1 -0
  18. package/dist/chunk-LHD445PJ.js +571 -0
  19. package/dist/chunk-LHD445PJ.js.map +1 -0
  20. package/dist/chunk-LPLBBHOW.js +386 -0
  21. package/dist/chunk-LPLBBHOW.js.map +1 -0
  22. package/dist/chunk-NGM5R3LW.js +881 -0
  23. package/dist/chunk-NGM5R3LW.js.map +1 -0
  24. package/dist/chunk-OMPR32AR.js +1320 -0
  25. package/dist/chunk-OMPR32AR.js.map +1 -0
  26. package/dist/chunk-QDQ5VVTC.js +255 -0
  27. package/dist/chunk-QDQ5VVTC.js.map +1 -0
  28. package/dist/chunk-RRWZKNDZ.js +1004 -0
  29. package/dist/chunk-RRWZKNDZ.js.map +1 -0
  30. package/dist/chunk-SRWIBMEB.js +178 -0
  31. package/dist/chunk-SRWIBMEB.js.map +1 -0
  32. package/dist/element/chunk-AOKCBPMV.js +1646 -0
  33. package/dist/element/chunk-AOKCBPMV.js.map +1 -0
  34. package/dist/element/chunk-B67SYRQP.js +281 -0
  35. package/dist/element/chunk-B67SYRQP.js.map +1 -0
  36. package/dist/element/chunk-FNRVFA2C.js +55 -0
  37. package/dist/element/chunk-FNRVFA2C.js.map +1 -0
  38. package/dist/element/chunk-G3C722QP.js +4707 -0
  39. package/dist/element/chunk-G3C722QP.js.map +1 -0
  40. package/dist/element/chunk-H5IFOSQP.js +346 -0
  41. package/dist/element/chunk-H5IFOSQP.js.map +1 -0
  42. package/dist/element/chunk-LXR3CLCN.js +30 -0
  43. package/dist/element/chunk-LXR3CLCN.js.map +1 -0
  44. package/dist/element/chunk-TFV4CJR4.js +183 -0
  45. package/dist/element/chunk-TFV4CJR4.js.map +1 -0
  46. package/dist/element/chunk-TXSK3CIN.js +859 -0
  47. package/dist/element/chunk-TXSK3CIN.js.map +1 -0
  48. package/dist/element/chunk-WDTTBY3S.js +45 -0
  49. package/dist/element/chunk-WDTTBY3S.js.map +1 -0
  50. package/dist/element/chunk-ZI3RYCAR.js +233 -0
  51. package/dist/element/chunk-ZI3RYCAR.js.map +1 -0
  52. package/dist/element/element.d.ts +3044 -0
  53. package/dist/element/element.js +146554 -0
  54. package/dist/element/element.js.map +1 -0
  55. package/dist/element/revo-grid.entry-7FHEBN3O.js +4817 -0
  56. package/dist/element/revo-grid.entry-7FHEBN3O.js.map +1 -0
  57. package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js +1328 -0
  58. package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js.map +1 -0
  59. package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js +494 -0
  60. package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js.map +1 -0
  61. package/dist/element/revogr-data_4.entry-2UBOKTFN.js +1041 -0
  62. package/dist/element/revogr-data_4.entry-2UBOKTFN.js.map +1 -0
  63. package/dist/element/revogr-filter-panel.entry-B24PLQU4.js +552 -0
  64. package/dist/element/revogr-filter-panel.entry-B24PLQU4.js.map +1 -0
  65. package/dist/index.d.ts +1041 -0
  66. package/dist/index.js +10 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/react.d.ts +1915 -0
  69. package/dist/react.js +14 -0
  70. package/dist/react.js.map +1 -0
  71. package/dist/renderers/echarts.d.ts +44 -0
  72. package/dist/renderers/echarts.js +6 -0
  73. package/dist/renderers/echarts.js.map +1 -0
  74. package/dist/renderers/index.d.ts +48 -0
  75. package/dist/renderers/index.js +12 -0
  76. package/dist/renderers/index.js.map +1 -0
  77. package/dist/renderers/revogrid.d.ts +76 -0
  78. package/dist/renderers/revogrid.js +6 -0
  79. package/dist/renderers/revogrid.js.map +1 -0
  80. package/dist/renderers/tabulator.d.ts +37 -0
  81. package/dist/renderers/tabulator.js +6 -0
  82. package/dist/renderers/tabulator.js.map +1 -0
  83. package/dist/result-table-CPls-277.d.ts +1885 -0
  84. package/dist/schema/dashboard.schema.json +4374 -0
  85. package/dist/schema/semantic-model.schema.json +1200 -0
  86. package/dist/schema/widget.schema.json +1793 -0
  87. package/dist/styles.css +156 -0
  88. package/dist/theme.css +1789 -0
  89. package/dist/types-CHFSsU_X.d.ts +1007 -0
  90. package/package.json +119 -0
@@ -0,0 +1,859 @@
1
+ import { GRID_INTERNALS, toFinite, isArray, baseIteratee, getVisibleSourceItem, DISABLED_CLASS, CELL_CLASS, getSourceItem, isArrayLike, isIterateeCall, keys } from './chunk-AOKCBPMV.js';
2
+
3
+ // ../../node_modules/.pnpm/@revolist+revogrid@4.25.2/node_modules/@revolist/revogrid/dist/esm/column.service-Cfw3L0PN.js
4
+ function toInteger(value) {
5
+ var result = toFinite(value), remainder = result % 1;
6
+ return result === result ? remainder ? result - remainder : result : 0;
7
+ }
8
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
9
+ var index = -1, length = array == null ? 0 : array.length;
10
+ if (initAccum && length) {
11
+ accumulator = array[++index];
12
+ }
13
+ while (++index < length) {
14
+ accumulator = iteratee(accumulator, array[index], index, array);
15
+ }
16
+ return accumulator;
17
+ }
18
+ function createBaseFor(fromRight) {
19
+ return function(object, iteratee, keysFunc) {
20
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
21
+ while (length--) {
22
+ var key = props[++index];
23
+ if (iteratee(iterable[key], key, iterable) === false) {
24
+ break;
25
+ }
26
+ }
27
+ return object;
28
+ };
29
+ }
30
+ var baseFor = createBaseFor();
31
+ function baseForOwn(object, iteratee) {
32
+ return object && baseFor(object, iteratee, keys);
33
+ }
34
+ function createBaseEach(eachFunc, fromRight) {
35
+ return function(collection, iteratee) {
36
+ if (collection == null) {
37
+ return collection;
38
+ }
39
+ if (!isArrayLike(collection)) {
40
+ return eachFunc(collection, iteratee);
41
+ }
42
+ var length = collection.length, index = -1, iterable = Object(collection);
43
+ while (++index < length) {
44
+ if (iteratee(iterable[index], index, iterable) === false) {
45
+ break;
46
+ }
47
+ }
48
+ return collection;
49
+ };
50
+ }
51
+ var baseEach = createBaseEach(baseForOwn);
52
+ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
53
+ eachFunc(collection, function(value, index, collection2) {
54
+ accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
55
+ });
56
+ return accumulator;
57
+ }
58
+ function reduce(collection, iteratee, accumulator) {
59
+ var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
60
+ return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach);
61
+ }
62
+ function getCellData(val) {
63
+ if (typeof val === "undefined" || val === null) {
64
+ return "";
65
+ }
66
+ return val;
67
+ }
68
+ function getCellRaw(model = {}, column) {
69
+ if (!column) {
70
+ return;
71
+ }
72
+ if (column.cellParser) {
73
+ return column.cellParser(model, column);
74
+ }
75
+ return model[column.prop];
76
+ }
77
+ function getCellDataParsed(model, column) {
78
+ return getCellData(getCellRaw(model, column));
79
+ }
80
+ function getColumnType(rgCol) {
81
+ if (rgCol.pin) {
82
+ return rgCol.pin;
83
+ }
84
+ return "rgCol";
85
+ }
86
+ function getColumnSizes(cols) {
87
+ const res = {};
88
+ for (const [i, c] of cols.entries()) {
89
+ if (c.size) {
90
+ res[i] = c.size;
91
+ }
92
+ }
93
+ return res;
94
+ }
95
+ function isColGrouping(colData) {
96
+ return !!colData.children;
97
+ }
98
+ function getColumns(columns, level = 0, types, resFromRoot) {
99
+ const collection = {
100
+ // columns as they are in stores per type
101
+ columns: {
102
+ rgCol: [],
103
+ colPinStart: [],
104
+ colPinEnd: []
105
+ },
106
+ // columns indexed by prop for quick access
107
+ columnByProp: {},
108
+ // column grouping
109
+ columnGrouping: {
110
+ rgCol: [],
111
+ colPinStart: [],
112
+ colPinEnd: []
113
+ },
114
+ // sorting
115
+ sort: {},
116
+ // max depth level for column grouping
117
+ maxLevel: level
118
+ };
119
+ return reduce(columns, (res, colData) => {
120
+ var _a;
121
+ if (isColGrouping(colData)) {
122
+ res = gatherGroup(res, colData, getColumns(colData.children, level + 1, types, res), resFromRoot === null || resFromRoot === void 0 ? void 0 : resFromRoot.columns, level);
123
+ return res;
124
+ }
125
+ const columnDefinitionFromType = colData.columnType && (types === null || types === void 0 ? void 0 : types[colData.columnType]);
126
+ const regularColumn = Object.assign(Object.assign({}, columnDefinitionFromType), colData);
127
+ if (!regularColumn.pin) {
128
+ res.columns.rgCol.push(regularColumn);
129
+ } else {
130
+ res.columns[regularColumn.pin].push(regularColumn);
131
+ }
132
+ if (regularColumn.order) {
133
+ res.sort[regularColumn.prop] = regularColumn;
134
+ }
135
+ if (!res.columnByProp[regularColumn.prop]) {
136
+ res.columnByProp[regularColumn.prop] = [];
137
+ }
138
+ res.columnByProp[regularColumn.prop].push(regularColumn);
139
+ (_a = regularColumn.beforeSetup) === null || _a === void 0 ? void 0 : _a.call(regularColumn, regularColumn);
140
+ return res;
141
+ }, collection);
142
+ }
143
+ function gatherGroup(res, colData, collection, existingColumnsByType, level = 0) {
144
+ const group = Object.assign(Object.assign({}, colData), { level, indexes: [] });
145
+ columnTypes.forEach((type) => {
146
+ const resultItem = res.columns[type];
147
+ const collectionItem = collection.columns[type];
148
+ if (isArray(resultItem) && isArray(collectionItem)) {
149
+ const itemLength = collectionItem.length;
150
+ if (itemLength) {
151
+ const columnLength = [...(existingColumnsByType === null || existingColumnsByType === void 0 ? void 0 : existingColumnsByType[type]) || [], ...resultItem].length;
152
+ resultItem.push(...collectionItem);
153
+ res.columnGrouping[type].push(Object.assign(Object.assign({}, group), { indexes: Array(itemLength).fill(columnLength).map((v, i) => v + i) }));
154
+ }
155
+ }
156
+ });
157
+ for (let k in collection.columnGrouping) {
158
+ const key = k;
159
+ const collectionItem = collection.columnGrouping[key];
160
+ const delta = ((existingColumnsByType === null || existingColumnsByType === void 0 ? void 0 : existingColumnsByType[key]) || []).length;
161
+ const rebasedItem = delta > 0 ? collectionItem.map((group2) => Object.assign(Object.assign({}, group2), { indexes: group2.indexes.map((i) => i + delta) })) : collectionItem;
162
+ res.columnGrouping[key].push(...rebasedItem);
163
+ }
164
+ res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);
165
+ res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
166
+ res.columnByProp = Object.assign(Object.assign({}, res.columnByProp), collection.columnByProp);
167
+ return res;
168
+ }
169
+ function findColumn(columns, prop) {
170
+ for (const c of columns) {
171
+ if (isColGrouping(c)) {
172
+ const found = findColumn(c.children, prop);
173
+ if (found) {
174
+ return found;
175
+ }
176
+ } else if (c.prop === prop) {
177
+ return c;
178
+ }
179
+ }
180
+ return void 0;
181
+ }
182
+ function getColumnByProp(columns, prop) {
183
+ return findColumn(columns, prop);
184
+ }
185
+ function nextCell(cell, lastCell) {
186
+ const nextItem = {};
187
+ let types = ["x", "y"];
188
+ for (let t of types) {
189
+ if (cell[t] < 0) {
190
+ nextItem[t] = cell[t];
191
+ return nextItem;
192
+ }
193
+ }
194
+ for (let t of types) {
195
+ if (cell[t] >= lastCell[t]) {
196
+ nextItem[t] = cell[t] - lastCell[t];
197
+ return nextItem;
198
+ }
199
+ }
200
+ return null;
201
+ }
202
+ function cropCellToMax(cell, lastCell) {
203
+ const croppedCell = Object.assign({}, cell);
204
+ const cellCoordinates = ["x", "y"];
205
+ for (const coordinate of cellCoordinates) {
206
+ if (cell[coordinate] < 0) {
207
+ croppedCell[coordinate] = 0;
208
+ } else if (cell[coordinate] >= lastCell[coordinate]) {
209
+ croppedCell[coordinate] = lastCell[coordinate] - 1;
210
+ }
211
+ }
212
+ return croppedCell;
213
+ }
214
+ function getRange(start, end) {
215
+ return start && end ? {
216
+ x: Math.min(start.x, end.x),
217
+ y: Math.min(start.y, end.y),
218
+ x1: Math.max(start.x, end.x),
219
+ y1: Math.max(start.y, end.y)
220
+ } : null;
221
+ }
222
+ function isRangeSingleCell(a) {
223
+ return a.x === a.x1 && a.y === a.y1;
224
+ }
225
+ var rowTypes = ["rowPinStart", "rgRow", "rowPinEnd"];
226
+ var columnTypes = [
227
+ "colPinStart",
228
+ "rgCol",
229
+ "colPinEnd"
230
+ ];
231
+ function isRowType(type) {
232
+ return rowTypes.indexOf(type) > -1;
233
+ }
234
+ var GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
235
+ var PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
236
+ var PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;
237
+ var PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;
238
+ var PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;
239
+ var GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;
240
+ var GROUP_COLUMN_PROP = `${GRID_INTERNALS}-prop`;
241
+ var GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;
242
+ var GROUP_EXPAND_BTN = `group-expand`;
243
+ var GROUP_EXPAND_EVENT = `groupexpandclick`;
244
+ var GROUPING_ROW_TYPE = "rgRow";
245
+ function getGroupValueDefault(item, prop, emptyGroupValue) {
246
+ var _a;
247
+ return (_a = item[prop]) !== null && _a !== void 0 ? _a : emptyGroupValue;
248
+ }
249
+ function isDataRow(item) {
250
+ return item != null;
251
+ }
252
+ function getSource(source, items, withoutGrouping = false) {
253
+ let index = 0;
254
+ const result = {
255
+ source: [],
256
+ prevExpanded: {},
257
+ oldNewIndexes: {}
258
+ };
259
+ items.forEach((i) => {
260
+ const model = source[i];
261
+ if (!withoutGrouping) {
262
+ result.source.push(model);
263
+ return;
264
+ }
265
+ if (isGrouping(model)) {
266
+ if (getExpanded(model)) {
267
+ result.prevExpanded[model[PSEUDO_GROUP_ITEM_VALUE]] = true;
268
+ }
269
+ } else if (!isDataRow(model)) {
270
+ return;
271
+ } else {
272
+ result.source.push(model);
273
+ result.oldNewIndexes[i] = index;
274
+ index++;
275
+ }
276
+ });
277
+ return result;
278
+ }
279
+ function getExpanded(model = {}) {
280
+ return model[GROUP_EXPANDED];
281
+ }
282
+ function flattenGroupMaps({ groupedValues, parentIds, isExpanded, itemIndex, expandedAll, prevExpanded, columnProps }) {
283
+ const depth = parentIds.length;
284
+ const sourceWithGroups = [];
285
+ let trimmed = {};
286
+ let oldNewIndexMap = {};
287
+ groupedValues.forEach((innerGroupedValues, groupId) => {
288
+ const levelIds = [...parentIds, groupId];
289
+ const mergedIds = levelIds.join(",");
290
+ const isGroupExpanded = isExpanded && (!!expandedAll || !!prevExpanded[mergedIds]);
291
+ sourceWithGroups.push({
292
+ [PSEUDO_GROUP_ITEM]: groupId,
293
+ [GROUP_DEPTH]: depth,
294
+ [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),
295
+ [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,
296
+ [GROUP_EXPANDED]: isGroupExpanded,
297
+ [GROUP_COLUMN_PROP]: columnProps[depth],
298
+ [columnProps[depth]]: groupId
299
+ });
300
+ itemIndex += 1;
301
+ if (!isExpanded && depth) {
302
+ trimmed[itemIndex] = true;
303
+ }
304
+ if (Array.isArray(innerGroupedValues)) {
305
+ innerGroupedValues.forEach((value) => {
306
+ itemIndex += 1;
307
+ if (!isGroupExpanded) {
308
+ trimmed[itemIndex] = true;
309
+ }
310
+ oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;
311
+ });
312
+ sourceWithGroups.push(...innerGroupedValues);
313
+ } else {
314
+ const children = flattenGroupMaps({
315
+ groupedValues: innerGroupedValues,
316
+ parentIds: levelIds,
317
+ isExpanded: isGroupExpanded,
318
+ itemIndex,
319
+ expandedAll,
320
+ prevExpanded,
321
+ columnProps
322
+ });
323
+ sourceWithGroups.push(...children.source);
324
+ trimmed = Object.assign(Object.assign({}, children.trimmed), trimmed);
325
+ oldNewIndexMap = Object.assign(Object.assign({}, children.oldNewIndexMap), oldNewIndexMap);
326
+ itemIndex = children.itemIndex;
327
+ }
328
+ });
329
+ return {
330
+ source: sourceWithGroups,
331
+ oldNewIndexMap,
332
+ trimmed,
333
+ itemIndex
334
+ };
335
+ }
336
+ function gatherGrouping(array, columnProps, { prevExpanded = {}, expandedAll = false, getGroupValue, emptyGroupValue = "" }) {
337
+ const groupedItems = /* @__PURE__ */ new Map();
338
+ array.forEach((item, originalIndex) => {
339
+ if (!isDataRow(item)) {
340
+ return;
341
+ }
342
+ const groupLevelValues = columnProps.map((groupId) => getGroupValue ? getGroupValue(item, groupId) : getGroupValueDefault(item, groupId, emptyGroupValue));
343
+ const lastLevelValue = groupLevelValues.pop();
344
+ let currentGroupLevel = groupedItems;
345
+ groupLevelValues.forEach((value) => {
346
+ if (!currentGroupLevel.has(value)) {
347
+ currentGroupLevel.set(value, /* @__PURE__ */ new Map());
348
+ }
349
+ currentGroupLevel = currentGroupLevel.get(value);
350
+ });
351
+ if (!currentGroupLevel.has(lastLevelValue)) {
352
+ const groupItems = [];
353
+ currentGroupLevel.set(lastLevelValue, groupItems);
354
+ }
355
+ const lastLevelItems = currentGroupLevel.get(lastLevelValue);
356
+ lastLevelItems.push(Object.assign(Object.assign({}, item), { [GROUP_ORIGINAL_INDEX]: originalIndex }));
357
+ });
358
+ const groupingDepth = columnProps.length;
359
+ const { source: sourceWithGroups, trimmed, oldNewIndexMap } = flattenGroupMaps({
360
+ groupedValues: groupedItems,
361
+ parentIds: [],
362
+ isExpanded: true,
363
+ itemIndex: -1,
364
+ expandedAll,
365
+ prevExpanded,
366
+ columnProps
367
+ });
368
+ return {
369
+ sourceWithGroups,
370
+ // updates source mirror
371
+ depth: groupingDepth,
372
+ // largest depth for grouping
373
+ trimmed,
374
+ // used for expand/collapse grouping values
375
+ oldNewIndexMap
376
+ // used for mapping old values to new
377
+ };
378
+ }
379
+ function getGroupingName(rgRow) {
380
+ return rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM];
381
+ }
382
+ function isGrouping(rgRow) {
383
+ return typeof (rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM]) !== "undefined";
384
+ }
385
+ function isGroupingColumn(column) {
386
+ return typeof (column === null || column === void 0 ? void 0 : column[PSEUDO_GROUP_COLUMN]) !== "undefined";
387
+ }
388
+ function measureEqualDepth(groupA, groupB) {
389
+ const ln = groupA.length;
390
+ let i = 0;
391
+ for (; i < ln; i++) {
392
+ if (groupA[i] !== groupB[i]) {
393
+ return i;
394
+ }
395
+ }
396
+ return i;
397
+ }
398
+ function getParsedGroup(id) {
399
+ const parseGroup = JSON.parse(id);
400
+ if (!Array.isArray(parseGroup)) {
401
+ return null;
402
+ }
403
+ return parseGroup;
404
+ }
405
+ function isSameGroup(currentGroup, currentModel, nextModel) {
406
+ const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);
407
+ if (!nextGroup) {
408
+ return false;
409
+ }
410
+ const depth = measureEqualDepth(currentGroup, nextGroup);
411
+ return currentModel[GROUP_DEPTH] < depth;
412
+ }
413
+ function baseSlice(array, start, end) {
414
+ var index = -1, length = array.length;
415
+ if (start < 0) {
416
+ start = -start > length ? 0 : length + start;
417
+ }
418
+ end = end > length ? length : end;
419
+ if (end < 0) {
420
+ end += length;
421
+ }
422
+ length = start > end ? 0 : end - start >>> 0;
423
+ start >>>= 0;
424
+ var result = Array(length);
425
+ while (++index < length) {
426
+ result[index] = array[index + start];
427
+ }
428
+ return result;
429
+ }
430
+ function slice(array, start, end) {
431
+ var length = array == null ? 0 : array.length;
432
+ if (!length) {
433
+ return [];
434
+ }
435
+ if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
436
+ start = 0;
437
+ end = length;
438
+ } else {
439
+ start = start == null ? 0 : toInteger(start);
440
+ end = end === void 0 ? length : toInteger(end);
441
+ }
442
+ return baseSlice(array, start, end);
443
+ }
444
+ function getCellEditor(column, editors = {}) {
445
+ const editor = column === null || column === void 0 ? void 0 : column.editor;
446
+ if (!editor) {
447
+ return void 0;
448
+ }
449
+ if (typeof editor === "string") {
450
+ return editors[editor];
451
+ }
452
+ return editor;
453
+ }
454
+ var ColumnService = class {
455
+ get columns() {
456
+ return getVisibleSourceItem(this.source);
457
+ }
458
+ constructor(dataStore, source) {
459
+ this.dataStore = dataStore;
460
+ this.source = source;
461
+ this.unsubscribe = [];
462
+ this.hasGrouping = false;
463
+ this.unsubscribe.push(source.onChange("source", (s) => this.checkGrouping(s)));
464
+ this.checkGrouping(source.get("source"));
465
+ this.type = source.get("type");
466
+ }
467
+ checkGrouping(cols) {
468
+ for (let rgCol of cols) {
469
+ if (isGroupingColumn(rgCol)) {
470
+ this.hasGrouping = true;
471
+ return;
472
+ }
473
+ this.hasGrouping = false;
474
+ }
475
+ }
476
+ isReadOnly(r, c) {
477
+ var _a;
478
+ const readOnly = (_a = this.columns[c]) === null || _a === void 0 ? void 0 : _a.readonly;
479
+ if (typeof readOnly === "function") {
480
+ const data = this.rowDataModel(r, c);
481
+ return readOnly(data);
482
+ }
483
+ return !!readOnly;
484
+ }
485
+ mergeProperties(r, c, defaultProps, schemaModel) {
486
+ var _a, _b;
487
+ const props = Object.assign({}, defaultProps);
488
+ props.class = Object.assign(Object.assign({}, typeof props.class === "string" ? { [props.class]: true } : props.class), { [CELL_CLASS]: true, [DISABLED_CLASS]: this.isReadOnly(r, c) });
489
+ const extra = (_b = (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties) === null || _b === void 0 ? void 0 : _b.call(_a, schemaModel);
490
+ if (!extra) {
491
+ return props;
492
+ }
493
+ return doPropMerge(props, extra);
494
+ }
495
+ getRowClass(r, prop) {
496
+ const model = getSourceItem(this.dataStore, r) || {};
497
+ return model[prop] || "";
498
+ }
499
+ getSaveData(rowIndex, colIndex, val) {
500
+ const data = this.rowDataModel(rowIndex, colIndex);
501
+ if (typeof val === "undefined") {
502
+ val = getCellData(data.value);
503
+ }
504
+ return Object.assign(Object.assign({}, data), { val });
505
+ }
506
+ /**
507
+ * Get cell data model for given rowIndex and colIndex
508
+ * Used to pass data to editor/renderer
509
+ */
510
+ rowDataModel(rowIndex, colIndex) {
511
+ const column = this.columns[colIndex];
512
+ const prop = column === null || column === void 0 ? void 0 : column.prop;
513
+ const model = getSourceItem(this.dataStore, rowIndex) || {};
514
+ const type = this.dataStore.get("type");
515
+ return {
516
+ prop,
517
+ model,
518
+ data: this.dataStore.get("source"),
519
+ column,
520
+ rowIndex,
521
+ colIndex,
522
+ colType: this.type,
523
+ type,
524
+ value: getCellRaw(model, column)
525
+ };
526
+ }
527
+ getRangeData(d, columns) {
528
+ var _a;
529
+ const changed = {};
530
+ const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;
531
+ const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;
532
+ const mapping = {};
533
+ for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {
534
+ const oldRowIndex = d.oldRange.y + i % copyRowLength;
535
+ const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};
536
+ for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {
537
+ if (rowIndex >= d.oldRange.y && rowIndex <= d.oldRange.y1 && colIndex >= d.oldRange.x && colIndex <= d.oldRange.x1) {
538
+ continue;
539
+ }
540
+ if (!this.columns[colIndex]) {
541
+ continue;
542
+ }
543
+ const prop = (_a = this.columns[colIndex]) === null || _a === void 0 ? void 0 : _a.prop;
544
+ const copyColIndex = d.oldRange.x + j % copyColLength;
545
+ const copyColumnProp = columns[copyColIndex].prop;
546
+ if (!this.isReadOnly(rowIndex, colIndex)) {
547
+ if (!changed[rowIndex]) {
548
+ changed[rowIndex] = {};
549
+ }
550
+ changed[rowIndex][prop] = copyRow[copyColumnProp];
551
+ if (!mapping[rowIndex]) {
552
+ mapping[rowIndex] = {};
553
+ }
554
+ mapping[rowIndex][prop] = {
555
+ colIndex: copyColIndex,
556
+ colProp: copyColumnProp,
557
+ rowIndex: oldRowIndex
558
+ };
559
+ }
560
+ }
561
+ }
562
+ return {
563
+ changed,
564
+ mapping
565
+ };
566
+ }
567
+ getTransformedDataToApply({ start, data, targetRange }) {
568
+ const changed = {};
569
+ const copyRowLength = data.length;
570
+ if (!copyRowLength) {
571
+ return {
572
+ changed,
573
+ range: null
574
+ };
575
+ }
576
+ const colLength = this.columns.length;
577
+ const rowLength = this.dataStore.get("items").length;
578
+ const bounds = this.getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength);
579
+ if (!bounds) {
580
+ return {
581
+ changed,
582
+ range: null
583
+ };
584
+ }
585
+ const { startRow, startCol, endRow } = bounds;
586
+ let maxCol = startCol - 1;
587
+ let lastRow = startRow - 1;
588
+ for (let rowIndex = startRow, i = 0; rowIndex <= endRow; rowIndex++, i++) {
589
+ const copyRow = data[i % copyRowLength];
590
+ const copyColLength = (copyRow === null || copyRow === void 0 ? void 0 : copyRow.length) || 0;
591
+ if (!copyColLength) {
592
+ continue;
593
+ }
594
+ maxCol = Math.max(maxCol, this.applyClipboardRow(changed, {
595
+ bounds,
596
+ copyColLength,
597
+ copyRow,
598
+ rowIndex,
599
+ start,
600
+ targetRange
601
+ }));
602
+ lastRow = rowIndex;
603
+ }
604
+ return {
605
+ changed,
606
+ range: this.getAppliedRange(bounds, lastRow, maxCol)
607
+ };
608
+ }
609
+ getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength) {
610
+ var _a, _b, _c;
611
+ const startRow = (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y) !== null && _a !== void 0 ? _a : start.y;
612
+ const startCol = (_b = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x) !== null && _b !== void 0 ? _b : start.x;
613
+ const endRow = Math.min(rowLength - 1, (_c = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y1) !== null && _c !== void 0 ? _c : start.y + copyRowLength - 1);
614
+ if (endRow < startRow || startCol >= colLength) {
615
+ return null;
616
+ }
617
+ return { startRow, startCol, endRow, colLength };
618
+ }
619
+ applyClipboardRow(changed, { bounds, copyColLength, copyRow, rowIndex, start, targetRange }) {
620
+ var _a;
621
+ const endCol = Math.min(bounds.colLength - 1, (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x1) !== null && _a !== void 0 ? _a : start.x + copyColLength - 1);
622
+ for (let colIndex = bounds.startCol, j = 0; colIndex <= endCol; colIndex++, j++) {
623
+ if (this.isReadOnly(rowIndex, colIndex)) {
624
+ continue;
625
+ }
626
+ const prop = this.columns[colIndex].prop;
627
+ changed[rowIndex] = changed[rowIndex] || {};
628
+ changed[rowIndex][prop] = copyRow[j % copyColLength];
629
+ }
630
+ return endCol;
631
+ }
632
+ getAppliedRange({ startRow, startCol }, lastRow, maxCol) {
633
+ if (lastRow < startRow || maxCol < startCol) {
634
+ return null;
635
+ }
636
+ return getRange({ x: startCol, y: startRow }, {
637
+ y: lastRow,
638
+ x: maxCol
639
+ });
640
+ }
641
+ getRangeStaticData(d, value) {
642
+ const changed = {};
643
+ for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {
644
+ for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {
645
+ if (!this.columns[colIndex]) {
646
+ continue;
647
+ }
648
+ const p = this.columns[colIndex].prop;
649
+ if (!this.isReadOnly(rowIndex, colIndex)) {
650
+ if (!changed[rowIndex]) {
651
+ changed[rowIndex] = {};
652
+ }
653
+ changed[rowIndex][p] = value;
654
+ }
655
+ }
656
+ }
657
+ return changed;
658
+ }
659
+ getRangeTransformedToProps(d, store) {
660
+ var _a;
661
+ const area = [];
662
+ const type = this.dataStore.get("type");
663
+ for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {
664
+ for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {
665
+ const prop = (_a = this.columns[colIndex]) === null || _a === void 0 ? void 0 : _a.prop;
666
+ area.push({
667
+ prop,
668
+ rowIndex,
669
+ colIndex,
670
+ model: getSourceItem(store, rowIndex),
671
+ type,
672
+ colType: this.type
673
+ });
674
+ }
675
+ }
676
+ return area;
677
+ }
678
+ copyRangeArray(range, store) {
679
+ const cols = [...this.columns];
680
+ const props = slice(cols, range.x, range.x1 + 1).map((v) => v.prop);
681
+ const toCopy = [];
682
+ const mapping = {};
683
+ for (let i = range.y; i <= range.y1; i++) {
684
+ const rgRow = [];
685
+ mapping[i] = {};
686
+ for (let prop of props) {
687
+ const item = getSourceItem(store, i);
688
+ if (!item) {
689
+ continue;
690
+ }
691
+ const val = item[prop];
692
+ rgRow.push(val);
693
+ mapping[i][prop] = val;
694
+ }
695
+ toCopy.push(rgRow);
696
+ }
697
+ return {
698
+ data: toCopy,
699
+ mapping
700
+ };
701
+ }
702
+ destroy() {
703
+ this.unsubscribe.forEach((f) => f());
704
+ }
705
+ };
706
+ function isRowDragService(rowDrag, model) {
707
+ if (typeof rowDrag === "function") {
708
+ return rowDrag(model);
709
+ }
710
+ return !!rowDrag;
711
+ }
712
+ function mergeClasses(class1 = {}, class2 = {}) {
713
+ if (typeof class1 === "string") {
714
+ class1 = { [class1]: true };
715
+ }
716
+ if (typeof class2 === "string") {
717
+ class2 = { [class2]: true };
718
+ }
719
+ return Object.assign(Object.assign({}, class1), class2);
720
+ }
721
+ function doPropMerge(existing, extra) {
722
+ if (extra.className) {
723
+ extra.class = mergeClasses(extra.class, extra.className);
724
+ delete extra.className;
725
+ }
726
+ let props = Object.assign(Object.assign({}, extra), existing);
727
+ if (extra.class) {
728
+ props.class = mergeClasses(props.class, extra.class);
729
+ }
730
+ if (extra.style) {
731
+ props.style = Object.assign(Object.assign({}, extra.style), props.style);
732
+ }
733
+ return props;
734
+ }
735
+
736
+ // ../../node_modules/.pnpm/@revolist+revogrid@4.25.2/node_modules/@revolist/revogrid/dist/esm/viewport.helpers-CoCAvmZs.js
737
+ var FALLBACK_MAX_SCROLL_SIZE = 16e6;
738
+ var SCROLL_SIZE_GUARD = 1e6;
739
+ var detectedMaxScrollSize;
740
+ function getMaxScrollSize(doc = typeof document === "undefined" ? void 0 : document) {
741
+ if (typeof detectedMaxScrollSize === "number") {
742
+ return detectedMaxScrollSize;
743
+ }
744
+ const body = doc === null || doc === void 0 ? void 0 : doc.body;
745
+ if (body) {
746
+ const ownerDocument = body.ownerDocument;
747
+ const element = ownerDocument.createElement("div");
748
+ element.style.cssText = [
749
+ "height:1px",
750
+ "left:-10000px",
751
+ "overflow:scroll",
752
+ "position:absolute",
753
+ "top:-10000px",
754
+ "visibility:hidden",
755
+ "width:1px"
756
+ ].join(";");
757
+ const content = ownerDocument.createElement("div");
758
+ content.style.height = `${FALLBACK_MAX_SCROLL_SIZE * 4}px`;
759
+ element.appendChild(content);
760
+ body.appendChild(element);
761
+ detectedMaxScrollSize = Math.max(0, Math.min(element.scrollHeight, FALLBACK_MAX_SCROLL_SIZE * 4) - SCROLL_SIZE_GUARD);
762
+ element.remove();
763
+ if (detectedMaxScrollSize > SCROLL_SIZE_GUARD) {
764
+ return detectedMaxScrollSize;
765
+ }
766
+ detectedMaxScrollSize = FALLBACK_MAX_SCROLL_SIZE;
767
+ return detectedMaxScrollSize;
768
+ }
769
+ return FALLBACK_MAX_SCROLL_SIZE;
770
+ }
771
+ function getScrollDimension({ contentSize, clientSize, virtualSize = 0, maxScrollSize = getMaxScrollSize() }) {
772
+ const safeContentSize = Math.max(0, maxScrollSize - SCROLL_SIZE_GUARD);
773
+ const size = Math.max(0, contentSize);
774
+ const client = Math.max(0, clientSize);
775
+ const viewport = Math.max(0, virtualSize || client);
776
+ const logicalScrollSize = Math.max(0, size - viewport);
777
+ const maxPhysicalScrollSize = Math.max(0, safeContentSize - client);
778
+ const physicalScrollSize = Math.min(logicalScrollSize, maxPhysicalScrollSize);
779
+ const physicalContentSize = client + physicalScrollSize;
780
+ const isCompressed = logicalScrollSize > physicalScrollSize && physicalScrollSize > 0;
781
+ const clampLogical = (coordinate) => Math.min(Math.max(0, coordinate || 0), logicalScrollSize);
782
+ const clampPhysical = (coordinate) => Math.min(Math.max(0, coordinate || 0), physicalScrollSize);
783
+ const toLogicalCoordinate = (coordinate) => {
784
+ if (!logicalScrollSize || !physicalScrollSize) {
785
+ return 0;
786
+ }
787
+ if (!isCompressed) {
788
+ return clampLogical(coordinate);
789
+ }
790
+ return clampLogical(clampPhysical(coordinate) / physicalScrollSize * logicalScrollSize);
791
+ };
792
+ const toPhysicalCoordinate = (coordinate) => {
793
+ if (!logicalScrollSize || !physicalScrollSize) {
794
+ return 0;
795
+ }
796
+ if (!isCompressed) {
797
+ return clampPhysical(coordinate);
798
+ }
799
+ return clampPhysical(clampLogical(coordinate) / logicalScrollSize * physicalScrollSize);
800
+ };
801
+ return {
802
+ contentSize: size,
803
+ clientSize: client,
804
+ viewportSize: viewport,
805
+ physicalContentSize,
806
+ logicalScrollSize,
807
+ physicalScrollSize,
808
+ isCompressed,
809
+ toLogicalCoordinate,
810
+ toPhysicalCoordinate,
811
+ getRenderOffset(coordinate) {
812
+ const logical = clampLogical(coordinate);
813
+ return logical - toPhysicalCoordinate(logical);
814
+ }
815
+ };
816
+ }
817
+ var HEADER_SLOT = "header";
818
+ var FOOTER_SLOT = "footer";
819
+ var CONTENT_SLOT = "content";
820
+ var DATA_SLOT = "data";
821
+ function getLastCell(data, rowType) {
822
+ const lastVisibleColumnCount = data.viewports[data.colType].store.get("realCount");
823
+ const lastVisibleRowCount = data.viewports[rowType].store.get("realCount");
824
+ return {
825
+ x: lastVisibleColumnCount,
826
+ y: lastVisibleRowCount
827
+ };
828
+ }
829
+ function viewportDataPartition(data, type, slot, fixed) {
830
+ return {
831
+ colData: data.colStore,
832
+ viewportCol: data.viewports[data.colType].store,
833
+ viewportRow: data.viewports[type].store,
834
+ /**
835
+ * lastCell is the last real coordinate + 1, saved to selection store
836
+ */
837
+ lastCell: getLastCell(data, type),
838
+ slot,
839
+ type,
840
+ canDrag: !fixed,
841
+ position: data.position,
842
+ dataStore: data.rowStores[type].store,
843
+ dimensionCol: data.dimensions[data.colType].store,
844
+ dimensionRow: data.dimensions[type].store,
845
+ style: fixed ? { height: `${data.dimensions[type].store.get("realSize")}px` } : void 0
846
+ };
847
+ }
848
+ /*! Bundled license information:
849
+
850
+ @revolist/revogrid/dist/esm/column.service-Cfw3L0PN.js:
851
+ @revolist/revogrid/dist/esm/viewport.helpers-CoCAvmZs.js:
852
+ (*!
853
+ * Built by Revolist OU ❤️
854
+ *)
855
+ */
856
+
857
+ export { CONTENT_SLOT, ColumnService, DATA_SLOT, FOOTER_SLOT, GROUPING_ROW_TYPE, GROUP_COLUMN_PROP, GROUP_DEPTH, GROUP_EXPANDED, GROUP_EXPAND_BTN, GROUP_EXPAND_EVENT, HEADER_SLOT, PSEUDO_GROUP_COLUMN, PSEUDO_GROUP_ITEM, PSEUDO_GROUP_ITEM_ID, PSEUDO_GROUP_ITEM_VALUE, baseEach, columnTypes, cropCellToMax, doPropMerge, gatherGrouping, getCellData, getCellDataParsed, getCellEditor, getCellRaw, getColumnByProp, getColumnSizes, getColumnType, getColumns, getExpanded, getGroupingName, getParsedGroup, getRange, getScrollDimension, getSource, isColGrouping, isGrouping, isGroupingColumn, isRangeSingleCell, isRowDragService, isRowType, isSameGroup, nextCell, reduce, rowTypes, toInteger, viewportDataPartition };
858
+ //# sourceMappingURL=chunk-TXSK3CIN.js.map
859
+ //# sourceMappingURL=chunk-TXSK3CIN.js.map