@defaultusr/dai-ui 1.1.7 → 1.1.9

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 (2) hide show
  1. package/dist/main.js +128 -121
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,32 +1,32 @@
1
1
  import { Combobox as te, ComboboxInput as oe, injectCombobox as ae, ComboboxOptions as le, ComboboxOption as ie, useFormControl as A, PopoverDialog as ne, MenuItems as se, MenuItem as re, Tab as de, TabList as ue } from "vue-composable-ui";
2
- import { Menu as Ot, Popover as Ut, TabContainer as Nt, TabPanel as Xt } from "vue-composable-ui";
3
- import { reactive as ce, watch as T, onUnmounted as R, defineComponent as v, createElementBlock as u, openBlock as a, renderSlot as p, createTextVNode as E, toDisplayString as k, normalizeClass as w, createBlock as f, createCommentVNode as h, createElementVNode as d, computed as $, createVNode as V, normalizeProps as me, guardReactiveProps as fe, withCtx as c, Transition as P, mergeModels as M, useModel as x, useId as L, mergeProps as _, unref as r, inject as ve, Fragment as I, useTemplateRef as q, ref as N, onMounted as j, withDirectives as F, renderList as X, vModelSelect as pe, vModelText as he, vModelCheckbox as be, vModelRadio as ye, resolveDynamicComponent as ge, nextTick as we, normalizeStyle as U, Teleport as Z, TransitionGroup as ke, withModifiers as $e } from "vue";
2
+ import { Menu as St, Popover as Ut, TabContainer as Nt, TabPanel as Xt } from "vue-composable-ui";
3
+ import { reactive as ce, watch as T, onUnmounted as R, defineComponent as v, createElementBlock as u, openBlock as l, renderSlot as p, createTextVNode as E, toDisplayString as k, normalizeClass as w, createBlock as f, createCommentVNode as h, createElementVNode as d, computed as $, createVNode as V, normalizeProps as me, guardReactiveProps as fe, withCtx as c, Transition as P, mergeModels as M, useModel as x, useId as L, mergeProps as _, unref as r, inject as ve, Fragment as I, useTemplateRef as q, ref as N, onMounted as j, withDirectives as F, renderList as X, vModelSelect as pe, vModelText as he, vModelCheckbox as be, vModelRadio as ye, resolveDynamicComponent as ge, nextTick as we, normalizeStyle as U, Teleport as Z, TransitionGroup as ke, withModifiers as $e } from "vue";
4
4
  import './assets/main.css';function xe(e, ...t) {
5
5
  let o = [];
6
- const l = ce(t);
6
+ const a = ce(t);
7
7
  function i() {
8
- l.length && (e.classList.add(...l), o = [...l]);
8
+ a.length && (e.classList.add(...a), o = [...a]);
9
9
  }
10
10
  function s() {
11
11
  e.classList.remove(...o);
12
12
  }
13
13
  return T(
14
- l,
14
+ a,
15
15
  () => {
16
16
  s(), i();
17
17
  },
18
18
  { immediate: !0 }
19
19
  ), R(s), {
20
- classList: l
20
+ classList: a
21
21
  };
22
22
  }
