@antify/ui-module 1.7.3 → 1.8.2
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/README.md +43 -52
- package/dist/module.d.mts +1 -251
- package/dist/module.d.ts +1 -251
- package/dist/module.json +1 -1
- package/dist/module.mjs +97 -418
- package/dist/runtime/composables/useUiClient.d.ts +2 -2
- package/dist/runtime/composables/useUiClient.mjs +1 -2
- package/dist/runtime/plugins/ui-module.mjs +3 -2
- package/dist/runtime/tailwind.config.d.ts +2 -3
- package/dist/runtime/tailwind.config.mjs +20 -204
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +10 -41
- package/dist/runtime/components/AntAccordion.vue +0 -64
- package/dist/runtime/components/AntAccordionItem.vue +0 -81
- package/dist/runtime/components/AntAlert.vue +0 -146
- package/dist/runtime/components/AntCard.vue +0 -34
- package/dist/runtime/components/AntContent.vue +0 -16
- package/dist/runtime/components/AntDropdown.vue +0 -79
- package/dist/runtime/components/AntIcon.vue +0 -56
- package/dist/runtime/components/AntKeycap.vue +0 -45
- package/dist/runtime/components/AntListGroup.vue +0 -24
- package/dist/runtime/components/AntListGroupItem.vue +0 -83
- package/dist/runtime/components/AntModal.vue +0 -88
- package/dist/runtime/components/AntPagination.vue +0 -206
- package/dist/runtime/components/AntPopover.vue +0 -114
- package/dist/runtime/components/AntSkeleton.vue +0 -38
- package/dist/runtime/components/AntSpinner.vue +0 -101
- package/dist/runtime/components/AntTag.vue +0 -114
- package/dist/runtime/components/AntToast.vue +0 -119
- package/dist/runtime/components/AntToaster.vue +0 -51
- package/dist/runtime/components/AntTooltip.vue +0 -189
- package/dist/runtime/components/Main.mdx +0 -11
- package/dist/runtime/components/Main.stories.d.ts +0 -7
- package/dist/runtime/components/Main.stories.mjs +0 -8
- package/dist/runtime/components/__stories/AntAccordion.stories.d.ts +0 -9
- package/dist/runtime/components/__stories/AntAccordion.stories.mjs +0 -101
- package/dist/runtime/components/__stories/AntAlert.stories.d.ts +0 -11
- package/dist/runtime/components/__stories/AntAlert.stories.mjs +0 -81
- package/dist/runtime/components/__stories/AntCard.stories.d.ts +0 -7
- package/dist/runtime/components/__stories/AntCard.stories.mjs +0 -87
- package/dist/runtime/components/__stories/AntContent.stories.d.ts +0 -6
- package/dist/runtime/components/__stories/AntContent.stories.mjs +0 -26
- package/dist/runtime/components/__stories/AntDropdown.stories.d.ts +0 -6
- package/dist/runtime/components/__stories/AntDropdown.stories.mjs +0 -52
- package/dist/runtime/components/__stories/AntIcon.stories.d.ts +0 -8
- package/dist/runtime/components/__stories/AntIcon.stories.mjs +0 -93
- package/dist/runtime/components/__stories/AntKeycap.stories.d.ts +0 -9
- package/dist/runtime/components/__stories/AntKeycap.stories.mjs +0 -69
- package/dist/runtime/components/__stories/AntListGroup.stories.d.ts +0 -7
- package/dist/runtime/components/__stories/AntListGroup.stories.mjs +0 -36
- package/dist/runtime/components/__stories/AntListGroupItem.stories.d.ts +0 -10
- package/dist/runtime/components/__stories/AntListGroupItem.stories.mjs +0 -62
- package/dist/runtime/components/__stories/AntModal.stories.d.ts +0 -7
- package/dist/runtime/components/__stories/AntModal.stories.mjs +0 -78
- package/dist/runtime/components/__stories/AntPagination.stories.d.ts +0 -8
- package/dist/runtime/components/__stories/AntPagination.stories.mjs +0 -39
- package/dist/runtime/components/__stories/AntPopover.stories.d.ts +0 -6
- package/dist/runtime/components/__stories/AntPopover.stories.mjs +0 -47
- package/dist/runtime/components/__stories/AntSkeleton.stories.d.ts +0 -8
- package/dist/runtime/components/__stories/AntSkeleton.stories.mjs +0 -43
- package/dist/runtime/components/__stories/AntSpinner.stories.d.ts +0 -6
- package/dist/runtime/components/__stories/AntSpinner.stories.mjs +0 -34
- package/dist/runtime/components/__stories/AntTag.stories.d.ts +0 -7
- package/dist/runtime/components/__stories/AntTag.stories.mjs +0 -43
- package/dist/runtime/components/__stories/AntToast.stories.d.ts +0 -8
- package/dist/runtime/components/__stories/AntToast.stories.mjs +0 -66
- package/dist/runtime/components/__stories/AntToaster.stories.d.ts +0 -34
- package/dist/runtime/components/__stories/AntToaster.stories.mjs +0 -42
- package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +0 -16
- package/dist/runtime/components/__stories/AntTooltip.stories.mjs +0 -241
- package/dist/runtime/components/__types/AntAccordion.types.d.ts +0 -4
- package/dist/runtime/components/__types/AntAccordion.types.mjs +0 -5
- package/dist/runtime/components/__types/AntIcon.types.d.ts +0 -8
- package/dist/runtime/components/__types/AntIcon.types.mjs +0 -9
- package/dist/runtime/components/__types/AntKeycap.types.d.ts +0 -4
- package/dist/runtime/components/__types/AntKeycap.types.mjs +0 -5
- package/dist/runtime/components/__types/AntListGroupItem.types.d.ts +0 -9
- package/dist/runtime/components/__types/AntListGroupItem.types.mjs +0 -10
- package/dist/runtime/components/__types/AntSpinner.types.d.ts +0 -10
- package/dist/runtime/components/__types/AntSpinner.types.mjs +0 -11
- package/dist/runtime/components/__types/AntTag.types.d.ts +0 -17
- package/dist/runtime/components/__types/AntTag.types.mjs +0 -19
- package/dist/runtime/components/__types/AntToaster.types.d.ts +0 -8
- package/dist/runtime/components/__types/AntToaster.types.mjs +0 -0
- package/dist/runtime/components/__types/index.d.ts +0 -7
- package/dist/runtime/components/__types/index.mjs +0 -7
- package/dist/runtime/components/buttons/AntActionButton.vue +0 -74
- package/dist/runtime/components/buttons/AntButton.vue +0 -257
- package/dist/runtime/components/buttons/AntCreateButton.vue +0 -54
- package/dist/runtime/components/buttons/AntDeleteButton.vue +0 -54
- package/dist/runtime/components/buttons/AntDuplicateButton.vue +0 -54
- package/dist/runtime/components/buttons/AntEditButton.vue +0 -54
- package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +0 -56
- package/dist/runtime/components/buttons/AntSaveButton.vue +0 -55
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +0 -11
- package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +0 -86
- package/dist/runtime/components/buttons/__stories/AntButton.stories.d.ts +0 -16
- package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +0 -313
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +0 -12
- package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +0 -76
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +0 -12
- package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +0 -76
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +0 -12
- package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +0 -76
- package/dist/runtime/components/buttons/__stories/AntEditButton.stories.d.ts +0 -12
- package/dist/runtime/components/buttons/__stories/AntEditButton.stories.mjs +0 -76
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +0 -12
- package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +0 -76
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +0 -12
- package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +0 -76
- package/dist/runtime/components/buttons/__types/AntButton.types.d.ts +0 -4
- package/dist/runtime/components/buttons/__types/AntButton.types.mjs +0 -5
- package/dist/runtime/components/buttons/__types/index.d.ts +0 -1
- package/dist/runtime/components/buttons/__types/index.mjs +0 -1
- package/dist/runtime/components/crud/AntCrud.vue +0 -45
- package/dist/runtime/components/crud/AntCrudDetail.vue +0 -11
- package/dist/runtime/components/crud/AntCrudDetailActions.vue +0 -58
- package/dist/runtime/components/crud/AntCrudDetailNav.vue +0 -64
- package/dist/runtime/components/crud/AntCrudTableFilter.vue +0 -122
- package/dist/runtime/components/crud/AntCrudTableNav.vue +0 -149
- package/dist/runtime/components/crud/__stories/AntCrud.stories.d.ts +0 -6
- package/dist/runtime/components/crud/__stories/AntCrud.stories.mjs +0 -126
- package/dist/runtime/components/crud/__stories/AntCrudDetail.stories.d.ts +0 -7
- package/dist/runtime/components/crud/__stories/AntCrudDetail.stories.mjs +0 -80
- package/dist/runtime/components/crud/__stories/AntCrudDetailActions.stories.d.ts +0 -6
- package/dist/runtime/components/crud/__stories/AntCrudDetailActions.stories.mjs +0 -25
- package/dist/runtime/components/crud/__stories/AntCrudDetailNav.stories.d.ts +0 -6
- package/dist/runtime/components/crud/__stories/AntCrudDetailNav.stories.mjs +0 -41
- package/dist/runtime/components/crud/__stories/AntCrudTableFilter.stories.d.ts +0 -6
- package/dist/runtime/components/crud/__stories/AntCrudTableFilter.stories.mjs +0 -25
- package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.d.ts +0 -8
- package/dist/runtime/components/crud/__stories/AntCrudTableNav.stories.mjs +0 -56
- package/dist/runtime/components/dialogs/AntDeleteDialog.vue +0 -29
- package/dist/runtime/components/dialogs/AntDialog.vue +0 -147
- package/dist/runtime/components/dialogs/__stories/AndDeleteDialog.stories.d.ts +0 -6
- package/dist/runtime/components/dialogs/__stories/AndDeleteDialog.stories.mjs +0 -32
- package/dist/runtime/components/dialogs/__stories/AntDialog.stories.d.ts +0 -6
- package/dist/runtime/components/dialogs/__stories/AntDialog.stories.mjs +0 -60
- package/dist/runtime/components/forms/AntField.vue +0 -123
- package/dist/runtime/components/forms/AntFormGroup.vue +0 -36
- package/dist/runtime/components/forms/AntFormGroupLabel.vue +0 -5
- package/dist/runtime/components/forms/__stories/AntField.stories.d.ts +0 -6
- package/dist/runtime/components/forms/__stories/AntField.stories.mjs +0 -80
- package/dist/runtime/components/forms/__stories/AntFormGroup.stories.d.ts +0 -6
- package/dist/runtime/components/forms/__stories/AntFormGroup.stories.mjs +0 -33
- package/dist/runtime/components/forms/__stories/AntFormGroupLabel.stories.d.ts +0 -6
- package/dist/runtime/components/forms/__stories/AntFormGroupLabel.stories.mjs +0 -20
- package/dist/runtime/components/index.d.ts +0 -62
- package/dist/runtime/components/index.mjs +0 -124
- package/dist/runtime/components/inputs/AntCheckbox.vue +0 -182
- package/dist/runtime/components/inputs/AntCheckboxGroup.vue +0 -117
- package/dist/runtime/components/inputs/AntDateInput.vue +0 -104
- package/dist/runtime/components/inputs/AntNumberInput.vue +0 -157
- package/dist/runtime/components/inputs/AntPasswordInput.vue +0 -107
- package/dist/runtime/components/inputs/AntRadio.vue +0 -206
- package/dist/runtime/components/inputs/AntRadioGroup.vue +0 -127
- package/dist/runtime/components/inputs/AntRangeSlider.vue +0 -101
- package/dist/runtime/components/inputs/AntRichTextEditor.vue +0 -237
- package/dist/runtime/components/inputs/AntSearch.vue +0 -75
- package/dist/runtime/components/inputs/AntSelect.vue +0 -319
- package/dist/runtime/components/inputs/AntSwitch.vue +0 -192
- package/dist/runtime/components/inputs/AntSwitcher.vue +0 -196
- package/dist/runtime/components/inputs/AntTagInput.vue +0 -339
- package/dist/runtime/components/inputs/AntTextInput.vue +0 -75
- package/dist/runtime/components/inputs/AntTextarea.vue +0 -191
- package/dist/runtime/components/inputs/AntUnitInput.vue +0 -96
- package/dist/runtime/components/inputs/Elements/AntBaseInput.vue +0 -271
- package/dist/runtime/components/inputs/Elements/AntDropDown.vue +0 -189
- package/dist/runtime/components/inputs/Elements/AntInputDescription.vue +0 -58
- package/dist/runtime/components/inputs/Elements/AntInputLabel.vue +0 -62
- package/dist/runtime/components/inputs/Elements/AntInputLimiter.vue +0 -58
- package/dist/runtime/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +0 -11
- package/dist/runtime/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +0 -234
- package/dist/runtime/components/inputs/Elements/__stories/AntInputDescription.stories.d.ts +0 -6
- package/dist/runtime/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +0 -34
- package/dist/runtime/components/inputs/Elements/__stories/AntInputLabel.stories.d.ts +0 -7
- package/dist/runtime/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +0 -46
- package/dist/runtime/components/inputs/Elements/__stories/AntInputLimiter.stories.d.ts +0 -6
- package/dist/runtime/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +0 -37
- package/dist/runtime/components/inputs/Elements/__types/AntBaseInput.types.d.ts +0 -17
- package/dist/runtime/components/inputs/Elements/__types/AntBaseInput.types.mjs +0 -18
- package/dist/runtime/components/inputs/Elements/__types/index.d.ts +0 -1
- package/dist/runtime/components/inputs/Elements/__types/index.mjs +0 -1
- package/dist/runtime/components/inputs/Elements/index.d.ts +0 -6
- package/dist/runtime/components/inputs/Elements/index.mjs +0 -12
- package/dist/runtime/components/inputs/__stories/AntCheckbox.stories.d.ts +0 -8
- package/dist/runtime/components/inputs/__stories/AntCheckbox.stories.mjs +0 -382
- package/dist/runtime/components/inputs/__stories/AntCheckboxGroup.stories.d.ts +0 -7
- package/dist/runtime/components/inputs/__stories/AntCheckboxGroup.stories.mjs +0 -84
- package/dist/runtime/components/inputs/__stories/AntDateInput.stories.d.ts +0 -8
- package/dist/runtime/components/inputs/__stories/AntDateInput.stories.mjs +0 -193
- package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.d.ts +0 -10
- package/dist/runtime/components/inputs/__stories/AntNumberInput.stories.mjs +0 -246
- package/dist/runtime/components/inputs/__stories/AntPasswordInput.stories.d.ts +0 -8
- package/dist/runtime/components/inputs/__stories/AntPasswordInput.stories.mjs +0 -156
- package/dist/runtime/components/inputs/__stories/AntRadioGroup.stories.d.ts +0 -8
- package/dist/runtime/components/inputs/__stories/AntRadioGroup.stories.mjs +0 -251
- package/dist/runtime/components/inputs/__stories/AntRangeSlider.stories.d.ts +0 -7
- package/dist/runtime/components/inputs/__stories/AntRangeSlider.stories.mjs +0 -67
- package/dist/runtime/components/inputs/__stories/AntRichTextEditor.stories-old.d.ts +0 -0
- package/dist/runtime/components/inputs/__stories/AntRichTextEditor.stories-old.mjs +0 -0
- package/dist/runtime/components/inputs/__stories/AntSearch.stories.d.ts +0 -7
- package/dist/runtime/components/inputs/__stories/AntSearch.stories.mjs +0 -103
- package/dist/runtime/components/inputs/__stories/AntSelect.stories.d.ts +0 -13
- package/dist/runtime/components/inputs/__stories/AntSelect.stories.mjs +0 -255
- package/dist/runtime/components/inputs/__stories/AntSwitch.stories.d.ts +0 -8
- package/dist/runtime/components/inputs/__stories/AntSwitch.stories.mjs +0 -344
- package/dist/runtime/components/inputs/__stories/AntSwitcher.stories.d.ts +0 -8
- package/dist/runtime/components/inputs/__stories/AntSwitcher.stories.mjs +0 -235
- package/dist/runtime/components/inputs/__stories/AntTagInput.stories.d.ts +0 -9
- package/dist/runtime/components/inputs/__stories/AntTagInput.stories.mjs +0 -228
- package/dist/runtime/components/inputs/__stories/AntTextInput.stories.d.ts +0 -9
- package/dist/runtime/components/inputs/__stories/AntTextInput.stories.mjs +0 -225
- package/dist/runtime/components/inputs/__stories/AntTextarea.stories.d.ts +0 -9
- package/dist/runtime/components/inputs/__stories/AntTextarea.stories.mjs +0 -144
- package/dist/runtime/components/inputs/__stories/AntUnitInput.stories.d.ts +0 -9
- package/dist/runtime/components/inputs/__stories/AntUnitInput.stories.mjs +0 -116
- package/dist/runtime/components/inputs/__types/AntCheckbox.types.d.ts +0 -6
- package/dist/runtime/components/inputs/__types/AntCheckbox.types.mjs +0 -0
- package/dist/runtime/components/inputs/__types/AntDateInput.types.d.ts +0 -7
- package/dist/runtime/components/inputs/__types/AntDateInput.types.mjs +0 -8
- package/dist/runtime/components/inputs/__types/AntRadio.types.d.ts +0 -9
- package/dist/runtime/components/inputs/__types/AntRadio.types.mjs +0 -0
- package/dist/runtime/components/inputs/__types/AntSelect.types.d.ts +0 -4
- package/dist/runtime/components/inputs/__types/AntSelect.types.mjs +0 -0
- package/dist/runtime/components/inputs/__types/AntSwitcher.types.d.ts +0 -4
- package/dist/runtime/components/inputs/__types/AntSwitcher.types.mjs +0 -0
- package/dist/runtime/components/inputs/__types/AntTagInput.types.d.ts +0 -5
- package/dist/runtime/components/inputs/__types/AntTagInput.types.mjs +0 -6
- package/dist/runtime/components/inputs/__types/AntTextInput.types.d.ts +0 -6
- package/dist/runtime/components/inputs/__types/AntTextInput.types.mjs +0 -7
- package/dist/runtime/components/inputs/__types/index.d.ts +0 -7
- package/dist/runtime/components/inputs/__types/index.mjs +0 -7
- package/dist/runtime/components/layouts/AntNavLeftLayout.vue +0 -36
- package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.d.ts +0 -7
- package/dist/runtime/components/layouts/__stories/AntNavLeftLayout.stories.mjs +0 -68
- package/dist/runtime/components/navbar/AntNavbar.vue +0 -25
- package/dist/runtime/components/navbar/AntNavbarItem.vue +0 -78
- package/dist/runtime/components/navbar/__stories/AntNavbar.stories.d.ts +0 -6
- package/dist/runtime/components/navbar/__stories/AntNavbar.stories.mjs +0 -66
- package/dist/runtime/components/navbar/__types/NavbarItem.types.d.ts +0 -10
- package/dist/runtime/components/navbar/__types/NavbarItem.types.mjs +0 -0
- package/dist/runtime/components/navbar/__types/index.d.ts +0 -1
- package/dist/runtime/components/navbar/__types/index.mjs +0 -1
- package/dist/runtime/components/table/AntTable.vue +0 -218
- package/dist/runtime/components/table/AntTableSortButton.vue +0 -48
- package/dist/runtime/components/table/AntTd.vue +0 -81
- package/dist/runtime/components/table/AntTh.vue +0 -78
- package/dist/runtime/components/table/__stories/AntTable.stories.d.ts +0 -9
- package/dist/runtime/components/table/__stories/AntTable.stories.mjs +0 -273
- package/dist/runtime/components/table/__types/TableHeader.types.d.ts +0 -36
- package/dist/runtime/components/table/__types/TableHeader.types.mjs +0 -25
- package/dist/runtime/components/table/__types/index.d.ts +0 -1
- package/dist/runtime/components/table/__types/index.mjs +0 -1
- package/dist/runtime/components/tabs/AntTabItem.vue +0 -118
- package/dist/runtime/components/tabs/AntTabs.vue +0 -47
- package/dist/runtime/components/tabs/__stories/AntTabItem.stories.d.ts +0 -6
- package/dist/runtime/components/tabs/__stories/AntTabItem.stories.mjs +0 -32
- package/dist/runtime/components/tabs/__stories/AntTabs.stories.d.ts +0 -9
- package/dist/runtime/components/tabs/__stories/AntTabs.stories.mjs +0 -173
- package/dist/runtime/components/tabs/__types/AntTabItem.types.d.ts +0 -17
- package/dist/runtime/components/tabs/__types/AntTabItem.types.mjs +0 -6
- package/dist/runtime/components/tabs/__types/index.d.ts +0 -1
- package/dist/runtime/components/tabs/__types/index.mjs +0 -1
- package/dist/runtime/components/transitions/AntTransitionCollapseHeight.vue +0 -92
- package/dist/runtime/composables/useUi.d.ts +0 -20
- package/dist/runtime/composables/useUi.mjs +0 -31
- package/dist/runtime/composables/useValidator.d.ts +0 -1
- package/dist/runtime/composables/useValidator.mjs +0 -1
- package/dist/runtime/enums/Direction.enum.d.ts +0 -4
- package/dist/runtime/enums/Direction.enum.mjs +0 -5
- package/dist/runtime/enums/Grouped.enum.d.ts +0 -6
- package/dist/runtime/enums/Grouped.enum.mjs +0 -7
- package/dist/runtime/enums/Position.enum.d.ts +0 -12
- package/dist/runtime/enums/Position.enum.mjs +0 -14
- package/dist/runtime/enums/Size.enum.d.ts +0 -7
- package/dist/runtime/enums/Size.enum.mjs +0 -8
- package/dist/runtime/enums/State.enum.d.ts +0 -16
- package/dist/runtime/enums/State.enum.mjs +0 -18
- package/dist/runtime/enums/index.d.ts +0 -5
- package/dist/runtime/enums/index.mjs +0 -5
- package/dist/runtime/env.d.ts +0 -8
- package/dist/runtime/handler.d.ts +0 -1
- package/dist/runtime/handler.mjs +0 -5
- package/dist/runtime/plugins/toaster.d.ts +0 -22
- package/dist/runtime/plugins/toaster.mjs +0 -53
- package/dist/runtime/shims/vue.d.ts +0 -5
- package/dist/runtime/types.d.ts +0 -8
- package/dist/runtime/types.mjs +0 -8
- package/dist/runtime/utils/helper.d.ts +0 -4
- package/dist/runtime/utils/helper.mjs +0 -12
- package/dist/runtime/utils.d.ts +0 -20
- package/dist/runtime/utils.mjs +0 -41
- package/src/runtime/components/AntAccordion.vue +0 -64
- package/src/runtime/components/AntAccordionItem.vue +0 -119
- package/src/runtime/components/AntAlert.vue +0 -146
- package/src/runtime/components/AntCard.vue +0 -34
- package/src/runtime/components/AntContent.vue +0 -16
- package/src/runtime/components/AntDropdown.vue +0 -100
- package/src/runtime/components/AntIcon.vue +0 -56
- package/src/runtime/components/AntKeycap.vue +0 -45
- package/src/runtime/components/AntListGroup.vue +0 -24
- package/src/runtime/components/AntListGroupItem.vue +0 -83
- package/src/runtime/components/AntModal.vue +0 -130
- package/src/runtime/components/AntPagination.vue +0 -206
- package/src/runtime/components/AntPopover.vue +0 -135
- package/src/runtime/components/AntSkeleton.vue +0 -38
- package/src/runtime/components/AntSpinner.vue +0 -101
- package/src/runtime/components/AntTag.vue +0 -114
- package/src/runtime/components/AntToast.vue +0 -119
- package/src/runtime/components/AntToaster.vue +0 -70
- package/src/runtime/components/AntTooltip.vue +0 -189
- package/src/runtime/components/buttons/AntActionButton.vue +0 -74
- package/src/runtime/components/buttons/AntButton.vue +0 -257
- package/src/runtime/components/buttons/AntCreateButton.vue +0 -54
- package/src/runtime/components/buttons/AntDeleteButton.vue +0 -54
- package/src/runtime/components/buttons/AntDuplicateButton.vue +0 -54
- package/src/runtime/components/buttons/AntEditButton.vue +0 -54
- package/src/runtime/components/buttons/AntSaveAndNewButton.vue +0 -56
- package/src/runtime/components/buttons/AntSaveButton.vue +0 -55
- package/src/runtime/components/crud/AntCrud.vue +0 -69
- package/src/runtime/components/crud/AntCrudDetail.vue +0 -11
- package/src/runtime/components/crud/AntCrudDetailActions.vue +0 -58
- package/src/runtime/components/crud/AntCrudDetailNav.vue +0 -64
- package/src/runtime/components/crud/AntCrudTableFilter.vue +0 -122
- package/src/runtime/components/crud/AntCrudTableNav.vue +0 -149
- package/src/runtime/components/dialogs/AntDeleteDialog.vue +0 -29
- package/src/runtime/components/dialogs/AntDialog.vue +0 -181
- package/src/runtime/components/forms/AntField.vue +0 -123
- package/src/runtime/components/forms/AntFormGroup.vue +0 -36
- package/src/runtime/components/forms/AntFormGroupLabel.vue +0 -5
- package/src/runtime/components/inputs/AntCheckbox.vue +0 -201
- package/src/runtime/components/inputs/AntCheckboxGroup.vue +0 -117
- package/src/runtime/components/inputs/AntDateInput.vue +0 -104
- package/src/runtime/components/inputs/AntNumberInput.vue +0 -157
- package/src/runtime/components/inputs/AntPasswordInput.vue +0 -107
- package/src/runtime/components/inputs/AntRadio.vue +0 -214
- package/src/runtime/components/inputs/AntRadioGroup.vue +0 -127
- package/src/runtime/components/inputs/AntRangeSlider.vue +0 -121
- package/src/runtime/components/inputs/AntRichTextEditor.vue +0 -237
- package/src/runtime/components/inputs/AntSearch.vue +0 -75
- package/src/runtime/components/inputs/AntSelect.vue +0 -319
- package/src/runtime/components/inputs/AntSwitch.vue +0 -192
- package/src/runtime/components/inputs/AntSwitcher.vue +0 -196
- package/src/runtime/components/inputs/AntTagInput.vue +0 -339
- package/src/runtime/components/inputs/AntTextInput.vue +0 -75
- package/src/runtime/components/inputs/AntTextarea.vue +0 -191
- package/src/runtime/components/inputs/AntUnitInput.vue +0 -96
- package/src/runtime/components/inputs/Elements/AntBaseInput.vue +0 -319
- package/src/runtime/components/inputs/Elements/AntDropDown.vue +0 -189
- package/src/runtime/components/inputs/Elements/AntInputDescription.vue +0 -58
- package/src/runtime/components/inputs/Elements/AntInputLabel.vue +0 -62
- package/src/runtime/components/inputs/Elements/AntInputLimiter.vue +0 -58
- package/src/runtime/components/layouts/AntNavLeftLayout.vue +0 -36
- package/src/runtime/components/navbar/AntNavbar.vue +0 -25
- package/src/runtime/components/navbar/AntNavbarItem.vue +0 -78
- package/src/runtime/components/table/AntTable.vue +0 -218
- package/src/runtime/components/table/AntTableSortButton.vue +0 -48
- package/src/runtime/components/table/AntTd.vue +0 -81
- package/src/runtime/components/table/AntTh.vue +0 -78
- package/src/runtime/components/tabs/AntTabItem.vue +0 -118
- package/src/runtime/components/tabs/AntTabs.vue +0 -47
- package/src/runtime/components/transitions/AntTransitionCollapseHeight.vue +0 -96
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted} from 'vue';
|
|
3
|
-
import AntButton from '../buttons/AntButton.vue';
|
|
4
|
-
import AntField from '../forms/AntField.vue';
|
|
5
|
-
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
6
|
-
import {Size} from '../../enums/Size.enum';
|
|
7
|
-
import {faPlus, faMinus} from '@fortawesome/free-solid-svg-icons';
|
|
8
|
-
import {State, InputState} from '../../enums/State.enum';
|
|
9
|
-
import {handleEnumValidation} from '../../handler';
|
|
10
|
-
import {useVModel} from '@vueuse/core';
|
|
11
|
-
import {Grouped} from '../../enums/Grouped.enum';
|
|
12
|
-
import {BaseInputType} from './Elements/__types';
|
|
13
|
-
|
|
14
|
-
defineOptions({inheritAttrs: false});
|
|
15
|
-
|
|
16
|
-
const props = withDefaults(defineProps<{
|
|
17
|
-
modelValue: number | null;
|
|
18
|
-
label?: string;
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
size?: Size;
|
|
22
|
-
state?: InputState;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
readonly?: boolean;
|
|
25
|
-
skeleton?: boolean;
|
|
26
|
-
steps?: number;
|
|
27
|
-
min?: number;
|
|
28
|
-
max?: number;
|
|
29
|
-
limiter?: boolean;
|
|
30
|
-
messages?: string[];
|
|
31
|
-
indicators?: boolean;
|
|
32
|
-
}>(), {
|
|
33
|
-
state: InputState.base,
|
|
34
|
-
disabled: false,
|
|
35
|
-
readonly: false,
|
|
36
|
-
skeleton: false,
|
|
37
|
-
size: Size.md,
|
|
38
|
-
steps: 1,
|
|
39
|
-
limiter: false,
|
|
40
|
-
messages: () => [],
|
|
41
|
-
indicators: false
|
|
42
|
-
});
|
|
43
|
-
const emit = defineEmits(['update:modelValue', 'validate']);
|
|
44
|
-
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
45
|
-
const isPrevButtonDisabled = computed(() => {
|
|
46
|
-
if (props.disabled) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (_modelValue.value === null) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return props.min !== undefined ? _modelValue.value <= props.min : false;
|
|
55
|
-
});
|
|
56
|
-
const isNextButtonDisabled = computed(() => {
|
|
57
|
-
if (props.disabled) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (_modelValue.value === null) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return props.max !== undefined ? _modelValue.value >= props.max : false;
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
onMounted(() => {
|
|
69
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
70
|
-
handleEnumValidation(props.state, InputState, 'state');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
function subtract() {
|
|
74
|
-
if (_modelValue.value === null) {
|
|
75
|
-
_modelValue.value = props.max || 0;
|
|
76
|
-
} else if (props.max !== undefined && _modelValue.value - props.steps > props.max) {
|
|
77
|
-
_modelValue.value = props.max;
|
|
78
|
-
} else {
|
|
79
|
-
_modelValue.value -= props.steps;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function add() {
|
|
84
|
-
if (_modelValue.value === null) {
|
|
85
|
-
return _modelValue.value = props.min || 0;
|
|
86
|
-
} else if (props.min !== undefined && _modelValue.value + props.steps < props.min) {
|
|
87
|
-
return _modelValue.value = props.min;
|
|
88
|
-
} else {
|
|
89
|
-
_modelValue.value += props.steps;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function onButtonBlur() {
|
|
94
|
-
emit('validate', _modelValue.value);
|
|
95
|
-
}
|
|
96
|
-
</script>
|
|
97
|
-
|
|
98
|
-
<template>
|
|
99
|
-
<AntField
|
|
100
|
-
:label="label"
|
|
101
|
-
:size="size"
|
|
102
|
-
:skeleton="skeleton"
|
|
103
|
-
:description="description"
|
|
104
|
-
:state="state"
|
|
105
|
-
:limiter-max-value="limiter && max !== undefined ? max : undefined"
|
|
106
|
-
:limiter-value="limiter && _modelValue !== undefined && _modelValue !== null ? _modelValue : undefined"
|
|
107
|
-
:messages="messages"
|
|
108
|
-
>
|
|
109
|
-
<div
|
|
110
|
-
class="flex relative"
|
|
111
|
-
>
|
|
112
|
-
<AntButton
|
|
113
|
-
v-if="indicators"
|
|
114
|
-
:icon-left="faMinus"
|
|
115
|
-
:grouped="Grouped.left"
|
|
116
|
-
:state="state as unknown as State"
|
|
117
|
-
:size="size"
|
|
118
|
-
:skeleton="skeleton"
|
|
119
|
-
:disabled="isPrevButtonDisabled"
|
|
120
|
-
:readonly="readonly"
|
|
121
|
-
@click="subtract"
|
|
122
|
-
@blur="onButtonBlur"
|
|
123
|
-
/>
|
|
124
|
-
|
|
125
|
-
<AntBaseInput
|
|
126
|
-
v-model.number="_modelValue"
|
|
127
|
-
:type="BaseInputType.number"
|
|
128
|
-
:grouped="indicators ? Grouped.center : Grouped.none"
|
|
129
|
-
wrapper-class="flex-grow"
|
|
130
|
-
:state="state"
|
|
131
|
-
:size="size"
|
|
132
|
-
:skeleton="skeleton"
|
|
133
|
-
:min="min"
|
|
134
|
-
:max="max"
|
|
135
|
-
:disabled="disabled"
|
|
136
|
-
:readonly="readonly"
|
|
137
|
-
:placeholder="placeholder || label"
|
|
138
|
-
:show-icon="false"
|
|
139
|
-
v-bind="$attrs"
|
|
140
|
-
@validate="val => $emit('validate', val)"
|
|
141
|
-
/>
|
|
142
|
-
|
|
143
|
-
<AntButton
|
|
144
|
-
v-if="indicators"
|
|
145
|
-
:icon-left="faPlus"
|
|
146
|
-
:grouped="Grouped.right"
|
|
147
|
-
:state="state as unknown as State"
|
|
148
|
-
:size="size"
|
|
149
|
-
:skeleton="skeleton"
|
|
150
|
-
:disabled="isNextButtonDisabled"
|
|
151
|
-
:readonly="readonly"
|
|
152
|
-
@click="add"
|
|
153
|
-
@blur="onButtonBlur"
|
|
154
|
-
/>
|
|
155
|
-
</div>
|
|
156
|
-
</AntField>
|
|
157
|
-
</template>
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted, ref} from 'vue';
|
|
3
|
-
import AntField from '../forms/AntField.vue';
|
|
4
|
-
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
5
|
-
import AntIcon from '../AntIcon.vue';
|
|
6
|
-
import {Size} from '../../enums/Size.enum';
|
|
7
|
-
import {faEye, faEyeSlash} from '@fortawesome/free-solid-svg-icons';
|
|
8
|
-
import {useVModel} from '@vueuse/core';
|
|
9
|
-
import {InputState} from '../../enums';
|
|
10
|
-
import {BaseInputType} from './Elements/__types';
|
|
11
|
-
import {handleEnumValidation} from '../../handler';
|
|
12
|
-
import {IconSize} from '../__types/AntIcon.types';
|
|
13
|
-
|
|
14
|
-
defineOptions({inheritAttrs: false});
|
|
15
|
-
|
|
16
|
-
const props = withDefaults(defineProps<{
|
|
17
|
-
modelValue: string | null;
|
|
18
|
-
label?: string;
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
size?: Size;
|
|
22
|
-
state?: InputState;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
skeleton?: boolean;
|
|
25
|
-
messages?: string[];
|
|
26
|
-
}>(), {
|
|
27
|
-
state: InputState.base,
|
|
28
|
-
disabled: false,
|
|
29
|
-
skeleton: false,
|
|
30
|
-
size: Size.md,
|
|
31
|
-
messages: () => []
|
|
32
|
-
});
|
|
33
|
-
const emit = defineEmits(['update:modelValue', 'validate']);
|
|
34
|
-
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
35
|
-
const isVisible = ref(false);
|
|
36
|
-
const iconSize = computed(() => {
|
|
37
|
-
if (props.size === Size.xs2 || props.size === Size.xs) {
|
|
38
|
-
return IconSize.xs;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return IconSize.sm;
|
|
42
|
-
});
|
|
43
|
-
const iconColor = computed(() => {
|
|
44
|
-
switch (props.state) {
|
|
45
|
-
case InputState.info:
|
|
46
|
-
return 'text-info-700';
|
|
47
|
-
case InputState.success:
|
|
48
|
-
return 'text-success-700';
|
|
49
|
-
case InputState.warning:
|
|
50
|
-
return 'text-warning-700';
|
|
51
|
-
case InputState.danger:
|
|
52
|
-
return 'text-danger-700';
|
|
53
|
-
default:
|
|
54
|
-
return 'text-neutral-500';
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
onMounted(() => {
|
|
59
|
-
handleEnumValidation(props.state, InputState, 'state');
|
|
60
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
61
|
-
});
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<template>
|
|
65
|
-
<AntField
|
|
66
|
-
:label="label"
|
|
67
|
-
:size="size"
|
|
68
|
-
:skeleton="skeleton"
|
|
69
|
-
:description="description"
|
|
70
|
-
:state="state"
|
|
71
|
-
:messages="messages"
|
|
72
|
-
>
|
|
73
|
-
<div class="flex relative">
|
|
74
|
-
<AntBaseInput
|
|
75
|
-
v-model="_modelValue"
|
|
76
|
-
:type="isVisible ? BaseInputType.text : BaseInputType.password"
|
|
77
|
-
:state="state"
|
|
78
|
-
:size="size"
|
|
79
|
-
:skeleton="skeleton"
|
|
80
|
-
:disabled="disabled"
|
|
81
|
-
:placeholder="placeholder || label"
|
|
82
|
-
:show-icon="false"
|
|
83
|
-
v-bind="$attrs"
|
|
84
|
-
@validate="val => $emit('validate', val)"
|
|
85
|
-
>
|
|
86
|
-
<template #icon-right>
|
|
87
|
-
<AntIcon
|
|
88
|
-
v-if="!isVisible"
|
|
89
|
-
class="cursor-pointer"
|
|
90
|
-
:icon="faEye"
|
|
91
|
-
:color="iconColor"
|
|
92
|
-
:size="iconSize"
|
|
93
|
-
@click="() => isVisible = !isVisible"
|
|
94
|
-
/>
|
|
95
|
-
|
|
96
|
-
<AntIcon
|
|
97
|
-
v-else
|
|
98
|
-
class="cursor-pointer"
|
|
99
|
-
:icon="faEyeSlash"
|
|
100
|
-
:color="iconColor"
|
|
101
|
-
@click="() => isVisible = !isVisible"
|
|
102
|
-
/>
|
|
103
|
-
</template>
|
|
104
|
-
</AntBaseInput>
|
|
105
|
-
</div>
|
|
106
|
-
</AntField>
|
|
107
|
-
</template>
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {AntField} from './Elements';
|
|
3
|
-
import {InputState, Size} from '../../enums';
|
|
4
|
-
import AntSkeleton from '../AntSkeleton.vue';
|
|
5
|
-
import {computed, onMounted, watch} from 'vue';
|
|
6
|
-
import {type AntRadioTypes} from './__types/AntRadio.types';
|
|
7
|
-
import {handleEnumValidation} from '../../handler';
|
|
8
|
-
|
|
9
|
-
defineOptions({inheritAttrs: false});
|
|
10
|
-
|
|
11
|
-
const emit = defineEmits(['update:modelValue', 'update:skeleton', 'validate', 'blur']);
|
|
12
|
-
const props = withDefaults(
|
|
13
|
-
defineProps<{
|
|
14
|
-
modelValue: string | null;
|
|
15
|
-
value: AntRadioTypes;
|
|
16
|
-
description?: string;
|
|
17
|
-
skeleton?: boolean;
|
|
18
|
-
state?: InputState;
|
|
19
|
-
size?: Size;
|
|
20
|
-
readonly?: boolean;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
messages?: string[];
|
|
23
|
-
}>(), {
|
|
24
|
-
state: InputState.base,
|
|
25
|
-
size: Size.md,
|
|
26
|
-
readonly: false,
|
|
27
|
-
disabled: false,
|
|
28
|
-
messages: () => []
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
const _modelValue = computed({
|
|
32
|
-
get(): string | null | AntRadioTypes {
|
|
33
|
-
return props.modelValue;
|
|
34
|
-
},
|
|
35
|
-
set(val: string | null | AntRadioTypes) {
|
|
36
|
-
emit('update:modelValue', val ? typeof val === 'string' ? val : val.value : null);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
|
|
40
|
-
const isActive = computed(() => _modelValue.value === props.value.value);
|
|
41
|
-
const inputClasses = computed(() => {
|
|
42
|
-
const classes: { [key: string]: boolean } = {
|
|
43
|
-
'relative inline-flex flex-shrink-0': true,
|
|
44
|
-
'focus:ring-offset-0 outline outline-offset-[-1px] outline-1 focus:outline-offset-[-1px] focus:outline-1 rounded-full': true,
|
|
45
|
-
'flex items-center justify-center rounded-full appearance-none': true,
|
|
46
|
-
'cursor-pointer': !hasInputState.value,
|
|
47
|
-
'rounded-full transition-colors ease-in-out duration-200 disabled:opacity-50': true,
|
|
48
|
-
'focus:ring-2': !hasInputState.value && (props.size === Size.sm || props.size === Size.xs || props.size === Size.xs2),
|
|
49
|
-
'focus:ring-4': !hasInputState.value && (props.size === Size.lg || props.size === Size.md),
|
|
50
|
-
'outline-neutral-300': props.state === InputState.base,
|
|
51
|
-
'outline-primary-500': props.state === InputState.base && isActive.value,
|
|
52
|
-
'outline-info-500': props.state === InputState.info,
|
|
53
|
-
'outline-success-500': props.state === InputState.success,
|
|
54
|
-
'outline-warning-500': props.state === InputState.warning,
|
|
55
|
-
'outline-danger-500': props.state === InputState.danger,
|
|
56
|
-
'h-4 w-4 small': props.size === Size.xs || props.size === Size.xs2,
|
|
57
|
-
'h-5 w-5': props.size === Size.lg || props.size === Size.md || props.size === Size.sm,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const focusColorVariant = {
|
|
61
|
-
[InputState.base]: 'focus:ring-primary-200',
|
|
62
|
-
[InputState.danger]: 'focus:ring-danger-200',
|
|
63
|
-
[InputState.info]: 'focus:ring-info-200',
|
|
64
|
-
[InputState.success]: 'focus:ring-success-200',
|
|
65
|
-
[InputState.warning]: 'focus:ring-warning-200',
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
classes[focusColorVariant[props.state]] = !hasInputState.value;
|
|
69
|
-
|
|
70
|
-
return classes;
|
|
71
|
-
});
|
|
72
|
-
const valueClass = computed(() => ({
|
|
73
|
-
'relative w-fit full-height text-for-white-bg-font': true,
|
|
74
|
-
'cursor-pointer': !hasInputState.value,
|
|
75
|
-
'cursor-not-allowed opacity-50': props.disabled,
|
|
76
|
-
'text-sm': props.size === Size.lg || props.size === Size.md || props.size === Size.sm,
|
|
77
|
-
'text-xs': props.size === Size.xs || props.size === Size.xs2,
|
|
78
|
-
}));
|
|
79
|
-
const gapSize = computed(() => {
|
|
80
|
-
switch (props.size) {
|
|
81
|
-
case Size.lg:
|
|
82
|
-
return 'gap-2.5';
|
|
83
|
-
case Size.md:
|
|
84
|
-
return 'gap-2';
|
|
85
|
-
case Size.sm:
|
|
86
|
-
return 'gap-1.5';
|
|
87
|
-
case Size.xs:
|
|
88
|
-
return 'gap-1.5';
|
|
89
|
-
default:
|
|
90
|
-
return 'gap-1';
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
const valueSize = computed(() => {
|
|
94
|
-
if (props.size === Size.xs || props.size === Size.xs2) {
|
|
95
|
-
return 'h-4';
|
|
96
|
-
} else {
|
|
97
|
-
return 'h-5';
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
const innerRadioClass = computed(() => (
|
|
101
|
-
{
|
|
102
|
-
'bg-primary-500': props.state === InputState.base,
|
|
103
|
-
'bg-info-500': props.state === InputState.info,
|
|
104
|
-
'bg-success-500': props.state === InputState.success,
|
|
105
|
-
'bg-warning-500': props.state === InputState.warning,
|
|
106
|
-
'bg-danger-500': props.state === InputState.danger,
|
|
107
|
-
'h-3 w-3': props.size === Size.lg || props.size === Size.md || props.size === Size.sm,
|
|
108
|
-
'h-2 w-2': props.size === Size.xs || props.size === Size.xs2,
|
|
109
|
-
}
|
|
110
|
-
));
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Validate default value if given after delayed data fetching.
|
|
114
|
-
*/
|
|
115
|
-
watch(_modelValue, (val) => {
|
|
116
|
-
if ([InputState.danger, InputState.warning, InputState.info].includes(props.state)) {
|
|
117
|
-
emit('validate', val);
|
|
118
|
-
}
|
|
119
|
-
}, {deep: true});
|
|
120
|
-
watch(() => props.skeleton, (val) => {
|
|
121
|
-
if (!val && props.modelValue !== null) {
|
|
122
|
-
emit('validate', props.modelValue);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
function onBlur(e: FocusEvent) {
|
|
127
|
-
emit('validate', props.modelValue);
|
|
128
|
-
emit('blur', e);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
onMounted(() => {
|
|
132
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
133
|
-
handleEnumValidation(props.state, InputState, 'state');
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Validate default value without delayed data fetching.
|
|
137
|
-
*/
|
|
138
|
-
if (!props.skeleton && props.modelValue !== null) {
|
|
139
|
-
emit('validate', props.modelValue);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
</script>
|
|
143
|
-
|
|
144
|
-
<template>
|
|
145
|
-
<AntField
|
|
146
|
-
:description="description"
|
|
147
|
-
:state="state"
|
|
148
|
-
class="cursor-pointer"
|
|
149
|
-
:skeleton="skeleton"
|
|
150
|
-
:size="size"
|
|
151
|
-
:expanded="false"
|
|
152
|
-
:messages="messages"
|
|
153
|
-
>
|
|
154
|
-
<div
|
|
155
|
-
class="flex items-center"
|
|
156
|
-
:class="gapSize"
|
|
157
|
-
>
|
|
158
|
-
<div class="relative full-height flex items-center">
|
|
159
|
-
<div class="absolute flex items-center justify-center w-full h-full">
|
|
160
|
-
<Transition name="fade-radio">
|
|
161
|
-
<div
|
|
162
|
-
v-if="isActive"
|
|
163
|
-
class="rounded-full transition-all"
|
|
164
|
-
:class="innerRadioClass"
|
|
165
|
-
/>
|
|
166
|
-
</Transition>
|
|
167
|
-
</div>
|
|
168
|
-
|
|
169
|
-
<input
|
|
170
|
-
v-model="_modelValue"
|
|
171
|
-
:value="value.value"
|
|
172
|
-
:class="inputClasses"
|
|
173
|
-
type="radio"
|
|
174
|
-
:aria-checked="isActive"
|
|
175
|
-
:disabled="disabled || readonly"
|
|
176
|
-
@blur="onBlur"
|
|
177
|
-
/>
|
|
178
|
-
|
|
179
|
-
<AntSkeleton
|
|
180
|
-
v-if="skeleton"
|
|
181
|
-
absolute
|
|
182
|
-
rounded-full
|
|
183
|
-
/>
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
<div
|
|
187
|
-
class="relative flex items-center"
|
|
188
|
-
:class="valueSize"
|
|
189
|
-
>
|
|
190
|
-
<span :class="valueClass">
|
|
191
|
-
{{ value.label }}
|
|
192
|
-
</span>
|
|
193
|
-
|
|
194
|
-
<AntSkeleton
|
|
195
|
-
v-if="skeleton"
|
|
196
|
-
absolute
|
|
197
|
-
rounded
|
|
198
|
-
/>
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
</AntField>
|
|
202
|
-
</template>
|
|
203
|
-
|
|
204
|
-
<style scoped>
|
|
205
|
-
.fade-radio-enter-active,
|
|
206
|
-
.fade-radio-leave-active {
|
|
207
|
-
@apply transition-opacity;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.fade-radio-enter-from,
|
|
211
|
-
.fade-radio-leave-to {
|
|
212
|
-
opacity: 0;
|
|
213
|
-
}
|
|
214
|
-
</style>
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import AntRadio from './AntRadio.vue';
|
|
3
|
-
import {useVModel} from '@vueuse/core';
|
|
4
|
-
import {AntField} from './Elements';
|
|
5
|
-
import {type AntRadioTypes} from './__types/AntRadio.types';
|
|
6
|
-
import {InputState, Size} from '../../enums';
|
|
7
|
-
import {computed, onMounted, ref, watch} from 'vue';
|
|
8
|
-
import {Direction} from '../../enums/Direction.enum';
|
|
9
|
-
import {handleEnumValidation} from '../../handler';
|
|
10
|
-
|
|
11
|
-
defineOptions({inheritAttrs: false});
|
|
12
|
-
|
|
13
|
-
const emit = defineEmits(['update:modelValue', 'update:skeleton', 'validate']);
|
|
14
|
-
const props = withDefaults(
|
|
15
|
-
defineProps<{
|
|
16
|
-
modelValue: string | null;
|
|
17
|
-
radioButtons: AntRadioTypes[];
|
|
18
|
-
label?: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
direction?: Direction;
|
|
21
|
-
state?: InputState;
|
|
22
|
-
size?: Size;
|
|
23
|
-
skeleton?: boolean;
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
readonly?: boolean;
|
|
26
|
-
messages?: string[];
|
|
27
|
-
}>(), {
|
|
28
|
-
direction: Direction.column,
|
|
29
|
-
state: InputState.base,
|
|
30
|
-
size: Size.md,
|
|
31
|
-
skeleton: false,
|
|
32
|
-
disabled: false,
|
|
33
|
-
readonly: false,
|
|
34
|
-
messages: () => []
|
|
35
|
-
});
|
|
36
|
-
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
37
|
-
const containerClasses = computed(() => ({
|
|
38
|
-
'flex justify-start': true,
|
|
39
|
-
'flex-row': props.direction === Direction.row,
|
|
40
|
-
'flex-col': props.direction === Direction.column,
|
|
41
|
-
'gap-2.5': props.size === Size.lg,
|
|
42
|
-
'gap-2': props.size === Size.md,
|
|
43
|
-
'gap-1.5': props.size === Size.sm || props.size === Size.xs,
|
|
44
|
-
'gap-1': props.size === Size.xs2,
|
|
45
|
-
}));
|
|
46
|
-
const containerRef = ref<null | HTMLElement>(null);
|
|
47
|
-
const fieldSize = computed(() => {
|
|
48
|
-
switch (props.size) {
|
|
49
|
-
case Size.lg:
|
|
50
|
-
return Size.lg;
|
|
51
|
-
case Size.md:
|
|
52
|
-
return Size.md;
|
|
53
|
-
case Size.sm:
|
|
54
|
-
return Size.sm;
|
|
55
|
-
case Size.xs:
|
|
56
|
-
return Size.xs;
|
|
57
|
-
default:
|
|
58
|
-
return Size.xs2;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
watch(_modelValue, (val) => {
|
|
63
|
-
if ([InputState.danger, InputState.warning, InputState.info].includes(props.state)) {
|
|
64
|
-
emit('validate', val);
|
|
65
|
-
}
|
|
66
|
-
}, {deep: true});
|
|
67
|
-
watch(_modelValue, (val) => {
|
|
68
|
-
if ([InputState.danger, InputState.warning, InputState.info].includes(props.state)) {
|
|
69
|
-
emit('validate', val);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
function hasFocusedRadio() {
|
|
74
|
-
return !!containerRef.value?.querySelector('input[type="radio"]:focus');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function onBlurRadio() {
|
|
78
|
-
setTimeout(() => {
|
|
79
|
-
if (!hasFocusedRadio()) {
|
|
80
|
-
emit('validate', _modelValue.value);
|
|
81
|
-
}
|
|
82
|
-
}, 100);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
onMounted(() => {
|
|
86
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
87
|
-
handleEnumValidation(props.state, InputState, 'state');
|
|
88
|
-
handleEnumValidation(props.direction, Direction, 'direction');
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Validate default value without delayed data fetching.
|
|
92
|
-
*/
|
|
93
|
-
if (!props.skeleton && props.modelValue !== null) {
|
|
94
|
-
emit('validate', props.modelValue);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<template>
|
|
100
|
-
<AntField
|
|
101
|
-
:label="label"
|
|
102
|
-
:description="description"
|
|
103
|
-
:state="state"
|
|
104
|
-
:skeleton="skeleton"
|
|
105
|
-
:messages="messages"
|
|
106
|
-
:size="fieldSize"
|
|
107
|
-
label-for="noop"
|
|
108
|
-
>
|
|
109
|
-
<div
|
|
110
|
-
ref="containerRef"
|
|
111
|
-
:class="containerClasses"
|
|
112
|
-
>
|
|
113
|
-
<AntRadio
|
|
114
|
-
v-for="(radio, index) in radioButtons"
|
|
115
|
-
:key="`radio-button-widget_${radio.value}-${index}`"
|
|
116
|
-
v-model="_modelValue"
|
|
117
|
-
:value="radio"
|
|
118
|
-
:skeleton="skeleton"
|
|
119
|
-
:disabled="disabled || radio.disabled"
|
|
120
|
-
:readonly="readonly || radio.readonly"
|
|
121
|
-
:state="radio.state || state"
|
|
122
|
-
:size="size"
|
|
123
|
-
@blur="onBlurRadio"
|
|
124
|
-
/>
|
|
125
|
-
</div>
|
|
126
|
-
</AntField>
|
|
127
|
-
</template>
|