@volverjs/ui-vue 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +17 -0
  2. package/dist/components/VvButton/VvButton.es.js +159 -147
  3. package/dist/components/VvButton/VvButton.umd.js +1 -1
  4. package/dist/components/VvButton/VvButton.vue.d.ts +0 -8
  5. package/dist/components/VvButton/index.d.ts +4 -4
  6. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +36 -37
  7. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  8. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -10
  9. package/dist/components/VvButtonGroup/index.d.ts +5 -5
  10. package/dist/components/VvCombobox/VvCombobox.es.js +526 -345
  11. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  12. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -0
  13. package/dist/components/VvCombobox/index.d.ts +13 -1
  14. package/dist/components/VvDropdown/VvDropdown.es.js +118 -109
  15. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  16. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +19 -0
  17. package/dist/components/VvDropdown/index.d.ts +12 -0
  18. package/dist/components/VvInputText/VvInputText.es.js +221 -213
  19. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  20. package/dist/components/VvInputText/VvInputText.vue.d.ts +13 -13
  21. package/dist/components/VvInputText/index.d.ts +5 -5
  22. package/dist/components/VvSelect/VvSelect.es.js +186 -167
  23. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  24. package/dist/components/VvSelect/VvSelect.vue.d.ts +23 -11
  25. package/dist/components/VvSelect/index.d.ts +10 -17
  26. package/dist/components/VvTextarea/VvTextarea.es.js +112 -104
  27. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  28. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +12 -12
  29. package/dist/components/VvTextarea/index.d.ts +5 -5
  30. package/dist/components/index.es.js +1045 -975
  31. package/dist/components/index.umd.js +1 -1
  32. package/dist/composables/group/types/IButtonGroupState.d.ts +1 -1
  33. package/dist/composables/group/types/IGroupState.d.ts +1 -1
  34. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  35. package/dist/icons.es.js +3 -3
  36. package/dist/icons.umd.js +1 -1
  37. package/dist/index.es.js +1065 -995
  38. package/dist/index.umd.js +1 -1
  39. package/dist/props/index.d.ts +35 -4
  40. package/dist/resolvers/unplugin.es.js +26 -24
  41. package/dist/resolvers/unplugin.umd.js +1 -1
  42. package/dist/stories/Button/Button.settings.d.ts +9 -11
  43. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +9 -0
  44. package/dist/stories/Combobox/Combobox.settings.d.ts +19 -0
  45. package/dist/stories/Dropdown/Dropdown.settings.d.ts +10 -0
  46. package/dist/stories/InputText/InputText.settings.d.ts +23 -23
  47. package/dist/stories/Select/Select.settings.d.ts +42 -23
  48. package/dist/stories/Textarea/Textarea.settings.d.ts +23 -23
  49. package/dist/stories/argTypes.d.ts +50 -1
  50. package/package.json +5 -4
  51. package/src/assets/icons/detailed.json +1 -1
  52. package/src/assets/icons/normal.json +1 -1
  53. package/src/assets/icons/simple.json +1 -1
  54. package/src/components/VvButton/index.ts +28 -10
  55. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -1
  56. package/src/components/VvButtonGroup/index.ts +3 -6
  57. package/src/components/VvCombobox/VvCombobox.vue +45 -11
  58. package/src/components/VvCombobox/index.ts +6 -0
  59. package/src/components/VvDropdown/VvDropdown.vue +9 -6
  60. package/src/components/VvDropdown/index.ts +11 -1
  61. package/src/components/VvInputText/VvInputText.vue +10 -8
  62. package/src/components/VvSelect/VvSelect.vue +23 -1
  63. package/src/components/VvSelect/index.ts +8 -11
  64. package/src/components/VvTextarea/VvTextarea.vue +10 -8
  65. package/src/composables/group/types/IButtonGroupState.ts +1 -1
  66. package/src/composables/group/types/IGroupState.ts +1 -1
  67. package/src/composables/group/useInjectedGroupState.ts +3 -3
  68. package/src/composables/useTextCount.ts +1 -1
  69. package/src/props/index.ts +33 -15
  70. package/src/resolvers/unplugin.ts +22 -13
  71. package/src/stories/Button/Button.settings.ts +2 -7
  72. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +6 -1
  73. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +37 -0
  74. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +12 -1
  75. package/src/stories/Combobox/Combobox.settings.ts +5 -0
  76. package/src/stories/Combobox/Combobox.stories.mdx +51 -0
  77. package/src/stories/Combobox/Combobox.test.ts +7 -0
  78. package/src/stories/Dropdown/Dropdown.settings.ts +10 -1
  79. package/src/stories/Dropdown/Dropdown.stories.mdx +17 -0
  80. package/src/stories/Select/Select.settings.ts +9 -23
  81. package/src/stories/Select/Select.stories.mdx +60 -0
  82. package/src/stories/argTypes.ts +46 -22
