@endge/ui-vue 0.25.2 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{edit.utils-3ZbhQCv_-CBOvR_lX.js → edit.utils-Dnnbd0xG-B4Hy-fKi.js} +1 -1
  2. package/dist/{main-DaAnRozo.js → main-jn_O1Op8.js} +18892 -19557
  3. package/dist/main.d.ts +20 -18
  4. package/dist/{domain/core → model/kernel}/endge-vue.d.ts +1 -1
  5. package/dist/model/render/register-vue-ui-renderer.d.ts +7 -0
  6. package/dist/model/render/sfc/SFCVueRenderInspection.d.ts +1 -1
  7. package/dist/model/render/sfc/SFCVueRuntimeBridge.d.ts +1 -1
  8. package/dist/model/render/sfc/native-vue-sfc-adapter.d.ts +1 -1
  9. package/dist/{domain/types/sfc-render.type.d.ts → model/render/sfc/sfc-vue-render.type.d.ts} +9 -9
  10. package/dist/reactive/use-subscribable-ref.d.ts +9 -0
  11. package/dist/revo-grid.entry-rg6K9ZHx.js +1615 -0
  12. package/dist/{revogr-attribution_7.entry-BT5lTuRW.js → revogr-attribution_7.entry-JV2go8j1.js} +102 -122
  13. package/dist/{revogr-clipboard_3.entry-C-dE9MUm.js → revogr-clipboard_3.entry-Bm3dUuH5.js} +9 -9
  14. package/dist/{revogr-data_4.entry-C9qNfzLe.js → revogr-data_4.entry-BIPbaA6y.js} +177 -231
  15. package/dist/revogr-filter-panel.entry-CxOW5xLi.js +329 -0
  16. package/dist/store/domain.d.ts +35 -0
  17. package/dist/test/model/render/register-vue-ui-renderer.test.d.ts +1 -0
  18. package/dist/test/reactive/use-subscribable-ref.test.d.ts +1 -0
  19. package/dist/throttle-Cpk1LoGk-DEv3RB-T.js +183 -0
  20. package/dist/ui/filter/EndgeFilterControlRenderer.d.ts +1 -1
  21. package/dist/ui/render/sfc/SFCRender_Adapter.d.ts +1 -1
  22. package/dist/ui/render/sfc/SFCRender_Badge.d.ts +1 -1
  23. package/dist/ui/render/sfc/SFCRender_Base.d.ts +2 -2
  24. package/dist/ui/render/sfc/SFCRender_Box.d.ts +1 -1
  25. package/dist/ui/render/sfc/SFCRender_Checkbox.d.ts +1 -1
  26. package/dist/ui/render/sfc/SFCRender_Component.d.ts +1 -1
  27. package/dist/ui/render/sfc/SFCRender_Context.d.ts +1 -1
  28. package/dist/ui/render/sfc/SFCRender_DateTime.d.ts +1 -1
  29. package/dist/ui/render/sfc/SFCRender_Divider.d.ts +1 -1
  30. package/dist/ui/render/sfc/SFCRender_Dot.d.ts +1 -1
  31. package/dist/ui/render/sfc/SFCRender_Editable.d.ts +1 -1
  32. package/dist/ui/render/sfc/SFCRender_Evaluator.d.ts +1 -1
  33. package/dist/ui/render/sfc/SFCRender_Flex.d.ts +1 -1
  34. package/dist/ui/render/sfc/SFCRender_Grid.d.ts +1 -1
  35. package/dist/ui/render/sfc/SFCRender_Icon.d.ts +1 -1
  36. package/dist/ui/render/sfc/SFCRender_Input.d.ts +1 -1
  37. package/dist/ui/render/sfc/SFCRender_Interaction.d.ts +2 -2
  38. package/dist/ui/render/sfc/SFCRender_Node.d.ts +1 -1
  39. package/dist/ui/render/sfc/SFCRender_Number.d.ts +1 -1
  40. package/dist/ui/render/sfc/SFCRender_Select.d.ts +1 -1
  41. package/dist/ui/render/sfc/SFCRender_Table.d.ts +1 -1
  42. package/dist/ui/render/sfc/SFCRender_TableMenu.d.ts +1 -1
  43. package/dist/ui/render/sfc/SFCRender_TableStyle.d.ts +3 -3
  44. package/dist/ui/render/sfc/SFCRender_Text.d.ts +1 -1
  45. package/dist/ui/render/sfc/SFCRender_Textarea.d.ts +1 -1
  46. package/dist/ui/render/sfc/SFCRender_Tooltip.d.ts +1 -1
  47. package/dist/ui/render/sfc/SFC_Renderer.vue.d.ts +1 -1
  48. package/dist/ui/render/sfc/SFC_RuntimeRenderer.vue.d.ts +1 -1
  49. package/dist/vue.css +1 -1
  50. package/dist/vue.js +39 -36
  51. package/package.json +24 -25
  52. package/dist/revo-grid.entry-raK8rO6x.js +0 -1793
  53. package/dist/revogr-filter-panel.entry-Belk-lw4.js +0 -335
  54. package/dist/throttle-3rhqdcLy-E1CC2r0m.js +0 -183
  55. package/dist/ui/render/entities/EndgePage.vue.d.ts +0 -1187
