vlite3 0.9.1 → 0.9.3

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 (42) hide show
  1. package/components/Alert.vue.js +40 -38
  2. package/components/Carousel/Carousel.vue.d.ts +2 -2
  3. package/components/Carousel/Carousel.vue.js +2 -2
  4. package/components/Carousel/Carousel.vue2.js +1 -1
  5. package/components/Chat/ChatBubble.vue.d.ts +18 -0
  6. package/components/Chat/ChatInterface.vue.d.ts +45 -0
  7. package/components/Chat/index.d.ts +2 -0
  8. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  9. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  10. package/components/DataTable/DataTableRow.vue.js +1 -1
  11. package/components/DateTime/DateTime.vue.js +31 -0
  12. package/components/DateTime/DateTime.vue2.js +4 -0
  13. package/components/DateTime/index.d.ts +1 -0
  14. package/components/FilePicker/FilePicker.vue.d.ts +4 -1
  15. package/components/FilePicker/FilePicker.vue.js +189 -139
  16. package/components/Form/CustomFields.vue.d.ts +2 -0
  17. package/components/Form/CustomFields.vue.js +2 -2
  18. package/components/Form/CustomFields.vue2.js +121 -99
  19. package/components/Form/FormField.vue.js +3 -1
  20. package/components/Form/types.d.ts +1 -0
  21. package/components/List/ListFieldRow.vue.js +1 -1
  22. package/components/NavbarCommandPalette.vue.js +1 -1
  23. package/components/Screen/Screen.vue.d.ts +1 -0
  24. package/components/Screen/Screen.vue.js +112 -107
  25. package/components/Screen/ScreenFilter.vue.js +3 -2
  26. package/components/Screen/components/ScreenEmptyState.vue.js +11 -10
  27. package/components/Screen/components/ScreenHeaderTitle.vue.d.ts +2 -0
  28. package/components/Screen/components/ScreenHeaderTitle.vue.js +28 -24
  29. package/components/Screen/components/ScreenQuickFilters.vue.js +1 -1
  30. package/components/Screen/types.d.ts +3 -0
  31. package/core/config.d.ts +2 -2
  32. package/core/config.js +7 -7
  33. package/core/index.js +3 -3
  34. package/index.d.ts +1 -1
  35. package/index.js +2 -2
  36. package/package.json +2 -2
  37. package/style.css +9 -10
  38. package/types/config.type.d.ts +1 -1
  39. package/components/Date/Date.vue.js +0 -21
  40. package/components/Date/Date.vue2.js +0 -4
  41. package/components/Date/index.d.ts +0 -1
  42. /package/components/{Date/Date.vue.d.ts → DateTime/DateTime.vue.d.ts} +0 -0
