@revolist/revogrid 4.23.13 → 4.23.15

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 (36) hide show
  1. package/dist/cjs/{column.drag.plugin-D_Dfhp4f.js → column.drag.plugin-ByDJ7Rk3.js} +5 -5
  2. package/dist/cjs/{filter.button-B9EzJrr1.js → filter.button-C4xpvyyE.js} +10 -16
  3. package/dist/cjs/index.cjs.js +2 -2
  4. package/dist/cjs/revo-grid.cjs.entry.js +2 -2
  5. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +1 -1
  6. package/dist/cjs/revogr-data_4.cjs.entry.js +1 -1
  7. package/dist/cjs/revogr-filter-panel.cjs.entry.js +119 -41
  8. package/dist/collection/components/clipboard/revogr-clipboard.js +1 -1
  9. package/dist/collection/plugins/filter/filter.button.js +10 -16
  10. package/dist/collection/plugins/filter/filter.panel.js +117 -39
  11. package/dist/collection/plugins/filter/filter.plugin.js +4 -4
  12. package/dist/collection/plugins/filter/filter.style.css +65 -13
  13. package/dist/{revo-grid/column.drag.plugin-UNSHSmgo.js → esm/column.drag.plugin-BZacA8n_.js} +5 -5
  14. package/dist/{revo-grid/filter.button-BFwo1uvz.js → esm/filter.button-B-RBiF67.js} +10 -16
  15. package/dist/esm/index.js +3 -3
  16. package/dist/esm/revo-grid.entry.js +2 -2
  17. package/dist/esm/revogr-clipboard_3.entry.js +1 -1
  18. package/dist/esm/revogr-data_4.entry.js +1 -1
  19. package/dist/esm/revogr-filter-panel.entry.js +119 -41
  20. package/dist/{esm/column.drag.plugin-UNSHSmgo.js → revo-grid/column.drag.plugin-BZacA8n_.js} +5 -5
  21. package/dist/{esm/filter.button-BFwo1uvz.js → revo-grid/filter.button-B-RBiF67.js} +10 -16
  22. package/dist/revo-grid/index.esm.js +3 -3
  23. package/dist/revo-grid/revo-grid.entry.js +2 -2
  24. package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
  25. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  26. package/dist/revo-grid/revogr-filter-panel.entry.js +119 -41
  27. package/dist/types/plugins/filter/filter.button.d.ts +13 -3
  28. package/dist/types/plugins/filter/filter.panel.d.ts +4 -0
  29. package/dist/types/plugins/filter/filter.types.d.ts +7 -0
  30. package/hydrate/index.js +133 -61
  31. package/hydrate/index.mjs +133 -61
  32. package/package.json +1 -1
  33. package/standalone/filter.button.js +1 -1
  34. package/standalone/revo-grid.js +1 -1
  35. package/standalone/revogr-clipboard2.js +1 -1
  36. package/standalone/revogr-filter-panel.js +1 -1
@@ -11,6 +11,7 @@ const defaultType = 'none';
11
11
  const FILTER_LIST_CLASS = 'multi-filter-list';
12
12
  const FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';
13
13
  const FILTER_ID = 'add-filter';
14
+ const VIEWPORT_PADDING = 8;
14
15
  /**
15
16
  * Filter panel for editing filters
16
17
  */
@@ -30,6 +31,9 @@ export class FilterPanel {
30
31
  placeholder: 'Enter value...',
31
32
  and: 'and',
32
33
  or: 'or',
34
+ filterCondition: 'Filter condition',
35
+ removeFilter: 'Remove filter',
36
+ reorderFilter: 'Reorder filter',
33
37
  };
34
38
  this.isFilterIdSet = false;
35
39
  this.filterId = 0;
