vlite3 1.1.6 → 1.1.8

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.
Files changed (37) hide show
  1. package/README.md +1 -0
  2. package/components/Chart/GaugeChart.vue.d.ts +120 -0
  3. package/components/Chart/PieChart.vue.d.ts +1 -1
  4. package/components/Chart/index.d.ts +2 -1
  5. package/components/Chart/types.d.ts +60 -1
  6. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  7. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  8. package/components/DataTable/DataTable.vue.d.ts +1 -0
  9. package/components/DataTable/DataTable.vue.js +142 -132
  10. package/components/DataTable/DataTableHeader.vue.d.ts +1 -0
  11. package/components/DataTable/DataTableHeader.vue.js +17 -16
  12. package/components/DataTable/DataTableRow.vue.d.ts +1 -0
  13. package/components/DataTable/DataTableRow.vue.js +29 -25
  14. package/components/DataTable/types.d.ts +1 -0
  15. package/components/Dropdown/Dropdown.vue.d.ts +2 -1
  16. package/components/Dropdown/Dropdown.vue.js +37 -34
  17. package/components/Dropdown/DropdownMenu.vue.d.ts +3 -0
  18. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  19. package/components/Dropdown/DropdownMenu.vue2.js +83 -72
  20. package/components/Dropdown/DropdownTrigger.vue.js +8 -4
  21. package/components/MultiSelect/MultiSelect.vue.d.ts +26 -1
  22. package/components/MultiSelect/MultiSelect.vue.js +135 -100
  23. package/components/NavbarCommandPalette.vue.js +1 -1
  24. package/components/Skeleton/Skeleton.vue.d.ts +30 -0
  25. package/components/Skeleton/Skeleton.vue.js +215 -0
  26. package/components/Skeleton/Skeleton.vue2.js +4 -0
  27. package/components/Skeleton/extract.d.ts +5 -0
  28. package/components/Skeleton/extract.js +83 -0
  29. package/components/Skeleton/index.d.ts +4 -0
  30. package/components/Skeleton/shared.d.ts +14 -0
  31. package/components/Skeleton/shared.js +29 -0
  32. package/components/Skeleton/types.d.ts +59 -0
  33. package/components/Skeleton/types.js +6 -0
  34. package/index.d.ts +1 -0
  35. package/index.js +217 -207
  36. package/package.json +1 -1
  37. package/style.css +1 -1
