vlite3 0.6.1 → 0.6.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.
@@ -1,26 +1,26 @@
1
- import { defineComponent as se, inject as le, computed as n, ref as oe, watch as $, onUnmounted as ne, openBlock as o, createElementBlock as u, withModifiers as re, normalizeClass as g, createVNode as V, unref as a, createCommentVNode as d, Fragment as ue, renderList as de, createElementVNode as p, toDisplayString as N, renderSlot as ce, createBlock as S, mergeProps as j } from "vue";
2
- import { useForm as me } from "./composables/useForm.js";
1
+ import { defineComponent as le, inject as oe, computed as n, ref as ne, watch as $, onUnmounted as re, openBlock as o, createElementBlock as d, withModifiers as ue, normalizeClass as g, createVNode as N, unref as s, createCommentVNode as c, Fragment as de, renderList as ce, createElementVNode as p, toDisplayString as U, renderSlot as me, createBlock as S, mergeProps as j } from "vue";
2
+ import { useForm as ve } from "./composables/useForm.js";
3
3
  import H from "./FormFields.vue.js";
4
4
  import C from "../Button.vue.js";
5
- import ve from "../Timeline/Timeline.vue.js";
5
+ import fe from "../Timeline/Timeline.vue.js";
6
6
  import "@iconify/vue";
