@volverjs/ui-vue 0.0.2 → 0.0.3-beta.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.
Files changed (171) hide show
  1. package/auto-imports.d.ts +289 -0
  2. package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
  3. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  4. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
  5. package/dist/components/VvAccordion/index.d.ts +2 -2
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
  9. package/dist/components/VvAccordionGroup/index.d.ts +2 -2
  10. package/dist/components/VvBadge/VvBadge.es.js +16 -50
  11. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  12. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
  13. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  14. package/dist/components/VvButton/VvButton.es.js +170 -306
  15. package/dist/components/VvButton/VvButton.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
  17. package/dist/components/VvButton/index.d.ts +3 -3
  18. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
  19. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  20. package/dist/components/VvCard/VvCard.es.js +26 -60
  21. package/dist/components/VvCard/VvCard.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
  23. package/dist/components/VvCard/index.d.ts +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
  27. package/dist/components/VvCheckbox/index.d.ts +10 -4
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  31. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  32. package/dist/components/VvCombobox/VvCombobox.es.js +330 -487
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
  35. package/dist/components/VvCombobox/index.d.ts +4 -4
  36. package/dist/components/VvDialog/VvDialog.es.js +66 -102
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
  41. package/dist/components/VvDropdown/index.d.ts +1 -1
  42. package/dist/components/VvIcon/VvIcon.es.js +30 -65
  43. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  44. package/dist/components/VvInputText/VvInputText.es.js +304 -407
  45. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  46. package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
  47. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  48. package/dist/components/VvInputText/index.d.ts +5 -5
  49. package/dist/components/VvProgress/VvProgress.es.js +17 -51
  50. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  51. package/dist/components/VvRadio/VvRadio.es.js +110 -249
  52. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  53. package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
  54. package/dist/components/VvRadio/index.d.ts +3 -3
  55. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
  56. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  57. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  58. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  59. package/dist/components/VvSelect/VvSelect.es.js +200 -292
  60. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  61. package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
  62. package/dist/components/VvSelect/index.d.ts +4 -4
  63. package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
  64. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  65. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
  66. package/dist/components/VvTextarea/index.d.ts +3 -3
  67. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  68. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  69. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  70. package/dist/components/VvTooltip/index.d.ts +18 -0
  71. package/dist/components/common/HintSlot.d.ts +1 -1
  72. package/dist/components/index.es.js +1179 -1371
  73. package/dist/components/index.umd.js +1 -1
  74. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  75. package/dist/composables/useComponentFocus.d.ts +1 -1
  76. package/dist/composables/useComponentIcons.d.ts +1 -1
  77. package/dist/composables/useDebouncedInput.d.ts +1 -1
  78. package/dist/composables/useModifiers.d.ts +1 -1
  79. package/dist/composables/useTextCount.d.ts +1 -1
  80. package/dist/icons.es.js +3 -3
  81. package/dist/icons.umd.js +1 -1
  82. package/dist/index.es.js +1211 -1404
  83. package/dist/index.umd.js +1 -1
  84. package/dist/props/index.d.ts +12 -12
  85. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  86. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  87. package/dist/utils/ObjectUtilities.d.ts +1 -1
  88. package/package.json +27 -20
  89. package/src/assets/icons/detailed.json +1 -1
  90. package/src/assets/icons/normal.json +1 -1
  91. package/src/assets/icons/simple.json +1 -1
  92. package/src/components/VvAccordion/VvAccordion.vue +0 -3
  93. package/src/components/VvAccordion/index.ts +1 -2
  94. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
  95. package/src/components/VvBadge/VvBadge.vue +0 -1
  96. package/src/components/VvButton/VvButton.vue +0 -3
  97. package/src/components/VvButton/index.ts +2 -10
  98. package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
  99. package/src/components/VvCard/VvCard.vue +0 -1
  100. package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
  101. package/src/components/VvCheckbox/index.ts +1 -2
  102. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
  103. package/src/components/VvCombobox/VvCombobox.vue +0 -7
  104. package/src/components/VvDialog/VvDialog.vue +1 -2
  105. package/src/components/VvDropdown/VvDropdown.vue +0 -4
  106. package/src/components/VvIcon/VvIcon.vue +0 -2
  107. package/src/components/VvInputText/VvInputClearAction.ts +0 -1
  108. package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
  109. package/src/components/VvInputText/VvInputStepAction.ts +0 -1
  110. package/src/components/VvInputText/VvInputText.vue +1 -16
  111. package/src/components/VvInputText/VvInputTextActions.ts +1 -1
  112. package/src/components/VvProgress/VvProgress.vue +0 -2
  113. package/src/components/VvRadio/VvRadio.vue +0 -3
  114. package/src/components/VvRadio/index.ts +0 -1
  115. package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
  116. package/src/components/VvSelect/VvSelect.vue +1 -14
  117. package/src/components/VvTextarea/VvTextarea.vue +1 -15
  118. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  119. package/src/components/VvTooltip/index.ts +21 -0
  120. package/src/components/common/HintSlot.ts +1 -11
  121. package/src/composables/group/types/IAccordionGroupState.ts +0 -1
  122. package/src/composables/group/types/IButtonGroupState.ts +0 -1
  123. package/src/composables/group/types/IInputGroup.ts +0 -1
  124. package/src/composables/group/useInjectedGroupState.ts +1 -2
  125. package/src/composables/group/useProvideGroupState.ts +0 -1
  126. package/src/composables/useComponentFocus.ts +1 -2
  127. package/src/composables/useComponentIcons.ts +1 -1
  128. package/src/composables/useDebouncedInput.ts +1 -1
  129. package/src/composables/useModifiers.ts +1 -2
  130. package/src/composables/useOptions.ts +0 -1
  131. package/src/composables/useTextCount.ts +1 -1
  132. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  133. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  134. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  135. package/src/stories/Badge/Badge.stories.mdx +1 -1
  136. package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
  137. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  138. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  139. package/src/stories/Button/Button.stories.mdx +1 -1
  140. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  141. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  142. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
  143. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  144. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
  145. package/src/stories/Card/Card.stories.mdx +1 -1
  146. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  147. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  148. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  149. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  150. package/src/stories/Combobox/Combobox.settings.ts +0 -1
  151. package/src/stories/Combobox/Combobox.stories.mdx +1 -1
  152. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  153. package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
  154. package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
  155. package/src/stories/Icon/Icon.settings.ts +0 -1
  156. package/src/stories/Icon/Icon.stories.mdx +1 -1
  157. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  158. package/src/stories/InputText/InputText.settings.ts +0 -1
  159. package/src/stories/InputText/InputText.stories.mdx +1 -1
  160. package/src/stories/Progress/Progress.stories.mdx +1 -1
  161. package/src/stories/Radio/Radio.stories.mdx +1 -1
  162. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  163. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  164. package/src/stories/Select/Select.settings.ts +0 -1
  165. package/src/stories/Select/Select.stories.mdx +1 -1
  166. package/src/stories/Textarea/Textarea.settings.ts +0 -1
  167. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  168. package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
  169. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  170. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
  171. package/src/utils/ObjectUtilities.ts +1 -1
