@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
package/hydrate/index.js CHANGED
@@ -6858,7 +6858,7 @@ class Clipboard {
6858
6858
  }
6859
6859
  getData(e) {
6860
6860
  return (e.clipboardData ||
6861
- (window === null || window === void 0 ? void 0 : window.clipboardData));
6861
+ (globalThis === null || globalThis === void 0 ? void 0 : globalThis.clipboardData));
6862
6862
  }
6863
6863
  static get cmpMeta() { return {
6864
6864
  "$flags$": 0,
@@ -7366,24 +7366,18 @@ const FilterButton = ({ column }) => {
7366
7366
  [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
7367
7367
  } }, hAsync("svg", { class: "filter-img", viewBox: "0 0 64 64" }, hAsync("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, hAsync("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" }))))));
7368
7368
  };
7369
- const TrashButton = () => {
7370
- return (hAsync("div", { class: { [TRASH_BUTTON]: true } }, hAsync("svg", { class: "trash-img", viewBox: "0 0 24 24" }, hAsync("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
7369
+ const TrashButton = ({ ariaLabel, onClick }) => {
7370
+ return (hAsync("button", { type: "button", class: { [TRASH_BUTTON]: true }, "aria-label": ariaLabel, onClick: onClick }, hAsync("svg", { class: "trash-img", viewBox: "0 0 24 24" }, hAsync("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
7371
7371
  };
7372
- const AndOrButton = ({ text }) => {
7373
- return hAsync("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
7372
+ const AndOrButton = ({ text, onClick }) => {
7373
+ return hAsync("button", { type: "button", class: { [AND_OR_BUTTON]: true, 'light revo-button': true }, onClick: onClick }, text);
7374
7374
  };
7375
- const ReorderButton = ({ dragging, dragOver, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, }) => {
7376
- const applyClass = (el) => {
7377
- if (!el) {
7378
- return;
7379
- }
7380
- el.className = [
7381
- REORDER_BUTTON,
7382
- dragging ? 'filter-row-dragging' : '',
7383
- dragOver ? 'filter-row-drag-over' : '',
7384
- ].filter(Boolean).join(' ');
7385
- };
7386
- return (hAsync("button", { type: "button", ref: applyClass, draggable: true, title: "Reorder filter", "aria-label": "reorder filter", onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop }, "::"));
7375
+ const ReorderButton = ({ ariaLabel, dragging, dragOver, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, onKeyDown, }) => {
7376
+ return (hAsync("button", { type: "button", class: {
7377
+ [REORDER_BUTTON]: true,
7378
+ 'filter-row-dragging': !!dragging,
7379
+ 'filter-row-drag-over': !!dragOver,
7380
+ }, draggable: true, title: ariaLabel, "aria-label": ariaLabel, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, onKeyDown: onKeyDown }, "::"));
7387
7381
  };
7388
7382
  function isFilterBtn(e) {
7389
7383
  if (e.classList.contains(FILTER_BUTTON_CLASS)) {
@@ -7453,12 +7447,13 @@ function moveFilterItem(items, sourceId, targetId) {
7453
7447
  return true;
7454
7448
  }
7455
7449
 
7456
- const filterStyleCss = () => `.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#4545ff;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037}.revo-button.red{background-color:#E0662E}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid #dbdbdb;line-height:30px;background:none;color:#000;box-shadow:none}revo-grid[theme^=dark] .revo-button.outline{border:1px solid #404040;color:#d8d8d8}revogr-filter-panel{position:absolute;display:block;top:0;left:0;z-index:100;max-height:calc(100% - 80px);overflow:auto;opacity:1;transform:none;background-color:var(--revo-grid-filter-panel-bg, #fff);border:1px solid var(--revo-grid-filter-panel-border, #cecece);transform-origin:62px 0px;box-shadow:0 5px 18px -2px var(--revo-grid-filter-panel-shadow, rgba(0, 0, 0, 0.15));padding:10px;border-radius:8px;min-width:220px;text-align:left;animation:revogr-filter-panel-open 140ms cubic-bezier(0.2, 0, 0, 1)}revogr-filter-panel .filter-holder>div{display:flex;flex-direction:column}revogr-filter-panel label{font-size:13px;display:block;padding:8px 0}revogr-filter-panel select{width:100%}revogr-filter-panel input[type=text]{border:0;min-height:34px;margin:5px 0;background:var(--revo-grid-filter-panel-input-bg, #f3f3f3);border-radius:5px;padding:0 10px;box-sizing:border-box;width:100%}revogr-filter-panel .filter-actions{text-align:right;margin-right:-5px}revogr-filter-panel .filter-actions button{margin-top:10px;margin-right:5px}@keyframes revogr-filter-panel-open{from{opacity:0;transform:translateY(-4px) scale(0.98)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){revogr-filter-panel{animation:none}}.rgHeaderCell:hover .rv-filter{transition:opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}.rgHeaderCell:hover .rv-filter,.rgHeaderCell .rv-filter.active{opacity:1}.rgHeaderCell .rv-filter{height:24px;width:24px;background:none;border:0;opacity:0;visibility:visible;cursor:pointer;border-radius:4px}.rgHeaderCell .rv-filter.active{color:#10224a}.rgHeaderCell .rv-filter .filter-img{color:gray;width:11px}.select-css{display:block;font-family:sans-serif;line-height:1.3;padding:0.6em 1.4em 0.5em 0.8em;width:100%;max-width:100%;box-sizing:border-box;margin:0;border:1px solid var(--revo-grid-filter-panel-select-border, #d9d9d9);box-shadow:transparent;border-radius:0.5em;appearance:none;background-color:var(--revo-grid-filter-panel-input-bg, #f3f3f3);background-image:url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat, repeat;background-position:right 0.7em top 50%, 0 0;background-size:0.65em auto, 100%;}.select-css::-ms-expand{display:none}.select-css:hover{border-color:var(--revo-grid-filter-panel-select-border, #d9d9d9)}.select-css:focus{border-color:var(--revo-grid-filter-panel-select-border-hover, #d9d9d9);box-shadow:0 0 1px 3px rgba(59, 153, 252, 0.7);box-shadow:0 0 0 3px -moz-mac-focusring;outline:none}.select-css option{font-weight:normal}.select-css:disabled,.select-css[aria-disabled=true]{color:gray;background-image:url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%)}.select-css:disabled:hover,.select-css[aria-disabled=true]{border-color:var(--revo-grid-filter-panel-select-border, #d9d9d9)}.multi-filter-list{margin-top:5px;margin-bottom:5px}.multi-filter-list div{white-space:nowrap}.multi-filter-list .multi-filter-list-row{display:flex;align-items:center;gap:6px}.multi-filter-list .multi-filter-list-action{display:flex;flex:0 0 auto;justify-content:flex-end;align-items:center}.multi-filter-list .and-or-button{margin:0 0 0 10px;min-width:58px;cursor:pointer}.multi-filter-list .trash-button{margin:0 0 -2px 6px;cursor:pointer;width:22px;height:100%;font-size:16px}.multi-filter-list .trash-button .trash-img{width:1em}.multi-filter-list .reorder-button{border:0;background:transparent;color:var(--revo-grid-filter-panel-reorder-color, #6b7280);cursor:grab;font-family:monospace;font-size:12px;letter-spacing:0;line-height:1;padding:6px 2px;transform:scaleX(0.8);width:16px}.multi-filter-list .reorder-button.filter-row-dragging{opacity:0.55}.multi-filter-list .reorder-button.filter-row-drag-over{color:var(--revo-grid-filter-panel-reorder-accent, #007cb2)}.multi-filter-list .reorder-button:active{cursor:grabbing}.add-filter-divider{display:block;margin:0 -10px 10px -10px;border-bottom:1px solid var(--revo-grid-filter-panel-divider, #d9d9d9);height:10px}.select-input{display:flex;align-items:center;flex:1 1 auto;gap:6px;min-width:0}.select-input .select-filter,.select-input .filter-extra{flex:1 1 0;min-width:0}.select-input .filter-extra{display:flex}.select-input .filter-extra>*{width:100%}.select-input input[type=text],.select-input input[type=date]{margin:0}`;
7450
+ const filterStyleCss = () => `.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#4545ff;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037}.revo-button.red{background-color:#E0662E}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid #dbdbdb;line-height:30px;background:none;color:#000;box-shadow:none}revo-grid[theme^=dark] .revo-button.outline{border:1px solid #404040;color:#d8d8d8}revogr-filter-panel{display:block}revogr-filter-panel .filter-panel-dialog{position:fixed;top:0;left:0;z-index:100;max-height:calc(100vh - 16px);overflow:auto;opacity:1;transform:none;background-color:var(--revo-grid-filter-panel-bg, #fff);border:1px solid var(--revo-grid-filter-panel-border, #cecece);transform-origin:62px 0px;box-shadow:0 5px 18px -2px var(--revo-grid-filter-panel-shadow, rgba(0, 0, 0, 0.15));box-sizing:border-box;padding:10px;border-radius:8px;margin:0;min-width:220px;text-align:left;animation:revogr-filter-panel-open 140ms cubic-bezier(0.2, 0, 0, 1)}revogr-filter-panel .filter-panel-dialog .filter-holder>div{display:flex;flex-direction:column}revogr-filter-panel .filter-panel-dialog label{font-size:13px;display:block;padding:8px 0}revogr-filter-panel .filter-panel-dialog select{width:100%}revogr-filter-panel .filter-panel-dialog input[type=text]{border:0;min-height:34px;margin:5px 0;background:var(--revo-grid-filter-panel-input-bg, #f3f3f3);border-radius:5px;padding:0 10px;box-sizing:border-box;width:100%}revogr-filter-panel .filter-panel-dialog .filter-actions{position:sticky;right:0;bottom:-10px;left:0;z-index:1;text-align:right;margin:10px -10px -10px;padding:0 5px 10px 10px;background:var(--revo-grid-filter-panel-bg, #fff);border-top:1px solid var(--revo-grid-filter-panel-divider, #d9d9d9)}revogr-filter-panel .filter-panel-dialog .filter-actions button{margin-top:10px;margin-right:5px}@keyframes revogr-filter-panel-open{from{opacity:0;transform:translateY(-4px) scale(0.98)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){revogr-filter-panel .filter-panel-dialog{animation:none}}.rgHeaderCell:hover .rv-filter{transition:opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}.rgHeaderCell:hover .rv-filter,.rgHeaderCell .rv-filter.active{opacity:1}.rgHeaderCell .rv-filter{height:24px;width:24px;background:none;border:0;opacity:0;visibility:visible;cursor:pointer;border-radius:4px}.rgHeaderCell .rv-filter.active{color:#10224a}.rgHeaderCell .rv-filter .filter-img{color:gray;width:11px}.select-css{display:block;font-family:sans-serif;line-height:1.3;padding:0.6em 1.4em 0.5em 0.8em;width:100%;max-width:100%;box-sizing:border-box;margin:0;border:1px solid var(--revo-grid-filter-panel-select-border, #d9d9d9);box-shadow:transparent;border-radius:0.5em;appearance:none;background-color:var(--revo-grid-filter-panel-input-bg, #f3f3f3);background-image:url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat, repeat;background-position:right 0.7em top 50%, 0 0;background-size:0.65em auto, 100%;}.select-css::-ms-expand{display:none}.select-css:hover{border-color:var(--revo-grid-filter-panel-select-border, #d9d9d9)}.select-css:focus{border-color:var(--revo-grid-filter-panel-select-border-hover, #d9d9d9);box-shadow:0 0 1px 3px rgba(59, 153, 252, 0.7);box-shadow:0 0 0 3px -moz-mac-focusring;outline:none}.select-css option{font-weight:normal}.select-css:disabled,.select-css[aria-disabled=true]{color:gray;background-image:url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%)}.select-css:disabled:hover,.select-css[aria-disabled=true]{border-color:var(--revo-grid-filter-panel-select-border, #d9d9d9)}.multi-filter-list{margin-top:5px;margin-bottom:5px}.multi-filter-list div{white-space:nowrap}.multi-filter-list .multi-filter-list-row{display:flex;align-items:center;gap:6px;position:relative}.multi-filter-list .multi-filter-list-row.filter-row-dragging{opacity:0.65}.multi-filter-list .multi-filter-list-row.filter-row-drag-over::before{content:"";position:absolute;top:-4px;right:0;left:0;z-index:2;height:2px;background:var(--revo-grid-filter-panel-reorder-accent, #007cb2);border-radius:999px;box-shadow:0 0 0 2px var(--revo-grid-filter-panel-bg, #fff)}.multi-filter-list .multi-filter-list-row.filter-row-drop-active .filter-row-drop-target{pointer-events:auto}.multi-filter-list .filter-row-drop-target{position:absolute;inset:0;z-index:1;padding:0;pointer-events:none;background:transparent;border:0}.multi-filter-list .multi-filter-list-action{display:flex;align-self:stretch;flex:0 0 auto;justify-content:flex-end;align-items:center}.multi-filter-list .and-or-button{margin:0 0 0 10px;min-width:58px;cursor:pointer}.multi-filter-list .trash-button{margin:0 0 -2px 6px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;width:22px;height:100%;font-size:16px}.multi-filter-list .trash-button .trash-img{width:1em}.multi-filter-list .reorder-button{border:0;background:transparent;color:var(--revo-grid-filter-panel-reorder-color, #6b7280);cursor:grab;font-family:monospace;font-size:12px;letter-spacing:0;line-height:1;padding:6px 2px;transform:scaleX(0.8);width:16px}.multi-filter-list .reorder-button.filter-row-drag-over{color:var(--revo-grid-filter-panel-reorder-accent, #007cb2)}.multi-filter-list .reorder-button:active{cursor:grabbing}.multi-filter-list-container{padding:0;margin:0;list-style:none}.add-filter-divider{display:block;margin:0 -10px 10px -10px;border-bottom:1px solid var(--revo-grid-filter-panel-divider, #d9d9d9);height:10px}.select-input{display:flex;align-items:center;flex:1 1 auto;gap:6px;min-width:0}.select-input .select-filter,.select-input .filter-extra{flex:1 1 0;min-width:0}.select-input .select-filter{width:auto}.select-input .filter-extra{display:flex}.select-input .filter-extra>*{width:100%}.select-input input[type=text],.select-input input[type=date]{margin:0}`;
7457
7451
 
7458
7452
  const defaultType = 'none';
7459
7453
  const FILTER_LIST_CLASS = 'multi-filter-list';
7460
7454
  const FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';
7461
7455
  const FILTER_ID = 'add-filter';
7456
+ const VIEWPORT_PADDING = 8;
7462
7457
  /**
7463
7458
  * Filter panel for editing filters
7464
7459
  */
@@ -7481,6 +7476,9 @@ class FilterPanel {
7481
7476
  placeholder: 'Enter value...',
7482
7477
  and: 'and',
7483
7478
  or: 'or',
7479
+ filterCondition: 'Filter condition',
7480
+ removeFilter: 'Remove filter',
7481
+ reorderFilter: 'Reorder filter',
7484
7482
  };
7485
7483
  this.isFilterIdSet = false;
7486
7484
  this.filterId = 0;
@@ -7555,36 +7553,75 @@ class FilterPanel {
7555
7553
  return '';
7556
7554
  const propFilters = (_b = this.filterItems[prop]) !== null && _b !== void 0 ? _b : [];
7557
7555
  const visibleFilterCount = propFilters.filter(filter => !filter.hidden).length;
7558
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
7559
- return (hAsync("div", { key: this.filterId }, propFilters.map((filter, index) => {
7556
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
7557
+ return (hAsync("div", { key: this.filterId }, hAsync("ul", { class: "multi-filter-list-container" }, propFilters.map((filter, index) => {
7560
7558
  let andOrButton;
7561
7559
  if (filter.hidden) {
7562
7560
  return;
7563
7561
  }
7564
7562
  // hide toggle button if there is only one filter and the last one
7565
7563
  if (index !== this.filterItems[prop].length - 1) {
7566
- andOrButton = (hAsync("div", { onClick: () => this.toggleFilterAndOr(filter.id) }, hAsync(AndOrButton, { text: filter.relation === 'and' ? capts.and : capts.or })));
7564
+ andOrButton = (hAsync(AndOrButton, { text: filter.relation === 'and' ? capts.and : capts.or, onClick: () => this.toggleFilterAndOr(filter.id) }));
7567
7565
  }
7568
7566
  const extra = this.renderExtra(prop, index);
7569
- return (hAsync("div", { key: filter.id, class: FILTER_LIST_CLASS }, hAsync("div", { ref: el => el === null || el === void 0 ? void 0 : el.classList.add('multi-filter-list-row') }, visibleFilterCount > 1 ? (hAsync(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) })) : '', hAsync("div", { class: { 'select-input': true } }, hAsync("select", { class: "select-css select-filter", onChange: e => this.onFilterTypeChange(e, prop, index) }, this.renderSelectOptions(this.filterItems[prop][index].type, true)), extra ? hAsync("div", { class: "filter-extra" }, extra) : ''), hAsync("div", { class: FILTER_LIST_CLASS_ACTION }, andOrButton, hAsync("div", { onClick: () => this.onRemoveFilter(filter.id) }, hAsync(TrashButton, null))))));
7570
- }), propFilters.filter(f => !f.hidden).length > 0 ? hAsync("div", { class: "add-filter-divider" }) : ''));
7567
+ const isDragging = this.draggedFilterId === filter.id;
7568
+ const isDragOver = this.dragOverFilterId === filter.id && !isDragging;
7569
+ const canReorder = visibleFilterCount > 1;
7570
+ return (hAsync("li", { key: filter.id, class: FILTER_LIST_CLASS, "aria-label": `${capts.filterCondition} ${index + 1}` }, hAsync("div", { class: {
7571
+ 'multi-filter-list-row': true,
7572
+ 'filter-row-drop-active': this.draggedFilterId !== undefined && !isDragging,
7573
+ 'filter-row-dragging': isDragging,
7574
+ 'filter-row-drag-over': isDragOver,
7575
+ } }, canReorder ? (hAsync("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 ? (hAsync(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) })) : '', hAsync("div", { class: { 'select-input': true } }, hAsync("select", { class: "select-css select-filter", onChange: e => this.onFilterTypeChange(e, prop, index) }, this.renderSelectOptions(this.filterItems[prop][index].type, true)), extra ? hAsync("div", { class: "filter-extra" }, extra) : ''), hAsync("div", { class: FILTER_LIST_CLASS_ACTION }, andOrButton, hAsync(TrashButton, { ariaLabel: capts.removeFilter, onClick: () => this.onRemoveFilter(filter.id) })))));
7576
+ })), propFilters.filter(f => !f.hidden).length > 0 ? hAsync("div", { class: "add-filter-divider" }) : ''));
7571
7577
  }
7572
- autoCorrect(el) {
7573
- var _a, _b;
7574
- if (!el) {
7578
+ componentDidRender() {
7579
+ this.syncDialog();
7580
+ }
7581
+ syncDialog() {
7582
+ if (!this.dialog) {
7575
7583
  return;
7576
7584
  }
7577
- const revoGrid = el.closest('revo-grid');
7578
- if (!revoGrid) {
7585
+ if (!this.changes) {
7586
+ if (this.dialog.open) {
7587
+ this.dialog.close();
7588
+ }
7579
7589
  return;
7580
7590
  }
7581
- const pos = el.getBoundingClientRect();
7582
- const gridPos = revoGrid.getBoundingClientRect();
7583
- const maxLeft = gridPos.right - pos.width;
7584
- if (pos.left > maxLeft && el.offsetLeft) {
7585
- el.style.left = `${maxLeft - ((_b = (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left) !== null && _b !== void 0 ? _b : 0)}px`;
7591
+ if (!this.dialog.open) {
7592
+ this.dialog.show();
7593
+ }
7594
+ if (this.changes.autoCorrect !== false) {
7595
+ this.autoCorrect(this.dialog);
7596
+ requestAnimationFrame(() => this.autoCorrect(this.dialog));
7586
7597
  }
7587
7598
  }
7599
+ autoCorrect(el) {
7600
+ var _a;
7601
+ if (!el || !this.changes) {
7602
+ return;
7603
+ }
7604
+ el.style.maxHeight = '';
7605
+ el.style.left = `${this.changes.x}px`;
7606
+ el.style.top = `${this.changes.y}px`;
7607
+ const pos = el.getBoundingClientRect();
7608
+ const anchorTop = (_a = this.changes.anchorY) !== null && _a !== void 0 ? _a : this.changes.y;
7609
+ const anchorBottom = this.changes.y;
7610
+ const spaceAbove = Math.max(0, anchorTop - VIEWPORT_PADDING);
7611
+ const spaceBelow = Math.max(0, window.innerHeight - anchorBottom - VIEWPORT_PADDING);
7612
+ const openAbove = pos.height > spaceBelow && spaceAbove > spaceBelow;
7613
+ const availableHeight = Math.max(VIEWPORT_PADDING, openAbove ? spaceAbove : spaceBelow);
7614
+ el.style.maxHeight = `${availableHeight}px`;
7615
+ const adjustedPos = el.getBoundingClientRect();
7616
+ const maxLeft = Math.max(VIEWPORT_PADDING, window.innerWidth - adjustedPos.width - VIEWPORT_PADDING);
7617
+ const maxTop = Math.max(VIEWPORT_PADDING, window.innerHeight - adjustedPos.height - VIEWPORT_PADDING);
7618
+ const left = Math.min(Math.max(VIEWPORT_PADDING, this.changes.x), maxLeft);
7619
+ const top = openAbove
7620
+ ? Math.min(Math.max(VIEWPORT_PADDING, anchorTop - adjustedPos.height), maxTop)
7621
+ : Math.min(Math.max(VIEWPORT_PADDING, anchorBottom), maxTop);
7622
+ el.style.left = `${left}px`;
7623
+ el.style.top = `${top}px`;
7624
+ }
7588
7625
  onFilterTypeChange(e, prop, index) {
7589
7626
  if (!(e.target instanceof HTMLSelectElement)) {
7590
7627
  return;
@@ -7718,6 +7755,37 @@ class FilterPanel {
7718
7755
  this.draggedFilterId = undefined;
7719
7756
  this.dragOverFilterId = undefined;
7720
7757
  }
7758
+ onFilterReorderKeyDown(e, prop, sourceId) {
7759
+ let direction = 0;
7760
+ if (e.key === 'ArrowUp') {
7761
+ direction = -1;
7762
+ }
7763
+ else if (e.key === 'ArrowDown') {
7764
+ direction = 1;
7765
+ }
7766
+ else {
7767
+ return;
7768
+ }
7769
+ const items = this.filterItems[prop];
7770
+ if (!items) {
7771
+ return;
7772
+ }
7773
+ const visibleItems = items.filter(item => !item.hidden);
7774
+ const sourceIndex = visibleItems.findIndex(item => item.id === sourceId);
7775
+ if (sourceIndex === -1) {
7776
+ return;
7777
+ }
7778
+ e.preventDefault();
7779
+ e.stopPropagation();
7780
+ const target = visibleItems[sourceIndex + direction];
7781
+ if (!target || !moveFilterItem(items, sourceId, target.id)) {
7782
+ return;
7783
+ }
7784
+ this.filterId++;
7785
+ if (!this.disableDynamicFiltering) {
7786
+ this.debouncedApplyFilter();
7787
+ }
7788
+ }
7721
7789
  toggleFilterAndOr(id) {
7722
7790
  var _a;
7723
7791
  this.assertChanges();
@@ -7756,7 +7824,7 @@ class FilterPanel {
7756
7824
  });
7757
7825
  });
7758
7826
  if (!isDefaultTypeRemoved) {
7759
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
7827
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
7760
7828
  options.push(hAsync("option", { selected: this.currentFilterType === defaultType, value: defaultType }, prop && this.filterItems[prop] && this.filterItems[prop].length > 0
7761
7829
  ? capts.add
7762
7830
  : this.filterNames[defaultType]));
@@ -7789,7 +7857,7 @@ class FilterPanel {
7789
7857
  select.focus();
7790
7858
  }
7791
7859
  };
7792
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
7860
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
7793
7861
  const extra = this.filterEntities[currentFilter[index].type].extra;
7794
7862
  if (typeof extra === 'function') {
7795
7863
  return extra(hAsync, {
@@ -7826,30 +7894,34 @@ class FilterPanel {
7826
7894
  } }));
7827
7895
  }
7828
7896
  render() {
7829
- var _a, _b, _c, _d, _e;
7830
- if (!this.changes) {
7831
- return hAsync(Host, { style: { display: 'none' } });
7832
- }
7897
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
7833
7898
  const style = {
7834
- display: 'block',
7835
- left: `${this.changes.x}px`,
7836
- top: `${this.changes.y}px`,
7899
+ left: `${(_b = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0}px`,
7900
+ top: `${(_d = (_c = this.changes) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0}px`,
7837
7901
  };
7838
- const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
7839
- return (hAsync(Host, { style: style, ref: el => {
7840
- var _a;
7841
- ((_a = this.changes) === null || _a === void 0 ? void 0 : _a.autoCorrect) !== false && this.autoCorrect(el);
7842
- } }, hAsync("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 && ([
7843
- hAsync("label", null, capts.title),
7844
- hAsync("div", { class: "filter-holder" }, this.getFilterItemsList()),
7845
- hAsync("div", { class: "add-filter" }, hAsync("select", { id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType)))
7846
- ]), hAsync("slot", null), ((_e = (_d = this.changes).extraBottomContent) === null || _e === void 0 ? void 0 : _e.call(_d, this.changes)) || '', hAsync("div", { class: "filter-actions" }, this.disableDynamicFiltering && [
7847
- hAsync("button", { id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
7848
- hAsync("button", { id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
7849
- ], !this.disableDynamicFiltering && [
7850
- hAsync("button", { id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
7851
- hAsync("button", { id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
7852
- ]), hAsync("slot", { slot: "footer" })));
7902
+ const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
7903
+ return (hAsync(Host, { key: '4e969f8b7033363c885c94b1f7770917786669f2' }, hAsync("dialog", { key: '79b2713724684fa99f56621fe43645a0b0ad54bf', class: "filter-panel-dialog", style: style, ref: el => (this.dialog = el), onCancel: e => {
7904
+ e.preventDefault();
7905
+ this.onCancel();
7906
+ } }, this.changes && [
7907
+ hAsync("slot", { key: "header-slot", slot: "header" }),
7908
+ ((_f = (_e = this.changes).extraContent) === null || _f === void 0 ? void 0 : _f.call(_e, this.changes)) || '',
7909
+ ((_g = this.changes) === null || _g === void 0 ? void 0 : _g.hideDefaultFilters) !== true && [
7910
+ hAsync("label", { key: "filter-title" }, capts.title),
7911
+ hAsync("div", { key: "filter-holder", class: "filter-holder" }, this.getFilterItemsList()),
7912
+ hAsync("div", { key: "add-filter", class: "add-filter" }, hAsync("select", { key: 'fc894bdfae1ff35d5c49adc7646dd3182b7bd49e', id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))),
7913
+ ],
7914
+ hAsync("slot", { key: "default-slot" }),
7915
+ ((_j = (_h = this.changes).extraBottomContent) === null || _j === void 0 ? void 0 : _j.call(_h, this.changes)) || '',
7916
+ hAsync("div", { key: "filter-actions", class: "filter-actions" }, this.disableDynamicFiltering && [
7917
+ hAsync("button", { key: "save", id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
7918
+ hAsync("button", { key: "cancel", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
7919
+ ], !this.disableDynamicFiltering && [
7920
+ hAsync("button", { key: "ok", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
7921
+ hAsync("button", { key: "reset", id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
7922
+ ]),
7923
+ hAsync("slot", { key: "footer-slot", slot: "footer" }),
7924
+ ])));
7853
7925
  }
7854
7926
  get element() { return getElement(this); }
7855
7927
  static get style() { return filterStyleCss(); }
@@ -15884,7 +15956,8 @@ class FilterPlugin extends BasePlugin {
15884
15956
  async headerclick(e) {
15885
15957
  var _a, _b;
15886
15958
  const el = (_a = e.detail.originalEvent) === null || _a === void 0 ? void 0 : _a.target;
15887
- if (!isFilterBtn(el)) {
15959
+ const filterButton = isFilterBtn(el);
15960
+ if (!filterButton) {
15888
15961
  return;
15889
15962
  }
15890
15963
  e.preventDefault();
@@ -15898,9 +15971,8 @@ class FilterPlugin extends BasePlugin {
15898
15971
  return;
15899
15972
  }
15900
15973
  // filter button clicked, open filter dialog
15901
- const gridPos = this.revogrid.getBoundingClientRect();
15902
- const buttonPos = el.getBoundingClientRect();
15903
- 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 });
15974
+ const buttonPos = (filterButton instanceof HTMLElement ? filterButton : el).getBoundingClientRect();
15975
+ 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 });
15904
15976
  (_b = this.beforeshow) === null || _b === void 0 ? void 0 : _b.call(this, data);
15905
15977
  this.pop.show(data);
15906
15978
  }