@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-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/LICENSE +1 -1
- package/README.md +98 -3
- package/auto-imports.d.ts +6 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +23 -16
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +70 -14
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
- package/dist/components/VvAccordion/index.d.ts +4 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +117 -38
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
- package/dist/components/VvAccordionGroup/index.d.ts +4 -1
- package/dist/components/VvAction/VvAction.es.js +58 -13
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
- package/dist/components/VvAction/index.d.ts +25 -4
- package/dist/components/VvAlert/VvAlert.es.js +195 -152
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
- package/dist/components/VvAlert/index.d.ts +9 -5
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +240 -174
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
- package/dist/components/VvAlertGroup/index.d.ts +6 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +73 -17
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +259 -49
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +187 -141
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
- package/dist/components/VvButton/index.d.ts +41 -14
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +69 -16
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +84 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -22
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
- package/dist/components/VvCheckbox/index.d.ts +45 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +180 -67
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +758 -531
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +181 -108
- package/dist/components/VvCombobox/index.d.ts +53 -22
- package/dist/components/VvDialog/VvDialog.es.js +136 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
- package/dist/components/VvDropdown/index.d.ts +16 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +82 -22
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +33 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1734 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +313 -0
- package/dist/components/VvInputFile/index.d.ts +179 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +331 -293
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +162 -55
- package/dist/components/VvInputText/index.d.ts +71 -29
- package/dist/components/VvNav/VvNav.es.js +151 -73
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
- package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +2 -0
- package/dist/components/VvNav/index.d.ts +5 -13
- package/dist/components/VvNavItem/VvNavItem.es.js +436 -0
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.es.js +65 -14
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +89 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
- package/dist/components/VvRadio/index.d.ts +44 -11
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +180 -66
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +248 -226
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +256 -110
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
- package/dist/components/VvTab/index.d.ts +13 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +229 -212
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
- package/dist/components/VvTooltip/index.d.ts +4 -1
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +2902 -1329
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +88 -1
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +92 -31
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +90 -26
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +210 -210
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +81 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +287 -73
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +78 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
- package/dist/stories/Tab/Tab.settings.d.ts +4 -37
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +16 -0
- package/dist/types/nav.d.ts +18 -0
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +97 -80
- package/src/Volver.ts +31 -20
- 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/VvAccordion/VvAccordion.vue +2 -2
- package/src/components/VvAction/VvAction.vue +5 -2
- package/src/components/VvAlert/index.ts +1 -3
- package/src/components/VvAlertGroup/index.ts +2 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +6 -6
- package/src/components/VvButton/index.ts +2 -4
- package/src/components/VvCombobox/VvCombobox.vue +24 -16
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +365 -0
- package/src/components/VvInputFile/index.ts +116 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +17 -18
- package/src/components/VvInputText/index.ts +7 -15
- package/src/components/VvNav/VvNav.vue +30 -50
- package/src/components/VvNav/VvNavItem.vue +18 -0
- package/src/components/VvNav/VvNavSeparator.vue +11 -0
- package/src/components/VvNav/index.ts +2 -15
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +63 -35
- package/src/components/VvTab/index.ts +10 -4
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/useUniqueId.ts +2 -2
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +115 -27
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +89 -0
- package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
- package/src/stories/Nav/Nav.settings.ts +3 -4
- package/src/stories/Nav/Nav.test.ts +4 -15
- package/src/stories/Tab/Tab.settings.ts +9 -9
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/stories/argTypes.ts +1 -1
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +6 -0
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +20 -0
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
- package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
- package/dist/components/VvNav/VvNavSeparator.d.ts +0 -2
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
- package/src/components/VvNav/VvNavItemTitle.vue +0 -11
- package/src/components/VvNav/VvNavSeparator.ts +0 -8
- package/src/types/generic.d.ts +0 -6
- /package/src/types/{alert.d.ts → alert.ts} +0 -0
- /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString
|
|
1
|
+
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, createCommentVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
3
|
Strategy2["absolute"] = "absolute";
|
|
4
4
|
Strategy2["fixed"] = "fixed";
|
|
@@ -33,6 +33,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
33
33
|
ButtonType2["reset"] = "reset";
|
|
34
34
|
return ButtonType2;
|
|
35
35
|
})(ButtonType || {});
|
|
36
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
37
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
38
|
+
ActionTag2["routerLink"] = "router-link";
|
|
39
|
+
ActionTag2["a"] = "a";
|
|
40
|
+
ActionTag2["button"] = "button";
|
|
41
|
+
return ActionTag2;
|
|
42
|
+
})(ActionTag || {});
|
|
36
43
|
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
37
44
|
AnchorTarget2["_blank"] = "_blank";
|
|
38
45
|
AnchorTarget2["_self"] = "_self";
|
|
@@ -57,6 +64,7 @@ const LinkProps = {
|
|
|
57
64
|
*/
|
|
58
65
|
target: {
|
|
59
66
|
type: String,
|
|
67
|
+
default: void 0,
|
|
60
68
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
61
69
|
},
|
|
62
70
|
/**
|
|
@@ -71,38 +79,65 @@ const DisabledProps = {
|
|
|
71
79
|
/**
|
|
72
80
|
* Whether the form control is disabled
|
|
73
81
|
*/
|
|
74
|
-
disabled:
|
|
82
|
+
disabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false
|
|
85
|
+
}
|
|
75
86
|
};
|
|
76
87
|
const ActiveProps = {
|
|
77
88
|
/**
|
|
78
89
|
* Whether the item is active
|
|
79
90
|
*/
|
|
80
|
-
active:
|
|
91
|
+
active: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const CurrentProps = {
|
|
97
|
+
/**
|
|
98
|
+
* Whether the item is current
|
|
99
|
+
*/
|
|
100
|
+
current: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false
|
|
103
|
+
}
|
|
81
104
|
};
|
|
82
105
|
const PressedProps = {
|
|
83
106
|
/**
|
|
84
107
|
* Whether the item is pressed
|
|
85
108
|
*/
|
|
86
|
-
pressed:
|
|
109
|
+
pressed: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false
|
|
112
|
+
}
|
|
87
113
|
};
|
|
88
114
|
const LabelProps = {
|
|
89
115
|
/**
|
|
90
116
|
* The item label
|
|
91
117
|
*/
|
|
92
|
-
label:
|
|
118
|
+
label: {
|
|
119
|
+
type: [String, Number],
|
|
120
|
+
default: void 0
|
|
121
|
+
}
|
|
93
122
|
};
|
|
94
123
|
const ModifiersProps = {
|
|
95
124
|
/**
|
|
96
125
|
* Component BEM modifiers
|
|
97
126
|
*/
|
|
98
|
-
modifiers:
|
|
127
|
+
modifiers: {
|
|
128
|
+
type: [String, Array],
|
|
129
|
+
default: void 0
|
|
130
|
+
}
|
|
99
131
|
};
|
|
100
132
|
({
|
|
101
133
|
/**
|
|
102
134
|
* VvIcon name or props
|
|
103
135
|
* @see VVIcon
|
|
104
136
|
*/
|
|
105
|
-
icon: {
|
|
137
|
+
icon: {
|
|
138
|
+
type: [String, Object],
|
|
139
|
+
default: void 0
|
|
140
|
+
},
|
|
106
141
|
/**
|
|
107
142
|
* VvIcon position
|
|
108
143
|
*/
|
|
@@ -133,7 +168,8 @@ const ModifiersProps = {
|
|
|
133
168
|
* Dropdown show / hide transition name
|
|
134
169
|
*/
|
|
135
170
|
transitionName: {
|
|
136
|
-
type: String
|
|
171
|
+
type: String,
|
|
172
|
+
default: void 0
|
|
137
173
|
},
|
|
138
174
|
/**
|
|
139
175
|
* Offset of the dropdown from the trigger
|
|
@@ -201,7 +237,8 @@ const ModifiersProps = {
|
|
|
201
237
|
* Set dropdown width to the same as the trigger
|
|
202
238
|
*/
|
|
203
239
|
triggerWidth: {
|
|
204
|
-
type: Boolean
|
|
240
|
+
type: Boolean,
|
|
241
|
+
default: false
|
|
205
242
|
}
|
|
206
243
|
});
|
|
207
244
|
({
|
|
@@ -209,6 +246,7 @@ const ModifiersProps = {
|
|
|
209
246
|
...LabelProps,
|
|
210
247
|
...PressedProps,
|
|
211
248
|
...ActiveProps,
|
|
249
|
+
...CurrentProps,
|
|
212
250
|
...LinkProps,
|
|
213
251
|
/**
|
|
214
252
|
* Button type
|
|
@@ -224,6 +262,13 @@ const ModifiersProps = {
|
|
|
224
262
|
ariaLabel: {
|
|
225
263
|
type: String,
|
|
226
264
|
default: void 0
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* Default tag for the action
|
|
268
|
+
*/
|
|
269
|
+
defaultTag: {
|
|
270
|
+
type: String,
|
|
271
|
+
default: ActionTag.button
|
|
227
272
|
}
|
|
228
273
|
});
|
|
229
274
|
const VvCardProps = {
|
|
@@ -276,22 +321,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
276
321
|
const { modifiers } = toRefs(props);
|
|
277
322
|
const bemCssClasses = useModifiers("vv-card", modifiers);
|
|
278
323
|
return (_ctx, _cache) => {
|
|
279
|
-
return openBlock(), createElementBlock(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
324
|
+
return openBlock(), createElementBlock(
|
|
325
|
+
"article",
|
|
326
|
+
{
|
|
327
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
328
|
+
},
|
|
329
|
+
[
|
|
330
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
|
|
331
|
+
createCommentVNode(" @slot Title slot "),
|
|
332
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
333
|
+
createTextVNode(
|
|
334
|
+
toDisplayString(_ctx.title),
|
|
335
|
+
1
|
|
336
|
+
/* TEXT */
|
|
337
|
+
)
|
|
338
|
+
])
|
|
339
|
+
])) : createCommentVNode("v-if", true),
|
|
340
|
+
createCommentVNode(" @slot Default slot "),
|
|
341
|
+
renderSlot(_ctx.$slots, "default"),
|
|
342
|
+
_ctx.$slots.content ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
343
|
+
createCommentVNode(" @slot Content slot "),
|
|
344
|
+
renderSlot(_ctx.$slots, "content")
|
|
345
|
+
])) : createCommentVNode("v-if", true),
|
|
346
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
|
|
347
|
+
createCommentVNode(" @slot Footer slot "),
|
|
348
|
+
renderSlot(_ctx.$slots, "footer")
|
|
349
|
+
])) : createCommentVNode("v-if", true)
|
|
350
|
+
],
|
|
351
|
+
2
|
|
352
|
+
/* CLASS */
|
|
353
|
+
);
|
|
295
354
|
};
|
|
296
355
|
}
|
|
297
356
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCard=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});Boolean,Boolean,Boolean;const
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCard=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});Boolean,Boolean,Boolean,Boolean;const l={modifiers:{type:[String,Array],default:void 0}};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button,r.button;const a={...l,title:String};const s={key:0,class:"vv-card__header"},c={key:1,class:"vv-card__content"},i={key:2,class:"vv-card__footer"};return e.defineComponent({name:"VvCard",props:a,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const r={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-card",n);return(o,t)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(r))},[o.$slots.header||o.title?(e.openBlock(),e.createElementBlock("header",s,[e.createCommentVNode(" @slot Title slot "),e.renderSlot(o.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]))])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" @slot Default slot "),e.renderSlot(o.$slots,"default"),o.$slots.content?(e.openBlock(),e.createElementBlock("div",c,[e.createCommentVNode(" @slot Content slot "),e.renderSlot(o.$slots,"content")])):e.createCommentVNode("v-if",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("footer",i,[e.createCommentVNode(" @slot Footer slot "),e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("v-if",!0)],2))}})}));
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
2
|
title: StringConstructor;
|
|
3
|
-
modifiers:
|
|
4
|
-
|
|
3
|
+
modifiers: {
|
|
4
|
+
type: globalThis.PropType<string | string[]>;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
5
8
|
title: StringConstructor;
|
|
6
|
-
modifiers:
|
|
7
|
-
|
|
9
|
+
modifiers: {
|
|
10
|
+
type: globalThis.PropType<string | string[]>;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
}>>, {
|
|
14
|
+
modifiers: string | string[];
|
|
15
|
+
}, {}>, {
|
|
8
16
|
header?(_: {}): any;
|
|
9
17
|
default?(_: {}): any;
|
|
10
18
|
content?(_: {}): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
import {
|
|
1
|
+
import { unref, inject, computed, toRef, toRefs, isRef, defineComponent, h, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, createCommentVNode, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { uid } from "uid";
|
|
3
3
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
4
4
|
Strategy2["absolute"] = "absolute";
|
|
5
5
|
Strategy2["fixed"] = "fixed";
|
|
@@ -34,6 +34,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
34
34
|
ButtonType2["reset"] = "reset";
|
|
35
35
|
return ButtonType2;
|
|
36
36
|
})(ButtonType || {});
|
|
37
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
38
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
39
|
+
ActionTag2["routerLink"] = "router-link";
|
|
40
|
+
ActionTag2["a"] = "a";
|
|
41
|
+
ActionTag2["button"] = "button";
|
|
42
|
+
return ActionTag2;
|
|
43
|
+
})(ActionTag || {});
|
|
37
44
|
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
38
45
|
AnchorTarget2["_blank"] = "_blank";
|
|
39
46
|
AnchorTarget2["_self"] = "_self";
|
|
@@ -60,6 +67,7 @@ const LinkProps = {
|
|
|
60
67
|
*/
|
|
61
68
|
target: {
|
|
62
69
|
type: String,
|
|
70
|
+
default: void 0,
|
|
63
71
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
64
72
|
},
|
|
65
73
|
/**
|
|
@@ -74,27 +82,33 @@ const ValidProps = {
|
|
|
74
82
|
/**
|
|
75
83
|
* Valid status
|
|
76
84
|
*/
|
|
77
|
-
valid: Boolean,
|
|
85
|
+
valid: { type: Boolean, default: false },
|
|
78
86
|
/**
|
|
79
87
|
* Valid label
|
|
80
88
|
*/
|
|
81
|
-
validLabel: [String, Array]
|
|
89
|
+
validLabel: { type: [String, Array], default: void 0 }
|
|
82
90
|
};
|
|
83
91
|
const InvalidProps = {
|
|
84
92
|
/**
|
|
85
93
|
* Invalid status
|
|
86
94
|
*/
|
|
87
|
-
invalid:
|
|
95
|
+
invalid: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: false
|
|
98
|
+
},
|
|
88
99
|
/**
|
|
89
100
|
* Invalid label
|
|
90
101
|
*/
|
|
91
|
-
invalidLabel: [String, Array]
|
|
102
|
+
invalidLabel: { type: [String, Array], default: void 0 }
|
|
92
103
|
};
|
|
93
104
|
const LoadingProps = {
|
|
94
105
|
/**
|
|
95
106
|
* Loading status
|
|
96
107
|
*/
|
|
97
|
-
loading:
|
|
108
|
+
loading: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
98
112
|
/**
|
|
99
113
|
* Loading label
|
|
100
114
|
*/
|
|
@@ -107,37 +121,64 @@ const DisabledProps = {
|
|
|
107
121
|
/**
|
|
108
122
|
* Whether the form control is disabled
|
|
109
123
|
*/
|
|
110
|
-
disabled:
|
|
124
|
+
disabled: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false
|
|
127
|
+
}
|
|
111
128
|
};
|
|
112
129
|
const ActiveProps = {
|
|
113
130
|
/**
|
|
114
131
|
* Whether the item is active
|
|
115
132
|
*/
|
|
116
|
-
active:
|
|
133
|
+
active: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
default: false
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const CurrentProps = {
|
|
139
|
+
/**
|
|
140
|
+
* Whether the item is current
|
|
141
|
+
*/
|
|
142
|
+
current: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: false
|
|
145
|
+
}
|
|
117
146
|
};
|
|
118
147
|
const PressedProps = {
|
|
119
148
|
/**
|
|
120
149
|
* Whether the item is pressed
|
|
121
150
|
*/
|
|
122
|
-
pressed:
|
|
151
|
+
pressed: {
|
|
152
|
+
type: Boolean,
|
|
153
|
+
default: false
|
|
154
|
+
}
|
|
123
155
|
};
|
|
124
156
|
const LabelProps = {
|
|
125
157
|
/**
|
|
126
158
|
* The item label
|
|
127
159
|
*/
|
|
128
|
-
label:
|
|
160
|
+
label: {
|
|
161
|
+
type: [String, Number],
|
|
162
|
+
default: void 0
|
|
163
|
+
}
|
|
129
164
|
};
|
|
130
165
|
const ReadonlyProps = {
|
|
131
166
|
/**
|
|
132
167
|
* The value is not editable
|
|
133
168
|
*/
|
|
134
|
-
readonly:
|
|
169
|
+
readonly: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: false
|
|
172
|
+
}
|
|
135
173
|
};
|
|
136
174
|
const ModifiersProps = {
|
|
137
175
|
/**
|
|
138
176
|
* Component BEM modifiers
|
|
139
177
|
*/
|
|
140
|
-
modifiers:
|
|
178
|
+
modifiers: {
|
|
179
|
+
type: [String, Array],
|
|
180
|
+
default: void 0
|
|
181
|
+
}
|
|
141
182
|
};
|
|
142
183
|
const HintProps = {
|
|
143
184
|
hintLabel: { type: String, default: "" }
|
|
@@ -147,7 +188,10 @@ const HintProps = {
|
|
|
147
188
|
* VvIcon name or props
|
|
148
189
|
* @see VVIcon
|
|
149
190
|
*/
|
|
150
|
-
icon: {
|
|
191
|
+
icon: {
|
|
192
|
+
type: [String, Object],
|
|
193
|
+
default: void 0
|
|
194
|
+
},
|
|
151
195
|
/**
|
|
152
196
|
* VvIcon position
|
|
153
197
|
*/
|
|
@@ -192,7 +236,8 @@ const IdProps = {
|
|
|
192
236
|
* Dropdown show / hide transition name
|
|
193
237
|
*/
|
|
194
238
|
transitionName: {
|
|
195
|
-
type: String
|
|
239
|
+
type: String,
|
|
240
|
+
default: void 0
|
|
196
241
|
},
|
|
197
242
|
/**
|
|
198
243
|
* Offset of the dropdown from the trigger
|
|
@@ -260,7 +305,8 @@ const IdProps = {
|
|
|
260
305
|
* Set dropdown width to the same as the trigger
|
|
261
306
|
*/
|
|
262
307
|
triggerWidth: {
|
|
263
|
-
type: Boolean
|
|
308
|
+
type: Boolean,
|
|
309
|
+
default: false
|
|
264
310
|
}
|
|
265
311
|
});
|
|
266
312
|
const IdNameProps = {
|
|
@@ -287,17 +333,24 @@ const CheckboxRadioProps = {
|
|
|
287
333
|
* Input value
|
|
288
334
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
289
335
|
*/
|
|
290
|
-
value:
|
|
336
|
+
value: {
|
|
337
|
+
type: [String, Number, Boolean],
|
|
338
|
+
default: void 0
|
|
339
|
+
},
|
|
291
340
|
/**
|
|
292
341
|
* Input value
|
|
293
342
|
*/
|
|
294
|
-
modelValue:
|
|
343
|
+
modelValue: {
|
|
344
|
+
type: [Object, Number, Boolean, String],
|
|
345
|
+
default: void 0
|
|
346
|
+
}
|
|
295
347
|
};
|
|
296
348
|
({
|
|
297
349
|
...DisabledProps,
|
|
298
350
|
...LabelProps,
|
|
299
351
|
...PressedProps,
|
|
300
352
|
...ActiveProps,
|
|
353
|
+
...CurrentProps,
|
|
301
354
|
...LinkProps,
|
|
302
355
|
/**
|
|
303
356
|
* Button type
|
|
@@ -313,6 +366,13 @@ const CheckboxRadioProps = {
|
|
|
313
366
|
ariaLabel: {
|
|
314
367
|
type: String,
|
|
315
368
|
default: void 0
|
|
369
|
+
},
|
|
370
|
+
/**
|
|
371
|
+
* Default tag for the action
|
|
372
|
+
*/
|
|
373
|
+
defaultTag: {
|
|
374
|
+
type: String,
|
|
375
|
+
default: ActionTag.button
|
|
316
376
|
}
|
|
317
377
|
});
|
|
318
378
|
function equals(obj1, obj2, field) {
|
|
@@ -656,7 +716,7 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
656
716
|
}, {});
|
|
657
717
|
});
|
|
658
718
|
}
|
|
659
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
719
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
660
720
|
function useModifiers(prefix, modifiers, others) {
|
|
661
721
|
return computed(() => {
|
|
662
722
|
const toReturn = {
|
|
@@ -689,8 +749,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
689
749
|
...__default__,
|
|
690
750
|
props: VvCheckboxProps,
|
|
691
751
|
emits: VvCheckboxEvents,
|
|
692
|
-
setup(__props, { emit }) {
|
|
752
|
+
setup(__props, { emit: __emit }) {
|
|
693
753
|
const props = __props;
|
|
754
|
+
const emit = __emit;
|
|
694
755
|
const slots = useSlots();
|
|
695
756
|
const propsDefaults = useDefaults(
|
|
696
757
|
"VvCheckbox",
|
|
@@ -832,13 +893,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
832
893
|
}, null, 8, _hoisted_2), [
|
|
833
894
|
[vModelCheckbox, unref(localModelValue)]
|
|
834
895
|
]),
|
|
896
|
+
createCommentVNode(" @slot Use this slot for check label "),
|
|
835
897
|
renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
|
|
836
|
-
createTextVNode(
|
|
898
|
+
createTextVNode(
|
|
899
|
+
toDisplayString(_ctx.label),
|
|
900
|
+
1
|
|
901
|
+
/* TEXT */
|
|
902
|
+
)
|
|
837
903
|
]),
|
|
838
904
|
createVNode(unref(HintSlot), {
|
|
839
905
|
id: unref(hasHintId),
|
|
840
906
|
class: "vv-checkbox__hint"
|
|
841
|
-
}, createSlots({
|
|
907
|
+
}, createSlots({
|
|
908
|
+
_: 2
|
|
909
|
+
/* DYNAMIC */
|
|
910
|
+
}, [
|
|
842
911
|
_ctx.$slots.hint ? {
|
|
843
912
|
name: "hint",
|
|
844
913
|
fn: withCtx(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";var l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),o=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(o||{});const i=Symbol.for("volver"),r=Symbol.for("checkGroup"),u={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},d={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},s={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},v={disabled:{type:Boolean,default:!1}},c=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),f={readonly:{type:Boolean,default:!1}},p={modifiers:{type:[String,Array],default:void 0}},b={hintLabel:{type:String,default:""}};a.before;const h={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const y={...{...m,name:{type:String,required:!0}},...h,...u,...d,...b,...v,...f,...p,...c,...s,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};function g(e,t,l){return l?L(e,l)===L(t,l):S(e,t)}function S(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let n,o,i;if(l&&a){if(o=e.length,o!=t.length)return!1;for(n=o;0!=n--;)if(!S(e[n],t[n]))return!1;return!0}if(l!=a)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!S(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function L(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function k(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,t);return e.computed({get:()=>o.value,set(e){n&&n(`update:${t}`,e)}})}}}n.button,o.button;const B={...y,...p,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function V(t,l,a){const n=e.inject(i),o=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[t]))return n.defaults.value[t]}));return e.computed((()=>{if(void 0===o.value)return a;const e=o.value,t=l,n=a;return Object.keys(t).reduce(((l,a)=>{const o=n[a];if(l[a]=o,a in e){if(Array.isArray(t[a])){const n=t[a];if(n.length){n[0]===o&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===o&&(l[a]=e[a])}if("object"==typeof t[a]){let n=t[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(l[a]=e[a]):n===o&&(l[a]=e[a])}}return l}),{})}))}const x=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:B,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const n=l,o=a,i=e.useSlots(),u=V("VvCheckbox",B,n),{id:d,disabled:s,readonly:v,valid:c,invalid:f,propsSwitch:p,modelValue:b,indeterminate:h,isInGroup:m}=function(t,l){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=k(r),{id:i,switch:u,indeterminate:d}=e.toRefs(t),s=o("modelValue",t,l),v=o("valid",t),c=o("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:u,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(n,o),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(d),S=e.computed((()=>`${y.value}-hint`)),L=e.computed((()=>w.value?-1:n.tabindex)),$=e.ref(),j=e.computed((()=>void 0!==n.uncheckedValue&&!m.value)),w=e.computed((()=>s.value||v.value)),C=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),R=e.computed((()=>j.value?b.value===n.value:Array.isArray(b.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(g(e,l))return!0;return!1}(n.value,b.value):g(n.value,b.value))),N=e.computed((()=>!!h.value||!(R.value||!j.value||n.uncheckedValue===b.value))),I=e.computed((()=>{if(!j.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),P=e.computed({get:()=>R.value,set(e){if(j.value)b.value=e?n.value:n.uncheckedValue;else if(Array.isArray(b.value)||m.value){const t=new Set(Array.isArray(b.value)?b.value:void 0!==b.value?[b.value]:[]);e?t.add(n.value):t.delete(n.value),b.value=[...t]}else b.value=e?n.value:void 0;o("change",e)}}),{modifiers:E}=e.toRefs(n),G=function(t,l,a){return e.computed((()=>{const n={[t]:!0},o="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{n[`${t}--${l}`]=e.unref(a.value[l])})),n}))}("vv-checkbox",E,e.computed((()=>({switch:p.value,valid:c.value,invalid:f.value,disabled:s.value,readonly:v.value,indeterminate:h.value}))));e.watchEffect((()=>{j.value&&Array.isArray(b.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>N.value),(e=>{$.value.indeterminate=!!e})),e.onMounted((()=>{N.value&&($.value.indeterminate=!0)}));const{HintSlot:H,hasHintLabelOrSlot:T,hasInvalidLabelOrSlot:_,hintSlotScope:z}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>O(a.value.invalidLabel))),o=e.computed((()=>O(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||o.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,n,o,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:p}}(u,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(G)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:$,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(P)?P.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(w),value:e.unref(I),tabindex:e.unref(L),"aria-invalid":e.unref(C),"aria-describedby":e.unref(T)?e.unref(S):void 0,"aria-errormessage":e.unref(_)?e.unref(S):void 0},null,8,A),[[e.vModelCheckbox,e.unref(P)]]),e.createCommentVNode(" @slot Use this slot for check label "),e.renderSlot(t.$slots,"default",{value:e.unref(b)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(H),{id:e.unref(S),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"3"}:void 0]),1032,["id"])],10,x))}})}));
|