@@ -104,36 +108,75 @@ export class FilterPanel {
104
108
  return '';
105
109
  const propFilters = (_b = this.filterItems[prop]) !== null && _b !== void 0 ? _b : [];
106
110
  const visibleFilterCount = propFilters.filter(filter => !filter.hidden).length;
107
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
108
- return (h("div", { key: this.filterId }, propFilters.map((filter, index) => {
111
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
112
+ return (h("div", { key: this.filterId }, h("ul", { class: "multi-filter-list-container" }, propFilters.map((filter, index) => {
109
113
  let andOrButton;
110
114
  if (filter.hidden) {
111
115
  return;
112
116
  }
113
117
  // hide toggle button if there is only one filter and the last one
114
118
  if (index !== this.filterItems[prop].length - 1) {
115
- andOrButton = (h("div", { onClick: () => this.toggleFilterAndOr(filter.id) }, h(AndOrButton, { text: filter.relation === 'and' ? capts.and : capts.or })));
119
+ andOrButton = (h(AndOrButton, { text: filter.relation === 'and' ? capts.and : capts.or, onClick: () => this.toggleFilterAndOr(filter.id) }));
116
120
  }
117
121
  const extra = this.renderExtra(prop, index);
118
- return (h("div", { key: filter.id, class: FILTER_LIST_CLASS }, h("div", { ref: el => el === null || el === void 0 ? void 0 : el.classList.add('multi-filter-list-row') }, visibleFilterCount > 1 ? (h(ReorderButton, { dragging: this.draggedFilterId === filter.id, dragOver: this.dragOverFilterId === filter.id && this.draggedFilterId !== filter.id, onDragStart: e => this.onFilterDragStart(e, filter.id), onDragEnd: () => this.onFilterDragEnd(), onDragOver: e => this.onFilterDragOver(e, filter.id), onDragLeave: () => this.onFilterDragLeave(filter.id), onDrop: e => this.onFilterDrop(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("div", { onClick: () => this.onRemoveFilter(filter.id) }, h(TrashButton, null))))));
119
- }), propFilters.filter(f => !f.hidden).length > 0 ? h("div", { class: "add-filter-divider" }) : ''));
122
+ const isDragging = this.draggedFilterId === filter.id;
123
+ const isDragOver = this.dragOverFilterId === filter.id && !isDragging;
124
+ const canReorder = visibleFilterCount > 1;
125
+ return (h("li", { key: filter.id, class: FILTER_LIST_CLASS, "aria-label": `${capts.filterCondition} ${index + 1}` }, h("div", { class: {
126
+ 'multi-filter-list-row': true,
127
+ 'filter-row-drop-active': this.draggedFilterId !== undefined && !isDragging,
128
+ 'filter-row-dragging': isDragging,
129
+ 'filter-row-drag-over': isDragOver,
130
+ } }, 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) })))));
131
+ })), propFilters.filter(f => !f.hidden).length > 0 ? h("div", { class: "add-filter-divider" }) : ''));
120
132
  }
