vlite3 0.8.11 → 0.9.2

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 (84) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +6 -0
  2. package/components/AttachmentsList/AttachmentsList.vue.js +82 -0
  3. package/components/AttachmentsList/AttachmentsList.vue2.js +4 -0
  4. package/components/AttachmentsList/index.d.ts +2 -0
  5. package/components/AttachmentsList/types.d.ts +11 -0
  6. package/components/Button.vue.js +6 -6
  7. package/components/Chat/ChatBubble.vue.d.ts +18 -0
  8. package/components/Chat/ChatInterface.vue.d.ts +45 -0
  9. package/components/Chat/index.d.ts +2 -0
  10. package/components/DataList/DataList.vue.d.ts +1 -1
  11. package/components/DataTable/DataTable.vue.d.ts +3 -3
  12. package/components/DataTable/DataTable.vue.js +22 -22
  13. package/components/DataTable/types.d.ts +1 -1
  14. package/components/DatePicker.vue.d.ts +3 -2
  15. package/components/DatePicker.vue.js +1 -1
  16. package/components/Dropdown/Dropdown.vue.d.ts +2 -0
  17. package/components/Dropdown/Dropdown.vue.js +106 -90
  18. package/components/Dropdown/DropdownItem.vue.js +8 -8
  19. package/components/Dropdown/DropdownMenu.vue.js +2 -2
  20. package/components/Dropdown/DropdownMenu.vue2.js +1 -1
  21. package/components/ExportData/ExportData.vue.d.ts +1 -1
  22. package/components/FilePicker/FilePicker.vue.d.ts +4 -1
  23. package/components/FilePicker/FilePicker.vue.js +189 -139
  24. package/components/FilePreview/FilePreview.vue.d.ts +5 -0
  25. package/components/FilePreview/FilePreview.vue.js +27 -0
  26. package/components/FilePreview/FilePreview.vue2.js +4 -0
  27. package/components/FilePreview/index.d.ts +2 -0
  28. package/components/FilePreview/types.d.ts +5 -0
  29. package/components/Form/FormField.vue.js +3 -1
  30. package/components/Form/composables/useForm.js +50 -47
  31. package/components/Input.vue.d.ts +1 -0
  32. package/components/Input.vue.js +18 -15
  33. package/components/Modal.vue.js +2 -2
  34. package/components/Modal.vue2.js +31 -31
  35. package/components/MultiSelect/MultiSelect.vue.js +92 -84
  36. package/components/Navbar/Navbar.vue.js +61 -60
  37. package/components/Screen/Screen.vue.d.ts +200 -7
  38. package/components/Screen/Screen.vue.js +306 -502
  39. package/components/Screen/ScreenFilter.vue.js +45 -42
  40. package/components/Screen/components/ScreenAddAction.vue.d.ts +15 -0
  41. package/components/Screen/components/ScreenAddAction.vue.js +107 -0
  42. package/components/Screen/components/ScreenAddAction.vue2.js +4 -0
  43. package/components/Screen/components/ScreenEmptyState.vue.d.ts +14 -0
  44. package/components/Screen/components/ScreenEmptyState.vue.js +105 -0
  45. package/components/Screen/components/ScreenEmptyState.vue2.js +4 -0
  46. package/components/Screen/components/ScreenExportModal.vue.d.ts +49 -0
  47. package/components/Screen/components/ScreenExportModal.vue.js +83 -0
  48. package/components/Screen/components/ScreenExportModal.vue2.js +4 -0
  49. package/components/Screen/components/ScreenHeaderTitle.vue.d.ts +28 -0
  50. package/components/Screen/components/ScreenHeaderTitle.vue.js +57 -0
  51. package/components/Screen/components/ScreenHeaderTitle.vue2.js +4 -0
  52. package/components/Screen/components/ScreenOptionsDropdown.vue.d.ts +10 -0
  53. package/components/Screen/components/ScreenOptionsDropdown.vue.js +43 -0
  54. package/components/Screen/components/ScreenOptionsDropdown.vue2.js +4 -0
  55. package/components/Screen/components/ScreenQuickFilters.vue.d.ts +15 -0
  56. package/components/Screen/components/ScreenQuickFilters.vue.js +36 -0
  57. package/components/Screen/components/ScreenQuickFilters.vue2.js +4 -0
  58. package/components/Screen/components/ScreenViewToggle.vue.d.ts +9 -0
  59. package/components/Screen/components/ScreenViewToggle.vue.js +48 -0
  60. package/components/Screen/components/ScreenViewToggle.vue2.js +4 -0
  61. package/components/Screen/index.d.ts +1 -0
  62. package/components/Screen/types.d.ts +41 -2
  63. package/components/SidePanel.vue.js +1 -1
  64. package/components/SidePanel.vue2.js +7 -7
  65. package/components/SidebarMenu/SidebarMenu.vue.js +1 -1
  66. package/components/Stats/Stats.vue.js +50 -49
  67. package/components/StatusChip/StatusChip.vue.d.ts +2 -2
  68. package/components/StatusChip/StatusChip.vue.js +15 -14
  69. package/components/StatusChip/status-map.d.ts +2 -1
  70. package/components/StatusChip/status-map.js +16 -6
  71. package/components/Tabes/Tabes.vue.d.ts +1 -1
  72. package/components/Tabes/Tabes.vue.js +5 -143
  73. package/components/Tabes/Tabes.vue2.js +144 -2
  74. package/components/Timeline/TimelineIndicator.vue.js +6 -6
  75. package/components/Workbook/Sheet.vue.d.ts +1 -1
  76. package/core/config.d.ts +8 -0
  77. package/core/config.js +10 -6
  78. package/core/index.js +28 -20
  79. package/index.d.ts +2 -0
  80. package/index.js +209 -203
  81. package/package.json +3 -2
  82. package/style.css +80 -6
  83. package/types/config.type.d.ts +10 -0
  84. package/types/form.type.d.ts +1 -0
