@volverjs/ui-vue 0.0.10-beta.35 → 0.0.10-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -77
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +5 -5
- package/dist/Volver.d.ts +10 -10
- package/dist/components/VvAccordion/VvAccordion.es.js +11 -11
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +17 -17
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +6 -6
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +23 -21
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/index.d.ts +2 -2
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +351 -349
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
- package/dist/components/VvAlertGroup/index.d.ts +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +4 -1
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +11 -3
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +10 -10
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +31 -25
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +208 -202
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +21 -15
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCombobox/VvCombobox.es.js +454 -446
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +5 -5
- package/dist/components/VvCombobox/index.d.ts +5 -10
- package/dist/components/VvDialog/VvDialog.es.js +17 -17
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +29 -25
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +16 -12
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +11 -14
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -1
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +61 -55
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +2 -2
- package/dist/components/VvInputFile/index.d.ts +6 -6
- package/dist/components/VvInputText/VvInputText.es.js +287 -286
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +2 -2
- package/dist/components/VvInputText/index.d.ts +7 -2
- package/dist/components/VvNav/VvNav.es.js +23 -20
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +6 -6
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +208 -202
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +21 -15
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvSelect/VvSelect.es.js +22 -20
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +2 -2
- package/dist/components/VvTab/VvTab.es.js +29 -23
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +29 -27
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +2 -2
- package/dist/components/VvTooltip/VvTooltip.es.js +4 -1
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/common/HintSlot.d.ts +3 -4
- package/dist/components/index.es.js +905 -888
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +2 -2
- package/dist/composables/index.es.js +10 -10
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +1 -1
- package/dist/composables/usePersistence.d.ts +2 -1
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/directives/index.es.js +5 -2
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +1 -1
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +4 -1
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2 -2
- package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
- package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Badge/Badge.test.d.ts +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +1 -1
- package/dist/test/options.d.ts +1 -1
- package/dist/test/sleep.d.ts +1 -1
- package/dist/types/alert.d.ts +1 -1
- package/dist/utils/ObjectUtilities.d.ts +7 -7
- package/package.json +232 -239
- package/src/Volver.ts +243 -243
- 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 +155 -155
- package/src/components/VvAccordion/index.ts +62 -62
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +220 -219
- package/src/components/VvAccordionGroup/index.ts +41 -41
- package/src/components/VvAction/VvAction.vue +144 -142
- package/src/components/VvAlert/VvAlert.vue +72 -70
- package/src/components/VvAlert/index.ts +147 -150
- package/src/components/VvAlertGroup/VvAlertGroup.vue +56 -55
- package/src/components/VvAlertGroup/index.ts +99 -103
- package/src/components/VvAvatar/VvAvatar.vue +20 -14
- package/src/components/VvAvatar/index.ts +5 -5
- package/src/components/VvAvatarGroup/VvAvatarGroup.vue +58 -53
- package/src/components/VvAvatarGroup/index.ts +21 -21
- package/src/components/VvBadge/VvBadge.vue +15 -14
- package/src/components/VvBadge/index.ts +2 -2
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +49 -48
- package/src/components/VvBreadcrumb/index.ts +2 -2
- package/src/components/VvButton/VvButton.vue +163 -162
- package/src/components/VvButton/index.ts +102 -102
- package/src/components/VvButtonGroup/VvButtonGroup.vue +72 -72
- package/src/components/VvButtonGroup/index.ts +22 -22
- package/src/components/VvCard/VvCard.vue +30 -30
- package/src/components/VvCard/index.ts +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +185 -180
- package/src/components/VvCheckbox/index.ts +44 -44
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +88 -86
- package/src/components/VvCombobox/VvCombobox.vue +633 -623
- package/src/components/VvCombobox/index.ts +166 -166
- package/src/components/VvDialog/VvDialog.vue +131 -129
- package/src/components/VvDialog/index.ts +35 -35
- package/src/components/VvDropdown/VvDropdown.vue +464 -452
- package/src/components/VvDropdown/VvDropdownAction.vue +37 -39
- package/src/components/VvDropdown/VvDropdownItem.vue +29 -28
- package/src/components/VvDropdown/VvDropdownOptgroup.vue +13 -12
- package/src/components/VvDropdown/VvDropdownOption.vue +47 -47
- package/src/components/VvDropdown/index.ts +53 -53
- package/src/components/VvIcon/README.md +1 -1
- package/src/components/VvIcon/VvIcon.vue +133 -133
- package/src/components/VvIcon/index.ts +77 -77
- package/src/components/VvInputFile/VvInputFile.vue +367 -363
- package/src/components/VvInputFile/index.ts +125 -125
- package/src/components/VvInputText/VvInputClearAction.ts +50 -50
- package/src/components/VvInputText/VvInputPasswordAction.ts +65 -65
- package/src/components/VvInputText/VvInputStepAction.ts +43 -43
- package/src/components/VvInputText/VvInputText.vue +636 -637
- package/src/components/VvInputText/VvInputTextActions.ts +86 -86
- package/src/components/VvInputText/index.ts +198 -198
- package/src/components/VvNav/VvNav.vue +40 -33
- package/src/components/VvNav/VvNavItem.vue +12 -12
- package/src/components/VvNav/VvNavSeparator.vue +6 -6
- package/src/components/VvNav/index.ts +2 -2
- package/src/components/VvProgress/VvProgress.vue +27 -26
- package/src/components/VvProgress/index.ts +28 -28
- package/src/components/VvRadio/VvRadio.vue +115 -112
- package/src/components/VvRadio/index.ts +27 -27
- package/src/components/VvRadioGroup/VvRadioGroup.vue +91 -89
- package/src/components/VvSelect/VvSelect.vue +241 -238
- package/src/components/VvSelect/index.ts +62 -62
- package/src/components/VvTab/VvTab.vue +79 -73
- package/src/components/VvTab/index.ts +12 -12
- package/src/components/VvTextarea/VvTextarea.vue +218 -216
- package/src/components/VvTextarea/index.ts +35 -35
- package/src/components/VvTooltip/VvTooltip.vue +22 -16
- package/src/components/VvTooltip/index.ts +12 -12
- package/src/components/common/HintSlot.ts +149 -150
- package/src/composables/alert/useAlert.ts +74 -74
- package/src/composables/alert/useInjectAlert.ts +1 -1
- package/src/composables/alert/useProvideAlert.ts +10 -10
- package/src/composables/dropdown/useInjectDropdown.ts +6 -6
- package/src/composables/dropdown/useProvideDropdown.ts +62 -62
- package/src/composables/group/useInjectedGroupState.ts +41 -41
- package/src/composables/group/useProvideGroupState.ts +1 -2
- package/src/composables/useBlurhash.ts +52 -60
- package/src/composables/useComponentFocus.ts +9 -9
- package/src/composables/useComponentIcon.ts +35 -35
- package/src/composables/useDebouncedInput.ts +25 -25
- package/src/composables/useDefaults.ts +77 -76
- package/src/composables/useModifiers.ts +29 -29
- package/src/composables/useOptions.ts +45 -43
- package/src/composables/usePersistence.ts +70 -72
- package/src/composables/useTextCount.ts +44 -44
- package/src/composables/useUniqueId.ts +3 -2
- package/src/composables/useVolver.ts +1 -1
- package/src/constants.ts +70 -70
- package/src/directives/v-contextmenu.ts +34 -34
- package/src/directives/v-tooltip.ts +17 -17
- package/src/index.ts +3 -3
- package/src/props/index.ts +453 -453
- package/src/resolvers/unplugin.ts +138 -138
- package/src/shims.d.ts +4 -5
- package/src/stories/Accordion/Accordion.settings.ts +49 -49
- package/src/stories/Accordion/Accordion.stories.ts +21 -21
- package/src/stories/Accordion/Accordion.test.ts +56 -54
- package/src/stories/Accordion/AccordionSlots.stories.ts +13 -13
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +69 -67
- package/src/stories/AccordionGroup/AccordionGroup.stories.ts +37 -37
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +49 -47
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +34 -34
- package/src/stories/Alert/Alert.settings.ts +115 -115
- package/src/stories/Alert/Alert.stories.ts +30 -30
- package/src/stories/Alert/Alert.test.ts +78 -78
- package/src/stories/Alert/AlertModifiers.stories.ts +45 -45
- package/src/stories/Alert/AlertSlots.stories.ts +35 -35
- package/src/stories/AlertGroup/AlertGroup.settings.ts +104 -104
- package/src/stories/AlertGroup/AlertGroup.stories.ts +25 -25
- package/src/stories/AlertGroup/AlertGroup.test.ts +67 -67
- package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +68 -68
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +23 -23
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +57 -57
- package/src/stories/Avatar/Avatar.settings.ts +29 -29
- package/src/stories/Avatar/Avatar.stories.ts +23 -23
- package/src/stories/Avatar/Avatar.test.ts +22 -22
- package/src/stories/Avatar/AvatarBadge.stories.ts +15 -15
- package/src/stories/Avatar/AvatarModifiers.stories.ts +61 -61
- package/src/stories/Avatar/AvatarSlots.stories.ts +18 -18
- package/src/stories/AvatarGroup/AvatarGroup.settings.ts +53 -53
- package/src/stories/AvatarGroup/AvatarGroup.stories.ts +17 -17
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +24 -24
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +15 -15
- package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +17 -17
- package/src/stories/Badge/Badge.settings.ts +20 -20
- package/src/stories/Badge/Badge.stories.ts +23 -23
- package/src/stories/Badge/Badge.test.ts +8 -8
- package/src/stories/Badge/BadgeSlots.stories.ts +10 -10
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +77 -76
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +34 -34
- package/src/stories/Breadcrumb/Breadcrumb.stories.ts +22 -22
- package/src/stories/Breadcrumb/Breadcrumb.test.ts +44 -43
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +17 -17
- package/src/stories/Button/Button.settings.ts +144 -144
- package/src/stories/Button/Button.stories.ts +18 -18
- package/src/stories/Button/Button.test.ts +41 -40
- package/src/stories/Button/ButtonIcon.stories.ts +42 -42
- package/src/stories/Button/ButtonLink.stories.ts +24 -24
- package/src/stories/Button/ButtonLoading.stories.ts +22 -22
- package/src/stories/Button/ButtonModifiers.stories.ts +91 -91
- package/src/stories/Button/ButtonSlots.stories.ts +47 -47
- package/src/stories/Button/ButtonState.stories.ts +23 -23
- package/src/stories/Button/ButtonToggle.stories.ts +30 -30
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +32 -32
- package/src/stories/ButtonGroup/ButtonGroup.stories.ts +19 -19
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +23 -22
- package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +20 -20
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +18 -18
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +22 -22
- package/src/stories/Card/Card.settings.ts +48 -48
- package/src/stories/Card/Card.stories.ts +22 -22
- package/src/stories/Card/Card.test.ts +14 -14
- package/src/stories/Card/CardSlots.stories.ts +42 -42
- package/src/stories/Checkbox/Checkbox.settings.ts +35 -35
- package/src/stories/Checkbox/Checkbox.stories.ts +57 -57
- package/src/stories/Checkbox/Checkbox.test.ts +63 -62
- package/src/stories/Checkbox/CheckboxBinary.stories.ts +17 -17
- package/src/stories/Checkbox/CheckboxSlots.stories.ts +15 -15
- package/src/stories/CheckboxGroup/CheckboxGroup.settings.ts +9 -9
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +50 -50
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +63 -63
- package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +34 -34
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +23 -23
- package/src/stories/Combobox/Combobox.settings.ts +390 -390
- package/src/stories/Combobox/Combobox.stories.ts +107 -107
- package/src/stories/Combobox/Combobox.test.ts +89 -87
- package/src/stories/Combobox/ComboboxIconPosition.stories.ts +24 -24
- package/src/stories/Combobox/ComboboxMultiple.stories.ts +22 -22
- package/src/stories/Combobox/ComboboxOptions.stories.ts +84 -84
- package/src/stories/Combobox/ComboboxSlots.stories.ts +55 -55
- package/src/stories/Dialog/Dialog.settings.ts +39 -39
- package/src/stories/Dialog/Dialog.stories.ts +28 -28
- package/src/stories/Dialog/Dialog.test.ts +49 -49
- package/src/stories/Dialog/DialogSlots.stories.ts +20 -20
- package/src/stories/Dropdown/Dropdown.settings.ts +62 -62
- package/src/stories/Dropdown/Dropdown.stories.ts +59 -59
- package/src/stories/Dropdown/Dropdown.test.ts +9 -9
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +16 -16
- package/src/stories/Dropdown/DropdownMultilevel.stories.ts +18 -18
- package/src/stories/Dropdown/DropdownSlots.stories.ts +49 -49
- package/src/stories/Icon/Icon.settings.ts +64 -64
- package/src/stories/Icon/Icon.stories.ts +28 -28
- package/src/stories/Icon/IconsCollection.stories.ts +22 -22
- package/src/stories/InputFile/InputFile.settings.ts +29 -29
- package/src/stories/InputFile/InputFile.stories.ts +54 -54
- package/src/stories/InputFile/InputFileDropArea.stories.ts +34 -34
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +24 -24
- package/src/stories/InputFile/InputFileSlots.stories.ts +17 -17
- package/src/stories/InputText/InputText.settings.ts +245 -246
- package/src/stories/InputText/InputText.stories.ts +67 -67
- package/src/stories/InputText/InputText.test.ts +118 -117
- package/src/stories/InputText/InputTextIconPosition.stories.ts +24 -24
- package/src/stories/InputText/InputTextLength.stories.ts +33 -33
- package/src/stories/InputText/InputTextMask.stories.ts +91 -91
- package/src/stories/InputText/InputTextMinMax.stories.ts +29 -29
- package/src/stories/InputText/InputTextSlots.stories.ts +20 -20
- package/src/stories/InputText/InputTextType.stories.ts +70 -70
- package/src/stories/Nav/Nav.settings.ts +25 -25
- package/src/stories/Nav/Nav.stories.ts +17 -17
- package/src/stories/Nav/Nav.test.ts +10 -10
- package/src/stories/Nav/NavModifiers.stories.ts +25 -25
- package/src/stories/Progress/Progress.settings.ts +23 -23
- package/src/stories/Progress/Progress.stories.ts +23 -23
- package/src/stories/Progress/Progress.test.ts +4 -4
- package/src/stories/Radio/Radio.settings.ts +9 -9
- package/src/stories/Radio/Radio.stories.ts +47 -47
- package/src/stories/Radio/Radio.test.ts +54 -53
- package/src/stories/Radio/RadioSlots.stories.ts +15 -15
- package/src/stories/RadioGroup/RadioGroup.settings.ts +9 -9
- package/src/stories/RadioGroup/RadioGroup.stories.ts +50 -50
- package/src/stories/RadioGroup/RadioGroup.test.ts +63 -63
- package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +34 -34
- package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +23 -23
- package/src/stories/Select/Select.settings.ts +70 -70
- package/src/stories/Select/Select.stories.ts +66 -66
- package/src/stories/Select/Select.test.ts +65 -64
- package/src/stories/Select/SelectIconPosition.stories.ts +24 -24
- package/src/stories/Select/SelectOptions.stories.ts +54 -54
- package/src/stories/Select/SelectSlots.stories.ts +20 -20
- package/src/stories/Tab/Tab.settings.ts +32 -32
- package/src/stories/Tab/Tab.stories.ts +17 -17
- package/src/stories/Tab/Tab.test.ts +17 -17
- package/src/stories/Textarea/Textarea.settings.ts +78 -79
- package/src/stories/Textarea/Textarea.stories.ts +63 -63
- package/src/stories/Textarea/Textarea.test.ts +70 -69
- package/src/stories/Textarea/TextareaLength.stories.ts +33 -33
- package/src/stories/Textarea/TextareaSlots.stories.ts +20 -20
- package/src/stories/Textarea/TextareatIconPosition.stories.ts +24 -24
- package/src/stories/Tooltip/Tooltip.settings.ts +16 -16
- package/src/stories/Tooltip/Tooltip.stories.ts +18 -18
- package/src/stories/Tooltip/Tooltip.test.ts +53 -52
- package/src/stories/Tooltip/TooltipDirective.stories.ts +37 -37
- package/src/stories/argTypes.ts +484 -485
- package/src/test/expect.ts +71 -74
- package/src/test/options.ts +17 -16
- package/src/test/sleep.ts +3 -2
- package/src/test/types.d.ts +11 -11
- package/src/types/alert.ts +18 -18
- package/src/types/blurhash.ts +18 -18
- package/src/types/generic.ts +1 -2
- package/src/types/group.ts +21 -21
- package/src/types/input-file.ts +17 -17
- package/src/types/nav.ts +13 -13
- package/src/utils/ObjectUtilities.ts +192 -177
|
@@ -1,5 +1,209 @@
|
|
|
1
|
-
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 } from "vue";
|
|
2
2
|
import { uid } from "uid";
|
|
3
|
+
function equals(obj1, obj2, field) {
|
|
4
|
+
if (field) {
|
|
5
|
+
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
6
|
+
}
|
|
7
|
+
return deepEquals(obj1, obj2);
|
|
8
|
+
}
|
|
9
|
+
function deepEquals(a, b) {
|
|
10
|
+
if (a === b)
|
|
11
|
+
return true;
|
|
12
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
13
|
+
const arrA = Array.isArray(a);
|
|
14
|
+
const arrB = Array.isArray(b);
|
|
15
|
+
let i, length, key;
|
|
16
|
+
if (arrA && arrB) {
|
|
17
|
+
length = a.length;
|
|
18
|
+
if (length !== b.length)
|
|
19
|
+
return false;
|
|
20
|
+
for (i = length; i-- !== 0; ) {
|
|
21
|
+
if (!deepEquals(a[i], b[i]))
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (arrA !== arrB)
|
|
27
|
+
return false;
|
|
28
|
+
const dateA = a instanceof Date;
|
|
29
|
+
const dateB = b instanceof Date;
|
|
30
|
+
if (dateA !== dateB)
|
|
31
|
+
return false;
|
|
32
|
+
if (dateA && dateB)
|
|
33
|
+
return a.getTime() === b.getTime();
|
|
34
|
+
const regexpA = a instanceof RegExp;
|
|
35
|
+
const regexpB = b instanceof RegExp;
|
|
36
|
+
if (regexpA !== regexpB)
|
|
37
|
+
return false;
|
|
38
|
+
if (regexpA && regexpB)
|
|
39
|
+
return a.toString() === b.toString();
|
|
40
|
+
const keys = Object.keys(a);
|
|
41
|
+
length = keys.length;
|
|
42
|
+
if (length !== Object.keys(b).length)
|
|
43
|
+
return false;
|
|
44
|
+
for (i = length; i-- !== 0; ) {
|
|
45
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
for (i = length; i-- !== 0; ) {
|
|
49
|
+
key = keys[i];
|
|
50
|
+
if (!deepEquals(a[key], b[key]))
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return Number.isNaN(a) && Number.isNaN(b);
|
|
56
|
+
}
|
|
57
|
+
function resolveFieldData(data, field) {
|
|
58
|
+
if (data && Object.keys(data).length && field) {
|
|
59
|
+
if (!field.includes(".")) {
|
|
60
|
+
return data[field];
|
|
61
|
+
} else {
|
|
62
|
+
const fields = field.split(".");
|
|
63
|
+
let value = data;
|
|
64
|
+
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
65
|
+
if (data == null) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
value = value[fields[i]];
|
|
69
|
+
}
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function contains(value, list) {
|
|
77
|
+
if (value != null && list && list.length) {
|
|
78
|
+
for (const val of list) {
|
|
79
|
+
if (equals(value, val)) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
function isString(value) {
|
|
87
|
+
return typeof value === "string" || value instanceof String;
|
|
88
|
+
}
|
|
89
|
+
function joinLines(items) {
|
|
90
|
+
if (Array.isArray(items)) {
|
|
91
|
+
return items.filter((item) => isString(item)).join(" ");
|
|
92
|
+
}
|
|
93
|
+
return items;
|
|
94
|
+
}
|
|
95
|
+
function HintSlotFactory(propsOrRef, slots) {
|
|
96
|
+
const props = computed(() => {
|
|
97
|
+
if (isRef(propsOrRef)) {
|
|
98
|
+
return propsOrRef.value;
|
|
99
|
+
}
|
|
100
|
+
return propsOrRef;
|
|
101
|
+
});
|
|
102
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
103
|
+
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
104
|
+
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
105
|
+
const hintLabel = computed(() => props.value.hintLabel);
|
|
106
|
+
const hasLoadingLabelOrSlot = computed(
|
|
107
|
+
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
108
|
+
);
|
|
109
|
+
const hasInvalidLabelOrSlot = computed(
|
|
110
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
111
|
+
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
const hasValidLabelOrSlot = computed(
|
|
115
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
116
|
+
);
|
|
117
|
+
const hasHintLabelOrSlot = computed(
|
|
118
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
119
|
+
);
|
|
120
|
+
const isVisible = computed(
|
|
121
|
+
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
122
|
+
);
|
|
123
|
+
const hintSlotScope = computed(() => ({
|
|
124
|
+
modelValue: props.value.modelValue,
|
|
125
|
+
valid: props.value.valid,
|
|
126
|
+
invalid: props.value.invalid,
|
|
127
|
+
loading: props.value.loading
|
|
128
|
+
}));
|
|
129
|
+
const HintSlot = defineComponent({
|
|
130
|
+
name: "HintSlot",
|
|
131
|
+
props: {
|
|
132
|
+
tag: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: "small"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
setup() {
|
|
138
|
+
return {
|
|
139
|
+
isVisible,
|
|
140
|
+
invalidLabel,
|
|
141
|
+
validLabel,
|
|
142
|
+
loadingLabel,
|
|
143
|
+
hintLabel,
|
|
144
|
+
hasInvalidLabelOrSlot,
|
|
145
|
+
hasValidLabelOrSlot,
|
|
146
|
+
hasLoadingLabelOrSlot,
|
|
147
|
+
hasHintLabelOrSlot
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
render() {
|
|
151
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
152
|
+
if (this.isVisible) {
|
|
153
|
+
let role;
|
|
154
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
155
|
+
role = "alert";
|
|
156
|
+
}
|
|
157
|
+
if (this.hasValidLabelOrSlot) {
|
|
158
|
+
role = "status";
|
|
159
|
+
}
|
|
160
|
+
if (this.hasLoadingLabelOrSlot) {
|
|
161
|
+
return h(
|
|
162
|
+
this.tag,
|
|
163
|
+
{
|
|
164
|
+
role
|
|
165
|
+
},
|
|
166
|
+
((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
170
|
+
return h(
|
|
171
|
+
this.tag,
|
|
172
|
+
{
|
|
173
|
+
role
|
|
174
|
+
},
|
|
175
|
+
((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
if (this.hasValidLabelOrSlot) {
|
|
179
|
+
return h(
|
|
180
|
+
this.tag,
|
|
181
|
+
{
|
|
182
|
+
role
|
|
183
|
+
},
|
|
184
|
+
((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return h(
|
|
188
|
+
this.tag,
|
|
189
|
+
{
|
|
190
|
+
role
|
|
191
|
+
},
|
|
192
|
+
((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
return {
|
|
199
|
+
hasInvalidLabelOrSlot,
|
|
200
|
+
hasHintLabelOrSlot,
|
|
201
|
+
hasValidLabelOrSlot,
|
|
202
|
+
hasLoadingLabelOrSlot,
|
|
203
|
+
hintSlotScope,
|
|
204
|
+
HintSlot
|
|
205
|
+
};
|
|
206
|
+
}
|
|
3
207
|
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
4
208
|
StorageType2["local"] = "local";
|
|
5
209
|
StorageType2["session"] = "session";
|
|
@@ -456,206 +660,6 @@ function useGroupProps(props, emit) {
|
|
|
456
660
|
disabled
|
|
457
661
|
};
|
|
458
662
|
}
|
|
459
|
-
function equals(obj1, obj2, field) {
|
|
460
|
-
if (field) {
|
|
461
|
-
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
462
|
-
}
|
|
463
|
-
return deepEquals(obj1, obj2);
|
|
464
|
-
}
|
|
465
|
-
function deepEquals(a, b) {
|
|
466
|
-
if (a === b)
|
|
467
|
-
return true;
|
|
468
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
469
|
-
const arrA = Array.isArray(a);
|
|
470
|
-
const arrB = Array.isArray(b);
|
|
471
|
-
let i, length, key;
|
|
472
|
-
if (arrA && arrB) {
|
|
473
|
-
length = a.length;
|
|
474
|
-
if (length != b.length)
|
|
475
|
-
return false;
|
|
476
|
-
for (i = length; i-- !== 0; )
|
|
477
|
-
if (!deepEquals(a[i], b[i]))
|
|
478
|
-
return false;
|
|
479
|
-
return true;
|
|
480
|
-
}
|
|
481
|
-
if (arrA != arrB)
|
|
482
|
-
return false;
|
|
483
|
-
const dateA = a instanceof Date, dateB = b instanceof Date;
|
|
484
|
-
if (dateA != dateB)
|
|
485
|
-
return false;
|
|
486
|
-
if (dateA && dateB)
|
|
487
|
-
return a.getTime() == b.getTime();
|
|
488
|
-
const regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
|
|
489
|
-
if (regexpA != regexpB)
|
|
490
|
-
return false;
|
|
491
|
-
if (regexpA && regexpB)
|
|
492
|
-
return a.toString() == b.toString();
|
|
493
|
-
const keys = Object.keys(a);
|
|
494
|
-
length = keys.length;
|
|
495
|
-
if (length !== Object.keys(b).length)
|
|
496
|
-
return false;
|
|
497
|
-
for (i = length; i-- !== 0; )
|
|
498
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
499
|
-
return false;
|
|
500
|
-
for (i = length; i-- !== 0; ) {
|
|
501
|
-
key = keys[i];
|
|
502
|
-
if (!deepEquals(a[key], b[key]))
|
|
503
|
-
return false;
|
|
504
|
-
}
|
|
505
|
-
return true;
|
|
506
|
-
}
|
|
507
|
-
return a !== a && b !== b;
|
|
508
|
-
}
|
|
509
|
-
function resolveFieldData(data, field) {
|
|
510
|
-
if (data && Object.keys(data).length && field) {
|
|
511
|
-
if (field.indexOf(".") === -1) {
|
|
512
|
-
return data[field];
|
|
513
|
-
} else {
|
|
514
|
-
const fields = field.split(".");
|
|
515
|
-
let value = data;
|
|
516
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
517
|
-
if (data == null) {
|
|
518
|
-
return null;
|
|
519
|
-
}
|
|
520
|
-
value = value[fields[i]];
|
|
521
|
-
}
|
|
522
|
-
return value;
|
|
523
|
-
}
|
|
524
|
-
} else {
|
|
525
|
-
return null;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
function contains(value, list) {
|
|
529
|
-
if (value != null && list && list.length) {
|
|
530
|
-
for (const val of list) {
|
|
531
|
-
if (equals(value, val)) {
|
|
532
|
-
return true;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return false;
|
|
537
|
-
}
|
|
538
|
-
function isString(value) {
|
|
539
|
-
return typeof value === "string" || value instanceof String;
|
|
540
|
-
}
|
|
541
|
-
function joinLines(items) {
|
|
542
|
-
if (Array.isArray(items)) {
|
|
543
|
-
return items.filter((item) => isString(item)).join(" ");
|
|
544
|
-
}
|
|
545
|
-
return items;
|
|
546
|
-
}
|
|
547
|
-
function HintSlotFactory(propsOrRef, slots) {
|
|
548
|
-
const props = computed(() => {
|
|
549
|
-
if (isRef(propsOrRef)) {
|
|
550
|
-
return propsOrRef.value;
|
|
551
|
-
}
|
|
552
|
-
return propsOrRef;
|
|
553
|
-
});
|
|
554
|
-
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
555
|
-
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
556
|
-
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
557
|
-
const hintLabel = computed(() => props.value.hintLabel);
|
|
558
|
-
const hasLoadingLabelOrSlot = computed(
|
|
559
|
-
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
560
|
-
);
|
|
561
|
-
const hasInvalidLabelOrSlot = computed(
|
|
562
|
-
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
563
|
-
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
564
|
-
)
|
|
565
|
-
);
|
|
566
|
-
const hasValidLabelOrSlot = computed(
|
|
567
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
568
|
-
);
|
|
569
|
-
const hasHintLabelOrSlot = computed(
|
|
570
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
571
|
-
);
|
|
572
|
-
const isVisible = computed(
|
|
573
|
-
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
574
|
-
);
|
|
575
|
-
const hintSlotScope = computed(() => ({
|
|
576
|
-
modelValue: props.value.modelValue,
|
|
577
|
-
valid: props.value.valid,
|
|
578
|
-
invalid: props.value.invalid,
|
|
579
|
-
loading: props.value.loading
|
|
580
|
-
}));
|
|
581
|
-
const HintSlot = defineComponent({
|
|
582
|
-
name: "HintSlot",
|
|
583
|
-
props: {
|
|
584
|
-
tag: {
|
|
585
|
-
type: String,
|
|
586
|
-
default: "small"
|
|
587
|
-
}
|
|
588
|
-
},
|
|
589
|
-
setup() {
|
|
590
|
-
return {
|
|
591
|
-
isVisible,
|
|
592
|
-
invalidLabel,
|
|
593
|
-
validLabel,
|
|
594
|
-
loadingLabel,
|
|
595
|
-
hintLabel,
|
|
596
|
-
hasInvalidLabelOrSlot,
|
|
597
|
-
hasValidLabelOrSlot,
|
|
598
|
-
hasLoadingLabelOrSlot,
|
|
599
|
-
hasHintLabelOrSlot
|
|
600
|
-
};
|
|
601
|
-
},
|
|
602
|
-
render() {
|
|
603
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
604
|
-
if (this.isVisible) {
|
|
605
|
-
let role;
|
|
606
|
-
if (this.hasInvalidLabelOrSlot) {
|
|
607
|
-
role = "alert";
|
|
608
|
-
}
|
|
609
|
-
if (this.hasValidLabelOrSlot) {
|
|
610
|
-
role = "status";
|
|
611
|
-
}
|
|
612
|
-
if (this.hasLoadingLabelOrSlot) {
|
|
613
|
-
return h(
|
|
614
|
-
this.tag,
|
|
615
|
-
{
|
|
616
|
-
role
|
|
617
|
-
},
|
|
618
|
-
((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
|
|
619
|
-
);
|
|
620
|
-
}
|
|
621
|
-
if (this.hasInvalidLabelOrSlot) {
|
|
622
|
-
return h(
|
|
623
|
-
this.tag,
|
|
624
|
-
{
|
|
625
|
-
role
|
|
626
|
-
},
|
|
627
|
-
((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
|
|
628
|
-
);
|
|
629
|
-
}
|
|
630
|
-
if (this.hasValidLabelOrSlot) {
|
|
631
|
-
return h(
|
|
632
|
-
this.tag,
|
|
633
|
-
{
|
|
634
|
-
role
|
|
635
|
-
},
|
|
636
|
-
((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
|
|
637
|
-
);
|
|
638
|
-
}
|
|
639
|
-
return h(
|
|
640
|
-
this.tag,
|
|
641
|
-
{
|
|
642
|
-
role
|
|
643
|
-
},
|
|
644
|
-
((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
return null;
|
|
648
|
-
}
|
|
649
|
-
});
|
|
650
|
-
return {
|
|
651
|
-
hasInvalidLabelOrSlot,
|
|
652
|
-
hasHintLabelOrSlot,
|
|
653
|
-
hasValidLabelOrSlot,
|
|
654
|
-
hasLoadingLabelOrSlot,
|
|
655
|
-
hintSlotScope,
|
|
656
|
-
HintSlot
|
|
657
|
-
};
|
|
658
|
-
}
|
|
659
663
|
function useVolver() {
|
|
660
664
|
return inject(INJECTION_KEY_VOLVER);
|
|
661
665
|
}
|
|
@@ -712,7 +716,9 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
712
716
|
}, {});
|
|
713
717
|
});
|
|
714
718
|
}
|
|
715
|
-
|
|
719
|
+
function useUniqueId(id) {
|
|
720
|
+
return computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
721
|
+
}
|
|
716
722
|
function useModifiers(prefix, modifiers, others) {
|
|
717
723
|
return computed(() => {
|
|
718
724
|
const toReturn = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";function l(e,t,l){return l?n(e,l)===n(t,l):a(e,t)}function a(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),n=Array.isArray(t);let o,i,r;if(l&&n){if(i=e.length,i!==t.length)return!1;for(o=i;0!=o--;)if(!a(e[o],t[o]))return!1;return!0}if(l!==n)return!1;const u=e instanceof Date,d=t instanceof Date;if(u!==d)return!1;if(u&&d)return e.getTime()===t.getTime();const s=e instanceof RegExp,v=t instanceof RegExp;if(s!==v)return!1;if(s&&v)return e.toString()===t.toString();const c=Object.keys(e);if(i=c.length,i!==Object.keys(t).length)return!1;for(o=i;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=i;0!=o--;)if(r=c[o],!a(e[r],t[r]))return!1;return!0}return Number.isNaN(e)&&Number.isNaN(t)}function n(e,t){if(e&&Object.keys(e).length&&t){if(t.includes(".")){const l=t.split(".");let a=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;a=a[l[t]]}return a}return e[t]}return null}function o(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}var i=(e=>(e.local="local",e.session="session",e))(i||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{}),s=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(s||{});const v=Symbol.for("volver"),c=Symbol.for("checkGroup"),f={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},p={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},h={disabled:{type:Boolean,default:!1}},m=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),y={readonly:{type:Boolean,default:!1}},g={modifiers:{type:[String,Array],default:void 0}},S={hintLabel:{type:String,default:""}};u.before;const L={tabindex:{type:[String,Number],default:0}},k={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const B={...{...k,name:{type:String,required:!0}},...L,...f,...p,...S,...h,...y,...g,...m,...b,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};d.button,s.button,i.local;const O={...B,...g,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function V(t,l){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=function(t){const l=e.inject(t,void 0),a=e.computed((()=>void 0!==l));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){const o=null==l?void 0:l[t];if(o)return e.computed({get:()=>o.value,set(e){o.value=e}});const i=e.toRef(a,t);return e.computed({get:()=>i.value,set(e){n&&n(`update:${t}`,e)}})}}}(c),{id:i,switch:r,indeterminate:u}=e.toRefs(t),d=o("modelValue",t,l),s=o("valid",t),v=o("invalid",t),f=e.computed((()=>Boolean(t.readonly||(null==a?void 0:a.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==a?void 0:a.disabled.value))));return{id:i,propsSwitch:r,indeterminate:u,group:a,isInGroup:n,modelValue:d,valid:s,invalid:v,readonly:f,disabled:p}}function x(t,l,a){const n=e.inject(v),o=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[t]))return n.defaults.value[t]}));return e.computed((()=>{if(void 0===o.value)return a;const e=o.value,t=l,n=a;return Object.keys(t).reduce(((l,a)=>{const o=n[a];if(l[a]=o,a in e){if(Array.isArray(t[a])){const n=t[a];if(n.length){n[0]===o&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===o&&(l[a]=e[a])}if("object"==typeof t[a]){let n=t[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(l[a]=e[a]):n===o&&(l[a]=e[a])}}return l}),{})}))}const A=["for"],$=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:O,emits:["click","update:modelValue","change","blur"],setup(a,{emit:n}){const i=a,r=n,u=e.useSlots(),d=x("VvCheckbox",O,i),{id:s,disabled:v,readonly:c,valid:f,invalid:p,propsSwitch:b,modelValue:h,indeterminate:m,isInGroup:y}=V(i,r),g=function(l){return e.computed((()=>String((null==l?void 0:l.value)||t.uid())))}(s),S=e.computed((()=>`${g.value}-hint`)),L=e.computed((()=>N.value?-1:i.tabindex)),k=e.ref(),B=e.computed((()=>void 0!==i.uncheckedValue&&!y.value)),N=e.computed((()=>v.value||c.value)),j=e.computed((()=>!0===p.value||!0!==f.value&&void 0)),w=e.computed((()=>B.value?h.value===i.value:Array.isArray(h.value)?function(e,t){if(null!=e&&t&&t.length)for(const a of t)if(l(e,a))return!0;return!1}(i.value,h.value):l(i.value,h.value))),R=e.computed((()=>!!m.value||!(w.value||!B.value||i.uncheckedValue===h.value))),C=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof i.value)||i.value})),I=e.computed({get:()=>w.value,set(e){if(B.value)h.value=e?i.value:i.uncheckedValue;else if(Array.isArray(h.value)||y.value){const t=h.value??[],l=new Set(Array.isArray(t)?t:[t]);e?l.add(i.value):l.delete(i.value),h.value=[...l]}else h.value=e?i.value:void 0;r("change",e)}}),{modifiers:P}=e.toRefs(i),E=function(t,l,a){return e.computed((()=>{const n={[t]:!0},o="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{n[`${t}--${l}`]=e.unref(a.value[l])})),n}))}("vv-checkbox",P,e.computed((()=>({switch:b.value,valid:f.value,invalid:p.value,disabled:v.value,readonly:c.value,indeterminate:m.value}))));e.watchEffect((()=>{B.value&&Array.isArray(h.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>R.value),(e=>{k.value.indeterminate=!!e})),e.onMounted((()=>{R.value&&(k.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:H,hasInvalidLabelOrSlot:T,hintSlotScope:_}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>o(a.value.invalidLabel))),i=e.computed((()=>o(a.value.validLabel))),r=e.computed((()=>a.value.loadingLabel)),u=e.computed((()=>a.value.hintLabel)),d=e.computed((()=>Boolean(a.value.loading&&(l.loading||r.value)))),s=e.computed((()=>!d.value&&Boolean(a.value.invalid&&(l.invalid||n.value)))),v=e.computed((()=>!d.value&&!s.value&&Boolean(a.value.valid&&(l.valid||i.value)))),c=e.computed((()=>!d.value&&!s.value&&!v.value&&Boolean(l.hint||u.value))),f=e.computed((()=>s.value||v.value||d.value||c.value)),p=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:f,invalidLabel:n,validLabel:i,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:c}),render(){var t,l,a,n,o,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hintSlotScope:p,HintSlot:b}}(d,u);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:k,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(I)?I.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(N),value:e.unref(C),tabindex:e.unref(L),"aria-invalid":e.unref(j),"aria-describedby":e.unref(H)?e.unref(S):void 0,"aria-errormessage":e.unref(T)?e.unref(S):void 0},null,8,$),[[e.vModelCheckbox,e.unref(I)]]),e.renderSlot(t.$slots,"default",{value:e.unref(h)},(()=>[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(_))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(_))))])),key:"3"}:void 0]),1032,["id"])],10,A))}})}));
|
|
@@ -140,12 +140,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
140
140
|
readonly: boolean;
|
|
141
141
|
loading: boolean;
|
|
142
142
|
loadingLabel: string;
|
|
143
|
-
indeterminate: boolean;
|
|
144
143
|
hintLabel: string;
|
|
145
|
-
invalid: boolean;
|
|
146
|
-
invalidLabel: string | unknown[];
|
|
147
144
|
valid: boolean;
|
|
148
145
|
validLabel: string | unknown[];
|
|
146
|
+
invalid: boolean;
|
|
147
|
+
invalidLabel: string | unknown[];
|
|
148
|
+
indeterminate: boolean;
|
|
149
149
|
tabindex: string | number;
|
|
150
150
|
}, {}>, {
|
|
151
151
|
default?(_: {
|
|
@@ -67,32 +67,36 @@ function deepEquals(a, b) {
|
|
|
67
67
|
let i, length, key;
|
|
68
68
|
if (arrA && arrB) {
|
|
69
69
|
length = a.length;
|
|
70
|
-
if (length
|
|
70
|
+
if (length !== b.length)
|
|
71
71
|
return false;
|
|
72
|
-
for (i = length; i-- !== 0; )
|
|
72
|
+
for (i = length; i-- !== 0; ) {
|
|
73
73
|
if (!deepEquals(a[i], b[i]))
|
|
74
74
|
return false;
|
|
75
|
+
}
|
|
75
76
|
return true;
|
|
76
77
|
}
|
|
77
|
-
if (arrA
|
|
78
|
+
if (arrA !== arrB)
|
|
78
79
|
return false;
|
|
79
|
-
const dateA = a instanceof Date
|
|
80
|
-
|
|
80
|
+
const dateA = a instanceof Date;
|
|
81
|
+
const dateB = b instanceof Date;
|
|
82
|
+
if (dateA !== dateB)
|
|
81
83
|
return false;
|
|
82
84
|
if (dateA && dateB)
|
|
83
|
-
return a.getTime()
|
|
84
|
-
const regexpA = a instanceof RegExp
|
|
85
|
-
|
|
85
|
+
return a.getTime() === b.getTime();
|
|
86
|
+
const regexpA = a instanceof RegExp;
|
|
87
|
+
const regexpB = b instanceof RegExp;
|
|
88
|
+
if (regexpA !== regexpB)
|
|
86
89
|
return false;
|
|
87
90
|
if (regexpA && regexpB)
|
|
88
|
-
return a.toString()
|
|
91
|
+
return a.toString() === b.toString();
|
|
89
92
|
const keys = Object.keys(a);
|
|
90
93
|
length = keys.length;
|
|
91
94
|
if (length !== Object.keys(b).length)
|
|
92
95
|
return false;
|
|
93
|
-
for (i = length; i-- !== 0; )
|
|
96
|
+
for (i = length; i-- !== 0; ) {
|
|
94
97
|
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
95
98
|
return false;
|
|
99
|
+
}
|
|
96
100
|
for (i = length; i-- !== 0; ) {
|
|
97
101
|
key = keys[i];
|
|
98
102
|
if (!deepEquals(a[key], b[key]))
|
|
@@ -100,11 +104,11 @@ function deepEquals(a, b) {
|
|
|
100
104
|
}
|
|
101
105
|
return true;
|
|
102
106
|
}
|
|
103
|
-
return a
|
|
107
|
+
return Number.isNaN(a) && Number.isNaN(b);
|
|
104
108
|
}
|
|
105
109
|
function resolveFieldData(data, field) {
|
|
106
110
|
if (data && Object.keys(data).length && field) {
|
|
107
|
-
if (field.
|
|
111
|
+
if (!field.includes(".")) {
|
|
108
112
|
return data[field];
|
|
109
113
|
} else {
|
|
110
114
|
const fields = field.split(".");
|
|
@@ -764,7 +768,9 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
764
768
|
}, {});
|
|
765
769
|
});
|
|
766
770
|
}
|
|
767
|
-
|
|
771
|
+
function useUniqueId(id) {
|
|
772
|
+
return computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
773
|
+
}
|
|
768
774
|
function useModifiers(prefix, modifiers, others) {
|
|
769
775
|
return computed(() => {
|
|
770
776
|
const toReturn = {
|
|
@@ -1065,14 +1071,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1065
1071
|
invalid: invalid.value
|
|
1066
1072
|
}))
|
|
1067
1073
|
);
|
|
1068
|
-
|
|
1074
|
+
function getOptionProps(option, index) {
|
|
1069
1075
|
return {
|
|
1070
1076
|
id: `${props.name}_opt${index}`,
|
|
1071
1077
|
name: props.name,
|
|
1072
1078
|
label: getOptionLabel(option),
|
|
1073
1079
|
value: getOptionValue(option)
|
|
1074
1080
|
};
|
|
1075
|
-
}
|
|
1081
|
+
}
|
|
1076
1082
|
const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
|
|
1077
1083
|
return (_ctx, _cache) => {
|
|
1078
1084
|
return openBlock(), createElementBlock(
|
|
@@ -1 +1 @@
|
|
|
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,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("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),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(!c(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],!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 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 b(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))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),b=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: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,a.local;const C={...$,...L,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function w(t,l){const{group:o,isInGroup:a,getGroupOrLocalRef:n}=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),{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==o?void 0:o.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==o?void 0:o.disabled.value))));return{id:i,propsSwitch:r,indeterminate:u,group:o,isInGroup:a,modelValue:d,valid:v,invalid:c,readonly:f,disabled:p}}function j(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 P(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 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:o}){const a=l,n=o,i=e.useSlots(),r=j("VvCheckbox",C,a),{id:u,disabled:d,readonly:s,valid:c,invalid:f,propsSwitch:p,modelValue:m,indeterminate:h,isInGroup:y}=w(a,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:a.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==a.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===a.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}(a.value,m.value):v(a.value,m.value))),$=e.computed((()=>!!h.value||!(O.value||!B.value||a.uncheckedValue===m.value))),A=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof a.value)||a.value})),_=e.computed({get:()=>O.value,set(e){if(B.value)m.value=e?a.value:a.uncheckedValue;else if(Array.isArray(m.value)||y.value){const t=m.value??[],l=new Set(Array.isArray(t)?t:[t]);e?l.add(a.value):l.delete(a.value),m.value=[...l]}else m.value=e?a.value:void 0;n("change",e)}}),{modifiers:z}=e.toRefs(a),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:a}){const n=t,i=a,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: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),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,ref_for:!0},((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))}})}));
|
|
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,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("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),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(!c(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],!c(e[i],t[i]))return!1;return!0}return Number.isNaN(e)&&Number.isNaN(t)}function f(e,t){if(e&&Object.keys(e).length&&t){if(t.includes(".")){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 e[t]}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 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))),c=e.computed((()=>d.value||s.value||u.value||v.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),b=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: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,a.local;const C={...$,...L,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function N(t,l){const{group:o,isInGroup:a,getGroupOrLocalRef:n}=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),{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==o?void 0:o.readonly.value)))),p=e.computed((()=>Boolean(t.disabled||(null==o?void 0:o.disabled.value))));return{id:i,propsSwitch:r,indeterminate:u,group:o,isInGroup:a,modelValue:d,valid:v,invalid:c,readonly:f,disabled:p}}function w(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 j(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"],R=["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:o}){const a=l,n=o,i=e.useSlots(),r=w("VvCheckbox",C,a),{id:u,disabled:d,readonly:s,valid:c,invalid:f,propsSwitch:p,modelValue:m,indeterminate:h,isInGroup:y}=N(a,n),g=function(l){return e.computed((()=>String((null==l?void 0:l.value)||t.uid())))}(u),S=e.computed((()=>`${g.value}-hint`)),k=e.computed((()=>V.value?-1:a.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==a.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===a.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}(a.value,m.value):v(a.value,m.value))),$=e.computed((()=>!!h.value||!(O.value||!B.value||a.uncheckedValue===m.value))),A=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof a.value)||a.value})),_=e.computed({get:()=>O.value,set(e){if(B.value)m.value=e?a.value:a.uncheckedValue;else if(Array.isArray(m.value)||y.value){const t=m.value??[],l=new Set(Array.isArray(t)?t:[t]);e?l.add(a.value):l.delete(a.value),m.value=[...l]}else m.value=e?a.value:void 0;n("change",e)}}),{modifiers:z}=e.toRefs(a),E=j("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,R),[[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,P))}}),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:a}){const n=t,i=a,r=e.useSlots(),u=w("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: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),L=j("vv-checkbox-group",h,e.computed((()=>({disabled:v.value,readonly:c.value,horizontal:!f.value,valid:p.value,invalid:m.value}))));const{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,ref_for:!0},function(e,t){return{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))}})}));
|
|
@@ -157,10 +157,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
157
157
|
loading: boolean;
|
|
158
158
|
loadingLabel: string;
|
|
159
159
|
hintLabel: string;
|
|
160
|
-
invalid: boolean;
|
|
161
|
-
invalidLabel: string | unknown[];
|
|
162
160
|
valid: boolean;
|
|
163
161
|
validLabel: string | unknown[];
|
|
162
|
+
invalid: boolean;
|
|
163
|
+
invalidLabel: string | unknown[];
|
|
164
164
|
vertical: boolean;
|
|
165
165
|
labelKey: string | Function;
|
|
166
166
|
valueKey: string | Function;
|