vlite3 1.2.2 → 1.2.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.
Files changed (38) hide show
  1. package/README.md +1 -0
  2. package/components/AppShell/AppShellLayoutDashboard.vue.js +1 -1
  3. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +1 -1
  4. package/components/AsyncSelect/createAsyncSelect.d.ts +88 -0
  5. package/components/AsyncSelect/createAsyncSelect.js +156 -0
  6. package/components/AsyncSelect/index.d.ts +1 -0
  7. package/components/ChoiceBox/ChoiceBox.vue.js +4 -2
  8. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  9. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  10. package/components/Form/Form.vue.js +1 -1
  11. package/components/Form/Form.vue2.js +1 -1
  12. package/components/List/ListFieldRow.vue.js +221 -144
  13. package/components/NavbarCommandPalette.vue.js +1 -1
  14. package/components/Price/Price.vue.d.ts +1 -1
  15. package/components/Price/Price.vue.js +35 -13
  16. package/components/Rating/Rating.vue.d.ts +43 -0
  17. package/components/Rating/Rating.vue.js +7 -0
  18. package/components/Rating/Rating.vue2.js +92 -0
  19. package/components/Rating/ReviewSummary.vue.d.ts +5 -0
  20. package/components/Rating/ReviewSummary.vue.js +67 -0
  21. package/components/Rating/ReviewSummary.vue2.js +4 -0
  22. package/components/Rating/index.d.ts +3 -0
  23. package/components/Rating/types.d.ts +28 -0
  24. package/components/Screen/Screen.vue.d.ts +2 -2
  25. package/components/Screen/Screen.vue.js +3 -1
  26. package/components/SidebarMenu/SidebarMenu.vue.js +1 -1
  27. package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +3 -1
  28. package/components/SidebarMenu/SidebarMenuItem.vue.js +198 -175
  29. package/components/Stats/StatItem.vue.js +222 -164
  30. package/components/Stats/components/StatIconBox.vue.js +42 -42
  31. package/components/Stats/components/StatTrend.vue.js +20 -20
  32. package/components/Timeline/Timeline.vue.js +21 -11
  33. package/components/Timeline/TimelineItem.vue.js +1 -1
  34. package/index.d.ts +2 -0
  35. package/index.js +108 -102
  36. package/package.json +2 -1
  37. package/style.css +23 -17
  38. package/utils/status.js +16 -16
package/README.md CHANGED
@@ -431,6 +431,7 @@ Follow these rules strictly to ensure visual consistency and predictable styling
431
431
  - [x] **CustomFields**
432
432
  - [x] **GoogleLogin**
433
433
  - [x] **PermissionEditor**
434
+ - [x] **Rating**
434
435
  - [x] **RichTextEditor**
435
436
 
436
437
  ### Data Display
@@ -119,7 +119,7 @@ const D = { class: "vlite-app-layout flex flex-row w-full h-full bg-muted/20 p-0
119
119
  ref_key: "mainScrollRef",
120
120
  ref: S,
121
121
  style: { "will-change": "transform", contain: "layout style" },
122
- class: "flex-1 overflow-y-auto pt-2 w-full relative h-full scrollbar-thin scrollbar-stable"
122
+ class: "flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable"
123
123
  }, [
124
124
  l(s.$slots, "main")
125
125
  ], 512)
@@ -121,7 +121,7 @@ const H = { class: "vlite-app-layout flex flex-row w-full h-full bg-background o
121
121
  ref_key: "mainScrollRef",
122
122
  ref: S,
123
123
  style: { "will-change": "transform", contain: "layout style" },
124
- class: "flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable px-6 pb-4 mt-4"
124
+ class: "flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable"
125
125
  }, [
126
126
  l(s.$slots, "main")
127
127
  ], 512)
