@defaultusr/dai-ui 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
- import { useFormControl as T, Combobox as te, ComboboxInput as oe, injectCombobox as ae, ComboboxOptions as le, ComboboxOption as ie, PopoverDialog as ne, MenuItems as se, MenuItem as re, Tab as de, TabList as ue } from "vue-composable-ui";
1
+ import { useFormControl as P, Combobox as te, ComboboxInput as oe, injectCombobox as ae, ComboboxOptions as le, ComboboxOption as ie, PopoverDialog as ne, MenuItems as se, MenuItem as re, Tab as de, TabList as ue } from "vue-composable-ui";
2
2
  import { Menu as Nt, Popover as Ut, TabContainer as Xt, TabPanel as Dt } from "vue-composable-ui";
3
- import { reactive as ce, watch as A, onUnmounted as R, defineComponent as v, createElementBlock as u, openBlock as i, renderSlot as p, createTextVNode as z, toDisplayString as k, normalizeClass as w, createBlock as h, createCommentVNode as y, createElementVNode as d, computed as _, createVNode as V, normalizeProps as fe, guardReactiveProps as me, withCtx as c, Transition as P, mergeModels as C, useModel as B, useId as q, useTemplateRef as L, mergeProps as $, unref as n, inject as ve, Fragment as I, ref as U, onMounted as O, withDirectives as X, renderList as D, vModelSelect as he, vModelText as pe, vModelRadio as be, resolveDynamicComponent as ye, nextTick as ge, normalizeStyle as N, Teleport as Z, TransitionGroup as we, withModifiers as ke } from "vue";
3
+ import { reactive as ce, watch as T, onUnmounted as R, defineComponent as v, createElementBlock as u, openBlock as i, renderSlot as b, createTextVNode as z, toDisplayString as k, normalizeClass as w, createBlock as p, createCommentVNode as y, createElementVNode as d, computed as _, createVNode as V, normalizeProps as fe, guardReactiveProps as me, withCtx as f, Transition as A, mergeModels as C, useModel as B, useId as q, useTemplateRef as L, mergeProps as $, unref as n, inject as ve, Fragment as I, ref as U, onMounted as O, withDirectives as X, renderList as D, vModelSelect as he, vModelText as pe, vModelRadio as be, resolveDynamicComponent as ye, nextTick as ge, normalizeStyle as N, Teleport as Z, TransitionGroup as we, withModifiers as ke } from "vue";
4
4
  import './assets/main.css';function $e(e, ...t) {
5
5
  let o = [];
6
6
  const l = ce(t);
@@ -10,7 +10,7 @@ import './assets/main.css';function $e(e, ...t) {
10
10
  function s() {
11
11
  e.classList.remove(...o);
12
12
  }
13
- return A(
13
+ return T(
14
14
  l,
15
15
  () => {
16
16
  s(), a();
@@ -27,7 +27,7 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
27
27
  },
28
28
  setup(e) {
29
29
  return (t, o) => (i(), u("label", xe, [
30
- p(t.$slots, "default", {}, () => [
30
+ b(t.$slots, "default", {}, () => [
31
31
  z(k(e.text), 1)
32
32
  ])
33
33
  ]));
@@ -39,7 +39,7 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
39
39
  },
40
40
  setup(e) {
41
41
  return (t, o) => (i(), u("div", _e, [
42
- p(t.$slots, "default", {}, () => [
42
+ b(t.$slots, "default", {}, () => [
43
43
  z(k(e.text), 1)
44
44
  ])
45
45
  ]));
@@ -69,14 +69,14 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
69
69
  "dai-form-control__input-group--invalid": e.invalid
70
70
  }])
71
71
  }, [
72
- e.label ? (i(), h(F, {
72
+ e.label ? (i(), p(F, {
73
73
  key: 0,
74
74
  text: e.label,
75
75
  for: e.labelFor,
76
76
  class: "dai-form-control__input-group__label"
77
77
  }, null, 8, ["text", "for"])) : y("", !0),
78
78
  d("div", Be, [
79
- p(t.$slots, "default")
79
+ b(t.$slots, "default")
80
80
  ])
81
81
  ], 2));
82
82
  }
@@ -85,7 +85,6 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
85
85
  class: "dai-form-control__validation-message",
86
86
  role: "alert"
87
87
  }, S = /* @__PURE__ */ v({
88
- inheritAttrs: !1,
89
88
  __name: "formControl",
90
89
  props: {
91
90
  labelPosition: { default: "above" },
@@ -112,7 +111,7 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
112
111
  "dai-form-control--lg": l.value === "large"
113
112
  }])
114
113
  }, [
115
- e.label && e.labelPosition !== "inside" ? (i(), h(F, {
114
+ e.label && e.labelPosition !== "inside" ? (i(), p(F, {
116
115
  key: 0,
117
116
  for: e.labelFor,
118
117
  text: e.label
@@ -124,18 +123,18 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
124
123
  variant: o.value,
125
124
  size: l.value
126
125
  })), {
127
- default: c(() => [
128
- p(a.$slots, "default")
126
+ default: f(() => [
127
+ b(a.$slots, "default")
129
128
  ]),
130
129
  _: 3
131
130
  }, 16),
132
- e.hint ? (i(), h(H, {
131
+ e.hint ? (i(), p(H, {
133
132
  key: 0,
134
133
  text: e.hint,
135
134
  class: "dai-form-control__hint"
136
135
  }, null, 8, ["text"])) : y("", !0),
137
- V(P, { name: "dai-form-control__validation-message-transition" }, {
138
- default: c(() => [
136
+ V(A, { name: "dai-form-control__validation-message-transition" }, {
137
+ default: f(() => [
139
138
  e.validationMessage ? (i(), u("div", Ce, [
140
139
  s[0] || (s[0] = d("svg", {
141
140
  xmlns: "http://www.w3.org/2000/svg",
@@ -182,31 +181,31 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
182
181
  }),
183
182
  emits: ["update:modelValue"],
184
183
  setup(e) {
185
- const t = e, o = B(e, "modelValue"), l = t.id || q(), a = L("formElement"), { isValid: s, validationMessage: r } = T(
184
+ const t = e, o = B(e, "modelValue"), l = t.id || q(), a = L("formElement"), { isValid: s, validationMessage: r, validate: g } = P(
186
185
  a,
187
186
  t.validators,
188
187
  t.showValidationError
189
188
  );
190
- return (g, b) => (i(), h(S, $(t, {
189
+ return T(o, () => g(), { flush: "post" }), (h, m) => (i(), p(S, $(t, {
191
190
  labelFor: n(l),
192
191
  validationMessage: e.showValidationError ? "" : n(r),
193
192
  invalid: !n(s),
194
- class: g.$attrs.class
193
+ class: h.$attrs.class
195
194
  }), {
196
- default: c(() => [
197
- V(n(te), $({ ...g.$attrs, class: void 0, required: void 0 }, {
195
+ default: f(() => [
196
+ V(n(te), $({ ...h.$attrs, class: void 0, required: void 0 }, {
198
197
  id: n(l),
199
198
  modelValue: o.value,
200
- "onUpdate:modelValue": b[0] || (b[0] = (f) => o.value = f)
199
+ "onUpdate:modelValue": m[0] || (m[0] = (c) => o.value = c)
201
200
  }), {
202
- default: c(() => [
201
+ default: f(() => [
203
202
  d("input", $({
204
203
  ref_key: "formElement",
205
204
  ref: a,
206
205
  type: "text",
207
206
  value: o.value
208
- }, { required: g.$attrs.required }, { class: "dai-combobox__stab-input" }), null, 16, Ee),
209
- p(g.$slots, "default")
207
+ }, { required: h.$attrs.required }, { class: "dai-combobox__stab-input" }), null, 16, Ee),
208
+ b(h.$slots, "default")
210
209
  ]),
211
210
  _: 3
212
211
  }, 16, ["id", "modelValue"])
@@ -217,9 +216,9 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
217
216
  }), kt = /* @__PURE__ */ v({
218
217
  __name: "comboboxInput",
219
218
  setup(e) {
220
- return (t, o) => (i(), h(n(oe), { class: "dai-form-control__input-group__control" }, {
221
- default: c(() => [
222
- p(t.$slots, "default")
219
+ return (t, o) => (i(), p(n(oe), { class: "dai-form-control__input-group__control" }, {
220
+ default: f(() => [
221
+ b(t.$slots, "default")
223
222
  ]),
224
223
  _: 3
225
224
  }));
@@ -245,7 +244,7 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
245
244
  type: "button",
246
245
  class: "dai-form-control__input-group__control dai-combobox-btn"
247
246
  }), [
248
- p(l.$slots, "default", {}, () => [
247
+ b(l.$slots, "default", {}, () => [
249
248
  n(t).displayValue.value ? (i(), u(I, { key: 1 }, [
250
249
  z(k(n(t).displayValue), 1)
251
250
  ], 64)) : (i(), u("span", Le, k(e.placeholder || "Select..."), 1)),
@@ -268,14 +267,14 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
268
267
  }), Te = /* @__PURE__ */ v({
269
268
  __name: "comboboxOptions",
270
269
  setup(e) {
271
- return (t, o) => (i(), h(P, {
270
+ return (t, o) => (i(), p(A, {
272
271
  "enter-from-class": "dai-combobox-options--anim",
273
272
  "leave-to-class": "dai-combobox-options--anim"
274
273
  }, {
275
- default: c(() => [
274
+ default: f(() => [
276
275
  V(n(le), { class: "dai-combobox-options" }, {
277
- default: c(() => [
278
- p(t.$slots, "default")
276
+ default: f(() => [
277
+ b(t.$slots, "default")
279
278
  ]),
280
279
  _: 3
281
280
  })
@@ -283,27 +282,27 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
283
282
  _: 3
284
283
  }));
285
284
  }
286
- }), Ae = {
285
+ }), Pe = {
287
286
  key: 0,
288
287
  class: "dai-combobox-option__check",
289
288
  xmlns: "http://www.w3.org/2000/svg",
290
289
  viewBox: "0 0 16 16"
291
- }, Pe = /* @__PURE__ */ v({
290
+ }, Ae = /* @__PURE__ */ v({
292
291
  __name: "comboboxOption",
293
292
  props: {
294
293
  value: {}
295
294
  },
296
295
  setup(e) {
297
- return (t, o) => (i(), h(n(ie), {
296
+ return (t, o) => (i(), p(n(ie), {
298
297
  value: e.value,
299
298
  class: "dai-combobox-option"
300
299
  }, {
301
- default: c(({ isActive: l, isSelected: a }) => [
302
- p(t.$slots, "default", {
300
+ default: f(({ isActive: l, isSelected: a }) => [
301
+ b(t.$slots, "default", {
303
302
  isActive: l,
304
303
  isSelected: a
305
304
  }),
306
- a ? (i(), u("svg", Ae, [...o[0] || (o[0] = [
305
+ a ? (i(), u("svg", Pe, [...o[0] || (o[0] = [
307
306
  d("path", {
308
307
  fill: "currentColor",
309
308
  "fill-rule": "evenodd",
@@ -328,7 +327,7 @@ const xe = { class: "dai-label" }, F = /* @__PURE__ */ v({
328
327
  };
329
328
  function Fe(e, t) {
330
329
  return i(), u("button", Oe, [
331
- p(e.$slots, "default")
330
+ b(e.$slots, "default")
332
331
  ]);
333
332
  }
334
333
  const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern", "title", "autocomplete", "value"], Ne = {
@@ -382,20 +381,20 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
382
381
  set(M) {
383
382
  return r.value && (r.value.files = M), M;
384
383
  }
385
- }), r = L("formElement"), { isValid: g, validationMessage: b, validate: f } = T(
384
+ }), r = L("formElement"), { isValid: g, validationMessage: h, validate: m } = P(
386
385
  r,
387
386
  t.validators,
388
387
  t.showValidationError
389
- ), m = U(!1);
390
- A(a, () => {
388
+ ), c = U(!1);
389
+ T(a, () => {
391
390
  s.value = r.value?.files || null;
392
391
  });
393
392
  let x;
394
- const j = _(() => t.type === "password" ? m.value ? "text" : "password" : t.type), Y = _(() => t.mask ? t.mask : t.type === "tel" ? {
393
+ const j = _(() => t.type === "password" ? c.value ? "text" : "password" : t.type), Y = _(() => t.mask ? t.mask : t.type === "tel" ? {
395
394
  mask: "{+7} (000) 000-00-00"
396
395
  } : t.mask), G = _(() => t.pattern ? t.pattern : t.type === "tel" ? "^\\+7 \\(9\\d{2}\\) \\d{3}-\\d{2}-\\d{2}" : t.pattern), Q = _(() => t.title ? t.title : t.type === "tel" ? "+7 (999) 888-77-66" : t.title);
397
396
  function W() {
398
- m.value = !m.value;
397
+ c.value = !c.value;
399
398
  }
400
399
  function J() {
401
400
  a.value = "";
@@ -415,14 +414,14 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
415
414
  a.value = x.value;
416
415
  });
417
416
  });
418
- }), (M, E) => (i(), h(S, $(t, {
417
+ }), (M, E) => (i(), p(S, $(t, {
419
418
  "label-for": n(o),
420
- "validation-message": e.showValidationError ? "" : n(b),
419
+ "validation-message": e.showValidationError ? "" : n(h),
421
420
  invalid: t.invalid || !n(g),
422
421
  class: M.$attrs.class
423
422
  }), {
424
- default: c(() => [
425
- p(M.$slots, "prepend"),
423
+ default: f(() => [
424
+ b(M.$slots, "prepend"),
426
425
  d("input", $({
427
426
  ref_key: "formElement",
428
427
  ref: r
@@ -434,16 +433,16 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
434
433
  autocomplete: l.value,
435
434
  value: a.value,
436
435
  onInputPassive: ee,
437
- onKeyupPassive: E[0] || (E[0] = (yt) => !n(g) && n(f)()),
436
+ onKeyupPassive: E[0] || (E[0] = (yt) => !n(g) && n(m)()),
438
437
  class: "dai-form-control__input-group__control dai-form-control__input"
439
438
  }), null, 16, Se),
440
- p(M.$slots, "append"),
441
- t.type === "password" && a.value ? (i(), h(K, {
439
+ b(M.$slots, "append"),
440
+ t.type === "password" && a.value ? (i(), p(K, {
442
441
  key: 0,
443
442
  onClick: W
444
443
  }, {
445
- default: c(() => [
446
- m.value ? (i(), u("svg", Ue, [...E[2] || (E[2] = [
444
+ default: f(() => [
445
+ c.value ? (i(), u("svg", Ue, [...E[2] || (E[2] = [
447
446
  d("path", {
448
447
  "stroke-linecap": "round",
449
448
  "stroke-linejoin": "round",
@@ -467,11 +466,11 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
467
466
  ]),
468
467
  _: 1
469
468
  })) : y("", !0),
470
- e.clearable && a.value && !t.disabled ? (i(), h(K, {
469
+ e.clearable && a.value && !t.disabled ? (i(), p(K, {
471
470
  key: 1,
472
471
  onClick: J
473
472
  }, {
474
- default: c(() => [...E[3] || (E[3] = [
473
+ default: f(() => [...E[3] || (E[3] = [
475
474
  d("svg", {
476
475
  xmlns: "http://www.w3.org/2000/svg",
477
476
  fill: "none",
@@ -522,36 +521,36 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
522
521
  }),
523
522
  emits: ["update:modelValue"],
524
523
  setup(e) {
525
- const t = e, o = t.id || q(), l = B(e, "modelValue"), a = L("formElement"), { isValid: s, validationMessage: r, validate: g } = T(
524
+ const t = e, o = t.id || q(), l = B(e, "modelValue"), a = L("formElement"), { isValid: s, validationMessage: r, validate: g } = P(
526
525
  a,
527
526
  t.validators,
528
527
  t.showValidationError
529
528
  );
530
- return (b, f) => (i(), h(S, $(t, {
529
+ return (h, m) => (i(), p(S, $(t, {
531
530
  "label-for": n(o),
532
531
  "validation-message": e.showValidationError ? "" : n(r),
533
532
  invalid: t.invalid || !n(s),
534
- class: b.$attrs.class
533
+ class: h.$attrs.class
535
534
  }), {
536
- default: c(() => [
535
+ default: f(() => [
537
536
  X(d("select", $({
538
537
  ref_key: "formElement",
539
538
  ref: a
540
- }, { ...b.$attrs, class: void 0 }, {
539
+ }, { ...h.$attrs, class: void 0 }, {
541
540
  id: n(o),
542
- "onUpdate:modelValue": f[0] || (f[0] = (m) => l.value = m),
541
+ "onUpdate:modelValue": m[0] || (m[0] = (c) => l.value = c),
543
542
  class: "dai-form-control__input-group__control dai-select"
544
543
  }), [
545
- p(b.$slots, "default", {}, () => [
546
- (i(!0), u(I, null, D(e.options, (m) => (i(), u("option", {
547
- value: m[e.optionValue],
548
- key: m[e.optionValue]
549
- }, k(m[e.optionText]), 9, De))), 128))
544
+ b(h.$slots, "default", {}, () => [
545
+ (i(!0), u(I, null, D(e.options, (c) => (i(), u("option", {
546
+ value: c[e.optionValue],
547
+ key: c[e.optionValue]
548
+ }, k(c[e.optionText]), 9, De))), 128))
550
549
  ])
551
550
  ], 16, Xe), [
552
551
  [he, l.value]
553
552
  ]),
554
- f[1] || (f[1] = d("svg", {
553
+ m[1] || (m[1] = d("svg", {
555
554
  class: "dai-select__chevron",
556
555
  xmlns: "http://www.w3.org/2000/svg",
557
556
  viewBox: "0 0 16 16"
@@ -598,20 +597,20 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
598
597
  emits: ["update:modelValue"],
599
598
  setup(e) {
600
599
  const t = e, o = B(e, "modelValue");
601
- return (l, a) => (i(), h(n(ze), $(t, {
600
+ return (l, a) => (i(), p(n(ze), $(t, {
602
601
  displayValue: (s) => e.options.find((r) => r[e.optionValue] === s)?.[e.optionText] || "",
603
602
  modelValue: o.value,
604
603
  "onUpdate:modelValue": a[0] || (a[0] = (s) => o.value = s)
605
604
  }), {
606
- default: c(() => [
605
+ default: f(() => [
607
606
  V(n(qe), { placeholder: e.placeholder }, null, 8, ["placeholder"]),
608
607
  V(n(Te), null, {
609
- default: c(() => [
610
- (i(!0), u(I, null, D(e.options, (s) => (i(), h(n(Pe), {
608
+ default: f(() => [
609
+ (i(!0), u(I, null, D(e.options, (s) => (i(), p(n(Ae), {
611
610
  key: s[e.optionValue],
612
611
  value: s[e.optionValue]
613
612
  }, {
614
- default: c(() => [
613
+ default: f(() => [
615
614
  z(k(s[e.optionText]), 1)
616
615
  ]),
617
616
  _: 2
@@ -637,31 +636,31 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
637
636
  }),
638
637
  emits: ["update:modelValue"],
639
638
  setup(e) {
640
- const t = e, o = t.id || q(), l = B(e, "modelValue"), a = L("formElement"), { isValid: s, validationMessage: r, validate: g } = T(
639
+ const t = e, o = t.id || q(), l = B(e, "modelValue"), a = L("formElement"), { isValid: s, validationMessage: r, validate: g } = P(
641
640
  a,
642
641
  t.validators,
643
642
  t.showValidationError
644
643
  );
645
- function b() {
644
+ function h() {
646
645
  if (!t.autosize) return;
647
- const f = a.value, m = f.offsetHeight - f.clientHeight;
648
- f.style.height = "auto", f.style.height = `${f.scrollHeight + m}px`;
646
+ const m = a.value, c = m.offsetHeight - m.clientHeight;
647
+ m.style.height = "auto", m.style.height = `${m.scrollHeight + c}px`;
649
648
  }
650
- return O(b), (f, m) => (i(), h(S, $(t, {
649
+ return O(h), (m, c) => (i(), p(S, $(t, {
651
650
  "label-for": n(o),
652
651
  "validation-message": e.showValidationError ? "" : n(r),
653
652
  invalid: !n(s),
654
- class: f.$attrs.class
653
+ class: m.$attrs.class
655
654
  }), {
656
- default: c(() => [
655
+ default: f(() => [
657
656
  X(d("textarea", $({
658
657
  ref_key: "formElement",
659
658
  ref: a
660
- }, { ...f.$attrs, class: void 0 }, {
659
+ }, { ...m.$attrs, class: void 0 }, {
661
660
  id: n(o),
662
- "onUpdate:modelValue": m[0] || (m[0] = (x) => l.value = x),
663
- onKeyupPassive: m[1] || (m[1] = (x) => !n(s) && n(g)()),
664
- onInputPassive: b,
661
+ "onUpdate:modelValue": c[0] || (c[0] = (x) => l.value = x),
662
+ onKeyupPassive: c[1] || (c[1] = (x) => !n(s) && n(g)()),
663
+ onInputPassive: h,
665
664
  class: ["form-control__textarea", {
666
665
  "form-control__textarea--autosize": e.autosize
667
666
  }]
@@ -693,13 +692,13 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
693
692
  }),
694
693
  emits: ["update:modelValue"],
695
694
  setup(e) {
696
- const t = e, o = t.id || q(), l = t.value || o, a = B(e, "modelValue"), s = L("formElement"), { isValid: r } = T(
695
+ const t = e, o = t.id || q(), l = t.value || o, a = B(e, "modelValue"), s = L("formElement"), { isValid: r } = P(
697
696
  s,
698
697
  t.validators,
699
698
  t.showValidationError
700
699
  ), g = _(() => Array.isArray(a.value) ? a.value.includes(l) : a.value);
701
- function b(f) {
702
- const x = f.target.checked;
700
+ function h(m) {
701
+ const x = m.target.checked;
703
702
  if (Array.isArray(a.value))
704
703
  if (x)
705
704
  a.value.push(l);
@@ -710,15 +709,15 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
710
709
  else
711
710
  a.value = x;
712
711
  }
713
- return (f, m) => (i(), u("div", {
714
- class: w(["dai-checkbox-control", f.$attrs.class])
712
+ return (m, c) => (i(), u("div", {
713
+ class: w(["dai-checkbox-control", m.$attrs.class])
715
714
  }, [
716
715
  d("input", $({
717
716
  ref_key: "formElement",
718
717
  ref: s
719
- }, { ...f.$attrs, class: "" }, {
718
+ }, { ...m.$attrs, class: "" }, {
720
719
  checked: g.value,
721
- onChange: b,
720
+ onChange: h,
722
721
  id: n(o),
723
722
  type: "checkbox",
724
723
  class: ["dai-checkbox", {
@@ -728,25 +727,25 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
728
727
  "dai-checkbox--lg": e.size === "large"
729
728
  }]
730
729
  }), null, 16, Ye),
731
- e.label || f.$slots.default ? (i(), u("div", Ke, [
730
+ e.label || m.$slots.default ? (i(), u("div", Ke, [
732
731
  V(F, {
733
732
  for: n(o),
734
733
  class: "dai-checkbox-control__label"
735
734
  }, {
736
- default: c(() => [
737
- p(f.$slots, "default", {}, () => [
735
+ default: f(() => [
736
+ b(m.$slots, "default", {}, () => [
738
737
  z(k(e.label), 1)
739
738
  ])
740
739
  ]),
741
740
  _: 3
742
741
  }, 8, ["for"])
743
742
  ])) : y("", !0),
744
- e.hint || f.$slots.hint ? (i(), h(H, {
743
+ e.hint || m.$slots.hint ? (i(), p(H, {
745
744
  key: 1,
746
745
  class: "dai-checkbox-control__hint"
747
746
  }, {
748
- default: c(() => [
749
- p(f.$slots, "hint", {}, () => [
747
+ default: f(() => [
748
+ b(m.$slots, "hint", {}, () => [
750
749
  z(k(e.hint), 1)
751
750
  ])
752
751
  ]),
@@ -776,7 +775,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
776
775
  }),
777
776
  emits: ["update:modelValue"],
778
777
  setup(e) {
779
- const t = e, o = B(e, "modelValue"), l = q(), a = L("formElement"), { isValid: s } = T(
778
+ const t = e, o = B(e, "modelValue"), l = q(), a = L("formElement"), { isValid: s } = P(
780
779
  a,
781
780
  t.validators,
782
781
  t.showValidationError
@@ -789,7 +788,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
789
788
  type: "radio",
790
789
  ref_key: "formElement",
791
790
  ref: a,
792
- "onUpdate:modelValue": g[0] || (g[0] = (b) => o.value = b)
791
+ "onUpdate:modelValue": g[0] || (g[0] = (h) => o.value = h)
793
792
  }, { ...r.$attrs, class: "" }, {
794
793
  value: e.value,
795
794
  id: n(l),
@@ -837,23 +836,23 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
837
836
  class: "dai-switch__thumb"
838
837
  }, null, -1)
839
838
  ])], 10, et),
840
- e.label || l.$slots.default ? (i(), h(F, {
839
+ e.label || l.$slots.default ? (i(), p(F, {
841
840
  key: 0,
842
841
  for: n(o)
843
842
  }, {
844
- default: c(() => [
845
- p(l.$slots, "default", {}, () => [
843
+ default: f(() => [
844
+ b(l.$slots, "default", {}, () => [
846
845
  z(k(e.label), 1)
847
846
  ])
848
847
  ]),
849
848
  _: 3
850
849
  }, 8, ["for"])) : y("", !0),
851
- e.hint || l.$slots.hint ? (i(), h(H, {
850
+ e.hint || l.$slots.hint ? (i(), p(H, {
852
851
  key: 1,
853
852
  class: "dai-switch-control__hint"
854
853
  }, {
855
- default: c(() => [
856
- p(l.$slots, "hint", {}, () => [
854
+ default: f(() => [
855
+ b(l.$slots, "hint", {}, () => [
857
856
  z(k(e.hint), 1)
858
857
  ])
859
858
  ]),
@@ -887,7 +886,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
887
886
  },
888
887
  setup(e) {
889
888
  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"), a = _(() => t.size ? t.size : t.sm ? "small" : t.lg ? "large" : "medium");
890
- return (s, r) => (i(), h(ye(e.href ? "a" : "button"), {
889
+ return (s, r) => (i(), p(ye(e.href ? "a" : "button"), {
891
890
  type: e.href ? void 0 : o.value,
892
891
  form: typeof e.submit == "string" ? e.submit : void 0,
893
892
  href: e.href,
@@ -905,7 +904,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
905
904
  "dai-btn--condensed": e.condensed
906
905
  }])
907
906
  }, {
908
- default: c(() => [
907
+ default: f(() => [
909
908
  e.loading ? (i(), u("span", tt, [...r[0] || (r[0] = [
910
909
  d("svg", {
911
910
  xmlns: "http://www.w3.org/2000/svg",
@@ -932,7 +931,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
932
931
  key: 0,
933
932
  class: w([e.icon, "dai-btn__icon"])
934
933
  }, null, 2)) : y("", !0),
935
- p(s.$slots, "default"),
934
+ b(s.$slots, "default"),
936
935
  e.iconAfter ? (i(), u("div", {
937
936
  key: 1,
938
937
  class: w([e.iconAfter, "dai-btn__icon"])
@@ -945,14 +944,14 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
945
944
  }), zt = /* @__PURE__ */ v({
946
945
  __name: "popoverDialog",
947
946
  setup(e) {
948
- return (t, o) => (i(), h(P, {
947
+ return (t, o) => (i(), p(A, {
949
948
  "enter-from-class": "dai-popover-dialog--anim",
950
949
  "leave-to-class": "dai-popover-dialog--anim"
951
950
  }, {
952
- default: c(() => [
951
+ default: f(() => [
953
952
  V(n(ne), { class: "dai-popover-dialog" }, {
954
- default: c(() => [
955
- p(t.$slots, "default")
953
+ default: f(() => [
954
+ b(t.$slots, "default")
956
955
  ]),
957
956
  _: 3
958
957
  })
@@ -963,14 +962,14 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
963
962
  }), Lt = /* @__PURE__ */ v({
964
963
  __name: "menuItems",
965
964
  setup(e) {
966
- return (t, o) => (i(), h(P, {
965
+ return (t, o) => (i(), p(A, {
967
966
  "enter-from-class": "dai-menu-items--anim",
968
967
  "leave-to-class": "dai-menu-items--anim"
969
968
  }, {
970
- default: c(() => [
969
+ default: f(() => [
971
970
  V(n(se), { class: "dai-menu-items" }, {
972
- default: c(() => [
973
- p(t.$slots, "default")
971
+ default: f(() => [
972
+ b(t.$slots, "default")
974
973
  ]),
975
974
  _: 3
976
975
  })
@@ -987,14 +986,14 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
987
986
  icon: {}
988
987
  },
989
988
  setup(e) {
990
- return (t, o) => (i(), h(n(re), { class: "dai-menu-item" }, {
991
- default: c(({ isActive: l, isSelected: a }) => [
989
+ return (t, o) => (i(), p(n(re), { class: "dai-menu-item" }, {
990
+ default: f(({ isActive: l, isSelected: a }) => [
992
991
  e.icon ? (i(), u("div", at, [
993
992
  d("div", {
994
993
  class: w(["h-5 w-5", e.icon])
995
994
  }, null, 2)
996
995
  ])) : y("", !0),
997
- p(t.$slots, "default", {
996
+ b(t.$slots, "default", {
998
997
  isActive: l,
999
998
  isSelected: a
1000
999
  })
@@ -1010,19 +1009,19 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1010
1009
  value: {}
1011
1010
  },
1012
1011
  setup(e) {
1013
- return (t, o) => (i(), h(n(de), {
1012
+ return (t, o) => (i(), p(n(de), {
1014
1013
  id: e.id,
1015
1014
  "aria-controls": e.ariaControls,
1016
1015
  value: e.value,
1017
1016
  class: "dai-tab"
1018
1017
  }, {
1019
- default: c(() => [
1020
- p(t.$slots, "default")
1018
+ default: f(() => [
1019
+ b(t.$slots, "default")
1021
1020
  ]),
1022
1021
  _: 3
1023
1022
  }, 8, ["id", "aria-controls", "value"]));
1024
1023
  }
1025
- }), At = /* @__PURE__ */ v({
1024
+ }), Pt = /* @__PURE__ */ v({
1026
1025
  __name: "tabList",
1027
1026
  setup(e) {
1028
1027
  const t = L("tablist"), o = L("slider"), l = U({});
@@ -1037,25 +1036,25 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1037
1036
  transition: o.value.offsetLeft > r.offsetLeft ? "left .2s, right .5s" : "left .5s, right .2s"
1038
1037
  });
1039
1038
  }
1040
- return O(() => ge(a)), (s, r) => (i(), h(n(ue), {
1039
+ return O(() => ge(a)), (s, r) => (i(), p(n(ue), {
1041
1040
  ref_key: "tablist",
1042
1041
  ref: t,
1043
1042
  onClickPassive: a,
1044
1043
  class: "dai-tab-list"
1045
1044
  }, {
1046
- default: c(() => [
1045
+ default: f(() => [
1047
1046
  d("div", {
1048
1047
  ref_key: "slider",
1049
1048
  ref: o,
1050
1049
  class: "dai-tab-list__slider",
1051
1050
  style: N(l.value)
1052
1051
  }, null, 4),
1053
- p(s.$slots, "default")
1052
+ b(s.$slots, "default")
1054
1053
  ]),
1055
1054
  _: 3
1056
1055
  }, 512));
1057
1056
  }
1058
- }), lt = ["id"], Pt = /* @__PURE__ */ v({
1057
+ }), lt = ["id"], At = /* @__PURE__ */ v({
1059
1058
  inheritAttrs: !1,
1060
1059
  __name: "offcanvas",
1061
1060
  props: /* @__PURE__ */ C({
@@ -1072,7 +1071,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1072
1071
  emits: ["update:modelValue"],
1073
1072
  setup(e) {
1074
1073
  const t = e, o = B(e, "modelValue"), l = t.id ?? q(), { classList: a } = $e(document.body, "nui-body-push");
1075
- A(o, () => {
1074
+ T(o, () => {
1076
1075
  if (!t.push || (a.splice(1), !o.value))
1077
1076
  return;
1078
1077
  let r = "nui-body-push--" + t.position;
@@ -1085,8 +1084,8 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1085
1084
  window.addEventListener("click", s, { passive: !0 });
1086
1085
  }), R(() => {
1087
1086
  window.removeEventListener("click", s);
1088
- }), (r, g) => (i(), h(Z, { to: "body" }, [
1089
- V(P, {
1087
+ }), (r, g) => (i(), p(Z, { to: "body" }, [
1088
+ V(A, {
1090
1089
  appear: "",
1091
1090
  "enter-from-class": "nui-offcanvas--animate-hidden",
1092
1091
  "enter-to-class": "nui-offcanvas--animate-shown",
@@ -1095,7 +1094,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1095
1094
  "leave-to-class": "nui-offcanvas--animate-hidden",
1096
1095
  "leave-active-class": "ease-in-out"
1097
1096
  }, {
1098
- default: c(() => [
1097
+ default: f(() => [
1099
1098
  o.value ? (i(), u("div", $({
1100
1099
  key: 0,
1101
1100
  id: n(l)
@@ -1107,7 +1106,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1107
1106
  "nui-offcanvas--xl": e.xl
1108
1107
  }]
1109
1108
  }), [
1110
- p(r.$slots, "default")
1109
+ b(r.$slots, "default")
1111
1110
  ], 16, lt)) : y("", !0)
1112
1111
  ]),
1113
1112
  _: 3
@@ -1169,7 +1168,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1169
1168
  function a() {
1170
1169
  clearTimeout(l), o.value && t.timeout && (l = setTimeout(() => o.value = !1, t.timeout));
1171
1170
  }
1172
- return A(o, a, { immediate: !0 }), (s, r) => o.value ? (i(), u("div", it, [
1171
+ return T(o, a, { immediate: !0 }), (s, r) => o.value ? (i(), u("div", it, [
1173
1172
  d("div", {
1174
1173
  class: w(["dai-notification", [`dai-notification--${e.color || "secondary"}`]])
1175
1174
  }, [
@@ -1230,19 +1229,19 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1230
1229
  function s() {
1231
1230
  o.value.length === 0 || l.value.length >= t.length || (l.value.push({ ...o.value[0], id: a++, show: !0 }), o.value.shift());
1232
1231
  }
1233
- function r(b) {
1232
+ function r(h) {
1234
1233
  setTimeout(() => {
1235
1234
  l.value = l.value.filter(
1236
- (f) => f.id !== b
1235
+ (m) => m.id !== h
1237
1236
  ), s();
1238
1237
  }, 200);
1239
1238
  }
1240
- A(o, s, { immediate: !0, deep: !0 });
1239
+ T(o, s, { immediate: !0, deep: !0 });
1241
1240
  const g = _(() => {
1242
- const b = ["dai-notification-queue__item--anim"];
1243
- 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(" ");
1241
+ const h = ["dai-notification-queue__item--anim"];
1242
+ return t.positionX === "right" ? h.push("dai-notification-queue__item--anim-x-right") : t.positionX === "left" ? h.push("dai-notification-queue__item--anim-x-left") : t.positionX === "center" && t.positionY === "top" ? h.push("dai-notification-queue__item--anim-y-top") : t.positionX === "center" && t.positionY === "bottom" && h.push("dai-notification-queue__item--anim-y-bottom"), h.join(" ");
1244
1243
  });
1245
- return (b, f) => (i(), u("div", {
1244
+ return (h, m) => (i(), u("div", {
1246
1245
  class: w(["dai-notification-queue", {
1247
1246
  "dai-notification-queue--fixed": e.position == "fixed",
1248
1247
  "dai-notification-queue--absolute": e.position == "absolute",
@@ -1260,16 +1259,16 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1260
1259
  "leave-to-class": g.value,
1261
1260
  "leave-active-class": "dai-notification-queue__item--anim-out"
1262
1261
  }, {
1263
- default: c(() => [
1264
- (i(!0), u(I, null, D(l.value, (m) => (i(), h(mt, {
1265
- key: m.id,
1266
- color: m.color,
1267
- icon: m.type,
1268
- message: m.message,
1269
- detail: m.detail,
1270
- timeout: m.timeout ?? e.timeout,
1271
- modelValue: m.show,
1272
- "onUpdate:modelValue": [(x) => m.show = x, (x) => r(m.id)],
1262
+ default: f(() => [
1263
+ (i(!0), u(I, null, D(l.value, (c) => (i(), p(mt, {
1264
+ key: c.id,
1265
+ color: c.color,
1266
+ icon: c.type,
1267
+ message: c.message,
1268
+ detail: c.detail,
1269
+ timeout: c.timeout ?? e.timeout,
1270
+ modelValue: c.show,
1271
+ "onUpdate:modelValue": [(x) => c.show = x, (x) => r(c.id)],
1273
1272
  class: "dai-notification-queue__item"
1274
1273
  }, null, 8, ["color", "icon", "message", "detail", "timeout", "modelValue", "onUpdate:modelValue"]))), 128))
1275
1274
  ]),
@@ -1331,15 +1330,15 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1331
1330
  function o() {
1332
1331
  t.value = !1;
1333
1332
  }
1334
- return A(t, (l) => {
1333
+ return T(t, (l) => {
1335
1334
  l ? document.body.classList.add("overflow-hidden") : document.body.classList.remove("overflow-hidden");
1336
- }), (l, a) => (i(), h(Z, { to: "body" }, [
1337
- V(P, {
1335
+ }), (l, a) => (i(), p(Z, { to: "body" }, [
1336
+ V(A, {
1338
1337
  appear: "",
1339
1338
  name: "modal",
1340
1339
  duration: { enter: 300, leave: 200 }
1341
1340
  }, {
1342
- default: c(() => [
1341
+ default: f(() => [
1343
1342
  t.value ? (i(), u("div", ht, [
1344
1343
  a[0] || (a[0] = d("div", {
1345
1344
  class: "modal__backdrop fixed inset-0 bg-primary-50/60 backdrop-blur-sm",
@@ -1351,7 +1350,7 @@ const K = /* @__PURE__ */ je(Ie, [["render", Fe]]), Se = ["id", "type", "pattern
1351
1350
  class: "min-h-full flex items-center justify-center p-4 sm:p-6"
1352
1351
  }, [
1353
1352
  d("div", bt, [
1354
- p(l.$slots, "default", { close: o })
1353
+ b(l.$slots, "default", { close: o })
1355
1354
  ])
1356
1355
  ])
1357
1356
  ])
@@ -1368,7 +1367,7 @@ export {
1368
1367
  ze as Combobox,
1369
1368
  qe as ComboboxButton,
1370
1369
  kt as ComboboxInput,
1371
- Pe as ComboboxOption,
1370
+ Ae as ComboboxOption,
1372
1371
  Te as ComboboxOptions,
1373
1372
  H as Hint,
1374
1373
  $t as Input,
@@ -1379,7 +1378,7 @@ export {
1379
1378
  Ot as Modal,
1380
1379
  mt as Notification,
1381
1380
  jt as NotificationQueue,
1382
- Pt as Offcanvas,
1381
+ At as Offcanvas,
1383
1382
  Ut as Popover,
1384
1383
  zt as PopoverDialog,
1385
1384
  It as Progressbar,
@@ -1389,7 +1388,7 @@ export {
1389
1388
  Ct as Switch,
1390
1389
  Tt as Tab,
1391
1390
  Xt as TabContainer,
1392
- At as TabList,
1391
+ Pt as TabList,
1393
1392
  Dt as TabPanel,
1394
1393
  Bt as Textarea,
1395
1394
  $e as useClassList
@@ -1,3 +1,7 @@
1
1
  import { PresetWind4Options } from "@unocss/preset-wind4";
2
- declare const _default: import("@unocss/core").PresetFactory<object, PresetWind4Options>;
2
+ import { presetAttributify } from "@unocss/preset-attributify";
3
+ type PresetDaiUiOptions = PresetWind4Options & {
4
+ attributify?: Parameters<typeof presetAttributify>[0];
5
+ };
6
+ declare const _default: import("@unocss/core").PresetFactory<object, PresetDaiUiOptions>;
3
7
  export default _default;
@@ -1,24 +1,25 @@
1
1
  import { definePreset as t } from "@unocss/core";
2
2
  import { theme as r, presetWind4 as s } from "@unocss/preset-wind4";
3
3
  import { presetAttributify as i } from "@unocss/preset-attributify";
4
- import { presetIcons as n } from "@unocss/preset-icons";
5
- import a from "@unocss/transformer-variant-group";
4
+ import { presetIcons as a } from "@unocss/preset-icons";
5
+ import n from "@unocss/transformer-variant-group";
6
6
  import c from "@unocss/transformer-directives";
7
- const y = t((o) => ({
7
+ const y = t((e) => ({
8
8
  presets: [
9
9
  //presetWind(options),
10
- s(o),
10
+ s(e),
11
11
  //presetForms(),
12
12
  i({
13
13
  prefix: "un-",
14
- prefixedOnly: !0
14
+ prefixedOnly: !0,
15
+ ...e?.attributify
15
16
  }),
16
- n({
17
+ a({
17
18
  scale: 1.2,
18
19
  warn: !0
19
20
  })
20
21
  ],
21
- transformers: [a(), c()],
22
+ transformers: [n(), c()],
22
23
  theme: {
23
24
  colors: {
24
25
  primary: r.colors.indigo,
@@ -122,8 +123,8 @@ const y = t((o) => ({
122
123
  active: "active=true"
123
124
  }
124
125
  },
125
- extendTheme: (e) => {
126
- e.colors.dark = e.colors.slate;
126
+ extendTheme: (o) => {
127
+ o.colors.dark = o.colors.slate;
127
128
  },
128
129
  name: "dai-ui-preset"
129
130
  // it supports most of the configuration you could have in the root config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defaultusr/dai-ui",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"