@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,129 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {ref, useSlots, watch} from 'vue';
|
|
3
|
+
import {faXmark} from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import AntButton from './buttons/AntButton.vue';
|
|
5
|
+
|
|
6
|
+
const emit = defineEmits(['update:open', 'close']);
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
title: string,
|
|
9
|
+
open: boolean,
|
|
10
|
+
fullscreen?: boolean
|
|
11
|
+
}>(), {
|
|
12
|
+
fullscreen: false
|
|
13
|
+
});
|
|
14
|
+
const openModal = ref(props.open);
|
|
15
|
+
const openBackground = ref(props.open);
|
|
16
|
+
|
|
17
|
+
watch(() => props.open, (val) => {
|
|
18
|
+
function onKeydown(e: KeyboardEvent) {
|
|
19
|
+
if (e.key === 'Escape') {
|
|
20
|
+
emit('update:open', false);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (val) {
|
|
25
|
+
openBackground.value = true;
|
|
26
|
+
setTimeout(() => openModal.value = true, props.fullscreen ? 0 : 100)
|
|
27
|
+
document.addEventListener('keydown', onKeydown);
|
|
28
|
+
} else {
|
|
29
|
+
openModal.value = false;
|
|
30
|
+
setTimeout(() => openBackground.value = false, props.fullscreen ? 0 : 100)
|
|
31
|
+
document.removeEventListener('keydown', onKeydown);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function closeModal() {
|
|
36
|
+
emit('update:open', false);
|
|
37
|
+
emit('close');
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<transition name="fade">
|
|
43
|
+
<div
|
|
44
|
+
v-if="openBackground"
|
|
45
|
+
class="absolute inset-0 flex items-center justify-center z-50 cursor-pointer overflow-hidden"
|
|
46
|
+
:class="{'bg-black/50 backdrop-blur-sm': !fullscreen}"
|
|
47
|
+
@click.self="closeModal"
|
|
48
|
+
>
|
|
49
|
+
<transition :name="!fullscreen ? 'bounce' : 'bounce-slow'">
|
|
50
|
+
<div
|
|
51
|
+
v-if="openModal"
|
|
52
|
+
class="flex flex-col gap-px bg-neutral-300 overflow-hidden cursor-auto"
|
|
53
|
+
:class="{'w-full h-full': fullscreen, 'border border-neutral-300 rounded-md shadow-md': !fullscreen}"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
class="bg-neutral-50 p-2.5 flex items-center justify-between text-neutral-50-font text-lg font-medium">
|
|
57
|
+
<slot name="title">
|
|
58
|
+
{{ title }}
|
|
59
|
+
</slot>
|
|
60
|
+
|
|
61
|
+
<AntButton
|
|
62
|
+
:icon-left="faXmark"
|
|
63
|
+
:outlined="false"
|
|
64
|
+
filled
|
|
65
|
+
@click="closeModal"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="bg-neutral-50 p-2.5 grow overflow-y-auto">
|
|
70
|
+
<slot/>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div
|
|
74
|
+
v-if="useSlots()['footer'] || false"
|
|
75
|
+
class="bg-neutral-50 p-2.5 text-neutral-50-font"
|
|
76
|
+
>
|
|
77
|
+
<slot name="footer"/>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</transition>
|
|
81
|
+
</div>
|
|
82
|
+
</transition>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.fade-leave-active {
|
|
87
|
+
transition: opacity .5s ease;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.fade-enter-active {
|
|
91
|
+
transition: opacity 0.3s ease;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.fade-enter-from,
|
|
95
|
+
.fade-leave-to {
|
|
96
|
+
opacity: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.bounce-enter-active {
|
|
100
|
+
animation: bounce-in .4s;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.bounce-leave-active {
|
|
104
|
+
animation: bounce-in .4s reverse;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.bounce-slow-enter-active {
|
|
108
|
+
animation: bounce-in .6s;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.bounce-slow-leave-active {
|
|
112
|
+
animation: bounce-in .4s reverse;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@keyframes bounce-in {
|
|
116
|
+
0% {
|
|
117
|
+
transform: scale(0);
|
|
118
|
+
opacity: 0;
|
|
119
|
+
}
|
|
120
|
+
50% {
|
|
121
|
+
transform: scale(1.05);
|
|
122
|
+
opacity: 1;
|
|
123
|
+
}
|
|
124
|
+
100% {
|
|
125
|
+
transform: scale(1);
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* TODO:: test me in storybook through vue router
|
|
5
|
+
* TODO:: Fix ts errors
|
|
6
|
+
*/
|
|
7
|
+
import {useRouter, useRoute} from 'vue-router'
|
|
8
|
+
import {computed} from 'vue';
|
|
9
|
+
import AntButton from './buttons/AntButton.vue';
|
|
10
|
+
import {faChevronRight, faChevronLeft} from '@fortawesome/free-solid-svg-icons';
|
|
11
|
+
import {Grouped} from '../enums/Grouped.enum';
|
|
12
|
+
import AntSkeleton from './AntSkeleton.vue';
|
|
13
|
+
import {ColorType} from '../enums';
|
|
14
|
+
|
|
15
|
+
const emit = defineEmits(['update:skeleton', 'input'])
|
|
16
|
+
const props = withDefaults(
|
|
17
|
+
defineProps<{
|
|
18
|
+
pages: number,
|
|
19
|
+
pageQuery?: string,
|
|
20
|
+
skeleton?: boolean,
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Light version does not show the very previous and next page button.
|
|
24
|
+
* This makes the pagination smaller in space.
|
|
25
|
+
*/
|
|
26
|
+
lightVersion?: boolean
|
|
27
|
+
}>(),
|
|
28
|
+
{
|
|
29
|
+
pageQuery: 'p',
|
|
30
|
+
skeleton: false,
|
|
31
|
+
lightVersion: false
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
const router = useRouter()
|
|
35
|
+
const route = useRoute()
|
|
36
|
+
const page = computed({
|
|
37
|
+
get() {
|
|
38
|
+
const _page = route.query[props.pageQuery] >= 1 ? Number.parseInt(route.query[props.pageQuery]) : 1
|
|
39
|
+
|
|
40
|
+
if (_page <= 0 || _page > props.pages) {
|
|
41
|
+
return 1
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return _page
|
|
45
|
+
},
|
|
46
|
+
set(val) {
|
|
47
|
+
const query = {...route.query}
|
|
48
|
+
query[props.pageQuery] = val;
|
|
49
|
+
|
|
50
|
+
(async () => {
|
|
51
|
+
await router.push({
|
|
52
|
+
...route,
|
|
53
|
+
query
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
emit('input', val)
|
|
57
|
+
})()
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Build following constellations:
|
|
63
|
+
* [1] 2 3 ... 10
|
|
64
|
+
* 1 [2] 3 4 ... 10
|
|
65
|
+
* 1 2 [3] 4 ... 10
|
|
66
|
+
* 1 ... 3 [4] 5 ... 10
|
|
67
|
+
* 1 ... 4 [5] 6 ... 10
|
|
68
|
+
* 1 ... 7 [8] 9 10
|
|
69
|
+
* 1 ... 8 [9] 10
|
|
70
|
+
* 1 ... 8 9 [10]
|
|
71
|
+
*/
|
|
72
|
+
const defaultPagination = computed(() => {
|
|
73
|
+
const pagination = []
|
|
74
|
+
|
|
75
|
+
if (page.value > 2 && props.pages > 3) {
|
|
76
|
+
pagination.push(1)
|
|
77
|
+
|
|
78
|
+
if (page.value > 3) {
|
|
79
|
+
pagination.push('...')
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (page.value === 1) {
|
|
84
|
+
pagination.push(1)
|
|
85
|
+
|
|
86
|
+
if (props.pages >= 2) {
|
|
87
|
+
pagination.push(2)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (props.pages >= 3) {
|
|
91
|
+
pagination.push(3)
|
|
92
|
+
}
|
|
93
|
+
} else if (page.value === props.pages) {
|
|
94
|
+
if (props.pages - 2 >= 1) {
|
|
95
|
+
pagination.push(props.pages - 2)
|
|
96
|
+
}
|
|
97
|
+
if (props.pages - 1 >= 1) {
|
|
98
|
+
pagination.push(props.pages - 1)
|
|
99
|
+
}
|
|
100
|
+
pagination.push(props.pages)
|
|
101
|
+
} else {
|
|
102
|
+
pagination.push(page.value - 1)
|
|
103
|
+
pagination.push(page.value)
|
|
104
|
+
pagination.push(page.value + 1)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (page.value < props.pages - 1 && props.pages > 3) {
|
|
108
|
+
if (page.value < props.pages - 2) {
|
|
109
|
+
pagination.push('...')
|
|
110
|
+
}
|
|
111
|
+
pagination.push(props.pages)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return pagination
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Build following constellations:
|
|
119
|
+
* [1] ... 10
|
|
120
|
+
* 1 [2] ... 10
|
|
121
|
+
* 1 ... [3] ... 10
|
|
122
|
+
* 1 ... [5] ... 10
|
|
123
|
+
* 1 ... [8] ... 10
|
|
124
|
+
* 1 ... [9] 10
|
|
125
|
+
* 1 ... [10]
|
|
126
|
+
*/
|
|
127
|
+
const lightPagination = computed(() => {
|
|
128
|
+
const pagination = []
|
|
129
|
+
|
|
130
|
+
pagination.push(1)
|
|
131
|
+
|
|
132
|
+
if (page.value > 2) {
|
|
133
|
+
pagination.push('...')
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (page.value > 1) {
|
|
137
|
+
pagination.push(page.value)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (page.value < props.pages - 1) {
|
|
141
|
+
pagination.push('...')
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (page.value < props.pages) {
|
|
145
|
+
pagination.push(props.pages)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return pagination
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
const pagination = computed(() => {
|
|
152
|
+
if (props.lightVersion) {
|
|
153
|
+
return lightPagination.value
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return defaultPagination.value
|
|
157
|
+
})
|
|
158
|
+
</script>
|
|
159
|
+
|
|
160
|
+
<template>
|
|
161
|
+
<div
|
|
162
|
+
class="inline-flex relative"
|
|
163
|
+
data-e2e="pagination"
|
|
164
|
+
>
|
|
165
|
+
<AntSkeleton v-if="skeleton" rounded absolute/>
|
|
166
|
+
|
|
167
|
+
<div
|
|
168
|
+
class="inline-flex gap-px"
|
|
169
|
+
:class="{'invisible': skeleton}"
|
|
170
|
+
>
|
|
171
|
+
<AntButton
|
|
172
|
+
:disabled="page === 1"
|
|
173
|
+
:icon-left="faChevronLeft"
|
|
174
|
+
:grouped="Grouped.left"
|
|
175
|
+
filled
|
|
176
|
+
@click="() => page = page - 1"
|
|
177
|
+
/>
|
|
178
|
+
|
|
179
|
+
<AntButton
|
|
180
|
+
v-for="(pageObj, index) in pagination"
|
|
181
|
+
:color-type="pageObj === page ? ColorType.primary : ColorType.base"
|
|
182
|
+
:class="{'text-primary-500 z-10': pageObj === page}"
|
|
183
|
+
:disabled="pageObj === '...'"
|
|
184
|
+
:grouped="Grouped.center"
|
|
185
|
+
:filled="pageObj !== page"
|
|
186
|
+
@click="() => page = pageObj"
|
|
187
|
+
v-bind:key="`pagination-button-${index}`"
|
|
188
|
+
>
|
|
189
|
+
{{ pageObj }}
|
|
190
|
+
</AntButton>
|
|
191
|
+
|
|
192
|
+
<AntButton
|
|
193
|
+
:icon-left="faChevronRight"
|
|
194
|
+
:grouped="Grouped.right"
|
|
195
|
+
:disabled="page === pages"
|
|
196
|
+
filled
|
|
197
|
+
@click="() => page = page + 1"
|
|
198
|
+
/>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</template>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {handleEnumValidation} from '../handler';
|
|
4
|
+
import {Position} from '../enums/Position.enum';
|
|
5
|
+
import {classesToObjectSyntax} from '../utils';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
showPopover: boolean,
|
|
9
|
+
title?: string,
|
|
10
|
+
position?: Position,
|
|
11
|
+
popoverClasses?: string | Record<string, boolean>
|
|
12
|
+
}>(), {
|
|
13
|
+
showPopover: false,
|
|
14
|
+
position: Position.left,
|
|
15
|
+
popoverClasses: ''
|
|
16
|
+
});
|
|
17
|
+
const _popoverClasses = computed(() => ({
|
|
18
|
+
'absolute min-w-[10rem]': true,
|
|
19
|
+
'bottom-0 mb-[50%] pb-3.5': props.position === Position.top,
|
|
20
|
+
'top-0 mt-[50%] pt-3.5': props.position === Position.bottom,
|
|
21
|
+
'right-0 mr-[100%] pr-3.5': props.position === Position.left,
|
|
22
|
+
'left-0 ml-[100%] pl-3.5': props.position === Position.right,
|
|
23
|
+
...classesToObjectSyntax(props.popoverClasses)
|
|
24
|
+
}));
|
|
25
|
+
const classes = computed(() => ({
|
|
26
|
+
'z-10 absolute flex': true,
|
|
27
|
+
'top-0 left-0 right-0 -m-[2.5px] justify-center': props.position === Position.bottom,
|
|
28
|
+
'bottom-0 left-0 right-0 -m-[2.5px] justify-center': props.position === Position.top,
|
|
29
|
+
'top-0 left-0 bottom-0 -ml-[2.5px] items-end pb-1': props.position === Position.right,
|
|
30
|
+
'top-0 right-0 bottom-0 -mr-[2.5px] items-end pb-1': props.position === Position.left,
|
|
31
|
+
}));
|
|
32
|
+
const itemContainerClasses = computed(() => ({
|
|
33
|
+
'relative flex items-center': true,
|
|
34
|
+
'justify-center': props.position === Position.bottom,
|
|
35
|
+
'justify-center rotate-180': props.position === Position.top,
|
|
36
|
+
'justify-start -rotate-90': props.position === Position.right,
|
|
37
|
+
'justify-end rotate-90': props.position === Position.left,
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
onMounted(() => {
|
|
41
|
+
handleEnumValidation(props.position, Position, 'Position')
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<div class="relative inline-flex justify-center items-end">
|
|
47
|
+
<slot/>
|
|
48
|
+
|
|
49
|
+
<transition name="bounce">
|
|
50
|
+
<template v-if="showPopover">
|
|
51
|
+
<div :class="_popoverClasses">
|
|
52
|
+
<div class="shadow-lg border-neutral-300 rounded-md text-sm relative inline-flex flex-col relative">
|
|
53
|
+
<div
|
|
54
|
+
:class="classes"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
:class="itemContainerClasses"
|
|
58
|
+
>
|
|
59
|
+
<svg
|
|
60
|
+
class="absolute mt-[.5px]"
|
|
61
|
+
width="35"
|
|
62
|
+
height="8"
|
|
63
|
+
viewBox="0 0 35 8"
|
|
64
|
+
fill="none"
|
|
65
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
66
|
+
>
|
|
67
|
+
<path
|
|
68
|
+
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"
|
|
69
|
+
:class="{'fill-neutral-100': position === Position.bottom, 'fill-neutral-50': position === Position.top || position === Position.right || position === Position.left}"
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<path
|
|
73
|
+
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"
|
|
74
|
+
:class="{'stroke-neutral-100': position === Position.bottom, 'stroke-neutral-50': position === Position.top || position === Position.right || position === Position.left}"
|
|
75
|
+
/>
|
|
76
|
+
</svg>
|
|
77
|
+
|
|
78
|
+
<svg
|
|
79
|
+
class="absolute"
|
|
80
|
+
width="35"
|
|
81
|
+
height="8"
|
|
82
|
+
viewBox="0 0 35 8"
|
|
83
|
+
fill="none"
|
|
84
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
85
|
+
>
|
|
86
|
+
<path
|
|
87
|
+
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"
|
|
88
|
+
class="stroke-neutral-300"
|
|
89
|
+
/>
|
|
90
|
+
</svg>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div
|
|
95
|
+
class="border-neutral-300 border-b p-2.5 bg-neutral-100 rounded-t-md border-t border-l border-r text-neutral-100-font font-semibold">
|
|
96
|
+
{{ title }}
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div
|
|
100
|
+
class="p-2.5 rounded-b-md text-neutral-50-font border-neutral-300 border-l border-b border-r bg-neutral-50">
|
|
101
|
+
<slot name="content"/>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
</transition>
|
|
107
|
+
</div>
|
|
108
|
+
</template>
|
|
109
|
+
|
|
110
|
+
<style scoped>
|
|
111
|
+
.bounce-enter-active {
|
|
112
|
+
animation: bounce-in .4s;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.bounce-leave-active {
|
|
116
|
+
animation: bounce-in .4s reverse;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@keyframes bounce-in {
|
|
120
|
+
0% {
|
|
121
|
+
transform: scale(0);
|
|
122
|
+
opacity: 0;
|
|
123
|
+
}
|
|
124
|
+
50% {
|
|
125
|
+
transform: scale(1.05);
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
100% {
|
|
129
|
+
transform: scale(1);
|
|
130
|
+
opacity: 1;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {Grouped} from '../enums/Grouped.enum';
|
|
3
|
+
import {computed} from 'vue';
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
grouped?: Grouped;
|
|
7
|
+
rounded?: boolean;
|
|
8
|
+
roundedFull?: boolean;
|
|
9
|
+
absolute?: boolean;
|
|
10
|
+
minShowTime?: number;
|
|
11
|
+
}>(), {
|
|
12
|
+
grouped: Grouped.none,
|
|
13
|
+
rounded: false,
|
|
14
|
+
roundedFull: false,
|
|
15
|
+
absolute: false,
|
|
16
|
+
minShowTime: 5000
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const groupedClassList = computed(() => ({
|
|
20
|
+
'rounded-tl-md rounded-bl-md rounded-tr-none rounded-br-none': props.grouped === Grouped.left,
|
|
21
|
+
'rounded-none': props.grouped === Grouped.center,
|
|
22
|
+
'rounded-tl-none rounded-bl-none rounded-tr-md rounded-br-md': props.grouped === Grouped.right,
|
|
23
|
+
}));
|
|
24
|
+
const classList = computed(() => ({
|
|
25
|
+
'animate-skeleton min-h-[1px] min-w-[1px] inline-block': true,
|
|
26
|
+
'absolute inset-0 w-full h-full z-40': props.absolute,
|
|
27
|
+
'rounded-md': props.rounded && props.grouped === Grouped.none,
|
|
28
|
+
'rounded-xl': props.roundedFull && props.grouped === Grouped.none,
|
|
29
|
+
...groupedClassList.value
|
|
30
|
+
}));
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<div
|
|
35
|
+
:class="classList"
|
|
36
|
+
data-e2e="skeleton"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {Size} from '../enums/Size.enum'
|
|
4
|
+
import {handleEnumValidation} from '../handler';
|
|
5
|
+
import {ColorType} from '../enums/ColorType.enum';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
colorType?: ColorType,
|
|
9
|
+
size?: Size;
|
|
10
|
+
inverted?: boolean;
|
|
11
|
+
}>(), {
|
|
12
|
+
size: Size.md,
|
|
13
|
+
colorType: ColorType.base,
|
|
14
|
+
inverted: false
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => ({
|
|
18
|
+
'animate-spin': true,
|
|
19
|
+
'w-4 h-4': props.size === Size.sm,
|
|
20
|
+
'w-5 h-5': props.size === Size.md,
|
|
21
|
+
}));
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
24
|
+
handleEnumValidation(props.colorType, ColorType, 'colorType');
|
|
25
|
+
});
|
|
26
|
+
const circleClass = computed(() => {
|
|
27
|
+
const invertedVariants: Record<ColorType, string> = {
|
|
28
|
+
[ColorType.base]: 'fill-neutral-500',
|
|
29
|
+
[ColorType.primary]: 'fill-primary-700',
|
|
30
|
+
[ColorType.secondary]: 'fill-secondary-700',
|
|
31
|
+
[ColorType.danger]: 'fill-danger-700',
|
|
32
|
+
[ColorType.info]: 'fill-info-700',
|
|
33
|
+
[ColorType.success]: 'fill-success-700',
|
|
34
|
+
[ColorType.warning]: 'fill-warning-700',
|
|
35
|
+
};
|
|
36
|
+
const notInvertedVariants: Record<ColorType, string> = {
|
|
37
|
+
[ColorType.base]: 'fill-neutral-100',
|
|
38
|
+
[ColorType.primary]: 'fill-primary-100',
|
|
39
|
+
[ColorType.secondary]: 'fill-secondary-100',
|
|
40
|
+
[ColorType.danger]: 'fill-danger-100',
|
|
41
|
+
[ColorType.info]: 'fill-info-100',
|
|
42
|
+
[ColorType.success]: 'fill-success-100',
|
|
43
|
+
[ColorType.warning]: 'fill-warning-100',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
[invertedVariants[props.colorType]]: props.inverted,
|
|
48
|
+
[notInvertedVariants[props.colorType]]: !props.inverted,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const spinningElementClass = computed(() => {
|
|
52
|
+
const invertedVariants: Record<ColorType, string> = {
|
|
53
|
+
[ColorType.base]: 'fill-neutral-100',
|
|
54
|
+
[ColorType.primary]: 'fill-primary-100',
|
|
55
|
+
[ColorType.secondary]: 'fill-secondary-100',
|
|
56
|
+
[ColorType.danger]: 'fill-danger-100',
|
|
57
|
+
[ColorType.info]: 'fill-info-100',
|
|
58
|
+
[ColorType.success]: 'fill-success-100',
|
|
59
|
+
[ColorType.warning]: 'fill-warning-100',
|
|
60
|
+
};
|
|
61
|
+
const notInvertedVariants: Record<ColorType, string> = {
|
|
62
|
+
[ColorType.base]: 'fill-neutral-500',
|
|
63
|
+
[ColorType.primary]: 'fill-primary-500',
|
|
64
|
+
[ColorType.secondary]: 'fill-secondary-500',
|
|
65
|
+
[ColorType.danger]: 'fill-danger-500',
|
|
66
|
+
[ColorType.info]: 'fill-info-500',
|
|
67
|
+
[ColorType.success]: 'fill-success-500',
|
|
68
|
+
[ColorType.warning]: 'fill-warning-500',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
[invertedVariants[props.colorType]]: props.inverted,
|
|
73
|
+
[notInvertedVariants[props.colorType]]: !props.inverted,
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
<svg
|
|
80
|
+
:class="classes"
|
|
81
|
+
viewBox="0 0 16 16"
|
|
82
|
+
fill="none"
|
|
83
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
84
|
+
data-e2e="spinner"
|
|
85
|
+
>
|
|
86
|
+
<path
|
|
87
|
+
:class="circleClass"
|
|
88
|
+
d="M8 16C12.4183 16 16 12.4183 16 8H14C14 11.5346 11.5346 14 8 14C4.46538 14 2 11.5346 2 8C2 4.46538 4.46538 2 8 2V0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z"
|
|
89
|
+
/>
|
|
90
|
+
<path
|
|
91
|
+
:class="spinningElementClass"
|
|
92
|
+
d="M16 8C16 6.94942 15.7931 5.90914 15.391 4.93853C14.989 3.96793 14.3997 3.08601 13.6569 2.34315C12.914 1.60028 12.0321 1.011 11.0615 0.608963C10.0909 0.206926 9.05057 -1.7116e-07 8 0L8 2C8.78793 2 9.56815 2.15519 10.2961 2.45672C11.0241 2.75825 11.6855 3.20021 12.2426 3.75736C12.7998 4.31451 13.2417 4.97595 13.5433 5.7039C13.8448 6.43185 14 7.21207 14 8H16Z"
|
|
93
|
+
/>
|
|
94
|
+
</svg>
|
|
95
|
+
</template>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {Size} from '../enums/Size.enum'
|
|
4
|
+
import {TagColorType} from '../types/AntTag.type';
|
|
5
|
+
import {handleEnumValidation} from '../handler';
|
|
6
|
+
import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
7
|
+
import {faCircleXmark} from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
colorType?: TagColorType,
|
|
11
|
+
size?: Size;
|
|
12
|
+
iconLeft?: IconDefinition;
|
|
13
|
+
dismiss?: boolean
|
|
14
|
+
}>(), {
|
|
15
|
+
size: Size.md,
|
|
16
|
+
colorType: TagColorType.neutral300,
|
|
17
|
+
dismiss: false
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const classes = computed(() => {
|
|
21
|
+
const variants: Record<TagColorType, string> = {
|
|
22
|
+
[TagColorType.danger]: 'bg-danger-500 text-danger-500-font',
|
|
23
|
+
[TagColorType.info]: 'bg-info-500 text-info-500-font',
|
|
24
|
+
[TagColorType.neutral300]: 'bg-neutral-300 text-neutral-300-font',
|
|
25
|
+
[TagColorType.neutral50]: 'bg-neutral-50 text-neutral-50-font',
|
|
26
|
+
[TagColorType.success]: 'bg-success-500 text-success-500-font',
|
|
27
|
+
[TagColorType.warning]: 'bg-warning-500 text-warning-500-font',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
'rounded-md inline-flex items-center': true,
|
|
32
|
+
'px-1.5 py-1 text-sm gap-1.5': props.size === Size.md,
|
|
33
|
+
'px-1 py-0.5 text-xs gap-1': props.size === Size.sm,
|
|
34
|
+
[variants[props.colorType]]: true,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const iconClasses = computed(() => ({
|
|
38
|
+
'h-3': props.size === Size.sm,
|
|
39
|
+
'h-4': props.size === Size.md,
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
onMounted(() => {
|
|
43
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
44
|
+
handleEnumValidation(props.colorType, TagColorType, 'colorType');
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<span
|
|
50
|
+
:class="classes"
|
|
51
|
+
data-e2e="tag"
|
|
52
|
+
>
|
|
53
|
+
<span
|
|
54
|
+
v-if="iconLeft"
|
|
55
|
+
class="inline-flex items-center justify-center"
|
|
56
|
+
:class="{'w-4 h-4': props.size === Size.sm, 'w-5 h-5': props.size === Size.md}"
|
|
57
|
+
>
|
|
58
|
+
<fa-icon
|
|
59
|
+
:icon="iconLeft"
|
|
60
|
+
:class="iconClasses"
|
|
61
|
+
/>
|
|
62
|
+
</span>
|
|
63
|
+
|
|
64
|
+
<slot/>
|
|
65
|
+
|
|
66
|
+
<span
|
|
67
|
+
v-if="dismiss"
|
|
68
|
+
class="inline-flex items-center justify-center"
|
|
69
|
+
:class="{'w-4 h-4': props.size === Size.sm, 'w-5 h-5': props.size === Size.md}"
|
|
70
|
+
>
|
|
71
|
+
<fa-icon
|
|
72
|
+
:icon="faCircleXmark"
|
|
73
|
+
:class="iconClasses"
|
|
74
|
+
class="cursor-pointer"
|
|
75
|
+
@click="() => $emit('close')"
|
|
76
|
+
/>
|
|
77
|
+
</span>
|
|
78
|
+
</span>
|
|
79
|
+
</template>
|