@@ -1,27 +1,32 @@
1
- import { defineComponent as M, computed as c, shallowRef as G, watch as H, openBlock as o, createElementBlock as n, createElementVNode as b, createBlock as q, withCtx as N, createTextVNode as J, toDisplayString as m, createCommentVNode as u, createVNode as v, Fragment as x, renderList as y, normalizeClass as F, TransitionGroup as K, isMemoSame as O } from "vue";
2
- import P from "./FormField.vue.js";
3
- import B from "../Button.vue.js";
4
- import Q from "../Label.vue.js";
5
- import { $t as p } from "../../utils/i18n.js";
6
- const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between items-center mb-2" }, Y = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, Z = {
1
+ import { defineComponent as H, computed as c, shallowRef as q, watch as G, openBlock as o, createElementBlock as n, createElementVNode as g, createBlock as J, withCtx as B, createTextVNode as K, toDisplayString as m, createCommentVNode as i, createVNode as b, Fragment as y, renderList as p, normalizeClass as x, unref as O, isMemoSame as P } from "vue";
2
+ import { VueDraggable as Q } from "vue-draggable-plus";
3
+ import W from "./FormField.vue.js";
4
+ import F from "../Button.vue.js";
5
+ import X from "../Label.vue.js";
6
+ import Y from "../Icon.vue.js";
7
+ import { $t as h } from "../../utils/i18n.js";
8
+ const Z = { class: "custom-fields-wrapper" }, ee = { class: "flex justify-between items-center mb-2" }, te = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, ae = {
7
9
  key: 0,
8
10
  class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
9
- }, ee = {
11
+ }, le = {
10
12
  key: 0,
11
- class: "w-10 flex-none p-3 text-center border-r border-border"
12
- }, te = {
13
+ class: "w-10 flex-none p-3 border-r border-border"
14
+ }, re = {
13
15
  key: 1,
14
- class: "w-10 flex-none p-3"
16
+ class: "w-10 flex-none p-3 text-center border-r border-border"
15
17
  }, se = {
16
- key: 0,
17
- class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
18
- }, le = {
18
+ key: 2,
19
+ class: "w-10 flex-none p-3"
20
+ }, oe = {
19
21
  key: 1,
22
+ class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
23
+ }, ne = {
24
+ key: 2,
20
25
  class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
21
- }, ae = {
26
+ }, de = {
22
27
  key: 1,
23
28
  class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
24
- }, oe = { class: "text-sm font-medium text-foreground" }, ne = { class: "text-xs text-muted-foreground mt-1" }, fe = /* @__PURE__ */ M({
29
+ }, ie = { class: "text-sm font-medium text-foreground" }, ue = { class: "text-xs text-muted-foreground mt-1" }, ye = /* @__PURE__ */ H({
25
30
  __name: "CustomFields",
26
31
  props: {
27
32
  modelValue: { default: () => [] },
@@ -31,6 +36,7 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
31
36
  size: { default: "md" },
32
37
  rounded: { default: "md" },
33
38
  disabled: { type: Boolean, default: !1 },
39
+ draggable: { type: Boolean, default: !1 },
34
40
  minRows: { default: 0 },
35
41
  maxRows: {},
36
42
  addButtonText: { default: "Add Row" },
@@ -42,144 +48,160 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
42
48
  isUpdate: { type: Boolean, default: !1 }
43
49
  },
44
50
  emits: ["update:modelValue", "change"],
45
- setup(d, { emit: $ }) {
46
- const t = d, g = $, _ = c(() => t.labelI18n ? p(t.labelI18n) : t.label), T = c(() => {
47
- const e = p("vlite.customFields.emptyTitle");
51
+ setup(r, { emit: $ }) {
52
+ const t = r, R = $, k = c(() => t.labelI18n ? h(t.labelI18n) : t.label), D = c(() => {
53
+ const e = h("vlite.customFields.emptyTitle");
48
54
  return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
49
- }), z = c(() => {
50
- const e = p("vlite.customFields.emptyDescription");
55
+ }), U = c(() => {
56
+ const e = h("vlite.customFields.emptyDescription");
51
57
  return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
52
- }), l = G([]), R = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
53
- H(
58
+ }), l = q([]), _ = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
59
+ G(
54
60
  () => t.modelValue,
55
61
  (e) => {
56
- Array.isArray(e) ? l.value = e.map((s, r) => {
57
- const a = l.value[r];
62
+ Array.isArray(e) ? l.value = e.map((a, d) => {
63
+ const s = l.value[d];
58
64
  return {
59
- ...s,
60
- _id: a?._id || R()
65
+ ...a,
66
+ _id: s?._id || _()
61
67
  };
62
68
  }) : l.value = [];
63
69
  },
64
70
  { immediate: !0, deep: !0 }
65
71
  );
66
- const A = () => {
72
+ const j = () => {
67
73
  const e = {};
68
- for (const s of t.schema) {
69
- const r = typeof s.value == "function" ? s.value() : s.value;
70
- e[s.name] = r ?? null;
74
+ for (const a of t.schema) {
75
+ const d = typeof a.value == "function" ? a.value() : a.value;
76
+ e[a.name] = d ?? null;
71
77
  }
72
- return { ...e, _id: R() };
73
- }, D = () => {
78
+ return { ...e, _id: _() };
79
+ }, z = () => {
74
80
  if (t.disabled || t.maxRows && l.value.length >= t.maxRows) return;
75
- const e = [...l.value, A()];
76
- l.value = e, h(e);
77
- }, E = (e) => {
81
+ const e = [...l.value, j()];
82
+ l.value = e, f(e);
83
+ }, A = (e) => {
78
84
  if (t.disabled || l.value.length <= t.minRows) return;
79
- const s = [...l.value];
80
- s.splice(e, 1), l.value = s, h(s);
81
- }, U = (e, s, r) => {
82
85
  const a = [...l.value];
83
- a[e] = {
84
- ...a[e],
85
- [s]: r.value
86
- }, l.value = a, h(a);
87
- }, h = (e) => {
88
- const s = e.map(({ _id: r, ...a }) => a);
89
- g("update:modelValue", s), g("change", s);
90
- }, j = (e, s) => l.value[e]?.[s], S = c(() => !(t.disabled || t.maxRows && l.value.length >= t.maxRows)), w = c(() => t.disabled ? !1 : l.value.length > t.minRows), k = c(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? p(e.labelI18n) : e.label || e.name));
91
- return (e, s) => (o(), n("div", W, [
92
- b("div", X, [
93
- _.value ? (o(), q(Q, {
86
+ a.splice(e, 1), l.value = a, f(a);
87
+ }, E = (e, a, d) => {
88
+ const s = [...l.value];
89
+ s[e] = {
90
+ ...s[e],
91
+ [a]: d.value
92
+ }, l.value = s, f(s);
93
+ }, T = (e) => {
94
+ l.value = e, f(e);
95
+ }, f = (e) => {
96
+ const a = e.map(({ _id: d, ...s }) => s);
97
+ R("update:modelValue", a), R("change", a);
98
+ }, S = (e, a) => l.value[e]?.[a], I = c(() => !(t.disabled || t.maxRows && l.value.length >= t.maxRows)), w = c(() => t.disabled ? !1 : l.value.length > t.minRows), C = c(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? h(e.labelI18n) : e.label || e.name));
99
+ return (e, a) => (o(), n("div", Z, [
100
+ g("div", ee, [
101
+ k.value ? (o(), J(X, {
94
102
  key: 0,
95
103
  class: "text-sm font-medium text-foreground"
96
104
  }, {
97
- default: N(() => [
98
- J(m(_.value), 1)
105
+ default: B(() => [
106
+ K(m(k.value), 1)
99
107
  ]),
100
108
  _: 1
101
- })) : u("", !0),
102
- v(B, {
109
+ })) : i("", !0),
110
+ b(F, {
103
111
  type: "button",
104
112
  variant: "outline",
105
113
  size: "xs",
106
114
  rounded: "full",
107
115
  icon: "lucide:plus",
108
- disabled: !S.value,
109
- onClick: D
116
+ disabled: !I.value,
117
+ onClick: z
110
118
  }, null, 8, ["disabled"])
111
119
  ]),
112
- b("div", Y, [
113
- k.value.length > 0 ? (o(), n("div", Z, [
114
- d.showRowNumbers ? (o(), n("div", ee, " # ")) : u("", !0),
115
- (o(!0), n(x, null, y(k.value, (r, a) => (o(), n("div", {
116
- key: a,
117
- class: F(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": a > 0 }])
118
- }, m(r), 3))), 128)),
119
- w.value ? (o(), n("div", te)) : u("", !0)
120
- ])) : u("", !0),
121
- v(K, {
122
- name: "list",
123
- tag: "div",
120
+ g("div", te, [
121
+ C.value.length > 0 ? (o(), n("div", ae, [
122
+ r.draggable ? (o(), n("div", le)) : i("", !0),
123
+ r.showRowNumbers ? (o(), n("div", re, " # ")) : i("", !0),
124
+ (o(!0), n(y, null, p(C.value, (d, s) => (o(), n("div", {
125
+ key: s,
126
+ class: x(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": s > 0 }])
127
+ }, m(d), 3))), 128)),
128
+ w.value ? (o(), n("div", se)) : i("", !0)
129
+ ])) : i("", !0),
130
+ b(O(Q), {
131
+ "model-value": l.value,
132
+ "onUpdate:modelValue": T,
133
+ disabled: !r.draggable || r.disabled,
134
+ animation: 150,
135
+ handle: ".drag-handle",
136
+ "ghost-class": "opacity-50",
124
137
  class: "divide-y divide-border"
125
138
  }, {
126
- default: N(() => [
127
- (o(!0), n(x, null, y(l.value, (r, a, re, f) => {
128
- const C = [r, d.disabled, d.isUpdate, d.showRowNumbers, w.value];
129
- if (f && f.key === r._id && O(f, C)) return f;
130
- const V = (o(), n("div", {
131
- key: r._id,
139
+ default: B(() => [
140
+ (o(!0), n(y, null, p(l.value, (d, s, ce, v) => {
141
+ const V = [d, r.disabled, r.isUpdate, r.showRowNumbers, w.value, r.draggable, s];
142
+ if (v && v.key === d._id && P(v, V)) return v;
143
+ const N = (o(), n("div", {
144
+ key: d._id,
132
145
  class: "flex group bg-white transition-colors"
133
146
  }, [
134
- d.showRowNumbers ? (o(), n("div", se, m(a + 1), 1)) : u("", !0),
135
- (o(!0), n(x, null, y(d.schema, (i, I) => (o(), n("div", {
136
- key: i.name,
137
- class: F(["flex-1 min-w-0 relative", { "border-l border-border": I > 0 }])
147
+ r.draggable ? (o(), n("div", {
148
+ key: 0,
149
+ class: x(["w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors", r.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"])
150
+ }, [
151
+ b(Y, {
152
+ icon: "lucide:grip-vertical",
153
+ class: "w-4 h-4"
154
+ })
155
+ ], 2)) : i("", !0),
156
+ r.showRowNumbers ? (o(), n("div", oe, m(s + 1), 1)) : i("", !0),
157
+ (o(!0), n(y, null, p(r.schema, (u, L) => (o(), n("div", {
158
+ key: u.name,
159
+ class: x(["flex-1 min-w-0 relative", { "border-l border-border": L > 0 }])
138
160
  }, [
139
- v(P, {
161
+ b(W, {
140
162
  field: {
141
- ...i,
163
+ ...u,
142
164
  props: {
143
- ...i.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
144
- ...i.props || {}
165
+ ...u.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
166
+ ...u.props || {}
145
167
  },
146
168
  label: void 0
147
169
  },
148
- value: j(a, i.name),
149
- values: d.values || {},
170
+ value: S(s, u.name),
171
+ values: r.values || {},
150
172
  variant: "transparent",
151
173
  size: "sm",
152
174
  rounded: "none",
153
- disabled: d.disabled,
154
- isUpdate: d.isUpdate,
175
+ disabled: r.disabled,
176
+ isUpdate: r.isUpdate,
155
177
  class: "w-full h-full min-h-[40px]",
156
- onChange: (L) => U(a, i.name, L)
178
+ onChange: (M) => E(s, u.name, M)
157
179
  }, null, 8, ["field", "value", "values", "disabled", "isUpdate", "onChange"])
158
180
  ], 2))), 128)),
159
- w.value ? (o(), n("div", le, [
160
- v(B, {
181
+ w.value ? (o(), n("div", ne, [
182
+ b(F, {
161
183
  type: "button",
162
184
  variant: "ghost",
163
185
  size: "xs",
164
186
  icon: "lucide:trash-2",
165
- disabled: d.disabled,
166
- onClick: (i) => E(a)
187
+ disabled: r.disabled,
188
+ onClick: (u) => A(s)
167
189
  }, null, 8, ["disabled", "onClick"])
168
- ])) : u("", !0)
190
+ ])) : i("", !0)
169
191
  ]));
170
- return V.memo = C, V;
171
- }, s, 0), 128))
192
+ return N.memo = V, N;
193
+ }, a, 0), 128))
172
194
  ]),
173
195
  _: 1
174
- }),
175
- l.value.length === 0 ? (o(), n("div", ae, [
176
- b("p", oe, m(T.value), 1),
177
- b("p", ne, m(z.value), 1)
178
- ])) : u("", !0)
196
+ }, 8, ["model-value", "disabled"]),
197
+ l.value.length === 0 ? (o(), n("div", de, [
198
+ g("p", ie, m(D.value), 1),
199
+ g("p", ue, m(U.value), 1)
200
+ ])) : i("", !0)
179
201
  ])
180
202
  ]));
181
203
  }
182
204
  });
183
205
  export {
184
- fe as default
206
+ ye as default
185
207
  };
@@ -189,7 +189,8 @@ const pe = /* @__PURE__ */ I({
189
189
  size: e.size,
190
190
  rounded: e.rounded,
191
191
  maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0,
192
- loading: e.loading
192
+ loading: e.loading,
193
+ allowRename: e.field.props?.allowRename ?? !0
193
194
  } : a === "avatarUpload" ? {
194
195
  size: "2xl",
195
196
  ...l,
@@ -210,6 +211,7 @@ const pe = /* @__PURE__ */ I({
210
211
  modelValue: Array.isArray(e.value) ? e.value : [],
211
212
  schema: e.field.props?.schema || [],
212
213
  headers: e.field.props?.headers || [],
214
+ draggable: e.field.props?.draggable || !1,
213
215
  values: e.values,
214
216
  variant: e.variant,
215
217
  size: e.size,
@@ -64,6 +64,7 @@ export type IFormWhen = (context: IFormContext) => boolean;
64
64
  export interface IFormCustomFieldsProps {
65
65
  schema: IForm[];
66
66
  headers?: string[];
67
+ draggable?: boolean;
67
68
  }
68
69
  /**
69
70
  * Main form field interface
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as V, ref as D, computed as f, openBlock as l, createElementBlock as a, normalizeClass as s, createElementVNode as v, createBlock as u, createCommentVNode as T, toDisplayString as w, renderSlot as C, resolveDynamicComponent as B, Fragment as m, createVNode as S } from "vue";
2
2
  import x from "../Icon.vue.js";
3
3
  import b from "../Price/Price.vue.js";
4
- import h from "../Date/Date.vue.js";
4
+ import h from "../DateTime/DateTime.vue.js";
5
5
  import { $t as I } from "../../utils/i18n.js";
6
6
  import { getObjectValue as N, formatNumber as Y, getStatusColorClass as F } from "./utils.js";
7
7
  const A = { class: "flex items-center gap-2 min-w-0" }, E = { class: "text-xs font-normal text-muted-foreground leading-snug truncate" }, O = { class: "min-w-0" }, z = {
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
3
3
  import v from "./Modal.vue.js";
4
4
  import N from "./CommandPalette/CommandPaletteContent.vue.js";
5
5
  import { $t as R } from "../utils/i18n.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  const U = { class: "block truncate -text-fs-1.5" }, V = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, q = /* @__PURE__ */ x({
8
8
  __name: "NavbarCommandPalette",
9
9
  props: {
@@ -139,6 +139,7 @@ declare const __VLS_component: import('vue').DefineComponent<ScreenProps, {}, {}
139
139
  showRefresh: boolean;
140
140
  viewProps: Record<string, any>;
141
141
  hideSelectable: boolean;
142
+ hideDeleteBtn: boolean;
142
143
  quickFilters: import('./types').ScreenQuickFilter[];
143
144
  quickFilterKey: string;
144
145
  quickFilterVariant: import('../Tabes').TabesVariant;