@volverjs/ui-vue 0.0.10-beta.3 → 0.0.10-beta.31
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 +106 -10
- package/auto-imports.d.ts +7 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +22 -15
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +192 -103
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +160 -8
- package/dist/components/VvAccordion/index.d.ts +8 -9
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +451 -172
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
- package/dist/components/VvAccordionGroup/index.d.ts +14 -6
- package/dist/components/VvAction/VvAction.es.js +78 -27
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
- package/dist/components/VvAction/index.d.ts +25 -9
- package/dist/components/VvAlert/VvAlert.es.js +204 -171
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
- package/dist/components/VvAlert/index.d.ts +17 -9
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +250 -188
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
- package/dist/components/VvAlertGroup/index.d.ts +6 -14
- package/dist/components/VvAvatar/VvAvatar.es.js +61 -21
- 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 +118 -48
- 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 +78 -28
- 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 +276 -60
- 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 +291 -252
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
- package/dist/components/VvButton/index.d.ts +51 -29
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +81 -40
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +24 -11
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +86 -36
- 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 +177 -120
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +105 -33
- package/dist/components/VvCheckbox/index.d.ts +47 -14
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -107
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +806 -581
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +171 -104
- package/dist/components/VvCombobox/index.d.ts +62 -26
- package/dist/components/VvDialog/VvDialog.es.js +140 -153
- 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 +138 -71
- 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 +66 -25
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
- package/dist/components/VvDropdown/index.d.ts +52 -10
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +152 -39
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
- 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 +1777 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +359 -0
- package/dist/components/VvInputFile/index.d.ts +200 -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 +2 -2
- package/dist/components/VvInputText/VvInputText.es.js +1237 -324
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
- package/dist/components/VvInputText/index.d.ts +99 -29
- package/dist/components/VvNav/VvNav.es.js +135 -56
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNav/index.d.ts +5 -2
- package/dist/components/VvNavItem/VvNavItem.es.js +91 -33
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +72 -26
- 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 +160 -103
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
- package/dist/components/VvRadio/index.d.ts +50 -17
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -107
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +251 -238
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +117 -44
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +191 -75
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
- package/dist/components/VvTab/index.d.ts +4 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +232 -224
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +79 -29
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
- package/dist/components/VvTooltip/index.d.ts +5 -2
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +3534 -1650
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +99 -4
- package/dist/composables/alert/useInjectAlert.d.ts +1 -6
- package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
- package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
- package/dist/composables/group/useProvideGroupState.d.ts +3 -3
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +92 -3
- 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/usePersistence.d.ts +2 -0
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/constants.d.ts +34 -32
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +99 -43
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +97 -38
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +267 -267
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +90 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +272 -81
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +87 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +143 -89
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1075 -492
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Button/Button.settings.d.ts +0 -1
- 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 +2 -15
- package/dist/test/expect.d.ts +1 -1
- package/dist/types/alert.d.ts +9 -7
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/generic.d.ts +1 -2
- package/dist/types/group.d.ts +37 -15
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +16 -0
- package/dist/types/nav.d.ts +2 -2
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +78 -78
- 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 +121 -58
- package/src/components/VvAccordion/index.ts +8 -23
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +164 -47
- package/src/components/VvAccordionGroup/index.ts +6 -6
- package/src/components/VvAction/VvAction.vue +17 -5
- package/src/components/VvAlert/index.ts +14 -9
- package/src/components/VvAlertGroup/index.ts +3 -15
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +17 -7
- package/src/components/VvButton/index.ts +9 -16
- package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
- package/src/components/VvCheckbox/index.ts +2 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
- package/src/components/VvCombobox/VvCombobox.vue +15 -12
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvDropdown/VvDropdown.vue +11 -2
- package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
- package/src/components/VvDropdown/VvDropdownOption.vue +4 -21
- package/src/components/VvDropdown/index.ts +35 -1
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +395 -0
- package/src/components/VvInputFile/index.ts +135 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +141 -33
- package/src/components/VvInputText/index.ts +31 -16
- package/src/components/VvNav/VvNav.vue +4 -2
- package/src/components/VvRadio/index.ts +5 -5
- package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +5 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/alert/useAlert.ts +12 -9
- package/src/composables/dropdown/useProvideDropdown.ts +4 -4
- package/src/composables/group/useInjectedGroupState.ts +20 -16
- package/src/composables/group/useProvideGroupState.ts +10 -15
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/usePersistence.ts +76 -0
- package/src/composables/useUniqueId.ts +2 -2
- package/src/constants.ts +47 -32
- 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 +108 -31
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/Accordion/Accordion.test.ts +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +17 -11
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
- package/src/stories/Alert/Alert.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Avatar/Avatar.test.ts +1 -1
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
- package/src/stories/Badge/Badge.test.ts +1 -1
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Button/Button.settings.ts +1 -4
- package/src/stories/Button/Button.test.ts +1 -1
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
- package/src/stories/Card/Card.test.ts +1 -1
- package/src/stories/Checkbox/Checkbox.test.ts +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Combobox/Combobox.test.ts +1 -1
- package/src/stories/Dialog/Dialog.test.ts +2 -2
- package/src/stories/Dropdown/Dropdown.test.ts +1 -1
- 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/InputText/InputText.test.ts +1 -1
- package/src/stories/Nav/Nav.test.ts +1 -1
- package/src/stories/Progress/Progress.test.ts +1 -1
- package/src/stories/Radio/Radio.test.ts +1 -1
- package/src/stories/RadioGroup/RadioGroup.test.ts +1 -1
- package/src/stories/Select/Select.test.ts +1 -1
- package/src/stories/Tab/Tab.settings.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +1 -1
- package/src/stories/Textarea/Textarea.test.ts +1 -1
- package/src/stories/Tooltip/Tooltip.test.ts +1 -1
- package/src/stories/argTypes.ts +1 -1
- package/src/test/expect.ts +2 -4
- package/src/types/alert.ts +11 -7
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +3 -3
- package/src/types/group.ts +22 -14
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +2 -3
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { inject, computed, toRef, toRefs, isRef, defineComponent, h, unref, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { uid } from "uid";
|
|
3
|
+
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
4
|
+
StorageType2["local"] = "local";
|
|
5
|
+
StorageType2["session"] = "session";
|
|
6
|
+
return StorageType2;
|
|
7
|
+
})(StorageType || {});
|
|
3
8
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
4
9
|
Strategy2["absolute"] = "absolute";
|
|
5
10
|
Strategy2["fixed"] = "fixed";
|
|
@@ -34,15 +39,17 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
34
39
|
ButtonType2["reset"] = "reset";
|
|
35
40
|
return ButtonType2;
|
|
36
41
|
})(ButtonType || {});
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return
|
|
43
|
-
})(
|
|
42
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
43
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
44
|
+
ActionTag2["routerLink"] = "router-link";
|
|
45
|
+
ActionTag2["a"] = "a";
|
|
46
|
+
ActionTag2["button"] = "button";
|
|
47
|
+
return ActionTag2;
|
|
48
|
+
})(ActionTag || {});
|
|
44
49
|
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
45
|
-
const INJECTION_KEY_CHECK_GROUP = Symbol.for(
|
|
50
|
+
const INJECTION_KEY_CHECK_GROUP = Symbol.for(
|
|
51
|
+
"checkGroup"
|
|
52
|
+
);
|
|
46
53
|
const LinkProps = {
|
|
47
54
|
/**
|
|
48
55
|
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
@@ -58,10 +65,7 @@ const LinkProps = {
|
|
|
58
65
|
/**
|
|
59
66
|
* Anchor target
|
|
60
67
|
*/
|
|
61
|
-
target:
|
|
62
|
-
type: String,
|
|
63
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
64
|
-
},
|
|
68
|
+
target: String,
|
|
65
69
|
/**
|
|
66
70
|
* Anchor rel
|
|
67
71
|
*/
|
|
@@ -74,27 +78,33 @@ const ValidProps = {
|
|
|
74
78
|
/**
|
|
75
79
|
* Valid status
|
|
76
80
|
*/
|
|
77
|
-
valid: Boolean,
|
|
81
|
+
valid: { type: Boolean, default: false },
|
|
78
82
|
/**
|
|
79
83
|
* Valid label
|
|
80
84
|
*/
|
|
81
|
-
validLabel: [String, Array]
|
|
85
|
+
validLabel: { type: [String, Array], default: void 0 }
|
|
82
86
|
};
|
|
83
87
|
const InvalidProps = {
|
|
84
88
|
/**
|
|
85
89
|
* Invalid status
|
|
86
90
|
*/
|
|
87
|
-
invalid:
|
|
91
|
+
invalid: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
},
|
|
88
95
|
/**
|
|
89
96
|
* Invalid label
|
|
90
97
|
*/
|
|
91
|
-
invalidLabel: [String, Array]
|
|
98
|
+
invalidLabel: { type: [String, Array], default: void 0 }
|
|
92
99
|
};
|
|
93
100
|
const LoadingProps = {
|
|
94
101
|
/**
|
|
95
102
|
* Loading status
|
|
96
103
|
*/
|
|
97
|
-
loading:
|
|
104
|
+
loading: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false
|
|
107
|
+
},
|
|
98
108
|
/**
|
|
99
109
|
* Loading label
|
|
100
110
|
*/
|
|
@@ -107,43 +117,64 @@ const DisabledProps = {
|
|
|
107
117
|
/**
|
|
108
118
|
* Whether the form control is disabled
|
|
109
119
|
*/
|
|
110
|
-
disabled:
|
|
120
|
+
disabled: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: false
|
|
123
|
+
}
|
|
111
124
|
};
|
|
112
125
|
const ActiveProps = {
|
|
113
126
|
/**
|
|
114
127
|
* Whether the item is active
|
|
115
128
|
*/
|
|
116
|
-
active:
|
|
129
|
+
active: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: false
|
|
132
|
+
}
|
|
117
133
|
};
|
|
118
134
|
const CurrentProps = {
|
|
119
135
|
/**
|
|
120
136
|
* Whether the item is current
|
|
121
137
|
*/
|
|
122
|
-
current:
|
|
138
|
+
current: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: false
|
|
141
|
+
}
|
|
123
142
|
};
|
|
124
143
|
const PressedProps = {
|
|
125
144
|
/**
|
|
126
145
|
* Whether the item is pressed
|
|
127
146
|
*/
|
|
128
|
-
pressed:
|
|
147
|
+
pressed: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
default: false
|
|
150
|
+
}
|
|
129
151
|
};
|
|
130
152
|
const LabelProps = {
|
|
131
153
|
/**
|
|
132
154
|
* The item label
|
|
133
155
|
*/
|
|
134
|
-
label:
|
|
156
|
+
label: {
|
|
157
|
+
type: [String, Number],
|
|
158
|
+
default: void 0
|
|
159
|
+
}
|
|
135
160
|
};
|
|
136
161
|
const ReadonlyProps = {
|
|
137
162
|
/**
|
|
138
163
|
* The value is not editable
|
|
139
164
|
*/
|
|
140
|
-
readonly:
|
|
165
|
+
readonly: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: false
|
|
168
|
+
}
|
|
141
169
|
};
|
|
142
170
|
const ModifiersProps = {
|
|
143
171
|
/**
|
|
144
172
|
* Component BEM modifiers
|
|
145
173
|
*/
|
|
146
|
-
modifiers:
|
|
174
|
+
modifiers: {
|
|
175
|
+
type: [String, Array],
|
|
176
|
+
default: void 0
|
|
177
|
+
}
|
|
147
178
|
};
|
|
148
179
|
const HintProps = {
|
|
149
180
|
hintLabel: { type: String, default: "" }
|
|
@@ -153,7 +184,10 @@ const HintProps = {
|
|
|
153
184
|
* VvIcon name or props
|
|
154
185
|
* @see VVIcon
|
|
155
186
|
*/
|
|
156
|
-
icon: {
|
|
187
|
+
icon: {
|
|
188
|
+
type: [String, Object],
|
|
189
|
+
default: void 0
|
|
190
|
+
},
|
|
157
191
|
/**
|
|
158
192
|
* VvIcon position
|
|
159
193
|
*/
|
|
@@ -198,7 +232,8 @@ const IdProps = {
|
|
|
198
232
|
* Dropdown show / hide transition name
|
|
199
233
|
*/
|
|
200
234
|
transitionName: {
|
|
201
|
-
type: String
|
|
235
|
+
type: String,
|
|
236
|
+
default: void 0
|
|
202
237
|
},
|
|
203
238
|
/**
|
|
204
239
|
* Offset of the dropdown from the trigger
|
|
@@ -266,7 +301,8 @@ const IdProps = {
|
|
|
266
301
|
* Set dropdown width to the same as the trigger
|
|
267
302
|
*/
|
|
268
303
|
triggerWidth: {
|
|
269
|
-
type: Boolean
|
|
304
|
+
type: Boolean,
|
|
305
|
+
default: false
|
|
270
306
|
}
|
|
271
307
|
});
|
|
272
308
|
const IdNameProps = {
|
|
@@ -293,11 +329,17 @@ const CheckboxRadioProps = {
|
|
|
293
329
|
* Input value
|
|
294
330
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
295
331
|
*/
|
|
296
|
-
value:
|
|
332
|
+
value: {
|
|
333
|
+
type: [String, Number, Boolean],
|
|
334
|
+
default: void 0
|
|
335
|
+
},
|
|
297
336
|
/**
|
|
298
337
|
* Input value
|
|
299
338
|
*/
|
|
300
|
-
modelValue:
|
|
339
|
+
modelValue: {
|
|
340
|
+
type: [Object, Number, Boolean, String],
|
|
341
|
+
default: void 0
|
|
342
|
+
}
|
|
301
343
|
};
|
|
302
344
|
({
|
|
303
345
|
...DisabledProps,
|
|
@@ -320,8 +362,100 @@ const CheckboxRadioProps = {
|
|
|
320
362
|
ariaLabel: {
|
|
321
363
|
type: String,
|
|
322
364
|
default: void 0
|
|
365
|
+
},
|
|
366
|
+
/**
|
|
367
|
+
* Default tag for the action
|
|
368
|
+
*/
|
|
369
|
+
defaultTag: {
|
|
370
|
+
type: String,
|
|
371
|
+
default: ActionTag.button
|
|
323
372
|
}
|
|
324
373
|
});
|
|
374
|
+
({
|
|
375
|
+
storageType: {
|
|
376
|
+
type: String,
|
|
377
|
+
default: StorageType.local,
|
|
378
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
379
|
+
},
|
|
380
|
+
storageKey: String
|
|
381
|
+
});
|
|
382
|
+
function useInjectedGroupState(groupKey) {
|
|
383
|
+
const group = inject(groupKey, void 0);
|
|
384
|
+
const isInGroup = computed(() => group !== void 0);
|
|
385
|
+
function getGroupOrLocalRef(propName, props, emit) {
|
|
386
|
+
const groupPropValue = group == null ? void 0 : group[propName];
|
|
387
|
+
if (groupPropValue) {
|
|
388
|
+
return computed({
|
|
389
|
+
get() {
|
|
390
|
+
return groupPropValue.value;
|
|
391
|
+
},
|
|
392
|
+
set(value) {
|
|
393
|
+
groupPropValue.value = value;
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
const propRef = toRef(props, propName);
|
|
398
|
+
return computed({
|
|
399
|
+
get() {
|
|
400
|
+
return propRef.value;
|
|
401
|
+
},
|
|
402
|
+
set(value) {
|
|
403
|
+
if (emit) {
|
|
404
|
+
emit(`update:${propName}`, value);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
return {
|
|
410
|
+
group,
|
|
411
|
+
isInGroup,
|
|
412
|
+
getGroupOrLocalRef
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
const VvCheckboxProps = {
|
|
416
|
+
...CheckboxRadioProps,
|
|
417
|
+
...ModifiersProps,
|
|
418
|
+
/**
|
|
419
|
+
* If true, the input will be indeterminated
|
|
420
|
+
*/
|
|
421
|
+
indeterminate: Boolean,
|
|
422
|
+
/**
|
|
423
|
+
* Value associated with the unchecked state
|
|
424
|
+
*/
|
|
425
|
+
uncheckedValue: [String, Number, Boolean],
|
|
426
|
+
/**
|
|
427
|
+
* If true, the input will be displayed as a switch
|
|
428
|
+
*/
|
|
429
|
+
switch: Boolean
|
|
430
|
+
};
|
|
431
|
+
const VvCheckboxEvents = ["click", "update:modelValue", "change", "blur"];
|
|
432
|
+
function useGroupProps(props, emit) {
|
|
433
|
+
const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(INJECTION_KEY_CHECK_GROUP);
|
|
434
|
+
const { id, switch: propsSwitch, indeterminate } = toRefs(props);
|
|
435
|
+
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
436
|
+
const valid = getGroupOrLocalRef("valid", props);
|
|
437
|
+
const invalid = getGroupOrLocalRef("invalid", props);
|
|
438
|
+
const readonly = computed(
|
|
439
|
+
() => Boolean(props.readonly || (group == null ? void 0 : group.readonly.value))
|
|
440
|
+
);
|
|
441
|
+
const disabled = computed(
|
|
442
|
+
() => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
|
|
443
|
+
);
|
|
444
|
+
return {
|
|
445
|
+
// local props
|
|
446
|
+
id,
|
|
447
|
+
propsSwitch,
|
|
448
|
+
indeterminate,
|
|
449
|
+
// global props
|
|
450
|
+
group,
|
|
451
|
+
isInGroup,
|
|
452
|
+
modelValue,
|
|
453
|
+
valid,
|
|
454
|
+
invalid,
|
|
455
|
+
readonly,
|
|
456
|
+
disabled
|
|
457
|
+
};
|
|
458
|
+
}
|
|
325
459
|
function equals(obj1, obj2, field) {
|
|
326
460
|
if (field) {
|
|
327
461
|
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
@@ -401,94 +535,9 @@ function contains(value, list) {
|
|
|
401
535
|
}
|
|
402
536
|
return false;
|
|
403
537
|
}
|
|
404
|
-
function isEmpty(value) {
|
|
405
|
-
return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
|
|
406
|
-
}
|
|
407
538
|
function isString(value) {
|
|
408
539
|
return typeof value === "string" || value instanceof String;
|
|
409
540
|
}
|
|
410
|
-
function useInjectedGroupState(groupKey) {
|
|
411
|
-
const group = inject(groupKey, void 0);
|
|
412
|
-
const isInGroup = computed(() => !isEmpty(group));
|
|
413
|
-
function getGroupOrLocalRef(propName, props, emit) {
|
|
414
|
-
if (group == null ? void 0 : group.value) {
|
|
415
|
-
const groupPropValue = unref(group.value)[propName];
|
|
416
|
-
return computed({
|
|
417
|
-
get() {
|
|
418
|
-
return groupPropValue == null ? void 0 : groupPropValue.value;
|
|
419
|
-
},
|
|
420
|
-
set(value) {
|
|
421
|
-
groupPropValue.value = value;
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
const propRef = toRef(props, propName);
|
|
426
|
-
return computed({
|
|
427
|
-
get() {
|
|
428
|
-
return propRef.value;
|
|
429
|
-
},
|
|
430
|
-
set(value) {
|
|
431
|
-
if (emit)
|
|
432
|
-
emit(`update:${propName}`, value);
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
return {
|
|
437
|
-
group,
|
|
438
|
-
isInGroup,
|
|
439
|
-
getGroupOrLocalRef
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
const VvCheckboxProps = {
|
|
443
|
-
...CheckboxRadioProps,
|
|
444
|
-
...ModifiersProps,
|
|
445
|
-
/**
|
|
446
|
-
* If true, the input will be indeterminated
|
|
447
|
-
*/
|
|
448
|
-
indeterminate: Boolean,
|
|
449
|
-
/**
|
|
450
|
-
* Value associated with the unchecked state
|
|
451
|
-
*/
|
|
452
|
-
uncheckedValue: [String, Number, Boolean],
|
|
453
|
-
/**
|
|
454
|
-
* If true, the input will be displayed as a switch
|
|
455
|
-
*/
|
|
456
|
-
switch: Boolean
|
|
457
|
-
};
|
|
458
|
-
const VvCheckboxEvents = ["click", "update:modelValue", "change", "blur"];
|
|
459
|
-
function useGroupProps(props, emit) {
|
|
460
|
-
const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(INJECTION_KEY_CHECK_GROUP);
|
|
461
|
-
const { id, switch: propsSwitch, indeterminate } = toRefs(props);
|
|
462
|
-
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
463
|
-
const valid = getGroupOrLocalRef("valid", props);
|
|
464
|
-
const invalid = getGroupOrLocalRef("invalid", props);
|
|
465
|
-
const readonly = computed(
|
|
466
|
-
() => {
|
|
467
|
-
var _a;
|
|
468
|
-
return Boolean(props.readonly || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.readonly.value));
|
|
469
|
-
}
|
|
470
|
-
);
|
|
471
|
-
const disabled = computed(
|
|
472
|
-
() => {
|
|
473
|
-
var _a;
|
|
474
|
-
return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
|
|
475
|
-
}
|
|
476
|
-
);
|
|
477
|
-
return {
|
|
478
|
-
// local props
|
|
479
|
-
id,
|
|
480
|
-
propsSwitch,
|
|
481
|
-
indeterminate,
|
|
482
|
-
// global props
|
|
483
|
-
group,
|
|
484
|
-
isInGroup,
|
|
485
|
-
modelValue,
|
|
486
|
-
valid,
|
|
487
|
-
invalid,
|
|
488
|
-
readonly,
|
|
489
|
-
disabled
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
541
|
function joinLines(items) {
|
|
493
542
|
if (Array.isArray(items)) {
|
|
494
543
|
return items.filter((item) => isString(item)).join(" ");
|
|
@@ -663,7 +712,7 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
663
712
|
}, {});
|
|
664
713
|
});
|
|
665
714
|
}
|
|
666
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
715
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
667
716
|
function useModifiers(prefix, modifiers, others) {
|
|
668
717
|
return computed(() => {
|
|
669
718
|
const toReturn = {
|
|
@@ -696,8 +745,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
696
745
|
...__default__,
|
|
697
746
|
props: VvCheckboxProps,
|
|
698
747
|
emits: VvCheckboxEvents,
|
|
699
|
-
setup(__props, { emit }) {
|
|
748
|
+
setup(__props, { emit: __emit }) {
|
|
700
749
|
const props = __props;
|
|
750
|
+
const emit = __emit;
|
|
701
751
|
const slots = useSlots();
|
|
702
752
|
const propsDefaults = useDefaults(
|
|
703
753
|
"VvCheckbox",
|
|
@@ -840,12 +890,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
840
890
|
[vModelCheckbox, unref(localModelValue)]
|
|
841
891
|
]),
|
|
842
892
|
renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
|
|
843
|
-
createTextVNode(
|
|
893
|
+
createTextVNode(
|
|
894
|
+
toDisplayString(_ctx.label),
|
|
895
|
+
1
|
|
896
|
+
/* TEXT */
|
|
897
|
+
)
|
|
844
898
|
]),
|
|
845
899
|
createVNode(unref(HintSlot), {
|
|
846
900
|
id: unref(hasHintId),
|
|
847
901
|
class: "vv-checkbox__hint"
|
|
848
|
-
}, createSlots({
|
|
902
|
+
}, createSlots({
|
|
903
|
+
_: 2
|
|
904
|
+
/* DYNAMIC */
|
|
905
|
+
}, [
|
|
849
906
|
_ctx.$slots.hint ? {
|
|
850
907
|
name: "hint",
|
|
851
908
|
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.local="local",e.session="session",e))(l||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),o=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(o||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("checkGroup"),d={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},s={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},v={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},c={disabled:{type:Boolean,default:!1}},f=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),p={readonly:{type:Boolean,default:!1}},b={modifiers:{type:[String,Array],default:void 0}},h={hintLabel:{type:String,default:""}};n.before;const m={tabindex:{type:[String,Number],default:0}},y={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const g={...{...y,name:{type:String,required:!0}},...m,...d,...s,...h,...c,...p,...b,...f,...v,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};o.button,i.button,l.local;const S={...g,...b,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function L(t,l){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=function(t){const l=e.inject(t,void 0),a=e.computed((()=>void 0!==l));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){const o=null==l?void 0:l[t];if(o)return e.computed({get:()=>o.value,set(e){o.value=e}});const i=e.toRef(a,t);return e.computed({get:()=>i.value,set(e){n&&n(`update:${t}`,e)}})}}}(u),{id:i,switch:r,indeterminate:d}=e.toRefs(t),s=o("modelValue",t,l),v=o("valid",t),c=o("invalid",t),f=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:i,propsSwitch:r,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}function k(e,t,l){return l?O(e,l)===O(t,l):B(e,t)}function B(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(!B(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],!B(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 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 x(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(r),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 A=["for"],$=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:S,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const n=l,o=a,i=e.useSlots(),r=V("VvCheckbox",S,n),{id:u,disabled:d,readonly:s,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:b,isInGroup:h}=L(n,o),m=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),y=e.computed((()=>`${m.value}-hint`)),g=e.computed((()=>j.value?-1:n.tabindex)),B=e.ref(),O=e.computed((()=>void 0!==n.uncheckedValue&&!h.value)),j=e.computed((()=>d.value||s.value)),w=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),R=e.computed((()=>O.value?p.value===n.value:Array.isArray(p.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(k(e,l))return!0;return!1}(n.value,p.value):k(n.value,p.value))),C=e.computed((()=>!!b.value||!(R.value||!O.value||n.uncheckedValue===p.value))),N=e.computed((()=>{if(!O.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),I=e.computed({get:()=>R.value,set(e){if(O.value)p.value=e?n.value:n.uncheckedValue;else if(Array.isArray(p.value)||h.value){const t=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?t.add(n.value):t.delete(n.value),p.value=[...t]}else p.value=e?n.value:void 0;o("change",e)}}),{modifiers:P}=e.toRefs(n),E=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",P,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:d.value,readonly:s.value,indeterminate:b.value}))));e.watchEffect((()=>{O.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{B.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(B.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>x(a.value.invalidLabel))),o=e.computed((()=>x(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}}(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:B,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(I)?I.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(j),value:e.unref(N),tabindex:e.unref(g),"aria-invalid":e.unref(w),"aria-describedby":e.unref(H)?e.unref(y):void 0,"aria-errormessage":e.unref(T)?e.unref(y):void 0},null,8,$),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(t.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(y),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(_))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,A))}})}));
|
|
@@ -1,26 +1,59 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
2
|
indeterminate: BooleanConstructor;
|
|
3
|
-
uncheckedValue: (
|
|
3
|
+
uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
switch: BooleanConstructor;
|
|
5
|
-
modifiers:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
modifiers: {
|
|
6
|
+
type: globalThis.PropType<string | string[]>;
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
9
|
+
value: {
|
|
10
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
loading: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
9
21
|
loadingLabel: {
|
|
10
22
|
type: StringConstructor;
|
|
11
23
|
default: string;
|
|
12
24
|
};
|
|
13
|
-
label:
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
label: {
|
|
26
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
29
|
+
readonly: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
disabled: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
16
37
|
hintLabel: {
|
|
17
38
|
type: StringConstructor;
|
|
18
39
|
default: string;
|
|
19
40
|
};
|
|
20
|
-
invalid:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
invalid: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
invalidLabel: {
|
|
46
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
valid: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
validLabel: {
|
|
54
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
24
57
|
tabindex: {
|
|
25
58
|
type: (StringConstructor | NumberConstructor)[];
|
|
26
59
|
default: number;
|
|
@@ -30,29 +63,64 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
30
63
|
required: boolean;
|
|
31
64
|
};
|
|
32
65
|
id: (StringConstructor | NumberConstructor)[];
|
|
33
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
66
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
67
|
+
[x: string]: (...args: any[]) => void;
|
|
68
|
+
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
34
69
|
indeterminate: BooleanConstructor;
|
|
35
|
-
uncheckedValue: (
|
|
70
|
+
uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
36
71
|
switch: BooleanConstructor;
|
|
37
|
-
modifiers:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
modifiers: {
|
|
73
|
+
type: globalThis.PropType<string | string[]>;
|
|
74
|
+
default: undefined;
|
|
75
|
+
};
|
|
76
|
+
value: {
|
|
77
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
78
|
+
default: undefined;
|
|
79
|
+
};
|
|
80
|
+
modelValue: {
|
|
81
|
+
type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
82
|
+
default: undefined;
|
|
83
|
+
};
|
|
84
|
+
loading: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
41
88
|
loadingLabel: {
|
|
42
89
|
type: StringConstructor;
|
|
43
90
|
default: string;
|
|
44
91
|
};
|
|
45
|
-
label:
|
|
46
|
-
|
|
47
|
-
|
|
92
|
+
label: {
|
|
93
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
94
|
+
default: undefined;
|
|
95
|
+
};
|
|
96
|
+
readonly: {
|
|
97
|
+
type: BooleanConstructor;
|
|
98
|
+
default: boolean;
|
|
99
|
+
};
|
|
100
|
+
disabled: {
|
|
101
|
+
type: BooleanConstructor;
|
|
102
|
+
default: boolean;
|
|
103
|
+
};
|
|
48
104
|
hintLabel: {
|
|
49
105
|
type: StringConstructor;
|
|
50
106
|
default: string;
|
|
51
107
|
};
|
|
52
|
-
invalid:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
108
|
+
invalid: {
|
|
109
|
+
type: BooleanConstructor;
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
invalidLabel: {
|
|
113
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
114
|
+
default: undefined;
|
|
115
|
+
};
|
|
116
|
+
valid: {
|
|
117
|
+
type: BooleanConstructor;
|
|
118
|
+
default: boolean;
|
|
119
|
+
};
|
|
120
|
+
validLabel: {
|
|
121
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
122
|
+
default: undefined;
|
|
123
|
+
};
|
|
56
124
|
tabindex: {
|
|
57
125
|
type: (StringConstructor | NumberConstructor)[];
|
|
58
126
|
default: number;
|
|
@@ -62,22 +130,26 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
62
130
|
required: boolean;
|
|
63
131
|
};
|
|
64
132
|
id: (StringConstructor | NumberConstructor)[];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
readonly: boolean;
|
|
133
|
+
}>>, {
|
|
134
|
+
label: string | number;
|
|
135
|
+
value: string | number | boolean;
|
|
69
136
|
disabled: boolean;
|
|
70
|
-
|
|
71
|
-
|
|
137
|
+
modelValue: string | number | boolean | Record<string, any>;
|
|
138
|
+
modifiers: string | string[];
|
|
72
139
|
switch: boolean;
|
|
73
|
-
|
|
140
|
+
readonly: boolean;
|
|
74
141
|
loading: boolean;
|
|
75
142
|
loadingLabel: string;
|
|
76
143
|
indeterminate: boolean;
|
|
77
144
|
hintLabel: string;
|
|
145
|
+
invalid: boolean;
|
|
146
|
+
invalidLabel: string | unknown[];
|
|
147
|
+
valid: boolean;
|
|
148
|
+
validLabel: string | unknown[];
|
|
149
|
+
tabindex: string | number;
|
|
78
150
|
}, {}>, {
|
|
79
151
|
default?(_: {
|
|
80
|
-
value:
|
|
152
|
+
value: unknown;
|
|
81
153
|
}): any;
|
|
82
154
|
hint?(_: {
|
|
83
155
|
modelValue: unknown;
|