@revolist/revogrid 4.23.13 → 4.23.14
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-DfUCisis.js → cell-renderer-Dcz022q7.js} +5 -23
- package/dist/cjs/{column.drag.plugin-D_Dfhp4f.js → column.drag.plugin-BGLbi1zS.js} +9 -38
- package/dist/cjs/{column.service-BNWNiJW3.js → column.service-C1Qvcf5l.js} +23 -62
- package/dist/cjs/{filter.button-B9EzJrr1.js → filter.button-w6LWnyhi.js} +0 -16
- package/dist/cjs/{header-cell-renderer-DyjOxArm.js → header-cell-renderer-vVr4IWNV.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -8
- 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 +4 -40
- package/dist/cjs/revogr-data_4.cjs.entry.js +6 -14
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +68 -119
- package/dist/collection/components/data/column.service.js +23 -62
- package/dist/collection/components/data/row-renderer.js +2 -15
- package/dist/collection/components/overlay/revogr-overlay-selection.js +7 -27
- package/dist/collection/components/revoGrid/revo-grid.js +7 -14
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +2 -10
- package/dist/collection/plugins/filter/filter.button.js +0 -14
- package/dist/collection/plugins/filter/filter.panel.js +68 -80
- package/dist/collection/plugins/filter/filter.plugin.js +4 -4
- package/dist/collection/plugins/filter/filter.style.css +18 -56
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +2 -7
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js +2 -30
- package/dist/collection/serve/controller.js +0 -1
- package/dist/esm/{cell-renderer-CLTRlCa5.js → cell-renderer-BtN-NGCk.js} +5 -23
- package/dist/esm/{column.drag.plugin-UNSHSmgo.js → column.drag.plugin-4Ixr4ijU.js} +10 -38
- package/dist/esm/{column.service-C6hByxPy.js → column.service-CC_SD8W3.js} +23 -62
- package/dist/{revo-grid/filter.button-BFwo1uvz.js → esm/filter.button-C8XTWPU2.js} +1 -15
- package/dist/esm/{header-cell-renderer-BMmXRsd_.js → header-cell-renderer-B-LX2sgu.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 +4 -40
- package/dist/esm/revogr-data_4.entry.js +6 -14
- package/dist/esm/revogr-filter-panel.entry.js +68 -119
- package/dist/revo-grid/{cell-renderer-CLTRlCa5.js → cell-renderer-BtN-NGCk.js} +5 -23
- package/dist/revo-grid/{column.drag.plugin-UNSHSmgo.js → column.drag.plugin-4Ixr4ijU.js} +10 -38
- package/dist/revo-grid/{column.service-C6hByxPy.js → column.service-CC_SD8W3.js} +23 -62
- package/dist/{esm/filter.button-BFwo1uvz.js → revo-grid/filter.button-C8XTWPU2.js} +1 -15
- package/dist/revo-grid/{header-cell-renderer-BMmXRsd_.js → header-cell-renderer-B-LX2sgu.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 +4 -40
- package/dist/revo-grid/revogr-data_4.entry.js +6 -14
- package/dist/revo-grid/revogr-filter-panel.entry.js +68 -119
- package/dist/types/components/data/column.service.d.ts +1 -10
- package/dist/types/components/data/row-renderer.d.ts +1 -1
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +3 -4
- 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 +0 -11
- package/dist/types/plugins/filter/filter.panel.d.ts +4 -7
- package/dist/types/plugins/filter/filter.plugin.d.ts +0 -1
- package/dist/types/plugins/filter/filter.types.d.ts +0 -1
- package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +0 -4
- package/dist/types/types/interfaces.d.ts +0 -8
- package/hydrate/index.js +107 -303
- package/hydrate/index.mjs +107 -303
- package/package.json +1 -1
- package/readme.md +1 -20
- 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-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/collection/components/overlay/clipboard.utils.js +0 -26
- package/dist/collection/plugins/filter/filter.reorder.js +0 -44
- package/dist/types/components/overlay/clipboard.utils.d.ts +0 -3
- package/dist/types/plugins/filter/filter.reorder.d.ts +0 -4
package/hydrate/index.mjs
CHANGED
|
@@ -7357,7 +7357,6 @@ 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';
|
|
7361
7360
|
const FilterButton = ({ column }) => {
|
|
7362
7361
|
return (hAsync("span", null, hAsync("button", { class: {
|
|
7363
7362
|
[FILTER_BUTTON_CLASS]: true,
|
|
@@ -7370,19 +7369,6 @@ const TrashButton = () => {
|
|
|
7370
7369
|
const AndOrButton = ({ text }) => {
|
|
7371
7370
|
return hAsync("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
|
|
7372
7371
|
};
|
|
7373
|
-
const ReorderButton = ({ dragging, dragOver, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, }) => {
|
|
7374
|
-
const applyClass = (el) => {
|
|
7375
|
-
if (!el) {
|
|
7376
|
-
return;
|
|
7377
|
-
}
|
|
7378
|
-
el.className = [
|
|
7379
|
-
REORDER_BUTTON,
|
|
7380
|
-
dragging ? 'filter-row-dragging' : '',
|
|
7381
|
-
dragOver ? 'filter-row-drag-over' : '',
|
|
7382
|
-
].filter(Boolean).join(' ');
|
|
7383
|
-
};
|
|
7384
|
-
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 }, "::"));
|
|
7385
|
-
};
|
|
7386
7372
|
function isFilterBtn(e) {
|
|
7387
7373
|
if (e.classList.contains(FILTER_BUTTON_CLASS)) {
|
|
7388
7374
|
return true;
|
|
@@ -7409,49 +7395,7 @@ function isFilterBtn(e) {
|
|
|
7409
7395
|
}
|
|
7410
7396
|
})();
|
|
7411
7397
|
|
|
7412
|
-
const
|
|
7413
|
-
function setFilterReorderData(dataTransfer, id) {
|
|
7414
|
-
if (!dataTransfer) {
|
|
7415
|
-
return;
|
|
7416
|
-
}
|
|
7417
|
-
dataTransfer.effectAllowed = 'move';
|
|
7418
|
-
dataTransfer.setData(FILTER_REORDER_MIME, String(id));
|
|
7419
|
-
dataTransfer.setData('text/plain', String(id));
|
|
7420
|
-
}
|
|
7421
|
-
function getFilterReorderId(dataTransfer) {
|
|
7422
|
-
if (!dataTransfer) {
|
|
7423
|
-
return;
|
|
7424
|
-
}
|
|
7425
|
-
const rawId = dataTransfer.getData(FILTER_REORDER_MIME) || dataTransfer.getData('text/plain');
|
|
7426
|
-
const normalizedId = rawId.trim();
|
|
7427
|
-
if (!normalizedId) {
|
|
7428
|
-
return;
|
|
7429
|
-
}
|
|
7430
|
-
const id = Number(normalizedId);
|
|
7431
|
-
return Number.isFinite(id) ? id : undefined;
|
|
7432
|
-
}
|
|
7433
|
-
function moveFilterItem(items, sourceId, targetId) {
|
|
7434
|
-
if (sourceId === targetId) {
|
|
7435
|
-
return false;
|
|
7436
|
-
}
|
|
7437
|
-
const sourceIndex = items.findIndex(item => item.id === sourceId);
|
|
7438
|
-
const targetIndex = items.findIndex(item => item.id === targetId);
|
|
7439
|
-
if (sourceIndex === -1 || targetIndex === -1 || sourceIndex === targetIndex) {
|
|
7440
|
-
return false;
|
|
7441
|
-
}
|
|
7442
|
-
const relationsByPosition = items.map(item => { var _a; return (_a = item.relation) !== null && _a !== void 0 ? _a : 'and'; });
|
|
7443
|
-
const [movedItem] = items.splice(sourceIndex, 1);
|
|
7444
|
-
items.splice(targetIndex, 0, movedItem);
|
|
7445
|
-
items.forEach((item, index) => {
|
|
7446
|
-
var _a;
|
|
7447
|
-
item.relation = index === items.length - 1
|
|
7448
|
-
? 'and'
|
|
7449
|
-
: (_a = relationsByPosition[index]) !== null && _a !== void 0 ? _a : 'and';
|
|
7450
|
-
});
|
|
7451
|
-
return true;
|
|
7452
|
-
}
|
|
7453
|
-
|
|
7454
|
-
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}`;
|
|
7398
|
+
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));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::backdrop{background:transparent}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{text-align:right;margin-right:-5px}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-action{display:flex;justify-content:space-between;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}.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;justify-content:space-between;align-items:center}`;
|
|
7455
7399
|
|
|
7456
7400
|
const defaultType = 'none';
|
|
7457
7401
|
const FILTER_LIST_CLASS = 'multi-filter-list';
|
|
@@ -7552,7 +7496,6 @@ class FilterPanel {
|
|
|
7552
7496
|
if (typeof prop === 'undefined')
|
|
7553
7497
|
return '';
|
|
7554
7498
|
const propFilters = (_b = this.filterItems[prop]) !== null && _b !== void 0 ? _b : [];
|
|
7555
|
-
const visibleFilterCount = propFilters.filter(filter => !filter.hidden).length;
|
|
7556
7499
|
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
7557
7500
|
return (hAsync("div", { key: this.filterId }, propFilters.map((filter, index) => {
|
|
7558
7501
|
let andOrButton;
|
|
@@ -7563,24 +7506,56 @@ class FilterPanel {
|
|
|
7563
7506
|
if (index !== this.filterItems[prop].length - 1) {
|
|
7564
7507
|
andOrButton = (hAsync("div", { onClick: () => this.toggleFilterAndOr(filter.id) }, hAsync(AndOrButton, { text: filter.relation === 'and' ? capts.and : capts.or })));
|
|
7565
7508
|
}
|
|
7566
|
-
|
|
7567
|
-
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))))));
|
|
7509
|
+
return (hAsync("div", { key: filter.id, class: FILTER_LIST_CLASS }, 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)), hAsync("div", { class: FILTER_LIST_CLASS_ACTION }, andOrButton), hAsync("div", { onClick: () => this.onRemoveFilter(filter.id) }, hAsync(TrashButton, null))), hAsync("div", null, this.renderExtra(prop, index))));
|
|
7568
7510
|
}), propFilters.filter(f => !f.hidden).length > 0 ? hAsync("div", { class: "add-filter-divider" }) : ''));
|
|
7569
7511
|
}
|
|
7512
|
+
componentDidRender() {
|
|
7513
|
+
this.syncDialog();
|
|
7514
|
+
}
|
|
7515
|
+
syncDialog() {
|
|
7516
|
+
if (!this.dialog) {
|
|
7517
|
+
return;
|
|
7518
|
+
}
|
|
7519
|
+
if (!this.changes) {
|
|
7520
|
+
if (this.dialog.open) {
|
|
7521
|
+
this.dialog.close();
|
|
7522
|
+
}
|
|
7523
|
+
return;
|
|
7524
|
+
}
|
|
7525
|
+
if (!this.dialog.open) {
|
|
7526
|
+
this.dialog.show();
|
|
7527
|
+
}
|
|
7528
|
+
if (this.changes.autoCorrect !== false) {
|
|
7529
|
+
requestAnimationFrame(() => this.autoCorrect(this.dialog));
|
|
7530
|
+
}
|
|
7531
|
+
}
|
|
7570
7532
|
autoCorrect(el) {
|
|
7571
|
-
var _a, _b;
|
|
7572
7533
|
if (!el) {
|
|
7573
7534
|
return;
|
|
7574
7535
|
}
|
|
7575
|
-
const
|
|
7576
|
-
|
|
7536
|
+
const pos = el.getBoundingClientRect();
|
|
7537
|
+
const maxLeft = Math.max(0, window.innerWidth - pos.width);
|
|
7538
|
+
const maxTop = Math.max(0, window.innerHeight - pos.height);
|
|
7539
|
+
if (pos.left > maxLeft) {
|
|
7540
|
+
el.style.left = `${maxLeft}px`;
|
|
7541
|
+
}
|
|
7542
|
+
if (pos.top > maxTop) {
|
|
7543
|
+
el.style.top = `${maxTop}px`;
|
|
7544
|
+
}
|
|
7545
|
+
}
|
|
7546
|
+
onDialogMouseDown(e) {
|
|
7547
|
+
if (!this.closeOnOutsideClick ||
|
|
7548
|
+
e.target !== this.dialog ||
|
|
7549
|
+
!this.dialog) {
|
|
7577
7550
|
return;
|
|
7578
7551
|
}
|
|
7579
|
-
const
|
|
7580
|
-
const
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7552
|
+
const rect = this.dialog.getBoundingClientRect();
|
|
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();
|
|
7584
7559
|
}
|
|
7585
7560
|
}
|
|
7586
7561
|
onFilterTypeChange(e, prop, index) {
|
|
@@ -7673,49 +7648,6 @@ class FilterPanel {
|
|
|
7673
7648
|
this.debouncedApplyFilter();
|
|
7674
7649
|
}
|
|
7675
7650
|
}
|
|
7676
|
-
onFilterDragStart(e, id) {
|
|
7677
|
-
this.draggedFilterId = id;
|
|
7678
|
-
setFilterReorderData(e.dataTransfer, id);
|
|
7679
|
-
}
|
|
7680
|
-
onFilterDragOver(e, id) {
|
|
7681
|
-
if (this.draggedFilterId === undefined || this.draggedFilterId === id) {
|
|
7682
|
-
return;
|
|
7683
|
-
}
|
|
7684
|
-
e.preventDefault();
|
|
7685
|
-
if (e.dataTransfer) {
|
|
7686
|
-
e.dataTransfer.dropEffect = 'move';
|
|
7687
|
-
}
|
|
7688
|
-
this.dragOverFilterId = id;
|
|
7689
|
-
}
|
|
7690
|
-
onFilterDragLeave(id) {
|
|
7691
|
-
if (this.dragOverFilterId === id) {
|
|
7692
|
-
this.dragOverFilterId = undefined;
|
|
7693
|
-
}
|
|
7694
|
-
}
|
|
7695
|
-
onFilterDrop(e, prop, targetId) {
|
|
7696
|
-
var _a;
|
|
7697
|
-
e.preventDefault();
|
|
7698
|
-
const sourceId = (_a = this.draggedFilterId) !== null && _a !== void 0 ? _a : getFilterReorderId(e.dataTransfer);
|
|
7699
|
-
this.onFilterDragEnd();
|
|
7700
|
-
if (sourceId === undefined) {
|
|
7701
|
-
return;
|
|
7702
|
-
}
|
|
7703
|
-
const items = this.filterItems[prop];
|
|
7704
|
-
if (!items) {
|
|
7705
|
-
return;
|
|
7706
|
-
}
|
|
7707
|
-
if (!moveFilterItem(items, sourceId, targetId)) {
|
|
7708
|
-
return;
|
|
7709
|
-
}
|
|
7710
|
-
this.filterId++;
|
|
7711
|
-
if (!this.disableDynamicFiltering) {
|
|
7712
|
-
this.debouncedApplyFilter();
|
|
7713
|
-
}
|
|
7714
|
-
}
|
|
7715
|
-
onFilterDragEnd() {
|
|
7716
|
-
this.draggedFilterId = undefined;
|
|
7717
|
-
this.dragOverFilterId = undefined;
|
|
7718
|
-
}
|
|
7719
7651
|
toggleFilterAndOr(id) {
|
|
7720
7652
|
var _a;
|
|
7721
7653
|
this.assertChanges();
|
|
@@ -7824,30 +7756,33 @@ class FilterPanel {
|
|
|
7824
7756
|
} }));
|
|
7825
7757
|
}
|
|
7826
7758
|
render() {
|
|
7827
|
-
var _a, _b, _c, _d, _e;
|
|
7828
|
-
if (!this.changes) {
|
|
7829
|
-
return hAsync(Host, { style: { display: 'none' } });
|
|
7830
|
-
}
|
|
7759
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
7831
7760
|
const style = {
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
top: `${this.changes.y}px`,
|
|
7761
|
+
left: `${(_b = (_a = this.changes) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0}px`,
|
|
7762
|
+
top: `${(_d = (_c = this.changes) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0}px`,
|
|
7835
7763
|
};
|
|
7836
7764
|
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
7837
|
-
return (hAsync(Host, { style: style, ref: el => {
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
}
|
|
7841
|
-
hAsync("
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
hAsync("
|
|
7849
|
-
hAsync("
|
|
7850
|
-
|
|
7765
|
+
return (hAsync(Host, { key: '9fb424017d080876ff7796237917b4f41f617fe0' }, hAsync("dialog", { key: '37b9f870b95f6fe1bd7be359dd7b77ef196e896e', class: "filter-panel-dialog", style: style, ref: el => (this.dialog = el), onCancel: e => {
|
|
7766
|
+
e.preventDefault();
|
|
7767
|
+
this.onCancel();
|
|
7768
|
+
}, onMouseDown: e => this.onDialogMouseDown(e) }, this.changes && [
|
|
7769
|
+
hAsync("slot", { key: '76ec505a92d0a7c1ae0bbb5f4cac63555f3416be', slot: "header" }),
|
|
7770
|
+
((_f = (_e = this.changes).extraContent) === null || _f === void 0 ? void 0 : _f.call(_e, this.changes)) || '',
|
|
7771
|
+
((_g = this.changes) === null || _g === void 0 ? void 0 : _g.hideDefaultFilters) !== true && [
|
|
7772
|
+
hAsync("label", { key: 'c6fd82c95f6005f286c7bc90de34956128a83246' }, capts.title),
|
|
7773
|
+
hAsync("div", { key: '5e7dac36ad79ba1b6072a0053b30aa384ade0dde', class: "filter-holder" }, this.getFilterItemsList()),
|
|
7774
|
+
hAsync("div", { key: 'd9b6103edbd138d4db845745686ee4c847310a66', class: "add-filter" }, hAsync("select", { key: 'c1b321f2d19458f95ab3f9188d83d94bebdb688e', id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))),
|
|
7775
|
+
],
|
|
7776
|
+
hAsync("slot", { key: '1571dcbc5c57651deb42a4046272ff60fa74f5a7' }),
|
|
7777
|
+
hAsync("div", { key: '4aa7dee532336b084542df0209291b4c60378b49', class: "filter-actions" }, this.disableDynamicFiltering && [
|
|
7778
|
+
hAsync("button", { key: '4c1b3054cd1bb7f46877592f00f6634d0f7ecafa', id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save),
|
|
7779
|
+
hAsync("button", { key: 'f31a568c89be18b1a854cdd7d4726e01db24e338', id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.cancel),
|
|
7780
|
+
], !this.disableDynamicFiltering && [
|
|
7781
|
+
hAsync("button", { key: '5d40e8b1f13f94cff4f5a2e2aefeee8861104a9d', id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, capts.ok),
|
|
7782
|
+
hAsync("button", { key: '67eac3abd16f6f6e2ed7089dcfb0d05524ddb7df', id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, capts.reset),
|
|
7783
|
+
]),
|
|
7784
|
+
hAsync("slot", { key: 'b27a9bb3ef814e1e09dca14eda3e332ff34c654c', slot: "footer" }),
|
|
7785
|
+
])));
|
|
7851
7786
|
}
|
|
7852
7787
|
get element() { return getElement(this); }
|
|
7853
7788
|
static get style() { return filterStyleCss(); }
|
|
@@ -7866,8 +7801,6 @@ class FilterPanel {
|
|
|
7866
7801
|
"currentFilterType": [32],
|
|
7867
7802
|
"changes": [32],
|
|
7868
7803
|
"filterItems": [32],
|
|
7869
|
-
"draggedFilterId": [32],
|
|
7870
|
-
"dragOverFilterId": [32],
|
|
7871
7804
|
"show": [64],
|
|
7872
7805
|
"getChanges": [64]
|
|
7873
7806
|
},
|
|
@@ -13149,82 +13082,43 @@ class ColumnService {
|
|
|
13149
13082
|
mapping,
|
|
13150
13083
|
};
|
|
13151
13084
|
}
|
|
13152
|
-
getTransformedDataToApply(
|
|
13085
|
+
getTransformedDataToApply(start, data) {
|
|
13153
13086
|
const changed = {};
|
|
13154
13087
|
const copyRowLength = data.length;
|
|
13155
|
-
if (!copyRowLength) {
|
|
13156
|
-
return {
|
|
13157
|
-
changed,
|
|
13158
|
-
range: null,
|
|
13159
|
-
};
|
|
13160
|
-
}
|
|
13161
13088
|
const colLength = this.columns.length;
|
|
13162
13089
|
const rowLength = this.dataStore.get('items').length;
|
|
13163
|
-
const bounds = this.getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength);
|
|
13164
|
-
if (!bounds) {
|
|
13165
|
-
return {
|
|
13166
|
-
changed,
|
|
13167
|
-
range: null,
|
|
13168
|
-
};
|
|
13169
|
-
}
|
|
13170
|
-
const { startRow, startCol, endRow } = bounds;
|
|
13171
|
-
let maxCol = startCol - 1;
|
|
13172
|
-
let lastRow = startRow - 1;
|
|
13173
13090
|
// rows
|
|
13174
|
-
|
|
13091
|
+
let rowIndex = start.y;
|
|
13092
|
+
let maxCol = 0;
|
|
13093
|
+
for (let i = 0; rowIndex < rowLength && i < copyRowLength; rowIndex++, i++) {
|
|
13175
13094
|
// copy original data link
|
|
13176
13095
|
const copyRow = data[i % copyRowLength];
|
|
13177
13096
|
const copyColLength = (copyRow === null || copyRow === void 0 ? void 0 : copyRow.length) || 0;
|
|
13178
|
-
|
|
13179
|
-
|
|
13097
|
+
// columns
|
|
13098
|
+
let colIndex = start.x;
|
|
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
|
+
}
|
|
13180
13110
|
}
|
|
13181
|
-
maxCol = Math.max(maxCol,
|
|
13182
|
-
bounds,
|
|
13183
|
-
copyColLength,
|
|
13184
|
-
copyRow,
|
|
13185
|
-
rowIndex,
|
|
13186
|
-
start,
|
|
13187
|
-
targetRange,
|
|
13188
|
-
}));
|
|
13189
|
-
lastRow = rowIndex;
|
|
13111
|
+
maxCol = Math.max(maxCol, colIndex - 1);
|
|
13190
13112
|
}
|
|
13113
|
+
const range = getRange(start, {
|
|
13114
|
+
y: rowIndex - 1,
|
|
13115
|
+
x: maxCol,
|
|
13116
|
+
});
|
|
13191
13117
|
return {
|
|
13192
13118
|
changed,
|
|
13193
|
-
range
|
|
13119
|
+
range,
|
|
13194
13120
|
};
|
|
13195
13121
|
}
|
|
13196
|
-
getDataApplyBounds(start, targetRange, copyRowLength, rowLength, colLength) {
|
|
13197
|
-
var _a, _b, _c;
|
|
13198
|
-
const startRow = (_a = targetRange === null || targetRange === void 0 ? void 0 : targetRange.y) !== null && _a !== void 0 ? _a : start.y;
|
|
13199
|
-
const startCol = (_b = targetRange === null || targetRange === void 0 ? void 0 : targetRange.x) !== null && _b !== void 0 ? _b : start.x;
|
|
13200
|
-
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);
|
|
13201
|
-
if (endRow < startRow || startCol >= colLength) {
|
|
13202
|
-
return null;
|
|
13203
|
-
}
|
|
13204
|
-
return { startRow, startCol, endRow, colLength };
|
|
13205
|
-
}
|
|
13206
|
-
applyClipboardRow(changed, { bounds, copyColLength, copyRow, rowIndex, start, targetRange, }) {
|
|
13207
|
-
var _a;
|
|
13208
|
-
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);
|
|
13209
|
-
for (let colIndex = bounds.startCol, j = 0; colIndex <= endCol; colIndex++, j++) {
|
|
13210
|
-
if (this.isReadOnly(rowIndex, colIndex)) {
|
|
13211
|
-
continue;
|
|
13212
|
-
}
|
|
13213
|
-
const prop = this.columns[colIndex].prop;
|
|
13214
|
-
changed[rowIndex] = changed[rowIndex] || {};
|
|
13215
|
-
changed[rowIndex][prop] = copyRow[j % copyColLength];
|
|
13216
|
-
}
|
|
13217
|
-
return endCol;
|
|
13218
|
-
}
|
|
13219
|
-
getAppliedRange({ startRow, startCol }, lastRow, maxCol) {
|
|
13220
|
-
if (lastRow < startRow || maxCol < startCol) {
|
|
13221
|
-
return null;
|
|
13222
|
-
}
|
|
13223
|
-
return getRange({ x: startCol, y: startRow }, {
|
|
13224
|
-
y: lastRow,
|
|
13225
|
-
x: maxCol,
|
|
13226
|
-
});
|
|
13227
|
-
}
|
|
13228
13122
|
getRangeStaticData(d, value) {
|
|
13229
13123
|
const changed = {};
|
|
13230
13124
|
// rows
|
|
@@ -13891,30 +13785,6 @@ class AutoFillService {
|
|
|
13891
13785
|
}
|
|
13892
13786
|
}
|
|
13893
13787
|
|
|
13894
|
-
function getRangeFillClipboardData(data, useClipboard) {
|
|
13895
|
-
var _a;
|
|
13896
|
-
if (!isClipboardRangeFillEnabled(useClipboard)) {
|
|
13897
|
-
return null;
|
|
13898
|
-
}
|
|
13899
|
-
const normalized = trimTrailingEmptyClipboardRows(data);
|
|
13900
|
-
return normalized.length === 1 && ((_a = normalized[0]) === null || _a === void 0 ? void 0 : _a.length) === 1
|
|
13901
|
-
? normalized
|
|
13902
|
-
: null;
|
|
13903
|
-
}
|
|
13904
|
-
function isClipboardRangeFillEnabled(useClipboard) {
|
|
13905
|
-
return (typeof useClipboard === 'object' && useClipboard.rangeFill === true);
|
|
13906
|
-
}
|
|
13907
|
-
function trimTrailingEmptyClipboardRows(data) {
|
|
13908
|
-
const rows = [...data];
|
|
13909
|
-
while (rows.length > 1 && isEmptyClipboardRow(rows[rows.length - 1])) {
|
|
13910
|
-
rows.pop();
|
|
13911
|
-
}
|
|
13912
|
-
return rows;
|
|
13913
|
-
}
|
|
13914
|
-
function isEmptyClipboardRow(row) {
|
|
13915
|
-
return !row || row.every(cell => cell === '');
|
|
13916
|
-
}
|
|
13917
|
-
|
|
13918
13788
|
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}`;
|
|
13919
13789
|
|
|
13920
13790
|
/**
|
|
@@ -14165,9 +14035,9 @@ class OverlaySelection {
|
|
|
14165
14035
|
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) }));
|
|
14166
14036
|
}
|
|
14167
14037
|
}
|
|
14168
|
-
return (hAsync(Host, { key: '
|
|
14038
|
+
return (hAsync(Host, { key: 'd936e8452e84c7a25ecd6502e929f1a5af69467f', 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),
|
|
14169
14039
|
// it's done to be able to throw events from different levels, not just from editor
|
|
14170
|
-
onCelledit: (e) => this.onEditCell(e) }, nodes, hAsync("slot", { key: '
|
|
14040
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, hAsync("slot", { key: 'cd3525d404aa44fd8d06e7fc459777acb8a9d585', name: "data" })));
|
|
14171
14041
|
}
|
|
14172
14042
|
/**
|
|
14173
14043
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -14332,25 +14202,13 @@ class OverlaySelection {
|
|
|
14332
14202
|
if (!focus || isEditing) {
|
|
14333
14203
|
return;
|
|
14334
14204
|
}
|
|
14335
|
-
|
|
14336
|
-
const targetRange = rangeFillData
|
|
14337
|
-
? this.getClipboardPasteTargetRange()
|
|
14338
|
-
: null;
|
|
14339
|
-
let { changed, range } = this.columnService.getTransformedDataToApply({
|
|
14340
|
-
start: focus,
|
|
14341
|
-
data: rangeFillData || data,
|
|
14342
|
-
targetRange,
|
|
14343
|
-
});
|
|
14205
|
+
let { changed, range } = this.columnService.getTransformedDataToApply(focus, data);
|
|
14344
14206
|
const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, models: collectModelsOfRange(changed, this.dataStore), range }, this.types));
|
|
14345
14207
|
if (canPaste) {
|
|
14346
14208
|
return;
|
|
14347
14209
|
}
|
|
14348
14210
|
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range, range);
|
|
14349
14211
|
}
|
|
14350
|
-
getClipboardPasteTargetRange() {
|
|
14351
|
-
const range = this.selectionStore.get('range');
|
|
14352
|
-
return range && !isRangeSingleCell(range) ? range : null;
|
|
14353
|
-
}
|
|
14354
14212
|
async focusNext() {
|
|
14355
14213
|
var _a;
|
|
14356
14214
|
const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
|
|
@@ -15882,7 +15740,8 @@ class FilterPlugin extends BasePlugin {
|
|
|
15882
15740
|
async headerclick(e) {
|
|
15883
15741
|
var _a, _b;
|
|
15884
15742
|
const el = (_a = e.detail.originalEvent) === null || _a === void 0 ? void 0 : _a.target;
|
|
15885
|
-
|
|
15743
|
+
const filterButton = isFilterBtn(el);
|
|
15744
|
+
if (!filterButton) {
|
|
15886
15745
|
return;
|
|
15887
15746
|
}
|
|
15888
15747
|
e.preventDefault();
|
|
@@ -15896,9 +15755,8 @@ class FilterPlugin extends BasePlugin {
|
|
|
15896
15755
|
return;
|
|
15897
15756
|
}
|
|
15898
15757
|
// filter button clicked, open filter dialog
|
|
15899
|
-
const
|
|
15900
|
-
const
|
|
15901
|
-
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 });
|
|
15758
|
+
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 });
|
|
15902
15760
|
(_b = this.beforeshow) === null || _b === void 0 ? void 0 : _b.call(this, data);
|
|
15903
15761
|
this.pop.show(data);
|
|
15904
15762
|
}
|
|
@@ -17156,22 +17014,9 @@ function filterOutEmptyGroupRows(source, filterTrimmed) {
|
|
|
17156
17014
|
return trimmed;
|
|
17157
17015
|
}
|
|
17158
17016
|
|
|
17159
|
-
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
17160
|
-
var t = {};
|
|
17161
|
-
for (var p in s)
|
|
17162
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17163
|
-
t[p] = s[p];
|
|
17164
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17165
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17166
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17167
|
-
t[p[i]] = s[p[i]];
|
|
17168
|
-
}
|
|
17169
|
-
return t;
|
|
17170
|
-
};
|
|
17171
17017
|
const PADDING_DEPTH = 10;
|
|
17172
|
-
const RowRenderer = (
|
|
17173
|
-
|
|
17174
|
-
const props = Object.assign(Object.assign(Object.assign({}, attrs), { [DATA_ROW]: index }), (typeof groupingLevel === 'number'
|
|
17018
|
+
const RowRenderer = ({ rowClass, index, size, start, depth, groupingLevel }, cells) => {
|
|
17019
|
+
const props = Object.assign({ [DATA_ROW]: index }, (typeof groupingLevel === 'number'
|
|
17175
17020
|
? { 'data-level': groupingLevel }
|
|
17176
17021
|
: {}));
|
|
17177
17022
|
return (hAsync("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
|
|
@@ -17198,17 +17043,12 @@ const GroupingRowRenderer = (props) => {
|
|
|
17198
17043
|
const name = model[PSEUDO_GROUP_ITEM];
|
|
17199
17044
|
const expanded = model[GROUP_EXPANDED];
|
|
17200
17045
|
const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
|
|
17201
|
-
const groupRowAttrs = {
|
|
17202
|
-
rowClass: 'groupingRow',
|
|
17203
|
-
depth,
|
|
17204
|
-
expanded,
|
|
17205
|
-
};
|
|
17206
17046
|
if (groupingCustomRenderer) {
|
|
17207
|
-
return (hAsync(RowRenderer, Object.assign({}, props,
|
|
17047
|
+
return (hAsync(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }), hAsync("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(hAsync, Object.assign(Object.assign({}, props), { colType: props.providers.colType, name,
|
|
17208
17048
|
expanded,
|
|
17209
17049
|
depth })))));
|
|
17210
17050
|
}
|
|
17211
|
-
return (hAsync(RowRenderer, Object.assign({}, props,
|
|
17051
|
+
return (hAsync(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }), hasExpand && [
|
|
17212
17052
|
hAsync("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)),
|
|
17213
17053
|
name,
|
|
17214
17054
|
]));
|
|
@@ -18681,17 +18521,8 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18681
18521
|
constructor(revogrid, providers) {
|
|
18682
18522
|
super(revogrid, providers);
|
|
18683
18523
|
this.moveFunc = debounce$1((e) => this.doMove(e), 5);
|
|
18684
|
-
this.preventHeaderClickAfterDrag = (event) => {
|
|
18685
|
-
if (!this.preventNextHeaderClick) {
|
|
18686
|
-
return;
|
|
18687
|
-
}
|
|
18688
|
-
this.preventNextHeaderClick = false;
|
|
18689
|
-
event.preventDefault();
|
|
18690
|
-
};
|
|
18691
18524
|
this.staticDragData = null;
|
|
18692
18525
|
this.dragData = null;
|
|
18693
|
-
this.columnDragMoved = false;
|
|
18694
|
-
this.preventNextHeaderClick = false;
|
|
18695
18526
|
this.localSubscriptions = {};
|
|
18696
18527
|
this.orderUi = new ColumnOrderHandler();
|
|
18697
18528
|
revogrid.appendChild(this.orderUi.render());
|
|
@@ -18710,13 +18541,11 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18710
18541
|
callback: (e) => this.move(e),
|
|
18711
18542
|
};
|
|
18712
18543
|
this.addEventListener(COLUMN_CLICK, ({ detail }) => this.dragStart(detail));
|
|
18713
|
-
this.revogrid.addEventListener('beforeheaderclick', this.preventHeaderClickAfterDrag, { capture: true });
|
|
18714
18544
|
}
|
|
18715
18545
|
dragStart({ event, data }) {
|
|
18716
18546
|
if (event.defaultPrevented) {
|
|
18717
18547
|
return;
|
|
18718
18548
|
}
|
|
18719
|
-
this.preventNextHeaderClick = false;
|
|
18720
18549
|
const { defaultPrevented } = dispatch(this.revogrid, COLUMN_DRAG_START_EVENT, data);
|
|
18721
18550
|
// check if allowed to drag particulat column
|
|
18722
18551
|
if (defaultPrevented) {
|
|
@@ -18738,8 +18567,7 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18738
18567
|
const cols = this.getDimension(data.pin || 'rgCol');
|
|
18739
18568
|
const gridRect = this.revogrid.getBoundingClientRect();
|
|
18740
18569
|
const elRect = dataEl.getBoundingClientRect();
|
|
18741
|
-
const startItem = getItemByPosition(cols, getLeftRelative(event.x, gridRect.left, elRect.left - gridRect.left) +
|
|
18742
|
-
(cols.renderOffset || 0));
|
|
18570
|
+
const startItem = getItemByPosition(cols, getLeftRelative(event.x, gridRect.left, elRect.left - gridRect.left) + (cols.renderOffset || 0));
|
|
18743
18571
|
this.staticDragData = {
|
|
18744
18572
|
startPos: event.x,
|
|
18745
18573
|
startItem,
|
|
@@ -18770,14 +18598,10 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18770
18598
|
if (rgCol.itemIndex >= this.staticDragData.cols.count) {
|
|
18771
18599
|
return;
|
|
18772
18600
|
}
|
|
18773
|
-
this.orderUi.showHandler(
|
|
18601
|
+
this.orderUi.showHandler(rgCol.end - (this.staticDragData.cols.renderOffset || 0) + dragData.scrollOffset, dragData.gridRect.width);
|
|
18774
18602
|
}
|
|
18775
18603
|
}
|
|
18776
18604
|
move(e) {
|
|
18777
|
-
if (this.staticDragData &&
|
|
18778
|
-
Math.abs(this.staticDragData.startPos - e.x) > 10) {
|
|
18779
|
-
this.columnDragMoved = true;
|
|
18780
|
-
}
|
|
18781
18605
|
dispatch(this.revogrid, COLUMN_DRAG_MOVE_EVENT, e);
|
|
18782
18606
|
// then do move
|
|
18783
18607
|
this.moveFunc(e);
|
|
@@ -18786,7 +18610,6 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18786
18610
|
this.clearOrder();
|
|
18787
18611
|
}
|
|
18788
18612
|
onMouseUp(e) {
|
|
18789
|
-
const suppressClick = this.columnDragMoved;
|
|
18790
18613
|
// apply new positions
|
|
18791
18614
|
if (this.dragData && this.staticDragData) {
|
|
18792
18615
|
let relativePos = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
|
|
@@ -18809,9 +18632,6 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18809
18632
|
}
|
|
18810
18633
|
dispatch(this.revogrid, COLUMN_DRAG_END_EVENT, this.getData(this.staticDragData, newItems, source));
|
|
18811
18634
|
}
|
|
18812
|
-
if (suppressClick) {
|
|
18813
|
-
this.preventNextHeaderClick = !!e.target.closest('revogr-header');
|
|
18814
|
-
}
|
|
18815
18635
|
this.clearOrder();
|
|
18816
18636
|
}
|
|
18817
18637
|
clearLocalSubscriptions() {
|
|
@@ -18820,7 +18640,6 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18820
18640
|
clearOrder() {
|
|
18821
18641
|
this.staticDragData = null;
|
|
18822
18642
|
this.dragData = null;
|
|
18823
|
-
this.columnDragMoved = false;
|
|
18824
18643
|
this.clearLocalSubscriptions();
|
|
18825
18644
|
this.orderUi.stop(this.revogrid);
|
|
18826
18645
|
}
|
|
@@ -18830,7 +18649,6 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18830
18649
|
clearSubscriptions() {
|
|
18831
18650
|
super.clearSubscriptions();
|
|
18832
18651
|
this.clearLocalSubscriptions();
|
|
18833
|
-
this.revogrid.removeEventListener('beforeheaderclick', this.preventHeaderClickAfterDrag, { capture: true });
|
|
18834
18652
|
}
|
|
18835
18653
|
getData({ gridEl, dataEl, pin }, order, source = []) {
|
|
18836
18654
|
const gridRect = gridEl.getBoundingClientRect();
|
|
@@ -18852,12 +18670,6 @@ class ColumnMovePlugin extends BasePlugin {
|
|
|
18852
18670
|
function getLeftRelative(absoluteX, gridPos, offset) {
|
|
18853
18671
|
return absoluteX - gridPos - offset;
|
|
18854
18672
|
}
|
|
18855
|
-
function getColumnDragPosition(targetItem, startItem, renderOffset, scrollOffset) {
|
|
18856
|
-
const insertionEdge = startItem.itemIndex > targetItem.itemIndex
|
|
18857
|
-
? targetItem.start
|
|
18858
|
-
: targetItem.end;
|
|
18859
|
-
return insertionEdge - renderOffset + scrollOffset;
|
|
18860
|
-
}
|
|
18861
18673
|
|
|
18862
18674
|
function isMobileDevice() {
|
|
18863
18675
|
return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;
|
|
@@ -19207,7 +19019,7 @@ class RevoGridComponent {
|
|
|
19207
19019
|
this.rowSize = 0;
|
|
19208
19020
|
/** Indicates default column size. */
|
|
19209
19021
|
this.colSize = 100;
|
|
19210
|
-
/** When true, user can
|
|
19022
|
+
/** When true, user can range selection. */
|
|
19211
19023
|
this.range = false;
|
|
19212
19024
|
/** When true, grid in read only mode. */
|
|
19213
19025
|
this.readonly = false;
|
|
@@ -19219,7 +19031,7 @@ class RevoGridComponent {
|
|
|
19219
19031
|
this.noHorizontalScrollTransfer = false;
|
|
19220
19032
|
/** When true cell focus appear. */
|
|
19221
19033
|
this.canFocus = true;
|
|
19222
|
-
/** When true enable clipboard.
|
|
19034
|
+
/** When true enable clipboard. */
|
|
19223
19035
|
this.useClipboard = true;
|
|
19224
19036
|
/**
|
|
19225
19037
|
* Columns - defines an array of grid columns.
|
|
@@ -22075,17 +21887,9 @@ class RevogrViewportScroll {
|
|
|
22075
21887
|
}
|
|
22076
21888
|
render() {
|
|
22077
21889
|
var _a, _b;
|
|
22078
|
-
const
|
|
22079
|
-
// When content fits in the viewport (no scroll needed), don't inflate content-wrapper
|
|
22080
|
-
// to clientHeight — that would prevent inner-content-table from shrinking and push
|
|
22081
|
-
// rowPinEnd (footer) to the bottom instead of letting it follow the data rows.
|
|
22082
|
-
// For large/compressed grids (content > clientHeight), physicalContentHeight handles
|
|
22083
|
-
// the browser scroll-size compression correctly.
|
|
22084
|
-
const physicalContentHeight = this.contentHeight < clientHeight
|
|
22085
|
-
? Math.max(this.contentHeight, 0)
|
|
22086
|
-
: getContentSize(this.contentHeight, clientHeight);
|
|
21890
|
+
const physicalContentHeight = getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
|
|
22087
21891
|
const physicalContentWidth = getContentSize(this.contentWidth, 0);
|
|
22088
|
-
return (hAsync(Host, { key: '
|
|
21892
|
+
return (hAsync(Host, { key: 'ec8d907976c1d50f7aab3c263be3f0249a274df6', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: 'e35696a7993ac94261426b45c28d488cdc42b7f0', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, hAsync("div", { key: 'a6997451e01eacda1d27d4efa1d74e1748626218', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: '1d401e87d32d5b1531c2211723b552bbc894f22c', name: HEADER_SLOT })), hAsync("div", { key: 'ceab6f9e812d6ca9a0aa376afcd2562a17f505e0', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: 'a9556578a23d6efddec2e982e863aec064042154', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, hAsync("slot", { key: '0ae01f9736b9740612e75261f6e3abebda533377', name: CONTENT_SLOT }))), hAsync("div", { key: '09c2565d4ed449a43820f92d97b6558fca3758e7', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: '1ffb08ff8138a560cc09d82e3fe22a53e502aafe', name: FOOTER_SLOT })))));
|
|
22089
21893
|
}
|
|
22090
21894
|
/**
|
|
22091
21895
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|