@volverjs/ui-vue 0.0.1-beta.8 → 0.0.2
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 +108 -56
- 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 +439 -0
- package/dist/components/VvButton/VvButton.umd.js +1 -0
- package/dist/components/VvButton/VvButton.vue.d.ts +100 -199
- package/dist/components/VvButton/index.d.ts +132 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +107 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +92 -186
- 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 +775 -0
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -0
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +175 -0
- package/dist/components/VvCombobox/index.d.ts +108 -0
- 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 +227 -0
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -0
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +59 -146
- package/dist/components/VvDropdown/index.d.ts +49 -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 +772 -0
- package/dist/components/VvInputText/VvInputText.umd.js +1 -0
- package/dist/components/VvInputText/VvInputText.vue.d.ts +211 -288
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- 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 +434 -0
- package/dist/components/VvSelect/VvSelect.umd.js +1 -0
- package/dist/components/VvSelect/VvSelect.vue.d.ts +125 -263
- package/dist/components/VvSelect/index.d.ts +89 -0
- package/dist/components/VvTextarea/VvTextarea.es.js +471 -0
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -0
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +140 -321
- 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 +2379 -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} +3 -2
- package/dist/composables/useDebouncedInput.d.ts +2 -0
- 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 +2420 -0
- package/dist/index.umd.js +1 -0
- package/dist/props/index.d.ts +328 -30
- package/dist/resolvers/unplugin.d.ts +27 -0
- package/dist/resolvers/unplugin.es.js +42 -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 +198 -0
- package/dist/stories/Button/Button.test.d.ts +1 -10
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +47 -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 +286 -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 +85 -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 +284 -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 +842 -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 +199 -126
- 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 -153
- package/src/components/VvButton/index.ts +189 -0
- package/src/components/VvButtonGroup/VvButtonGroup.vue +76 -48
- package/src/components/VvButtonGroup/index.ts +16 -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 +261 -0
- package/src/components/VvCombobox/index.ts +88 -0
- package/src/components/VvDialog/VvDialog.vue +69 -67
- package/src/components/VvDialog/index.ts +10 -0
- package/src/components/VvDropdown/VvDropdown.vue +115 -114
- package/src/components/VvDropdown/index.ts +35 -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 +307 -238
- package/src/components/VvInputText/VvInputTextActions.ts +63 -114
- 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 +187 -186
- package/src/components/VvSelect/index.ts +71 -0
- package/src/components/VvTextarea/VvTextarea.vue +188 -174
- package/src/components/VvTextarea/index.ts +50 -0
- package/src/components/common/HintSlot.ts +167 -137
- 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 +23 -35
- package/src/composables/group/useProvideGroupState.ts +5 -7
- package/src/composables/useComponentFocus.ts +17 -0
- package/src/composables/{icons/useComponentIcons.ts → useComponentIcons.ts} +29 -20
- package/src/composables/useDebouncedInput.ts +25 -0
- package/src/composables/useModifiers.ts +18 -20
- 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 -36
- package/src/resolvers/unplugin.ts +112 -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 +145 -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 +33 -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/ButtonGroupSlots.stories.mdx +37 -0
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +52 -110
- 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 +127 -0
- package/src/stories/Combobox/Combobox.stories.mdx +204 -0
- package/src/stories/Combobox/Combobox.test.ts +103 -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 +51 -0
- package/src/stories/Dropdown/Dropdown.stories.mdx +102 -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 +86 -0
- package/src/stories/Select/Select.stories.mdx +173 -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 +167 -47
- 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 +457 -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 -422
- 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 -452
- 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 -73
- package/dist/components/VvInputText/constants.d.ts +0 -55
- package/dist/components/VvInputText/vv-input-text.es.js +0 -725
- 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 -414
- 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 -441
- package/dist/components/VvRadioGroup/vv-radio-group.umd.js +0 -2
- package/dist/components/VvSelect/VvSelect.d.ts +0 -99
- package/dist/components/VvSelect/vv-select.es.js +0 -445
- package/dist/components/VvSelect/vv-select.umd.js +0 -2
- package/dist/components/VvTextarea/VvTextarea.d.ts +0 -88
- package/dist/components/VvTextarea/constants.d.ts +0 -19
- package/dist/components/VvTextarea/vv-textarea.es.js +0 -548
- package/dist/components/VvTextarea/vv-textarea.umd.js +0 -2
- package/dist/composables/debouncedInput/useDebouncedInput.d.ts +0 -2
- package/dist/composables/focus/useComponentFocus.d.ts +0 -7
- package/dist/composables/options/useOptions.d.ts +0 -5
- package/dist/composables/textLimit/useTextLimit.d.ts +0 -14
- package/dist/stories/Icon/IconList.vue.d.ts +0 -44
- package/dist/stories/utils.d.ts +0 -5
- package/dist/ui-vue.es.js +0 -3001
- 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 -66
- package/src/components/VvInputText/constants.ts +0 -34
- 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 -64
- package/src/components/VvTextarea/constants.ts +0 -14
- package/src/composables/debouncedInput/useDebouncedInput.ts +0 -19
- package/src/composables/focus/useComponentFocus.ts +0 -22
- package/src/composables/options/useOptions.ts +0 -27
- package/src/composables/textLimit/useTextLimit.ts +0 -44
- 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 -36
- 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/TextareaAutoclear.stories.mdx +0 -23
- package/src/stories/Textarea/TextareaAutocomplete.stories.mdx +0 -23
- package/src/stories/Textarea/TextareaAutofocus.stories.mdx +0 -24
- package/src/stories/Textarea/TextareaDebounce.stories.mdx +0 -23
- package/src/stories/Textarea/TextareaDisabled.stories.mdx +0 -23
- package/src/stories/Textarea/TextareaError.stories.mdx +0 -22
- package/src/stories/Textarea/TextareaErrorLabel.stories.mdx +0 -37
- package/src/stories/Textarea/TextareaFloating.stories.mdx +0 -25
- package/src/stories/Textarea/TextareaHintLabel.stories.mdx +0 -22
- package/src/stories/Textarea/TextareaIcon.stories.mdx +0 -22
- package/src/stories/Textarea/TextareaIconPosition.stories.mdx +0 -39
- package/src/stories/Textarea/TextareaId.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaLabel.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaLimit.stories.mdx +0 -50
- package/src/stories/Textarea/TextareaLoading.stories.mdx +0 -22
- package/src/stories/Textarea/TextareaLoadingLabel.stories.mdx +0 -23
- package/src/stories/Textarea/TextareaMaxLength.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaMinLength.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaModifiers.stories.mdx +0 -24
- package/src/stories/Textarea/TextareaName.stories.mdx +0 -23
- package/src/stories/Textarea/TextareaPlaceholder.stories.mdx +0 -19
- package/src/stories/Textarea/TextareaReadonly.stories.mdx +0 -23
- package/src/stories/Textarea/TextareaRequired.stories.mdx +0 -22
- package/src/stories/Textarea/TextareaResizable.stories.mdx +0 -22
- package/src/stories/Textarea/TextareaRowsCols.stories.mdx +0 -39
- package/src/stories/Textarea/TextareaValid.stories.mdx +0 -22
- package/src/stories/Textarea/TextareaValidLabel.stories.mdx +0 -35
- package/src/stories/stories.scss +0 -35
- package/src/stories/utils.ts +0 -12
- package/src/stories/volver-ui-vue.stories.mdx +0 -77
- package/src/types/.README +0 -0
|
@@ -1,250 +1,319 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<slot v-if="hasIconLeft" name="icon-left" v-bind="iconSlotProps">
|
|
7
|
-
<vv-icon class="vv-input-text__icon-left" :name="icon" />
|
|
8
|
-
</slot>
|
|
9
|
-
<input
|
|
10
|
-
ref="input"
|
|
11
|
-
v-bind="innerInputProps"
|
|
12
|
-
v-model="inputTextData"
|
|
13
|
-
@input="emit('input', $event)" />
|
|
14
|
-
<!-- autoclear text button -->
|
|
15
|
-
<button
|
|
16
|
-
v-if="autoclear && textLength > 0"
|
|
17
|
-
class="vv-button vv-button--ghost"
|
|
18
|
-
@click="clearInputText">
|
|
19
|
-
<vv-icon name="clear-field" />
|
|
20
|
-
</button>
|
|
21
|
-
<!-- @slot icon-right to replace icon right -->
|
|
22
|
-
<slot name="icon-right" v-bind="iconSlotProps">
|
|
23
|
-
<template v-if="isPassword">
|
|
24
|
-
<PasswordInputActions
|
|
25
|
-
@action-password-on="showPassword = true"
|
|
26
|
-
@action-password-off="showPassword = false" />
|
|
27
|
-
</template>
|
|
28
|
-
<template v-else-if="isNumber">
|
|
29
|
-
<NumberInputActions
|
|
30
|
-
@action-step-up="stepUp"
|
|
31
|
-
@action-step-down="stepDown" />
|
|
32
|
-
</template>
|
|
33
|
-
<template v-else-if="hasIconRight || defaultRightIcon">
|
|
34
|
-
<vv-icon :name="icon || defaultRightIcon" />
|
|
35
|
-
</template>
|
|
36
|
-
</slot>
|
|
37
|
-
<span v-if="limit" class="vv-input-text__limit">
|
|
38
|
-
<slot name="limit"> {{ formattedTextLimitLength }} </slot>
|
|
39
|
-
</span>
|
|
40
|
-
</div>
|
|
41
|
-
<HintSlot :id="inputTextDescribedBy" class="vv-input-text__hint" />
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export default {
|
|
3
|
+
name: 'VvInputText',
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
44
6
|
|
|
45
7
|
<script setup lang="ts">
|
|
46
|
-
import {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} from '
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
import
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
//
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
props.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
8
|
+
import {
|
|
9
|
+
computed,
|
|
10
|
+
useSlots,
|
|
11
|
+
ref,
|
|
12
|
+
toRefs,
|
|
13
|
+
unref,
|
|
14
|
+
watch,
|
|
15
|
+
type InputHTMLAttributes,
|
|
16
|
+
} from 'vue'
|
|
17
|
+
import { useElementVisibility } from '@vueuse/core'
|
|
18
|
+
import { nanoid } from 'nanoid'
|
|
19
|
+
import { isEmpty } from '@/utils/ObjectUtilities'
|
|
20
|
+
import HintSlotFactory from '@/components/common/HintSlot'
|
|
21
|
+
import { useComponentIcon } from '@/composables/useComponentIcons'
|
|
22
|
+
import { useComponentFocus } from '@/composables/useComponentFocus'
|
|
23
|
+
import { useDebouncedInput } from '@/composables/useDebouncedInput'
|
|
24
|
+
import { useTextCount } from '@/composables/useTextCount'
|
|
25
|
+
import { useBemModifiers } from '@/composables/useModifiers'
|
|
26
|
+
import VvIcon from '@/components/VvIcon/VvIcon.vue'
|
|
27
|
+
import VvInputTextActionsFactory from '@/components/VvInputText/VvInputTextActions'
|
|
28
|
+
import {
|
|
29
|
+
VvInputTextEvents,
|
|
30
|
+
VvInputTextProps,
|
|
31
|
+
INPUT_TYPES,
|
|
32
|
+
TYPES_ICON,
|
|
33
|
+
} from '@/components/VvInputText'
|
|
34
|
+
|
|
35
|
+
// props, emit, slots and attrs
|
|
36
|
+
const props = defineProps(VvInputTextProps)
|
|
37
|
+
const emit = defineEmits(VvInputTextEvents)
|
|
38
|
+
const slots = useSlots()
|
|
39
|
+
|
|
40
|
+
// template refs
|
|
41
|
+
const input = ref()
|
|
42
|
+
|
|
43
|
+
// data
|
|
44
|
+
const {
|
|
45
|
+
icon,
|
|
46
|
+
iconPosition,
|
|
47
|
+
label,
|
|
48
|
+
modelValue,
|
|
49
|
+
count,
|
|
50
|
+
valid,
|
|
51
|
+
invalid,
|
|
52
|
+
loading,
|
|
53
|
+
} = toRefs(props)
|
|
54
|
+
const hasId = computed(() => String(props.id || nanoid()))
|
|
55
|
+
const hasDescribedBy = computed(() => `${hasId.value}-hint`)
|
|
56
|
+
// BUG: https://www.samanthaming.com/tidbits/88-css-placeholder-shown/
|
|
57
|
+
const inputTextPlaceholder = computed(() =>
|
|
58
|
+
props.floating && isEmpty(props.placeholder) ? ' ' : props.placeholder,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
// debounce
|
|
62
|
+
const localModelValue = useDebouncedInput(modelValue, emit, props.debounce)
|
|
63
|
+
|
|
64
|
+
// focus
|
|
65
|
+
const { focused } = useComponentFocus(input, emit)
|
|
66
|
+
|
|
67
|
+
// visibility
|
|
68
|
+
const isVisible = useElementVisibility(input)
|
|
69
|
+
watch(isVisible, (newValue) => {
|
|
70
|
+
if (newValue && props.autofocus) {
|
|
71
|
+
focused.value = true
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
// password
|
|
76
|
+
const showPassword = ref(false)
|
|
77
|
+
const isPassword = computed(() => props.type === INPUT_TYPES.PASSWORD)
|
|
78
|
+
const onTogglePassword = () => {
|
|
79
|
+
showPassword.value = !showPassword.value
|
|
111
80
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
81
|
+
|
|
82
|
+
// time, datetime and date
|
|
83
|
+
const isDateTime = computed(
|
|
84
|
+
() =>
|
|
85
|
+
props.type === INPUT_TYPES.TIME ||
|
|
86
|
+
props.type === INPUT_TYPES.DATETIME_LOCAL ||
|
|
87
|
+
props.type === INPUT_TYPES.DATE ||
|
|
88
|
+
props.type === INPUT_TYPES.WEEK ||
|
|
89
|
+
props.type === INPUT_TYPES.MONTH,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
// number
|
|
93
|
+
const isNumber = computed(() => props.type === INPUT_TYPES.NUMBER)
|
|
94
|
+
const onStepUp = () => {
|
|
95
|
+
if (isClickable.value) {
|
|
96
|
+
input.value.stepUp()
|
|
97
|
+
localModelValue.value = unref(input).value
|
|
98
|
+
}
|
|
118
99
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
iconRight: slots['icon-right']
|
|
125
|
-
})
|
|
126
|
-
const defaultRightIcon = computed(() => {
|
|
127
|
-
switch (props.type) {
|
|
128
|
-
case INPUT.TYPES.PASSWORD:
|
|
129
|
-
return INPUT.TYPES_ICON.PASSWORD_OFF
|
|
130
|
-
case INPUT.TYPES.COLOR:
|
|
131
|
-
return INPUT.TYPES_ICON.COLOR
|
|
132
|
-
case INPUT.TYPES.DATE:
|
|
133
|
-
case INPUT.TYPES.DATETIME_LOCAL:
|
|
134
|
-
return INPUT.TYPES_ICON.DATE
|
|
135
|
-
case INPUT.TYPES.TIME:
|
|
136
|
-
return INPUT.TYPES_ICON.TIME
|
|
137
|
-
case INPUT.TYPES.SEARCH:
|
|
138
|
-
return INPUT.TYPES_ICON.SEARCH
|
|
139
|
-
default:
|
|
140
|
-
return ''
|
|
100
|
+
const onStepDown = () => {
|
|
101
|
+
if (isClickable.value) {
|
|
102
|
+
input.value.stepDown()
|
|
103
|
+
localModelValue.value = unref(input).value
|
|
104
|
+
}
|
|
141
105
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
//Component computed
|
|
154
|
-
const isActionsDisabled = computed(() => props.disabled || props.readonly)
|
|
155
|
-
|
|
156
|
-
//Styles & Bindings
|
|
157
|
-
const inputTextClass = computed(() => {
|
|
158
|
-
const _hasIconRigth =
|
|
159
|
-
hasIconRight.value || ObjectUtilities.isNotEmpty(defaultRightIcon.value)
|
|
160
|
-
const _isFloating =
|
|
161
|
-
props.floating && ObjectUtilities.isNotEmpty(props.label)
|
|
162
|
-
const _isDirty = ObjectUtilities.isNotEmpty(modelValue?.value)
|
|
163
|
-
|
|
164
|
-
return [
|
|
165
|
-
toBem('vv-input-text', {
|
|
166
|
-
modifiers: props.modifiers,
|
|
167
|
-
readonly: props.readonly,
|
|
168
|
-
valid: props.valid,
|
|
169
|
-
invalid: props.error,
|
|
170
|
-
loading: props.loading,
|
|
171
|
-
iconLeft: hasIconLeft,
|
|
172
|
-
iconRight: _hasIconRigth,
|
|
173
|
-
floating: _isFloating,
|
|
174
|
-
dirty: _isDirty
|
|
175
|
-
}),
|
|
176
|
-
attrs.class
|
|
177
|
-
]
|
|
178
|
-
})
|
|
179
|
-
const vvInputTextProps = computed(() => {
|
|
180
|
-
const { style } = attrs
|
|
181
|
-
const dataAttrs = ObjectUtilities.pickBy(attrs, (k: string) =>
|
|
182
|
-
k.startsWith('data-')
|
|
106
|
+
|
|
107
|
+
// search
|
|
108
|
+
const isSearch = computed(() => props.type === INPUT_TYPES.SEARCH)
|
|
109
|
+
const onClear = () => {
|
|
110
|
+
localModelValue.value = undefined
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// icons
|
|
114
|
+
const { hasIconLeft, hasIconRight, hasIcon } = useComponentIcon(
|
|
115
|
+
icon,
|
|
116
|
+
iconPosition,
|
|
183
117
|
)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
118
|
+
const defaultRightIcon = computed(() => {
|
|
119
|
+
switch (props.type) {
|
|
120
|
+
case INPUT_TYPES.COLOR:
|
|
121
|
+
return { name: TYPES_ICON.COLOR }
|
|
122
|
+
case INPUT_TYPES.DATE:
|
|
123
|
+
case INPUT_TYPES.DATETIME_LOCAL:
|
|
124
|
+
case INPUT_TYPES.WEEK:
|
|
125
|
+
case INPUT_TYPES.MONTH:
|
|
126
|
+
return { name: TYPES_ICON.DATE }
|
|
127
|
+
case INPUT_TYPES.TIME:
|
|
128
|
+
return { name: TYPES_ICON.TIME }
|
|
129
|
+
default:
|
|
130
|
+
return ''
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
// count
|
|
135
|
+
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
136
|
+
mode: props.count,
|
|
137
|
+
upperLimit: props.maxlength,
|
|
138
|
+
lowerLimit: props.minlength,
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
// tabindex
|
|
142
|
+
const isClickable = computed(() => !props.disabled && !props.readonly)
|
|
143
|
+
const hasTabindex = computed(() =>
|
|
144
|
+
isClickable.value ? props.tabindex : -1,
|
|
193
145
|
)
|
|
194
146
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
147
|
+
// dirty
|
|
148
|
+
const isDirty = computed(() => !isEmpty(modelValue))
|
|
149
|
+
|
|
150
|
+
// invalid
|
|
151
|
+
const isInvalid = computed(() => {
|
|
152
|
+
if (invalid.value === true) {
|
|
153
|
+
return true
|
|
154
|
+
}
|
|
155
|
+
if (valid.value === true) {
|
|
156
|
+
return false
|
|
157
|
+
}
|
|
158
|
+
return undefined
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
// styles
|
|
162
|
+
const { bemCssClasses } = useBemModifiers('vv-input-text', {
|
|
163
|
+
modifiers: props.modifiers,
|
|
164
|
+
valid,
|
|
165
|
+
invalid,
|
|
166
|
+
loading,
|
|
201
167
|
disabled: props.disabled,
|
|
202
168
|
readonly: props.readonly,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
'aria-valid': !props.valid,
|
|
210
|
-
'aria-labeledby': inputTextLabeledBy,
|
|
211
|
-
'aria-describedby': inputTextDescribedBy,
|
|
212
|
-
'aria-errormessage': inputTextDescribedBy,
|
|
213
|
-
...ariaAttrs
|
|
214
|
-
} as InputHTMLAttributes
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
//Slot props
|
|
218
|
-
const iconSlotProps = computed(() => {
|
|
219
|
-
const { modelValue, valid, error } = props
|
|
220
|
-
return {
|
|
221
|
-
valid,
|
|
222
|
-
error,
|
|
223
|
-
modelValue
|
|
224
|
-
}
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
//Other components
|
|
228
|
-
const HintSlot = HintSlotFactory(props, slots)
|
|
229
|
-
const PasswordInputActions = VvInputTextActionsFactory(
|
|
230
|
-
INPUT.TYPES.PASSWORD,
|
|
231
|
-
props
|
|
232
|
-
)
|
|
233
|
-
const NumberInputActions = VvInputTextActionsFactory(INPUT.TYPES.NUMBER, props)
|
|
234
|
-
|
|
235
|
-
//Methods
|
|
236
|
-
function clearInputText() {
|
|
237
|
-
inputTextData.value = null
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
onMounted(() => {
|
|
241
|
-
if (props.autofocus) focused.value = true
|
|
242
|
-
console.log('Focused', focused.value)
|
|
243
|
-
})
|
|
244
|
-
</script>
|
|
169
|
+
iconLeft: hasIconLeft,
|
|
170
|
+
iconRight: hasIconRight.value || !isEmpty(defaultRightIcon),
|
|
171
|
+
floating: props.floating && !isEmpty(props.label),
|
|
172
|
+
dirty: isDirty,
|
|
173
|
+
focus: focused,
|
|
174
|
+
})
|
|
245
175
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
176
|
+
// attrs
|
|
177
|
+
const hasAttrs = computed(() => {
|
|
178
|
+
const type = (() => {
|
|
179
|
+
if (isPassword.value && showPassword.value) {
|
|
180
|
+
return INPUT_TYPES.TEXT
|
|
181
|
+
}
|
|
182
|
+
if (isDateTime.value && !isDirty.value && !focused.value) {
|
|
183
|
+
return INPUT_TYPES.TEXT
|
|
184
|
+
}
|
|
185
|
+
return props.type
|
|
186
|
+
})()
|
|
187
|
+
const toReturn: InputHTMLAttributes = {
|
|
188
|
+
type,
|
|
189
|
+
name: props.name,
|
|
190
|
+
tabindex: hasTabindex.value,
|
|
191
|
+
disabled: props.disabled,
|
|
192
|
+
readonly: props.readonly,
|
|
193
|
+
required: props.required,
|
|
194
|
+
autocomplete: props.autocomplete,
|
|
195
|
+
'aria-invalid': isInvalid.value,
|
|
196
|
+
'aria-describedby':
|
|
197
|
+
!hasInvalid.value && hasHint.value
|
|
198
|
+
? hasDescribedBy.value
|
|
199
|
+
: undefined,
|
|
200
|
+
'aria-errormessage': hasInvalid.value
|
|
201
|
+
? hasDescribedBy.value
|
|
202
|
+
: undefined,
|
|
203
|
+
}
|
|
204
|
+
if (
|
|
205
|
+
type === INPUT_TYPES.DATE ||
|
|
206
|
+
type === INPUT_TYPES.MONTH ||
|
|
207
|
+
type === INPUT_TYPES.WEEK ||
|
|
208
|
+
type === INPUT_TYPES.TIME ||
|
|
209
|
+
type === INPUT_TYPES.DATETIME_LOCAL ||
|
|
210
|
+
type === INPUT_TYPES.NUMBER
|
|
211
|
+
) {
|
|
212
|
+
toReturn.step = props.step
|
|
213
|
+
toReturn.max = String(props.max)
|
|
214
|
+
toReturn.min = String(props.min)
|
|
215
|
+
}
|
|
216
|
+
if (
|
|
217
|
+
type === INPUT_TYPES.TEXT ||
|
|
218
|
+
type === INPUT_TYPES.SEARCH ||
|
|
219
|
+
type === INPUT_TYPES.URL ||
|
|
220
|
+
type === INPUT_TYPES.TEL ||
|
|
221
|
+
type === INPUT_TYPES.EMAIL ||
|
|
222
|
+
type === INPUT_TYPES.PASSWORD ||
|
|
223
|
+
type === INPUT_TYPES.NUMBER
|
|
224
|
+
) {
|
|
225
|
+
toReturn.placeholder = inputTextPlaceholder.value
|
|
226
|
+
}
|
|
227
|
+
if (
|
|
228
|
+
type === INPUT_TYPES.TEXT ||
|
|
229
|
+
type === INPUT_TYPES.SEARCH ||
|
|
230
|
+
type === INPUT_TYPES.URL ||
|
|
231
|
+
type === INPUT_TYPES.TEL ||
|
|
232
|
+
type === INPUT_TYPES.EMAIL ||
|
|
233
|
+
type === INPUT_TYPES.PASSWORD
|
|
234
|
+
) {
|
|
235
|
+
toReturn.minlength = props.minlength
|
|
236
|
+
toReturn.maxlength = props.maxlength
|
|
237
|
+
toReturn.pattern = props.pattern
|
|
238
|
+
}
|
|
239
|
+
if (type === INPUT_TYPES.EMAIL) {
|
|
240
|
+
toReturn.multiple = props.multiple
|
|
241
|
+
}
|
|
242
|
+
return toReturn
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
// slots
|
|
246
|
+
const slotProps = computed(() => ({
|
|
247
|
+
valid: props.valid,
|
|
248
|
+
invalid: props.invalid,
|
|
249
|
+
modelValue: props.modelValue,
|
|
250
|
+
togglePassword: onTogglePassword,
|
|
251
|
+
stepUp: onStepUp,
|
|
252
|
+
stepDown: onStepDown,
|
|
253
|
+
clear: onClear,
|
|
254
|
+
}))
|
|
255
|
+
|
|
256
|
+
// components
|
|
257
|
+
const { HintSlot, hasHint, hasInvalid } = HintSlotFactory(props, slots)
|
|
258
|
+
const PasswordInputActions = VvInputTextActionsFactory(
|
|
259
|
+
INPUT_TYPES.PASSWORD,
|
|
260
|
+
props,
|
|
261
|
+
)
|
|
262
|
+
const NumberInputActions = VvInputTextActionsFactory(
|
|
263
|
+
INPUT_TYPES.NUMBER,
|
|
264
|
+
props,
|
|
265
|
+
)
|
|
266
|
+
const SearchInputActions = VvInputTextActionsFactory(
|
|
267
|
+
INPUT_TYPES.SEARCH,
|
|
268
|
+
props,
|
|
269
|
+
)
|
|
250
270
|
</script>
|
|
271
|
+
|
|
272
|
+
<template>
|
|
273
|
+
<div :class="bemCssClasses">
|
|
274
|
+
<label v-if="label" :for="hasId" class="vv-input-text__label">
|
|
275
|
+
{{ label }}
|
|
276
|
+
</label>
|
|
277
|
+
<div class="vv-input-text__wrapper">
|
|
278
|
+
<!-- @slot Slot to replace left icon -->
|
|
279
|
+
<slot name="before" v-bind="slotProps">
|
|
280
|
+
<VvIcon
|
|
281
|
+
v-if="hasIconLeft"
|
|
282
|
+
class="vv-input-text__icon-left"
|
|
283
|
+
v-bind="hasIcon"
|
|
284
|
+
/>
|
|
285
|
+
</slot>
|
|
286
|
+
<input
|
|
287
|
+
:id="hasId"
|
|
288
|
+
ref="input"
|
|
289
|
+
v-model="localModelValue"
|
|
290
|
+
v-bind="hasAttrs"
|
|
291
|
+
@keyup="emit('keyup', $event)"
|
|
292
|
+
/>
|
|
293
|
+
<!-- @slot Slot to replace right icon -->
|
|
294
|
+
<slot name="after" v-bind="slotProps">
|
|
295
|
+
<VvIcon
|
|
296
|
+
v-if="hasIconRight || defaultRightIcon"
|
|
297
|
+
v-bind="hasIconRight ? hasIcon : defaultRightIcon"
|
|
298
|
+
/>
|
|
299
|
+
<PasswordInputActions
|
|
300
|
+
v-else-if="isPassword"
|
|
301
|
+
@toggle-password="onTogglePassword"
|
|
302
|
+
/>
|
|
303
|
+
<NumberInputActions
|
|
304
|
+
v-else-if="isNumber"
|
|
305
|
+
@step-up="onStepUp"
|
|
306
|
+
@step-down="onStepDown"
|
|
307
|
+
/>
|
|
308
|
+
<SearchInputActions v-else-if="isSearch" @clear="onClear" />
|
|
309
|
+
</slot>
|
|
310
|
+
<span v-if="count" class="vv-input-text__limit">
|
|
311
|
+
<!-- @slot Slot to replace count -->
|
|
312
|
+
<slot name="count" v-bind="slotProps">
|
|
313
|
+
{{ countFormatted }}
|
|
314
|
+
</slot>
|
|
315
|
+
</span>
|
|
316
|
+
</div>
|
|
317
|
+
<HintSlot :id="hasDescribedBy" class="vv-input-text__hint" />
|
|
318
|
+
</div>
|
|
319
|
+
</template>
|