@@ -1,28 +1,28 @@
1
- import { unref as i, toRefs as Y, computed as s, h as g, watch as Ae, defineComponent as H, ref as B, inject as Te, openBlock as I, createBlock as _, mergeProps as k, createCommentVNode as O, useSlots as Ce, onMounted as De, createElementBlock as z, normalizeClass as Pe, toDisplayString as oe, createElementVNode as ie, renderSlot as X, normalizeProps as M, guardReactiveProps as K, withDirectives as _e, isRef as Oe, vModelDynamic as Re, createTextVNode as He, createVNode as Le } from "vue";
2
- import { nanoid as xe } from "nanoid";
3
- import { toReactive as Me, useFocus as Ne } from "@vueuse/core";
4
- import { iconExists as N, Icon as Ve, addIcon as ke } from "@iconify/vue";
5
- function le(n, t) {
1
+ import { unref as l, toRefs as Y, computed as s, h as g, watch as pe, defineComponent as H, ref as $, inject as Ce, openBlock as E, createBlock as P, mergeProps as B, createCommentVNode as O, useSlots as De, createElementBlock as z, normalizeClass as Pe, toDisplayString as ie, createElementVNode as le, renderSlot as X, normalizeProps as N, guardReactiveProps as K, withDirectives as _e, isRef as Oe, vModelDynamic as Re, createTextVNode as He, createVNode as Le } from "vue";
2
+ import { toReactive as xe, useFocus as Ve, useElementVisibility as Ne } from "@vueuse/core";
3
+ import { nanoid as ke } from "nanoid";
4
+ import { iconExists as k, Icon as Me, addIcon as Be } from "@iconify/vue";
5
+ function oe(n, t) {
6
6
  if (n && Object.keys(n).length && t) {
7
7
  if (t.indexOf(".") === -1)
8
8
  return n[t];
9
9
  {
10
10
  const e = t.split(".");
11
- let o = n;
12
- for (let a = 0, p = e.length; a < p; ++a) {
11
+ let i = n;
12
+ for (let r = 0, p = e.length; r < p; ++r) {
13
13
  if (n == null)
14
14
  return null;
15
- o = o[e[a]];
15
+ i = i[e[r]];
16
16
  }
17
- return o;
17
+ return i;
18
18
  }
19
19
  } else
20
20
  return null;
21
21
  }
22
22
  function R(n) {
23
- return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(i(n));
23
+ return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(l(n));
24
24
  }
25
- function Be(n) {
25
+ function $e(n) {
26
26
  return typeof n == "string" || n instanceof String;
27
27
  }
28
28
  function se(n) {
@@ -32,37 +32,37 @@ function se(n) {
32
32
  /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
33
33
  )) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
34
34
  }
35
- function V(n) {
36
- return Array.isArray(n) ? n.filter((t) => Be(t)).join(" ") : n;
35
+ function M(n) {
36
+ return Array.isArray(n) ? n.filter((t) => $e(t)).join(" ") : n;
37
37
  }
38
- function $e(n, t) {
38
+ function Ue(n, t) {
39
39
  const {
40
40
  invalid: e,
41
- valid: o,
42
- hint: a,
41
+ valid: i,
42
+ hint: r,
43
43
  loading: p
44
44
  } = t, {
45
45
  hintLabel: u,
46
46
  modelValue: w,
47
47
  valid: h,
48
48
  validLabel: m,
49
- invalid: l,
49
+ invalid: o,
50
50
  invalidLabel: c,
51
51
  ...b
52
- } = Y(n), v = le(b, "loading"), S = le(b, "loadingLabel"), T = s(() => l.value ? !!(l.value && e || c != null && c.value && Array.isArray(c.value) && c.value.length > 0 || c != null && c.value && !R(c)) : !1), y = s(
53
- () => !!(u && u.value || a)
52
+ } = Y(n), v = oe(b, "loading"), S = oe(b, "loadingLabel"), T = s(() => o.value ? !!(o.value && e || c != null && c.value && Array.isArray(c.value) && c.value.length > 0 || c != null && c.value && !R(c)) : !1), y = s(
53
+ () => !!(u && u.value || r)
54
54
  ), C = s(
55
- () => !!(m && m.value || o)
56
- ), D = s(
57
- () => !!(v != null && v.value && p || v != null && v.value && (S != null && S.value))
55
+ () => !!(m && m.value || i)
58
56
  ), L = s(
59
- () => y.value || C.value || T.value || D.value
57
+ () => !!(v != null && v.value && p || v != null && v.value && (S != null && S.value))
58
+ ), _ = s(
59
+ () => y.value || C.value || T.value || L.value
60
60
  );
61
61
  return {
62
62
  hasInvalid: T,
63
63
  hasHint: y,
64
64
  hasValid: C,
65
- hasLoading: D,
65
+ hasLoading: L,
66
66
  HintSlot: {
67
67
  name: "HintSlot",
68
68
  props: {
@@ -72,25 +72,25 @@ function $e(n, t) {
72
72
  }
73
73
  },
74
74
  setup(x) {
75
- const $ = s(() => {
76
- const P = Me({
75
+ const V = s(() => {
76
+ const D = xe({
77
77
  hintLabel: u,
78
78
  modelValue: w,
79
79
  valid: h,
80
80
  validLabel: m,
81
- invalid: l,
81
+ invalid: o,
82
82
  invalidLabel: c,
83
83
  loading: v,
84
84
  loadingLabel: S,
85
85
  ...x.params
86
86
  });
87
- return l != null && l.value ? (e == null ? void 0 : e(P)) || V(c == null ? void 0 : c.value) || (u == null ? void 0 : u.value) : h != null && h.value ? (o == null ? void 0 : o(P)) || V(m == null ? void 0 : m.value) || (u == null ? void 0 : u.value) : v != null && v.value ? (p == null ? void 0 : p(P)) || V(S == null ? void 0 : S.value) || (u == null ? void 0 : u.value) : (a == null ? void 0 : a(P)) || V(u == null ? void 0 : u.value) || (u == null ? void 0 : u.value);
87
+ return o != null && o.value ? (e == null ? void 0 : e(D)) || M(c == null ? void 0 : c.value) || (u == null ? void 0 : u.value) : h != null && h.value ? (i == null ? void 0 : i(D)) || M(m == null ? void 0 : m.value) || (u == null ? void 0 : u.value) : v != null && v.value ? (p == null ? void 0 : p(D)) || M(S == null ? void 0 : S.value) || (u == null ? void 0 : u.value) : (r == null ? void 0 : r(D)) || M(u == null ? void 0 : u.value) || (u == null ? void 0 : u.value);
88
88
  });
89
89
  return {
90
- isVisible: L,
90
+ isVisible: _,
91
91
  hasInvalid: T,
92
92
  hasValid: C,
93
- hintContent: $
93
+ hintContent: V
94
94
  };
95
95
  },
96
96
  render() {
@@ -106,10 +106,10 @@ function $e(n, t) {
106
106
  }
107
107
  };
108
108
  }
109
- function Ue(n, t, e) {
110
- const o = s(
109
+ function We(n, t, e) {
110
+ const i = s(
111
111
  () => !!(n != null && n.value && t.value === "left" || e != null && e.iconLeft)
112
- ), a = s(
112
+ ), r = s(
113
113
  () => !!(n != null && n.value && t.value === "right" || e != null && e.iconRight)
114
114
  ), p = s(
115
115
  () => !!(n != null && n.value && t.value === "top" || e != null && e.iconTop)
@@ -118,50 +118,50 @@ function Ue(n, t, e) {
118
118
  );
119
119
  return {
120
120
  hasIcon: s(() => typeof (n == null ? void 0 : n.value) == "string" ? { name: n == null ? void 0 : n.value } : n == null ? void 0 : n.value),
121
- hasIconLeft: o,
122
- hasIconRight: a,
121
+ hasIconLeft: i,
122
+ hasIconRight: r,
123
123
  hasIconTop: p,
124
124
  hasIconBottom: u
125
125
  };
126
126
  }
127
- function We(n, t) {
128
- const { focused: e } = Ne(n);
129
- return Ae(e, (o) => {
130
- t(o ? "focus" : "blur", i(n));
127
+ function Fe(n, t) {
128
+ const { focused: e } = Ve(n);
129
+ return pe(e, (i) => {
130
+ t(i ? "focus" : "blur", l(n));
131
131
  }), {
132
132
  focused: e
133
133
  };
134
134
  }
135
- function Fe(n, t, e = 0) {
136
- let o;
135
+ function je(n, t, e = 0) {
136
+ let i;
137
137
  return typeof e == "string" && (e = parseInt(e)), s({
138
138
  get: () => n == null ? void 0 : n.value,
139
- set: (a) => {
140
- o && clearTimeout(o), o = setTimeout(() => {
141
- t("update:modelValue", a);
139
+ set: (r) => {
140
+ i && clearTimeout(i), i = setTimeout(() => {
141
+ t("update:modelValue", r);
142
142
  }, e);
143
143
  }
144
144
  });
145
145
  }
146
- function je(n, t) {
147
- const e = s(() => (i(n) ?? "").length), o = s(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && e.value < (t == null ? void 0 : t.lowerLimit) ? e.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && e.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - e.value : 0), a = s(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" ? `${e.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? o.value === 0 ? void 0 : o : e.value);
146
+ function qe(n, t) {
147
+ const e = s(() => (l(n) ?? "").length), i = s(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && e.value < (t == null ? void 0 : t.lowerLimit) ? e.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && e.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - e.value : 0), r = s(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" && (t != null && t.upperLimit) ? `${e.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? i.value === 0 ? void 0 : i : e.value);
148
148
  return {
149
149
  length: e,
150
- gap: o,
151
- formatted: a
150
+ gap: i,
151
+ formatted: r
152
152
  };
153
153
  }
154
- function pe(n, t) {
154
+ function ve(n, t) {
155
155
  const e = { [`${n}`]: !0 };
156
156
  return {
157
- bemCssClasses: s(() => Object.keys(t).reduce((a, p) => {
158
- const u = i(t[p]) || !1;
157
+ bemCssClasses: s(() => Object.keys(t).reduce((r, p) => {
158
+ const u = l(t[p]) || !1;
159
159
  if (!u)
160
- return a;
160
+ return r;
161
161
  if (p === "modifiers") {
162
162
  const w = Array.isArray(u) ? u : u.split(" ");
163
163
  return {
164
- ...a,
164
+ ...r,
165
165
  ...w.reduce(
166
166
  (h, m) => ({
167
167
  ...h,
@@ -172,13 +172,13 @@ function pe(n, t) {
172
172
  };
173
173
  } else
174
174
  return {
175
- ...a,
175
+ ...r,
176
176
  [`${n}--${se(p)}`]: u
177
177
  };
178
178
  }, e) || {})
179
179
  };
180
180
  }
181
- const qe = "ds", ze = {
181
+ const ze = "ds", Xe = {
182
182
  color: String,
183
183
  width: {
184
184
  type: [String, Number]
@@ -209,120 +209,126 @@ const qe = "ds", ze = {
209
209
  modifiers: {
210
210
  type: [String, Array]
211
211
  }
212
- }, Xe = {
212
+ }, Ke = {
213
213
  name: "VvIcon"
214
214
  }, A = /* @__PURE__ */ H({
215
- ...Xe,
216
- props: ze,
215
+ ...Ke,
216
+ props: Xe,
217
217
  setup(n) {
218
- const t = n, e = B(!0), { modifiers: o } = Y(t), a = Te(qe), { bemCssClasses: p } = pe("vv-icon", {
219
- modifiers: o
220
- }), u = s(() => t.provider || (a == null ? void 0 : a.provider)), w = s(() => {
221
- const l = t.name ?? "", c = `@${u.value}:${t.prefix}:${t.name}`;
222
- return N(l) ? l : N(c) ? c : (a == null ? void 0 : a.iconsCollections.find((b) => {
223
- const v = `@${u.value}:${b.prefix}:${l}`;
224
- if (N(v))
218
+ const t = n, e = $(!0), { modifiers: i } = Y(t), r = Ce(ze), { bemCssClasses: p } = ve("vv-icon", {
219
+ modifiers: i
220
+ }), u = s(() => t.provider || (r == null ? void 0 : r.provider)), w = s(() => {
221
+ const o = t.name ?? "", c = `@${u.value}:${t.prefix}:${t.name}`;
222
+ return k(o) ? o : k(c) ? c : (r == null ? void 0 : r.iconsCollections.find((b) => {
223
+ const v = `@${u.value}:${b.prefix}:${o}`;
224
+ if (k(v))
225
225
  return v;
226
- })) || l;
226
+ })) || o;
227
227
  });
228
- function h(l) {
228
+ function h(o) {
229
229
  let c = null;
230
230
  if (typeof window > "u") {
231
231
  const { JSDOM: T } = require("jsdom");
232
232
  c = new T().window;
233
233
  }
234
- return (c ? new c.DOMParser() : new window.DOMParser()).parseFromString(l, "text/html").querySelector("svg");
234
+ return (c ? new c.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
235
235
  }
236
- function m(l) {
237
- const c = h(l), b = (c == null ? void 0 : c.innerHTML.trim()) || "";
238
- c && b && ke(`@${u.value}:${t.prefix}:${t.name}`, {
236
+ function m(o) {
237
+ const c = h(o), b = (c == null ? void 0 : c.innerHTML.trim()) || "";
238
+ c && b && Be(`@${u.value}:${t.prefix}:${t.name}`, {
239
239
  body: b,
240
240
  height: c.viewBox.baseVal.height,
241
241
  width: c.viewBox.baseVal.width
242
242
  });
243
243
  }
244
- return a && (t.src && !N(`@${u.value}:${t.prefix}:${t.name}`) ? (e.value = !1, a.fetchIcon(t.src).then((l) => {
245
- l && (m(l), e.value = !0);
246
- }).catch((l) => {
247
- throw new Error(`During fetch icon: ${l == null ? void 0 : l.message}`);
248
- })) : t.svg && m(t.svg)), (l, c) => e.value ? (I(), _(i(Ve), k({
244
+ return r && (t.src && !k(`@${u.value}:${t.prefix}:${t.name}`) ? (e.value = !1, r.fetchIcon(t.src).then((o) => {
245
+ o && (m(o), e.value = !0);
246
+ }).catch((o) => {
247
+ throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
248
+ })) : t.svg && m(t.svg)), (o, c) => e.value ? (E(), P(l(Me), B({
249
249
  key: 0,
250
- class: i(p)
250
+ class: l(p)
251
251
  }, {
252
- inline: l.inline,
253
- width: l.width,
254
- height: l.height,
255
- horizontalFlip: l.horizontalFlip,
256
- verticalFlip: l.verticalFlip,
257
- flip: l.flip,
258
- rotate: l.rotate,
259
- color: l.color,
260
- onLoad: l.onLoad,
261
- icon: i(w)
252
+ inline: o.inline,
253
+ width: o.width,
254
+ height: o.height,
255
+ horizontalFlip: o.horizontalFlip,
256
+ verticalFlip: o.verticalFlip,
257
+ flip: o.flip,
258
+ rotate: o.rotate,
259
+ color: o.color,
260
+ onLoad: o.onLoad,
261
+ icon: l(w)
262
262
  }), null, 16, ["class"])) : O("", !0);
263
263
  }
264
- }), Ke = {
264
+ }), Ze = {
265
265
  valid: Boolean,
266
266
  validLabel: [String, Array]
267
- }, Ze = {
267
+ }, Ge = {
268
268
  invalid: Boolean,
269
269
  invalidLabel: [String, Array]
270
- }, Ge = {
270
+ }, Ye = {
271
271
  loading: Boolean,
272
272
  loadingLabel: String
273
- }, Ye = {
274
- disabled: Boolean
275
273
  }, Je = {
276
- readonly: Boolean
274
+ disabled: Boolean
277
275
  }, Qe = {
278
- modifiers: [String, Array]
276
+ readonly: Boolean
279
277
  }, et = {
280
- hintLabel: { type: String, default: "" }
278
+ modifiers: [String, Array]
281
279
  }, tt = {
280
+ hintLabel: { type: String, default: "" }
281
+ }, nt = {
282
282
  count: {
283
283
  type: [Boolean, String],
284
284
  default: !1,
285
285
  validator: (n) => [!0, !1, "limit", "countdown"].includes(n)
286
286
  }
287
- }, nt = {
287
+ }, rt = {
288
288
  debounce: [Number, String]
289
289
  }, ue = {
290
290
  LEFT: "left",
291
291
  RIGHT: "right"
292
- }, rt = {
292
+ }, at = {
293
293
  icon: { type: [String, Object] },
294
294
  iconPosition: {
295
295
  type: String,
296
296
  validation: (n) => Object.values(ue).includes(n),
297
297
  default: ue.RIGHT
298
298
  }
299
- }, at = {
299
+ }, it = {
300
300
  tabindex: { type: [String, Number], default: 0 }
301
+ }, lt = {
302
+ floating: Boolean
301
303
  }, ot = {
302
304
  id: [String, Number],
303
305
  name: { type: String, required: !0 }
304
- }, it = {
306
+ }, st = {
307
+ autofocus: Boolean
308
+ }, ut = {
309
+ autocomplete: { type: String, default: "off" }
310
+ }, ct = {
305
311
  ...ot,
306
- ...at,
307
- ...Ye,
312
+ ...st,
313
+ ...ut,
314
+ ...it,
308
315
  ...Je,
309
- ...Ke,
316
+ ...Qe,
310
317
  ...Ze,
311
- ...et,
312
318
  ...Ge,
313
- ...Qe,
314
319
  ...tt,
320
+ ...Ye,
321
+ ...et,
315
322
  ...nt,
316
323
  ...rt,
317
- autofocus: Boolean,
318
- autocomplete: { type: String, default: "off" },
324
+ ...at,
325
+ ...lt,
319
326
  minlength: Number,
320
327
  maxlength: Number,
321
328
  placeholder: String,
322
329
  required: Boolean,
323
- label: String,
324
- floating: Boolean
325
- }, r = {
330
+ label: String
331
+ }, a = {
326
332
  TEXT: "text",
327
333
  PASSWORD: "password",
328
334
  NUMBER: "number",
@@ -336,20 +342,20 @@ const qe = "ds", ze = {
336
342
  DATETIME_LOCAL: "datetime-local",
337
343
  MONTH: "month",
338
344
  WEEK: "week"
339
- }, E = {
345
+ }, I = {
340
346
  PASSWORD_SHOW: "eye-on",
341
347
  PASSWORD_HIDE: "eye-off",
342
348
  DATE: "calendar",
343
349
  TIME: "time",
344
350
  COLOR: "color",
345
351
  SEARCH: "close"
346
- }, lt = ["update:modelValue", "focus", "blur", "keyup"], st = {
347
- ...it,
352
+ }, dt = ["update:modelValue", "focus", "blur", "keyup"], pt = {
353
+ ...ct,
348
354
  modelValue: [String, Number],
349
355
  type: {
350
356
  type: String,
351
- default: r.TEXT,
352
- validator: (n) => Object.values(r).includes(n)
357
+ default: a.TEXT,
358
+ validator: (n) => Object.values(a).includes(n)
353
359
  },
354
360
  min: [Number, Date, String],
355
361
  max: [Number, Date, String],
@@ -358,15 +364,15 @@ const qe = "ds", ze = {
358
364
  multiple: Boolean,
359
365
  iconShowPassword: {
360
366
  type: String,
361
- default: E.PASSWORD_SHOW
367
+ default: I.PASSWORD_SHOW
362
368
  },
363
369
  iconHidePassword: {
364
370
  type: String,
365
- default: E.PASSWORD_HIDE
371
+ default: I.PASSWORD_HIDE
366
372
  },
367
373
  iconClear: {
368
374
  type: String,
369
- default: E.SEARCH
375
+ default: I.SEARCH
370
376
  },
371
377
  labelStepUp: {
372
378
  type: String,
@@ -407,25 +413,25 @@ const qe = "ds", ze = {
407
413
  },
408
414
  iconShow: {
409
415
  type: String,
410
- default: E.PASSWORD_SHOW
416
+ default: I.PASSWORD_SHOW
411
417
  },
412
418
  iconHide: {
413
419
  type: String,
414
- default: E.PASSWORD_HIDE
420
+ default: I.PASSWORD_HIDE
415
421
  }
416
422
  },
417
423
  emits: ["toggle-password"],
418
424
  setup(n, { emit: t }) {
419
- const e = B(!1), o = s(
425
+ const e = $(!1), i = s(
420
426
  () => e.value ? n.iconHide : n.iconShow
421
427
  );
422
- function a(p) {
428
+ function r(p) {
423
429
  p == null || p.stopPropagation(), n.disabled || (e.value = !e.value, t("toggle-password", e.value));
424
430
  }
425
431
  return {
426
432
  active: e,
427
- activeIcon: o,
428
- onClick: a
433
+ activeIcon: i,
434
+ onClick: r
429
435
  };
430
436
  },
431
437
  render() {
@@ -468,8 +474,8 @@ const qe = "ds", ze = {
468
474
  const e = s(() => n.mode === "up");
469
475
  return {
470
476
  isUp: e,
471
- onClick: (a) => {
472
- a == null || a.stopPropagation(), n.disabled || t(e.value ? "step-up" : "step-down");
477
+ onClick: (r) => {
478
+ r == null || r.stopPropagation(), n.disabled || t(e.value ? "step-up" : "step-down");
473
479
  }
474
480
  };
475
481
  },
@@ -504,8 +510,8 @@ const qe = "ds", ze = {
504
510
  },
505
511
  emits: ["clear"],
506
512
  setup(n, { emit: t }) {
507
- function e(o) {
508
- o == null || o.stopPropagation(), n.disabled || t("clear");
513
+ function e(i) {
514
+ i == null || i.stopPropagation(), n.disabled || t("clear");
509
515
  }
510
516
  return {
511
517
  onClick: e
@@ -553,23 +559,23 @@ function G(n, t) {
553
559
  render() {
554
560
  let e = null;
555
561
  switch (n) {
556
- case r.SEARCH: {
557
- const { onClear: o } = this.$attrs;
562
+ case a.SEARCH: {
563
+ const { onClear: i } = this.$attrs;
558
564
  e = [
559
565
  g(de, {
560
566
  disabled: this.isDisabled,
561
567
  label: this.labelShowPassword,
562
- onClear: o
568
+ onClear: i
563
569
  })
564
570
  ];
565
571
  break;
566
572
  }
567
- case r.PASSWORD: {
568
- const { onTogglePassword: o } = this.$attrs;
573
+ case a.PASSWORD: {
574
+ const { onTogglePassword: i } = this.$attrs;
569
575
  e = [
570
576
  g(ce, {
571
577
  disabled: this.isDisabled,
572
- onTogglePassword: o,
578
+ onTogglePassword: i,
573
579
  labelShow: this.labelShowPassword,
574
580
  labelHide: this.labelHidePassword,
575
581
  iconShow: this.iconShowPassword,
@@ -578,22 +584,22 @@ function G(n, t) {
578
584
  ];
579
585
  break;
580
586
  }
581
- case r.NUMBER: {
582
- const { onStepUp: o, onStepDown: a } = this.$attrs;
587
+ case a.NUMBER: {
588
+ const { onStepUp: i, onStepDown: r } = this.$attrs;
583
589
  e = [
584
590
  g(Z, {
585
591
  mode: "up",
586
592
  disabled: this.isDisabled || t.max !== void 0 && t.modelValue === t.max,
587
593
  label: this.labelStepUp,
588
- onStepUp: o,
589
- onStepDown: a
594
+ onStepUp: i,
595
+ onStepDown: r
590
596
  }),
591
597
  g(Z, {
592
598
  mode: "down",
593
599
  disabled: this.isDisabled || t.min !== void 0 && t.modelValue === t.min,
594
600
  label: this.labelStepDown,
595
- onStepUp: o,
596
- onStepDown: a
601
+ onStepUp: i,
602
+ onStepDown: r
597
603
  })
598
604
  ];
599
605
  break;
@@ -603,68 +609,72 @@ function G(n, t) {
603
609
  }
604
610
  };
605
611
  }
606
- const ut = ["for"], ct = { class: "vv-input-text__wrapper" }, dt = ["id"], pt = {
612
+ const vt = ["for"], ft = { class: "vv-input-text__wrapper" }, mt = ["id"], St = {
607
613
  key: 0,
608
614
  class: "vv-input-text__limit"
609
- }, vt = {
615
+ }, ht = {
610
616
  name: "VvInputText"
611
- }, gt = /* @__PURE__ */ H({
612
- ...vt,
613
- props: st,
614
- emits: lt,
617
+ }, Et = /* @__PURE__ */ H({
618
+ ...ht,
619
+ props: pt,
620
+ emits: dt,
615
621
  setup(n, { emit: t }) {
616
- const e = n, o = Ce(), a = B(), {
622
+ const e = n, i = De(), r = $(), {
617
623
  icon: p,
618
624
  iconPosition: u,
619
625
  label: w,
620
626
  modelValue: h,
621
627
  count: m,
622
- valid: l,
628
+ valid: o,
623
629
  invalid: c,
624
630
  loading: b
625
- } = Y(e), v = s(() => String(e.id || xe())), S = s(() => `${v.value}-hint`), T = s(
631
+ } = Y(e), v = s(() => String(e.id || ke())), S = s(() => `${v.value}-hint`), T = s(
626
632
  () => e.floating && R(e.placeholder) ? " " : e.placeholder
627
- ), y = Fe(h, t, e.debounce), { focused: C } = We(a, t), D = B(!1), L = s(() => e.type === r.PASSWORD), x = () => {
628
- D.value = !D.value;
629
- }, $ = s(
630
- () => e.type === r.TIME || e.type === r.DATETIME_LOCAL || e.type === r.DATE || e.type === r.WEEK || e.type === r.MONTH
631
- ), P = s(() => e.type === r.NUMBER), J = () => {
632
- F.value && (a.value.stepUp(), y.value = i(a).value);
633
+ ), y = je(h, t, e.debounce), { focused: C } = Fe(r, t), L = Ne(r);
634
+ pe(L, (d) => {
635
+ d && e.autofocus && (C.value = !0);
636
+ });
637
+ const _ = $(!1), x = s(() => e.type === a.PASSWORD), V = () => {
638
+ _.value = !_.value;
639
+ }, D = s(
640
+ () => e.type === a.TIME || e.type === a.DATETIME_LOCAL || e.type === a.DATE || e.type === a.WEEK || e.type === a.MONTH
641
+ ), fe = s(() => e.type === a.NUMBER), J = () => {
642
+ F.value && (r.value.stepUp(), y.value = l(r).value);
633
643
  }, Q = () => {
634
- F.value && (a.value.stepDown(), y.value = i(a).value);
635
- }, ve = s(() => e.type === r.SEARCH), ee = () => {
644
+ F.value && (r.value.stepDown(), y.value = l(r).value);
645
+ }, me = s(() => e.type === a.SEARCH), ee = () => {
636
646
  y.value = void 0;
637
- }, { hasIconLeft: te, hasIconRight: U, hasIcon: ne } = Ue(
647
+ }, { hasIconLeft: te, hasIconRight: U, hasIcon: ne } = We(
638
648
  p,
639
649
  u
640
650
  ), W = s(() => {
641
651
  switch (e.type) {
642
- case r.COLOR:
643
- return { name: E.COLOR };
644
- case r.DATE:
645
- case r.DATETIME_LOCAL:
646
- case r.WEEK:
647
- case r.MONTH:
648
- return { name: E.DATE };
649
- case r.TIME:
650
- return { name: E.TIME };
652
+ case a.COLOR:
653
+ return { name: I.COLOR };
654
+ case a.DATE:
655
+ case a.DATETIME_LOCAL:
656
+ case a.WEEK:
657
+ case a.MONTH:
658
+ return { name: I.DATE };
659
+ case a.TIME:
660
+ return { name: I.TIME };
651
661
  default:
652
662
  return "";
653
663
  }
654
- }), { formatted: fe } = je(y, {
664
+ }), { formatted: Se } = qe(y, {
655
665
  mode: e.count,
656
666
  upperLimit: e.maxlength,
657
667
  lowerLimit: e.minlength
658
- }), F = s(() => !e.disabled && !e.readonly), me = s(
668
+ }), F = s(() => !e.disabled && !e.readonly), he = s(
659
669
  () => F.value ? e.tabindex : -1
660
- ), re = s(() => !R(h)), Se = s(() => {
670
+ ), re = s(() => !R(h)), ge = s(() => {
661
671
  if (c.value === !0)
662
672
  return !0;
663
- if (l.value === !0)
673
+ if (o.value === !0)
664
674
  return !1;
665
- }), { bemCssClasses: he } = pe("vv-input-text", {
675
+ }), { bemCssClasses: be } = ve("vv-input-text", {
666
676
  modifiers: e.modifiers,
667
- valid: l,
677
+ valid: o,
668
678
  invalid: c,
669
679
  loading: b,
670
680
  disabled: e.disabled,
@@ -674,91 +684,89 @@ const ut = ["for"], ct = { class: "vv-input-text__wrapper" }, dt = ["id"], pt =
674
684
  floating: e.floating && !R(e.label),
675
685
  dirty: re,
676
686
  focus: C
677
- }), ge = s(() => {
678
- const d = (() => L.value && D.value || $.value && !re.value && !C.value ? r.TEXT : e.type)(), f = {
687
+ }), ye = s(() => {
688
+ const d = (() => x.value && _.value || D.value && !re.value && !C.value ? a.TEXT : e.type)(), f = {
679
689
  type: d,
680
690
  name: e.name,
681
- tabindex: me.value,
691
+ tabindex: he.value,
682
692
  disabled: e.disabled,
683
693
  readonly: e.readonly,
684
694
  required: e.required,
685
695
  autocomplete: e.autocomplete,
686
- "aria-invalid": Se.value,
687
- "aria-describedby": !ae.value && ye.value ? S.value : void 0,
696
+ "aria-invalid": ge.value,
697
+ "aria-describedby": !ae.value && Ee.value ? S.value : void 0,
688
698
  "aria-errormessage": ae.value ? S.value : void 0
689
699
  };
690
- return (d === r.DATE || d === r.MONTH || d === r.WEEK || d === r.TIME || d === r.DATETIME_LOCAL || d === r.NUMBER) && (f.step = e.step, f.max = String(e.max), f.min = String(e.min)), (d === r.TEXT || d === r.SEARCH || d === r.URL || d === r.TEL || d === r.EMAIL || d === r.PASSWORD || d === r.NUMBER) && (f.placeholder = T.value), (d === r.TEXT || d === r.SEARCH || d === r.URL || d === r.TEL || d === r.EMAIL || d === r.PASSWORD) && (f.minlength = e.minlength, f.maxlength = e.maxlength, f.pattern = e.pattern), d === r.EMAIL && (f.multiple = e.multiple), f;
700
+ return (d === a.DATE || d === a.MONTH || d === a.WEEK || d === a.TIME || d === a.DATETIME_LOCAL || d === a.NUMBER) && (f.step = e.step, f.max = String(e.max), f.min = String(e.min)), (d === a.TEXT || d === a.SEARCH || d === a.URL || d === a.TEL || d === a.EMAIL || d === a.PASSWORD || d === a.NUMBER) && (f.placeholder = T.value), (d === a.TEXT || d === a.SEARCH || d === a.URL || d === a.TEL || d === a.EMAIL || d === a.PASSWORD) && (f.minlength = e.minlength, f.maxlength = e.maxlength, f.pattern = e.pattern), d === a.EMAIL && (f.multiple = e.multiple), f;
691
701
  }), j = s(() => ({
692
702
  valid: e.valid,
693
703
  invalid: e.invalid,
694
704
  modelValue: e.modelValue,
695
- togglePassword: x,
705
+ togglePassword: V,
696
706
  stepUp: J,
697
707
  stepDown: Q,
698
708
  clear: ee
699
- })), { HintSlot: be, hasHint: ye, hasInvalid: ae } = $e(e, o), we = G(
700
- r.PASSWORD,
709
+ })), { HintSlot: we, hasHint: Ee, hasInvalid: ae } = Ue(e, i), Ie = G(
710
+ a.PASSWORD,
701
711
  e
702
- ), Ie = G(
703
- r.NUMBER,
712
+ ), Ae = G(
713
+ a.NUMBER,
704
714
  e
705
- ), Ee = G(
706
- r.SEARCH,
715
+ ), Te = G(
716
+ a.SEARCH,
707
717
  e
708
718
  );
709
- return De(() => {
710
- e.autofocus && (C.value = !0);
711
- }), (d, f) => (I(), z("div", {
712
- class: Pe(i(he))
719
+ return (d, f) => (E(), z("div", {
720
+ class: Pe(l(be))
713
721
  }, [
714
- i(w) ? (I(), z("label", {
722
+ l(w) ? (E(), z("label", {
715
723
  key: 0,
716
- for: i(v),
724
+ for: l(v),
717
725
  class: "vv-input-text__label"
718
- }, oe(i(w)), 9, ut)) : O("", !0),
719
- ie("div", ct, [
720
- X(d.$slots, "before", M(K(i(j))), () => [
721
- i(te) ? (I(), _(A, k({
726
+ }, ie(l(w)), 9, vt)) : O("", !0),
727
+ le("div", ft, [
728
+ X(d.$slots, "before", N(K(l(j))), () => [
729
+ l(te) ? (E(), P(A, B({
722
730
  key: 0,
723
731
  class: "vv-input-text__icon-left"
724
- }, i(ne)), null, 16)) : O("", !0)
732
+ }, l(ne)), null, 16)) : O("", !0)
725
733
  ]),
726
- _e(ie("input", k({
727
- id: i(v),
734
+ _e(le("input", B({
735
+ id: l(v),
728
736
  ref_key: "input",
729
- ref: a,
737
+ ref: r,
730
738
  "onUpdate:modelValue": f[0] || (f[0] = (q) => Oe(y) ? y.value = q : null)
731
- }, i(ge), {
739
+ }, l(ye), {
732
740
  onKeyup: f[1] || (f[1] = (q) => t("keyup", q))
733
- }), null, 16, dt), [
734
- [Re, i(y)]
741
+ }), null, 16, mt), [
742
+ [Re, l(y)]
735
743
  ]),
736
- X(d.$slots, "after", M(K(i(j))), () => [
737
- i(U) || i(W) ? (I(), _(A, M(k({ key: 0 }, i(U) ? i(ne) : i(W))), null, 16)) : i(L) ? (I(), _(i(we), {
744
+ X(d.$slots, "after", N(K(l(j))), () => [
745
+ l(U) || l(W) ? (E(), P(A, N(B({ key: 0 }, l(U) ? l(ne) : l(W))), null, 16)) : l(x) ? (E(), P(l(Ie), {
738
746
  key: 1,
739
- onTogglePassword: x
740
- })) : i(P) ? (I(), _(i(Ie), {
747
+ onTogglePassword: V
748
+ })) : l(fe) ? (E(), P(l(Ae), {
741
749
  key: 2,
742
750
  onStepUp: J,
743
751
  onStepDown: Q
744
- })) : i(ve) ? (I(), _(i(Ee), {
752
+ })) : l(me) ? (E(), P(l(Te), {
745
753
  key: 3,
746
754
  onClear: ee
747
755
  })) : O("", !0)
748
756
  ]),
749
- i(m) ? (I(), z("span", pt, [
750
- X(d.$slots, "count", M(K(i(j))), () => [
751
- He(oe(i(fe)), 1)
757
+ l(m) ? (E(), z("span", St, [
758
+ X(d.$slots, "count", N(K(l(j))), () => [
759
+ He(ie(l(Se)), 1)
752
760
  ])
753
761
  ])) : O("", !0)
754
762
  ]),
755
- Le(i(be), {
756
- id: i(S),
763
+ Le(l(we), {
764
+ id: l(S),
757
765
  class: "vv-input-text__hint"
758
766
  }, null, 8, ["id"])
759
767
  ], 2));
760
768
  }
761
769
  });
762
770
  export {
763
- gt as default
771
+ Et as default
764
772
  };