@antify/ui-module 1.6.0 → 1.7.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/dist/module.d.mts +182 -51
- package/dist/module.d.ts +182 -51
- package/dist/module.json +1 -1
- package/dist/module.mjs +152 -49
- package/dist/runtime/components/AntAccordion.vue +10 -5
- package/dist/runtime/components/AntAccordionItem.vue +19 -7
- package/dist/runtime/components/AntAlert.vue +27 -27
- package/dist/runtime/components/AntCard.vue +34 -0
- package/dist/runtime/components/AntDropdown.vue +2 -2
- package/dist/runtime/components/AntIcon.vue +21 -16
- package/dist/runtime/components/AntKeycap.vue +26 -5
- package/dist/runtime/components/AntListGroupItem.vue +24 -28
- package/dist/runtime/components/AntModal.vue +5 -5
- package/dist/runtime/components/AntPagination.vue +45 -45
- package/dist/runtime/components/AntPopover.vue +3 -3
- package/dist/runtime/components/AntSpinner.vue +56 -50
- package/dist/runtime/components/AntTag.vue +75 -40
- package/dist/runtime/components/AntToast.vue +40 -31
- package/dist/runtime/components/AntToaster.vue +14 -9
- package/dist/runtime/components/AntTooltip.vue +75 -69
- package/dist/runtime/components/__stories/AntAccordion.stories.mjs +3 -2
- package/dist/runtime/components/__stories/AntAlert.stories.mjs +3 -3
- package/dist/runtime/components/__stories/AntCard.stories.d.ts +7 -0
- package/dist/runtime/components/__stories/AntCard.stories.mjs +87 -0
- package/dist/runtime/components/__stories/AntIcon.stories.mjs +7 -4
- package/dist/runtime/components/__stories/AntKeycap.stories.mjs +8 -1
- package/dist/runtime/components/__stories/AntListGroupItem.stories.mjs +3 -3
- package/dist/runtime/components/__stories/AntModal.stories.mjs +2 -2
- package/dist/runtime/components/__stories/AntSpinner.stories.mjs +7 -7
- package/dist/runtime/components/__stories/AntTag.stories.mjs +5 -6
- package/dist/runtime/components/__stories/AntToast.stories.mjs +3 -3
- package/dist/runtime/components/__stories/AntToaster.stories.d.ts +2 -2
- package/dist/runtime/components/__stories/AntToaster.stories.mjs +4 -4
- package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +5 -0
- package/dist/runtime/components/__stories/AntTooltip.stories.mjs +35 -11
- package/dist/runtime/components/__types/AntIcon.types.d.ts +5 -3
- package/dist/runtime/components/__types/AntIcon.types.mjs +5 -3
- package/dist/runtime/components/__types/AntKeycap.types.d.ts +4 -0
- package/dist/runtime/components/__types/AntKeycap.types.mjs +5 -0
- package/dist/runtime/components/__types/AntListGroupItem.types.d.ts +9 -0
- package/dist/runtime/components/__types/AntListGroupItem.types.mjs +10 -0
- package/dist/runtime/components/__types/AntSpinner.types.d.ts +10 -0
- package/dist/runtime/components/__types/AntSpinner.types.mjs +11 -0
- package/dist/runtime/components/__types/AntTag.types.d.ts +17 -0
- package/dist/runtime/components/__types/AntTag.types.mjs +19 -0
- package/dist/runtime/components/__types/AntToaster.types.d.ts +2 -2
- package/dist/runtime/components/__types/index.d.ts +6 -1
- package/dist/runtime/components/__types/index.mjs +6 -1
- package/dist/runtime/components/buttons/AntActionButton.vue +26 -23
- package/dist/runtime/components/buttons/AntButton.vue +85 -75
- package/dist/runtime/components/buttons/AntCreateButton.vue +2 -2
- package/dist/runtime/components/buttons/AntDeleteButton.vue +2 -2
- package/dist/runtime/components/buttons/AntDuplicateButton.vue +2 -2
- package/dist/runtime/components/buttons/AntEditButton.vue +2 -2
- package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +14 -13
- package/dist/runtime/components/buttons/AntSaveButton.vue +13 -12
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +15 -11
- package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +39 -36
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +1 -1
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +1 -1
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +1 -1
- package/dist/runtime/components/buttons/__stories/AntEditButton.stories.mjs +1 -1
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +1 -1
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +1 -1
- package/dist/runtime/components/buttons/__types/index.d.ts +1 -1
- package/dist/runtime/components/buttons/__types/index.mjs +1 -1
- package/dist/runtime/components/crud/AntCrudDetailActions.vue +2 -2
- package/dist/runtime/components/crud/AntCrudDetailNav.vue +10 -3
- package/dist/runtime/components/crud/AntCrudTableFilter.vue +14 -14
- package/dist/runtime/components/crud/AntCrudTableNav.vue +27 -27
- package/dist/runtime/components/crud/__stories/AntCrud.stories.mjs +1 -1
- package/dist/runtime/components/dialogs/AntDeleteDialog.vue +3 -3
- package/dist/runtime/components/dialogs/AntDialog.vue +23 -23
- package/dist/runtime/components/dialogs/__stories/AndDeleteDialog.stories.mjs +3 -1
- package/dist/runtime/components/dialogs/__stories/AntDialog.stories.mjs +4 -4
- package/dist/runtime/components/forms/AntField.vue +123 -0
- package/dist/runtime/components/forms/AntFormGroupLabel.vue +5 -0
- package/dist/runtime/components/{form/Elements → forms}/__stories/AntField.stories.mjs +15 -15
- package/dist/runtime/components/{form → forms}/__stories/AntFormGroup.stories.mjs +3 -3
- package/dist/runtime/components/{form → forms}/__stories/AntFormGroupLabel.stories.mjs +1 -1
- package/dist/runtime/components/index.d.ts +46 -6
- package/dist/runtime/components/index.mjs +90 -7
- package/dist/runtime/components/inputs/AntCheckbox.vue +183 -0
- package/dist/runtime/components/inputs/AntCheckboxGroup.vue +117 -0
- package/dist/runtime/components/inputs/AntDateInput.vue +97 -0
- package/{src/runtime/components/form → dist/runtime/components/inputs}/AntNumberInput.vue +28 -50
- package/dist/runtime/components/inputs/AntPasswordInput.vue +107 -0
- package/dist/runtime/components/inputs/AntRadio.vue +192 -0
- package/dist/runtime/components/inputs/AntRadioGroup.vue +116 -0
- package/dist/runtime/components/inputs/AntRangeSlider.vue +101 -0
- package/{src/runtime/components/form → dist/runtime/components/inputs}/AntSearch.vue +17 -21
- package/dist/runtime/components/{form → inputs}/AntSelect.vue +68 -60
- package/dist/runtime/components/inputs/AntSwitch.vue +192 -0
- package/dist/runtime/components/inputs/AntSwitcher.vue +196 -0
- package/{src/runtime/components/form → dist/runtime/components/inputs}/AntTagInput.vue +94 -69
- package/dist/runtime/components/inputs/AntTextInput.vue +72 -0
- package/dist/runtime/components/{form → inputs}/AntTextarea.vue +53 -41
- package/dist/runtime/components/{form → inputs}/AntUnitInput.vue +17 -23
- package/dist/runtime/components/inputs/Elements/AntBaseInput.vue +256 -0
- package/dist/runtime/components/{form → inputs}/Elements/AntDropDown.vue +29 -30
- package/dist/runtime/components/{form → inputs}/Elements/AntInputDescription.vue +17 -14
- package/dist/runtime/components/inputs/Elements/AntInputLabel.vue +65 -0
- package/dist/runtime/components/inputs/Elements/AntInputLimiter.vue +58 -0
- package/dist/runtime/components/{form → inputs}/Elements/__stories/AntBaseInput.stories.d.ts +2 -0
- package/dist/runtime/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +234 -0
- package/dist/runtime/components/{form → inputs}/Elements/__stories/AntInputDescription.stories.mjs +5 -5
- package/dist/runtime/components/{form → inputs}/Elements/__stories/AntInputLabel.stories.mjs +3 -3
- package/dist/runtime/components/{form → inputs}/Elements/__stories/AntInputLimiter.stories.mjs +5 -5
- package/dist/runtime/components/inputs/Elements/__types/index.d.ts +1 -0
- package/dist/runtime/components/inputs/Elements/__types/index.mjs +1 -0
- package/dist/runtime/components/{form → inputs}/Elements/index.d.ts +1 -1
- package/dist/runtime/components/{form → inputs}/Elements/index.mjs +1 -1
- package/dist/runtime/components/inputs/__stories/AntCheckbox.stories.mjs +341 -0
- package/dist/runtime/components/{form/AntCheckboxWidget → inputs}/__stories/AntCheckboxGroup.stories.mjs +23 -34
- package/dist/runtime/components/inputs/__stories/AntDateInput.stories.d.ts +8 -0
- package/dist/runtime/components/inputs/__stories/AntDateInput.stories.mjs +193 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntNumberInput.stories.d.ts +2 -1
- package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.mjs +106 -0
- package/dist/runtime/components/inputs/__stories/AntPasswordInput.stories.d.ts +8 -0
- package/dist/runtime/components/inputs/__stories/AntPasswordInput.stories.mjs +156 -0
- package/dist/runtime/components/{form/AntRadioWidget → inputs}/__stories/AntRadioGroup.stories.d.ts +1 -1
- package/dist/runtime/components/inputs/__stories/AntRadioGroup.stories.mjs +243 -0
- package/dist/runtime/components/inputs/__stories/AntRangeSlider.stories.d.ts +7 -0
- package/dist/runtime/components/inputs/__stories/AntRangeSlider.stories.mjs +67 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntSearch.stories.d.ts +1 -0
- package/dist/runtime/components/inputs/__stories/AntSearch.stories.mjs +103 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntSelect.stories.mjs +78 -46
- package/dist/runtime/components/{form → inputs}/__stories/AntSwitch.stories.d.ts +1 -1
- package/dist/runtime/components/inputs/__stories/AntSwitch.stories.mjs +344 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntSwitcher.stories.d.ts +1 -1
- package/dist/runtime/components/inputs/__stories/AntSwitcher.stories.mjs +235 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntTagInput.stories.d.ts +3 -3
- package/dist/runtime/components/inputs/__stories/AntTagInput.stories.mjs +228 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntTextInput.stories.d.ts +2 -0
- package/dist/runtime/components/inputs/__stories/AntTextInput.stories.mjs +225 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntTextarea.stories.d.ts +1 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntTextarea.stories.mjs +44 -31
- package/dist/runtime/components/{form → inputs}/__stories/AntUnitInput.stories.d.ts +1 -0
- package/dist/runtime/components/{form → inputs}/__stories/AntUnitInput.stories.mjs +49 -17
- package/dist/runtime/components/{form/AntCheckboxWidget/__types/AntCheckbox.d.ts → inputs/__types/AntCheckbox.types.d.ts} +4 -0
- package/dist/runtime/components/inputs/__types/AntCheckbox.types.mjs +5 -0
- package/dist/runtime/components/inputs/__types/AntDateInput.types.d.ts +7 -0
- package/dist/runtime/components/inputs/__types/AntDateInput.types.mjs +8 -0
- package/dist/runtime/components/inputs/__types/AntRadio.types.d.ts +13 -0
- package/dist/runtime/components/inputs/__types/AntRadio.types.mjs +5 -0
- package/dist/runtime/components/inputs/__types/AntTagInput.types.d.ts +5 -0
- package/dist/runtime/components/inputs/__types/AntTagInput.types.mjs +6 -0
- package/dist/runtime/components/{form/__types/AntTextInput.type.d.ts → inputs/__types/AntTextInput.types.d.ts} +0 -1
- package/dist/runtime/components/{form/__types/AntTextInput.type.mjs → inputs/__types/AntTextInput.types.mjs} +0 -1
- package/dist/runtime/components/inputs/__types/index.d.ts +7 -0
- package/dist/runtime/components/inputs/__types/index.mjs +7 -0
- package/dist/runtime/components/layouts/AntNavLeftLayout.vue +3 -3
- package/dist/runtime/components/navbar/AntNavbar.vue +10 -10
- package/dist/runtime/components/navbar/AntNavbarItem.vue +5 -5
- package/dist/runtime/components/navbar/__types/{NavbarItem.d.ts → NavbarItem.types.d.ts} +2 -2
- package/dist/runtime/components/navbar/__types/index.d.ts +1 -0
- package/dist/runtime/components/navbar/__types/index.mjs +1 -0
- package/dist/runtime/components/table/AntTable.vue +10 -6
- package/dist/runtime/components/table/AntTableSortButton.vue +37 -27
- package/dist/runtime/components/table/AntTd.vue +21 -10
- package/dist/runtime/components/table/AntTh.vue +21 -14
- package/dist/runtime/components/table/__stories/AntTable.stories.mjs +35 -36
- package/dist/runtime/components/table/__types/{TableHeader.type.d.ts → TableHeader.types.d.ts} +5 -0
- package/dist/runtime/components/table/__types/{TableHeader.type.mjs → TableHeader.types.mjs} +6 -0
- package/dist/runtime/components/table/__types/index.d.ts +1 -0
- package/dist/runtime/components/table/__types/index.mjs +1 -0
- package/dist/runtime/components/tabs/AntTabItem.vue +34 -34
- package/dist/runtime/components/tabs/__stories/AntTabItem.stories.mjs +4 -4
- package/dist/runtime/components/tabs/__stories/AntTabs.stories.mjs +3 -3
- package/dist/runtime/components/tabs/__types/AntTabItem.types.d.ts +2 -2
- package/dist/runtime/components/tabs/__types/AntTabItem.types.mjs +6 -6
- package/dist/runtime/components/tabs/__types/index.d.ts +1 -0
- package/dist/runtime/components/tabs/__types/index.mjs +1 -0
- package/dist/runtime/composables/useUi.d.ts +6 -6
- package/dist/runtime/composables/useUi.mjs +8 -8
- package/dist/runtime/enums/Size.enum.d.ts +4 -1
- package/dist/runtime/enums/Size.enum.mjs +4 -1
- package/dist/runtime/enums/{ColorType.enum.d.ts → State.enum.d.ts} +2 -2
- package/dist/runtime/enums/State.enum.mjs +18 -0
- package/dist/runtime/enums/index.d.ts +2 -1
- package/dist/runtime/enums/index.mjs +2 -1
- package/dist/runtime/plugins/toaster.d.ts +2 -2
- package/dist/runtime/plugins/toaster.mjs +5 -5
- package/dist/runtime/plugins/ui-module.mjs +1 -1
- package/dist/runtime/tailwind.config.d.ts +1 -181
- package/dist/runtime/tailwind.config.mjs +3 -0
- package/dist/runtime/types.d.ts +5 -4
- package/dist/runtime/types.mjs +5 -4
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/runtime/components/AntAccordion.vue +10 -5
- package/src/runtime/components/AntAccordionItem.vue +19 -7
- package/src/runtime/components/AntAlert.vue +27 -27
- package/src/runtime/components/AntCard.vue +34 -0
- package/src/runtime/components/AntDropdown.vue +2 -2
- package/src/runtime/components/AntIcon.vue +21 -16
- package/src/runtime/components/AntKeycap.vue +26 -5
- package/src/runtime/components/AntListGroupItem.vue +24 -28
- package/src/runtime/components/AntModal.vue +5 -5
- package/src/runtime/components/AntPagination.vue +45 -45
- package/src/runtime/components/AntPopover.vue +3 -3
- package/src/runtime/components/AntSpinner.vue +56 -50
- package/src/runtime/components/AntTag.vue +75 -40
- package/src/runtime/components/AntToast.vue +40 -31
- package/src/runtime/components/AntToaster.vue +16 -17
- package/src/runtime/components/AntTooltip.vue +75 -69
- package/src/runtime/components/buttons/AntActionButton.vue +26 -23
- package/src/runtime/components/buttons/AntButton.vue +85 -75
- package/src/runtime/components/buttons/AntCreateButton.vue +2 -2
- package/src/runtime/components/buttons/AntDeleteButton.vue +2 -2
- package/src/runtime/components/buttons/AntDuplicateButton.vue +2 -2
- package/src/runtime/components/buttons/AntEditButton.vue +2 -2
- package/src/runtime/components/buttons/AntSaveAndNewButton.vue +14 -13
- package/src/runtime/components/buttons/AntSaveButton.vue +13 -12
- package/src/runtime/components/crud/AntCrudDetailActions.vue +2 -2
- package/src/runtime/components/crud/AntCrudDetailNav.vue +10 -3
- package/src/runtime/components/crud/AntCrudTableFilter.vue +14 -14
- package/src/runtime/components/crud/AntCrudTableNav.vue +27 -27
- package/src/runtime/components/dialogs/AntDeleteDialog.vue +3 -3
- package/src/runtime/components/dialogs/AntDialog.vue +23 -23
- package/src/runtime/components/forms/AntField.vue +123 -0
- package/src/runtime/components/forms/AntFormGroupLabel.vue +5 -0
- package/src/runtime/components/inputs/AntCheckbox.vue +202 -0
- package/src/runtime/components/inputs/AntCheckboxGroup.vue +117 -0
- package/src/runtime/components/inputs/AntDateInput.vue +97 -0
- package/{dist/runtime/components/form → src/runtime/components/inputs}/AntNumberInput.vue +28 -50
- package/src/runtime/components/inputs/AntPasswordInput.vue +107 -0
- package/src/runtime/components/inputs/AntRadio.vue +200 -0
- package/src/runtime/components/inputs/AntRadioGroup.vue +116 -0
- package/src/runtime/components/inputs/AntRangeSlider.vue +121 -0
- package/{dist/runtime/components/form → src/runtime/components/inputs}/AntSearch.vue +17 -21
- package/src/runtime/components/{form → inputs}/AntSelect.vue +68 -60
- package/src/runtime/components/inputs/AntSwitch.vue +192 -0
- package/src/runtime/components/inputs/AntSwitcher.vue +196 -0
- package/{dist/runtime/components/form → src/runtime/components/inputs}/AntTagInput.vue +94 -69
- package/src/runtime/components/inputs/AntTextInput.vue +72 -0
- package/src/runtime/components/{form → inputs}/AntTextarea.vue +53 -41
- package/src/runtime/components/{form → inputs}/AntUnitInput.vue +17 -23
- package/src/runtime/components/inputs/Elements/AntBaseInput.vue +304 -0
- package/src/runtime/components/{form → inputs}/Elements/AntDropDown.vue +29 -30
- package/src/runtime/components/{form → inputs}/Elements/AntInputDescription.vue +17 -14
- package/src/runtime/components/inputs/Elements/AntInputLabel.vue +65 -0
- package/src/runtime/components/inputs/Elements/AntInputLimiter.vue +58 -0
- package/src/runtime/components/layouts/AntNavLeftLayout.vue +3 -3
- package/src/runtime/components/navbar/AntNavbar.vue +10 -10
- package/src/runtime/components/navbar/AntNavbarItem.vue +5 -5
- package/src/runtime/components/table/AntTable.vue +10 -6
- package/src/runtime/components/table/AntTableSortButton.vue +37 -27
- package/src/runtime/components/table/AntTd.vue +21 -10
- package/src/runtime/components/table/AntTh.vue +21 -14
- package/src/runtime/components/tabs/AntTabItem.vue +34 -34
- package/dist/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +0 -144
- package/dist/runtime/components/form/AntCheckboxWidget/AntCheckboxGroup.vue +0 -91
- package/dist/runtime/components/form/AntCheckboxWidget/__stories/AntCheckbox.stories.mjs +0 -289
- package/dist/runtime/components/form/AntFormGroupLabel.vue +0 -5
- package/dist/runtime/components/form/AntRadioWidget/AntRadio.vue +0 -139
- package/dist/runtime/components/form/AntRadioWidget/AntRadioGroup.vue +0 -80
- package/dist/runtime/components/form/AntRadioWidget/__stories/AntRadio.stories.d.ts +0 -8
- package/dist/runtime/components/form/AntRadioWidget/__stories/AntRadio.stories.mjs +0 -79
- package/dist/runtime/components/form/AntRadioWidget/__stories/AntRadioGroup.stories.mjs +0 -125
- package/dist/runtime/components/form/AntRadioWidget/__types/AntRadio.type.d.ts +0 -9
- package/dist/runtime/components/form/AntRangeSlider.vue +0 -81
- package/dist/runtime/components/form/AntSwitch.vue +0 -153
- package/dist/runtime/components/form/AntSwitcher.vue +0 -184
- package/dist/runtime/components/form/AntTextInput.vue +0 -73
- package/dist/runtime/components/form/Elements/AntBaseInput.vue +0 -220
- package/dist/runtime/components/form/Elements/AntField.vue +0 -105
- package/dist/runtime/components/form/Elements/AntInputLabel.vue +0 -55
- package/dist/runtime/components/form/Elements/AntInputLimiter.vue +0 -55
- package/dist/runtime/components/form/Elements/__stories/AntBaseInput.stories.mjs +0 -171
- package/dist/runtime/components/form/Elements/__types/index.d.ts +0 -1
- package/dist/runtime/components/form/Elements/__types/index.mjs +0 -1
- package/dist/runtime/components/form/__stories/AntNumberInput.stories.mjs +0 -74
- package/dist/runtime/components/form/__stories/AntRangeSlider.stories.d.ts +0 -6
- package/dist/runtime/components/form/__stories/AntRangeSlider.stories.mjs +0 -40
- package/dist/runtime/components/form/__stories/AntSearch.stories.mjs +0 -43
- package/dist/runtime/components/form/__stories/AntSwitch.stories.mjs +0 -218
- package/dist/runtime/components/form/__stories/AntSwitcher.stories.mjs +0 -228
- package/dist/runtime/components/form/__stories/AntTagInput.stories.mjs +0 -106
- package/dist/runtime/components/form/__stories/AntTextInput.stories.mjs +0 -68
- package/dist/runtime/components/form/__types/AntSwitcher.type.mjs +0 -0
- package/dist/runtime/components/form/__types/index.d.ts +0 -3
- package/dist/runtime/components/form/__types/index.mjs +0 -3
- package/dist/runtime/components/form/index.d.ts +0 -12
- package/dist/runtime/components/form/index.mjs +0 -24
- package/dist/runtime/components/navbar/__types/NavbarItem.mjs +0 -0
- package/dist/runtime/enums/ColorType.enum.mjs +0 -18
- package/dist/runtime/types/AntListGroupItem.type.d.ts +0 -11
- package/dist/runtime/types/AntListGroupItem.type.mjs +0 -12
- package/dist/runtime/types/AntTag.type.d.ts +0 -7
- package/dist/runtime/types/AntTag.type.mjs +0 -8
- package/dist/runtime/types/Checkbox.type.d.ts +0 -8
- package/dist/runtime/types/Checkbox.type.mjs +0 -0
- package/dist/runtime/types/NavItem.type.d.ts +0 -9
- package/dist/runtime/types/NavItem.type.mjs +0 -0
- package/dist/runtime/types/RadioButton.type.d.ts +0 -5
- package/dist/runtime/types/RadioButton.type.mjs +0 -0
- package/dist/runtime/types/Tabs.type.d.ts +0 -6
- package/dist/runtime/types/Tabs.type.mjs +0 -0
- package/dist/runtime/types/Toaster.type.d.ts +0 -6
- package/dist/runtime/types/Toaster.type.mjs +0 -0
- package/dist/runtime/types/index.d.ts +0 -7
- package/dist/runtime/types/index.mjs +0 -7
- package/src/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +0 -166
- package/src/runtime/components/form/AntCheckboxWidget/AntCheckboxGroup.vue +0 -91
- package/src/runtime/components/form/AntFormGroupLabel.vue +0 -5
- package/src/runtime/components/form/AntRadioWidget/AntRadio.vue +0 -164
- package/src/runtime/components/form/AntRadioWidget/AntRadioGroup.vue +0 -80
- package/src/runtime/components/form/AntRangeSlider.vue +0 -101
- package/src/runtime/components/form/AntSwitch.vue +0 -153
- package/src/runtime/components/form/AntSwitcher.vue +0 -200
- package/src/runtime/components/form/AntTextInput.vue +0 -73
- package/src/runtime/components/form/Elements/AntBaseInput.vue +0 -251
- package/src/runtime/components/form/Elements/AntField.vue +0 -105
- package/src/runtime/components/form/Elements/AntInputLabel.vue +0 -55
- package/src/runtime/components/form/Elements/AntInputLimiter.vue +0 -55
- /package/dist/runtime/components/__types/{Accordion.types.d.ts → AntAccordion.types.d.ts} +0 -0
- /package/dist/runtime/components/__types/{Accordion.types.mjs → AntAccordion.types.mjs} +0 -0
- /package/dist/runtime/components/buttons/__types/{AntButton.type.d.ts → AntButton.types.d.ts} +0 -0
- /package/dist/runtime/components/buttons/__types/{AntButton.type.mjs → AntButton.types.mjs} +0 -0
- /package/dist/runtime/components/{form → forms}/AntFormGroup.vue +0 -0
- /package/dist/runtime/components/{form/Elements → forms}/__stories/AntField.stories.d.ts +0 -0
- /package/dist/runtime/components/{form → forms}/__stories/AntFormGroup.stories.d.ts +0 -0
- /package/dist/runtime/components/{form → forms}/__stories/AntFormGroupLabel.stories.d.ts +0 -0
- /package/dist/runtime/components/{form → inputs}/AntRichTextEditor.vue +0 -0
- /package/dist/runtime/components/{form → inputs}/Elements/__stories/AntInputDescription.stories.d.ts +0 -0
- /package/dist/runtime/components/{form → inputs}/Elements/__stories/AntInputLabel.stories.d.ts +0 -0
- /package/dist/runtime/components/{form → inputs}/Elements/__stories/AntInputLimiter.stories.d.ts +0 -0
- /package/dist/runtime/components/{form/Elements/__types/AntBaseInput.type.d.ts → inputs/Elements/__types/AntBaseInput.types.d.ts} +0 -0
- /package/dist/runtime/components/{form/Elements/__types/AntBaseInput.type.mjs → inputs/Elements/__types/AntBaseInput.types.mjs} +0 -0
- /package/dist/runtime/components/{form/AntCheckboxWidget → inputs}/__stories/AntCheckbox.stories.d.ts +0 -0
- /package/dist/runtime/components/{form/AntCheckboxWidget → inputs}/__stories/AntCheckboxGroup.stories.d.ts +0 -0
- /package/dist/runtime/components/{form → inputs}/__stories/AntRichTextEditor.stories-old.d.ts +0 -0
- /package/dist/runtime/components/{form → inputs}/__stories/AntRichTextEditor.stories-old.mjs +0 -0
- /package/dist/runtime/components/{form → inputs}/__stories/AntSelect.stories.d.ts +0 -0
- /package/dist/runtime/components/{form/__types/AntSelect.type.d.ts → inputs/__types/AntSelect.types.d.ts} +0 -0
- /package/dist/runtime/components/{form/AntCheckboxWidget/__types/AntCheckbox.mjs → inputs/__types/AntSelect.types.mjs} +0 -0
- /package/dist/runtime/components/{form/__types/AntSwitcher.type.d.ts → inputs/__types/AntSwitcher.types.d.ts} +0 -0
- /package/dist/runtime/components/{form/AntRadioWidget/__types/AntRadio.type.mjs → inputs/__types/AntSwitcher.types.mjs} +0 -0
- /package/dist/runtime/components/{form/__types/AntSelect.type.mjs → navbar/__types/NavbarItem.types.mjs} +0 -0
- /package/src/runtime/components/{form → forms}/AntFormGroup.vue +0 -0
- /package/src/runtime/components/{form → inputs}/AntRichTextEditor.vue +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import AntCheckboxGroup from "../AntCheckboxGroup.vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Direction } from "
|
|
2
|
+
import { reactive } from "vue";
|
|
3
|
+
import { InputState } from "../../../enums/index.mjs";
|
|
4
|
+
import { Direction } from "../../../enums/Direction.enum.mjs";
|
|
5
5
|
import { useFieldValidator } from "@antify/validate";
|
|
6
|
+
import { AntCheckboxSize } from "../__types/AntCheckbox.types.mjs";
|
|
6
7
|
const meta = {
|
|
7
|
-
title: "
|
|
8
|
+
title: "Inputs/Checkbox Group",
|
|
8
9
|
component: AntCheckboxGroup,
|
|
10
|
+
parameters: { controls: { sort: "requiredFirst" } },
|
|
9
11
|
argTypes: {
|
|
10
12
|
modelValue: {
|
|
11
13
|
description: "Contains the list of selected checkboxes (the value prop of the checkboxes)"
|
|
@@ -13,13 +15,13 @@ const meta = {
|
|
|
13
15
|
checkboxes: {
|
|
14
16
|
description: "List of checkboxes to be displayed"
|
|
15
17
|
},
|
|
16
|
-
|
|
18
|
+
state: {
|
|
17
19
|
control: { type: "select" },
|
|
18
|
-
options: Object.values(
|
|
20
|
+
options: Object.values(InputState)
|
|
19
21
|
},
|
|
20
22
|
size: {
|
|
21
23
|
control: { type: "select" },
|
|
22
|
-
options: Object.values(
|
|
24
|
+
options: Object.values(AntCheckboxSize)
|
|
23
25
|
},
|
|
24
26
|
direction: {
|
|
25
27
|
control: { type: "select" },
|
|
@@ -32,21 +34,10 @@ export const Docs = {
|
|
|
32
34
|
render: (args) => ({
|
|
33
35
|
components: { AntCheckboxGroup },
|
|
34
36
|
setup() {
|
|
35
|
-
|
|
36
|
-
get() {
|
|
37
|
-
return args.modelValue;
|
|
38
|
-
},
|
|
39
|
-
set(val) {
|
|
40
|
-
args.modelValue = val;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return {
|
|
44
|
-
args,
|
|
45
|
-
value
|
|
46
|
-
};
|
|
37
|
+
return { args };
|
|
47
38
|
},
|
|
48
39
|
template: `
|
|
49
|
-
<AntCheckboxGroup v-bind="args" v-model="
|
|
40
|
+
<AntCheckboxGroup v-bind="args" v-model="args.modelValue"/>
|
|
50
41
|
`
|
|
51
42
|
}),
|
|
52
43
|
args: {
|
|
@@ -70,27 +61,25 @@ export const WithValidator = {
|
|
|
70
61
|
render: (args) => ({
|
|
71
62
|
components: { AntCheckboxGroup },
|
|
72
63
|
setup() {
|
|
73
|
-
const
|
|
74
|
-
get() {
|
|
75
|
-
return args.modelValue;
|
|
76
|
-
},
|
|
77
|
-
set(val) {
|
|
78
|
-
args.modelValue = val;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
const validator = ref(useFieldValidator((val) => val.length >= 2 || "Select at least 2"));
|
|
82
|
-
validator.value.validate(value.value);
|
|
64
|
+
const validator = reactive(useFieldValidator((val) => val.length >= 2 || "Select at least 2"));
|
|
83
65
|
return {
|
|
84
66
|
args,
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
validator,
|
|
68
|
+
InputState
|
|
87
69
|
};
|
|
88
70
|
},
|
|
89
71
|
template: `
|
|
90
|
-
<AntCheckboxGroup
|
|
72
|
+
<AntCheckboxGroup
|
|
73
|
+
v-bind="args"
|
|
74
|
+
v-model="args.modelValue"
|
|
75
|
+
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
76
|
+
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
77
|
+
@validate="(val) => validator.validate(val)"
|
|
78
|
+
/>
|
|
91
79
|
`
|
|
92
80
|
}),
|
|
93
81
|
args: {
|
|
94
|
-
...Docs.args
|
|
82
|
+
...Docs.args,
|
|
83
|
+
modelValue: null
|
|
95
84
|
}
|
|
96
85
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/vue3';
|
|
2
|
+
import AntDateInput from '../AntDateInput.vue';
|
|
3
|
+
declare const meta: Meta<typeof AntDateInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AntDateInput>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const WithValidator: Story;
|
|
8
|
+
export declare const Summary: Story;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Size } from "../../../enums/Size.enum.mjs";
|
|
2
|
+
import { Direction } from "../../../enums/Direction.enum.mjs";
|
|
3
|
+
import AntDateInput from "../AntDateInput.vue";
|
|
4
|
+
import { InputState } from "../../../enums/index.mjs";
|
|
5
|
+
import { AntDateInputTypes } from "../__types/AntDateInput.types.mjs";
|
|
6
|
+
import { isRequiredRule, useFieldValidator } from "@antify/validate";
|
|
7
|
+
import { reactive } from "vue";
|
|
8
|
+
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
9
|
+
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
10
|
+
const meta = {
|
|
11
|
+
title: "Inputs/Date Input",
|
|
12
|
+
component: AntDateInput,
|
|
13
|
+
parameters: { controls: { sort: "requiredFirst" } },
|
|
14
|
+
argTypes: {
|
|
15
|
+
modelValue: {
|
|
16
|
+
table: { type: { summary: "string|null" } }
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
control: { type: "select" },
|
|
20
|
+
options: Object.values(AntDateInputTypes)
|
|
21
|
+
},
|
|
22
|
+
state: {
|
|
23
|
+
control: { type: "select" },
|
|
24
|
+
options: Object.values(InputState)
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
control: { type: "select" },
|
|
28
|
+
options: Object.values(Size)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
export const Docs = {
|
|
34
|
+
render: (args) => ({
|
|
35
|
+
components: { AntDateInput },
|
|
36
|
+
setup() {
|
|
37
|
+
return { args };
|
|
38
|
+
},
|
|
39
|
+
template: `
|
|
40
|
+
<AntDateInput
|
|
41
|
+
v-bind="args"
|
|
42
|
+
v-model="args.modelValue"
|
|
43
|
+
/>
|
|
44
|
+
`
|
|
45
|
+
}),
|
|
46
|
+
args: {
|
|
47
|
+
modelValue: null,
|
|
48
|
+
label: "Label",
|
|
49
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export const WithValidator = {
|
|
53
|
+
render: (args) => ({
|
|
54
|
+
components: { AntDateInput },
|
|
55
|
+
setup() {
|
|
56
|
+
const validator = reactive(useFieldValidator([
|
|
57
|
+
isRequiredRule,
|
|
58
|
+
(val) => typeof val !== "number" || val <= 8 || "Value should not be bigger than 8"
|
|
59
|
+
]));
|
|
60
|
+
return { args, validator, InputState };
|
|
61
|
+
},
|
|
62
|
+
template: `
|
|
63
|
+
<AntDateInput
|
|
64
|
+
v-bind="args"
|
|
65
|
+
v-model="args.modelValue"
|
|
66
|
+
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
67
|
+
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
68
|
+
@validate="(val) => validator.validate(val)"
|
|
69
|
+
/>
|
|
70
|
+
`
|
|
71
|
+
}),
|
|
72
|
+
args: {
|
|
73
|
+
modelValue: null,
|
|
74
|
+
label: "Label",
|
|
75
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
export const Summary = {
|
|
79
|
+
parameters: {
|
|
80
|
+
chromatic: { disableSnapshot: false }
|
|
81
|
+
},
|
|
82
|
+
render: (args) => ({
|
|
83
|
+
components: { AntDateInput, AntFormGroup, AntFormGroupLabel },
|
|
84
|
+
setup() {
|
|
85
|
+
return { args, InputState, Size, AntDateInputType: AntDateInputTypes, Direction };
|
|
86
|
+
},
|
|
87
|
+
template: `
|
|
88
|
+
<AntFormGroup>
|
|
89
|
+
<AntFormGroupLabel>
|
|
90
|
+
State
|
|
91
|
+
</AntFormGroupLabel>
|
|
92
|
+
<AntFormGroup :direction="Direction.row">
|
|
93
|
+
<AntDateInput
|
|
94
|
+
v-bind="args"
|
|
95
|
+
v-model="args.modelValue"
|
|
96
|
+
/>
|
|
97
|
+
<AntDateInput
|
|
98
|
+
v-bind="args"
|
|
99
|
+
v-model="args.modelValue"
|
|
100
|
+
:state="InputState.info"
|
|
101
|
+
/>
|
|
102
|
+
<AntDateInput
|
|
103
|
+
v-bind="args"
|
|
104
|
+
v-model="args.modelValue"
|
|
105
|
+
:state="InputState.success"
|
|
106
|
+
/>
|
|
107
|
+
<AntDateInput
|
|
108
|
+
v-bind="args"
|
|
109
|
+
v-model="args.modelValue"
|
|
110
|
+
:state="InputState.warning"
|
|
111
|
+
/>
|
|
112
|
+
<AntDateInput
|
|
113
|
+
v-bind="args"
|
|
114
|
+
v-model="args.modelValue"
|
|
115
|
+
:state="InputState.danger"
|
|
116
|
+
/>
|
|
117
|
+
</AntFormGroup>
|
|
118
|
+
|
|
119
|
+
<AntFormGroupLabel>
|
|
120
|
+
Type
|
|
121
|
+
</AntFormGroupLabel>
|
|
122
|
+
<AntFormGroup :direction="Direction.row">
|
|
123
|
+
<AntDateInput
|
|
124
|
+
v-bind="args"
|
|
125
|
+
v-model="args.modelValue"
|
|
126
|
+
label="Type date"
|
|
127
|
+
:type="AntDateInputType.date"
|
|
128
|
+
/>
|
|
129
|
+
<AntDateInput
|
|
130
|
+
v-bind="args"
|
|
131
|
+
v-model="args.modelValue"
|
|
132
|
+
label="Type datetimeLocal"
|
|
133
|
+
:type="AntDateInputType.datetimeLocal"
|
|
134
|
+
/>
|
|
135
|
+
<AntDateInput
|
|
136
|
+
v-bind="args"
|
|
137
|
+
v-model="args.modelValue"
|
|
138
|
+
label="Type month"
|
|
139
|
+
:type="AntDateInputType.month"
|
|
140
|
+
/>
|
|
141
|
+
<AntDateInput
|
|
142
|
+
v-bind="args"
|
|
143
|
+
v-model="args.modelValue"
|
|
144
|
+
label="Type time"
|
|
145
|
+
:type="AntDateInputType.time"
|
|
146
|
+
/>
|
|
147
|
+
<AntDateInput
|
|
148
|
+
v-bind="args"
|
|
149
|
+
v-model="args.modelValue"
|
|
150
|
+
label="Type week"
|
|
151
|
+
:type="AntDateInputType.week"
|
|
152
|
+
/>
|
|
153
|
+
</AntFormGroup>
|
|
154
|
+
|
|
155
|
+
<AntFormGroupLabel>
|
|
156
|
+
Size
|
|
157
|
+
</AntFormGroupLabel>
|
|
158
|
+
<AntFormGroup :direction="Direction.row">
|
|
159
|
+
<AntDateInput
|
|
160
|
+
v-bind="args"
|
|
161
|
+
value="2024-01-01"
|
|
162
|
+
:size="Size.lg"
|
|
163
|
+
/>
|
|
164
|
+
<AntDateInput
|
|
165
|
+
v-bind="args"
|
|
166
|
+
value="2018-06-12T19:30"
|
|
167
|
+
:size="Size.md"
|
|
168
|
+
/>
|
|
169
|
+
<AntDateInput
|
|
170
|
+
v-bind="args"
|
|
171
|
+
value="2024-12"
|
|
172
|
+
:size="Size.sm"
|
|
173
|
+
/>
|
|
174
|
+
<AntDateInput
|
|
175
|
+
v-bind="args"
|
|
176
|
+
value="14:28"
|
|
177
|
+
:size="Size.xs"
|
|
178
|
+
/>
|
|
179
|
+
<AntDateInput
|
|
180
|
+
v-bind="args"
|
|
181
|
+
value="2024-W18"
|
|
182
|
+
:size="Size.xs2"
|
|
183
|
+
/>
|
|
184
|
+
</AntFormGroup>
|
|
185
|
+
</AntFormGroup>
|
|
186
|
+
`
|
|
187
|
+
}),
|
|
188
|
+
args: {
|
|
189
|
+
modelValue: null,
|
|
190
|
+
label: "Label",
|
|
191
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
192
|
+
}
|
|
193
|
+
};
|
|
@@ -4,5 +4,6 @@ declare const meta: Meta<typeof AntNumberInput>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntNumberInput>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
+
export declare const withValidator: Story;
|
|
7
8
|
export declare const Limited: Story;
|
|
8
|
-
export declare const
|
|
9
|
+
export declare const WithIndicators: Story;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Size } from "../../../enums/Size.enum.mjs";
|
|
2
|
+
import AntNumberInput from "../AntNumberInput.vue";
|
|
3
|
+
import { InputState } from "../../../enums/State.enum.mjs";
|
|
4
|
+
import { isRequiredRule, useFieldValidator } from "@antify/validate";
|
|
5
|
+
import { reactive } from "vue";
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Inputs/Number Input",
|
|
8
|
+
component: AntNumberInput,
|
|
9
|
+
parameters: { controls: { sort: "requiredFirst" } },
|
|
10
|
+
argTypes: {
|
|
11
|
+
modelValue: {
|
|
12
|
+
control: { type: "number" },
|
|
13
|
+
table: { type: { summary: "number|null" } }
|
|
14
|
+
},
|
|
15
|
+
state: {
|
|
16
|
+
control: { type: "select" },
|
|
17
|
+
options: Object.values(InputState)
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
control: { type: "select" },
|
|
21
|
+
options: Object.values(Size),
|
|
22
|
+
table: { defaultValue: { summary: Size.md } }
|
|
23
|
+
},
|
|
24
|
+
placeholder: {
|
|
25
|
+
table: { defaultValue: { summary: "this.label" } }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export default meta;
|
|
30
|
+
export const Docs = {
|
|
31
|
+
render: (args) => ({
|
|
32
|
+
components: { AntNumberInput },
|
|
33
|
+
setup() {
|
|
34
|
+
return { args };
|
|
35
|
+
},
|
|
36
|
+
template: `
|
|
37
|
+
<AntNumberInput
|
|
38
|
+
v-bind="args"
|
|
39
|
+
v-model="args.modelValue"
|
|
40
|
+
/>`
|
|
41
|
+
}),
|
|
42
|
+
args: {
|
|
43
|
+
modelValue: null,
|
|
44
|
+
steps: 1,
|
|
45
|
+
label: "Label",
|
|
46
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export const withValidator = {
|
|
50
|
+
render: (args) => ({
|
|
51
|
+
components: { AntNumberInput },
|
|
52
|
+
setup() {
|
|
53
|
+
const validator = reactive(useFieldValidator(isRequiredRule));
|
|
54
|
+
return { args, validator, InputState };
|
|
55
|
+
},
|
|
56
|
+
template: `
|
|
57
|
+
<AntNumberInput
|
|
58
|
+
v-bind="args"
|
|
59
|
+
v-model="args.modelValue"
|
|
60
|
+
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
61
|
+
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
62
|
+
@validate="(val) => validator.validate(val)"
|
|
63
|
+
/>`
|
|
64
|
+
}),
|
|
65
|
+
args: {
|
|
66
|
+
modelValue: null,
|
|
67
|
+
steps: 1,
|
|
68
|
+
label: "Label",
|
|
69
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export const Limited = {
|
|
73
|
+
render: (args) => ({
|
|
74
|
+
components: { AntNumberInput },
|
|
75
|
+
setup() {
|
|
76
|
+
const validator = reactive(useFieldValidator([
|
|
77
|
+
isRequiredRule,
|
|
78
|
+
(val) => val <= 10 || "Value should not be bigger than 10",
|
|
79
|
+
(val) => val <= 11 || "It should be really not bigger than 10!!!!"
|
|
80
|
+
]));
|
|
81
|
+
return { args, validator, InputState };
|
|
82
|
+
},
|
|
83
|
+
template: `
|
|
84
|
+
<AntNumberInput
|
|
85
|
+
v-bind="args"
|
|
86
|
+
v-model="args.modelValue"
|
|
87
|
+
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
88
|
+
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
89
|
+
@validate="(val) => validator.validate(val)"
|
|
90
|
+
/>`
|
|
91
|
+
}),
|
|
92
|
+
args: {
|
|
93
|
+
...Docs.args,
|
|
94
|
+
modelValue: 50,
|
|
95
|
+
limiter: true,
|
|
96
|
+
max: 10,
|
|
97
|
+
indicators: true
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export const WithIndicators = {
|
|
101
|
+
render: Docs.render,
|
|
102
|
+
args: {
|
|
103
|
+
...Docs.args,
|
|
104
|
+
indicators: true
|
|
105
|
+
}
|
|
106
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/vue3';
|
|
2
|
+
import AntPasswordInput from '../AntPasswordInput.vue';
|
|
3
|
+
declare const meta: Meta<typeof AntPasswordInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AntPasswordInput>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const WithValidator: Story;
|
|
8
|
+
export declare const Summary: Story;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Size } from "../../../enums/Size.enum.mjs";
|
|
2
|
+
import { isRequiredRule, notBlankRule, useFieldValidator } from "@antify/validate";
|
|
3
|
+
import { InputState } from "../../../enums/index.mjs";
|
|
4
|
+
import { reactive } from "vue";
|
|
5
|
+
import AntPasswordInput from "../AntPasswordInput.vue";
|
|
6
|
+
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
7
|
+
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
8
|
+
const meta = {
|
|
9
|
+
components: { AntFormGroupLabel, AntFormGroup },
|
|
10
|
+
title: "Inputs/Password Input",
|
|
11
|
+
component: AntPasswordInput,
|
|
12
|
+
parameters: { controls: { sort: "requiredFirst" } },
|
|
13
|
+
argTypes: {
|
|
14
|
+
modelValue: {
|
|
15
|
+
control: "text",
|
|
16
|
+
table: { type: { summary: "string|null" } }
|
|
17
|
+
},
|
|
18
|
+
state: {
|
|
19
|
+
control: { type: "select" },
|
|
20
|
+
options: Object.values(InputState)
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
control: { type: "select" },
|
|
24
|
+
options: Object.values(Size),
|
|
25
|
+
table: { defaultValue: { summary: Size.md } }
|
|
26
|
+
},
|
|
27
|
+
placeholder: {
|
|
28
|
+
table: { defaultValue: { summary: "this.label" } }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
export const Docs = {
|
|
34
|
+
render: (args) => ({
|
|
35
|
+
components: { AntPasswordInput },
|
|
36
|
+
setup() {
|
|
37
|
+
return { args };
|
|
38
|
+
},
|
|
39
|
+
template: `
|
|
40
|
+
<AntPasswordInput
|
|
41
|
+
v-bind="args"
|
|
42
|
+
v-model="args.modelValue"
|
|
43
|
+
/>`
|
|
44
|
+
}),
|
|
45
|
+
args: {
|
|
46
|
+
modelValue: null,
|
|
47
|
+
label: "Label",
|
|
48
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export const WithValidator = {
|
|
52
|
+
render: (args) => ({
|
|
53
|
+
components: { AntPasswordInput },
|
|
54
|
+
setup() {
|
|
55
|
+
const validator = reactive(useFieldValidator([isRequiredRule, notBlankRule]));
|
|
56
|
+
return { args, validator, InputState };
|
|
57
|
+
},
|
|
58
|
+
template: `
|
|
59
|
+
<AntPasswordInput
|
|
60
|
+
v-bind="args"
|
|
61
|
+
v-model="args.modelValue"
|
|
62
|
+
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
63
|
+
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
64
|
+
@validate="(val) => validator.validate(val)"
|
|
65
|
+
/>`
|
|
66
|
+
}),
|
|
67
|
+
args: {
|
|
68
|
+
modelValue: null,
|
|
69
|
+
label: "Label",
|
|
70
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export const Summary = {
|
|
74
|
+
parameters: {
|
|
75
|
+
chromatic: { disableSnapshot: false }
|
|
76
|
+
},
|
|
77
|
+
render: (args) => ({
|
|
78
|
+
components: { AntPasswordInput, AntFormGroup, AntFormGroupLabel },
|
|
79
|
+
setup() {
|
|
80
|
+
return { args, InputState, Size };
|
|
81
|
+
},
|
|
82
|
+
template: `
|
|
83
|
+
<AntFormGroup>
|
|
84
|
+
<AntFormGroupLabel>
|
|
85
|
+
State
|
|
86
|
+
</AntFormGroupLabel>
|
|
87
|
+
<AntFormGroup direction="row">
|
|
88
|
+
<AntPasswordInput
|
|
89
|
+
v-bind="args"
|
|
90
|
+
v-model="args.modelValue"
|
|
91
|
+
/>
|
|
92
|
+
<AntPasswordInput
|
|
93
|
+
v-bind="args"
|
|
94
|
+
v-model="args.modelValue"
|
|
95
|
+
:state="InputState.info"
|
|
96
|
+
message="asdf"
|
|
97
|
+
/>
|
|
98
|
+
<AntPasswordInput
|
|
99
|
+
v-bind="args"
|
|
100
|
+
v-model="args.modelValue"
|
|
101
|
+
:state="InputState.success"
|
|
102
|
+
/>
|
|
103
|
+
<AntPasswordInput
|
|
104
|
+
v-bind="args"
|
|
105
|
+
v-model="args.modelValue"
|
|
106
|
+
:state="InputState.warning"
|
|
107
|
+
/>
|
|
108
|
+
<AntPasswordInput
|
|
109
|
+
v-bind="args"
|
|
110
|
+
v-model="args.modelValue"
|
|
111
|
+
:state="InputState.danger"
|
|
112
|
+
/>
|
|
113
|
+
</AntFormGroup>
|
|
114
|
+
|
|
115
|
+
<AntFormGroupLabel>
|
|
116
|
+
Size
|
|
117
|
+
</AntFormGroupLabel>
|
|
118
|
+
<AntFormGroup direction="row">
|
|
119
|
+
<AntPasswordInput
|
|
120
|
+
v-bind="args"
|
|
121
|
+
value="1234"
|
|
122
|
+
:size="Size.lg"
|
|
123
|
+
/>
|
|
124
|
+
<AntPasswordInput
|
|
125
|
+
v-bind="args"
|
|
126
|
+
v-model="args.modelValue"
|
|
127
|
+
:state="InputState.info"
|
|
128
|
+
:size="Size.md"
|
|
129
|
+
/>
|
|
130
|
+
<AntPasswordInput
|
|
131
|
+
v-bind="args"
|
|
132
|
+
value="1234"
|
|
133
|
+
:state="InputState.success"
|
|
134
|
+
:size="Size.sm"
|
|
135
|
+
/>
|
|
136
|
+
<AntPasswordInput
|
|
137
|
+
v-bind="args"
|
|
138
|
+
v-model="args.modelValue"
|
|
139
|
+
:state="InputState.warning"
|
|
140
|
+
:size="Size.xs"
|
|
141
|
+
/>
|
|
142
|
+
<AntPasswordInput
|
|
143
|
+
v-bind="args"
|
|
144
|
+
value="1234"
|
|
145
|
+
:state="InputState.danger"
|
|
146
|
+
:size="Size.xs2"
|
|
147
|
+
/>
|
|
148
|
+
</AntFormGroup>
|
|
149
|
+
</AntFormGroup>
|
|
150
|
+
`
|
|
151
|
+
}),
|
|
152
|
+
args: {
|
|
153
|
+
label: "Label",
|
|
154
|
+
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
155
|
+
}
|
|
156
|
+
};
|