@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,109 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted, useSlots} from 'vue';
|
|
3
|
+
import {handleEnumValidation} from '../handler';
|
|
4
|
+
import {
|
|
5
|
+
faCheckCircle,
|
|
6
|
+
faExclamationCircle,
|
|
7
|
+
faExclamationTriangle,
|
|
8
|
+
faInfoCircle,
|
|
9
|
+
faXmark
|
|
10
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
11
|
+
import AntIcon from './AntIcon.vue';
|
|
12
|
+
import AntButton from './buttons/AntButton.vue';
|
|
13
|
+
import {ColorType, InputColorType} from '../enums';
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<{
|
|
16
|
+
title?: string,
|
|
17
|
+
colorType?: InputColorType,
|
|
18
|
+
showUndo?: boolean,
|
|
19
|
+
icon?: boolean
|
|
20
|
+
}>(), {
|
|
21
|
+
colorType: InputColorType.base,
|
|
22
|
+
showUndo: false,
|
|
23
|
+
icon: true
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const icons = {
|
|
27
|
+
[InputColorType.base]: faInfoCircle,
|
|
28
|
+
[InputColorType.info]: faInfoCircle,
|
|
29
|
+
[InputColorType.danger]: faExclamationCircle,
|
|
30
|
+
[InputColorType.warning]: faExclamationTriangle,
|
|
31
|
+
[InputColorType.success]: faCheckCircle,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const _icon = computed(() => icons[props.colorType]);
|
|
35
|
+
const classes = computed(() => {
|
|
36
|
+
const variants: Record<InputColorType, string> = {
|
|
37
|
+
[InputColorType.base]: 'bg-neutral-100 border-neutral-500 text-neutral-500',
|
|
38
|
+
[InputColorType.danger]: 'bg-danger-100 border-danger-500 text-danger-500',
|
|
39
|
+
[InputColorType.info]: 'bg-info-100 border-info-500 text-info-500',
|
|
40
|
+
[InputColorType.success]: 'bg-success-100 border-success-500 text-success-500',
|
|
41
|
+
[InputColorType.warning]: 'bg-warning-100 border-warning-500 text-warning-500',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
'inline-flex flex-col gap-2.5 rounded-md p-2.5 border transition-colors shadow-md': true,
|
|
46
|
+
[variants[props.colorType]]: true,
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
const hasDefaultSlot = computed(() => useSlots()['default'] || false);
|
|
50
|
+
const iconColor = computed(() => {
|
|
51
|
+
const variants = {
|
|
52
|
+
[InputColorType.base]: 'text-neutral-100-font',
|
|
53
|
+
[InputColorType.danger]: 'text-danger-500',
|
|
54
|
+
[InputColorType.info]: 'text-info-500',
|
|
55
|
+
[InputColorType.success]: 'text-success-500',
|
|
56
|
+
[InputColorType.warning]: 'text-warning-500',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return variants[props.colorType];
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
onMounted(() => {
|
|
63
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<div
|
|
69
|
+
:class="classes"
|
|
70
|
+
data-e2e="toast"
|
|
71
|
+
>
|
|
72
|
+
<div class="inline-flex items-center justify-between w-content gap-2.5">
|
|
73
|
+
<div class="inline-flex items-center gap-2.5">
|
|
74
|
+
<AntIcon
|
|
75
|
+
v-if="icon"
|
|
76
|
+
:icon="_icon"
|
|
77
|
+
:color="iconColor"
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<div class="whitespace-pre" :class="{'font-semibold': hasDefaultSlot}">
|
|
81
|
+
<slot name="title">
|
|
82
|
+
{{ title }}
|
|
83
|
+
</slot>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<AntIcon
|
|
88
|
+
:icon="faXmark"
|
|
89
|
+
class="cursor-pointer"
|
|
90
|
+
:color="iconColor"
|
|
91
|
+
@click="() => $emit('close')"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div v-if="hasDefaultSlot">
|
|
96
|
+
<slot/>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div v-if="showUndo" class="flex justify-end">
|
|
100
|
+
<AntButton
|
|
101
|
+
:color-type="props.colorType as unknown as ColorType"
|
|
102
|
+
filled
|
|
103
|
+
@click="() => $emit('undo')"
|
|
104
|
+
>
|
|
105
|
+
undo
|
|
106
|
+
</AntButton>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</template>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
/**
|
|
3
|
+
* To let the toaster show toasts, use the plugin "$uiModule.toaster" property.
|
|
4
|
+
*/
|
|
5
|
+
import {computed} from 'vue';
|
|
6
|
+
import AntToast from './AntToast.vue';
|
|
7
|
+
import {CornerPosition} from '../enums/Position.enum';
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
position?: CornerPosition;
|
|
11
|
+
}>(), {
|
|
12
|
+
position: CornerPosition.bottomLeft
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const classes = computed(() => ({
|
|
16
|
+
'left-0 top-0': props.position === CornerPosition.topLeft,
|
|
17
|
+
'right-0 top-0': props.position === CornerPosition.topRight,
|
|
18
|
+
'left-0 bottom-0': props.position === CornerPosition.bottomLeft,
|
|
19
|
+
'right-0 bottom-0': props.position === CornerPosition.bottomRight,
|
|
20
|
+
}));
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div
|
|
25
|
+
class="absolute flex flex-col items-baseline space-y-2.5 p-2.5"
|
|
26
|
+
:class="classes"
|
|
27
|
+
data-e2e="toaster"
|
|
28
|
+
>
|
|
29
|
+
<TransitionGroup name="list">
|
|
30
|
+
<AntToast
|
|
31
|
+
v-for="toast of $uiModule.toaster.getToasts()"
|
|
32
|
+
:title="toast.title"
|
|
33
|
+
:color-type="toast.type"
|
|
34
|
+
:icon="toast.hasIcon"
|
|
35
|
+
@close="$uiModule.toaster.removeToast(toast)"
|
|
36
|
+
v-bind:key="`ant-toast-${toast.id}`"
|
|
37
|
+
>
|
|
38
|
+
<template v-if="toast.content" #default>{{ toast.content }}</template>
|
|
39
|
+
</AntToast>
|
|
40
|
+
</TransitionGroup>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
.list-move {
|
|
46
|
+
transition: all 0.5s ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.list-enter-active{
|
|
50
|
+
animation: bounce-in-left .6s;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.list-leave-active {
|
|
54
|
+
animation: bounce-in-left .4s reverse;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes bounce-in-left {
|
|
58
|
+
0% {
|
|
59
|
+
transform: translateX(-10rem);
|
|
60
|
+
opacity: 0;
|
|
61
|
+
}
|
|
62
|
+
50% {
|
|
63
|
+
transform: translateX(.5rem);
|
|
64
|
+
opacity: 1;
|
|
65
|
+
}
|
|
66
|
+
100% {
|
|
67
|
+
transform: translateX(0);
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted, ref} from 'vue';
|
|
3
|
+
import {handleEnumValidation} from '../handler';
|
|
4
|
+
import {InputColorType, Position} from '../enums';
|
|
5
|
+
import {classesToObjectSyntax} from '../utils';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
content?: string,
|
|
9
|
+
position?: Position,
|
|
10
|
+
tooltipClasses?: string | Record<string, boolean>,
|
|
11
|
+
colorType?: InputColorType
|
|
12
|
+
}>(), {
|
|
13
|
+
position: Position.left,
|
|
14
|
+
tooltipClasses: '',
|
|
15
|
+
colorType: InputColorType.base
|
|
16
|
+
});
|
|
17
|
+
const visible = ref(false);
|
|
18
|
+
const _tooltipClasses = computed(() => ({
|
|
19
|
+
'absolute w-max inline-flex': true,
|
|
20
|
+
// Position
|
|
21
|
+
'bottom-full pb-3.5': props.position === Position.top,
|
|
22
|
+
'top-full pt-3.5': props.position === Position.bottom,
|
|
23
|
+
'right-full pr-3.5': props.position === Position.left,
|
|
24
|
+
'left-full pl-3.5': props.position === Position.right,
|
|
25
|
+
...classesToObjectSyntax(props.tooltipClasses)
|
|
26
|
+
}));
|
|
27
|
+
const classes = computed(() => ({
|
|
28
|
+
'z-10 absolute flex': true,
|
|
29
|
+
'top-0 left-0 right-0 -m-[2px] justify-center': props.position === Position.bottom,
|
|
30
|
+
'bottom-0 left-0 right-0 -m-[2px] justify-center': props.position === Position.top,
|
|
31
|
+
'top-0 left-0 bottom-0 -ml-[2.2px] items-center': props.position === Position.right,
|
|
32
|
+
'top-0 right-0 bottom-0 -mr-[2.2px] items-center': props.position === Position.left,
|
|
33
|
+
}));
|
|
34
|
+
const itemContainerClasses = computed(() => ({
|
|
35
|
+
'relative flex items-center': true,
|
|
36
|
+
'justify-center': props.position === Position.bottom,
|
|
37
|
+
'justify-center rotate-180': props.position === Position.top,
|
|
38
|
+
'justify-center -rotate-90': props.position === Position.right,
|
|
39
|
+
'justify-center rotate-90': props.position === Position.left,
|
|
40
|
+
}));
|
|
41
|
+
const contentClasses = computed(() => {
|
|
42
|
+
const variants: Record<InputColorType, string> = {
|
|
43
|
+
[InputColorType.base]: 'text-neutral-50-font bg-neutral-50 border-neutral-300',
|
|
44
|
+
[InputColorType.danger]: 'text-danger-500-font bg-danger-500 border-danger-500',
|
|
45
|
+
[InputColorType.info]: 'text-info-500-font bg-info-500 border-info-500',
|
|
46
|
+
[InputColorType.success]: 'text-success-500-font bg-success-500 border-success-500',
|
|
47
|
+
[InputColorType.warning]: 'text-warning-500-font bg-warning-500 border-warning-500',
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return {[variants[props.colorType]]: true};
|
|
51
|
+
});
|
|
52
|
+
const svgPathClasses = computed(() => {
|
|
53
|
+
const variants: Record<InputColorType, string> = {
|
|
54
|
+
[InputColorType.base]: 'fill-neutral-50 stroke-neutral-50',
|
|
55
|
+
[InputColorType.danger]: 'fill-danger-500 stroke-danger-500',
|
|
56
|
+
[InputColorType.info]: 'fill-info-500 stroke-info-500',
|
|
57
|
+
[InputColorType.success]: 'fill-success-500 stroke-success-500',
|
|
58
|
+
[InputColorType.warning]: 'fill-warning-500 stroke-warning-500',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return {[variants[props.colorType]]: true};
|
|
62
|
+
});
|
|
63
|
+
const arrowSvgPathClasses = computed(() => {
|
|
64
|
+
const variants: Record<InputColorType, string> = {
|
|
65
|
+
[InputColorType.base]: 'stroke-neutral-300',
|
|
66
|
+
[InputColorType.danger]: 'stroke-danger-500',
|
|
67
|
+
[InputColorType.info]: 'stroke-info-500',
|
|
68
|
+
[InputColorType.success]: 'stroke-success-500',
|
|
69
|
+
[InputColorType.warning]: 'stroke-warning-500',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return {[variants[props.colorType]]: true};
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
onMounted(() => {
|
|
76
|
+
handleEnumValidation(props.position, Position, 'Position')
|
|
77
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType')
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* To prevent a fliggering ux, add a delay on hover and leaving the hover target,
|
|
82
|
+
* before showing the tooltip content.
|
|
83
|
+
*/
|
|
84
|
+
const delayVisible = ref(visible.value);
|
|
85
|
+
|
|
86
|
+
function onMouseOver() {
|
|
87
|
+
delayVisible.value = true;
|
|
88
|
+
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
if (delayVisible.value) {
|
|
91
|
+
visible.value = true
|
|
92
|
+
}
|
|
93
|
+
}, 300)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function onMouseLeave() {
|
|
97
|
+
delayVisible.value = false
|
|
98
|
+
visible.value = false
|
|
99
|
+
}
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<div
|
|
104
|
+
class="relative inline-flex justify-center items-center"
|
|
105
|
+
data-e2e="tooltip"
|
|
106
|
+
@mouseover="onMouseOver"
|
|
107
|
+
@mouseleave="onMouseLeave"
|
|
108
|
+
>
|
|
109
|
+
<slot/>
|
|
110
|
+
|
|
111
|
+
<div v-if="visible" :class="_tooltipClasses">
|
|
112
|
+
<div
|
|
113
|
+
class="shadow-lg text-sm relative inline-flex flex-col relative"
|
|
114
|
+
>
|
|
115
|
+
<div
|
|
116
|
+
:class="classes"
|
|
117
|
+
>
|
|
118
|
+
<div
|
|
119
|
+
:class="itemContainerClasses"
|
|
120
|
+
>
|
|
121
|
+
<svg
|
|
122
|
+
class="absolute mt-[.5px]"
|
|
123
|
+
width="30"
|
|
124
|
+
height="8"
|
|
125
|
+
viewBox="0 0 35 8"
|
|
126
|
+
fill="none"
|
|
127
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
128
|
+
>
|
|
129
|
+
<path
|
|
130
|
+
d="M20.3284 1.82843L23.1569 4.65685C24.6571 6.15715 26.692 7 28.8137 7L6.18629 7C8.30802 7 10.3429 6.15715 11.8431 4.65686L14.6716 1.82843C16.2337 0.266331 18.7663 0.266328 20.3284 1.82843Z"
|
|
131
|
+
:class="svgPathClasses"
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
<path
|
|
135
|
+
d="M34.5 7L28.8137 7C26.692 7 24.6571 6.15715 23.1569 4.65685L20.3284 1.82843C18.7663 0.266328 16.2337 0.266331 14.6716 1.82843L11.8431 4.65686C10.3429 6.15715 8.30802 7 6.18629 7L0.5 7L34.5 7Z"
|
|
136
|
+
:class="svgPathClasses"
|
|
137
|
+
/>
|
|
138
|
+
</svg>
|
|
139
|
+
|
|
140
|
+
<svg
|
|
141
|
+
class="absolute"
|
|
142
|
+
width="30"
|
|
143
|
+
height="8"
|
|
144
|
+
viewBox="0 0 35 8"
|
|
145
|
+
fill="none"
|
|
146
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
147
|
+
>
|
|
148
|
+
<path
|
|
149
|
+
d="M34.5 7L28.8137 7C26.692 7 24.6571 6.15715 23.1569 4.65685L20.3284 1.82843C18.7663 0.266328 16.2337 0.266331 14.6716 1.82843L11.8431 4.65686C10.3429 6.15715 8.30802 7 6.18629 7L0.5 7"
|
|
150
|
+
:class="arrowSvgPathClasses"
|
|
151
|
+
/>
|
|
152
|
+
</svg>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div
|
|
157
|
+
class="p-2.5 rounded-md border"
|
|
158
|
+
:class="contentClasses"
|
|
159
|
+
>
|
|
160
|
+
<slot name="content"/>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</template>
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import {computed, onMounted} from 'vue';
|
|
4
|
+
import {type RouteLocationRaw} from 'vue-router';
|
|
5
|
+
import AntSkeleton from '../AntSkeleton.vue';
|
|
6
|
+
import AntSpinner from '../AntSpinner.vue';
|
|
7
|
+
import {Grouped} from '../../enums/Grouped.enum';
|
|
8
|
+
import {Size} from '../../enums/Size.enum';
|
|
9
|
+
import {handleEnumValidation} from '../../handler';
|
|
10
|
+
import {ColorType} from '../../enums';
|
|
11
|
+
import {ButtonType} from './__types';
|
|
12
|
+
import AntIcon from '../AntIcon.vue';
|
|
13
|
+
import {IconSize} from '../__types/AntIcon.types';
|
|
14
|
+
|
|
15
|
+
defineEmits(['click', 'blur']);
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<{
|
|
18
|
+
filled?: boolean;
|
|
19
|
+
size?: Size;
|
|
20
|
+
colorType?: ColorType;
|
|
21
|
+
iconLeft?: IconDefinition;
|
|
22
|
+
iconRight?: IconDefinition;
|
|
23
|
+
to?: RouteLocationRaw;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
grouped?: Grouped;
|
|
26
|
+
skeleton?: boolean;
|
|
27
|
+
spinner?: boolean;
|
|
28
|
+
readonly?: boolean;
|
|
29
|
+
expanded?: boolean;
|
|
30
|
+
submit?: boolean;
|
|
31
|
+
outlined?: boolean;
|
|
32
|
+
noFocus?: boolean;
|
|
33
|
+
}>(), {
|
|
34
|
+
colorType: ColorType.base,
|
|
35
|
+
disabled: false,
|
|
36
|
+
filled: false,
|
|
37
|
+
skeleton: false,
|
|
38
|
+
spinner: false,
|
|
39
|
+
size: Size.md,
|
|
40
|
+
grouped: Grouped.none,
|
|
41
|
+
readonly: false,
|
|
42
|
+
expanded: false,
|
|
43
|
+
submit: false,
|
|
44
|
+
outlined: true,
|
|
45
|
+
noFocus: false,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const hasAction = computed(() => (props.skeleton || props.readonly || props.disabled))
|
|
49
|
+
const groupedClassList = computed(() => ({
|
|
50
|
+
'rounded-tl-md rounded-bl-md rounded-tr-none rounded-br-none -mr-px': props.grouped === Grouped.left,
|
|
51
|
+
'rounded-none -mx-px': props.grouped === Grouped.center,
|
|
52
|
+
'rounded-tl-none rounded-bl-none rounded-tr-md rounded-br-md -ml-px': props.grouped === Grouped.right,
|
|
53
|
+
'rounded-md': props.grouped === Grouped.none,
|
|
54
|
+
}));
|
|
55
|
+
const classes = computed(() => {
|
|
56
|
+
const variants = {
|
|
57
|
+
[ColorType.base]: 'ring-primary-200 outline-neutral-300',
|
|
58
|
+
[ColorType.danger]: 'ring-danger-200 outline-danger-500',
|
|
59
|
+
[ColorType.info]: 'ring-info-200 outline-info-500',
|
|
60
|
+
[ColorType.primary]: 'ring-primary-200 outline-primary-500',
|
|
61
|
+
[ColorType.secondary]: 'ring-secondary-200 outline-secondary-500',
|
|
62
|
+
[ColorType.success]: 'ring-success-200 outline-success-500',
|
|
63
|
+
[ColorType.warning]: 'ring-warning-200 outline-warning-500',
|
|
64
|
+
};
|
|
65
|
+
const notFilledVariants = {
|
|
66
|
+
[ColorType.base]: 'bg-white text-neutral-50-font',
|
|
67
|
+
[ColorType.danger]: 'bg-white text-danger-500',
|
|
68
|
+
[ColorType.info]: 'bg-white text-info-500',
|
|
69
|
+
[ColorType.primary]: 'bg-white text-primary-500',
|
|
70
|
+
[ColorType.secondary]: 'bg-white text-secondary-500',
|
|
71
|
+
[ColorType.success]: 'bg-white text-success-500',
|
|
72
|
+
[ColorType.warning]: 'bg-white text-warning-500',
|
|
73
|
+
};
|
|
74
|
+
const notFilledHoverVariants = {
|
|
75
|
+
[ColorType.base]: 'hover:bg-neutral-100',
|
|
76
|
+
[ColorType.danger]: 'hover:bg-danger-100',
|
|
77
|
+
[ColorType.info]: 'hover:bg-info-100',
|
|
78
|
+
[ColorType.primary]: 'hover:bg-primary-100',
|
|
79
|
+
[ColorType.secondary]: 'hover:bg-secondary-100',
|
|
80
|
+
[ColorType.success]: 'hover:bg-success-100',
|
|
81
|
+
[ColorType.warning]: 'hover:bg-warning-100',
|
|
82
|
+
};
|
|
83
|
+
const filledVariants = {
|
|
84
|
+
[ColorType.base]: 'bg-neutral-50 text-neutral-50-font',
|
|
85
|
+
[ColorType.danger]: 'bg-danger-500 text-danger-500-font',
|
|
86
|
+
[ColorType.info]: 'bg-info-500 text-info-500-font',
|
|
87
|
+
[ColorType.primary]: 'bg-primary-500 text-primary-500-font',
|
|
88
|
+
[ColorType.secondary]: 'bg-secondary-500 text-secondary-500-font',
|
|
89
|
+
[ColorType.success]: 'bg-success-500 text-success-500-font',
|
|
90
|
+
[ColorType.warning]: 'bg-warning-500 text-warning-500-font',
|
|
91
|
+
};
|
|
92
|
+
const filledHoverVariants = {
|
|
93
|
+
[ColorType.base]: 'hover:bg-neutral-200',
|
|
94
|
+
[ColorType.danger]: 'hover:bg-danger-600',
|
|
95
|
+
[ColorType.info]: 'hover:bg-info-600',
|
|
96
|
+
[ColorType.primary]: 'hover:bg-primary-600',
|
|
97
|
+
[ColorType.secondary]: 'hover:bg-secondary-600',
|
|
98
|
+
[ColorType.success]: 'hover:bg-success-600',
|
|
99
|
+
[ColorType.warning]: 'hover:bg-warning-600',
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
'transition-all inline-flex items-center justify-center relative font-medium': true,
|
|
104
|
+
'focus:z-10': true,
|
|
105
|
+
'active:shadow-[inset_0_4px_4px_rgba(0,0,0,0.25)]': !props.readonly,
|
|
106
|
+
'py-1.5 px-2.5 text-xs gap-1': props.size === Size.sm,
|
|
107
|
+
'py-2.5 px-3.5 text-sm gap-2.5': props.size === Size.md,
|
|
108
|
+
'disabled:opacity-50 disabled:cursor-not-allowed': true,
|
|
109
|
+
'cursor-default': props.readonly,
|
|
110
|
+
'focus:ring-2': !props.readonly && props.size === Size.sm,
|
|
111
|
+
'focus:ring-4': !props.readonly && props.size === Size.md,
|
|
112
|
+
'w-full': props.expanded,
|
|
113
|
+
'invisible': props.skeleton,
|
|
114
|
+
'outline outline-1 outline-offset-[-1px]': props.outlined,
|
|
115
|
+
...groupedClassList.value,
|
|
116
|
+
[variants[props.colorType]]: true,
|
|
117
|
+
[notFilledVariants[props.colorType]]: !props.filled,
|
|
118
|
+
[notFilledHoverVariants[props.colorType]]: !props.filled && !props.readonly,
|
|
119
|
+
[filledVariants[props.colorType]]: props.filled,
|
|
120
|
+
[filledHoverVariants[props.colorType]]: props.filled && !props.readonly,
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
const iconColor = computed(() => {
|
|
124
|
+
const notFilledVariants = {
|
|
125
|
+
[ColorType.base]: 'text-neutral-50-font',
|
|
126
|
+
[ColorType.danger]: 'text-danger-500',
|
|
127
|
+
[ColorType.info]: 'text-info-500',
|
|
128
|
+
[ColorType.primary]: 'text-primary-500',
|
|
129
|
+
[ColorType.secondary]: 'text-secondary-500',
|
|
130
|
+
[ColorType.success]: 'text-success-500',
|
|
131
|
+
[ColorType.warning]: 'text-warning-500',
|
|
132
|
+
};
|
|
133
|
+
const filledVariants = {
|
|
134
|
+
[ColorType.base]: 'text-neutral-50-font',
|
|
135
|
+
[ColorType.danger]: 'text-danger-500-font',
|
|
136
|
+
[ColorType.info]: 'text-info-500-font',
|
|
137
|
+
[ColorType.primary]: 'text-primary-500-font',
|
|
138
|
+
[ColorType.secondary]: 'text-secondary-500-font',
|
|
139
|
+
[ColorType.success]: 'text-success-500-font',
|
|
140
|
+
[ColorType.warning]: 'text-warning-500-font',
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return props.filled ? filledVariants[props.colorType] : notFilledVariants[props.colorType];
|
|
144
|
+
});
|
|
145
|
+
const type = computed(() => {
|
|
146
|
+
if (props.to !== undefined) {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return props.submit ? ButtonType.submit : ButtonType.button;
|
|
151
|
+
});
|
|
152
|
+
const is = computed(() => {
|
|
153
|
+
if (props.readonly) {
|
|
154
|
+
return 'div';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return props.to !== undefined ? 'router-link' : 'button'
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
onMounted(() => {
|
|
161
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
162
|
+
handleEnumValidation(props.colorType, ColorType, 'colorType');
|
|
163
|
+
handleEnumValidation(props.grouped, Grouped, 'grouped');
|
|
164
|
+
});
|
|
165
|
+
</script>
|
|
166
|
+
|
|
167
|
+
<template>
|
|
168
|
+
<div
|
|
169
|
+
class="relative inline-flex h-fit"
|
|
170
|
+
:class="{'w-full': props.expanded}"
|
|
171
|
+
data-e2e="button"
|
|
172
|
+
:data-e2e-color-type="props.colorType"
|
|
173
|
+
>
|
|
174
|
+
<AntSkeleton
|
|
175
|
+
v-if="skeleton"
|
|
176
|
+
:grouped="grouped"
|
|
177
|
+
rounded
|
|
178
|
+
absolute
|
|
179
|
+
/>
|
|
180
|
+
|
|
181
|
+
<component
|
|
182
|
+
:is="is"
|
|
183
|
+
:class="classes"
|
|
184
|
+
:type="type"
|
|
185
|
+
:to="to"
|
|
186
|
+
:disabled="disabled || undefined"
|
|
187
|
+
:tabindex="noFocus || hasAction ? '-1' : '0'"
|
|
188
|
+
@click="() => !props.readonly ? $emit('click') : null"
|
|
189
|
+
@blur="() => !props.readonly ? $emit('blur') : null"
|
|
190
|
+
>
|
|
191
|
+
<AntSpinner
|
|
192
|
+
v-if="spinner"
|
|
193
|
+
:size="size"
|
|
194
|
+
:color-type="colorType"
|
|
195
|
+
:inverted="!filled"
|
|
196
|
+
/>
|
|
197
|
+
|
|
198
|
+
<slot
|
|
199
|
+
v-if="!spinner"
|
|
200
|
+
name="icon-left"
|
|
201
|
+
>
|
|
202
|
+
<AntIcon
|
|
203
|
+
v-if="iconLeft"
|
|
204
|
+
:icon="iconLeft"
|
|
205
|
+
:size="size as unknown as IconSize"
|
|
206
|
+
:color="iconColor"
|
|
207
|
+
/>
|
|
208
|
+
</slot>
|
|
209
|
+
|
|
210
|
+
<slot
|
|
211
|
+
v-if="!spinner"
|
|
212
|
+
/>
|
|
213
|
+
|
|
214
|
+
<slot
|
|
215
|
+
v-if="!spinner"
|
|
216
|
+
name="icon-right"
|
|
217
|
+
>
|
|
218
|
+
<AntIcon
|
|
219
|
+
v-if="iconRight"
|
|
220
|
+
:icon="iconRight"
|
|
221
|
+
:size="size as unknown as IconSize"
|
|
222
|
+
:color="iconColor"
|
|
223
|
+
/>
|
|
224
|
+
</slot>
|
|
225
|
+
</component>
|
|
226
|
+
</div>
|
|
227
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
|
+
import {Size} from '../../enums/Size.enum';
|
|
4
|
+
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
|
+
import AntButton from './AntButton.vue';
|
|
6
|
+
|
|
7
|
+
defineEmits(['click', 'blur']);
|
|
8
|
+
defineProps<{
|
|
9
|
+
size?: Size;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
grouped?: Grouped;
|
|
12
|
+
skeleton?: boolean;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
}>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<AntButton
|
|
19
|
+
:size="size"
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
:grouped="grouped"
|
|
22
|
+
:skeleton="skeleton"
|
|
23
|
+
:expanded="expanded"
|
|
24
|
+
:color-type="ColorType.primary"
|
|
25
|
+
filled
|
|
26
|
+
data-e2e="create-button"
|
|
27
|
+
@click="$emit('click')"
|
|
28
|
+
@blur="$emit('blur')"
|
|
29
|
+
>
|
|
30
|
+
Create
|
|
31
|
+
</AntButton>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
|
+
import {Size} from '../../enums/Size.enum';
|
|
4
|
+
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
|
+
import AntButton from './AntButton.vue';
|
|
6
|
+
|
|
7
|
+
defineEmits(['click', 'blur']);
|
|
8
|
+
defineProps<{
|
|
9
|
+
size?: Size;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
grouped?: Grouped;
|
|
12
|
+
skeleton?: boolean;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
}>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<AntButton
|
|
19
|
+
:size="size"
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
:grouped="grouped"
|
|
22
|
+
:skeleton="skeleton"
|
|
23
|
+
:expanded="expanded"
|
|
24
|
+
:color-type="ColorType.danger"
|
|
25
|
+
filled
|
|
26
|
+
data-e2e="delete-button"
|
|
27
|
+
@click="$emit('click')"
|
|
28
|
+
@blur="$emit('blur')"
|
|
29
|
+
>
|
|
30
|
+
Delete
|
|
31
|
+
</AntButton>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {Grouped} from '../../enums/Grouped.enum';
|
|
3
|
+
import {Size} from '../../enums/Size.enum';
|
|
4
|
+
import {ColorType} from '../../enums/ColorType.enum';
|
|
5
|
+
import AntButton from './AntButton.vue';
|
|
6
|
+
|
|
7
|
+
defineEmits(['click', 'blur']);
|
|
8
|
+
defineProps<{
|
|
9
|
+
size?: Size;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
grouped?: Grouped;
|
|
12
|
+
skeleton?: boolean;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
}>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<AntButton
|
|
19
|
+
:size="size"
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
:grouped="grouped"
|
|
22
|
+
:skeleton="skeleton"
|
|
23
|
+
:expanded="expanded"
|
|
24
|
+
:color-type="ColorType.primary"
|
|
25
|
+
filled
|
|
26
|
+
data-e2e="save-and-new-button"
|
|
27
|
+
@click="$emit('click')"
|
|
28
|
+
@blur="$emit('blur')"
|
|
29
|
+
>
|
|
30
|
+
Save and new
|
|
31
|
+
</AntButton>
|
|
32
|
+
</template>
|