@volverjs/ui-vue 0.0.9-beta.2 → 0.0.9-beta.21
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/README.md +3 -3
- package/auto-imports.d.ts +2 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +15 -7
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +15 -7
- package/dist/components/VvAction/VvAction.es.js +17 -8
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
- package/dist/components/VvAction/index.d.ts +4 -0
- package/dist/components/VvAlert/VvAlert.es.js +22 -13
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
- package/dist/components/VvAlert/index.d.ts +3 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +22 -13
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +6 -6
- package/dist/components/VvAlertGroup/index.d.ts +2 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +15 -7
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +15 -7
- package/dist/components/VvBadge/VvBadge.es.js +15 -7
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +15 -7
- package/dist/components/VvButton/VvButton.es.js +19 -9
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
- package/dist/components/VvButton/index.d.ts +4 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +15 -7
- package/dist/components/VvCard/VvCard.es.js +15 -7
- package/dist/components/VvCheckbox/VvCheckbox.es.js +99 -21
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +105 -22
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +256 -191
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +329 -101
- package/dist/components/VvCombobox/index.d.ts +123 -37
- package/dist/components/VvDialog/VvDialog.es.js +50 -37
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +32 -18
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +300 -92
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +99 -30
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +17 -8
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +15 -7
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +15 -7
- package/dist/components/VvInputText/VvInputText.es.js +279 -116
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +23 -41
- package/dist/components/VvInputText/index.d.ts +15 -33
- package/dist/components/VvNav/VvNav.es.js +18 -9
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/index.d.ts +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +15 -7
- package/dist/components/VvRadio/VvRadio.es.js +99 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +105 -22
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +95 -21
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +5 -5
- package/dist/components/VvTab/VvTab.es.js +18 -9
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +103 -26
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +15 -7
- package/dist/components/common/HintSlot.d.ts +4 -3
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.es.js +1212 -626
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +27 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +81 -0
- package/dist/composables/index.umd.js +1 -0
- package/dist/constants.d.ts +14 -0
- package/dist/directives/index.es.js +15 -7
- package/dist/directives/v-tooltip.es.js +15 -7
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +107 -31
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -2
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +54 -269
- package/dist/stories/Alert/Alert.settings.d.ts +3 -7
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
- package/dist/stories/Button/Button.settings.d.ts +3 -13
- package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
- package/dist/stories/InputText/InputText.settings.d.ts +31 -9
- package/dist/stories/InputText/InputText.stories.d.ts +0 -1
- package/dist/stories/InputText/InputTextMask.stories.d.ts +12 -0
- package/dist/stories/Nav/Nav.settings.d.ts +3 -21
- package/package.json +75 -66
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAction/VvAction.vue +2 -1
- package/src/components/VvAlert/VvAlert.vue +5 -1
- package/src/components/VvAlert/index.ts +3 -3
- package/src/components/VvAlertGroup/VvAlertGroup.vue +2 -0
- package/src/components/VvButton/VvButton.vue +1 -0
- package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
- package/src/components/VvCombobox/VvCombobox.vue +43 -23
- package/src/components/VvCombobox/index.ts +24 -0
- package/src/components/VvDialog/VvDialog.vue +22 -19
- package/src/components/VvDropdown/VvDropdown.vue +24 -18
- package/src/components/VvInputText/VvInputText.vue +177 -55
- package/src/components/VvInputText/index.ts +32 -34
- package/src/components/VvNav/VvNav.vue +1 -1
- package/src/components/VvNav/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +8 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
- package/src/components/VvSelect/VvSelect.vue +8 -1
- package/src/components/VvTextarea/VvTextarea.vue +16 -6
- package/src/components/common/HintSlot.ts +26 -13
- package/src/components/index.ts +5 -0
- package/src/composables/alert/useAlert.ts +103 -0
- package/src/composables/index.ts +1 -0
- package/src/constants.ts +26 -0
- package/src/props/index.ts +14 -11
- package/src/resolvers/unplugin.ts +3 -0
- package/src/stories/Alert/Alert.settings.ts +3 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
- package/src/stories/Button/Button.settings.ts +5 -3
- package/src/stories/Combobox/Combobox.settings.ts +119 -2
- package/src/stories/Combobox/Combobox.test.ts +1 -1
- package/src/stories/InputText/InputText.settings.ts +36 -15
- package/src/stories/InputText/InputText.stories.ts +4 -12
- package/src/stories/InputText/InputText.test.ts +31 -15
- package/src/stories/InputText/InputTextMask.stories.ts +122 -0
- package/src/stories/Nav/Nav.settings.ts +3 -1
- package/src/stories/Tab/Tab.stories.ts +3 -3
- package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
- package/src/types/alert.d.ts +20 -0
- /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
- /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
- /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
- /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
|
@@ -29,7 +29,7 @@ export declare const VvAlertGroupProps: {
|
|
|
29
29
|
default: boolean;
|
|
30
30
|
};
|
|
31
31
|
inline: {
|
|
32
|
-
type: globalThis.PropType<"start" | "
|
|
32
|
+
type: globalThis.PropType<"start" | "end" | "middle">;
|
|
33
33
|
default: undefined;
|
|
34
34
|
};
|
|
35
35
|
block: {
|
|
@@ -37,7 +37,7 @@ export declare const VvAlertGroupProps: {
|
|
|
37
37
|
default: undefined;
|
|
38
38
|
};
|
|
39
39
|
position: {
|
|
40
|
-
type: globalThis.PropType<"
|
|
40
|
+
type: globalThis.PropType<"absolute" | "fixed">;
|
|
41
41
|
default: undefined;
|
|
42
42
|
};
|
|
43
43
|
transition: {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode } from "vue";
|
|
2
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
|
+
Strategy2["absolute"] = "absolute";
|
|
4
|
+
Strategy2["fixed"] = "fixed";
|
|
5
|
+
return Strategy2;
|
|
6
|
+
})(Strategy || {});
|
|
2
7
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
3
8
|
Side2["left"] = "left";
|
|
4
9
|
Side2["right"] = "right";
|
|
@@ -114,19 +119,15 @@ const ModifiersProps = {
|
|
|
114
119
|
placement: {
|
|
115
120
|
type: String,
|
|
116
121
|
default: Side.bottom,
|
|
117
|
-
validator: (value) =>
|
|
118
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
119
|
-
}
|
|
122
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
120
123
|
},
|
|
121
124
|
/**
|
|
122
125
|
* Dropdown strategy
|
|
123
126
|
*/
|
|
124
127
|
strategy: {
|
|
125
128
|
type: String,
|
|
126
|
-
default:
|
|
127
|
-
validator: (value) =>
|
|
128
|
-
return ["fixed", "absolute"].includes(value);
|
|
129
|
-
}
|
|
129
|
+
default: void 0,
|
|
130
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
130
131
|
},
|
|
131
132
|
/**
|
|
132
133
|
* Dropdown show / hide transition name
|
|
@@ -216,6 +217,13 @@ const ModifiersProps = {
|
|
|
216
217
|
type: String,
|
|
217
218
|
default: ButtonType.button,
|
|
218
219
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* Button aria-label
|
|
223
|
+
*/
|
|
224
|
+
ariaLabel: {
|
|
225
|
+
type: String,
|
|
226
|
+
default: void 0
|
|
219
227
|
}
|
|
220
228
|
});
|
|
221
229
|
const VvAvatarProps = {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, Fragment, renderList, createBlock, mergeProps, withCtx, toDisplayString, createTextVNode } from "vue";
|
|
2
2
|
import { nanoid } from "nanoid";
|
|
3
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
4
|
+
Strategy2["absolute"] = "absolute";
|
|
5
|
+
Strategy2["fixed"] = "fixed";
|
|
6
|
+
return Strategy2;
|
|
7
|
+
})(Strategy || {});
|
|
3
8
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
4
9
|
Side2["left"] = "left";
|
|
5
10
|
Side2["right"] = "right";
|
|
@@ -115,19 +120,15 @@ const ModifiersProps = {
|
|
|
115
120
|
placement: {
|
|
116
121
|
type: String,
|
|
117
122
|
default: Side.bottom,
|
|
118
|
-
validator: (value) =>
|
|
119
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
120
|
-
}
|
|
123
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
121
124
|
},
|
|
122
125
|
/**
|
|
123
126
|
* Dropdown strategy
|
|
124
127
|
*/
|
|
125
128
|
strategy: {
|
|
126
129
|
type: String,
|
|
127
|
-
default:
|
|
128
|
-
validator: (value) =>
|
|
129
|
-
return ["fixed", "absolute"].includes(value);
|
|
130
|
-
}
|
|
130
|
+
default: void 0,
|
|
131
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
131
132
|
},
|
|
132
133
|
/**
|
|
133
134
|
* Dropdown show / hide transition name
|
|
@@ -217,6 +218,13 @@ const ModifiersProps = {
|
|
|
217
218
|
type: String,
|
|
218
219
|
default: ButtonType.button,
|
|
219
220
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* Button aria-label
|
|
224
|
+
*/
|
|
225
|
+
ariaLabel: {
|
|
226
|
+
type: String,
|
|
227
|
+
default: void 0
|
|
220
228
|
}
|
|
221
229
|
});
|
|
222
230
|
const VvAvatarGroupProps = {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
|
+
Strategy2["absolute"] = "absolute";
|
|
4
|
+
Strategy2["fixed"] = "fixed";
|
|
5
|
+
return Strategy2;
|
|
6
|
+
})(Strategy || {});
|
|
2
7
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
3
8
|
Side2["left"] = "left";
|
|
4
9
|
Side2["right"] = "right";
|
|
@@ -114,19 +119,15 @@ const ModifiersProps = {
|
|
|
114
119
|
placement: {
|
|
115
120
|
type: String,
|
|
116
121
|
default: Side.bottom,
|
|
117
|
-
validator: (value) =>
|
|
118
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
119
|
-
}
|
|
122
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
120
123
|
},
|
|
121
124
|
/**
|
|
122
125
|
* Dropdown strategy
|
|
123
126
|
*/
|
|
124
127
|
strategy: {
|
|
125
128
|
type: String,
|
|
126
|
-
default:
|
|
127
|
-
validator: (value) =>
|
|
128
|
-
return ["fixed", "absolute"].includes(value);
|
|
129
|
-
}
|
|
129
|
+
default: void 0,
|
|
130
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
130
131
|
},
|
|
131
132
|
/**
|
|
132
133
|
* Dropdown show / hide transition name
|
|
@@ -216,6 +217,13 @@ const ModifiersProps = {
|
|
|
216
217
|
type: String,
|
|
217
218
|
default: ButtonType.button,
|
|
218
219
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* Button aria-label
|
|
223
|
+
*/
|
|
224
|
+
ariaLabel: {
|
|
225
|
+
type: String,
|
|
226
|
+
default: void 0
|
|
219
227
|
}
|
|
220
228
|
});
|
|
221
229
|
const VvBadgeProps = {
|
|
@@ -22,6 +22,11 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
22
22
|
return toReturn;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
26
|
+
Strategy2["absolute"] = "absolute";
|
|
27
|
+
Strategy2["fixed"] = "fixed";
|
|
28
|
+
return Strategy2;
|
|
29
|
+
})(Strategy || {});
|
|
25
30
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
26
31
|
Side2["left"] = "left";
|
|
27
32
|
Side2["right"] = "right";
|
|
@@ -137,19 +142,15 @@ const ModifiersProps = {
|
|
|
137
142
|
placement: {
|
|
138
143
|
type: String,
|
|
139
144
|
default: Side.bottom,
|
|
140
|
-
validator: (value) =>
|
|
141
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
142
|
-
}
|
|
145
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
143
146
|
},
|
|
144
147
|
/**
|
|
145
148
|
* Dropdown strategy
|
|
146
149
|
*/
|
|
147
150
|
strategy: {
|
|
148
151
|
type: String,
|
|
149
|
-
default:
|
|
150
|
-
validator: (value) =>
|
|
151
|
-
return ["fixed", "absolute"].includes(value);
|
|
152
|
-
}
|
|
152
|
+
default: void 0,
|
|
153
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
153
154
|
},
|
|
154
155
|
/**
|
|
155
156
|
* Dropdown show / hide transition name
|
|
@@ -239,6 +240,13 @@ const ModifiersProps = {
|
|
|
239
240
|
type: String,
|
|
240
241
|
default: ButtonType.button,
|
|
241
242
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* Button aria-label
|
|
246
|
+
*/
|
|
247
|
+
ariaLabel: {
|
|
248
|
+
type: String,
|
|
249
|
+
default: void 0
|
|
242
250
|
}
|
|
243
251
|
});
|
|
244
252
|
const VvBreadcrumbProps = {
|
|
@@ -95,6 +95,11 @@ const VvIconProps = {
|
|
|
95
95
|
type: [String, Array]
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
99
|
+
Strategy2["absolute"] = "absolute";
|
|
100
|
+
Strategy2["fixed"] = "fixed";
|
|
101
|
+
return Strategy2;
|
|
102
|
+
})(Strategy || {});
|
|
98
103
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
99
104
|
Side2["left"] = "left";
|
|
100
105
|
Side2["right"] = "right";
|
|
@@ -373,19 +378,15 @@ const IdProps = {
|
|
|
373
378
|
placement: {
|
|
374
379
|
type: String,
|
|
375
380
|
default: Side.bottom,
|
|
376
|
-
validator: (value) =>
|
|
377
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
378
|
-
}
|
|
381
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
379
382
|
},
|
|
380
383
|
/**
|
|
381
384
|
* Dropdown strategy
|
|
382
385
|
*/
|
|
383
386
|
strategy: {
|
|
384
387
|
type: String,
|
|
385
|
-
default:
|
|
386
|
-
validator: (value) =>
|
|
387
|
-
return ["fixed", "absolute"].includes(value);
|
|
388
|
-
}
|
|
388
|
+
default: void 0,
|
|
389
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
389
390
|
},
|
|
390
391
|
/**
|
|
391
392
|
* Dropdown show / hide transition name
|
|
@@ -475,6 +476,13 @@ const ActionProps = {
|
|
|
475
476
|
type: String,
|
|
476
477
|
default: ButtonType.button,
|
|
477
478
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
479
|
+
},
|
|
480
|
+
/**
|
|
481
|
+
* Button aria-label
|
|
482
|
+
*/
|
|
483
|
+
ariaLabel: {
|
|
484
|
+
type: String,
|
|
485
|
+
default: void 0
|
|
478
486
|
}
|
|
479
487
|
};
|
|
480
488
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
@@ -530,7 +538,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
530
538
|
const hasProps = computed(() => {
|
|
531
539
|
const toReturn = {
|
|
532
540
|
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
533
|
-
|
|
541
|
+
ariaPressed: pressed.value ? true : void 0,
|
|
542
|
+
ariaLabel: props.ariaLabel,
|
|
534
543
|
role: role == null ? void 0 : role.value
|
|
535
544
|
};
|
|
536
545
|
switch (hasTag.value) {
|
|
@@ -912,7 +921,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
912
921
|
to: _ctx.to,
|
|
913
922
|
href: _ctx.href,
|
|
914
923
|
target: _ctx.target,
|
|
915
|
-
rel: _ctx.rel
|
|
924
|
+
rel: _ctx.rel,
|
|
925
|
+
ariaLabel: _ctx.ariaLabel
|
|
916
926
|
}, {
|
|
917
927
|
id: unref(hasId),
|
|
918
928
|
ref_key: "element",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.nanoid)}(this,(function(e,t,o){"use strict";const n={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]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{}),a=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(a||{});const s=Symbol.for("volver"),c=Symbol.for("buttonGroup"),d=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function v(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}const m=e.defineComponent({name:"VvIcon",props:n,setup(o){const n=o,r=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),l=e.ref(!0),i=v(),{modifiers:u}=e.toRefs(n),a=p("vv-icon",u),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),c=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const r=null==i?void 0:i.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return r?`@${s.value}:${r.prefix}:${e}`:e}));function d(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==o?void 0:o.innerHTML.trim())||"";o&&r&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(l.value=!1,i.fetchIcon(n.src).then((e=>{e&&(d(e),l.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&d(n.svg),(o,n)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(a)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(r),color:o.color,onLoad:o.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(a).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},y={disabled:Boolean},h={active:Boolean},S={pressed:Boolean},k={label:[String,Number]},B={modifiers:[String,Array]};l.before;const $={unselectable:{type:Boolean,default:!0}},x={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...y,...k,...S,...h,...g,type:{type:String,default:i.button,validator:e=>Object.values(i).includes(e)}},A=w;const j=e.defineComponent({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,l=v(),i=e.ref(null);o({$el:i});const{reference:a,bus:s,aria:c,expanded:p}=e.inject(d,{});e.watch((()=>i.value),(e=>{a&&(a.value=e)}));const m=e.computed((()=>r.pressed||(null==p?void 0:p.value))),{role:g}=e.inject(f,{}),b=e.computed((()=>{switch(!0){case r.disabled:return u.button;case void 0!==r.to:return(null==l?void 0:l.nuxt)?u.nuxtLink:u.routerLink;case void 0!==r.href:return u.a;default:return u.button}})),y=e.computed((()=>{const e={...null==c?void 0:c.value,"aria-pressed":!!m.value||void 0,role:null==g?void 0:g.value};switch(b.value){case u.a:return{...e,href:r.href,target:r.target,rel:r.rel};case u.routerLink:case u.nuxtLink:return{...e,to:r.to,target:r.target};default:return{...e,type:r.type,disabled:r.disabled}}})),h=e=>{r.disabled?e.preventDefault():(null==s||s.emit("click",e),n("click",e))},S=e=>{null==s||s.emit("mouseover",e),n("mouseover",e)},k=e=>{null==s||s.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(y),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:k}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function V(e,t,o){return o?O(e,o)===O(t,o):_(e,t)}function _(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let r,l,i;if(o&&n){if(l=e.length,l!=t.length)return!1;for(r=l;0!=r--;)if(!_(e[r],t[r]))return!1;return!0}if(o!=n)return!1;const u=e instanceof Date,a=t instanceof Date;if(u!=a)return!1;if(u&&a)return e.getTime()==t.getTime();const s=e instanceof RegExp,c=t instanceof RegExp;if(s!=c)return!1;if(s&&c)return e.toString()==t.toString();const d=Object.keys(e);if(l=d.length,l!==Object.keys(t).length)return!1;for(r=l;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,d[r]))return!1;for(r=l;0!=r--;)if(i=d[r],!_(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function O(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,r=o.length;t<r;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function L(e,t){if(null!=e&&t&&t.length)for(const o of t)if(V(e,o))return!0;return!1}function N(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,r){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const l=e.toRef(n,t);return e.computed({get:()=>l.value,set(e){r&&r(`update:${t}`,e)}})}}}const P={...w,...x,...B,...$,...b,icon:[String,Object],iconPosition:{type:String,default:r.left,validator:e=>Object.values(r).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const C={key:1,class:"vv-button__label"},E={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:P,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const i=t,u=e.useAttrs(),a=e.useSlots(),{id:s,modifiers:d,iconPosition:f,icon:v,label:g,modelValue:b,disabled:y,toggle:h,unselectable:S}=function(t,o){const{group:n,isInGroup:r,getGroupOrLocalRef:l}=N(c),{id:i,iconPosition:u,icon:a,label:s,pressed:d}=e.toRefs(t),f=l("modelValue",t,o),v=l("toggle",t),p=l("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const r=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>r.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>r.add(e)))),Array.from(r)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:r,modelValue:f,toggle:v,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:d,iconPosition:u,icon:a,label:s}}(i,l),k=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(s),B=e.computed((()=>(null==u?void 0:u.name)||k.value)),$=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=$.value)?void 0:e.$el}))});const x=e.computed((()=>h.value?Array.isArray(b.value)?L(B.value,b.value):V(B.value,b.value):i.pressed)),w=p("vv-button",d,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==g?void 0:g.value)&&!a.default)})))),A=e.computed((()=>"string"==typeof(null==v?void 0:v.value)?{name:null==v?void 0:v.value}:null==v?void 0:v.value)),_=e.computed((()=>void 0!==i.value?i.value:B.value)),O=()=>{if(h.value){if(Array.isArray(b.value))return L(_.value,b.value)?void(S.value&&(b.value=b.value.filter((e=>e!==_.value)))):void b.value.push(_.value);if(_.value===b.value&&S.value)return void(b.value=i.uncheckedValue);b.value=_.value}};return(t,o)=>(e.openBlock(),e.createBlock(j,e.mergeProps({disabled:e.unref(y),pressed:e.unref(x),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel},{id:e.unref(k),ref_key:"element",ref:$,class:e.unref(w),onClick:O}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(v)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(A)),null,16)):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("span",E,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.nanoid)}(this,(function(e,t,o){"use strict";const n={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]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),u=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(u||{});const s=Symbol.for("volver"),c=Symbol.for("buttonGroup"),d=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function v(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}const m=e.defineComponent({name:"VvIcon",props:n,setup(o){const n=o,r=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),l=e.ref(!0),i=v(),{modifiers:a}=e.toRefs(n),u=p("vv-icon",a),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),c=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const r=null==i?void 0:i.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return r?`@${s.value}:${r.prefix}:${e}`:e}));function d(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==o?void 0:o.innerHTML.trim())||"";o&&r&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(l.value=!1,i.fetchIcon(n.src).then((e=>{e&&(d(e),l.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&d(n.svg),(o,n)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(r),color:o.color,onLoad:o.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(u).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},y={disabled:Boolean},h={active:Boolean},S={pressed:Boolean},k={label:[String,Number]},B={modifiers:[String,Array]};l.before;const $={unselectable:{type:Boolean,default:!0}},x={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...y,...k,...S,...h,...g,type:{type:String,default:i.button,validator:e=>Object.values(i).includes(e)},ariaLabel:{type:String,default:void 0}},A=w;const L=e.defineComponent({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,l=v(),i=e.ref(null);o({$el:i});const{reference:u,bus:s,aria:c,expanded:p}=e.inject(d,{});e.watch((()=>i.value),(e=>{u&&(u.value=e)}));const m=e.computed((()=>r.pressed||(null==p?void 0:p.value))),{role:g}=e.inject(f,{}),b=e.computed((()=>{switch(!0){case r.disabled:return a.button;case void 0!==r.to:return(null==l?void 0:l.nuxt)?a.nuxtLink:a.routerLink;case void 0!==r.href:return a.a;default:return a.button}})),y=e.computed((()=>{const e={...null==c?void 0:c.value,ariaPressed:!!m.value||void 0,ariaLabel:r.ariaLabel,role:null==g?void 0:g.value};switch(b.value){case a.a:return{...e,href:r.href,target:r.target,rel:r.rel};case a.routerLink:case a.nuxtLink:return{...e,to:r.to,target:r.target};default:return{...e,type:r.type,disabled:r.disabled}}})),h=e=>{r.disabled?e.preventDefault():(null==s||s.emit("click",e),n("click",e))},S=e=>{null==s||s.emit("mouseover",e),n("mouseover",e)},k=e=>{null==s||s.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(y),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:k}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function j(e,t,o){return o?_(e,o)===_(t,o):V(e,t)}function V(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let r,l,i;if(o&&n){if(l=e.length,l!=t.length)return!1;for(r=l;0!=r--;)if(!V(e[r],t[r]))return!1;return!0}if(o!=n)return!1;const a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();const s=e instanceof RegExp,c=t instanceof RegExp;if(s!=c)return!1;if(s&&c)return e.toString()==t.toString();const d=Object.keys(e);if(l=d.length,l!==Object.keys(t).length)return!1;for(r=l;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,d[r]))return!1;for(r=l;0!=r--;)if(i=d[r],!V(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function _(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,r=o.length;t<r;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function O(e,t){if(null!=e&&t&&t.length)for(const o of t)if(j(e,o))return!0;return!1}function P(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,r){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const l=e.toRef(n,t);return e.computed({get:()=>l.value,set(e){r&&r(`update:${t}`,e)}})}}}const N={...w,...x,...B,...$,...b,icon:[String,Object],iconPosition:{type:String,default:r.left,validator:e=>Object.values(r).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const C={key:1,class:"vv-button__label"},E={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:N,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const i=t,a=e.useAttrs(),u=e.useSlots(),{id:s,modifiers:d,iconPosition:f,icon:v,label:g,modelValue:b,disabled:y,toggle:h,unselectable:S}=function(t,o){const{group:n,isInGroup:r,getGroupOrLocalRef:l}=P(c),{id:i,iconPosition:a,icon:u,label:s,pressed:d}=e.toRefs(t),f=l("modelValue",t,o),v=l("toggle",t),p=l("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const r=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>r.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>r.add(e)))),Array.from(r)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:r,modelValue:f,toggle:v,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:d,iconPosition:a,icon:u,label:s}}(i,l),k=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(s),B=e.computed((()=>(null==a?void 0:a.name)||k.value)),$=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=$.value)?void 0:e.$el}))});const x=e.computed((()=>h.value?Array.isArray(b.value)?O(B.value,b.value):j(B.value,b.value):i.pressed)),w=p("vv-button",d,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==g?void 0:g.value)&&!u.default)})))),A=e.computed((()=>"string"==typeof(null==v?void 0:v.value)?{name:null==v?void 0:v.value}:null==v?void 0:v.value)),V=e.computed((()=>void 0!==i.value?i.value:B.value)),_=()=>{if(h.value){if(Array.isArray(b.value))return O(V.value,b.value)?void(S.value&&(b.value=b.value.filter((e=>e!==V.value)))):void b.value.push(V.value);if(V.value===b.value&&S.value)return void(b.value=i.uncheckedValue);b.value=V.value}};return(t,o)=>(e.openBlock(),e.createBlock(L,e.mergeProps({disabled:e.unref(y),pressed:e.unref(x),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(k),ref_key:"element",ref:$,class:e.unref(w),onClick:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(v)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(A)),null,16)):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("span",E,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
|
|
@@ -42,6 +42,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
42
42
|
default: import("../../constants").ButtonType;
|
|
43
43
|
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
44
44
|
};
|
|
45
|
+
ariaLabel: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
45
49
|
to: {
|
|
46
50
|
type: (ObjectConstructor | StringConstructor)[];
|
|
47
51
|
};
|
|
@@ -103,6 +107,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
103
107
|
default: import("../../constants").ButtonType;
|
|
104
108
|
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
105
109
|
};
|
|
110
|
+
ariaLabel: {
|
|
111
|
+
type: StringConstructor;
|
|
112
|
+
default: undefined;
|
|
113
|
+
};
|
|
106
114
|
to: {
|
|
107
115
|
type: (ObjectConstructor | StringConstructor)[];
|
|
108
116
|
};
|
|
@@ -127,6 +135,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
127
135
|
modelValue: string | number | boolean;
|
|
128
136
|
type: "button" | "submit" | "reset";
|
|
129
137
|
unselectable: boolean;
|
|
138
|
+
ariaLabel: string;
|
|
130
139
|
rel: string;
|
|
131
140
|
active: boolean;
|
|
132
141
|
pressed: boolean;
|
|
@@ -66,6 +66,10 @@ export declare const VvButtonProps: {
|
|
|
66
66
|
default: import("../../constants").ButtonType;
|
|
67
67
|
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
68
68
|
};
|
|
69
|
+
ariaLabel: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
default: undefined;
|
|
72
|
+
};
|
|
69
73
|
to: {
|
|
70
74
|
type: (ObjectConstructor | StringConstructor)[];
|
|
71
75
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { isRef, provide, computed, unref, defineComponent, toRefs, watchEffect, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
2
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
|
+
Strategy2["absolute"] = "absolute";
|
|
4
|
+
Strategy2["fixed"] = "fixed";
|
|
5
|
+
return Strategy2;
|
|
6
|
+
})(Strategy || {});
|
|
2
7
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
3
8
|
Side2["left"] = "left";
|
|
4
9
|
Side2["right"] = "right";
|
|
@@ -121,19 +126,15 @@ const UnselectableProps = {
|
|
|
121
126
|
placement: {
|
|
122
127
|
type: String,
|
|
123
128
|
default: Side.bottom,
|
|
124
|
-
validator: (value) =>
|
|
125
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
126
|
-
}
|
|
129
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
127
130
|
},
|
|
128
131
|
/**
|
|
129
132
|
* Dropdown strategy
|
|
130
133
|
*/
|
|
131
134
|
strategy: {
|
|
132
135
|
type: String,
|
|
133
|
-
default:
|
|
134
|
-
validator: (value) =>
|
|
135
|
-
return ["fixed", "absolute"].includes(value);
|
|
136
|
-
}
|
|
136
|
+
default: void 0,
|
|
137
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
137
138
|
},
|
|
138
139
|
/**
|
|
139
140
|
* Dropdown show / hide transition name
|
|
@@ -223,6 +224,13 @@ const UnselectableProps = {
|
|
|
223
224
|
type: String,
|
|
224
225
|
default: ButtonType.button,
|
|
225
226
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
227
|
+
},
|
|
228
|
+
/**
|
|
229
|
+
* Button aria-label
|
|
230
|
+
*/
|
|
231
|
+
ariaLabel: {
|
|
232
|
+
type: String,
|
|
233
|
+
default: void 0
|
|
226
234
|
}
|
|
227
235
|
});
|
|
228
236
|
const VvButtonGroupProps = {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
|
+
Strategy2["absolute"] = "absolute";
|
|
4
|
+
Strategy2["fixed"] = "fixed";
|
|
5
|
+
return Strategy2;
|
|
6
|
+
})(Strategy || {});
|
|
2
7
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
3
8
|
Side2["left"] = "left";
|
|
4
9
|
Side2["right"] = "right";
|
|
@@ -114,19 +119,15 @@ const ModifiersProps = {
|
|
|
114
119
|
placement: {
|
|
115
120
|
type: String,
|
|
116
121
|
default: Side.bottom,
|
|
117
|
-
validator: (value) =>
|
|
118
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
119
|
-
}
|
|
122
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
120
123
|
},
|
|
121
124
|
/**
|
|
122
125
|
* Dropdown strategy
|
|
123
126
|
*/
|
|
124
127
|
strategy: {
|
|
125
128
|
type: String,
|
|
126
|
-
default:
|
|
127
|
-
validator: (value) =>
|
|
128
|
-
return ["fixed", "absolute"].includes(value);
|
|
129
|
-
}
|
|
129
|
+
default: void 0,
|
|
130
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
130
131
|
},
|
|
131
132
|
/**
|
|
132
133
|
* Dropdown show / hide transition name
|
|
@@ -216,6 +217,13 @@ const ModifiersProps = {
|
|
|
216
217
|
type: String,
|
|
217
218
|
default: ButtonType.button,
|
|
218
219
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* Button aria-label
|
|
223
|
+
*/
|
|
224
|
+
ariaLabel: {
|
|
225
|
+
type: String,
|
|
226
|
+
default: void 0
|
|
219
227
|
}
|
|
220
228
|
});
|
|
221
229
|
const VvCardProps = {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { unref, inject, computed, toRef, toRefs, defineComponent, h, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode,
|
|
1
|
+
import { unref, inject, computed, toRef, toRefs, isRef, defineComponent, h, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
|
|
2
2
|
import { nanoid } from "nanoid";
|
|
3
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
4
|
+
Strategy2["absolute"] = "absolute";
|
|
5
|
+
Strategy2["fixed"] = "fixed";
|
|
6
|
+
return Strategy2;
|
|
7
|
+
})(Strategy || {});
|
|
3
8
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
4
9
|
Side2["left"] = "left";
|
|
5
10
|
Side2["right"] = "right";
|
|
@@ -36,6 +41,7 @@ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
|
36
41
|
AnchorTarget2["_top"] = "_top";
|
|
37
42
|
return AnchorTarget2;
|
|
38
43
|
})(AnchorTarget || {});
|
|
44
|
+
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
39
45
|
const INJECTION_KEY_CHECK_GROUP = Symbol.for("checkGroup");
|
|
40
46
|
const LinkProps = {
|
|
41
47
|
/**
|
|
@@ -172,19 +178,15 @@ const IdProps = {
|
|
|
172
178
|
placement: {
|
|
173
179
|
type: String,
|
|
174
180
|
default: Side.bottom,
|
|
175
|
-
validator: (value) =>
|
|
176
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
177
|
-
}
|
|
181
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
178
182
|
},
|
|
179
183
|
/**
|
|
180
184
|
* Dropdown strategy
|
|
181
185
|
*/
|
|
182
186
|
strategy: {
|
|
183
187
|
type: String,
|
|
184
|
-
default:
|
|
185
|
-
validator: (value) =>
|
|
186
|
-
return ["fixed", "absolute"].includes(value);
|
|
187
|
-
}
|
|
188
|
+
default: void 0,
|
|
189
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
188
190
|
},
|
|
189
191
|
/**
|
|
190
192
|
* Dropdown show / hide transition name
|
|
@@ -304,6 +306,13 @@ const CheckboxRadioProps = {
|
|
|
304
306
|
type: String,
|
|
305
307
|
default: ButtonType.button,
|
|
306
308
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
* Button aria-label
|
|
312
|
+
*/
|
|
313
|
+
ariaLabel: {
|
|
314
|
+
type: String,
|
|
315
|
+
default: void 0
|
|
307
316
|
}
|
|
308
317
|
});
|
|
309
318
|
function equals(obj1, obj2, field) {
|
|
@@ -479,19 +488,27 @@ function joinLines(items) {
|
|
|
479
488
|
}
|
|
480
489
|
return items;
|
|
481
490
|
}
|
|
482
|
-
function HintSlotFactory(
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
491
|
+
function HintSlotFactory(propsOrRef, slots) {
|
|
492
|
+
const props = computed(() => {
|
|
493
|
+
if (isRef(propsOrRef)) {
|
|
494
|
+
return propsOrRef.value;
|
|
495
|
+
}
|
|
496
|
+
return propsOrRef;
|
|
497
|
+
});
|
|
498
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
499
|
+
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
500
|
+
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
501
|
+
const hintLabel = computed(() => props.value.hintLabel);
|
|
487
502
|
const hasLoadingLabelOrSlot = computed(
|
|
488
|
-
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
503
|
+
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
489
504
|
);
|
|
490
505
|
const hasInvalidLabelOrSlot = computed(
|
|
491
|
-
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
506
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
507
|
+
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
508
|
+
)
|
|
492
509
|
);
|
|
493
510
|
const hasValidLabelOrSlot = computed(
|
|
494
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
511
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
495
512
|
);
|
|
496
513
|
const hasHintLabelOrSlot = computed(
|
|
497
514
|
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
@@ -500,10 +517,10 @@ function HintSlotFactory(props, slots) {
|
|
|
500
517
|
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
501
518
|
);
|
|
502
519
|
const hintSlotScope = computed(() => ({
|
|
503
|
-
modelValue: props.modelValue,
|
|
504
|
-
valid: props.valid,
|
|
505
|
-
invalid: props.invalid,
|
|
506
|
-
loading: props.loading
|
|
520
|
+
modelValue: props.value.modelValue,
|
|
521
|
+
valid: props.value.valid,
|
|
522
|
+
invalid: props.value.invalid,
|
|
523
|
+
loading: props.value.loading
|
|
507
524
|
}));
|
|
508
525
|
const HintSlot = defineComponent({
|
|
509
526
|
name: "HintSlot",
|
|
@@ -583,6 +600,62 @@ function HintSlotFactory(props, slots) {
|
|
|
583
600
|
HintSlot
|
|
584
601
|
};
|
|
585
602
|
}
|
|
603
|
+
function useVolver() {
|
|
604
|
+
return inject(INJECTION_KEY_VOLVER);
|
|
605
|
+
}
|
|
606
|
+
function useDefaults(componentName, propsDefinition, props) {
|
|
607
|
+
const volver = useVolver();
|
|
608
|
+
const volverComponentDefaults = computed(() => {
|
|
609
|
+
var _a;
|
|
610
|
+
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
611
|
+
return void 0;
|
|
612
|
+
}
|
|
613
|
+
return volver.defaults.value[componentName];
|
|
614
|
+
});
|
|
615
|
+
return computed(() => {
|
|
616
|
+
if (volverComponentDefaults.value === void 0) {
|
|
617
|
+
return props;
|
|
618
|
+
}
|
|
619
|
+
const componentDefaults = volverComponentDefaults.value;
|
|
620
|
+
const simplifiedPropsDefinition = propsDefinition;
|
|
621
|
+
const simplifiedProps = props;
|
|
622
|
+
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
623
|
+
const propValue = simplifiedProps[key];
|
|
624
|
+
acc[key] = propValue;
|
|
625
|
+
if (key in componentDefaults) {
|
|
626
|
+
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
627
|
+
const typeArray = simplifiedPropsDefinition[key];
|
|
628
|
+
if (typeArray.length) {
|
|
629
|
+
const typeFunction = typeArray[0];
|
|
630
|
+
if (typeFunction === propValue) {
|
|
631
|
+
acc[key] = componentDefaults[key];
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
636
|
+
const typeFunction = simplifiedPropsDefinition[key];
|
|
637
|
+
if (typeFunction() === propValue) {
|
|
638
|
+
acc[key] = componentDefaults[key];
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
642
|
+
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
643
|
+
if (typeof defaultValue === "function") {
|
|
644
|
+
defaultValue = defaultValue();
|
|
645
|
+
}
|
|
646
|
+
if (typeof defaultValue === "object") {
|
|
647
|
+
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
648
|
+
acc[key] = componentDefaults[key];
|
|
649
|
+
}
|
|
650
|
+
} else if (defaultValue === propValue) {
|
|
651
|
+
acc[key] = componentDefaults[key];
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return acc;
|
|
656
|
+
}, {});
|
|
657
|
+
});
|
|
658
|
+
}
|
|
586
659
|
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
|
|
587
660
|
function useModifiers(prefix, modifiers, others) {
|
|
588
661
|
return computed(() => {
|
|
@@ -619,6 +692,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
619
692
|
setup(__props, { emit }) {
|
|
620
693
|
const props = __props;
|
|
621
694
|
const slots = useSlots();
|
|
695
|
+
const propsDefaults = useDefaults(
|
|
696
|
+
"VvCheckbox",
|
|
697
|
+
VvCheckboxProps,
|
|
698
|
+
props
|
|
699
|
+
);
|
|
622
700
|
const {
|
|
623
701
|
id,
|
|
624
702
|
disabled,
|
|
@@ -731,7 +809,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
731
809
|
hasHintLabelOrSlot,
|
|
732
810
|
hasInvalidLabelOrSlot,
|
|
733
811
|
hintSlotScope
|
|
734
|
-
} = HintSlotFactory(
|
|
812
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
735
813
|
return (_ctx, _cache) => {
|
|
736
814
|
return openBlock(), createElementBlock("label", {
|
|
737
815
|
class: normalizeClass(unref(bemCssClasses)),
|