@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,220 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted, watch} from 'vue';
|
|
3
|
-
import {Size} from '../../../enums/Size.enum'
|
|
4
|
-
import AntSkeleton from '../../AntSkeleton.vue';
|
|
5
|
-
import AntIcon from '../../AntIcon.vue';
|
|
6
|
-
import {BaseInputType} from './__types/AntBaseInput.type';
|
|
7
|
-
import {Grouped} from '../../../enums/Grouped.enum';
|
|
8
|
-
import {
|
|
9
|
-
faExclamationTriangle,
|
|
10
|
-
faExclamationCircle,
|
|
11
|
-
faCircleCheck,
|
|
12
|
-
faCircleInfo,
|
|
13
|
-
faXmark
|
|
14
|
-
} from '@fortawesome/free-solid-svg-icons';
|
|
15
|
-
import {handleEnumValidation} from '../../../handler';
|
|
16
|
-
import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
17
|
-
import {classesToObjectSyntax} from '../../../utils';
|
|
18
|
-
import {InputColorType} from '../../../enums';
|
|
19
|
-
import {IconSize} from '../../__types';
|
|
20
|
-
|
|
21
|
-
defineOptions({ inheritAttrs: false });
|
|
22
|
-
|
|
23
|
-
const emit = defineEmits(['update:value', 'blur', 'validate']);
|
|
24
|
-
const props = withDefaults(defineProps<{
|
|
25
|
-
value: string | number | null;
|
|
26
|
-
size?: Size;
|
|
27
|
-
colorType?: InputColorType;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
placeholder?: string;
|
|
30
|
-
skeleton?: boolean;
|
|
31
|
-
type?: BaseInputType;
|
|
32
|
-
grouped?: Grouped;
|
|
33
|
-
wrapperClass?: string | Record<string, boolean>;
|
|
34
|
-
showIcon?: boolean;
|
|
35
|
-
iconLeft?: IconDefinition;
|
|
36
|
-
nullable?: boolean;
|
|
37
|
-
hasErrors?: boolean;
|
|
38
|
-
}>(), {
|
|
39
|
-
colorType: InputColorType.base,
|
|
40
|
-
disabled: false,
|
|
41
|
-
size: Size.md,
|
|
42
|
-
skeleton: false,
|
|
43
|
-
type: BaseInputType.text,
|
|
44
|
-
grouped: Grouped.none,
|
|
45
|
-
showIcon: true,
|
|
46
|
-
default: false,
|
|
47
|
-
nullable: false,
|
|
48
|
-
hasErrors: false
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const icons = {
|
|
52
|
-
[InputColorType.info]: faCircleInfo,
|
|
53
|
-
[InputColorType.warning]: faExclamationTriangle,
|
|
54
|
-
[InputColorType.danger]: faExclamationCircle,
|
|
55
|
-
[InputColorType.success]: faCircleCheck,
|
|
56
|
-
[InputColorType.base]: null,
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const inputClasses = computed(() => {
|
|
60
|
-
const variants: Record<InputColorType, string> = {
|
|
61
|
-
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 focus:ring-primary/25 bg-white placeholder:text-neutral-500',
|
|
62
|
-
[InputColorType.danger]: 'outline-danger-500 focus:outline-danger-500 focus:ring-danger/25 bg-danger-100 placeholder:text-danger-700',
|
|
63
|
-
[InputColorType.info]: 'outline-info-500 focus:outline-info-500 focus:ring-info/25 bg-info-100 placeholder:text-info-700',
|
|
64
|
-
[InputColorType.success]: 'outline-success-500 focus:outline-success-500 focus:ring-success/25 bg-success-100 placeholder:text-success-700',
|
|
65
|
-
[InputColorType.warning]: 'outline-warning-500 focus:outline-warning-500 focus:ring-warning/25 bg-warning-100 placeholder:text-warning-700',
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
'transition-colors relative border-none outline w-full focus:z-10 text-black': true,
|
|
70
|
-
'outline-offset-[-1px] outline-1 focus:outline-offset-[-1px] focus:outline-1': true,
|
|
71
|
-
'disabled:opacity-50 disabled:cursor-not-allowed': props.disabled,
|
|
72
|
-
'text-right': props.type === BaseInputType.number,
|
|
73
|
-
[variants[_colorType.value]]: true,
|
|
74
|
-
// Size
|
|
75
|
-
'focus:ring-2 p-1.5 text-xs': props.size === Size.sm,
|
|
76
|
-
'focus:ring-4 p-2.5 text-sm': props.size === Size.md,
|
|
77
|
-
// Icon left
|
|
78
|
-
'pl-7': props.size === Size.sm && props.iconLeft,
|
|
79
|
-
'pl-10': props.size === Size.md && props.iconLeft,
|
|
80
|
-
// Icon right
|
|
81
|
-
'pr-7': props.size === Size.sm && props.showIcon && icon.value,
|
|
82
|
-
'pr-10': props.size === Size.md && props.showIcon && icon.value,
|
|
83
|
-
// Grouped
|
|
84
|
-
'rounded-tl-md rounded-bl-md rounded-tr-none rounded-br-none': props.grouped === Grouped.left,
|
|
85
|
-
'rounded-none': props.grouped === Grouped.center,
|
|
86
|
-
'rounded-tl-none rounded-bl-none rounded-tr-md rounded-br-md': props.grouped === Grouped.right,
|
|
87
|
-
'rounded-md': props.grouped === Grouped.none,
|
|
88
|
-
'invisible': props.skeleton,
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
const iconClasses = computed(() => ({
|
|
92
|
-
'transition-[height]': true,
|
|
93
|
-
}));
|
|
94
|
-
const iconColorClass = computed(() => {
|
|
95
|
-
const variants: Record<InputColorType, string> = {
|
|
96
|
-
[InputColorType.base]: 'text-for-white-bg-font',
|
|
97
|
-
[InputColorType.danger]: 'text-danger-500',
|
|
98
|
-
[InputColorType.info]: 'text-info-500',
|
|
99
|
-
[InputColorType.success]: 'text-success-500',
|
|
100
|
-
[InputColorType.warning]: 'text-warning-500',
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
return variants[_colorType.value];
|
|
104
|
-
});
|
|
105
|
-
const _wrapperClass = computed(() => classesToObjectSyntax(props.wrapperClass));
|
|
106
|
-
const icon = computed(() => icons[_colorType.value]);
|
|
107
|
-
const _value = computed<string | number | null>({
|
|
108
|
-
get: () => props.value,
|
|
109
|
-
set: (val: string | number | null) => {
|
|
110
|
-
if (props.type === BaseInputType.number && typeof val !== 'number') {
|
|
111
|
-
return emit('update:value', null);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
emit('update:value', val);
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
const _colorType = computed(() => props.hasErrors ? InputColorType.danger : props.colorType);
|
|
118
|
-
|
|
119
|
-
watch(_value, (val) => {
|
|
120
|
-
if (props.hasErrors) {
|
|
121
|
-
emit('validate', val)
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Validate default value if given after delayed data fetching.
|
|
127
|
-
*/
|
|
128
|
-
watch(() => props.skeleton, (val) => {
|
|
129
|
-
if (!val && props.value !== null) {
|
|
130
|
-
emit('validate', props.value)
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
onMounted(() => {
|
|
135
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
136
|
-
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
137
|
-
handleEnumValidation(props.type, BaseInputType, 'Type');
|
|
138
|
-
handleEnumValidation(props.grouped, Grouped, 'grouped');
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Validate default value without delayed data fetching.
|
|
142
|
-
*/
|
|
143
|
-
if (!props.skeleton && props.value !== null) {
|
|
144
|
-
emit('validate', props.value)
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
function onBlur(e: FocusEvent) {
|
|
149
|
-
emit('validate', props.value)
|
|
150
|
-
emit('blur', e);
|
|
151
|
-
}
|
|
152
|
-
</script>
|
|
153
|
-
|
|
154
|
-
<template>
|
|
155
|
-
<div
|
|
156
|
-
class="block relative w-full"
|
|
157
|
-
:class="{...{'-mr-px': grouped !== Grouped.none}, ..._wrapperClass}"
|
|
158
|
-
>
|
|
159
|
-
<div
|
|
160
|
-
v-if="iconLeft"
|
|
161
|
-
class="absolute h-full flex items-center justify-center z-20"
|
|
162
|
-
:class="{'w-7': size === Size.sm, 'w-10': size === Size.md}"
|
|
163
|
-
>
|
|
164
|
-
<AntIcon
|
|
165
|
-
:icon="iconLeft"
|
|
166
|
-
:size="size as unknown as IconSize"
|
|
167
|
-
color="text-for-white-bg-font"
|
|
168
|
-
/>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<input
|
|
172
|
-
v-model="_value"
|
|
173
|
-
:class="inputClasses"
|
|
174
|
-
:type="type"
|
|
175
|
-
:placeholder="placeholder"
|
|
176
|
-
:disabled="disabled || skeleton"
|
|
177
|
-
v-bind="$attrs"
|
|
178
|
-
@blur="onBlur"
|
|
179
|
-
>
|
|
180
|
-
|
|
181
|
-
<div
|
|
182
|
-
v-if="nullable && _value !== null && _value !== ''"
|
|
183
|
-
class="absolute flex w-fit right-0 top-0 h-full transition-all z-20"
|
|
184
|
-
:class="{'p-1.5': size === Size.sm, 'p-2.5': size === Size.md}"
|
|
185
|
-
>
|
|
186
|
-
<AntIcon
|
|
187
|
-
:icon="faXmark"
|
|
188
|
-
:class="iconClasses"
|
|
189
|
-
class="cursor-pointer"
|
|
190
|
-
:color="iconColorClass"
|
|
191
|
-
:size="size as unknown as IconSize"
|
|
192
|
-
@click="() => _value = null"
|
|
193
|
-
/>
|
|
194
|
-
</div>
|
|
195
|
-
|
|
196
|
-
<div
|
|
197
|
-
v-else-if="showIcon && icon"
|
|
198
|
-
class="absolute flex w-fit right-0 top-0 h-full transition-all z-20"
|
|
199
|
-
:class="{'p-1.5': size === Size.sm, 'p-2.5': size === Size.md}"
|
|
200
|
-
>
|
|
201
|
-
<AntIcon
|
|
202
|
-
:icon="icon"
|
|
203
|
-
:color="iconColorClass"
|
|
204
|
-
:class="iconClasses"
|
|
205
|
-
:size="size as unknown as IconSize"
|
|
206
|
-
/>
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
<AntSkeleton
|
|
210
|
-
v-if="skeleton"
|
|
211
|
-
absolute
|
|
212
|
-
:grouped="grouped"
|
|
213
|
-
rounded
|
|
214
|
-
/>
|
|
215
|
-
</div>
|
|
216
|
-
</template>
|
|
217
|
-
|
|
218
|
-
<style scoped>
|
|
219
|
-
input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=search]::-ms-clear,input[type=search]::-ms-reveal{display:none;height:0;width:0}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}
|
|
220
|
-
</style>
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {onMounted, computed} from 'vue';
|
|
3
|
-
import {Size} from '../../../enums/Size.enum'
|
|
4
|
-
import AntInputLabel from './AntInputLabel.vue';
|
|
5
|
-
import AntInputDescription from './AntInputDescription.vue';
|
|
6
|
-
import {handleEnumValidation} from '../../../handler';
|
|
7
|
-
import AntInputLimiter from './AntInputLimiter.vue';
|
|
8
|
-
import {InputColorType} from '../../../enums';
|
|
9
|
-
|
|
10
|
-
defineEmits(['clickLabel', 'validate']);
|
|
11
|
-
const props = withDefaults(defineProps<{
|
|
12
|
-
label?: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
size?: Size;
|
|
15
|
-
colorType?: InputColorType;
|
|
16
|
-
skeleton?: boolean;
|
|
17
|
-
limiterValue?: number;
|
|
18
|
-
limiterMaxValue?: number;
|
|
19
|
-
labelFor?: string;
|
|
20
|
-
errors?: string[];
|
|
21
|
-
expanded?: boolean;
|
|
22
|
-
}>(), {
|
|
23
|
-
colorType: InputColorType.base,
|
|
24
|
-
skeleton: false,
|
|
25
|
-
size: Size.md,
|
|
26
|
-
errors: () => [],
|
|
27
|
-
expanded: true
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
onMounted(() => {
|
|
31
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
32
|
-
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const _errors = computed(() => props.skeleton ? [] : props.errors);
|
|
36
|
-
const _colorType = computed(() => _errors.value.length > 0 ? InputColorType.danger : props.colorType);
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<template>
|
|
40
|
-
<div
|
|
41
|
-
class="flex flex-col items-start gap-1.5"
|
|
42
|
-
:class="{'w-full': expanded}"
|
|
43
|
-
>
|
|
44
|
-
<AntInputLabel
|
|
45
|
-
:label="label"
|
|
46
|
-
:size="size"
|
|
47
|
-
:skeleton="skeleton"
|
|
48
|
-
:for="labelFor"
|
|
49
|
-
@click-content="$emit('clickLabel')"
|
|
50
|
-
>
|
|
51
|
-
<div class="w-full">
|
|
52
|
-
<slot />
|
|
53
|
-
</div>
|
|
54
|
-
</AntInputLabel>
|
|
55
|
-
|
|
56
|
-
<div
|
|
57
|
-
v-if="description || _errors.length > 0 || (limiterMaxValue !== undefined && limiterValue !== undefined)"
|
|
58
|
-
class="flex justify-between w-full"
|
|
59
|
-
>
|
|
60
|
-
<AntInputDescription
|
|
61
|
-
v-if="description || _errors.length > 0"
|
|
62
|
-
:size="size"
|
|
63
|
-
:skeleton="skeleton"
|
|
64
|
-
:color-type="_colorType"
|
|
65
|
-
>
|
|
66
|
-
<slot name="description">
|
|
67
|
-
<template v-if="_errors.length === 1">
|
|
68
|
-
{{ errors[0] }}
|
|
69
|
-
</template>
|
|
70
|
-
|
|
71
|
-
<template v-else-if="_errors.length > 1">
|
|
72
|
-
<ul class="list-disc list-outside pl-4">
|
|
73
|
-
<li
|
|
74
|
-
v-for="(error, index) of _errors"
|
|
75
|
-
:key="`field-error-${index}`"
|
|
76
|
-
class="marker:m-none marker:p-none"
|
|
77
|
-
>
|
|
78
|
-
{{ error }}
|
|
79
|
-
</li>
|
|
80
|
-
</ul>
|
|
81
|
-
</template>
|
|
82
|
-
|
|
83
|
-
<template v-else>
|
|
84
|
-
{{ description }}
|
|
85
|
-
</template>
|
|
86
|
-
</slot>
|
|
87
|
-
</AntInputDescription>
|
|
88
|
-
|
|
89
|
-
<div
|
|
90
|
-
v-if="limiterMaxValue !== undefined && limiterValue !== undefined"
|
|
91
|
-
class="flex flex-grow justify-end"
|
|
92
|
-
>
|
|
93
|
-
<AntInputLimiter
|
|
94
|
-
:value="limiterValue"
|
|
95
|
-
:max-value="limiterMaxValue"
|
|
96
|
-
:color-type="_colorType"
|
|
97
|
-
:size="size"
|
|
98
|
-
:skeleton="skeleton"
|
|
99
|
-
>
|
|
100
|
-
{{ limiterValue }}/{{ limiterMaxValue }}
|
|
101
|
-
</AntInputLimiter>
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</template>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted} from 'vue';
|
|
3
|
-
import {Size} from '../../../enums/Size.enum'
|
|
4
|
-
import AntSkeleton from '../../AntSkeleton.vue';
|
|
5
|
-
import {handleEnumValidation} from '../../../handler';
|
|
6
|
-
|
|
7
|
-
defineEmits(['clickContent']);
|
|
8
|
-
|
|
9
|
-
const props = withDefaults(defineProps<{
|
|
10
|
-
label?: string;
|
|
11
|
-
size?: Size;
|
|
12
|
-
skeleton?: boolean;
|
|
13
|
-
}>(), {
|
|
14
|
-
skeleton: false,
|
|
15
|
-
size: Size.md,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const classes = computed(() => ({
|
|
19
|
-
'relative font-medium w-fit': true,
|
|
20
|
-
'text-xs': props.size === Size.sm,
|
|
21
|
-
'text-sm': props.size === Size.md,
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
onMounted(() => {
|
|
25
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<label
|
|
31
|
-
class="flex flex-col gap-1.5 w-full"
|
|
32
|
-
>
|
|
33
|
-
<span
|
|
34
|
-
v-if="label"
|
|
35
|
-
:class="classes"
|
|
36
|
-
>
|
|
37
|
-
<span
|
|
38
|
-
:class="{'invisible': skeleton}"
|
|
39
|
-
@click="$emit('clickContent')"
|
|
40
|
-
>
|
|
41
|
-
<slot name="label">
|
|
42
|
-
{{ label }}
|
|
43
|
-
</slot>
|
|
44
|
-
</span>
|
|
45
|
-
|
|
46
|
-
<AntSkeleton
|
|
47
|
-
v-if="skeleton"
|
|
48
|
-
absolute
|
|
49
|
-
rounded
|
|
50
|
-
/>
|
|
51
|
-
</span>
|
|
52
|
-
|
|
53
|
-
<slot/>
|
|
54
|
-
</label>
|
|
55
|
-
</template>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted} from 'vue';
|
|
3
|
-
import {Size} from '../../../enums/Size.enum'
|
|
4
|
-
import AntSkeleton from '../../AntSkeleton.vue';
|
|
5
|
-
import {handleEnumValidation} from '../../../handler';
|
|
6
|
-
import {InputColorType} from '../../../enums';
|
|
7
|
-
|
|
8
|
-
const props = withDefaults(defineProps<{
|
|
9
|
-
value: number;
|
|
10
|
-
maxValue: number;
|
|
11
|
-
colorType?: InputColorType;
|
|
12
|
-
size?: Size;
|
|
13
|
-
skeleton?: boolean;
|
|
14
|
-
}>(), {
|
|
15
|
-
skeleton: false,
|
|
16
|
-
size: Size.md,
|
|
17
|
-
colorType: InputColorType.base
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const classes = computed(() => {
|
|
21
|
-
const variants: Record<InputColorType, string> = {
|
|
22
|
-
[InputColorType.base]: 'text-neutral-500',
|
|
23
|
-
[InputColorType.danger]: 'text-danger-500',
|
|
24
|
-
[InputColorType.info]: 'text-info-500',
|
|
25
|
-
[InputColorType.success]: 'text-success-500',
|
|
26
|
-
[InputColorType.warning]: 'text-warning-500',
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
'relative font-regular inline-block transition-color': true,
|
|
31
|
-
'text-xs': props.size === Size.sm,
|
|
32
|
-
'text-sm': props.size === Size.md,
|
|
33
|
-
[variants[props.colorType]]: true,
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
onMounted(() => {
|
|
38
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
39
|
-
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
40
|
-
});
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<template>
|
|
44
|
-
<div :class="classes">
|
|
45
|
-
<span :class="{'invisible': skeleton}">
|
|
46
|
-
{{ value }}/{{ maxValue }}
|
|
47
|
-
</span>
|
|
48
|
-
|
|
49
|
-
<AntSkeleton
|
|
50
|
-
v-if="skeleton"
|
|
51
|
-
absolute
|
|
52
|
-
rounded
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
</template>
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { Size } from "../../../../enums/Size.enum.mjs";
|
|
2
|
-
import { BaseInputType } from "../__types/AntBaseInput.type.mjs";
|
|
3
|
-
import AntBaseInput from "../AntBaseInput.vue";
|
|
4
|
-
import AntButton from "../../../buttons/AntButton.vue";
|
|
5
|
-
import { Grouped as _Grouped } from "../../../../enums/Grouped.enum.mjs";
|
|
6
|
-
import { isRequiredRule, notBlankRule, useFieldValidator } from "@antify/validate";
|
|
7
|
-
import { computed, reactive } from "vue";
|
|
8
|
-
import { faSearch } from "@fortawesome/free-solid-svg-icons";
|
|
9
|
-
import { InputColorType } from "../../../../enums/index.mjs";
|
|
10
|
-
const meta = {
|
|
11
|
-
title: "Components/Forms/Elements/Base Input",
|
|
12
|
-
component: AntBaseInput,
|
|
13
|
-
parameters: { controls: { sort: "requiredFirst" } },
|
|
14
|
-
argTypes: {
|
|
15
|
-
value: {
|
|
16
|
-
control: { type: "text" },
|
|
17
|
-
table: { type: { summary: "string|number|null" } }
|
|
18
|
-
},
|
|
19
|
-
type: {
|
|
20
|
-
control: { type: "select" },
|
|
21
|
-
options: Object.values(BaseInputType),
|
|
22
|
-
table: { defaultValue: { summary: BaseInputType.text } }
|
|
23
|
-
},
|
|
24
|
-
colorType: {
|
|
25
|
-
control: { type: "select" },
|
|
26
|
-
options: Object.values(InputColorType)
|
|
27
|
-
},
|
|
28
|
-
size: {
|
|
29
|
-
control: { type: "radio" },
|
|
30
|
-
options: Object.values(Size),
|
|
31
|
-
table: { defaultValue: { summary: Size.md } }
|
|
32
|
-
},
|
|
33
|
-
placeholder: {
|
|
34
|
-
control: "text",
|
|
35
|
-
table: { defaultValue: { summary: "this.label" } }
|
|
36
|
-
},
|
|
37
|
-
grouped: {
|
|
38
|
-
control: { type: "select" },
|
|
39
|
-
options: Object.values(_Grouped),
|
|
40
|
-
description: "Where is this fields position in a group",
|
|
41
|
-
table: { defaultValue: { summary: _Grouped.none } }
|
|
42
|
-
},
|
|
43
|
-
wrapperClass: {
|
|
44
|
-
control: "text",
|
|
45
|
-
description: 'Class for the first element because the attribute "class" would affect the input element.',
|
|
46
|
-
table: { type: { summary: "string|object" } }
|
|
47
|
-
},
|
|
48
|
-
showIcon: {
|
|
49
|
-
control: "boolean",
|
|
50
|
-
description: "Some InputColorTypes can have an icon. Control with this property if it gets shown or not."
|
|
51
|
-
},
|
|
52
|
-
iconLeft: {
|
|
53
|
-
control: { type: "none" },
|
|
54
|
-
description: "Will be displayed left to the input text.<br>Use Font-awesome Icons."
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
export default meta;
|
|
59
|
-
export const Docs = {
|
|
60
|
-
render: (args) => ({
|
|
61
|
-
components: { AntBaseInput },
|
|
62
|
-
setup: () => {
|
|
63
|
-
const validator = reactive(useFieldValidator([isRequiredRule, notBlankRule]));
|
|
64
|
-
return { args, validator };
|
|
65
|
-
},
|
|
66
|
-
template: `
|
|
67
|
-
<AntBaseInput
|
|
68
|
-
v-bind="args"
|
|
69
|
-
v-model:value="args.value"
|
|
70
|
-
:has-errors="typeof args.hasErrors === 'boolean' ? args.hasErrors : validator.hasErrors()"
|
|
71
|
-
@validate="(val) => validator.validate(val)"
|
|
72
|
-
/>`
|
|
73
|
-
}),
|
|
74
|
-
args: {
|
|
75
|
-
value: null,
|
|
76
|
-
placeholder: "Placeholder"
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
export const withValidator = {
|
|
80
|
-
render: (args) => ({
|
|
81
|
-
components: { AntBaseInput },
|
|
82
|
-
setup: () => {
|
|
83
|
-
setTimeout(() => {
|
|
84
|
-
args.skeleton = false;
|
|
85
|
-
}, 1e3);
|
|
86
|
-
const validator = reactive(useFieldValidator([isRequiredRule, notBlankRule]));
|
|
87
|
-
return { args, validator };
|
|
88
|
-
},
|
|
89
|
-
template: `
|
|
90
|
-
<AntBaseInput
|
|
91
|
-
v-bind="args"
|
|
92
|
-
v-model:value="args.value"
|
|
93
|
-
:has-errors="typeof args.hasErrors === 'boolean' ? args.hasErrors : validator.hasErrors()"
|
|
94
|
-
@validate="(val) => validator.validate(val)"
|
|
95
|
-
/>`
|
|
96
|
-
}),
|
|
97
|
-
args: {
|
|
98
|
-
...Docs.args,
|
|
99
|
-
value: null,
|
|
100
|
-
skeleton: true,
|
|
101
|
-
description: void 0
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
export const IconLeft = {
|
|
105
|
-
render: Docs.render,
|
|
106
|
-
args: {
|
|
107
|
-
...Docs.args,
|
|
108
|
-
iconLeft: faSearch
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
export const Summary = {
|
|
112
|
-
parameters: {
|
|
113
|
-
chromatic: { disableSnapshot: false }
|
|
114
|
-
},
|
|
115
|
-
render: (args) => ({
|
|
116
|
-
components: { AntBaseInput, AntButton },
|
|
117
|
-
setup: () => {
|
|
118
|
-
const value = computed({
|
|
119
|
-
// @ts-ignore
|
|
120
|
-
get: () => args.value,
|
|
121
|
-
// @ts-ignore
|
|
122
|
-
set: (val) => args.value = val
|
|
123
|
-
});
|
|
124
|
-
return { args, value, faSearch };
|
|
125
|
-
},
|
|
126
|
-
template: `
|
|
127
|
-
<div class="p-4 pb-10 flex flex-col gap-2">
|
|
128
|
-
<div class="flex gap-2">
|
|
129
|
-
<AntBaseInput v-bind="args" v-model:value="value" color-type="base"/>
|
|
130
|
-
<AntBaseInput v-bind="args" v-model:value="value" color-type="info"/>
|
|
131
|
-
<AntBaseInput v-bind="args" v-model:value="value" color-type="success"/>
|
|
132
|
-
<AntBaseInput v-bind="args" v-model:value="value" color-type="warning"/>
|
|
133
|
-
<AntBaseInput v-bind="args" v-model:value="value" color-type="danger"/>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<div class="flex gap-2">
|
|
137
|
-
<AntBaseInput v-bind="args" value="A value" nullable color-type="base"/>
|
|
138
|
-
<AntBaseInput v-bind="args" value="A value" nullable color-type="info"/>
|
|
139
|
-
<AntBaseInput v-bind="args" value="A value" nullable color-type="success"/>
|
|
140
|
-
<AntBaseInput v-bind="args" value="A value" nullable color-type="warning"/>
|
|
141
|
-
<AntBaseInput v-bind="args" value="A value" nullable color-type="danger"/>
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
<div class="flex gap-2">
|
|
145
|
-
<AntBaseInput v-bind="args" v-model:value="value" :show-icon="false" color-type="base"/>
|
|
146
|
-
<AntBaseInput v-bind="args" v-model:value="value" :show-icon="false" color-type="info"/>
|
|
147
|
-
<AntBaseInput v-bind="args" v-model:value="value" :show-icon="false" color-type="success"/>
|
|
148
|
-
<AntBaseInput v-bind="args" v-model:value="value" :show-icon="false" color-type="warning"/>
|
|
149
|
-
<AntBaseInput v-bind="args" v-model:value="value" :show-icon="false" color-type="danger"/>
|
|
150
|
-
</div>
|
|
151
|
-
|
|
152
|
-
<div class="flex gap-2">
|
|
153
|
-
<AntBaseInput v-bind="args" v-model:value="value" :icon-left="faSearch" color-type="base"/>
|
|
154
|
-
<AntBaseInput v-bind="args" v-model:value="value" :icon-left="faSearch" color-type="info"/>
|
|
155
|
-
<AntBaseInput v-bind="args" v-model:value="value" :icon-left="faSearch" color-type="success"/>
|
|
156
|
-
<AntBaseInput v-bind="args" v-model:value="value" :icon-left="faSearch" color-type="warning"/>
|
|
157
|
-
<AntBaseInput v-bind="args" v-model:value="value" :icon-left="faSearch" color-type="danger"/>
|
|
158
|
-
</div>
|
|
159
|
-
|
|
160
|
-
<div class="flex gap-[-2px]">
|
|
161
|
-
<AntBaseInput v-bind="args" v-model:value="value" grouped="left"/>
|
|
162
|
-
<AntBaseInput v-bind="args" v-model:value="value" grouped="center" color-type="danger"/>
|
|
163
|
-
<AntBaseInput v-bind="args" v-model:value="value" grouped="right" color-type="info"/>
|
|
164
|
-
</div>
|
|
165
|
-
</div>`
|
|
166
|
-
}),
|
|
167
|
-
args: {
|
|
168
|
-
value: "",
|
|
169
|
-
placeholder: "Placeholder"
|
|
170
|
-
}
|
|
171
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AntBaseInput.type';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./AntBaseInput.type.mjs";
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Size } from "../../../enums/Size.enum.mjs";
|
|
2
|
-
import AntNumberInput from "../AntNumberInput.vue";
|
|
3
|
-
import { ColorType } from "../../../enums/ColorType.enum.mjs";
|
|
4
|
-
import { isRequiredRule, useFieldValidator } from "@antify/validate";
|
|
5
|
-
import { reactive } from "vue";
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Components/Forms/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
|
-
colorType: {
|
|
16
|
-
control: { type: "select" },
|
|
17
|
-
options: Object.values(ColorType)
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
control: { type: "radio" },
|
|
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
|
-
const validator = reactive(useFieldValidator([
|
|
35
|
-
isRequiredRule,
|
|
36
|
-
(val) => typeof val !== "number" || val <= 8 || "Value should not be bigger than 8"
|
|
37
|
-
]));
|
|
38
|
-
return { args, validator };
|
|
39
|
-
},
|
|
40
|
-
template: `
|
|
41
|
-
<AntNumberInput
|
|
42
|
-
v-bind="args"
|
|
43
|
-
v-model="args.modelValue"
|
|
44
|
-
:errors="Array.isArray(args.errors) ? args.errors : validator.getErrors()"
|
|
45
|
-
@validate="(val) => validator.validate(val)"
|
|
46
|
-
/>`
|
|
47
|
-
}),
|
|
48
|
-
args: {
|
|
49
|
-
modelValue: null,
|
|
50
|
-
steps: 1,
|
|
51
|
-
label: "Label",
|
|
52
|
-
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
export const Limited = {
|
|
56
|
-
render: Docs.render,
|
|
57
|
-
args: {
|
|
58
|
-
...Docs.args,
|
|
59
|
-
modelValue: 50,
|
|
60
|
-
limiter: true,
|
|
61
|
-
max: 10,
|
|
62
|
-
validator: useFieldValidator([
|
|
63
|
-
(val) => val <= 10 || "Value should not be bigger than 10",
|
|
64
|
-
(val) => val <= 11 || "It should be really not bigger than 10!!!!"
|
|
65
|
-
])
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
export const WithoutIndicators = {
|
|
69
|
-
render: Docs.render,
|
|
70
|
-
args: {
|
|
71
|
-
...Docs.args,
|
|
72
|
-
indicators: false
|
|
73
|
-
}
|
|
74
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type Meta, type StoryObj } from "@storybook/vue3";
|
|
2
|
-
import AntRangeSlider from "../AntRangeSlider.vue";
|
|
3
|
-
declare const meta: Meta<typeof AntRangeSlider>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AntRangeSlider>;
|
|
6
|
-
export declare const Docs: Story;
|