@@ -0,0 +1,88 @@
1
+ import { PropType } from 'vue';
2
+ export interface SelectOption<T = unknown> {
3
+ label: string;
4
+ value: string | number;
5
+ subtitle?: string;
6
+ description?: string;
7
+ icon?: string;
8
+ data?: T;
9
+ }
10
+ export type OptionsMapper<T> = (item: T) => SelectOption<T> | null | undefined;
11
+ export interface CreateSelectConfig<T = any> {
12
+ name: string;
13
+ useQuery: any;
14
+ queryName: string;
15
+ labelKey?: keyof T | ((item: T) => string);
16
+ subtitleKey?: keyof T | ((item: T) => string);
17
+ descriptionKey?: keyof T | ((item: T) => string);
18
+ valueKey?: keyof T;
19
+ iconKey?: keyof T | ((item: T) => string);
20
+ searchable?: boolean;
21
+ remote?: boolean;
22
+ multiple?: boolean;
23
+ optionsMapper?: OptionsMapper<T>;
24
+ }
25
+ export declare const createAsyncSelect: <T extends {
26
+ id?: string | number;
27
+ }>(config: CreateSelectConfig<T>) => import('vue').DefineComponent<import('vue').ExtractPropTypes<{
28
+ value: {
29
+ type: (ObjectConstructor | ArrayConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
30
+ };
31
+ modelValue: {
32
+ type: (ObjectConstructor | ArrayConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
33
+ };
34
+ multiple: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ placeholder: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ filter: {
43
+ type: ObjectConstructor;
44
+ default: () => {};
45
+ };
46
+ disabled: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
50
+ optionsMapper: {
51
+ type: PropType<OptionsMapper<T>>;
52
+ };
53
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("onChange" | "change" | "update:modelValue")[], "onChange" | "change" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
54
+ value: {
55
+ type: (ObjectConstructor | ArrayConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
56
+ };
57
+ modelValue: {
58
+ type: (ObjectConstructor | ArrayConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
59
+ };
60
+ multiple: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ placeholder: {
65
+ type: StringConstructor;
66
+ default: string;
67
+ };
68
+ filter: {
69
+ type: ObjectConstructor;
70
+ default: () => {};
71
+ };
72
+ disabled: {
73
+ type: BooleanConstructor;
74
+ default: boolean;
75
+ };
76
+ optionsMapper: {
77
+ type: PropType<OptionsMapper<T>>;
78
+ };
79
+ }>> & Readonly<{
80
+ onChange?: (...args: any[]) => any;
81
+ "onUpdate:modelValue"?: (...args: any[]) => any;
82
+ onOnChange?: (...args: any[]) => any;
83
+ }>, {
84
+ filter: Record<string, any>;
85
+ placeholder: string;
86
+ disabled: boolean;
87
+ multiple: boolean;
88
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,156 @@
1
+ import { defineComponent as q, ref as m, computed as s, watch as _, createVNode as w, mergeProps as I, nextTick as j } from "vue";
2
+ import k from "../Dropdown/Dropdown.vue.js";
3
+ import "@iconify/vue";
4
+ import "../../core/config.js";
5
+ /* empty css */
6
+ /* empty css */
7
+ import x from "../MultiSelect/MultiSelect.vue.js";
8
+ const z = (t) => /* @__PURE__ */ q({
9
+ name: t.name,
10
+ inheritAttrs: !1,
11
+ props: {
12
+ value: {
13
+ type: [String, Array, Number, Object, Boolean]
14
+ },
15
+ modelValue: {
16
+ type: [String, Array, Number, Object, Boolean]
17
+ },
18
+ multiple: {
19
+ type: Boolean,
20
+ default: t.multiple || !1
21
+ },
22
+ placeholder: {
23
+ type: String,
24
+ default: "Select..."
25
+ },
26
+ filter: {
27
+ type: Object,
28
+ default: () => ({})
29
+ },
30
+ disabled: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ optionsMapper: {
35
+ type: Function
36
+ }
37
+ },
38
+ emits: ["onChange", "update:modelValue", "change"],
39
+ setup(l, {
40
+ attrs: M,
41
+ emit: c
42
+ }) {
43
+ const i = m([]), d = m(1), f = m(""), N = 20, h = s(() => l.value !== void 0 ? l.value : l.modelValue), v = s(() => l.optionsMapper || t.optionsMapper), B = s(() => ({
44
+ pagination: {
45
+ page: d.value,
46
+ limit: N
47
+ },
48
+ search: f.value || void 0,
49
+ filter: {
50
+ ...l.filter
51
+ }
52
+ })), {
53
+ result: b,
54
+ loading: K,
55
+ refetch: g
56
+ } = t.useQuery(B, {
57
+ notifyOnNetworkStatusChange: !0,
58
+ fetchPolicy: "cache-and-network"
59
+ }), A = s(() => {
60
+ const e = b.value?.[t.queryName]?.pageInfo;
61
+ return e ? e.currentPage < e.totalPages : !1;
62
+ });
63
+ _(() => b.value?.[t.queryName], (e) => {
64
+ if (!e) return;
65
+ const n = Array.isArray(e) ? e : e.items;
66
+ if (n)
67
+ if (d.value === 1)
68
+ i.value = [...n];
69
+ else {
70
+ const u = new Set(i.value.map((a) => a.id)), r = n.filter((a) => !u.has(a.id));
71
+ i.value.push(...r);
72
+ }
73
+ }, {
74
+ immediate: !0
75
+ });
76
+ const S = (e) => {
77
+ if (v.value)
78
+ return v.value(e);
79
+ const n = typeof t.labelKey == "function" ? t.labelKey(e) : e[t.labelKey || "name"], u = typeof t.subtitleKey == "function" ? t.subtitleKey(e) : e[t.subtitleKey || ""], r = typeof t.descriptionKey == "function" ? t.descriptionKey(e) : e[t.descriptionKey || ""], a = t.iconKey ? typeof t.iconKey == "function" ? t.iconKey(e) : e[t.iconKey] : void 0;
80
+ return {
81
+ label: n,
82
+ subtitle: u || void 0,
83
+ description: r || void 0,
84
+ value: e[t.valueKey || "id"],
85
+ icon: a || void 0,
86
+ data: e
87
+ };
88
+ }, p = s(() => i.value.map(S).filter(Boolean)), y = (e, n) => {
89
+ let u = n;
90
+ l.multiple && Array.isArray(e) && (u = e.map((a) => {
91
+ const o = p.value.find((V) => V.value === a);
92
+ return o ? o.data : null;
93
+ }).filter(Boolean));
94
+ const r = {
95
+ value: e,
96
+ data: u
97
+ };
98
+ c("update:modelValue", e), c("change", r), c("onChange", r);
99
+ }, C = (e) => {
100
+ f.value = e, d.value = 1;
101
+ }, O = () => {
102
+ !A.value || K.value || d.value++;
103
+ }, P = async (e) => {
104
+ const n = (Array.isArray(e) ? e : [e]).filter((a) => (typeof a == "string" || typeof a == "number") && a !== "");
105
+ if (n.length === 0) return [];
106
+ await j();
107
+ const u = new Set(p.value.map((a) => a.value)), r = n.filter((a) => !u.has(a));
108
+ if (r.length === 0) return [];
109
+ try {
110
+ const {
111
+ data: a
112
+ } = await g({
113
+ pagination: {
114
+ page: 1,
115
+ limit: r.length
116
+ },
117
+ filter: {
118
+ ...l.filter,
119
+ ids: r
120
+ }
121
+ }), o = a?.[t.queryName];
122
+ return (Array.isArray(o) ? o : o?.items || []).map(S).filter(Boolean);
123
+ } catch (a) {
124
+ return console.error(`[${t.name}] Hydration failed`, a), [];
125
+ }
126
+ };
127
+ return () => {
128
+ const e = {
129
+ options: p.value,
130
+ loading: K.value,
131
+ searchable: t.searchable ?? !0,
132
+ remote: t.remote ?? !0,
133
+ hasMore: A.value,
134
+ placeholder: l.placeholder,
135
+ disabled: l.disabled,
136
+ fetchSelected: P,
137
+ onSearch: C,
138
+ onLoadMore: O,
139
+ ...M
140
+ };
141
+ return l.multiple ? w(x, I(e, {
142
+ modelValue: h.value,
143
+ "onUpdate:modelValue": (n) => y(n),
144
+ onChange: (n) => y(n)
145
+ }), null) : w(k, I(e, {
146
+ showSelectedIcon: !0,
147
+ emptyMessage: "Data not found",
148
+ modelValue: h.value,
149
+ onOnSelect: (n) => y(n.value, n.data)
150
+ }), null);
151
+ };
152
+ }
153
+ });
154
+ export {
155
+ z as createAsyncSelect
156
+ };
@@ -0,0 +1 @@
1
+ export * from './createAsyncSelect';
@@ -15,7 +15,7 @@ const E = { class: "w-full" }, S = {
15
15
  class: "shrink-0 pt-0.5"
16
16
  }, L = { class: "flex flex-col" }, M = { class: "flex items-center gap-2" }, G = {
17
17
  key: 0,
18
- class: "mt-1 -text-fs-3 text-muted leading-relaxed"
18
+ class: "mt-0.5 -text-fs-3 text-muted leading-relaxed"
19
19
  }, H = {
20
20
  key: 0,
21
21
  class: "absolute top-4 right-4 text-primary"
@@ -35,7 +35,9 @@ const E = { class: "w-full" }, S = {
35
35
  },
36
36
  emits: ["update:modelValue", "change"],
37
37
  setup(g, { emit: _ }) {
38
- const s = g, x = _, f = m(() => s.titleI18n ? u(s.titleI18n) : s.title), p = m(() => s.descriptionI18n ? u(s.descriptionI18n) : s.description), k = (t) => t.titleI18n ? u(t.titleI18n) : t.title, I = (t) => t.descriptionI18n ? u(t.descriptionI18n) : t.description, w = (t) => t.badgeI18n ? u(t.badgeI18n) : t.badge, d = (t) => Array.isArray(s.modelValue) ? s.modelValue.includes(t) : s.modelValue === t, b = (t) => {
38
+ const s = g, x = _, f = m(() => s.titleI18n ? u(s.titleI18n) : s.title), p = m(
39
+ () => s.descriptionI18n ? u(s.descriptionI18n) : s.description
40
+ ), k = (t) => t.titleI18n ? u(t.titleI18n) : t.title, I = (t) => t.descriptionI18n ? u(t.descriptionI18n) : t.description, w = (t) => t.badgeI18n ? u(t.badgeI18n) : t.badge, d = (t) => Array.isArray(s.modelValue) ? s.modelValue.includes(t) : s.modelValue === t, b = (t) => {
39
41
  if (s.disabled || s.options.find((l) => l.id === t)?.disabled) return;
40
42
  let e;
41
43
  if (s.multiple) {
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
4
4
  import { $t as E } from "../../utils/i18n.js";
5
5
  import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
6
6
  import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
7
- import ee from "./CommandPaletteItem.vue.js";
7
+ import ee from "./CommandPaletteItem.vue2.js";
8
8
  const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
9
9
  key: 0,
10
10
  class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
@@ -1,5 +1,5 @@
1
1
  import t from "./CommandPaletteItem.vue3.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-66b1ae06"]]);
5
5
  export {
@@ -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-712d6d5d"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-45c18c7b"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -220,7 +220,7 @@ const Be = ["onKeydown"], Le = { class: "flex items-center gap-3" }, Ne = { clas
220
220
  ], 2)) : c("", !0),
221
221
  !e.schemaLoading && u.value && X.value.length > 0 ? (s(), d("div", {
222
222
  key: 1,
223
- class: m(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
223
+ class: m(["form-timeline", e.timelineTextPosition == "right" ? "mb-2" : "mb-8"])
224
224
  }, [
225
225
  T(t(Pe), {
226
226
  steps: X.value,