@@ -1,148 +1,24 @@
1
- import { computed as B, unref as a, toRefs as N, defineComponent as $, openBlock as b, createElementBlock as V, normalizeClass as j, createElementVNode as v, toDisplayString as O, createCommentVNode as w, Fragment as x, renderList as D, withModifiers as L, createTextVNode as R } from "vue";
2
- import { nanoid as E } from "nanoid";
3
- function A(r, t, e) {
4
- return e ? _(r, e) === _(t, e) : C(r, t);
5
- }
6
- function C(r, t) {
7
- if (r === t)
8
- return !0;
9
- if (r && t && typeof r == "object" && typeof t == "object") {
10
- const e = Array.isArray(r), s = Array.isArray(t);
11
- let n, u, l;
12
- if (e && s) {
13
- if (u = r.length, u != t.length)
14
- return !1;
15
- for (n = u; n-- !== 0; )
16
- if (!C(r[n], t[n]))
17
- return !1;
18
- return !0;
19
- }
20
- if (e != s)
21
- return !1;
22
- const i = r instanceof Date, d = t instanceof Date;
23
- if (i != d)
24
- return !1;
25
- if (i && d)
26
- return r.getTime() == t.getTime();
27
- const f = r instanceof RegExp, g = t instanceof RegExp;
28
- if (f != g)
29
- return !1;
30
- if (f && g)
31
- return r.toString() == t.toString();
32
- const m = Object.keys(r);
33
- if (u = m.length, u !== Object.keys(t).length)
34
- return !1;
35
- for (n = u; n-- !== 0; )
36
- if (!Object.prototype.hasOwnProperty.call(t, m[n]))
37
- return !1;
38
- for (n = u; n-- !== 0; )
39
- if (l = m[n], !C(r[l], t[l]))
40
- return !1;
41
- return !0;
42
- }
43
- return r !== r && t !== t;
44
- }
45
- function _(r, t) {
46
- if (r && Object.keys(r).length && t) {
47
- if (t.indexOf(".") === -1)
48
- return r[t];
49
- {
50
- const e = t.split(".");
51
- let s = r;
52
- for (let n = 0, u = e.length; n < u; ++n) {
53
- if (r == null)
54
- return null;
55
- s = s[e[n]];
56
- }
57
- return s;
58
- }
59
- } else
60
- return null;
61
- }
62
- function P(r, t) {
63
- let e = -1;
64
- if (t) {
65
- for (let s = 0; s < t.length; s++)
66
- if (A(t[s], r)) {
67
- e = s;
68
- break;
69
- }
70
- }
71
- return e;
72
- }
73
- function h(r, t) {
74
- if (r != null && t && t.length) {
75
- for (const e of t)
76
- if (A(r, e))
77
- return !0;
78
- }
79
- return !1;
80
- }
81
- function F(r, t) {
82
- const e = P(r, t);
83
- return e > -1 ? t.filter((s, n) => n !== e) : t;
84
- }
85
- function S(r) {
86
- var t, e;
87
- if (r)
88
- return (e = (t = r.match(
89
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
90
- )) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
91
- }
92
- function I(r, t) {
93
- const e = { [`${r}`]: !0 };
94
- return {
95
- bemCssClasses: B(() => Object.keys(t).reduce((n, u) => {
96
- const l = a(t[u]) || !1;
97
- if (!l)
98
- return n;
99
- if (u === "modifiers") {
100
- const i = Array.isArray(l) ? l : l.split(" ");
101
- return {
102
- ...n,
103
- ...i.reduce(
104
- (d, f) => ({
105
- ...d,
106
- [`${r}--${S(f)}`]: !0
107
- }),
108
- {}
109
- )
110
- };
111
- } else
112
- return {
113
- ...n,
114
- [`${r}--${S(u)}`]: l
115
- };
116
- }, e) || {})
117
- };
118
- }
119
- function K(r) {
120
- const { options: t, labelKey: e, valueKey: s } = N(r);
121
- return {
122
- options: t,
123
- getOptionLabel: (l) => typeof l != "object" && l !== null ? l : typeof e.value == "function" ? e.value(l) : l[e.value],
124
- getOptionValue: (l) => typeof l != "object" && l !== null ? l : typeof s.value == "function" ? s.value(l) : l[s.value]
125
- };
126
- }
127
- const M = {
1
+ import { defineComponent as N, openBlock as s, createElementBlock as i, unref as l, normalizeClass as S, createElementVNode as m, toDisplayString as f, createCommentVNode as v, Fragment as C, renderList as w, withModifiers as A, createTextVNode as B } from "vue";
2
+ import { nanoid as D } from "nanoid";
3
+ const O = {
128
4
  disabled: Boolean
129
- }, T = {
5
+ }, P = {
130
6
  modifiers: [String, Array]
131
- }, Z = {
7
+ }, $ = {
132
8
  options: {
133
9
  type: Array,
134
10
  default: () => []
135
11
  },
136
12
  labelKey: { type: [String, Function], default: "label" },
137
13
  valueKey: { type: [String, Function], default: "value" }
138
- }, q = {
14
+ }, F = {
139
15
  id: [String, Number],
140
16
  name: { type: String, required: !0 }
141
- }, z = {
142
- ...q,
143
- ...Z,
144
- ...M,
145
- ...T,
17
+ }, R = {
18
+ ...F,
19
+ ...$,
20
+ ...O,
21
+ ...P,
146
22
  modelValue: {
147
23
  type: [String, Number, Boolean, Object, Array]
148
24
  },
@@ -150,78 +26,78 @@ const M = {
150
26
  multiple: Boolean,
151
27
  maxValues: [Number, String],
152
28
  unselectable: { type: Boolean, default: !0 }
153
- }, G = ["id"], H = {
29
+ }, q = ["id"], x = {
154
30
  key: 0,
155
31
  role: "option"
156
- }, J = ["aria-selected"], Q = ["for", "onClick"], U = ["id", "type", "value", "checked", "disabled", "name"], W = {
32
+ }, I = ["aria-selected"], L = ["for", "onClick"], M = ["id", "type", "value", "checked", "disabled", "name"], E = {
157
33
  name: "VvDropdown"
158
- }, te = /* @__PURE__ */ $({
159
- ...W,
160
- props: z,
34
+ }, T = /* @__PURE__ */ N({
35
+ ...E,
36
+ props: R,
161
37
  emits: ["update:modelValue"],
162
- setup(r, { emit: t }) {
163
- const e = r, s = B(() => String(e.id || E())), { modifiers: n, disabled: u } = N(e), { getOptionLabel: l, getOptionValue: i } = K(e), { bemCssClasses: d } = I("vv-dropdown", {
164
- modifiers: n,
165
- disabled: u
38
+ setup(b, { emit: V }) {
39
+ const t = b, d = computed(() => String(t.id || D())), { modifiers: y, disabled: c } = toRefs(t), { getOptionLabel: g, getOptionValue: a } = useOptions(t), { bemCssClasses: h } = useBemModifiers("vv-dropdown", {
40
+ modifiers: y,
41
+ disabled: c
166
42
  });
167
- function f(o) {
168
- return Array.isArray(e.modelValue) ? h(o, e.modelValue) || h(i(o), e.modelValue) : A(o, e.modelValue) || A(i(o), e.modelValue);
43
+ function p(e) {
44
+ return Array.isArray(t.modelValue) ? contains(e, t.modelValue) || contains(a(e), t.modelValue) : equals(e, t.modelValue) || equals(a(e), t.modelValue);
169
45
  }
170
- function g(o) {
171
- return typeof o == "string" || o.disabled === void 0 ? u.value : o.disabled;
46
+ function _(e) {
47
+ return typeof e == "string" || e.disabled === void 0 ? c.value : e.disabled;
172
48
  }
173
- function m(o) {
174
- var y;
175
- if (e.disabled)
49
+ function k(e) {
50
+ var n;
51
+ if (t.disabled)
176
52
  return;
177
- let p = o;
178
- if (e.multiple)
179
- if (Array.isArray(e.modelValue)) {
180
- if (e.maxValues !== void 0 && e.maxValues >= 0 && ((y = e.modelValue) == null ? void 0 : y.length) >= e.maxValues && !h(o, e.modelValue))
53
+ let r = e;
54
+ if (t.multiple)
55
+ if (Array.isArray(t.modelValue)) {
56
+ if (t.maxValues !== void 0 && t.maxValues >= 0 && ((n = t.modelValue) == null ? void 0 : n.length) >= t.maxValues && !contains(e, t.modelValue))
181
57
  return;
182
- p = h(o, e.modelValue) ? F(o, e.modelValue) : [...e.modelValue, o];
58
+ r = contains(e, t.modelValue) ? removeFromList(e, t.modelValue) : [...t.modelValue, e];
183
59
  } else
184
- p = [o];
60
+ r = [e];
185
61
  else
186
- e.unselectable && o === e.modelValue && (p = void 0);
187
- t("update:modelValue", p);
62
+ t.unselectable && e === t.modelValue && (r = void 0);
63
+ V("update:modelValue", r);
188
64
  }
189
- return (o, p) => {
190
- var y;
191
- return b(), V("ul", {
192
- id: a(s),
193
- class: j(a(d)),
65
+ return (e, r) => {
66
+ var n;
67
+ return s(), i("ul", {
68
+ id: l(d),
69
+ class: S(l(h)),
194
70
  role: "listbox"
195
71
  }, [
196
- (y = o.options) != null && y.length ? w("", !0) : (b(), V("li", H, [
197
- v("label", null, O(o.labelNoResults), 1)
72
+ (n = e.options) != null && n.length ? v("", !0) : (s(), i("li", x, [
73
+ m("label", null, f(e.labelNoResults), 1)
198
74
  ])),
199
- (b(!0), V(x, null, D(o.options, (c, k) => (b(), V("li", {
200
- key: k,
75
+ (s(!0), i(C, null, w(e.options, (o, u) => (s(), i("li", {
76
+ key: u,
201
77
  role: "option",
202
- "aria-selected": f(c)
78
+ "aria-selected": p(o)
203
79
  }, [
204
- v("label", {
205
- for: `dropdown-${k}-${a(s)}`,
206
- onClick: L((X) => m(a(i)(c)), ["prevent"])
80
+ m("label", {
81
+ for: `dropdown-${u}-${l(d)}`,
82
+ onClick: A((K) => k(l(a)(o)), ["prevent"])
207
83
  }, [
208
- v("input", {
209
- id: `dropdown-${k}-${a(s)}`,
210
- type: o.multiple ? "checkbox" : "radio",
211
- value: a(i)(c),
212
- checked: f(c),
213
- disabled: g(c),
214
- name: o.name,
84
+ m("input", {
85
+ id: `dropdown-${u}-${l(d)}`,
86
+ type: e.multiple ? "checkbox" : "radio",
87
+ value: l(a)(o),
88
+ checked: p(o),
89
+ disabled: _(o),
90
+ name: e.name,
215
91
  tabindex: "-1",
216
92
  "aria-hidden": "true"
217
- }, null, 8, U),
218
- R(" " + O(a(l)(c)), 1)
219
- ], 8, Q)
220
- ], 8, J))), 128))
221
- ], 10, G);
93
+ }, null, 8, M),
94
+ B(" " + f(l(g)(o)), 1)
95
+ ], 8, L)
96
+ ], 8, I))), 128))
97
+ ], 10, q);
222
98
  };
223
99
  }
224
100
  });
225
101
  export {
226
- te as default
102
+ T as default
227
103
  };
@@ -1 +1 @@
1
- (function(r,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],p):(r=typeof globalThis<"u"?globalThis:r||self,r.VvDropdown=p(r.vue,r.nanoid))})(this,function(r,p){"use strict";function V(n,t,e){return e?C(n,e)===C(t,e):k(n,t)}function k(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=Array.isArray(n),i=Array.isArray(t);let o,u,l;if(e&&i){if(u=n.length,u!=t.length)return!1;for(o=u;o--!==0;)if(!k(n[o],t[o]))return!1;return!0}if(e!=i)return!1;const a=n instanceof Date,d=t instanceof Date;if(a!=d)return!1;if(a&&d)return n.getTime()==t.getTime();const f=n instanceof RegExp,h=t instanceof RegExp;if(f!=h)return!1;if(f&&h)return n.toString()==t.toString();const m=Object.keys(n);if(u=m.length,u!==Object.keys(t).length)return!1;for(o=u;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,m[o]))return!1;for(o=u;o--!==0;)if(l=m[o],!k(n[l],t[l]))return!1;return!0}return n!==n&&t!==t}function C(n,t){if(n&&Object.keys(n).length&&t){if(t.indexOf(".")===-1)return n[t];{const e=t.split(".");let i=n;for(let o=0,u=e.length;o<u;++o){if(n==null)return null;i=i[e[o]]}return i}}else return null}function _(n,t){let e=-1;if(t){for(let i=0;i<t.length;i++)if(V(t[i],n)){e=i;break}}return e}function b(n,t){if(n!=null&&t&&t.length){for(const e of t)if(V(n,e))return!0}return!1}function B(n,t){const e=_(n,t);return e>-1?t.filter((i,o)=>o!==e):t}function O(n){var t,e;if(n)return(e=(t=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:t.join("-"))==null?void 0:e.toLowerCase()}function N(n,t){const e={[`${n}`]:!0};return{bemCssClasses:r.computed(()=>Object.keys(t).reduce((o,u)=>{const l=r.unref(t[u])||!1;if(!l)return o;if(u==="modifiers"){const a=Array.isArray(l)?l:l.split(" ");return{...o,...a.reduce((d,f)=>({...d,[`${n}--${O(f)}`]:!0}),{})}}else return{...o,[`${n}--${O(u)}`]:l}},e)||{})}}function S(n){const{options:t,labelKey:e,valueKey:i}=r.toRefs(n);return{options:t,getOptionLabel:l=>typeof l!="object"&&l!==null?l:typeof e.value=="function"?e.value(l):l[e.value],getOptionValue:l=>typeof l!="object"&&l!==null?l:typeof i.value=="function"?i.value(l):l[i.value]}}const D={...{id:[String,Number],name:{type:String,required:!0}},...{options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"}},...{disabled:Boolean},...{modifiers:[String,Array]},modelValue:{type:[String,Number,Boolean,Object,Array]},labelNoResults:{type:String,default:"No results"},multiple:Boolean,maxValues:[Number,String],unselectable:{type:Boolean,default:!0}},E=["id"],j={key:0,role:"option"},w=["aria-selected"],x=["for","onClick"],P=["id","type","value","checked","disabled","name"],$={name:"VvDropdown"};return r.defineComponent({...$,props:D,emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=r.computed(()=>String(e.id||p.nanoid())),{modifiers:o,disabled:u}=r.toRefs(e),{getOptionLabel:l,getOptionValue:a}=S(e),{bemCssClasses:d}=N("vv-dropdown",{modifiers:o,disabled:u});function f(s){return Array.isArray(e.modelValue)?b(s,e.modelValue)||b(a(s),e.modelValue):V(s,e.modelValue)||V(a(s),e.modelValue)}function h(s){return typeof s=="string"||s.disabled===void 0?u.value:s.disabled}function m(s){var g;if(e.disabled)return;let y=s;if(e.multiple)if(Array.isArray(e.modelValue)){if(e.maxValues!==void 0&&e.maxValues>=0&&((g=e.modelValue)==null?void 0:g.length)>=e.maxValues&&!b(s,e.modelValue))return;y=b(s,e.modelValue)?B(s,e.modelValue):[...e.modelValue,s]}else y=[s];else e.unselectable&&s===e.modelValue&&(y=void 0);t("update:modelValue",y)}return(s,y)=>{var g;return r.openBlock(),r.createElementBlock("ul",{id:r.unref(i),class:r.normalizeClass(r.unref(d)),role:"listbox"},[(g=s.options)!=null&&g.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",j,[r.createElementVNode("label",null,r.toDisplayString(s.labelNoResults),1)])),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,A)=>(r.openBlock(),r.createElementBlock("li",{key:A,role:"option","aria-selected":f(c)},[r.createElementVNode("label",{for:`dropdown-${A}-${r.unref(i)}`,onClick:r.withModifiers(F=>m(r.unref(a)(c)),["prevent"])},[r.createElementVNode("input",{id:`dropdown-${A}-${r.unref(i)}`,type:s.multiple?"checkbox":"radio",value:r.unref(a)(c),checked:f(c),disabled:h(c),name:s.name,tabindex:"-1","aria-hidden":"true"},null,8,P),r.createTextVNode(" "+r.toDisplayString(r.unref(l)(c)),1)],8,x)],8,w))),128))],10,E)}}})});
1
+ (function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.VvDropdown=l(e.vue,e.nanoid))})(this,function(e,l){"use strict";const m={...{id:[String,Number],name:{type:String,required:!0}},...{options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"}},...{disabled:Boolean},...{modifiers:[String,Array]},modelValue:{type:[String,Number,Boolean,Object,Array]},labelNoResults:{type:String,default:"No results"},multiple:Boolean,maxValues:[Number,String],unselectable:{type:Boolean,default:!0}},p=["id"],f={key:0,role:"option"},V=["aria-selected"],b=["for","onClick"],y=["id","type","value","checked","disabled","name"],h={name:"VvDropdown"};return e.defineComponent({...h,props:m,emits:["update:modelValue"],setup(g,{emit:k}){const t=g,a=computed(()=>String(t.id||l.nanoid())),{modifiers:_,disabled:u}=toRefs(t),{getOptionLabel:B,getOptionValue:i}=useOptions(t),{bemCssClasses:N}=useBemModifiers("vv-dropdown",{modifiers:_,disabled:u});function c(o){return Array.isArray(t.modelValue)?contains(o,t.modelValue)||contains(i(o),t.modelValue):equals(o,t.modelValue)||equals(i(o),t.modelValue)}function S(o){return typeof o=="string"||o.disabled===void 0?u.value:o.disabled}function C(o){var s;if(t.disabled)return;let r=o;if(t.multiple)if(Array.isArray(t.modelValue)){if(t.maxValues!==void 0&&t.maxValues>=0&&((s=t.modelValue)==null?void 0:s.length)>=t.maxValues&&!contains(o,t.modelValue))return;r=contains(o,t.modelValue)?removeFromList(o,t.modelValue):[...t.modelValue,o]}else r=[o];else t.unselectable&&o===t.modelValue&&(r=void 0);k("update:modelValue",r)}return(o,r)=>{var s;return e.openBlock(),e.createElementBlock("ul",{id:e.unref(a),class:e.normalizeClass(e.unref(N)),role:"listbox"},[(s=o.options)!=null&&s.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",f,[e.createElementVNode("label",null,e.toDisplayString(o.labelNoResults),1)])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,(n,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,role:"option","aria-selected":c(n)},[e.createElementVNode("label",{for:`dropdown-${d}-${e.unref(a)}`,onClick:e.withModifiers(O=>C(e.unref(i)(n)),["prevent"])},[e.createElementVNode("input",{id:`dropdown-${d}-${e.unref(a)}`,type:o.multiple?"checkbox":"radio",value:e.unref(i)(n),checked:c(n),disabled:S(n),name:o.name,tabindex:"-1","aria-hidden":"true"},null,8,y),e.createTextVNode(" "+e.toDisplayString(e.unref(B)(n)),1)],8,b)],8,V))),128))],10,p)}}})});
@@ -1,7 +1,7 @@
1
1
  import type { Option } from '@/types/generic';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  modelValue: {
4
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
4
+ type: (StringConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
5
5
  };
6
6
  labelNoResults: {
7
7
  type: StringConstructor;
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
34
34
  };
35
35
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
36
  modelValue: {
37
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
37
+ type: (StringConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
38
38
  };
39
39
  labelNoResults: {
40
40
  type: StringConstructor;
@@ -3,7 +3,7 @@ export declare const VvDropdownProps: {
3
3
  * modelValue can be a string, number, boolean, object or array of string, number, boolean, object
4
4
  */
5
5
  modelValue: {
6
- type: (ArrayConstructor | ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
6
+ type: (StringConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
7
7
  };
8
8
  /**
9
9
  * Label of "no results" options
@@ -1,6 +1,6 @@
1
- import { computed as g, unref as f, defineComponent as S, ref as $, toRefs as b, inject as y, openBlock as C, createBlock as F, mergeProps as B, createCommentVNode as A } from "vue";
2
- import { iconExists as u, Icon as I, addIcon as P } from "@iconify/vue";
3
- const V = "ds", D = {
1
+ import { defineComponent as h, unref as s, openBlock as w, createBlock as S, mergeProps as $, createCommentVNode as y } from "vue";
2
+ import { iconExists as a, Icon as F, addIcon as B } from "@iconify/vue";
3
+ const b = "ds", I = {
4
4
  color: String,
5
5
  width: {
6
6
  type: [String, Number]
@@ -31,80 +31,45 @@ const V = "ds", D = {
31
31
  modifiers: {
32
32
  type: [String, Array]
33
33
  }
34
- };
35
- function h(i) {
36
- var r, s;
37
- if (i)
38
- return (s = (r = i.match(
39
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
40
- )) == null ? void 0 : r.join("-")) == null ? void 0 : s.toLowerCase();
41
- }
42
- function L(i, r) {
43
- const s = { [`${i}`]: !0 };
44
- return {
45
- bemCssClasses: g(() => Object.keys(r).reduce((o, a) => {
46
- const t = f(r[a]) || !1;
47
- if (!t)
48
- return o;
49
- if (a === "modifiers") {
50
- const d = Array.isArray(t) ? t : t.split(" ");
51
- return {
52
- ...o,
53
- ...d.reduce(
54
- (m, l) => ({
55
- ...m,
56
- [`${i}--${h(l)}`]: !0
57
- }),
58
- {}
59
- )
60
- };
61
- } else
62
- return {
63
- ...o,
64
- [`${i}--${h(a)}`]: t
65
- };
66
- }, s) || {})
67
- };
68
- }
69
- const M = {
34
+ }, P = {
70
35
  name: "VvIcon"
71
- }, N = /* @__PURE__ */ S({
72
- ...M,
73
- props: D,
74
- setup(i) {
75
- const r = i, s = $(!0), { modifiers: v } = b(r), o = y(V), { bemCssClasses: a } = L("vv-icon", {
76
- modifiers: v
77
- }), t = g(() => r.provider || (o == null ? void 0 : o.provider)), d = g(() => {
78
- const e = r.name ?? "", n = `@${t.value}:${r.prefix}:${r.name}`;
79
- return u(e) ? e : u(n) ? n : (o == null ? void 0 : o.iconsCollections.find((c) => {
80
- const p = `@${t.value}:${c.prefix}:${e}`;
81
- if (u(p))
82
- return p;
36
+ }, E = /* @__PURE__ */ h({
37
+ ...P,
38
+ props: I,
39
+ setup(u) {
40
+ const o = u, c = ref(!0), { modifiers: f } = toRefs(o), r = inject(b), { bemCssClasses: m } = useBemModifiers("vv-icon", {
41
+ modifiers: f
42
+ }), i = computed(() => o.provider || (r == null ? void 0 : r.provider)), d = computed(() => {
43
+ const e = o.name ?? "", n = `@${i.value}:${o.prefix}:${o.name}`;
44
+ return a(e) ? e : a(n) ? n : (r == null ? void 0 : r.iconsCollections.find((t) => {
45
+ const l = `@${i.value}:${t.prefix}:${e}`;
46
+ if (a(l))
47
+ return l;
83
48
  })) || e;
84
49
  });
85
- function m(e) {
50
+ function g(e) {
86
51
  let n = null;
87
52
  if (typeof window > "u") {
88
- const { JSDOM: w } = require("jsdom");
89
- n = new w().window;
53
+ const { JSDOM: v } = require("jsdom");
54
+ n = new v().window;
90
55
  }
91
56
  return (n ? new n.DOMParser() : new window.DOMParser()).parseFromString(e, "text/html").querySelector("svg");
92
57
  }
93
- function l(e) {
94
- const n = m(e), c = (n == null ? void 0 : n.innerHTML.trim()) || "";
95
- n && c && P(`@${t.value}:${r.prefix}:${r.name}`, {
96
- body: c,
58
+ function p(e) {
59
+ const n = g(e), t = (n == null ? void 0 : n.innerHTML.trim()) || "";
60
+ n && t && B(`@${i.value}:${o.prefix}:${o.name}`, {
61
+ body: t,
97
62
  height: n.viewBox.baseVal.height,
98
63
  width: n.viewBox.baseVal.width
99
64
  });
100
65
  }
101
- return o && (r.src && !u(`@${t.value}:${r.prefix}:${r.name}`) ? (s.value = !1, o.fetchIcon(r.src).then((e) => {
102
- e && (l(e), s.value = !0);
66
+ return r && (o.src && !a(`@${i.value}:${o.prefix}:${o.name}`) ? (c.value = !1, r.fetchIcon(o.src).then((e) => {
67
+ e && (p(e), c.value = !0);
103
68
  }).catch((e) => {
104
69
  throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
105
- })) : r.svg && l(r.svg)), (e, n) => s.value ? (C(), F(f(I), B({
70
+ })) : o.svg && p(o.svg)), (e, n) => s(c) ? (w(), S(s(F), $({
106
71
  key: 0,
107
- class: f(a)
72
+ class: s(m)
108
73
  }, {
109
74
  inline: e.inline,
110
75
  width: e.width,
@@ -115,10 +80,10 @@ const M = {
115
80
  rotate: e.rotate,
116
81
  color: e.color,
117
82
  onLoad: e.onLoad,
118
- icon: f(d)
119
- }), null, 16, ["class"])) : A("", !0);
83
+ icon: s(d)
84
+ }), null, 16, ["class"])) : y("", !0);
120
85
  }
121
86
  });
122
87
  export {
123
- N as default
88
+ E as default
124
89
  };
@@ -1 +1 @@
1
- (function(n,t){typeof exports=="object"&&typeof module<"u"?module.exports=t(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],t):(n=typeof globalThis<"u"?globalThis:n||self,n.VvIcon=t(n.vue,n.vue$1))})(this,function(n,t){"use strict";const w="ds",S={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};function g(c){var r,a;if(c)return(a=(r=c.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:r.join("-"))==null?void 0:a.toLowerCase()}function y(c,r){const a={[`${c}`]:!0};return{bemCssClasses:n.computed(()=>Object.keys(r).reduce((i,l)=>{const s=n.unref(r[l])||!1;if(!s)return i;if(l==="modifiers"){const d=Array.isArray(s)?s:s.split(" ");return{...i,...d.reduce((p,u)=>({...p,[`${c}--${g(u)}`]:!0}),{})}}else return{...i,[`${c}--${g(l)}`]:s}},a)||{})}}const v={name:"VvIcon"};return n.defineComponent({...v,props:S,setup(c){const r=c,a=n.ref(!0),{modifiers:h}=n.toRefs(r),i=n.inject(w),{bemCssClasses:l}=y("vv-icon",{modifiers:h}),s=n.computed(()=>r.provider||(i==null?void 0:i.provider)),d=n.computed(()=>{const e=r.name??"",o=`@${s.value}:${r.prefix}:${r.name}`;return t.iconExists(e)?e:t.iconExists(o)?o:(i==null?void 0:i.iconsCollections.find(f=>{const m=`@${s.value}:${f.prefix}:${e}`;if(t.iconExists(m))return m}))||e});function p(e){let o=null;if(typeof window>"u"){const{JSDOM:C}=require("jsdom");o=new C().window}return(o?new o.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}function u(e){const o=p(e),f=(o==null?void 0:o.innerHTML.trim())||"";o&&f&&t.addIcon(`@${s.value}:${r.prefix}:${r.name}`,{body:f,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&(r.src&&!t.iconExists(`@${s.value}:${r.prefix}:${r.name}`)?(a.value=!1,i.fetchIcon(r.src).then(e=>{e&&(u(e),a.value=!0)}).catch(e=>{throw new Error(`During fetch icon: ${e==null?void 0:e.message}`)})):r.svg&&u(r.svg)),(e,o)=>a.value?(n.openBlock(),n.createBlock(n.unref(t.Icon),n.mergeProps({key:0,class:n.unref(l)},{inline:e.inline,width:e.width,height:e.height,horizontalFlip:e.horizontalFlip,verticalFlip:e.verticalFlip,flip:e.flip,rotate:e.rotate,color:e.color,onLoad:e.onLoad,icon:n.unref(d)}),null,16,["class"])):n.createCommentVNode("",!0)}})});
1
+ (function(n,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],r):(n=typeof globalThis<"u"?globalThis:n||self,n.VvIcon=r(n.vue,n.vue$1))})(this,function(n,r){"use strict";const d="ds",u={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}},p={name:"VvIcon"};return n.defineComponent({...p,props:u,setup(m){const o=m,l=ref(!0),{modifiers:g}=toRefs(o),t=inject(d),{bemCssClasses:h}=useBemModifiers("vv-icon",{modifiers:g}),c=computed(()=>o.provider||(t==null?void 0:t.provider)),v=computed(()=>{const e=o.name??"",i=`@${c.value}:${o.prefix}:${o.name}`;return r.iconExists(e)?e:r.iconExists(i)?i:(t==null?void 0:t.iconsCollections.find(s=>{const a=`@${c.value}:${s.prefix}:${e}`;if(r.iconExists(a))return a}))||e});function w(e){let i=null;if(typeof window>"u"){const{JSDOM:S}=require("jsdom");i=new S().window}return(i?new i.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}function f(e){const i=w(e),s=(i==null?void 0:i.innerHTML.trim())||"";i&&s&&r.addIcon(`@${c.value}:${o.prefix}:${o.name}`,{body:s,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return t&&(o.src&&!r.iconExists(`@${c.value}:${o.prefix}:${o.name}`)?(l.value=!1,t.fetchIcon(o.src).then(e=>{e&&(f(e),l.value=!0)}).catch(e=>{throw new Error(`During fetch icon: ${e==null?void 0:e.message}`)})):o.svg&&f(o.svg)),(e,i)=>n.unref(l)?(n.openBlock(),n.createBlock(n.unref(r.Icon),n.mergeProps({key:0,class:n.unref(h)},{inline:e.inline,width:e.width,height:e.height,horizontalFlip:e.horizontalFlip,verticalFlip:e.verticalFlip,flip:e.flip,rotate:e.rotate,color:e.color,onLoad:e.onLoad,icon:n.unref(v)}),null,16,["class"])):n.createCommentVNode("",!0)}})});