@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,121 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import AntField from '../forms/AntField.vue';
|
|
3
|
-
import {useVModel} from '@vueuse/core';
|
|
4
|
-
import {computed, onMounted, watch} from 'vue';
|
|
5
|
-
import {InputState, Size} from '../../enums';
|
|
6
|
-
import {handleEnumValidation} from '../../handler';
|
|
7
|
-
|
|
8
|
-
defineOptions({inheritAttrs: false});
|
|
9
|
-
|
|
10
|
-
const emit = defineEmits(['update:modelValue', 'update:skeleton', 'validate', 'blur']);
|
|
11
|
-
const props = withDefaults(defineProps<{
|
|
12
|
-
modelValue: number | number[] | null;
|
|
13
|
-
label?: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
state?: InputState;
|
|
16
|
-
size?: Size,
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
skeleton?: boolean;
|
|
19
|
-
min?: number;
|
|
20
|
-
max?: number;
|
|
21
|
-
messages?: string[];
|
|
22
|
-
}>(), {
|
|
23
|
-
state: InputState.base,
|
|
24
|
-
size: Size.md,
|
|
25
|
-
disabled: false,
|
|
26
|
-
skeleton: false,
|
|
27
|
-
limiter: false,
|
|
28
|
-
messages: () => []
|
|
29
|
-
});
|
|
30
|
-
const _modelValue = useVModel(props, 'modelValue', emit);
|
|
31
|
-
const inputClasses = computed(() => {
|
|
32
|
-
const variants: Record<InputState, string> = {
|
|
33
|
-
[InputState.base]: 'text-neutral-base',
|
|
34
|
-
[InputState.danger]: 'text-danger-base',
|
|
35
|
-
[InputState.info]: 'text-info-base',
|
|
36
|
-
[InputState.success]: 'text-success-base',
|
|
37
|
-
[InputState.warning]: 'text-warning-base',
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
'ant-range-slider transition-colors relative border-none w-full focus:z-10 h-2 bg-neutral-300 rounded-md outline-none': true,
|
|
42
|
-
'disabled:opacity-50 disabled:cursor-not-allowed': props.disabled,
|
|
43
|
-
'invisible': props.skeleton,
|
|
44
|
-
[variants[props.state]]: true
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Validate default value if given after delayed data fetching.
|
|
50
|
-
*/
|
|
51
|
-
watch(() => props.skeleton, (val) => {
|
|
52
|
-
if (!val && props.modelValue !== null) {
|
|
53
|
-
emit('validate', props.modelValue);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
watch(_modelValue, (val) => {
|
|
57
|
-
if ([InputState.danger, InputState.warning, InputState.info].includes(props.state)) {
|
|
58
|
-
emit('validate', val);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
function onBlur(e: FocusEvent) {
|
|
63
|
-
emit('validate', props.modelValue);
|
|
64
|
-
emit('blur', e);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
onMounted(() => {
|
|
68
|
-
handleEnumValidation(props.state, InputState, 'state');
|
|
69
|
-
handleEnumValidation(props.size, Size, 'size');
|
|
70
|
-
|
|
71
|
-
if (!props.skeleton && props.modelValue !== null) {
|
|
72
|
-
emit('validate', props.modelValue);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
</script>
|
|
76
|
-
|
|
77
|
-
<template>
|
|
78
|
-
<AntField
|
|
79
|
-
:label="label"
|
|
80
|
-
:size="size"
|
|
81
|
-
:skeleton="skeleton"
|
|
82
|
-
:description="description"
|
|
83
|
-
:state="state"
|
|
84
|
-
:messages="messages"
|
|
85
|
-
>
|
|
86
|
-
<input
|
|
87
|
-
v-model.number="_modelValue"
|
|
88
|
-
:class="inputClasses"
|
|
89
|
-
type="range"
|
|
90
|
-
:disabled="disabled || skeleton"
|
|
91
|
-
:min="min"
|
|
92
|
-
:max="max"
|
|
93
|
-
v-bind="$attrs"
|
|
94
|
-
@blur="onBlur"
|
|
95
|
-
>
|
|
96
|
-
</AntField>
|
|
97
|
-
</template>
|
|
98
|
-
|
|
99
|
-
<style scoped>
|
|
100
|
-
.ant-range-slider {
|
|
101
|
-
-webkit-appearance: none;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.ant-range-slider::-webkit-slider-thumb {
|
|
105
|
-
-webkit-appearance: none;
|
|
106
|
-
border-radius: 100%;
|
|
107
|
-
appearance: none;
|
|
108
|
-
width: 14px;
|
|
109
|
-
height: 14px;
|
|
110
|
-
background: #fff;
|
|
111
|
-
border: 1px solid #CBD5E1;
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.ant-range-slider::-moz-range-thumb {
|
|
116
|
-
width: 25px;
|
|
117
|
-
height: 25px;
|
|
118
|
-
background: #04AA6D;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
}
|
|
121
|
-
</style>
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
<template></template>
|
|
2
|
-
|
|
3
|
-
<!--<script lang="ts" setup>-->
|
|
4
|
-
<!--defineOptions({ inheritAttrs: false });-->
|
|
5
|
-
<!--// TODO:: fix ts errors-->
|
|
6
|
-
<!--// @ts-nocheck-->
|
|
7
|
-
<!--import {ref, computed, onUnmounted, watch} from 'vue';-->
|
|
8
|
-
<!--import {useEditor, EditorContent} from '@tiptap/vue-3';-->
|
|
9
|
-
<!--import StarterKit from '@tiptap/starter-kit';-->
|
|
10
|
-
<!--import Underline from '@tiptap/extension-underline';-->
|
|
11
|
-
<!--import Heading from '@tiptap/extension-heading';-->
|
|
12
|
-
<!--import AntButton from './AntButton.vue';-->
|
|
13
|
-
<!--import AntSkeleton from '../AntSkeleton.vue';-->
|
|
14
|
-
<!--import {generateId} from '../../utils/helper';-->
|
|
15
|
-
|
|
16
|
-
<!--const emit = defineEmits(['update:data']);-->
|
|
17
|
-
|
|
18
|
-
<!--const props =-->
|
|
19
|
-
<!-- defineProps<{-->
|
|
20
|
-
<!-- id?: string;-->
|
|
21
|
-
<!-- data?: string;-->
|
|
22
|
-
<!-- label?: string;-->
|
|
23
|
-
<!-- description?: string;-->
|
|
24
|
-
<!-- validator?: Function;-->
|
|
25
|
-
<!-- errors?: string[];-->
|
|
26
|
-
<!-- isError?: boolean;-->
|
|
27
|
-
<!-- loading?: boolean;-->
|
|
28
|
-
<!-- disabled?: boolean;-->
|
|
29
|
-
<!-- }>();-->
|
|
30
|
-
|
|
31
|
-
<!--const _data = computed({-->
|
|
32
|
-
<!-- get: () => {-->
|
|
33
|
-
<!-- return props.data || '';-->
|
|
34
|
-
<!-- },-->
|
|
35
|
-
<!-- set: (val) => {-->
|
|
36
|
-
<!-- emit('update:data', val);-->
|
|
37
|
-
<!-- },-->
|
|
38
|
-
<!--});-->
|
|
39
|
-
|
|
40
|
-
<!--const _id = ref(props.id || generateId(40));-->
|
|
41
|
-
<!--const editor = ref(-->
|
|
42
|
-
<!-- useEditor({-->
|
|
43
|
-
<!-- content: _data.value,-->
|
|
44
|
-
<!-- extensions: [-->
|
|
45
|
-
<!-- StarterKit,-->
|
|
46
|
-
<!-- Underline,-->
|
|
47
|
-
<!-- Heading.configure({-->
|
|
48
|
-
<!-- levels: [1, 2, 3],-->
|
|
49
|
-
<!-- }),-->
|
|
50
|
-
<!-- ],-->
|
|
51
|
-
<!-- onUpdate: ({editor}) => {-->
|
|
52
|
-
<!-- const state = editor.getHTML();-->
|
|
53
|
-
<!-- _data.value = state;-->
|
|
54
|
-
|
|
55
|
-
<!-- if (props.validator && typeof props.validator === 'function') {-->
|
|
56
|
-
<!-- props.validator(_data.value);-->
|
|
57
|
-
<!-- }-->
|
|
58
|
-
<!-- },-->
|
|
59
|
-
<!-- editable: !props.disabled,-->
|
|
60
|
-
<!-- })-->
|
|
61
|
-
<!--);-->
|
|
62
|
-
|
|
63
|
-
<!--watch(-->
|
|
64
|
-
<!-- () => props.disabled,-->
|
|
65
|
-
<!-- () => {-->
|
|
66
|
-
<!-- editor.value?.setOptions({editable: !props.disabled});-->
|
|
67
|
-
<!-- }-->
|
|
68
|
-
<!--);-->
|
|
69
|
-
|
|
70
|
-
<!--onUnmounted(() => editor?.value?.destroy());-->
|
|
71
|
-
<!--</script>-->
|
|
72
|
-
|
|
73
|
-
<!--<template>-->
|
|
74
|
-
<!-- <div v-if="!loading">-->
|
|
75
|
-
<!-- <slot>-->
|
|
76
|
-
<!-- <label-->
|
|
77
|
-
<!-- v-if="label"-->
|
|
78
|
-
<!-- :for="_id"-->
|
|
79
|
-
<!-- class="block text-sm font-medium text-gray-700"-->
|
|
80
|
-
<!-- >-->
|
|
81
|
-
<!-- {{ label }}-->
|
|
82
|
-
<!-- </label>-->
|
|
83
|
-
<!-- </slot>-->
|
|
84
|
-
|
|
85
|
-
<!-- <div-->
|
|
86
|
-
<!-- v-if="editor"-->
|
|
87
|
-
<!-- class="border border-gray-200 rounded-md overflow-hidden p-2 bg-gray-50"-->
|
|
88
|
-
<!-- >-->
|
|
89
|
-
<!-- <slot name="buttons" v-bind="editor">-->
|
|
90
|
-
<!-- <div class="space-x-1 mb-2 flex">-->
|
|
91
|
-
<!-- <slot name="headers-buttons" v-bind="editor">-->
|
|
92
|
-
<!-- <AntButton-->
|
|
93
|
-
<!-- @click="-->
|
|
94
|
-
<!-- editor-->
|
|
95
|
-
<!-- ? editor.chain().focus().toggleHeading({ level: 1 }).run()-->
|
|
96
|
-
<!-- : false-->
|
|
97
|
-
<!-- "-->
|
|
98
|
-
<!-- :class="{-->
|
|
99
|
-
<!-- '!bg-gray-200': editor.isActive('heading', { level: 1 }),-->
|
|
100
|
-
<!-- }"-->
|
|
101
|
-
<!-- class="hover:bg-gray-200 border-none"-->
|
|
102
|
-
<!-- :disabled="disabled"-->
|
|
103
|
-
<!-- >-->
|
|
104
|
-
<!-- <span>H1</span>-->
|
|
105
|
-
<!-- </AntButton>-->
|
|
106
|
-
|
|
107
|
-
<!-- <AntButton-->
|
|
108
|
-
<!-- @click="-->
|
|
109
|
-
<!-- editor-->
|
|
110
|
-
<!-- ? editor.chain().focus().toggleHeading({ level: 2 }).run()-->
|
|
111
|
-
<!-- : false-->
|
|
112
|
-
<!-- "-->
|
|
113
|
-
<!-- :class="{-->
|
|
114
|
-
<!-- '!bg-gray-200': editor.isActive('heading', { level: 2 }),-->
|
|
115
|
-
<!-- }"-->
|
|
116
|
-
<!-- class="hover:bg-gray-200 border-none"-->
|
|
117
|
-
<!-- :disabled="disabled"-->
|
|
118
|
-
<!-- >-->
|
|
119
|
-
<!-- <span class="">H2</span>-->
|
|
120
|
-
<!-- </AntButton>-->
|
|
121
|
-
|
|
122
|
-
<!-- <AntButton-->
|
|
123
|
-
<!-- @click="-->
|
|
124
|
-
<!-- editor-->
|
|
125
|
-
<!-- ? editor.chain().focus().toggleHeading({ level: 3 }).run()-->
|
|
126
|
-
<!-- : false-->
|
|
127
|
-
<!-- "-->
|
|
128
|
-
<!-- :class="{-->
|
|
129
|
-
<!-- '!bg-gray-200': editor.isActive('heading', { level: 3 }),-->
|
|
130
|
-
<!-- }"-->
|
|
131
|
-
<!-- class="hover:bg-gray-200 border-none"-->
|
|
132
|
-
<!-- :disabled="disabled"-->
|
|
133
|
-
<!-- >-->
|
|
134
|
-
<!-- <span class="">H3</span>-->
|
|
135
|
-
<!-- </AntButton>-->
|
|
136
|
-
<!-- </slot>-->
|
|
137
|
-
|
|
138
|
-
<!-- <slot name="bold-button" v-bind="editor">-->
|
|
139
|
-
<!-- <AntButton-->
|
|
140
|
-
<!-- @click="-->
|
|
141
|
-
<!-- editor ? editor.chain().focus().toggleBold().run() : false-->
|
|
142
|
-
<!-- "-->
|
|
143
|
-
<!-- :class="{ '!bg-gray-200': editor.isActive('bold') }"-->
|
|
144
|
-
<!-- class="hover:bg-gray-200 border-none"-->
|
|
145
|
-
<!-- :disabled="disabled"-->
|
|
146
|
-
<!-- >-->
|
|
147
|
-
<!-- <span class="font-bold">B</span>-->
|
|
148
|
-
<!-- </AntButton>-->
|
|
149
|
-
<!-- </slot>-->
|
|
150
|
-
|
|
151
|
-
<!-- <slot name="italic-button" v-bind="editor">-->
|
|
152
|
-
<!-- <AntButton-->
|
|
153
|
-
<!-- @click="-->
|
|
154
|
-
<!-- editor ? editor.chain().focus().toggleItalic().run() : false-->
|
|
155
|
-
<!-- "-->
|
|
156
|
-
<!-- :class="{ '!bg-gray-200': editor.isActive('italic') }"-->
|
|
157
|
-
<!-- class="hover:bg-gray-200 border-none"-->
|
|
158
|
-
<!-- :disabled="disabled"-->
|
|
159
|
-
<!-- >-->
|
|
160
|
-
<!-- <span class="italic">I</span>-->
|
|
161
|
-
<!-- </AntButton>-->
|
|
162
|
-
<!-- </slot>-->
|
|
163
|
-
|
|
164
|
-
<!-- <slot name="underline-button" v-bind="editor">-->
|
|
165
|
-
<!-- <AntButton-->
|
|
166
|
-
<!-- @click="-->
|
|
167
|
-
<!-- editor ? editor.chain().focus().toggleUnderline().run() : false-->
|
|
168
|
-
<!-- "-->
|
|
169
|
-
<!-- :class="{ '!bg-gray-200': editor.isActive('underline') }"-->
|
|
170
|
-
<!-- class="hover:bg-gray-200 border-none"-->
|
|
171
|
-
<!-- :disabled="disabled"-->
|
|
172
|
-
<!-- >-->
|
|
173
|
-
<!-- <span class="underline">U</span>-->
|
|
174
|
-
<!-- </AntButton>-->
|
|
175
|
-
<!-- </slot>-->
|
|
176
|
-
|
|
177
|
-
<!-- <slot name="strike-button" v-bind="editor">-->
|
|
178
|
-
<!-- <AntButton-->
|
|
179
|
-
<!-- @click="-->
|
|
180
|
-
<!-- editor ? editor.chain().focus().toggleStrike().run() : false-->
|
|
181
|
-
<!-- "-->
|
|
182
|
-
<!-- :class="{ '!bg-gray-200': editor.isActive('strike') }"-->
|
|
183
|
-
<!-- class="hover:bg-gray-200 border-none"-->
|
|
184
|
-
<!-- :disabled="disabled"-->
|
|
185
|
-
<!-- >-->
|
|
186
|
-
<!-- <span class="line-through">S</span>-->
|
|
187
|
-
<!-- </AntButton>-->
|
|
188
|
-
<!-- </slot>-->
|
|
189
|
-
|
|
190
|
-
<!-- <slot name="custom-buttons" v-bind="editor"></slot>-->
|
|
191
|
-
<!-- </div>-->
|
|
192
|
-
<!-- </slot>-->
|
|
193
|
-
|
|
194
|
-
<!-- <EditorContent-->
|
|
195
|
-
<!-- :id="_id"-->
|
|
196
|
-
<!-- :described-by="`${_id}-description`"-->
|
|
197
|
-
<!-- :editor="editor"-->
|
|
198
|
-
<!-- v-bind="$attrs"-->
|
|
199
|
-
<!-- :class="{-->
|
|
200
|
-
<!-- 'border-red-300 text-red-900 placeholder-red-300 focus:border-red-500':-->
|
|
201
|
-
<!-- (errors && errors.length > 0) || isError,-->
|
|
202
|
-
<!-- }"-->
|
|
203
|
-
<!-- />-->
|
|
204
|
-
|
|
205
|
-
<!-- <slot name="errorList" v-bind="{ errors }">-->
|
|
206
|
-
<!-- <div v-for="error in errors" class="text-red-600">{{ error }}</div>-->
|
|
207
|
-
<!-- </slot>-->
|
|
208
|
-
<!-- </div>-->
|
|
209
|
-
|
|
210
|
-
<!-- <div-->
|
|
211
|
-
<!-- v-if="description"-->
|
|
212
|
-
<!-- class="mt-1 text-sm text-gray-500"-->
|
|
213
|
-
<!-- :id="`${_id}-description`"-->
|
|
214
|
-
<!-- >-->
|
|
215
|
-
<!-- <slot name="description"> {{ description }}</slot>-->
|
|
216
|
-
<!-- </div>-->
|
|
217
|
-
<!-- </div>-->
|
|
218
|
-
|
|
219
|
-
<!-- <div v-else>-->
|
|
220
|
-
<!-- <AntSkeleton-->
|
|
221
|
-
<!-- :model-value="loading"-->
|
|
222
|
-
<!-- v-if="label || $slots['label']"-->
|
|
223
|
-
<!-- class="w-2/6 h-4 rounded-md mb-1"-->
|
|
224
|
-
<!-- />-->
|
|
225
|
-
|
|
226
|
-
<!-- <AntSkeleton-->
|
|
227
|
-
<!-- :model-value="loading"-->
|
|
228
|
-
<!-- class="w-full h-24 rounded-md"-->
|
|
229
|
-
<!-- />-->
|
|
230
|
-
|
|
231
|
-
<!-- <AntSkeleton-->
|
|
232
|
-
<!-- :model-value="loading"-->
|
|
233
|
-
<!-- v-if="description || $slots['description']"-->
|
|
234
|
-
<!-- class="w-4/6 h-4 rounded-md mt-1"-->
|
|
235
|
-
<!-- />-->
|
|
236
|
-
<!-- </div>-->
|
|
237
|
-
<!--</template>-->
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {computed, onMounted, ref} from 'vue';
|
|
3
|
-
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
4
|
-
import {Size} from '../../enums/Size.enum';
|
|
5
|
-
import {handleEnumValidation} from '../../handler';
|
|
6
|
-
import {faSearch} from '@fortawesome/free-solid-svg-icons';
|
|
7
|
-
import {BaseInputType} from './Elements/__types';
|
|
8
|
-
import AntField from '../forms/AntField.vue';
|
|
9
|
-
|
|
10
|
-
const emits = defineEmits(['update:modelValue']);
|
|
11
|
-
const props = withDefaults(defineProps<{
|
|
12
|
-
modelValue: string | null;
|
|
13
|
-
label?: string;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
size?: Size;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
readonly?: boolean;
|
|
19
|
-
skeleton?: boolean;
|
|
20
|
-
inputTimeout?: number;
|
|
21
|
-
query?: string;
|
|
22
|
-
}>(), {
|
|
23
|
-
disabled: false,
|
|
24
|
-
skeleton: false,
|
|
25
|
-
readonly: false,
|
|
26
|
-
size: Size.md,
|
|
27
|
-
inputTimeout: 300,
|
|
28
|
-
placeholder: 'Search'
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const timeout = ref<ReturnType<typeof setTimeout> | null>(null);
|
|
32
|
-
|
|
33
|
-
// TODO:: implement query prop. Find a way to use vue router in Storybook.
|
|
34
|
-
const _value = computed<string | null>({
|
|
35
|
-
get: () => props.modelValue,
|
|
36
|
-
set: (val: string | null) => {
|
|
37
|
-
if (val === null) {
|
|
38
|
-
return emits('update:modelValue', val);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (timeout.value) {
|
|
42
|
-
clearTimeout(timeout.value);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
timeout.value = setTimeout(() => {
|
|
46
|
-
emits('update:modelValue', val);
|
|
47
|
-
}, props.inputTimeout);
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
onMounted(() => handleEnumValidation(props.size, Size, 'size'));
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<template>
|
|
55
|
-
<AntField
|
|
56
|
-
:label="label"
|
|
57
|
-
:size="size"
|
|
58
|
-
:skeleton="skeleton"
|
|
59
|
-
:description="description"
|
|
60
|
-
data-e2e="search"
|
|
61
|
-
>
|
|
62
|
-
<AntBaseInput
|
|
63
|
-
v-model="_value"
|
|
64
|
-
:type="BaseInputType.search"
|
|
65
|
-
:size="size"
|
|
66
|
-
:skeleton="skeleton"
|
|
67
|
-
:disabled="disabled"
|
|
68
|
-
:readonly="readonly"
|
|
69
|
-
:placeholder="placeholder"
|
|
70
|
-
:icon-left="faSearch"
|
|
71
|
-
nullable
|
|
72
|
-
v-bind="$attrs"
|
|
73
|
-
/>
|
|
74
|
-
</AntField>
|
|
75
|
-
</template>
|