121
- autoCorrect(el) {
122
- var _a, _b;
123
- if (!el) {
133
+ componentDidRender() {
134
+ this.syncDialog();
135
+ }
136
+ syncDialog() {
137
+ if (!this.dialog) {
124
138
  return;
125
139
  }
126
- const revoGrid = el.closest('revo-grid');
127
- if (!revoGrid) {
140
+ if (!this.changes) {
141
+ if (this.dialog.open) {
142
+ this.dialog.close();
143
+ }
128
144
  return;
129
145
  }
130
- const pos = el.getBoundingClientRect();
131
- const gridPos = revoGrid.getBoundingClientRect();
132
- const maxLeft = gridPos.right - pos.width;
133
- if (pos.left > maxLeft && el.offsetLeft) {
134
- el.style.left = `${maxLeft - ((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left) !== null && _b !== void 0 ? _b : 0)}px`;
146
+ if (!this.dialog.open) {
147
+ this.dialog.show();
148
+ }
149
+ if (this.changes.autoCorrect !== false) {
150
+ this.autoCorrect(this.dialog);
151
+ requestAnimationFrame(() => this.autoCorrect(this.dialog));
135
152
  }
136
153
  }
154
+ autoCorrect(el) {
155
+ var _a;
156
+ if (!el || !this.changes) {
157
+ return;
158
+ }
159
+ el.style.maxHeight = '';
160
+ el.style.left = `${this.changes.x}px`;
161
+ el.style.top = `${this.changes.y}px`;
162
+ const pos = el.getBoundingClientRect();
163
+ const anchorTop = (_a = this.changes.anchorY) !== null && _a !== void 0 ? _a : this.changes.y;
164
+ const anchorBottom = this.changes.y;
165
+ const spaceAbove = Math.max(0, anchorTop - VIEWPORT_PADDING);
166
+ const spaceBelow = Math.max(0, window.innerHeight - anchorBottom - VIEWPORT_PADDING);
167
+ const openAbove = pos.height > spaceBelow && spaceAbove > spaceBelow;
168
+ const availableHeight = Math.max(VIEWPORT_PADDING, openAbove ? spaceAbove : spaceBelow);
169
+ el.style.maxHeight = `${availableHeight}px`;
170
+ const adjustedPos = el.getBoundingClientRect();
171
+ const maxLeft = Math.max(VIEWPORT_PADDING, window.innerWidth - adjustedPos.width - VIEWPORT_PADDING);
172
+ const maxTop = Math.max(VIEWPORT_PADDING, window.innerHeight - adjustedPos.height - VIEWPORT_PADDING);
173
+ const left = Math.min(Math.max(VIEWPORT_PADDING, this.changes.x), maxLeft);
174
+ const top = openAbove
175
+ ? Math.min(Math.max(VIEWPORT_PADDING, anchorTop - adjustedPos.height), maxTop)
176
+ : Math.min(Math.max(VIEWPORT_PADDING, anchorBottom), maxTop);
177
+ el.style.left = `${left}px`;
178
+ el.style.top = `${top}px`;
179
+ }
137
180
  onFilterTypeChange(e, prop, index) {
138
181
  if (!(e.target instanceof HTMLSelectElement)) {
139
182
  return;
@@ -267,6 +310,37 @@ export class FilterPanel {
267
310
  this.draggedFilterId = undefined;
268
311
  this.dragOverFilterId = undefined;
269
312
  }
313
+ onFilterReorderKeyDown(e, prop, sourceId) {
314
+ let direction = 0;
315
+ if (e.key === 'ArrowUp') {
316
+ direction = -1;
317
+ }
318
+ else if (e.key === 'ArrowDown') {
319
+ direction = 1;
320
+ }
321
+ else {
322
+ return;
323
+ }
324
+ const items = this.filterItems[prop];
325
+ if (!items) {
326
+ return;
327
+ }
328
+ const visibleItems = items.filter(item => !item.hidden);
329
+ const sourceIndex = visibleItems.findIndex(item => item.id === sourceId);
330
+ if (sourceIndex === -1) {
331
+ return;
332
+ }
333
+ e.preventDefault();
334
+ e.stopPropagation();
335
+ const target = visibleItems[sourceIndex + direction];
336
+ if (!target || !moveFilterItem(items, sourceId, target.id)) {
337
+ return;
338
+ }
339
+ this.filterId++;
340
+ if (!this.disableDynamicFiltering) {
341
+ this.debouncedApplyFilter();
342
+ }
343
+ }
270
344
  toggleFilterAndOr(id) {
271
345
  var _a;
272
346
  this.assertChanges();
@@ -305,7 +379,7 @@ export class FilterPanel {
305
379
  });
306
380
  });
307
381
  if (!isDefaultTypeRemoved) {
308
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
382
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
309
383
  options.push(h("option", { selected: this.currentFilterType === defaultType, value: defaultType }, prop && this.filterItems[prop] && this.filterItems[prop].length > 0
310
384
  ? capts.add
311
385
  : this.filterNames[defaultType]));
@@ -338,7 +412,7 @@ export class FilterPanel {
338
412
  select.focus();
339
413
  }
340
414
  };
341
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
415
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
342
416
  const extra = this.filterEntities[currentFilter[index].type].extra;
343
417
  if (typeof extra === 'function') {
344
418
  return extra(h, {
@@ -375,30 +449,34 @@ export class FilterPanel {
375
449
  } }));
376
450
  }
377
451
  render() {
378
- var _a, _b, _c, _d, _e;
379
- if (!this.changes) {
380
- return h(Host, { style: { display: 'none' } });
381
- }
452
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
382
453
  const style = {
383
- display: 'block',
384
- left: `${this.changes.x}px`,
385
- top: `${this.changes.y}px`,
454
+ left: `${(_b = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0}px`,
455
+ top: `${(_d = (_c = this.changes) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0}px`,
386
456
  };
387
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
388
- return (h(Host, { style: style, ref: el => {
389
- var _a;
390
- ((_a = this.changes) === null || _a === void 0 ? void 0 : _a.autoCorrect) !== false && this.autoCorrect(el);
391
- } }, h("slot", { slot: "header" }), ((_b = (_a = this.changes).extraContent) === null || _b === void 0 ? void 0 : _b.call(_a, this.changes)) || '', ((_c = this.changes) === null || _c === void 0 ? void 0 : _c.hideDefaultFilters) !== true && ([
392
- h("label", null, capts.title),
393
- h("div", { class: "filter-holder" }, this.getFilterItemsList()),
394
- h("div", { class: "add-filter" }, h("select", { id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType)))
395
- ]), h("slot", null), ((_e = (_d = this.changes).extraBottomContent) === null || _e === void 0 ? void 0 : _e.call(_d, this.changes)) || '', h("div", { class: "filter-actions" }, this.disableDynamicFiltering && [
396
- h("button", { id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
397
- h("button", { id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
398
- ], !this.disableDynamicFiltering && [
399
- h("button", { id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
400
- h("button", { id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
401
- ]), h("slot", { slot: "footer" })));
457
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
458
+ return (h(Host, { key: '4e969f8b7033363c885c94b1f7770917786669f2' }, h("dialog", { key: '79b2713724684fa99f56621fe43645a0b0ad54bf', class: "filter-panel-dialog", style: style, ref: el => (this.dialog = el), onCancel: e => {
459
+ e.preventDefault();
460
+ this.onCancel();
461
+ } }, this.changes && [
462
+ h("slot", { key: "header-slot", slot: "header" }),
463
+ ((_f = (_e = this.changes).extraContent) === null || _f === void 0 ? void 0 : _f.call(_e, this.changes)) || '',
464
+ ((_g = this.changes) === null || _g === void 0 ? void 0 : _g.hideDefaultFilters) !== true && [
465
+ h("label", { key: "filter-title" }, capts.title),
466
+ h("div", { key: "filter-holder", class: "filter-holder" }, this.getFilterItemsList()),
467
+ h("div", { key: "add-filter", class: "add-filter" }, h("select", { key: 'fc894bdfae1ff35d5c49adc7646dd3182b7bd49e', id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))),
468
+ ],
469
+ h("slot", { key: "default-slot" }),
470
+ ((_j = (_h = this.changes).extraBottomContent) === null || _j === void 0 ? void 0 : _j.call(_h, this.changes)) || '',
471
+ h("div", { key: "filter-actions", class: "filter-actions" }, this.disableDynamicFiltering && [
472
+ h("button", { key: "save", id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
473
+ h("button", { key: "cancel", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
474
+ ], !this.disableDynamicFiltering && [
475
+ h("button", { key: "ok", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
476
+ h("button", { key: "reset", id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
477
+ ]),
478
+ h("slot", { key: "footer-slot", slot: "footer" }),
479
+ ])));
402
480
  }
403
481
  static get is() { return "revogr-filter-panel"; }
404
482
  static get originalStyleUrls() {
@@ -178,7 +178,8 @@ export class FilterPlugin extends BasePlugin {
178
178
  async headerclick(e) {
179
179
  var _a, _b;
180
180
  const el = (_a = e.detail.originalEvent) === null || _a === void 0 ? void 0 : _a.target;
181
- if (!isFilterBtn(el)) {
181
+ const filterButton = isFilterBtn(el);
182
+ if (!filterButton) {
182
183
  return;
183
184
  }
184
185
  e.preventDefault();
@@ -192,9 +193,8 @@ export class FilterPlugin extends BasePlugin {
192
193
  return;
193
194
  }
194
195
  // filter button clicked, open filter dialog
195
- const gridPos = this.revogrid.getBoundingClientRect();
196
- const buttonPos = el.getBoundingClientRect();
197
- const data = Object.assign(Object.assign(Object.assign({}, e.detail), this.filterCollection[prop]), { x: buttonPos.x - gridPos.x, y: buttonPos.y - gridPos.y + buttonPos.height, autoCorrect: true, filterTypes: this.getColumnFilter(e.detail.filter), filterItems: this.multiFilterItems, extraContent: this.extraHyperContent, extraBottomContent: this.extraBottomHyperContent });
196
+ const buttonPos = (filterButton instanceof HTMLElement ? filterButton : el).getBoundingClientRect();
197
+ 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 });
198
198
  (_b = this.beforeshow) === null || _b === void 0 ? void 0 : _b.call(this, data);
199
199
  this.pop.show(data);
200
200
  }
@@ -36,12 +36,15 @@ revo-grid[theme^=dark] .revo-button.outline {
36
36
  }
37
37
 
38
38
  revogr-filter-panel {
39
- position: absolute;
40
39
  display: block;
40
+ }
41
+
42
+ revogr-filter-panel .filter-panel-dialog {
43
+ position: fixed;
41
44
  top: 0;
42
45
  left: 0;
43
46
  z-index: 100;
44
- max-height: calc(100% - 80px);
47
+ max-height: calc(100vh - 16px);
45
48
  overflow: auto;
46
49
  opacity: 1;
47
50
  transform: none;
@@ -49,25 +52,27 @@ revogr-filter-panel {
49
52
  border: 1px solid var(--revo-grid-filter-panel-border, #cecece);
50
53
  transform-origin: 62px 0px;
51
54
  box-shadow: 0 5px 18px -2px var(--revo-grid-filter-panel-shadow, rgba(0, 0, 0, 0.15));
55
+ box-sizing: border-box;
52
56
  padding: 10px;
53
57
  border-radius: 8px;
58
+ margin: 0;
54
59
  min-width: 220px;
55
60
  text-align: left;
56
61
  animation: revogr-filter-panel-open 140ms cubic-bezier(0.2, 0, 0, 1);
57
62
  }
58
- revogr-filter-panel .filter-holder > div {
63
+ revogr-filter-panel .filter-panel-dialog .filter-holder > div {
59
64
  display: flex;
60
65
  flex-direction: column;
61
66
  }
62
- revogr-filter-panel label {
67
+ revogr-filter-panel .filter-panel-dialog label {
63
68
  font-size: 13px;
64
69
  display: block;
65
70
  padding: 8px 0;
66
71
  }
67
- revogr-filter-panel select {
72
+ revogr-filter-panel .filter-panel-dialog select {
68
73
  width: 100%;
69
74
  }
70
- revogr-filter-panel input[type=text] {
75
+ revogr-filter-panel .filter-panel-dialog input[type=text] {
71
76
  border: 0;
72
77
  min-height: 34px;
73
78
  margin: 5px 0;
@@ -77,11 +82,19 @@ revogr-filter-panel input[type=text] {
77
82
  box-sizing: border-box;
78
83
  width: 100%;
79
84
  }
80
- revogr-filter-panel .filter-actions {
85
+ revogr-filter-panel .filter-panel-dialog .filter-actions {
86
+ position: sticky;
87
+ right: 0;
88
+ bottom: -10px;
89
+ left: 0;
90
+ z-index: 1;
81
91
  text-align: right;
82
- margin-right: -5px;
92
+ margin: 10px -10px -10px;
93
+ padding: 0 5px 10px 10px;
94
+ background: var(--revo-grid-filter-panel-bg, #fff);
95
+ border-top: 1px solid var(--revo-grid-filter-panel-divider, #d9d9d9);
83
96
  }
84
- revogr-filter-panel .filter-actions button {
97
+ revogr-filter-panel .filter-panel-dialog .filter-actions button {
85
98
  margin-top: 10px;
86
99
  margin-right: 5px;
87
100
  }
@@ -97,7 +110,7 @@ revogr-filter-panel .filter-actions button {
97
110
  }
98
111
  }
99
112
  @media (prefers-reduced-motion: reduce) {
100
- revogr-filter-panel {
113
+ revogr-filter-panel .filter-panel-dialog {
101
114
  animation: none;
102
115
  }
103
116
  }
@@ -186,9 +199,38 @@ revogr-filter-panel .filter-actions button {
186
199
  display: flex;
187
200
  align-items: center;
188
201
  gap: 6px;
202
+ position: relative;
203
+ }
204
+ .multi-filter-list .multi-filter-list-row.filter-row-dragging {
205
+ opacity: 0.65;
206
+ }
207
+ .multi-filter-list .multi-filter-list-row.filter-row-drag-over::before {
208
+ content: "";
209
+ position: absolute;
210
+ top: -4px;
211
+ right: 0;
212
+ left: 0;
213
+ z-index: 2;
214
+ height: 2px;
215
+ background: var(--revo-grid-filter-panel-reorder-accent, #007cb2);
216
+ border-radius: 999px;
217
+ box-shadow: 0 0 0 2px var(--revo-grid-filter-panel-bg, #fff);
218
+ }
219
+ .multi-filter-list .multi-filter-list-row.filter-row-drop-active .filter-row-drop-target {
220
+ pointer-events: auto;
221
+ }
222
+ .multi-filter-list .filter-row-drop-target {
223
+ position: absolute;
224
+ inset: 0;
225
+ z-index: 1;
226
+ padding: 0;
227
+ pointer-events: none;
228
+ background: transparent;
229
+ border: 0;
189
230
  }
190
231
  .multi-filter-list .multi-filter-list-action {
191
232
  display: flex;
233
+ align-self: stretch;
192
234
  flex: 0 0 auto;
193
235
  justify-content: flex-end;
194
236
  align-items: center;
@@ -200,6 +242,10 @@ revogr-filter-panel .filter-actions button {
200
242
  }
201
243
  .multi-filter-list .trash-button {
202
244
  margin: 0 0 -2px 6px;
245
+ padding: 0;
246
+ border: 0;
247
+ background: transparent;
248
+ color: inherit;
203
249
  cursor: pointer;
204
250
  width: 22px;
205
251
  height: 100%;
@@ -221,9 +267,6 @@ revogr-filter-panel .filter-actions button {
221
267
  transform: scaleX(0.8);
222
268
  width: 16px;
223
269
  }
224
- .multi-filter-list .reorder-button.filter-row-dragging {
225
- opacity: 0.55;
226
- }
227
270
  .multi-filter-list .reorder-button.filter-row-drag-over {
228
271
  color: var(--revo-grid-filter-panel-reorder-accent, #007cb2);
229
272
  }
@@ -231,6 +274,12 @@ revogr-filter-panel .filter-actions button {
231
274
  cursor: grabbing;
232
275
  }
233
276
 
277
+ .multi-filter-list-container {
278
+ padding: 0;
279
+ margin: 0;
280
+ list-style: none;
281
+ }
282
+
234
283
  .add-filter-divider {
235
284
  display: block;
236
285
  margin: 0 -10px 10px -10px;
@@ -250,6 +299,9 @@ revogr-filter-panel .filter-actions button {
250
299
  flex: 1 1 0;
251
300
  min-width: 0;
252
301
  }
302
+ .select-input .select-filter {
303
+ width: auto;
304
+ }
253
305
  .select-input .filter-extra {
254
306
  display: flex;
255
307
  }
@@ -6,7 +6,7 @@ import { K as createStore, l as setStore, i as calculateDimensionData, L as iden
6
6
  import { j as calculateRowHeaderSize } from './viewport.store-_c579YyM.js';
7
7
  import { g as getScrollbarSize, t as timeout } from './index-Db3qZoW5.js';
8
8
  import { h } from './index-Chp_81rd.js';
9
- import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-BFwo1uvz.js';
9
+ import { b as FILTER_PROP, i as isFilterBtn } from './filter.button-B-RBiF67.js';
10
10
  import { d as debounce } from './debounce-PCRWZliA.js';
11
11
  import { O as ON_COLUMN_CLICK, d as dispatch } from './header-cell-renderer-BMmXRsd_.js';
12
12
 
@@ -1400,7 +1400,8 @@ class FilterPlugin extends BasePlugin {
1400
1400
  async headerclick(e) {
1401
1401
  var _a, _b;
1402
1402
  const el = (_a = e.detail.originalEvent) === null || _a === void 0 ? void 0 : _a.target;
1403
- if (!isFilterBtn(el)) {
1403
+ const filterButton = isFilterBtn(el);
1404
+ if (!filterButton) {
1404
1405
  return;
1405
1406
  }
1406
1407
  e.preventDefault();
@@ -1414,9 +1415,8 @@ class FilterPlugin extends BasePlugin {
1414
1415
  return;
1415
1416
  }
1416
1417
  // filter button clicked, open filter dialog
1417
- const gridPos = this.revogrid.getBoundingClientRect();
1418
- const buttonPos = el.getBoundingClientRect();
1419
- const data = Object.assign(Object.assign(Object.assign({}, e.detail), this.filterCollection[prop]), { x: buttonPos.x - gridPos.x, y: buttonPos.y - gridPos.y + buttonPos.height, autoCorrect: true, filterTypes: this.getColumnFilter(e.detail.filter), filterItems: this.multiFilterItems, extraContent: this.extraHyperContent, extraBottomContent: this.extraBottomHyperContent });
1418
+ const buttonPos = (filterButton instanceof HTMLElement ? filterButton : el).getBoundingClientRect();
1419
+ 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 });
1420
1420
  (_b = this.beforeshow) === null || _b === void 0 ? void 0 : _b.call(this, data);
1421
1421
  this.pop.show(data);
1422
1422
  }
@@ -15,24 +15,18 @@ const FilterButton = ({ column }) => {
15
15
  [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
16
16
  } }, h("svg", { class: "filter-img", viewBox: "0 0 64 64" }, h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, h("path", { d: "M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z", fill: "currentColor" }))))));
17
17
  };
18
- const TrashButton = () => {
19
- return (h("div", { class: { [TRASH_BUTTON]: true } }, h("svg", { class: "trash-img", viewBox: "0 0 24 24" }, h("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
18
+ const TrashButton = ({ ariaLabel, onClick }) => {
19
+ return (h("button", { type: "button", class: { [TRASH_BUTTON]: true }, "aria-label": ariaLabel, onClick: onClick }, h("svg", { class: "trash-img", viewBox: "0 0 24 24" }, h("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
20
20
  };
21
- const AndOrButton = ({ text }) => {
22
- return h("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
21
+ const AndOrButton = ({ text, onClick }) => {
22
+ return h("button", { type: "button", class: { [AND_OR_BUTTON]: true, 'light revo-button': true }, onClick: onClick }, text);
23
23
  };
24
- const ReorderButton = ({ dragging, dragOver, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, }) => {
25
- const applyClass = (el) => {
26
- if (!el) {
27
- return;
28
- }
29
- el.className = [
30
- REORDER_BUTTON,
31
- dragging ? 'filter-row-dragging' : '',
32
- dragOver ? 'filter-row-drag-over' : '',
33
- ].filter(Boolean).join(' ');
34
- };
35
- return (h("button", { type: "button", ref: applyClass, draggable: true, title: "Reorder filter", "aria-label": "reorder filter", onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop }, "::"));
24
+ const ReorderButton = ({ ariaLabel, dragging, dragOver, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, onKeyDown, }) => {
25
+ return (h("button", { type: "button", class: {
26
+ [REORDER_BUTTON]: true,
27
+ 'filter-row-dragging': !!dragging,
28
+ 'filter-row-drag-over': !!dragOver,
29
+ }, draggable: true, title: ariaLabel, "aria-label": ariaLabel, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, onKeyDown: onKeyDown }, "::"));
36
30
  };
37
31
  function isFilterBtn(e) {
38
32
  if (e.classList.contains(FILTER_BUTTON_CLASS)) {
package/dist/esm/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
4
  export { 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, H as gatherGroup, s as gatherGrouping, z as getCellData, B as getCellDataParsed, A as getCellRaw, I as getColumnByProp, D as getColumnSizes, C as getColumnType, F as getColumns, q as getExpanded, t as getGroupingName, x as getParsedGroup, g as getRange, p as getSource, E 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-C6hByxPy.js';
5
- import { B as BasePlugin } from './column.drag.plugin-UNSHSmgo.js';
6
- export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-UNSHSmgo.js';
5
+ import { B as BasePlugin } from './column.drag.plugin-BZacA8n_.js';
6
+ export { A as AutoSizeColumnPlugin, n as BEFORE_COLUMN_DRAG_END_EVENT, m as COLUMN_DRAG_END_EVENT, l as COLUMN_DRAG_MOVE_EVENT, o as COLUMN_DRAG_START_EVENT, C as ColumnAutoSizeMode, p as ColumnMovePlugin, D as DimensionStore, b as ExportCsv, E as ExportFilePlugin, c as FILTER_CONFIG_CHANGED_EVENT, F as FILTER_TRIMMED_TYPE, d as FILTE_PANEL, e as FilterPlugin, G as GroupingRowPlugin, S as SelectionStore, s as SortingPlugin, a as StretchColumn, w as defaultCellCompare, x as descCellCompare, j as doCollapse, k as doExpand, f as filterCoreFunctionsIndexedByType, h as filterNames, g as filterTypes, r as getColumnDragPosition, z as getComparer, q as getLeftRelative, y as getNextOrder, u as getSortingIndex, t as hasActiveSorting, i as isStretchPlugin, v as sortIndexByItems } from './column.drag.plugin-BZacA8n_.js';
7
7
  export { d as dispatch, a as dispatchByEvent } from './header-cell-renderer-BMmXRsd_.js';
8
8
  export { C as CellRenderer, G as GroupingRowRenderer, S as SortingSign, e as expandEvent, a as expandSvgIconVNode } from './cell-renderer-CLTRlCa5.js';
9
9
  export { a as applyMixins, f as findPositionInArray, g as getScrollbarSize, m as mergeSortedArray, p as pushSorted, r as range, s as scaleValue, t as timeout } from './index-Db3qZoW5.js';
@@ -12,7 +12,7 @@ export { k as isAll, c as isClear, h as isCopy, a as isCtrlKey, b as isCtrlMetaK
12
12
  export { h } from './index-Chp_81rd.js';
13
13
  export { C as CELL_CLASS, z as CELL_HANDLER_CLASS, m as DATA_COL, n as DATA_ROW, o as DISABLED_CLASS, x as DRAGGABLE_CLASS, A as DRAGG_TEXT, w as DRAG_ICON_CLASS, D as DataStore, E as EDIT_INPUT_WR, F as FOCUS_CLASS, G as GRID_INTERNALS, v as HEADER_ACTUAL_ROW_CLASS, H as HEADER_CLASS, u as HEADER_ROW_CLASS, r as HEADER_SORTABLE_CLASS, M as MIN_COL_SIZE, y as MOBILE_CLASS, R as RESIZE_INTERVAL, B as ROW_FOCUSED_CLASS, q as ROW_HEADER_TYPE, S as SELECTION_BORDER_CLASS, T as TMP_SELECTION_BG_CLASS, i as calculateDimensionData, I as codesLetter, h as gatherTrimmedItems, k as getItemByIndex, j as getItemByPosition, g as getPhysical, b as getSourceItem, f as getSourceItemVirtualIndexByProp, c as getSourcePhysicalIndex, a as getVisibleSourceItem, J as keyValues, p as proxyPlugin, e as setItems, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, l as setStore, t as trimmedPlugin } from './dimension.helpers-CGKwSvw6.js';
14
14
  export { V as ViewportStore, b as addMissingItems, j as calculateRowHeaderSize, c as clampViewportCoordinate, f as getFirstItem, d as getItems, h as getLastItem, a as getUpdatedItemsByPosition, g as getViewportMaxCoordinate, i as isActiveRange, e as isActiveRangeOutsideLastItem, r as recombineByOffset, s as setItemSizes, u as updateMissingAndRange } from './viewport.store-_c579YyM.js';
15
- export { A as AND_OR_BUTTON, e as AndOrButton, a as FILTER_BUTTON_ACTIVE, F as FILTER_BUTTON_CLASS, b as FILTER_PROP, c as FilterButton, R as REORDER_BUTTON, f as ReorderButton, T as TRASH_BUTTON, d as TrashButton, i as isFilterBtn } from './filter.button-BFwo1uvz.js';
15
+ export { A as AND_OR_BUTTON, e as AndOrButton, a as FILTER_BUTTON_ACTIVE, F as FILTER_BUTTON_CLASS, b as FILTER_PROP, c as FilterButton, R as REORDER_BUTTON, f as ReorderButton, T as TRASH_BUTTON, d as TrashButton, i as isFilterBtn } from './filter.button-B-RBiF67.js';
16
16
  import './debounce-PCRWZliA.js';
17
17
 
18
18
  const REVOGRID_EVENTS = new Map([
@@ -6,12 +6,12 @@ import { c as columnTypes, J as reduce, C 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, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL } from './dimension.helpers-CGKwSvw6.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, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-UNSHSmgo.js';
9
+ import { D as DimensionStore, S as SelectionStore, B as BasePlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, A as AutoSizeColumnPlugin, e as FilterPlugin, E as ExportFilePlugin, s as SortingPlugin, p as ColumnMovePlugin } from './column.drag.plugin-BZacA8n_.js';
10
10
  import { V as ViewportStore } from './viewport.store-_c579YyM.js';
11
11
  import { T as ThemeService } from './theme.service-BmnDvr6P.js';
12
12
  import { t as timeout } from './index-Db3qZoW5.js';
13
13
  import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
14
- import './filter.button-BFwo1uvz.js';
14
+ import './filter.button-B-RBiF67.js';
15
15
  import './header-cell-renderer-BMmXRsd_.js';
16
16
 
17
17
  class ColumnDataProvider {
@@ -143,7 +143,7 @@ const Clipboard = class {
143
143
  }
144
144
  getData(e) {
145
145
  return (e.clipboardData ||
146
- (window === null || window === void 0 ? void 0 : window.clipboardData));
146
+ (globalThis === null || globalThis === void 0 ? void 0 : globalThis.clipboardData));
147
147
  }
148
148
  };
149
149
 
@@ -5,7 +5,7 @@ import { r as registerInstance, d as createEvent, h, e as Host, g as getElement
5
5
  import { M as ColumnService, u as isGrouping } from './column.service-C6hByxPy.js';
6
6
  import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CGKwSvw6.js';
7
7
  import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-CLTRlCa5.js';
8
- import { c as FilterButton } from './filter.button-BFwo1uvz.js';
8
+ import { c as FilterButton } from './filter.button-B-RBiF67.js';
9
9
  import { H as HeaderCellRenderer } from './header-cell-renderer-BMmXRsd_.js';
10
10
  import { t as throttle, L as LocalScrollTimer, a as LocalScrollService, g as getContentSize } from './throttle-CaUDyxyU.js';
11
11
  import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-CoCAvmZs.js';