@@ -1,335 +0,0 @@
1
- import { r as F, c as v, m as I, h as o, L as w, M as C, T as D, N as k, H as O, f as E } from "./main-DaAnRozo.js";
2
- /*!
3
- * Built by Revolist OU ❤️
4
- */
5
- (function() {
6
- Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector), Element.prototype.closest || (Element.prototype.closest = function(i) {
7
- let t = this;
8
- do {
9
- if (Element.prototype.matches.call(t, i))
10
- return t;
11
- t = t.parentElement || t.parentNode;
12
- } while (t !== null && t.nodeType === 1);
13
- return null;
14
- });
15
- })();
16
- const y = "text/revogrid-filter-id";
17
- function S(e, i) {
18
- e && (e.effectAllowed = "move", e.setData(y, String(i)), e.setData("text/plain", String(i)));
19
- }
20
- function A(e) {
21
- if (!e)
22
- return;
23
- const t = (e.getData(y) || e.getData("text/plain")).trim();
24
- if (!t)
25
- return;
26
- const r = Number(t);
27
- return Number.isFinite(r) ? r : void 0;
28
- }
29
- function b(e, i, t) {
30
- if (i === t)
31
- return !1;
32
- const r = e.findIndex((n) => n.id === i), s = e.findIndex((n) => n.id === t);
33
- if (r === -1 || s === -1 || r === s)
34
- return !1;
35
- const a = e.map((n) => {
36
- var d;
37
- return (d = n.relation) !== null && d !== void 0 ? d : "and";
38
- }), [l] = e.splice(r, 1);
39
- return e.splice(s, 0, l), e.forEach((n, d) => {
40
- var c;
41
- n.relation = d === e.length - 1 ? "and" : (c = a[d]) !== null && c !== void 0 ? c : "and";
42
- }), !0;
43
- }
44
- const T = () => '.revo-button{position:relative;overflow:hidden;color:var(--rg-theme-button-text);background-color:var(--rg-theme-button-bg);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:var(--rg-theme-button-success-bg)}.revo-button.red{background-color:var(--rg-theme-button-danger-bg)}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid var(--rg-theme-button-outline-border);line-height:30px;background:none;color:var(--rg-theme-button-outline-text);box-shadow:none}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;color:var(--rg-theme-filter-panel-text);background-color:var(--rg-theme-filter-panel-bg);border:1px solid var(--rg-theme-filter-panel-border);transform-origin:62px 0px;box-shadow:0 5px 18px -2px var(--rg-theme-filter-panel-shadow);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;color:var(--rg-theme-filter-panel-text);background:var(--rg-theme-filter-panel-input-bg);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(--rg-theme-filter-panel-bg);border-top:1px solid var(--rg-theme-filter-panel-divider)}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;position:relative;z-index:1}.rgHeaderCell .rv-filter.active{color:var(--rg-theme-filter-panel-icon-active)}.rgHeaderCell .rv-filter .filter-img{color:var(--rg-theme-filter-panel-icon);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;color:var(--rg-theme-filter-panel-text);border:1px solid var(--rg-theme-filter-panel-select-border);box-shadow:transparent;border-radius:0.5em;appearance:none;background-color:var(--rg-theme-filter-panel-input-bg);background-image:var(--revo-grid-filter-panel-select-arrow, 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{}.select-css:hover{border-color:var(--rg-theme-filter-panel-select-border)}.select-css{}.select-css:focus{border-color:var(--rg-theme-filter-panel-select-border-hover);box-shadow:var(--rg-theme-filter-panel-focus-ring);outline:none}.select-css{}.select-css option{font-weight:normal}.select-css{}.select-css:disabled,.select-css[aria-disabled=true]{color:var(--rg-theme-filter-panel-muted-text);background-image:var(--revo-grid-filter-panel-select-arrow-disabled, 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"))}.select-css:disabled:hover,.select-css[aria-disabled=true]{border-color:var(--rg-theme-filter-panel-select-border)}.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(--rg-theme-filter-panel-reorder-accent);border-radius:999px;box-shadow:0 0 0 2px var(--rg-theme-filter-panel-bg)}.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(--rg-theme-filter-panel-reorder-color);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(--rg-theme-filter-panel-reorder-accent)}.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(--rg-theme-filter-panel-divider);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}', p = "none", _ = "multi-filter-list", R = "multi-filter-list-action", x = "add-filter", u = 8, L = class {
45
- constructor(e) {
46
- F(this, e), this.filterChange = v(this, "filterChange", 7), this.resetChange = v(this, "resetChange", 7), this.filterCaptionsInternal = {
47
- title: "Filter by",
48
- ok: "Close",
49
- save: "Save",
50
- // drops the filter
51
- reset: "Reset",
52
- cancel: "Cancel",
53
- add: "Add condition",
54
- placeholder: "Enter value...",
55
- and: "and",
56
- or: "or",
57
- filterCondition: "Filter condition",
58
- removeFilter: "Remove filter",
59
- reorderFilter: "Reorder filter"
60
- }, this.isFilterIdSet = !1, this.filterId = 0, this.currentFilterId = -1, this.currentFilterType = p, this.filterItems = {}, this.filterNames = {}, this.filterEntities = {}, this.disableDynamicFiltering = !1, this.closeOnOutsideClick = !0, this.allowDuplicateOperators = !0, this.debouncedApplyFilter = I(() => {
61
- this.filterChange.emit(this.filterItems);
62
- }, 400);
63
- }
64
- onMouseDown(e) {
65
- if (!this.changes)
66
- return;
67
- const i = e.composedPath(), t = this.getAddFilterSelect();
68
- if (t instanceof HTMLSelectElement) {
69
- if (i.includes(t))
70
- return;
71
- t.value = p;
72
- }
73
- this.currentFilterType = p, this.changes && (this.changes.type = p), this.currentFilterId = -1, !i.includes(this.element) && !this.isOwnFilterButton(e.target) && this.closeOnOutsideClick && (this.changes = void 0);
74
- }
75
- async show(e) {
76
- this.changes = e, this.filterItems = (e == null ? void 0 : e.filterItems) || {}, this.changes && (this.changes.type = this.changes.type || p);
77
- }
78
- async getChanges() {
79
- return this.changes;
80
- }
81
- componentWillRender() {
82
- if (!this.isFilterIdSet) {
83
- this.isFilterIdSet = !0;
84
- const e = Object.keys(this.filterItems);
85
- for (const i of e)
86
- this.filterId += this.filterItems[i].length;
87
- }
88
- }
89
- getFilterItemsList() {
90
- var e, i;
91
- const t = (e = this.changes) === null || e === void 0 ? void 0 : e.prop;
92
- if (t === void 0)
93
- return "";
94
- const r = (i = this.filterItems[t]) !== null && i !== void 0 ? i : [], s = r.filter((l) => !l.hidden).length, a = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
95
- return o("div", { key: this.filterId }, o("ul", { class: "multi-filter-list-container" }, r.map((l, n) => {
96
- let d;
97
- if (l.hidden)
98
- return;
99
- n !== this.filterItems[t].length - 1 && (d = o(w, { text: l.relation === "and" ? a.and : a.or, onClick: () => this.toggleFilterAndOr(l.id) }));
100
- const c = this.renderExtra(t, n), h = this.draggedFilterId === l.id, g = this.dragOverFilterId === l.id && !h, m = s > 1;
101
- return o("li", { key: l.id, class: _, "aria-label": `${a.filterCondition} ${n + 1}` }, o("div", { class: {
102
- "multi-filter-list-row": !0,
103
- "filter-row-drop-active": this.draggedFilterId !== void 0 && !h,
104
- "filter-row-dragging": h,
105
- "filter-row-drag-over": g
106
- } }, m ? o("button", { type: "button", class: "filter-row-drop-target", tabIndex: -1, "aria-label": `${a.filterCondition} ${n + 1}`, onDragOver: (f) => this.onFilterDragOver(f, l.id), onDragLeave: () => this.onFilterDragLeave(l.id), onDrop: (f) => this.onFilterDrop(f, t, l.id) }) : "", m ? o(C, { ariaLabel: a.reorderFilter, dragging: h, dragOver: g, onDragStart: (f) => this.onFilterDragStart(f, l.id), onDragEnd: () => this.onFilterDragEnd(), onKeyDown: (f) => this.onFilterReorderKeyDown(f, t, l.id) }) : "", o("div", { class: { "select-input": !0 } }, o("select", { class: "select-css select-filter", onChange: (f) => this.onFilterTypeChange(f, t, n) }, this.renderSelectOptions(this.filterItems[t][n].type, !0)), c ? o("div", { class: "filter-extra" }, c) : ""), o("div", { class: R }, d, o(D, { ariaLabel: a.removeFilter, onClick: () => this.onRemoveFilter(l.id) }))));
107
- })), r.some((l) => !l.hidden) ? o("div", { class: "add-filter-divider" }) : "");
108
- }
109
- componentDidRender() {
110
- this.syncDialog();
111
- }
112
- syncDialog() {
113
- if (this.dialog) {
114
- if (!this.changes) {
115
- this.dialog.open && this.dialog.close();
116
- return;
117
- }
118
- this.dialog.open || this.dialog.show(), this.changes.autoCorrect !== !1 && (this.autoCorrect(this.dialog), requestAnimationFrame(() => this.autoCorrect(this.dialog)));
119
- }
120
- }
121
- autoCorrect(e) {
122
- var i;
123
- if (!e || !this.changes)
124
- return;
125
- e.style.maxHeight = "", e.style.left = `${this.changes.x}px`, e.style.top = `${this.changes.y}px`;
126
- const t = e.getBoundingClientRect(), r = (i = this.changes.anchorY) !== null && i !== void 0 ? i : this.changes.y, s = this.changes.y, a = Math.max(0, r - u), l = Math.max(0, window.innerHeight - s - u), n = t.height > l && a > l, d = Math.max(u, n ? a : l);
127
- e.style.maxHeight = `${d}px`;
128
- const c = e.getBoundingClientRect(), h = Math.max(u, window.innerWidth - c.width - u), g = Math.max(u, window.innerHeight - c.height - u), m = Math.min(Math.max(u, this.changes.x), h), f = Math.min(n ? Math.max(u, r - c.height) : Math.max(u, s), g);
129
- e.style.left = `${m}px`, e.style.top = `${f}px`;
130
- }
131
- onFilterTypeChange(e, i, t) {
132
- e.target instanceof HTMLSelectElement && (this.filterItems[i][t].type = e.target.value, this.filterId++, setTimeout(() => {
133
- const r = document.getElementById("filter-input-" + this.filterItems[i][t].id);
134
- r instanceof HTMLInputElement && r.focus();
135
- }, 0), this.disableDynamicFiltering || this.debouncedApplyFilter());
136
- }
137
- onAddNewFilter(e) {
138
- const i = e.target;
139
- this.currentFilterType = i.value, this.addNewFilterToProp();
140
- const t = this.getAddFilterSelect();
141
- t && (t.value = p, this.currentFilterType = p), this.disableDynamicFiltering || this.debouncedApplyFilter();
142
- }
143
- addNewFilterToProp() {
144
- var e;
145
- const i = (e = this.changes) === null || e === void 0 ? void 0 : e.prop;
146
- (i || i === 0) && (this.filterItems[i] || (this.filterItems[i] = []), this.currentFilterType !== "none" && (this.filterId++, this.currentFilterId = this.filterId, this.filterItems[i].push({
147
- id: this.currentFilterId,
148
- type: this.currentFilterType,
149
- value: "",
150
- relation: "and"
151
- }), setTimeout(() => {
152
- const t = document.getElementById("filter-input-" + this.currentFilterId);
153
- t && t.focus();
154
- }, 0)));
155
- }
156
- onSave() {
157
- this.filterChange.emit(this.filterItems);
158
- }
159
- onCancel() {
160
- this.changes = void 0;
161
- }
162
- onReset() {
163
- var e;
164
- this.assertChanges(), this.resetChange.emit((e = this.changes) === null || e === void 0 ? void 0 : e.prop), this.filterId++;
165
- }
166
- onRemoveFilter(e) {
167
- var i;
168
- this.assertChanges(), this.filterId++;
169
- const t = (i = this.changes) === null || i === void 0 ? void 0 : i.prop, r = this.filterItems[t ?? ""];
170
- if (!r)
171
- return;
172
- const s = r.findIndex((a) => a.id === e);
173
- s !== -1 && (r.splice(s, 1), r.length === 0 && delete this.filterItems[t ?? ""], this.disableDynamicFiltering || this.debouncedApplyFilter());
174
- }
175
- onFilterDragStart(e, i) {
176
- this.draggedFilterId = i, S(e.dataTransfer, i);
177
- }
178
- onFilterDragOver(e, i) {
179
- this.draggedFilterId === void 0 || this.draggedFilterId === i || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this.dragOverFilterId = i);
180
- }
181
- onFilterDragLeave(e) {
182
- this.dragOverFilterId === e && (this.dragOverFilterId = void 0);
183
- }
184
- onFilterDrop(e, i, t) {
185
- var r;
186
- e.preventDefault();
187
- const s = (r = this.draggedFilterId) !== null && r !== void 0 ? r : A(e.dataTransfer);
188
- if (this.onFilterDragEnd(), s === void 0)
189
- return;
190
- const a = this.filterItems[i];
191
- a && b(a, s, t) && (this.filterId++, this.disableDynamicFiltering || this.debouncedApplyFilter());
192
- }
193
- onFilterDragEnd() {
194
- this.draggedFilterId = void 0, this.dragOverFilterId = void 0;
195
- }
196
- onFilterReorderKeyDown(e, i, t) {
197
- let r = 0;
198
- if (e.key === "ArrowUp")
199
- r = -1;
200
- else if (e.key === "ArrowDown")
201
- r = 1;
202
- else
203
- return;
204
- const s = this.filterItems[i];
205
- if (!s)
206
- return;
207
- const a = s.filter((d) => !d.hidden), l = a.findIndex((d) => d.id === t);
208
- if (l === -1)
209
- return;
210
- e.preventDefault(), e.stopPropagation();
211
- const n = a[l + r];
212
- !n || !b(s, t, n.id) || (this.filterId++, this.disableDynamicFiltering || this.debouncedApplyFilter());
213
- }
214
- toggleFilterAndOr(e) {
215
- var i;
216
- this.assertChanges(), this.filterId++;
217
- const t = (i = this.changes) === null || i === void 0 ? void 0 : i.prop, r = this.filterItems[t ?? ""];
218
- if (!r)
219
- return;
220
- const s = r.findIndex((a) => a.id === e);
221
- s !== -1 && (r[s].relation = r[s].relation === "and" ? "or" : "and", this.disableDynamicFiltering || this.debouncedApplyFilter());
222
- }
223
- assertChanges() {
224
- if (!this.changes)
225
- throw new Error("Changes required per edit");
226
- }
227
- renderSelectOptions(e, i = !1) {
228
- var t;
229
- if (!this.changes)
230
- return;
231
- const r = [], s = this.changes.prop;
232
- if (s === void 0)
233
- return;
234
- const a = /* @__PURE__ */ new Set();
235
- Object.keys(this.filterItems).forEach((n) => {
236
- this.filterItems[n].forEach((c) => {
237
- c.hidden && a.add(c.type);
238
- });
239
- });
240
- const l = new Set(((t = this.filterItems[s]) !== null && t !== void 0 ? t : []).filter((n) => !n.hidden).map((n) => n.type));
241
- if (!i) {
242
- const n = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
243
- r.push(o("option", { selected: this.currentFilterType === p, value: p }, s && this.filterItems[s] && this.filterItems[s].length > 0 ? n.add : this.filterNames[p]));
244
- }
245
- for (let n in this.changes.filterTypes) {
246
- const d = this.changes.filterTypes[n].filter((c) => !a.has(c) && (this.allowDuplicateOperators || !l.has(c) || i && e === c));
247
- d.length && (r.push(...d.map((c) => o("option", { value: c, selected: e === c }, this.filterNames[c]))), r.push(o("option", { disabled: !0 })));
248
- }
249
- return r;
250
- }
251
- renderExtra(e, i) {
252
- const t = this.filterItems[e];
253
- if (!t)
254
- return "";
255
- const r = (n) => {
256
- this.filterItems[e][i].value = n, this.disableDynamicFiltering || this.debouncedApplyFilter();
257
- }, s = () => {
258
- const n = this.getAddFilterSelect();
259
- n && (n.value = p, this.currentFilterType = p, this.addNewFilterToProp(), n.focus());
260
- }, a = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions), l = this.filterEntities[t[i].type].extra;
261
- return typeof l == "function" ? l(o, {
262
- value: t[i].value,
263
- filter: t[i],
264
- prop: e,
265
- index: i,
266
- placeholder: a.placeholder,
267
- onInput: (n) => {
268
- r(n);
269
- },
270
- onFocus: () => {
271
- s();
272
- }
273
- }) : l !== "input" && l !== "datepicker" ? "" : o("input", { id: `filter-input-${t[i].id}`, placeholder: a.placeholder, type: l === "datepicker" ? "date" : "text", value: t[i].value, onInput: (n) => {
274
- n.target instanceof HTMLInputElement && r(n.target.value);
275
- }, onKeyDown: (n) => {
276
- if (n.key.toLowerCase() === "enter") {
277
- this.getAddFilterSelect() && s();
278
- return;
279
- }
280
- n.stopPropagation();
281
- } });
282
- }
283
- getAddFilterSelect() {
284
- return this.element.querySelector(`#${x}`);
285
- }
286
- isOwnFilterButton(e) {
287
- if (!(e instanceof Element) || !k(e))
288
- return !1;
289
- const i = this.getOwningGrid(this.element), t = this.getOwningGrid(e);
290
- return !!i && i === t;
291
- }
292
- getOwningGrid(e) {
293
- const i = e.closest("revo-grid");
294
- if (i)
295
- return i;
296
- const t = e.getRootNode();
297
- if (t instanceof ShadowRoot && t.host.localName === "revo-grid")
298
- return t.host;
299
- }
300
- render() {
301
- var e, i, t, r, s, a, l, n, d;
302
- const c = {
303
- left: `${(i = (e = this.changes) === null || e === void 0 ? void 0 : e.x) !== null && i !== void 0 ? i : 0}px`,
304
- top: `${(r = (t = this.changes) === null || t === void 0 ? void 0 : t.y) !== null && r !== void 0 ? r : 0}px`
305
- }, h = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
306
- return o(O, { key: "d0e4ebb408750b11b3965da6a25e581733c968e3" }, o("dialog", { key: "3df36777c931ec1063e8574169ca880a99dbfe41", class: "filter-panel-dialog", style: c, ref: (g) => this.dialog = g, onCancel: (g) => {
307
- g.preventDefault(), this.onCancel();
308
- } }, this.changes && [
309
- o("slot", { key: "header-slot", slot: "header" }),
310
- ((a = (s = this.changes).extraContent) === null || a === void 0 ? void 0 : a.call(s, this.changes)) || "",
311
- ((l = this.changes) === null || l === void 0 ? void 0 : l.hideDefaultFilters) !== !0 && [
312
- o("label", { key: "filter-title" }, h.title),
313
- o("div", { key: "filter-holder", class: "filter-holder" }, this.getFilterItemsList()),
314
- o("div", { key: "add-filter", class: "add-filter" }, o("select", { key: "e2a8bd29f2090d3e6c933795427b71ca190b82aa", id: x, class: "select-css", onChange: (g) => this.onAddNewFilter(g) }, this.renderSelectOptions(this.currentFilterType)))
315
- ],
316
- o("slot", { key: "default-slot" }),
317
- ((d = (n = this.changes).extraBottomContent) === null || d === void 0 ? void 0 : d.call(n, this.changes)) || "",
318
- o("div", { key: "filter-actions", class: "filter-actions" }, this.disableDynamicFiltering && [
319
- o("button", { key: "save", type: "button", id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, h.save),
320
- o("button", { key: "cancel", type: "button", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, h.cancel)
321
- ], !this.disableDynamicFiltering && [
322
- o("button", { key: "ok", type: "button", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, h.ok),
323
- o("button", { key: "reset", type: "button", id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, h.reset)
324
- ]),
325
- o("slot", { key: "footer-slot", slot: "footer" })
326
- ]));
327
- }
328
- get element() {
329
- return E(this);
330
- }
331
- };
332
- L.style = T();
333
- export {
334
- L as revogr_filter_panel
335
- };
@@ -1,183 +0,0 @@
1
- import { g as h } from "./viewport.helpers-CoCAvmZs-f555rwPU.js";
2
- import { ax as d, m } from "./main-DaAnRozo.js";
3
- /*!
4
- * Built by Revolist OU ❤️
5
- */
6
- const c = {
7
- contentSize: 0,
8
- clientSize: 0,
9
- virtualSize: 0,
10
- maxSize: 0
11
- }, s = -1;
12
- function C(a, i, o = 0) {
13
- return h({
14
- contentSize: a,
15
- clientSize: i,
16
- virtualSize: o
17
- }).physicalContentSize;
18
- }
19
- class v {
20
- constructor(i) {
21
- this.cfg = i, this.preventArtificialScroll = {
22
- rgRow: null,
23
- rgCol: null
24
- }, this.previousScroll = {
25
- rgRow: s,
26
- rgCol: s
27
- }, this.previousLogicalScroll = {
28
- rgRow: 0,
29
- rgCol: 0
30
- }, this.params = {
31
- rgRow: Object.assign({}, c),
32
- rgCol: Object.assign({}, c)
33
- };
34
- }
35
- setParams(i, o) {
36
- const t = h(i), l = t.physicalContentSize;
37
- this.params[o] = Object.assign(Object.assign({}, i), {
38
- maxSize: l - i.clientSize,
39
- virtualContentSize: l,
40
- scrollDimension: t
41
- });
42
- }
43
- // apply scroll values after scroll done
44
- async setScroll(i) {
45
- this.cancelScroll(i.dimension);
46
- const o = new Promise((t, l) => {
47
- if (this.cfg.skipAnimationFrame)
48
- return t();
49
- const r = window.requestAnimationFrame(() => {
50
- t();
51
- });
52
- this.preventArtificialScroll[i.dimension] = l.bind(null, r);
53
- });
54
- try {
55
- await o;
56
- const t = this.getParams(i.dimension);
57
- i.coordinate = Math.ceil(i.coordinate), this.previousLogicalScroll[i.dimension] = this.wrapLogicalCoordinate(i.coordinate, t);
58
- const l = this.toPhysicalCoordinate(i.coordinate, t);
59
- this.previousScroll[i.dimension] = this.wrapPhysicalCoordinate(l, t), this.preventArtificialScroll[i.dimension] = null, this.cfg.applyScroll(Object.assign(Object.assign({}, i), { coordinate: l }));
60
- } catch (t) {
61
- window.cancelAnimationFrame(t);
62
- }
63
- }
64
- async setScrollByDelta(i, o) {
65
- var t;
66
- const l = this.getParams(i.dimension), r = this.previousScroll[i.dimension] === s ? this.toLogicalCoordinate(o, l) : this.previousLogicalScroll[i.dimension], e = this.wrapLogicalCoordinate(r + ((t = i.delta) !== null && t !== void 0 ? t : 0), l), n = Object.assign(Object.assign({}, i), { coordinate: e });
67
- return await this.setScroll(n), n;
68
- }
69
- /**
70
- * On scroll event started
71
- */
72
- scroll(i, o, t = !1, l, r = !1) {
73
- if (this.cancelScroll(o), !t && this.previousScroll[o] === i) {
74
- this.previousScroll[o] = s;
75
- return;
76
- }
77
- const e = this.getParams(o), n = this.toLogicalScrollCoordinate(i, o, e, l);
78
- this.cfg.runScroll({
79
- dimension: o,
80
- coordinate: n,
81
- delta: l,
82
- outside: r
83
- }), this.previousLogicalScroll[o] = n;
84
- }
85
- getParams(i) {
86
- return this.params[i];
87
- }
88
- // check if scroll outside of region to avoid looping
89
- wrapPhysicalCoordinate(i, o) {
90
- return i < 0 ? s : typeof o.maxSize == "number" && i > o.maxSize ? o.maxSize : i;
91
- }
92
- wrapLogicalCoordinate(i, o) {
93
- var t, l;
94
- return i < 0 ? 0 : Math.min(i, (l = (t = o.scrollDimension) === null || t === void 0 ? void 0 : t.logicalScrollSize) !== null && l !== void 0 ? l : i);
95
- }
96
- // prevent already started scroll, performance optimization
97
- cancelScroll(i) {
98
- var o, t;
99
- (t = (o = this.preventArtificialScroll)[i]) === null || t === void 0 || t.call(o), this.preventArtificialScroll[i] = null;
100
- }
101
- toLogicalScrollCoordinate(i, o, t, l) {
102
- const r = t.scrollDimension;
103
- if (!r)
104
- return i;
105
- if (typeof l == "number" && r.isCompressed) {
106
- const e = this.previousScroll[o] === s ? r.toLogicalCoordinate(i - l) : this.previousLogicalScroll[o];
107
- return r.toLogicalCoordinate(r.toPhysicalCoordinate(e + l));
108
- }
109
- return r.toLogicalCoordinate(i);
110
- }
111
- toPhysicalCoordinate(i, o) {
112
- var t, l;
113
- return (l = (t = o.scrollDimension) === null || t === void 0 ? void 0 : t.toPhysicalCoordinate(i)) !== null && l !== void 0 ? l : i;
114
- }
115
- toLogicalCoordinate(i, o) {
116
- var t, l;
117
- return (l = (t = o.scrollDimension) === null || t === void 0 ? void 0 : t.toLogicalCoordinate(i)) !== null && l !== void 0 ? l : i;
118
- }
119
- }
120
- class p {
121
- constructor(i = 10) {
122
- this.scrollThrottling = i, this.mouseWheelScrollTimestamp = {
123
- rgCol: 0,
124
- rgRow: 0
125
- }, this.lastKnownScrollCoordinate = {
126
- rgCol: 0,
127
- rgRow: 0
128
- }, this.lastScrollUpdateCallbacks = {};
129
- }
130
- setCoordinate(i) {
131
- this.lastKnownScrollCoordinate[i.dimension] = i.coordinate;
132
- }
133
- setCoordinateFromScroll(i) {
134
- this.setCoordinate(i), this.mouseWheelScrollTimestamp[i.dimension] = 0;
135
- }
136
- /**
137
- * Remember last mw event time
138
- */
139
- latestScrollUpdate(i) {
140
- this.mouseWheelScrollTimestamp[i] = Date.now();
141
- }
142
- isReady(i, o) {
143
- return this.lastScrollUpdateCallbacks[i] && this.clearLastScrollUpdate(i), this.verifyChange(i, o);
144
- }
145
- verifyChange(i, o) {
146
- return Date.now() - this.mouseWheelScrollTimestamp[i] > this.scrollThrottling && o !== this.lastKnownScrollCoordinate[i];
147
- }
148
- clearLastScrollUpdate(i) {
149
- var o, t;
150
- clearTimeout((t = (o = this.lastScrollUpdateCallbacks[i]) === null || o === void 0 ? void 0 : o.timeout) !== null && t !== void 0 ? t : 0), delete this.lastScrollUpdateCallbacks[i];
151
- }
152
- throttleLastScrollUpdate(i, o, t) {
153
- if (this.scrollThrottling) {
154
- this.clearLastScrollUpdate(i);
155
- const l = this.lastScrollUpdateCallbacks[i] = {
156
- callback: t,
157
- timestamp: Date.now(),
158
- coordinate: o,
159
- timeout: 0
160
- };
161
- l.timeout = setTimeout(() => {
162
- this.clearLastScrollUpdate(i), this.mouseWheelScrollTimestamp[i] < l.timestamp && this.verifyChange(i, l.coordinate) && l.callback();
163
- }, this.scrollThrottling + 50);
164
- }
165
- }
166
- }
167
- var u = "Expected a function";
168
- function f(a, i, o) {
169
- var t = !0, l = !0;
170
- if (typeof a != "function")
171
- throw new TypeError(u);
172
- return d(o) && (t = "leading" in o ? !!o.leading : t, l = "trailing" in o ? !!o.trailing : l), m(a, i, {
173
- leading: t,
174
- maxWait: i,
175
- trailing: l
176
- });
177
- }
178
- export {
179
- p as L,
180
- v as a,
181
- C as g,
182
- f as t
183
- };