@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,25 +1,58 @@
|
|
|
1
|
-
import type { ExtractPropTypes
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
import type { InputGroupState } from '../../types/group';
|
|
3
3
|
export declare const VvRadioProps: {
|
|
4
|
-
value:
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
value: {
|
|
5
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
6
|
+
default: undefined;
|
|
7
|
+
};
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
10
|
+
default: undefined;
|
|
11
|
+
};
|
|
12
|
+
loading: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
7
16
|
loadingLabel: {
|
|
8
17
|
type: StringConstructor;
|
|
9
18
|
default: string;
|
|
10
19
|
};
|
|
11
|
-
label:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
label: {
|
|
21
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
22
|
+
default: undefined;
|
|
23
|
+
};
|
|
24
|
+
modifiers: {
|
|
25
|
+
type: globalThis.PropType<string | string[]>;
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
readonly: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
disabled: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
15
36
|
hintLabel: {
|
|
16
37
|
type: StringConstructor;
|
|
17
38
|
default: string;
|
|
18
39
|
};
|
|
19
|
-
invalid:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
invalid: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
invalidLabel: {
|
|
45
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
valid: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
52
|
+
validLabel: {
|
|
53
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
23
56
|
tabindex: {
|
|
24
57
|
type: (StringConstructor | NumberConstructor)[];
|
|
25
58
|
default: number;
|
|
@@ -36,12 +69,12 @@ export type VvRadioPropsType = ExtractPropTypes<typeof VvRadioProps>;
|
|
|
36
69
|
* Merges local and group props
|
|
37
70
|
*/
|
|
38
71
|
export declare function useGroupProps(props: VvRadioPropsType, emit: (event: (typeof VvRadioEvents)[number], value: unknown) => void): {
|
|
39
|
-
id: Ref<string | number | undefined> | undefined;
|
|
40
|
-
group:
|
|
72
|
+
id: globalThis.Ref<string | number | undefined> | undefined;
|
|
73
|
+
group: InputGroupState | undefined;
|
|
41
74
|
isInGroup: globalThis.ComputedRef<boolean>;
|
|
42
|
-
modelValue: globalThis.
|
|
43
|
-
valid: Ref<boolean>;
|
|
44
|
-
invalid: Ref<boolean>;
|
|
75
|
+
modelValue: globalThis.Ref<unknown>;
|
|
76
|
+
valid: globalThis.Ref<boolean>;
|
|
77
|
+
invalid: globalThis.Ref<boolean>;
|
|
45
78
|
readonly: globalThis.ComputedRef<boolean>;
|
|
46
79
|
disabled: globalThis.ComputedRef<boolean>;
|
|
47
80
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { computed, isRef, defineComponent, h, inject, toRef, toRefs, unref, useSlots, ref, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelRadio, 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_RADIO_GROUP = Symbol.for(
|
|
52
|
+
const INJECTION_KEY_RADIO_GROUP = Symbol.for(
|
|
53
|
+
"radioGroup"
|
|
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
|
}
|
|
@@ -612,16 +673,10 @@ function useGroupProps(props, emit) {
|
|
|
612
673
|
const valid = getGroupOrLocalRef("valid", props);
|
|
613
674
|
const invalid = getGroupOrLocalRef("invalid", props);
|
|
614
675
|
const readonly = computed(
|
|
615
|
-
() =>
|
|
616
|
-
var _a;
|
|
617
|
-
return Boolean(props.readonly || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.readonly.value));
|
|
618
|
-
}
|
|
676
|
+
() => Boolean(props.readonly || (group == null ? void 0 : group.readonly.value))
|
|
619
677
|
);
|
|
620
678
|
const disabled = computed(
|
|
621
|
-
() =>
|
|
622
|
-
var _a;
|
|
623
|
-
return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
|
|
624
|
-
}
|
|
679
|
+
() => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
|
|
625
680
|
);
|
|
626
681
|
return {
|
|
627
682
|
// local props
|
|
@@ -692,7 +747,7 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
692
747
|
}, {});
|
|
693
748
|
});
|
|
694
749
|
}
|
|
695
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
750
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
696
751
|
function useModifiers(prefix, modifiers, others) {
|
|
697
752
|
return computed(() => {
|
|
698
753
|
const toReturn = {
|
|
@@ -725,8 +780,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
725
780
|
...__default__$1,
|
|
726
781
|
props: VvRadioProps,
|
|
727
782
|
emits: VvRadioEvents,
|
|
728
|
-
setup(__props, { emit }) {
|
|
783
|
+
setup(__props, { emit: __emit }) {
|
|
729
784
|
const props = __props;
|
|
785
|
+
const emit = __emit;
|
|
730
786
|
const slots = useSlots();
|
|
731
787
|
const propsDefaults = useDefaults(
|
|
732
788
|
"VvRadio",
|
|
@@ -807,12 +863,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
807
863
|
[vModelRadio, unref(localModelValue)]
|
|
808
864
|
]),
|
|
809
865
|
renderSlot(_ctx.$slots, "default", { value: unref(modelValue) }, () => [
|
|
810
|
-
createTextVNode(
|
|
866
|
+
createTextVNode(
|
|
867
|
+
toDisplayString(_ctx.label),
|
|
868
|
+
1
|
|
869
|
+
/* TEXT */
|
|
870
|
+
)
|
|
811
871
|
]),
|
|
812
872
|
createVNode(unref(HintSlot), {
|
|
813
873
|
id: unref(hasHintId),
|
|
814
874
|
class: "vv-radio__hint"
|
|
815
|
-
}, createSlots({
|
|
875
|
+
}, createSlots({
|
|
876
|
+
_: 2
|
|
877
|
+
/* DYNAMIC */
|
|
878
|
+
}, [
|
|
816
879
|
_ctx.$slots.hint ? {
|
|
817
880
|
name: "hint",
|
|
818
881
|
fn: withCtx(() => [
|
|
@@ -848,15 +911,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
848
911
|
});
|
|
849
912
|
const VvRadioGroupProps = CheckboxRadioGroupProps;
|
|
850
913
|
const VvRadioGroupEvents = ["update:modelValue", "change"];
|
|
851
|
-
function useProvideGroupState(groupState) {
|
|
852
|
-
|
|
853
|
-
(k) => k !== "key" && !isRef(groupState[k])
|
|
854
|
-
))
|
|
855
|
-
throw Error("One or more groupState props aren't ref.");
|
|
856
|
-
provide(
|
|
857
|
-
groupState.key,
|
|
858
|
-
computed(() => groupState)
|
|
859
|
-
);
|
|
914
|
+
function useProvideGroupState(key, groupState) {
|
|
915
|
+
provide(key, groupState);
|
|
860
916
|
}
|
|
861
917
|
function useOptions(props) {
|
|
862
918
|
const { options, labelKey, valueKey, disabledKey } = toRefs(props);
|
|
@@ -899,8 +955,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
899
955
|
...__default__,
|
|
900
956
|
props: VvRadioGroupProps,
|
|
901
957
|
emits: VvRadioGroupEvents,
|
|
902
|
-
setup(__props, { emit }) {
|
|
958
|
+
setup(__props, { emit: __emit }) {
|
|
903
959
|
const props = __props;
|
|
960
|
+
const emit = __emit;
|
|
904
961
|
const slots = useSlots();
|
|
905
962
|
const propsDefaults = useDefaults(
|
|
906
963
|
"VvRadioGroup",
|
|
@@ -909,8 +966,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
909
966
|
);
|
|
910
967
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
911
968
|
const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
|
|
912
|
-
useProvideGroupState({
|
|
913
|
-
key: INJECTION_KEY_RADIO_GROUP,
|
|
969
|
+
useProvideGroupState(INJECTION_KEY_RADIO_GROUP, {
|
|
914
970
|
modelValue,
|
|
915
971
|
disabled,
|
|
916
972
|
readonly,
|
|
@@ -939,49 +995,76 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
939
995
|
};
|
|
940
996
|
const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
|
|
941
997
|
return (_ctx, _cache) => {
|
|
942
|
-
return openBlock(), createElementBlock(
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
key:
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
998
|
+
return openBlock(), createElementBlock(
|
|
999
|
+
"fieldset",
|
|
1000
|
+
{
|
|
1001
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1002
|
+
},
|
|
1003
|
+
[
|
|
1004
|
+
_ctx.label ? (openBlock(), createElementBlock("legend", {
|
|
1005
|
+
key: 0,
|
|
1006
|
+
textContent: toDisplayString(_ctx.label)
|
|
1007
|
+
}, null, 8, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
1008
|
+
createElementVNode("div", _hoisted_2, [
|
|
1009
|
+
_ctx.options.length > 0 ? (openBlock(true), createElementBlock(
|
|
1010
|
+
Fragment,
|
|
1011
|
+
{ key: 0 },
|
|
1012
|
+
renderList(_ctx.options, (option, index) => {
|
|
1013
|
+
return openBlock(), createBlock(
|
|
1014
|
+
_sfc_main$1,
|
|
1015
|
+
mergeProps({ key: index }, getOptionProps(option, index)),
|
|
1016
|
+
null,
|
|
1017
|
+
16
|
|
1018
|
+
/* FULL_PROPS */
|
|
1019
|
+
);
|
|
1020
|
+
}),
|
|
1021
|
+
128
|
|
1022
|
+
/* KEYED_FRAGMENT */
|
|
1023
|
+
)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
1024
|
+
]),
|
|
1025
|
+
createVNode(
|
|
1026
|
+
unref(HintSlot),
|
|
1027
|
+
{ class: "vv-radio-group__hint" },
|
|
1028
|
+
createSlots({
|
|
1029
|
+
_: 2
|
|
1030
|
+
/* DYNAMIC */
|
|
1031
|
+
}, [
|
|
1032
|
+
_ctx.$slots.hint ? {
|
|
1033
|
+
name: "hint",
|
|
1034
|
+
fn: withCtx(() => [
|
|
1035
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1036
|
+
]),
|
|
1037
|
+
key: "0"
|
|
1038
|
+
} : void 0,
|
|
1039
|
+
_ctx.$slots.loading ? {
|
|
1040
|
+
name: "loading",
|
|
1041
|
+
fn: withCtx(() => [
|
|
1042
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1043
|
+
]),
|
|
1044
|
+
key: "1"
|
|
1045
|
+
} : void 0,
|
|
1046
|
+
_ctx.$slots.valid ? {
|
|
1047
|
+
name: "valid",
|
|
1048
|
+
fn: withCtx(() => [
|
|
1049
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1050
|
+
]),
|
|
1051
|
+
key: "2"
|
|
1052
|
+
} : void 0,
|
|
1053
|
+
_ctx.$slots.invalid ? {
|
|
1054
|
+
name: "invalid",
|
|
1055
|
+
fn: withCtx(() => [
|
|
1056
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1057
|
+
]),
|
|
1058
|
+
key: "3"
|
|
1059
|
+
} : void 0
|
|
980
1060
|
]),
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1061
|
+
1024
|
|
1062
|
+
/* DYNAMIC_SLOTS */
|
|
1063
|
+
)
|
|
1064
|
+
],
|
|
1065
|
+
2
|
|
1066
|
+
/* CLASS */
|
|
1067
|
+
);
|
|
985
1068
|
};
|
|
986
1069
|
}
|
|
987
1070
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=t(e.vue,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,t,l,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("radioGroup");function d(e,t,l){return l?v(e,l)===v(t,l):s(e,t)}function s(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let a,n,i;if(l&&o){if(n=e.length,n!=t.length)return!1;for(a=n;0!=a--;)if(!s(e[a],t[a]))return!1;return!0}if(l!=o)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,v=t instanceof RegExp;if(d!=v)return!1;if(d&&v)return e.toString()==t.toString();const f=Object.keys(e);if(n=f.length,n!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,f[a]))return!1;for(a=n;0!=a--;)if(i=f[a],!s(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function v(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function f(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function c(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>f(o.value.invalidLabel))),n=e.computed((()=>f(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.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)),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:c,invalidLabel:a,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,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==(l=(t=this.$slots).loading)?void 0:l.call(t))??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..."}},g={disabled:Boolean},y=(Boolean,Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},S={modifiers:[String,Array]},L={hintLabel:{type:String,default:""}},O={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}},k={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const V={...{...k,name:{type:String,required:!0}},...B,...p,...m,...L,...g,...h,...S,...y,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},$={...p,...m,...O,...L,...g,...h,...S,...y,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function R(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,t);return e.computed({get:()=>n.value,set(e){a&&a(`update:${t}`,e)}})}}}i.button;const j=V;function A(t,l,o){const a=e.inject(r),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];if(a.length){a[0]===n&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===n&&(l[o]=e[o])}if("object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}function x(t,l,o){return e.computed((()=>{const a={[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&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const P=["for"],C=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],N=e.defineComponent({name:"VvRadio",props:j,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=e.useSlots(),i=A("VvRadio",j,a),{id:r,disabled:s,readonly:v,modelValue:f,valid:p,invalid:m}=function(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=R(u),r=i("modelValue",t,l),d=i("valid",t),s=i("invalid",t),v=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:o,group:a,isInGroup:n,modelValue:r,valid:d,invalid:s,readonly:v,disabled:f}}(a,o),b=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.nanoid()))))(r),g=e.computed((()=>`${b.value}-hint`)),y=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),S=e.computed((()=>s.value||v.value)),L=e.computed((()=>!0===m.value||!0!==p.value&&void 0)),O=e.computed((()=>Array.isArray(f.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(d(e,l))return!0;return!1}(a.value,f.value):d(a.value,f.value))),B=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),k=e.computed({get:()=>O.value?B.value:null,set(e){Array.isArray(f.value)?f.value=[a.value]:f.value=a.value,o("change",e)}}),{modifiers:V}=e.toRefs(a),$=x("vv-radio",V,e.computed((()=>({valid:p.value,invalid:m.value,disabled:s.value,readonly:v.value})))),{HintSlot:N,hasHintLabelOrSlot:w,hasInvalidLabelOrSlot:_,hintSlotScope:z}=c(i,n);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(k)?k.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(S),value:e.unref(B),tabindex:e.unref(y),"aria-invalid":e.unref(L),"aria-describedby":e.unref(w)?e.unref(g):void 0,"aria-errormessage":e.unref(_)?e.unref(g):void 0},null,8,C),[[e.vModelRadio,e.unref(k)]]),e.renderSlot(t.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(N),{id:e.unref(g),class:"vv-radio__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"3"}:void 0]),1032,["id"])],10,P))}}),w=$;const _=["textContent"],z={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:w,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=e.useSlots(),r=A("VvRadioGroup",w,n),d=l.useVModel(n,"modelValue",a),{disabled:s,readonly:v,vertical:f,valid:p,invalid:m,modifiers:b}=e.toRefs(n);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:u,modelValue:d,disabled:s,readonly:v,valid:p,invalid:m});const{getOptionLabel:g,getOptionValue:y}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,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),h=x("vv-radio-group",b,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!f.value,valid:p.value,invalid:m.value})))),{HintSlot:S,hintSlotScope:L}=c(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(h))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,_)):e.createCommentVNode("",!0),e.createElementVNode("div",z,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(N,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:g(e),value:y(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-radio-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),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).VvRadioGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";var a=(e=>(e.local="local",e.session="session",e))(a||{}),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("radioGroup");function v(e,t,l){return l?c(e,l)===c(t,l):f(e,t)}function f(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let a,n,i;if(l&&o){if(n=e.length,n!=t.length)return!1;for(a=n;0!=a--;)if(!f(e[a],t[a]))return!1;return!0}if(l!=o)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(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,v[a]))return!1;for(a=n;0!=a--;)if(i=v[a],!f(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function c(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,a=l.length;t<a;++t){if(null==e)return null;o=o[l[t]]}return o}}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 m(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>p(o.value.invalidLabel))),n=e.computed((()=>p(o.value.validLabel))),i=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),u=e.computed((()=>Boolean(o.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),c=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 t,l,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==(l=(t=this.$slots).loading)?void 0:l.call(t))??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:c,HintSlot:m}}const b={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},y={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},g={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},h={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),L={readonly:{type:Boolean,default:!1}},B={modifiers:{type:[String,Array],default:void 0}},O={hintLabel:{type:String,default:""}},k={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 V={tabindex:{type:[String,Number],default:0}},$={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const R={...{...$,name:{type:String,required:!0}},...V,...b,...y,...O,...h,...L,...B,...S,...g,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},x={...b,...y,...k,...O,...h,...L,...B,...S,...g,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};r.button,u.button,a.local;const j=R;function A(t,l){const{id:o}=e.toRefs(t),{group:a,isInGroup:n,getGroupOrLocalRef:i}=function(t){const l=e.inject(t,void 0),o=e.computed((()=>void 0!==l));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,a){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(o,t);return e.computed({get:()=>i.value,set(e){a&&a(`update:${t}`,e)}})}}}(s),r=i("modelValue",t,l),u=i("valid",t),d=i("invalid",t),v=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),f=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:o,group:a,isInGroup:n,modelValue:r,valid:u,invalid:d,readonly:v,disabled:f}}function P(t,l,o){const a=e.inject(d),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];if(a.length){a[0]===n&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===n&&(l[o]=e[o])}if("object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}function C(t,l,o){return e.computed((()=>{const a={[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&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const N=["for"],_=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],w=e.defineComponent({name:"VvRadio",props:j,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const a=l,n=o,i=e.useSlots(),r=P("VvRadio",j,a),{id:u,disabled:d,readonly:s,modelValue:f,valid:c,invalid:p}=A(a,n),b=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),y=e.computed((()=>`${b.value}-hint`)),g=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),S=e.computed((()=>d.value||s.value)),L=e.computed((()=>!0===p.value||!0!==c.value&&void 0)),B=e.computed((()=>Array.isArray(f.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(v(e,l))return!0;return!1}(a.value,f.value):v(a.value,f.value))),O=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),k=e.computed({get:()=>B.value?O.value:null,set(e){Array.isArray(f.value)?f.value=[a.value]:f.value=a.value,n("change",e)}}),{modifiers:V}=e.toRefs(a),$=C("vv-radio",V,e.computed((()=>({valid:c.value,invalid:p.value,disabled:d.value,readonly:s.value})))),{HintSlot:R,hasHintLabelOrSlot:x,hasInvalidLabelOrSlot:w,hintSlotScope:z}=m(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(k)?k.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(S),value:e.unref(O),tabindex:e.unref(g),"aria-invalid":e.unref(L),"aria-describedby":e.unref(x)?e.unref(y):void 0,"aria-errormessage":e.unref(w)?e.unref(y):void 0},null,8,_),[[e.vModelRadio,e.unref(k)]]),e.renderSlot(t.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(R),{id:e.unref(y),class:"vv-radio__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"3"}:void 0]),1032,["id"])],10,N))}}),z=x;const E=["textContent"],G={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:z,emits:["update:modelValue","change"],setup(t,{emit:a}){const n=t,i=a,r=e.useSlots(),u=P("VvRadioGroup",z,n),d=l.useVModel(n,"modelValue",i),{disabled:v,readonly:f,vertical:c,valid:p,invalid:b,modifiers:y}=e.toRefs(n);var g,h;g=s,h={modelValue:d,disabled:v,readonly:f,valid:p,invalid:b},e.provide(g,h);const{getOptionLabel:S,getOptionValue:L}=function(t){const{options:l,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,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),B=C("vv-radio-group",y,e.computed((()=>({disabled:v.value,readonly:f.value,horizontal:!c.value,valid:p.value,invalid:b.value})))),{HintSlot:O,hintSlotScope:k}=m(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(B))},[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(w,e.mergeProps({key:l},((e,t)=>({id:`${n.name}_opt${t}`,name:n.name,label:S(e),value:L(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(O),{class:"vv-radio-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"3"}:void 0]),1024)],2))}})}));
|