23
- const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
23
+ const _e = { class: "dai-label" }, O = /* @__PURE__ */ v({
24
24
  __name: "label",
25
25
  props: {
26
26
  text: {}
27
27
  },
28
28
  setup(e) {
29
- return (t, o) => (a(), u("label", _e, [
29
+ return (t, o) => (l(), u("label", _e, [
30
30
  p(t.$slots, "default", {}, () => [
31
31
  E(k(e.text), 1)
32
32
  ])
@@ -38,7 +38,7 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
38
38
  text: {}
39
39
  },
40
40
  setup(e) {
41
- return (t, o) => (a(), u("div", Be, [
41
+ return (t, o) => (l(), u("div", Be, [
42
42
  p(t.$slots, "default", {}, () => [
43
43
  E(k(e.text), 1)
44
44
  ])
@@ -57,7 +57,7 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
57
57
  invalid: { type: Boolean }
58
58
  },
59
59
  setup(e) {
60
- return (t, o) => (a(), u("div", {
60
+ return (t, o) => (l(), u("div", {
61
61
  class: w(["dai-form-control__input-group", {
62
62
  "dai-form-control__input-group--labeled": !!e.label,
63
63
  "dai-form-control__input-group--outlined": e.variant === "outlined",
@@ -69,7 +69,7 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
69
69
  "dai-form-control__input-group--invalid": e.invalid
70
70
  }])
71
71
  }, [
72
- e.label ? (a(), f(S, {
72
+ e.label ? (l(), f(O, {
73
73
  key: 0,
74
74
  text: e.label,
75
75
  for: e.labelFor,
@@ -84,7 +84,7 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
84
84
  key: 0,
85
85
  class: "dai-form-control__validation-message",
86
86
  role: "alert"
87
- }, O = /* @__PURE__ */ v({
87
+ }, S = /* @__PURE__ */ v({
88
88
  inheritAttrs: !1,
89
89
  __name: "formControl",
90
90
  props: {
@@ -104,15 +104,15 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
104
104
  invalid: { type: Boolean }
105
105
  },
106
106
  setup(e) {
107
- const t = e, o = $(() => t.variant ? t.variant : t.muted ? "muted" : t.outlined ? "outlined" : "flat"), l = $(() => t.size ? t.size : t.sm ? "small" : t.lg ? "large" : "medium");
108
- return (i, s) => (a(), u("div", {
107
+ const t = e, o = $(() => t.variant ? t.variant : t.muted ? "muted" : t.outlined ? "outlined" : "flat"), a = $(() => t.size ? t.size : t.sm ? "small" : t.lg ? "large" : "medium");
108
+ return (i, s) => (l(), u("div", {
109
109
  class: w(["dai-form-control", {
110
110
  "dai-form-control--label-inline": e.labelPosition === "inline",
111
111
  "dai-form-control--invalid": e.invalid,
112
- "dai-form-control--lg": l.value === "large"
112
+ "dai-form-control--lg": a.value === "large"
113
113
  }])
114
114
  }, [
115
- e.label && e.labelPosition !== "inside" ? (a(), f(S, {
115
+ e.label && e.labelPosition !== "inside" ? (l(), f(O, {
116
116
  key: 0,
117
117
  for: e.labelFor,
118
118
  text: e.label
@@ -122,21 +122,21 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
122
122
  ...t,
123
123
  label: e.labelPosition === "inside" ? e.label : void 0,
124
124
  variant: o.value,
125
- size: l.value
125
+ size: a.value
126
126
  })), {
127
127
  default: c(() => [
128
128
  p(i.$slots, "default")
129
129
  ]),
130
130
  _: 3
131
131
  }, 16),
132
- e.hint ? (a(), f(D, {
132
+ e.hint ? (l(), f(D, {
133
133
  key: 0,
134
134
  text: e.hint,
135
135
  class: "dai-form-control__hint"
136
136
  }, null, 8, ["text"])) : h("", !0),
137
137
  V(P, { name: "dai-form-control__validation-message-transition" }, {
138
138
  default: c(() => [
139
- e.validationMessage ? (a(), u("div", ze, [
139
+ e.validationMessage ? (l(), u("div", ze, [
140
140
  s[0] || (s[0] = d("svg", {
141
141
  xmlns: "http://www.w3.org/2000/svg",
142
142
  viewBox: "0 0 256 256",
@@ -180,14 +180,14 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
180
180
  }),
181
181
  emits: ["update:modelValue"],
182
182
  setup(e) {
183
- const t = e, o = x(e, "modelValue"), l = t.id || L();
184
- return (i, s) => (a(), f(O, _(t, {
185
- labelFor: r(l),
183
+ const t = e, o = x(e, "modelValue"), a = t.id || L();
184
+ return (i, s) => (l(), f(S, _(t, {
185
+ labelFor: r(a),
186
186
  class: i.$attrs.class
187
187
  }), {
188
188
  default: c(() => [
189
189
  V(r(te), _({ ...i.$attrs, class: void 0 }, {
190
- id: r(l),
190
+ id: r(a),
191
191
  modelValue: o.value,
192
192
  "onUpdate:modelValue": s[0] || (s[0] = (n) => o.value = n)
193
193
  }), {
@@ -203,7 +203,7 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
203
203
  }), wt = /* @__PURE__ */ v({
204
204
  __name: "comboboxInput",
205
205
  setup(e) {
206
- return (t, o) => (a(), f(r(oe), { class: "dai-form-control__input-group__control" }, {
206
+ return (t, o) => (l(), f(r(oe), { class: "dai-form-control__input-group__control" }, {
207
207
  default: c(() => [
208
208
  p(t.$slots, "default")
209
209
  ]),
@@ -223,19 +223,26 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
223
223
  if (!t)
224
224
  throw new Error("Combobox injectable context is not provided");
225
225
  const o = $(() => ({
226
- onclick: () => t.open({ focus: !0 }),
227
- ...t.activatorAttrs.value
226
+ ...t.activatorAttrs.value,
227
+ onclick: () => t.isOpen.value ? t.close({ focus: !0 }) : t.open({ focus: !1 })
228
228
  }));
229
- return (l, i) => (a(), u("button", _(o.value, {
229
+ return T(
230
+ o,
231
+ (a) => {
232
+ console.log("btnAttrs changed:", a);
233
+ },
234
+ { immediate: !0 }
235
+ ), (a, i) => (l(), u("button", _(o.value, {
230
236
  type: "button",
231
237
  class: "dai-form-control__input-group__control dai-combobox-btn"
232
238
  }), [
233
- p(l.$slots, "default", {}, () => [
234
- r(t).displayValue.value ? (a(), u(I, { key: 1 }, [
239
+ p(a.$slots, "default", {}, () => [
240
+ r(t).displayValue.value ? (l(), u(I, { key: 1 }, [
235
241
  E(k(r(t).displayValue), 1)
236
- ], 64)) : (a(), u("span", Le, k(e.placeholder || "Select..."), 1)),
242
+ ], 64)) : (l(), u("span", Le, k(e.placeholder || "Select..."), 1)),
237
243
  i[0] || (i[0] = d("svg", {
238
244
  class: "dai-combobox-btn__chevron",
245
+ role: "presentation",
239
246
  xmlns: "http://www.w3.org/2000/svg",
240
247
  viewBox: "0 0 16 16"
241
248
  }, [
@@ -252,7 +259,7 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
252
259
  }), Te = /* @__PURE__ */ v({
253
260
  __name: "comboboxOptions",
254
261
  setup(e) {
255
- return (t, o) => (a(), f(P, {
262
+ return (t, o) => (l(), f(P, {
256
263
  "enter-from-class": "dai-combobox-options--anim",
257
264
  "leave-to-class": "dai-combobox-options--anim"
258
265
  }, {
@@ -278,16 +285,16 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
278
285
  value: {}
279
286
  },
280
287
  setup(e) {
281
- return (t, o) => (a(), f(r(ie), {
288
+ return (t, o) => (l(), f(r(ie), {
282
289
  value: e.value,
283
290
  class: "dai-combobox-option"
284
291
  }, {
285
- default: c(({ isActive: l, isSelected: i }) => [
292
+ default: c(({ isActive: a, isSelected: i }) => [
286
293
  p(t.$slots, "default", {
287
- isActive: l,
294
+ isActive: a,
288
295
  isSelected: i
289
296
  }),
290
- i ? (a(), u("svg", Pe, [...o[0] || (o[0] = [
297
+ i ? (l(), u("svg", Pe, [...o[0] || (o[0] = [
291
298
  d("path", {
292
299
  fill: "currentColor",
293
300
  "fill-rule": "evenodd",
@@ -301,8 +308,8 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
301
308
  }
302
309
  }), Ie = (e, t) => {
303
310
  const o = e.__vccOpts || e;
304
- for (const [l, i] of t)
305
- o[l] = i;
311
+ for (const [a, i] of t)
312
+ o[a] = i;
306
313
  return o;
307
314
  }, je = {}, Fe = {
308
315
  type: "button",
@@ -310,12 +317,12 @@ const _e = { class: "dai-label" }, S = /* @__PURE__ */ v({
310
317
  tabindex: "-1",
311
318
  "aria-hidden": "true"
312
319
  };
313
- function Se(e, t) {
314
- return a(), u("button", Fe, [
320
+ function Oe(e, t) {
321
+ return l(), u("button", Fe, [
315
322
  p(e.$slots, "default")
316
323
  ]);
317
324
  }
318
- const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern", "title", "autocomplete", "value"], Ue = {
325
+ const Y = /* @__PURE__ */ Ie(je, [["render", Oe]]), Se = ["id", "type", "pattern", "title", "autocomplete", "value"], Ue = {
319
326
  key: 0,
320
327
  xmlns: "http://www.w3.org/2000/svg",
321
328
  fill: "none",
@@ -362,7 +369,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
362
369
  }),
363
370
  emits: ["update:modelValue", "update:files"],
364
371
  setup(e) {
365
- const t = e, o = t.id || L(), l = $(() => typeof t.autocomplete == "string" ? t.autocomplete : t.autocomplete ? "on" : "off"), i = x(e, "modelValue"), s = x(e, "files", {
372
+ const t = e, o = t.id || L(), a = $(() => typeof t.autocomplete == "string" ? t.autocomplete : t.autocomplete ? "on" : "off"), i = x(e, "modelValue"), s = x(e, "files", {
366
373
  set(B) {
367
374
  return n.value && (n.value.files = B), B;
368
375
  }
@@ -399,7 +406,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
399
406
  i.value = C.value;
400
407
  });
401
408
  });
402
- }), (B, z) => (a(), f(O, _(t, {
409
+ }), (B, z) => (l(), f(S, _(t, {
403
410
  "label-for": r(o),
404
411
  "validation-message": e.showValidationError ? "" : r(b),
405
412
  invalid: t.invalid || !r(g),
@@ -415,26 +422,26 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
415
422
  type: G.value,
416
423
  pattern: K.value,
417
424
  title: Q.value,
418
- autocomplete: l.value,
425
+ autocomplete: a.value,
419
426
  value: i.value,
420
427
  onInputPassive: ee,
421
428
  onKeyupPassive: z[0] || (z[0] = (bt) => !r(g) && r(y)()),
422
429
  class: "dai-form-control__input-group__control dai-form-control__input"
423
- }), null, 16, Oe),
430
+ }), null, 16, Se),
424
431
  p(B.$slots, "append"),
425
- t.type === "password" && i.value ? (a(), f(Y, {
432
+ t.type === "password" && i.value ? (l(), f(Y, {
426
433
  key: 0,
427
434
  onClick: W
428
435
  }, {
429
436
  default: c(() => [
430
- m.value ? (a(), u("svg", Ne, [...z[2] || (z[2] = [
437
+ m.value ? (l(), u("svg", Ne, [...z[2] || (z[2] = [
431
438
  d("path", {
432
439
  "stroke-linecap": "round",
433
440
  "stroke-linejoin": "round",
434
441
  "stroke-width": "2",
435
442
  d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
436
443
  }, null, -1)
437
- ])])) : (a(), u("svg", Ue, [...z[1] || (z[1] = [
444
+ ])])) : (l(), u("svg", Ue, [...z[1] || (z[1] = [
438
445
  d("path", {
439
446
  "stroke-linecap": "round",
440
447
  "stroke-linejoin": "round",
@@ -451,7 +458,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
451
458
  ]),
452
459
  _: 1
453
460
  })) : h("", !0),
454
- e.clearable && i.value && !t.disabled ? (a(), f(Y, {
461
+ e.clearable && i.value && !t.disabled ? (l(), f(Y, {
455
462
  key: 1,
456
463
  onClick: J
457
464
  }, {
@@ -506,12 +513,12 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
506
513
  }),
507
514
  emits: ["update:modelValue"],
508
515
  setup(e) {
509
- const t = e, o = t.id || L(), l = x(e, "modelValue"), i = q("formElement"), { isValid: s, validationMessage: n, validate: g } = A(
516
+ const t = e, o = t.id || L(), a = x(e, "modelValue"), i = q("formElement"), { isValid: s, validationMessage: n, validate: g } = A(
510
517
  i,
511
518
  t.validators,
512
519
  t.showValidationError
513
520
  );
514
- return (b, y) => (a(), f(O, _(t, {
521
+ return (b, y) => (l(), f(S, _(t, {
515
522
  "label-for": r(o),
516
523
  "validation-message": e.showValidationError ? "" : r(n),
517
524
  invalid: t.invalid || !r(s),
@@ -523,17 +530,17 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
523
530
  ref: i
524
531
  }, { ...b.$attrs, class: void 0 }, {
525
532
  id: r(o),
526
- "onUpdate:modelValue": y[0] || (y[0] = (m) => l.value = m),
533
+ "onUpdate:modelValue": y[0] || (y[0] = (m) => a.value = m),
527
534
  class: "dai-form-control__input-group__control dai-select"
528
535
  }), [
529
536
  p(b.$slots, "default", {}, () => [
530
- (a(!0), u(I, null, X(e.options, (m) => (a(), u("option", {
537
+ (l(!0), u(I, null, X(e.options, (m) => (l(), u("option", {
531
538
  value: m[e.optionValue],
532
539
  key: m[e.optionValue]
533
540
  }, k(m[e.optionText]), 9, De))), 128))
534
541
  ])
535
542
  ], 16, Xe), [
536
- [pe, l.value]
543
+ [pe, a.value]
537
544
  ]),
538
545
  y[1] || (y[1] = d("svg", {
539
546
  class: "dai-select__chevron",
@@ -580,7 +587,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
580
587
  emits: ["update:modelValue"],
581
588
  setup(e) {
582
589
  const t = e, o = x(e, "modelValue");
583
- return (l, i) => (a(), f(r(Ee), _(t, {
590
+ return (a, i) => (l(), f(r(Ee), _(t, {
584
591
  displayValue: (s) => e.options.find((n) => n[e.optionValue] === s)?.[e.optionText] || "",
585
592
  modelValue: o.value,
586
593
  "onUpdate:modelValue": i[0] || (i[0] = (s) => o.value = s)
@@ -589,7 +596,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
589
596
  V(r(qe), { placeholder: e.placeholder }, null, 8, ["placeholder"]),
590
597
  V(r(Te), null, {
591
598
  default: c(() => [
592
- (a(!0), u(I, null, X(e.options, (s) => (a(), f(r(Ae), {
599
+ (l(!0), u(I, null, X(e.options, (s) => (l(), f(r(Ae), {
593
600
  key: s[e.optionValue],
594
601
  value: s[e.optionValue]
595
602
  }, {
@@ -619,7 +626,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
619
626
  }),
620
627
  emits: ["update:modelValue"],
621
628
  setup(e) {
622
- const t = e, o = t.id || L(), l = x(e, "modelValue"), i = q("formElement"), { isValid: s, validationMessage: n, validate: g } = A(
629
+ const t = e, o = t.id || L(), a = x(e, "modelValue"), i = q("formElement"), { isValid: s, validationMessage: n, validate: g } = A(
623
630
  i,
624
631
  t.validators,
625
632
  t.showValidationError
@@ -629,7 +636,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
629
636
  const y = i.value, m = y.offsetHeight - y.clientHeight;
630
637
  y.style.height = "auto", y.style.height = `${y.scrollHeight + m}px`;
631
638
  }
632
- return j(b), (y, m) => (a(), f(O, _(t, {
639
+ return j(b), (y, m) => (l(), f(S, _(t, {
633
640
  "label-for": r(o),
634
641
  "validation-message": e.showValidationError ? "" : r(n),
635
642
  invalid: !r(s),
@@ -641,14 +648,14 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
641
648
  ref: i
642
649
  }, { ...y.$attrs, class: void 0 }, {
643
650
  id: r(o),
644
- "onUpdate:modelValue": m[0] || (m[0] = (C) => l.value = C),
651
+ "onUpdate:modelValue": m[0] || (m[0] = (C) => a.value = C),
645
652
  onKeyupPassive: m[1] || (m[1] = (C) => !r(s) && r(g)()),
646
653
  onInputPassive: b,
647
654
  class: ["form-control__textarea", {
648
655
  "form-control__textarea--autosize": e.autosize
649
656
  }]
650
657
  }), null, 16, He), [
651
- [he, l.value]
658
+ [he, a.value]
652
659
  ])
653
660
  ]),
654
661
  _: 1
@@ -669,12 +676,12 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
669
676
  }),
670
677
  emits: ["update:modelValue"],
671
678
  setup(e) {
672
- const t = e, o = x(e, "modelValue"), l = L(), i = q("formElement"), { isValid: s } = A(
679
+ const t = e, o = x(e, "modelValue"), a = L(), i = q("formElement"), { isValid: s } = A(
673
680
  i,
674
681
  t.validators,
675
682
  t.showValidationError
676
683
  );
677
- return (n, g) => (a(), u("div", {
684
+ return (n, g) => (l(), u("div", {
678
685
  class: w(["dai-checkbox-control", n.$attrs.class])
679
686
  }, [
680
687
  F(d("input", _({
@@ -682,7 +689,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
682
689
  ref: i,
683
690
  "onUpdate:modelValue": g[0] || (g[0] = (b) => o.value = b)
684
691
  }, { ...n.$attrs, class: "" }, {
685
- id: r(l),
692
+ id: r(a),
686
693
  type: "checkbox",
687
694
  class: ["dai-checkbox", {
688
695
  [`dai-checkbox--${e.color}`]: e.color,
@@ -691,9 +698,9 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
691
698
  }), null, 16, Ye), [
692
699
  [be, o.value]
693
700
  ]),
694
- e.label || n.$slots.default ? (a(), f(S, {
701
+ e.label || n.$slots.default ? (l(), f(O, {
695
702
  key: 0,
696
- for: r(l)
703
+ for: r(a)
697
704
  }, {
698
705
  default: c(() => [
699
706
  p(n.$slots, "default", {}, () => [
@@ -702,7 +709,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
702
709
  ]),
703
710
  _: 3
704
711
  }, 8, ["for"])) : h("", !0),
705
- e.hint || n.$slots.hint ? (a(), f(D, {
712
+ e.hint || n.$slots.hint ? (l(), f(D, {
706
713
  key: 1,
707
714
  class: "dai-checkbox-control__hint"
708
715
  }, {
@@ -737,12 +744,12 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
737
744
  }),
738
745
  emits: ["update:modelValue"],
739
746
  setup(e) {
740
- const t = e, o = x(e, "modelValue"), l = L(), i = q("formElement"), { isValid: s } = A(
747
+ const t = e, o = x(e, "modelValue"), a = L(), i = q("formElement"), { isValid: s } = A(
741
748
  i,
742
749
  t.validators,
743
750
  t.showValidationError
744
751
  );
745
- return (n, g) => (a(), u("div", {
752
+ return (n, g) => (l(), u("div", {
746
753
  class: w(["flex items-start gap-3", n.$attrs.class])
747
754
  }, [
748
755
  d("div", Re, [
@@ -753,7 +760,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
753
760
  "onUpdate:modelValue": g[0] || (g[0] = (b) => o.value = b)
754
761
  }, { ...n.$attrs, class: "" }, {
755
762
  value: e.value,
756
- id: r(l),
763
+ id: r(a),
757
764
  class: ["radio", {
758
765
  [`radio--${e.color}`]: e.color,
759
766
  "radio--invalid": !r(s)
@@ -762,12 +769,12 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
762
769
  [ye, o.value]
763
770
  ])
764
771
  ]),
765
- e.label ? (a(), u("div", Ge, [
772
+ e.label ? (l(), u("div", Ge, [
766
773
  d("label", {
767
- for: r(l),
774
+ for: r(a),
768
775
  class: "font-medium select-none cursor-pointer"
769
776
  }, k(e.label), 9, Ke),
770
- e.hint ? (a(), u("p", Qe, k(e.hint), 1)) : h("", !0)
777
+ e.hint ? (l(), u("p", Qe, k(e.hint), 1)) : h("", !0)
771
778
  ])) : h("", !0)
772
779
  ], 2));
773
780
  }
@@ -783,7 +790,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
783
790
  emits: ["update:modelValue"],
784
791
  setup(e) {
785
792
  const t = x(e, "modelValue"), o = L();
786
- return (l, i) => (a(), u("div", We, [
793
+ return (a, i) => (l(), u("div", We, [
787
794
  d("button", {
788
795
  onClick: i[0] || (i[0] = (s) => t.value = !t.value),
789
796
  id: r(o),
@@ -798,23 +805,23 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
798
805
  class: "dai-switch__thumb"
799
806
  }, null, -1)
800
807
  ])], 10, Je),
801
- e.label || l.$slots.default ? (a(), f(S, {
808
+ e.label || a.$slots.default ? (l(), f(O, {
802
809
  key: 0,
803
810
  for: r(o)
804
811
  }, {
805
812
  default: c(() => [
806
- p(l.$slots, "default", {}, () => [
813
+ p(a.$slots, "default", {}, () => [
807
814
  E(k(e.label), 1)
808
815
  ])
809
816
  ]),
810
817
  _: 3
811
818
  }, 8, ["for"])) : h("", !0),
812
- e.hint || l.$slots.hint ? (a(), f(D, {
819
+ e.hint || a.$slots.hint ? (l(), f(D, {
813
820
  key: 1,
814
821
  class: "dai-switch-control__hint"
815
822
  }, {
816
823
  default: c(() => [
817
- p(l.$slots, "hint", {}, () => [
824
+ p(a.$slots, "hint", {}, () => [
818
825
  E(k(e.hint), 1)
819
826
  ])
820
827
  ]),
@@ -847,17 +854,17 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
847
854
  condensed: { type: Boolean }
848
855
  },
849
856
  setup(e) {
850
- const t = e, o = $(() => t.submit ? "submit" : t.reset ? "reset" : "button"), l = $(() => t.variant ? t.variant : t.plain ? "plain" : t.muted ? "muted" : t.outlined ? "outlined" : "flat"), i = $(() => t.size ? t.size : t.sm ? "small" : t.lg ? "large" : "medium");
851
- return (s, n) => (a(), f(ge(e.href ? "a" : "button"), {
857
+ const t = e, o = $(() => t.submit ? "submit" : t.reset ? "reset" : "button"), a = $(() => t.variant ? t.variant : t.plain ? "plain" : t.muted ? "muted" : t.outlined ? "outlined" : "flat"), i = $(() => t.size ? t.size : t.sm ? "small" : t.lg ? "large" : "medium");
858
+ return (s, n) => (l(), f(ge(e.href ? "a" : "button"), {
852
859
  type: e.href ? void 0 : o.value,
853
860
  form: typeof e.submit == "string" ? e.submit : void 0,
854
861
  href: e.href,
855
862
  class: w(["dai-btn", {
856
863
  [`dai-btn--${e.color}`]: e.color,
857
- "dai-btn--flat": l.value === "flat",
858
- "dai-btn--plain": l.value === "plain",
859
- "dai-btn--muted": l.value === "muted",
860
- "dai-btn--outlined": l.value === "outlined",
864
+ "dai-btn--flat": a.value === "flat",
865
+ "dai-btn--plain": a.value === "plain",
866
+ "dai-btn--muted": a.value === "muted",
867
+ "dai-btn--outlined": a.value === "outlined",
861
868
  "dai-btn--sm": i.value === "small",
862
869
  "dai-btn--lg": i.value === "large",
863
870
  "dai-btn--loading": e.loading,
@@ -867,7 +874,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
867
874
  }])
868
875
  }, {
869
876
  default: c(() => [
870
- e.loading ? (a(), u("span", et, [...n[0] || (n[0] = [
877
+ e.loading ? (l(), u("span", et, [...n[0] || (n[0] = [
871
878
  d("svg", {
872
879
  xmlns: "http://www.w3.org/2000/svg",
873
880
  fill: "none",
@@ -889,12 +896,12 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
889
896
  ], -1)
890
897
  ])])) : h("", !0),
891
898
  d("span", tt, [
892
- e.icon ? (a(), u("div", {
899
+ e.icon ? (l(), u("div", {
893
900
  key: 0,
894
901
  class: w([e.icon, "dai-btn__icon"])
895
902
  }, null, 2)) : h("", !0),
896
903
  p(s.$slots, "default"),
897
- e.iconAfter ? (a(), u("div", {
904
+ e.iconAfter ? (l(), u("div", {
898
905
  key: 1,
899
906
  class: w([e.iconAfter, "dai-btn__icon"])
900
907
  }, null, 2)) : h("", !0)
@@ -906,7 +913,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
906
913
  }), zt = /* @__PURE__ */ v({
907
914
  __name: "popoverDialog",
908
915
  setup(e) {
909
- return (t, o) => (a(), f(P, {
916
+ return (t, o) => (l(), f(P, {
910
917
  "enter-from-class": "dai-popover-dialog--anim",
911
918
  "leave-to-class": "dai-popover-dialog--anim"
912
919
  }, {
@@ -924,7 +931,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
924
931
  }), Et = /* @__PURE__ */ v({
925
932
  __name: "menuItems",
926
933
  setup(e) {
927
- return (t, o) => (a(), f(P, {
934
+ return (t, o) => (l(), f(P, {
928
935
  "enter-from-class": "dai-menu-items--anim",
929
936
  "leave-to-class": "dai-menu-items--anim"
930
937
  }, {
@@ -948,15 +955,15 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
948
955
  icon: {}
949
956
  },
950
957
  setup(e) {
951
- return (t, o) => (a(), f(r(re), { class: "dai-menu-item" }, {
952
- default: c(({ isActive: l, isSelected: i }) => [
953
- e.icon ? (a(), u("div", ot, [
958
+ return (t, o) => (l(), f(r(re), { class: "dai-menu-item" }, {
959
+ default: c(({ isActive: a, isSelected: i }) => [
960
+ e.icon ? (l(), u("div", ot, [
954
961
  d("div", {
955
962
  class: w(["h-5 w-5", e.icon])
956
963
  }, null, 2)
957
964
  ])) : h("", !0),
958
965
  p(t.$slots, "default", {
959
- isActive: l,
966
+ isActive: a,
960
967
  isSelected: i
961
968
  })
962
969
  ]),
@@ -971,7 +978,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
971
978
  value: {}
972
979
  },
973
980
  setup(e) {
974
- return (t, o) => (a(), f(r(de), {
981
+ return (t, o) => (l(), f(r(de), {
975
982
  id: e.id,
976
983
  "aria-controls": e.ariaControls,
977
984
  value: e.value,
@@ -986,19 +993,19 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
986
993
  }), Tt = /* @__PURE__ */ v({
987
994
  __name: "tabList",
988
995
  setup(e) {
989
- const t = q("tablist"), o = q("slider"), l = N({});
996
+ const t = q("tablist"), o = q("slider"), a = N({});
990
997
  function i() {
991
998
  if (!o.value) return;
992
999
  const s = t.value?.$el;
993
1000
  if (!s) return;
994
1001
  const n = s.querySelector("[aria-selected=true]");
995
- n && (l.value = {
1002
+ n && (a.value = {
996
1003
  left: `${n.offsetLeft}px`,
997
1004
  right: `${s.offsetWidth - n.offsetLeft - n.offsetWidth}px`,
998
1005
  transition: o.value.offsetLeft > n.offsetLeft ? "left .2s, right .5s" : "left .5s, right .2s"
999
1006
  });
1000
1007
  }
1001
- return j(() => we(i)), (s, n) => (a(), f(r(ue), {
1008
+ return j(() => we(i)), (s, n) => (l(), f(r(ue), {
1002
1009
  ref_key: "tablist",
1003
1010
  ref: t,
1004
1011
  onClickPassive: i,
@@ -1009,7 +1016,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1009
1016
  ref_key: "slider",
1010
1017
  ref: o,
1011
1018
  class: "dai-tab-list__slider",
1012
- style: U(l.value)
1019
+ style: U(a.value)
1013
1020
  }, null, 4),
1014
1021
  p(s.$slots, "default")
1015
1022
  ]),
@@ -1032,7 +1039,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1032
1039
  }),
1033
1040
  emits: ["update:modelValue"],
1034
1041
  setup(e) {
1035
- const t = e, o = x(e, "modelValue"), l = t.id ?? L(), { classList: i } = xe(document.body, "nui-body-push");
1042
+ const t = e, o = x(e, "modelValue"), a = t.id ?? L(), { classList: i } = xe(document.body, "nui-body-push");
1036
1043
  T(o, () => {
1037
1044
  if (!t.push || (i.splice(1), !o.value))
1038
1045
  return;
@@ -1040,13 +1047,13 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1040
1047
  t.lg && (n += "--lg"), t.xl && (n += "--xl"), i.push(n);
1041
1048
  });
1042
1049
  function s(n) {
1043
- n.target.closest(`#${l}`) || t.closeOnOutsideClick && (o.value = !1);
1050
+ n.target.closest(`#${a}`) || t.closeOnOutsideClick && (o.value = !1);
1044
1051
  }
1045
1052
  return j(() => {
1046
1053
  window.addEventListener("click", s, { passive: !0 });
1047
1054
  }), R(() => {
1048
1055
  window.removeEventListener("click", s);
1049
- }), (n, g) => (a(), f(Z, { to: "body" }, [
1056
+ }), (n, g) => (l(), f(Z, { to: "body" }, [
1050
1057
  V(P, {
1051
1058
  appear: "",
1052
1059
  "enter-from-class": "nui-offcanvas--animate-hidden",
@@ -1057,9 +1064,9 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1057
1064
  "leave-active-class": "ease-in-out"
1058
1065
  }, {
1059
1066
  default: c(() => [
1060
- o.value ? (a(), u("div", _({
1067
+ o.value ? (l(), u("div", _({
1061
1068
  key: 0,
1062
- id: r(l)
1069
+ id: r(a)
1063
1070
  }, n.$attrs, {
1064
1071
  class: ["nui-offcanvas", {
1065
1072
  [`nui-offcanvas--${e.position}`]: !0,
@@ -1126,20 +1133,20 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1126
1133
  emits: ["update:modelValue"],
1127
1134
  setup(e) {
1128
1135
  const t = e, o = x(e, "modelValue");
1129
- let l;
1136
+ let a;
1130
1137
  function i() {
1131
- clearTimeout(l), o.value && t.timeout && (l = setTimeout(() => o.value = !1, t.timeout));
1138
+ clearTimeout(a), o.value && t.timeout && (a = setTimeout(() => o.value = !1, t.timeout));
1132
1139
  }
1133
- return T(o, i, { immediate: !0 }), (s, n) => o.value ? (a(), u("div", lt, [
1140
+ return T(o, i, { immediate: !0 }), (s, n) => o.value ? (l(), u("div", lt, [
1134
1141
  d("div", {
1135
1142
  class: w(["dai-notification", [`dai-notification--${e.color || "secondary"}`]])
1136
1143
  }, [
1137
- e.icon ? (a(), u("div", {
1144
+ e.icon ? (l(), u("div", {
1138
1145
  key: 0,
1139
1146
  class: w(["dai-notification__icon", [`dai-notification__icon--${e.icon}`]])
1140
1147
  }, [
1141
- (a(), u("svg", it, [
1142
- e.icon == "success" ? (a(), u("path", nt)) : e.icon == "info" ? (a(), u("path", st)) : e.icon == "warning" ? (a(), u("path", rt)) : e.icon == "danger" ? (a(), u("path", dt)) : h("", !0)
1148
+ (l(), u("svg", it, [
1149
+ e.icon == "success" ? (l(), u("path", nt)) : e.icon == "info" ? (l(), u("path", st)) : e.icon == "warning" ? (l(), u("path", rt)) : e.icon == "danger" ? (l(), u("path", dt)) : h("", !0)
1143
1150
  ]))
1144
1151
  ], 2)) : h("", !0),
1145
1152
  d("div", ut, [
@@ -1148,9 +1155,9 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1148
1155
  "dai-notification__content__message--bold": e.detail
1149
1156
  }])
1150
1157
  }, k(e.message), 3),
1151
- e.detail ? (a(), u("div", ct, k(e.detail), 1)) : h("", !0)
1158
+ e.detail ? (l(), u("div", ct, k(e.detail), 1)) : h("", !0)
1152
1159
  ]),
1153
- e.dismissible ? (a(), u("div", {
1160
+ e.dismissible ? (l(), u("div", {
1154
1161
  key: 1,
1155
1162
  onClick: n[0] || (n[0] = (g) => o.value = !1),
1156
1163
  class: "dai-notification__dismiss"
@@ -1186,14 +1193,14 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1186
1193
  }),
1187
1194
  emits: ["update:queue"],
1188
1195
  setup(e) {
1189
- const t = e, o = x(e, "queue"), l = N([]);
1196
+ const t = e, o = x(e, "queue"), a = N([]);
1190
1197
  let i = 0;
1191
1198
  function s() {
1192
- o.value.length === 0 || l.value.length >= t.length || (l.value.push({ ...o.value[0], id: i++, show: !0 }), o.value.shift());
1199
+ o.value.length === 0 || a.value.length >= t.length || (a.value.push({ ...o.value[0], id: i++, show: !0 }), o.value.shift());
1193
1200
  }
1194
1201
  function n(b) {
1195
1202
  setTimeout(() => {
1196
- l.value = l.value.filter(
1203
+ a.value = a.value.filter(
1197
1204
  (y) => y.id !== b
1198
1205
  ), s();
1199
1206
  }, 200);
@@ -1203,7 +1210,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1203
1210
  const b = ["dai-notification-queue__item--anim"];
1204
1211
  return t.positionX === "right" ? b.push("dai-notification-queue__item--anim-x-right") : t.positionX === "left" ? b.push("dai-notification-queue__item--anim-x-left") : t.positionX === "center" && t.positionY === "top" ? b.push("dai-notification-queue__item--anim-y-top") : t.positionX === "center" && t.positionY === "bottom" && b.push("dai-notification-queue__item--anim-y-bottom"), b.join(" ");
1205
1212
  });
1206
- return (b, y) => (a(), u("div", {
1213
+ return (b, y) => (l(), u("div", {
1207
1214
  class: w(["dai-notification-queue", {
1208
1215
  "dai-notification-queue--fixed": e.position == "fixed",
1209
1216
  "dai-notification-queue--absolute": e.position == "absolute",
@@ -1222,7 +1229,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1222
1229
  "leave-active-class": "dai-notification-queue__item--anim-out"
1223
1230
  }, {
1224
1231
  default: c(() => [
1225
- (a(!0), u(I, null, X(l.value, (m) => (a(), f(mt, {
1232
+ (l(!0), u(I, null, X(a.value, (m) => (l(), f(mt, {
1226
1233
  key: m.id,
1227
1234
  color: m.color,
1228
1235
  icon: m.type,
@@ -1248,7 +1255,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1248
1255
  },
1249
1256
  setup(e) {
1250
1257
  const t = e, o = $(() => t.value === void 0);
1251
- return (l, i) => (a(), u("div", {
1258
+ return (a, i) => (l(), u("div", {
1252
1259
  class: w(["overflow-hidden text-xs w-full flex-1", {
1253
1260
  rounded: e.rounded,
1254
1261
  "bg-primary-200": e.color == "primary",
@@ -1292,16 +1299,16 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1292
1299
  function o() {
1293
1300
  t.value = !1;
1294
1301
  }
1295
- return T(t, (l) => {
1296
- l ? document.body.classList.add("overflow-hidden") : document.body.classList.remove("overflow-hidden");
1297
- }), (l, i) => (a(), f(Z, { to: "body" }, [
1302
+ return T(t, (a) => {
1303
+ a ? document.body.classList.add("overflow-hidden") : document.body.classList.remove("overflow-hidden");
1304
+ }), (a, i) => (l(), f(Z, { to: "body" }, [
1298
1305
  V(P, {
1299
1306
  appear: "",
1300
1307
  name: "modal",
1301
1308
  duration: { enter: 300, leave: 200 }
1302
1309
  }, {
1303
1310
  default: c(() => [
1304
- t.value ? (a(), u("div", vt, [
1311
+ t.value ? (l(), u("div", vt, [
1305
1312
  i[0] || (i[0] = d("div", {
1306
1313
  class: "modal__backdrop fixed inset-0 bg-primary-50/60 backdrop-blur-sm",
1307
1314
  "aria-hidden": "true"
@@ -1312,7 +1319,7 @@ const Y = /* @__PURE__ */ Ie(je, [["render", Se]]), Oe = ["id", "type", "pattern
1312
1319
  class: "min-h-full flex items-center justify-center p-4 sm:p-6"
1313
1320
  }, [
1314
1321
  d("div", ht, [
1315
- p(l.$slots, "default", { close: o })
1322
+ p(a.$slots, "default", { close: o })
1316
1323
  ])
1317
1324
  ])
1318
1325
  ])
@@ -1332,7 +1339,7 @@ export {
1332
1339
  Ae as ComboboxOption,
1333
1340
  Te as ComboboxOptions,
1334
1341
  kt as Input,
1335
- Ot as Menu,
1342
+ St as Menu,
1336
1343
  Lt as MenuItem,
1337
1344
  Et as MenuItems,
1338
1345
  jt as Modal,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defaultusr/dai-ui",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"