7
- import { useVLiteConfig as fe } from "../../core/config.js";
8
- const ge = {
7
+ import { useVLiteConfig as ge } from "../../core/config.js";
8
+ const he = {
9
9
  key: 1,
10
10
  class: "form-fields-single"
11
- }, he = {
11
+ }, be = {
12
12
  key: 2,
13
13
  class: "form-groups space-y-6"
14
- }, be = { class: "text-base font-semibold text-foreground" }, ye = {
14
+ }, ye = { class: "text-base font-semibold text-foreground" }, pe = {
15
15
  key: 0,
16
16
  class: "text-sm text-muted-foreground mt-1"
17
- }, pe = { class: "form-group-body p-6" }, Se = {
17
+ }, Se = { class: "form-group-body p-4.5" }, Ce = {
18
18
  key: 3,
19
19
  class: "form-step"
20
- }, Ce = { class: "text-lg font-semibold text-foreground" }, ke = {
20
+ }, ke = { class: "text-lg font-semibold text-foreground" }, xe = {
21
21
  key: 0,
22
22
  class: "text-sm text-muted-foreground mt-1"
23
- }, Fe = { class: "flex items-center gap-3" }, xe = { class: "flex items-center gap-3 ml-auto" }, qe = /* @__PURE__ */ se({
23
+ }, Fe = { class: "flex items-center gap-3" }, Ae = { class: "flex items-center gap-3 ml-auto" }, Te = /* @__PURE__ */ le({
24
24
  __name: "Form",
25
25
  props: {
26
26
  schema: {},
@@ -50,19 +50,19 @@ const ge = {
50
50
  },
51
51
  emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction"],
52
52
  setup(e, { emit: I }) {
53
- const t = e, m = I, v = le(
53
+ const i = e, m = I, v = oe(
54
54
  "modal-context",
55
55
  null
56
- ), J = fe(), k = n(() => J?.components?.form || {}), U = n(() => t.variant ?? k.value.variant ?? "outline"), z = n(() => t.size ?? k.value.size ?? "md"), P = n(() => t.rounded ?? k.value.rounded ?? "md"), D = n(
57
- () => t.showRequiredAsterisk ?? k.value.showRequiredAsterisk ?? !0
58
- ), K = n(() => t.showCancel || !!v), O = n(() => !!v), F = n(() => !t.schema || t.schema.length === 0 ? !1 : Array.isArray(t.schema[0])), r = n(() => t.tabs && t.tabs.length > 0 && F.value), s = oe(0), M = n(() => t.tabs ? t.tabs.map((l, i) => ({
59
- id: l.id?.toString() || i.toString(),
60
- title: l.title,
61
- icon: l.icon,
62
- description: l.description,
63
- status: i < s.value ? "completed" : i === s.value ? "current" : "upcoming"
64
- })) : []), h = n(() => F.value ? t.schema : [t.schema]), E = n(() => r.value ? h.value[s.value] || [] : []), {
65
- formValues: x,
56
+ ), K = ge(), k = n(() => K?.components?.form || {}), z = n(() => i.variant ?? k.value.variant ?? "outline"), D = n(() => i.size ?? k.value.size ?? "md"), P = n(() => i.rounded ?? k.value.rounded ?? "md"), q = n(
57
+ () => i.showRequiredAsterisk ?? k.value.showRequiredAsterisk ?? !0
58
+ ), J = n(() => i.showCancel || !!v), O = n(() => !!v), x = n(() => !i.schema || i.schema.length === 0 ? !1 : Array.isArray(i.schema[0])), u = n(() => i.tabs && i.tabs.length > 0 && x.value), l = ne(0), M = n(() => i.tabs ? i.tabs.map((a, t) => ({
59
+ id: a.id?.toString() || t.toString(),
60
+ title: a.title,
61
+ icon: a.icon,
62
+ description: a.description,
63
+ status: t < l.value ? "completed" : t === l.value ? "current" : "upcoming"
64
+ })) : []), h = n(() => x.value ? i.schema : [i.schema]), E = n(() => u.value ? h.value[l.value] || [] : []), {
65
+ formValues: F,
66
66
  errors: b,
67
67
  isSubmitting: y,
68
68
  handleFieldChange: Q,
@@ -70,63 +70,63 @@ const ge = {
70
70
  validateAll: X,
71
71
  isFieldVisible: A,
72
72
  isFieldDisabled: w,
73
- isFieldReadonly: q,
74
- getFieldValue: Ae,
73
+ isFieldReadonly: T,
74
+ getFieldValue: we,
75
75
  handleSubmit: Y,
76
- flatSchema: we
77
- } = me({
78
- schema: t.schema,
79
- values: t.values,
80
- isUpdate: t.isUpdate,
81
- folderId: t.folderId,
82
- emitFields: t.emitFields,
83
- onSubmit: (l) => {
84
- m("onSubmit", l, v?.close || (() => {
76
+ flatSchema: Re
77
+ } = ve({
78
+ schema: i.schema,
79
+ values: i.values,
80
+ isUpdate: i.isUpdate,
81
+ folderId: i.folderId,
82
+ emitFields: i.emitFields,
83
+ onSubmit: (a) => {
84
+ m("onSubmit", a, v?.close || (() => {
85
85
  }));
86
86
  }
87
87
  });
88
88
  $(
89
- () => t.loading || y.value,
90
- (l) => {
91
- v?.setSubmitting && v.setSubmitting(l);
89
+ () => i.loading || y.value,
90
+ (a) => {
91
+ v?.setSubmitting && v.setSubmitting(a);
92
92
  },
93
93
  { immediate: !0 }
94
- ), ne(() => {
94
+ ), re(() => {
95
95
  v?.setSubmitting && v.setSubmitting(!1);
96
96
  }), $(
97
- () => t.values,
98
- (l) => {
97
+ () => i.values,
98
+ (a) => {
99
99
  },
100
100
  { deep: !0 }
101
101
  );
102
- const T = (l, i) => {
103
- Q(l, i.value, i.data);
102
+ const B = (a, t) => {
103
+ Q(a, t.value, t.data);
104
104
  }, Z = () => {
105
- if (!r.value) return !0;
106
- const l = E.value;
107
- let i = !0;
108
- for (const c of l) {
109
- if (!A(c) || w(c)) continue;
110
- W(c) && (i = !1);
105
+ if (!u.value) return !0;
106
+ const a = E.value;
107
+ let t = !0;
108
+ for (const r of a) {
109
+ if (!A(r) || w(r)) continue;
110
+ W(r) && (t = !1);
111
111
  }
112
- return i;
113
- }, _ = n(() => r.value ? s.value < h.value.length - 1 : !1), G = n(() => r.value ? s.value > 0 : !1), R = n(() => r.value ? s.value === h.value.length - 1 : !0), L = () => {
114
- _.value && Z() && (s.value++, m("onStepChange", s.value));
112
+ return t;
113
+ }, _ = n(() => u.value ? l.value < h.value.length - 1 : !1), L = n(() => u.value ? l.value > 0 : !1), R = n(() => u.value ? l.value === h.value.length - 1 : !0), G = () => {
114
+ _.value && Z() && (l.value++, m("onStepChange", l.value));
115
115
  }, ee = () => {
116
- G.value && (s.value--, m("onStepChange", s.value));
117
- }, te = (l, i) => {
118
- i <= s.value && (s.value = i, m("onStepChange", s.value));
119
- }, B = async () => {
120
- if (r.value) {
121
- if (!R.value && !t.isUpdate) {
122
- L();
116
+ L.value && (l.value--, m("onStepChange", l.value));
117
+ }, te = (a, t) => {
118
+ t <= l.value && (l.value = t, m("onStepChange", l.value));
119
+ }, V = async () => {
120
+ if (u.value) {
121
+ if (!R.value && !i.isUpdate) {
122
+ G();
123
123
  return;
124
124
  }
125
125
  if (!X()) {
126
- const i = h.value.findIndex(
127
- (c) => c.some((f) => !!b.value[f.name])
126
+ const t = h.value.findIndex(
127
+ (r) => r.some((f) => !!b.value[f.name])
128
128
  );
129
- i !== -1 && i !== s.value && (s.value = i, m("onStepChange", s.value));
129
+ t !== -1 && t !== l.value && (l.value = t, m("onStepChange", l.value));
130
130
  return;
131
131
  }
132
132
  }
@@ -134,106 +134,111 @@ const ge = {
134
134
  await Y();
135
135
  } catch {
136
136
  }
137
- }, ie = () => {
137
+ }, ie = (a) => {
138
+ if (a.key !== "Enter") return;
139
+ const r = a.target.tagName.toLowerCase();
140
+ r !== "textarea" && r !== "button" && (a.preventDefault(), V());
141
+ }, ae = () => {
138
142
  m("onCancel"), v && v?.close?.();
139
143
  };
140
- return (l, i) => (o(), u("form", {
141
- class: g(["form-container", t.class]),
142
- onSubmit: re(B, ["prevent"])
144
+ return (a, t) => (o(), d("form", {
145
+ class: g(["form-container", i.class]),
146
+ onSubmit: ue(V, ["prevent"]),
147
+ onKeydown: ie
143
148
  }, [
144
- r.value && M.value.length > 0 ? (o(), u("div", {
149
+ u.value && M.value.length > 0 ? (o(), d("div", {
145
150
  key: 0,
146
151
  class: g(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
147
152
  }, [
148
- V(a(ve), {
153
+ N(s(fe), {
149
154
  steps: M.value,
150
- activeStep: s.value,
155
+ activeStep: l.value,
151
156
  direction: "horizontal",
152
157
  textPosition: e.timelineTextPosition,
153
158
  clickable: !0,
154
159
  onStepClick: te
155
160
  }, null, 8, ["steps", "activeStep", "textPosition"])
156
- ], 2)) : d("", !0),
157
- F.value ? F.value && !r.value ? (o(), u("div", he, [
158
- (o(!0), u(ue, null, de(h.value, (c, f) => (o(), u("div", {
161
+ ], 2)) : c("", !0),
162
+ x.value ? x.value && !u.value ? (o(), d("div", be, [
163
+ (o(!0), d(de, null, ce(h.value, (r, f) => (o(), d("div", {
159
164
  key: f,
160
- class: g(["form-group border rounded-lg overflow-hidden", e.groupClass])
165
+ class: g(["form-group border rounded overflow-hidden", e.groupClass])
161
166
  }, [
162
- e.groupsHeadings?.[f] ? (o(), u("div", {
167
+ e.groupsHeadings?.[f] ? (o(), d("div", {
163
168
  key: 0,
164
- class: g(["form-group-header bg-muted/50 px-6 py-4 border-b", e.headerClass])
169
+ class: g(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
165
170
  }, [
166
- p("h3", be, N(e.groupsHeadings[f]), 1),
167
- e.groupHeadingsDescription?.[f] ? (o(), u("p", ye, N(e.groupHeadingsDescription[f]), 1)) : d("", !0)
168
- ], 2)) : d("", !0),
169
- p("div", pe, [
170
- V(H, {
171
- schema: c,
172
- values: a(x),
173
- errors: a(b),
174
- variant: U.value,
175
- size: z.value,
171
+ p("h3", ye, U(e.groupsHeadings[f]), 1),
172
+ e.groupHeadingsDescription?.[f] ? (o(), d("p", pe, U(e.groupHeadingsDescription[f]), 1)) : c("", !0)
173
+ ], 2)) : c("", !0),
174
+ p("div", Se, [
175
+ N(H, {
176
+ schema: r,
177
+ values: s(F),
178
+ errors: s(b),
179
+ variant: z.value,
180
+ size: D.value,
176
181
  rounded: P.value,
177
182
  className: e.className,
178
183
  isUpdate: e.isUpdate,
179
- showRequiredAsterisk: D.value,
180
- isFieldVisible: a(A),
181
- isFieldDisabled: a(w),
182
- isFieldReadonly: a(q),
183
- onChange: T,
184
- onAddonAction: i[1] || (i[1] = (ae) => m("onAddonAction", ae))
184
+ showRequiredAsterisk: q.value,
185
+ isFieldVisible: s(A),
186
+ isFieldDisabled: s(w),
187
+ isFieldReadonly: s(T),
188
+ onChange: B,
189
+ onAddonAction: t[1] || (t[1] = (se) => m("onAddonAction", se))
185
190
  }, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
186
191
  ])
187
192
  ], 2))), 128))
188
- ])) : r.value ? (o(), u("div", Se, [
189
- e.tabs?.[s.value] ? (o(), u("div", {
193
+ ])) : u.value ? (o(), d("div", Ce, [
194
+ e.tabs?.[l.value] ? (o(), d("div", {
190
195
  key: 0,
191
196
  class: g(["form-step-header mb-6", e.headerClass])
192
197
  }, [
193
- p("h2", Ce, N(e.tabs[s.value].title), 1),
194
- e.tabs[s.value].description ? (o(), u("p", ke, N(e.tabs[s.value].description), 1)) : d("", !0)
195
- ], 2)) : d("", !0),
196
- V(H, {
198
+ p("h2", ke, U(e.tabs[l.value].title), 1),
199
+ e.tabs[l.value].description ? (o(), d("p", xe, U(e.tabs[l.value].description), 1)) : c("", !0)
200
+ ], 2)) : c("", !0),
201
+ N(H, {
197
202
  schema: E.value,
198
- values: a(x),
199
- errors: a(b),
200
- variant: U.value,
201
- size: z.value,
203
+ values: s(F),
204
+ errors: s(b),
205
+ variant: z.value,
206
+ size: D.value,
202
207
  rounded: P.value,
203
208
  className: e.className,
204
209
  isUpdate: e.isUpdate,
205
- showRequiredAsterisk: D.value,
206
- isFieldVisible: a(A),
207
- isFieldDisabled: a(w),
208
- isFieldReadonly: a(q),
209
- onChange: T,
210
- onAddonAction: i[2] || (i[2] = (c) => m("onAddonAction", c))
210
+ showRequiredAsterisk: q.value,
211
+ isFieldVisible: s(A),
212
+ isFieldDisabled: s(w),
213
+ isFieldReadonly: s(T),
214
+ onChange: B,
215
+ onAddonAction: t[2] || (t[2] = (r) => m("onAddonAction", r))
211
216
  }, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
212
- ])) : d("", !0) : (o(), u("div", ge, [
213
- V(H, {
217
+ ])) : c("", !0) : (o(), d("div", he, [
218
+ N(H, {
214
219
  schema: e.schema,
215
- values: a(x),
216
- errors: a(b),
217
- variant: U.value,
218
- size: z.value,
220
+ values: s(F),
221
+ errors: s(b),
222
+ variant: z.value,
223
+ size: D.value,
219
224
  rounded: P.value,
220
225
  className: e.className,
221
226
  isUpdate: e.isUpdate,
222
- showRequiredAsterisk: D.value,
223
- isFieldVisible: a(A),
224
- isFieldDisabled: a(w),
225
- isFieldReadonly: a(q),
226
- onChange: T,
227
- onAddonAction: i[0] || (i[0] = (c) => m("onAddonAction", c))
227
+ showRequiredAsterisk: q.value,
228
+ isFieldVisible: s(A),
229
+ isFieldDisabled: s(w),
230
+ isFieldReadonly: s(T),
231
+ onChange: B,
232
+ onAddonAction: t[0] || (t[0] = (r) => m("onAddonAction", r))
228
233
  }, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
229
234
  ])),
230
- ce(l.$slots, "default", {
231
- values: a(x),
232
- errors: a(b),
233
- isSubmitting: a(y),
234
- handleSubmit: B
235
+ me(a.$slots, "default", {
236
+ values: s(F),
237
+ errors: s(b),
238
+ isSubmitting: s(y),
239
+ handleSubmit: V
235
240
  }, void 0, !0),
236
- e.footer ? (o(), u("div", {
241
+ e.footer ? (o(), d("div", {
237
242
  key: 4,
238
243
  class: g([
239
244
  "form-footer flex items-center justify-between gap-3",
@@ -242,54 +247,54 @@ const ge = {
242
247
  ])
243
248
  }, [
244
249
  p("div", Fe, [
245
- K.value ? (o(), S(C, {
250
+ J.value ? (o(), S(C, {
246
251
  key: 0,
247
252
  type: "button",
248
253
  variant: "outline",
249
254
  text: e.cancelText,
250
- disabled: e.loading || a(y),
251
- onClick: ie
252
- }, null, 8, ["text", "disabled"])) : d("", !0),
253
- r.value && e.isUpdate && !R.value ? (o(), S(C, j({
255
+ disabled: e.loading || s(y),
256
+ onClick: ae
257
+ }, null, 8, ["text", "disabled"])) : c("", !0),
258
+ u.value && e.isUpdate && !R.value ? (o(), S(C, j({
254
259
  key: 1,
255
260
  type: "button",
256
261
  variant: "primary",
257
262
  text: e.submitText
258
263
  }, e.submitProps, {
259
- loading: e.loading || a(y),
260
- onClick: B
261
- }), null, 16, ["text", "loading"])) : d("", !0)
264
+ loading: e.loading || s(y),
265
+ onClick: V
266
+ }), null, 16, ["text", "loading"])) : c("", !0)
262
267
  ]),
263
- p("div", xe, [
264
- r.value && G.value ? (o(), S(C, {
268
+ p("div", Ae, [
269
+ u.value && L.value ? (o(), S(C, {
265
270
  key: 0,
266
271
  type: "button",
267
272
  variant: "outline",
268
273
  icon: "lucide:arrow-left",
269
274
  text: "Previous",
270
275
  onClick: ee
271
- })) : d("", !0),
272
- r.value && !R.value ? (o(), S(C, {
276
+ })) : c("", !0),
277
+ u.value && !R.value ? (o(), S(C, {
273
278
  key: 1,
274
279
  type: "button",
275
280
  variant: e.isUpdate ? "outline" : "primary",
276
281
  text: "Next",
277
282
  iconRight: "lucide:arrow-right",
278
- onClick: L
279
- }, null, 8, ["variant"])) : d("", !0),
280
- !r.value || R.value ? (o(), S(C, j({
283
+ onClick: G
284
+ }, null, 8, ["variant"])) : c("", !0),
285
+ !u.value || R.value ? (o(), S(C, j({
281
286
  key: 2,
282
287
  type: "submit",
283
288
  variant: "primary",
284
289
  text: e.submitText
285
290
  }, e.submitProps, {
286
- loading: e.loading || a(y)
287
- }), null, 16, ["text", "loading"])) : d("", !0)
291
+ loading: e.loading || s(y)
292
+ }), null, 16, ["text", "loading"])) : c("", !0)
288
293
  ])
289
- ], 2)) : d("", !0)
294
+ ], 2)) : c("", !0)
290
295
  ], 34));
291
296
  }
292
297
  });
293
298
  export {
294
- qe as default
299
+ Te as default
295
300
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as U, computed as o, markRaw as I, openBlock as r, createBlock as f, mergeProps as s, toHandlers as S, createSlots as N, unref as R, withCtx as n, createVNode as z, createTextVNode as c, toDisplayString as m, createCommentVNode as L, resolveDynamicComponent as B } from "vue";
1
+ import { defineComponent as U, computed as o, markRaw as I, openBlock as r, createBlock as f, mergeProps as s, toHandlers as S, createSlots as N, unref as z, withCtx as n, createVNode as R, createTextVNode as c, toDisplayString as m, createCommentVNode as L, resolveDynamicComponent as B } from "vue";
2
2
  import { isComponent as h, isAddonObject as p } from "./utils/form.utils.js";
3
3
  import O from "../NumberInput.vue.js";
4
4
  import v from "../Button.vue.js";
@@ -119,6 +119,7 @@ const ue = /* @__PURE__ */ U({
119
119
  } : t === "switch" ? {
120
120
  ...a,
121
121
  modelValue: !!e.value,
122
+ size: "sm",
122
123
  label: ""
123
124
  // Label handled externally
124
125
  } : t === "check" ? {
@@ -240,7 +241,7 @@ const ue = /* @__PURE__ */ U({
240
241
  ...b.value,
241
242
  ...l.field?.props || {}
242
243
  }, S(x.value)), N({ _: 2 }, [
243
- R(p)(l.field.addonLeft) ? {
244
+ z(p)(l.field.addonLeft) ? {
244
245
  name: "addon-left",
245
246
  fn: n(() => [
246
247
  l.field.addonLeft.type === "select" ? (r(), f(y, s({
@@ -251,7 +252,7 @@ const ue = /* @__PURE__ */ U({
251
252
  onOnSelect: a[0] || (a[0] = (i) => V(l.field.addonLeft, i))
252
253
  }), {
253
254
  trigger: n(({ selectedLabel: i }) => [
254
- z(v, { variant: "outline" }, {
255
+ R(v, { variant: "outline" }, {
255
256
  default: n(() => [
256
257
  c(m(i), 1)
257
258
  ]),
@@ -273,7 +274,7 @@ const ue = /* @__PURE__ */ U({
273
274
  ]),
274
275
  key: "0"
275
276
  } : void 0,
276
- R(p)(l.field.addonRight) ? {
277
+ z(p)(l.field.addonRight) ? {
277
278
  name: "addon-right",
278
279
  fn: n(() => [
279
280
  l.field.addonRight.type === "select" ? (r(), f(y, s({
@@ -284,7 +285,7 @@ const ue = /* @__PURE__ */ U({
284
285
  onOnSelect: a[2] || (a[2] = (i) => V(l.field.addonRight, i))
285
286
  }), {
286
287
  trigger: n(({ selectedLabel: i }) => [
287
- z(v, { variant: "outline" }, {
288
+ R(v, { variant: "outline" }, {
288
289
  default: n(() => [
289
290
  c(m(i), 1)
290
291
  ]),
@@ -1,7 +1,7 @@
1
1
  import o from "./FormFields.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-03c267ac"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0fe8a23f"]]);
5
5
  export {
6
- c as default
6
+ a as default
7
7
  };
@@ -33,17 +33,17 @@ const W = {
33
33
  },
34
34
  emits: ["change", "addonAction"],
35
35
  setup(c, { emit: N }) {
36
- const a = c, y = N, L = O(() => {
36
+ const a = c, h = N, L = O(() => {
37
37
  if (a.className) return a.className;
38
- }), k = (t) => M(a.values, t.name), h = (t) => a.errors[t.name] || "", z = (t) => a.isFieldVisible ? a.isFieldVisible(t) : !0, D = (t) => a.isFieldDisabled ? a.isFieldDisabled(t) : t.disabled === !0, R = (t) => a.isFieldReadonly ? a.isFieldReadonly(t) : t.readonly === !0, o = (t) => t.labelI18n ? Q(t.labelI18n) : t.label, x = (t) => {
38
+ }), k = (t) => M(a.values, t.name), y = (t) => a.errors[t.name] || "", z = (t) => a.isFieldVisible ? a.isFieldVisible(t) : !0, D = (t) => a.isFieldDisabled ? a.isFieldDisabled(t) : t.disabled === !0, R = (t) => a.isFieldReadonly ? a.isFieldReadonly(t) : t.readonly === !0, o = (t) => t.labelI18n ? Q(t.labelI18n) : t.label, x = (t) => {
39
39
  if (t)
40
40
  return p(t), t;
41
41
  }, $ = (t, n) => {
42
- y("change", t.name, n);
42
+ h("change", t.name, n);
43
43
  }, q = (t) => t.itemClass || "", B = (t, n) => {
44
- y("change", t, n);
44
+ h("change", t, n);
45
45
  }, I = (t) => {
46
- y("addonAction", t);
46
+ h("addonAction", t);
47
47
  }, v = j({}), U = (t) => {
48
48
  v.value[t] = !0;
49
49
  }, E = (t) => {
@@ -96,7 +96,7 @@ const W = {
96
96
  for: e.name,
97
97
  class: i([
98
98
  "absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
99
- f(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-primary shadow-[0_4px_4px_-4px_bg-background]" : `top-2.5 text-sm text-muted-foreground/70 ${S(e)}`
99
+ f(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background]" : `top-2.5 text-sm text-muted-foreground/70 ${S(e)}`
100
100
  ])
101
101
  }, [
102
102
  _(p)(o(e)) ? (s(), d(w(x(o(e))), { key: 0 })) : (s(), r(l, { key: 1 }, [
@@ -119,7 +119,7 @@ const W = {
119
119
  rounded: c.rounded,
120
120
  disabled: D(e),
121
121
  readonly: R(e),
122
- error: h(e),
122
+ error: y(e),
123
123
  isUpdate: c.isUpdate,
124
124
  onChange: (F) => $(e, F),
125
125
  onAddonChange: B,
@@ -137,7 +137,7 @@ const W = {
137
137
  ]),
138
138
  _: 2
139
139
  }, 1032, ["for"])) : u("", !0),
140
- h(e) ? (s(), r("p", te, m(h(e)), 1)) : u("", !0)
140
+ y(e) ? (s(), r("p", te, m(y(e)), 1)) : u("", !0)
141
141
  ], 2)) : u("", !0)
142
142
  ], 64))), 128))
143
143
  ], 2));
@@ -1,4 +1,4 @@
1
- import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as C } from "vue";
1
+ import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as k } from "vue";
2
2
  import v from "./Icon.vue.js";
3
3
  import te from "./Label.vue.js";
4
4
  import le from "./Textarea.vue.js";
@@ -40,7 +40,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
40
40
  setup(t, { emit: D }) {
41
41
  const e = t, c = D, s = a(() => e.labelI18n ? E(e.labelI18n) : e.label), I = a(
42
42
  () => 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), k = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => h.value || k.value || y.value), p = a(() => !!e.addonLeft || !!g["addon-left"]), B = a(() => !!e.addonRight || !!g["addon-right"]), U = a(() => [
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
44
  "relative w-full",
45
45
  e.class,
46
46
  e.labelPosition === "left" ? "flex items-center gap-4" : "",
@@ -49,11 +49,11 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
49
49
  " "
50
50
  )), S = a(() => {
51
51
  const l = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none relative focus:z-10", n = {
52
- solid: "bg-muted border-transparent focus-visible:border-primary",
53
- outline: "border border-input focus-visible:border-primary",
54
- "outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-primary",
52
+ solid: "bg-muted border-transparent focus-visible:border-black",
53
+ outline: "border border-input focus-visible:border-black",
54
+ "outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-black",
55
55
  transparent: "border-none bg-transparent shadow-none",
56
- floating: "border border-input focus-visible:border-primary"
56
+ floating: "border border-input focus-visible:border-black"
57
57
  }, f = {
58
58
  sm: "h-7.5 text-xs",
59
59
  md: "h-9 text-sm",
@@ -77,7 +77,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
77
77
  o,
78
78
  e.error ? "border-destructive focus-visible:ring-destructive" : "",
79
79
  e.icon ? "pl-9" : M && !p.value ? "pl-0" : "",
80
- e.showClearButton && k.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : M && !B.value ? "pr-0" : "",
80
+ e.showClearButton && C.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : M && !B.value ? "pr-0" : "",
81
81
  // Keyframe name used to detect browser autofill via animationstart event
82
82
  e.variant === "floating" ? "autofill-detect" : "",
83
83
  e.inputClass
@@ -188,7 +188,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
188
188
  for: s.value,
189
189
  class: r([
190
190
  "absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
191
- V.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-primary shadow-[0_4px_4px_-4px_bg-background] translate-y-0" : t.type === "textarea" ? `top-2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"} translate-y-0` : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"}`
191
+ V.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background] translate-y-0" : t.type === "textarea" ? `top-2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"} translate-y-0` : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"}`
192
192
  ])
193
193
  }, w(s.value), 11, ne)) : i("", !0),
194
194
  t.type === "textarea" ? (d(), R(le, {
@@ -226,7 +226,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
226
226
  t.disabled ? "opacity-50" : ""
227
227
  ])
228
228
  }, [
229
- C(v, {
229
+ k(v, {
230
230
  icon: t.icon,
231
231
  class: r(["h-4 w-4", t.iconClass])
232
232
  }, null, 8, ["icon", "class"])
@@ -245,7 +245,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
245
245
  ]),
246
246
  onClick: n[1] || (n[1] = (f) => !t.disabled && c("click:icon-right", f))
247
247
  }, [
248
- C(v, {
248
+ k(v, {
249
249
  icon: t.iconRight,
250
250
  class: r(["h-4 w-4", t.iconRightClass])
251
251
  }, null, 8, ["icon", "class"])
@@ -257,19 +257,19 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
257
257
  class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none",
258
258
  onClick: O
259
259
  }, [
260
- C(v, {
260
+ k(v, {
261
261
  icon: x.value ? "lucide:eye-off" : "lucide:eye",
262
262
  class: "h-4 w-4"
263
263
  }, null, 8, ["icon"])
264
264
  ])) : i("", !0),
265
- t.showClearButton && k.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (h.value || j.value) ? (d(), u("button", {
265
+ t.showClearButton && C.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (h.value || j.value) ? (d(), u("button", {
266
266
  key: 3,
267
267
  type: "button",
268
268
  tabindex: "-1",
269
269
  class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none transition-opacity duration-200",
270
270
  onClick: Q
271
271
  }, [
272
- C(v, {
272
+ k(v, {
273
273
  icon: "lucide:x-circle",
274
274
  class: "h-4 w-4"
275
275
  })
@@ -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-b4f8e934"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c26acbd9"]]);
5
5
  export {
6
6
  m as default
7
7
  };