@endge/ui-vue 0.33.0 → 0.34.0

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.
@@ -1,329 +0,0 @@
1
- import { r as F, c as m, l as I, h as s, J as w, K as C, L as k, M as D, H as E, f as O } from "./main-CTvK8fpg.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), a = e.findIndex((n) => n.id === t);
33
- if (r === -1 || a === -1 || r === a)
34
- return !1;
35
- const o = 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(a, 0, l), e.forEach((n, d) => {
40
- var c;
41
- n.relation = d === e.length - 1 ? "and" : (c = o[d]) !== null && c !== void 0 ? c : "and";
42
- }), !0;
43
- }
44
- const T = () => '.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}', f = "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 = m(this, "filterChange", 7), this.resetChange = m(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 = f, this.filterItems = {}, this.filterNames = {}, this.filterEntities = {}, this.disableDynamicFiltering = !1, this.closeOnOutsideClick = !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 = f;
72
- }
73
- this.currentFilterType = f, this.changes && (this.changes.type = f), 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 || f);
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 (typeof t > "u")
93
- return "";
94
- const r = (i = this.filterItems[t]) !== null && i !== void 0 ? i : [], a = r.filter((l) => !l.hidden).length, o = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
95
- return s("div", { key: this.filterId }, s("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 = s(w, { text: l.relation === "and" ? o.and : o.or, onClick: () => this.toggleFilterAndOr(l.id) }));
100
- const c = this.renderExtra(t, n), h = this.draggedFilterId === l.id, p = this.dragOverFilterId === l.id && !h, v = a > 1;
101
- return s("li", { key: l.id, class: _, "aria-label": `${o.filterCondition} ${n + 1}` }, s("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": p
106
- } }, v ? s("button", { type: "button", class: "filter-row-drop-target", tabIndex: -1, "aria-label": `${o.filterCondition} ${n + 1}`, onDragOver: (g) => this.onFilterDragOver(g, l.id), onDragLeave: () => this.onFilterDragLeave(l.id), onDrop: (g) => this.onFilterDrop(g, t, l.id) }) : "", v ? s(C, { ariaLabel: o.reorderFilter, dragging: h, dragOver: p, onDragStart: (g) => this.onFilterDragStart(g, l.id), onDragEnd: () => this.onFilterDragEnd(), onKeyDown: (g) => this.onFilterReorderKeyDown(g, t, l.id) }) : "", s("div", { class: { "select-input": !0 } }, s("select", { class: "select-css select-filter", onChange: (g) => this.onFilterTypeChange(g, t, n) }, this.renderSelectOptions(this.filterItems[t][n].type, !0)), c ? s("div", { class: "filter-extra" }, c) : ""), s("div", { class: R }, d, s(k, { ariaLabel: o.removeFilter, onClick: () => this.onRemoveFilter(l.id) }))));
107
- })), r.filter((l) => !l.hidden).length > 0 ? s("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, a = this.changes.y, o = Math.max(0, r - u), l = Math.max(0, window.innerHeight - a - u), n = t.height > l && o > l, d = Math.max(u, n ? o : l);
127
- e.style.maxHeight = `${d}px`;
128
- const c = e.getBoundingClientRect(), h = Math.max(u, window.innerWidth - c.width - u), p = Math.max(u, window.innerHeight - c.height - u), v = Math.min(Math.max(u, this.changes.x), h), g = Math.min(n ? Math.max(u, r - c.height) : Math.max(u, a), p);
129
- e.style.left = `${v}px`, e.style.top = `${g}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 = f, this.currentFilterType = f), 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 a = r.findIndex((o) => o.id === e);
173
- a !== -1 && (r.splice(a, 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 a = (r = this.draggedFilterId) !== null && r !== void 0 ? r : A(e.dataTransfer);
188
- if (this.onFilterDragEnd(), a === void 0)
189
- return;
190
- const o = this.filterItems[i];
191
- o && b(o, a, 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 a = this.filterItems[i];
205
- if (!a)
206
- return;
207
- const o = a.filter((d) => !d.hidden), l = o.findIndex((d) => d.id === t);
208
- if (l === -1)
209
- return;
210
- e.preventDefault(), e.stopPropagation();
211
- const n = o[l + r];
212
- !n || !b(a, 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 a = r.findIndex((o) => o.id === e);
221
- a !== -1 && (r[a].relation = r[a].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
- if (!this.changes)
229
- return;
230
- const t = [], r = this.changes.prop, a = /* @__PURE__ */ new Set();
231
- if (Object.keys(this.filterItems).forEach((o) => {
232
- this.filterItems[o].forEach((n) => {
233
- n.hidden && a.add(n.type);
234
- });
235
- }), !i) {
236
- const o = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
237
- t.push(s("option", { selected: this.currentFilterType === f, value: f }, r && this.filterItems[r] && this.filterItems[r].length > 0 ? o.add : this.filterNames[f]));
238
- }
239
- for (let o in this.changes.filterTypes) {
240
- const l = this.changes.filterTypes[o].filter((n) => !a.has(n));
241
- l.length && (t.push(...l.map((n) => s("option", { value: n, selected: e === n }, this.filterNames[n]))), t.push(s("option", { disabled: !0 })));
242
- }
243
- return t;
244
- }
245
- renderExtra(e, i) {
246
- const t = this.filterItems[e];
247
- if (!t)
248
- return "";
249
- const r = (n) => {
250
- this.filterItems[e][i].value = n, this.disableDynamicFiltering || this.debouncedApplyFilter();
251
- }, a = () => {
252
- const n = this.getAddFilterSelect();
253
- n && (n.value = f, this.currentFilterType = f, this.addNewFilterToProp(), n.focus());
254
- }, o = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions), l = this.filterEntities[t[i].type].extra;
255
- return typeof l == "function" ? l(s, {
256
- value: t[i].value,
257
- filter: t[i],
258
- prop: e,
259
- index: i,
260
- placeholder: o.placeholder,
261
- onInput: (n) => {
262
- r(n);
263
- },
264
- onFocus: () => {
265
- a();
266
- }
267
- }) : l !== "input" && l !== "datepicker" ? "" : s("input", { id: `filter-input-${t[i].id}`, placeholder: o.placeholder, type: l === "datepicker" ? "date" : "text", value: t[i].value, onInput: (n) => {
268
- n.target instanceof HTMLInputElement && r(n.target.value);
269
- }, onKeyDown: (n) => {
270
- if (n.key.toLowerCase() === "enter") {
271
- this.getAddFilterSelect() && a();
272
- return;
273
- }
274
- n.stopPropagation();
275
- } });
276
- }
277
- getAddFilterSelect() {
278
- return this.element.querySelector(`#${x}`);
279
- }
280
- isOwnFilterButton(e) {
281
- if (!(e instanceof Element) || !D(e))
282
- return !1;
283
- const i = this.getOwningGrid(this.element), t = this.getOwningGrid(e);
284
- return !!i && i === t;
285
- }
286
- getOwningGrid(e) {
287
- const i = e.closest("revo-grid");
288
- if (i)
289
- return i;
290
- const t = e.getRootNode();
291
- if (t instanceof ShadowRoot && t.host.localName === "revo-grid")
292
- return t.host;
293
- }
294
- render() {
295
- var e, i, t, r, a, o, l, n, d;
296
- const c = {
297
- left: `${(i = (e = this.changes) === null || e === void 0 ? void 0 : e.x) !== null && i !== void 0 ? i : 0}px`,
298
- top: `${(r = (t = this.changes) === null || t === void 0 ? void 0 : t.y) !== null && r !== void 0 ? r : 0}px`
299
- }, h = Object.assign(Object.assign({}, this.filterCaptionsInternal), this.filterCaptions);
300
- return s(E, { key: "2a19b35adb56fb7d23385fffebc768838edee162" }, s("dialog", { key: "94386d7cbc4bd9c631f72928938b1d1550a3de82", class: "filter-panel-dialog", style: c, ref: (p) => this.dialog = p, onCancel: (p) => {
301
- p.preventDefault(), this.onCancel();
302
- } }, this.changes && [
303
- s("slot", { key: "header-slot", slot: "header" }),
304
- ((o = (a = this.changes).extraContent) === null || o === void 0 ? void 0 : o.call(a, this.changes)) || "",
305
- ((l = this.changes) === null || l === void 0 ? void 0 : l.hideDefaultFilters) !== !0 && [
306
- s("label", { key: "filter-title" }, h.title),
307
- s("div", { key: "filter-holder", class: "filter-holder" }, this.getFilterItemsList()),
308
- s("div", { key: "add-filter", class: "add-filter" }, s("select", { key: "4f7354e39d8e5cf9ae7b735290eff18d105ab87e", id: x, class: "select-css", onChange: (p) => this.onAddNewFilter(p) }, this.renderSelectOptions(this.currentFilterType)))
309
- ],
310
- s("slot", { key: "default-slot" }),
311
- ((d = (n = this.changes).extraBottomContent) === null || d === void 0 ? void 0 : d.call(n, this.changes)) || "",
312
- s("div", { key: "filter-actions", class: "filter-actions" }, this.disableDynamicFiltering && [
313
- s("button", { key: "save", id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, h.save),
314
- s("button", { key: "cancel", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, h.cancel)
315
- ], !this.disableDynamicFiltering && [
316
- s("button", { key: "ok", id: "revo-button-ok", "aria-label": "ok", class: "revo-button green", onClick: () => this.onCancel() }, h.ok),
317
- s("button", { key: "reset", id: "revo-button-reset", "aria-label": "reset", class: "revo-button outline", onClick: () => this.onReset() }, h.reset)
318
- ]),
319
- s("slot", { key: "footer-slot", slot: "footer" })
320
- ]));
321
- }
322
- get element() {
323
- return O(this);
324
- }
325
- };
326
- L.style = T();
327
- export {
328
- L as revogr_filter_panel
329
- };
@@ -1,183 +0,0 @@
1
- import { g as h } from "./viewport.helpers-CoCAvmZs-f555rwPU.js";
2
- import { as as d, l as m } from "./main-CTvK8fpg.js";
3
- /*!
4
- * Built by Revolist OU ❤️
5
- */
6
- const c = {
7
- contentSize: 0,
8
- clientSize: 0,
9
- virtualSize: 0,
10
- maxSize: 0
11
- }, e = -1;
12
- function C(a, i, t = 0) {
13
- return h({
14
- contentSize: a,
15
- clientSize: i,
16
- virtualSize: t
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: e,
26
- rgCol: e
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, t) {
36
- const o = h(i), l = o.physicalContentSize;
37
- this.params[t] = Object.assign(Object.assign({}, i), {
38
- maxSize: l - i.clientSize,
39
- virtualContentSize: l,
40
- scrollDimension: o
41
- });
42
- }
43
- // apply scroll values after scroll done
44
- async setScroll(i) {
45
- this.cancelScroll(i.dimension);
46
- const t = new Promise((o, l) => {
47
- if (this.cfg.skipAnimationFrame)
48
- return o();
49
- const r = window.requestAnimationFrame(() => {
50
- o();
51
- });
52
- this.preventArtificialScroll[i.dimension] = l.bind(null, r);
53
- });
54
- try {
55
- await t;
56
- const o = this.getParams(i.dimension);
57
- i.coordinate = Math.ceil(i.coordinate), this.previousLogicalScroll[i.dimension] = this.wrapLogicalCoordinate(i.coordinate, o);
58
- const l = this.toPhysicalCoordinate(i.coordinate, o);
59
- this.previousScroll[i.dimension] = this.wrapPhysicalCoordinate(l, o), this.preventArtificialScroll[i.dimension] = null, this.cfg.applyScroll(Object.assign(Object.assign({}, i), { coordinate: l }));
60
- } catch (o) {
61
- window.cancelAnimationFrame(o);
62
- }
63
- }
64
- async setScrollByDelta(i, t) {
65
- var o;
66
- const l = this.getParams(i.dimension), r = this.previousScroll[i.dimension] === e ? this.toLogicalCoordinate(t, l) : this.previousLogicalScroll[i.dimension], s = this.wrapLogicalCoordinate(r + ((o = i.delta) !== null && o !== void 0 ? o : 0), l), n = Object.assign(Object.assign({}, i), { coordinate: s });
67
- return await this.setScroll(n), n;
68
- }
69
- /**
70
- * On scroll event started
71
- */
72
- scroll(i, t, o = !1, l, r = !1) {
73
- if (this.cancelScroll(t), !o && this.previousScroll[t] === i) {
74
- this.previousScroll[t] = e;
75
- return;
76
- }
77
- const s = this.getParams(t), n = this.toLogicalScrollCoordinate(i, t, s, l);
78
- this.cfg.runScroll({
79
- dimension: t,
80
- coordinate: n,
81
- delta: l,
82
- outside: r
83
- }), this.previousLogicalScroll[t] = n;
84
- }
85
- getParams(i) {
86
- return this.params[i];
87
- }
88
- // check if scroll outside of region to avoid looping
89
- wrapPhysicalCoordinate(i, t) {
90
- return i < 0 ? e : typeof t.maxSize == "number" && i > t.maxSize ? t.maxSize : i;
91
- }
92
- wrapLogicalCoordinate(i, t) {
93
- var o, l;
94
- return i < 0 ? 0 : Math.min(i, (l = (o = t.scrollDimension) === null || o === void 0 ? void 0 : o.logicalScrollSize) !== null && l !== void 0 ? l : i);
95
- }
96
- // prevent already started scroll, performance optimization
97
- cancelScroll(i) {
98
- var t, o;
99
- (o = (t = this.preventArtificialScroll)[i]) === null || o === void 0 || o.call(t), this.preventArtificialScroll[i] = null;
100
- }
101
- toLogicalScrollCoordinate(i, t, o, l) {
102
- const r = o.scrollDimension;
103
- if (!r)
104
- return i;
105
- if (typeof l == "number" && r.isCompressed) {
106
- const s = this.previousScroll[t] === e ? r.toLogicalCoordinate(i - l) : this.previousLogicalScroll[t];
107
- return r.toLogicalCoordinate(r.toPhysicalCoordinate(s + l));
108
- }
109
- return r.toLogicalCoordinate(i);
110
- }
111
- toPhysicalCoordinate(i, t) {
112
- var o, l;
113
- return (l = (o = t.scrollDimension) === null || o === void 0 ? void 0 : o.toPhysicalCoordinate(i)) !== null && l !== void 0 ? l : i;
114
- }
115
- toLogicalCoordinate(i, t) {
116
- var o, l;
117
- return (l = (o = t.scrollDimension) === null || o === void 0 ? void 0 : o.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] = (/* @__PURE__ */ new Date()).getTime();
141
- }
142
- isReady(i, t) {
143
- return this.lastScrollUpdateCallbacks[i] && this.clearLastScrollUpdate(i), this.verifyChange(i, t);
144
- }
145
- verifyChange(i, t) {
146
- return (/* @__PURE__ */ new Date()).getTime() - this.mouseWheelScrollTimestamp[i] > this.scrollThrottling && t !== this.lastKnownScrollCoordinate[i];
147
- }
148
- clearLastScrollUpdate(i) {
149
- var t, o;
150
- clearTimeout((o = (t = this.lastScrollUpdateCallbacks[i]) === null || t === void 0 ? void 0 : t.timeout) !== null && o !== void 0 ? o : 0), delete this.lastScrollUpdateCallbacks[i];
151
- }
152
- throttleLastScrollUpdate(i, t, o) {
153
- if (this.scrollThrottling) {
154
- this.clearLastScrollUpdate(i);
155
- const l = this.lastScrollUpdateCallbacks[i] = {
156
- callback: o,
157
- timestamp: (/* @__PURE__ */ new Date()).getTime(),
158
- coordinate: t,
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 g = "Expected a function";
168
- function f(a, i, t) {
169
- var o = !0, l = !0;
170
- if (typeof a != "function")
171
- throw new TypeError(g);
172
- return d(t) && (o = "leading" in t ? !!t.leading : o, l = "trailing" in t ? !!t.trailing : l), m(a, i, {
173
- leading: o,
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
- };
@@ -1,16 +0,0 @@
1
- type __VLS_Props = {
2
- pageIndex: number;
3
- pageSize: number;
4
- pageCount: number;
5
- pageSizes: number[];
6
- lazy?: boolean;
7
- };
8
- declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
9
- "update:pageIndex": (value: number) => any;
10
- "update:pageSize": (value: number) => any;
11
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
12
- "onUpdate:pageIndex"?: ((value: number) => any) | undefined;
13
- "onUpdate:pageSize"?: ((value: number) => any) | undefined;
14
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
- declare const _default: typeof __VLS_export;
16
- export default _default;
@@ -1,77 +0,0 @@
1
- /*!
2
- * Built by Revolist OU ❤️
3
- */
4
- let l;
5
- function x(t = typeof document > "u" ? void 0 : document) {
6
- if (typeof l == "number")
7
- return l;
8
- const e = t == null ? void 0 : t.body;
9
- if (e) {
10
- const s = e.ownerDocument, o = s.createElement("div");
11
- o.style.cssText = [
12
- "height:1px",
13
- "left:-10000px",
14
- "overflow:scroll",
15
- "position:absolute",
16
- "top:-10000px",
17
- "visibility:hidden",
18
- "width:1px"
19
- ].join(";");
20
- const c = s.createElement("div");
21
- return c.style.height = `${16e6 * 4}px`, o.appendChild(c), e.appendChild(o), l = Math.max(0, Math.min(o.scrollHeight, 16e6 * 4) - 1e6), o.remove(), l > 1e6 || (l = 16e6), l;
22
- }
23
- return 16e6;
24
- }
25
- function R({ contentSize: t, clientSize: e, virtualSize: s = 0, maxScrollSize: o = x() }) {
26
- const c = Math.max(0, o - 1e6), u = Math.max(0, t), a = Math.max(0, e), C = Math.max(0, s || a), r = Math.max(0, u - C), _ = Math.max(0, c - a), i = Math.min(r, _), A = a + i, L = r > i && i > 0, S = (n) => Math.min(Math.max(0, n || 0), r), m = (n) => Math.min(Math.max(0, n || 0), i), f = (n) => !r || !i ? 0 : S(L ? m(n) / i * r : n), h = (n) => !r || !i ? 0 : m(L ? S(n) / r * i : n);
27
- return {
28
- contentSize: u,
29
- clientSize: a,
30
- viewportSize: C,
31
- physicalContentSize: A,
32
- logicalScrollSize: r,
33
- physicalScrollSize: i,
34
- isCompressed: L,
35
- toLogicalCoordinate: f,
36
- toPhysicalCoordinate: h,
37
- getRenderOffset(n) {
38
- const p = S(n);
39
- return p - h(p);
40
- }
41
- };
42
- }
43
- const d = "header", g = "footer", v = "content", w = "data";
44
- function M(t, e) {
45
- const s = t.viewports[t.colType].store.get("realCount"), o = t.viewports[e].store.get("realCount");
46
- return {
47
- x: s,
48
- y: o
49
- };
50
- }
51
- function O(t, e, s, o) {
52
- return {
53
- colData: t.colStore,
54
- viewportCol: t.viewports[t.colType].store,
55
- viewportRow: t.viewports[e].store,
56
- /**
57
- * lastCell is the last real coordinate + 1, saved to selection store
58
- */
59
- lastCell: M(t, e),
60
- slot: s,
61
- type: e,
62
- canDrag: !o,
63
- position: t.position,
64
- dataStore: t.rowStores[e].store,
65
- dimensionCol: t.dimensions[t.colType].store,
66
- dimensionRow: t.dimensions[e].store,
67
- style: o ? { height: `${t.dimensions[e].store.get("realSize")}px` } : void 0
68
- };
69
- }
70
- export {
71
- v as C,
72
- w as D,
73
- g as F,
74
- d as H,
75
- R as g,
76
- O as v
77
- };