@revolist/revogrid 4.27.3 → 4.27.5
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.
- package/dist/cjs/index.cjs.js +1 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +1 -1
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +31 -139
- package/dist/cjs/{row-resize.plugin-C4YOF1lN.js → row-resize.plugin-jaZje3kL.js} +4 -53
- package/dist/collection/plugins/filter/filter.indexed.js +0 -5
- package/dist/collection/plugins/filter/filter.panel.js +31 -140
- package/dist/collection/plugins/filter/filter.plugin.js +5 -48
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +1 -1
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-filter-panel.entry.js +31 -139
- package/dist/esm/{row-resize.plugin-Beu0pMds.js → row-resize.plugin-Dzn9bTOr.js} +5 -53
- package/dist/revo-grid/index.esm.js +2 -2
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js +31 -139
- package/dist/revo-grid/{row-resize.plugin-Beu0pMds.js → row-resize.plugin-Dzn9bTOr.js} +5 -53
- package/dist/types/plugins/filter/filter.indexed.d.ts +0 -2
- package/dist/types/plugins/filter/filter.panel.d.ts +2 -9
- package/dist/types/plugins/filter/filter.plugin.d.ts +1 -8
- package/dist/types/plugins/filter/filter.types.d.ts +0 -8
- package/dist/types/types/interfaces.d.ts +1 -13
- package/hydrate/index.js +35 -192
- package/hydrate/index.mjs +35 -192
- package/package.json +1 -1
- package/standalone/index.js +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-filter-panel.js +1 -1
|
@@ -20,7 +20,6 @@ const VIEWPORT_PADDING = 8;
|
|
|
20
20
|
*/
|
|
21
21
|
export class FilterPanel {
|
|
22
22
|
constructor() {
|
|
23
|
-
this.hasChanges = false;
|
|
24
23
|
this.filterCaptionsInternal = {
|
|
25
24
|
title: 'Filter by',
|
|
26
25
|
ok: 'Close',
|
|
@@ -56,7 +55,7 @@ export class FilterPanel {
|
|
|
56
55
|
*/
|
|
57
56
|
this.allowDuplicateOperators = true;
|
|
58
57
|
this.debouncedApplyFilter = debounce(() => {
|
|
59
|
-
this.
|
|
58
|
+
this.filterChange.emit(this.filterItems);
|
|
60
59
|
}, 400);
|
|
61
60
|
}
|
|
62
61
|
onMouseDown(e) {
|
|
@@ -86,27 +85,10 @@ export class FilterPanel {
|
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
async show(newEntity) {
|
|
89
|
-
this.hasChanges = false;
|
|
90
88
|
this.changes = newEntity;
|
|
91
|
-
this.filterItems =
|
|
92
|
-
this.draftFilter = undefined;
|
|
89
|
+
this.filterItems = (newEntity === null || newEntity === void 0 ? void 0 : newEntity.filterItems) || {};
|
|
93
90
|
if (this.changes) {
|
|
94
91
|
this.changes.type = this.changes.type || defaultType;
|
|
95
|
-
const prop = this.changes.prop;
|
|
96
|
-
const propFilters = prop === undefined ? undefined : this.filterItems[prop];
|
|
97
|
-
if (!(propFilters === null || propFilters === void 0 ? void 0 : propFilters.length) &&
|
|
98
|
-
this.changes.showDefaultFilter !== false &&
|
|
99
|
-
this.changes.hideDefaultFilters !== true) {
|
|
100
|
-
const type = this.resolveDraftFilterType(this.changes.defaultFilterType);
|
|
101
|
-
if (type) {
|
|
102
|
-
this.draftFilter = {
|
|
103
|
-
id: ++this.filterId,
|
|
104
|
-
type,
|
|
105
|
-
value: '',
|
|
106
|
-
relation: 'and',
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
92
|
}
|
|
111
93
|
}
|
|
112
94
|
async getChanges() {
|
|
@@ -127,42 +109,29 @@ export class FilterPanel {
|
|
|
127
109
|
const prop = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.prop;
|
|
128
110
|
if (prop === undefined)
|
|
129
111
|
return '';
|
|
130
|
-
const propFilters = (
|
|
131
|
-
|
|
132
|
-
index,
|
|
133
|
-
isDraft: false,
|
|
134
|
-
}));
|
|
135
|
-
if (this.draftFilter) {
|
|
136
|
-
propFilters.push({
|
|
137
|
-
filter: this.draftFilter,
|
|
138
|
-
index: propFilters.length,
|
|
139
|
-
isDraft: true,
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
const visibleFilters = propFilters.filter(({ filter }) => !filter.hidden);
|
|
143
|
-
const visibleFilterCount = visibleFilters.length;
|
|
112
|
+
const propFilters = (_b = this.filterItems[prop]) !== null && _b !== void 0 ? _b : [];
|
|
113
|
+
const visibleFilterCount = propFilters.filter(filter => !filter.hidden).length;
|
|
144
114
|
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
145
|
-
return (h("div", { key: this.filterId }, h("ul", { class: "multi-filter-list-container" }, propFilters.map((
|
|
146
|
-
var _a;
|
|
115
|
+
return (h("div", { key: this.filterId }, h("ul", { class: "multi-filter-list-container" }, propFilters.map((filter, index) => {
|
|
147
116
|
let andOrButton;
|
|
148
117
|
if (filter.hidden) {
|
|
149
118
|
return;
|
|
150
119
|
}
|
|
151
120
|
// hide toggle button if there is only one filter and the last one
|
|
152
|
-
if (
|
|
121
|
+
if (index !== this.filterItems[prop].length - 1) {
|
|
153
122
|
andOrButton = (h(AndOrButton, { text: filter.relation === 'and' ? capts.and : capts.or, onClick: () => this.toggleFilterAndOr(filter.id) }));
|
|
154
123
|
}
|
|
155
|
-
const extra = this.renderExtra(prop, index
|
|
124
|
+
const extra = this.renderExtra(prop, index);
|
|
156
125
|
const isDragging = this.draggedFilterId === filter.id;
|
|
157
126
|
const isDragOver = this.dragOverFilterId === filter.id && !isDragging;
|
|
158
|
-
const canReorder = visibleFilterCount > 1
|
|
127
|
+
const canReorder = visibleFilterCount > 1;
|
|
159
128
|
return (h("li", { key: filter.id, class: FILTER_LIST_CLASS, "aria-label": `${capts.filterCondition} ${index + 1}` }, h("div", { class: {
|
|
160
129
|
'multi-filter-list-row': true,
|
|
161
130
|
'filter-row-drop-active': this.draggedFilterId !== undefined && !isDragging,
|
|
162
131
|
'filter-row-dragging': isDragging,
|
|
163
132
|
'filter-row-drag-over': isDragOver,
|
|
164
|
-
} }, canReorder ? (h("button", { type: "button", class: "filter-row-drop-target", tabIndex: -1, "aria-label": `${capts.filterCondition} ${index + 1}`, onDragOver: e => this.onFilterDragOver(e, filter.id), onDragLeave: () => this.onFilterDragLeave(filter.id), onDrop: e => this.onFilterDrop(e, prop, filter.id) })) : '', canReorder ? (h(ReorderButton, { ariaLabel: capts.reorderFilter, dragging: isDragging, dragOver: isDragOver, onDragStart: e => this.onFilterDragStart(e, filter.id), onDragEnd: () => this.onFilterDragEnd(), onKeyDown: e => this.onFilterReorderKeyDown(e, prop, filter.id) })) : '', h("div", { class: { 'select-input': true } }, h("select", { class: "select-css select-filter", onChange: e => this.onFilterTypeChange(e, prop, index
|
|
165
|
-
})),
|
|
133
|
+
} }, canReorder ? (h("button", { type: "button", class: "filter-row-drop-target", tabIndex: -1, "aria-label": `${capts.filterCondition} ${index + 1}`, onDragOver: e => this.onFilterDragOver(e, filter.id), onDragLeave: () => this.onFilterDragLeave(filter.id), onDrop: e => this.onFilterDrop(e, prop, filter.id) })) : '', canReorder ? (h(ReorderButton, { ariaLabel: capts.reorderFilter, dragging: isDragging, dragOver: isDragOver, onDragStart: e => this.onFilterDragStart(e, filter.id), onDragEnd: () => this.onFilterDragEnd(), onKeyDown: e => this.onFilterReorderKeyDown(e, prop, filter.id) })) : '', h("div", { class: { 'select-input': true } }, h("select", { class: "select-css select-filter", onChange: e => this.onFilterTypeChange(e, prop, index) }, this.renderSelectOptions(this.filterItems[prop][index].type, true)), extra ? h("div", { class: "filter-extra" }, extra) : ''), h("div", { class: FILTER_LIST_CLASS_ACTION }, andOrButton, h(TrashButton, { ariaLabel: capts.removeFilter, onClick: () => this.onRemoveFilter(filter.id) })))));
|
|
134
|
+
})), propFilters.some(f => !f.hidden) ? h("div", { class: "add-filter-divider" }) : ''));
|
|
166
135
|
}
|
|
167
136
|
componentDidRender() {
|
|
168
137
|
this.syncDialog();
|
|
@@ -211,24 +180,16 @@ export class FilterPanel {
|
|
|
211
180
|
el.style.left = `${left}px`;
|
|
212
181
|
el.style.top = `${top}px`;
|
|
213
182
|
}
|
|
214
|
-
onFilterTypeChange(e, prop, index
|
|
183
|
+
onFilterTypeChange(e, prop, index) {
|
|
215
184
|
if (!(e.target instanceof HTMLSelectElement)) {
|
|
216
185
|
return;
|
|
217
186
|
}
|
|
218
|
-
|
|
219
|
-
const filter = isDraft
|
|
220
|
-
? this.promoteDraft(prop, type)
|
|
221
|
-
: this.filterItems[prop][index];
|
|
222
|
-
if (!filter) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
filter.type = type;
|
|
226
|
-
this.hasChanges = true;
|
|
187
|
+
this.filterItems[prop][index].type = e.target.value;
|
|
227
188
|
// this re-renders the input to know if we need extra input
|
|
228
189
|
this.filterId++;
|
|
229
190
|
// adding setTimeout will wait for the next tick DOM update then focus on input
|
|
230
191
|
setTimeout(() => {
|
|
231
|
-
const input = document.getElementById('filter-input-' +
|
|
192
|
+
const input = document.getElementById('filter-input-' + this.filterItems[prop][index].id);
|
|
232
193
|
if (input instanceof HTMLInputElement) {
|
|
233
194
|
input.focus();
|
|
234
195
|
}
|
|
@@ -263,20 +224,12 @@ export class FilterPanel {
|
|
|
263
224
|
return;
|
|
264
225
|
this.filterId++;
|
|
265
226
|
this.currentFilterId = this.filterId;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
this.filterItems[prop].push({
|
|
273
|
-
id: this.currentFilterId,
|
|
274
|
-
type: this.currentFilterType,
|
|
275
|
-
value: '',
|
|
276
|
-
relation: 'and',
|
|
277
|
-
});
|
|
278
|
-
this.hasChanges = true;
|
|
279
|
-
}
|
|
227
|
+
this.filterItems[prop].push({
|
|
228
|
+
id: this.currentFilterId,
|
|
229
|
+
type: this.currentFilterType,
|
|
230
|
+
value: '',
|
|
231
|
+
relation: 'and',
|
|
232
|
+
});
|
|
280
233
|
// adding setTimeout will wait for the next tick DOM update then focus on input
|
|
281
234
|
setTimeout(() => {
|
|
282
235
|
const input = document.getElementById('filter-input-' + this.currentFilterId);
|
|
@@ -285,9 +238,7 @@ export class FilterPanel {
|
|
|
285
238
|
}, 0);
|
|
286
239
|
}
|
|
287
240
|
onSave() {
|
|
288
|
-
|
|
289
|
-
this.emitFilterChange();
|
|
290
|
-
}
|
|
241
|
+
this.filterChange.emit(this.filterItems);
|
|
291
242
|
}
|
|
292
243
|
onCancel() {
|
|
293
244
|
this.changes = undefined;
|
|
@@ -295,25 +246,16 @@ export class FilterPanel {
|
|
|
295
246
|
onReset() {
|
|
296
247
|
var _a;
|
|
297
248
|
this.assertChanges();
|
|
298
|
-
this.
|
|
299
|
-
const prop = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.prop;
|
|
300
|
-
if (prop !== undefined) {
|
|
301
|
-
delete this.filterItems[prop];
|
|
302
|
-
}
|
|
303
|
-
this.resetChange.emit(prop);
|
|
249
|
+
this.resetChange.emit((_a = this.changes) === null || _a === void 0 ? void 0 : _a.prop);
|
|
304
250
|
// this updates the DOM which is used by getFilterItemsList() key
|
|
305
251
|
this.filterId++;
|
|
306
252
|
}
|
|
307
253
|
onRemoveFilter(id) {
|
|
308
|
-
var _a
|
|
254
|
+
var _a;
|
|
309
255
|
this.assertChanges();
|
|
310
256
|
// this is for reactivity issues for getFilterItemsList()
|
|
311
257
|
this.filterId++;
|
|
312
258
|
const prop = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.prop;
|
|
313
|
-
if (((_b = this.draftFilter) === null || _b === void 0 ? void 0 : _b.id) === id) {
|
|
314
|
-
this.draftFilter = undefined;
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
259
|
const items = this.filterItems[prop !== null && prop !== void 0 ? prop : ''];
|
|
318
260
|
if (!items)
|
|
319
261
|
return;
|
|
@@ -321,7 +263,6 @@ export class FilterPanel {
|
|
|
321
263
|
if (index === -1)
|
|
322
264
|
return;
|
|
323
265
|
items.splice(index, 1);
|
|
324
|
-
this.hasChanges = true;
|
|
325
266
|
// let's remove the prop if no more filters so the filter icon will be removed
|
|
326
267
|
if (items.length === 0)
|
|
327
268
|
delete this.filterItems[prop !== null && prop !== void 0 ? prop : ''];
|
|
@@ -363,7 +304,6 @@ export class FilterPanel {
|
|
|
363
304
|
if (!moveFilterItem(items, sourceId, targetId)) {
|
|
364
305
|
return;
|
|
365
306
|
}
|
|
366
|
-
this.hasChanges = true;
|
|
367
307
|
this.filterId++;
|
|
368
308
|
if (!this.disableDynamicFiltering) {
|
|
369
309
|
this.debouncedApplyFilter();
|
|
@@ -399,7 +339,6 @@ export class FilterPanel {
|
|
|
399
339
|
if (!target || !moveFilterItem(items, sourceId, target.id)) {
|
|
400
340
|
return;
|
|
401
341
|
}
|
|
402
|
-
this.hasChanges = true;
|
|
403
342
|
this.filterId++;
|
|
404
343
|
if (!this.disableDynamicFiltering) {
|
|
405
344
|
this.debouncedApplyFilter();
|
|
@@ -418,7 +357,6 @@ export class FilterPanel {
|
|
|
418
357
|
if (index === -1)
|
|
419
358
|
return;
|
|
420
359
|
items[index].relation = items[index].relation === 'and' ? 'or' : 'and';
|
|
421
|
-
this.hasChanges = true;
|
|
422
360
|
if (!this.disableDynamicFiltering) {
|
|
423
361
|
this.debouncedApplyFilter();
|
|
424
362
|
}
|
|
@@ -467,22 +405,12 @@ export class FilterPanel {
|
|
|
467
405
|
}
|
|
468
406
|
return options;
|
|
469
407
|
}
|
|
470
|
-
renderExtra(prop, index
|
|
471
|
-
|
|
472
|
-
const currentFilter = isDraft
|
|
473
|
-
? this.draftFilter
|
|
474
|
-
: (_a = this.filterItems[prop]) === null || _a === void 0 ? void 0 : _a[index];
|
|
408
|
+
renderExtra(prop, index) {
|
|
409
|
+
const currentFilter = this.filterItems[prop];
|
|
475
410
|
if (!currentFilter)
|
|
476
411
|
return '';
|
|
477
412
|
const applyFilter = (value) => {
|
|
478
|
-
|
|
479
|
-
if (isDraft && !this.isMeaningfulDraftValue(value)) {
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
if (isDraft && !this.promoteDraft(prop)) {
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
this.hasChanges = true;
|
|
413
|
+
this.filterItems[prop][index].value = value;
|
|
486
414
|
if (!this.disableDynamicFiltering) {
|
|
487
415
|
this.debouncedApplyFilter();
|
|
488
416
|
}
|
|
@@ -497,11 +425,11 @@ export class FilterPanel {
|
|
|
497
425
|
}
|
|
498
426
|
};
|
|
499
427
|
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
500
|
-
const extra =
|
|
428
|
+
const extra = this.filterEntities[currentFilter[index].type].extra;
|
|
501
429
|
if (typeof extra === 'function') {
|
|
502
430
|
return extra(h, {
|
|
503
|
-
value: currentFilter.value,
|
|
504
|
-
filter: currentFilter,
|
|
431
|
+
value: currentFilter[index].value,
|
|
432
|
+
filter: currentFilter[index],
|
|
505
433
|
prop,
|
|
506
434
|
index,
|
|
507
435
|
placeholder: capts.placeholder,
|
|
@@ -516,7 +444,7 @@ export class FilterPanel {
|
|
|
516
444
|
if (extra !== 'input' && extra !== 'datepicker') {
|
|
517
445
|
return '';
|
|
518
446
|
}
|
|
519
|
-
return (h("input", { id: `filter-input-${currentFilter.id}`, placeholder: capts.placeholder, type: extra === 'datepicker' ? 'date' : 'text', value: currentFilter.value, onInput: (e) => {
|
|
447
|
+
return (h("input", { id: `filter-input-${currentFilter[index].id}`, placeholder: capts.placeholder, type: extra === 'datepicker' ? 'date' : 'text', value: currentFilter[index].value, onInput: (e) => {
|
|
520
448
|
if (e.target instanceof HTMLInputElement) {
|
|
521
449
|
applyFilter(e.target.value);
|
|
522
450
|
}
|
|
@@ -532,42 +460,6 @@ export class FilterPanel {
|
|
|
532
460
|
e.stopPropagation();
|
|
533
461
|
} }));
|
|
534
462
|
}
|
|
535
|
-
resolveDraftFilterType(preferred) {
|
|
536
|
-
var _a, _b;
|
|
537
|
-
const available = Object.values((_b = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.filterTypes) !== null && _b !== void 0 ? _b : {}).flat();
|
|
538
|
-
const type = preferred && available.includes(preferred)
|
|
539
|
-
? preferred
|
|
540
|
-
: available[0];
|
|
541
|
-
return type;
|
|
542
|
-
}
|
|
543
|
-
promoteDraft(prop, type) {
|
|
544
|
-
if (!this.draftFilter) {
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
if (!this.filterItems[prop]) {
|
|
548
|
-
this.filterItems[prop] = [];
|
|
549
|
-
}
|
|
550
|
-
if (type) {
|
|
551
|
-
this.draftFilter.type = type;
|
|
552
|
-
}
|
|
553
|
-
const filter = this.draftFilter;
|
|
554
|
-
this.filterItems[prop].push(filter);
|
|
555
|
-
this.draftFilter = undefined;
|
|
556
|
-
this.hasChanges = true;
|
|
557
|
-
return filter;
|
|
558
|
-
}
|
|
559
|
-
isMeaningfulDraftValue(value) {
|
|
560
|
-
return value !== '' && value !== undefined && value !== null;
|
|
561
|
-
}
|
|
562
|
-
emitFilterChange() {
|
|
563
|
-
this.filterChange.emit(this.cloneFilterItems(this.filterItems));
|
|
564
|
-
}
|
|
565
|
-
cloneFilterItems(filterItems) {
|
|
566
|
-
return Object.fromEntries(Object.entries(filterItems).map(([prop, filters]) => [
|
|
567
|
-
prop,
|
|
568
|
-
filters.map(filter => (Object.assign({}, filter))),
|
|
569
|
-
]));
|
|
570
|
-
}
|
|
571
463
|
getAddFilterSelect() {
|
|
572
464
|
return this.element.querySelector(`#${FILTER_ID}`);
|
|
573
465
|
}
|
|
@@ -600,7 +492,7 @@ export class FilterPanel {
|
|
|
600
492
|
top: `${(_d = (_c = this.changes) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0}px`,
|
|
601
493
|
};
|
|
602
494
|
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
603
|
-
return (h(Host, { key: '
|
|
495
|
+
return (h(Host, { key: 'd0e4ebb408750b11b3965da6a25e581733c968e3' }, h("dialog", { key: '3df36777c931ec1063e8574169ca880a99dbfe41', class: "filter-panel-dialog", style: style, ref: el => (this.dialog = el), onCancel: e => {
|
|
604
496
|
e.preventDefault();
|
|
605
497
|
this.onCancel();
|
|
606
498
|
} }, this.changes && [
|
|
@@ -609,7 +501,7 @@ export class FilterPanel {
|
|
|
609
501
|
((_g = this.changes) === null || _g === void 0 ? void 0 : _g.hideDefaultFilters) !== true && [
|
|
610
502
|
h("label", { key: "filter-title" }, capts.title),
|
|
611
503
|
h("div", { key: "filter-holder", class: "filter-holder" }, this.getFilterItemsList()),
|
|
612
|
-
h("div", { key: "add-filter", class: "add-filter" }, h("select", { key: '
|
|
504
|
+
h("div", { key: "add-filter", class: "add-filter" }, h("select", { key: 'e2a8bd29f2090d3e6c933795427b71ca190b82aa', id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))),
|
|
613
505
|
],
|
|
614
506
|
h("slot", { key: "default-slot" }),
|
|
615
507
|
((_j = (_h = this.changes).extraBottomContent) === null || _j === void 0 ? void 0 : _j.call(_h, this.changes)) || '',
|
|
@@ -786,7 +678,6 @@ export class FilterPanel {
|
|
|
786
678
|
"currentFilterType": {},
|
|
787
679
|
"changes": {},
|
|
788
680
|
"filterItems": {},
|
|
789
|
-
"draftFilter": {},
|
|
790
681
|
"draggedFilterId": {},
|
|
791
682
|
"dragOverFilterId": {}
|
|
792
683
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { h } from "@stencil/core";
|
|
6
6
|
import { BasePlugin } from "../base.plugin";
|
|
7
7
|
import { FILTER_PROP, isFilterBtn } from "./filter.button";
|
|
8
|
-
import { filterCoreFunctionsIndexedByType, filterNames,
|
|
8
|
+
import { filterCoreFunctionsIndexedByType, filterNames, filterTypes, } from "./filter.indexed";
|
|
9
9
|
import { resolveBlankSemantics } from "./filter.blank";
|
|
10
10
|
import { timeout } from "../../utils";
|
|
11
11
|
import { ASYNC_FILTER_ROW_THRESHOLD, FILTER_CHUNK_SIZE, FILTER_TIME_BUDGET_MS, } from "./filter.constants";
|
|
@@ -30,8 +30,6 @@ export const FILTE_PANEL = 'revogr-filter-panel';
|
|
|
30
30
|
*
|
|
31
31
|
* @property {FilterLocalization|undefined} localization - translation for filter popup captions.
|
|
32
32
|
*
|
|
33
|
-
* @property {boolean|undefined} defaultFilter - creates a draft condition when an empty filter panel opens. Defaults to true.
|
|
34
|
-
*
|
|
35
33
|
* @property {boolean|undefined} disableDynamicFiltering - disables dynamic filtering. A way to apply filters on Save only.
|
|
36
34
|
*/
|
|
37
35
|
/**
|
|
@@ -53,7 +51,7 @@ export class FilterPlugin extends BasePlugin {
|
|
|
53
51
|
* number: ['eqN', 'neqN', 'gt']
|
|
54
52
|
* }
|
|
55
53
|
*/
|
|
56
|
-
this.filterByType = Object.
|
|
54
|
+
this.filterByType = Object.assign({}, filterTypes);
|
|
57
55
|
this.filterNameIndexByType = Object.assign({}, filterNames);
|
|
58
56
|
this.filterFunctionsIndexedByType = Object.assign({}, filterCoreFunctionsIndexedByType);
|
|
59
57
|
this.filterProp = FILTER_PROP;
|
|
@@ -137,16 +135,11 @@ export class FilterPlugin extends BasePlugin {
|
|
|
137
135
|
return null;
|
|
138
136
|
}
|
|
139
137
|
initConfig(config) {
|
|
140
|
-
var _a
|
|
138
|
+
var _a;
|
|
141
139
|
this.config = config;
|
|
142
140
|
this.allowDuplicateOperators = (_a = config.allowDuplicateOperators) !== null && _a !== void 0 ? _a : true;
|
|
143
141
|
if (this.pop) {
|
|
144
142
|
this.pop.allowDuplicateOperators = this.allowDuplicateOperators;
|
|
145
|
-
this.pop.disableDynamicFiltering =
|
|
146
|
-
(_b = config.disableDynamicFiltering) !== null && _b !== void 0 ? _b : false;
|
|
147
|
-
this.pop.closeOnOutsideClick =
|
|
148
|
-
(_c = config.closeFilterPanelOnOutsideClick) !== null && _c !== void 0 ? _c : true;
|
|
149
|
-
this.pop.filterCaptions = (_d = config.localization) === null || _d === void 0 ? void 0 : _d.captions;
|
|
150
143
|
}
|
|
151
144
|
if (config.multiFilterItems) {
|
|
152
145
|
this.multiFilterItems = Object.assign({}, config.multiFilterItems);
|
|
@@ -235,12 +228,11 @@ export class FilterPlugin extends BasePlugin {
|
|
|
235
228
|
}
|
|
236
229
|
// filter button clicked, open filter dialog
|
|
237
230
|
const buttonPos = (filterButton instanceof HTMLElement ? filterButton : el).getBoundingClientRect();
|
|
238
|
-
const data = Object.assign(Object.assign(Object.assign({}, e.detail), this.filterCollection[prop]), { x: buttonPos.x, y: buttonPos.y + buttonPos.height, anchorY: buttonPos.y, autoCorrect: true, filterTypes: this.getColumnFilter(e.detail.filter),
|
|
231
|
+
const data = Object.assign(Object.assign(Object.assign({}, e.detail), this.filterCollection[prop]), { x: buttonPos.x, y: buttonPos.y + buttonPos.height, anchorY: buttonPos.y, autoCorrect: true, filterTypes: this.getColumnFilter(e.detail.filter), filterItems: this.multiFilterItems, extraContent: this.extraHyperContent, extraBottomContent: this.extraBottomHyperContent });
|
|
239
232
|
(_b = this.beforeshow) === null || _b === void 0 ? void 0 : _b.call(this, data);
|
|
240
233
|
this.pop.show(data);
|
|
241
234
|
}
|
|
242
|
-
getColumnFilter(
|
|
243
|
-
const type = this.isColumnFilterOption(config) ? config.type : config;
|
|
235
|
+
getColumnFilter(type) {
|
|
244
236
|
let filterType = 'string';
|
|
245
237
|
if (!type) {
|
|
246
238
|
return { [filterType]: this.filterByType[filterType] };
|
|
@@ -260,41 +252,6 @@ export class FilterPlugin extends BasePlugin {
|
|
|
260
252
|
}
|
|
261
253
|
return { [filterType]: this.filterByType[filterType] };
|
|
262
254
|
}
|
|
263
|
-
/** Resolve the preferred operator against the column's available filters. */
|
|
264
|
-
getDefaultFilter(config) {
|
|
265
|
-
var _a;
|
|
266
|
-
const filters = this.getColumnFilter(config);
|
|
267
|
-
const availableFilters = Object.values(filters).flat();
|
|
268
|
-
const columnDefault = this.isColumnFilterOption(config)
|
|
269
|
-
? config.default
|
|
270
|
-
: undefined;
|
|
271
|
-
if (typeof columnDefault === 'string' &&
|
|
272
|
-
availableFilters.includes(columnDefault)) {
|
|
273
|
-
return columnDefault;
|
|
274
|
-
}
|
|
275
|
-
const firstFamily = Object.keys(filters)[0];
|
|
276
|
-
const familyDefault = filterTypeDefaults[firstFamily];
|
|
277
|
-
if (familyDefault && ((_a = filters[firstFamily]) === null || _a === void 0 ? void 0 : _a.includes(familyDefault))) {
|
|
278
|
-
return familyDefault;
|
|
279
|
-
}
|
|
280
|
-
return availableFilters[0];
|
|
281
|
-
}
|
|
282
|
-
/** Resolve grid and column-level draft opt-outs. */
|
|
283
|
-
shouldShowDefaultFilter(config) {
|
|
284
|
-
var _a;
|
|
285
|
-
if (this.isColumnFilterOption(config)) {
|
|
286
|
-
if (config.default === false) {
|
|
287
|
-
return false;
|
|
288
|
-
}
|
|
289
|
-
if (typeof config.default === 'string') {
|
|
290
|
-
return true;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return ((_a = this.config) === null || _a === void 0 ? void 0 : _a.defaultFilter) !== false;
|
|
294
|
-
}
|
|
295
|
-
isColumnFilterOption(value) {
|
|
296
|
-
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
297
|
-
}
|
|
298
255
|
isValidType(type) {
|
|
299
256
|
return !!(typeof type === 'string' && this.filterByType[type]);
|
|
300
257
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
|
-
import { d as defineTheme, B as BasePlugin } from './row-resize.plugin-
|
|
5
|
-
export {
|
|
4
|
+
import { d as defineTheme, B as BasePlugin } from './row-resize.plugin-Dzn9bTOr.js';
|
|
5
|
+
export { z as AFTER_ROW_RESIZE_EVENT, A as AutoSizeColumnPlugin, q as BEFORE_COLUMN_DRAG_END_EVENT, x as BEFORE_ROW_RESIZE_EVENT, p as COLUMN_DRAG_END_EVENT, o as COLUMN_DRAG_MOVE_EVENT, s as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, u as ColumnMovePlugin, k as DEFAULT_BLANK_SEMANTICS, J as DEFAULT_MIN_ROW_HEIGHT, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, e as FILTE_PANEL, f as FilterPlugin, G as GroupingRowPlugin, H as ROW_RESIZE_CANCEL_EVENT, y as ROW_RESIZE_EVENT, R as ROW_RESIZE_HANDLE_CLASS, I as RowResizePlugin, S as SelectionStore, P as SortingPlugin, a as StretchColumn, L as clampRowResizeHeight, N as createRowResizePatch, V as defaultCellCompare, W as descCellCompare, m as doCollapse, n as doExpand, g as filterCoreFunctionsIndexedByType, j as filterNames, h as filterTypes, w as getColumnDragPosition, Y as getComparer, v as getLeftRelative, X as getNextOrder, M as getRowResizeIndexes, T as getSortingIndex, Q as hasActiveSorting, l as isBlankValue, i as isStretchPlugin, O as mergeRowResizeDefinitions, r as resolveBlankSemantics, K as resolveRowResizeConfig, U as sortIndexByItems, t as themeTokenCssVariables } from './row-resize.plugin-Dzn9bTOr.js';
|
|
6
6
|
export { B as BEFORE_GROUPING_APPLY_EVENT, o as GROUPING_ROW_TYPE, j as GROUP_COLUMN_PROP, G as GROUP_DEPTH, h as GROUP_EXPANDED, l as GROUP_EXPAND_BTN, m as GROUP_EXPAND_EVENT, k as GROUP_ORIGINAL_INDEX, f as PSEUDO_GROUP_COLUMN, P as PSEUDO_GROUP_ITEM, d as PSEUDO_GROUP_ITEM_ID, e as PSEUDO_GROUP_ITEM_VALUE, c as columnTypes, a as cropCellToMax, I as gatherGroup, s as gatherGrouping, z as getCellData, C as getCellDataParsed, A as getCellRaw, J as getColumnByProp, E as getColumnSizes, D as getColumnType, H as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, F as isColGrouping, u as isGrouping, v as isGroupingColumn, b as isRangeSingleCell, i as isRowType, y as isSameGroup, w as measureEqualDepth, n as nextCell, r as rowTypes } from './column.service-pu_fdQ0S.js';
|
|
7
7
|
export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-YCiVIQ2E.js';
|
|
8
8
|
export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode, r as renderGroupCells } from './cell-renderer-D9ze8OJw.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -8,7 +8,7 @@ import { g as globalScripts } from './app-globals-CA4dvSNd.js';
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await globalScripts();
|
|
11
|
-
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"resizeRow":[4,"resize-row"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"themeDefinitions":[16],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"colSize":[{"colSizeChanged":0}],"theme":[{"themeChanged":0}],"themeDefinitions":[{"themeDefinitionsChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"resizeRow":[{"resizeRowChanged":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"allowDuplicateOperators":[4,"allow-duplicate-operators"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"
|
|
11
|
+
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"resizeRow":[4,"resize-row"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"themeDefinitions":[16],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"colSize":[{"colSizeChanged":0}],"theme":[{"themeChanged":0}],"themeDefinitions":[{"themeDefinitionsChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"resizeRow":[{"resizeRowChanged":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"allowDuplicateOperators":[4,"allow-duplicate-operators"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export { defineCustomElements };
|
|
@@ -6,7 +6,7 @@ import { c as columnTypes, K as reduce, D as getColumnType, r as rowTypes, i as
|
|
|
6
6
|
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, h as gatherTrimmedItems, l as getItemByIndex, R as RESIZE_INTERVAL, a as getVisibleSourceItem } from './dimension.helpers-Cln9sALu.js';
|
|
7
7
|
import { d as debounce } from './debounce-PCRWZliA.js';
|
|
8
8
|
import { g as getScrollDimension, v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
9
|
-
import { D as DimensionStore, t as themeTokenCssVariables, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, f as FilterPlugin, E as ExportFilePlugin,
|
|
9
|
+
import { D as DimensionStore, t as themeTokenCssVariables, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, f as FilterPlugin, E as ExportFilePlugin, P as SortingPlugin, I as RowResizePlugin, u as ColumnMovePlugin } from './row-resize.plugin-Dzn9bTOr.js';
|
|
10
10
|
import { V as ViewportStore } from './viewport.store-DWMKRDSH.js';
|
|
11
11
|
import { t as timeout } from './index-BvMNbQyq.js';
|
|
12
12
|
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
package/dist/esm/revo-grid.js
CHANGED
|
@@ -47,5 +47,5 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
47
47
|
|
|
48
48
|
patchBrowser().then(async (options) => {
|
|
49
49
|
await globalScripts();
|
|
50
|
-
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"resizeRow":[4,"resize-row"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"themeDefinitions":[16],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"colSize":[{"colSizeChanged":0}],"theme":[{"themeChanged":0}],"themeDefinitions":[{"themeDefinitionsChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"resizeRow":[{"resizeRowChanged":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"allowDuplicateOperators":[4,"allow-duplicate-operators"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"
|
|
50
|
+
return bootstrapLazy([["revo-grid",[[260,"revo-grid",{"rowHeaders":[4,"row-headers"],"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"resizeRow":[4,"resize-row"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"canFocus":[4,"can-focus"],"useClipboard":[4,"use-clipboard"],"columns":[16],"source":[16],"pinnedTopSource":[16],"pinnedBottomSource":[16],"rowDefinitions":[16],"editors":[16],"applyOnClose":[4,"apply-on-close"],"plugins":[16],"columnTypes":[16],"theme":[1537],"themeDefinitions":[16],"rowClass":[513,"row-class"],"autoSizeColumn":[4,"auto-size-column"],"filter":[4],"sorting":[16],"focusTemplate":[16],"canMoveColumns":[4,"can-move-columns"],"trimmedRows":[16],"exporting":[4],"grouping":[16],"stretch":[8],"additionalData":[16],"disableVirtualX":[4,"disable-virtual-x"],"virtualX":[16],"disableVirtualY":[4,"disable-virtual-y"],"hideAttribution":[4,"hide-attribution"],"jobsBeforeRender":[16],"registerVNode":[16],"accessible":[4],"rtl":[4],"canDrag":[4,"can-drag"],"refresh":[64],"setDataAt":[64],"scrollToRow":[64],"scrollToColumnIndex":[64],"scrollToColumnProp":[64],"updateColumns":[64],"addTrimmed":[64],"scrollToCoordinate":[64],"setCellEdit":[64],"setCellsFocus":[64],"getSource":[64],"getVisibleSource":[64],"getSourceStore":[64],"getColumnStore":[64],"updateColumnSorting":[64],"clearSorting":[64],"getColumns":[64],"clearFocus":[64],"getPlugins":[64],"getFocused":[64],"getContentSize":[64],"getSelectedRange":[64],"refreshExtraElements":[64],"getProviders":[64]},[[5,"touchstart","mousedownHandle"],[5,"mousedown","mousedownHandle"],[5,"touchend","mouseupHandle"],[5,"mouseup","mouseupHandle"],[0,"rowdragstartinit","onRowDragStarted"],[0,"rowdragendinit","onRowDragEnd"],[0,"roworderchange","onRowOrderChange"],[0,"rowdragmoveinit","onRowDrag"],[0,"rowdragmousemove","onRowMouseMove"],[0,"celleditapply","onCellEdit"],[0,"rangeeditapply","onRangeEdit"],[0,"selectionchangeinit","onRangeChanged"],[0,"rowdropinit","onRowDropped"],[0,"beforeheaderclick","onHeaderClick"],[0,"beforecellfocusinit","onCellFocus"]],{"columnTypes":[{"columnTypesChanged":0}],"columns":[{"columnChanged":0}],"disableVirtualX":[{"disableVirtualXChanged":0}],"virtualX":[{"virtualXChanged":0}],"rowSize":[{"rowSizeChanged":0}],"colSize":[{"colSizeChanged":0}],"theme":[{"themeChanged":0}],"themeDefinitions":[{"themeDefinitionsChanged":0}],"source":[{"dataSourceChanged":0}],"pinnedBottomSource":[{"dataSourceChanged":0}],"pinnedTopSource":[{"dataSourceChanged":0}],"disableVirtualY":[{"disableVirtualYChanged":0}],"rowDefinitions":[{"rowDefChanged":0}],"trimmedRows":[{"trimmedRowsChanged":0}],"grouping":[{"groupingChanged":0}],"stretch":[{"applyStretch":0}],"filter":[{"applyFilter":0}],"sorting":[{"applySorting":0}],"rowHeaders":[{"rowHeadersChange":0}],"resizeRow":[{"resizeRowChanged":0}],"registerVNode":[{"registerOutsideVNodes":0}],"additionalData":[{"additionalDataChanged":0}],"rtl":[{"rtlChanged":0}],"plugins":[{"pluginsChanged":0}]}]]],["revogr-filter-panel",[[260,"revogr-filter-panel",{"filterNames":[16],"filterEntities":[16],"filterCaptions":[16],"disableDynamicFiltering":[4,"disable-dynamic-filtering"],"closeOnOutsideClick":[4,"close-on-outside-click"],"allowDuplicateOperators":[4,"allow-duplicate-operators"],"isFilterIdSet":[32],"filterId":[32],"currentFilterId":[32],"currentFilterType":[32],"changes":[32],"filterItems":[32],"draggedFilterId":[32],"dragOverFilterId":[32],"show":[64],"getChanges":[64]},[[5,"mousedown","onMouseDown"]]]]],["revogr-clipboard_3",[[0,"revogr-clipboard",{"readonly":[4],"doCopy":[64]},[[4,"paste","onPaste"],[4,"copy","copyStarted"],[4,"cut","cutStarted"]]],[0,"revogr-edit",{"editCell":[16],"column":[16],"editor":[16],"saveOnClose":[4,"save-on-close"],"additionalData":[8,"additional-data"],"cancelChanges":[64],"beforeDisconnect":[64]}],[0,"revogr-order-editor",{"parent":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"rowType":[1,"row-type"],"dragStart":[64],"endOrder":[64],"clearOrder":[64]}]]],["revogr-data_4",[[260,"revogr-data",{"readonly":[4],"range":[4],"rowClass":[1,"row-class"],"additionalData":[8,"additional-data"],"rowSelectionStore":[16],"viewportRow":[16],"viewportCol":[16],"dimensionRow":[16],"colData":[16],"dataStore":[16],"type":[513],"colType":[513,"col-type"],"jobsBeforeRender":[16],"providers":[32],"updateCell":[64]},null,{"dataStore":[{"onDataStoreChange":0}],"colData":[{"onColDataChange":0}]}],[0,"revogr-header",{"viewportCol":[16],"dimensionCol":[16],"selectionStore":[16],"groups":[16],"groupingDepth":[2,"grouping-depth"],"readonly":[4],"canResize":[4,"can-resize"],"resizeHandler":[16],"colData":[16],"columnFilter":[4,"column-filter"],"type":[1],"additionalData":[8,"additional-data"]}],[260,"revogr-viewport-scroll",{"rowHeader":[4,"row-header"],"contentWidth":[2,"content-width"],"contentHeight":[2,"content-height"],"colType":[1,"col-type"],"noHorizontalScrollTransfer":[4,"no-horizontal-scroll-transfer"],"setScroll":[64],"changeScroll":[64],"applyScroll":[64]},[[0,"mousewheel-vertical","mousewheelVertical"],[0,"mousewheel-horizontal","mousewheelHorizontal"],[0,"scroll-coordinate","scrollApply"]]],[0,"vnode-html",{"redraw":[16]}]]],["revogr-attribution_7",[[0,"revogr-row-headers",{"height":[2],"dataPorts":[16],"headerProp":[16],"rowClass":[1,"row-class"],"resize":[4],"rowHeaderColumn":[16],"additionalData":[8,"additional-data"],"jobsBeforeRender":[16]}],[260,"revogr-overlay-selection",{"readonly":[4],"range":[4],"canDrag":[4,"can-drag"],"useClipboard":[4,"use-clipboard"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"lastCell":[16],"editors":[16],"applyChangesOnClose":[4,"apply-changes-on-close"],"additionalData":[8,"additional-data"],"isMobileDevice":[4,"is-mobile-device"]},[[5,"touchmove","onMouseMove"],[5,"mousemove","onMouseMove"],[5,"touchend","onMouseUp"],[5,"mouseup","onMouseUp"],[5,"mouseleave","onMouseUp"],[0,"dragstartcell","onCellDrag"],[4,"keyup","onKeyUp"],[4,"keydown","onKeyDown"]],{"selectionStore":[{"selectionServiceSet":0}],"dimensionRow":[{"createAutoFillService":0}],"dimensionCol":[{"createAutoFillService":0}],"dataStore":[{"columnServiceSet":0}],"colData":[{"columnServiceSet":0}]}],[0,"revogr-attribution"],[260,"revogr-focus",{"colType":[1,"col-type"],"rowType":[1,"row-type"],"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16],"dataStore":[16],"colData":[16],"focusTemplate":[16]}],[0,"revogr-scroll-virtual",{"dimension":[1],"realSize":[2,"real-size"],"virtualSize":[2,"virtual-size"],"clientSize":[2,"client-size"],"setScroll":[64],"changeScroll":[64]}],[0,"revogr-temp-range",{"selectionStore":[16],"dimensionRow":[16],"dimensionCol":[16]}],[0,"revogr-extra",{"nodes":[16],"update":[32],"refresh":[64]}]]]], options);
|
|
51
51
|
});
|