@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
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { unref as s, toRefs as j, computed as i, h as ie, watch as J, defineComponent as U, ref as W, inject as ue, openBlock as w, createBlock as R, mergeProps as k, createCommentVNode as C, useSlots as se, createElementBlock as D, normalizeClass as ce, toDisplayString as z, createElementVNode as M, renderSlot as O, normalizeProps as _, guardReactiveProps as E, withDirectives as de, isRef as fe, vModelText as ve, createTextVNode as me, createVNode as ge } from "vue";
|
|
2
|
+
import { nanoid as he } from "nanoid";
|
|
3
|
+
import { toReactive as pe, useFocus as ye, useElementVisibility as be } from "@vueuse/core";
|
|
4
|
+
import { iconExists as B, Icon as Se, addIcon as we } from "@iconify/vue";
|
|
5
|
+
function q(r, t) {
|
|
6
|
+
if (r && Object.keys(r).length && t) {
|
|
7
|
+
if (t.indexOf(".") === -1)
|
|
8
|
+
return r[t];
|
|
9
|
+
{
|
|
10
|
+
const e = t.split(".");
|
|
11
|
+
let u = r;
|
|
12
|
+
for (let l = 0, d = e.length; l < d; ++l) {
|
|
13
|
+
if (r == null)
|
|
14
|
+
return null;
|
|
15
|
+
u = u[e[l]];
|
|
16
|
+
}
|
|
17
|
+
return u;
|
|
18
|
+
}
|
|
19
|
+
} else
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
function N(r) {
|
|
23
|
+
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(s(r));
|
|
24
|
+
}
|
|
25
|
+
function Ie(r) {
|
|
26
|
+
return typeof r == "string" || r instanceof String;
|
|
27
|
+
}
|
|
28
|
+
function Z(r) {
|
|
29
|
+
var t, e;
|
|
30
|
+
if (r)
|
|
31
|
+
return (e = (t = r.match(
|
|
32
|
+
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
33
|
+
)) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
|
|
34
|
+
}
|
|
35
|
+
function A(r) {
|
|
36
|
+
return Array.isArray(r) ? r.filter((t) => Ie(t)).join(" ") : r;
|
|
37
|
+
}
|
|
38
|
+
function Pe(r, t) {
|
|
39
|
+
const {
|
|
40
|
+
invalid: e,
|
|
41
|
+
valid: u,
|
|
42
|
+
hint: l,
|
|
43
|
+
loading: d
|
|
44
|
+
} = t, {
|
|
45
|
+
hintLabel: a,
|
|
46
|
+
modelValue: h,
|
|
47
|
+
valid: m,
|
|
48
|
+
validLabel: f,
|
|
49
|
+
invalid: n,
|
|
50
|
+
invalidLabel: o,
|
|
51
|
+
...g
|
|
52
|
+
} = j(r), c = q(g, "loading"), v = q(g, "loadingLabel"), y = i(() => n.value ? !!(n.value && e || o != null && o.value && Array.isArray(o.value) && o.value.length > 0 || o != null && o.value && !N(o)) : !1), p = i(
|
|
53
|
+
() => !!(a && a.value || l)
|
|
54
|
+
), b = i(
|
|
55
|
+
() => !!(f && f.value || u)
|
|
56
|
+
), I = i(
|
|
57
|
+
() => !!(c != null && c.value && d || c != null && c.value && (v != null && v.value))
|
|
58
|
+
), $ = i(
|
|
59
|
+
() => p.value || b.value || y.value || I.value
|
|
60
|
+
);
|
|
61
|
+
return {
|
|
62
|
+
hasInvalid: y,
|
|
63
|
+
hasHint: p,
|
|
64
|
+
hasValid: b,
|
|
65
|
+
hasLoading: I,
|
|
66
|
+
HintSlot: {
|
|
67
|
+
name: "HintSlot",
|
|
68
|
+
props: {
|
|
69
|
+
params: {
|
|
70
|
+
type: Object,
|
|
71
|
+
default: () => ({})
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
setup(x) {
|
|
75
|
+
const F = i(() => {
|
|
76
|
+
const S = pe({
|
|
77
|
+
hintLabel: a,
|
|
78
|
+
modelValue: h,
|
|
79
|
+
valid: m,
|
|
80
|
+
validLabel: f,
|
|
81
|
+
invalid: n,
|
|
82
|
+
invalidLabel: o,
|
|
83
|
+
loading: c,
|
|
84
|
+
loadingLabel: v,
|
|
85
|
+
...x.params
|
|
86
|
+
});
|
|
87
|
+
return n != null && n.value ? (e == null ? void 0 : e(S)) || A(o == null ? void 0 : o.value) || (a == null ? void 0 : a.value) : m != null && m.value ? (u == null ? void 0 : u(S)) || A(f == null ? void 0 : f.value) || (a == null ? void 0 : a.value) : c != null && c.value ? (d == null ? void 0 : d(S)) || A(v == null ? void 0 : v.value) || (a == null ? void 0 : a.value) : (l == null ? void 0 : l(S)) || A(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
isVisible: $,
|
|
91
|
+
hasInvalid: y,
|
|
92
|
+
hasValid: b,
|
|
93
|
+
hintContent: F
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
render() {
|
|
97
|
+
if (this.isVisible)
|
|
98
|
+
return ie(
|
|
99
|
+
"small",
|
|
100
|
+
{
|
|
101
|
+
role: this.hasInvalid || this.hasValid ? "alert" : void 0
|
|
102
|
+
},
|
|
103
|
+
this.hintContent
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function Ce(r, t, e) {
|
|
110
|
+
const u = i(
|
|
111
|
+
() => !!(r != null && r.value && t.value === "left" || e != null && e.iconLeft)
|
|
112
|
+
), l = i(
|
|
113
|
+
() => !!(r != null && r.value && t.value === "right" || e != null && e.iconRight)
|
|
114
|
+
), d = i(
|
|
115
|
+
() => !!(r != null && r.value && t.value === "top" || e != null && e.iconTop)
|
|
116
|
+
), a = i(
|
|
117
|
+
() => !!(r != null && r.value && t.value === "bottom" || e != null && e.iconBottom)
|
|
118
|
+
);
|
|
119
|
+
return {
|
|
120
|
+
hasIcon: i(() => typeof (r == null ? void 0 : r.value) == "string" ? { name: r == null ? void 0 : r.value } : r == null ? void 0 : r.value),
|
|
121
|
+
hasIconLeft: u,
|
|
122
|
+
hasIconRight: l,
|
|
123
|
+
hasIconTop: d,
|
|
124
|
+
hasIconBottom: a
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function $e(r, t) {
|
|
128
|
+
const { focused: e } = ye(r);
|
|
129
|
+
return J(e, (u) => {
|
|
130
|
+
t(u ? "focus" : "blur", s(r));
|
|
131
|
+
}), {
|
|
132
|
+
focused: e
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function xe(r, t, e = 0) {
|
|
136
|
+
let u;
|
|
137
|
+
return typeof e == "string" && (e = parseInt(e)), i({
|
|
138
|
+
get: () => r == null ? void 0 : r.value,
|
|
139
|
+
set: (l) => {
|
|
140
|
+
u && clearTimeout(u), u = setTimeout(() => {
|
|
141
|
+
t("update:modelValue", l);
|
|
142
|
+
}, e);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function Ve(r, t) {
|
|
147
|
+
const e = i(() => (s(r) ?? "").length), u = i(() => (t == null ? void 0 : t.lowerLimit) !== void 0 && e.value < (t == null ? void 0 : t.lowerLimit) ? e.value - t.lowerLimit : (t == null ? void 0 : t.upperLimit) !== void 0 && e.value < (t == null ? void 0 : t.upperLimit) ? t.upperLimit - e.value : 0), l = i(() => (t == null ? void 0 : t.mode) === !1 ? "" : (t == null ? void 0 : t.mode) === "limit" && (t != null && t.upperLimit) ? `${e.value} / ${t.lowerLimit ? `${t.lowerLimit}-` : ""}${t.upperLimit}` : (t == null ? void 0 : t.mode) === "countdown" ? u.value === 0 ? void 0 : u : e.value);
|
|
148
|
+
return {
|
|
149
|
+
length: e,
|
|
150
|
+
gap: u,
|
|
151
|
+
formatted: l
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function X(r, t) {
|
|
155
|
+
const e = { [`${r}`]: !0 };
|
|
156
|
+
return {
|
|
157
|
+
bemCssClasses: i(() => Object.keys(t).reduce((l, d) => {
|
|
158
|
+
const a = s(t[d]) || !1;
|
|
159
|
+
if (!a)
|
|
160
|
+
return l;
|
|
161
|
+
if (d === "modifiers") {
|
|
162
|
+
const h = Array.isArray(a) ? a : a.split(" ");
|
|
163
|
+
return {
|
|
164
|
+
...l,
|
|
165
|
+
...h.reduce(
|
|
166
|
+
(m, f) => ({
|
|
167
|
+
...m,
|
|
168
|
+
[`${r}--${Z(f)}`]: !0
|
|
169
|
+
}),
|
|
170
|
+
{}
|
|
171
|
+
)
|
|
172
|
+
};
|
|
173
|
+
} else
|
|
174
|
+
return {
|
|
175
|
+
...l,
|
|
176
|
+
[`${r}--${Z(d)}`]: a
|
|
177
|
+
};
|
|
178
|
+
}, e) || {})
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
const _e = "ds", Be = {
|
|
182
|
+
color: String,
|
|
183
|
+
width: {
|
|
184
|
+
type: [String, Number]
|
|
185
|
+
},
|
|
186
|
+
height: {
|
|
187
|
+
type: [String, Number]
|
|
188
|
+
},
|
|
189
|
+
name: {
|
|
190
|
+
type: String,
|
|
191
|
+
required: !0
|
|
192
|
+
},
|
|
193
|
+
provider: {
|
|
194
|
+
type: String
|
|
195
|
+
},
|
|
196
|
+
prefix: {
|
|
197
|
+
type: String,
|
|
198
|
+
default: "normal"
|
|
199
|
+
},
|
|
200
|
+
src: String,
|
|
201
|
+
horizontalFlip: Boolean,
|
|
202
|
+
verticalFlip: Boolean,
|
|
203
|
+
flip: String,
|
|
204
|
+
mode: String,
|
|
205
|
+
inline: Boolean,
|
|
206
|
+
rotate: [Number, String],
|
|
207
|
+
onLoad: Function,
|
|
208
|
+
svg: String,
|
|
209
|
+
modifiers: {
|
|
210
|
+
type: [String, Array]
|
|
211
|
+
}
|
|
212
|
+
}, Ae = {
|
|
213
|
+
name: "VvIcon"
|
|
214
|
+
}, G = /* @__PURE__ */ U({
|
|
215
|
+
...Ae,
|
|
216
|
+
props: Be,
|
|
217
|
+
setup(r) {
|
|
218
|
+
const t = r, e = W(!0), { modifiers: u } = j(t), l = ue(_e), { bemCssClasses: d } = X("vv-icon", {
|
|
219
|
+
modifiers: u
|
|
220
|
+
}), a = i(() => t.provider || (l == null ? void 0 : l.provider)), h = i(() => {
|
|
221
|
+
const n = t.name ?? "", o = `@${a.value}:${t.prefix}:${t.name}`;
|
|
222
|
+
return B(n) ? n : B(o) ? o : (l == null ? void 0 : l.iconsCollections.find((g) => {
|
|
223
|
+
const c = `@${a.value}:${g.prefix}:${n}`;
|
|
224
|
+
if (B(c))
|
|
225
|
+
return c;
|
|
226
|
+
})) || n;
|
|
227
|
+
});
|
|
228
|
+
function m(n) {
|
|
229
|
+
let o = null;
|
|
230
|
+
if (typeof window > "u") {
|
|
231
|
+
const { JSDOM: y } = require("jsdom");
|
|
232
|
+
o = new y().window;
|
|
233
|
+
}
|
|
234
|
+
return (o ? new o.DOMParser() : new window.DOMParser()).parseFromString(n, "text/html").querySelector("svg");
|
|
235
|
+
}
|
|
236
|
+
function f(n) {
|
|
237
|
+
const o = m(n), g = (o == null ? void 0 : o.innerHTML.trim()) || "";
|
|
238
|
+
o && g && we(`@${a.value}:${t.prefix}:${t.name}`, {
|
|
239
|
+
body: g,
|
|
240
|
+
height: o.viewBox.baseVal.height,
|
|
241
|
+
width: o.viewBox.baseVal.width
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
return l && (t.src && !B(`@${a.value}:${t.prefix}:${t.name}`) ? (e.value = !1, l.fetchIcon(t.src).then((n) => {
|
|
245
|
+
n && (f(n), e.value = !0);
|
|
246
|
+
}).catch((n) => {
|
|
247
|
+
throw new Error(`During fetch icon: ${n == null ? void 0 : n.message}`);
|
|
248
|
+
})) : t.svg && f(t.svg)), (n, o) => e.value ? (w(), R(s(Se), k({
|
|
249
|
+
key: 0,
|
|
250
|
+
class: s(d)
|
|
251
|
+
}, {
|
|
252
|
+
inline: n.inline,
|
|
253
|
+
width: n.width,
|
|
254
|
+
height: n.height,
|
|
255
|
+
horizontalFlip: n.horizontalFlip,
|
|
256
|
+
verticalFlip: n.verticalFlip,
|
|
257
|
+
flip: n.flip,
|
|
258
|
+
rotate: n.rotate,
|
|
259
|
+
color: n.color,
|
|
260
|
+
onLoad: n.onLoad,
|
|
261
|
+
icon: s(h)
|
|
262
|
+
}), null, 16, ["class"])) : C("", !0);
|
|
263
|
+
}
|
|
264
|
+
}), ke = {
|
|
265
|
+
valid: Boolean,
|
|
266
|
+
validLabel: [String, Array]
|
|
267
|
+
}, Ne = {
|
|
268
|
+
invalid: Boolean,
|
|
269
|
+
invalidLabel: [String, Array]
|
|
270
|
+
}, Fe = {
|
|
271
|
+
loading: Boolean,
|
|
272
|
+
loadingLabel: String
|
|
273
|
+
}, Le = {
|
|
274
|
+
disabled: Boolean
|
|
275
|
+
}, Te = {
|
|
276
|
+
readonly: Boolean
|
|
277
|
+
}, De = {
|
|
278
|
+
modifiers: [String, Array]
|
|
279
|
+
}, Oe = {
|
|
280
|
+
hintLabel: { type: String, default: "" }
|
|
281
|
+
}, Ee = {
|
|
282
|
+
count: {
|
|
283
|
+
type: [Boolean, String],
|
|
284
|
+
default: !1,
|
|
285
|
+
validator: (r) => [!0, !1, "limit", "countdown"].includes(r)
|
|
286
|
+
}
|
|
287
|
+
}, Re = {
|
|
288
|
+
debounce: [Number, String]
|
|
289
|
+
}, K = {
|
|
290
|
+
LEFT: "left",
|
|
291
|
+
RIGHT: "right"
|
|
292
|
+
}, je = {
|
|
293
|
+
icon: { type: [String, Object] },
|
|
294
|
+
iconPosition: {
|
|
295
|
+
type: String,
|
|
296
|
+
validation: (r) => Object.values(K).includes(r),
|
|
297
|
+
default: K.RIGHT
|
|
298
|
+
}
|
|
299
|
+
}, He = {
|
|
300
|
+
tabindex: { type: [String, Number], default: 0 }
|
|
301
|
+
}, ze = {
|
|
302
|
+
floating: Boolean
|
|
303
|
+
}, Me = {
|
|
304
|
+
id: [String, Number],
|
|
305
|
+
name: { type: String, required: !0 }
|
|
306
|
+
}, qe = {
|
|
307
|
+
autofocus: Boolean
|
|
308
|
+
}, Ze = {
|
|
309
|
+
autocomplete: { type: String, default: "off" }
|
|
310
|
+
}, Ge = {
|
|
311
|
+
...Me,
|
|
312
|
+
...qe,
|
|
313
|
+
...Ze,
|
|
314
|
+
...He,
|
|
315
|
+
...Le,
|
|
316
|
+
...Te,
|
|
317
|
+
...ke,
|
|
318
|
+
...Ne,
|
|
319
|
+
...Oe,
|
|
320
|
+
...Fe,
|
|
321
|
+
...De,
|
|
322
|
+
...Ee,
|
|
323
|
+
...Re,
|
|
324
|
+
...je,
|
|
325
|
+
...ze,
|
|
326
|
+
minlength: Number,
|
|
327
|
+
maxlength: Number,
|
|
328
|
+
placeholder: String,
|
|
329
|
+
required: Boolean,
|
|
330
|
+
label: String
|
|
331
|
+
}, Ke = {
|
|
332
|
+
hard: "hard",
|
|
333
|
+
soft: "soft"
|
|
334
|
+
}, Je = {
|
|
335
|
+
true: !0,
|
|
336
|
+
false: !1,
|
|
337
|
+
default: "default"
|
|
338
|
+
}, Ue = ["update:modelValue", "focus", "blur", "keyup"], We = {
|
|
339
|
+
...Ge,
|
|
340
|
+
modelValue: String,
|
|
341
|
+
cols: { type: [String, Number], default: 20 },
|
|
342
|
+
rows: { type: [String, Number], default: 2 },
|
|
343
|
+
wrap: { type: String, default: Ke.soft },
|
|
344
|
+
spellcheck: { type: [Boolean, String], default: Je.default },
|
|
345
|
+
resizable: Boolean
|
|
346
|
+
}, Xe = ["for"], Qe = { class: "vv-textarea__wrapper" }, Ye = ["id"], et = {
|
|
347
|
+
key: 0,
|
|
348
|
+
class: "vv-textarea__limit"
|
|
349
|
+
}, tt = {
|
|
350
|
+
name: "VvTextarea"
|
|
351
|
+
}, ot = /* @__PURE__ */ U({
|
|
352
|
+
...tt,
|
|
353
|
+
props: We,
|
|
354
|
+
emits: Ue,
|
|
355
|
+
setup(r, { emit: t }) {
|
|
356
|
+
const e = r, u = se(), l = W(), {
|
|
357
|
+
icon: d,
|
|
358
|
+
iconPosition: a,
|
|
359
|
+
label: h,
|
|
360
|
+
modelValue: m,
|
|
361
|
+
count: f,
|
|
362
|
+
valid: n,
|
|
363
|
+
invalid: o,
|
|
364
|
+
loading: g
|
|
365
|
+
} = j(e), c = i(() => String(e.id || he())), v = i(() => `${c.value}-hint`), y = i(
|
|
366
|
+
() => e.floating && N(e.placeholder) ? " " : e.placeholder
|
|
367
|
+
), p = xe(m, t, e.debounce), { hasIcon: b, hasIconLeft: I, hasIconRight: $ } = Ce(
|
|
368
|
+
d,
|
|
369
|
+
a
|
|
370
|
+
), { focused: x } = $e(l, t), F = be(l);
|
|
371
|
+
J(F, (P) => {
|
|
372
|
+
P && e.autofocus && (x.value = !0);
|
|
373
|
+
});
|
|
374
|
+
const { formatted: S } = Ve(p, {
|
|
375
|
+
mode: e.count,
|
|
376
|
+
upperLimit: e.maxlength,
|
|
377
|
+
lowerLimit: e.minlength
|
|
378
|
+
}), Q = i(() => !e.disabled && !e.readonly), Y = i(
|
|
379
|
+
() => Q.value ? e.tabindex : -1
|
|
380
|
+
), ee = i(() => !N(m)), te = i(() => {
|
|
381
|
+
if (e.invalid === !0)
|
|
382
|
+
return !0;
|
|
383
|
+
if (e.valid === !0)
|
|
384
|
+
return !1;
|
|
385
|
+
}), { HintSlot: re, hasHint: ne, hasInvalid: H } = Pe(e, u), { bemCssClasses: ae } = X("vv-textarea", {
|
|
386
|
+
modifiers: e.modifiers,
|
|
387
|
+
valid: n,
|
|
388
|
+
invalid: o,
|
|
389
|
+
loading: g,
|
|
390
|
+
disabled: e.disabled,
|
|
391
|
+
readonly: e.readonly,
|
|
392
|
+
iconLeft: I,
|
|
393
|
+
iconRight: $,
|
|
394
|
+
floating: e.floating && !N(e.label),
|
|
395
|
+
dirty: ee,
|
|
396
|
+
focused: x,
|
|
397
|
+
resizable: e.resizable
|
|
398
|
+
}), le = i(
|
|
399
|
+
() => ({
|
|
400
|
+
name: e.name,
|
|
401
|
+
placeholder: y.value,
|
|
402
|
+
tabindex: Y.value,
|
|
403
|
+
disabled: e.disabled,
|
|
404
|
+
readonly: e.readonly,
|
|
405
|
+
required: e.required,
|
|
406
|
+
autocomplete: e.autocomplete,
|
|
407
|
+
minlength: e.minlength,
|
|
408
|
+
maxlength: e.maxlength,
|
|
409
|
+
cols: e.cols,
|
|
410
|
+
rows: e.rows,
|
|
411
|
+
wrap: e.wrap,
|
|
412
|
+
spellcheck: e.spellcheck,
|
|
413
|
+
"aria-invalid": te.value,
|
|
414
|
+
"aria-describedby": !H.value && ne.value ? v.value : void 0,
|
|
415
|
+
"aria-errormessage": H.value ? v.value : void 0
|
|
416
|
+
})
|
|
417
|
+
), L = i(() => ({
|
|
418
|
+
valid: e.valid,
|
|
419
|
+
invalid: e.invalid,
|
|
420
|
+
modelValue: e.modelValue,
|
|
421
|
+
hintLabel: e.hintLabel,
|
|
422
|
+
maxlength: e.maxlength,
|
|
423
|
+
minlength: e.minlength,
|
|
424
|
+
clear: oe
|
|
425
|
+
})), oe = () => {
|
|
426
|
+
p.value = void 0;
|
|
427
|
+
};
|
|
428
|
+
return (P, V) => (w(), D("div", {
|
|
429
|
+
class: ce(s(ae))
|
|
430
|
+
}, [
|
|
431
|
+
s(h) ? (w(), D("label", {
|
|
432
|
+
key: 0,
|
|
433
|
+
for: s(c),
|
|
434
|
+
class: "vv-textarea__label"
|
|
435
|
+
}, z(s(h)), 9, Xe)) : C("", !0),
|
|
436
|
+
M("div", Qe, [
|
|
437
|
+
O(P.$slots, "before", _(E(s(L))), () => [
|
|
438
|
+
s(I) ? (w(), R(G, k({
|
|
439
|
+
key: 0,
|
|
440
|
+
class: "vv-textarea__icon-left"
|
|
441
|
+
}, s(b)), null, 16)) : C("", !0)
|
|
442
|
+
]),
|
|
443
|
+
de(M("textarea", k({
|
|
444
|
+
id: s(c),
|
|
445
|
+
ref_key: "textarea",
|
|
446
|
+
ref: l,
|
|
447
|
+
"onUpdate:modelValue": V[0] || (V[0] = (T) => fe(p) ? p.value = T : null)
|
|
448
|
+
}, s(le), {
|
|
449
|
+
onKeyup: V[1] || (V[1] = (T) => t("keyup", T))
|
|
450
|
+
}), null, 16, Ye), [
|
|
451
|
+
[ve, s(p)]
|
|
452
|
+
]),
|
|
453
|
+
O(P.$slots, "after", _(E(s(L))), () => [
|
|
454
|
+
s($) ? (w(), R(G, _(k({ key: 0 }, s(b))), null, 16)) : C("", !0)
|
|
455
|
+
]),
|
|
456
|
+
s(f) ? (w(), D("span", et, [
|
|
457
|
+
O(P.$slots, "count", _(E(s(L))), () => [
|
|
458
|
+
me(z(s(S)), 1)
|
|
459
|
+
])
|
|
460
|
+
])) : C("", !0)
|
|
461
|
+
]),
|
|
462
|
+
ge(s(re), {
|
|
463
|
+
id: s(v),
|
|
464
|
+
class: "vv-textarea__hint"
|
|
465
|
+
}, null, 8, ["id"])
|
|
466
|
+
], 2));
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
export {
|
|
470
|
+
ot as default
|
|
471
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,w){typeof exports=="object"&&typeof module<"u"?module.exports=w(require("vue"),require("nanoid"),require("@vueuse/core"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core","@iconify/vue"],w):(e=typeof globalThis<"u"?globalThis:e||self,e.VvTextarea=w(e.vue,e.nanoid,e.core,e.vue$1))})(this,function(e,w,_,b){"use strict";function T(n,r){if(n&&Object.keys(n).length&&r){if(r.indexOf(".")===-1)return n[r];{const t=r.split(".");let s=n;for(let l=0,u=t.length;l<u;++l){if(n==null)return null;s=s[t[l]]}return s}}else return null}function x(n){return(r=>r==null||r===""||Array.isArray(r)&&r.length===0||!(r instanceof Date)&&typeof r=="object"&&Object.keys(r).length===0)(e.unref(n))}function O(n){return typeof n=="string"||n instanceof String}function E(n){var r,t;if(n)return(t=(r=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:r.join("-"))==null?void 0:t.toLowerCase()}function B(n){return Array.isArray(n)?n.filter(r=>O(r)).join(" "):n}function j(n,r){const{invalid:t,valid:s,hint:l,loading:u}=r,{hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:i,...p}=e.toRefs(n),c=T(p,"loading"),f=T(p,"loadingLabel"),y=e.computed(()=>o.value?!!(o.value&&t||i!=null&&i.value&&Array.isArray(i.value)&&i.value.length>0||i!=null&&i.value&&!x(i)):!1),h=e.computed(()=>!!(a&&a.value||l)),S=e.computed(()=>!!(d&&d.value||s)),I=e.computed(()=>!!(c!=null&&c.value&&u||c!=null&&c.value&&(f!=null&&f.value))),V=e.computed(()=>h.value||S.value||y.value||I.value);return{hasInvalid:y,hasHint:h,hasValid:S,hasLoading:I,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(k){const N=e.computed(()=>{const P=_.toReactive({hintLabel:a,modelValue:g,valid:m,validLabel:d,invalid:o,invalidLabel:i,loading:c,loadingLabel:f,...k.params});return o!=null&&o.value?(t==null?void 0:t(P))||B(i==null?void 0:i.value)||(a==null?void 0:a.value):m!=null&&m.value?(s==null?void 0:s(P))||B(d==null?void 0:d.value)||(a==null?void 0:a.value):c!=null&&c.value?(u==null?void 0:u(P))||B(f==null?void 0:f.value)||(a==null?void 0:a.value):(l==null?void 0:l(P))||B(a==null?void 0:a.value)||(a==null?void 0:a.value)});return{isVisible:V,hasInvalid:y,hasValid:S,hintContent:N}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid||this.hasValid?"alert":void 0},this.hintContent)}}}}function z(n,r,t){const s=e.computed(()=>!!(n!=null&&n.value&&r.value==="left"||t!=null&&t.iconLeft)),l=e.computed(()=>!!(n!=null&&n.value&&r.value==="right"||t!=null&&t.iconRight)),u=e.computed(()=>!!(n!=null&&n.value&&r.value==="top"||t!=null&&t.iconTop)),a=e.computed(()=>!!(n!=null&&n.value&&r.value==="bottom"||t!=null&&t.iconBottom));return{hasIcon:e.computed(()=>typeof(n==null?void 0:n.value)=="string"?{name:n==null?void 0:n.value}:n==null?void 0:n.value),hasIconLeft:s,hasIconRight:l,hasIconTop:u,hasIconBottom:a}}function q(n,r){const{focused:t}=_.useFocus(n);return e.watch(t,s=>{r(s?"focus":"blur",e.unref(n))}),{focused:t}}function H(n,r,t=0){let s;return typeof t=="string"&&(t=parseInt(t)),e.computed({get:()=>n==null?void 0:n.value,set:l=>{s&&clearTimeout(s),s=setTimeout(()=>{r("update:modelValue",l)},t)}})}function M(n,r){const t=e.computed(()=>(e.unref(n)??"").length),s=e.computed(()=>(r==null?void 0:r.lowerLimit)!==void 0&&t.value<(r==null?void 0:r.lowerLimit)?t.value-r.lowerLimit:(r==null?void 0:r.upperLimit)!==void 0&&t.value<(r==null?void 0:r.upperLimit)?r.upperLimit-t.value:0),l=e.computed(()=>(r==null?void 0:r.mode)===!1?"":(r==null?void 0:r.mode)==="limit"&&(r!=null&&r.upperLimit)?`${t.value} / ${r.lowerLimit?`${r.lowerLimit}-`:""}${r.upperLimit}`:(r==null?void 0:r.mode)==="countdown"?s.value===0?void 0:s:t.value);return{length:t,gap:s,formatted:l}}function F(n,r){const t={[`${n}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(r).reduce((l,u)=>{const a=e.unref(r[u])||!1;if(!a)return l;if(u==="modifiers"){const g=Array.isArray(a)?a:a.split(" ");return{...l,...g.reduce((m,d)=>({...m,[`${n}--${E(d)}`]:!0}),{})}}else return{...l,[`${n}--${E(u)}`]:a}},t)||{})}}const Z="ds",G={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}},K={name:"VvIcon"},L=e.defineComponent({...K,props:G,setup(n){const r=n,t=e.ref(!0),{modifiers:s}=e.toRefs(r),l=e.inject(Z),{bemCssClasses:u}=F("vv-icon",{modifiers:s}),a=e.computed(()=>r.provider||(l==null?void 0:l.provider)),g=e.computed(()=>{const o=r.name??"",i=`@${a.value}:${r.prefix}:${r.name}`;return b.iconExists(o)?o:b.iconExists(i)?i:(l==null?void 0:l.iconsCollections.find(p=>{const c=`@${a.value}:${p.prefix}:${o}`;if(b.iconExists(c))return c}))||o});function m(o){let i=null;if(typeof window>"u"){const{JSDOM:y}=require("jsdom");i=new y().window}return(i?new i.DOMParser:new window.DOMParser).parseFromString(o,"text/html").querySelector("svg")}function d(o){const i=m(o),p=(i==null?void 0:i.innerHTML.trim())||"";i&&p&&b.addIcon(`@${a.value}:${r.prefix}:${r.name}`,{body:p,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return l&&(r.src&&!b.iconExists(`@${a.value}:${r.prefix}:${r.name}`)?(t.value=!1,l.fetchIcon(r.src).then(o=>{o&&(d(o),t.value=!0)}).catch(o=>{throw new Error(`During fetch icon: ${o==null?void 0:o.message}`)})):r.svg&&d(r.svg)),(o,i)=>t.value?(e.openBlock(),e.createBlock(e.unref(b.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(g)}),null,16,["class"])):e.createCommentVNode("",!0)}}),J={valid:Boolean,validLabel:[String,Array]},U={invalid:Boolean,invalidLabel:[String,Array]},W={loading:Boolean,loadingLabel:String},X={disabled:Boolean},Q={readonly:Boolean},Y={modifiers:[String,Array]},ee={hintLabel:{type:String,default:""}},te={count:{type:[Boolean,String],default:!1,validator:n=>[!0,!1,"limit","countdown"].includes(n)}},re={debounce:[Number,String]},R={LEFT:"left",RIGHT:"right"},ne={icon:{type:[String,Object]},iconPosition:{type:String,validation:n=>Object.values(R).includes(n),default:R.RIGHT}},oe={...{id:[String,Number],name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...{tabindex:{type:[String,Number],default:0}},...X,...Q,...J,...U,...ee,...W,...Y,...te,...re,...ne,...{floating:Boolean},minlength:Number,maxlength:Number,placeholder:String,required:Boolean,label:String},ae={hard:"hard",soft:"soft"},le={true:!0,false:!1,default:"default"},ie=["update:modelValue","focus","blur","keyup"],se={...oe,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:ae.soft},spellcheck:{type:[Boolean,String],default:le.default},resizable:Boolean},ce=["for"],ue={class:"vv-textarea__wrapper"},de=["id"],fe={key:0,class:"vv-textarea__limit"},me={name:"VvTextarea"};return e.defineComponent({...me,props:se,emits:ie,setup(n,{emit:r}){const t=n,s=e.useSlots(),l=e.ref(),{icon:u,iconPosition:a,label:g,modelValue:m,count:d,valid:o,invalid:i,loading:p}=e.toRefs(t),c=e.computed(()=>String(t.id||w.nanoid())),f=e.computed(()=>`${c.value}-hint`),y=e.computed(()=>t.floating&&x(t.placeholder)?" ":t.placeholder),h=H(m,r,t.debounce),{hasIcon:S,hasIconLeft:I,hasIconRight:V}=z(u,a),{focused:k}=q(l,r),N=_.useElementVisibility(l);e.watch(N,C=>{C&&t.autofocus&&(k.value=!0)});const{formatted:P}=M(h,{mode:t.count,upperLimit:t.maxlength,lowerLimit:t.minlength}),pe=e.computed(()=>!t.disabled&&!t.readonly),ge=e.computed(()=>pe.value?t.tabindex:-1),he=e.computed(()=>!x(m)),ye=e.computed(()=>{if(t.invalid===!0)return!0;if(t.valid===!0)return!1}),{HintSlot:be,hasHint:Se,hasInvalid:D}=j(t,s),{bemCssClasses:Pe}=F("vv-textarea",{modifiers:t.modifiers,valid:o,invalid:i,loading:p,disabled:t.disabled,readonly:t.readonly,iconLeft:I,iconRight:V,floating:t.floating&&!x(t.label),dirty:he,focused:k,resizable:t.resizable}),we=e.computed(()=>({name:t.name,placeholder:y.value,tabindex:ge.value,disabled:t.disabled,readonly:t.readonly,required:t.required,autocomplete:t.autocomplete,minlength:t.minlength,maxlength:t.maxlength,cols:t.cols,rows:t.rows,wrap:t.wrap,spellcheck:t.spellcheck,"aria-invalid":ye.value,"aria-describedby":!D.value&&Se.value?f.value:void 0,"aria-errormessage":D.value?f.value:void 0})),$=e.computed(()=>({valid:t.valid,invalid:t.invalid,modelValue:t.modelValue,hintLabel:t.hintLabel,maxlength:t.maxlength,minlength:t.minlength,clear:Ie})),Ie=()=>{h.value=void 0};return(C,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Pe))},[e.unref(g)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(c),class:"vv-textarea__label"},e.toDisplayString(e.unref(g)),9,ce)):e.createCommentVNode("",!0),e.createElementVNode("div",ue,[e.renderSlot(C.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.unref(I)?(e.openBlock(),e.createBlock(L,e.mergeProps({key:0,class:"vv-textarea__icon-left"},e.unref(S)),null,16)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(c),ref_key:"textarea",ref:l,"onUpdate:modelValue":v[0]||(v[0]=A=>e.isRef(h)?h.value=A:null)},e.unref(we),{onKeyup:v[1]||(v[1]=A=>r("keyup",A))}),null,16,de),[[e.vModelText,e.unref(h)]]),e.renderSlot(C.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.unref(V)?(e.openBlock(),e.createBlock(L,e.normalizeProps(e.mergeProps({key:0},e.unref(S))),null,16)):e.createCommentVNode("",!0)]),e.unref(d)?(e.openBlock(),e.createElementBlock("span",fe,[e.renderSlot(C.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref($))),()=>[e.createTextVNode(e.toDisplayString(e.unref(P)),1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(be),{id:e.unref(f),class:"vv-textarea__hint"},null,8,["id"])],2))}})});
|