@knime/jsonforms 0.1.4
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/CHANGELOG.md +37 -0
- package/LICENSE +710 -0
- package/README.md +125 -0
- package/dist/AnyOfTwinlist-GJ6LGkM1.js +17 -0
- package/dist/ArrayLayout-CbpSgf0X.js +487 -0
- package/dist/ButtonControl-CVu36jz8.js +127 -0
- package/dist/CheckboxControl-DYFLb-qW.js +50 -0
- package/dist/Checkboxes-DlhdiWWA.js +103 -0
- package/dist/CheckboxesControl-DYV72Aua.js +39 -0
- package/dist/ColumnFilter-BbweAsmq.js +17 -0
- package/dist/ColumnSelect-aw7cYcWC.js +60 -0
- package/dist/ComboBoxControl-BqVUWz4q.js +600 -0
- package/dist/CredentialsControl-Ci6ZEuKM.js +20 -0
- package/dist/CredentialsControlBase-CxYOD3ne.js +110 -0
- package/dist/DateControl-ZyQ_vmOW.js +30 -0
- package/dist/DateTimeControl-anye7xvC.js +4 -0
- package/dist/DropdownControl-JX1LF5Tk.js +4 -0
- package/dist/DropdownControl.vue_vue_type_script_setup_true_lang-B5dPfH3x.js +171 -0
- package/dist/DynamicValuesControl-CFubOaRb.js +127 -0
- package/dist/FileChooserControl-Cf_UaWqV.js +605 -0
- package/dist/FileExplorerTab-Ba76jD3y.js +3951 -0
- package/dist/HorizontalLayout-5irQmhXp.js +39 -0
- package/dist/IntegerControl-CqHJWRgn.js +13 -0
- package/dist/IntervalControl-BUhs5_lc.js +549 -0
- package/dist/LayoutComponentWrapper-CDw9BDq5.js +36 -0
- package/dist/LegacyCredentialsControl-DxRZcRVo.js +62 -0
- package/dist/LocalFileChooserControl-DxSeiKxg.js +57 -0
- package/dist/MenuItems.vue_vue_type_style_index_0_lang-qMVpH9oC.js +464 -0
- package/dist/MultiselectListBox-C4ZnJvJJ.js +579 -0
- package/dist/NameFilter-D6EI_V08.js +17 -0
- package/dist/NodeDialog.vue.d.ts +8 -0
- package/dist/NumberControl-DLo0LCsi.js +13 -0
- package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-B69hrnY1.js +43 -0
- package/dist/NumberInput-BdL-jZ-i.js +219 -0
- package/dist/OneOfDropdown-BmbbuaZk.js +15 -0
- package/dist/RadioControl-GbwpOdAy.js +13 -0
- package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-BlImm9is.js +128 -0
- package/dist/RichTextControl-CGY3rdM7.js +16895 -0
- package/dist/SectionLayout-CqSFyj1K.js +54 -0
- package/dist/SimpleButtonControl-BgOrTGEP.js +59 -0
- package/dist/SimpleTwinlistControl-ByOlLGIN.js +68 -0
- package/dist/SortListControl-Dege54Dj.js +316 -0
- package/dist/TextAreaControl-CKviHabr.js +111 -0
- package/dist/TextControl-CPL48j4B.js +49 -0
- package/dist/TimeControl-CGsLRgR3.js +842 -0
- package/dist/TwinlistControl-C4XaH_Xc.js +587 -0
- package/dist/TwinlistLoadingInfo-CFlSBQXn.js +1057 -0
- package/dist/ValueSwitch-B9oWSkM_.js +138 -0
- package/dist/ValueSwitchControl-4ODpL58f.js +13 -0
- package/dist/VennDiagramLayout-CabCs-fX.js +104 -0
- package/dist/VerticalLayout-D5HeZyKY.js +39 -0
- package/dist/VerticalLayoutBase-C0PZ-y5d.js +20 -0
- package/dist/arrow-next-CvdR0-WC.js +17 -0
- package/dist/arrow-up-Dsq3EgtE.js +30 -0
- package/dist/createMissingItem-B00Kg95q.js +4 -0
- package/dist/floating-ui.vue.esm-CIFBDytk.js +94 -0
- package/dist/getFlattenedSettings-D64OwqpI.js +7 -0
- package/dist/index-ZDm2GXeD.js +32714 -0
- package/dist/index.d.ts +3 -0
- package/dist/knime-jsonforms.js +5 -0
- package/dist/layoutComponents/Form.vue.d.ts +2 -0
- package/dist/link-BA69Hfx6.js +17 -0
- package/dist/loading/LoadingDialog.vue.d.ts +2 -0
- package/dist/navigator-BYUFe-z3.js +8 -0
- package/dist/style.css +1 -0
- package/dist/useHideOnNull-CCfNP3O7.js +42 -0
- package/package.json +74 -0
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import { openBlock as h, createElementBlock as u, mergeProps as x, withModifiers as a, toDisplayString as y, toRef as p, watch as I, resolveComponent as v, normalizeClass as C, normalizeStyle as w, createElementVNode as f, withKeys as d, normalizeProps as V, guardReactiveProps as k, Fragment as H, renderList as B, createBlock as g, resolveDynamicComponent as D, createCommentVNode as b, createVNode as K } from "vue";
|
|
2
|
+
import { _ as S, aJ as N } from "./index-ZDm2GXeD.js";
|
|
3
|
+
const A = (e, t) => {
|
|
4
|
+
let i, n = 0;
|
|
5
|
+
return (...r) => {
|
|
6
|
+
const [s, o] = r;
|
|
7
|
+
clearTimeout(i);
|
|
8
|
+
const l = Date.now();
|
|
9
|
+
l - n > t ? (n = l, e(s, o)) : i = setTimeout(() => {
|
|
10
|
+
n = l, e(s, o);
|
|
11
|
+
}, t);
|
|
12
|
+
};
|
|
13
|
+
}, L = {
|
|
14
|
+
name: "StyledListItem",
|
|
15
|
+
props: {
|
|
16
|
+
text: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: " "
|
|
19
|
+
},
|
|
20
|
+
selected: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
invalid: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Styles the item distinct to the other ones by adding a margin, adjusting the font-style and -height and
|
|
34
|
+
* rounding the corners
|
|
35
|
+
*/
|
|
36
|
+
special: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
lineHeight: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: null
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
emits: [
|
|
46
|
+
"mousedown",
|
|
47
|
+
"mousemove",
|
|
48
|
+
"dblclick-exact",
|
|
49
|
+
"dblclick-shift",
|
|
50
|
+
"click"
|
|
51
|
+
]
|
|
52
|
+
}, T = ["title", "aria-selected"];
|
|
53
|
+
function O(e, t, i, n, r, s) {
|
|
54
|
+
return h(), u("li", x(e.$attrs, {
|
|
55
|
+
role: "option",
|
|
56
|
+
title: i.text,
|
|
57
|
+
style: {
|
|
58
|
+
...i.lineHeight !== null ? { lineHeight: `${i.lineHeight}px` } : {}
|
|
59
|
+
},
|
|
60
|
+
class: {
|
|
61
|
+
selected: i.selected,
|
|
62
|
+
invalid: i.invalid,
|
|
63
|
+
empty: !i.text.trim(),
|
|
64
|
+
disabled: i.disabled,
|
|
65
|
+
special: i.special
|
|
66
|
+
},
|
|
67
|
+
"aria-selected": i.selected,
|
|
68
|
+
onClick: t[0] || (t[0] = (o) => e.$emit("click", o)),
|
|
69
|
+
onDblclick: [
|
|
70
|
+
t[1] || (t[1] = a((o) => e.$emit("dblclick-shift"), ["shift"])),
|
|
71
|
+
t[2] || (t[2] = a((o) => e.$emit("dblclick-exact"), ["exact"]))
|
|
72
|
+
],
|
|
73
|
+
onMousedown: t[3] || (t[3] = (o) => e.$emit("mousedown", o)),
|
|
74
|
+
onMousemove: t[4] || (t[4] = (o) => e.$emit("mousemove", o))
|
|
75
|
+
}), y(i.text), 17, T);
|
|
76
|
+
}
|
|
77
|
+
const z = /* @__PURE__ */ S(L, [["render", O], ["__scopeId", "data-v-561778e1"]]);
|
|
78
|
+
let M = 0;
|
|
79
|
+
const P = 250, E = {
|
|
80
|
+
name: "MultiselectListBox",
|
|
81
|
+
components: { StyledListItem: z },
|
|
82
|
+
props: {
|
|
83
|
+
id: {
|
|
84
|
+
type: String,
|
|
85
|
+
default() {
|
|
86
|
+
return `MultiselectListBox-${M++}`;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
modelValue: {
|
|
90
|
+
type: Array,
|
|
91
|
+
default: () => []
|
|
92
|
+
},
|
|
93
|
+
disabled: {
|
|
94
|
+
default: !1,
|
|
95
|
+
type: Boolean
|
|
96
|
+
},
|
|
97
|
+
withIsEmptyState: {
|
|
98
|
+
default: !1,
|
|
99
|
+
type: Boolean
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* Is only used when emptyStateComponent is null
|
|
103
|
+
*/
|
|
104
|
+
emptyStateLabel: {
|
|
105
|
+
default: "No entries in this list",
|
|
106
|
+
type: String
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* this component is displayed centered in the middle of the box in case it is empty
|
|
110
|
+
*/
|
|
111
|
+
emptyStateComponent: {
|
|
112
|
+
default: null,
|
|
113
|
+
type: Object
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* If enabled the single click will allow the user to select multiple items, otherwise this only works with
|
|
117
|
+
* CTRL + Click (similar to <select> html widgets)
|
|
118
|
+
*/
|
|
119
|
+
multiselectByClick: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: !1
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* Bottom values
|
|
125
|
+
*/
|
|
126
|
+
withBottomValue: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: !1
|
|
129
|
+
},
|
|
130
|
+
bottomValue: {
|
|
131
|
+
type: Object,
|
|
132
|
+
default: () => ({ id: "bottom", text: "Other" }),
|
|
133
|
+
validator(e) {
|
|
134
|
+
return e.hasOwnProperty("id") && e.hasOwnProperty("text");
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Controls the size of the list. Number of visible items (for others user need to scroll)
|
|
139
|
+
* 0 means all
|
|
140
|
+
*/
|
|
141
|
+
size: {
|
|
142
|
+
type: Number,
|
|
143
|
+
default: 0,
|
|
144
|
+
validator(e) {
|
|
145
|
+
return e >= 0;
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
minSize: {
|
|
149
|
+
type: Number,
|
|
150
|
+
default: 1
|
|
151
|
+
},
|
|
152
|
+
isValid: {
|
|
153
|
+
default: !0,
|
|
154
|
+
type: Boolean
|
|
155
|
+
},
|
|
156
|
+
ariaLabel: {
|
|
157
|
+
type: String,
|
|
158
|
+
required: !0
|
|
159
|
+
},
|
|
160
|
+
/**
|
|
161
|
+
* List of possible values. Each item must have an `id` and a `text` property
|
|
162
|
+
* @example
|
|
163
|
+
* [{
|
|
164
|
+
* id: 'pdf',
|
|
165
|
+
* text: 'PDF'
|
|
166
|
+
* }, {
|
|
167
|
+
* id: 'XLS',
|
|
168
|
+
* text: 'Excel',
|
|
169
|
+
* }]
|
|
170
|
+
*/
|
|
171
|
+
possibleValues: {
|
|
172
|
+
type: Array,
|
|
173
|
+
default: () => [],
|
|
174
|
+
validator(e) {
|
|
175
|
+
return Array.isArray(e) ? e.every(
|
|
176
|
+
(t) => t.hasOwnProperty("id") && t.hasOwnProperty("text")
|
|
177
|
+
) : !1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
emits: [
|
|
182
|
+
"update:modelValue",
|
|
183
|
+
"doubleClickOnItem",
|
|
184
|
+
"doubleClickShift",
|
|
185
|
+
"keyArrowLeft",
|
|
186
|
+
"keyArrowRight"
|
|
187
|
+
],
|
|
188
|
+
setup(e) {
|
|
189
|
+
const { containerProps: i, wrapperProps: n, list: r, scrollTo: s } = N(
|
|
190
|
+
p(e, "possibleValues"),
|
|
191
|
+
{
|
|
192
|
+
itemHeight: 22
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
return I(
|
|
196
|
+
() => e.possibleValues,
|
|
197
|
+
() => {
|
|
198
|
+
var l;
|
|
199
|
+
if (!i.ref.value)
|
|
200
|
+
return;
|
|
201
|
+
const o = ((l = i.ref.value) == null ? void 0 : l.scrollTop) ?? 0;
|
|
202
|
+
s(
|
|
203
|
+
Math.max(
|
|
204
|
+
Math.min(
|
|
205
|
+
Math.floor(o / 22),
|
|
206
|
+
e.possibleValues.length - 1
|
|
207
|
+
),
|
|
208
|
+
0
|
|
209
|
+
)
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
), {
|
|
213
|
+
optionLineHeight: 22,
|
|
214
|
+
containerProps: i,
|
|
215
|
+
wrapperProps: n,
|
|
216
|
+
list: r
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
data() {
|
|
220
|
+
return {
|
|
221
|
+
selectedValues: this.modelValue,
|
|
222
|
+
// indices for mouse and keyboard nav
|
|
223
|
+
currentKeyNavIndex: 0,
|
|
224
|
+
shiftStartIndex: -1,
|
|
225
|
+
draggingStartIndex: -1,
|
|
226
|
+
draggingInverseMode: !1,
|
|
227
|
+
resizeHeight: 0
|
|
228
|
+
};
|
|
229
|
+
},
|
|
230
|
+
computed: {
|
|
231
|
+
cssStyleSize() {
|
|
232
|
+
if (this.resizeHeight !== 0)
|
|
233
|
+
return { height: `${this.resizeHeight}px` };
|
|
234
|
+
const e = `${this.computeBoxHeight(this.size)}px`;
|
|
235
|
+
return this.size > 0 ? { height: e } : {};
|
|
236
|
+
},
|
|
237
|
+
minResizeHeight() {
|
|
238
|
+
return this.computeBoxHeight(this.minSize);
|
|
239
|
+
},
|
|
240
|
+
possibleValuesWithBottom() {
|
|
241
|
+
return [
|
|
242
|
+
...this.possibleValues,
|
|
243
|
+
...this.withBottomValue ? [this.bottomValue] : []
|
|
244
|
+
];
|
|
245
|
+
},
|
|
246
|
+
bottomIndex() {
|
|
247
|
+
return this.possibleValues.length;
|
|
248
|
+
},
|
|
249
|
+
showEmptyState() {
|
|
250
|
+
return this.withIsEmptyState && this.possibleValues.length === 0;
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
watch: {
|
|
254
|
+
modelValue: {
|
|
255
|
+
handler(e) {
|
|
256
|
+
this.selectedValues = [...e];
|
|
257
|
+
},
|
|
258
|
+
deep: !0
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
mounted() {
|
|
262
|
+
var t, i;
|
|
263
|
+
window.addEventListener("mouseup", this.onStopDrag);
|
|
264
|
+
const e = (i = this.modelValue) == null ? void 0 : i[((t = this.modelValue) == null ? void 0 : t.length) - 1];
|
|
265
|
+
this.currentKeyNavIndex = this.possibleValues.map((n) => n.id).indexOf(e);
|
|
266
|
+
},
|
|
267
|
+
beforeUnmount() {
|
|
268
|
+
window.removeEventListener("mouseup", this.onStopDrag);
|
|
269
|
+
},
|
|
270
|
+
created() {
|
|
271
|
+
this.createDebouncedHandleCtrlClick();
|
|
272
|
+
},
|
|
273
|
+
methods: {
|
|
274
|
+
createDebouncedHandleCtrlClick() {
|
|
275
|
+
this.debouncedHandleCtrlClick = A((e, t) => {
|
|
276
|
+
this.handleCtrlClick(e, t);
|
|
277
|
+
}, P);
|
|
278
|
+
},
|
|
279
|
+
// Define debouncedHandleCtrlClick as a method
|
|
280
|
+
debouncedHandleCtrlClick(e, t) {
|
|
281
|
+
this.debouncedHandleCtrlClick || this.createDebouncedHandleCtrlClick(), this.debouncedHandleCtrlClick(e, t);
|
|
282
|
+
},
|
|
283
|
+
isCurrentValue(e) {
|
|
284
|
+
var t;
|
|
285
|
+
return (t = this.selectedValues) == null ? void 0 : t.includes(e);
|
|
286
|
+
},
|
|
287
|
+
handleCtrlClick(e, t) {
|
|
288
|
+
this.currentKeyNavIndex = t, this.toggleSelection(e);
|
|
289
|
+
},
|
|
290
|
+
handleShiftClick(e, t) {
|
|
291
|
+
this.setSelected(
|
|
292
|
+
this.getPossibleValuesInSection(this.currentKeyNavIndex, t)
|
|
293
|
+
);
|
|
294
|
+
},
|
|
295
|
+
/**
|
|
296
|
+
* Returns all value ids (String) for two indices no matter which one is the start/end index
|
|
297
|
+
* @param {Number} firstIndex - index a
|
|
298
|
+
* @param {Number} secondIndex - index b
|
|
299
|
+
* @returns {String[]}
|
|
300
|
+
*/
|
|
301
|
+
getPossibleValuesInSection(e, t) {
|
|
302
|
+
const i = e > t ? t : e, n = e > t ? e : t;
|
|
303
|
+
return this.possibleValuesWithBottom.slice(i, n + 1).map((r) => r.id);
|
|
304
|
+
},
|
|
305
|
+
onStartDrag(e, t = !1) {
|
|
306
|
+
if (this.disabled || e.shiftKey)
|
|
307
|
+
return;
|
|
308
|
+
(e.ctrlKey || e.metaKey) && (this.draggingInverseMode = !0);
|
|
309
|
+
const i = e.target, n = t ? this.bottomIndex : i.getAttribute("data-option-index");
|
|
310
|
+
n && (this.draggingStartIndex = Number(n));
|
|
311
|
+
},
|
|
312
|
+
onDrag(e) {
|
|
313
|
+
if (this.draggingStartIndex !== -1) {
|
|
314
|
+
const i = e.target.getAttribute("data-option-index");
|
|
315
|
+
if (!i)
|
|
316
|
+
return;
|
|
317
|
+
const n = Number(i);
|
|
318
|
+
let r = this.getPossibleValuesInSection(
|
|
319
|
+
this.draggingStartIndex,
|
|
320
|
+
n
|
|
321
|
+
);
|
|
322
|
+
this.draggingInverseMode && (r = this.selectedValues.filter(
|
|
323
|
+
(s) => !r.includes(s)
|
|
324
|
+
)), this.setSelected(r);
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
onBottomStartDrag(e) {
|
|
328
|
+
this.focus(), this.onStartDrag(e);
|
|
329
|
+
},
|
|
330
|
+
onBottomDrag(e) {
|
|
331
|
+
this.focus(), this.onDrag(e);
|
|
332
|
+
},
|
|
333
|
+
onStopDrag() {
|
|
334
|
+
this.draggingStartIndex = -1, this.draggingInverseMode = !1;
|
|
335
|
+
},
|
|
336
|
+
handleClick(e, t, i) {
|
|
337
|
+
if (!this.disabled) {
|
|
338
|
+
if (e.preventDefault(), e.metaKey) {
|
|
339
|
+
this.debouncedHandleCtrlClick(t, i);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (e.ctrlKey) {
|
|
343
|
+
this.handleCtrlClick(t, i);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (e.shiftKey) {
|
|
347
|
+
this.handleShiftClick(t, i);
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
this.multiselectByClick || (this.selectedValues = []), this.currentKeyNavIndex = i, this.toggleSelection(t);
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
handleDblClick(e, t) {
|
|
354
|
+
this.disabled || this.$emit("doubleClickOnItem", e, t);
|
|
355
|
+
},
|
|
356
|
+
handleBottomClick(e) {
|
|
357
|
+
this.handleClick(e, this.bottomValue.id, this.bottomIndex), this.focus();
|
|
358
|
+
},
|
|
359
|
+
handleBottomDblClick() {
|
|
360
|
+
this.handleDblClick(this.bottomValue.id, this.bottomIndex);
|
|
361
|
+
},
|
|
362
|
+
handleShiftDblClick() {
|
|
363
|
+
this.disabled || this.$emit("doubleClickShift", this.selectedValues);
|
|
364
|
+
},
|
|
365
|
+
addToSelection(e) {
|
|
366
|
+
let t = !1;
|
|
367
|
+
const i = this.selectedValues;
|
|
368
|
+
return i != null && i.includes(e) || (i == null || i.push(e), t = !0), this.setSelected(i), t;
|
|
369
|
+
},
|
|
370
|
+
removeFromSelection(e) {
|
|
371
|
+
let t = !1;
|
|
372
|
+
const i = this.selectedValues;
|
|
373
|
+
return i != null && i.includes(e) && (i.splice(i.indexOf(e), 1), t = !0), this.setSelected(i), t;
|
|
374
|
+
},
|
|
375
|
+
toggleSelection(e) {
|
|
376
|
+
var t;
|
|
377
|
+
(t = this.selectedValues) != null && t.includes(e) ? this.removeFromSelection(e) : this.addToSelection(e);
|
|
378
|
+
},
|
|
379
|
+
setSelectedNoShiftReset(e) {
|
|
380
|
+
consola.trace("MultiselectListBox setSelected on", e), this.selectedValues = e, this.$emit("update:modelValue", e);
|
|
381
|
+
},
|
|
382
|
+
setSelected(e) {
|
|
383
|
+
this.shiftStartIndex = -1, this.setSelectedNoShiftReset(e);
|
|
384
|
+
},
|
|
385
|
+
setSelectedToIndex(e) {
|
|
386
|
+
const t = this.possibleValuesWithBottom[e];
|
|
387
|
+
t && t.id && this.setSelected([t.id]);
|
|
388
|
+
},
|
|
389
|
+
scrollToCurrent() {
|
|
390
|
+
this.currentKeyNavIndex !== this.bottomIndex && this.scrollIntoView(this.currentKeyNavIndex);
|
|
391
|
+
},
|
|
392
|
+
scrollIntoView(e, t = "auto") {
|
|
393
|
+
if (!this.containerProps.ref.value)
|
|
394
|
+
return;
|
|
395
|
+
const i = this.containerProps.ref.value;
|
|
396
|
+
if (i.scrollHeight > i.clientHeight) {
|
|
397
|
+
const n = i.clientHeight + i.scrollTop, r = e * this.optionLineHeight, s = r + this.optionLineHeight, o = r < i.scrollTop;
|
|
398
|
+
if (!(s > n || o))
|
|
399
|
+
return;
|
|
400
|
+
t === "up" || t === "auto" && o ? i.scrollTop = r : i.scrollTop = s - i.clientHeight;
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
scrollUpIntoView(e) {
|
|
404
|
+
this.scrollIntoView(e, "up");
|
|
405
|
+
},
|
|
406
|
+
scrollDownIntoView(e) {
|
|
407
|
+
this.scrollIntoView(e, "down");
|
|
408
|
+
},
|
|
409
|
+
setCurrentKeyNavIndex(e) {
|
|
410
|
+
this.currentKeyNavIndex = e;
|
|
411
|
+
},
|
|
412
|
+
isOutOfRange(e) {
|
|
413
|
+
return e < 0 ? !0 : this.withBottomValue ? e > this.bottomIndex : e >= this.bottomIndex;
|
|
414
|
+
},
|
|
415
|
+
onArrowDown() {
|
|
416
|
+
if (this.disabled)
|
|
417
|
+
return;
|
|
418
|
+
const e = this.currentKeyNavIndex + 1;
|
|
419
|
+
this.isOutOfRange(e) || (this.setSelectedToIndex(e), this.currentKeyNavIndex = e, this.scrollToCurrent());
|
|
420
|
+
},
|
|
421
|
+
onArrowUp() {
|
|
422
|
+
if (this.disabled)
|
|
423
|
+
return;
|
|
424
|
+
const e = this.currentKeyNavIndex - 1;
|
|
425
|
+
this.isOutOfRange(e) || (this.setSelectedToIndex(e), this.currentKeyNavIndex = e, this.scrollToCurrent());
|
|
426
|
+
},
|
|
427
|
+
onArrowDownShift() {
|
|
428
|
+
if (this.disabled)
|
|
429
|
+
return;
|
|
430
|
+
this.shiftStartIndex === -1 && (this.shiftStartIndex = this.currentKeyNavIndex);
|
|
431
|
+
const e = this.currentKeyNavIndex + 1;
|
|
432
|
+
this.isOutOfRange(e) || (this.setSelectedNoShiftReset(
|
|
433
|
+
this.getPossibleValuesInSection(this.shiftStartIndex, e)
|
|
434
|
+
), this.currentKeyNavIndex = e, this.scrollToCurrent());
|
|
435
|
+
},
|
|
436
|
+
onArrowUpShift() {
|
|
437
|
+
if (this.disabled)
|
|
438
|
+
return;
|
|
439
|
+
this.shiftStartIndex === -1 && (this.shiftStartIndex = this.currentKeyNavIndex);
|
|
440
|
+
const e = this.currentKeyNavIndex - 1;
|
|
441
|
+
this.isOutOfRange(e) || (this.setSelectedNoShiftReset(
|
|
442
|
+
this.getPossibleValuesInSection(this.shiftStartIndex, e)
|
|
443
|
+
), this.currentKeyNavIndex = e, this.scrollToCurrent());
|
|
444
|
+
},
|
|
445
|
+
onEndKey() {
|
|
446
|
+
const e = this.possibleValues.length - 1;
|
|
447
|
+
this.setSelectedToIndex(e), this.currentKeyNavIndex = e, this.containerProps.ref.value && (this.containerProps.ref.value.scrollTop = this.containerProps.ref.value.scrollHeight);
|
|
448
|
+
},
|
|
449
|
+
onHomeKey() {
|
|
450
|
+
this.setSelectedToIndex(0), this.currentKeyNavIndex = 0, this.containerProps.ref.value && (this.containerProps.ref.value.scrollTop = 0);
|
|
451
|
+
},
|
|
452
|
+
onArrowLeft() {
|
|
453
|
+
this.disabled || this.$emit("keyArrowLeft", this.selectedValues);
|
|
454
|
+
},
|
|
455
|
+
onArrowRight() {
|
|
456
|
+
this.disabled || this.$emit("keyArrowRight", this.selectedValues);
|
|
457
|
+
},
|
|
458
|
+
onCtrlA() {
|
|
459
|
+
this.disabled || this.setSelected(this.possibleValuesWithBottom.map((e) => e.id));
|
|
460
|
+
},
|
|
461
|
+
hasSelection() {
|
|
462
|
+
return this.selectedValues.length > 0;
|
|
463
|
+
},
|
|
464
|
+
getCurrentKeyNavItem() {
|
|
465
|
+
try {
|
|
466
|
+
return this.possibleValues[this.currentKeyNavIndex];
|
|
467
|
+
} catch {
|
|
468
|
+
return {
|
|
469
|
+
id: "",
|
|
470
|
+
text: ""
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
generateOptionId(e) {
|
|
475
|
+
if (!e)
|
|
476
|
+
return "";
|
|
477
|
+
const t = typeof e.id == "symbol" ? e.id.description : e.id, i = t && t.replace(/[^\w]/gi, "");
|
|
478
|
+
return `option-${this.id}-${i}`;
|
|
479
|
+
},
|
|
480
|
+
focus() {
|
|
481
|
+
var e;
|
|
482
|
+
this.disabled || (e = this.containerProps.ref.value) == null || e.focus();
|
|
483
|
+
},
|
|
484
|
+
clearSelection() {
|
|
485
|
+
this.disabled || this.setSelected([]);
|
|
486
|
+
},
|
|
487
|
+
computeBoxHeight(e) {
|
|
488
|
+
return e * this.optionLineHeight;
|
|
489
|
+
},
|
|
490
|
+
initResizeHeight() {
|
|
491
|
+
this.resizeHeight = this.computeBoxHeight(
|
|
492
|
+
this.size || this.possibleValues.length
|
|
493
|
+
);
|
|
494
|
+
},
|
|
495
|
+
onResizeMove(e) {
|
|
496
|
+
this.resizeHeight += e, this.resizeHeight = Math.max(this.minResizeHeight, this.resizeHeight);
|
|
497
|
+
},
|
|
498
|
+
onResizeEnd() {
|
|
499
|
+
const e = this.resizeHeight / this.optionLineHeight;
|
|
500
|
+
this.resizeHeight = this.computeBoxHeight(Math.round(e));
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}, R = { class: "box" }, U = ["id", "aria-label", "aria-activedescendant"], F = {
|
|
504
|
+
key: 0,
|
|
505
|
+
class: "empty-state"
|
|
506
|
+
}, W = { key: 1 }, j = {
|
|
507
|
+
key: 1,
|
|
508
|
+
role: "bottom-box"
|
|
509
|
+
};
|
|
510
|
+
function q(e, t, i, n, r, s) {
|
|
511
|
+
const o = v("StyledListItem");
|
|
512
|
+
return h(), u("div", {
|
|
513
|
+
class: C(["multiselect-list-box", { invalid: !i.isValid, disabled: i.disabled }]),
|
|
514
|
+
style: w(s.cssStyleSize)
|
|
515
|
+
}, [
|
|
516
|
+
f("div", R, [
|
|
517
|
+
f("ul", x(n.containerProps, {
|
|
518
|
+
id: i.id,
|
|
519
|
+
role: "listbox",
|
|
520
|
+
tabindex: "0",
|
|
521
|
+
class: { disabled: i.disabled, "empty-box": s.showEmptyState },
|
|
522
|
+
"aria-label": i.ariaLabel,
|
|
523
|
+
"aria-activedescendant": s.generateOptionId(s.getCurrentKeyNavItem()),
|
|
524
|
+
onKeydown: [
|
|
525
|
+
t[1] || (t[1] = d(a((...l) => s.onCtrlA && s.onCtrlA(...l), ["ctrl", "prevent", "exact"]), ["a"])),
|
|
526
|
+
t[2] || (t[2] = d(a((...l) => s.onArrowUp && s.onArrowUp(...l), ["prevent", "exact"]), ["up"])),
|
|
527
|
+
t[3] || (t[3] = d(a((...l) => s.onArrowDown && s.onArrowDown(...l), ["prevent", "exact"]), ["down"])),
|
|
528
|
+
t[4] || (t[4] = d(a((...l) => s.onArrowUpShift && s.onArrowUpShift(...l), ["shift", "prevent", "exact"]), ["up"])),
|
|
529
|
+
t[5] || (t[5] = d(a((...l) => s.onArrowDownShift && s.onArrowDownShift(...l), ["shift", "prevent", "exact"]), ["down"])),
|
|
530
|
+
t[6] || (t[6] = d(a((...l) => s.onArrowLeft && s.onArrowLeft(...l), ["prevent", "exact"]), ["left"])),
|
|
531
|
+
t[7] || (t[7] = d(a((...l) => s.onArrowRight && s.onArrowRight(...l), ["prevent", "exact"]), ["right"])),
|
|
532
|
+
t[8] || (t[8] = d(a((...l) => s.onHomeKey && s.onHomeKey(...l), ["prevent", "exact"]), ["home"])),
|
|
533
|
+
t[9] || (t[9] = d(a((...l) => s.onEndKey && s.onEndKey(...l), ["prevent", "exact"]), ["end"]))
|
|
534
|
+
],
|
|
535
|
+
onMousedown: t[10] || (t[10] = (...l) => s.onStartDrag && s.onStartDrag(...l)),
|
|
536
|
+
onMousemove: t[11] || (t[11] = (...l) => s.onDrag && s.onDrag(...l))
|
|
537
|
+
}), [
|
|
538
|
+
f("div", V(k(n.wrapperProps)), [
|
|
539
|
+
(h(!0), u(H, null, B(n.list, ({ data: l, index: c }) => (h(), g(o, {
|
|
540
|
+
id: s.generateOptionId(l),
|
|
541
|
+
key: `listbox-${l.id}`,
|
|
542
|
+
text: l.text,
|
|
543
|
+
"data-option-index": c,
|
|
544
|
+
"line-height": n.optionLineHeight,
|
|
545
|
+
selected: s.isCurrentValue(l.id),
|
|
546
|
+
invalid: l.invalid,
|
|
547
|
+
special: l.special,
|
|
548
|
+
disabled: i.disabled,
|
|
549
|
+
onClick: (m) => s.handleClick(m, l.id, c),
|
|
550
|
+
onDblclickShift: t[0] || (t[0] = (m) => s.handleShiftDblClick()),
|
|
551
|
+
onDblclickExact: (m) => s.handleDblClick(l.id, c)
|
|
552
|
+
}, null, 8, ["id", "text", "data-option-index", "line-height", "selected", "invalid", "special", "disabled", "onClick", "onDblclickExact"]))), 128))
|
|
553
|
+
], 16)
|
|
554
|
+
], 16, U),
|
|
555
|
+
s.showEmptyState ? (h(), u("div", F, [
|
|
556
|
+
i.emptyStateComponent ? (h(), g(D(i.emptyStateComponent), { key: 0 })) : (h(), u("span", W, y(i.emptyStateLabel), 1))
|
|
557
|
+
])) : b("", !0),
|
|
558
|
+
i.withBottomValue ? (h(), u("div", j, [
|
|
559
|
+
K(o, {
|
|
560
|
+
id: s.generateOptionId(i.bottomValue),
|
|
561
|
+
special: "",
|
|
562
|
+
text: i.bottomValue.text,
|
|
563
|
+
"data-option-index": s.bottomIndex,
|
|
564
|
+
selected: s.isCurrentValue(i.bottomValue.id),
|
|
565
|
+
disabled: i.disabled,
|
|
566
|
+
onClick: s.handleBottomClick,
|
|
567
|
+
onDblclickShift: t[12] || (t[12] = (l) => s.handleShiftDblClick()),
|
|
568
|
+
onDblclickExact: s.handleBottomDblClick,
|
|
569
|
+
onMousedown: s.onBottomStartDrag,
|
|
570
|
+
onMousemove: s.onBottomDrag
|
|
571
|
+
}, null, 8, ["id", "text", "data-option-index", "selected", "disabled", "onClick", "onDblclickExact", "onMousedown", "onMousemove"])
|
|
572
|
+
])) : b("", !0)
|
|
573
|
+
])
|
|
574
|
+
], 6);
|
|
575
|
+
}
|
|
576
|
+
const G = /* @__PURE__ */ S(E, [["render", q], ["__scopeId", "data-v-0b9d68d0"]]);
|
|
577
|
+
export {
|
|
578
|
+
G as M
|
|
579
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent as o, openBlock as r, createBlock as n, mergeProps as t } from "vue";
|
|
2
|
+
import { r as s } from "./index-ZDm2GXeD.js";
|
|
3
|
+
import p from "./TwinlistControl-C4XaH_Xc.js";
|
|
4
|
+
const c = /* @__PURE__ */ o({
|
|
5
|
+
__name: "NameFilter",
|
|
6
|
+
props: s(),
|
|
7
|
+
setup(a) {
|
|
8
|
+
return (e, l) => (r(), n(p, t({ ...e.$props, ...e.$attrs }, {
|
|
9
|
+
"unknown-values-text": "Any unknown value",
|
|
10
|
+
"show-unknown-values": "",
|
|
11
|
+
"empty-state-label": "No values in this list"
|
|
12
|
+
}), null, 16));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
c as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineComponent as e, openBlock as o, createBlock as p, mergeProps as n } from "vue";
|
|
2
|
+
import { r as t } from "./index-ZDm2GXeD.js";
|
|
3
|
+
import { _ as m } from "./NumberControlBase.vue_vue_type_script_setup_true_lang-B69hrnY1.js";
|
|
4
|
+
const l = /* @__PURE__ */ e({
|
|
5
|
+
__name: "NumberControl",
|
|
6
|
+
props: t(),
|
|
7
|
+
setup(s) {
|
|
8
|
+
return (r, _) => (o(), p(m, n(r.$props, { type: "double" }), null, 16));
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
l as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as d, computed as u, openBlock as p, createBlock as f, unref as e, withCtx as b, createVNode as v } from "vue";
|
|
2
|
+
import { r as x, a as C, L as h } from "./index-ZDm2GXeD.js";
|
|
3
|
+
import { N as y } from "./NumberInput-BdL-jZ-i.js";
|
|
4
|
+
const N = /* @__PURE__ */ d({
|
|
5
|
+
__name: "NumberControlBase",
|
|
6
|
+
props: {
|
|
7
|
+
...x(),
|
|
8
|
+
type: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: !1,
|
|
11
|
+
default: "double"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(m) {
|
|
15
|
+
const r = m, { control: o, onChange: a, disabled: i } = C({ props: r }), t = u(() => o.value.schema.minimum), n = u(() => o.value.schema.maximum), s = () => {
|
|
16
|
+
const l = o.value.data;
|
|
17
|
+
typeof t.value == "number" && l < t.value ? a(t.value) : typeof n.value == "number" && l > n.value && a(n.value);
|
|
18
|
+
};
|
|
19
|
+
return (l, _) => (p(), f(h, {
|
|
20
|
+
control: e(o),
|
|
21
|
+
onControllingFlowVariableSet: e(a)
|
|
22
|
+
}, {
|
|
23
|
+
default: b(({ labelForId: c }) => [
|
|
24
|
+
v(e(y), {
|
|
25
|
+
id: c ?? void 0,
|
|
26
|
+
class: "number-input",
|
|
27
|
+
disabled: e(i),
|
|
28
|
+
"model-value": e(o).data,
|
|
29
|
+
type: m.type,
|
|
30
|
+
min: e(o).schema.minimum,
|
|
31
|
+
max: e(o).schema.maximum,
|
|
32
|
+
compact: "",
|
|
33
|
+
"onUpdate:modelValue": e(a),
|
|
34
|
+
onFocusout: s
|
|
35
|
+
}, null, 8, ["id", "disabled", "model-value", "type", "min", "max", "onUpdate:modelValue"])
|
|
36
|
+
]),
|
|
37
|
+
_: 1
|
|
38
|
+
}, 8, ["control", "onControllingFlowVariableSet"]));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
N as _
|
|
43
|
+
};
|