@@ -1,34 +1,34 @@
1
1
  import { ref as m, shallowRef as Q, computed as W, watch as X } from "vue";
2
- import { initializeFormValues as L, deepClone as b, cleanSubmitValues as Y, getNestedValue as M, evaluateConditional as x, setNestedValue as A, collectFileFields as Z, filterNullCustomFields as _ } from "../utils/form.utils.js";
2
+ import { initializeFormValues as M, deepClone as b, cleanSubmitValues as Y, getNestedValue as R, evaluateConditional as E, setNestedValue as A, collectFileFields as Z, filterNullCustomFields as _ } from "../utils/form.utils.js";
3
3
  import { useFileUpload as ee } from "./useFileUpload.js";
4
4
  import { $t as le } from "../../../utils/i18n.js";
5
5
  function ue(S) {
6
- const { schema: f, values: E, isUpdate: h = !1, folderId: C, onSubmit: I } = S, { handleUploadFile: N } = ee(), i = m(L(f, E)), d = m({}), j = m(!1), y = m(!1), w = m({}), z = Q(b(i.value)), V = W(() => f ? Array.isArray(f[0]) ? f.flat() : f : []);
6
+ const { schema: f, values: C, isUpdate: h = !1, folderId: $, onSubmit: I } = S, { handleUploadFile: N } = ee(), i = m(M(f, C)), d = m({}), w = m(!1), y = m(!1), j = m({}), z = Q(b(i.value)), V = W(() => f ? Array.isArray(f[0]) ? f.flat() : f : []);
7
7
  X(
8
- () => E,
8
+ () => C,
9
9
  (e) => {
10
- e && (i.value = L(f, e), z.value = b(i.value), y.value = !1);
10
+ e && (i.value = M(f, e), z.value = b(i.value), y.value = !1);
11
11
  },
12
12
  { deep: !0 }
13
13
  );
14
14
  const g = () => ({
15
15
  values: i.value,
16
16
  isUpdate: h
17
- }), O = (e) => M(i.value, e), R = (e) => d.value[e] || "", $ = (e, l) => {
17
+ }), O = (e) => R(i.value, e), G = (e) => d.value[e] || "", D = (e, l) => {
18
18
  l ? d.value[e] = l : delete d.value[e];
19
19
  }, U = () => {
20
20
  d.value = {};
21
- }, D = (e) => e.when ? x(e.when, g()) : !0, P = (e) => x(e.disabled, g()), G = (e) => x(e.readonly, g()), T = (e) => {
21
+ }, P = (e) => e.when ? E(e.when, g()) : !0, x = (e) => E(e.disabled, g()), k = (e) => E(e.readonly, g()), B = (e) => {
22
22
  const l = O(e.name);
23
23
  let t = "";
24
24
  const r = e.labelI18n ? le(e.labelI18n) : typeof e.label == "string" ? e.label : e.name;
25
25
  if (e.required && (l == null || l === "" || Array.isArray(l) && l.length === 0) && (t = `${r} is required`), !t && e.maxFileSize) {
26
- const n = e.maxFileSize * 1024 * 1024;
26
+ const o = e.maxFileSize * 1024 * 1024;
27
27
  if (l != null && l !== "") {
28
28
  const s = Array.isArray(l) ? l : [l];
29
- for (const o of s) {
30
- const a = o instanceof File ? o.size : o?.fileSize || o?.file?.size || o?.size;
31
- if (a !== void 0 && a > n) {
29
+ for (const n of s) {
30
+ const a = n instanceof File ? n.size : n?.fileSize || n?.file?.size || n?.size;
31
+ if (a !== void 0 && a > o) {
32
32
  t = `${r} size must be less than ${e.maxFileSize}MB`;
33
33
  break;
34
34
  }
@@ -36,54 +36,57 @@ function ue(S) {
36
36
  }
37
37
  }
38
38
  if (!t && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
39
- const n = e.maxFiles || e.props?.maxFiles;
40
- n && Array.isArray(l) && l.length > n && (t = `Maximum ${n} files allowed`);
39
+ const o = e.maxFiles || e.props?.maxFiles;
40
+ o && Array.isArray(l) && l.length > o && (t = `Maximum ${o} files allowed`);
41
41
  }
42
42
  return !t && e.validation && (t = e.validation({
43
43
  value: l,
44
44
  values: i.value,
45
45
  isUpdate: h
46
46
  })), t ? d.value[e.name] = t : delete d.value[e.name], t;
47
- }, k = () => {
47
+ }, T = () => {
48
48
  U();
49
49
  let e = !0;
50
50
  for (const l of V.value) {
51
- if (!D(l) || P(l)) continue;
52
- T(l) && (e = !1);
51
+ if (!P(l) || x(l)) continue;
52
+ B(l) && (e = !1);
53
53
  }
54
54
  return e;
55
55
  }, H = (e, l, t) => {
56
- i.value = A(i.value, e, l), y.value = !0, delete d.value[e];
57
- const r = V.value.find((n) => n.name === e);
58
- if (r?.updateValues) {
59
- const n = r.updateValues({
56
+ const r = V.value.find((o) => o.name === e);
57
+ if (r && (x(r) || k(r))) {
58
+ console.warn(`[vlite3/useForm] Blocked attempted update to disabled/readonly field: ${e}`);
59
+ return;
60
+ }
61
+ if (i.value = A(i.value, e, l), y.value = !0, delete d.value[e], r?.updateValues) {
62
+ const o = r.updateValues({
60
63
  values: i.value,
61
64
  data: t,
62
65
  isUpdate: h,
63
- updateError: $
66
+ updateError: D
64
67
  });
65
- n && typeof n == "object" && (i.value = { ...i.value, ...n });
68
+ o && typeof o == "object" && (i.value = { ...i.value, ...o });
66
69
  }
67
70
  }, J = async () => {
68
- const e = b(i.value), l = Z(f, e), t = (s, o) => {
71
+ const e = b(i.value), l = Z(f, e), t = (s, n) => {
69
72
  let a = null;
70
73
  s instanceof File ? a = s : s && typeof s == "object" && s.file instanceof File && (a = s.file);
71
74
  const F = {
72
75
  ...typeof s == "object" ? s : {},
73
- fileName: s?.fileName || a?.name || o.split("/").pop() || "unknown",
74
- fileUrl: o,
76
+ fileName: s?.fileName || a?.name || n.split("/").pop() || "unknown",
77
+ fileUrl: n,
75
78
  fileType: s?.fileType || a?.type || "application/octet-stream",
76
79
  fileSize: s?.fileSize || a?.size || 0
77
80
  };
78
81
  return delete F.file, delete F.base64, F;
79
82
  }, r = l.map(async (s) => {
80
- const { name: o, value: a, field: F } = s, q = F.returnFileObject === !0, B = Array.isArray(a) ? a.some((p) => p instanceof File || p && typeof p == "object" && p.file instanceof File) : a instanceof File || a && typeof a == "object" && a.file instanceof File;
81
- B && (w.value[o] = !0);
83
+ const { name: n, value: a, field: F } = s, q = F.returnFileObject === !0, L = Array.isArray(a) ? a.some((p) => p instanceof File || p && typeof p == "object" && p.file instanceof File) : a instanceof File || a && typeof a == "object" && a.file instanceof File;
84
+ L && (j.value[n] = !0);
82
85
  try {
83
86
  if (Array.isArray(a)) {
84
87
  const p = a.map(async (u) => {
85
88
  if (u instanceof File || u && typeof u == "object" && u.file instanceof File) {
86
- const v = await N(u, C);
89
+ const v = await N(u, $);
87
90
  return v ? q ? t(u, v) : v : null;
88
91
  }
89
92
  if (u && typeof u == "object") {
@@ -92,20 +95,20 @@ function ue(S) {
92
95
  }
93
96
  return u;
94
97
  }), c = await Promise.all(p);
95
- return { name: o, value: c };
98
+ return { name: n, value: c };
96
99
  } else {
97
100
  if (a instanceof File || a && typeof a == "object" && a.file instanceof File) {
98
- const c = await N(a, C);
101
+ const c = await N(a, $);
99
102
  if (c)
100
- return { name: o, value: q ? t(a, c) : c };
103
+ return { name: n, value: q ? t(a, c) : c };
101
104
  } else if (a && typeof a == "object") {
102
105
  const c = { ...a };
103
- return delete c.file, delete c.base64, { name: o, value: c };
106
+ return delete c.file, delete c.base64, { name: n, value: c };
104
107
  }
105
108
  return null;
106
109
  }
107
110
  } finally {
108
- B && (w.value[o] = !1);
111
+ L && (j.value[n] = !1);
109
112
  }
110
113
  });
111
114
  return (await Promise.all(r)).forEach((s) => {
@@ -115,10 +118,10 @@ function ue(S) {
115
118
  const l = { ...e };
116
119
  for (const t of V.value)
117
120
  if (t.type === "customFields" && t.props?.schema) {
118
- const r = M(l, t.name);
121
+ const r = R(l, t.name);
119
122
  if (Array.isArray(r)) {
120
- const n = _(r, t.props.schema);
121
- Object.assign(l, A(l, t.name, n));
123
+ const o = _(r, t.props.schema);
124
+ Object.assign(l, A(l, t.name, o));
122
125
  }
123
126
  }
124
127
  return l;
@@ -126,25 +129,25 @@ function ue(S) {
126
129
  return {
127
130
  formValues: i,
128
131
  errors: d,
129
- isSubmitting: j,
132
+ isSubmitting: w,
130
133
  isDirty: y,
131
- fieldLoading: w,
134
+ fieldLoading: j,
132
135
  handleFieldChange: H,
133
- validateField: T,
134
- validateAll: k,
135
- isFieldVisible: D,
136
- isFieldDisabled: P,
137
- isFieldReadonly: G,
136
+ validateField: B,
137
+ validateAll: T,
138
+ isFieldVisible: P,
139
+ isFieldDisabled: x,
140
+ isFieldReadonly: k,
138
141
  getFieldValue: O,
139
- getFieldError: R,
140
- setFieldError: $,
142
+ getFieldError: G,
143
+ setFieldError: D,
141
144
  clearErrors: U,
142
145
  resetForm: () => {
143
146
  i.value = b(z.value), U(), y.value = !1;
144
147
  },
145
148
  handleSubmit: async () => {
146
- if (k()) {
147
- j.value = !0;
149
+ if (T()) {
150
+ w.value = !0;
148
151
  try {
149
152
  let l = await J();
150
153
  l = K(l), l = Y(
@@ -159,7 +162,7 @@ function ue(S) {
159
162
  } catch (l) {
160
163
  throw console.error("[useForm] Submit error:", l), l;
161
164
  } finally {
162
- j.value = !1;
165
+ w.value = !1;
163
166
  }
164
167
  }
165
168
  },
@@ -26,6 +26,7 @@ declare const __VLS_component: import('vue').DefineComponent<InputProps, {}, {},
26
26
  "onClick:icon"?: (event: MouseEvent) => any;
27
27
  "onClick:icon-right"?: (event: MouseEvent) => any;
28
28
  }>, {
29
+ readonly: boolean;
29
30
  variant: InputVariant;
30
31
  size: InputSize;
31
32
  rounded: InputRounded;
@@ -3,7 +3,7 @@ import v from "./Icon.vue.js";
3
3
  import te from "./Label.vue.js";
4
4
  import le from "./Textarea.vue.js";
5
5
  import { $t as E } from "../utils/i18n.js";
6
- const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "max"], ae = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 z-20" }, fe = /* @__PURE__ */ Y({
6
+ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly", "min", "max"], ae = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 z-20" }, fe = /* @__PURE__ */ Y({
7
7
  __name: "Input",
8
8
  props: {
9
9
  modelValue: { default: "" },
@@ -13,6 +13,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
13
13
  placeholder: {},
14
14
  placeholderI18n: {},
15
15
  disabled: { type: Boolean, default: !1 },
16
+ readonly: { type: Boolean, default: !1 },
16
17
  loading: { type: Boolean, default: !1 },
17
18
  error: {},
18
19
  icon: {},
@@ -40,7 +41,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
40
41
  setup(t, { emit: D }) {
41
42
  const e = t, c = D, s = a(() => e.labelI18n ? E(e.labelI18n) : e.label), I = a(
42
43
  () => e.placeholderI18n ? E(e.placeholderI18n) : e.placeholder
43
- ), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type), C = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => h.value || C.value || y.value), p = a(() => !!e.addonLeft || !!g["addon-left"]), B = a(() => !!e.addonRight || !!g["addon-right"]), U = a(() => [
44
+ ), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type), C = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => p.value || C.value || y.value), h = a(() => !!e.addonLeft || !!g["addon-left"]), B = a(() => !!e.addonRight || !!g["addon-right"]), U = a(() => [
44
45
  "relative w-full",
45
46
  e.class,
46
47
  e.labelPosition === "left" ? "flex items-center gap-4" : "",
@@ -68,7 +69,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
68
69
  "2xl": "rounded-2xl",
69
70
  full: "rounded-full"
70
71
  }[e.rounded];
71
- p.value && (e.rounded === "md" ? o = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? o = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? o = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? o = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))), B.value && (p.value ? o = "rounded-none" : e.rounded === "md" ? o = "rounded-l-md rounded-r-none" : e.rounded === "sm" ? o = "rounded-l-sm rounded-r-none" : e.rounded === "lg" ? o = "rounded-l-lg rounded-r-none" : e.rounded === "full" ? o = "rounded-l-full rounded-r-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-l-").replace("rounded-r-", ""))), e.variant === "outline-b" && (o = "rounded-none");
72
+ h.value && (e.rounded === "md" ? o = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? o = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? o = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? o = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))), B.value && (h.value ? o = "rounded-none" : e.rounded === "md" ? o = "rounded-l-md rounded-r-none" : e.rounded === "sm" ? o = "rounded-l-sm rounded-r-none" : e.rounded === "lg" ? o = "rounded-l-lg rounded-r-none" : e.rounded === "full" ? o = "rounded-l-full rounded-r-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-l-").replace("rounded-r-", ""))), e.variant === "outline-b" && (o = "rounded-none");
72
73
  const M = e.variant === "outline-b" || e.variant === "transparent";
73
74
  return e.variant, [
74
75
  l,
@@ -76,7 +77,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
76
77
  e.type === "textarea" ? "" : f[e.size],
77
78
  o,
78
79
  e.error ? "border-destructive focus-visible:ring-destructive" : "",
79
- e.icon ? "pl-9" : M && !p.value ? "pl-0" : "",
80
+ e.icon ? "pl-9" : M && !h.value ? "pl-0" : "",
80
81
  e.showClearButton && C.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : M && !B.value ? "pr-0" : "",
81
82
  // Keyframe name used to detect browser autofill via animationstart event
82
83
  e.variant === "floating" ? "autofill-detect" : "",
@@ -136,15 +137,15 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
136
137
  const n = l.target;
137
138
  c("change", n.value);
138
139
  }, O = () => {
139
- x.value = !x.value;
140
+ e.disabled || e.readonly || (x.value = !x.value);
140
141
  }, Q = () => {
141
- c("update:modelValue", ""), z(() => {
142
+ e.disabled || e.readonly || (c("update:modelValue", ""), z(() => {
142
143
  m.value?.focus();
143
- });
144
- }, h = b(!1), j = b(!1), F = (l) => {
145
- h.value = !0, c("focus", l);
144
+ }));
145
+ }, p = b(!1), j = b(!1), F = (l) => {
146
+ p.value = !0, c("focus", l);
146
147
  }, N = (l) => {
147
- h.value = !1, c("blur", l);
148
+ p.value = !1, c("blur", l);
148
149
  }, X = (l) => {
149
150
  l.animationName === "onAutoFillStart" ? y.value = !0 : l.animationName === "onAutoFillCancel" && (y.value = !1);
150
151
  };
@@ -170,7 +171,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
170
171
  A("div", {
171
172
  class: r(W.value)
172
173
  }, [
173
- p.value ? (d(), u("div", {
174
+ h.value ? (d(), u("div", {
174
175
  key: 0,
175
176
  class: r(q.value)
176
177
  }, [
@@ -196,12 +197,13 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
196
197
  "model-value": String(t.modelValue),
197
198
  placeholder: t.variant === "floating" && s.value && !V.value ? "" : I.value,
198
199
  disabled: t.disabled,
200
+ readonly: t.readonly,
199
201
  rows: t.rows,
200
202
  class: r(S.value),
201
203
  "onUpdate:modelValue": n[0] || (n[0] = (f) => c("update:modelValue", f)),
202
204
  onBlur: N,
203
205
  onFocus: F
204
- }, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (d(), u("input", {
206
+ }, null, 8, ["model-value", "placeholder", "disabled", "readonly", "rows", "class"])) : (d(), u("input", {
205
207
  key: 2,
206
208
  ref_key: "inputRef",
207
209
  ref: m,
@@ -209,6 +211,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
209
211
  value: t.modelValue,
210
212
  placeholder: t.variant === "floating" && s.value && !V.value ? "" : I.value,
211
213
  disabled: t.disabled,
214
+ readonly: t.readonly,
212
215
  min: t.min,
213
216
  max: t.max,
214
217
  class: r(S.value),
@@ -243,14 +246,14 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
243
246
  "flex items-center justify-center text-muted-foreground",
244
247
  t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
245
248
  ]),
246
- onClick: n[1] || (n[1] = (f) => !t.disabled && c("click:icon-right", f))
249
+ onClick: n[1] || (n[1] = (f) => !t.disabled && !t.readonly && c("click:icon-right", f))
247
250
  }, [
248
251
  k(v, {
249
252
  icon: t.iconRight,
250
253
  class: r(["h-4 w-4", t.iconRightClass])
251
254
  }, null, 8, ["icon", "class"])
252
255
  ], 2)) : i("", !0),
253
- t.type === "password" && !t.disabled ? (d(), u("button", {
256
+ t.type === "password" && !t.disabled && !t.readonly ? (d(), u("button", {
254
257
  key: 2,
255
258
  type: "button",
256
259
  tabindex: "-1",
@@ -262,7 +265,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
262
265
  class: "h-4 w-4"
263
266
  }, null, 8, ["icon"])
264
267
  ])) : i("", !0),
265
- t.showClearButton && C.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (h.value || j.value) ? (d(), u("button", {
268
+ t.showClearButton && C.value && !t.disabled && !t.readonly && !t.loading && t.type !== "textarea" && t.type !== "password" && (p.value || j.value) ? (d(), u("button", {
266
269
  key: 3,
267
270
  type: "button",
268
271
  tabindex: "-1",
@@ -1,7 +1,7 @@
1
1
  import o from "./Modal.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0f3159c0"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7c958115"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as P, ref as c, inject as R, computed as h, markRaw as V, watch as T, provide as W, nextTick as K, onMounted as A, onUnmounted as U, openBlock as s, createElementBlock as a, Fragment as q, mergeProps as B, withModifiers as I, renderSlot as m, createCommentVNode as r, createBlock as S, Teleport as G, normalizeClass as d, createElementVNode as v, toDisplayString as F, createVNode as H, resolveDynamicComponent as J } from "vue";
1
+ import { defineComponent as P, ref as c, inject as R, computed as h, markRaw as V, watch as T, provide as W, nextTick as K, onMounted as A, onUnmounted as U, openBlock as s, createElementBlock as r, Fragment as q, mergeProps as B, withModifiers as I, renderSlot as m, createCommentVNode as a, createBlock as S, Teleport as G, normalizeClass as i, createElementVNode as b, toDisplayString as F, createVNode as H, resolveDynamicComponent as J } from "vue";
2
2
  import L from "./Button.vue.js";
3
3
  import { useKeyStroke as Q } from "../composables/useKeyStroke.js";
4
4
  import { $t as O } from "../utils/i18n.js";
@@ -29,13 +29,13 @@ const X = {
29
29
  },
30
30
  emits: ["close", "update:show", "onOpen"],
31
31
  setup(t, { emit: j }) {
32
- const o = t, i = j, l = c(o.show), g = c(!1), y = c(!1), k = c(null);
32
+ const o = t, d = j, l = c(o.show), g = c(!1), v = c(!1), k = c(null);
33
33
  let u = null;
34
- const b = c(!1), n = R("dropdown-context", null), C = h(() => o.body ? V(o.body) : void 0);
34
+ const y = c(!1), n = R("dropdown-context", null), C = h(() => o.body ? V(o.body) : void 0);
35
35
  T(
36
36
  () => o.show,
37
37
  (e) => {
38
- l.value = e, e && (i("onOpen"), n?.close());
38
+ l.value = e, e && (d("onOpen"), n?.close());
39
39
  }
40
40
  );
41
41
  const z = () => {
@@ -43,24 +43,24 @@ const X = {
43
43
  }, D = (e) => {
44
44
  g.value = e;
45
45
  }, E = (e) => {
46
- b.value = e;
46
+ y.value = e;
47
47
  }, f = () => {
48
48
  if (g.value) {
49
- y.value = !0, u && clearTimeout(u), u = setTimeout(() => {
50
- y.value = !1;
49
+ v.value = !0, u && clearTimeout(u), u = setTimeout(() => {
50
+ v.value = !1;
51
51
  }, 1e3);
52
52
  return;
53
53
  }
54
- l.value = !1, i("update:show", !1), i("close");
54
+ l.value = !1, d("update:show", !1), d("close");
55
55
  }, p = () => {
56
- l.value = !1, i("update:show", !1), i("close");
56
+ l.value = !1, d("update:show", !1), d("close");
57
57
  };
58
58
  W("modal-context", { close: f, setSubmitting: D, registerFormFooter: E });
59
59
  const M = () => {
60
60
  o.closeOutside && f();
61
61
  }, { onKeyStroke: N } = Q();
62
62
  N("Escape", f), T(l, async (e) => {
63
- e ? (n?.onChildToggle?.(!0), document.body.style.overflow = "hidden", await K(), k.value?.focus()) : (document.body.style.overflow = "", n?.onChildToggle?.(!1), b.value = !1);
63
+ e ? (n?.onChildToggle?.(!0), document.body.style.overflow = "hidden", await K(), k.value?.focus()) : (document.body.style.overflow = "", n?.onChildToggle?.(!1), y.value = !1);
64
64
  }), A(() => {
65
65
  l.value && n?.onChildToggle?.(!0);
66
66
  }), U(() => {
@@ -69,62 +69,62 @@ const X = {
69
69
  const x = h(() => o.titleI18n ? O(o.titleI18n) : o.title), w = h(
70
70
  () => o.descriptionI18n ? O(o.descriptionI18n) : o.description
71
71
  );
72
- return (e, $) => (s(), a(q, null, [
73
- e.$slots?.trigger || e.$slots?.default ? (s(), a("span", B({
72
+ return (e, $) => (s(), r(q, null, [
73
+ e.$slots?.trigger || e.$slots?.default ? (s(), r("span", B({
74
74
  key: 0,
75
75
  onClick: I(z, ["stop"]),
76
76
  class: `${t.triggerClass}`
77
77
  }, e.$attrs), [
78
78
  m(e.$slots, "trigger", {}, () => [
79
- t.body ? m(e.$slots, "default", { key: 0 }, void 0, !0) : r("", !0)
79
+ t.body ? m(e.$slots, "default", { key: 0 }, void 0, !0) : a("", !0)
80
80
  ], !0)
81
- ], 16)) : r("", !0),
81
+ ], 16)) : a("", !0),
82
82
  (s(), S(G, { to: "body" }, [
83
- l.value ? (s(), a("div", {
83
+ l.value ? (s(), r("div", {
84
84
  key: 0,
85
- class: d(["fixed inset-0 z-50 flex items-center justify-center p-4 v-modal-overlay", t.backdrop ? "v-modal-backdrop" : ""]),
85
+ class: i(["fixed inset-0 z-50 flex items-center justify-center p-4 v-modal-overlay", t.backdrop ? "v-modal-backdrop" : ""]),
86
86
  onClick: M
87
87
  }, [
88
- v("div", {
88
+ b("div", {
89
89
  ref_key: "modalRef",
90
90
  ref: k,
91
91
  tabindex: "-1",
92
- class: d(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh] focus:outline-none", [t.maxWidth]]),
92
+ class: i(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh] focus:outline-none", [t.maxWidth]]),
93
93
  onClick: $[0] || ($[0] = I(() => {
94
94
  }, ["stop"]))
95
95
  }, [
96
- x.value ? (s(), a("div", X, [
97
- v("div", {
98
- class: d(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
96
+ x.value ? (s(), r("div", X, [
97
+ b("div", {
98
+ class: i(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
99
99
  }, [
100
- v("h3", Y, F(x.value), 1),
100
+ b("h3", Y, F(x.value), 1),
101
101
  H(L, {
102
102
  rounded: "full",
103
103
  size: "sm",
104
104
  icon: "lucide:x",
105
105
  variant: "ghost",
106
- class: d(["hover:bg-gray-250/25!", { "blink-bg": y.value }]),
106
+ class: i(["hover:bg-gray-250/25!", { "blink-bg": v.value }]),
107
107
  onClick: f
108
108
  }, null, 8, ["class"])
109
109
  ], 2)
110
- ])) : r("", !0),
111
- v("div", {
112
- class: d(["flex-1 overflow-y-auto px-4 pt-4 min-h-0", [b.value ? "pb-0" : "pb-3.5", t.bodyClass]])
110
+ ])) : a("", !0),
111
+ b("div", {
112
+ class: i(["flex-1 overflow-y-auto px-4 pt-4 min-h-0 scrollbar-thin scrollbar-stable", [y.value ? "pb-0" : "pb-3.5", t.bodyClass]])
113
113
  }, [
114
- w.value ? (s(), a("p", Z, F(w.value), 1)) : r("", !0),
114
+ w.value ? (s(), r("p", Z, F(w.value), 1)) : a("", !0),
115
115
  C.value ? (s(), S(J(C.value), B({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: p }), null, 16)) : m(e.$slots, "default", {
116
116
  key: 2,
117
117
  close: p
118
118
  }, void 0, !0)
119
119
  ], 2),
120
- e.$slots.footer ? (s(), a("div", {
120
+ e.$slots.footer ? (s(), r("div", {
121
121
  key: 1,
122
- class: d([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
122
+ class: i([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
123
123
  }, [
124
124
  m(e.$slots, "footer", { close: p }, void 0, !0)
125
- ], 2)) : r("", !0)
125
+ ], 2)) : a("", !0)
126
126
  ], 2)
127
- ], 2)) : r("", !0)
127
+ ], 2)) : a("", !0)
128
128
  ]))
129
129
  ], 64));
130
130
  }