@antify/ui-module 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +131 -0
- package/dist/module.d.ts +131 -0
- package/dist/module.json +5 -0
- package/dist/module.mjs +339 -0
- package/dist/runtime/assets/tailwind.css +1 -0
- package/dist/runtime/components/AntAccordion.vue +59 -0
- package/dist/runtime/components/AntAccordionItem.vue +66 -0
- package/dist/runtime/components/AntAlert.vue +137 -0
- package/dist/runtime/components/AntDropdown.vue +79 -0
- package/dist/runtime/components/AntIcon.vue +51 -0
- package/dist/runtime/components/AntKeycap.vue +24 -0
- package/dist/runtime/components/AntListGroup.vue +24 -0
- package/dist/runtime/components/AntListGroupItem.vue +81 -0
- package/dist/runtime/components/AntModal.vue +87 -0
- package/dist/runtime/components/AntPagination.vue +201 -0
- package/dist/runtime/components/AntPopover.vue +112 -0
- package/dist/runtime/components/AntSkeleton.vue +38 -0
- package/dist/runtime/components/AntSpinner.vue +95 -0
- package/dist/runtime/components/AntTag.vue +79 -0
- package/dist/runtime/components/AntToast.vue +109 -0
- package/dist/runtime/components/AntToaster.vue +46 -0
- package/dist/runtime/components/AntTooltip.vue +165 -0
- package/dist/runtime/components/Main.stories.mdx +10 -0
- package/dist/runtime/components/__stories/AntAccordion.stories.d.ts +9 -0
- package/dist/runtime/components/__stories/AntAccordion.stories.mjs +97 -0
- package/dist/runtime/components/__stories/AntAlert.stories.d.ts +10 -0
- package/dist/runtime/components/__stories/AntAlert.stories.mjs +75 -0
- package/dist/runtime/components/__stories/AntDropdown.stories.d.ts +6 -0
- package/dist/runtime/components/__stories/AntDropdown.stories.mjs +52 -0
- package/dist/runtime/components/__stories/AntIcon.stories.d.ts +8 -0
- package/dist/runtime/components/__stories/AntIcon.stories.mjs +90 -0
- package/dist/runtime/components/__stories/AntKeycap.stories.d.ts +9 -0
- package/dist/runtime/components/__stories/AntKeycap.stories.mjs +59 -0
- package/dist/runtime/components/__stories/AntListGroup.stories.d.ts +7 -0
- package/dist/runtime/components/__stories/AntListGroup.stories.mjs +36 -0
- package/dist/runtime/components/__stories/AntListGroupItem.stories.d.ts +10 -0
- package/dist/runtime/components/__stories/AntListGroupItem.stories.mjs +62 -0
- package/dist/runtime/components/__stories/AntModal.stories.d.ts +7 -0
- package/dist/runtime/components/__stories/AntModal.stories.mjs +78 -0
- package/dist/runtime/components/__stories/AntPagination.stories.d.ts +8 -0
- package/dist/runtime/components/__stories/AntPagination.stories.mjs +39 -0
- package/dist/runtime/components/__stories/AntPopover.stories.d.ts +6 -0
- package/dist/runtime/components/__stories/AntPopover.stories.mjs +47 -0
- package/dist/runtime/components/__stories/AntSkeleton.stories.d.ts +8 -0
- package/dist/runtime/components/__stories/AntSkeleton.stories.mjs +43 -0
- package/dist/runtime/components/__stories/AntSpinner.stories.d.ts +6 -0
- package/dist/runtime/components/__stories/AntSpinner.stories.mjs +34 -0
- package/dist/runtime/components/__stories/AntTag.stories.d.ts +7 -0
- package/dist/runtime/components/__stories/AntTag.stories.mjs +44 -0
- package/dist/runtime/components/__stories/AntToast.stories.d.ts +8 -0
- package/dist/runtime/components/__stories/AntToast.stories.mjs +66 -0
- package/dist/runtime/components/__stories/AntToaster.stories.d.ts +34 -0
- package/dist/runtime/components/__stories/AntToaster.stories.mjs +42 -0
- package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +6 -0
- package/dist/runtime/components/__stories/AntTooltip.stories.mjs +43 -0
- package/dist/runtime/components/__types/Accordion.types.d.ts +4 -0
- package/dist/runtime/components/__types/Accordion.types.mjs +5 -0
- package/dist/runtime/components/__types/AntIcon.types.d.ts +5 -0
- package/dist/runtime/components/__types/AntIcon.types.mjs +6 -0
- package/dist/runtime/components/__types/AntToaster.types.d.ts +8 -0
- package/dist/runtime/components/__types/AntToaster.types.mjs +0 -0
- package/dist/runtime/components/__types/index.d.ts +2 -0
- package/dist/runtime/components/__types/index.mjs +2 -0
- package/dist/runtime/components/buttons/AntButton.vue +227 -0
- package/dist/runtime/components/buttons/AntCreateButton.vue +32 -0
- package/dist/runtime/components/buttons/AntDeleteButton.vue +32 -0
- package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +32 -0
- package/dist/runtime/components/buttons/AntSaveButton.vue +31 -0
- package/dist/runtime/components/buttons/__stories/AntButton.stories.d.ts +15 -0
- package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +272 -0
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +10 -0
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +57 -0
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +10 -0
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +57 -0
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +10 -0
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +57 -0
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +10 -0
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +57 -0
- package/dist/runtime/components/buttons/__types/AntButton.type.d.ts +4 -0
- package/dist/runtime/components/buttons/__types/AntButton.type.mjs +5 -0
- package/dist/runtime/components/buttons/__types/index.d.ts +1 -0
- package/dist/runtime/components/buttons/__types/index.mjs +1 -0
- package/dist/runtime/components/crud/AntCrud.vue +42 -0
- package/dist/runtime/components/crud/AntCrudDetail.vue +11 -0
- package/dist/runtime/components/crud/AntCrudDetailActions.vue +51 -0
- package/dist/runtime/components/crud/AntCrudDetailNav.vue +51 -0
- package/dist/runtime/components/crud/AntCrudTableFilter.vue +120 -0
- package/dist/runtime/components/crud/AntCrudTableNav.vue +129 -0
- package/dist/runtime/components/crud/__stories/AntCrud.stories.d.ts +6 -0
- package/dist/runtime/components/crud/__stories/AntCrud.stories.mjs +126 -0
- package/dist/runtime/components/crud/__stories/AntCrudDetail.stories.d.ts +7 -0
- package/dist/runtime/components/crud/__stories/AntCrudDetail.stories.mjs +80 -0
- package/dist/runtime/components/crud/__stories/AntCrudDetailActions.stories.d.ts +6 -0
- package/dist/runtime/components/crud/__stories/AntCrudDetailActions.stories.mjs +25 -0
- package/dist/runtime/components/crud/__stories/AntCrudDetailNav.stories.d.ts +6 -0
- package/dist/runtime/components/crud/__stories/AntCrudDetailNav.stories.mjs +41 -0
- package/dist/runtime/components/crud/__stories/AntCrudTableFilter.stories.d.ts +6 -0
- package/dist/runtime/components/crud/__stories/AntCrudTableFilter.stories.mjs +25 -0
- package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.d.ts +8 -0
- package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.mjs +56 -0
- package/dist/runtime/components/dialogs/AntDeleteDialog.vue +29 -0
- package/dist/runtime/components/dialogs/AntDialog.vue +147 -0
- package/dist/runtime/components/dialogs/__stories/AndDeleteDialog.stories.d.ts +6 -0
- package/dist/runtime/components/dialogs/__stories/AndDeleteDialog.stories.mjs +30 -0
- package/dist/runtime/components/dialogs/__stories/AntDialog.stories.d.ts +6 -0
- package/dist/runtime/components/dialogs/__stories/AntDialog.stories.mjs +60 -0
- package/dist/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +145 -0
- package/dist/runtime/components/form/AntCheckboxWidget/AntCheckboxGroup.vue +91 -0
- package/dist/runtime/components/form/AntCheckboxWidget/__stories/AntCheckbox.stories.d.ts +8 -0
- package/dist/runtime/components/form/AntCheckboxWidget/__stories/AntCheckbox.stories.mjs +286 -0
- package/dist/runtime/components/form/AntCheckboxWidget/__stories/AntCheckboxGroup.stories.d.ts +7 -0
- package/dist/runtime/components/form/AntCheckboxWidget/__stories/AntCheckboxGroup.stories.mjs +96 -0
- package/dist/runtime/components/form/AntCheckboxWidget/__types/AntCheckbox.d.ts +6 -0
- package/dist/runtime/components/form/AntCheckboxWidget/__types/AntCheckbox.mjs +0 -0
- package/dist/runtime/components/form/AntFormGroup.vue +21 -0
- package/dist/runtime/components/form/AntFormGroupLabel.vue +5 -0
- package/dist/runtime/components/form/AntNumberInput.vue +170 -0
- package/dist/runtime/components/form/AntRadioWidget/AntRadio.vue +139 -0
- package/dist/runtime/components/form/AntRadioWidget/AntRadioGroup.vue +80 -0
- package/dist/runtime/components/form/AntRadioWidget/__stories/AntRadio.stories.d.ts +8 -0
- package/dist/runtime/components/form/AntRadioWidget/__stories/AntRadio.stories.mjs +79 -0
- package/dist/runtime/components/form/AntRadioWidget/__stories/AntRadioGroup.stories.d.ts +8 -0
- package/dist/runtime/components/form/AntRadioWidget/__stories/AntRadioGroup.stories.mjs +125 -0
- package/dist/runtime/components/form/AntRadioWidget/__types/AntRadio.type.d.ts +9 -0
- package/dist/runtime/components/form/AntRadioWidget/__types/AntRadio.type.mjs +0 -0
- package/dist/runtime/components/form/AntRangeSlider.vue +81 -0
- package/dist/runtime/components/form/AntRichTextEditor.vue +237 -0
- package/dist/runtime/components/form/AntSearch.vue +76 -0
- package/dist/runtime/components/form/AntSelect.vue +346 -0
- package/dist/runtime/components/form/AntSwitch.vue +145 -0
- package/dist/runtime/components/form/AntSwitcher.vue +184 -0
- package/dist/runtime/components/form/AntTextInput.vue +73 -0
- package/dist/runtime/components/form/AntTextarea.vue +170 -0
- package/dist/runtime/components/form/AntUnitInput.vue +99 -0
- package/dist/runtime/components/form/Elements/AntBaseInput.vue +216 -0
- package/dist/runtime/components/form/Elements/AntDropDown.vue +160 -0
- package/dist/runtime/components/form/Elements/AntField.vue +102 -0
- package/dist/runtime/components/form/Elements/AntInputDescription.vue +55 -0
- package/dist/runtime/components/form/Elements/AntInputLabel.vue +55 -0
- package/dist/runtime/components/form/Elements/AntInputLimiter.vue +55 -0
- package/dist/runtime/components/form/Elements/__stories/AntBaseInput.stories.d.ts +9 -0
- package/dist/runtime/components/form/Elements/__stories/AntBaseInput.stories.mjs +168 -0
- package/dist/runtime/components/form/Elements/__stories/AntField.stories.d.ts +6 -0
- package/dist/runtime/components/form/Elements/__stories/AntField.stories.mjs +80 -0
- package/dist/runtime/components/form/Elements/__stories/AntInputDescription.stories.d.ts +6 -0
- package/dist/runtime/components/form/Elements/__stories/AntInputDescription.stories.mjs +34 -0
- package/dist/runtime/components/form/Elements/__stories/AntInputLabel.stories.d.ts +7 -0
- package/dist/runtime/components/form/Elements/__stories/AntInputLabel.stories.mjs +46 -0
- package/dist/runtime/components/form/Elements/__stories/AntInputLimiter.stories.d.ts +6 -0
- package/dist/runtime/components/form/Elements/__stories/AntInputLimiter.stories.mjs +37 -0
- package/dist/runtime/components/form/Elements/__types/AntBaseInput.type.d.ts +16 -0
- package/dist/runtime/components/form/Elements/__types/AntBaseInput.type.mjs +17 -0
- package/dist/runtime/components/form/Elements/__types/index.d.ts +1 -0
- package/dist/runtime/components/form/Elements/__types/index.mjs +1 -0
- package/dist/runtime/components/form/Elements/index.d.ts +6 -0
- package/dist/runtime/components/form/Elements/index.mjs +12 -0
- package/dist/runtime/components/form/__stories/AntFormGroup.stories.d.ts +6 -0
- package/dist/runtime/components/form/__stories/AntFormGroup.stories.mjs +33 -0
- package/dist/runtime/components/form/__stories/AntFormGroupLabel.stories.d.ts +6 -0
- package/dist/runtime/components/form/__stories/AntFormGroupLabel.stories.mjs +20 -0
- package/dist/runtime/components/form/__stories/AntNumberInput.stories.d.ts +7 -0
- package/dist/runtime/components/form/__stories/AntNumberInput.stories.mjs +67 -0
- package/dist/runtime/components/form/__stories/AntRangeSlider.stories.d.ts +6 -0
- package/dist/runtime/components/form/__stories/AntRangeSlider.stories.mjs +40 -0
- package/dist/runtime/components/form/__stories/AntRichTextEditor.stories-old.d.ts +0 -0
- package/dist/runtime/components/form/__stories/AntRichTextEditor.stories-old.mjs +0 -0
- package/dist/runtime/components/form/__stories/AntSearch.stories.d.ts +6 -0
- package/dist/runtime/components/form/__stories/AntSearch.stories.mjs +43 -0
- package/dist/runtime/components/form/__stories/AntSelect.stories.d.ts +13 -0
- package/dist/runtime/components/form/__stories/AntSelect.stories.mjs +220 -0
- package/dist/runtime/components/form/__stories/AntSwitch.stories.d.ts +8 -0
- package/dist/runtime/components/form/__stories/AntSwitch.stories.mjs +215 -0
- package/dist/runtime/components/form/__stories/AntSwitcher.stories.d.ts +8 -0
- package/dist/runtime/components/form/__stories/AntSwitcher.stories.mjs +225 -0
- package/dist/runtime/components/form/__stories/AntTextInput.stories.d.ts +7 -0
- package/dist/runtime/components/form/__stories/AntTextInput.stories.mjs +68 -0
- package/dist/runtime/components/form/__stories/AntTextarea.stories.d.ts +8 -0
- package/dist/runtime/components/form/__stories/AntTextarea.stories.mjs +128 -0
- package/dist/runtime/components/form/__stories/AntUnitInput.stories.d.ts +8 -0
- package/dist/runtime/components/form/__stories/AntUnitInput.stories.mjs +84 -0
- package/dist/runtime/components/form/__types/AntSelect.type.d.ts +4 -0
- package/dist/runtime/components/form/__types/AntSelect.type.mjs +0 -0
- package/dist/runtime/components/form/__types/AntSwitcher.type.d.ts +4 -0
- package/dist/runtime/components/form/__types/AntSwitcher.type.mjs +0 -0
- package/dist/runtime/components/form/__types/AntTextInput.type.d.ts +7 -0
- package/dist/runtime/components/form/__types/AntTextInput.type.mjs +8 -0
- package/dist/runtime/components/form/__types/index.d.ts +3 -0
- package/dist/runtime/components/form/__types/index.mjs +3 -0
- package/dist/runtime/components/form/index.d.ts +11 -0
- package/dist/runtime/components/form/index.mjs +22 -0
- package/dist/runtime/components/index.d.ts +22 -0
- package/dist/runtime/components/index.mjs +41 -0
- package/dist/runtime/components/layouts/AntNavLeftLayout.vue +36 -0
- package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.d.ts +7 -0
- package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.mjs +68 -0
- package/dist/runtime/components/navbar/AntNavbar.vue +25 -0
- package/dist/runtime/components/navbar/AntNavbarItem.vue +78 -0
- package/dist/runtime/components/navbar/__stories/AntNavbar.stories.d.ts +6 -0
- package/dist/runtime/components/navbar/__stories/AntNavbar.stories.mjs +66 -0
- package/dist/runtime/components/navbar/__types/NavbarItem.d.ts +10 -0
- package/dist/runtime/components/navbar/__types/NavbarItem.mjs +0 -0
- package/dist/runtime/components/table/AntTable.vue +192 -0
- package/dist/runtime/components/table/AntTableSortButton.vue +26 -0
- package/dist/runtime/components/table/AntTd.vue +70 -0
- package/dist/runtime/components/table/AntTh.vue +67 -0
- package/dist/runtime/components/table/__stories/AntTable.stories.d.ts +9 -0
- package/dist/runtime/components/table/__stories/AntTable.stories.mjs +274 -0
- package/dist/runtime/components/table/__types/TableHeader.type.d.ts +31 -0
- package/dist/runtime/components/table/__types/TableHeader.type.mjs +19 -0
- package/dist/runtime/components/tabs/AntTabItem.vue +115 -0
- package/dist/runtime/components/tabs/AntTabs.vue +47 -0
- package/dist/runtime/components/tabs/__stories/AntTabItem.stories.d.ts +6 -0
- package/dist/runtime/components/tabs/__stories/AntTabItem.stories.mjs +32 -0
- package/dist/runtime/components/tabs/__stories/AntTabs.stories.d.ts +9 -0
- package/dist/runtime/components/tabs/__stories/AntTabs.stories.mjs +173 -0
- package/dist/runtime/components/tabs/__types/AntTabItem.types.d.ts +17 -0
- package/dist/runtime/components/tabs/__types/AntTabItem.types.mjs +6 -0
- package/dist/runtime/components/transitions/AntTransitionCollapseHeight.vue +92 -0
- package/dist/runtime/composables/useUi.d.ts +20 -0
- package/dist/runtime/composables/useUi.mjs +31 -0
- package/dist/runtime/composables/useUiClient.d.ts +34 -0
- package/dist/runtime/composables/useUiClient.mjs +61 -0
- package/dist/runtime/composables/useValidator.d.ts +1 -0
- package/dist/runtime/composables/useValidator.mjs +1 -0
- package/dist/runtime/enums/ColorType.enum.d.ts +16 -0
- package/dist/runtime/enums/ColorType.enum.mjs +18 -0
- package/dist/runtime/enums/Direction.enum.d.ts +4 -0
- package/dist/runtime/enums/Direction.enum.mjs +5 -0
- package/dist/runtime/enums/Grouped.enum.d.ts +6 -0
- package/dist/runtime/enums/Grouped.enum.mjs +7 -0
- package/dist/runtime/enums/Position.enum.d.ts +12 -0
- package/dist/runtime/enums/Position.enum.mjs +14 -0
- package/dist/runtime/enums/Size.enum.d.ts +4 -0
- package/dist/runtime/enums/Size.enum.mjs +5 -0
- package/dist/runtime/enums/index.d.ts +4 -0
- package/dist/runtime/enums/index.mjs +4 -0
- package/dist/runtime/env.d.ts +8 -0
- package/dist/runtime/handler.d.ts +1 -0
- package/dist/runtime/handler.mjs +5 -0
- package/dist/runtime/plugins/toaster.d.ts +22 -0
- package/dist/runtime/plugins/toaster.mjs +53 -0
- package/dist/runtime/plugins/ui-module.d.ts +2 -0
- package/dist/runtime/plugins/ui-module.mjs +13 -0
- package/dist/runtime/shims/vue.d.ts +5 -0
- package/dist/runtime/tailwind.config.d.ts +182 -0
- package/dist/runtime/tailwind.config.mjs +196 -0
- package/dist/runtime/types/AntListGroupItem.type.d.ts +11 -0
- package/dist/runtime/types/AntListGroupItem.type.mjs +12 -0
- package/dist/runtime/types/AntTag.type.d.ts +8 -0
- package/dist/runtime/types/AntTag.type.mjs +9 -0
- package/dist/runtime/types/Checkbox.type.d.ts +8 -0
- package/dist/runtime/types/Checkbox.type.mjs +0 -0
- package/dist/runtime/types/NavItem.type.d.ts +9 -0
- package/dist/runtime/types/NavItem.type.mjs +0 -0
- package/dist/runtime/types/RadioButton.type.d.ts +5 -0
- package/dist/runtime/types/RadioButton.type.mjs +0 -0
- package/dist/runtime/types/Tabs.type.d.ts +6 -0
- package/dist/runtime/types/Tabs.type.mjs +0 -0
- package/dist/runtime/types/Toaster.type.d.ts +6 -0
- package/dist/runtime/types/Toaster.type.mjs +0 -0
- package/dist/runtime/types/index.d.ts +7 -0
- package/dist/runtime/types/index.mjs +7 -0
- package/dist/runtime/types.d.ts +7 -0
- package/dist/runtime/types.mjs +7 -0
- package/dist/runtime/utils/helper.d.ts +4 -0
- package/dist/runtime/utils/helper.mjs +12 -0
- package/dist/runtime/utils.d.ts +14 -0
- package/dist/runtime/utils.mjs +20 -0
- package/dist/types.d.mts +8 -0
- package/dist/types.d.ts +8 -0
- package/package.json +81 -0
- package/src/runtime/components/AntAccordion.vue +59 -0
- package/src/runtime/components/AntAccordionItem.vue +104 -0
- package/src/runtime/components/AntAlert.vue +137 -0
- package/src/runtime/components/AntDropdown.vue +100 -0
- package/src/runtime/components/AntIcon.vue +51 -0
- package/src/runtime/components/AntKeycap.vue +24 -0
- package/src/runtime/components/AntListGroup.vue +24 -0
- package/src/runtime/components/AntListGroupItem.vue +81 -0
- package/src/runtime/components/AntModal.vue +129 -0
- package/src/runtime/components/AntPagination.vue +201 -0
- package/src/runtime/components/AntPopover.vue +133 -0
- package/src/runtime/components/AntSkeleton.vue +38 -0
- package/src/runtime/components/AntSpinner.vue +95 -0
- package/src/runtime/components/AntTag.vue +79 -0
- package/src/runtime/components/AntToast.vue +109 -0
- package/src/runtime/components/AntToaster.vue +71 -0
- package/src/runtime/components/AntTooltip.vue +165 -0
- package/src/runtime/components/buttons/AntButton.vue +227 -0
- package/src/runtime/components/buttons/AntCreateButton.vue +32 -0
- package/src/runtime/components/buttons/AntDeleteButton.vue +32 -0
- package/src/runtime/components/buttons/AntSaveAndNewButton.vue +32 -0
- package/src/runtime/components/buttons/AntSaveButton.vue +31 -0
- package/src/runtime/components/crud/AntCrud.vue +66 -0
- package/src/runtime/components/crud/AntCrudDetail.vue +11 -0
- package/src/runtime/components/crud/AntCrudDetailActions.vue +51 -0
- package/src/runtime/components/crud/AntCrudDetailNav.vue +51 -0
- package/src/runtime/components/crud/AntCrudTableFilter.vue +120 -0
- package/src/runtime/components/crud/AntCrudTableNav.vue +129 -0
- package/src/runtime/components/dialogs/AntDeleteDialog.vue +29 -0
- package/src/runtime/components/dialogs/AntDialog.vue +181 -0
- package/src/runtime/components/form/AntCheckboxWidget/AntCheckbox.vue +167 -0
- package/src/runtime/components/form/AntCheckboxWidget/AntCheckboxGroup.vue +91 -0
- package/src/runtime/components/form/AntFormGroup.vue +21 -0
- package/src/runtime/components/form/AntFormGroupLabel.vue +5 -0
- package/src/runtime/components/form/AntNumberInput.vue +170 -0
- package/src/runtime/components/form/AntRadioWidget/AntRadio.vue +164 -0
- package/src/runtime/components/form/AntRadioWidget/AntRadioGroup.vue +80 -0
- package/src/runtime/components/form/AntRangeSlider.vue +101 -0
- package/src/runtime/components/form/AntRichTextEditor.vue +237 -0
- package/src/runtime/components/form/AntSearch.vue +76 -0
- package/src/runtime/components/form/AntSelect.vue +346 -0
- package/src/runtime/components/form/AntSwitch.vue +145 -0
- package/src/runtime/components/form/AntSwitcher.vue +200 -0
- package/src/runtime/components/form/AntTextInput.vue +73 -0
- package/src/runtime/components/form/AntTextarea.vue +170 -0
- package/src/runtime/components/form/AntUnitInput.vue +99 -0
- package/src/runtime/components/form/Elements/AntBaseInput.vue +247 -0
- package/src/runtime/components/form/Elements/AntDropDown.vue +160 -0
- package/src/runtime/components/form/Elements/AntField.vue +102 -0
- package/src/runtime/components/form/Elements/AntInputDescription.vue +55 -0
- package/src/runtime/components/form/Elements/AntInputLabel.vue +55 -0
- package/src/runtime/components/form/Elements/AntInputLimiter.vue +55 -0
- package/src/runtime/components/layouts/AntNavLeftLayout.vue +36 -0
- package/src/runtime/components/navbar/AntNavbar.vue +25 -0
- package/src/runtime/components/navbar/AntNavbarItem.vue +78 -0
- package/src/runtime/components/table/AntTable.vue +192 -0
- package/src/runtime/components/table/AntTableSortButton.vue +26 -0
- package/src/runtime/components/table/AntTd.vue +70 -0
- package/src/runtime/components/table/AntTh.vue +67 -0
- package/src/runtime/components/tabs/AntTabItem.vue +115 -0
- package/src/runtime/components/tabs/AntTabs.vue +47 -0
- package/src/runtime/components/transitions/AntTransitionCollapseHeight.vue +96 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {onMounted} from 'vue';
|
|
3
|
+
import AntField from './Elements/AntField.vue'
|
|
4
|
+
import AntBaseInput from './Elements/AntBaseInput.vue'
|
|
5
|
+
import {Size} from '../../enums/Size.enum'
|
|
6
|
+
import {TextInputType} from './__types/AntTextInput.type'
|
|
7
|
+
import {handleEnumValidation} from '../../handler';
|
|
8
|
+
import {useVModel} from '@vueuse/core';
|
|
9
|
+
import {InputColorType} from '../../enums';
|
|
10
|
+
import {BaseInputType} from './Elements/__types';
|
|
11
|
+
|
|
12
|
+
defineOptions({ inheritAttrs: false });
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(['update:modelValue', 'update:skeleton', 'validate']);
|
|
15
|
+
const props = withDefaults(defineProps<{
|
|
16
|
+
modelValue: string | null;
|
|
17
|
+
label?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
size?: Size;
|
|
21
|
+
colorType?: InputColorType;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
skeleton?: boolean;
|
|
24
|
+
type?: TextInputType;
|
|
25
|
+
limiter?: boolean;
|
|
26
|
+
max?: number;
|
|
27
|
+
errors?: string[];
|
|
28
|
+
}>(), {
|
|
29
|
+
colorType: InputColorType.base,
|
|
30
|
+
disabled: false,
|
|
31
|
+
skeleton: false,
|
|
32
|
+
size: Size.md,
|
|
33
|
+
type: TextInputType.text,
|
|
34
|
+
limiter: false,
|
|
35
|
+
errors: []
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const _value = useVModel(props, 'modelValue', emit);
|
|
39
|
+
|
|
40
|
+
onMounted(() => {
|
|
41
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
42
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
43
|
+
handleEnumValidation(props.type, TextInputType, 'Type');
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<AntField
|
|
49
|
+
:label="label"
|
|
50
|
+
:size="size"
|
|
51
|
+
:skeleton="skeleton"
|
|
52
|
+
:description="description"
|
|
53
|
+
:colorType="colorType"
|
|
54
|
+
:limiter-max-value="limiter && max !== undefined ? max : undefined"
|
|
55
|
+
:limiter-value="limiter ? _value?.length : undefined"
|
|
56
|
+
:errors="errors"
|
|
57
|
+
>
|
|
58
|
+
<AntBaseInput
|
|
59
|
+
v-model:value="_value"
|
|
60
|
+
:type="type as unknown as BaseInputType"
|
|
61
|
+
wrapper-class="flex-grow"
|
|
62
|
+
:colorType="colorType"
|
|
63
|
+
:size="size"
|
|
64
|
+
:skeleton="skeleton"
|
|
65
|
+
:disabled="disabled"
|
|
66
|
+
:placeholder="placeholder !== undefined ? placeholder : label"
|
|
67
|
+
:show-icon="false"
|
|
68
|
+
v-bind="$attrs"
|
|
69
|
+
:has-errors="errors.length > 0"
|
|
70
|
+
@validate="val => $emit('validate', val)"
|
|
71
|
+
/>
|
|
72
|
+
</AntField>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,170 @@
|
|
|
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 {Grouped} from '../../enums/Grouped.enum';
|
|
7
|
+
import {
|
|
8
|
+
faExclamationTriangle,
|
|
9
|
+
faExclamationCircle,
|
|
10
|
+
faCircleCheck,
|
|
11
|
+
faCircleInfo
|
|
12
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
13
|
+
import {handleEnumValidation} from '../../handler';
|
|
14
|
+
import {classesToObjectSyntax} from '../../utils';
|
|
15
|
+
import AntField from './Elements/AntField.vue';
|
|
16
|
+
import {useVModel} from '@vueuse/core';
|
|
17
|
+
import {InputColorType} from '../../enums';
|
|
18
|
+
import {IconSize} from '../__types';
|
|
19
|
+
|
|
20
|
+
defineOptions({ inheritAttrs: false });
|
|
21
|
+
|
|
22
|
+
const emit = defineEmits(['update:modelValue', 'validate', 'blur']);
|
|
23
|
+
const props = withDefaults(defineProps<{
|
|
24
|
+
modelValue: string | null;
|
|
25
|
+
size?: Size;
|
|
26
|
+
colorType?: InputColorType;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
skeleton?: boolean;
|
|
29
|
+
grouped?: Grouped;
|
|
30
|
+
wrapperClass?: string | Record<string, boolean>;
|
|
31
|
+
showIcon?: boolean;
|
|
32
|
+
label?: string;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
limiter?: boolean;
|
|
36
|
+
max?: number;
|
|
37
|
+
errors?: string[];
|
|
38
|
+
}>(), {
|
|
39
|
+
colorType: InputColorType.base,
|
|
40
|
+
disabled: false,
|
|
41
|
+
size: Size.md,
|
|
42
|
+
skeleton: false,
|
|
43
|
+
grouped: Grouped.none,
|
|
44
|
+
showIcon: true,
|
|
45
|
+
limiter: false,
|
|
46
|
+
errors: []
|
|
47
|
+
});
|
|
48
|
+
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
49
|
+
const icons = {
|
|
50
|
+
[InputColorType.info]: faCircleInfo,
|
|
51
|
+
[InputColorType.warning]: faExclamationTriangle,
|
|
52
|
+
[InputColorType.danger]: faExclamationCircle,
|
|
53
|
+
[InputColorType.success]: faCircleCheck,
|
|
54
|
+
[InputColorType.base]: null,
|
|
55
|
+
};
|
|
56
|
+
const inputClasses = computed(() => {
|
|
57
|
+
const variants: Record<InputColorType, string> = {
|
|
58
|
+
[InputColorType.base]: 'outline-neutral-300 focus:outline-primary-500 focus:ring-primary/25 bg-neutral-50 placeholder:text-neutral-500',
|
|
59
|
+
[InputColorType.danger]: 'outline-danger-500 focus:outline-danger-500 focus:ring-danger/25 bg-danger-100 placeholder:text-danger-700',
|
|
60
|
+
[InputColorType.info]: 'outline-info-500 focus:outline-info-500 focus:ring-info/25 bg-info-100 placeholder:text-info-700',
|
|
61
|
+
[InputColorType.success]: 'outline-success-500 focus:outline-success-500 focus:ring-success/25 bg-success-100 placeholder:text-success-700',
|
|
62
|
+
[InputColorType.warning]: 'outline-warning-500 focus:outline-warning-500 focus:ring-warning/25 bg-warning-100 placeholder:text-warning-700',
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
'block transition-colors relative border-none outline w-full focus:z-10': true,
|
|
66
|
+
'outline-offset-[-1px] outline-1 focus:outline-offset-[-1px] focus:outline-1': true,
|
|
67
|
+
'disabled:opacity-50 disabled:cursor-not-allowed': props.disabled,
|
|
68
|
+
[variants[_colorType.value]]: true,
|
|
69
|
+
// Size
|
|
70
|
+
'focus:ring-2 p-1.5 text-xs': props.size === Size.sm,
|
|
71
|
+
'focus:ring-4 p-2.5 text-sm': props.size === Size.md,
|
|
72
|
+
// Icon right
|
|
73
|
+
'pr-7': props.size === Size.sm && props.showIcon && icon.value,
|
|
74
|
+
'pr-10': props.size === Size.md && props.showIcon && icon.value,
|
|
75
|
+
// Grouped
|
|
76
|
+
'rounded-tl-md rounded-bl-md rounded-tr-none rounded-br-none': props.grouped === Grouped.left,
|
|
77
|
+
'rounded-none': props.grouped === Grouped.center,
|
|
78
|
+
'rounded-tl-none rounded-bl-none rounded-tr-md rounded-br-md': props.grouped === Grouped.right,
|
|
79
|
+
'rounded-md': props.grouped === Grouped.none,
|
|
80
|
+
'invisible': props.skeleton
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const iconColor = computed(() => {
|
|
84
|
+
const variants = {
|
|
85
|
+
'base': undefined,
|
|
86
|
+
'danger': 'text-danger-500',
|
|
87
|
+
'info': 'text-info-500',
|
|
88
|
+
'primary': 'text-primary-500',
|
|
89
|
+
'secondary': 'text-secondary-500',
|
|
90
|
+
'success': 'text-success-500',
|
|
91
|
+
'warning': 'text-warning-500',
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return variants[_colorType.value];
|
|
95
|
+
});
|
|
96
|
+
const _wrapperClass = computed(() => classesToObjectSyntax(props.wrapperClass));
|
|
97
|
+
const icon = computed(() => icons[_colorType.value]);
|
|
98
|
+
const hasErrors = computed(() => props.errors.length > 0);
|
|
99
|
+
const _colorType = computed(() => hasErrors.value ? InputColorType.danger : props.colorType);
|
|
100
|
+
|
|
101
|
+
onMounted(() => {
|
|
102
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
103
|
+
handleEnumValidation(props.grouped, Grouped, 'grouped');
|
|
104
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
105
|
+
|
|
106
|
+
if (!props.skeleton && props.modelValue !== null) {
|
|
107
|
+
emit('validate', props.modelValue);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
watch(() => props.skeleton, (val) => {
|
|
112
|
+
if (!val && props.modelValue !== null) {
|
|
113
|
+
emit('validate', props.modelValue);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
watch(_modelValue, (val) => {
|
|
118
|
+
if (hasErrors.value) {
|
|
119
|
+
emit('validate', val);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
function onBlur(e: FocusEvent) {
|
|
124
|
+
emit('validate', props.modelValue);
|
|
125
|
+
emit('blur', e);
|
|
126
|
+
}
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<template>
|
|
130
|
+
<AntField
|
|
131
|
+
:label="label"
|
|
132
|
+
:size="size"
|
|
133
|
+
:skeleton="skeleton"
|
|
134
|
+
:description="description"
|
|
135
|
+
:colorType="colorType"
|
|
136
|
+
:limiter-max-value="limiter && max !== undefined ? max : undefined"
|
|
137
|
+
:limiter-value="limiter ? _modelValue.length : undefined"
|
|
138
|
+
:errors="errors"
|
|
139
|
+
>
|
|
140
|
+
<div class="block relative w-full" :class="{...{'-mr-px': grouped !== Grouped.none}, ..._wrapperClass}">
|
|
141
|
+
<textarea
|
|
142
|
+
v-model="_modelValue"
|
|
143
|
+
:class="inputClasses"
|
|
144
|
+
:placeholder="placeholder !== undefined ? placeholder : label"
|
|
145
|
+
:disabled="disabled || skeleton"
|
|
146
|
+
v-bind="$attrs"
|
|
147
|
+
@blur="onBlur"
|
|
148
|
+
/>
|
|
149
|
+
|
|
150
|
+
<div
|
|
151
|
+
v-if="showIcon && icon"
|
|
152
|
+
class="absolute flex w-fit right-0 top-0 transition-all z-20"
|
|
153
|
+
:class="{'p-1.5': size === Size.sm, 'p-2.5': size === Size.md}"
|
|
154
|
+
>
|
|
155
|
+
<AntIcon
|
|
156
|
+
:icon="icon"
|
|
157
|
+
:size="size as unknown as IconSize"
|
|
158
|
+
:color="iconColor"
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<AntSkeleton
|
|
163
|
+
v-if="skeleton"
|
|
164
|
+
absolute
|
|
165
|
+
:grouped="grouped"
|
|
166
|
+
rounded
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
</AntField>
|
|
170
|
+
</template>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import AntButton from '../buttons/AntButton.vue'
|
|
4
|
+
import AntField from './Elements/AntField.vue'
|
|
5
|
+
import AntBaseInput from './Elements/AntBaseInput.vue'
|
|
6
|
+
import {Size} from '../../enums/Size.enum'
|
|
7
|
+
import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import {useVModel} from '@vueuse/core';
|
|
9
|
+
import {ColorType, InputColorType} from '../../enums';
|
|
10
|
+
import {Grouped} from '../../enums/Grouped.enum';
|
|
11
|
+
import {BaseInputType} from './Elements/__types';
|
|
12
|
+
import {handleEnumValidation} from '../../handler';
|
|
13
|
+
import {FieldValidator} from '@antify/validate';
|
|
14
|
+
|
|
15
|
+
defineOptions({ inheritAttrs: false });
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<{
|
|
18
|
+
modelValue: number | null;
|
|
19
|
+
unit: string | IconDefinition;
|
|
20
|
+
label?: string;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
limiter?: boolean;
|
|
24
|
+
min?: number;
|
|
25
|
+
max?: number;
|
|
26
|
+
validator?: FieldValidator;
|
|
27
|
+
size?: Size;
|
|
28
|
+
colorType?: InputColorType;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
skeleton?: boolean;
|
|
31
|
+
wrapperClass?: string | Record<string, boolean>;
|
|
32
|
+
errors?: string[];
|
|
33
|
+
}>(), {
|
|
34
|
+
colorType: InputColorType.base,
|
|
35
|
+
disabled: false,
|
|
36
|
+
skeleton: false,
|
|
37
|
+
size: Size.md,
|
|
38
|
+
limiter: false,
|
|
39
|
+
errors: []
|
|
40
|
+
});
|
|
41
|
+
const emit = defineEmits(['update:modelValue', 'validate']);
|
|
42
|
+
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
43
|
+
const _colorType = computed(() => hasErrors.value ? InputColorType.danger : props.colorType);
|
|
44
|
+
const hasErrors = computed(() => props.errors.length > 0);
|
|
45
|
+
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
48
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<AntField
|
|
54
|
+
:label="label"
|
|
55
|
+
:size="size"
|
|
56
|
+
:skeleton="skeleton"
|
|
57
|
+
:description="description"
|
|
58
|
+
:colorType="colorType"
|
|
59
|
+
:validator="validator"
|
|
60
|
+
:limiter-max-value="limiter && max !== undefined ? max : undefined"
|
|
61
|
+
:limiter-value="limiter && _modelValue !== undefined && _modelValue !== null ? _modelValue : undefined"
|
|
62
|
+
:errors="errors"
|
|
63
|
+
>
|
|
64
|
+
<div
|
|
65
|
+
class="flex relative"
|
|
66
|
+
>
|
|
67
|
+
<AntBaseInput
|
|
68
|
+
v-model:value="_modelValue"
|
|
69
|
+
:type="BaseInputType.number"
|
|
70
|
+
:grouped="Grouped.left"
|
|
71
|
+
wrapper-class="flex-grow"
|
|
72
|
+
:color-type="colorType"
|
|
73
|
+
:size="size"
|
|
74
|
+
:min="min"
|
|
75
|
+
:max="max"
|
|
76
|
+
:skeleton="skeleton"
|
|
77
|
+
:disabled="disabled"
|
|
78
|
+
:placeholder="placeholder || label"
|
|
79
|
+
:show-icon="false"
|
|
80
|
+
:has-errors="hasErrors"
|
|
81
|
+
v-bind="$attrs"
|
|
82
|
+
@validate="val => $emit('validate', val)"
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<AntButton
|
|
86
|
+
:icon-left="typeof unit === 'object' ? unit : undefined"
|
|
87
|
+
:grouped="Grouped.right"
|
|
88
|
+
:color-type="_colorType as unknown as ColorType"
|
|
89
|
+
:size="size"
|
|
90
|
+
:skeleton="skeleton"
|
|
91
|
+
:readonly="true"
|
|
92
|
+
>
|
|
93
|
+
<span v-if="typeof unit === 'string'">
|
|
94
|
+
{{ unit }}
|
|
95
|
+
</span>
|
|
96
|
+
</AntButton>
|
|
97
|
+
</div>
|
|
98
|
+
</AntField>
|
|
99
|
+
</template>
|
|
@@ -0,0 +1,247 @@
|
|
|
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-neutral-50 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': 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
|
+
'h-4': props.size === Size.sm,
|
|
94
|
+
'h-5': props.size === Size.md,
|
|
95
|
+
}));
|
|
96
|
+
const iconColorClasses = computed(() => {
|
|
97
|
+
const variants: Record<InputColorType, string> = {
|
|
98
|
+
[InputColorType.base]: 'text-neutral-500',
|
|
99
|
+
[InputColorType.danger]: 'text-danger-500',
|
|
100
|
+
[InputColorType.info]: 'text-info-500',
|
|
101
|
+
[InputColorType.success]: 'text-success-500',
|
|
102
|
+
[InputColorType.warning]: 'text-warning-500',
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
[variants[_colorType.value]]: true,
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
const _wrapperClass = computed(() => classesToObjectSyntax(props.wrapperClass));
|
|
110
|
+
const icon = computed(() => icons[_colorType.value]);
|
|
111
|
+
const _value = computed<string | number | null>({
|
|
112
|
+
get: () => props.value,
|
|
113
|
+
set: (val: string | number | null) => {
|
|
114
|
+
if (props.type === BaseInputType.number && typeof val !== 'number') {
|
|
115
|
+
return emit('update:value', null);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
emit('update:value', val);
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
const _colorType = computed(() => props.hasErrors ? InputColorType.danger : props.colorType);
|
|
122
|
+
|
|
123
|
+
watch(_value, (val) => {
|
|
124
|
+
if (props.hasErrors) {
|
|
125
|
+
emit('validate', val)
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Validate default value if given after delayed data fetching.
|
|
131
|
+
*/
|
|
132
|
+
watch(() => props.skeleton, (val) => {
|
|
133
|
+
if (!val && props.value !== null) {
|
|
134
|
+
emit('validate', props.value)
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
onMounted(() => {
|
|
139
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
140
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
141
|
+
handleEnumValidation(props.type, BaseInputType, 'Type');
|
|
142
|
+
handleEnumValidation(props.grouped, Grouped, 'grouped');
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Validate default value without delayed data fetching.
|
|
146
|
+
*/
|
|
147
|
+
if (!props.skeleton && props.value !== null) {
|
|
148
|
+
emit('validate', props.value)
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
function onBlur(e: FocusEvent) {
|
|
153
|
+
emit('validate', props.value)
|
|
154
|
+
emit('blur', e);
|
|
155
|
+
}
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<template>
|
|
159
|
+
<div class="block relative w-full" :class="{...{'-mr-px': grouped !== Grouped.none}, ..._wrapperClass}">
|
|
160
|
+
<div
|
|
161
|
+
v-if="iconLeft"
|
|
162
|
+
class="absolute h-full flex items-center justify-center z-20"
|
|
163
|
+
:class="{'w-7': size === Size.sm, 'w-10': size === Size.md}"
|
|
164
|
+
>
|
|
165
|
+
<AntIcon
|
|
166
|
+
:icon="iconLeft"
|
|
167
|
+
:size="size as unknown as IconSize"
|
|
168
|
+
color="text-neutral-50-font"
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<input
|
|
173
|
+
v-model="_value"
|
|
174
|
+
:class="inputClasses"
|
|
175
|
+
:type="type"
|
|
176
|
+
:placeholder="placeholder"
|
|
177
|
+
:disabled="disabled || skeleton"
|
|
178
|
+
@blur="onBlur"
|
|
179
|
+
v-bind="$attrs"
|
|
180
|
+
>
|
|
181
|
+
|
|
182
|
+
<div
|
|
183
|
+
v-if="nullable && _value !== null && _value !== ''"
|
|
184
|
+
class="absolute flex w-fit right-0 top-0 h-full transition-all z-20"
|
|
185
|
+
:class="{'p-1.5': size === Size.sm, 'p-2.5': size === Size.md}"
|
|
186
|
+
>
|
|
187
|
+
<!-- TODO:: Replace with AntIcon -->
|
|
188
|
+
<fa-icon
|
|
189
|
+
:icon="faXmark"
|
|
190
|
+
:class="iconClasses"
|
|
191
|
+
class="text-neutral-500-font cursor-pointer"
|
|
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
|
+
<!-- TODO:: Replace with AntIcon -->
|
|
202
|
+
<fa-icon :icon="icon" :class="{...iconClasses, ...iconColorClasses}"/>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<AntSkeleton
|
|
206
|
+
v-if="skeleton"
|
|
207
|
+
absolute
|
|
208
|
+
:grouped="grouped"
|
|
209
|
+
rounded
|
|
210
|
+
/>
|
|
211
|
+
</div>
|
|
212
|
+
</template>
|
|
213
|
+
|
|
214
|
+
<style scoped>
|
|
215
|
+
/* Chrome, Safari, Edge, Opera */
|
|
216
|
+
input::-webkit-outer-spin-button,
|
|
217
|
+
input::-webkit-inner-spin-button {
|
|
218
|
+
-webkit-appearance: none;
|
|
219
|
+
margin: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* Firefox */
|
|
223
|
+
input[type=number] {
|
|
224
|
+
-moz-appearance: textfield;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* clears the "X" from Internet Explorer */
|
|
228
|
+
input[type=search]::-ms-clear {
|
|
229
|
+
display: none;
|
|
230
|
+
width: 0;
|
|
231
|
+
height: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
input[type=search]::-ms-reveal {
|
|
235
|
+
display: none;
|
|
236
|
+
width: 0;
|
|
237
|
+
height: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* clears the "X" from Chrome */
|
|
241
|
+
input[type="search"]::-webkit-search-decoration,
|
|
242
|
+
input[type="search"]::-webkit-search-cancel-button,
|
|
243
|
+
input[type="search"]::-webkit-search-results-button,
|
|
244
|
+
input[type="search"]::-webkit-search-results-decoration {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
247
|
+
</style>
|