@@ -1,5 +1,5 @@
1
- import { defineComponent as ee, ref as C, computed as v, watch as j, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as i, createVNode as T, createCommentVNode as d, renderSlot as b, unref as r, normalizeStyle as se, normalizeClass as E, toDisplayString as N, createBlock as m, Fragment as P, renderList as oe, withCtx as V, createElementVNode as S, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
2
- import O from "../Icon.vue.js";
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";
3
3
  import ie from "../Input.vue.js";
4
4
  /* empty css */
5
5
  import ce from "./DropdownItem.vue.js";
@@ -7,7 +7,7 @@ import de from "./DropdownBooleanItem.vue.js";
7
7
  import ue from "./DropdownGroupedLayout.vue.js";
8
8
  import { useDropdownNavigation as fe } from "./composables/useDropdownNavigation.js";
9
9
  import { useDropdownIds as me } from "./composables/useDropdownIds.js";
10
- import { $t as _ } from "../../utils/i18n.js";
10
+ import { $t as $ } from "../../utils/i18n.js";
11
11
  import he from "./Dropdown.vue.js";
12
12
  const ve = ["dir"], ye = {
13
13
  key: 0,
@@ -17,14 +17,14 @@ const ve = ["dir"], ye = {
17
17
  class: "shrink-0"
18
18
  }, be = ["tabindex"], ke = {
19
19
  key: 0,
20
- class: "px-2 py-6 text-center text-sm text-muted-foreground"
20
+ class: "flex flex-col items-center justify-center px-4 py-8 text-center text-sm text-muted-foreground whitespace-pre-line break-words"
21
21
  }, we = {
22
22
  key: 0,
23
23
  class: "h-px bg-border my-1 mx-1"
24
- }, pe = ["onMouseenter"], xe = { class: "flex items-center flex-1 min-w-0" }, Se = { class: "truncate" }, Oe = {
24
+ }, pe = ["onMouseenter"], xe = { class: "flex items-center flex-1 min-w-0" }, Me = { class: "truncate" }, Se = {
25
25
  key: 3,
26
26
  class: "flex justify-center py-2"
27
- }, _e = {
27
+ }, Oe = {
28
28
  key: 3,
29
29
  class: "shrink-0"
30
30
  }, De = /* @__PURE__ */ ee({
@@ -46,43 +46,48 @@ const ve = ["dir"], ye = {
46
46
  searchable: { type: Boolean, default: !0 },
47
47
  remote: { type: Boolean, default: !1 },
48
48
  debounceTime: { default: 300 },
49
- direction: { default: "ltr" }
49
+ direction: { default: "ltr" },
50
+ emptyMessage: { default: "No options found" },
51
+ searchEmptyMessage: {}
50
52
  },
51
53
  emits: ["select", "close", "load-more", "search"],
52
54
  setup(a, { emit: D }) {
53
- const t = a, f = D, $ = C(null), h = C(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = v(() => {
54
- const e = _("vlite.dropdown.empty");
55
- return e !== "vlite.dropdown.empty" ? e : "No options found";
56
- }), R = v(() => {
57
- const e = _("vlite.dropdown.search");
55
+ const t = a, f = D, _ = j(null), d = j(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = y(() => {
56
+ if (d.value && d.value.trim() !== "")
57
+ return t.searchEmptyMessage ? t.searchEmptyMessage : `No results found for
58
+ "${d.value}"`;
59
+ const e = $("vlite.dropdown.empty");
60
+ return e !== "vlite.dropdown.empty" ? e : t.emptyMessage;
61
+ }), R = y(() => {
62
+ const e = $("vlite.dropdown.search");
58
63
  return e !== "vlite.dropdown.search" ? e : "Search...";
59
- }), u = v(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), I = v(() => t.remote ? t.searchable : t.searchable && (u.value.length || 0) > 9);
60
- let k = null;
61
- j(h, (e) => {
62
- t.remote && (k && clearTimeout(k), k = setTimeout(() => {
64
+ }), m = y(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), I = y(() => t.searchable && (m.value.length || 0) > 5);
65
+ let p = null;
66
+ E(d, (e) => {
67
+ t.remote && (p && clearTimeout(p), p = setTimeout(() => {
63
68
  e !== void 0 && f("search", e);
64
69
  }, t.debounceTime));
65
70
  });
66
71
  const A = (e) => {
67
72
  const s = e.target;
68
73
  s.scrollTop + s.clientHeight >= s.scrollHeight - 50 && t.hasMore && !t.loading && f("load-more");
69
- }, w = (e, s) => {
74
+ }, x = (e, s) => {
70
75
  e.disabled || f("select", e);
71
76
  }, {
72
- focusedIndex: y,
73
- isKeyboardMode: p,
77
+ focusedIndex: g,
78
+ isKeyboardMode: M,
74
79
  filteredOptions: F,
75
- handleKeyDown: M,
76
- handleMouseMove: B,
77
- onMouseEnterItem: x,
80
+ handleKeyDown: B,
81
+ handleMouseMove: C,
82
+ onMouseEnterItem: S,
78
83
  scrollToIndex: K
79
84
  } = fe({
80
- options: u,
81
- searchQuery: h,
82
- containerRef: $,
85
+ options: m,
86
+ searchQuery: d,
87
+ containerRef: _,
83
88
  emit: (e, ...s) => f(e, ...s),
84
- handleSelect: (e, s) => w(e)
85
- }), g = v(() => t.remote ? h.value ? u.value : t.cachedOptions.length ? t.cachedOptions : u.value : F.value), U = (e) => {
89
+ handleSelect: (e, s) => x(e)
90
+ }), v = y(() => t.remote ? d.value ? m.value : t.cachedOptions.length ? t.cachedOptions : m.value : F.value), U = (e) => {
86
91
  if (!(!t.selected || typeof t.selected != "object") && e.key && e.key in t.selected)
87
92
  return t.selected[e.key];
88
93
  }, 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) => {
@@ -111,27 +116,27 @@ const ve = ["dir"], ye = {
111
116
  }, W = async () => {
112
117
  await ae();
113
118
  let e = -1;
114
- 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));
119
+ t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = m.value.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
115
120
  };
116
- j(
117
- () => g.value,
121
+ E(
122
+ () => v.value,
118
123
  () => {
119
- y.value = -1;
124
+ g.value = -1;
120
125
  }
121
126
  ), te(() => {
122
- W(), window.addEventListener("keydown", M);
127
+ W(), window.addEventListener("keydown", B);
123
128
  }), le(() => {
124
- window.removeEventListener("keydown", M);
129
+ window.removeEventListener("keydown", B);
125
130
  });
126
- const X = (e) => e.labelI18n ? _(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
131
+ const X = (e) => e.labelI18n ? $(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
127
132
  return (e, s) => (o(), i("div", {
128
133
  class: "dropdown-menu w-full min-w-[150px] flex flex-col",
129
134
  dir: a.direction
130
135
  }, [
131
136
  I.value ? (o(), i("div", ye, [
132
- T(ie, {
133
- modelValue: h.value,
134
- "onUpdate:modelValue": s[0] || (s[0] = (l) => h.value = l),
137
+ O(ie, {
138
+ modelValue: d.value,
139
+ "onUpdate:modelValue": s[0] || (s[0] = (l) => d.value = l),
135
140
  placeholder: R.value,
136
141
  icon: "lucide:search",
137
142
  size: "sm",
@@ -143,42 +148,48 @@ const ve = ["dir"], ye = {
143
148
  "show-clear-button": !1,
144
149
  "data-testid": "dropdown-search-input"
145
150
  }, null, 8, ["modelValue", "placeholder"])
146
- ])) : d("", !0),
151
+ ])) : u("", !0),
147
152
  e.$slots.header ? (o(), i("div", ge, [
148
153
  b(e.$slots, "header", {}, void 0, !0)
149
- ])) : d("", !0),
150
- u.value.length > 0 || e.$slots.menu ? (o(), i("div", {
154
+ ])) : u("", !0),
155
+ m.value.length > 0 || e.$slots.menu || v.value.length === 0 ? (o(), i("div", {
151
156
  key: 2,
152
157
  ref_key: "containerRef",
153
- ref: $,
158
+ ref: _,
154
159
  tabindex: I.value ? -1 : 0,
155
160
  role: "menu",
156
- class: E([
161
+ class: T([
157
162
  "w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1 scrollbar-thin",
158
163
  t.class
159
164
  ]),
160
165
  style: se({ maxHeight: t.maxHeight }),
161
166
  onMousemove: s[1] || (s[1] = //@ts-ignore
162
- (...l) => r(B) && r(B)(...l)),
167
+ (...l) => r(C) && r(C)(...l)),
163
168
  onScroll: A
164
169
  }, [
165
- g.value.length === 0 && u.value.length > 0 && !a.loading ? (o(), i("div", ke, N(L.value), 1)) : d("", !0),
166
- a.layout === "grouped" ? (o(), m(ue, {
170
+ v.value.length === 0 && !a.loading ? (o(), i("div", ke, [
171
+ O(w, {
172
+ icon: "lucide:inbox",
173
+ class: "w-8 h-8 mb-2 opacity-70"
174
+ }),
175
+ k("span", null, N(L.value), 1)
176
+ ])) : u("", !0),
177
+ a.layout === "grouped" ? (o(), h(ue, {
167
178
  key: 1,
168
- options: g.value,
179
+ options: v.value,
169
180
  selected: a.selected,
170
181
  selectable: a.selectable,
171
182
  columns: a.columns,
172
- onSelect: w
173
- }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), i(P, { key: 2 }, oe(g.value, (l, n) => (o(), i(P, { key: n }, [
174
- l.label === "---" ? (o(), i("div", we)) : l.data?.isBoolean ? (o(), m(de, {
183
+ onSelect: x
184
+ }, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), i(P, { key: 2 }, oe(v.value, (l, n) => (o(), i(P, { key: n }, [
185
+ l.label === "---" ? (o(), i("div", we)) : l.data?.isBoolean ? (o(), h(de, {
175
186
  key: 1,
176
187
  option: l,
177
188
  value: G(l),
178
- focused: r(p) && r(y) === n,
189
+ focused: r(M) && r(g) === n,
179
190
  onChange: J,
180
- onMouseenter: (c) => r(x)(n)
181
- }, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(he, {
191
+ onMouseenter: (c) => r(S)(n)
192
+ }, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), h(he, {
182
193
  key: 2,
183
194
  "is-nested": !0,
184
195
  position: l.position || t.nestedPosition,
@@ -195,42 +206,42 @@ const ve = ["dir"], ye = {
195
206
  onOnSelect: (c) => Q(l, c)
196
207
  }, {
197
208
  trigger: V(() => [
198
- S("div", {
209
+ k("div", {
199
210
  tabindex: 0,
200
211
  "data-dropdown-item": "",
201
- 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", [
202
- r(p) && r(y) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
212
+ 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", [
213
+ r(M) && r(g) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
203
214
  l.disabled ? "opacity-50 cursor-not-allowed" : "",
204
215
  l.triggerClass || l.class || ""
205
216
  ]]),
206
- onMouseenter: (c) => r(x)(n)
217
+ onMouseenter: (c) => r(S)(n)
207
218
  }, [
208
- S("div", xe, [
209
- l.icon || l.emoji ? (o(), m(O, {
219
+ k("div", xe, [
220
+ l.icon || l.emoji ? (o(), h(w, {
210
221
  key: 0,
211
222
  icon: l.icon,
212
223
  emoji: l.emoji,
213
224
  class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
214
- }, null, 8, ["icon", "emoji"])) : d("", !0),
215
- S("span", Se, N(X(l)), 1)
225
+ }, null, 8, ["icon", "emoji"])) : u("", !0),
226
+ k("span", Me, N(X(l)), 1)
216
227
  ]),
217
- Y(l) ? (o(), m(O, {
228
+ Y(l) ? (o(), h(w, {
218
229
  key: 0,
219
230
  icon: a.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
220
231
  class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
221
- }, null, 8, ["icon"])) : d("", !0)
232
+ }, null, 8, ["icon"])) : u("", !0)
222
233
  ], 42, pe)
223
234
  ]),
224
235
  _: 2
225
- }, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ce, {
236
+ }, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), h(ce, {
226
237
  key: 3,
227
238
  option: l,
228
239
  index: n,
229
240
  selected: q(l),
230
- focused: r(p) && r(y) === n,
241
+ focused: r(M) && r(g) === n,
231
242
  selectable: a.selectable,
232
- onClick: (c) => w(l),
233
- onMouseenter: (c) => r(x)(n)
243
+ onClick: (c) => x(l),
244
+ onMouseenter: (c) => r(S)(n)
234
245
  }, ne({ _: 2 }, [
235
246
  e.$slots.item ? {
236
247
  name: "default",
@@ -241,17 +252,17 @@ const ve = ["dir"], ye = {
241
252
  } : void 0
242
253
  ]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
243
254
  ], 64))), 128)),
244
- a.loading ? (o(), i("div", Oe, [
245
- T(O, {
255
+ a.loading ? (o(), i("div", Se, [
256
+ O(w, {
246
257
  icon: "lucide:loader-2",
247
258
  class: "w-4 h-4 animate-spin text-muted-foreground"
248
259
  })
249
- ])) : d("", !0),
260
+ ])) : u("", !0),
250
261
  b(e.$slots, "menu", {}, void 0, !0)
251
- ], 46, be)) : d("", !0),
252
- e.$slots.footer ? (o(), i("div", _e, [
262
+ ], 46, be)) : u("", !0),
263
+ e.$slots.footer ? (o(), i("div", Oe, [
253
264
  b(e.$slots, "footer", {}, void 0, !0)
254
- ])) : d("", !0)
265
+ ])) : u("", !0)
255
266
  ], 8, ve));
256
267
  }
257
268
  });
@@ -1,5 +1,5 @@
1
- import { defineComponent as a, openBlock as l, createBlock as d, mergeProps as n } from "vue";
2
- import o from "../Button.vue.js";
1
+ import { defineComponent as a, openBlock as l, createBlock as d, mergeProps as i } from "vue";
2
+ import n from "../Button.vue.js";
3
3
  const s = /* @__PURE__ */ a({
4
4
  __name: "DropdownTrigger",
5
5
  props: {
@@ -14,7 +14,7 @@ const s = /* @__PURE__ */ a({
14
14
  triggerProps: {}
15
15
  },
16
16
  setup(e) {
17
- return (t, i) => (l(), d(o, n({
17
+ return (t, o) => (l(), d(n, i({
18
18
  text: e.selectedLabel || e.placeholder,
19
19
  iconRight: e.disabled || e.readonly ? void 0 : "iconamoon:arrow-down-2",
20
20
  variant: "outline",
@@ -22,7 +22,11 @@ const s = /* @__PURE__ */ a({
22
22
  dir: e.direction
23
23
  }, e.triggerProps, {
24
24
  icon: e.selectedIcon || e.triggerProps?.icon,
25
- class: ["w-full justify-between! font-normal px-2.5!", [e.className, e.readonly && !e.disabled ? "pointer-events-none" : ""]],
25
+ class: ["w-full font-normal px-2.5!", [
26
+ e.className,
27
+ e.readonly && !e.disabled ? "pointer-events-none justify-start!" : "",
28
+ e.disabled || e.readonly ? "justify-start!" : "justify-between!"
29
+ ]],
26
30
  "icon-right-class": "ml-auto!",
27
31
  "data-testid": t.$attrs["data-testid"] || "dropdown-trigger"
28
32
  }), null, 16, ["text", "iconRight", "disabled", "dir", "icon", "class", "data-testid"]));
@@ -4,6 +4,8 @@ interface Props {
4
4
  options?: (IDropdownOption | string | number)[];
5
5
  placeholder?: string;
6
6
  placeholderI18n?: string;
7
+ emptyMessage?: string;
8
+ searchEmptyMessage?: string;
7
9
  disabled?: boolean;
8
10
  readonly?: boolean;
9
11
  searchable?: boolean;
@@ -20,7 +22,23 @@ interface Props {
20
22
  wrap?: boolean;
21
23
  rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | string;
22
24
  }
23
- declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
25
+ declare function __VLS_template(): {
26
+ attrs: Partial<{}>;
27
+ slots: {
28
+ menu?(_: {}): any;
29
+ item?(_: {
30
+ option: IDropdownOption;
31
+ index: number;
32
+ selected: boolean;
33
+ }): any;
34
+ header?(_: {}): any;
35
+ footer?(_: {}): any;
36
+ };
37
+ refs: {};
38
+ rootEl: HTMLDivElement;
39
+ };
40
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
41
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
24
42
  search: (query: string) => any;
25
43
  change: (value: any[]) => any;
26
44
  "update:modelValue": (value: any[]) => any;
@@ -44,8 +62,15 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
44
62
  searchable: boolean;
45
63
  remote: boolean;
46
64
  debounceTime: number;
65
+ emptyMessage: string;
47
66
  maxVisible: number;
48
67
  showControls: boolean;
49
68
  wrap: boolean;
50
69
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
70
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
51
71
  export default _default;
72
+ type __VLS_WithTemplateSlots<T, S> = T & {
73
+ new (): {
74
+ $slots: S;
75
+ };
76
+ };