vlite3 1.4.31 → 1.4.33
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/components/Accordion/Accordion.vue.js +19 -16
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionItem.vue.js +38 -36
- package/components/CategoryManager/CategoryManager.vue2.js +4 -3
- package/components/CategoryManager/CategoryNode.vue.js +30 -30
- package/components/CategoryMenu/CategoryMenu.vue.js +9 -11
- package/components/Chart/GanttChart.vue.d.ts +18 -2
- package/components/Chart/GanttChart.vue.js +1 -1
- package/components/Chart/GanttChart.vue2.js +1347 -604
- package/components/Chart/GanttChartConnectorRouting.d.ts +83 -0
- package/components/Chart/GanttChartConnectorRouting.js +405 -0
- package/components/Chart/GanttChartDateUtils.d.ts +38 -0
- package/components/Chart/GanttChartDateUtils.js +79 -0
- package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
- package/components/Chart/GanttChartDependencyUtils.js +109 -0
- package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
- package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
- package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
- package/components/Chart/GanttChartTooltipUtils.js +63 -0
- package/components/Chart/index.d.ts +3 -1
- package/components/Chart/types.d.ts +92 -2
- package/components/Chart/types.js +8 -0
- package/components/ColorPicker/ColorIro.vue2.js +155 -0
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.d.ts +5 -0
- package/components/ColorPicker/ColorPicker.vue.js +111 -65
- package/components/ColorPicker/constants.d.ts +2 -0
- package/components/ColorPicker/constants.js +4 -0
- package/components/ColorPicker/index.d.ts +1 -0
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/Dropdown/Dropdown.vue.js +100 -97
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Form/AccordionView.vue.js +5 -220
- package/components/Form/AccordionView.vue3.js +250 -0
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +309 -280
- package/components/Form/FormField.vue.js +177 -197
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +60 -60
- package/components/Form/FormSkeleton.vue.js +50 -35
- package/components/Form/TableView.vue.js +59 -43
- package/components/Form/composables/useForm.js +159 -148
- package/components/Form/index.vue2.js +7 -7
- package/components/Form/utils/form.utils.d.ts +2 -0
- package/components/Form/utils/form.utils.js +17 -13
- package/components/GoogleMap.vue.d.ts +1 -1
- package/components/Kanban/Kanban.vue.d.ts +16 -2
- package/components/Kanban/Kanban.vue.js +2 -2
- package/components/Kanban/Kanban.vue2.js +150 -86
- package/components/Kanban/types.d.ts +37 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
- package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
- package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
- package/components/PanZoomViewport/index.d.ts +2 -0
- package/components/PanZoomViewport/types.d.ts +121 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
- package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
- package/components/ScaleGenerator/types.d.ts +2 -0
- package/components/Screen/ScreenFilter.vue.js +19 -18
- package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
- package/components/SeoProvider/SeoProvider.vue.js +39 -33
- package/components/SeoProvider/domAdapter.d.ts +1 -4
- package/components/SeoProvider/domAdapter.js +71 -58
- package/components/SeoProvider/index.d.ts +5 -2
- package/components/SeoProvider/normalizeSeo.d.ts +10 -49
- package/components/SeoProvider/normalizeSeo.js +246 -182
- package/components/SeoProvider/plainText.d.ts +8 -0
- package/components/SeoProvider/plainText.js +117 -0
- package/components/SeoProvider/seoUrl.d.ts +13 -0
- package/components/SeoProvider/seoUrl.js +25 -0
- package/components/SeoProvider/structuredData.d.ts +100 -0
- package/components/SeoProvider/structuredData.js +33 -0
- package/components/SeoProvider/types.d.ts +47 -109
- package/components/Tabes/Tabes.vue.js +1 -1
- package/components/Tabes/Tabes.vue2.js +215 -193
- package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
- package/components/Tabes/TabesMarkerGeometry.js +21 -0
- package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
- package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
- package/components/ThemeProvider/index.d.ts +1 -1
- package/components/ThemeProvider/themeVars.d.ts +9 -13
- package/components/ThemeProvider/themeVars.js +173 -125
- package/components/ThemeProvider/types.d.ts +10 -0
- package/components/ToastNotification.vue.js +1 -1
- package/components/ToastNotification.vue2.js +3 -3
- package/components/index.d.ts +3 -2
- package/composables/useKeyStroke.d.ts +18 -0
- package/composables/useKeyStroke.js +103 -77
- package/composables/useTheme.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +380 -350
- package/package.json +12 -4
- package/style.css +1 -1
- package/utils/environment.d.ts +29 -0
- package/utils/environment.js +4 -0
- package/utils/functions.js +14 -13
- package/components/ColorPicker/ColorIro.vue.js +0 -141
- package/components/Form/AccordionView.vue2.js +0 -4
- /package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as re, ref as a, computed as u, inject as de, onMounted as ue, onUnmounted as ce, watch as x, provide as L, reactive as fe, toRefs as me, openBlock as N, createElementBlock as ve, normalizeStyle as ye, createVNode as R, unref as c, withCtx as m, createBlock as j, normalizeClass as he, createSlots as ge, renderSlot as v, normalizeProps as z, guardReactiveProps as U, createCommentVNode as q, createElementVNode as be } from "vue";
|
|
2
|
+
import Ce from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useDropdownIds as
|
|
8
|
-
import { useDropdownSelection as
|
|
9
|
-
import { useDropdownHydration as
|
|
10
|
-
const
|
|
4
|
+
import pe from "./DropdownMenu.vue.js";
|
|
5
|
+
import Se from "./DropdownTrigger.vue.js";
|
|
6
|
+
import we from "../ConfirmationModal.vue.js";
|
|
7
|
+
import { useDropdownIds as Oe } from "./composables/useDropdownIds.js";
|
|
8
|
+
import { useDropdownSelection as $e } from "./composables/useDropdownSelection.js";
|
|
9
|
+
import { useDropdownHydration as Ie } from "./composables/useDropdownHydration.js";
|
|
10
|
+
const Ve = /* @__PURE__ */ re({
|
|
11
11
|
__name: "Dropdown",
|
|
12
12
|
props: {
|
|
13
13
|
selected: {},
|
|
@@ -54,63 +54,65 @@ const He = /* @__PURE__ */ ae({
|
|
|
54
54
|
trigger: { default: "click" }
|
|
55
55
|
},
|
|
56
56
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
57
|
-
setup(t, { emit:
|
|
58
|
-
const
|
|
57
|
+
setup(t, { emit: F }) {
|
|
58
|
+
const n = t, y = F, h = a(!1), g = a(null), G = u(() => n.doubleConfirmation || h.value ? !0 : (n.options ?? []).some(
|
|
59
|
+
(e) => typeof e == "object" && e !== null && !!e.confirmation
|
|
60
|
+
)), r = a({
|
|
59
61
|
title: "Confirm Selection",
|
|
60
62
|
description: "Are you sure you want to select this option?",
|
|
61
63
|
confirmText: "Confirm",
|
|
62
64
|
cancelText: "Cancel",
|
|
63
65
|
variant: "primary"
|
|
64
|
-
}),
|
|
66
|
+
}), J = u(() => n.position ? n.position : n.direction === "rtl" ? "bottom-end" : "bottom-start"), K = u(() => n.nestedPosition ? n.nestedPosition : n.direction === "rtl" ? "left-start" : "right-start"), C = a(n.isOpen || !1), p = a(0), Q = a(null), O = a(null), $ = () => {
|
|
65
67
|
O.value && setTimeout(() => {
|
|
66
68
|
O.value?.focus({ preventScroll: !0 });
|
|
67
69
|
}, 10);
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
70
|
+
}, X = `dropdown-${Math.random().toString(36).substring(2, 9)}`, I = u(() => n.menuId || X), b = a([]), s = de("dropdown-context", null), Y = (e) => {
|
|
71
|
+
b.value.includes(e) || b.value.push(e), s?.registerChildId?.(e);
|
|
72
|
+
}, Z = (e) => {
|
|
73
|
+
b.value = b.value.filter((o) => o !== e), s?.unregisterChildId?.(e);
|
|
72
74
|
};
|
|
73
|
-
|
|
75
|
+
ue(() => {
|
|
74
76
|
s?.registerChildId && s.registerChildId(`#${I.value}`);
|
|
75
|
-
}),
|
|
77
|
+
}), ce(() => {
|
|
76
78
|
s?.unregisterChildId && s.unregisterChildId(`#${I.value}`);
|
|
77
79
|
}), x(
|
|
78
|
-
() =>
|
|
80
|
+
() => n.isOpen,
|
|
79
81
|
(e) => {
|
|
80
82
|
if (e !== void 0) {
|
|
81
|
-
if ((
|
|
83
|
+
if ((n.disabled || n.readonly) && e) return;
|
|
82
84
|
C.value = e;
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
);
|
|
86
88
|
const A = (e) => {
|
|
87
|
-
if (
|
|
88
|
-
C.value = !1,
|
|
89
|
+
if (n.disabled || n.readonly) {
|
|
90
|
+
C.value = !1, y("update:isOpen", !1);
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
|
-
C.value = e,
|
|
93
|
+
C.value = e, y("update:isOpen", e), y(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
|
|
92
94
|
}, S = () => {
|
|
93
95
|
A(!1);
|
|
94
|
-
},
|
|
96
|
+
}, _ = (e) => {
|
|
95
97
|
e ? p.value++ : p.value = Math.max(0, p.value - 1);
|
|
96
98
|
};
|
|
97
99
|
L("dropdown-context", {
|
|
98
100
|
close: S,
|
|
99
101
|
onChildToggle: (e) => {
|
|
100
|
-
|
|
102
|
+
_(e), s?.onChildToggle?.(e);
|
|
101
103
|
},
|
|
102
|
-
registerChildId:
|
|
103
|
-
unregisterChildId:
|
|
104
|
+
registerChildId: Y,
|
|
105
|
+
unregisterChildId: Z
|
|
104
106
|
}), L("modal-context", null);
|
|
105
|
-
const k =
|
|
107
|
+
const k = u(() => n.options ? n.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), w = a([]), E = a(!1), T = a(!1);
|
|
106
108
|
x(
|
|
107
109
|
k,
|
|
108
110
|
(e) => {
|
|
109
111
|
if (e) {
|
|
110
|
-
if (
|
|
112
|
+
if (n.remote) {
|
|
111
113
|
const o = [...w.value];
|
|
112
|
-
e.forEach((
|
|
113
|
-
o.some((i) => i.value !== void 0 &&
|
|
114
|
+
e.forEach((l) => {
|
|
115
|
+
o.some((i) => i.value !== void 0 && l.value !== void 0 ? typeof i.value == "object" && i.key && l.key ? i.key === l.key && i.value[i.key] === l.value[l.key] : i.value === l.value : i.label === l.label) || o.push(l);
|
|
114
116
|
}), w.value = o;
|
|
115
117
|
} else
|
|
116
118
|
w.value = e;
|
|
@@ -121,24 +123,24 @@ const He = /* @__PURE__ */ ae({
|
|
|
121
123
|
},
|
|
122
124
|
{ immediate: !0 }
|
|
123
125
|
);
|
|
124
|
-
const
|
|
125
|
-
const e = [...w.value], o = new Set(e.map((
|
|
126
|
-
return B.value.forEach((
|
|
127
|
-
o.has(d) || (e.unshift(
|
|
126
|
+
const f = u(() => {
|
|
127
|
+
const e = [...w.value], o = new Set(e.map((l) => l.value ?? l.label));
|
|
128
|
+
return B.value.forEach((l, d) => {
|
|
129
|
+
o.has(d) || (e.unshift(l), o.add(d));
|
|
128
130
|
}), e;
|
|
129
|
-
}), { selectedBuffer: B, isHydrating:
|
|
130
|
-
fetchSelected:
|
|
131
|
-
getAvailableOptions: () =>
|
|
131
|
+
}), { selectedBuffer: B, isHydrating: ee, hydrateSelected: H } = Ie({
|
|
132
|
+
fetchSelected: n.fetchSelected,
|
|
133
|
+
getAvailableOptions: () => f.value,
|
|
132
134
|
isReady: () => T.value
|
|
133
|
-
}), { getAllRecursiveIds:
|
|
134
|
-
...
|
|
135
|
-
options:
|
|
136
|
-
}), { currentValue: M, selectedLabel: V, selectedIcon: W, selectOption:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
),
|
|
140
|
-
const e =
|
|
141
|
-
return [.../* @__PURE__ */ new Set([...e, ...o, ...
|
|
135
|
+
}), { getAllRecursiveIds: te } = Oe(), ne = fe({
|
|
136
|
+
...me(n),
|
|
137
|
+
options: f
|
|
138
|
+
}), { currentValue: M, selectedLabel: V, selectedIcon: W, selectOption: le } = $e(
|
|
139
|
+
ne,
|
|
140
|
+
y
|
|
141
|
+
), oe = u(() => {
|
|
142
|
+
const e = n.ignoreClickOutside || [], o = te(f.value);
|
|
143
|
+
return [.../* @__PURE__ */ new Set([...e, ...o, ...b.value])];
|
|
142
144
|
});
|
|
143
145
|
x(
|
|
144
146
|
() => M.value,
|
|
@@ -147,9 +149,9 @@ const He = /* @__PURE__ */ ae({
|
|
|
147
149
|
},
|
|
148
150
|
{ deep: !0 }
|
|
149
151
|
);
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
152
|
-
|
|
152
|
+
const ae = (e) => {
|
|
153
|
+
if (n.disabled || n.readonly || e.disabled) return;
|
|
154
|
+
n.doubleConfirmation || !!e.confirmation ? (g.value = e, typeof e.confirmation == "object" ? r.value = {
|
|
153
155
|
title: e.confirmation.title || "Confirm Selection",
|
|
154
156
|
description: e.confirmation.description || "Are you sure you want to select this option?",
|
|
155
157
|
confirmText: e.confirmation.confirmText || "Confirm",
|
|
@@ -161,50 +163,50 @@ const He = /* @__PURE__ */ ae({
|
|
|
161
163
|
confirmText: "Confirm",
|
|
162
164
|
cancelText: "Cancel",
|
|
163
165
|
variant: "primary"
|
|
164
|
-
},
|
|
166
|
+
}, h.value = !0, S()) : (D(e), n.closeOnSelect && (S(), $()));
|
|
165
167
|
}, D = (e) => {
|
|
166
|
-
if (
|
|
168
|
+
if (n.disabled || n.readonly || e.disabled) return;
|
|
167
169
|
const o = e.value ?? e.label;
|
|
168
170
|
B.value.has(o) || B.value.set(o, e);
|
|
169
|
-
const
|
|
170
|
-
if (!
|
|
171
|
+
const l = le(e);
|
|
172
|
+
if (!n.isNested) {
|
|
171
173
|
const d = e._originalOption || e, i = d.value ?? d.label;
|
|
172
174
|
(e._path || [d]).forEach((P) => {
|
|
173
175
|
typeof P.onSelect == "function" && P.onSelect({
|
|
174
176
|
value: i,
|
|
175
177
|
option: P,
|
|
176
|
-
data:
|
|
177
|
-
values:
|
|
178
|
+
data: f.value || [],
|
|
179
|
+
values: l
|
|
178
180
|
});
|
|
179
181
|
});
|
|
180
182
|
}
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
|
|
183
|
+
}, ie = () => {
|
|
184
|
+
g.value && (D(g.value), g.value = null, h.value = !1, $());
|
|
185
|
+
}, se = () => {
|
|
186
|
+
g.value = null, h.value = !1, $();
|
|
185
187
|
};
|
|
186
|
-
return (e, o) => (
|
|
188
|
+
return (e, o) => (N(), ve("div", {
|
|
187
189
|
class: "relative inline-block text-left",
|
|
188
|
-
style:
|
|
190
|
+
style: ye({ direction: t.direction }),
|
|
189
191
|
ref_key: "dropdownWrapper",
|
|
190
|
-
ref:
|
|
192
|
+
ref: Q
|
|
191
193
|
}, [
|
|
192
|
-
|
|
194
|
+
R(c(Ce), {
|
|
193
195
|
content: "",
|
|
194
196
|
trigger: t.trigger,
|
|
195
197
|
arrow: !1,
|
|
196
198
|
disabled: t.disabled || t.readonly,
|
|
197
199
|
teleport: t.teleport,
|
|
198
200
|
offset: t.offset,
|
|
199
|
-
placement:
|
|
201
|
+
placement: J.value,
|
|
200
202
|
isOpen: C.value,
|
|
201
203
|
keepAlive: p.value > 0,
|
|
202
204
|
menuId: I.value,
|
|
203
|
-
ignoreClickOutside:
|
|
205
|
+
ignoreClickOutside: oe.value,
|
|
204
206
|
class: "w-full flex!",
|
|
205
207
|
className: "dropdown " + (t.className || "") + (t.variant === "transparent" ? " unstyled-dropdown" : "") + (t.variant === "secondary" ? " dropdown-secondary" : ""),
|
|
206
|
-
onOnShow: o[2] || (o[2] = (
|
|
207
|
-
onOnHide: o[3] || (o[3] = (
|
|
208
|
+
onOnShow: o[2] || (o[2] = (l) => e.$emit("onOpen")),
|
|
209
|
+
onOnHide: o[3] || (o[3] = (l) => e.$emit("onClose")),
|
|
208
210
|
"onUpdate:isOpen": A,
|
|
209
211
|
triggerClass: "w-full flex items-center",
|
|
210
212
|
styles: {
|
|
@@ -215,16 +217,16 @@ const He = /* @__PURE__ */ ae({
|
|
|
215
217
|
...t.variant === "transparent" ? { background: "transparent", border: "none", boxShadow: "none" } : {}
|
|
216
218
|
}
|
|
217
219
|
}, {
|
|
218
|
-
trigger: m(({ isOpen:
|
|
219
|
-
v(e.$slots, "trigger", z(
|
|
220
|
-
selectedLabel:
|
|
221
|
-
selectedIcon: t.showSelectedIcon ?
|
|
222
|
-
isOpen:
|
|
220
|
+
trigger: m(({ isOpen: l }) => [
|
|
221
|
+
v(e.$slots, "trigger", z(U({
|
|
222
|
+
selectedLabel: c(V),
|
|
223
|
+
selectedIcon: t.showSelectedIcon ? c(W) : void 0,
|
|
224
|
+
isOpen: l
|
|
223
225
|
})), () => [
|
|
224
|
-
|
|
225
|
-
"selected-label":
|
|
226
|
-
"selected-icon": t.showSelectedIcon ?
|
|
227
|
-
"is-open":
|
|
226
|
+
R(Se, {
|
|
227
|
+
"selected-label": c(V),
|
|
228
|
+
"selected-icon": t.showSelectedIcon ? c(W) : void 0,
|
|
229
|
+
"is-open": l,
|
|
228
230
|
direction: t.direction,
|
|
229
231
|
disabled: t.disabled,
|
|
230
232
|
readonly: t.readonly,
|
|
@@ -234,34 +236,34 @@ const He = /* @__PURE__ */ ae({
|
|
|
234
236
|
])
|
|
235
237
|
]),
|
|
236
238
|
default: m(() => [
|
|
237
|
-
!(t.disabled || t.readonly) && (k.value.length ||
|
|
239
|
+
!(t.disabled || t.readonly) && (k.value.length || f.value.length || e.$slots.menu || e.$slots.item || e.$slots.default || t.remote || t.searchable) ? (N(), j(pe, {
|
|
238
240
|
key: 0,
|
|
239
241
|
options: k.value,
|
|
240
|
-
cachedOptions:
|
|
241
|
-
class:
|
|
242
|
+
cachedOptions: f.value,
|
|
243
|
+
class: he(t.className),
|
|
242
244
|
emptyMessage: t.emptyMessage,
|
|
243
245
|
searchEmptyMessage: t.searchEmptyMessage,
|
|
244
|
-
selected:
|
|
246
|
+
selected: c(M),
|
|
245
247
|
selectedIndex: t.selectedIndex,
|
|
246
248
|
maxHeight: t.maxHeight,
|
|
247
|
-
nestedPosition:
|
|
249
|
+
nestedPosition: K.value,
|
|
248
250
|
nestedOffset: t.nestedOffset,
|
|
249
251
|
selectable: t.selectable,
|
|
250
252
|
direction: t.direction,
|
|
251
253
|
isCustomSlotMenu: !!e.$slots?.default || !!e.$slots?.menu,
|
|
252
254
|
layout: t.layout,
|
|
253
255
|
columns: t.columns,
|
|
254
|
-
loading: t.loading ||
|
|
256
|
+
loading: t.loading || c(ee),
|
|
255
257
|
hasMore: t.hasMore,
|
|
256
258
|
searchable: t.searchable,
|
|
257
259
|
remote: t.remote,
|
|
258
260
|
debounceTime: t.debounceTime,
|
|
259
261
|
trigger: t.trigger,
|
|
260
|
-
onSelect:
|
|
262
|
+
onSelect: ae,
|
|
261
263
|
onClose: S,
|
|
262
|
-
onLoadMore: o[0] || (o[0] = (
|
|
263
|
-
onSearch: o[1] || (o[1] = (
|
|
264
|
-
},
|
|
264
|
+
onLoadMore: o[0] || (o[0] = (l) => e.$emit("load-more")),
|
|
265
|
+
onSearch: o[1] || (o[1] = (l) => e.$emit("search", l))
|
|
266
|
+
}, ge({ _: 2 }, [
|
|
265
267
|
e.$slots.menu || e.$slots?.default ? {
|
|
266
268
|
name: "menu",
|
|
267
269
|
fn: m(() => [
|
|
@@ -272,8 +274,8 @@ const He = /* @__PURE__ */ ae({
|
|
|
272
274
|
} : void 0,
|
|
273
275
|
e.$slots.item ? {
|
|
274
276
|
name: "item",
|
|
275
|
-
fn: m((
|
|
276
|
-
v(e.$slots, "item", z(
|
|
277
|
+
fn: m((l) => [
|
|
278
|
+
v(e.$slots, "item", z(U(l)))
|
|
277
279
|
]),
|
|
278
280
|
key: "1"
|
|
279
281
|
} : void 0,
|
|
@@ -291,21 +293,22 @@ const He = /* @__PURE__ */ ae({
|
|
|
291
293
|
]),
|
|
292
294
|
key: "3"
|
|
293
295
|
} : void 0
|
|
294
|
-
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime", "trigger"])) :
|
|
296
|
+
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime", "trigger"])) : q("", !0)
|
|
295
297
|
]),
|
|
296
298
|
_: 3
|
|
297
299
|
}, 8, ["trigger", "disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
298
|
-
N(
|
|
299
|
-
|
|
300
|
+
G.value ? (N(), j(we, {
|
|
301
|
+
key: 0,
|
|
302
|
+
show: h.value,
|
|
300
303
|
title: r.value.title,
|
|
301
304
|
description: r.value.description,
|
|
302
305
|
"confirm-text": r.value.confirmText,
|
|
303
306
|
"cancel-text": r.value.cancelText,
|
|
304
307
|
variant: r.value.variant,
|
|
305
|
-
onConfirm:
|
|
306
|
-
onCancel:
|
|
307
|
-
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"]),
|
|
308
|
-
|
|
308
|
+
onConfirm: ie,
|
|
309
|
+
onCancel: se
|
|
310
|
+
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])) : q("", !0),
|
|
311
|
+
be("span", {
|
|
309
312
|
ref_key: "focusTrapAfter",
|
|
310
313
|
ref: O,
|
|
311
314
|
tabindex: "-1",
|
|
@@ -316,5 +319,5 @@ const He = /* @__PURE__ */ ae({
|
|
|
316
319
|
}
|
|
317
320
|
});
|
|
318
321
|
export {
|
|
319
|
-
|
|
322
|
+
Ve as default
|
|
320
323
|
};
|
|
@@ -1,222 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import z from "../Label.vue.js";
|
|
6
|
-
import H from "../Button.vue.js";
|
|
7
|
-
import p from "../Icon.vue.js";
|
|
8
|
-
import { renderLabel as x } from "./rowHelpers.js";
|
|
9
|
-
import { resolveI18nText as G } from "../../utils/i18n.js";
|
|
10
|
-
const J = { class: "custom-fields-accordion min-w-0 w-full" }, P = ["onClick"], Q = { class: "flex items-center flex-1 py-3 px-4 min-w-0" }, W = { class: "font-medium flex-1 text-left truncate mr-4 min-w-0" }, X = { class: "flex items-center gap-2 flex-none" }, Y = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "text-destructive flex items-center justify-center rounded-full bg-destructive/10 w-6 h-6"
|
|
13
|
-
}, Z = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "grid gap-4 min-w-0"
|
|
16
|
-
}, I = {
|
|
17
|
-
key: 0,
|
|
18
|
-
class: "text-destructive ml-0.5"
|
|
19
|
-
}, _ = {
|
|
20
|
-
key: 0,
|
|
21
|
-
class: "text-destructive ml-0.5"
|
|
22
|
-
}, ee = {
|
|
23
|
-
key: 1,
|
|
24
|
-
class: "mt-1 text-xs text-destructive"
|
|
25
|
-
}, te = {
|
|
26
|
-
key: 0,
|
|
27
|
-
class: "col-span-1 flex justify-end"
|
|
28
|
-
}, se = {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: "flex flex-col items-center justify-center py-6 text-center border border-border rounded bg-muted/5 mt-2"
|
|
31
|
-
}, le = { class: "text-sm font-medium text-foreground" }, ae = { class: "text-xs text-muted-foreground mt-1" }, ye = /* @__PURE__ */ S({
|
|
32
|
-
__name: "AccordionView",
|
|
33
|
-
props: {
|
|
34
|
-
rows: {},
|
|
35
|
-
schema: {},
|
|
36
|
-
draggable: { type: Boolean },
|
|
37
|
-
disabled: { type: Boolean },
|
|
38
|
-
readonly: { type: Boolean },
|
|
39
|
-
isUpdate: { type: Boolean },
|
|
40
|
-
variant: {},
|
|
41
|
-
size: {},
|
|
42
|
-
rounded: {},
|
|
43
|
-
canRemoveRow: { type: Boolean },
|
|
44
|
-
canAddRow: { type: Boolean },
|
|
45
|
-
helpers: {},
|
|
46
|
-
accordionTitleKey: {},
|
|
47
|
-
itemName: {},
|
|
48
|
-
emptyTitle: {},
|
|
49
|
-
emptyDescription: {},
|
|
50
|
-
onFieldChange: { type: Function },
|
|
51
|
-
onRemoveRow: { type: Function },
|
|
52
|
-
onDragUpdate: { type: Function }
|
|
53
|
-
},
|
|
54
|
-
setup(e) {
|
|
55
|
-
const c = e, o = E([]), v = E([]), N = (l) => {
|
|
56
|
-
o.value.includes(l) ? o.value = o.value.filter((r) => r !== l) : (v.value.includes(l) || v.value.push(l), o.value = [...o.value, l]);
|
|
57
|
-
}, F = (l, d) => c.accordionTitleKey && l[c.accordionTitleKey] ? String(l[c.accordionTitleKey]) : `${c.itemName} #${d + 1}`, u = (l) => l.labelI18n ? G(
|
|
58
|
-
l.labelI18n,
|
|
59
|
-
typeof l.label == "string" ? l.label : void 0
|
|
60
|
-
) ?? l.label : l.label;
|
|
61
|
-
return j(
|
|
62
|
-
() => [c.helpers.errors, c.rows],
|
|
63
|
-
() => {
|
|
64
|
-
const l = c.rows.map((s, C) => c.helpers.hasRowErrors(C) ? s._id : null).filter((s) => s !== null);
|
|
65
|
-
if (l.length === 0) return;
|
|
66
|
-
const d = /* @__PURE__ */ new Set([...o.value, ...l]);
|
|
67
|
-
o.value = Array.from(d);
|
|
68
|
-
const r = /* @__PURE__ */ new Set([...v.value, ...l]);
|
|
69
|
-
v.value = Array.from(r);
|
|
70
|
-
},
|
|
71
|
-
{ deep: !0, immediate: !0 }
|
|
72
|
-
), (l, d) => (a(), n("div", J, [
|
|
73
|
-
h(g(q), {
|
|
74
|
-
"model-value": e.rows,
|
|
75
|
-
"onUpdate:modelValue": e.onDragUpdate,
|
|
76
|
-
disabled: !e.draggable || e.disabled || e.readonly,
|
|
77
|
-
animation: 150,
|
|
78
|
-
handle: ".drag-handle",
|
|
79
|
-
"ghost-class": "opacity-50",
|
|
80
|
-
class: "space-y-2 min-w-0"
|
|
81
|
-
}, {
|
|
82
|
-
default: b(() => [
|
|
83
|
-
(a(!0), n(f, null, U(e.rows, (r, s, C, R) => {
|
|
84
|
-
const V = [
|
|
85
|
-
r,
|
|
86
|
-
e.disabled,
|
|
87
|
-
e.readonly,
|
|
88
|
-
e.isUpdate,
|
|
89
|
-
e.draggable,
|
|
90
|
-
s,
|
|
91
|
-
e.helpers.getRowErrorsHash(s),
|
|
92
|
-
e.helpers.hasRowErrors(s),
|
|
93
|
-
o.value.includes(r._id)
|
|
94
|
-
];
|
|
95
|
-
if (R && R.key === r._id && K(R, V)) return R;
|
|
96
|
-
const B = (a(), k(M, {
|
|
97
|
-
key: r._id,
|
|
98
|
-
item: { id: r._id, title: F(r, s) },
|
|
99
|
-
"is-open": o.value.includes(r._id),
|
|
100
|
-
variant: "solid",
|
|
101
|
-
onToggle: N,
|
|
102
|
-
class: "bg-white min-w-0"
|
|
103
|
-
}, {
|
|
104
|
-
trigger: b(({ open: t, toggle: T, triggerClass: A }) => [
|
|
105
|
-
m("div", {
|
|
106
|
-
class: w(["flex items-stretch w-full min-w-0", [A, "!p-0 overflow-hidden"]]),
|
|
107
|
-
onClick: T
|
|
108
|
-
}, [
|
|
109
|
-
e.draggable && !e.disabled && !e.readonly ? (a(), n("div", {
|
|
110
|
-
key: 0,
|
|
111
|
-
class: w([
|
|
112
|
-
"w-12 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
|
|
113
|
-
e.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"
|
|
114
|
-
]),
|
|
115
|
-
onClick: d[0] || (d[0] = L(() => {
|
|
116
|
-
}, ["stop"]))
|
|
117
|
-
}, [
|
|
118
|
-
h(p, {
|
|
119
|
-
icon: "lucide:grip-vertical",
|
|
120
|
-
class: "w-4 h-4"
|
|
121
|
-
})
|
|
122
|
-
], 2)) : i("", !0),
|
|
123
|
-
m("div", Q, [
|
|
124
|
-
m("span", W, y(F(r, s)), 1),
|
|
125
|
-
m("div", X, [
|
|
126
|
-
e.helpers.hasRowErrors(s) ? (a(), n("div", Y, [
|
|
127
|
-
h(p, {
|
|
128
|
-
icon: "lucide:alert-circle",
|
|
129
|
-
class: "w-4 h-4"
|
|
130
|
-
})
|
|
131
|
-
])) : i("", !0),
|
|
132
|
-
h(p, {
|
|
133
|
-
icon: "lucide:chevron-down",
|
|
134
|
-
class: w(["w-4 h-4 transition-transform duration-200", { "rotate-180": t }])
|
|
135
|
-
}, null, 8, ["class"])
|
|
136
|
-
])
|
|
137
|
-
])
|
|
138
|
-
], 10, P)
|
|
139
|
-
]),
|
|
140
|
-
content: b(() => [
|
|
141
|
-
v.value.includes(r._id) ? (a(), n("div", Z, [
|
|
142
|
-
(a(!0), n(f, null, U(e.schema, (t) => (a(), n("div", {
|
|
143
|
-
key: t.name,
|
|
144
|
-
class: "col-span-1 flex flex-col min-w-0"
|
|
145
|
-
}, [
|
|
146
|
-
e.helpers.isFieldVisible(s, t) ? (a(), n(f, { key: 0 }, [
|
|
147
|
-
(t.label || t.labelI18n) && e.helpers.getResolvedType(t, s) !== "switch" && e.helpers.getResolvedType(t, s) !== "check" && e.helpers.getResolvedType(t, s) !== "customFields" && e.helpers.getResolvedType(t, s) !== "choiceBox" ? (a(), k(z, {
|
|
148
|
-
key: 0,
|
|
149
|
-
class: "mb-2 block text-sm font-medium"
|
|
150
|
-
}, {
|
|
151
|
-
default: b(() => [
|
|
152
|
-
typeof g(x)(u(t)) != "string" ? (a(), k(D(g(x)(u(t))), { key: 0 })) : (a(), n(f, { key: 1 }, [
|
|
153
|
-
$(y(u(t)) + " ", 1),
|
|
154
|
-
t.required ? (a(), n("span", I, "*")) : i("", !0)
|
|
155
|
-
], 64))
|
|
156
|
-
]),
|
|
157
|
-
_: 2
|
|
158
|
-
}, 1024)) : i("", !0),
|
|
159
|
-
m("div", {
|
|
160
|
-
class: w(["relative min-w-0", [
|
|
161
|
-
e.helpers.getResolvedType(t, s) === "check" || e.helpers.getResolvedType(t, s) === "switch" && t.props?.switchVariant === "basic" ? "w-auto flex items-center" : "w-full"
|
|
162
|
-
]])
|
|
163
|
-
}, [
|
|
164
|
-
h(O, {
|
|
165
|
-
field: { ...t, props: { ...t.props || {} } },
|
|
166
|
-
value: e.helpers.getFieldValue(s, t.name),
|
|
167
|
-
values: r,
|
|
168
|
-
errors: e.helpers.errors,
|
|
169
|
-
error: e.helpers.getFieldError(s, t.name),
|
|
170
|
-
variant: e.variant,
|
|
171
|
-
size: e.size,
|
|
172
|
-
rounded: e.rounded,
|
|
173
|
-
disabled: e.disabled || e.helpers.isFieldDisabled(s, t),
|
|
174
|
-
readonly: e.readonly || e.helpers.isFieldReadonly(s, t),
|
|
175
|
-
isUpdate: e.isUpdate,
|
|
176
|
-
onChange: (T) => e.onFieldChange(s, t.name, T)
|
|
177
|
-
}, null, 8, ["field", "value", "values", "errors", "error", "variant", "size", "rounded", "disabled", "readonly", "isUpdate", "onChange"]),
|
|
178
|
-
e.helpers.getResolvedType(t, s) === "check" || e.helpers.getResolvedType(t, s) === "switch" && t.props?.switchVariant === "basic" ? (a(), k(z, {
|
|
179
|
-
key: 0,
|
|
180
|
-
class: "ml-2 text-sm font-medium cursor-pointer"
|
|
181
|
-
}, {
|
|
182
|
-
default: b(() => [
|
|
183
|
-
typeof g(x)(u(t)) != "string" ? (a(), k(D(g(x)(u(t))), { key: 0 })) : (a(), n(f, { key: 1 }, [
|
|
184
|
-
$(y(u(t)) + " ", 1),
|
|
185
|
-
t.required ? (a(), n("span", _, "*")) : i("", !0)
|
|
186
|
-
], 64))
|
|
187
|
-
]),
|
|
188
|
-
_: 2
|
|
189
|
-
}, 1024)) : i("", !0)
|
|
190
|
-
], 2),
|
|
191
|
-
e.helpers.getFieldError(s, t.name) ? (a(), n("p", ee, y(e.helpers.getFieldError(s, t.name)), 1)) : i("", !0)
|
|
192
|
-
], 64)) : i("", !0)
|
|
193
|
-
]))), 128)),
|
|
194
|
-
e.canRemoveRow ? (a(), n("div", te, [
|
|
195
|
-
h(H, {
|
|
196
|
-
type: "button",
|
|
197
|
-
variant: "secondary",
|
|
198
|
-
size: "xs",
|
|
199
|
-
icon: "lucide:trash-2",
|
|
200
|
-
disabled: e.disabled || e.readonly,
|
|
201
|
-
onClick: (t) => e.onRemoveRow(s)
|
|
202
|
-
}, null, 8, ["disabled", "onClick"])
|
|
203
|
-
])) : i("", !0)
|
|
204
|
-
])) : i("", !0)
|
|
205
|
-
]),
|
|
206
|
-
_: 2
|
|
207
|
-
}, 1032, ["item", "is-open"]));
|
|
208
|
-
return B.memo = V, B;
|
|
209
|
-
}, d, 1), 128))
|
|
210
|
-
]),
|
|
211
|
-
_: 1
|
|
212
|
-
}, 8, ["model-value", "onUpdate:modelValue", "disabled"]),
|
|
213
|
-
e.rows.length === 0 ? (a(), n("div", se, [
|
|
214
|
-
m("p", le, y(e.emptyTitle), 1),
|
|
215
|
-
m("p", ae, y(e.emptyDescription), 1)
|
|
216
|
-
])) : i("", !0)
|
|
217
|
-
]));
|
|
218
|
-
}
|
|
219
|
-
});
|
|
1
|
+
import o from "./AccordionView.vue3.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-bb30cb10"]]);
|
|
220
5
|
export {
|
|
221
|
-
|
|
6
|
+
m as default
|
|
222
7
|
};
|