@antify/ui 1.0.0
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 +14 -0
- package/dist/components/AntAccordion.vue +64 -0
- package/dist/components/AntAccordionItem.vue +119 -0
- package/dist/components/AntAlert.vue +146 -0
- package/dist/components/AntCard.vue +34 -0
- package/dist/components/AntContent.vue +16 -0
- package/dist/components/AntDropdown.vue +100 -0
- package/dist/components/AntIcon.vue +56 -0
- package/dist/components/AntKeycap.vue +45 -0
- package/dist/components/AntListGroup.vue +24 -0
- package/dist/components/AntListGroupItem.vue +83 -0
- package/dist/components/AntModal.vue +130 -0
- package/dist/components/AntPagination.vue +205 -0
- package/dist/components/AntPopover.vue +135 -0
- package/dist/components/AntSkeleton.vue +38 -0
- package/dist/components/AntSpinner.vue +101 -0
- package/dist/components/AntTag.vue +114 -0
- package/dist/components/AntToast.vue +119 -0
- package/dist/components/AntToaster.vue +71 -0
- package/dist/components/AntTooltip.vue +189 -0
- package/dist/components/Main.stories.d.ts +7 -0
- package/dist/components/Main.stories.js +15 -0
- package/dist/components/Main.stories.mjs +8 -0
- package/dist/components/__stories/AntAccordion.stories.d.ts +9 -0
- package/dist/components/__stories/AntAccordion.stories.js +120 -0
- package/dist/components/__stories/AntAccordion.stories.mjs +101 -0
- package/dist/components/__stories/AntAlert.stories.d.ts +11 -0
- package/dist/components/__stories/AntAlert.stories.js +99 -0
- package/dist/components/__stories/AntAlert.stories.mjs +81 -0
- package/dist/components/__stories/AntCard.stories.d.ts +7 -0
- package/dist/components/__stories/AntCard.stories.js +118 -0
- package/dist/components/__stories/AntCard.stories.mjs +87 -0
- package/dist/components/__stories/AntContent.stories.d.ts +6 -0
- package/dist/components/__stories/AntContent.stories.js +43 -0
- package/dist/components/__stories/AntContent.stories.mjs +26 -0
- package/dist/components/__stories/AntDropdown.stories.d.ts +6 -0
- package/dist/components/__stories/AntDropdown.stories.js +71 -0
- package/dist/components/__stories/AntDropdown.stories.mjs +52 -0
- package/dist/components/__stories/AntIcon.stories.d.ts +8 -0
- package/dist/components/__stories/AntIcon.stories.js +122 -0
- package/dist/components/__stories/AntIcon.stories.mjs +93 -0
- package/dist/components/__stories/AntKeycap.stories.d.ts +9 -0
- package/dist/components/__stories/AntKeycap.stories.js +98 -0
- package/dist/components/__stories/AntKeycap.stories.mjs +69 -0
- package/dist/components/__stories/AntListGroup.stories.d.ts +7 -0
- package/dist/components/__stories/AntListGroup.stories.js +56 -0
- package/dist/components/__stories/AntListGroup.stories.mjs +36 -0
- package/dist/components/__stories/AntListGroupItem.stories.d.ts +10 -0
- package/dist/components/__stories/AntListGroupItem.stories.js +83 -0
- package/dist/components/__stories/AntListGroupItem.stories.mjs +62 -0
- package/dist/components/__stories/AntModal.stories.d.ts +7 -0
- package/dist/components/__stories/AntModal.stories.js +96 -0
- package/dist/components/__stories/AntModal.stories.mjs +78 -0
- package/dist/components/__stories/AntPagination.stories.d.ts +8 -0
- package/dist/components/__stories/AntPagination.stories.js +57 -0
- package/dist/components/__stories/AntPagination.stories.mjs +41 -0
- package/dist/components/__stories/AntPopover.stories.d.ts +6 -0
- package/dist/components/__stories/AntPopover.stories.js +67 -0
- package/dist/components/__stories/AntPopover.stories.mjs +47 -0
- package/dist/components/__stories/AntSkeleton.stories.d.ts +8 -0
- package/dist/components/__stories/AntSkeleton.stories.js +60 -0
- package/dist/components/__stories/AntSkeleton.stories.mjs +43 -0
- package/dist/components/__stories/AntSpinner.stories.d.ts +6 -0
- package/dist/components/__stories/AntSpinner.stories.js +61 -0
- package/dist/components/__stories/AntSpinner.stories.mjs +34 -0
- package/dist/components/__stories/AntTag.stories.d.ts +7 -0
- package/dist/components/__stories/AntTag.stories.js +65 -0
- package/dist/components/__stories/AntTag.stories.mjs +43 -0
- package/dist/components/__stories/AntToast.stories.d.ts +8 -0
- package/dist/components/__stories/AntToast.stories.js +85 -0
- package/dist/components/__stories/AntToast.stories.mjs +66 -0
- package/dist/components/__stories/AntToaster.stories.d.ts +42 -0
- package/dist/components/__stories/AntToaster.stories.js +128 -0
- package/dist/components/__stories/AntToaster.stories.mjs +110 -0
- package/dist/components/__stories/AntTooltip.stories.d.ts +16 -0
- package/dist/components/__stories/AntTooltip.stories.js +283 -0
- package/dist/components/__stories/AntTooltip.stories.mjs +241 -0
- package/dist/components/__types/AntAccordion.types.d.ts +4 -0
- package/dist/components/__types/AntAccordion.types.js +11 -0
- package/dist/components/__types/AntAccordion.types.mjs +5 -0
- package/dist/components/__types/AntIcon.types.d.ts +8 -0
- package/dist/components/__types/AntIcon.types.js +15 -0
- package/dist/components/__types/AntIcon.types.mjs +9 -0
- package/dist/components/__types/AntKeycap.types.d.ts +4 -0
- package/dist/components/__types/AntKeycap.types.js +11 -0
- package/dist/components/__types/AntKeycap.types.mjs +5 -0
- package/dist/components/__types/AntListGroupItem.types.d.ts +9 -0
- package/dist/components/__types/AntListGroupItem.types.js +16 -0
- package/dist/components/__types/AntListGroupItem.types.mjs +10 -0
- package/dist/components/__types/AntSpinner.types.d.ts +10 -0
- package/dist/components/__types/AntSpinner.types.js +17 -0
- package/dist/components/__types/AntSpinner.types.mjs +11 -0
- package/dist/components/__types/AntTag.types.d.ts +17 -0
- package/dist/components/__types/AntTag.types.js +25 -0
- package/dist/components/__types/AntTag.types.mjs +19 -0
- package/dist/components/__types/AntToaster.types.d.ts +8 -0
- package/dist/components/__types/AntToaster.types.js +1 -0
- package/dist/components/__types/AntToaster.types.mjs +0 -0
- package/dist/components/__types/index.d.ts +7 -0
- package/dist/components/__types/index.js +82 -0
- package/dist/components/__types/index.mjs +7 -0
- package/dist/components/buttons/AntActionButton.vue +74 -0
- package/dist/components/buttons/AntButton.vue +257 -0
- package/dist/components/buttons/AntCreateButton.vue +54 -0
- package/dist/components/buttons/AntDeleteButton.vue +54 -0
- package/dist/components/buttons/AntDuplicateButton.vue +54 -0
- package/dist/components/buttons/AntEditButton.vue +54 -0
- package/dist/components/buttons/AntSaveAndNewButton.vue +56 -0
- package/dist/components/buttons/AntSaveButton.vue +55 -0
- package/dist/components/buttons/__stories/AntActionButton.stories.d.ts +11 -0
- package/dist/components/buttons/__stories/AntActionButton.stories.js +111 -0
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +86 -0
- package/dist/components/buttons/__stories/AntButton.stories.d.ts +16 -0
- package/dist/components/buttons/__stories/AntButton.stories.js +361 -0
- package/dist/components/buttons/__stories/AntButton.stories.mjs +313 -0
- package/dist/components/buttons/__stories/AntCreateButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntCreateButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntDeleteButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntDeleteButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntEditButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntEditButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntSaveButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntSaveButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +76 -0
- package/dist/components/buttons/__types/AntButton.types.d.ts +4 -0
- package/dist/components/buttons/__types/AntButton.types.js +11 -0
- package/dist/components/buttons/__types/AntButton.types.mjs +5 -0
- package/dist/components/buttons/__types/index.d.ts +1 -0
- package/dist/components/buttons/__types/index.js +16 -0
- package/dist/components/buttons/__types/index.mjs +1 -0
- package/dist/components/crud/AntCrud.vue +75 -0
- package/dist/components/crud/AntCrudDetail.vue +11 -0
- package/dist/components/crud/AntCrudDetailActions.vue +58 -0
- package/dist/components/crud/AntCrudDetailNav.vue +64 -0
- package/dist/components/crud/AntCrudTableFilter.vue +122 -0
- package/dist/components/crud/AntCrudTableNav.vue +149 -0
- package/dist/components/crud/__stories/AntCrud.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrud.stories.js +131 -0
- package/dist/components/crud/__stories/AntCrud.stories.mjs +130 -0
- package/dist/components/crud/__stories/AntCrudDetail.stories.d.ts +7 -0
- package/dist/components/crud/__stories/AntCrudDetail.stories.js +90 -0
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +84 -0
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.js +38 -0
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +25 -0
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.js +51 -0
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +45 -0
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.js +42 -0
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +27 -0
- package/dist/components/crud/__stories/AntCrudTableNav.stories.d.ts +8 -0
- package/dist/components/crud/__stories/AntCrudTableNav.stories.js +77 -0
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +58 -0
- package/dist/components/dialogs/AntDeleteDialog.vue +29 -0
- package/dist/components/dialogs/AntDialog.vue +182 -0
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.d.ts +6 -0
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.js +48 -0
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +32 -0
- package/dist/components/dialogs/__stories/AntDialog.stories.d.ts +6 -0
- package/dist/components/dialogs/__stories/AntDialog.stories.js +84 -0
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +60 -0
- package/dist/components/forms/AntField.vue +123 -0
- package/dist/components/forms/AntFormGroup.vue +36 -0
- package/dist/components/forms/AntFormGroupLabel.vue +5 -0
- package/dist/components/forms/__stories/AntField.stories.d.ts +6 -0
- package/dist/components/forms/__stories/AntField.stories.js +110 -0
- package/dist/components/forms/__stories/AntField.stories.mjs +80 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.d.ts +6 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.js +53 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +33 -0
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.d.ts +6 -0
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.js +35 -0
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +20 -0
- package/dist/components/index.d.ts +62 -0
- package/dist/components/index.js +433 -0
- package/dist/components/index.mjs +124 -0
- package/dist/components/inputs/AntCheckbox.vue +201 -0
- package/dist/components/inputs/AntCheckboxGroup.vue +117 -0
- package/dist/components/inputs/AntDateInput.vue +104 -0
- package/dist/components/inputs/AntNumberInput.vue +157 -0
- package/dist/components/inputs/AntPasswordInput.vue +107 -0
- package/dist/components/inputs/AntRadio.vue +214 -0
- package/dist/components/inputs/AntRadioGroup.vue +127 -0
- package/dist/components/inputs/AntRangeSlider.vue +121 -0
- package/dist/components/inputs/AntRichTextEditor.vue +237 -0
- package/dist/components/inputs/AntSearch.vue +75 -0
- package/dist/components/inputs/AntSelect.vue +319 -0
- package/dist/components/inputs/AntSwitch.vue +192 -0
- package/dist/components/inputs/AntSwitcher.vue +196 -0
- package/dist/components/inputs/AntTagInput.vue +339 -0
- package/dist/components/inputs/AntTextInput.vue +75 -0
- package/dist/components/inputs/AntTextarea.vue +191 -0
- package/dist/components/inputs/AntUnitInput.vue +96 -0
- package/dist/components/inputs/Elements/AntBaseInput.vue +319 -0
- package/dist/components/inputs/Elements/AntDropDown.vue +189 -0
- package/dist/components/inputs/Elements/AntInputDescription.vue +58 -0
- package/dist/components/inputs/Elements/AntInputLabel.vue +62 -0
- package/dist/components/inputs/Elements/AntInputLimiter.vue +58 -0
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +11 -0
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +311 -0
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +234 -0
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.d.ts +6 -0
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.js +61 -0
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +34 -0
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.d.ts +7 -0
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.js +76 -0
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +46 -0
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.d.ts +6 -0
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.js +64 -0
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +37 -0
- package/dist/components/inputs/Elements/__types/AntBaseInput.types.d.ts +17 -0
- package/dist/components/inputs/Elements/__types/AntBaseInput.types.js +24 -0
- package/dist/components/inputs/Elements/__types/AntBaseInput.types.mjs +18 -0
- package/dist/components/inputs/Elements/__types/index.d.ts +1 -0
- package/dist/components/inputs/Elements/__types/index.js +16 -0
- package/dist/components/inputs/Elements/__types/index.mjs +1 -0
- package/dist/components/inputs/Elements/index.d.ts +6 -0
- package/dist/components/inputs/Elements/index.js +41 -0
- package/dist/components/inputs/Elements/index.mjs +12 -0
- package/dist/components/inputs/__stories/AntCheckbox.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntCheckbox.stories.js +415 -0
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +382 -0
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.d.ts +7 -0
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.js +107 -0
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +84 -0
- package/dist/components/inputs/__stories/AntDateInput.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntDateInput.stories.js +233 -0
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +193 -0
- package/dist/components/inputs/__stories/AntNumberInput.stories.d.ts +10 -0
- package/dist/components/inputs/__stories/AntNumberInput.stories.js +301 -0
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +246 -0
- package/dist/components/inputs/__stories/AntPasswordInput.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntPasswordInput.stories.js +206 -0
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +156 -0
- package/dist/components/inputs/__stories/AntRadioGroup.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntRadioGroup.stories.js +279 -0
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +251 -0
- package/dist/components/inputs/__stories/AntRangeSlider.stories.d.ts +7 -0
- package/dist/components/inputs/__stories/AntRangeSlider.stories.js +86 -0
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +67 -0
- package/dist/components/inputs/__stories/AntRichTextEditor.stories-old.d.ts +0 -0
- package/dist/components/inputs/__stories/AntRichTextEditor.stories-old.js +1 -0
- package/dist/components/inputs/__stories/AntRichTextEditor.stories-old.mjs +0 -0
- package/dist/components/inputs/__stories/AntSearch.stories.d.ts +7 -0
- package/dist/components/inputs/__stories/AntSearch.stories.js +137 -0
- package/dist/components/inputs/__stories/AntSearch.stories.mjs +103 -0
- package/dist/components/inputs/__stories/AntSelect.stories.d.ts +13 -0
- package/dist/components/inputs/__stories/AntSelect.stories.js +287 -0
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +255 -0
- package/dist/components/inputs/__stories/AntSwitch.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntSwitch.stories.js +376 -0
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +344 -0
- package/dist/components/inputs/__stories/AntSwitcher.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntSwitcher.stories.js +252 -0
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +235 -0
- package/dist/components/inputs/__stories/AntTagInput.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntTagInput.stories.js +256 -0
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +228 -0
- package/dist/components/inputs/__stories/AntTextInput.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntTextInput.stories.js +271 -0
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +225 -0
- package/dist/components/inputs/__stories/AntTextarea.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntTextarea.stories.js +189 -0
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +144 -0
- package/dist/components/inputs/__stories/AntUnitInput.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntUnitInput.stories.js +158 -0
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +116 -0
- package/dist/components/inputs/__types/AntCheckbox.types.d.ts +6 -0
- package/dist/components/inputs/__types/AntCheckbox.types.js +1 -0
- package/dist/components/inputs/__types/AntCheckbox.types.mjs +0 -0
- package/dist/components/inputs/__types/AntDateInput.types.d.ts +7 -0
- package/dist/components/inputs/__types/AntDateInput.types.js +14 -0
- package/dist/components/inputs/__types/AntDateInput.types.mjs +8 -0
- package/dist/components/inputs/__types/AntRadio.types.d.ts +9 -0
- package/dist/components/inputs/__types/AntRadio.types.js +1 -0
- package/dist/components/inputs/__types/AntRadio.types.mjs +0 -0
- package/dist/components/inputs/__types/AntSelect.types.d.ts +4 -0
- package/dist/components/inputs/__types/AntSelect.types.js +1 -0
- package/dist/components/inputs/__types/AntSelect.types.mjs +0 -0
- package/dist/components/inputs/__types/AntSwitcher.types.d.ts +4 -0
- package/dist/components/inputs/__types/AntSwitcher.types.js +1 -0
- package/dist/components/inputs/__types/AntSwitcher.types.mjs +0 -0
- package/dist/components/inputs/__types/AntTagInput.types.d.ts +5 -0
- package/dist/components/inputs/__types/AntTagInput.types.js +12 -0
- package/dist/components/inputs/__types/AntTagInput.types.mjs +6 -0
- package/dist/components/inputs/__types/AntTextInput.types.d.ts +6 -0
- package/dist/components/inputs/__types/AntTextInput.types.js +13 -0
- package/dist/components/inputs/__types/AntTextInput.types.mjs +7 -0
- package/dist/components/inputs/__types/index.d.ts +7 -0
- package/dist/components/inputs/__types/index.js +82 -0
- package/dist/components/inputs/__types/index.mjs +7 -0
- package/dist/components/layouts/AntNavLeftLayout.vue +36 -0
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.d.ts +7 -0
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.js +77 -0
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +68 -0
- package/dist/components/navbar/AntNavbar.vue +25 -0
- package/dist/components/navbar/AntNavbarItem.vue +78 -0
- package/dist/components/navbar/__stories/AntNavbar.stories.d.ts +6 -0
- package/dist/components/navbar/__stories/AntNavbar.stories.js +73 -0
- package/dist/components/navbar/__stories/AntNavbar.stories.mjs +64 -0
- package/dist/components/navbar/__types/NavbarItem.types.d.ts +10 -0
- package/dist/components/navbar/__types/NavbarItem.types.js +1 -0
- package/dist/components/navbar/__types/NavbarItem.types.mjs +0 -0
- package/dist/components/navbar/__types/index.d.ts +1 -0
- package/dist/components/navbar/__types/index.js +16 -0
- package/dist/components/navbar/__types/index.mjs +1 -0
- package/dist/components/table/AntTable.vue +218 -0
- package/dist/components/table/AntTableSortButton.vue +48 -0
- package/dist/components/table/AntTd.vue +81 -0
- package/dist/components/table/AntTh.vue +78 -0
- package/dist/components/table/__stories/AntTable.stories.d.ts +9 -0
- package/dist/components/table/__stories/AntTable.stories.js +308 -0
- package/dist/components/table/__stories/AntTable.stories.mjs +273 -0
- package/dist/components/table/__types/TableHeader.types.d.ts +36 -0
- package/dist/components/table/__types/TableHeader.types.js +31 -0
- package/dist/components/table/__types/TableHeader.types.mjs +25 -0
- package/dist/components/table/__types/index.d.ts +1 -0
- package/dist/components/table/__types/index.js +16 -0
- package/dist/components/table/__types/index.mjs +1 -0
- package/dist/components/tabs/AntTabItem.vue +118 -0
- package/dist/components/tabs/AntTabs.vue +47 -0
- package/dist/components/tabs/__stories/AntTabItem.stories.d.ts +6 -0
- package/dist/components/tabs/__stories/AntTabItem.stories.js +52 -0
- package/dist/components/tabs/__stories/AntTabItem.stories.mjs +36 -0
- package/dist/components/tabs/__stories/AntTabs.stories.d.ts +9 -0
- package/dist/components/tabs/__stories/AntTabs.stories.js +183 -0
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +179 -0
- package/dist/components/tabs/__types/AntTabItem.types.d.ts +17 -0
- package/dist/components/tabs/__types/AntTabItem.types.js +12 -0
- package/dist/components/tabs/__types/AntTabItem.types.mjs +6 -0
- package/dist/components/tabs/__types/index.d.ts +1 -0
- package/dist/components/tabs/__types/index.js +16 -0
- package/dist/components/tabs/__types/index.mjs +1 -0
- package/dist/components/transitions/AntTransitionCollapseHeight.vue +96 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +16 -0
- package/dist/composables/index.mjs +1 -0
- package/dist/composables/useToaster.d.ts +21 -0
- package/dist/composables/useToaster.js +72 -0
- package/dist/composables/useToaster.mjs +53 -0
- package/dist/enums/Direction.enum.d.ts +4 -0
- package/dist/enums/Direction.enum.js +11 -0
- package/dist/enums/Direction.enum.mjs +5 -0
- package/dist/enums/Grouped.enum.d.ts +6 -0
- package/dist/enums/Grouped.enum.js +13 -0
- package/dist/enums/Grouped.enum.mjs +7 -0
- package/dist/enums/Position.enum.d.ts +12 -0
- package/dist/enums/Position.enum.js +20 -0
- package/dist/enums/Position.enum.mjs +14 -0
- package/dist/enums/Size.enum.d.ts +7 -0
- package/dist/enums/Size.enum.js +14 -0
- package/dist/enums/Size.enum.mjs +8 -0
- package/dist/enums/State.enum.d.ts +16 -0
- package/dist/enums/State.enum.js +24 -0
- package/dist/enums/State.enum.mjs +18 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/index.js +60 -0
- package/dist/enums/index.mjs +5 -0
- package/dist/handler.d.ts +1 -0
- package/dist/handler.js +11 -0
- package/dist/handler.mjs +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +60 -0
- package/dist/index.mjs +5 -0
- package/dist/install.d.ts +3 -0
- package/dist/install.js +17 -0
- package/dist/install.mjs +9 -0
- package/dist/tailwind.config.d.ts +2 -0
- package/dist/tailwind.config.js +198 -0
- package/dist/tailwind.config.mjs +189 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +93 -0
- package/dist/types.mjs +8 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +49 -0
- package/dist/utils.mjs +41 -0
- package/package.json +100 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import {ListGroupItemState} from './__types/AntListGroupItem.types';
|
|
5
|
+
import {handleEnumValidation} from '../handler';
|
|
6
|
+
import {type RouteLocationRaw} from 'vue-router';
|
|
7
|
+
import AntIcon from './AntIcon.vue';
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
to?: RouteLocationRaw | string;
|
|
11
|
+
state?: ListGroupItemState;
|
|
12
|
+
iconLeft?: IconDefinition;
|
|
13
|
+
iconRight?: IconDefinition;
|
|
14
|
+
}>(), {
|
|
15
|
+
state: ListGroupItemState.base,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const classes = computed(() => {
|
|
19
|
+
const variants: Record<ListGroupItemState, string> = {
|
|
20
|
+
[ListGroupItemState.danger]: 'bg-danger-500 text-danger-500-font hover:bg-danger-700',
|
|
21
|
+
[ListGroupItemState.info]: 'bg-info-500 text-info-500-font hover:bg-info-700',
|
|
22
|
+
[ListGroupItemState.base]: 'bg-white text-for-white-bg-font hover:bg-neutral-200',
|
|
23
|
+
[ListGroupItemState.primary]: 'bg-primary-500 text-primary-500-font hover:bg-primary-700',
|
|
24
|
+
[ListGroupItemState.secondary]: 'bg-secondary-500 text-secondary-500-font hover:bg-secondary-700',
|
|
25
|
+
[ListGroupItemState.success]: 'bg-success-500 text-success-500-font hover:bg-success-700',
|
|
26
|
+
[ListGroupItemState.warning]: 'bg-warning-500 text-warning-500-font hover:bg-warning-700',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
'text-sm transition-colors inline-block w-full': true,
|
|
31
|
+
[variants[props.state]]: true,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const contentWrapperClasses = computed(() => {
|
|
35
|
+
const variants: Record<ListGroupItemState, string> = {
|
|
36
|
+
[ListGroupItemState.danger]: 'text-danger-500-font',
|
|
37
|
+
[ListGroupItemState.info]: 'text-info-500-font',
|
|
38
|
+
[ListGroupItemState.base]: 'text-for-white-bg-font',
|
|
39
|
+
[ListGroupItemState.primary]: 'text-primary-500-font',
|
|
40
|
+
[ListGroupItemState.secondary]: 'text-secondary-500-font',
|
|
41
|
+
[ListGroupItemState.success]: 'text-success-500-font',
|
|
42
|
+
[ListGroupItemState.warning]: 'text-warning-500-font',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
'w-full p-2 flex gap-2 items-center justify-between': true,
|
|
47
|
+
'cursor-pointer transition-colors': props.to !== undefined,
|
|
48
|
+
[variants[props.state]]: props.to !== undefined
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
handleEnumValidation(props.state, ListGroupItemState, 'state');
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<component
|
|
59
|
+
:is="to !== undefined ? 'router-link' : 'div'"
|
|
60
|
+
:to="to"
|
|
61
|
+
:class="classes"
|
|
62
|
+
>
|
|
63
|
+
<div :class="contentWrapperClasses">
|
|
64
|
+
<div class="flex items-center gap-2.5">
|
|
65
|
+
<slot
|
|
66
|
+
v-if="iconLeft"
|
|
67
|
+
name="icon-left"
|
|
68
|
+
>
|
|
69
|
+
<AntIcon :icon="iconLeft"/>
|
|
70
|
+
</slot>
|
|
71
|
+
|
|
72
|
+
<slot/>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<slot
|
|
76
|
+
v-if="iconRight"
|
|
77
|
+
name="icon-right"
|
|
78
|
+
>
|
|
79
|
+
<AntIcon :icon="iconRight"/>
|
|
80
|
+
</slot>
|
|
81
|
+
</div>
|
|
82
|
+
</component>
|
|
83
|
+
</template>
|
|
@@ -0,0 +1,130 @@
|
|
|
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-white p-2 flex items-center justify-between text-for-white-bg-font text-lg font-medium"
|
|
57
|
+
>
|
|
58
|
+
<slot name="title">
|
|
59
|
+
{{ title }}
|
|
60
|
+
</slot>
|
|
61
|
+
|
|
62
|
+
<AntButton
|
|
63
|
+
:icon-left="faXmark"
|
|
64
|
+
:outlined="false"
|
|
65
|
+
filled
|
|
66
|
+
@click="closeModal"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div class="bg-white p-2 text-for-white-bg-font grow overflow-y-auto">
|
|
71
|
+
<slot/>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div
|
|
75
|
+
v-if="useSlots()['footer'] || false"
|
|
76
|
+
class="bg-white p-2 text-for-white-bg-font"
|
|
77
|
+
>
|
|
78
|
+
<slot name="footer"/>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</Transition>
|
|
82
|
+
</div>
|
|
83
|
+
</Transition>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<style scoped>
|
|
87
|
+
.fade-leave-active {
|
|
88
|
+
transition: opacity .5s ease;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.fade-enter-active {
|
|
92
|
+
transition: opacity 0.3s ease;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.fade-enter-from,
|
|
96
|
+
.fade-leave-to {
|
|
97
|
+
opacity: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.bounce-enter-active {
|
|
101
|
+
animation: bounce-in .4s;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bounce-leave-active {
|
|
105
|
+
animation: bounce-in .4s reverse;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.bounce-slow-enter-active {
|
|
109
|
+
animation: bounce-in .6s;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.bounce-slow-leave-active {
|
|
113
|
+
animation: bounce-in .4s reverse;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@keyframes bounce-in {
|
|
117
|
+
0% {
|
|
118
|
+
transform: scale(0);
|
|
119
|
+
opacity: 0;
|
|
120
|
+
}
|
|
121
|
+
50% {
|
|
122
|
+
transform: scale(1.05);
|
|
123
|
+
opacity: 1;
|
|
124
|
+
}
|
|
125
|
+
100% {
|
|
126
|
+
transform: scale(1);
|
|
127
|
+
opacity: 1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,205 @@
|
|
|
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 AntSkeleton from './AntSkeleton.vue';
|
|
12
|
+
import {State, Grouped} from '../enums';
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(['update:skeleton', 'input']);
|
|
15
|
+
const props = withDefaults(
|
|
16
|
+
defineProps<{
|
|
17
|
+
pages: number,
|
|
18
|
+
pageQuery?: string,
|
|
19
|
+
skeleton?: boolean,
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Light version does not show the very previous and next page button.
|
|
23
|
+
* This makes the pagination smaller in space.
|
|
24
|
+
*/
|
|
25
|
+
lightVersion?: boolean
|
|
26
|
+
}>(),
|
|
27
|
+
{
|
|
28
|
+
pageQuery: 'p',
|
|
29
|
+
skeleton: false,
|
|
30
|
+
lightVersion: false
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
const router = useRouter();
|
|
34
|
+
const route = useRoute();
|
|
35
|
+
const page = computed({
|
|
36
|
+
get() {
|
|
37
|
+
const _page = route.query[props.pageQuery] >= 1 ? Number.parseInt(route.query[props.pageQuery]) : 1;
|
|
38
|
+
|
|
39
|
+
if (_page <= 0 || _page > props.pages) {
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return _page;
|
|
44
|
+
},
|
|
45
|
+
set(val) {
|
|
46
|
+
const query = {...route.query};
|
|
47
|
+
query[props.pageQuery] = val;
|
|
48
|
+
|
|
49
|
+
(async () => {
|
|
50
|
+
await router.push({
|
|
51
|
+
...route,
|
|
52
|
+
query
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
emit('input', val);
|
|
56
|
+
})();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Build following constellations:
|
|
62
|
+
* [1] 2 3 ... 10
|
|
63
|
+
* 1 [2] 3 4 ... 10
|
|
64
|
+
* 1 2 [3] 4 ... 10
|
|
65
|
+
* 1 ... 3 [4] 5 ... 10
|
|
66
|
+
* 1 ... 4 [5] 6 ... 10
|
|
67
|
+
* 1 ... 7 [8] 9 10
|
|
68
|
+
* 1 ... 8 [9] 10
|
|
69
|
+
* 1 ... 8 9 [10]
|
|
70
|
+
*/
|
|
71
|
+
const defaultPagination = computed(() => {
|
|
72
|
+
const pagination = [];
|
|
73
|
+
|
|
74
|
+
if (page.value > 2 && props.pages > 3) {
|
|
75
|
+
pagination.push(1);
|
|
76
|
+
|
|
77
|
+
if (page.value > 3) {
|
|
78
|
+
pagination.push('...');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (page.value === 1) {
|
|
83
|
+
pagination.push(1);
|
|
84
|
+
|
|
85
|
+
if (props.pages >= 2) {
|
|
86
|
+
pagination.push(2);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (props.pages >= 3) {
|
|
90
|
+
pagination.push(3);
|
|
91
|
+
}
|
|
92
|
+
} else if (page.value === props.pages) {
|
|
93
|
+
if (props.pages - 2 >= 1) {
|
|
94
|
+
pagination.push(props.pages - 2);
|
|
95
|
+
}
|
|
96
|
+
if (props.pages - 1 >= 1) {
|
|
97
|
+
pagination.push(props.pages - 1);
|
|
98
|
+
}
|
|
99
|
+
pagination.push(props.pages);
|
|
100
|
+
} else {
|
|
101
|
+
pagination.push(page.value - 1);
|
|
102
|
+
pagination.push(page.value);
|
|
103
|
+
pagination.push(page.value + 1);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (page.value < props.pages - 1 && props.pages > 3) {
|
|
107
|
+
if (page.value < props.pages - 2) {
|
|
108
|
+
pagination.push('...');
|
|
109
|
+
}
|
|
110
|
+
pagination.push(props.pages);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return pagination;
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Build following constellations:
|
|
118
|
+
* [1] ... 10
|
|
119
|
+
* 1 [2] ... 10
|
|
120
|
+
* 1 ... [3] ... 10
|
|
121
|
+
* 1 ... [5] ... 10
|
|
122
|
+
* 1 ... [8] ... 10
|
|
123
|
+
* 1 ... [9] 10
|
|
124
|
+
* 1 ... [10]
|
|
125
|
+
*/
|
|
126
|
+
const lightPagination = computed(() => {
|
|
127
|
+
const pagination = [];
|
|
128
|
+
|
|
129
|
+
pagination.push(1);
|
|
130
|
+
|
|
131
|
+
if (page.value > 2) {
|
|
132
|
+
pagination.push('...');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (page.value > 1) {
|
|
136
|
+
pagination.push(page.value);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (page.value < props.pages - 1) {
|
|
140
|
+
pagination.push('...');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (page.value < props.pages) {
|
|
144
|
+
pagination.push(props.pages);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return pagination;
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const pagination = computed(() => {
|
|
151
|
+
if (props.lightVersion) {
|
|
152
|
+
return lightPagination.value;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return defaultPagination.value;
|
|
156
|
+
});
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<template>
|
|
160
|
+
<div
|
|
161
|
+
class="inline-flex relative"
|
|
162
|
+
data-e2e="pagination"
|
|
163
|
+
>
|
|
164
|
+
<AntSkeleton
|
|
165
|
+
v-if="skeleton"
|
|
166
|
+
rounded
|
|
167
|
+
absolute
|
|
168
|
+
/>
|
|
169
|
+
|
|
170
|
+
<div
|
|
171
|
+
class="inline-flex gap-px"
|
|
172
|
+
:class="{'invisible': skeleton}"
|
|
173
|
+
>
|
|
174
|
+
<AntButton
|
|
175
|
+
:disabled="page === 1"
|
|
176
|
+
:icon-left="faChevronLeft"
|
|
177
|
+
:grouped="Grouped.left"
|
|
178
|
+
:filled="false"
|
|
179
|
+
@click="() => page = page - 1"
|
|
180
|
+
/>
|
|
181
|
+
|
|
182
|
+
<AntButton
|
|
183
|
+
v-for="(pageObj) in pagination"
|
|
184
|
+
:key="`pagination-button-${pageObj}`"
|
|
185
|
+
:state="pageObj === page ? State.primary : State.base"
|
|
186
|
+
:class="{'text-primary-500 z-10': pageObj === page}"
|
|
187
|
+
:disabled="pageObj === '...'"
|
|
188
|
+
:grouped="Grouped.center"
|
|
189
|
+
:filled="false"
|
|
190
|
+
:readonly="pageObj === page"
|
|
191
|
+
@click="() => page = pageObj"
|
|
192
|
+
>
|
|
193
|
+
{{ pageObj }}
|
|
194
|
+
</AntButton>
|
|
195
|
+
|
|
196
|
+
<AntButton
|
|
197
|
+
:icon-left="faChevronRight"
|
|
198
|
+
:grouped="Grouped.right"
|
|
199
|
+
:disabled="page === pages"
|
|
200
|
+
:filled="false"
|
|
201
|
+
@click="() => page = page + 1"
|
|
202
|
+
/>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</template>
|
|
@@ -0,0 +1,135 @@
|
|
|
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-white': 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-white': 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 bg-neutral-100 rounded-t-md border-t border-l border-r text-neutral-100-font font-semibold"
|
|
96
|
+
>
|
|
97
|
+
{{ title }}
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div
|
|
101
|
+
class="p-2 rounded-b-md text-for-white-bg-font border-neutral-300 border-l border-b border-r bg-white"
|
|
102
|
+
>
|
|
103
|
+
<slot name="content"/>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
</Transition>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<style scoped>
|
|
113
|
+
.bounce-enter-active {
|
|
114
|
+
animation: bounce-in .4s;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.bounce-leave-active {
|
|
118
|
+
animation: bounce-in .4s reverse;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@keyframes bounce-in {
|
|
122
|
+
0% {
|
|
123
|
+
transform: scale(0);
|
|
124
|
+
opacity: 0;
|
|
125
|
+
}
|
|
126
|
+
50% {
|
|
127
|
+
transform: scale(1.05);
|
|
128
|
+
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
100% {
|
|
131
|
+
transform: scale(1);
|
|
132
|
+
opacity: 1;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</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,101 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {AntSpinnerSize} from './__types/AntSpinner.types';
|
|
4
|
+
import {handleEnumValidation} from '../handler';
|
|
5
|
+
import {State} from '../enums/State.enum';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
state?: State,
|
|
9
|
+
size?: AntSpinnerSize;
|
|
10
|
+
inverted?: boolean;
|
|
11
|
+
}>(), {
|
|
12
|
+
size: AntSpinnerSize.md,
|
|
13
|
+
state: State.base,
|
|
14
|
+
inverted: false
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => ({
|
|
18
|
+
'animate-spin': true,
|
|
19
|
+
'w-3 h-3': props.size === AntSpinnerSize.xs2,
|
|
20
|
+
'w-4 h-4': props.size === AntSpinnerSize.xs,
|
|
21
|
+
'w-5 h-5': props.size === AntSpinnerSize.sm,
|
|
22
|
+
'w-6 h-6': props.size === AntSpinnerSize.md,
|
|
23
|
+
'w-7 h-7': props.size === AntSpinnerSize.lg,
|
|
24
|
+
'w-8 h-8': props.size === AntSpinnerSize.xl2,
|
|
25
|
+
'w-9 h-9': props.size === AntSpinnerSize.xl3,
|
|
26
|
+
'w-10 h-10': props.size === AntSpinnerSize.xl4,
|
|
27
|
+
}));
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
handleEnumValidation(props.size, AntSpinnerSize, 'size');
|
|
30
|
+
handleEnumValidation(props.state, State, 'state');
|
|
31
|
+
});
|
|
32
|
+
const circleClass = computed(() => {
|
|
33
|
+
const invertedVariants: Record<State, string> = {
|
|
34
|
+
[State.base]: 'fill-neutral-500',
|
|
35
|
+
[State.primary]: 'fill-primary-700',
|
|
36
|
+
[State.secondary]: 'fill-secondary-700',
|
|
37
|
+
[State.danger]: 'fill-danger-700',
|
|
38
|
+
[State.info]: 'fill-info-700',
|
|
39
|
+
[State.success]: 'fill-success-700',
|
|
40
|
+
[State.warning]: 'fill-warning-700',
|
|
41
|
+
};
|
|
42
|
+
const notInvertedVariants: Record<State, string> = {
|
|
43
|
+
[State.base]: 'fill-neutral-100',
|
|
44
|
+
[State.primary]: 'fill-primary-100',
|
|
45
|
+
[State.secondary]: 'fill-secondary-100',
|
|
46
|
+
[State.danger]: 'fill-danger-100',
|
|
47
|
+
[State.info]: 'fill-info-100',
|
|
48
|
+
[State.success]: 'fill-success-100',
|
|
49
|
+
[State.warning]: 'fill-warning-100',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
[invertedVariants[props.state]]: props.inverted,
|
|
54
|
+
[notInvertedVariants[props.state]]: !props.inverted,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
const spinningElementClass = computed(() => {
|
|
58
|
+
const invertedVariants: Record<State, string> = {
|
|
59
|
+
[State.base]: 'fill-neutral-100',
|
|
60
|
+
[State.primary]: 'fill-primary-100',
|
|
61
|
+
[State.secondary]: 'fill-secondary-100',
|
|
62
|
+
[State.danger]: 'fill-danger-100',
|
|
63
|
+
[State.info]: 'fill-info-100',
|
|
64
|
+
[State.success]: 'fill-success-100',
|
|
65
|
+
[State.warning]: 'fill-warning-100',
|
|
66
|
+
};
|
|
67
|
+
const notInvertedVariants: Record<State, string> = {
|
|
68
|
+
[State.base]: 'fill-neutral-500',
|
|
69
|
+
[State.primary]: 'fill-primary-500',
|
|
70
|
+
[State.secondary]: 'fill-secondary-500',
|
|
71
|
+
[State.danger]: 'fill-danger-500',
|
|
72
|
+
[State.info]: 'fill-info-500',
|
|
73
|
+
[State.success]: 'fill-success-500',
|
|
74
|
+
[State.warning]: 'fill-warning-500',
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
[invertedVariants[props.state]]: props.inverted,
|
|
79
|
+
[notInvertedVariants[props.state]]: !props.inverted,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<svg
|
|
86
|
+
:class="classes"
|
|
87
|
+
viewBox="0 0 16 16"
|
|
88
|
+
fill="none"
|
|
89
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
90
|
+
data-e2e="spinner"
|
|
91
|
+
>
|
|
92
|
+
<path
|
|
93
|
+
:class="circleClass"
|
|
94
|
+
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"
|
|
95
|
+
/>
|
|
96
|
+
<path
|
|
97
|
+
:class="spinningElementClass"
|
|
98
|
+
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"
|
|
99
|
+
/>
|
|
100
|
+
</svg>
|
|
101
|
+
</template>
|