@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
|
@@ -8,30 +8,63 @@ export declare const VvCheckboxProps: {
|
|
|
8
8
|
/**
|
|
9
9
|
* Value associated with the unchecked state
|
|
10
10
|
*/
|
|
11
|
-
uncheckedValue: (
|
|
11
|
+
uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
12
12
|
/**
|
|
13
13
|
* If true, the input will be displayed as a switch
|
|
14
14
|
*/
|
|
15
15
|
switch: BooleanConstructor;
|
|
16
|
-
modifiers:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
modifiers: {
|
|
17
|
+
type: globalThis.PropType<string | string[]>;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
20
|
+
value: {
|
|
21
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
22
|
+
default: undefined;
|
|
23
|
+
};
|
|
24
|
+
modelValue: {
|
|
25
|
+
type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
loading: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
20
32
|
loadingLabel: {
|
|
21
33
|
type: StringConstructor;
|
|
22
34
|
default: string;
|
|
23
35
|
};
|
|
24
|
-
label:
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
label: {
|
|
37
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
readonly: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
disabled: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
27
48
|
hintLabel: {
|
|
28
49
|
type: StringConstructor;
|
|
29
50
|
default: string;
|
|
30
51
|
};
|
|
31
|
-
invalid:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
52
|
+
invalid: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
invalidLabel: {
|
|
57
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
60
|
+
valid: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
validLabel: {
|
|
65
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
35
68
|
tabindex: {
|
|
36
69
|
type: (StringConstructor | NumberConstructor)[];
|
|
37
70
|
default: number;
|
|
@@ -51,9 +84,9 @@ export declare function useGroupProps(props: VvCheckboxPropsTypes, emit: (event:
|
|
|
51
84
|
id: Ref<string | number | undefined> | undefined;
|
|
52
85
|
propsSwitch: Ref<boolean>;
|
|
53
86
|
indeterminate: Ref<boolean>;
|
|
54
|
-
group:
|
|
87
|
+
group: InputGroupState | undefined;
|
|
55
88
|
isInGroup: globalThis.ComputedRef<boolean>;
|
|
56
|
-
modelValue:
|
|
89
|
+
modelValue: Ref<unknown>;
|
|
57
90
|
valid: Ref<boolean>;
|
|
58
91
|
invalid: Ref<boolean>;
|
|
59
92
|
readonly: globalThis.ComputedRef<boolean>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { computed, isRef, defineComponent, h, inject, toRef, toRefs, unref, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps, provide, createCommentVNode, Fragment, renderList, createBlock, mergeProps } from "vue";
|
|
2
|
+
import { uid } from "uid";
|
|
3
3
|
import { useVModel } from "@vueuse/core";
|
|
4
4
|
import { get } from "ts-dot-prop";
|
|
5
|
+
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
6
|
+
StorageType2["local"] = "local";
|
|
7
|
+
StorageType2["session"] = "session";
|
|
8
|
+
return StorageType2;
|
|
9
|
+
})(StorageType || {});
|
|
5
10
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
6
11
|
Strategy2["absolute"] = "absolute";
|
|
7
12
|
Strategy2["fixed"] = "fixed";
|
|
@@ -36,15 +41,17 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
36
41
|
ButtonType2["reset"] = "reset";
|
|
37
42
|
return ButtonType2;
|
|
38
43
|
})(ButtonType || {});
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return
|
|
45
|
-
})(
|
|
44
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
45
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
46
|
+
ActionTag2["routerLink"] = "router-link";
|
|
47
|
+
ActionTag2["a"] = "a";
|
|
48
|
+
ActionTag2["button"] = "button";
|
|
49
|
+
return ActionTag2;
|
|
50
|
+
})(ActionTag || {});
|
|
46
51
|
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
47
|
-
const INJECTION_KEY_CHECK_GROUP = Symbol.for(
|
|
52
|
+
const INJECTION_KEY_CHECK_GROUP = Symbol.for(
|
|
53
|
+
"checkGroup"
|
|
54
|
+
);
|
|
48
55
|
function equals(obj1, obj2, field) {
|
|
49
56
|
if (field) {
|
|
50
57
|
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
@@ -124,9 +131,6 @@ function contains(value, list) {
|
|
|
124
131
|
}
|
|
125
132
|
return false;
|
|
126
133
|
}
|
|
127
|
-
function isEmpty(value) {
|
|
128
|
-
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));
|
|
129
|
-
}
|
|
130
134
|
function isString(value) {
|
|
131
135
|
return typeof value === "string" || value instanceof String;
|
|
132
136
|
}
|
|
@@ -263,10 +267,7 @@ const LinkProps = {
|
|
|
263
267
|
/**
|
|
264
268
|
* Anchor target
|
|
265
269
|
*/
|
|
266
|
-
target:
|
|
267
|
-
type: String,
|
|
268
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
269
|
-
},
|
|
270
|
+
target: String,
|
|
270
271
|
/**
|
|
271
272
|
* Anchor rel
|
|
272
273
|
*/
|
|
@@ -279,27 +280,33 @@ const ValidProps = {
|
|
|
279
280
|
/**
|
|
280
281
|
* Valid status
|
|
281
282
|
*/
|
|
282
|
-
valid: Boolean,
|
|
283
|
+
valid: { type: Boolean, default: false },
|
|
283
284
|
/**
|
|
284
285
|
* Valid label
|
|
285
286
|
*/
|
|
286
|
-
validLabel: [String, Array]
|
|
287
|
+
validLabel: { type: [String, Array], default: void 0 }
|
|
287
288
|
};
|
|
288
289
|
const InvalidProps = {
|
|
289
290
|
/**
|
|
290
291
|
* Invalid status
|
|
291
292
|
*/
|
|
292
|
-
invalid:
|
|
293
|
+
invalid: {
|
|
294
|
+
type: Boolean,
|
|
295
|
+
default: false
|
|
296
|
+
},
|
|
293
297
|
/**
|
|
294
298
|
* Invalid label
|
|
295
299
|
*/
|
|
296
|
-
invalidLabel: [String, Array]
|
|
300
|
+
invalidLabel: { type: [String, Array], default: void 0 }
|
|
297
301
|
};
|
|
298
302
|
const LoadingProps = {
|
|
299
303
|
/**
|
|
300
304
|
* Loading status
|
|
301
305
|
*/
|
|
302
|
-
loading:
|
|
306
|
+
loading: {
|
|
307
|
+
type: Boolean,
|
|
308
|
+
default: false
|
|
309
|
+
},
|
|
303
310
|
/**
|
|
304
311
|
* Loading label
|
|
305
312
|
*/
|
|
@@ -312,43 +319,64 @@ const DisabledProps = {
|
|
|
312
319
|
/**
|
|
313
320
|
* Whether the form control is disabled
|
|
314
321
|
*/
|
|
315
|
-
disabled:
|
|
322
|
+
disabled: {
|
|
323
|
+
type: Boolean,
|
|
324
|
+
default: false
|
|
325
|
+
}
|
|
316
326
|
};
|
|
317
327
|
const ActiveProps = {
|
|
318
328
|
/**
|
|
319
329
|
* Whether the item is active
|
|
320
330
|
*/
|
|
321
|
-
active:
|
|
331
|
+
active: {
|
|
332
|
+
type: Boolean,
|
|
333
|
+
default: false
|
|
334
|
+
}
|
|
322
335
|
};
|
|
323
336
|
const CurrentProps = {
|
|
324
337
|
/**
|
|
325
338
|
* Whether the item is current
|
|
326
339
|
*/
|
|
327
|
-
current:
|
|
340
|
+
current: {
|
|
341
|
+
type: Boolean,
|
|
342
|
+
default: false
|
|
343
|
+
}
|
|
328
344
|
};
|
|
329
345
|
const PressedProps = {
|
|
330
346
|
/**
|
|
331
347
|
* Whether the item is pressed
|
|
332
348
|
*/
|
|
333
|
-
pressed:
|
|
349
|
+
pressed: {
|
|
350
|
+
type: Boolean,
|
|
351
|
+
default: false
|
|
352
|
+
}
|
|
334
353
|
};
|
|
335
354
|
const LabelProps = {
|
|
336
355
|
/**
|
|
337
356
|
* The item label
|
|
338
357
|
*/
|
|
339
|
-
label:
|
|
358
|
+
label: {
|
|
359
|
+
type: [String, Number],
|
|
360
|
+
default: void 0
|
|
361
|
+
}
|
|
340
362
|
};
|
|
341
363
|
const ReadonlyProps = {
|
|
342
364
|
/**
|
|
343
365
|
* The value is not editable
|
|
344
366
|
*/
|
|
345
|
-
readonly:
|
|
367
|
+
readonly: {
|
|
368
|
+
type: Boolean,
|
|
369
|
+
default: false
|
|
370
|
+
}
|
|
346
371
|
};
|
|
347
372
|
const ModifiersProps = {
|
|
348
373
|
/**
|
|
349
374
|
* Component BEM modifiers
|
|
350
375
|
*/
|
|
351
|
-
modifiers:
|
|
376
|
+
modifiers: {
|
|
377
|
+
type: [String, Array],
|
|
378
|
+
default: void 0
|
|
379
|
+
}
|
|
352
380
|
};
|
|
353
381
|
const HintProps = {
|
|
354
382
|
hintLabel: { type: String, default: "" }
|
|
@@ -379,7 +407,10 @@ const OptionsProps = {
|
|
|
379
407
|
* VvIcon name or props
|
|
380
408
|
* @see VVIcon
|
|
381
409
|
*/
|
|
382
|
-
icon: {
|
|
410
|
+
icon: {
|
|
411
|
+
type: [String, Object],
|
|
412
|
+
default: void 0
|
|
413
|
+
},
|
|
383
414
|
/**
|
|
384
415
|
* VvIcon position
|
|
385
416
|
*/
|
|
@@ -424,7 +455,8 @@ const IdProps = {
|
|
|
424
455
|
* Dropdown show / hide transition name
|
|
425
456
|
*/
|
|
426
457
|
transitionName: {
|
|
427
|
-
type: String
|
|
458
|
+
type: String,
|
|
459
|
+
default: void 0
|
|
428
460
|
},
|
|
429
461
|
/**
|
|
430
462
|
* Offset of the dropdown from the trigger
|
|
@@ -492,7 +524,8 @@ const IdProps = {
|
|
|
492
524
|
* Set dropdown width to the same as the trigger
|
|
493
525
|
*/
|
|
494
526
|
triggerWidth: {
|
|
495
|
-
type: Boolean
|
|
527
|
+
type: Boolean,
|
|
528
|
+
default: false
|
|
496
529
|
}
|
|
497
530
|
});
|
|
498
531
|
const IdNameProps = {
|
|
@@ -519,11 +552,17 @@ const CheckboxRadioProps = {
|
|
|
519
552
|
* Input value
|
|
520
553
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
521
554
|
*/
|
|
522
|
-
value:
|
|
555
|
+
value: {
|
|
556
|
+
type: [String, Number, Boolean],
|
|
557
|
+
default: void 0
|
|
558
|
+
},
|
|
523
559
|
/**
|
|
524
560
|
* Input value
|
|
525
561
|
*/
|
|
526
|
-
modelValue:
|
|
562
|
+
modelValue: {
|
|
563
|
+
type: [Object, Number, Boolean, String],
|
|
564
|
+
default: void 0
|
|
565
|
+
}
|
|
527
566
|
};
|
|
528
567
|
const CheckboxRadioGroupProps = {
|
|
529
568
|
...ValidProps,
|
|
@@ -538,7 +577,10 @@ const CheckboxRadioGroupProps = {
|
|
|
538
577
|
/**
|
|
539
578
|
* Input value
|
|
540
579
|
*/
|
|
541
|
-
modelValue:
|
|
580
|
+
modelValue: {
|
|
581
|
+
type: [String, Array, Boolean, Number, Symbol],
|
|
582
|
+
default: void 0
|
|
583
|
+
},
|
|
542
584
|
/**
|
|
543
585
|
* Input name
|
|
544
586
|
*/
|
|
@@ -546,7 +588,10 @@ const CheckboxRadioGroupProps = {
|
|
|
546
588
|
/**
|
|
547
589
|
* If true, the group will be displayed in a vertical column
|
|
548
590
|
*/
|
|
549
|
-
vertical:
|
|
591
|
+
vertical: {
|
|
592
|
+
type: Boolean,
|
|
593
|
+
default: false
|
|
594
|
+
}
|
|
550
595
|
};
|
|
551
596
|
({
|
|
552
597
|
...DisabledProps,
|
|
@@ -569,17 +614,32 @@ const CheckboxRadioGroupProps = {
|
|
|
569
614
|
ariaLabel: {
|
|
570
615
|
type: String,
|
|
571
616
|
default: void 0
|
|
617
|
+
},
|
|
618
|
+
/**
|
|
619
|
+
* Default tag for the action
|
|
620
|
+
*/
|
|
621
|
+
defaultTag: {
|
|
622
|
+
type: String,
|
|
623
|
+
default: ActionTag.button
|
|
572
624
|
}
|
|
573
625
|
});
|
|
626
|
+
({
|
|
627
|
+
storageType: {
|
|
628
|
+
type: String,
|
|
629
|
+
default: StorageType.local,
|
|
630
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
631
|
+
},
|
|
632
|
+
storageKey: String
|
|
633
|
+
});
|
|
574
634
|
function useInjectedGroupState(groupKey) {
|
|
575
635
|
const group = inject(groupKey, void 0);
|
|
576
|
-
const isInGroup = computed(() =>
|
|
636
|
+
const isInGroup = computed(() => group !== void 0);
|
|
577
637
|
function getGroupOrLocalRef(propName, props, emit) {
|
|
578
|
-
|
|
579
|
-
|
|
638
|
+
const groupPropValue = group == null ? void 0 : group[propName];
|
|
639
|
+
if (groupPropValue) {
|
|
580
640
|
return computed({
|
|
581
641
|
get() {
|
|
582
|
-
return groupPropValue
|
|
642
|
+
return groupPropValue.value;
|
|
583
643
|
},
|
|
584
644
|
set(value) {
|
|
585
645
|
groupPropValue.value = value;
|
|
@@ -592,8 +652,9 @@ function useInjectedGroupState(groupKey) {
|
|
|
592
652
|
return propRef.value;
|
|
593
653
|
},
|
|
594
654
|
set(value) {
|
|
595
|
-
if (emit)
|
|
655
|
+
if (emit) {
|
|
596
656
|
emit(`update:${propName}`, value);
|
|
657
|
+
}
|
|
597
658
|
}
|
|
598
659
|
});
|
|
599
660
|
}
|
|
@@ -627,16 +688,10 @@ function useGroupProps(props, emit) {
|
|
|
627
688
|
const valid = getGroupOrLocalRef("valid", props);
|
|
628
689
|
const invalid = getGroupOrLocalRef("invalid", props);
|
|
629
690
|
const readonly = computed(
|
|
630
|
-
() =>
|
|
631
|
-
var _a;
|
|
632
|
-
return Boolean(props.readonly || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.readonly.value));
|
|
633
|
-
}
|
|
691
|
+
() => Boolean(props.readonly || (group == null ? void 0 : group.readonly.value))
|
|
634
692
|
);
|
|
635
693
|
const disabled = computed(
|
|
636
|
-
() =>
|
|
637
|
-
var _a;
|
|
638
|
-
return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
|
|
639
|
-
}
|
|
694
|
+
() => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
|
|
640
695
|
);
|
|
641
696
|
return {
|
|
642
697
|
// local props
|
|
@@ -709,7 +764,7 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
709
764
|
}, {});
|
|
710
765
|
});
|
|
711
766
|
}
|
|
712
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
767
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
713
768
|
function useModifiers(prefix, modifiers, others) {
|
|
714
769
|
return computed(() => {
|
|
715
770
|
const toReturn = {
|
|
@@ -742,8 +797,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
742
797
|
...__default__$1,
|
|
743
798
|
props: VvCheckboxProps,
|
|
744
799
|
emits: VvCheckboxEvents,
|
|
745
|
-
setup(__props, { emit }) {
|
|
800
|
+
setup(__props, { emit: __emit }) {
|
|
746
801
|
const props = __props;
|
|
802
|
+
const emit = __emit;
|
|
747
803
|
const slots = useSlots();
|
|
748
804
|
const propsDefaults = useDefaults(
|
|
749
805
|
"VvCheckbox",
|
|
@@ -886,12 +942,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
886
942
|
[vModelCheckbox, unref(localModelValue)]
|
|
887
943
|
]),
|
|
888
944
|
renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
|
|
889
|
-
createTextVNode(
|
|
945
|
+
createTextVNode(
|
|
946
|
+
toDisplayString(_ctx.label),
|
|
947
|
+
1
|
|
948
|
+
/* TEXT */
|
|
949
|
+
)
|
|
890
950
|
]),
|
|
891
951
|
createVNode(unref(HintSlot), {
|
|
892
952
|
id: unref(hasHintId),
|
|
893
953
|
class: "vv-checkbox__hint"
|
|
894
|
-
}, createSlots({
|
|
954
|
+
}, createSlots({
|
|
955
|
+
_: 2
|
|
956
|
+
/* DYNAMIC */
|
|
957
|
+
}, [
|
|
895
958
|
_ctx.$slots.hint ? {
|
|
896
959
|
name: "hint",
|
|
897
960
|
fn: withCtx(() => [
|
|
@@ -927,15 +990,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
927
990
|
});
|
|
928
991
|
const VvCheckboxGroupProps = CheckboxRadioGroupProps;
|
|
929
992
|
const VvCheckboxGroupEvents = ["update:modelValue", "change"];
|
|
930
|
-
function useProvideGroupState(groupState) {
|
|
931
|
-
|
|
932
|
-
(k) => k !== "key" && !isRef(groupState[k])
|
|
933
|
-
))
|
|
934
|
-
throw Error("One or more groupState props aren't ref.");
|
|
935
|
-
provide(
|
|
936
|
-
groupState.key,
|
|
937
|
-
computed(() => groupState)
|
|
938
|
-
);
|
|
993
|
+
function useProvideGroupState(key, groupState) {
|
|
994
|
+
provide(key, groupState);
|
|
939
995
|
}
|
|
940
996
|
function useOptions(props) {
|
|
941
997
|
const { options, labelKey, valueKey, disabledKey } = toRefs(props);
|
|
@@ -978,8 +1034,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
978
1034
|
...__default__,
|
|
979
1035
|
props: VvCheckboxGroupProps,
|
|
980
1036
|
emits: VvCheckboxGroupEvents,
|
|
981
|
-
setup(__props, { emit }) {
|
|
1037
|
+
setup(__props, { emit: __emit }) {
|
|
982
1038
|
const props = __props;
|
|
1039
|
+
const emit = __emit;
|
|
983
1040
|
const slots = useSlots();
|
|
984
1041
|
const propsDefaults = useDefaults(
|
|
985
1042
|
"VvCheckboxGroup",
|
|
@@ -988,8 +1045,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
988
1045
|
);
|
|
989
1046
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
990
1047
|
const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
|
|
991
|
-
useProvideGroupState({
|
|
992
|
-
key: INJECTION_KEY_CHECK_GROUP,
|
|
1048
|
+
useProvideGroupState(INJECTION_KEY_CHECK_GROUP, {
|
|
993
1049
|
modelValue,
|
|
994
1050
|
disabled,
|
|
995
1051
|
readonly,
|
|
@@ -1018,49 +1074,76 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1018
1074
|
};
|
|
1019
1075
|
const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
|
|
1020
1076
|
return (_ctx, _cache) => {
|
|
1021
|
-
return openBlock(), createElementBlock(
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
key:
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1077
|
+
return openBlock(), createElementBlock(
|
|
1078
|
+
"fieldset",
|
|
1079
|
+
{
|
|
1080
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1081
|
+
},
|
|
1082
|
+
[
|
|
1083
|
+
_ctx.label ? (openBlock(), createElementBlock("legend", {
|
|
1084
|
+
key: 0,
|
|
1085
|
+
textContent: toDisplayString(_ctx.label)
|
|
1086
|
+
}, null, 8, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
1087
|
+
createElementVNode("div", _hoisted_2, [
|
|
1088
|
+
_ctx.options.length > 0 ? (openBlock(true), createElementBlock(
|
|
1089
|
+
Fragment,
|
|
1090
|
+
{ key: 0 },
|
|
1091
|
+
renderList(_ctx.options, (option, index) => {
|
|
1092
|
+
return openBlock(), createBlock(
|
|
1093
|
+
_sfc_main$1,
|
|
1094
|
+
mergeProps({ key: index }, getOptionProps(option, index)),
|
|
1095
|
+
null,
|
|
1096
|
+
16
|
|
1097
|
+
/* FULL_PROPS */
|
|
1098
|
+
);
|
|
1099
|
+
}),
|
|
1100
|
+
128
|
|
1101
|
+
/* KEYED_FRAGMENT */
|
|
1102
|
+
)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
1103
|
+
]),
|
|
1104
|
+
createVNode(
|
|
1105
|
+
unref(HintSlot),
|
|
1106
|
+
{ class: "vv-checkbox-group__hint" },
|
|
1107
|
+
createSlots({
|
|
1108
|
+
_: 2
|
|
1109
|
+
/* DYNAMIC */
|
|
1110
|
+
}, [
|
|
1111
|
+
_ctx.$slots.hint ? {
|
|
1112
|
+
name: "hint",
|
|
1113
|
+
fn: withCtx(() => [
|
|
1114
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1115
|
+
]),
|
|
1116
|
+
key: "0"
|
|
1117
|
+
} : void 0,
|
|
1118
|
+
_ctx.$slots.loading ? {
|
|
1119
|
+
name: "loading",
|
|
1120
|
+
fn: withCtx(() => [
|
|
1121
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1122
|
+
]),
|
|
1123
|
+
key: "1"
|
|
1124
|
+
} : void 0,
|
|
1125
|
+
_ctx.$slots.valid ? {
|
|
1126
|
+
name: "valid",
|
|
1127
|
+
fn: withCtx(() => [
|
|
1128
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1129
|
+
]),
|
|
1130
|
+
key: "2"
|
|
1131
|
+
} : void 0,
|
|
1132
|
+
_ctx.$slots.invalid ? {
|
|
1133
|
+
name: "invalid",
|
|
1134
|
+
fn: withCtx(() => [
|
|
1135
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1136
|
+
]),
|
|
1137
|
+
key: "3"
|
|
1138
|
+
} : void 0
|
|
1059
1139
|
]),
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1140
|
+
1024
|
|
1141
|
+
/* DYNAMIC_SLOTS */
|
|
1142
|
+
)
|
|
1143
|
+
],
|
|
1144
|
+
2
|
|
1145
|
+
/* CLASS */
|
|
1146
|
+
);
|
|
1064
1147
|
};
|
|
1065
1148
|
}
|
|
1066
1149
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=l(e.vue,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,l,t,o){"use strict";var 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||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("checkGroup");function d(e,l,t){return t?v(e,t)===v(l,t):s(e,l)}function s(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),o=Array.isArray(l);let a,n,i;if(t&&o){if(n=e.length,n!=l.length)return!1;for(a=n;0!=a--;)if(!s(e[a],l[a]))return!1;return!0}if(t!=o)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const d=e instanceof RegExp,v=l instanceof RegExp;if(d!=v)return!1;if(d&&v)return e.toString()==l.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(l).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(l,c[a]))return!1;for(a=n;0!=a--;)if(i=c[a],!s(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function v(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let o=e;for(let l=0,a=t.length;l<a;++l){if(null==e)return null;o=o[t[l]]}return o}}return null}function c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function f(l,t){const o=e.computed((()=>e.isRef(l)?l.value:l)),a=e.computed((()=>c(o.value.invalidLabel))),n=e.computed((()=>c(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(t.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(t.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(t.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(t.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var l,t,o,a,n,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==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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:p,HintSlot:m}}const p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},h={disabled:Boolean},g=(Boolean,Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},k={hintLabel:{type:String,default:""}},L={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const B={tabindex:{type:[String,Number],default:0}},O={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const V={...{...O,name:{type:String,required:!0}},...B,...p,...m,...k,...h,...y,...S,...g,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},x={...p,...m,...L,...k,...h,...y,...S,...g,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function $(l){const t=e.inject(l,void 0),o=e.computed((()=>{return l=t,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o}));return{group:t,isInGroup:o,getGroupOrLocalRef:function(l,o,a){if(null==t?void 0:t.value){const o=e.unref(t.value)[l];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,l);return e.computed({get:()=>n.value,set(e){a&&a(`update:${l}`,e)}})}}}i.button;const A={...V,...S,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function C(l,t,o){const a=e.inject(r),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[l]))return a.defaults.value[l]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,l=t,a=o;return Object.keys(l).reduce(((t,o)=>{const n=a[o];if(t[o]=n,o in e){if(Array.isArray(l[o])){const a=l[o];if(a.length){a[0]===n&&(t[o]=e[o])}}if("function"==typeof l[o]){(0,l[o])()===n&&(t[o]=e[o])}if("object"==typeof l[o]){let a=l[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(t[o]=e[o]):a===n&&(t[o]=e[o])}}return t}),{})}))}function j(l,t,o){return e.computed((()=>{const a={[l]:!0},n="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((t=>{a[`${l}--${t}`]=e.unref(o.value[t])})),a}))}const w=["for"],R=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],P=e.defineComponent({name:"VvCheckbox",props:A,emits:["click","update:modelValue","change","blur"],setup(t,{emit:o}){const a=t,n=e.useSlots(),i=C("VvCheckbox",A,a),{id:r,disabled:s,readonly:v,valid:c,invalid:p,propsSwitch:m,modelValue:b,indeterminate:h,isInGroup:g}=function(l,t){const{group:o,isInGroup:a,getGroupOrLocalRef:n}=$(u),{id:i,switch:r,indeterminate:d}=e.toRefs(l),s=n("modelValue",l,t),v=n("valid",l),c=n("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==o?void 0:o.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==o?void 0:o.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:d,group:o,isInGroup:a,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(a,o),y=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(r),S=e.computed((()=>`${y.value}-hint`)),k=e.computed((()=>O.value?-1:a.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==a.uncheckedValue&&!g.value)),O=e.computed((()=>s.value||v.value)),V=e.computed((()=>!0===p.value||!0!==c.value&&void 0)),x=e.computed((()=>B.value?b.value===a.value:Array.isArray(b.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(d(e,t))return!0;return!1}(a.value,b.value):d(a.value,b.value))),P=e.computed((()=>!!h.value||!(x.value||!B.value||a.uncheckedValue===b.value))),N=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof a.value)||a.value})),E=e.computed({get:()=>x.value,set(e){if(B.value)b.value=e?a.value:a.uncheckedValue;else if(Array.isArray(b.value)||g.value){const l=new Set(Array.isArray(b.value)?b.value:void 0!==b.value?[b.value]:[]);e?l.add(a.value):l.delete(a.value),b.value=[...l]}else b.value=e?a.value:void 0;o("change",e)}}),{modifiers:_}=e.toRefs(a),z=j("vv-checkbox",_,e.computed((()=>({switch:m.value,valid:c.value,invalid:p.value,disabled:s.value,readonly:v.value,indeterminate:h.value}))));e.watchEffect((()=>{B.value&&Array.isArray(b.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>P.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{P.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:D,hintSlotScope:H}=f(i,n);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(z)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:L,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(E)?E.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(O),value:e.unref(N),tabindex:e.unref(k),"aria-invalid":e.unref(V),"aria-describedby":e.unref(I)?e.unref(S):void 0,"aria-errormessage":e.unref(D)?e.unref(S):void 0},null,8,R),[[e.vModelCheckbox,e.unref(E)]]),e.renderSlot(l.$slots,"default",{value:e.unref(b)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(G),{id:e.unref(S),class:"vv-checkbox__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"3"}:void 0]),1032,["id"])],10,w))}}),N=x;const E=["textContent"],_={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:N,emits:["update:modelValue","change"],setup(l,{emit:a}){const n=l,i=e.useSlots(),r=C("VvCheckboxGroup",N,n),d=t.useVModel(n,"modelValue",a),{disabled:s,readonly:v,vertical:c,valid:p,invalid:m,modifiers:b}=e.toRefs(n);!function(l){if(Object.keys(l).some((t=>"key"!==t&&!e.isRef(l[t]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:u,modelValue:d,disabled:s,readonly:v,valid:p,invalid:m});const{getOptionLabel:h,getOptionValue:g}=function(l){const{options:t,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(l);return{options:t,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):o.get(e,a.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):o.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),y=j("vv-checkbox-group",b,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!c.value,valid:p.value,invalid:m.value})))),{HintSlot:S,hintSlotScope:k}=f(r,i);return(l,t)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,E)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,t)=>(e.openBlock(),e.createBlock(P,e.mergeProps({key:t},((e,l)=>({id:`${n.name}_opt${l}`,name:n.name,label:h(e),value:g(e)}))(l,t)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,a){"use strict";var o=(e=>(e.local="local",e.session="session",e))(o||{}),n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),i=(e=>(e.before="before",e.after="after",e))(i||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{});const d=Symbol.for("volver"),s=Symbol.for("checkGroup");function v(e,t,l){return l?f(e,l)===f(t,l):c(e,t)}function c(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 o,n,i;if(l&&a){if(n=e.length,n!=t.length)return!1;for(o=n;0!=o--;)if(!c(e[o],t[o]))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(n=v.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,v[o]))return!1;for(o=n;0!=o--;)if(i=v[o],!c(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function f(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,o=l.length;t<o;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function b(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),o=e.computed((()=>p(a.value.invalidLabel))),n=e.computed((()=>p(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||o.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||n.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}))),b=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,o,n,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==(o=(a=this.$slots).invalid)?void 0:o.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??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:b}}const m={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},h={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},y={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),k={readonly:{type:Boolean,default:!1}},L={modifiers:{type:[String,Array],default:void 0}},B={hintLabel:{type:String,default:""}},V={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};i.before;const x={tabindex:{type:[String,Number],default:0}},O={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const $={...{...O,name:{type:String,required:!0}},...x,...m,...h,...B,...g,...k,...L,...S,...y,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},A={...m,...h,...V,...B,...g,...k,...L,...S,...y,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};r.button,u.button,o.local;const C={...$,...L,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function w(t,l){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=function(t){const l=e.inject(t,void 0),a=e.computed((()=>void 0!==l));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,o){const n=null==l?void 0:l[t];if(n)return e.computed({get:()=>n.value,set(e){n.value=e}});const i=e.toRef(a,t);return e.computed({get:()=>i.value,set(e){o&&o(`update:${t}`,e)}})}}}(s),{id:i,switch:r,indeterminate:u}=e.toRefs(t),d=n("modelValue",t,l),v=n("valid",t),c=n("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:u,group:a,isInGroup:o,modelValue:d,valid:v,invalid:c,readonly:f,disabled:p}}function j(t,l,a){const o=e.inject(d),n=e.computed((()=>{var e;if(o&&(null==(e=o.defaults.value)?void 0:e[t]))return o.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return a;const e=n.value,t=l,o=a;return Object.keys(t).reduce(((l,a)=>{const n=o[a];if(l[a]=n,a in e){if(Array.isArray(t[a])){const o=t[a];if(o.length){o[0]===n&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===n&&(l[a]=e[a])}if("object"==typeof t[a]){let o=t[a].default;"function"==typeof o&&(o=o()),"object"==typeof o?JSON.stringify(o)===JSON.stringify(n)&&(l[a]=e[a]):o===n&&(l[a]=e[a])}}return l}),{})}))}function P(t,l,a){return e.computed((()=>{const o={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(o[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{o[`${t}--${l}`]=e.unref(a.value[l])})),o}))}const R=["for"],N=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],_=e.defineComponent({name:"VvCheckbox",props:C,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const o=l,n=a,i=e.useSlots(),r=j("VvCheckbox",C,o),{id:u,disabled:d,readonly:s,valid:c,invalid:f,propsSwitch:p,modelValue:m,indeterminate:h,isInGroup:y}=w(o,n),g=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),S=e.computed((()=>`${g.value}-hint`)),k=e.computed((()=>V.value?-1:o.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==o.uncheckedValue&&!y.value)),V=e.computed((()=>d.value||s.value)),x=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),O=e.computed((()=>B.value?m.value===o.value:Array.isArray(m.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(v(e,l))return!0;return!1}(o.value,m.value):v(o.value,m.value))),$=e.computed((()=>!!h.value||!(O.value||!B.value||o.uncheckedValue===m.value))),A=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),_=e.computed({get:()=>O.value,set(e){if(B.value)m.value=e?o.value:o.uncheckedValue;else if(Array.isArray(m.value)||y.value){const t=new Set(Array.isArray(m.value)?m.value:void 0!==m.value?[m.value]:[]);e?t.add(o.value):t.delete(o.value),m.value=[...t]}else m.value=e?o.value:void 0;n("change",e)}}),{modifiers:z}=e.toRefs(o),E=P("vv-checkbox",z,e.computed((()=>({switch:p.value,valid:c.value,invalid:f.value,disabled:d.value,readonly:s.value,indeterminate:h.value}))));e.watchEffect((()=>{B.value&&Array.isArray(m.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>$.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{$.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:D,hintSlotScope:H}=b(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(E)),for:e.unref(g)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(g),ref_key:"input",ref:L,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(_)?_.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(V),value:e.unref(A),tabindex:e.unref(k),"aria-invalid":e.unref(x),"aria-describedby":e.unref(I)?e.unref(S):void 0,"aria-errormessage":e.unref(D)?e.unref(S):void 0},null,8,N),[[e.vModelCheckbox,e.unref(_)]]),e.renderSlot(t.$slots,"default",{value:e.unref(m)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{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(H))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"3"}:void 0]),1032,["id"])],10,R))}}),z=A;const E=["textContent"],G={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:z,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,i=o,r=e.useSlots(),u=j("VvCheckboxGroup",z,n),d=l.useVModel(n,"modelValue",i),{disabled:v,readonly:c,vertical:f,valid:p,invalid:m,modifiers:h}=e.toRefs(n);var y,g;y=s,g={modelValue:d,disabled:v,readonly:c,valid:p,invalid:m},e.provide(y,g);const{getOptionLabel:S,getOptionValue:k}=function(t){const{options:l,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),L=P("vv-checkbox-group",h,e.computed((()=>({disabled:v.value,readonly:c.value,horizontal:!f.value,valid:p.value,invalid:m.value})))),{HintSlot:B,hintSlotScope:V}=b(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(L))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,E)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",G,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(_,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:S(e),value:k(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(B),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(V))))])),key:"3"}:void 0]),1024)],2))}})}));
|