@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,160 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* This is the custom DropDown for each element (like select / tag-select)
|
|
4
|
+
*
|
|
5
|
+
* TODO:: add screen reader support
|
|
6
|
+
* Fix overflow bug (See Ellipsis Text story)
|
|
7
|
+
* TODO:: if the dropdown is open and the user types something, the element with a matching value should be focused.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { computed, nextTick, ref, watch } from 'vue';
|
|
11
|
+
import { InputColorType, Size } from '../../../enums';
|
|
12
|
+
import type { SelectOption } from '../__types';
|
|
13
|
+
import { useVModel } from '@vueuse/core';
|
|
14
|
+
import type { Validator } from '@antify/validate';
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits(['update:open', 'update:modelValue']);
|
|
17
|
+
const props = withDefaults(defineProps<{
|
|
18
|
+
modelValue: string | number | null;
|
|
19
|
+
open: boolean;
|
|
20
|
+
options: SelectOption[];
|
|
21
|
+
colorType?: InputColorType;
|
|
22
|
+
validator?: Validator;
|
|
23
|
+
size?: Size;
|
|
24
|
+
inputRef?: HTMLElement | null
|
|
25
|
+
}>(), {
|
|
26
|
+
colorType: InputColorType.base,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
30
|
+
const isOpen = useVModel(props, 'open', emit);
|
|
31
|
+
|
|
32
|
+
const focusedDropDownItem = ref<string | number | null>(null);
|
|
33
|
+
const dropDownRef = ref<HTMLElement | null>(null);
|
|
34
|
+
|
|
35
|
+
const dropdownClasses = computed(() => {
|
|
36
|
+
const variants: Record<InputColorType, string> = {
|
|
37
|
+
[InputColorType.base]: 'bg-neutral-300 border-neutral-300',
|
|
38
|
+
[InputColorType.success]: 'bg-success-500 border-success-500',
|
|
39
|
+
[InputColorType.info]: 'bg-info-500 border-info-500',
|
|
40
|
+
[InputColorType.warning]: 'bg-warning-500 border-warning-500',
|
|
41
|
+
[InputColorType.danger]: 'bg-danger-500 border-danger-500',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
'absolute w-full border flex flex-col gap-px outline-none -mt-px overflow-hidden shadow-md z-40': true,
|
|
46
|
+
'rounded-bl-md rounded-br-md': true,
|
|
47
|
+
[variants[props.colorType]]: true,
|
|
48
|
+
// Size
|
|
49
|
+
'text-xs': props.size === Size.sm,
|
|
50
|
+
'text-sm': props.size === Size.md,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
const dropDownItemClasses = computed(() => {
|
|
54
|
+
const variants: Record<InputColorType, string> = {
|
|
55
|
+
[InputColorType.base]: 'bg-neutral-50 text-neutral-50-font',
|
|
56
|
+
[InputColorType.success]: 'bg-success-100 border-success-100-font',
|
|
57
|
+
[InputColorType.info]: 'bg-info-100 border-info-100-font',
|
|
58
|
+
[InputColorType.warning]: 'bg-warning-100 border-warning-100-font',
|
|
59
|
+
[InputColorType.danger]: 'bg-danger-100 border-danger-100-font',
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
'select-none text-ellipsis overflow-hidden whitespace-nowrap': true,
|
|
64
|
+
[variants[props.colorType]]: true,
|
|
65
|
+
// Size
|
|
66
|
+
'p-1.5': props.size === Size.sm,
|
|
67
|
+
'p-2.5': props.size === Size.md,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
watch(isOpen, (val) => {
|
|
72
|
+
nextTick(() => {
|
|
73
|
+
if (val) {
|
|
74
|
+
dropDownRef.value?.focus();
|
|
75
|
+
focusedDropDownItem.value = _modelValue.value || props.options[0].value;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
function onKeyDownDropDown(e: KeyboardEvent) {
|
|
81
|
+
if (e.key === 'Enter') {
|
|
82
|
+
isOpen.value = false;
|
|
83
|
+
_modelValue.value = focusedDropDownItem.value;
|
|
84
|
+
props.inputRef?.focus();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (e.key === 'Escape') {
|
|
88
|
+
isOpen.value = false;
|
|
89
|
+
props.inputRef?.focus();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowRight') {
|
|
93
|
+
const index = props.options.findIndex(option => option.value === focusedDropDownItem.value);
|
|
94
|
+
const option = props.options[index + 1];
|
|
95
|
+
|
|
96
|
+
if (index === -1) {
|
|
97
|
+
focusedDropDownItem.value = props.options[0].value
|
|
98
|
+
} else if (option !== undefined) {
|
|
99
|
+
focusedDropDownItem.value = option.value
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') {
|
|
104
|
+
const index = props.options.findIndex(option => option.value === focusedDropDownItem.value);
|
|
105
|
+
const option = props.options[index - 1];
|
|
106
|
+
|
|
107
|
+
if (option !== undefined) {
|
|
108
|
+
focusedDropDownItem.value = option.value
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (e.key === 'Tab') {
|
|
113
|
+
isOpen.value = false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function getActiveDropDownItemClasses(option: SelectOption) {
|
|
118
|
+
const variants: Record<InputColorType, string> = {
|
|
119
|
+
[InputColorType.base]: 'bg-neutral-50/25',
|
|
120
|
+
[InputColorType.success]: 'bg-success-100/25',
|
|
121
|
+
[InputColorType.info]: 'bg-info-100/25',
|
|
122
|
+
[InputColorType.warning]: 'bg-warning-100/25',
|
|
123
|
+
[InputColorType.danger]: 'bg-danger-100/25',
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return option.value === focusedDropDownItem.value ? {[variants[props.colorType]]: true} : {};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function onClickDropDownItem(e: MouseEvent, value: string | number | null) {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
props.inputRef?.focus();
|
|
132
|
+
|
|
133
|
+
isOpen.value = false;
|
|
134
|
+
_modelValue.value = value;
|
|
135
|
+
}
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<template>
|
|
139
|
+
<div
|
|
140
|
+
v-if="isOpen"
|
|
141
|
+
:class="dropdownClasses"
|
|
142
|
+
@keydown="onKeyDownDropDown"
|
|
143
|
+
ref="dropDownRef"
|
|
144
|
+
tabindex="0"
|
|
145
|
+
>
|
|
146
|
+
<div
|
|
147
|
+
v-for="(option, index) in options"
|
|
148
|
+
:key="`option-${index}`"
|
|
149
|
+
:class="{...dropDownItemClasses, ...getActiveDropDownItemClasses(option)}"
|
|
150
|
+
@mousedown="(e) => onClickDropDownItem(e, option.value)"
|
|
151
|
+
@mouseover="() => focusedDropDownItem = option.value"
|
|
152
|
+
>
|
|
153
|
+
{{ option.label }}
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
|
|
158
|
+
<style scoped>
|
|
159
|
+
|
|
160
|
+
</style>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {onMounted, computed} from 'vue';
|
|
3
|
+
import {Size} from '../../../enums/Size.enum'
|
|
4
|
+
import AntInputLabel from './AntInputLabel.vue';
|
|
5
|
+
import AntInputDescription from './AntInputDescription.vue';
|
|
6
|
+
import {handleEnumValidation} from '../../../handler';
|
|
7
|
+
import AntInputLimiter from './AntInputLimiter.vue';
|
|
8
|
+
import {InputColorType} from '../../../enums';
|
|
9
|
+
|
|
10
|
+
const emits = defineEmits(['clickLabel', 'validate']);
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
label?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
size?: Size;
|
|
15
|
+
colorType?: InputColorType;
|
|
16
|
+
skeleton?: boolean;
|
|
17
|
+
limiterValue?: number;
|
|
18
|
+
limiterMaxValue?: number;
|
|
19
|
+
labelFor?: string;
|
|
20
|
+
showMessageOnError?: boolean;
|
|
21
|
+
errors?: string[];
|
|
22
|
+
expanded?: boolean;
|
|
23
|
+
}>(), {
|
|
24
|
+
colorType: InputColorType.base,
|
|
25
|
+
skeleton: false,
|
|
26
|
+
size: Size.md,
|
|
27
|
+
showMessageOnError: true,
|
|
28
|
+
errors: [],
|
|
29
|
+
expanded: true
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
onMounted(() => {
|
|
33
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
34
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const _errors = computed(() => props.skeleton ? [] : props.errors);
|
|
38
|
+
const _colorType = computed(() => _errors.value.length > 0 ? InputColorType.danger : props.colorType)
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div
|
|
43
|
+
class="flex flex-col items-start gap-1.5"
|
|
44
|
+
:class="{'w-full': expanded}"
|
|
45
|
+
>
|
|
46
|
+
<AntInputLabel
|
|
47
|
+
:label="label"
|
|
48
|
+
:size="size"
|
|
49
|
+
:skeleton="skeleton"
|
|
50
|
+
:for="labelFor"
|
|
51
|
+
@clickContent="$emit('clickLabel')"
|
|
52
|
+
>
|
|
53
|
+
<div class="w-full">
|
|
54
|
+
<slot/>
|
|
55
|
+
</div>
|
|
56
|
+
</AntInputLabel>
|
|
57
|
+
|
|
58
|
+
<div
|
|
59
|
+
v-if="showMessageOnError && (description || _errors.length > 0)"
|
|
60
|
+
class="flex justify-between w-full"
|
|
61
|
+
>
|
|
62
|
+
<AntInputDescription
|
|
63
|
+
:size="size"
|
|
64
|
+
:skeleton="skeleton"
|
|
65
|
+
:color-type="_colorType"
|
|
66
|
+
>
|
|
67
|
+
<slot name="description">
|
|
68
|
+
<template v-if="_errors.length === 1">
|
|
69
|
+
{{ errors[0] }}
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<template v-else-if="_errors.length > 1">
|
|
73
|
+
<ul class="list-disc list-outside pl-4">
|
|
74
|
+
<li
|
|
75
|
+
v-for="(error, index) of _errors"
|
|
76
|
+
:key="`field-error-${index}`"
|
|
77
|
+
class="marker:m-none marker:p-none"
|
|
78
|
+
>
|
|
79
|
+
{{ error }}
|
|
80
|
+
</li>
|
|
81
|
+
</ul>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<template v-else>
|
|
85
|
+
{{ description }}
|
|
86
|
+
</template>
|
|
87
|
+
</slot>
|
|
88
|
+
</AntInputDescription>
|
|
89
|
+
|
|
90
|
+
<AntInputLimiter
|
|
91
|
+
v-if="limiterMaxValue !== undefined && limiterValue !== undefined"
|
|
92
|
+
:value="limiterValue"
|
|
93
|
+
:max-value="limiterMaxValue"
|
|
94
|
+
:color-type="_colorType"
|
|
95
|
+
:size="size"
|
|
96
|
+
:skeleton="skeleton"
|
|
97
|
+
>
|
|
98
|
+
{{ limiterValue }}/{{ limiterMaxValue }}
|
|
99
|
+
</AntInputLimiter>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {Size} from '../../../enums/Size.enum'
|
|
4
|
+
import AntSkeleton from '../../AntSkeleton.vue';
|
|
5
|
+
import {handleEnumValidation} from '../../../handler';
|
|
6
|
+
import {InputColorType} from '../../../enums';
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<{
|
|
9
|
+
colorType?: InputColorType,
|
|
10
|
+
size?: Size;
|
|
11
|
+
skeleton?: boolean;
|
|
12
|
+
}>(), {
|
|
13
|
+
skeleton: false,
|
|
14
|
+
size: Size.md,
|
|
15
|
+
colorType: InputColorType.base
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const classes = computed(() => {
|
|
19
|
+
const variants: Record<InputColorType, string> = {
|
|
20
|
+
[InputColorType.base]: 'text-neutral-500',
|
|
21
|
+
[InputColorType.danger]: 'text-danger-500',
|
|
22
|
+
[InputColorType.info]: 'text-info-500',
|
|
23
|
+
[InputColorType.success]: 'text-success-500',
|
|
24
|
+
[InputColorType.warning]: 'text-warning-500',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
'relative font-regular inline-block transition-color': true,
|
|
29
|
+
'text-xs': props.size === Size.sm,
|
|
30
|
+
'text-sm': props.size === Size.md,
|
|
31
|
+
[variants[props.colorType]]: true
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
37
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div
|
|
43
|
+
:class="classes"
|
|
44
|
+
>
|
|
45
|
+
<span :class="{'invisible': skeleton}">
|
|
46
|
+
<slot/>
|
|
47
|
+
</span>
|
|
48
|
+
|
|
49
|
+
<AntSkeleton
|
|
50
|
+
v-if="skeleton"
|
|
51
|
+
absolute
|
|
52
|
+
rounded
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {Size} from '../../../enums/Size.enum'
|
|
4
|
+
import AntSkeleton from '../../AntSkeleton.vue';
|
|
5
|
+
import {handleEnumValidation} from '../../../handler';
|
|
6
|
+
|
|
7
|
+
defineEmits(['clickContent']);
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
label?: string;
|
|
11
|
+
size?: Size;
|
|
12
|
+
skeleton?: boolean;
|
|
13
|
+
}>(), {
|
|
14
|
+
skeleton: false,
|
|
15
|
+
size: Size.md,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const classes = computed(() => ({
|
|
19
|
+
'relative font-medium w-fit': true,
|
|
20
|
+
'text-xs': props.size === Size.sm,
|
|
21
|
+
'text-sm': props.size === Size.md,
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
onMounted(() => {
|
|
25
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<label
|
|
31
|
+
class="flex flex-col gap-1.5 w-full"
|
|
32
|
+
>
|
|
33
|
+
<span
|
|
34
|
+
v-if="label"
|
|
35
|
+
:class="classes"
|
|
36
|
+
>
|
|
37
|
+
<span
|
|
38
|
+
:class="{'invisible': skeleton}"
|
|
39
|
+
@click="$emit('clickContent')"
|
|
40
|
+
>
|
|
41
|
+
<slot name="label">
|
|
42
|
+
{{ label }}
|
|
43
|
+
</slot>
|
|
44
|
+
</span>
|
|
45
|
+
|
|
46
|
+
<AntSkeleton
|
|
47
|
+
v-if="skeleton"
|
|
48
|
+
absolute
|
|
49
|
+
rounded
|
|
50
|
+
/>
|
|
51
|
+
</span>
|
|
52
|
+
|
|
53
|
+
<slot/>
|
|
54
|
+
</label>
|
|
55
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {Size} from '../../../enums/Size.enum'
|
|
4
|
+
import AntSkeleton from '../../AntSkeleton.vue';
|
|
5
|
+
import {handleEnumValidation} from '../../../handler';
|
|
6
|
+
import {InputColorType} from '../../../enums';
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<{
|
|
9
|
+
value: number;
|
|
10
|
+
maxValue: number;
|
|
11
|
+
colorType?: InputColorType;
|
|
12
|
+
size?: Size;
|
|
13
|
+
skeleton?: boolean;
|
|
14
|
+
}>(), {
|
|
15
|
+
skeleton: false,
|
|
16
|
+
size: Size.md,
|
|
17
|
+
colorType: InputColorType.base
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const classes = computed(() => {
|
|
21
|
+
const variants: Record<InputColorType, string> = {
|
|
22
|
+
[InputColorType.base]: 'text-neutral-500',
|
|
23
|
+
[InputColorType.danger]: 'text-danger-500',
|
|
24
|
+
[InputColorType.info]: 'text-info-500',
|
|
25
|
+
[InputColorType.success]: 'text-success-500',
|
|
26
|
+
[InputColorType.warning]: 'text-warning-500',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
'relative font-regular inline-block transition-color': true,
|
|
31
|
+
'text-xs': props.size === Size.sm,
|
|
32
|
+
'text-sm': props.size === Size.md,
|
|
33
|
+
[variants[props.colorType]]: true,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
onMounted(() => {
|
|
38
|
+
handleEnumValidation(props.size, Size, 'size');
|
|
39
|
+
handleEnumValidation(props.colorType, InputColorType, 'colorType');
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div :class="classes">
|
|
45
|
+
<span :class="{'invisible': skeleton}">
|
|
46
|
+
{{ value }}/{{ maxValue }}
|
|
47
|
+
</span>
|
|
48
|
+
|
|
49
|
+
<AntSkeleton
|
|
50
|
+
v-if="skeleton"
|
|
51
|
+
absolute
|
|
52
|
+
rounded
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {computed, useSlots} from 'vue';
|
|
3
|
+
import AntNavbar from '../navbar/AntNavbar.vue';
|
|
4
|
+
import type {RouteLocationRaw} from 'vue-router';
|
|
5
|
+
import type {NavbarItem} from '../navbar/__types/NavbarItem';
|
|
6
|
+
|
|
7
|
+
defineProps<{
|
|
8
|
+
navbarItems: NavbarItem[];
|
|
9
|
+
logoRoute?: RouteLocationRaw;
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const hasLogoImageSlot = computed(() => useSlots()['logo-image'] || false);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="flex gap-px bg-neutral-300 h-screen overflow-hidden">
|
|
17
|
+
<div class="flex flex-col gap-px bg-neutral-300 w-52 shrink-0">
|
|
18
|
+
<component
|
|
19
|
+
v-if="hasLogoImageSlot"
|
|
20
|
+
:is="logoRoute ? 'RouterLink' : 'div'"
|
|
21
|
+
:to="logoRoute"
|
|
22
|
+
class="bg-neutral-50 min-h-[60px] flex justify-center items-center p-2.5"
|
|
23
|
+
>
|
|
24
|
+
<slot name="logo-image"/>
|
|
25
|
+
</component>
|
|
26
|
+
|
|
27
|
+
<AntNavbar
|
|
28
|
+
:navbar-items="navbarItems"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="flex-grow">
|
|
33
|
+
<slot/>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import type { NavbarItem } from './__types/NavbarItem';
|
|
5
|
+
import AntNavbarItem from './AntNavbarItem.vue';
|
|
6
|
+
|
|
7
|
+
defineProps<{
|
|
8
|
+
navbarItems: NavbarItem[]
|
|
9
|
+
}>();
|
|
10
|
+
|
|
11
|
+
const containerClasses = computed(() => ({
|
|
12
|
+
'w-full h-full bg-white flex flex-col gap-1 p-1.5': true,
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div :class="containerClasses">
|
|
19
|
+
<AntNavbarItem
|
|
20
|
+
v-for="(navbarItem, index) in navbarItems"
|
|
21
|
+
:key="`navbar-item-${index}`"
|
|
22
|
+
:navbar-item="navbarItem"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type {NavbarItem} from './__types/NavbarItem';
|
|
3
|
+
import {computed, ref} from 'vue';
|
|
4
|
+
import AntIcon from '../AntIcon.vue';
|
|
5
|
+
import {faChevronDown, faChevronUp} from '@fortawesome/free-solid-svg-icons';
|
|
6
|
+
import AntTransitionCollapseHeight from '../transitions/AntTransitionCollapseHeight.vue';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
navbarItem: NavbarItem
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const itemClasses = computed(() => ({
|
|
13
|
+
'w-full text-sm p-1.5 rounded-md cursor-pointer flex items-center flex-nowrap gap-1': true,
|
|
14
|
+
'transition-colors hover:bg-neutral-100': true,
|
|
15
|
+
'text-primary-500': props.navbarItem.active
|
|
16
|
+
}))
|
|
17
|
+
|
|
18
|
+
const open = ref(false)
|
|
19
|
+
|
|
20
|
+
function itemClick(): void {
|
|
21
|
+
if (props.navbarItem.click) {
|
|
22
|
+
props.navbarItem.click();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (props.navbarItem.children && props.navbarItem.children.length > 0) {
|
|
26
|
+
open.value = !open.value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<component
|
|
33
|
+
:is="navbarItem.to ? 'router-link' : 'div'"
|
|
34
|
+
:to="navbarItem.to"
|
|
35
|
+
v-bind="$attrs"
|
|
36
|
+
:class="itemClasses"
|
|
37
|
+
@click="itemClick"
|
|
38
|
+
>
|
|
39
|
+
<AntIcon
|
|
40
|
+
v-if="navbarItem.icon"
|
|
41
|
+
:icon="navbarItem.icon"
|
|
42
|
+
:color="navbarItem.active ? 'text-primary-500' : 'text-for-white-bg-font'"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<div class="flex-grow select-none">
|
|
46
|
+
{{ navbarItem.label }}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div
|
|
50
|
+
v-if="navbarItem.children && navbarItem.children.length > 0"
|
|
51
|
+
>
|
|
52
|
+
<AntIcon
|
|
53
|
+
v-if="!open"
|
|
54
|
+
:icon="faChevronDown"
|
|
55
|
+
:color="navbarItem.active ? 'text-primary-500' : 'text-for-white-bg-font'"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<AntIcon
|
|
59
|
+
v-if="open"
|
|
60
|
+
:icon="faChevronUp"
|
|
61
|
+
:color="navbarItem.active ? 'text-primary-500' : 'text-for-white-bg-font'"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</component>
|
|
65
|
+
|
|
66
|
+
<AntTransitionCollapseHeight
|
|
67
|
+
v-if="navbarItem.children && navbarItem.children.length > 0"
|
|
68
|
+
>
|
|
69
|
+
<div v-show="open">
|
|
70
|
+
<AntNavbarItem
|
|
71
|
+
v-for="(child, index) in navbarItem.children"
|
|
72
|
+
:key="`navbar-item-child-${index}`"
|
|
73
|
+
:navbar-item="child"
|
|
74
|
+
class="pl-[30px]"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
</AntTransitionCollapseHeight>
|
|
78
|
+
</template>
|