@volverjs/ui-vue 0.0.1-beta.6 → 0.0.1
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 +21 -0
- package/README.md +101 -7
- package/bin/icons.cjs +73 -0
- package/bin/icons.js +75 -0
- package/dist/{DesignSystem.d.ts → Volver.d.ts} +22 -18
- package/dist/components/VvAccordion/VvAccordion.es.js +165 -0
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -0
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +32 -97
- package/dist/components/VvAccordion/index.d.ts +46 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +243 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +77 -151
- package/dist/components/VvAccordionGroup/{VvAccordionGroup.d.ts → index.d.ts} +30 -13
- package/dist/components/VvBadge/VvBadge.es.js +62 -0
- package/dist/components/VvBadge/VvBadge.umd.js +1 -0
- package/dist/components/VvBadge/VvBadge.vue.d.ts +13 -54
- package/dist/components/VvBadge/{VvBadge.d.ts → index.d.ts} +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +93 -0
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -0
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +33 -107
- package/dist/components/VvBreadcrumb/{VvBreadcrumb.d.ts → index.d.ts} +2 -3
- package/dist/components/VvButton/VvButton.es.js +427 -0
- package/dist/components/VvButton/VvButton.umd.js +1 -0
- package/dist/components/VvButton/VvButton.vue.d.ts +108 -199
- package/dist/components/VvButton/index.d.ts +132 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +108 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +89 -183
- package/dist/components/VvButtonGroup/index.d.ts +54 -0
- package/dist/components/VvCard/VvCard.es.js +77 -0
- package/dist/components/VvCard/VvCard.umd.js +1 -0
- package/dist/components/VvCard/VvCard.vue.d.ts +16 -61
- package/dist/components/VvCard/{VvCard.d.ts → index.d.ts} +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +357 -0
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -0
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +74 -0
- package/dist/components/VvCheckbox/index.d.ts +54 -0
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +435 -0
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -0
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +82 -0
- package/dist/components/VvCheckboxGroup/index.d.ts +32 -0
- package/dist/components/VvCombobox/VvCombobox.es.js +594 -0
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -0
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +153 -0
- package/dist/components/{VvSelect/VvSelect.d.ts → VvCombobox/index.d.ts} +33 -36
- package/dist/components/VvDialog/VvDialog.es.js +200 -0
- package/dist/components/VvDialog/VvDialog.umd.js +1 -0
- package/dist/components/VvDialog/VvDialog.vue.d.ts +28 -132
- package/dist/components/VvDialog/{VvDialog.d.ts → index.d.ts} +2 -6
- package/dist/components/VvDropdown/VvDropdown.es.js +218 -0
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -0
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +41 -147
- package/dist/components/VvDropdown/index.d.ts +37 -0
- package/dist/components/VvIcon/VvIcon.es.js +124 -0
- package/dist/components/VvIcon/VvIcon.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.vue.d.ts +36 -150
- package/dist/components/VvIcon/{VvIcon.d.ts → index.d.ts} +9 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +36 -0
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +56 -0
- package/dist/components/VvInputText/VvInputStepAction.d.ts +37 -0
- package/dist/components/VvInputText/VvInputText.es.js +764 -0
- package/dist/components/VvInputText/VvInputText.umd.js +1 -0
- package/dist/components/VvInputText/VvInputText.vue.d.ts +214 -256
- package/dist/components/VvInputText/VvInputTextActions.d.ts +3 -0
- package/dist/components/VvInputText/index.d.ts +182 -0
- package/dist/components/VvProgress/VvProgress.es.js +71 -0
- package/dist/components/VvProgress/VvProgress.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.vue.d.ts +20 -107
- package/dist/components/VvProgress/index.d.ts +30 -0
- package/dist/components/VvRadio/VvRadio.es.js +320 -0
- package/dist/components/VvRadio/VvRadio.umd.js +1 -0
- package/dist/components/VvRadio/VvRadio.vue.d.ts +55 -125
- package/dist/components/VvRadio/index.d.ts +40 -0
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +398 -0
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -0
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +56 -238
- package/dist/components/VvRadioGroup/index.d.ts +32 -0
- package/dist/components/VvSelect/VvSelect.es.js +415 -0
- package/dist/components/VvSelect/VvSelect.umd.js +1 -0
- package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -262
- package/dist/components/VvSelect/index.d.ts +96 -0
- package/dist/components/VvTextarea/VvTextarea.es.js +463 -0
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -0
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +147 -273
- package/dist/components/VvTextarea/index.d.ts +102 -0
- package/dist/components/common/HintSlot.d.ts +12 -6
- package/dist/components/index.d.ts +19 -12
- package/dist/components/index.es.js +2309 -0
- package/dist/components/index.umd.js +1 -0
- package/dist/composables/group/types/IAccordionGroupState.d.ts +3 -4
- package/dist/composables/group/types/IButtonGroupState.d.ts +5 -11
- package/dist/composables/group/types/IGroupState.d.ts +3 -6
- package/dist/composables/group/types/IInputGroup.d.ts +1 -4
- package/dist/composables/group/useInjectedGroupState.d.ts +4 -4
- package/dist/composables/group/useProvideGroupState.d.ts +2 -2
- package/dist/composables/useComponentFocus.d.ts +4 -0
- package/dist/composables/{icons/useComponentIcons.d.ts → useComponentIcons.d.ts} +8 -1
- package/dist/composables/useDebouncedInput.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +3 -2
- package/dist/composables/useOptions.d.ts +6 -0
- package/dist/composables/useTextCount.d.ts +10 -0
- package/dist/constants.d.ts +4 -4
- package/dist/icons.d.ts +1881 -0
- package/dist/icons.es.js +12 -14
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.es.js +2350 -0
- package/dist/index.umd.js +1 -0
- package/dist/props/index.d.ts +322 -13
- package/dist/resolvers/unplugin.d.ts +27 -0
- package/dist/resolvers/unplugin.es.js +40 -0
- package/dist/resolvers/unplugin.umd.js +1 -0
- package/dist/stories/Accordion/Accordion.settings.d.ts +63 -0
- package/dist/stories/Accordion/Accordion.test.d.ts +2 -0
- package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +58 -0
- package/dist/stories/AccordionGroup/AccordionGroup.test.d.ts +2 -0
- package/dist/stories/Badge/Badge.settings.d.ts +32 -0
- package/dist/stories/Badge/Badge.test.d.ts +2 -0
- package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +29 -0
- package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +2 -0
- package/dist/stories/Button/Button.settings.d.ts +200 -0
- package/dist/stories/Button/Button.test.d.ts +1 -10
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +38 -0
- package/dist/stories/ButtonGroup/ButtonGroup.test.d.ts +2 -0
- package/dist/stories/Card/Card.settings.d.ts +70 -0
- package/dist/stories/Card/Card.test.d.ts +2 -0
- package/dist/stories/Checkbox/Checkbox.settings.d.ts +165 -0
- package/dist/stories/Checkbox/Checkbox.test.d.ts +2 -0
- package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +164 -0
- package/dist/stories/CheckboxGroup/CheckboxGroup.test.d.ts +2 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +267 -0
- package/dist/stories/Combobox/Combobox.test.d.ts +2 -0
- package/dist/stories/Dialog/Dialog.settings.d.ts +55 -0
- package/dist/stories/Dialog/Dialog.test.d.ts +2 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +75 -0
- package/dist/stories/Dropdown/Dropdown.test.d.ts +2 -0
- package/dist/stories/Icon/Icon.settings.d.ts +74 -0
- package/dist/stories/InputText/InputText.settings.d.ts +445 -0
- package/dist/stories/InputText/InputText.test.d.ts +2 -0
- package/dist/stories/Progress/Progress.settings.d.ts +38 -0
- package/dist/stories/Progress/Progress.test.d.ts +2 -0
- package/dist/stories/Radio/Radio.settings.d.ts +139 -0
- package/dist/stories/Radio/Radio.test.d.ts +2 -0
- package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +164 -0
- package/dist/stories/RadioGroup/RadioGroup.test.d.ts +2 -0
- package/dist/stories/Select/Select.settings.d.ts +265 -0
- package/dist/stories/Select/Select.test.d.ts +2 -0
- package/dist/stories/Textarea/Textarea.settings.d.ts +336 -0
- package/dist/stories/Textarea/Textarea.test.d.ts +2 -0
- package/dist/stories/argTypes.d.ts +793 -0
- package/dist/test/expect.d.ts +3 -0
- package/dist/test/options.d.ts +1 -0
- package/dist/test/sleep.d.ts +1 -0
- package/dist/utils/ObjectUtilities.d.ts +82 -95
- package/env.d.ts +1 -0
- package/package.json +198 -124
- package/src/{DesignSystem.ts → Volver.ts} +57 -29
- 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 +94 -78
- package/src/components/VvAccordion/index.ts +72 -0
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +93 -53
- package/src/components/VvAccordionGroup/{VvAccordionGroup.ts → index.ts} +18 -14
- package/src/components/VvBadge/VvBadge.vue +17 -8
- package/src/components/VvBadge/index.ts +6 -0
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +26 -24
- package/src/components/VvBreadcrumb/{VvBreadcrumb.ts → index.ts} +1 -2
- package/src/components/VvButton/VvButton.vue +174 -154
- package/src/components/VvButton/index.ts +171 -0
- package/src/components/VvButtonGroup/VvButtonGroup.vue +76 -48
- package/src/components/VvButtonGroup/index.ts +19 -0
- package/src/components/VvCard/VvCard.vue +20 -22
- package/src/components/VvCard/{VvCard.ts → index.ts} +1 -1
- package/src/components/VvCheckbox/VvCheckbox.vue +172 -0
- package/src/components/VvCheckbox/index.ts +60 -0
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +85 -0
- package/src/components/VvCheckboxGroup/index.ts +5 -0
- package/src/components/VvCombobox/VvCombobox.vue +227 -0
- package/src/components/VvCombobox/index.ts +82 -0
- package/src/components/VvDialog/VvDialog.vue +69 -67
- package/src/components/VvDialog/index.ts +10 -0
- package/src/components/VvDropdown/VvDropdown.vue +112 -114
- package/src/components/VvDropdown/index.ts +25 -0
- package/src/components/VvIcon/README.md +64 -0
- package/src/components/VvIcon/VvIcon.vue +122 -107
- package/src/components/VvIcon/{VvIcon.ts → index.ts} +17 -8
- package/src/components/VvInputText/VvInputClearAction.ts +53 -0
- package/src/components/VvInputText/VvInputPasswordAction.ts +70 -0
- package/src/components/VvInputText/VvInputStepAction.ts +49 -0
- package/src/components/VvInputText/VvInputText.vue +293 -252
- package/src/components/VvInputText/VvInputTextActions.ts +100 -0
- package/src/components/VvInputText/index.ts +140 -0
- package/src/components/VvProgress/VvProgress.vue +29 -29
- package/src/components/VvProgress/index.ts +32 -0
- package/src/components/VvRadio/VvRadio.vue +90 -119
- package/src/components/VvRadio/index.ts +40 -0
- package/src/components/VvRadioGroup/VvRadioGroup.vue +76 -69
- package/src/components/VvRadioGroup/index.ts +5 -0
- package/src/components/VvSelect/VvSelect.vue +165 -186
- package/src/components/VvSelect/index.ts +74 -0
- package/src/components/VvTextarea/VvTextarea.vue +188 -180
- package/src/components/VvTextarea/index.ts +50 -0
- package/src/components/common/HintSlot.ts +169 -121
- package/src/components/index.ts +19 -12
- package/src/composables/group/types/IAccordionGroupState.ts +3 -4
- package/src/composables/group/types/IButtonGroupState.ts +5 -11
- package/src/composables/group/types/IGroupState.ts +4 -6
- package/src/composables/group/types/IInputGroup.ts +1 -4
- package/src/composables/group/useInjectedGroupState.ts +21 -33
- package/src/composables/group/useProvideGroupState.ts +5 -7
- package/src/composables/useComponentFocus.ts +17 -0
- package/src/composables/useComponentIcons.ts +96 -0
- package/src/composables/useDebouncedInput.ts +25 -0
- package/src/composables/useModifiers.ts +58 -14
- package/src/composables/useOptions.ts +31 -0
- package/src/composables/useTextCount.ts +57 -0
- package/src/constants.ts +5 -7
- package/src/directives/{.README → .gitkeep} +0 -0
- package/src/icons.ts +7 -0
- package/src/index.ts +12 -5
- package/src/props/index.ts +204 -15
- package/src/resolvers/unplugin.ts +103 -0
- package/src/shims.d.ts +13 -0
- package/src/stories/Accordion/Accordion.settings.ts +46 -0
- package/src/stories/Accordion/Accordion.stories.mdx +21 -21
- package/src/stories/Accordion/Accordion.test.ts +61 -0
- package/src/stories/Accordion/AccordionSlots.stories.mdx +46 -70
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +55 -0
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +24 -27
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +50 -0
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +56 -0
- package/src/stories/Badge/Badge.settings.ts +26 -0
- package/src/stories/Badge/Badge.stories.mdx +36 -24
- package/src/stories/Badge/Badge.test.ts +12 -0
- package/src/stories/Badge/BadgeSlots.stories.mdx +20 -0
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +41 -0
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +32 -29
- package/src/stories/Breadcrumb/Breadcrumb.test.ts +50 -0
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +43 -0
- package/src/stories/Button/Button.settings.ts +150 -0
- package/src/stories/Button/Button.stories.mdx +20 -54
- package/src/stories/Button/Button.test.ts +35 -46
- package/src/stories/Button/ButtonIcon.stories.mdx +139 -29
- package/src/stories/Button/ButtonLink.stories.mdx +58 -111
- package/src/stories/Button/ButtonLoading.stories.mdx +89 -62
- package/src/stories/Button/ButtonModifiers.stories.mdx +198 -121
- package/src/stories/Button/ButtonSlots.stories.mdx +83 -95
- package/src/stories/Button/ButtonState.stories.mdx +75 -0
- package/src/stories/Button/ButtonToggle.stories.mdx +50 -0
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +28 -0
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +16 -18
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +35 -0
- package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.mdx +52 -0
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +45 -114
- package/src/stories/Card/Card.settings.ts +55 -0
- package/src/stories/Card/Card.stories.mdx +27 -11
- package/src/stories/Card/Card.test.ts +23 -0
- package/src/stories/Card/CardSlots.stories.mdx +80 -24
- package/src/stories/Checkbox/Checkbox.settings.ts +43 -0
- package/src/stories/Checkbox/Checkbox.stories.mdx +163 -0
- package/src/stories/Checkbox/Checkbox.test.ts +81 -0
- package/src/stories/Checkbox/CheckboxBinary.stories.mdx +68 -0
- package/src/stories/Checkbox/CheckboxSlots.stories.mdx +46 -0
- package/src/stories/CheckboxGroup/CheckboxGroup.settings.ts +15 -0
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +134 -0
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +83 -0
- package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.mdx +100 -0
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +67 -0
- package/src/stories/Combobox/Combobox.settings.ts +122 -0
- package/src/stories/Combobox/Combobox.stories.mdx +153 -0
- package/src/stories/Combobox/Combobox.test.ts +96 -0
- package/src/stories/Combobox/ComboboxMultiple.stories.mdx +74 -0
- package/src/stories/Combobox/ComboboxOptions.stories.mdx +100 -0
- package/src/stories/Combobox/ComboboxSlots.stories.mdx +48 -0
- package/src/stories/Dialog/Dialog.settings.ts +45 -0
- package/src/stories/Dialog/Dialog.stories.mdx +42 -16
- package/src/stories/Dialog/Dialog.test.ts +69 -0
- package/src/stories/Dialog/DialogSlots.stories.mdx +63 -0
- package/src/stories/Dropdown/Dropdown.settings.ts +42 -0
- package/src/stories/Dropdown/Dropdown.stories.mdx +85 -29
- package/src/stories/Dropdown/Dropdown.test.ts +43 -0
- package/src/stories/Dropdown/DropdownOptions.stories.mdx +87 -67
- package/src/stories/Icon/Icon.settings.ts +72 -0
- package/src/stories/Icon/Icon.stories.mdx +76 -59
- package/src/stories/Icon/IconsCollection.stories.mdx +68 -0
- package/src/stories/InputText/InputText.settings.ts +221 -0
- package/src/stories/InputText/InputText.stories.mdx +142 -69
- package/src/stories/InputText/InputText.test.ts +125 -0
- package/src/stories/InputText/InputTextIconPosition.stories.mdx +63 -16
- package/src/stories/InputText/InputTextLength.stories.mdx +110 -0
- package/src/stories/InputText/InputTextMinMax.stories.mdx +112 -0
- package/src/stories/InputText/InputTextSlots.stories.mdx +61 -22
- package/src/stories/InputText/InputTextType.stories.mdx +207 -29
- package/src/stories/Progress/Progress.settings.ts +33 -0
- package/src/stories/Progress/Progress.stories.mdx +12 -14
- package/src/stories/Progress/Progress.test.ts +9 -0
- package/src/stories/Radio/Radio.settings.ts +15 -0
- package/src/stories/Radio/Radio.stories.mdx +102 -42
- package/src/stories/Radio/Radio.test.ts +70 -0
- package/src/stories/Radio/RadioSlots.stories.mdx +39 -22
- package/src/stories/RadioGroup/RadioGroup.settings.ts +15 -0
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +115 -54
- package/src/stories/RadioGroup/RadioGroup.test.ts +83 -0
- package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +83 -41
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +49 -144
- package/src/stories/Select/Select.settings.ts +100 -0
- package/src/stories/Select/Select.stories.mdx +113 -33
- package/src/stories/Select/Select.test.ts +82 -0
- package/src/stories/Select/SelectOptions.stories.mdx +91 -69
- package/src/stories/Select/SelectSlots.stories.mdx +48 -0
- package/src/stories/Textarea/Textarea.settings.ts +96 -0
- package/src/stories/Textarea/Textarea.stories.mdx +160 -58
- package/src/stories/Textarea/Textarea.test.ts +90 -0
- package/src/stories/Textarea/TextareaLength.stories.mdx +110 -0
- package/src/stories/Textarea/TextareaSlots.stories.mdx +61 -23
- package/src/stories/Textarea/TextareatIconPosition.stories.mdx +78 -0
- package/src/stories/argTypes.ts +433 -0
- package/src/test/expect.ts +27 -6
- package/src/test/options.ts +17 -0
- package/src/test/sleep.ts +2 -0
- package/src/test/types.d.ts +14 -0
- package/src/types/generic.d.ts +5 -0
- package/src/utils/ObjectUtilities.ts +253 -244
- package/dist/components/VvAccordion/VvAccordion.d.ts +0 -32
- package/dist/components/VvAccordion/useAccordionProps.d.ts +0 -16
- package/dist/components/VvAccordion/vv-accordion.es.js +0 -262
- package/dist/components/VvAccordion/vv-accordion.umd.js +0 -1
- package/dist/components/VvAccordionGroup/vv-accordion-group.es.js +0 -315
- package/dist/components/VvAccordionGroup/vv-accordion-group.umd.js +0 -1
- package/dist/components/VvBadge/vv-badge.es.js +0 -18
- package/dist/components/VvBadge/vv-badge.umd.js +0 -1
- package/dist/components/VvBreadcrumb/vv-breadcrumb.es.js +0 -206
- package/dist/components/VvBreadcrumb/vv-breadcrumb.umd.js +0 -1
- package/dist/components/VvButton/VvButton.d.ts +0 -115
- package/dist/components/VvButton/useButtonGroupProps.d.ts +0 -23
- package/dist/components/VvButton/vv-button.es.js +0 -424
- package/dist/components/VvButton/vv-button.umd.js +0 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.d.ts +0 -57
- package/dist/components/VvButtonGroup/vv-button-group.es.js +0 -210
- package/dist/components/VvButtonGroup/vv-button-group.umd.js +0 -1
- package/dist/components/VvCard/vv-card.es.js +0 -188
- package/dist/components/VvCard/vv-card.umd.js +0 -1
- package/dist/components/VvCheck/VvCheck.d.ts +0 -47
- package/dist/components/VvCheck/VvCheck.vue.d.ts +0 -165
- package/dist/components/VvCheck/useCheckProps.d.ts +0 -16
- package/dist/components/VvCheck/vv-check.es.js +0 -321
- package/dist/components/VvCheck/vv-check.umd.js +0 -1
- package/dist/components/VvCheckGroup/VvCheckGroup.d.ts +0 -65
- package/dist/components/VvCheckGroup/VvCheckGroup.vue.d.ts +0 -272
- package/dist/components/VvCheckGroup/vv-check-group.es.js +0 -434
- package/dist/components/VvCheckGroup/vv-check-group.umd.js +0 -2
- package/dist/components/VvDialog/constants.d.ts +0 -5
- package/dist/components/VvDialog/vv-dialog.es.js +0 -315
- package/dist/components/VvDialog/vv-dialog.umd.js +0 -1
- package/dist/components/VvDropdown/VvDropdown.d.ts +0 -52
- package/dist/components/VvDropdown/vv-dropdown.es.js +0 -236
- package/dist/components/VvDropdown/vv-dropdown.umd.js +0 -1
- package/dist/components/VvIcon/vv-icon.es.js +0 -229
- package/dist/components/VvIcon/vv-icon.umd.js +0 -1
- package/dist/components/VvInputText/VvInputText.d.ts +0 -59
- package/dist/components/VvInputText/constants.d.ts +0 -55
- package/dist/components/VvInputText/useInputNumber.d.ts +0 -16
- package/dist/components/VvInputText/useInputPassword.d.ts +0 -16
- package/dist/components/VvInputText/vv-input-text.es.js +0 -596
- package/dist/components/VvInputText/vv-input-text.umd.js +0 -2
- package/dist/components/VvNativeSelect/VvNativeSelect.d.ts +0 -70
- package/dist/components/VvNativeSelect/VvNativeSelect.vue.d.ts +0 -228
- package/dist/components/VvNativeSelect/vv-native-select.es.js +0 -395
- package/dist/components/VvNativeSelect/vv-native-select.umd.js +0 -2
- package/dist/components/VvProgress/VvProgress.d.ts +0 -29
- package/dist/components/VvProgress/vv-progress.es.js +0 -185
- package/dist/components/VvProgress/vv-progress.umd.js +0 -1
- package/dist/components/VvRadio/VvRadio.d.ts +0 -22
- package/dist/components/VvRadio/useRadioProps.d.ts +0 -15
- package/dist/components/VvRadio/vv-radio.es.js +0 -309
- package/dist/components/VvRadio/vv-radio.umd.js +0 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.d.ts +0 -54
- package/dist/components/VvRadioGroup/vv-radio-group.es.js +0 -423
- package/dist/components/VvRadioGroup/vv-radio-group.umd.js +0 -2
- package/dist/components/VvSelect/vv-select.es.js +0 -427
- package/dist/components/VvSelect/vv-select.umd.js +0 -2
- package/dist/components/VvTextarea/VvTextarea.d.ts +0 -67
- package/dist/components/VvTextarea/constants.d.ts +0 -19
- package/dist/components/VvTextarea/vv-textarea.es.js +0 -472
- package/dist/components/VvTextarea/vv-textarea.umd.js +0 -2
- package/dist/composables/focus/useComponentFocus.d.ts +0 -7
- package/dist/composables/options/useOptions.d.ts +0 -5
- package/dist/stories/Icon/IconList.vue.d.ts +0 -44
- package/dist/ui-vue.es.js +0 -2985
- package/dist/ui-vue.umd.js +0 -2
- package/src/assets/icons/index.js +0 -7
- package/src/components/VvAccordion/VvAccordion.ts +0 -34
- package/src/components/VvAccordion/useAccordionProps.ts +0 -45
- package/src/components/VvBadge/VvBadge.ts +0 -4
- package/src/components/VvButton/VvButton.ts +0 -117
- package/src/components/VvButton/useButtonGroupProps.ts +0 -51
- package/src/components/VvButtonGroup/VvButtonGroup.ts +0 -37
- package/src/components/VvCheck/VvCheck.ts +0 -48
- package/src/components/VvCheck/VvCheck.vue +0 -149
- package/src/components/VvCheck/useCheckProps.ts +0 -41
- package/src/components/VvCheckGroup/VvCheckGroup.ts +0 -34
- package/src/components/VvCheckGroup/VvCheckGroup.vue +0 -84
- package/src/components/VvDialog/VvDialog.ts +0 -17
- package/src/components/VvDialog/constants.ts +0 -5
- package/src/components/VvDropdown/VvDropdown.ts +0 -46
- package/src/components/VvInputText/VvInputText.ts +0 -49
- package/src/components/VvInputText/constants.ts +0 -34
- package/src/components/VvInputText/useInputNumber.ts +0 -40
- package/src/components/VvInputText/useInputPassword.ts +0 -38
- package/src/components/VvNativeSelect/VvNativeSelect.ts +0 -70
- package/src/components/VvNativeSelect/VvNativeSelect.vue +0 -106
- package/src/components/VvProgress/VvProgress.ts +0 -28
- package/src/components/VvRadio/VvRadio.ts +0 -25
- package/src/components/VvRadio/useRadioProps.ts +0 -40
- package/src/components/VvRadioGroup/VvRadioGroup.ts +0 -25
- package/src/components/VvSelect/VvSelect.ts +0 -91
- package/src/components/VvTextarea/VvTextarea.ts +0 -55
- package/src/components/VvTextarea/constants.ts +0 -14
- package/src/composables/focus/useComponentFocus.ts +0 -22
- package/src/composables/icons/useComponentIcons.ts +0 -52
- package/src/composables/options/useOptions.ts +0 -27
- package/src/stories/Accordion/AccordionBordered.stories.mdx +0 -26
- package/src/stories/Accordion/AccordionIconRight.stories.mdx +0 -32
- package/src/stories/Accordion/accordionTest.js +0 -36
- package/src/stories/AccordionGroup/Accordion.stories.mdx +0 -42
- package/src/stories/AccordionGroup/AccordionItems.stories.mdx +0 -51
- package/src/stories/AccordionGroup/accordionGroupTest.js +0 -51
- package/src/stories/Badge/BadgeColor.stories.mdx +0 -54
- package/src/stories/Badge/BadgeDot.stories.mdx +0 -20
- package/src/stories/Badge/BadgeTest.js +0 -21
- package/src/stories/Breadcrumb/BreadcrumbMultiline.stories.mdx +0 -41
- package/src/stories/Button/ButtonBadge.stories.mdx +0 -34
- package/src/stories/Button/ButtonIconPosition.stories.mdx +0 -106
- package/src/stories/Button/ButtonVariant.stories.mdx +0 -205
- package/src/stories/Button/test.js +0 -41
- package/src/stories/ButtonGroup/ButtonGroupAction.stories.mdx +0 -83
- package/src/stories/ButtonGroup/ButtonGroupActionQuiet.stories.mdx +0 -50
- package/src/stories/ButtonGroup/ButtonGroupBlock.stories.mdx +0 -40
- package/src/stories/ButtonGroup/ButtonGroupCompact.stories.mdx +0 -38
- package/src/stories/ButtonGroup/ButtonGroupRounded.stories.mdx +0 -77
- package/src/stories/ButtonGroup/ButtonGroupTest.js +0 -61
- package/src/stories/ButtonGroup/ButtonGroupVertical.stories.mdx +0 -38
- package/src/stories/Card/CardVariant.stories.mdx +0 -37
- package/src/stories/Check/Check.stories.mdx +0 -62
- package/src/stories/Check/CheckBinary.stories.mdx +0 -80
- package/src/stories/Check/CheckDisabled.stories.mdx +0 -30
- package/src/stories/Check/CheckError.stories.mdx +0 -64
- package/src/stories/Check/CheckErrorTests.js +0 -72
- package/src/stories/Check/CheckHintLabel.stories.mdx +0 -30
- package/src/stories/Check/CheckPropertyTest.js +0 -101
- package/src/stories/Check/CheckReadonly.stories.mdx +0 -30
- package/src/stories/Check/CheckSlots.stories.mdx +0 -51
- package/src/stories/Check/CheckSwitch.stories.mdx +0 -30
- package/src/stories/CheckGroup/CheckGroup.stories.mdx +0 -69
- package/src/stories/CheckGroup/CheckGroupDisabled.stories.mdx +0 -26
- package/src/stories/CheckGroup/CheckGroupError.stories.mdx +0 -28
- package/src/stories/CheckGroup/CheckGroupHintLabel.stories.mdx +0 -27
- package/src/stories/CheckGroup/CheckGroupLabel.stories.mdx +0 -26
- package/src/stories/CheckGroup/CheckGroupOptionLabel.stories.mdx +0 -48
- package/src/stories/CheckGroup/CheckGroupOptionValue.stories.mdx +0 -48
- package/src/stories/CheckGroup/CheckGroupOptions.stories.mdx +0 -40
- package/src/stories/CheckGroup/CheckGroupReadonly.stories.mdx +0 -26
- package/src/stories/CheckGroup/CheckGroupSlots.stories.mdx +0 -152
- package/src/stories/CheckGroup/CheckGroupValid.stories.mdx +0 -28
- package/src/stories/CheckGroup/CheckGroupVertical.stories.mdx +0 -26
- package/src/stories/Dialog/DialogAutoClose.stories.mdx +0 -18
- package/src/stories/Dialog/DialogSize.stories.mdx +0 -36
- package/src/stories/Dropdown/DropdownDisabled.stories.mdx +0 -25
- package/src/stories/Dropdown/DropdownLabelNoResults.stories.mdx +0 -25
- package/src/stories/Dropdown/DropdownMaxValues.stories.mdx +0 -26
- package/src/stories/Dropdown/DropdownMultiple.stories.mdx +0 -56
- package/src/stories/Dropdown/DropdownUseObject.stories.mdx +0 -58
- package/src/stories/Icon/IconList.vue +0 -34
- package/src/stories/Icon/IconPrefix.stories.mdx +0 -79
- package/src/stories/Icon/IconRemote.stories.mdx +0 -39
- package/src/stories/Icon/IconTest.js +0 -27
- package/src/stories/Icon/IconsList.stories.mdx +0 -35
- package/src/stories/InputText/InputTextAutocomplete.stories.mdx +0 -15
- package/src/stories/InputText/InputTextAutofocus.stories.mdx +0 -20
- package/src/stories/InputText/InputTextDisabled.stories.mdx +0 -19
- package/src/stories/InputText/InputTextError.stories.mdx +0 -19
- package/src/stories/InputText/InputTextFloating.stories.mdx +0 -20
- package/src/stories/InputText/InputTextHintLabel.stories.mdx +0 -18
- package/src/stories/InputText/InputTextIcon.stories.mdx +0 -18
- package/src/stories/InputText/InputTextLabel.stories.mdx +0 -15
- package/src/stories/InputText/InputTextLoading.stories.mdx +0 -19
- package/src/stories/InputText/InputTextMax.stories.mdx +0 -31
- package/src/stories/InputText/InputTextMaxLength.stories.mdx +0 -15
- package/src/stories/InputText/InputTextMin.stories.mdx +0 -31
- package/src/stories/InputText/InputTextMinLength.stories.mdx +0 -15
- package/src/stories/InputText/InputTextPlaceholder.stories.mdx +0 -15
- package/src/stories/InputText/InputTextReadonly.stories.mdx +0 -19
- package/src/stories/InputText/InputTextStep.stories.mdx +0 -31
- package/src/stories/InputText/InputTextValid.stories.mdx +0 -19
- package/src/stories/NativeSelect/NativeSelect.stories.mdx +0 -53
- package/src/stories/NativeSelect/NativeSelectDisabled.stories.mdx +0 -32
- package/src/stories/NativeSelect/NativeSelectError.stories.mdx +0 -36
- package/src/stories/NativeSelect/NativeSelectHintLabel.stories.mdx +0 -34
- package/src/stories/NativeSelect/NativeSelectIconLeftRight.stories.mdx +0 -42
- package/src/stories/NativeSelect/NativeSelectLoading.stories.mdx +0 -27
- package/src/stories/NativeSelect/NativeSelectOptions.stories.mdx +0 -78
- package/src/stories/NativeSelect/NativeSelectReadonly.stories.mdx +0 -34
- package/src/stories/NativeSelect/NativeSelectUseObject.stories.mdx +0 -66
- package/src/stories/NativeSelect/NativeSelectValid.stories.mdx +0 -36
- package/src/stories/NativeSelect/NativeSelectValueKey.stories.mdx +0 -66
- package/src/stories/Progress/ProgressDeterminate.stories.mdx +0 -19
- package/src/stories/Radio/RadioDisabled.stories.mdx +0 -30
- package/src/stories/Radio/RadioError.stories.mdx +0 -64
- package/src/stories/Radio/RadioHintLabel.stories.mdx +0 -30
- package/src/stories/Radio/RadioTest.js +0 -89
- package/src/stories/RadioGroup/RadioGroupDisabled.stories.mdx +0 -29
- package/src/stories/RadioGroup/RadioGroupError.stories.mdx +0 -31
- package/src/stories/RadioGroup/RadioGroupHintLabel.stories.mdx +0 -28
- package/src/stories/RadioGroup/RadioGroupLabel.stories.mdx +0 -29
- package/src/stories/RadioGroup/RadioGroupOptionLabel.stories.mdx +0 -65
- package/src/stories/RadioGroup/RadioGroupOptionValue.stories.mdx +0 -65
- package/src/stories/RadioGroup/RadioGroupReadonly.stories.mdx +0 -29
- package/src/stories/RadioGroup/RadioGroupValid.stories.mdx +0 -31
- package/src/stories/RadioGroup/RadioGroupVertical.stories.mdx +0 -29
- package/src/stories/RadioGroup/RadioOptionsTest.js +0 -78
- package/src/stories/RadioGroup/RadioPropertyTest.js +0 -131
- package/src/stories/RadioGroup/RadioSlotsTest.js +0 -20
- package/src/stories/Select/SelectDisabled.stories.mdx +0 -32
- package/src/stories/Select/SelectMaxValues.stories.mdx +0 -33
- package/src/stories/Select/SelectMultiple.stories.mdx +0 -64
- package/src/stories/Select/SelectSearchable.stories.mdx +0 -80
- package/src/stories/Select/SelectSeparator.stories.mdx +0 -64
- package/src/stories/Select/SelectUseObject.stories.mdx +0 -66
- package/src/stories/Textarea/TextareaAutocomplete.stories.mdx +0 -15
- package/src/stories/Textarea/TextareaAutofocus.stories.mdx +0 -20
- package/src/stories/Textarea/TextareaDisabled.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaError.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaFloating.stories.mdx +0 -20
- package/src/stories/Textarea/TextareaHintLabel.stories.mdx +0 -18
- package/src/stories/Textarea/TextareaIcon.stories.mdx +0 -18
- package/src/stories/Textarea/TextareaIconPosition.stories.mdx +0 -31
- package/src/stories/Textarea/TextareaLabel.stories.mdx +0 -15
- package/src/stories/Textarea/TextareaLoading.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaMaxLength.stories.mdx +0 -15
- package/src/stories/Textarea/TextareaMinLength.stories.mdx +0 -15
- package/src/stories/Textarea/TextareaPlaceholder.stories.mdx +0 -15
- package/src/stories/Textarea/TextareaReadonly.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaRowsCols.stories.mdx +0 -31
- package/src/stories/Textarea/TextareaValid.stories.mdx +0 -19
- package/src/stories/stories.scss +0 -24
- package/src/stories/volver-ui-vue.stories.mdx +0 -71
- package/src/types/.README +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue'
|
|
2
|
+
import { InputTextareaProps } from '@/props'
|
|
3
|
+
|
|
4
|
+
export const INPUT_TYPES = {
|
|
5
|
+
TEXT: 'text',
|
|
6
|
+
PASSWORD: 'password',
|
|
7
|
+
NUMBER: 'number',
|
|
8
|
+
EMAIL: 'email',
|
|
9
|
+
TEL: 'tel',
|
|
10
|
+
URL: 'url',
|
|
11
|
+
COLOR: 'color',
|
|
12
|
+
SEARCH: 'search',
|
|
13
|
+
DATE: 'date',
|
|
14
|
+
TIME: 'time',
|
|
15
|
+
DATETIME_LOCAL: 'datetime-local',
|
|
16
|
+
MONTH: 'month',
|
|
17
|
+
WEEK: 'week',
|
|
18
|
+
} as const
|
|
19
|
+
export type InputType = ValueOf<typeof INPUT_TYPES>
|
|
20
|
+
|
|
21
|
+
export const TYPES_ICON = {
|
|
22
|
+
PASSWORD_SHOW: 'eye-on',
|
|
23
|
+
PASSWORD_HIDE: 'eye-off',
|
|
24
|
+
DATE: 'calendar',
|
|
25
|
+
TIME: 'time',
|
|
26
|
+
COLOR: 'color',
|
|
27
|
+
SEARCH: 'close',
|
|
28
|
+
} as const
|
|
29
|
+
|
|
30
|
+
export const VvInputTextEvents = ['update:modelValue', 'focus', 'blur', 'keyup']
|
|
31
|
+
|
|
32
|
+
export const VvInputTextProps = {
|
|
33
|
+
...InputTextareaProps,
|
|
34
|
+
/**
|
|
35
|
+
* Input value
|
|
36
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
37
|
+
*/
|
|
38
|
+
modelValue: [String, Number],
|
|
39
|
+
/**
|
|
40
|
+
* Type of form control
|
|
41
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#type
|
|
42
|
+
*/
|
|
43
|
+
type: {
|
|
44
|
+
type: String as PropType<InputType>,
|
|
45
|
+
default: INPUT_TYPES.TEXT,
|
|
46
|
+
validator: (value: InputType) =>
|
|
47
|
+
Object.values(INPUT_TYPES).includes(value),
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Minimum value
|
|
51
|
+
* Available for input types: date, month, week, time, datetime-local, number, range.
|
|
52
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
|
|
53
|
+
*/
|
|
54
|
+
min: [Number, Date, String],
|
|
55
|
+
/**
|
|
56
|
+
* Maximum value
|
|
57
|
+
* Available for input types: date, month, week, time, datetime-local, number, range.
|
|
58
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
|
|
59
|
+
*/
|
|
60
|
+
max: [Number, Date, String],
|
|
61
|
+
/**
|
|
62
|
+
* Incremental values that are valid
|
|
63
|
+
* Available for input types: date, month, week, time, datetime-local and number
|
|
64
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step
|
|
65
|
+
*/
|
|
66
|
+
step: { type: [String, Number], default: 1 },
|
|
67
|
+
/**
|
|
68
|
+
* Pattern the value must match to be valid
|
|
69
|
+
* Available for input types: text, search, url, tel, email and password
|
|
70
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
71
|
+
*/
|
|
72
|
+
pattern: String,
|
|
73
|
+
/**
|
|
74
|
+
* Whether to allow multiple values
|
|
75
|
+
* Available for input type email
|
|
76
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#multiple
|
|
77
|
+
*/
|
|
78
|
+
multiple: Boolean,
|
|
79
|
+
/**
|
|
80
|
+
* VvIcon name for show password button
|
|
81
|
+
* @see VVIcon
|
|
82
|
+
*/
|
|
83
|
+
iconShowPassword: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: TYPES_ICON.PASSWORD_SHOW,
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* VvIcon name for hide password button
|
|
89
|
+
* @see VVIcon
|
|
90
|
+
*/
|
|
91
|
+
iconHidePassword: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: TYPES_ICON.PASSWORD_HIDE,
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* VvIcon name for clear button
|
|
97
|
+
* @see VVIcon
|
|
98
|
+
*/
|
|
99
|
+
iconClear: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: TYPES_ICON.SEARCH,
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Label for step up button
|
|
105
|
+
*/
|
|
106
|
+
labelStepUp: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: 'Increase value',
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Label for step down button
|
|
112
|
+
*/
|
|
113
|
+
labelStepDown: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: 'Decrease value',
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* Label for show password button
|
|
119
|
+
*/
|
|
120
|
+
labelShowPassword: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: 'Show password',
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Label for hide password button
|
|
126
|
+
*/
|
|
127
|
+
labelHidePassword: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: 'Hide password',
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* Label for clear button
|
|
133
|
+
*/
|
|
134
|
+
labelClear: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: 'Clear',
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type VvInputTextPropsTypes = ExtractPropTypes<typeof VvInputTextProps>
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export default {
|
|
3
|
+
name: 'VvProgress',
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
4
6
|
|
|
5
7
|
<script setup lang="ts">
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { VvProgressProps } from '
|
|
9
|
-
|
|
10
|
-
//Props, emits, slots, attrs
|
|
11
|
-
const props = defineProps(VvProgressProps)
|
|
8
|
+
import { computed, toRefs } from 'vue'
|
|
9
|
+
import { useBemModifiers } from '@/composables/useModifiers'
|
|
10
|
+
import { VvProgressProps } from '@/components/VvProgress'
|
|
12
11
|
|
|
13
|
-
//
|
|
14
|
-
const
|
|
12
|
+
// props
|
|
13
|
+
const props = defineProps(VvProgressProps)
|
|
14
|
+
const { value, max, label: ariaLabel } = toRefs(props)
|
|
15
|
+
const indeterminate = computed(() => props.value === undefined)
|
|
15
16
|
|
|
16
|
-
//
|
|
17
|
-
const { bemCssClasses:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Compute component properties
|
|
24
|
-
*/
|
|
25
|
-
const properties = computed(() => {
|
|
26
|
-
return {
|
|
27
|
-
'aria-label': props.ariaLabel,
|
|
28
|
-
role: 'progressbar',
|
|
29
|
-
class: progressClass.value,
|
|
30
|
-
value: props.value,
|
|
31
|
-
max: props.max
|
|
32
|
-
}
|
|
33
|
-
})
|
|
17
|
+
// styles
|
|
18
|
+
const { bemCssClasses: hasClass } = useBemModifiers('vv-progress', {
|
|
19
|
+
modifiers: props.modifiers,
|
|
20
|
+
indeterminate,
|
|
21
|
+
})
|
|
34
22
|
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<progress
|
|
26
|
+
role="progressbar"
|
|
27
|
+
v-bind="{
|
|
28
|
+
class: hasClass,
|
|
29
|
+
ariaLabel,
|
|
30
|
+
max,
|
|
31
|
+
value,
|
|
32
|
+
}"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ModifiersProps } from '@/props'
|
|
2
|
+
|
|
3
|
+
export const VvProgressProps = {
|
|
4
|
+
...ModifiersProps,
|
|
5
|
+
/**
|
|
6
|
+
* Progress value
|
|
7
|
+
* This attribute specifies how much of the task that has been completed.
|
|
8
|
+
* It must be a valid floating point number between 0 and max, or between 0 and 1 if max is omitted.
|
|
9
|
+
* If there is no value attribute, the progress bar is indeterminate.
|
|
10
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#attr-max
|
|
11
|
+
*/
|
|
12
|
+
value: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
default: undefined,
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* Progress max
|
|
18
|
+
* This attribute describes how much work the task indicated by the progress element requires.
|
|
19
|
+
* The max attribute, if present, must have a value greater than 0 and be a valid floating point number. The default value is 1.
|
|
20
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#attr-max
|
|
21
|
+
*/
|
|
22
|
+
max: {
|
|
23
|
+
type: [Number, String],
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Progress aria-label
|
|
27
|
+
*/
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
@@ -1,130 +1,101 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
v-bind="radioInputAttrs"
|
|
7
|
-
@input="onChange" />
|
|
8
|
-
<slot :value="modelValue">
|
|
9
|
-
{{ label }}
|
|
10
|
-
</slot>
|
|
11
|
-
</label>
|
|
12
|
-
</template>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export default {
|
|
3
|
+
name: 'VvRadio',
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
13
6
|
|
|
14
7
|
<script setup lang="ts">
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import {
|
|
8
|
+
import { computed, ref, useSlots } from 'vue'
|
|
9
|
+
import { nanoid } from 'nanoid'
|
|
10
|
+
import { contains, equals } from '@/utils/ObjectUtilities'
|
|
11
|
+
import { useBemModifiers } from '@/composables/useModifiers'
|
|
12
|
+
import {
|
|
13
|
+
VvRadioProps,
|
|
14
|
+
VvRadioEvents,
|
|
15
|
+
useGroupProps,
|
|
16
|
+
} from '@/components/VvRadio'
|
|
17
|
+
import { HintSlotFactory } from '@/components/common/HintSlot'
|
|
25
18
|
|
|
26
|
-
//
|
|
27
|
-
const props = defineProps(VvRadioProps)
|
|
28
|
-
const emit = defineEmits(VvRadioEvents)
|
|
29
|
-
const
|
|
19
|
+
// props, emit and slots
|
|
20
|
+
const props = defineProps(VvRadioProps)
|
|
21
|
+
const emit = defineEmits(VvRadioEvents)
|
|
22
|
+
const slots = useSlots()
|
|
30
23
|
|
|
31
|
-
//
|
|
32
|
-
const { disabled, readonly, modelValue, valid,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const input = ref()
|
|
39
|
-
|
|
40
|
-
//Component computed
|
|
41
|
-
const isChecked = computed(() => {
|
|
42
|
-
return Array.isArray(modelValue.value)
|
|
43
|
-
? ObjectUtilities.contains(props.value, modelValue.value)
|
|
44
|
-
: ObjectUtilities.equals(props.value, modelValue.value)
|
|
45
|
-
})
|
|
24
|
+
// data
|
|
25
|
+
const { disabled, readonly, modelValue, valid, invalid } = useGroupProps(
|
|
26
|
+
props,
|
|
27
|
+
emit,
|
|
28
|
+
)
|
|
29
|
+
const id = computed(() => String(props.id || nanoid()))
|
|
30
|
+
const tabindex = computed(() => (isDisabled.value ? -1 : props.tabindex))
|
|
46
31
|
|
|
47
|
-
//
|
|
48
|
-
const
|
|
49
|
-
// #endregion FOCUS
|
|
32
|
+
// template refs
|
|
33
|
+
const input = ref()
|
|
50
34
|
|
|
51
|
-
//
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
class: cssClass,
|
|
68
|
-
...bemRadioClass.value
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
const radioInputClass = computed(() => {
|
|
72
|
-
return {
|
|
73
|
-
'focus-visible': focused.value,
|
|
74
|
-
...bemInputRadioClass.value
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
const radioAttrs = computed(() => {
|
|
78
|
-
const { id, name, style } = attrs
|
|
79
|
-
const dataAttrs = ObjectUtilities.pickBy(attrs, (k: string) =>
|
|
80
|
-
k.startsWith('data-')
|
|
35
|
+
// computed
|
|
36
|
+
const isDisabled = computed(() => disabled.value || readonly.value)
|
|
37
|
+
const isInvalid = computed(() => {
|
|
38
|
+
if (invalid.value === true) {
|
|
39
|
+
return true
|
|
40
|
+
}
|
|
41
|
+
if (valid.value === true) {
|
|
42
|
+
return false
|
|
43
|
+
}
|
|
44
|
+
return undefined
|
|
45
|
+
})
|
|
46
|
+
const isChecked = computed(() =>
|
|
47
|
+
Array.isArray(modelValue.value)
|
|
48
|
+
? contains(props.value, modelValue.value)
|
|
49
|
+
: equals(props.value, modelValue.value),
|
|
81
50
|
)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} as LabelHTMLAttributes
|
|
87
|
-
})
|
|
88
|
-
const radioInputAttrs = computed(() => {
|
|
89
|
-
const { id = '', name = '' } = attrs as InputHTMLAttributes
|
|
90
|
-
return {
|
|
91
|
-
type: 'radio',
|
|
92
|
-
id: id || name,
|
|
93
|
-
name,
|
|
94
|
-
value: props.value,
|
|
95
|
-
disabled: disabled.value,
|
|
96
|
-
readonly: readonly.value,
|
|
97
|
-
checked: isChecked.value,
|
|
98
|
-
...radioInputAriaAttrs.value
|
|
99
|
-
} as InputHTMLAttributes
|
|
100
|
-
})
|
|
101
|
-
const radioInputAriaAttrs = computed(() => {
|
|
102
|
-
const { name } = attrs
|
|
103
|
-
const dataAttrs = ObjectUtilities.pickBy(attrs, (k: string) =>
|
|
104
|
-
k.startsWith('aria-')
|
|
51
|
+
const hasValue = computed(() =>
|
|
52
|
+
['string', 'number', 'boolean'].includes(typeof props.value)
|
|
53
|
+
? props.value
|
|
54
|
+
: true,
|
|
105
55
|
)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
56
|
+
const localModelValue = computed({
|
|
57
|
+
get() {
|
|
58
|
+
return isChecked.value ? hasValue.value : null
|
|
59
|
+
},
|
|
60
|
+
set(newValue) {
|
|
61
|
+
if (Array.isArray(modelValue.value)) {
|
|
62
|
+
modelValue.value = [props.value]
|
|
63
|
+
} else {
|
|
64
|
+
modelValue.value = props.value
|
|
65
|
+
}
|
|
66
|
+
emit('change', newValue)
|
|
67
|
+
},
|
|
68
|
+
})
|
|
112
69
|
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
emit('click', event)
|
|
121
|
-
focused.value = true
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
</script>
|
|
70
|
+
// styles
|
|
71
|
+
const { bemCssClasses } = useBemModifiers('vv-radio', {
|
|
72
|
+
valid,
|
|
73
|
+
invalid,
|
|
74
|
+
disabled,
|
|
75
|
+
readonly,
|
|
76
|
+
})
|
|
125
77
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
inheritAttrs: false
|
|
129
|
-
}
|
|
78
|
+
// hint
|
|
79
|
+
const { HintSlot } = HintSlotFactory(props, slots)
|
|
130
80
|
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<label :class="bemCssClasses" :for="id">
|
|
84
|
+
<input
|
|
85
|
+
:id="id"
|
|
86
|
+
ref="input"
|
|
87
|
+
v-model="localModelValue"
|
|
88
|
+
type="radio"
|
|
89
|
+
class="vv-radio__input"
|
|
90
|
+
:name="name"
|
|
91
|
+
:disabled="isDisabled"
|
|
92
|
+
:value="hasValue"
|
|
93
|
+
:tabindex="tabindex"
|
|
94
|
+
:aria-invalid="isInvalid"
|
|
95
|
+
/>
|
|
96
|
+
<slot :value="modelValue">
|
|
97
|
+
{{ label }}
|
|
98
|
+
</slot>
|
|
99
|
+
<HintSlot class="vv-radio__hint" :params="{ value: modelValue }" />
|
|
100
|
+
</label>
|
|
101
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ExtractPropTypes, Ref } from 'vue'
|
|
2
|
+
import type { IInputGroupState } from '@/composables/group/types/IInputGroup'
|
|
3
|
+
import { CheckboxRadioProps } from '@/props'
|
|
4
|
+
import { useInjectedGroupState } from '@/composables/group/useInjectedGroupState'
|
|
5
|
+
import { VV_RADIO_GROUP } from '@/constants'
|
|
6
|
+
|
|
7
|
+
export const VvRadioProps = CheckboxRadioProps
|
|
8
|
+
|
|
9
|
+
export const VvRadioEvents = ['click', 'update:modelValue', 'change', 'blur']
|
|
10
|
+
|
|
11
|
+
export type VvRadioPropsType = ExtractPropTypes<typeof VvRadioProps>
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Merges local and group props
|
|
15
|
+
*/
|
|
16
|
+
export function useGroupProps(
|
|
17
|
+
props: VvRadioPropsType,
|
|
18
|
+
emit: (event: (typeof VvRadioEvents)[number], value: unknown) => void,
|
|
19
|
+
) {
|
|
20
|
+
const { group, isInGroup, getGroupOrLocalRef } =
|
|
21
|
+
useInjectedGroupState<IInputGroupState>(VV_RADIO_GROUP)
|
|
22
|
+
|
|
23
|
+
// global props
|
|
24
|
+
const modelValue = getGroupOrLocalRef('modelValue', props, emit)
|
|
25
|
+
const readonly = getGroupOrLocalRef('readonly', props) as Ref<boolean>
|
|
26
|
+
const disabled = getGroupOrLocalRef('disabled', props) as Ref<boolean>
|
|
27
|
+
const valid = getGroupOrLocalRef('valid', props) as Ref<boolean>
|
|
28
|
+
const invalid = getGroupOrLocalRef('invalid', props) as Ref<boolean>
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
// global props
|
|
32
|
+
group,
|
|
33
|
+
isInGroup,
|
|
34
|
+
modelValue,
|
|
35
|
+
readonly,
|
|
36
|
+
disabled,
|
|
37
|
+
valid,
|
|
38
|
+
invalid,
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<template v-if="options.length > 0">
|
|
7
|
-
<vv-radio
|
|
8
|
-
v-for="(o, oIndex) in options"
|
|
9
|
-
:key="oIndex"
|
|
10
|
-
v-bind="getOptionProps(o, oIndex)" />
|
|
11
|
-
</template>
|
|
12
|
-
<!-- #endregion options set up -->
|
|
13
|
-
<!-- #region default -->
|
|
14
|
-
<slot v-else />
|
|
15
|
-
<!-- #endregion default -->
|
|
16
|
-
</div>
|
|
17
|
-
<!-- @slot error,valid,hint,loading vanno vanno qua -->
|
|
18
|
-
<HintSlot class="vv-input-radio-group__hint" />
|
|
19
|
-
</fieldset>
|
|
20
|
-
</template>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export default {
|
|
3
|
+
name: 'VvRadioGroup',
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
21
6
|
|
|
22
7
|
<script setup lang="ts">
|
|
23
|
-
import {
|
|
24
|
-
import type { IInputGroupState } from '@/composables/group/types/IInputGroup'
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
import type { Option } from '@/types/generic'
|
|
9
|
+
import type { IInputGroupState } from '@/composables/group/types/IInputGroup'
|
|
10
|
+
import { useSlots, computed, toRefs } from 'vue'
|
|
11
|
+
import { useVModel } from '@vueuse/core'
|
|
12
|
+
import { useProvideGroupState } from '@/composables/group/useProvideGroupState'
|
|
13
|
+
import { useOptions } from '@/composables/useOptions'
|
|
14
|
+
import { useBemModifiers } from '@/composables/useModifiers'
|
|
15
|
+
import { VV_RADIO_GROUP } from '@/constants'
|
|
16
|
+
import { HintSlotFactory } from '@/components/common/HintSlot'
|
|
17
|
+
import VvRadio from '@/components/VvRadio/VvRadio.vue'
|
|
18
|
+
import {
|
|
19
|
+
VvRadioGroupProps,
|
|
20
|
+
VvRadioGroupEvents,
|
|
21
|
+
} from '@/components/VvRadioGroup'
|
|
35
22
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
// props, emit and slots
|
|
24
|
+
const props = defineProps(VvRadioGroupProps)
|
|
25
|
+
const emit = defineEmits(VvRadioGroupEvents)
|
|
26
|
+
const slots = useSlots()
|
|
39
27
|
|
|
40
|
-
//
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const slots = useSlots()
|
|
28
|
+
// data
|
|
29
|
+
const modelValue = useVModel(props, 'modelValue', emit)
|
|
30
|
+
const { disabled, readonly, vertical, valid, invalid } = toRefs(props)
|
|
44
31
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
readonly
|
|
55
|
-
}
|
|
56
|
-
useProvideGroupState(groupState)
|
|
57
|
-
// #endregion group
|
|
32
|
+
const groupState: IInputGroupState = {
|
|
33
|
+
key: VV_RADIO_GROUP,
|
|
34
|
+
modelValue,
|
|
35
|
+
disabled,
|
|
36
|
+
readonly,
|
|
37
|
+
valid,
|
|
38
|
+
invalid,
|
|
39
|
+
}
|
|
40
|
+
useProvideGroupState(groupState)
|
|
58
41
|
|
|
59
|
-
//
|
|
60
|
-
const { getOptionLabel, getOptionValue } = useOptions(props)
|
|
42
|
+
// options
|
|
43
|
+
const { getOptionLabel, getOptionValue } = useOptions(props)
|
|
61
44
|
|
|
62
|
-
//
|
|
63
|
-
const { bemCssClasses: groupClass } = useBemModifiers('vv-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
// styles
|
|
46
|
+
const { bemCssClasses: groupClass } = useBemModifiers('vv-radio-group', {
|
|
47
|
+
disabled,
|
|
48
|
+
readonly,
|
|
49
|
+
horizontal: computed(() => !vertical.value),
|
|
50
|
+
valid,
|
|
51
|
+
invalid,
|
|
52
|
+
})
|
|
68
53
|
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
// methods
|
|
55
|
+
const getOptionProps = (option: string | Option, index: number) => {
|
|
56
|
+
return {
|
|
57
|
+
id: `${props.name}_opt${index}`,
|
|
58
|
+
name: props.name,
|
|
59
|
+
label: getOptionLabel(option),
|
|
60
|
+
value: getOptionValue(option),
|
|
61
|
+
}
|
|
76
62
|
}
|
|
77
|
-
}
|
|
78
63
|
|
|
79
|
-
|
|
64
|
+
// hint
|
|
65
|
+
const { HintSlot } = HintSlotFactory(props, slots)
|
|
80
66
|
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<fieldset :class="groupClass">
|
|
70
|
+
<legend v-if="label" v-text="label" />
|
|
71
|
+
<div class="vv-radio-group__wrapper">
|
|
72
|
+
<!-- #region options -->
|
|
73
|
+
<template v-if="options.length > 0">
|
|
74
|
+
<vv-radio
|
|
75
|
+
v-for="(option, index) in options"
|
|
76
|
+
:key="index"
|
|
77
|
+
v-bind="getOptionProps(option, index)"
|
|
78
|
+
/>
|
|
79
|
+
</template>
|
|
80
|
+
<!-- #endregion -->
|
|
81
|
+
<!-- #region default -->
|
|
82
|
+
<slot v-else />
|
|
83
|
+
<!-- #endregion -->
|
|
84
|
+
</div>
|
|
85
|
+
<HintSlot class="vv-radio-group__hint" />
|
|
86
|
+
</fieldset>
|
|
87
|
+
</template>
|