@avakhula/ui 0.1.22 → 0.1.23
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/App.js +23 -0
- package/dist/EventEmmiter.js +33 -0
- package/dist/chunks/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/chunks/floating-ui.dom-D8OVFdyL.js +861 -0
- package/dist/chunks/vue-quill.esm-bundler-FvTqp_xR.js +9070 -0
- package/dist/components/Accordion/Accordion.js +81 -0
- package/dist/components/Alert/Alert.js +121 -0
- package/dist/components/Alert/constants.js +10 -0
- package/dist/components/Avatar/Avatar.js +75 -0
- package/dist/components/Avatar/constants.js +12 -0
- package/dist/components/Badge/Badge.js +29 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +117 -0
- package/dist/components/Button/Button.js +140 -0
- package/dist/components/Button/constants.js +11 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +14 -0
- package/dist/components/Chips/Chips.js +65 -0
- package/dist/components/Dropdown/Dropdown.js +228 -0
- package/dist/components/Dropdown/DropdownDivider.js +10 -0
- package/dist/components/Dropdown/DropdownItem.js +50 -0
- package/dist/components/Dropdown/DropdownList.js +104 -0
- package/dist/components/Dropdown/constants.js +12 -0
- package/dist/components/Form/CharactersCount.js +33 -0
- package/dist/components/Form/Checkbox/Checkbox.js +171 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +81 -0
- package/dist/components/Form/DatePicker/DatePicker.js +1782 -0
- package/dist/components/Form/DatePicker/Icons/chevron-back.js +8 -0
- package/dist/components/Form/DatePicker/Icons/chevron-forward.js +8 -0
- package/dist/components/Form/FormGroup/FormGroup.js +30 -0
- package/dist/components/Form/FormGroup/FormGroupSet.js +44 -0
- package/dist/components/Form/Input/Input.js +375 -0
- package/dist/components/Form/Input/constants.js +9 -0
- package/dist/components/Form/Label/Label.js +87 -0
- package/dist/components/Form/PhoneInput/PhoneInput.js +3811 -0
- package/dist/components/Form/Radio/Radio.js +91 -0
- package/dist/components/Form/TextEditor/TextEditor.js +422 -0
- package/dist/components/Form/TextEditor/Toolbar.js +291 -0
- package/dist/components/Form/TextEditor/icons/toolbarIcons.js +109 -0
- package/dist/components/Form/TextEditor/plugins/alphabetList.js +31 -0
- package/dist/components/Form/TextEditor/plugins/imageBlot.js +16 -0
- package/dist/components/Form/TextEditor/setupTextEditor.js +27 -0
- package/dist/components/Form/Textarea/Textarea.js +121 -0
- package/dist/components/Form/Toggle/Toggle.js +134 -0
- package/dist/components/Icon.js +37 -0
- package/dist/components/IconButton/IconButton.js +93 -0
- package/dist/components/IconButton/constants.js +15 -0
- package/dist/components/List.js +66 -0
- package/dist/components/Modal/Modal.js +198 -0
- package/dist/components/Modal/constants.js +9 -0
- package/dist/components/Pagination/LimitSelector.js +73 -0
- package/dist/components/Pagination/Pagination.js +226 -0
- package/dist/components/Panel/Panel.js +107 -0
- package/dist/components/Popover/Popover.js +105 -0
- package/dist/components/Popover/constants.js +17 -0
- package/dist/components/ProgressBar/ProgressBar.js +63 -0
- package/dist/components/ProgressBar/constants.js +10 -0
- package/dist/components/Sorting/Sorting.js +182 -0
- package/dist/components/Sorting/constants.js +12 -0
- package/dist/components/SplitButton/SplitButton.js +145 -0
- package/dist/components/SplitButton/SplitButtonItem.js +34 -0
- package/dist/components/SplitButton/constants.js +7 -0
- package/dist/components/StatusIndicator/StatusIndicator.js +29 -0
- package/dist/components/StatusIndicator/constants.js +13 -0
- package/dist/components/StatusIndicator/icons.js +44 -0
- package/dist/components/Table/Cells/Cell.js +39 -0
- package/dist/components/Table/Cells/CheckboxCell.js +37 -0
- package/dist/components/Table/Row.js +14 -0
- package/dist/components/Table/Table.js +24 -0
- package/dist/components/Tabs/Tab.js +47 -0
- package/dist/components/Tabs/TabDropdown.js +94 -0
- package/dist/components/Tabs/Tabs.js +128 -0
- package/dist/components/TagPill/TagPill.js +61 -0
- package/dist/components/TagPill/constants.js +12 -0
- package/dist/components/ToggleTip/ToggleTip.js +91 -0
- package/dist/components/ToggleTip/constants.js +17 -0
- package/dist/components/Tooltip/Tooltip.js +46 -0
- package/dist/components/TreeSelect/Option.js +302 -0
- package/dist/components/TreeSelect/Select.js +1871 -0
- package/dist/components/TreeSelect/mixins/InfinityLoaderMixin.js +32 -0
- package/dist/constants/events.js +5 -0
- package/dist/constants/keyCodes.js +12 -0
- package/dist/directives/outside/outside.js +37 -0
- package/dist/directives/tooltip/TooltipController.js +116 -0
- package/dist/directives/tooltip/textOverflowTooltip.js +23 -0
- package/dist/directives/tooltip/tooltip.js +48 -0
- package/dist/helpers/debounce.js +14 -0
- package/dist/helpers/generateUID.js +6 -0
- package/dist/helpers/getHrefFromID.js +6 -0
- package/dist/helpers/multiLineOverflows.js +6 -0
- package/dist/helpers/removeEvents.js +8 -0
- package/dist/helpers/stripHtml.js +6 -0
- package/dist/index.css +1 -1
- package/dist/index.js +103 -22665
- package/dist/main.js +10 -0
- package/dist/mixins/expandAnimation.js +24 -0
- package/package.json +7 -4
- package/src/components/Form/Textarea/Textarea.vue +8 -4
- package/.babelrc.json +0 -14
- package/.eslintrc.cjs +0 -22
- package/.nvmrc +0 -1
- package/.prettierrc.json +0 -1
- package/.storybook/intelliboardTheme.js +0 -10
- package/.storybook/main.js +0 -25
- package/.storybook/manager.js +0 -7
- package/.storybook/preview-head.html +0 -12
- package/.storybook/preview.js +0 -25
- package/.storybook/scss-loader.scss +0 -6
- package/.storybook/withSource.js +0 -97
- package/dist/index.umd.cjs +0 -238
- package/index.html +0 -21
- package/static/Logo.svg +0 -25
- package/static/docks/button.pdf +0 -147566
- package/static/favicon.ico +0 -0
- package/vite.config.js +0 -47
|
@@ -0,0 +1,1871 @@
|
|
|
1
|
+
import { computed as Z, unref as A, shallowRef as Q, watch as L, triggerRef as j, onScopeDispose as $, resolveComponent as E, resolveDirective as ee, createElementBlock as b, openBlock as y, Fragment as M, createBlock as S, createCommentVNode as v, createElementVNode as x, withCtx as C, createTextVNode as te, toDisplayString as z, mergeProps as se, createVNode as _, normalizeClass as I, createSlots as ie, normalizeStyle as B, withDirectives as R, withKeys as w, renderSlot as D, vShow as P, renderList as F, withModifiers as T } from "vue";
|
|
2
|
+
import ne from "../Form/Input/Input.js";
|
|
3
|
+
import re from "./Option.js";
|
|
4
|
+
import { g as le } from "../../chunks/_commonjsHelpers-DaMA6jEr.js";
|
|
5
|
+
import W from "../../helpers/generateUID.js";
|
|
6
|
+
import oe from "../Dropdown/Dropdown.js";
|
|
7
|
+
import ae from "../Icon.js";
|
|
8
|
+
import he from "../IconButton/IconButton.js";
|
|
9
|
+
import ce from "../Alert/Alert.js";
|
|
10
|
+
import de from "../List.js";
|
|
11
|
+
import ue from "./mixins/InfinityLoaderMixin.js";
|
|
12
|
+
import { TooltipDirective as fe } from "../../directives/tooltip/tooltip.js";
|
|
13
|
+
import pe from "../../helpers/debounce.js";
|
|
14
|
+
import { _ as me } from "../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
|
+
function N(n, o, t) {
|
|
16
|
+
let l = t.initialDeps ?? [], r;
|
|
17
|
+
function e() {
|
|
18
|
+
var i, s, a, c;
|
|
19
|
+
let h;
|
|
20
|
+
t.key && ((i = t.debug) != null && i.call(t)) && (h = Date.now());
|
|
21
|
+
const u = n();
|
|
22
|
+
if (!(u.length !== l.length || u.some((f, p) => l[p] !== f)))
|
|
23
|
+
return r;
|
|
24
|
+
l = u;
|
|
25
|
+
let m;
|
|
26
|
+
if (t.key && ((s = t.debug) != null && s.call(t)) && (m = Date.now()), r = o(...u), t.key && ((a = t.debug) != null && a.call(t))) {
|
|
27
|
+
const f = Math.round((Date.now() - h) * 100) / 100, p = Math.round((Date.now() - m) * 100) / 100, g = p / 16, O = (k, Y) => {
|
|
28
|
+
for (k = String(k); k.length < Y; )
|
|
29
|
+
k = " " + k;
|
|
30
|
+
return k;
|
|
31
|
+
};
|
|
32
|
+
console.info(
|
|
33
|
+
`%c⏱ ${O(p, 5)} /${O(f, 5)} ms`,
|
|
34
|
+
`
|
|
35
|
+
font-size: .6rem;
|
|
36
|
+
font-weight: bold;
|
|
37
|
+
color: hsl(${Math.max(
|
|
38
|
+
0,
|
|
39
|
+
Math.min(120 - 120 * g, 120)
|
|
40
|
+
)}deg 100% 31%);`,
|
|
41
|
+
t == null ? void 0 : t.key
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return (c = t == null ? void 0 : t.onChange) == null || c.call(t, r), r;
|
|
45
|
+
}
|
|
46
|
+
return e.updateDeps = (i) => {
|
|
47
|
+
l = i;
|
|
48
|
+
}, e;
|
|
49
|
+
}
|
|
50
|
+
function K(n, o) {
|
|
51
|
+
if (n === void 0)
|
|
52
|
+
throw new Error("Unexpected undefined");
|
|
53
|
+
return n;
|
|
54
|
+
}
|
|
55
|
+
const ge = (n, o) => Math.abs(n - o) < 1.01, ye = (n, o, t) => {
|
|
56
|
+
let l;
|
|
57
|
+
return function(...r) {
|
|
58
|
+
n.clearTimeout(l), l = n.setTimeout(() => o.apply(this, r), t);
|
|
59
|
+
};
|
|
60
|
+
}, q = (n) => {
|
|
61
|
+
const { offsetWidth: o, offsetHeight: t } = n;
|
|
62
|
+
return { width: o, height: t };
|
|
63
|
+
}, be = (n) => n, ke = (n) => {
|
|
64
|
+
const o = Math.max(n.startIndex - n.overscan, 0), t = Math.min(n.endIndex + n.overscan, n.count - 1), l = [];
|
|
65
|
+
for (let r = o; r <= t; r++)
|
|
66
|
+
l.push(r);
|
|
67
|
+
return l;
|
|
68
|
+
}, ve = (n, o) => {
|
|
69
|
+
const t = n.scrollElement;
|
|
70
|
+
if (!t)
|
|
71
|
+
return;
|
|
72
|
+
const l = n.targetWindow;
|
|
73
|
+
if (!l)
|
|
74
|
+
return;
|
|
75
|
+
const r = (i) => {
|
|
76
|
+
const { width: s, height: a } = i;
|
|
77
|
+
o({ width: Math.round(s), height: Math.round(a) });
|
|
78
|
+
};
|
|
79
|
+
if (r(q(t)), !l.ResizeObserver)
|
|
80
|
+
return () => {
|
|
81
|
+
};
|
|
82
|
+
const e = new l.ResizeObserver((i) => {
|
|
83
|
+
const s = () => {
|
|
84
|
+
const a = i[0];
|
|
85
|
+
if (a != null && a.borderBoxSize) {
|
|
86
|
+
const c = a.borderBoxSize[0];
|
|
87
|
+
if (c) {
|
|
88
|
+
r({ width: c.inlineSize, height: c.blockSize });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
r(q(t));
|
|
93
|
+
};
|
|
94
|
+
n.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(s) : s();
|
|
95
|
+
});
|
|
96
|
+
return e.observe(t, { box: "border-box" }), () => {
|
|
97
|
+
e.unobserve(t);
|
|
98
|
+
};
|
|
99
|
+
}, J = {
|
|
100
|
+
passive: !0
|
|
101
|
+
}, H = typeof window > "u" ? !0 : "onscrollend" in window, Oe = (n, o) => {
|
|
102
|
+
const t = n.scrollElement;
|
|
103
|
+
if (!t)
|
|
104
|
+
return;
|
|
105
|
+
const l = n.targetWindow;
|
|
106
|
+
if (!l)
|
|
107
|
+
return;
|
|
108
|
+
let r = 0;
|
|
109
|
+
const e = n.options.useScrollendEvent && H ? () => {
|
|
110
|
+
} : ye(
|
|
111
|
+
l,
|
|
112
|
+
() => {
|
|
113
|
+
o(r, !1);
|
|
114
|
+
},
|
|
115
|
+
n.options.isScrollingResetDelay
|
|
116
|
+
), i = (h) => () => {
|
|
117
|
+
const { horizontal: u, isRtl: d } = n.options;
|
|
118
|
+
r = u ? t.scrollLeft * (d && -1 || 1) : t.scrollTop, e(), o(r, h);
|
|
119
|
+
}, s = i(!0), a = i(!1);
|
|
120
|
+
a(), t.addEventListener("scroll", s, J);
|
|
121
|
+
const c = n.options.useScrollendEvent && H;
|
|
122
|
+
return c && t.addEventListener("scrollend", a, J), () => {
|
|
123
|
+
t.removeEventListener("scroll", s), c && t.removeEventListener("scrollend", a);
|
|
124
|
+
};
|
|
125
|
+
}, Ee = (n, o, t) => {
|
|
126
|
+
if (o != null && o.borderBoxSize) {
|
|
127
|
+
const l = o.borderBoxSize[0];
|
|
128
|
+
if (l)
|
|
129
|
+
return Math.round(
|
|
130
|
+
l[t.options.horizontal ? "inlineSize" : "blockSize"]
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return n[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
134
|
+
}, Se = (n, {
|
|
135
|
+
adjustments: o = 0,
|
|
136
|
+
behavior: t
|
|
137
|
+
}, l) => {
|
|
138
|
+
var r, e;
|
|
139
|
+
const i = n + o;
|
|
140
|
+
(e = (r = l.scrollElement) == null ? void 0 : r.scrollTo) == null || e.call(r, {
|
|
141
|
+
[l.options.horizontal ? "left" : "top"]: i,
|
|
142
|
+
behavior: t
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
class xe {
|
|
146
|
+
constructor(o) {
|
|
147
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
148
|
+
let t = null;
|
|
149
|
+
const l = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((r) => {
|
|
150
|
+
r.forEach((e) => {
|
|
151
|
+
const i = () => {
|
|
152
|
+
this._measureElement(e.target, e);
|
|
153
|
+
};
|
|
154
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(i) : i();
|
|
155
|
+
});
|
|
156
|
+
}));
|
|
157
|
+
return {
|
|
158
|
+
disconnect: () => {
|
|
159
|
+
var r;
|
|
160
|
+
(r = l()) == null || r.disconnect(), t = null;
|
|
161
|
+
},
|
|
162
|
+
observe: (r) => {
|
|
163
|
+
var e;
|
|
164
|
+
return (e = l()) == null ? void 0 : e.observe(r, { box: "border-box" });
|
|
165
|
+
},
|
|
166
|
+
unobserve: (r) => {
|
|
167
|
+
var e;
|
|
168
|
+
return (e = l()) == null ? void 0 : e.unobserve(r);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
})(), this.range = null, this.setOptions = (t) => {
|
|
172
|
+
Object.entries(t).forEach(([l, r]) => {
|
|
173
|
+
typeof r > "u" && delete t[l];
|
|
174
|
+
}), this.options = {
|
|
175
|
+
debug: !1,
|
|
176
|
+
initialOffset: 0,
|
|
177
|
+
overscan: 1,
|
|
178
|
+
paddingStart: 0,
|
|
179
|
+
paddingEnd: 0,
|
|
180
|
+
scrollPaddingStart: 0,
|
|
181
|
+
scrollPaddingEnd: 0,
|
|
182
|
+
horizontal: !1,
|
|
183
|
+
getItemKey: be,
|
|
184
|
+
rangeExtractor: ke,
|
|
185
|
+
onChange: () => {
|
|
186
|
+
},
|
|
187
|
+
measureElement: Ee,
|
|
188
|
+
initialRect: { width: 0, height: 0 },
|
|
189
|
+
scrollMargin: 0,
|
|
190
|
+
gap: 0,
|
|
191
|
+
indexAttribute: "data-index",
|
|
192
|
+
initialMeasurementsCache: [],
|
|
193
|
+
lanes: 1,
|
|
194
|
+
isScrollingResetDelay: 150,
|
|
195
|
+
enabled: !0,
|
|
196
|
+
isRtl: !1,
|
|
197
|
+
useScrollendEvent: !1,
|
|
198
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
199
|
+
...t
|
|
200
|
+
};
|
|
201
|
+
}, this.notify = (t) => {
|
|
202
|
+
var l, r;
|
|
203
|
+
(r = (l = this.options).onChange) == null || r.call(l, this, t);
|
|
204
|
+
}, this.maybeNotify = N(
|
|
205
|
+
() => (this.calculateRange(), [
|
|
206
|
+
this.isScrolling,
|
|
207
|
+
this.range ? this.range.startIndex : null,
|
|
208
|
+
this.range ? this.range.endIndex : null
|
|
209
|
+
]),
|
|
210
|
+
(t) => {
|
|
211
|
+
this.notify(t);
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
215
|
+
debug: () => this.options.debug,
|
|
216
|
+
initialDeps: [
|
|
217
|
+
this.isScrolling,
|
|
218
|
+
this.range ? this.range.startIndex : null,
|
|
219
|
+
this.range ? this.range.endIndex : null
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
), this.cleanup = () => {
|
|
223
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
|
|
224
|
+
}, this._didMount = () => () => {
|
|
225
|
+
this.cleanup();
|
|
226
|
+
}, this._willUpdate = () => {
|
|
227
|
+
var t;
|
|
228
|
+
const l = this.options.enabled ? this.options.getScrollElement() : null;
|
|
229
|
+
if (this.scrollElement !== l) {
|
|
230
|
+
if (this.cleanup(), !l) {
|
|
231
|
+
this.maybeNotify();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
this.scrollElement = l, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((r) => {
|
|
235
|
+
this.observer.observe(r);
|
|
236
|
+
}), this._scrollToOffset(this.getScrollOffset(), {
|
|
237
|
+
adjustments: void 0,
|
|
238
|
+
behavior: void 0
|
|
239
|
+
}), this.unsubs.push(
|
|
240
|
+
this.options.observeElementRect(this, (r) => {
|
|
241
|
+
this.scrollRect = r, this.maybeNotify();
|
|
242
|
+
})
|
|
243
|
+
), this.unsubs.push(
|
|
244
|
+
this.options.observeElementOffset(this, (r, e) => {
|
|
245
|
+
this.scrollAdjustments = 0, this.scrollDirection = e ? this.getScrollOffset() < r ? "forward" : "backward" : null, this.scrollOffset = r, this.isScrolling = e, this.maybeNotify();
|
|
246
|
+
})
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, l) => {
|
|
250
|
+
const r = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
251
|
+
for (let i = l - 1; i >= 0; i--) {
|
|
252
|
+
const s = t[i];
|
|
253
|
+
if (r.has(s.lane))
|
|
254
|
+
continue;
|
|
255
|
+
const a = e.get(
|
|
256
|
+
s.lane
|
|
257
|
+
);
|
|
258
|
+
if (a == null || s.end > a.end ? e.set(s.lane, s) : s.end < a.end && r.set(s.lane, !0), r.size === this.options.lanes)
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
return e.size === this.options.lanes ? Array.from(e.values()).sort((i, s) => i.end === s.end ? i.index - s.index : i.end - s.end)[0] : void 0;
|
|
262
|
+
}, this.getMeasurementOptions = N(
|
|
263
|
+
() => [
|
|
264
|
+
this.options.count,
|
|
265
|
+
this.options.paddingStart,
|
|
266
|
+
this.options.scrollMargin,
|
|
267
|
+
this.options.getItemKey,
|
|
268
|
+
this.options.enabled
|
|
269
|
+
],
|
|
270
|
+
(t, l, r, e, i) => (this.pendingMeasuredCacheIndexes = [], {
|
|
271
|
+
count: t,
|
|
272
|
+
paddingStart: l,
|
|
273
|
+
scrollMargin: r,
|
|
274
|
+
getItemKey: e,
|
|
275
|
+
enabled: i
|
|
276
|
+
}),
|
|
277
|
+
{
|
|
278
|
+
key: !1
|
|
279
|
+
}
|
|
280
|
+
), this.getMeasurements = N(
|
|
281
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
282
|
+
({ count: t, paddingStart: l, scrollMargin: r, getItemKey: e, enabled: i }, s) => {
|
|
283
|
+
if (!i)
|
|
284
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
285
|
+
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((h) => {
|
|
286
|
+
this.itemSizeCache.set(h.key, h.size);
|
|
287
|
+
}));
|
|
288
|
+
const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
289
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
290
|
+
const c = this.measurementsCache.slice(0, a);
|
|
291
|
+
for (let h = a; h < t; h++) {
|
|
292
|
+
const u = e(h), d = this.options.lanes === 1 ? c[h - 1] : this.getFurthestMeasurement(c, h), m = d ? d.end + this.options.gap : l + r, f = s.get(u), p = typeof f == "number" ? f : this.options.estimateSize(h), g = m + p, O = d ? d.lane : h % this.options.lanes;
|
|
293
|
+
c[h] = {
|
|
294
|
+
index: h,
|
|
295
|
+
start: m,
|
|
296
|
+
size: p,
|
|
297
|
+
end: g,
|
|
298
|
+
key: u,
|
|
299
|
+
lane: O
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return this.measurementsCache = c, c;
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
306
|
+
debug: () => this.options.debug
|
|
307
|
+
}
|
|
308
|
+
), this.calculateRange = N(
|
|
309
|
+
() => [
|
|
310
|
+
this.getMeasurements(),
|
|
311
|
+
this.getSize(),
|
|
312
|
+
this.getScrollOffset(),
|
|
313
|
+
this.options.lanes
|
|
314
|
+
],
|
|
315
|
+
(t, l, r, e) => this.range = t.length > 0 && l > 0 ? Ce({
|
|
316
|
+
measurements: t,
|
|
317
|
+
outerSize: l,
|
|
318
|
+
scrollOffset: r,
|
|
319
|
+
lanes: e
|
|
320
|
+
}) : null,
|
|
321
|
+
{
|
|
322
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
323
|
+
debug: () => this.options.debug
|
|
324
|
+
}
|
|
325
|
+
), this.getVirtualIndexes = N(
|
|
326
|
+
() => {
|
|
327
|
+
let t = null, l = null;
|
|
328
|
+
const r = this.calculateRange();
|
|
329
|
+
return r && (t = r.startIndex, l = r.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, l]), [
|
|
330
|
+
this.options.rangeExtractor,
|
|
331
|
+
this.options.overscan,
|
|
332
|
+
this.options.count,
|
|
333
|
+
t,
|
|
334
|
+
l
|
|
335
|
+
];
|
|
336
|
+
},
|
|
337
|
+
(t, l, r, e, i) => e === null || i === null ? [] : t({
|
|
338
|
+
startIndex: e,
|
|
339
|
+
endIndex: i,
|
|
340
|
+
overscan: l,
|
|
341
|
+
count: r
|
|
342
|
+
}),
|
|
343
|
+
{
|
|
344
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
345
|
+
debug: () => this.options.debug
|
|
346
|
+
}
|
|
347
|
+
), this.indexFromElement = (t) => {
|
|
348
|
+
const l = this.options.indexAttribute, r = t.getAttribute(l);
|
|
349
|
+
return r ? parseInt(r, 10) : (console.warn(
|
|
350
|
+
`Missing attribute name '${l}={index}' on measured element.`
|
|
351
|
+
), -1);
|
|
352
|
+
}, this._measureElement = (t, l) => {
|
|
353
|
+
const r = this.indexFromElement(t), e = this.measurementsCache[r];
|
|
354
|
+
if (!e)
|
|
355
|
+
return;
|
|
356
|
+
const i = e.key, s = this.elementsCache.get(i);
|
|
357
|
+
s !== t && (s && this.observer.unobserve(s), this.observer.observe(t), this.elementsCache.set(i, t)), t.isConnected && this.resizeItem(r, this.options.measureElement(t, l, this));
|
|
358
|
+
}, this.resizeItem = (t, l) => {
|
|
359
|
+
const r = this.measurementsCache[t];
|
|
360
|
+
if (!r)
|
|
361
|
+
return;
|
|
362
|
+
const e = this.itemSizeCache.get(r.key) ?? r.size, i = l - e;
|
|
363
|
+
i !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(r, i, this) : r.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", i), this._scrollToOffset(this.getScrollOffset(), {
|
|
364
|
+
adjustments: this.scrollAdjustments += i,
|
|
365
|
+
behavior: void 0
|
|
366
|
+
})), this.pendingMeasuredCacheIndexes.push(r.index), this.itemSizeCache = new Map(this.itemSizeCache.set(r.key, l)), this.notify(!1));
|
|
367
|
+
}, this.measureElement = (t) => {
|
|
368
|
+
if (!t) {
|
|
369
|
+
this.elementsCache.forEach((l, r) => {
|
|
370
|
+
l.isConnected || (this.observer.unobserve(l), this.elementsCache.delete(r));
|
|
371
|
+
});
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
this._measureElement(t, void 0);
|
|
375
|
+
}, this.getVirtualItems = N(
|
|
376
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
377
|
+
(t, l) => {
|
|
378
|
+
const r = [];
|
|
379
|
+
for (let e = 0, i = t.length; e < i; e++) {
|
|
380
|
+
const s = t[e], a = l[s];
|
|
381
|
+
r.push(a);
|
|
382
|
+
}
|
|
383
|
+
return r;
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
387
|
+
debug: () => this.options.debug
|
|
388
|
+
}
|
|
389
|
+
), this.getVirtualItemForOffset = (t) => {
|
|
390
|
+
const l = this.getMeasurements();
|
|
391
|
+
if (l.length !== 0)
|
|
392
|
+
return K(
|
|
393
|
+
l[X(
|
|
394
|
+
0,
|
|
395
|
+
l.length - 1,
|
|
396
|
+
(r) => K(l[r]).start,
|
|
397
|
+
t
|
|
398
|
+
)]
|
|
399
|
+
);
|
|
400
|
+
}, this.getOffsetForAlignment = (t, l, r = 0) => {
|
|
401
|
+
const e = this.getSize(), i = this.getScrollOffset();
|
|
402
|
+
l === "auto" && (l = t >= i + e ? "end" : "start"), l === "center" ? t += (r - e) / 2 : l === "end" && (t -= e);
|
|
403
|
+
const s = this.getTotalSize() + this.options.scrollMargin - e;
|
|
404
|
+
return Math.max(Math.min(s, t), 0);
|
|
405
|
+
}, this.getOffsetForIndex = (t, l = "auto") => {
|
|
406
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
407
|
+
const r = this.measurementsCache[t];
|
|
408
|
+
if (!r)
|
|
409
|
+
return;
|
|
410
|
+
const e = this.getSize(), i = this.getScrollOffset();
|
|
411
|
+
if (l === "auto")
|
|
412
|
+
if (r.end >= i + e - this.options.scrollPaddingEnd)
|
|
413
|
+
l = "end";
|
|
414
|
+
else if (r.start <= i + this.options.scrollPaddingStart)
|
|
415
|
+
l = "start";
|
|
416
|
+
else
|
|
417
|
+
return [i, l];
|
|
418
|
+
const s = l === "end" ? r.end + this.options.scrollPaddingEnd : r.start - this.options.scrollPaddingStart;
|
|
419
|
+
return [
|
|
420
|
+
this.getOffsetForAlignment(s, l, r.size),
|
|
421
|
+
l
|
|
422
|
+
];
|
|
423
|
+
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (t, { align: l = "start", behavior: r } = {}) => {
|
|
424
|
+
r === "smooth" && this.isDynamicMode() && console.warn(
|
|
425
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
426
|
+
), this._scrollToOffset(this.getOffsetForAlignment(t, l), {
|
|
427
|
+
adjustments: void 0,
|
|
428
|
+
behavior: r
|
|
429
|
+
});
|
|
430
|
+
}, this.scrollToIndex = (t, { align: l = "auto", behavior: r } = {}) => {
|
|
431
|
+
r === "smooth" && this.isDynamicMode() && console.warn(
|
|
432
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
433
|
+
), t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
434
|
+
let e = 0;
|
|
435
|
+
const i = 10, s = (c) => {
|
|
436
|
+
if (!this.targetWindow) return;
|
|
437
|
+
const h = this.getOffsetForIndex(t, c);
|
|
438
|
+
if (!h) {
|
|
439
|
+
console.warn("Failed to get offset for index:", t);
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
const [u, d] = h;
|
|
443
|
+
this._scrollToOffset(u, { adjustments: void 0, behavior: r }), this.targetWindow.requestAnimationFrame(() => {
|
|
444
|
+
const m = this.getScrollOffset(), f = this.getOffsetForIndex(t, d);
|
|
445
|
+
if (!f) {
|
|
446
|
+
console.warn("Failed to get offset for index:", t);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
ge(f[0], m) || a(d);
|
|
450
|
+
});
|
|
451
|
+
}, a = (c) => {
|
|
452
|
+
this.targetWindow && (e++, e < i ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", e, i), this.targetWindow.requestAnimationFrame(() => s(c))) : console.warn(
|
|
453
|
+
`Failed to scroll to index ${t} after ${i} attempts.`
|
|
454
|
+
));
|
|
455
|
+
};
|
|
456
|
+
s(l);
|
|
457
|
+
}, this.scrollBy = (t, { behavior: l } = {}) => {
|
|
458
|
+
l === "smooth" && this.isDynamicMode() && console.warn(
|
|
459
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
460
|
+
), this._scrollToOffset(this.getScrollOffset() + t, {
|
|
461
|
+
adjustments: void 0,
|
|
462
|
+
behavior: l
|
|
463
|
+
});
|
|
464
|
+
}, this.getTotalSize = () => {
|
|
465
|
+
var t;
|
|
466
|
+
const l = this.getMeasurements();
|
|
467
|
+
let r;
|
|
468
|
+
if (l.length === 0)
|
|
469
|
+
r = this.options.paddingStart;
|
|
470
|
+
else if (this.options.lanes === 1)
|
|
471
|
+
r = ((t = l[l.length - 1]) == null ? void 0 : t.end) ?? 0;
|
|
472
|
+
else {
|
|
473
|
+
const e = Array(this.options.lanes).fill(null);
|
|
474
|
+
let i = l.length - 1;
|
|
475
|
+
for (; i >= 0 && e.some((s) => s === null); ) {
|
|
476
|
+
const s = l[i];
|
|
477
|
+
e[s.lane] === null && (e[s.lane] = s.end), i--;
|
|
478
|
+
}
|
|
479
|
+
r = Math.max(...e.filter((s) => s !== null));
|
|
480
|
+
}
|
|
481
|
+
return Math.max(
|
|
482
|
+
r - this.options.scrollMargin + this.options.paddingEnd,
|
|
483
|
+
0
|
|
484
|
+
);
|
|
485
|
+
}, this._scrollToOffset = (t, {
|
|
486
|
+
adjustments: l,
|
|
487
|
+
behavior: r
|
|
488
|
+
}) => {
|
|
489
|
+
this.options.scrollToFn(t, { behavior: r, adjustments: l }, this);
|
|
490
|
+
}, this.measure = () => {
|
|
491
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
492
|
+
}, this.setOptions(o);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const X = (n, o, t, l) => {
|
|
496
|
+
for (; n <= o; ) {
|
|
497
|
+
const r = (n + o) / 2 | 0, e = t(r);
|
|
498
|
+
if (e < l)
|
|
499
|
+
n = r + 1;
|
|
500
|
+
else if (e > l)
|
|
501
|
+
o = r - 1;
|
|
502
|
+
else
|
|
503
|
+
return r;
|
|
504
|
+
}
|
|
505
|
+
return n > 0 ? n - 1 : 0;
|
|
506
|
+
};
|
|
507
|
+
function Ce({
|
|
508
|
+
measurements: n,
|
|
509
|
+
outerSize: o,
|
|
510
|
+
scrollOffset: t,
|
|
511
|
+
lanes: l
|
|
512
|
+
}) {
|
|
513
|
+
const r = n.length - 1, e = (a) => n[a].start;
|
|
514
|
+
if (n.length <= l)
|
|
515
|
+
return {
|
|
516
|
+
startIndex: 0,
|
|
517
|
+
endIndex: r
|
|
518
|
+
};
|
|
519
|
+
let i = X(
|
|
520
|
+
0,
|
|
521
|
+
r,
|
|
522
|
+
e,
|
|
523
|
+
t
|
|
524
|
+
), s = i;
|
|
525
|
+
if (l === 1)
|
|
526
|
+
for (; s < r && n[s].end < t + o; )
|
|
527
|
+
s++;
|
|
528
|
+
else if (l > 1) {
|
|
529
|
+
const a = Array(l).fill(0);
|
|
530
|
+
for (; s < r && a.some((h) => h < t + o); ) {
|
|
531
|
+
const h = n[s];
|
|
532
|
+
a[h.lane] = h.end, s++;
|
|
533
|
+
}
|
|
534
|
+
const c = Array(l).fill(t + o);
|
|
535
|
+
for (; i >= 0 && c.some((h) => h >= t); ) {
|
|
536
|
+
const h = n[i];
|
|
537
|
+
c[h.lane] = h.start, i--;
|
|
538
|
+
}
|
|
539
|
+
i = Math.max(0, i - i % l), s = Math.min(r, s + (l - 1 - s % l));
|
|
540
|
+
}
|
|
541
|
+
return { startIndex: i, endIndex: s };
|
|
542
|
+
}
|
|
543
|
+
function Ie(n) {
|
|
544
|
+
const o = new xe(A(n)), t = Q(o), l = o._didMount();
|
|
545
|
+
return L(
|
|
546
|
+
() => A(n).getScrollElement(),
|
|
547
|
+
(r) => {
|
|
548
|
+
r && o._willUpdate();
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
immediate: !0
|
|
552
|
+
}
|
|
553
|
+
), L(
|
|
554
|
+
() => A(n),
|
|
555
|
+
(r) => {
|
|
556
|
+
o.setOptions({
|
|
557
|
+
...r,
|
|
558
|
+
onChange: (e, i) => {
|
|
559
|
+
var s;
|
|
560
|
+
j(t), (s = r.onChange) == null || s.call(r, e, i);
|
|
561
|
+
}
|
|
562
|
+
}), o._willUpdate(), j(t);
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
immediate: !0
|
|
566
|
+
}
|
|
567
|
+
), $(l), t;
|
|
568
|
+
}
|
|
569
|
+
function we(n) {
|
|
570
|
+
return Ie(
|
|
571
|
+
Z(() => ({
|
|
572
|
+
observeElementRect: ve,
|
|
573
|
+
observeElementOffset: Oe,
|
|
574
|
+
scrollToFn: Se,
|
|
575
|
+
...A(n)
|
|
576
|
+
}))
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
var V = { exports: {} };
|
|
580
|
+
/*!***************************************************
|
|
581
|
+
* mark.js v8.11.1
|
|
582
|
+
* https://markjs.io/
|
|
583
|
+
* Copyright (c) 2014–2018, Julian Kühnel
|
|
584
|
+
* Released under the MIT license https://git.io/vwTVl
|
|
585
|
+
*****************************************************/
|
|
586
|
+
var Ne = V.exports, G;
|
|
587
|
+
function Me() {
|
|
588
|
+
return G || (G = 1, (function(n, o) {
|
|
589
|
+
(function(t, l) {
|
|
590
|
+
n.exports = l();
|
|
591
|
+
})(Ne, function() {
|
|
592
|
+
class t {
|
|
593
|
+
constructor(e, i = !0, s = [], a = 5e3) {
|
|
594
|
+
this.ctx = e, this.iframes = i, this.exclude = s, this.iframesTimeout = a;
|
|
595
|
+
}
|
|
596
|
+
static matches(e, i) {
|
|
597
|
+
const s = typeof i == "string" ? [i] : i, a = e.matches || e.matchesSelector || e.msMatchesSelector || e.mozMatchesSelector || e.oMatchesSelector || e.webkitMatchesSelector;
|
|
598
|
+
if (a) {
|
|
599
|
+
let c = !1;
|
|
600
|
+
return s.every((h) => !a.call(e, h) || (c = !0, !1)), c;
|
|
601
|
+
}
|
|
602
|
+
return !1;
|
|
603
|
+
}
|
|
604
|
+
getContexts() {
|
|
605
|
+
let e = [];
|
|
606
|
+
return (this.ctx !== void 0 && this.ctx ? NodeList.prototype.isPrototypeOf(this.ctx) ? Array.prototype.slice.call(this.ctx) : Array.isArray(this.ctx) ? this.ctx : typeof this.ctx == "string" ? Array.prototype.slice.call(document.querySelectorAll(this.ctx)) : [this.ctx] : []).forEach((i) => {
|
|
607
|
+
const s = e.filter((a) => a.contains(i)).length > 0;
|
|
608
|
+
e.indexOf(i) !== -1 || s || e.push(i);
|
|
609
|
+
}), e;
|
|
610
|
+
}
|
|
611
|
+
getIframeContents(e, i, s = (() => {
|
|
612
|
+
})) {
|
|
613
|
+
let a;
|
|
614
|
+
try {
|
|
615
|
+
const c = e.contentWindow;
|
|
616
|
+
if (a = c.document, !c || !a) throw new Error("iframe inaccessible");
|
|
617
|
+
} catch {
|
|
618
|
+
s();
|
|
619
|
+
}
|
|
620
|
+
a && i(a);
|
|
621
|
+
}
|
|
622
|
+
isIframeBlank(e) {
|
|
623
|
+
const i = "about:blank", s = e.getAttribute("src").trim();
|
|
624
|
+
return e.contentWindow.location.href === i && s !== i && s;
|
|
625
|
+
}
|
|
626
|
+
observeIframeLoad(e, i, s) {
|
|
627
|
+
let a = !1, c = null;
|
|
628
|
+
const h = () => {
|
|
629
|
+
if (!a) {
|
|
630
|
+
a = !0, clearTimeout(c);
|
|
631
|
+
try {
|
|
632
|
+
this.isIframeBlank(e) || (e.removeEventListener("load", h), this.getIframeContents(e, i, s));
|
|
633
|
+
} catch {
|
|
634
|
+
s();
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
e.addEventListener("load", h), c = setTimeout(h, this.iframesTimeout);
|
|
639
|
+
}
|
|
640
|
+
onIframeReady(e, i, s) {
|
|
641
|
+
try {
|
|
642
|
+
e.contentWindow.document.readyState === "complete" ? this.isIframeBlank(e) ? this.observeIframeLoad(e, i, s) : this.getIframeContents(e, i, s) : this.observeIframeLoad(e, i, s);
|
|
643
|
+
} catch {
|
|
644
|
+
s();
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
waitForIframes(e, i) {
|
|
648
|
+
let s = 0;
|
|
649
|
+
this.forEachIframe(e, () => !0, (a) => {
|
|
650
|
+
s++, this.waitForIframes(a.querySelector("html"), () => {
|
|
651
|
+
--s || i();
|
|
652
|
+
});
|
|
653
|
+
}, (a) => {
|
|
654
|
+
a || i();
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
forEachIframe(e, i, s, a = (() => {
|
|
658
|
+
})) {
|
|
659
|
+
let c = e.querySelectorAll("iframe"), h = c.length, u = 0;
|
|
660
|
+
c = Array.prototype.slice.call(c);
|
|
661
|
+
const d = () => {
|
|
662
|
+
--h <= 0 && a(u);
|
|
663
|
+
};
|
|
664
|
+
h || d(), c.forEach((m) => {
|
|
665
|
+
t.matches(m, this.exclude) ? d() : this.onIframeReady(m, (f) => {
|
|
666
|
+
i(m) && (u++, s(f)), d();
|
|
667
|
+
}, d);
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
createIterator(e, i, s) {
|
|
671
|
+
return document.createNodeIterator(e, i, s, !1);
|
|
672
|
+
}
|
|
673
|
+
createInstanceOnIframe(e) {
|
|
674
|
+
return new t(e.querySelector("html"), this.iframes);
|
|
675
|
+
}
|
|
676
|
+
compareNodeIframe(e, i, s) {
|
|
677
|
+
const a = e.compareDocumentPosition(s), c = Node.DOCUMENT_POSITION_PRECEDING;
|
|
678
|
+
return !!(a & c && (i === null || i.compareDocumentPosition(s) & Node.DOCUMENT_POSITION_FOLLOWING));
|
|
679
|
+
}
|
|
680
|
+
getIteratorNode(e) {
|
|
681
|
+
const i = e.previousNode();
|
|
682
|
+
return { prevNode: i, node: (i === null || e.nextNode()) && e.nextNode() };
|
|
683
|
+
}
|
|
684
|
+
checkIframeFilter(e, i, s, a) {
|
|
685
|
+
let c = !1, h = !1;
|
|
686
|
+
return a.forEach((u, d) => {
|
|
687
|
+
u.val === s && (c = d, h = u.handled);
|
|
688
|
+
}), this.compareNodeIframe(e, i, s) ? (c !== !1 || h ? c === !1 || h || (a[c].handled = !0) : a.push({ val: s, handled: !0 }), !0) : (c === !1 && a.push({ val: s, handled: !1 }), !1);
|
|
689
|
+
}
|
|
690
|
+
handleOpenIframes(e, i, s, a) {
|
|
691
|
+
e.forEach((c) => {
|
|
692
|
+
c.handled || this.getIframeContents(c.val, (h) => {
|
|
693
|
+
this.createInstanceOnIframe(h).forEachNode(i, s, a);
|
|
694
|
+
});
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
iterateThroughNodes(e, i, s, a, c) {
|
|
698
|
+
const h = this.createIterator(i, e, a);
|
|
699
|
+
let u, d, m = [], f = [], p = () => ({ prevNode: d, node: u } = this.getIteratorNode(h), u);
|
|
700
|
+
for (; p(); ) this.iframes && this.forEachIframe(i, (g) => this.checkIframeFilter(u, d, g, m), (g) => {
|
|
701
|
+
this.createInstanceOnIframe(g).forEachNode(e, (O) => f.push(O), a);
|
|
702
|
+
}), f.push(u);
|
|
703
|
+
f.forEach((g) => {
|
|
704
|
+
s(g);
|
|
705
|
+
}), this.iframes && this.handleOpenIframes(m, e, s, a), c();
|
|
706
|
+
}
|
|
707
|
+
forEachNode(e, i, s, a = (() => {
|
|
708
|
+
})) {
|
|
709
|
+
const c = this.getContexts();
|
|
710
|
+
let h = c.length;
|
|
711
|
+
h || a(), c.forEach((u) => {
|
|
712
|
+
const d = () => {
|
|
713
|
+
this.iterateThroughNodes(e, u, i, s, () => {
|
|
714
|
+
--h <= 0 && a();
|
|
715
|
+
});
|
|
716
|
+
};
|
|
717
|
+
this.iframes ? this.waitForIframes(u, d) : d();
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
class l {
|
|
722
|
+
constructor(e) {
|
|
723
|
+
this.ctx = e, this.ie = !1;
|
|
724
|
+
const i = window.navigator.userAgent;
|
|
725
|
+
(i.indexOf("MSIE") > -1 || i.indexOf("Trident") > -1) && (this.ie = !0);
|
|
726
|
+
}
|
|
727
|
+
set opt(e) {
|
|
728
|
+
this._opt = Object.assign({}, { element: "", className: "", exclude: [], iframes: !1, iframesTimeout: 5e3, separateWordSearch: !0, diacritics: !0, synonyms: {}, accuracy: "partially", acrossElements: !1, caseSensitive: !1, ignoreJoiners: !1, ignoreGroups: 0, ignorePunctuation: [], wildcards: "disabled", each: () => {
|
|
729
|
+
}, noMatch: () => {
|
|
730
|
+
}, filter: () => !0, done: () => {
|
|
731
|
+
}, debug: !1, log: window.console }, e);
|
|
732
|
+
}
|
|
733
|
+
get opt() {
|
|
734
|
+
return this._opt;
|
|
735
|
+
}
|
|
736
|
+
get iterator() {
|
|
737
|
+
return new t(this.ctx, this.opt.iframes, this.opt.exclude, this.opt.iframesTimeout);
|
|
738
|
+
}
|
|
739
|
+
log(e, i = "debug") {
|
|
740
|
+
const s = this.opt.log;
|
|
741
|
+
this.opt.debug && typeof s == "object" && typeof s[i] == "function" && s[i](`mark.js: ${e}`);
|
|
742
|
+
}
|
|
743
|
+
escapeStr(e) {
|
|
744
|
+
return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
745
|
+
}
|
|
746
|
+
createRegExp(e) {
|
|
747
|
+
return this.opt.wildcards !== "disabled" && (e = this.setupWildcardsRegExp(e)), e = this.escapeStr(e), Object.keys(this.opt.synonyms).length && (e = this.createSynonymsRegExp(e)), (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) && (e = this.setupIgnoreJoinersRegExp(e)), this.opt.diacritics && (e = this.createDiacriticsRegExp(e)), e = this.createMergedBlanksRegExp(e), (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) && (e = this.createJoinersRegExp(e)), this.opt.wildcards !== "disabled" && (e = this.createWildcardsRegExp(e)), e = this.createAccuracyRegExp(e);
|
|
748
|
+
}
|
|
749
|
+
createSynonymsRegExp(e) {
|
|
750
|
+
const i = this.opt.synonyms, s = this.opt.caseSensitive ? "" : "i", a = this.opt.ignoreJoiners || this.opt.ignorePunctuation.length ? "\0" : "";
|
|
751
|
+
for (let c in i) if (i.hasOwnProperty(c)) {
|
|
752
|
+
const h = i[c], u = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(c) : this.escapeStr(c), d = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(h) : this.escapeStr(h);
|
|
753
|
+
u !== "" && d !== "" && (e = e.replace(new RegExp(`(${this.escapeStr(u)}|${this.escapeStr(d)})`, `gm${s}`), a + `(${this.processSynomyms(u)}|${this.processSynomyms(d)})` + a));
|
|
754
|
+
}
|
|
755
|
+
return e;
|
|
756
|
+
}
|
|
757
|
+
processSynomyms(e) {
|
|
758
|
+
return (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) && (e = this.setupIgnoreJoinersRegExp(e)), e;
|
|
759
|
+
}
|
|
760
|
+
setupWildcardsRegExp(e) {
|
|
761
|
+
return (e = e.replace(/(?:\\)*\?/g, (i) => i.charAt(0) === "\\" ? "?" : "")).replace(/(?:\\)*\*/g, (i) => i.charAt(0) === "\\" ? "*" : "");
|
|
762
|
+
}
|
|
763
|
+
createWildcardsRegExp(e) {
|
|
764
|
+
let i = this.opt.wildcards === "withSpaces";
|
|
765
|
+
return e.replace(/\u0001/g, i ? "[\\S\\s]?" : "\\S?").replace(/\u0002/g, i ? "[\\S\\s]*?" : "\\S*");
|
|
766
|
+
}
|
|
767
|
+
setupIgnoreJoinersRegExp(e) {
|
|
768
|
+
return e.replace(/[^(|)\\]/g, (i, s, a) => {
|
|
769
|
+
let c = a.charAt(s + 1);
|
|
770
|
+
return /[(|)\\]/.test(c) || c === "" ? i : i + "\0";
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
createJoinersRegExp(e) {
|
|
774
|
+
let i = [];
|
|
775
|
+
const s = this.opt.ignorePunctuation;
|
|
776
|
+
return Array.isArray(s) && s.length && i.push(this.escapeStr(s.join(""))), this.opt.ignoreJoiners && i.push("\\u00ad\\u200b\\u200c\\u200d"), i.length ? e.split(/\u0000+/).join(`[${i.join("")}]*`) : e;
|
|
777
|
+
}
|
|
778
|
+
createDiacriticsRegExp(e) {
|
|
779
|
+
const i = this.opt.caseSensitive ? "" : "i", s = this.opt.caseSensitive ? ["aàáảãạăằắẳẵặâầấẩẫậäåāą", "AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ", "cçćč", "CÇĆČ", "dđď", "DĐĎ", "eèéẻẽẹêềếểễệëěēę", "EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ", "iìíỉĩịîïī", "IÌÍỈĨỊÎÏĪ", "lł", "LŁ", "nñňń", "NÑŇŃ", "oòóỏõọôồốổỗộơởỡớờợöøō", "OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ", "rř", "RŘ", "sšśșş", "SŠŚȘŞ", "tťțţ", "TŤȚŢ", "uùúủũụưừứửữựûüůū", "UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ", "yýỳỷỹỵÿ", "YÝỲỶỸỴŸ", "zžżź", "ZŽŻŹ"] : ["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ", "cçćčCÇĆČ", "dđďDĐĎ", "eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ", "iìíỉĩịîïīIÌÍỈĨỊÎÏĪ", "lłLŁ", "nñňńNÑŇŃ", "oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ", "rřRŘ", "sšśșşSŠŚȘŞ", "tťțţTŤȚŢ", "uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ", "yýỳỷỹỵÿYÝỲỶỸỴŸ", "zžżźZŽŻŹ"];
|
|
780
|
+
let a = [];
|
|
781
|
+
return e.split("").forEach((c) => {
|
|
782
|
+
s.every((h) => {
|
|
783
|
+
if (h.indexOf(c) !== -1) {
|
|
784
|
+
if (a.indexOf(h) > -1) return !1;
|
|
785
|
+
e = e.replace(new RegExp(`[${h}]`, `gm${i}`), `[${h}]`), a.push(h);
|
|
786
|
+
}
|
|
787
|
+
return !0;
|
|
788
|
+
});
|
|
789
|
+
}), e;
|
|
790
|
+
}
|
|
791
|
+
createMergedBlanksRegExp(e) {
|
|
792
|
+
return e.replace(/[\s]+/gim, "[\\s]+");
|
|
793
|
+
}
|
|
794
|
+
createAccuracyRegExp(e) {
|
|
795
|
+
const i = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿";
|
|
796
|
+
let s = this.opt.accuracy, a = typeof s == "string" ? s : s.value, c = typeof s == "string" ? [] : s.limiters, h = "";
|
|
797
|
+
switch (c.forEach((u) => {
|
|
798
|
+
h += `|${this.escapeStr(u)}`;
|
|
799
|
+
}), a) {
|
|
800
|
+
case "partially":
|
|
801
|
+
default:
|
|
802
|
+
return `()(${e})`;
|
|
803
|
+
case "complementary":
|
|
804
|
+
return `()([^${h = "\\s" + (h || this.escapeStr(i))}]*${e}[^${h}]*)`;
|
|
805
|
+
case "exactly":
|
|
806
|
+
return `(^|\\s${h})(${e})(?=$|\\s${h})`;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
getSeparatedKeywords(e) {
|
|
810
|
+
let i = [];
|
|
811
|
+
return e.forEach((s) => {
|
|
812
|
+
this.opt.separateWordSearch ? s.split(" ").forEach((a) => {
|
|
813
|
+
a.trim() && i.indexOf(a) === -1 && i.push(a);
|
|
814
|
+
}) : s.trim() && i.indexOf(s) === -1 && i.push(s);
|
|
815
|
+
}), { keywords: i.sort((s, a) => a.length - s.length), length: i.length };
|
|
816
|
+
}
|
|
817
|
+
isNumeric(e) {
|
|
818
|
+
return Number(parseFloat(e)) == e;
|
|
819
|
+
}
|
|
820
|
+
checkRanges(e) {
|
|
821
|
+
if (!Array.isArray(e) || Object.prototype.toString.call(e[0]) !== "[object Object]") return this.log("markRanges() will only accept an array of objects"), this.opt.noMatch(e), [];
|
|
822
|
+
const i = [];
|
|
823
|
+
let s = 0;
|
|
824
|
+
return e.sort((a, c) => a.start - c.start).forEach((a) => {
|
|
825
|
+
let { start: c, end: h, valid: u } = this.callNoMatchOnInvalidRanges(a, s);
|
|
826
|
+
u && (a.start = c, a.length = h - c, i.push(a), s = h);
|
|
827
|
+
}), i;
|
|
828
|
+
}
|
|
829
|
+
callNoMatchOnInvalidRanges(e, i) {
|
|
830
|
+
let s, a, c = !1;
|
|
831
|
+
return e && e.start !== void 0 ? (a = (s = parseInt(e.start, 10)) + parseInt(e.length, 10), this.isNumeric(e.start) && this.isNumeric(e.length) && a - i > 0 && a - s > 0 ? c = !0 : (this.log(`Ignoring invalid or overlapping range: ${JSON.stringify(e)}`), this.opt.noMatch(e))) : (this.log(`Ignoring invalid range: ${JSON.stringify(e)}`), this.opt.noMatch(e)), { start: s, end: a, valid: c };
|
|
832
|
+
}
|
|
833
|
+
checkWhitespaceRanges(e, i, s) {
|
|
834
|
+
let a, c = !0, h = s.length, u = i - h, d = parseInt(e.start, 10) - u;
|
|
835
|
+
return (a = (d = d > h ? h : d) + parseInt(e.length, 10)) > h && (a = h, this.log(`End range automatically set to the max value of ${h}`)), d < 0 || a - d < 0 || d > h || a > h ? (c = !1, this.log(`Invalid range: ${JSON.stringify(e)}`), this.opt.noMatch(e)) : s.substring(d, a).replace(/\s+/g, "") === "" && (c = !1, this.log("Skipping whitespace only range: " + JSON.stringify(e)), this.opt.noMatch(e)), { start: d, end: a, valid: c };
|
|
836
|
+
}
|
|
837
|
+
getTextNodes(e) {
|
|
838
|
+
let i = "", s = [];
|
|
839
|
+
this.iterator.forEachNode(NodeFilter.SHOW_TEXT, (a) => {
|
|
840
|
+
s.push({ start: i.length, end: (i += a.textContent).length, node: a });
|
|
841
|
+
}, (a) => this.matchesExclude(a.parentNode) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT, () => {
|
|
842
|
+
e({ value: i, nodes: s });
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
matchesExclude(e) {
|
|
846
|
+
return t.matches(e, this.opt.exclude.concat(["script", "style", "title", "head", "html"]));
|
|
847
|
+
}
|
|
848
|
+
wrapRangeInTextNode(e, i, s) {
|
|
849
|
+
const a = this.opt.element ? this.opt.element : "mark", c = e.splitText(i), h = c.splitText(s - i);
|
|
850
|
+
let u = document.createElement(a);
|
|
851
|
+
return u.setAttribute("data-markjs", "true"), this.opt.className && u.setAttribute("class", this.opt.className), u.textContent = c.textContent, c.parentNode.replaceChild(u, c), h;
|
|
852
|
+
}
|
|
853
|
+
wrapRangeInMappedTextNode(e, i, s, a, c) {
|
|
854
|
+
e.nodes.every((h, u) => {
|
|
855
|
+
const d = e.nodes[u + 1];
|
|
856
|
+
if (d === void 0 || d.start > i) {
|
|
857
|
+
if (!a(h.node)) return !1;
|
|
858
|
+
const m = i - h.start, f = (s > h.end ? h.end : s) - h.start, p = e.value.substr(0, h.start), g = e.value.substr(f + h.start);
|
|
859
|
+
if (h.node = this.wrapRangeInTextNode(h.node, m, f), e.value = p + g, e.nodes.forEach((O, k) => {
|
|
860
|
+
k >= u && (e.nodes[k].start > 0 && k !== u && (e.nodes[k].start -= f), e.nodes[k].end -= f);
|
|
861
|
+
}), s -= f, c(h.node.previousSibling, h.start), !(s > h.end)) return !1;
|
|
862
|
+
i = h.end;
|
|
863
|
+
}
|
|
864
|
+
return !0;
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
wrapMatches(e, i, s, a, c) {
|
|
868
|
+
const h = i === 0 ? 0 : i + 1;
|
|
869
|
+
this.getTextNodes((u) => {
|
|
870
|
+
u.nodes.forEach((d) => {
|
|
871
|
+
let m;
|
|
872
|
+
for (d = d.node; (m = e.exec(d.textContent)) !== null && m[h] !== ""; ) {
|
|
873
|
+
if (!s(m[h], d)) continue;
|
|
874
|
+
let f = m.index;
|
|
875
|
+
if (h !== 0) for (let p = 1; p < h; p++) f += m[p].length;
|
|
876
|
+
d = this.wrapRangeInTextNode(d, f, f + m[h].length), a(d.previousSibling), e.lastIndex = 0;
|
|
877
|
+
}
|
|
878
|
+
}), c();
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
wrapMatchesAcrossElements(e, i, s, a, c) {
|
|
882
|
+
const h = i === 0 ? 0 : i + 1;
|
|
883
|
+
this.getTextNodes((u) => {
|
|
884
|
+
let d;
|
|
885
|
+
for (; (d = e.exec(u.value)) !== null && d[h] !== ""; ) {
|
|
886
|
+
let m = d.index;
|
|
887
|
+
if (h !== 0) for (let p = 1; p < h; p++) m += d[p].length;
|
|
888
|
+
const f = m + d[h].length;
|
|
889
|
+
this.wrapRangeInMappedTextNode(u, m, f, (p) => s(d[h], p), (p, g) => {
|
|
890
|
+
e.lastIndex = g, a(p);
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
c();
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
wrapRangeFromIndex(e, i, s, a) {
|
|
897
|
+
this.getTextNodes((c) => {
|
|
898
|
+
const h = c.value.length;
|
|
899
|
+
e.forEach((u, d) => {
|
|
900
|
+
let { start: m, end: f, valid: p } = this.checkWhitespaceRanges(u, h, c.value);
|
|
901
|
+
p && this.wrapRangeInMappedTextNode(c, m, f, (g) => i(g, u, c.value.substring(m, f), d), (g) => {
|
|
902
|
+
s(g, u);
|
|
903
|
+
});
|
|
904
|
+
}), a();
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
unwrapMatches(e) {
|
|
908
|
+
const i = e.parentNode;
|
|
909
|
+
let s = document.createDocumentFragment();
|
|
910
|
+
for (; e.firstChild; ) s.appendChild(e.removeChild(e.firstChild));
|
|
911
|
+
i.replaceChild(s, e), this.ie ? this.normalizeTextNode(i) : i.normalize();
|
|
912
|
+
}
|
|
913
|
+
normalizeTextNode(e) {
|
|
914
|
+
if (e) {
|
|
915
|
+
if (e.nodeType === 3) for (; e.nextSibling && e.nextSibling.nodeType === 3; ) e.nodeValue += e.nextSibling.nodeValue, e.parentNode.removeChild(e.nextSibling);
|
|
916
|
+
else this.normalizeTextNode(e.firstChild);
|
|
917
|
+
this.normalizeTextNode(e.nextSibling);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
markRegExp(e, i) {
|
|
921
|
+
this.opt = i, this.log(`Searching with expression "${e}"`);
|
|
922
|
+
let s = 0, a = "wrapMatches";
|
|
923
|
+
const c = (h) => {
|
|
924
|
+
s++, this.opt.each(h);
|
|
925
|
+
};
|
|
926
|
+
this.opt.acrossElements && (a = "wrapMatchesAcrossElements"), this[a](e, this.opt.ignoreGroups, (h, u) => this.opt.filter(u, h, s), c, () => {
|
|
927
|
+
s === 0 && this.opt.noMatch(e), this.opt.done(s);
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
mark(e, i) {
|
|
931
|
+
this.opt = i;
|
|
932
|
+
let s = 0, a = "wrapMatches";
|
|
933
|
+
const { keywords: c, length: h } = this.getSeparatedKeywords(typeof e == "string" ? [e] : e), u = this.opt.caseSensitive ? "" : "i", d = (m) => {
|
|
934
|
+
let f = new RegExp(this.createRegExp(m), `gm${u}`), p = 0;
|
|
935
|
+
this.log(`Searching with expression "${f}"`), this[a](f, 1, (g, O) => this.opt.filter(O, m, s, p), (g) => {
|
|
936
|
+
p++, s++, this.opt.each(g);
|
|
937
|
+
}, () => {
|
|
938
|
+
p === 0 && this.opt.noMatch(m), c[h - 1] === m ? this.opt.done(s) : d(c[c.indexOf(m) + 1]);
|
|
939
|
+
});
|
|
940
|
+
};
|
|
941
|
+
this.opt.acrossElements && (a = "wrapMatchesAcrossElements"), h === 0 ? this.opt.done(s) : d(c[0]);
|
|
942
|
+
}
|
|
943
|
+
markRanges(e, i) {
|
|
944
|
+
this.opt = i;
|
|
945
|
+
let s = 0, a = this.checkRanges(e);
|
|
946
|
+
a && a.length ? (this.log("Starting to mark with the following ranges: " + JSON.stringify(a)), this.wrapRangeFromIndex(a, (c, h, u, d) => this.opt.filter(c, h, u, d), (c, h) => {
|
|
947
|
+
s++, this.opt.each(c, h);
|
|
948
|
+
}, () => {
|
|
949
|
+
this.opt.done(s);
|
|
950
|
+
})) : this.opt.done(s);
|
|
951
|
+
}
|
|
952
|
+
unmark(e) {
|
|
953
|
+
this.opt = e;
|
|
954
|
+
let i = this.opt.element ? this.opt.element : "*";
|
|
955
|
+
i += "[data-markjs]", this.opt.className && (i += `.${this.opt.className}`), this.log(`Removal selector "${i}"`), this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, (s) => {
|
|
956
|
+
this.unwrapMatches(s);
|
|
957
|
+
}, (s) => {
|
|
958
|
+
const a = t.matches(s, i), c = this.matchesExclude(s);
|
|
959
|
+
return !a || c ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
960
|
+
}, this.opt.done);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
return function(r) {
|
|
964
|
+
const e = new l(r);
|
|
965
|
+
return this.mark = ((i, s) => (e.mark(i, s), this)), this.markRegExp = ((i, s) => (e.markRegExp(i, s), this)), this.markRanges = ((i, s) => (e.markRanges(i, s), this)), this.unmark = ((i) => (e.unmark(i), this)), this;
|
|
966
|
+
};
|
|
967
|
+
});
|
|
968
|
+
})(V)), V.exports;
|
|
969
|
+
}
|
|
970
|
+
var Te = Me();
|
|
971
|
+
const ze = /* @__PURE__ */ le(Te);
|
|
972
|
+
function U(n) {
|
|
973
|
+
return JSON.parse(JSON.stringify(n));
|
|
974
|
+
}
|
|
975
|
+
const _e = {
|
|
976
|
+
name: "IbTreeSelect",
|
|
977
|
+
inject: ["LANG_COMPONENTS"],
|
|
978
|
+
mixins: [ue],
|
|
979
|
+
props: {
|
|
980
|
+
classList: [String, Array],
|
|
981
|
+
keywordHighlighter: {
|
|
982
|
+
type: Boolean,
|
|
983
|
+
default: !0
|
|
984
|
+
},
|
|
985
|
+
placeholder: {
|
|
986
|
+
type: String,
|
|
987
|
+
default: ""
|
|
988
|
+
},
|
|
989
|
+
searchPlaceholderText: {
|
|
990
|
+
type: String,
|
|
991
|
+
default: ""
|
|
992
|
+
},
|
|
993
|
+
clearButtonMessage: {
|
|
994
|
+
type: String,
|
|
995
|
+
default: ""
|
|
996
|
+
},
|
|
997
|
+
showClearButton: {
|
|
998
|
+
type: Boolean,
|
|
999
|
+
default: !0
|
|
1000
|
+
},
|
|
1001
|
+
isResizable: {
|
|
1002
|
+
type: Boolean,
|
|
1003
|
+
default: !1
|
|
1004
|
+
},
|
|
1005
|
+
menuSize: {
|
|
1006
|
+
type: [String, Number]
|
|
1007
|
+
},
|
|
1008
|
+
initialSize: {
|
|
1009
|
+
left: 0,
|
|
1010
|
+
right: 0
|
|
1011
|
+
},
|
|
1012
|
+
ariaLabel: {
|
|
1013
|
+
type: String,
|
|
1014
|
+
default: ""
|
|
1015
|
+
},
|
|
1016
|
+
name: String,
|
|
1017
|
+
id: {
|
|
1018
|
+
type: String,
|
|
1019
|
+
default() {
|
|
1020
|
+
return W();
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
options: {
|
|
1024
|
+
type: [Array, Function],
|
|
1025
|
+
default() {
|
|
1026
|
+
return [];
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
modelValue: {
|
|
1030
|
+
type: [Number, String, Array]
|
|
1031
|
+
},
|
|
1032
|
+
value: {
|
|
1033
|
+
type: [Number, String, Array],
|
|
1034
|
+
default() {
|
|
1035
|
+
return [];
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
maxSelectedNames: {
|
|
1039
|
+
type: Number,
|
|
1040
|
+
default: 2
|
|
1041
|
+
},
|
|
1042
|
+
isMultiple: {
|
|
1043
|
+
type: Boolean,
|
|
1044
|
+
default: !0
|
|
1045
|
+
},
|
|
1046
|
+
parentAutoCheck: {
|
|
1047
|
+
type: Boolean,
|
|
1048
|
+
default: null
|
|
1049
|
+
},
|
|
1050
|
+
strings: {
|
|
1051
|
+
type: Object,
|
|
1052
|
+
default() {
|
|
1053
|
+
return {};
|
|
1054
|
+
}
|
|
1055
|
+
},
|
|
1056
|
+
onlyEndNodes: {
|
|
1057
|
+
type: Boolean,
|
|
1058
|
+
default: !1
|
|
1059
|
+
},
|
|
1060
|
+
isRequired: {
|
|
1061
|
+
type: Boolean,
|
|
1062
|
+
default: !0
|
|
1063
|
+
},
|
|
1064
|
+
htmlOptionTitle: {
|
|
1065
|
+
type: Boolean,
|
|
1066
|
+
default: !1
|
|
1067
|
+
},
|
|
1068
|
+
isBookmarkable: {
|
|
1069
|
+
type: Boolean,
|
|
1070
|
+
default: !1
|
|
1071
|
+
},
|
|
1072
|
+
initBookmarks: {
|
|
1073
|
+
type: Array,
|
|
1074
|
+
default: () => []
|
|
1075
|
+
},
|
|
1076
|
+
showInputs: {
|
|
1077
|
+
type: Boolean,
|
|
1078
|
+
default(n) {
|
|
1079
|
+
return n.isMultiple;
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
dependency: {
|
|
1083
|
+
type: String
|
|
1084
|
+
},
|
|
1085
|
+
filterId: {
|
|
1086
|
+
type: String,
|
|
1087
|
+
default() {
|
|
1088
|
+
return W();
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
staticPlaceholder: {
|
|
1092
|
+
type: Boolean,
|
|
1093
|
+
default: !1
|
|
1094
|
+
},
|
|
1095
|
+
useSearch: {
|
|
1096
|
+
type: Boolean,
|
|
1097
|
+
default: !1
|
|
1098
|
+
},
|
|
1099
|
+
isWatching: {
|
|
1100
|
+
type: Boolean,
|
|
1101
|
+
default: !1
|
|
1102
|
+
},
|
|
1103
|
+
vertical: {
|
|
1104
|
+
type: String
|
|
1105
|
+
},
|
|
1106
|
+
emptyMessage: {
|
|
1107
|
+
type: String,
|
|
1108
|
+
default: ""
|
|
1109
|
+
},
|
|
1110
|
+
errorMessage: {
|
|
1111
|
+
type: String,
|
|
1112
|
+
default: ""
|
|
1113
|
+
},
|
|
1114
|
+
allOptions: {
|
|
1115
|
+
type: Boolean,
|
|
1116
|
+
default: !0
|
|
1117
|
+
},
|
|
1118
|
+
watchClearValue: {
|
|
1119
|
+
type: Boolean,
|
|
1120
|
+
default: !1
|
|
1121
|
+
},
|
|
1122
|
+
isToggle: {
|
|
1123
|
+
type: Boolean,
|
|
1124
|
+
default: !1
|
|
1125
|
+
},
|
|
1126
|
+
alphabetSort: {
|
|
1127
|
+
type: Boolean,
|
|
1128
|
+
default: !1
|
|
1129
|
+
},
|
|
1130
|
+
disable: {
|
|
1131
|
+
type: Boolean,
|
|
1132
|
+
default: !1
|
|
1133
|
+
},
|
|
1134
|
+
searchDebounce: {
|
|
1135
|
+
type: Number,
|
|
1136
|
+
default: 500
|
|
1137
|
+
},
|
|
1138
|
+
alphabeticStyle: {
|
|
1139
|
+
type: Boolean,
|
|
1140
|
+
default: !1
|
|
1141
|
+
},
|
|
1142
|
+
initialDependencyValue: {
|
|
1143
|
+
type: Object
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
emits: [
|
|
1147
|
+
"close",
|
|
1148
|
+
"input",
|
|
1149
|
+
"blur",
|
|
1150
|
+
"search",
|
|
1151
|
+
"resize",
|
|
1152
|
+
"submit",
|
|
1153
|
+
"clearValue",
|
|
1154
|
+
"toggle-bookmarked-option",
|
|
1155
|
+
"update:modelValue"
|
|
1156
|
+
],
|
|
1157
|
+
watch: {
|
|
1158
|
+
value(n) {
|
|
1159
|
+
this.val = n, (!Array.isArray(n) || n.join(",") !== Object.keys(this.selected).join(",")) && this.setPreparedValues(this.actualOptions, !1);
|
|
1160
|
+
},
|
|
1161
|
+
modelValue: {
|
|
1162
|
+
handler(n) {
|
|
1163
|
+
if (this.isInternalChange) return;
|
|
1164
|
+
this.val = n, this.val = n, (!Array.isArray(n) || n.join(",") !== Object.keys(this.selected).join(",")) && this.setPreparedValues(this.actualOptions, !1);
|
|
1165
|
+
const o = new Set(Array.isArray(n) ? n : [n].filter(Boolean));
|
|
1166
|
+
this.syncCheckedBySet(o);
|
|
1167
|
+
},
|
|
1168
|
+
deep: !0
|
|
1169
|
+
},
|
|
1170
|
+
val(n) {
|
|
1171
|
+
this.watchClearValue && (!n || Array.isArray(n) && !n.length) && this.setPreparedValues(this.actualOptions).then(() => {
|
|
1172
|
+
const o = Object.keys(this.selected);
|
|
1173
|
+
this.$globalEvents.$emit("select-" + this.filterId + ":update", {
|
|
1174
|
+
values: o,
|
|
1175
|
+
filter: this.filterId
|
|
1176
|
+
});
|
|
1177
|
+
});
|
|
1178
|
+
},
|
|
1179
|
+
options: {
|
|
1180
|
+
handler(n) {
|
|
1181
|
+
this.initialOptions = typeof n == "function" ? n : U(n);
|
|
1182
|
+
},
|
|
1183
|
+
deep: !0
|
|
1184
|
+
},
|
|
1185
|
+
initialOptions(n) {
|
|
1186
|
+
let o = !0;
|
|
1187
|
+
if (typeof n == "function")
|
|
1188
|
+
o = !1;
|
|
1189
|
+
else {
|
|
1190
|
+
const t = [], l = n;
|
|
1191
|
+
Array.prototype.forEach.call(l, (r) => {
|
|
1192
|
+
r.id !== void 0 && t.push(r.id);
|
|
1193
|
+
}), o = JSON.stringify(t) === JSON.stringify(this.optionsIdsWatch), this.optionsIdsWatch = t;
|
|
1194
|
+
}
|
|
1195
|
+
(this.isInitialized && !o || this.isWatching) && this.setPreparedValues().then(() => {
|
|
1196
|
+
const t = Object.keys(this.selected);
|
|
1197
|
+
this.$globalEvents.$emit("select-" + this.filterId + ":update", {
|
|
1198
|
+
values: t,
|
|
1199
|
+
filter: this.filterId
|
|
1200
|
+
});
|
|
1201
|
+
});
|
|
1202
|
+
},
|
|
1203
|
+
dependency(n, o) {
|
|
1204
|
+
this.$nextTick(() => {
|
|
1205
|
+
this.registerDependency(o);
|
|
1206
|
+
});
|
|
1207
|
+
},
|
|
1208
|
+
initBookmarks() {
|
|
1209
|
+
this.actualBookmarkedOptions = {}, this.setBookmarkedOptions(this.actualOptions);
|
|
1210
|
+
},
|
|
1211
|
+
initialDependencyValue(n) {
|
|
1212
|
+
this.dependencyValue = n, this.hasFilledDependency && this.$nextTick(() => {
|
|
1213
|
+
this.loadValues();
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
mounted() {
|
|
1218
|
+
this.marker = new ze(this.$refs.list.$el), this.registerDependency(), this.$globalEvents.$on("select:refresh", () => {
|
|
1219
|
+
this.setPreparedValues();
|
|
1220
|
+
}), document.addEventListener("mousemove", this.onResize), document.addEventListener("mouseup", this.endResizing);
|
|
1221
|
+
},
|
|
1222
|
+
data() {
|
|
1223
|
+
var n, o, t, l, r, e, i, s;
|
|
1224
|
+
return this.defaultFilter = pe((a) => {
|
|
1225
|
+
var h;
|
|
1226
|
+
this.marker.unmark();
|
|
1227
|
+
const c = this.filterString.toLowerCase().trim();
|
|
1228
|
+
this.countVisibleChildren = this.filterFunc.call(this, a, c), c && this.keywordHighlighter && this.marker.mark(c), (h = this.virtualizer) == null || h.measure();
|
|
1229
|
+
}, 1e3), {
|
|
1230
|
+
virtualizer: null,
|
|
1231
|
+
initialOptions: typeof this.options == "function" ? this.options : U(this.options),
|
|
1232
|
+
val: this.modelValue ? this.modelValue : this.value,
|
|
1233
|
+
size: {
|
|
1234
|
+
left: this.initialSize && this.initialSize.left || 0,
|
|
1235
|
+
right: this.initialSize && this.initialSize.right || 0
|
|
1236
|
+
},
|
|
1237
|
+
resizingProp: null,
|
|
1238
|
+
isInitialized: !1,
|
|
1239
|
+
isLoading: !1,
|
|
1240
|
+
isOpen: !1,
|
|
1241
|
+
optionsIdsWatch: [],
|
|
1242
|
+
actualName: this.isMultiple ? this.name + "[]" : this.name,
|
|
1243
|
+
parentAutoCheckVal: this.parentAutoCheck !== null ? this.parentAutoCheck : this.isMultiple,
|
|
1244
|
+
filterString: "",
|
|
1245
|
+
actualOptions: [],
|
|
1246
|
+
actualBookmarkedOptions: {},
|
|
1247
|
+
selected: [],
|
|
1248
|
+
verticalVal: this.vertical ?? "bottom",
|
|
1249
|
+
allOptionsIsChecked: !0,
|
|
1250
|
+
hasTreeChildren: !1,
|
|
1251
|
+
uid: `f${(~~(Math.random() * 1e8)).toString(16)}`,
|
|
1252
|
+
focusedOptionId: "",
|
|
1253
|
+
actualStrings: {
|
|
1254
|
+
searchPlaceholder: lang(
|
|
1255
|
+
this.searchPlaceholderText.length ? this.searchPlaceholderText : "search_placeholder",
|
|
1256
|
+
(n = this.LANG_COMPONENTS) == null ? void 0 : n.COMPONENT_SELECT
|
|
1257
|
+
),
|
|
1258
|
+
emptyTitle: lang(
|
|
1259
|
+
"empty_title",
|
|
1260
|
+
(o = this.LANG_COMPONENTS) == null ? void 0 : o.COMPONENT_SELECT
|
|
1261
|
+
),
|
|
1262
|
+
selectAllOptions: lang(
|
|
1263
|
+
"all_options",
|
|
1264
|
+
(t = this.LANG_COMPONENTS) == null ? void 0 : t.COMPONENT_SELECT
|
|
1265
|
+
),
|
|
1266
|
+
allSelected: lang(
|
|
1267
|
+
"all_selected",
|
|
1268
|
+
(l = this.LANG_COMPONENTS) == null ? void 0 : l.COMPONENT_SELECT
|
|
1269
|
+
),
|
|
1270
|
+
loading: lang("loading", (r = this.LANG_COMPONENTS) == null ? void 0 : r.COMPONENT_SELECT) + "...",
|
|
1271
|
+
selectedCount: lang(
|
|
1272
|
+
"selected_count",
|
|
1273
|
+
(e = this.LANG_COMPONENTS) == null ? void 0 : e.COMPONENT_SELECT
|
|
1274
|
+
),
|
|
1275
|
+
buttonTitle: this.buttonTitle || lang("button_title", (i = this.LANG_COMPONENTS) == null ? void 0 : i.COMPONENT_SELECT),
|
|
1276
|
+
requiredDependencyNotFilled: (
|
|
1277
|
+
// eslint-disable-next-line vue/no-computed-properties-in-data
|
|
1278
|
+
this.requiredDependencyNotFilled || lang(
|
|
1279
|
+
"required_dependency_are_not_filled",
|
|
1280
|
+
(s = this.LANG_COMPONENTS) == null ? void 0 : s.COMPONENT_SELECT
|
|
1281
|
+
)
|
|
1282
|
+
),
|
|
1283
|
+
...this.strings
|
|
1284
|
+
},
|
|
1285
|
+
dependencyValue: this.initialDependencyValue,
|
|
1286
|
+
isInternalChange: !1,
|
|
1287
|
+
nodeIndex: /* @__PURE__ */ new Map()
|
|
1288
|
+
};
|
|
1289
|
+
},
|
|
1290
|
+
methods: {
|
|
1291
|
+
toggleDuplicateOptionsFast(n, o) {
|
|
1292
|
+
const t = this.nodeIndex.get(n);
|
|
1293
|
+
if (t)
|
|
1294
|
+
for (const l of t) l.checked = o;
|
|
1295
|
+
},
|
|
1296
|
+
buildNodeIndex() {
|
|
1297
|
+
this.nodeIndex.clear(), this.traverseTree(this.actualOptions, (n) => {
|
|
1298
|
+
this.nodeIndex.has(n.id) || this.nodeIndex.set(n.id, []), this.nodeIndex.get(n.id).push(n);
|
|
1299
|
+
});
|
|
1300
|
+
},
|
|
1301
|
+
syncCheckedBySet(n) {
|
|
1302
|
+
this.traverseTree(this.actualOptions, (o) => {
|
|
1303
|
+
const t = n.has(o.id);
|
|
1304
|
+
o.checked !== t && (o.checked = t);
|
|
1305
|
+
}), this.selected = {}, this.traverseTree(this.actualOptions, (o) => {
|
|
1306
|
+
o.checked && (!this.onlyEndNodes || !o.children) && (this.selected[o.id] = o);
|
|
1307
|
+
}), this.allOptionsIsChecked = this.checkIfOptionsChecked(this.actualOptions);
|
|
1308
|
+
},
|
|
1309
|
+
onBlur() {
|
|
1310
|
+
setTimeout(() => {
|
|
1311
|
+
this.isOpen || this.$emit("blur");
|
|
1312
|
+
}, 200);
|
|
1313
|
+
},
|
|
1314
|
+
inputKeyupDown() {
|
|
1315
|
+
this.focusOnFirstOptions();
|
|
1316
|
+
},
|
|
1317
|
+
comboboxKeyupDown() {
|
|
1318
|
+
if (this.showSearch) {
|
|
1319
|
+
this.$refs.search.focus();
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
this.focusOnFirstOptions();
|
|
1323
|
+
},
|
|
1324
|
+
focus() {
|
|
1325
|
+
this.$refs.combobox.focus();
|
|
1326
|
+
},
|
|
1327
|
+
focusOnFirstOptions() {
|
|
1328
|
+
this.$refs.list.$el.querySelector("[tabindex]:not(hidden)").focus();
|
|
1329
|
+
},
|
|
1330
|
+
startResizing(n) {
|
|
1331
|
+
this.resizingProp = n;
|
|
1332
|
+
},
|
|
1333
|
+
endResizing() {
|
|
1334
|
+
this.resizingProp && (this.resizingProp = null, this.$emit("resize", this.size));
|
|
1335
|
+
},
|
|
1336
|
+
onResize(n) {
|
|
1337
|
+
switch (this.resizingProp) {
|
|
1338
|
+
case "left":
|
|
1339
|
+
this.size.left = Math.max(this.size.left - n.movementX, 0);
|
|
1340
|
+
break;
|
|
1341
|
+
case "right":
|
|
1342
|
+
this.size.right = Math.max(this.size.right + n.movementX, 0);
|
|
1343
|
+
break;
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
registerDependency(n) {
|
|
1347
|
+
this.dependency ? (this.$globalEvents.$on(
|
|
1348
|
+
"select-" + this.dependency + ":update",
|
|
1349
|
+
(o) => {
|
|
1350
|
+
this.clear(), this.dependencyValue = o, this.dependencyValue && this.dependencyValue.values && (!Array.isArray(this.dependencyValue.values) || this.dependencyValue.values.length) && this.setPreparedValues();
|
|
1351
|
+
}
|
|
1352
|
+
), this.isLoading = !1, !n && this.hasFilledDependency && this.setPreparedValues()) : (this.$globalEvents.$off("select-" + n + ":update"), this.setPreparedValues().then(() => {
|
|
1353
|
+
const o = Object.keys(this.selected);
|
|
1354
|
+
this.$globalEvents.$emit("select-" + this.filterId + ":update", {
|
|
1355
|
+
values: o,
|
|
1356
|
+
filter: this.filterId
|
|
1357
|
+
});
|
|
1358
|
+
}));
|
|
1359
|
+
},
|
|
1360
|
+
loadValues() {
|
|
1361
|
+
this.setPreparedValues().then(() => {
|
|
1362
|
+
if (!this.dependency) {
|
|
1363
|
+
const n = Object.keys(this.selected);
|
|
1364
|
+
Array.isArray(this.options) && !this.options.length || this.$globalEvents.$emit("select-" + this.filterId + ":update", { values: n, filter: this.filterId });
|
|
1365
|
+
}
|
|
1366
|
+
this.$emit("loaded", this.dependencyValue);
|
|
1367
|
+
});
|
|
1368
|
+
},
|
|
1369
|
+
filter(n, o) {
|
|
1370
|
+
this.filterString = n, this.$emit("search", this.filterString), this.defaultFilter(o);
|
|
1371
|
+
},
|
|
1372
|
+
setPreparedValues(n) {
|
|
1373
|
+
let o = n || this.initialOptions;
|
|
1374
|
+
return this.alphabetSort && (o = o.sort(
|
|
1375
|
+
(t, l) => t.title.toLowerCase().localeCompare(l.title.toLowerCase())
|
|
1376
|
+
)), this.prepare(o).then(([t, l]) => {
|
|
1377
|
+
this.actualOptions = t, this.buildNodeIndex(), this.allOptionsIsChecked = this.checkIfOptionsChecked(t), this.isInitialized = !0, this.selected = l, this.setBookmarkedOptions(t);
|
|
1378
|
+
});
|
|
1379
|
+
},
|
|
1380
|
+
clear() {
|
|
1381
|
+
this.actualOptions = [], this.allOptionsIsChecked = !1, this.countVisibleChildren = 0, this.selected = [];
|
|
1382
|
+
},
|
|
1383
|
+
clearValue() {
|
|
1384
|
+
this.traverseTree(this.actualOptions, (o) => o.checked = !1), this.clear(), this.isInternalChange = !0;
|
|
1385
|
+
const n = this.isMultiple ? [] : null;
|
|
1386
|
+
this.$emit("update:modelValue", n), this.$emit("input", n), this.$emit("clear-value", n), this.$nextTick(() => this.isInternalChange = !1), this.setPreparedValues();
|
|
1387
|
+
},
|
|
1388
|
+
prepare(n, o = !0) {
|
|
1389
|
+
return new Promise((t) => {
|
|
1390
|
+
const l = {}, r = [];
|
|
1391
|
+
let e = Promise.resolve();
|
|
1392
|
+
typeof n == "function" ? (this.isLoading = !0, this.dependency && (n = n.bind(null, this.dependencyValue)), e = e.then(n)) : e = e.then(() => n), e.then((i) => (this.isLoading = !1, i.forEach((s) => {
|
|
1393
|
+
s.initiallyVisible = typeof s.visible > "u" ? !0 : s.visible, s.visible = s.initiallyVisible, s.readonly = !!s.readonly, s.checked = this.isMultiple ? this.val !== null && this.val.findIndex((a) => s.id == a) > -1 : this.val !== null && this.val == s.id, s.checked && (!this.onlyEndNodes || !s.children) && (l[s.id] = s), s.children && (this.hasTreeChildren = !0, s.isChildrenVisible = !1), r.push(
|
|
1394
|
+
new Promise((a) => {
|
|
1395
|
+
s.children ? this.prepare(s.children).then(
|
|
1396
|
+
([c, h]) => {
|
|
1397
|
+
s.children = c, this.parentAutoCheckVal && (s.checked = this.checkIfOptionsChecked(
|
|
1398
|
+
s.children
|
|
1399
|
+
)), Object.assign(l, h), a(s);
|
|
1400
|
+
}
|
|
1401
|
+
) : a(s);
|
|
1402
|
+
})
|
|
1403
|
+
);
|
|
1404
|
+
}), Promise.all(r).then((s) => {
|
|
1405
|
+
t([s, l]);
|
|
1406
|
+
}))).catch((i) => {
|
|
1407
|
+
throw this.isLoading = !1, i;
|
|
1408
|
+
});
|
|
1409
|
+
});
|
|
1410
|
+
},
|
|
1411
|
+
filterFunc(n, o) {
|
|
1412
|
+
let t = 0;
|
|
1413
|
+
return n.forEach((l) => {
|
|
1414
|
+
let r = l.initiallyVisible && l.title && l.title.toString().toLowerCase().includes(o) && !this.actualBookmarkedOptions[l.id];
|
|
1415
|
+
if (l.children && l.children.length) {
|
|
1416
|
+
let e = this.filterFunc(l.children, o);
|
|
1417
|
+
t += e, e && (l.isChildrenVisible = o.length > 0 || !!Object.keys(this.actualBookmarkedOptions).length, l.isDisabled = e < l.children.length && !this.isBookmarkable), r ? e || (r = !1) : r = !!e;
|
|
1418
|
+
}
|
|
1419
|
+
l.visible = r, r && t++;
|
|
1420
|
+
}), t;
|
|
1421
|
+
},
|
|
1422
|
+
submit() {
|
|
1423
|
+
this.change();
|
|
1424
|
+
const n = Object.keys(this.selected);
|
|
1425
|
+
this.$globalEvents.$emit("select-" + this.filterId + ":submit", {
|
|
1426
|
+
values: n,
|
|
1427
|
+
filter: this.filterId
|
|
1428
|
+
}), this.$emit("submit");
|
|
1429
|
+
},
|
|
1430
|
+
change() {
|
|
1431
|
+
const n = Object.keys(this.selected);
|
|
1432
|
+
this.isInternalChange = !0, this.isMultiple ? (this.$emit("update:modelValue", n), this.$emit("input", n)) : (this.$emit("update:modelValue", n[0]), this.$emit("input", n[0])), this.$nextTick(() => this.isInternalChange = !1), this.$globalEvents.$emit("select-" + this.filterId + ":update", { values: n, filter: this.filterId }), this.isMultiple || this.$refs.dropdown.close();
|
|
1433
|
+
},
|
|
1434
|
+
checkIfOptionsChecked(n) {
|
|
1435
|
+
return n.every((o) => o.checked || o.readonly);
|
|
1436
|
+
},
|
|
1437
|
+
registerCheck(n, o, t) {
|
|
1438
|
+
var l;
|
|
1439
|
+
if (o) {
|
|
1440
|
+
if (n.checked = !0, this.isMultiple && !(this.onlyEndNodes && ((l = n.children) != null && l.length)))
|
|
1441
|
+
this.selected[n.id] = n;
|
|
1442
|
+
else if (!this.isMultiple) {
|
|
1443
|
+
const r = Object.keys(this.selected)[0];
|
|
1444
|
+
r && (this.selected[r].checked = !1), this.selected = { [n.id]: n }, this.change();
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1447
|
+
} else
|
|
1448
|
+
delete this.selected[n.id], n.checked = !1;
|
|
1449
|
+
if (this.toggleDuplicateOptionsFast(n.id, o), t && (this.allOptionsIsChecked = this.checkIfOptionsChecked(this.actualOptions)), this.isMultiple) {
|
|
1450
|
+
this.isInternalChange = !0;
|
|
1451
|
+
const r = Object.keys(this.selected);
|
|
1452
|
+
this.$emit("update:modelValue", r), this.$emit("input", r), this.$nextTick(() => this.isInternalChange = !1);
|
|
1453
|
+
}
|
|
1454
|
+
},
|
|
1455
|
+
toggleDuplicateOptions(n, o, t) {
|
|
1456
|
+
for (let l of n)
|
|
1457
|
+
l.id === o && (l.checked = t), l.children && this.toggleDuplicateOptions(l.children, o, t);
|
|
1458
|
+
},
|
|
1459
|
+
manageAll() {
|
|
1460
|
+
this.allOptionsIsChecked = !this.allOptionsIsChecked, this.traverseTree(this.actualOptions, (n) => {
|
|
1461
|
+
n.readonly || this.registerCheck(n, this.allOptionsIsChecked, !1);
|
|
1462
|
+
});
|
|
1463
|
+
},
|
|
1464
|
+
traverseTree(n, o) {
|
|
1465
|
+
n.forEach((t) => {
|
|
1466
|
+
o(t), t.children && t.children.length && this.traverseTree(t.children, o);
|
|
1467
|
+
});
|
|
1468
|
+
},
|
|
1469
|
+
getArrayOptions(n) {
|
|
1470
|
+
let o = [];
|
|
1471
|
+
for (let t of n)
|
|
1472
|
+
o.push(t), t.children && (o = o.concat(this.getArrayOptions(t.children)));
|
|
1473
|
+
return o;
|
|
1474
|
+
},
|
|
1475
|
+
toggleBookmark(n) {
|
|
1476
|
+
this.actualBookmarkedOptions[n.id] ? delete this.actualBookmarkedOptions[n.id] : this.actualBookmarkedOptions[n.id] = n, this.$emit("toggle-bookmarked-option", n.id), this.filter(this.filterString, this.actualOptions);
|
|
1477
|
+
},
|
|
1478
|
+
setBookmarkedOptions(n) {
|
|
1479
|
+
n.forEach((o) => {
|
|
1480
|
+
o.children && o.children.length ? this.setBookmarkedOptions(o.children) : this.initBookmarks.includes(o.id) && (this.actualBookmarkedOptions[o.id] = o);
|
|
1481
|
+
}), this.filter(this.filterString, n);
|
|
1482
|
+
},
|
|
1483
|
+
onClose() {
|
|
1484
|
+
this.isOpen = !1, this.filterString = "", this.filterFunc(this.actualOptions, this.filterString), this.isMultiple ? this.$emit("close", Object.keys(this.selected)) : this.$emit("close", Object.keys(this.selected)[0]), this.virtualizer = null, this.$emit("blur"), this.verticalVal = this.vertical ?? "bottom";
|
|
1485
|
+
},
|
|
1486
|
+
onOpen() {
|
|
1487
|
+
var o;
|
|
1488
|
+
const n = document.documentElement.scrollHeight;
|
|
1489
|
+
this.isOpen = !0, this.virtualizer || (this.virtualizer = we({
|
|
1490
|
+
count: this.actualOptions.length,
|
|
1491
|
+
getScrollElement: () => this.$refs.parentRef,
|
|
1492
|
+
estimateSize: () => 40,
|
|
1493
|
+
overscan: 8
|
|
1494
|
+
})), (o = this.virtualizer) == null || o.measure(), this.vertical !== "bottom" && this.$nextTick(() => {
|
|
1495
|
+
document.documentElement.scrollHeight > n && (this.verticalVal = "top");
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
},
|
|
1499
|
+
computed: {
|
|
1500
|
+
hasTrigger() {
|
|
1501
|
+
return !!this.$slots.trigger;
|
|
1502
|
+
},
|
|
1503
|
+
hasTriggerContent() {
|
|
1504
|
+
return !!this.$slots.triggerContent;
|
|
1505
|
+
},
|
|
1506
|
+
hasEmptyMessage() {
|
|
1507
|
+
return !!this.$slots.emptyMessage;
|
|
1508
|
+
},
|
|
1509
|
+
treeDropPos() {
|
|
1510
|
+
return this.menuSize ? {
|
|
1511
|
+
width: this.menuSize + "px",
|
|
1512
|
+
maxWidth: this.menuSize + "px",
|
|
1513
|
+
minWidth: this.menuSize + "px"
|
|
1514
|
+
} : {
|
|
1515
|
+
width: "auto",
|
|
1516
|
+
position: "absolute",
|
|
1517
|
+
left: -this.size.left + "px",
|
|
1518
|
+
right: -this.size.right + "px"
|
|
1519
|
+
};
|
|
1520
|
+
},
|
|
1521
|
+
hasHierarchy() {
|
|
1522
|
+
return this.actualOptions.some((n) => n.children);
|
|
1523
|
+
},
|
|
1524
|
+
selectedKeys() {
|
|
1525
|
+
return Object.keys(this.selected).filter((n) => {
|
|
1526
|
+
if (!this.onlyEndNodes || !this.selected[n].children)
|
|
1527
|
+
return !0;
|
|
1528
|
+
});
|
|
1529
|
+
},
|
|
1530
|
+
selectStatus() {
|
|
1531
|
+
return this.staticPlaceholder ? this.placeholder : this.isLoading ? this.actualStrings.loading : this.selectedKeys.length ? this.selectedKeys.length < this.maxSelectedNames ? this.selectedKeys.map((n) => this.selected[n].title).join(",") : this.allOptionsIsChecked ? this.actualStrings.allSelected : this.actualStrings.selectedCount.replace("{selected}", this.selectedKeys.length).replace("{all}", this.optionsCount) : this.emptyMessage;
|
|
1532
|
+
},
|
|
1533
|
+
isEmpty() {
|
|
1534
|
+
return Array.isArray(this.value) ? !this.value.length : !this.value;
|
|
1535
|
+
},
|
|
1536
|
+
requiredDependencyNotFilled() {
|
|
1537
|
+
return this.dependency && (!this.dependencyValue || !this.dependencyValue.values || !this.dependencyValue.values.length);
|
|
1538
|
+
},
|
|
1539
|
+
showSearch() {
|
|
1540
|
+
return this.useSearch || this.optionsCount > 10 && !this.alphabeticStyle;
|
|
1541
|
+
},
|
|
1542
|
+
arrayOfOptions() {
|
|
1543
|
+
return this.getArrayOptions(this.actualOptions);
|
|
1544
|
+
},
|
|
1545
|
+
optionsCount() {
|
|
1546
|
+
let n = [];
|
|
1547
|
+
for (let o of this.arrayOfOptions)
|
|
1548
|
+
(!this.onlyEndNodes || !o.children) && !n.includes(o.id) && n.push(o.id);
|
|
1549
|
+
return n.length;
|
|
1550
|
+
},
|
|
1551
|
+
visibleOptionsCount() {
|
|
1552
|
+
let n = [];
|
|
1553
|
+
return this.traverseTree(this.actualOptions, (o) => {
|
|
1554
|
+
(!this.onlyEndNodes || !o.children) && !n.includes(o.id) && o.visible && n.push(o.id);
|
|
1555
|
+
}), n.length + (this.isBookmarkable ? Object.keys(this.actualBookmarkedOptions).length : 0);
|
|
1556
|
+
},
|
|
1557
|
+
hasFilledDependency() {
|
|
1558
|
+
var n, o, t;
|
|
1559
|
+
return !!(this.dependency && this.dependencyValue && ((n = this.dependencyValue) != null && n.values) && (!Array.isArray((o = this.dependencyValue) == null ? void 0 : o.values) || (t = this.dependencyValue) != null && t.values.length));
|
|
1560
|
+
}
|
|
1561
|
+
},
|
|
1562
|
+
components: {
|
|
1563
|
+
IbAlert: ce,
|
|
1564
|
+
IbIconButton: he,
|
|
1565
|
+
IbIcon: ae,
|
|
1566
|
+
IbDropdown: oe,
|
|
1567
|
+
IbInput: ne,
|
|
1568
|
+
List: de,
|
|
1569
|
+
"select-option": re
|
|
1570
|
+
},
|
|
1571
|
+
directives: {
|
|
1572
|
+
Tooltip: fe
|
|
1573
|
+
},
|
|
1574
|
+
beforeUnmount() {
|
|
1575
|
+
document.removeEventListener("mousemove", this.onResize), document.removeEventListener("mouseup", this.endResizing);
|
|
1576
|
+
},
|
|
1577
|
+
inheritAttrs: !1
|
|
1578
|
+
}, Re = {
|
|
1579
|
+
key: 0,
|
|
1580
|
+
class: "tree-select-empty"
|
|
1581
|
+
}, Ae = {
|
|
1582
|
+
key: 1,
|
|
1583
|
+
class: "tree-select-default-empty tree-select-empty"
|
|
1584
|
+
}, Ve = {
|
|
1585
|
+
key: 4,
|
|
1586
|
+
class: "scrollable-container"
|
|
1587
|
+
}, Be = { ref: "parentRef" }, De = ["data-index"], Pe = {
|
|
1588
|
+
key: 5,
|
|
1589
|
+
ref: "infinityLoader"
|
|
1590
|
+
};
|
|
1591
|
+
function Fe(n, o, t, l, r, e) {
|
|
1592
|
+
const i = E("ib-alert"), s = E("ib-icon"), a = E("ib-icon-button"), c = E("ib-input"), h = E("select-option"), u = E("list"), d = E("ib-dropdown"), m = ee("tooltip");
|
|
1593
|
+
return y(), b(M, null, [
|
|
1594
|
+
t.errorMessage ? (y(), S(i, {
|
|
1595
|
+
key: 0,
|
|
1596
|
+
class: "tree-select-error"
|
|
1597
|
+
}, {
|
|
1598
|
+
default: C(() => [
|
|
1599
|
+
te(z(t.errorMessage), 1)
|
|
1600
|
+
]),
|
|
1601
|
+
_: 1
|
|
1602
|
+
})) : v("", !0),
|
|
1603
|
+
x("div", se(Object.fromEntries(Object.entries(n.$attrs).filter(([f]) => f.startsWith("data-"))), {
|
|
1604
|
+
class: ["tree-select", {
|
|
1605
|
+
...t.classList,
|
|
1606
|
+
"tree-select-custom-trigger-content": e.hasTriggerContent,
|
|
1607
|
+
"disabled-parent-autocheck": t.parentAutoCheck === !1
|
|
1608
|
+
}]
|
|
1609
|
+
}), [
|
|
1610
|
+
_(d, {
|
|
1611
|
+
disabled: r.isLoading || t.disable,
|
|
1612
|
+
"is-resizable": t.isResizable,
|
|
1613
|
+
vertical: r.verticalVal,
|
|
1614
|
+
class: I({
|
|
1615
|
+
disable: t.disable
|
|
1616
|
+
}),
|
|
1617
|
+
ref: "dropdown",
|
|
1618
|
+
onClose: e.onClose,
|
|
1619
|
+
onOpen: e.onOpen
|
|
1620
|
+
}, ie({
|
|
1621
|
+
body: C(() => [
|
|
1622
|
+
x("div", {
|
|
1623
|
+
class: I(["tree-drop", { "not-tree-child": !r.hasTreeChildren }]),
|
|
1624
|
+
style: B(e.treeDropPos),
|
|
1625
|
+
role: "listbox"
|
|
1626
|
+
}, [
|
|
1627
|
+
t.isResizable ? (y(), b("div", {
|
|
1628
|
+
key: 0,
|
|
1629
|
+
class: "ib-dropdown-resizer ib-dropdown-resizer-left",
|
|
1630
|
+
onMousedown: o[6] || (o[6] = (f) => e.startResizing("left"))
|
|
1631
|
+
}, null, 32)) : v("", !0),
|
|
1632
|
+
t.isResizable ? R((y(), b("div", {
|
|
1633
|
+
key: 1,
|
|
1634
|
+
class: "ib-dropdown-resizer ib-dropdown-resizer-right",
|
|
1635
|
+
onMousedown: o[7] || (o[7] = (f) => e.startResizing("right"))
|
|
1636
|
+
}, null, 544)), [
|
|
1637
|
+
[
|
|
1638
|
+
m,
|
|
1639
|
+
n.lang("resize_list", "select"),
|
|
1640
|
+
void 0,
|
|
1641
|
+
{ rightCenter: !0 }
|
|
1642
|
+
]
|
|
1643
|
+
]) : v("", !0),
|
|
1644
|
+
e.showSearch ? (y(), S(c, {
|
|
1645
|
+
key: 2,
|
|
1646
|
+
class: "tree-search",
|
|
1647
|
+
ref: "search",
|
|
1648
|
+
autocomplete: "new-password",
|
|
1649
|
+
"show-icon": !0,
|
|
1650
|
+
value: r.filterString,
|
|
1651
|
+
debounce: t.searchDebounce,
|
|
1652
|
+
"aria-label": t.searchPlaceholderText ? t.searchPlaceholderText : r.actualStrings.searchPlaceholder,
|
|
1653
|
+
placeholder: t.searchPlaceholderText ? t.searchPlaceholderText : r.actualStrings.searchPlaceholder,
|
|
1654
|
+
onInput: o[8] || (o[8] = (f) => e.filter(f, r.actualOptions)),
|
|
1655
|
+
onKeyup: w(e.inputKeyupDown, ["down"])
|
|
1656
|
+
}, null, 8, ["value", "debounce", "aria-label", "placeholder", "onKeyup"])) : v("", !0),
|
|
1657
|
+
_(u, {
|
|
1658
|
+
ref: "list",
|
|
1659
|
+
role: "listbox",
|
|
1660
|
+
class: I({
|
|
1661
|
+
"tree-select-list": !0,
|
|
1662
|
+
"has-hierarchy": e.hasHierarchy,
|
|
1663
|
+
"alphabetic-list": t.alphabeticStyle
|
|
1664
|
+
})
|
|
1665
|
+
}, {
|
|
1666
|
+
default: C(() => {
|
|
1667
|
+
var f, p;
|
|
1668
|
+
return [
|
|
1669
|
+
!e.requiredDependencyNotFilled && !e.visibleOptionsCount && e.hasEmptyMessage ? (y(), b("div", Re, [
|
|
1670
|
+
D(n.$slots, "emptyMessage")
|
|
1671
|
+
])) : !e.requiredDependencyNotFilled && !e.visibleOptionsCount ? (y(), b("div", Ae, z(r.actualStrings.emptyTitle), 1)) : v("", !0),
|
|
1672
|
+
R(x("div", { class: "tree-select-empty" }, z(r.actualStrings.requiredDependencyNotFilled), 513), [
|
|
1673
|
+
[P, e.requiredDependencyNotFilled]
|
|
1674
|
+
]),
|
|
1675
|
+
!t.isMultiple && !t.isRequired && r.actualOptions.length > 0 ? (y(), S(h, {
|
|
1676
|
+
key: 2,
|
|
1677
|
+
option: {
|
|
1678
|
+
title: n.lang("none", "select"),
|
|
1679
|
+
id: null,
|
|
1680
|
+
checked: e.isEmpty
|
|
1681
|
+
},
|
|
1682
|
+
name: r.actualName,
|
|
1683
|
+
"parent-auto-check": r.parentAutoCheckVal,
|
|
1684
|
+
"is-multiple": t.isMultiple,
|
|
1685
|
+
role: "option",
|
|
1686
|
+
onCheck: e.registerCheck,
|
|
1687
|
+
onToggleBookmark: e.toggleBookmark,
|
|
1688
|
+
uid: r.uid,
|
|
1689
|
+
"only-end-nodes": t.onlyEndNodes,
|
|
1690
|
+
"show-input": t.showInputs
|
|
1691
|
+
}, null, 8, ["option", "name", "parent-auto-check", "is-multiple", "onCheck", "onToggleBookmark", "uid", "only-end-nodes", "show-input"])) : v("", !0),
|
|
1692
|
+
Object.keys(r.actualBookmarkedOptions).length > 0 ? (y(!0), b(M, { key: 3 }, F(r.actualBookmarkedOptions, (g) => (y(), S(h, {
|
|
1693
|
+
key: "bookmark" + g.id,
|
|
1694
|
+
class: "bookmarked-option",
|
|
1695
|
+
option: g,
|
|
1696
|
+
"parent-auto-check": !1,
|
|
1697
|
+
"is-multiple": t.isMultiple,
|
|
1698
|
+
"is-bookmarkable": !0,
|
|
1699
|
+
"is-bookmarked": !0,
|
|
1700
|
+
role: "option",
|
|
1701
|
+
onCheck: e.registerCheck,
|
|
1702
|
+
onToggleBookmark: e.toggleBookmark,
|
|
1703
|
+
uid: r.uid,
|
|
1704
|
+
"only-end-nodes": t.onlyEndNodes,
|
|
1705
|
+
"html-title": t.htmlOptionTitle,
|
|
1706
|
+
"show-input": t.showInputs
|
|
1707
|
+
}, null, 8, ["option", "is-multiple", "onCheck", "onToggleBookmark", "uid", "only-end-nodes", "html-title", "show-input"]))), 128)) : v("", !0),
|
|
1708
|
+
e.requiredDependencyNotFilled ? v("", !0) : (y(), b("div", Ve, [
|
|
1709
|
+
t.allOptions && !t.alphabeticStyle && t.isMultiple && e.visibleOptionsCount && !e.requiredDependencyNotFilled ? (y(), S(h, {
|
|
1710
|
+
key: 0,
|
|
1711
|
+
option: {
|
|
1712
|
+
title: r.actualStrings.selectAllOptions,
|
|
1713
|
+
initiallyVisible: !0,
|
|
1714
|
+
visible: !0,
|
|
1715
|
+
isDisabled: e.visibleOptionsCount < e.optionsCount,
|
|
1716
|
+
checked: r.allOptionsIsChecked,
|
|
1717
|
+
isIndeterminate: !!Object.keys(r.selected).length
|
|
1718
|
+
},
|
|
1719
|
+
"is-toggle": t.isToggle,
|
|
1720
|
+
"parent-auto-check": !1,
|
|
1721
|
+
"is-multiple": t.isMultiple,
|
|
1722
|
+
"is-bookmarkable": !1,
|
|
1723
|
+
uid: r.uid,
|
|
1724
|
+
"only-end-nodes": t.onlyEndNodes,
|
|
1725
|
+
"show-input": t.showInputs,
|
|
1726
|
+
"alphabetic-style": t.alphabeticStyle,
|
|
1727
|
+
role: "option",
|
|
1728
|
+
onCheck: e.manageAll,
|
|
1729
|
+
onOnFocus: o[9] || (o[9] = (g) => r.focusedOptionId = g)
|
|
1730
|
+
}, null, 8, ["option", "is-toggle", "is-multiple", "uid", "only-end-nodes", "show-input", "alphabetic-style", "onCheck"])) : v("", !0),
|
|
1731
|
+
x("div", Be, [
|
|
1732
|
+
x("div", {
|
|
1733
|
+
style: B({
|
|
1734
|
+
height: ((f = r.virtualizer) == null ? void 0 : f.getTotalSize()) + "px",
|
|
1735
|
+
position: "relative"
|
|
1736
|
+
})
|
|
1737
|
+
}, [
|
|
1738
|
+
(y(!0), b(M, null, F((p = r.virtualizer) == null ? void 0 : p.getVirtualItems(), (g) => (y(), b("div", {
|
|
1739
|
+
key: g.index,
|
|
1740
|
+
"data-index": g.index,
|
|
1741
|
+
ref_for: !0,
|
|
1742
|
+
ref: r.virtualizer.measureElement,
|
|
1743
|
+
style: B({
|
|
1744
|
+
position: "absolute",
|
|
1745
|
+
top: 0,
|
|
1746
|
+
left: 0,
|
|
1747
|
+
width: "100%",
|
|
1748
|
+
transform: `translateY(${g.start}px)`
|
|
1749
|
+
})
|
|
1750
|
+
}, [
|
|
1751
|
+
r.actualOptions[g.index] ? R((y(), S(h, {
|
|
1752
|
+
key: 0,
|
|
1753
|
+
option: r.actualOptions[g.index],
|
|
1754
|
+
"is-toggle": t.isToggle,
|
|
1755
|
+
name: r.actualName,
|
|
1756
|
+
role: "option",
|
|
1757
|
+
"parent-auto-check": r.parentAutoCheckVal,
|
|
1758
|
+
"is-multiple": t.isMultiple,
|
|
1759
|
+
"is-bookmarkable": t.isBookmarkable,
|
|
1760
|
+
uid: r.uid,
|
|
1761
|
+
"only-end-nodes": t.onlyEndNodes,
|
|
1762
|
+
"html-title": t.htmlOptionTitle,
|
|
1763
|
+
"show-input": t.showInputs,
|
|
1764
|
+
"alphabetic-style": t.alphabeticStyle,
|
|
1765
|
+
onCheck: e.registerCheck,
|
|
1766
|
+
onToggleBookmark: e.toggleBookmark,
|
|
1767
|
+
onOnFocus: o[10] || (o[10] = (O) => r.focusedOptionId = O)
|
|
1768
|
+
}, null, 8, ["option", "is-toggle", "name", "parent-auto-check", "is-multiple", "is-bookmarkable", "uid", "only-end-nodes", "html-title", "show-input", "alphabetic-style", "onCheck", "onToggleBookmark"])), [
|
|
1769
|
+
[P, r.actualOptions[g.index].visible && !r.actualOptions[g.index].hidden]
|
|
1770
|
+
]) : v("", !0)
|
|
1771
|
+
], 12, De))), 128))
|
|
1772
|
+
], 4)
|
|
1773
|
+
], 512)
|
|
1774
|
+
])),
|
|
1775
|
+
n.infiniteLoader ? (y(), b("div", Pe, null, 512)) : v("", !0)
|
|
1776
|
+
];
|
|
1777
|
+
}),
|
|
1778
|
+
_: 3
|
|
1779
|
+
}, 8, ["class"])
|
|
1780
|
+
], 6)
|
|
1781
|
+
]),
|
|
1782
|
+
_: 2
|
|
1783
|
+
}, [
|
|
1784
|
+
e.hasTrigger ? {
|
|
1785
|
+
name: "trigger",
|
|
1786
|
+
fn: C(() => [
|
|
1787
|
+
D(n.$slots, "trigger", {
|
|
1788
|
+
selectedCount: e.selectedKeys.length,
|
|
1789
|
+
isOpen: r.isOpen
|
|
1790
|
+
})
|
|
1791
|
+
]),
|
|
1792
|
+
key: "0"
|
|
1793
|
+
} : {
|
|
1794
|
+
name: "trigger",
|
|
1795
|
+
fn: C(({ isOpened: f }) => [
|
|
1796
|
+
x("div", {
|
|
1797
|
+
role: "combobox",
|
|
1798
|
+
tabindex: "0",
|
|
1799
|
+
class: I(["tree-choice", {
|
|
1800
|
+
"tree-choice-opened": f,
|
|
1801
|
+
"has-clear-button": t.showClearButton,
|
|
1802
|
+
"tree-choice-error": t.errorMessage
|
|
1803
|
+
}]),
|
|
1804
|
+
ref: "combobox",
|
|
1805
|
+
"aria-expanded": f,
|
|
1806
|
+
onClick: o[2] || (o[2] = T(() => {
|
|
1807
|
+
}, ["prevent"])),
|
|
1808
|
+
onBlur: o[3] || (o[3] = (...p) => e.onBlur && e.onBlur(...p)),
|
|
1809
|
+
onKeyup: [
|
|
1810
|
+
o[4] || (o[4] = w((...p) => e.comboboxKeyupDown && e.comboboxKeyupDown(...p), ["down"])),
|
|
1811
|
+
o[5] || (o[5] = w((...p) => e.comboboxKeyupDown && e.comboboxKeyupDown(...p), ["up"]))
|
|
1812
|
+
],
|
|
1813
|
+
"aria-label": t.ariaLabel,
|
|
1814
|
+
"aria-activedescendant": r.focusedOptionId
|
|
1815
|
+
}, [
|
|
1816
|
+
e.hasTriggerContent ? D(n.$slots, "triggerContent", {
|
|
1817
|
+
key: 0,
|
|
1818
|
+
selectedCount: e.selectedKeys.length,
|
|
1819
|
+
isOpen: f
|
|
1820
|
+
}) : (y(), b(M, { key: 1 }, [
|
|
1821
|
+
t.htmlOptionTitle ? (y(), b("span", {
|
|
1822
|
+
key: 0,
|
|
1823
|
+
class: I({ placeholder: !e.selectStatus }),
|
|
1824
|
+
innerHTML: e.selectStatus || t.placeholder
|
|
1825
|
+
}, null, 10, ["innerHTML"])) : (y(), b("span", {
|
|
1826
|
+
key: 1,
|
|
1827
|
+
class: I({ placeholder: !e.selectStatus })
|
|
1828
|
+
}, z(e.selectStatus || t.placeholder), 3))
|
|
1829
|
+
], 64)),
|
|
1830
|
+
t.showClearButton ? R((y(), S(a, {
|
|
1831
|
+
key: 2,
|
|
1832
|
+
kind: "ghost",
|
|
1833
|
+
class: "button-clear",
|
|
1834
|
+
"aria-label": "Clear selection",
|
|
1835
|
+
onClick: T(e.clearValue, ["prevent"]),
|
|
1836
|
+
onKeypress: o[0] || (o[0] = w(T(() => {
|
|
1837
|
+
}, ["stop", "prevent"]), ["enter"])),
|
|
1838
|
+
onKeydown: o[1] || (o[1] = w(T(() => {
|
|
1839
|
+
}, ["stop", "prevent"]), ["enter"])),
|
|
1840
|
+
onKeyup: w(T(e.clearValue, ["prevent"]), ["enter"]),
|
|
1841
|
+
"help-text": t.clearButtonMessage
|
|
1842
|
+
}, {
|
|
1843
|
+
default: C(() => [
|
|
1844
|
+
_(s, { name: "close-outline" })
|
|
1845
|
+
]),
|
|
1846
|
+
_: 1
|
|
1847
|
+
}, 8, ["onClick", "onKeyup", "help-text"])), [
|
|
1848
|
+
[P, Object.keys(r.selected).length]
|
|
1849
|
+
]) : v("", !0),
|
|
1850
|
+
_(s, {
|
|
1851
|
+
name: f ? "chevron-up-outline" : "chevron-down-outline",
|
|
1852
|
+
classes: "tree-select-caret"
|
|
1853
|
+
}, null, 8, ["name"]),
|
|
1854
|
+
(y(!0), b(M, null, F(e.selectedKeys, (p) => (y(), b("input", {
|
|
1855
|
+
type: "hidden",
|
|
1856
|
+
key: "hidden-" + p,
|
|
1857
|
+
name: r.actualName,
|
|
1858
|
+
value: p
|
|
1859
|
+
}, null, 8, ["name", "value"]))), 128))
|
|
1860
|
+
], 42, ["aria-expanded", "aria-label", "aria-activedescendant"])
|
|
1861
|
+
]),
|
|
1862
|
+
key: "1"
|
|
1863
|
+
}
|
|
1864
|
+
]), 1032, ["disabled", "is-resizable", "vertical", "class", "onClose", "onOpen"])
|
|
1865
|
+
], 16)
|
|
1866
|
+
], 64);
|
|
1867
|
+
}
|
|
1868
|
+
const et = /* @__PURE__ */ me(_e, [["render", Fe]]);
|
|
1869
|
+
export {
|
|
1870
|
+
et as default
|
|
1871
|
+
};
|