@revolist/revogrid 4.23.14 → 4.23.16
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/{cell-renderer-Dcz022q7.js → cell-renderer-DfUCisis.js} +23 -5
- package/dist/cjs/{column.drag.plugin-BGLbi1zS.js → column.drag.plugin-ByDJ7Rk3.js} +35 -6
- package/dist/cjs/{column.service-C1Qvcf5l.js → column.service-BNWNiJW3.js} +62 -23
- package/dist/cjs/{filter.button-w6LWnyhi.js → filter.button-C4xpvyyE.js} +14 -4
- package/dist/cjs/{header-cell-renderer-vVr4IWNV.js → header-cell-renderer-DyjOxArm.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +6 -6
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +40 -4
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +14 -6
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +177 -48
- package/dist/collection/components/clipboard/revogr-clipboard.js +1 -1
- package/dist/collection/components/data/column.service.js +62 -23
- package/dist/collection/components/data/row-renderer.js +15 -2
- package/dist/collection/components/overlay/clipboard.utils.js +26 -0
- package/dist/collection/components/overlay/revogr-overlay-selection.js +27 -7
- package/dist/collection/components/revoGrid/revo-grid.js +14 -7
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +10 -2
- package/dist/collection/plugins/filter/filter.button.js +12 -4
- package/dist/collection/plugins/filter/filter.panel.js +138 -48
- package/dist/collection/plugins/filter/filter.plugin.js +1 -1
- package/dist/collection/plugins/filter/filter.reorder.js +44 -0
- package/dist/collection/plugins/filter/filter.style.css +96 -6
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +7 -2
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js +30 -2
- package/dist/collection/serve/controller.js +1 -0
- package/dist/esm/{cell-renderer-BtN-NGCk.js → cell-renderer-CLTRlCa5.js} +23 -5
- package/dist/esm/{column.drag.plugin-4Ixr4ijU.js → column.drag.plugin-BZacA8n_.js} +35 -7
- package/dist/esm/{column.service-CC_SD8W3.js → column.service-C6hByxPy.js} +62 -23
- package/dist/esm/filter.button-B-RBiF67.js +38 -0
- package/dist/esm/{header-cell-renderer-B-LX2sgu.js → header-cell-renderer-BMmXRsd_.js} +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +6 -6
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_7.entry.js +40 -4
- package/dist/esm/revogr-clipboard_3.entry.js +1 -1
- package/dist/esm/revogr-data_4.entry.js +14 -6
- package/dist/esm/revogr-filter-panel.entry.js +177 -48
- package/dist/revo-grid/{cell-renderer-BtN-NGCk.js → cell-renderer-CLTRlCa5.js} +23 -5
- package/dist/revo-grid/{column.drag.plugin-4Ixr4ijU.js → column.drag.plugin-BZacA8n_.js} +35 -7
- package/dist/revo-grid/{column.service-CC_SD8W3.js → column.service-C6hByxPy.js} +62 -23
- package/dist/revo-grid/filter.button-B-RBiF67.js +38 -0
- package/dist/revo-grid/{header-cell-renderer-B-LX2sgu.js → header-cell-renderer-BMmXRsd_.js} +1 -1
- package/dist/revo-grid/index.esm.js +6 -6
- package/dist/revo-grid/revo-grid.entry.js +6 -6
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revogr-attribution_7.entry.js +40 -4
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +14 -6
- package/dist/revo-grid/revogr-filter-panel.entry.js +177 -48
- package/dist/types/components/data/column.service.d.ts +10 -1
- package/dist/types/components/data/row-renderer.d.ts +1 -1
- package/dist/types/components/overlay/clipboard.utils.d.ts +3 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +4 -3
- package/dist/types/components/revoGrid/revo-grid.d.ts +4 -4
- package/dist/types/components.d.ts +14 -14
- package/dist/types/plugins/filter/filter.button.d.ts +23 -2
- package/dist/types/plugins/filter/filter.panel.d.ts +8 -1
- package/dist/types/plugins/filter/filter.plugin.d.ts +1 -0
- package/dist/types/plugins/filter/filter.reorder.d.ts +4 -0
- package/dist/types/plugins/filter/filter.types.d.ts +8 -0
- package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +4 -0
- package/dist/types/types/interfaces.d.ts +8 -0
- package/hydrate/index.js +358 -90
- package/hydrate/index.mjs +358 -90
- package/package.json +1 -1
- package/readme.md +20 -1
- package/standalone/column.service.js +1 -1
- package/standalone/filter.button.js +1 -1
- package/standalone/index.js +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-clipboard2.js +1 -1
- package/standalone/revogr-data2.js +1 -1
- package/standalone/revogr-filter-panel.js +1 -1
- package/standalone/revogr-overlay-selection2.js +1 -1
- package/standalone/revogr-viewport-scroll2.js +1 -1
- package/dist/esm/filter.button-C8XTWPU2.js +0 -30
- package/dist/revo-grid/filter.button-C8XTWPU2.js +0 -30
package/hydrate/index.mjs
CHANGED
|
@@ -6856,7 +6856,7 @@ class Clipboard {
|
|
|
6856
6856
|
}
|
|
6857
6857
|
getData(e) {
|
|
6858
6858
|
return (e.clipboardData ||
|
|
6859
|
-
(
|
|
6859
|
+
(globalThis === null || globalThis === void 0 ? void 0 : globalThis.clipboardData));
|
|
6860
6860
|
}
|
|
6861
6861
|
static get cmpMeta() { return {
|
|
6862
6862
|
"$flags$": 0,
|
|
@@ -7357,17 +7357,25 @@ const FILTER_BUTTON_ACTIVE = 'active';
|
|
|
7357
7357
|
const FILTER_PROP = 'hasFilter';
|
|
7358
7358
|
const AND_OR_BUTTON = 'and-or-button';
|
|
7359
7359
|
const TRASH_BUTTON = 'trash-button';
|
|
7360
|
+
const REORDER_BUTTON = 'reorder-button';
|
|
7360
7361
|
const FilterButton = ({ column }) => {
|
|
7361
7362
|
return (hAsync("span", null, hAsync("button", { class: {
|
|
7362
7363
|
[FILTER_BUTTON_CLASS]: true,
|
|
7363
7364
|
[FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
|
|
7364
7365
|
} }, 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" }))))));
|
|
7365
7366
|
};
|
|
7366
|
-
const TrashButton = () => {
|
|
7367
|
-
return (hAsync("
|
|
7367
|
+
const TrashButton = ({ ariaLabel, onClick }) => {
|
|
7368
|
+
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" }))));
|
|
7368
7369
|
};
|
|
7369
|
-
const AndOrButton = ({ text }) => {
|
|
7370
|
-
return hAsync("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
|
|
7370
|
+
const AndOrButton = ({ text, onClick }) => {
|
|
7371
|
+
return hAsync("button", { type: "button", class: { [AND_OR_BUTTON]: true, 'light revo-button': true }, onClick: onClick }, text);
|
|
7372
|
+
};
|
|
7373
|
+
const ReorderButton = ({ ariaLabel, dragging, dragOver, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, onKeyDown, }) => {
|
|
7374
|
+
return (hAsync("button", { type: "button", class: {
|
|
7375
|
+
[REORDER_BUTTON]: true,
|
|
7376
|
+
'filter-row-dragging': !!dragging,
|
|
7377
|
+
'filter-row-drag-over': !!dragOver,
|
|
7378
|
+
}, draggable: true, title: ariaLabel, "aria-label": ariaLabel, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, onKeyDown: onKeyDown }, "::"));
|
|
7371
7379
|
};
|
|
7372
7380
|
function isFilterBtn(e) {
|
|
7373
7381
|
if (e.classList.contains(FILTER_BUTTON_CLASS)) {
|
|
@@ -7395,12 +7403,55 @@ function isFilterBtn(e) {
|
|
|
7395
7403
|
}
|
|
7396
7404
|
})();
|
|
7397
7405
|
|
|
7398
|
-
const
|
|
7406
|
+
const FILTER_REORDER_MIME = 'text/revogrid-filter-id';
|
|
7407
|
+
function setFilterReorderData(dataTransfer, id) {
|
|
7408
|
+
if (!dataTransfer) {
|
|
7409
|
+
return;
|
|
7410
|
+
}
|
|
7411
|
+
dataTransfer.effectAllowed = 'move';
|
|
7412
|
+
dataTransfer.setData(FILTER_REORDER_MIME, String(id));
|
|
7413
|
+
dataTransfer.setData('text/plain', String(id));
|
|
7414
|
+
}
|
|
7415
|
+
function getFilterReorderId(dataTransfer) {
|
|
7416
|
+
if (!dataTransfer) {
|
|
7417
|
+
return;
|
|
7418
|
+
}
|
|
7419
|
+
const rawId = dataTransfer.getData(FILTER_REORDER_MIME) || dataTransfer.getData('text/plain');
|
|
7420
|
+
const normalizedId = rawId.trim();
|
|
7421
|
+
if (!normalizedId) {
|
|
7422
|
+
return;
|
|
7423
|
+
}
|
|
7424
|
+
const id = Number(normalizedId);
|
|
7425
|
+
return Number.isFinite(id) ? id : undefined;
|
|
7426
|
+
}
|
|
7427
|
+
function moveFilterItem(items, sourceId, targetId) {
|
|
7428
|
+
if (sourceId === targetId) {
|
|
7429
|
+
return false;
|
|
7430
|
+
}
|
|
7431
|
+
const sourceIndex = items.findIndex(item => item.id === sourceId);
|
|
7432
|
+
const targetIndex = items.findIndex(item => item.id === targetId);
|
|
7433
|
+
if (sourceIndex === -1 || targetIndex === -1 || sourceIndex === targetIndex) {
|
|
7434
|
+
return false;
|
|
7435
|
+
}
|
|
7436
|
+
const relationsByPosition = items.map(item => { var _a; return (_a = item.relation) !== null && _a !== void 0 ? _a : 'and'; });
|
|
7437
|
+
const [movedItem] = items.splice(sourceIndex, 1);
|
|
7438
|
+
items.splice(targetIndex, 0, movedItem);
|
|
7439
|
+
items.forEach((item, index) => {
|
|
7440
|
+
var _a;
|
|
7441
|
+
item.relation = index === items.length - 1
|
|
7442
|
+
? 'and'
|
|
7443
|
+
: (_a = relationsByPosition[index]) !== null && _a !== void 0 ? _a : 'and';
|
|
7444
|
+
});
|
|
7445
|
+
return true;
|
|
7446
|
+
}
|
|
7447
|
+
|
|
7448
|
+
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}`;
|
|
7399
7449
|
|
|
7400
7450
|
const defaultType = 'none';
|
|
7401
7451
|
const FILTER_LIST_CLASS = 'multi-filter-list';
|
|
7402
7452
|
const FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';
|
|
7403
7453
|
const FILTER_ID = 'add-filter';
|
|
7454
|
+
const VIEWPORT_PADDING = 8;
|
|
7404
7455
|
/**
|
|
7405
7456
|
* Filter panel for editing filters
|
|
7406
7457
|
*/
|
|
@@ -7423,6 +7474,9 @@ class FilterPanel {
|
|
|
7423
7474
|
placeholder: 'Enter value...',
|
|
7424
7475
|
and: 'and',
|
|
7425
7476
|
or: 'or',
|
|
7477
|
+
filterCondition: 'Filter condition',
|
|
7478
|
+
removeFilter: 'Remove filter',
|
|
7479
|
+
reorderFilter: 'Reorder filter',
|
|
7426
7480
|
};
|
|
7427
7481
|
this.isFilterIdSet = false;
|
|
7428
7482
|
this.filterId = 0;
|
|
@@ -7496,18 +7550,28 @@ class FilterPanel {
|
|
|
7496
7550
|
if (typeof prop === 'undefined')
|
|
7497
7551
|
return '';
|
|
7498
7552
|
const propFilters = (_b = this.filterItems[prop]) !== null && _b !== void 0 ? _b : [];
|
|
7499
|
-
const
|
|
7500
|
-
|
|
7553
|
+
const visibleFilterCount = propFilters.filter(filter => !filter.hidden).length;
|
|
7554
|
+
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
7555
|
+
return (hAsync("div", { key: this.filterId }, hAsync("ul", { class: "multi-filter-list-container" }, propFilters.map((filter, index) => {
|
|
7501
7556
|
let andOrButton;
|
|
7502
7557
|
if (filter.hidden) {
|
|
7503
7558
|
return;
|
|
7504
7559
|
}
|
|
7505
7560
|
// hide toggle button if there is only one filter and the last one
|
|
7506
7561
|
if (index !== this.filterItems[prop].length - 1) {
|
|
7507
|
-
andOrButton = (hAsync(
|
|
7508
|
-
}
|
|
7509
|
-
|
|
7510
|
-
|
|
7562
|
+
andOrButton = (hAsync(AndOrButton, { text: filter.relation === 'and' ? capts.and : capts.or, onClick: () => this.toggleFilterAndOr(filter.id) }));
|
|
7563
|
+
}
|
|
7564
|
+
const extra = this.renderExtra(prop, index);
|
|
7565
|
+
const isDragging = this.draggedFilterId === filter.id;
|
|
7566
|
+
const isDragOver = this.dragOverFilterId === filter.id && !isDragging;
|
|
7567
|
+
const canReorder = visibleFilterCount > 1;
|
|
7568
|
+
return (hAsync("li", { key: filter.id, class: FILTER_LIST_CLASS, "aria-label": `${capts.filterCondition} ${index + 1}` }, hAsync("div", { class: {
|
|
7569
|
+
'multi-filter-list-row': true,
|
|
7570
|
+
'filter-row-drop-active': this.draggedFilterId !== undefined && !isDragging,
|
|
7571
|
+
'filter-row-dragging': isDragging,
|
|
7572
|
+
'filter-row-drag-over': isDragOver,
|
|
7573
|
+
} }, 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) })))));
|
|
7574
|
+
})), propFilters.filter(f => !f.hidden).length > 0 ? hAsync("div", { class: "add-filter-divider" }) : ''));
|
|
7511
7575
|
}
|
|
7512
7576
|
componentDidRender() {
|
|
7513
7577
|
this.syncDialog();
|
|
@@ -7526,37 +7590,35 @@ class FilterPanel {
|
|
|
7526
7590
|
this.dialog.show();
|
|
7527
7591
|
}
|
|
7528
7592
|
if (this.changes.autoCorrect !== false) {
|
|
7593
|
+
this.autoCorrect(this.dialog);
|
|
7529
7594
|
requestAnimationFrame(() => this.autoCorrect(this.dialog));
|
|
7530
7595
|
}
|
|
7531
7596
|
}
|
|
7532
7597
|
autoCorrect(el) {
|
|
7533
|
-
|
|
7598
|
+
var _a;
|
|
7599
|
+
if (!el || !this.changes) {
|
|
7534
7600
|
return;
|
|
7535
7601
|
}
|
|
7602
|
+
el.style.maxHeight = '';
|
|
7603
|
+
el.style.left = `${this.changes.x}px`;
|
|
7604
|
+
el.style.top = `${this.changes.y}px`;
|
|
7536
7605
|
const pos = el.getBoundingClientRect();
|
|
7537
|
-
const
|
|
7538
|
-
const
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
}
|
|
7552
|
-
|
|
7553
|
-
const isInside = e.clientX >= rect.left &&
|
|
7554
|
-
e.clientX <= rect.right &&
|
|
7555
|
-
e.clientY >= rect.top &&
|
|
7556
|
-
e.clientY <= rect.bottom;
|
|
7557
|
-
if (!isInside) {
|
|
7558
|
-
this.onCancel();
|
|
7559
|
-
}
|
|
7606
|
+
const anchorTop = (_a = this.changes.anchorY) !== null && _a !== void 0 ? _a : this.changes.y;
|
|
7607
|
+
const anchorBottom = this.changes.y;
|
|
7608
|
+
const spaceAbove = Math.max(0, anchorTop - VIEWPORT_PADDING);
|
|
7609
|
+
const spaceBelow = Math.max(0, window.innerHeight - anchorBottom - VIEWPORT_PADDING);
|
|
7610
|
+
const openAbove = pos.height > spaceBelow && spaceAbove > spaceBelow;
|
|
7611
|
+
const availableHeight = Math.max(VIEWPORT_PADDING, openAbove ? spaceAbove : spaceBelow);
|
|
7612
|
+
el.style.maxHeight = `${availableHeight}px`;
|
|
7613
|
+
const adjustedPos = el.getBoundingClientRect();
|
|
7614
|
+
const maxLeft = Math.max(VIEWPORT_PADDING, window.innerWidth - adjustedPos.width - VIEWPORT_PADDING);
|
|
7615
|
+
const maxTop = Math.max(VIEWPORT_PADDING, window.innerHeight - adjustedPos.height - VIEWPORT_PADDING);
|
|
7616
|
+
const left = Math.min(Math.max(VIEWPORT_PADDING, this.changes.x), maxLeft);
|
|
7617
|
+
const top = openAbove
|
|
7618
|
+
? Math.min(Math.max(VIEWPORT_PADDING, anchorTop - adjustedPos.height), maxTop)
|
|
7619
|
+
: Math.min(Math.max(VIEWPORT_PADDING, anchorBottom), maxTop);
|
|
7620
|
+
el.style.left = `${left}px`;
|
|
7621
|
+
el.style.top = `${top}px`;
|
|
7560
7622
|
}
|
|
7561
7623
|
onFilterTypeChange(e, prop, index) {
|
|
7562
7624
|
if (!(e.target instanceof HTMLSelectElement)) {
|
|
@@ -7648,6 +7710,80 @@ class FilterPanel {
|
|
|
7648
7710
|
this.debouncedApplyFilter();
|
|
7649
7711
|
}
|
|
7650
7712
|
}
|
|
7713
|
+
onFilterDragStart(e, id) {
|
|
7714
|
+
this.draggedFilterId = id;
|
|
7715
|
+
setFilterReorderData(e.dataTransfer, id);
|
|
7716
|
+
}
|
|
7717
|
+
onFilterDragOver(e, id) {
|
|
7718
|
+
if (this.draggedFilterId === undefined || this.draggedFilterId === id) {
|
|
7719
|
+
return;
|
|
7720
|
+
}
|
|
7721
|
+
e.preventDefault();
|
|
7722
|
+
if (e.dataTransfer) {
|
|
7723
|
+
e.dataTransfer.dropEffect = 'move';
|
|
7724
|
+
}
|
|
7725
|
+
this.dragOverFilterId = id;
|
|
7726
|
+
}
|
|
7727
|
+
onFilterDragLeave(id) {
|
|
7728
|
+
if (this.dragOverFilterId === id) {
|
|
7729
|
+
this.dragOverFilterId = undefined;
|
|
7730
|
+
}
|
|
7731
|
+
}
|
|
7732
|
+
onFilterDrop(e, prop, targetId) {
|
|
7733
|
+
var _a;
|
|
7734
|
+
e.preventDefault();
|
|
7735
|
+
const sourceId = (_a = this.draggedFilterId) !== null && _a !== void 0 ? _a : getFilterReorderId(e.dataTransfer);
|
|
7736
|
+
this.onFilterDragEnd();
|
|
7737
|
+
if (sourceId === undefined) {
|
|
7738
|
+
return;
|
|
7739
|
+
}
|
|
7740
|
+
const items = this.filterItems[prop];
|
|
7741
|
+
if (!items) {
|
|
7742
|
+
return;
|
|
7743
|
+
}
|
|
7744
|
+
if (!moveFilterItem(items, sourceId, targetId)) {
|
|
7745
|
+
return;
|
|
7746
|
+
}
|
|
7747
|
+
this.filterId++;
|
|
7748
|
+
if (!this.disableDynamicFiltering) {
|
|
7749
|
+
this.debouncedApplyFilter();
|
|
7750
|
+
}
|
|
7751
|
+
}
|
|
7752
|
+
onFilterDragEnd() {
|
|
7753
|
+
this.draggedFilterId = undefined;
|
|
7754
|
+
this.dragOverFilterId = undefined;
|
|
7755
|
+
}
|
|
7756
|
+
onFilterReorderKeyDown(e, prop, sourceId) {
|
|
7757
|
+
let direction = 0;
|
|
7758
|
+
if (e.key === 'ArrowUp') {
|
|
7759
|
+
direction = -1;
|
|
7760
|
+
}
|
|
7761
|
+
else if (e.key === 'ArrowDown') {
|
|
7762
|
+
direction = 1;
|
|
7763
|
+
}
|
|
7764
|
+
else {
|
|
7765
|
+
return;
|
|
7766
|
+
}
|
|
7767
|
+
const items = this.filterItems[prop];
|
|
7768
|
+
if (!items) {
|
|
7769
|
+
return;
|
|
7770
|
+
}
|
|
7771
|
+
const visibleItems = items.filter(item => !item.hidden);
|
|
7772
|
+
const sourceIndex = visibleItems.findIndex(item => item.id === sourceId);
|
|
7773
|
+
if (sourceIndex === -1) {
|
|
7774
|
+
return;
|
|
7775
|
+
}
|
|
7776
|
+
e.preventDefault();
|
|
7777
|
+
e.stopPropagation();
|
|
7778
|
+
const target = visibleItems[sourceIndex + direction];
|
|
7779
|
+
if (!target || !moveFilterItem(items, sourceId, target.id)) {
|
|
7780
|
+
return;
|
|
7781
|
+
}
|
|
7782
|
+
this.filterId++;
|
|
7783
|
+
if (!this.disableDynamicFiltering) {
|
|
7784
|
+
this.debouncedApplyFilter();
|
|
7785
|
+
}
|
|
7786
|
+
}
|
|
7651
7787
|
toggleFilterAndOr(id) {
|
|
7652
7788
|
var _a;
|
|
7653
7789
|
this.assertChanges();
|
|
@@ -7686,7 +7822,7 @@ class FilterPanel {
|
|
|
7686
7822
|
});
|
|
7687
7823
|
});
|
|
7688
7824
|
if (!isDefaultTypeRemoved) {
|
|
7689
|
-
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
7825
|
+
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
7690
7826
|
options.push(hAsync("option", { selected: this.currentFilterType === defaultType, value: defaultType }, prop && this.filterItems[prop] && this.filterItems[prop].length > 0
|
|
7691
7827
|
? capts.add
|
|
7692
7828
|
: this.filterNames[defaultType]));
|
|
@@ -7719,7 +7855,7 @@ class FilterPanel {
|
|
|
7719
7855
|
select.focus();
|
|
7720
7856
|
}
|
|
7721
7857
|
};
|
|
7722
|
-
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
7858
|
+
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
7723
7859
|
const extra = this.filterEntities[currentFilter[index].type].extra;
|
|
7724
7860
|
if (typeof extra === 'function') {
|
|
7725
7861
|
return extra(hAsync, {
|
|
@@ -7756,32 +7892,33 @@ class FilterPanel {
|
|
|
7756
7892
|
} }));
|
|
7757
7893
|
}
|
|
7758
7894
|
render() {
|
|
7759
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
7895
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
7760
7896
|
const style = {
|
|
7761
7897
|
left: `${(_b = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0}px`,
|
|
7762
7898
|
top: `${(_d = (_c = this.changes) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0}px`,
|
|
7763
7899
|
};
|
|
7764
|
-
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
7765
|
-
return (hAsync(Host, { key: '
|
|
7900
|
+
const capts = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
|
|
7901
|
+
return (hAsync(Host, { key: '4e969f8b7033363c885c94b1f7770917786669f2' }, hAsync("dialog", { key: '79b2713724684fa99f56621fe43645a0b0ad54bf', class: "filter-panel-dialog", style: style, ref: el => (this.dialog = el), onCancel: e => {
|
|
7766
7902
|
e.preventDefault();
|
|
7767
7903
|
this.onCancel();
|
|
7768
|
-
}
|
|
7769
|
-
hAsync("slot", { key:
|
|
7904
|
+
} }, this.changes && [
|
|
7905
|
+
hAsync("slot", { key: "header-slot", slot: "header" }),
|
|
7770
7906
|
((_f = (_e = this.changes).extraContent) === null || _f === void 0 ? void 0 : _f.call(_e, this.changes)) || '',
|
|
7771
7907
|
((_g = this.changes) === null || _g === void 0 ? void 0 : _g.hideDefaultFilters) !== true && [
|
|
7772
|
-
hAsync("label", { key:
|
|
7773
|
-
hAsync("div", { key:
|
|
7774
|
-
hAsync("div", { key:
|
|
7908
|
+
hAsync("label", { key: "filter-title" }, capts.title),
|
|
7909
|
+
hAsync("div", { key: "filter-holder", class: "filter-holder" }, this.getFilterItemsList()),
|
|
7910
|
+
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))),
|
|
7775
7911
|
],
|
|
7776
|
-
hAsync("slot", { key:
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
hAsync("button", { key:
|
|
7912
|
+
hAsync("slot", { key: "default-slot" }),
|
|
7913
|
+
((_j = (_h = this.changes).extraBottomContent) === null || _j === void 0 ? void 0 : _j.call(_h, this.changes)) || '',
|
|
7914
|
+
hAsync("div", { key: "filter-actions", class: "filter-actions" }, this.disableDynamicFiltering && [
|
|
7915
|
+
hAsync("button", { key: "save", id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
|
|
7916
|
+
hAsync("button", { key: "cancel", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
|
|
7780
7917
|
], !this.disableDynamicFiltering && [
|
|
7781
|
-
hAsync("button", { key:
|
|
7782
|
-
hAsync("button", { key:
|
|
7918
|
+
hAsync("button", { key: "ok", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
|
|
7919
|
+
hAsync("button", { key: "reset", id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
|
|
7783
7920
|
]),
|
|
7784
|
-
hAsync("slot", { key:
|
|
7921
|
+
hAsync("slot", { key: "footer-slot", slot: "footer" }),
|
|
7785
7922
|
])));
|
|
7786
7923
|
}
|
|
7787
7924
|
get element() { return getElement(this); }
|
|
@@ -7801,6 +7938,8 @@ class FilterPanel {
|
|
|
7801
7938
|
"currentFilterType": [32],
|
|
7802
7939
|
"changes": [32],
|
|
7803
7940
|
"filterItems": [32],
|
|
7941
|
+
"draggedFilterId": [32],
|
|
7942
|
+
"dragOverFilterId": [32],
|
|
7804
7943
|
"show": [64],
|
|
7805
7944
|
"getChanges": [64]
|
|
7806
7945
|
},
|
|
@@ -13082,43 +13221,82 @@ class ColumnService {
|
|
|
13082
13221
|
mapping,
|
|
13083
13222
|
};
|
|
13084
13223
|
}
|
|
13085
|
-
getTransformedDataToApply(start, data) {
|
|
13224
|
+
getTransformedDataToApply({ start, data, targetRange, }) {
|
|
13086
13225
|
const changed = {};
|
|
13087
13226
|
const copyRowLength = data.length;
|
|
13227
|
+
if (!copyRowLength) {
|
|
13228
|
+
return {
|
|
13229
|
+
changed,
|
|
13230
|
+
range: null,
|
|
13231
|
+
};
|
|
13232
|
+
}
|
|
13088
13233
|
const colLength = this.columns.length;
|
|
13089
13234
|
const rowLength = this.dataStore.get('items').length;
|
|
13235
|
+
const bounds = this.getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength);
|
|
13236
|
+
if (!bounds) {
|
|
13237
|
+
return {
|
|
13238
|
+
changed,
|
|
13239
|
+
range: null,
|
|
13240
|
+
};
|
|
13241
|
+
}
|
|
13242
|
+
const { startRow, startCol, endRow } = bounds;
|
|
13243
|
+
let maxCol = startCol - 1;
|
|
13244
|
+
let lastRow = startRow - 1;
|
|
13090
13245
|
// rows
|
|
13091
|
-
let rowIndex =
|
|
13092
|
-
let maxCol = 0;
|
|
13093
|
-
for (let i = 0; rowIndex < rowLength && i < copyRowLength; rowIndex++, i++) {
|
|
13246
|
+
for (let rowIndex = startRow, i = 0; rowIndex <= endRow; rowIndex++, i++) {
|
|
13094
13247
|
// copy original data link
|
|
13095
13248
|
const copyRow = data[i % copyRowLength];
|
|
13096
13249
|
const copyColLength = (copyRow === null || copyRow === void 0 ? void 0 : copyRow.length) || 0;
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
for (let j = 0; colIndex < colLength && j < copyColLength; colIndex++, j++) {
|
|
13100
|
-
const p = this.columns[colIndex].prop;
|
|
13101
|
-
const currentCol = j % colLength;
|
|
13102
|
-
/** if can write */
|
|
13103
|
-
if (!this.isReadOnly(rowIndex, colIndex)) {
|
|
13104
|
-
/** to show before save */
|
|
13105
|
-
if (!changed[rowIndex]) {
|
|
13106
|
-
changed[rowIndex] = {};
|
|
13107
|
-
}
|
|
13108
|
-
changed[rowIndex][p] = copyRow[currentCol];
|
|
13109
|
-
}
|
|
13250
|
+
if (!copyColLength) {
|
|
13251
|
+
continue;
|
|
13110
13252
|
}
|
|
13111
|
-
maxCol = Math.max(maxCol,
|
|
13253
|
+
maxCol = Math.max(maxCol, this.applyClipboardRow(changed, {
|
|
13254
|
+
bounds,
|
|
13255
|
+
copyColLength,
|
|
13256
|
+
copyRow,
|
|
13257
|
+
rowIndex,
|
|
13258
|
+
start,
|
|
13259
|
+
targetRange,
|
|
13260
|
+
}));
|
|
13261
|
+
lastRow = rowIndex;
|
|
13112
13262
|
}
|
|
13113
|
-
const range = getRange(start, {
|
|
13114
|
-
y: rowIndex - 1,
|
|
13115
|
-
x: maxCol,
|
|
13116
|
-
});
|
|
13117
13263
|
return {
|
|
13118
13264
|
changed,
|
|
13119
|
-
range,
|
|
13265
|
+
range: this.getAppliedRange(bounds, lastRow, maxCol),
|
|
13120
13266
|
};
|
|
13121
13267
|
}
|
|
13268
|
+
getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength) {
|
|
13269
|
+
var _a, _b, _c;
|
|
13270
|
+
const startRow = (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y) !== null && _a !== void 0 ? _a : start.y;
|
|
13271
|
+
const startCol = (_b = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x) !== null && _b !== void 0 ? _b : start.x;
|
|
13272
|
+
const endRow = Math.min(rowLength - 1, (_c = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y1) !== null && _c !== void 0 ? _c : start.y + copyRowLength - 1);
|
|
13273
|
+
if (endRow < startRow || startCol >= colLength) {
|
|
13274
|
+
return null;
|
|
13275
|
+
}
|
|
13276
|
+
return { startRow, startCol, endRow, colLength };
|
|
13277
|
+
}
|
|
13278
|
+
applyClipboardRow(changed, { bounds, copyColLength, copyRow, rowIndex, start, targetRange, }) {
|
|
13279
|
+
var _a;
|
|
13280
|
+
const endCol = Math.min(bounds.colLength - 1, (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x1) !== null && _a !== void 0 ? _a : start.x + copyColLength - 1);
|
|
13281
|
+
for (let colIndex = bounds.startCol, j = 0; colIndex <= endCol; colIndex++, j++) {
|
|
13282
|
+
if (this.isReadOnly(rowIndex, colIndex)) {
|
|
13283
|
+
continue;
|
|
13284
|
+
}
|
|
13285
|
+
const prop = this.columns[colIndex].prop;
|
|
13286
|
+
changed[rowIndex] = changed[rowIndex] || {};
|
|
13287
|
+
changed[rowIndex][prop] = copyRow[j % copyColLength];
|
|
13288
|
+
}
|
|
13289
|
+
return endCol;
|
|
13290
|
+
}
|
|
13291
|
+
getAppliedRange({ startRow, startCol }, lastRow, maxCol) {
|
|
13292
|
+
if (lastRow < startRow || maxCol < startCol) {
|
|
13293
|
+
return null;
|
|
13294
|
+
}
|
|
13295
|
+
return getRange({ x: startCol, y: startRow }, {
|
|
13296
|
+
y: lastRow,
|
|
13297
|
+
x: maxCol,
|
|
13298
|
+
});
|
|
13299
|
+
}
|
|
13122
13300
|
getRangeStaticData(d, value) {
|
|
13123
13301
|
const changed = {};
|
|
13124
13302
|
// rows
|
|
@@ -13785,6 +13963,30 @@ class AutoFillService {
|
|
|
13785
13963
|
}
|
|
13786
13964
|
}
|
|
13787
13965
|
|
|
13966
|
+
function getRangeFillClipboardData(data, useClipboard) {
|
|
13967
|
+
var _a;
|
|
13968
|
+
if (!isClipboardRangeFillEnabled(useClipboard)) {
|
|
13969
|
+
return null;
|
|
13970
|
+
}
|
|
13971
|
+
const normalized = trimTrailingEmptyClipboardRows(data);
|
|
13972
|
+
return normalized.length === 1 && ((_a = normalized[0]) === null || _a === void 0 ? void 0 : _a.length) === 1
|
|
13973
|
+
? normalized
|
|
13974
|
+
: null;
|
|
13975
|
+
}
|
|
13976
|
+
function isClipboardRangeFillEnabled(useClipboard) {
|
|
13977
|
+
return (typeof useClipboard === 'object' && useClipboard.rangeFill === true);
|
|
13978
|
+
}
|
|
13979
|
+
function trimTrailingEmptyClipboardRows(data) {
|
|
13980
|
+
const rows = [...data];
|
|
13981
|
+
while (rows.length > 1 && isEmptyClipboardRow(rows[rows.length - 1])) {
|
|
13982
|
+
rows.pop();
|
|
13983
|
+
}
|
|
13984
|
+
return rows;
|
|
13985
|
+
}
|
|
13986
|
+
function isEmptyClipboardRow(row) {
|
|
13987
|
+
return !row || row.every(cell => cell === '');
|
|
13988
|
+
}
|
|
13989
|
+
|
|
13788
13990
|
const revogrOverlayStyleCss = () => `revogr-overlay-selection{display:block;position:relative;width:100%}revogr-overlay-selection .autofill-handle{position:absolute;width:14px;height:14px;margin-left:-13px;margin-top:-13px;z-index:10;cursor:crosshair}revogr-overlay-selection .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:10px;height:10px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection.mobile .autofill-handle{position:absolute;width:30px;height:30px;margin-left:-29px;margin-top:-29px;z-index:10;cursor:crosshair}revogr-overlay-selection.mobile .autofill-handle::before{content:"";position:absolute;right:0;bottom:0;width:12px;height:12px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection .selection-border-range{position:absolute;pointer-events:none;z-index:9;box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset}revogr-overlay-selection .selection-border-range .range-handlers{height:100%;background-color:transparent;width:75%;max-width:50px;min-width:20px;left:50%;transform:translateX(-50%);position:absolute}revogr-overlay-selection .selection-border-range .range-handlers>span{pointer-events:auto;height:20px;width:20px;position:absolute;left:50%;transform:translateX(-50%)}revogr-overlay-selection .selection-border-range .range-handlers>span:before,revogr-overlay-selection .selection-border-range .range-handlers>span:after{position:absolute;border-radius:5px;width:15px;height:5px;left:50%;transform:translateX(-50%);background-color:rgba(0, 0, 0, 0.2)}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child{top:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child:before{content:"";top:0}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child{bottom:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child:after{content:"";bottom:0}revogr-overlay-selection revogr-edit{z-index:10}`;
|
|
13789
13991
|
|
|
13790
13992
|
/**
|
|
@@ -14035,9 +14237,9 @@ class OverlaySelection {
|
|
|
14035
14237
|
nodes.push(hAsync("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
14036
14238
|
}
|
|
14037
14239
|
}
|
|
14038
|
-
return (hAsync(Host, { key: '
|
|
14240
|
+
return (hAsync(Host, { key: 'ff303c39d59e4ef217421fa11b9a80de07311b07', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true), onCloseedit: (e) => this.closeEdit(e),
|
|
14039
14241
|
// it's done to be able to throw events from different levels, not just from editor
|
|
14040
|
-
onCelledit: (e) => this.onEditCell(e) }, nodes, hAsync("slot", { key: '
|
|
14242
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, hAsync("slot", { key: '3cbe4c3ad7d447f779e9e20f73eec2e3107275e0', name: "data" })));
|
|
14041
14243
|
}
|
|
14042
14244
|
/**
|
|
14043
14245
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -14202,13 +14404,25 @@ class OverlaySelection {
|
|
|
14202
14404
|
if (!focus || isEditing) {
|
|
14203
14405
|
return;
|
|
14204
14406
|
}
|
|
14205
|
-
|
|
14407
|
+
const rangeFillData = getRangeFillClipboardData(data, this.useClipboard);
|
|
14408
|
+
const targetRange = rangeFillData
|
|
14409
|
+
? this.getClipboardPasteTargetRange()
|
|
14410
|
+
: null;
|
|
14411
|
+
let { changed, range } = this.columnService.getTransformedDataToApply({
|
|
14412
|
+
start: focus,
|
|
14413
|
+
data: rangeFillData || data,
|
|
14414
|
+
targetRange,
|
|
14415
|
+
});
|
|
14206
14416
|
const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, models: collectModelsOfRange(changed, this.dataStore), range }, this.types));
|
|
14207
14417
|
if (canPaste) {
|
|
14208
14418
|
return;
|
|
14209
14419
|
}
|
|
14210
14420
|
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range, range);
|
|
14211
14421
|
}
|
|
14422
|
+
getClipboardPasteTargetRange() {
|
|
14423
|
+
const range = this.selectionStore.get('range');
|
|
14424
|
+
return range && !isRangeSingleCell(range) ? range : null;
|
|
14425
|
+
}
|
|
14212
14426
|
async focusNext() {
|
|
14213
14427
|
var _a;
|
|
14214
14428
|
const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
|
|
@@ -15756,7 +15970,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
15756
15970
|
}
|
|
15757
15971
|
// filter button clicked, open filter dialog
|
|
15758
15972
|
const buttonPos = (filterButton instanceof HTMLElement ? filterButton : el).getBoundingClientRect();
|
|
15759
|
-
const data = Object.assign(Object.assign(Object.assign({}, e.detail), this.filterCollection[prop]), { x: buttonPos.x, y: buttonPos.y + buttonPos.height, autoCorrect: true, filterTypes: this.getColumnFilter(e.detail.filter), filterItems: this.multiFilterItems, extraContent: this.extraHyperContent });
|
|
15973
|
+
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 });
|
|
15760
15974
|
(_b = this.beforeshow) === null || _b === void 0 ? void 0 : _b.call(this, data);
|
|
15761
15975
|
this.pop.show(data);
|
|
15762
15976
|
}
|
|
@@ -17014,9 +17228,22 @@ function filterOutEmptyGroupRows(source, filterTrimmed) {
|
|
|
17014
17228
|
return trimmed;
|
|
17015
17229
|
}
|
|
17016
17230
|
|
|
17231
|
+
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
17232
|
+
var t = {};
|
|
17233
|
+
for (var p in s)
|
|
17234
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17235
|
+
t[p] = s[p];
|
|
17236
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17237
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17238
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17239
|
+
t[p[i]] = s[p[i]];
|
|
17240
|
+
}
|
|
17241
|
+
return t;
|
|
17242
|
+
};
|
|
17017
17243
|
const PADDING_DEPTH = 10;
|
|
17018
|
-
const RowRenderer = (
|
|
17019
|
-
|
|
17244
|
+
const RowRenderer = (_a, cells) => {
|
|
17245
|
+
var { rowClass, index, size, start, depth, groupingLevel } = _a, attrs = __rest$1(_a, ["rowClass", "index", "size", "start", "depth", "groupingLevel"]);
|
|
17246
|
+
const props = Object.assign(Object.assign(Object.assign({}, attrs), { [DATA_ROW]: index }), (typeof groupingLevel === 'number'
|
|
17020
17247
|
? { 'data-level': groupingLevel }
|
|
17021
17248
|
: {}));
|
|
17022
17249
|
return (hAsync("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
@@ -17043,12 +17270,17 @@ const GroupingRowRenderer = (props) => {
|
|
|
17043
17270
|
const name = model[PSEUDO_GROUP_ITEM];
|
|
17044
17271
|
const expanded = model[GROUP_EXPANDED];
|
|
17045
17272
|
const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
|
|
17273
|
+
const groupRowAttrs = {
|
|
17274
|
+
rowClass: 'groupingRow',
|
|
17275
|
+
depth,
|
|
17276
|
+
expanded,
|
|
17277
|
+
};
|
|
17046
17278
|
if (groupingCustomRenderer) {
|
|
17047
|
-
return (hAsync(RowRenderer, Object.assign({}, props,
|
|
17279
|
+
return (hAsync(RowRenderer, Object.assign({}, props, groupRowAttrs), hAsync("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(hAsync, Object.assign(Object.assign({}, props), { colType: props.providers.colType, name,
|
|
17048
17280
|
expanded,
|
|
17049
17281
|
depth })))));
|
|
17050
17282
|
}
|
|
17051
|
-
return (hAsync(RowRenderer, Object.assign({}, props,
|
|
17283
|
+
return (hAsync(RowRenderer, Object.assign({}, props, groupRowAttrs), hasExpand && [
|
|
17052
17284
|
hAsync("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)),
|
|
17053
17285
|
name,
|
|
17054
17286
|
]));
|
|
@@ -18521,8 +18753,17 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18521
18753
|
constructor(revogrid, providers) {
|
|
18522
18754
|
super(revogrid, providers);
|
|
18523
18755
|
this.moveFunc = debounce$1((e) => this.doMove(e), 5);
|
|
18756
|
+
this.preventHeaderClickAfterDrag = (event) => {
|
|
18757
|
+
if (!this.preventNextHeaderClick) {
|
|
18758
|
+
return;
|
|
18759
|
+
}
|
|
18760
|
+
this.preventNextHeaderClick = false;
|
|
18761
|
+
event.preventDefault();
|
|
18762
|
+
};
|
|
18524
18763
|
this.staticDragData = null;
|
|
18525
18764
|
this.dragData = null;
|
|
18765
|
+
this.columnDragMoved = false;
|
|
18766
|
+
this.preventNextHeaderClick = false;
|
|
18526
18767
|
this.localSubscriptions = {};
|
|
18527
18768
|
this.orderUi = new ColumnOrderHandler();
|
|
18528
18769
|
revogrid.appendChild(this.orderUi.render());
|
|
@@ -18541,11 +18782,13 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18541
18782
|
callback: (e) => this.move(e),
|
|
18542
18783
|
};
|
|
18543
18784
|
this.addEventListener(COLUMN_CLICK, ({ detail }) => this.dragStart(detail));
|
|
18785
|
+
this.revogrid.addEventListener('beforeheaderclick', this.preventHeaderClickAfterDrag, { capture: true });
|
|
18544
18786
|
}
|
|
18545
18787
|
dragStart({ event, data }) {
|
|
18546
18788
|
if (event.defaultPrevented) {
|
|
18547
18789
|
return;
|
|
18548
18790
|
}
|
|
18791
|
+
this.preventNextHeaderClick = false;
|
|
18549
18792
|
const { defaultPrevented } = dispatch(this.revogrid, COLUMN_DRAG_START_EVENT, data);
|
|
18550
18793
|
// check if allowed to drag particulat column
|
|
18551
18794
|
if (defaultPrevented) {
|
|
@@ -18567,7 +18810,8 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18567
18810
|
const cols = this.getDimension(data.pin || 'rgCol');
|
|
18568
18811
|
const gridRect = this.revogrid.getBoundingClientRect();
|
|
18569
18812
|
const elRect = dataEl.getBoundingClientRect();
|
|
18570
|
-
const startItem = getItemByPosition(cols, getLeftRelative(event.x, gridRect.left, elRect.left - gridRect.left) +
|
|
18813
|
+
const startItem = getItemByPosition(cols, getLeftRelative(event.x, gridRect.left, elRect.left - gridRect.left) +
|
|
18814
|
+
(cols.renderOffset || 0));
|
|
18571
18815
|
this.staticDragData = {
|
|
18572
18816
|
startPos: event.x,
|
|
18573
18817
|
startItem,
|
|
@@ -18598,10 +18842,14 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18598
18842
|
if (rgCol.itemIndex >= this.staticDragData.cols.count) {
|
|
18599
18843
|
return;
|
|
18600
18844
|
}
|
|
18601
|
-
this.orderUi.showHandler(rgCol.
|
|
18845
|
+
this.orderUi.showHandler(getColumnDragPosition(rgCol, this.staticDragData.startItem, this.staticDragData.cols.renderOffset || 0, dragData.scrollOffset), dragData.gridRect.width);
|
|
18602
18846
|
}
|
|
18603
18847
|
}
|
|
18604
18848
|
move(e) {
|
|
18849
|
+
if (this.staticDragData &&
|
|
18850
|
+
Math.abs(this.staticDragData.startPos - e.x) > 10) {
|
|
18851
|
+
this.columnDragMoved = true;
|
|
18852
|
+
}
|
|
18605
18853
|
dispatch(this.revogrid, COLUMN_DRAG_MOVE_EVENT, e);
|
|
18606
18854
|
// then do move
|
|
18607
18855
|
this.moveFunc(e);
|
|
@@ -18610,6 +18858,7 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18610
18858
|
this.clearOrder();
|
|
18611
18859
|
}
|
|
18612
18860
|
onMouseUp(e) {
|
|
18861
|
+
const suppressClick = this.columnDragMoved;
|
|
18613
18862
|
// apply new positions
|
|
18614
18863
|
if (this.dragData && this.staticDragData) {
|
|
18615
18864
|
let relativePos = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
|
|
@@ -18632,6 +18881,9 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18632
18881
|
}
|
|
18633
18882
|
dispatch(this.revogrid, COLUMN_DRAG_END_EVENT, this.getData(this.staticDragData, newItems, source));
|
|
18634
18883
|
}
|
|
18884
|
+
if (suppressClick) {
|
|
18885
|
+
this.preventNextHeaderClick = !!e.target.closest('revogr-header');
|
|
18886
|
+
}
|
|
18635
18887
|
this.clearOrder();
|
|
18636
18888
|
}
|
|
18637
18889
|
clearLocalSubscriptions() {
|
|
@@ -18640,6 +18892,7 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18640
18892
|
clearOrder() {
|
|
18641
18893
|
this.staticDragData = null;
|
|
18642
18894
|
this.dragData = null;
|
|
18895
|
+
this.columnDragMoved = false;
|
|
18643
18896
|
this.clearLocalSubscriptions();
|
|
18644
18897
|
this.orderUi.stop(this.revogrid);
|
|
18645
18898
|
}
|
|
@@ -18649,6 +18902,7 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18649
18902
|
clearSubscriptions() {
|
|
18650
18903
|
super.clearSubscriptions();
|
|
18651
18904
|
this.clearLocalSubscriptions();
|
|
18905
|
+
this.revogrid.removeEventListener('beforeheaderclick', this.preventHeaderClickAfterDrag, { capture: true });
|
|
18652
18906
|
}
|
|
18653
18907
|
getData({ gridEl, dataEl, pin }, order, source = []) {
|
|
18654
18908
|
const gridRect = gridEl.getBoundingClientRect();
|
|
@@ -18670,6 +18924,12 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18670
18924
|
function getLeftRelative(absoluteX, gridPos, offset) {
|
|
18671
18925
|
return absoluteX - gridPos - offset;
|
|
18672
18926
|
}
|
|
18927
|
+
function getColumnDragPosition(targetItem, startItem, renderOffset, scrollOffset) {
|
|
18928
|
+
const insertionEdge = startItem.itemIndex > targetItem.itemIndex
|
|
18929
|
+
? targetItem.start
|
|
18930
|
+
: targetItem.end;
|
|
18931
|
+
return insertionEdge - renderOffset + scrollOffset;
|
|
18932
|
+
}
|
|
18673
18933
|
|
|
18674
18934
|
function isMobileDevice() {
|
|
18675
18935
|
return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;
|
|
@@ -19019,7 +19279,7 @@ class RevoGridComponent {
|
|
|
19019
19279
|
this.rowSize = 0;
|
|
19020
19280
|
/** Indicates default column size. */
|
|
19021
19281
|
this.colSize = 100;
|
|
19022
|
-
/** When true, user can range
|
|
19282
|
+
/** When true, user can select a cell range. Required for range-based clipboard fill. */
|
|
19023
19283
|
this.range = false;
|
|
19024
19284
|
/** When true, grid in read only mode. */
|
|
19025
19285
|
this.readonly = false;
|
|
@@ -19031,7 +19291,7 @@ class RevoGridComponent {
|
|
|
19031
19291
|
this.noHorizontalScrollTransfer = false;
|
|
19032
19292
|
/** When true cell focus appear. */
|
|
19033
19293
|
this.canFocus = true;
|
|
19034
|
-
/** When true enable clipboard. */
|
|
19294
|
+
/** When true enable clipboard. Can be boolean or clipboard config. */
|
|
19035
19295
|
this.useClipboard = true;
|
|
19036
19296
|
/**
|
|
19037
19297
|
* Columns - defines an array of grid columns.
|
|
@@ -21887,9 +22147,17 @@ class RevogrViewportScroll {
|
|
|
21887
22147
|
}
|
|
21888
22148
|
render() {
|
|
21889
22149
|
var _a, _b;
|
|
21890
|
-
const
|
|
22150
|
+
const clientHeight = (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
|
|
22151
|
+
// When content fits in the viewport (no scroll needed), don't inflate content-wrapper
|
|
22152
|
+
// to clientHeight — that would prevent inner-content-table from shrinking and push
|
|
22153
|
+
// rowPinEnd (footer) to the bottom instead of letting it follow the data rows.
|
|
22154
|
+
// For large/compressed grids (content > clientHeight), physicalContentHeight handles
|
|
22155
|
+
// the browser scroll-size compression correctly.
|
|
22156
|
+
const physicalContentHeight = this.contentHeight < clientHeight
|
|
22157
|
+
? Math.max(this.contentHeight, 0)
|
|
22158
|
+
: getContentSize(this.contentHeight, clientHeight);
|
|
21891
22159
|
const physicalContentWidth = getContentSize(this.contentWidth, 0);
|
|
21892
|
-
return (hAsync(Host, { key: '
|
|
22160
|
+
return (hAsync(Host, { key: '3dd9d29cf26743d7aa4995f51180d56008526e54', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: 'af75428e845044c33eba2fecd1ec04a9177b9b5c', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, hAsync("div", { key: 'a0149f597588371e1fafe69efc3bd4411379a017', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: 'e5d2570bf93897cd97ef702141c83bb8c0e13ee2', name: HEADER_SLOT })), hAsync("div", { key: 'd1388ff0d721dd8ce925b934bb2128fddc1ac17b', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: 'a306ff56f62279402e2a881a081e3224341d5bdf', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, hAsync("slot", { key: '898bda8e9429da06c9ff2bd41626ac27f3cde3cc', name: CONTENT_SLOT }))), hAsync("div", { key: '5e9eba1edd5fca07a964971054a7900e4dd84099', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: 'f233ad1c23b3f692c45e1db235cfef4704a80726', name: FOOTER_SLOT })))));
|
|
21893
22161
|
}
|
|
21894
22162
|
/**
|
|
21895
22163
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|