vlite3 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { defineComponent as le, ref as i, computed as f, inject as ne, onMounted as oe, onUnmounted as ae, watch as M, provide as L, reactive as ie, toRefs as se, openBlock as V, createElementBlock as re, normalizeStyle as de, createVNode as P, unref as u, withCtx as m, createBlock as ue, normalizeClass as ce, createSlots as fe, renderSlot as v, normalizeProps as R, guardReactiveProps as W, createCommentVNode as me } from "vue";
1
+ import { defineComponent as le, ref as i, computed as f, inject as ne, onMounted as oe, onUnmounted as ae, watch as M, provide as L, reactive as ie, toRefs as se, openBlock as V, createElementBlock as de, normalizeStyle as re, createVNode as P, unref as u, withCtx as m, createBlock as ue, normalizeClass as ce, createSlots as fe, renderSlot as v, normalizeProps as R, guardReactiveProps as W, createCommentVNode as me } from "vue";
2
2
  import ve from "v-tooltip-lite";
3
3
  import "v-tooltip-lite/style.css";
4
4
  import he from "./DropdownMenu.vue.js";
@@ -53,7 +53,7 @@ const xe = /* @__PURE__ */ le({
53
53
  },
54
54
  emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
55
55
  setup(t, { emit: z }) {
56
- const l = t, h = z, b = i(!1), y = i(null), r = i({
56
+ const l = t, h = z, b = i(!1), y = i(null), d = i({
57
57
  title: "Confirm Selection",
58
58
  description: "Are you sure you want to select this option?",
59
59
  confirmText: "Confirm",
@@ -117,8 +117,8 @@ const xe = /* @__PURE__ */ le({
117
117
  );
118
118
  const c = f(() => {
119
119
  const e = [...S.value], o = new Set(e.map((n) => n.value ?? n.label));
120
- return k.value.forEach((n, d) => {
121
- o.has(d) || (e.unshift(n), o.add(d));
120
+ return k.value.forEach((n, r) => {
121
+ o.has(r) || (e.unshift(n), o.add(r));
122
122
  }), e;
123
123
  }), { selectedBuffer: k, isHydrating: K, hydrateSelected: E } = pe({
124
124
  fetchSelected: l.fetchSelected,
@@ -143,13 +143,13 @@ const xe = /* @__PURE__ */ le({
143
143
  );
144
144
  const _ = (e) => {
145
145
  if (l.disabled || l.readonly || e.disabled) return;
146
- l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ? r.value = {
146
+ l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ? d.value = {
147
147
  title: e.confirmation.title || "Confirm Selection",
148
148
  description: e.confirmation.description || "Are you sure you want to select this option?",
149
149
  confirmText: e.confirmation.confirmText || "Confirm",
150
150
  cancelText: e.confirmation.cancelText || "Cancel",
151
151
  variant: e.confirmation.variant || "primary"
152
- } : r.value = {
152
+ } : d.value = {
153
153
  title: "Confirm Selection",
154
154
  description: `Are you sure you want to select "${e.label}"?`,
155
155
  confirmText: "Confirm",
@@ -162,8 +162,8 @@ const xe = /* @__PURE__ */ le({
162
162
  k.value.has(o) || k.value.set(o, e);
163
163
  const n = Y(e);
164
164
  if (!l.isNested) {
165
- const d = e._originalOption || e, a = d.value ?? d.label;
166
- (e._path || [d]).forEach((T) => {
165
+ const r = e._originalOption || e, a = r.value ?? r.label;
166
+ (e._path || [r]).forEach((T) => {
167
167
  typeof T.onSelect == "function" && T.onSelect({
168
168
  value: a,
169
169
  option: T,
@@ -177,14 +177,15 @@ const xe = /* @__PURE__ */ le({
177
177
  }, te = () => {
178
178
  y.value = null, b.value = !1;
179
179
  };
180
- return (e, o) => (V(), re("div", {
180
+ return (e, o) => (V(), de("div", {
181
181
  class: "relative inline-block text-left",
182
- style: de({ direction: t.direction })
182
+ style: re({ direction: t.direction })
183
183
  }, [
184
184
  P(u(ve), {
185
185
  content: "",
186
186
  trigger: "click",
187
187
  arrow: !1,
188
+ disabled: t.disabled || t.readonly,
188
189
  teleport: t.teleport,
189
190
  offset: t.offset,
190
191
  placement: j.value,
@@ -283,14 +284,14 @@ const xe = /* @__PURE__ */ le({
283
284
  ]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : me("", !0)
284
285
  ]),
285
286
  _: 3
286
- }, 8, ["teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
287
+ }, 8, ["disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
287
288
  P(ge, {
288
289
  show: b.value,
289
- title: r.value.title,
290
- description: r.value.description,
291
- "confirm-text": r.value.confirmText,
292
- "cancel-text": r.value.cancelText,
293
- variant: r.value.variant,
290
+ title: d.value.title,
291
+ description: d.value.description,
292
+ "confirm-text": d.value.confirmText,
293
+ "cancel-text": d.value.cancelText,
294
+ variant: d.value.variant,
294
295
  onConfirm: ee,
295
296
  onCancel: te
296
297
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
@@ -1,7 +1,7 @@
1
1
  import o from "./DropdownMenu.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d7105497"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1742cff5"]]);
5
5
  export {
6
- _ as default
6
+ m as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as ee, ref as j, computed as y, watch as E, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as i, createVNode as O, createCommentVNode as u, renderSlot as b, unref as r, normalizeStyle as se, normalizeClass as T, createElementVNode as k, toDisplayString as N, createBlock as h, Fragment as P, renderList as oe, withCtx as V, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
2
- import w from "../Icon.vue.js";
1
+ import { defineComponent as ee, ref as j, computed as g, watch as T, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as c, createVNode as O, createCommentVNode as f, renderSlot as k, unref as r, normalizeStyle as se, normalizeClass as E, createElementVNode as w, toDisplayString as N, createBlock as h, Fragment as P, renderList as oe, withCtx as V, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
2
+ import p from "../Icon.vue.js";
3
3
  import ie from "../Input.vue.js";
4
4
  /* empty css */
5
5
  import ce from "./DropdownItem.vue.js";
@@ -53,19 +53,19 @@ const ve = ["dir"], ye = {
53
53
  },
54
54
  emits: ["select", "close", "load-more", "search"],
55
55
  setup(a, { emit: D }) {
56
- const t = a, m = D, _ = j(null), c = j(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = y(() => {
57
- if (c.value && c.value.trim() !== "")
56
+ const t = a, m = D, _ = j(null), i = j(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = g(() => {
57
+ if (i.value && i.value.trim() !== "")
58
58
  return t.searchEmptyMessage ? t.searchEmptyMessage : `No results found for
59
- "${c.value}"`;
59
+ "${i.value}"`;
60
60
  const e = $("vlite.dropdown.empty");
61
61
  return e !== "vlite.dropdown.empty" ? e : t.emptyMessage;
62
- }), R = y(() => {
62
+ }), R = g(() => {
63
63
  const e = $("vlite.dropdown.search");
64
64
  return e !== "vlite.dropdown.search" ? e : "Search...";
65
- }), f = y(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = y(() => t.searchable ? t.remote || (f.value.length || 0) > 5 || c.value.length > 0 : !1);
66
- let p = null;
67
- E(c, (e) => {
68
- t.remote && (p && clearTimeout(p), p = setTimeout(() => {
65
+ }), u = g(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = g(() => t.searchable ? i.value && i.value.trim() !== "" ? !0 : t.remote ? t.loading ? !0 : t.hasMore || (u.value.length || 0) > 5 : (u.value.length || 0) > 5 : !1);
66
+ let v = null;
67
+ T(i, (e) => {
68
+ t.remote && (v && clearTimeout(v), v = setTimeout(() => {
69
69
  e !== void 0 && m("search", e);
70
70
  }, t.debounceTime));
71
71
  });
@@ -75,7 +75,7 @@ const ve = ["dir"], ye = {
75
75
  }, x = (e, s) => {
76
76
  e.disabled || m("select", e);
77
77
  }, {
78
- focusedIndex: g,
78
+ focusedIndex: b,
79
79
  isKeyboardMode: M,
80
80
  filteredOptions: F,
81
81
  handleKeyDown: C,
@@ -83,12 +83,12 @@ const ve = ["dir"], ye = {
83
83
  onMouseEnterItem: S,
84
84
  scrollToIndex: K
85
85
  } = fe({
86
- options: f,
87
- searchQuery: c,
86
+ options: u,
87
+ searchQuery: i,
88
88
  containerRef: _,
89
89
  emit: (e, ...s) => m(e, ...s),
90
90
  handleSelect: (e, s) => x(e)
91
- }), v = y(() => t.remote ? c.value ? f.value : t.cachedOptions.length ? t.cachedOptions : f.value : F.value), U = (e) => {
91
+ }), y = g(() => t.remote ? i.value ? u.value : t.cachedOptions.length ? t.cachedOptions : u.value : F.value), U = (e) => {
92
92
  if (!(!t.selected || typeof t.selected != "object") && e.key && e.key in t.selected)
93
93
  return t.selected[e.key];
94
94
  }, q = (e) => e.disabled ? !1 : Array.isArray(t.selected) ? t.selected.includes(e.value) : t.selected && typeof t.selected == "object" && e.key ? t.selected[e.key] === e.value : t.selected === e.value, G = (e) => !e.key || !t.selected || typeof t.selected != "object" ? !1 : !!t.selected[e.key], J = (e, s) => {
@@ -117,27 +117,27 @@ const ve = ["dir"], ye = {
117
117
  }, W = async () => {
118
118
  await ae();
119
119
  let e = -1;
120
- t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = f.value.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
120
+ t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = u.value.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
121
121
  };
122
- E(
123
- () => v.value,
122
+ T(
123
+ () => y.value,
124
124
  () => {
125
- g.value = -1;
125
+ b.value = -1;
126
126
  }
127
127
  ), te(() => {
128
128
  W(), window.addEventListener("keydown", C);
129
129
  }), le(() => {
130
- window.removeEventListener("keydown", C);
130
+ window.removeEventListener("keydown", C), v && clearTimeout(v), i.value && t.remote && m("search", "");
131
131
  });
132
132
  const X = (e) => e.labelI18n ? $(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
133
- return (e, s) => (o(), i("div", {
133
+ return (e, s) => (o(), c("div", {
134
134
  class: "dropdown-menu w-full flex flex-col",
135
135
  dir: a.direction
136
136
  }, [
137
- B.value ? (o(), i("div", ye, [
137
+ B.value ? (o(), c("div", ye, [
138
138
  O(ie, {
139
- modelValue: c.value,
140
- "onUpdate:modelValue": s[0] || (s[0] = (l) => c.value = l),
139
+ modelValue: i.value,
140
+ "onUpdate:modelValue": s[0] || (s[0] = (l) => i.value = l),
141
141
  placeholder: R.value,
142
142
  icon: "lucide:search",
143
143
  size: "sm",
@@ -149,17 +149,17 @@ const ve = ["dir"], ye = {
149
149
  "show-clear-button": !1,
150
150
  "data-testid": "dropdown-search-input"
151
151
  }, null, 8, ["modelValue", "placeholder"])
152
- ])) : u("", !0),
153
- e.$slots.header ? (o(), i("div", ge, [
154
- b(e.$slots, "header", {}, void 0, !0)
155
- ])) : u("", !0),
156
- f.value.length > 0 || v.value.length === 0 ? (o(), i("div", {
152
+ ])) : f("", !0),
153
+ e.$slots.header ? (o(), c("div", ge, [
154
+ k(e.$slots, "header", {}, void 0, !0)
155
+ ])) : f("", !0),
156
+ u.value.length > 0 || y.value.length === 0 ? (o(), c("div", {
157
157
  key: 2,
158
158
  ref_key: "containerRef",
159
159
  ref: _,
160
160
  tabindex: B.value ? -1 : 0,
161
161
  role: "menu",
162
- class: T([
162
+ class: E([
163
163
  "w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1 scrollbar-thin",
164
164
  t.class
165
165
  ]),
@@ -168,26 +168,26 @@ const ve = ["dir"], ye = {
168
168
  (...l) => r(I) && r(I)(...l)),
169
169
  onScroll: A
170
170
  }, [
171
- !a.isCustomSlotMenu && v.value.length === 0 && !a.loading && !(f.value.length === 0 && e.$slots.menu) ? (o(), i("div", ke, [
172
- O(w, {
171
+ !a.isCustomSlotMenu && y.value.length === 0 && !a.loading && !(u.value.length === 0 && e.$slots.menu) ? (o(), c("div", ke, [
172
+ O(p, {
173
173
  icon: "lucide:inbox",
174
174
  class: "w-8 h-8 mb-2 opacity-70"
175
175
  }),
176
- k("span", null, N(L.value), 1)
177
- ])) : u("", !0),
176
+ w("span", null, N(L.value), 1)
177
+ ])) : f("", !0),
178
178
  a.layout === "grouped" ? (o(), h(ue, {
179
179
  key: 1,
180
- options: v.value,
180
+ options: y.value,
181
181
  selected: a.selected,
182
182
  selectable: a.selectable,
183
183
  columns: a.columns,
184
184
  onSelect: x
185
- }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), i(P, { key: 2 }, oe(v.value, (l, n) => (o(), i(P, { key: n }, [
186
- l.label === "---" ? (o(), i("div", we)) : l.data?.isBoolean ? (o(), h(de, {
185
+ }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(P, { key: 2 }, oe(y.value, (l, n) => (o(), c(P, { key: n }, [
186
+ l.label === "---" ? (o(), c("div", we)) : l.data?.isBoolean ? (o(), h(de, {
187
187
  key: 1,
188
188
  option: l,
189
189
  value: G(l),
190
- focused: r(M) && r(g) === n,
190
+ focused: r(M) && r(b) === n,
191
191
  onChange: J,
192
192
  onMouseenter: (d) => r(S)(n)
193
193
  }, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), h(he, {
@@ -207,30 +207,30 @@ const ve = ["dir"], ye = {
207
207
  onOnSelect: (d) => Q(l, d)
208
208
  }, {
209
209
  trigger: V(() => [
210
- k("div", {
210
+ w("div", {
211
211
  tabindex: 0,
212
212
  "data-dropdown-item": "",
213
- class: T(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1", [
214
- r(M) && r(g) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
213
+ class: E(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1", [
214
+ r(M) && r(b) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
215
215
  l.disabled ? "opacity-50 cursor-not-allowed" : "",
216
216
  l.triggerClass || l.class || ""
217
217
  ]]),
218
218
  onMouseenter: (d) => r(S)(n)
219
219
  }, [
220
- k("div", xe, [
221
- l.icon || l.emoji ? (o(), h(w, {
220
+ w("div", xe, [
221
+ l.icon || l.emoji ? (o(), h(p, {
222
222
  key: 0,
223
223
  icon: l.icon,
224
224
  emoji: l.emoji,
225
225
  class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
226
- }, null, 8, ["icon", "emoji"])) : u("", !0),
227
- k("span", Me, N(X(l)), 1)
226
+ }, null, 8, ["icon", "emoji"])) : f("", !0),
227
+ w("span", Me, N(X(l)), 1)
228
228
  ]),
229
- Y(l) ? (o(), h(w, {
229
+ Y(l) ? (o(), h(p, {
230
230
  key: 0,
231
231
  icon: a.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
232
232
  class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
233
- }, null, 8, ["icon"])) : u("", !0)
233
+ }, null, 8, ["icon"])) : f("", !0)
234
234
  ], 42, pe)
235
235
  ]),
236
236
  _: 2
@@ -239,7 +239,7 @@ const ve = ["dir"], ye = {
239
239
  option: l,
240
240
  index: n,
241
241
  selected: q(l),
242
- focused: r(M) && r(g) === n,
242
+ focused: r(M) && r(b) === n,
243
243
  selectable: a.selectable,
244
244
  onClick: (d) => x(l),
245
245
  onMouseenter: (d) => r(S)(n)
@@ -247,23 +247,23 @@ const ve = ["dir"], ye = {
247
247
  e.$slots.item ? {
248
248
  name: "default",
249
249
  fn: V((d) => [
250
- b(e.$slots, "item", re({ ref_for: !0 }, d), void 0, !0)
250
+ k(e.$slots, "item", re({ ref_for: !0 }, d), void 0, !0)
251
251
  ]),
252
252
  key: "0"
253
253
  } : void 0
254
254
  ]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
255
255
  ], 64))), 128)),
256
- a.loading ? (o(), i("div", Se, [
257
- O(w, {
256
+ a.loading ? (o(), c("div", Se, [
257
+ O(p, {
258
258
  icon: "lucide:loader-2",
259
259
  class: "w-4 h-4 animate-spin text-muted-foreground"
260
260
  })
261
- ])) : u("", !0),
262
- b(e.$slots, "menu", {}, void 0, !0)
263
- ], 46, be)) : u("", !0),
264
- e.$slots.footer ? (o(), i("div", Oe, [
265
- b(e.$slots, "footer", {}, void 0, !0)
266
- ])) : u("", !0)
261
+ ])) : f("", !0),
262
+ k(e.$slots, "menu", {}, void 0, !0)
263
+ ], 46, be)) : f("", !0),
264
+ e.$slots.footer ? (o(), c("div", Oe, [
265
+ k(e.$slots, "footer", {}, void 0, !0)
266
+ ])) : f("", !0)
267
267
  ], 8, ve));
268
268
  }
269
269
  });
@@ -37,6 +37,7 @@ interface Props {
37
37
  pageHeaderClass?: string;
38
38
  backButtonProps?: ButtonProps;
39
39
  backButtonPath?: string;
40
+ layout?: 'vertical' | 'inline';
40
41
  }
41
42
  declare function __VLS_template(): {
42
43
  attrs: Partial<{}>;
@@ -87,6 +88,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
87
88
  footer: boolean;
88
89
  class: string;
89
90
  loading: boolean;
91
+ layout: "vertical" | "inline";
90
92
  isUpdate: boolean;
91
93
  folderId: string;
92
94
  className: string;
@@ -1,7 +1,7 @@
1
1
  import o from "./Form.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fdd38572"]]);
4
+ const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d4325cd1"]]);
5
5
  export {
6
- p as default
6
+ _ as default
7
7
  };