@dt-frames/ui 2.0.23 → 3.0.1
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 +9 -9
- package/es/assets/icons/ui-blank.svg +1 -0
- package/es/assets/icons/ui-docx.svg +1 -0
- package/es/assets/icons/ui-exl.svg +1 -0
- package/es/assets/icons/ui-forder-open.svg +1 -0
- package/es/assets/icons/ui-forder.svg +1 -0
- package/es/assets/icons/ui-jpg.svg +1 -0
- package/es/assets/icons/ui-pdf.svg +1 -0
- package/es/assets/icons/ui-ppt.svg +1 -0
- package/es/assets/icons/ui-rar.svg +1 -0
- package/es/assets/icons/ui-table-empty.svg +1 -0
- package/es/assets/icons/ui-txt.svg +1 -0
- package/es/assets/index.e67ea2f5.css +1 -0
- package/es/assets/locales/en.d.ts +1 -0
- package/es/assets/locales/en.ts +1 -0
- package/es/assets/locales/zh.d.ts +1 -0
- package/es/assets/locales/zh.ts +1 -0
- package/es/assets/test.ts +1 -0
- package/es/components/container/index.d.ts +2 -93
- package/es/components/container/index.js +92 -15
- package/es/components/container/src/components/bar.d.ts +2 -2
- package/es/components/container/{index.less → src/index.scss} +9 -16
- package/es/components/container/src/utils/scroll.d.ts +1 -1
- package/es/components/curd/index.d.ts +3 -1
- package/es/components/curd/index.js +66 -141
- package/es/components/curd/src/components/props.d.ts +53 -0
- package/es/components/curd/src/components/types/curd.type.d.ts +13 -0
- package/es/components/curd/src/hooks/useCurd.d.ts +3 -110
- package/es/components/curd/src/props.d.ts +109 -159
- package/es/components/curd/src/types/curd.type.d.ts +54 -8
- package/es/components/drawer/index.d.ts +3 -7881
- package/es/components/drawer/index.js +209 -307
- package/es/components/drawer/src/components/DrawerFooter.d.ts +19 -21
- package/es/components/drawer/src/hooks/useDrawer.d.ts +2 -2
- package/es/components/drawer/src/index.d.ts +11 -7876
- package/es/components/drawer/src/index.scss +24 -0
- package/es/components/drawer/src/props.d.ts +2 -64
- package/es/components/drawer/src/{types/index.type.d.ts → type/drawer.type.d.ts} +26 -14
- package/es/components/form/index.d.ts +5 -5
- package/es/components/form/index.js +641 -634
- package/es/components/form/src/components/DynanicInput.d.ts +2 -0
- package/es/components/form/src/components/FormButtons.d.ts +13 -3086
- package/es/components/form/src/components/FormInputUseDialog.d.ts +2 -0
- package/es/components/form/src/components/FormItem.d.ts +53 -156
- package/es/components/form/src/components/RadioButton.d.ts +26 -0
- package/es/components/form/src/components/componentMap.d.ts +2 -2
- package/es/components/form/src/components/index.d.ts +2 -4
- package/es/components/form/src/hooks/useForm.d.ts +3 -3
- package/es/components/form/src/hooks/useFormActions.d.ts +38 -5
- package/es/components/form/src/hooks/useFormEvent.d.ts +9 -7
- package/es/components/form/src/hooks/useFormValue.d.ts +2 -2
- package/es/components/form/src/hooks/useFormValues.d.ts +8 -6
- package/es/components/form/src/hooks/useLabelWidth.d.ts +1 -1
- package/es/components/form/src/index.d.ts +358 -0
- package/es/components/form/src/index.scss +162 -0
- package/es/components/form/src/props.d.ts +45 -7
- package/es/components/form/src/types/actions.type.d.ts +1 -1
- package/es/components/form/src/types/form.type.d.ts +59 -26
- package/es/components/form/src/types/items.type.d.ts +33 -33
- package/es/components/form/src/{hooks → utils}/helper.d.ts +7 -0
- package/es/components/icons/index.d.ts +2 -497
- package/es/components/icons/index.js +42 -1911
- package/es/components/icons/src/{svg-icon.d.ts → SvgIcon.d.ts} +7 -14
- package/es/components/icons/src/index.scss +3 -0
- package/es/components/iframe/index.js +40 -29
- package/es/components/iframe/src/index.d.ts +16 -11
- package/es/components/iframe/src/index.scss +20 -0
- package/es/components/modal/index.d.ts +3 -2
- package/es/components/modal/index.js +188 -198
- package/es/components/modal/src/components/CloseIcon.d.ts +4 -20
- package/es/components/modal/src/components/Modal.d.ts +201 -108
- package/es/components/modal/src/components/ModalFooter.d.ts +12 -20
- package/es/components/modal/src/hooks/useDrag.d.ts +2 -3
- package/es/components/modal/src/hooks/useFullScreen.d.ts +1 -1
- package/es/components/modal/src/hooks/useModal.d.ts +3 -3
- package/es/components/modal/src/index.d.ts +32 -359
- package/es/components/modal/{index.less → src/index.scss} +104 -82
- package/es/components/modal/src/props.d.ts +10 -17
- package/es/components/modal/src/types/{modal.type.d.ts → index.type.d.ts} +7 -6
- package/es/components/source/index.d.ts +1 -1
- package/es/components/source/index.js +142 -113
- package/es/components/source/{hooks → src/hooks}/useDownload.d.ts +1 -1
- package/es/components/source/{hooks → src/hooks}/useSource.d.ts +24 -20
- package/es/components/source/{types → src/types}/source.type.d.ts +12 -13
- package/es/components/table/index.d.ts +7 -2
- package/es/components/table/index.js +197 -286
- package/es/components/table/src/components/TableAction.d.ts +16 -24
- package/es/components/table/src/components/TableHeader.d.ts +35 -0
- package/es/components/table/src/components/TableRender.d.ts +10 -14
- package/es/components/table/src/components/editTable/CellComponent.d.ts +4 -4
- package/es/components/table/src/components/editTable/EditTableCell.d.ts +15 -57
- package/es/components/table/src/components/editTable/componentMap.d.ts +1 -1
- package/es/components/table/src/components/editTable/index.d.ts +3 -3
- package/es/components/table/src/components/editTable/props.d.ts +6 -6
- package/es/components/table/src/components/tableSetting/Column.d.ts +3 -68
- package/es/components/table/src/components/tableSetting/Download.d.ts +11 -0
- package/es/components/table/src/components/tableSetting/DownloadCtrl.d.ts +2 -22
- package/es/components/table/src/components/tableSetting/Fullscreen.d.ts +2 -22
- package/es/components/table/src/components/tableSetting/index.d.ts +17 -0
- package/es/components/table/src/hooks/useDataSource.d.ts +3 -4
- package/es/components/table/src/hooks/useHeader.d.ts +3 -3
- package/es/components/table/src/hooks/useHeaderCode.d.ts +2 -2
- package/es/components/table/src/hooks/useLoading.d.ts +3 -3
- package/es/components/table/src/hooks/usePagination.d.ts +2 -2
- package/es/components/table/src/hooks/useRowSelection.d.ts +1 -1
- package/es/components/table/src/hooks/useTable.d.ts +1 -1
- package/es/components/table/src/hooks/useTableInstance.d.ts +2 -2
- package/es/components/table/src/hooks/useTableScroll.d.ts +0 -1
- package/es/components/table/src/hooks/useTableStyle.d.ts +5 -0
- package/es/components/table/src/index.d.ts +169 -324
- package/es/components/table/{index.less → src/index.scss} +309 -279
- package/es/components/table/src/props.d.ts +39 -14
- package/es/components/table/src/types/actions.type.d.ts +5 -5
- package/es/components/table/src/types/header.type.d.ts +6 -6
- package/es/components/table/src/types/table.type.d.ts +84 -21
- package/es/components/tree/index.d.ts +2 -1
- package/es/components/tree/index.js +320 -324
- package/es/components/tree/src/basicProps.d.ts +9 -9
- package/es/components/tree/src/components/ContextMenu.d.ts +17 -17
- package/es/components/tree/src/components/TreeHeader.d.ts +13 -33
- package/es/components/tree/src/hooks/useContextMenu.d.ts +2 -2
- package/es/components/tree/src/hooks/useMethod.d.ts +16 -0
- package/es/components/tree/src/hooks/useTree.d.ts +5 -15
- package/es/components/tree/src/index.d.ts +52 -6369
- package/es/components/tree/src/index.scss +178 -0
- package/es/components/tree/src/types/action.type.d.ts +64 -0
- package/es/components/tree/src/{type → types}/menu.d.ts +1 -1
- package/es/components/tree/src/types/tree.d.ts +31 -0
- package/es/components/tree/src/utils/tree.d.ts +1 -1
- package/es/components/upload/index.d.ts +1 -1
- package/es/components/upload/index.js +111 -102
- package/es/components/upload/src/basicProps.d.ts +11 -7
- package/es/components/upload/src/components/PdfView.d.ts +2 -9
- package/es/components/upload/src/components/WordView.d.ts +2 -7
- package/es/components/upload/src/hooks/useFile.d.ts +3 -3
- package/es/components/upload/src/index.d.ts +47 -96
- package/es/components/upload/{index.less → src/index.scss} +19 -13
- package/es/components/upload/src/type/file.d.ts +2 -2
- package/es/components/upload/src/utils/upload.d.ts +1 -1
- package/es/components/vxe_table/index.d.ts +4 -0
- package/es/components/vxe_table/index.js +1162 -0
- package/es/components/vxe_table/src/components/AApiSelect.d.ts +12 -0
- package/es/components/vxe_table/src/components/AAutoComplete.d.ts +2 -0
- package/es/components/vxe_table/src/components/AButton.d.ts +12 -0
- package/es/components/vxe_table/src/components/AButtonGroup.d.ts +2 -0
- package/es/components/vxe_table/src/components/ACascader.d.ts +2 -0
- package/es/components/vxe_table/src/components/ACheckbox.d.ts +2 -0
- package/es/components/vxe_table/src/components/ACheckboxGroup.d.ts +6 -0
- package/es/components/vxe_table/src/components/ADatePicker.d.ts +4 -0
- package/es/components/vxe_table/src/components/AEmpty.d.ts +6 -0
- package/es/components/vxe_table/src/components/AInput.d.ts +2 -0
- package/es/components/vxe_table/src/components/AInputNumber.d.ts +2 -0
- package/es/components/vxe_table/src/components/AInputSearch.d.ts +2 -0
- package/es/components/vxe_table/src/components/AMonthPicker.d.ts +2 -0
- package/es/components/vxe_table/src/components/ARadioGroup.d.ts +6 -0
- package/es/components/vxe_table/src/components/ARangePicker.d.ts +2 -0
- package/es/components/vxe_table/src/components/ARate.d.ts +2 -0
- package/es/components/vxe_table/src/components/ASelect.d.ts +2 -0
- package/es/components/vxe_table/src/components/ASwitch.d.ts +2 -0
- package/es/components/vxe_table/src/components/ATimePicker.d.ts +2 -0
- package/es/components/vxe_table/src/components/ATreeSelect.d.ts +2 -0
- package/es/components/vxe_table/src/components/AWeekPicker.d.ts +2 -0
- package/es/components/vxe_table/src/components/AYearPicker.d.ts +2 -0
- package/es/components/vxe_table/src/components/Select.d.ts +2 -0
- package/es/components/vxe_table/src/components/common.d.ts +52 -0
- package/es/components/vxe_table/src/components/componentMap.d.ts +3 -0
- package/es/components/vxe_table/src/components/index.d.ts +4 -0
- package/es/components/vxe_table/src/hooks/useColumns.d.ts +1 -0
- package/es/components/vxe_table/src/hooks/useComponents.d.ts +2 -0
- package/es/components/vxe_table/src/hooks/useHeader.d.ts +6 -0
- package/es/components/vxe_table/src/hooks/useProps.d.ts +3 -0
- package/es/components/vxe_table/src/hooks/useVxeTable.d.ts +7 -0
- package/es/components/vxe_table/src/index.d.ts +26 -0
- package/es/components/vxe_table/src/index.scss +13 -0
- package/es/components/vxe_table/src/props.d.ts +1 -0
- package/es/components/vxe_table/src/types/componentType.d.ts +1 -0
- package/es/components/vxe_table/src/types/vxeTable.type.d.ts +45 -0
- package/es/components/vxe_table/src/utils/index.d.ts +6 -0
- package/es/directives/index.d.ts +1 -4
- package/es/directives/index.js +6 -1991
- package/es/theme/index.d.ts +9 -9
- package/es/theme/index.js +2112 -2344
- package/es/theme/src/components/content/index.d.ts +2 -31
- package/es/theme/src/components/feature/BackTop.d.ts +2 -0
- package/es/theme/src/components/feature/index.d.ts +2 -7
- package/es/theme/src/components/footer/index.d.ts +2 -31
- package/es/theme/src/components/header/MultipleHeader.d.ts +2 -0
- package/es/theme/src/components/header/components/BreadCrumb.d.ts +2 -0
- package/es/theme/src/components/header/components/FullScreen.d.ts +2 -0
- package/es/theme/src/components/header/components/LangPicker.d.ts +12 -0
- package/es/theme/src/components/header/components/Logo.d.ts +22 -0
- package/es/theme/src/components/header/components/MenuFilter.d.ts +2 -0
- package/es/theme/src/components/header/components/Notice.d.ts +2 -0
- package/es/theme/src/components/header/components/SettintTheme.d.ts +2 -0
- package/es/theme/src/components/header/components/Size.d.ts +2 -0
- package/es/theme/src/components/header/components/Trigger.d.ts +6 -0
- package/es/theme/src/components/header/components/UserInfo.d.ts +2 -0
- package/es/theme/src/components/header/components/lock/Lockscreen.d.ts +2 -85
- package/es/theme/src/components/header/components/lock/Recharge.d.ts +4 -6
- package/es/theme/src/components/header/components/lock/useBattery.d.ts +4 -4
- package/es/theme/src/components/header/components/lock/useTime.d.ts +5 -5
- package/es/theme/src/components/header/components/theme-drawer/Color.d.ts +26 -0
- package/es/theme/src/components/header/components/theme-drawer/ColorPrimary.d.ts +27 -0
- package/es/theme/src/components/header/components/theme-drawer/Feature.d.ts +2 -0
- package/es/theme/src/components/header/components/theme-drawer/InputNumber.d.ts +28 -0
- package/es/theme/src/components/header/components/theme-drawer/MenuType.d.ts +2 -0
- package/es/theme/src/components/header/components/theme-drawer/Select.d.ts +44 -0
- package/es/theme/src/components/header/components/theme-drawer/Switch.d.ts +29 -0
- package/es/theme/src/components/header/components/theme-drawer/Var.d.ts +2 -0
- package/es/theme/src/components/header/components/theme-drawer/styles/GlobalStyle.d.ts +2 -0
- package/es/theme/src/components/header/components/theme-drawer/styles/MenuStyle.d.ts +2 -0
- package/es/theme/src/components/header/helper/changeTheme.d.ts +15 -0
- package/es/theme/src/components/header/helper/{menu-tree.d.ts → menuTree.d.ts} +1 -1
- package/es/theme/src/components/header/index.d.ts +4 -547
- package/es/theme/src/components/sider/components/DragBar.d.ts +2 -0
- package/es/theme/src/components/sider/components/{layout-menu.d.ts → LayoutMenu.d.ts} +5 -5
- package/es/theme/src/components/sider/components/MixSider.d.ts +2 -0
- package/es/theme/src/components/sider/components/SiderTrigger.d.ts +14 -0
- package/es/theme/src/components/sider/components/basic-menu/basic-menu-item.d.ts +8 -35
- package/es/theme/src/components/sider/components/basic-menu/basic-sub-menu-item.d.ts +8 -100
- package/es/theme/src/components/sider/components/basic-menu/index.d.ts +64 -0
- package/es/theme/src/components/sider/components/basic-menu/menu-item-content.d.ts +6 -10
- package/es/theme/src/components/sider/components/{props.d.ts → basic-menu/props.d.ts} +12 -29
- package/es/theme/src/components/sider/helper/sider.d.ts +3 -3
- package/es/theme/src/components/sider/helper/split-menu.d.ts +2 -2
- package/es/theme/src/components/sider/index.d.ts +2 -235
- package/es/theme/src/components/tabs/components/TabContent.d.ts +4 -21
- package/es/theme/src/components/tabs/components/TabRedo.d.ts +2 -23
- package/es/theme/src/components/tabs/hooks/useTabDropdown.d.ts +9 -3
- package/es/theme/src/components/tabs/hooks/useTabs.d.ts +1 -1
- package/es/theme/src/components/tabs/index.d.ts +2 -86
- package/es/theme/src/consts/color.d.ts +3 -0
- package/es/theme/src/consts/index.d.ts +14 -0
- package/es/theme/src/enums/index.d.ts +34 -1
- package/es/theme/src/hooks/index.d.ts +6 -6
- package/es/theme/src/hooks/useDragLine.d.ts +1 -1
- package/es/theme/src/hooks/useHeader.d.ts +22 -23
- package/es/theme/src/hooks/useMenu.d.ts +26 -26
- package/es/theme/src/hooks/useMultifyTab.d.ts +6 -6
- package/es/theme/src/hooks/useOpenKeys.d.ts +3 -3
- package/es/theme/src/hooks/useTheme.d.ts +25 -7
- package/es/theme/src/index.d.ts +2 -1630
- package/es/theme/src/index.scss +1134 -0
- package/es/theme/src/stores/index.d.ts +2 -2
- package/es/theme/src/stores/lockscreen.store.d.ts +7 -5
- package/es/theme/src/stores/routeReuse.store.d.ts +18 -20
- package/es/theme/src/stores/theme.store.d.ts +9 -15
- package/es/theme/{transition.less → src/transition.scss} +1 -1
- package/es/theme/src/types/index.d.ts +0 -3
- package/es/theme/src/types/menu.type.d.ts +2 -1
- package/es/theme/src/types/theme.type.d.ts +31 -12
- package/es/theme/src/utils/color.d.ts +14 -0
- package/es/theme/src/utils/index.d.ts +3 -0
- package/es/theme/src/utils.ts/index.d.ts +3 -0
- package/index.d.ts +12 -13
- package/index.js +44 -62
- package/manualContentPath.js +73 -19
- package/package.json +65 -65
- package/tsconfig.json +19 -30
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +82 -68
- package/es/assets/data/icons/actions.d.ts +0 -1
- package/es/assets/data/icons/actions.ts +0 -423
- package/es/assets/data/icons/code.d.ts +0 -1
- package/es/assets/data/icons/code.ts +0 -10
- package/es/assets/data/icons/commuticate.d.ts +0 -1
- package/es/assets/data/icons/commuticate.ts +0 -182
- package/es/assets/data/icons/currency.d.ts +0 -1
- package/es/assets/data/icons/currency.ts +0 -44
- package/es/assets/data/icons/devices.d.ts +0 -1
- package/es/assets/data/icons/devices.ts +0 -126
- package/es/assets/data/icons/edit.d.ts +0 -1
- package/es/assets/data/icons/edit.ts +0 -163
- package/es/assets/data/icons/file.d.ts +0 -1
- package/es/assets/data/icons/file.ts +0 -99
- package/es/assets/data/icons/math.d.ts +0 -1
- package/es/assets/data/icons/math.ts +0 -53
- package/es/assets/data/icons/message.d.ts +0 -1
- package/es/assets/data/icons/message.ts +0 -68
- package/es/assets/data/icons/navigate.d.ts +0 -1
- package/es/assets/data/icons/navigate.ts +0 -181
- package/es/assets/data/icons/other.d.ts +0 -1
- package/es/assets/data/icons/other.ts +0 -324
- package/es/assets/data/index.d.ts +0 -4
- package/es/assets/data/index.ts +0 -58
- package/es/assets/imgs/tree/forder-open.svg +0 -1
- package/es/assets/imgs/tree/forder.svg +0 -1
- package/es/components/container/src/components/scroll-bar.d.ts +0 -70
- package/es/components/container/src/scroll-container.d.ts +0 -76
- package/es/components/container/src/slot-container.d.ts +0 -20
- package/es/components/curd/src/components/Curd.d.ts +0 -384
- package/es/components/drawer/index.less +0 -16
- package/es/components/drawer/src/components/DrawerHeader.d.ts +0 -11
- package/es/components/form/index.less +0 -361
- package/es/components/form/src/components/formIcon.d.ts +0 -14
- package/es/components/form/src/components/formInputUseDialog.d.ts +0 -17
- package/es/components/form/src/components/radioButton.d.ts +0 -34
- package/es/components/form/src/enums/index.d.ts +0 -7
- package/es/components/icons/index.less +0 -47
- package/es/components/icons/src/pick-icon.d.ts +0 -455
- package/es/components/iframe/index.less +0 -29
- package/es/components/modal/src/components/ModalWrap.d.ts +0 -79
- package/es/components/source/utils/index.d.ts +0 -8
- package/es/components/table/src/enums/table.enum.d.ts +0 -5
- package/es/components/table/src/hooks/useRow.d.ts +0 -5
- package/es/components/tree/index.less +0 -200
- package/es/components/tree/src/type/tree.d.ts +0 -50
- package/es/directives/icon.d.ts +0 -2
- package/es/global.d.ts +0 -7
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -4
- package/es/theme/index.less +0 -1003
- package/es/theme/src/components/feature/back-top.d.ts +0 -5
- package/es/theme/src/components/header/components/bread-crumb.d.ts +0 -6
- package/es/theme/src/components/header/components/fullscreen.d.ts +0 -5
- package/es/theme/src/components/header/components/index.d.ts +0 -11
- package/es/theme/src/components/header/components/lang-picker.d.ts +0 -23
- package/es/theme/src/components/header/components/lock/index.d.ts +0 -2
- package/es/theme/src/components/header/components/logo.d.ts +0 -55
- package/es/theme/src/components/header/components/menu-filter.d.ts +0 -22
- package/es/theme/src/components/header/components/notify.d.ts +0 -22
- package/es/theme/src/components/header/components/setting-theme.d.ts +0 -223
- package/es/theme/src/components/header/components/size.d.ts +0 -21
- package/es/theme/src/components/header/components/theme-drawer/feature.d.ts +0 -138
- package/es/theme/src/components/header/components/theme-drawer/index.d.ts +0 -3
- package/es/theme/src/components/header/components/theme-drawer/menu-type.d.ts +0 -16
- package/es/theme/src/components/header/components/theme-drawer/select.d.ts +0 -58
- package/es/theme/src/components/header/components/theme-drawer/switch.d.ts +0 -49
- package/es/theme/src/components/header/components/trigger.d.ts +0 -10
- package/es/theme/src/components/header/components/user-info.d.ts +0 -44
- package/es/theme/src/components/header/helper/change-theme.d.ts +0 -13
- package/es/theme/src/components/header/multiple-header.d.ts +0 -660
- package/es/theme/src/components/sider/components/basic-menu/basic-menu.d.ts +0 -207
- package/es/theme/src/components/sider/components/drag-bar.d.ts +0 -14
- package/es/theme/src/components/sider/components/sider-trigger.d.ts +0 -17
- package/es/theme/src/components/sider/mix-sider.d.ts +0 -167
- package/es/theme/src/components/tabs/components/index.d.ts +0 -3
- package/es/theme/src/components/tabs/types/tabs.type.d.ts +0 -7
- package/es/theme/src/enums/theme.enum.d.ts +0 -34
- package/es/theme/src/setting/theme.setting.d.ts +0 -2
- package/es/utils/withInstall.d.ts +0 -4
- package/tailwind.config.cjs +0 -11
- package/tsconfig.node.json +0 -9
- /package/es/assets/{icons → fonts}/iconfont.css +0 -0
- /package/es/assets/{icons → fonts}/iconfont.eot +0 -0
- /package/es/assets/{icons → fonts}/iconfont.svg +0 -0
- /package/es/assets/{icons → fonts}/iconfont.ttf +0 -0
- /package/es/assets/{icons → fonts}/iconfont.woff +0 -0
- /package/es/assets/{icons → fonts}/iconfont.woff2 +0 -0
- /package/es/components/container/src/types/{scroll.type.d.ts → index.d.ts} +0 -0
|
@@ -1,161 +1,163 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { isProd, isObject, isFunction, error, isUnDef } from "@dt-frames/core";
|
|
2
|
+
import { reactive, ref, getCurrentInstance, unref, onUnmounted, watch, toRaw, defineComponent, computed, openBlock, createBlock, mergeProps, isRef, createSlots, withCtx, createElementBlock, createElementVNode, toDisplayString, renderSlot, createCommentVNode, createVNode, renderList, normalizeProps, guardReactiveProps } from "vue";
|
|
3
|
+
import { Spin, Drawer } from "ant-design-vue/es";
|
|
4
|
+
import { omit } from "lodash-es";
|
|
5
|
+
import { ModalFooter } from "../modal";
|
|
6
|
+
const orgDialogProp = reactive({});
|
|
7
|
+
const cbTransfer = {};
|
|
8
|
+
const cbFun = {};
|
|
9
|
+
function useDrawerOut() {
|
|
10
|
+
const drawer = ref(null);
|
|
11
|
+
const loaded = ref(false);
|
|
12
|
+
const uid = ref("");
|
|
13
|
+
const open = ref(false);
|
|
14
|
+
function register(drawerMethods, uuid, isOpen) {
|
|
15
|
+
if (!getCurrentInstance()) {
|
|
16
|
+
throw new Error("useDrawer\u53EA\u80FD\u5728setup()\u6216\u8005\u51FD\u6570\u4E2D\u4F7F\u7528");
|
|
13
17
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
const _hoisted_1 = {
|
|
27
|
-
class: "flex items-center",
|
|
28
|
-
style: { gap: "10px" }
|
|
29
|
-
};
|
|
30
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
31
|
-
__name: "DrawerFooter",
|
|
32
|
-
props: {
|
|
33
|
-
buttons: Object,
|
|
34
|
-
showSave: { type: Boolean, default: true },
|
|
35
|
-
showCancel: { type: Boolean, default: true },
|
|
36
|
-
okText: { type: String },
|
|
37
|
-
cancelText: { type: String }
|
|
38
|
-
},
|
|
39
|
-
emits: [
|
|
40
|
-
"handleSave",
|
|
41
|
-
"handleCancel"
|
|
42
|
-
],
|
|
43
|
-
setup(__props, { emit: emits }) {
|
|
44
|
-
const props = __props;
|
|
45
|
-
const { t } = useI18n("UI");
|
|
46
|
-
const buttonList = computed(() => {
|
|
47
|
-
if (props.buttons && props.buttons.length)
|
|
48
|
-
return props.buttons;
|
|
49
|
-
let buttonActions = [
|
|
50
|
-
{ t: "\u5173\u95ED", label: props.cancelText || t("CLOSE"), preIcon: "mdi:close", flag: "CANCEL" },
|
|
51
|
-
{ t: "\u4FDD\u5B58", label: props.okText || t("SAVE"), preIcon: "mdi:content-save", type: "primary", flag: "OK" }
|
|
52
|
-
];
|
|
53
|
-
if (!props.showSave)
|
|
54
|
-
buttonActions = buttonActions.filter((btn) => btn.flag !== "OK");
|
|
55
|
-
if (!props.showCancel)
|
|
56
|
-
buttonActions = buttonActions.filter((btn) => btn.flag !== "CANCEL");
|
|
57
|
-
return buttonActions;
|
|
18
|
+
uid.value = uuid;
|
|
19
|
+
if (unref(loaded) && drawerMethods === unref(drawer))
|
|
20
|
+
return;
|
|
21
|
+
drawer.value = drawerMethods;
|
|
22
|
+
loaded.value = true;
|
|
23
|
+
onUnmounted(() => {
|
|
24
|
+
if (isProd()) {
|
|
25
|
+
drawer.value = null;
|
|
26
|
+
loaded.value = false;
|
|
27
|
+
delete orgDialogProp[unref(uid)];
|
|
28
|
+
delete cbTransfer[unref(uid)];
|
|
29
|
+
}
|
|
58
30
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
31
|
+
watch(
|
|
32
|
+
() => unref(isOpen),
|
|
33
|
+
(v) => {
|
|
34
|
+
if (v === false) {
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
open.value = v;
|
|
37
|
+
}, 250);
|
|
38
|
+
} else {
|
|
39
|
+
open.value = v;
|
|
40
|
+
}
|
|
67
41
|
}
|
|
68
|
-
|
|
69
|
-
return (_ctx, _cache) => {
|
|
70
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
71
|
-
renderSlot(_ctx.$slots, "appendFooter"),
|
|
72
|
-
createVNode(unref(DtFormButtons), {
|
|
73
|
-
mode: "dialog",
|
|
74
|
-
buttonList: unref(buttonList),
|
|
75
|
-
onHandleMethod: _cache[0] || (_cache[0] = ($event) => handleMethod($event))
|
|
76
|
-
}, null, 8, ["buttonList"])
|
|
77
|
-
]);
|
|
78
|
-
};
|
|
42
|
+
);
|
|
79
43
|
}
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
44
|
+
const getInstance = () => {
|
|
45
|
+
const instance = unref(drawer);
|
|
46
|
+
if (!instance) {
|
|
47
|
+
error("useDrawerOut \u5B9E\u4F8B\u672A\u5B9A\u4E49");
|
|
48
|
+
}
|
|
49
|
+
return instance;
|
|
50
|
+
};
|
|
51
|
+
const methods = {
|
|
52
|
+
setDrawerProps: (props) => {
|
|
53
|
+
getInstance()?.setDrawerProps(props);
|
|
54
|
+
},
|
|
55
|
+
openDrawer: (params = null, afterClose) => {
|
|
56
|
+
open.value = true;
|
|
57
|
+
let uidWatch = watch(
|
|
58
|
+
() => unref(uid),
|
|
59
|
+
(v) => {
|
|
60
|
+
if (v) {
|
|
61
|
+
const id = unref(uid);
|
|
62
|
+
cbFun[id]?.(isObject(params) ? { ...toRaw(params) } : params);
|
|
63
|
+
getInstance()?.setDrawerProps({
|
|
64
|
+
defaultFullscreen: false,
|
|
65
|
+
...orgDialogProp[id],
|
|
66
|
+
open: true
|
|
67
|
+
});
|
|
68
|
+
cbTransfer[id] = (res) => {
|
|
69
|
+
if (afterClose && isFunction(afterClose)) {
|
|
70
|
+
afterClose(res);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
uidWatch();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
closeDrawer: () => {
|
|
79
|
+
getInstance()?.setDrawerProps({ open: false });
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return [register, methods, open];
|
|
83
|
+
}
|
|
84
|
+
function useDrawer(props, setDrawerData) {
|
|
85
|
+
const drawerInstanceRef = ref(null);
|
|
86
|
+
const uidRef = ref("");
|
|
87
|
+
const getInstance = () => {
|
|
88
|
+
const instance = unref(drawerInstanceRef);
|
|
89
|
+
if (!instance) {
|
|
90
|
+
error("useDrawer \u5B9E\u4F8B\u672A\u5B9A\u4E49");
|
|
91
|
+
}
|
|
92
|
+
return instance;
|
|
93
|
+
};
|
|
94
|
+
const register = (drawerInstance, uuid) => {
|
|
95
|
+
uidRef.value = uuid;
|
|
96
|
+
drawerInstanceRef.value = drawerInstance;
|
|
97
|
+
cbFun[uuid] = setDrawerData;
|
|
98
|
+
orgDialogProp[uuid] = toRaw(props);
|
|
99
|
+
drawerInstance.setDrawerProps(props);
|
|
100
|
+
};
|
|
101
|
+
const methods = {
|
|
102
|
+
setLoading: (loading = true) => {
|
|
103
|
+
getInstance()?.setDrawerProps({ loading });
|
|
104
|
+
},
|
|
105
|
+
getDrawerProps: () => {
|
|
106
|
+
return getInstance()?.getDrawerProps();
|
|
107
|
+
},
|
|
108
|
+
closeDrawer: (rsp) => {
|
|
109
|
+
if (cbTransfer[unref(uidRef)])
|
|
110
|
+
cbTransfer[unref(uidRef)](rsp);
|
|
111
|
+
getInstance()?.setDrawerProps({ open: false });
|
|
112
|
+
},
|
|
113
|
+
setDrawerProps: (props2) => {
|
|
114
|
+
getInstance()?.setDrawerProps(props2);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
return [register, methods];
|
|
118
|
+
}
|
|
119
|
+
const defaultProps = {
|
|
120
|
+
loadingTip: "\u52A0\u8F7D\u4E2D...",
|
|
121
|
+
mask: true,
|
|
122
|
+
maskClosable: true,
|
|
123
|
+
keyboard: true,
|
|
124
|
+
showOkBtn: true,
|
|
125
|
+
showCancelBtn: true,
|
|
126
|
+
placement: "right",
|
|
127
|
+
okText: "\u4FDD\u5B58",
|
|
128
|
+
cancelText: "\u5173\u95ED"
|
|
129
|
+
};
|
|
130
|
+
const _hoisted_1 = {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "flex h-full items-center"
|
|
133
|
+
};
|
|
134
|
+
const _hoisted_2 = {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: "pr-12 flex items-start"
|
|
122
137
|
};
|
|
138
|
+
const _hoisted_3 = { key: 1 };
|
|
123
139
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
124
140
|
__name: "index",
|
|
125
|
-
props: basicProps,
|
|
126
141
|
emits: ["cancel", "save", "register", "visible-change"],
|
|
127
142
|
setup(__props, { emit: emits }) {
|
|
128
|
-
const props = __props;
|
|
129
|
-
const attrs = useAttrs();
|
|
130
|
-
const propsRef = ref(null);
|
|
131
|
-
const auths = DtCache.getLocal(CacheKey.AUTHS);
|
|
132
143
|
const visibleRef = ref(false);
|
|
144
|
+
const propsRef = ref({});
|
|
133
145
|
const getMergeProps = computed(() => {
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (isUnDef(footer))
|
|
139
|
-
return true;
|
|
140
|
-
const filterFooterLen = footer.filter((it) => {
|
|
141
|
-
if (it.auth && auths.indexOf(it.auth) !== -1 || !it.auth)
|
|
142
|
-
return true;
|
|
143
|
-
return false;
|
|
144
|
-
}).length;
|
|
145
|
-
return !!filterFooterLen;
|
|
146
|
+
return {
|
|
147
|
+
...defaultProps,
|
|
148
|
+
...unref(propsRef) || {}
|
|
149
|
+
};
|
|
146
150
|
});
|
|
147
151
|
const getProps = computed(() => {
|
|
148
152
|
let opt = {
|
|
149
|
-
|
|
150
|
-
...unref(attrs),
|
|
151
|
-
...unref(getMergeProps),
|
|
152
|
-
visible: unref(visibleRef),
|
|
153
|
+
...defaultProps,
|
|
153
154
|
bodyStyle: {
|
|
154
155
|
padding: 0
|
|
155
156
|
},
|
|
156
157
|
style: {
|
|
157
158
|
position: "absolute"
|
|
158
|
-
}
|
|
159
|
+
},
|
|
160
|
+
...unref(getMergeProps)
|
|
159
161
|
};
|
|
160
162
|
const { getContainer, width } = opt;
|
|
161
163
|
if (isUnDef(getContainer)) {
|
|
@@ -165,17 +167,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
165
167
|
width: width || "100%"
|
|
166
168
|
};
|
|
167
169
|
} else {
|
|
168
|
-
opt.width = width || "
|
|
170
|
+
opt.width = width || "500px";
|
|
169
171
|
}
|
|
170
172
|
return opt;
|
|
171
173
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
+
const loading = ref(false);
|
|
175
|
+
function setDrawerProps(props) {
|
|
176
|
+
propsRef.value = {
|
|
177
|
+
...unref(propsRef),
|
|
178
|
+
...props
|
|
179
|
+
};
|
|
174
180
|
}
|
|
175
181
|
async function handleCancel(e = null) {
|
|
176
|
-
const {
|
|
177
|
-
if (
|
|
178
|
-
const isClose = await
|
|
182
|
+
const { beforeClose } = unref(getProps);
|
|
183
|
+
if (beforeClose && isFunction(beforeClose)) {
|
|
184
|
+
const isClose = await beforeClose();
|
|
179
185
|
visibleRef.value = !isClose;
|
|
180
186
|
return;
|
|
181
187
|
}
|
|
@@ -183,66 +189,86 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
183
189
|
if (afterClose && isFunction(afterClose)) {
|
|
184
190
|
afterClose();
|
|
185
191
|
}
|
|
192
|
+
loading.value = false;
|
|
186
193
|
visibleRef.value = false;
|
|
187
|
-
propsRef.value.visible = false;
|
|
188
194
|
emits("cancel", e);
|
|
189
195
|
}
|
|
190
|
-
function
|
|
191
|
-
|
|
196
|
+
function getDrawerProps() {
|
|
197
|
+
return unref(getProps);
|
|
198
|
+
}
|
|
199
|
+
function handleSave() {
|
|
200
|
+
emits("save");
|
|
192
201
|
}
|
|
193
202
|
const drawerMethods = {
|
|
194
|
-
setDrawerProps
|
|
203
|
+
setDrawerProps,
|
|
204
|
+
getDrawerProps
|
|
195
205
|
};
|
|
196
206
|
const instance = getCurrentInstance();
|
|
197
|
-
|
|
207
|
+
if (instance) {
|
|
208
|
+
emits("register", drawerMethods, instance.uid, visibleRef);
|
|
209
|
+
}
|
|
198
210
|
watch(
|
|
199
|
-
() => unref(propsRef).
|
|
211
|
+
() => unref(propsRef).open,
|
|
200
212
|
(v) => {
|
|
201
213
|
emits("visible-change", v);
|
|
202
214
|
visibleRef.value = v;
|
|
203
215
|
},
|
|
204
216
|
{ immediate: false }
|
|
205
217
|
);
|
|
218
|
+
watch(
|
|
219
|
+
() => unref(propsRef).loading,
|
|
220
|
+
(v) => {
|
|
221
|
+
loading.value = v;
|
|
222
|
+
},
|
|
223
|
+
{ immediate: false }
|
|
224
|
+
);
|
|
206
225
|
return (_ctx, _cache) => {
|
|
226
|
+
const _component_ASpin = Spin;
|
|
207
227
|
const _component_ADrawer = Drawer;
|
|
208
228
|
return openBlock(), createBlock(_component_ADrawer, mergeProps({
|
|
209
229
|
class: "dt-drawer",
|
|
210
230
|
onClose: handleCancel
|
|
211
|
-
}, unref(getProps), {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
231
|
+
}, unref(omit)(unref(getProps), ["title", "footer"]), {
|
|
232
|
+
open: unref(visibleRef),
|
|
233
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => isRef(visibleRef) ? visibleRef.value = $event : null)
|
|
215
234
|
}), createSlots({
|
|
235
|
+
title: withCtx(() => [
|
|
236
|
+
!_ctx.$slots.title ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
237
|
+
createElementVNode("span", null, toDisplayString(unref(getProps).title), 1),
|
|
238
|
+
_ctx.$slots.titleExtra ? (openBlock(), createElementBlock("span", _hoisted_2, [
|
|
239
|
+
renderSlot(_ctx.$slots, "titleExtra")
|
|
240
|
+
])) : createCommentVNode("", true)
|
|
241
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
242
|
+
renderSlot(_ctx.$slots, "title")
|
|
243
|
+
]))
|
|
244
|
+
]),
|
|
216
245
|
default: withCtx(() => [
|
|
217
|
-
|
|
246
|
+
createVNode(_component_ASpin, {
|
|
247
|
+
spinning: unref(loading),
|
|
248
|
+
tip: unref(getProps).loadingTip
|
|
249
|
+
}, {
|
|
250
|
+
default: withCtx(() => [
|
|
251
|
+
renderSlot(_ctx.$slots, "default")
|
|
252
|
+
]),
|
|
253
|
+
_: 3
|
|
254
|
+
}, 8, ["spinning", "tip"])
|
|
218
255
|
]),
|
|
219
256
|
_: 2
|
|
220
257
|
}, [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
_: 3
|
|
231
|
-
}, 8, ["title"])
|
|
232
|
-
]),
|
|
233
|
-
key: "0"
|
|
234
|
-
} : {
|
|
235
|
-
name: "title",
|
|
236
|
-
fn: withCtx(() => [
|
|
237
|
-
renderSlot(_ctx.$slots, "title")
|
|
238
|
-
]),
|
|
239
|
-
key: "1"
|
|
240
|
-
},
|
|
241
|
-
unref(getshowFooter) ? {
|
|
258
|
+
renderList(Object.keys(unref(omit)(_ctx.$slots, "default")), (item) => {
|
|
259
|
+
return {
|
|
260
|
+
name: item,
|
|
261
|
+
fn: withCtx((data) => [
|
|
262
|
+
renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
|
|
263
|
+
])
|
|
264
|
+
};
|
|
265
|
+
}),
|
|
266
|
+
!_ctx.$slots.footer ? {
|
|
242
267
|
name: "footer",
|
|
243
268
|
fn: withCtx(() => [
|
|
244
|
-
createVNode(
|
|
245
|
-
|
|
269
|
+
createVNode(unref(ModalFooter), {
|
|
270
|
+
authPrefix: unref(getProps).authPrefix,
|
|
271
|
+
buttons: unref(propsRef).footer,
|
|
246
272
|
showSave: unref(getProps).showOkBtn,
|
|
247
273
|
showCancel: unref(getProps).showCancelBtn,
|
|
248
274
|
okText: unref(getProps).okText,
|
|
@@ -258,140 +284,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
258
284
|
])
|
|
259
285
|
};
|
|
260
286
|
})
|
|
261
|
-
]), 1032, ["buttons", "showSave", "showCancel", "okText", "cancelText"])
|
|
287
|
+
]), 1032, ["authPrefix", "buttons", "showSave", "showCancel", "okText", "cancelText"])
|
|
262
288
|
]),
|
|
263
|
-
key: "
|
|
289
|
+
key: "0"
|
|
264
290
|
} : void 0
|
|
265
|
-
]), 1040, ["
|
|
291
|
+
]), 1040, ["open"]);
|
|
266
292
|
};
|
|
267
293
|
}
|
|
268
294
|
});
|
|
269
|
-
const orgDialogProp = reactive({});
|
|
270
|
-
const cbTransfer = reactive({});
|
|
271
|
-
const dataTransfer = reactive({});
|
|
272
|
-
function useDrawerOut() {
|
|
273
|
-
const drawer = ref(null);
|
|
274
|
-
const loaded = ref(false);
|
|
275
|
-
const uid = ref("");
|
|
276
|
-
const { isProd } = useApp();
|
|
277
|
-
function register(drawerMethods, uuid) {
|
|
278
|
-
if (!getCurrentInstance()) {
|
|
279
|
-
throw new Error("useDrawer\u53EA\u80FD\u5728setup()\u6216\u8005\u51FD\u6570\u4E2D\u4F7F\u7528");
|
|
280
|
-
}
|
|
281
|
-
uid.value = uuid;
|
|
282
|
-
onUnmounted(() => {
|
|
283
|
-
if (unref(isProd)) {
|
|
284
|
-
drawer.value = null;
|
|
285
|
-
loaded.value = false;
|
|
286
|
-
dataTransfer[unref(uid)] = null;
|
|
287
|
-
orgDialogProp[unref(uid)] = null;
|
|
288
|
-
cbTransfer[unref(uid)] = (res) => {
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
if (unref(loaded) && drawerMethods === unref(drawer))
|
|
293
|
-
return;
|
|
294
|
-
drawer.value = drawerMethods;
|
|
295
|
-
loaded.value = true;
|
|
296
|
-
}
|
|
297
|
-
const getInstance = () => {
|
|
298
|
-
const instance = unref(drawer);
|
|
299
|
-
if (!instance) {
|
|
300
|
-
error("useDrawerOut \u5B9E\u4F8B\u672A\u5B9A\u4E49");
|
|
301
|
-
}
|
|
302
|
-
return instance;
|
|
303
|
-
};
|
|
304
|
-
const methods = {
|
|
305
|
-
setDrawerProps: (props) => {
|
|
306
|
-
getInstance()?.setDrawerProps(props);
|
|
307
|
-
},
|
|
308
|
-
openDrawer: (params = null, afterClose) => {
|
|
309
|
-
const id = unref(uid);
|
|
310
|
-
dataTransfer[id] = isObject(params) ? { ...toRaw(params) } : params;
|
|
311
|
-
getInstance()?.setDrawerProps({
|
|
312
|
-
defaultFullscreen: false,
|
|
313
|
-
...orgDialogProp[id],
|
|
314
|
-
visible: true
|
|
315
|
-
});
|
|
316
|
-
cbTransfer[id] = (res) => {
|
|
317
|
-
if (afterClose && isFunction(afterClose)) {
|
|
318
|
-
afterClose(res);
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
},
|
|
322
|
-
closeDrawer: () => {
|
|
323
|
-
getInstance()?.setDrawerProps({ visible: false });
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
return [register, methods];
|
|
327
|
-
}
|
|
328
|
-
function useDrawer(props, setModalData) {
|
|
329
|
-
const drawerInstanceRef = ref(null);
|
|
330
|
-
const currentInstance = getCurrentInstance();
|
|
331
|
-
const uidRef = ref("");
|
|
332
|
-
const isFirstRegister = ref(true);
|
|
333
|
-
const { isProd } = useApp();
|
|
334
|
-
const getInstance = () => {
|
|
335
|
-
const instance = unref(drawerInstanceRef);
|
|
336
|
-
if (!instance) {
|
|
337
|
-
error("useDrawer \u5B9E\u4F8B\u672A\u5B9A\u4E49");
|
|
338
|
-
}
|
|
339
|
-
return instance;
|
|
340
|
-
};
|
|
341
|
-
function register(drawerInstance, uuid) {
|
|
342
|
-
if (unref(isProd)) {
|
|
343
|
-
drawerInstanceRef.value = null;
|
|
344
|
-
}
|
|
345
|
-
uidRef.value = uuid;
|
|
346
|
-
drawerInstanceRef.value = drawerInstance;
|
|
347
|
-
currentInstance?.emit("register", drawerInstance, uuid);
|
|
348
|
-
orgDialogProp[uuid] = toRaw(props);
|
|
349
|
-
drawerInstance.setDrawerProps(props);
|
|
350
|
-
}
|
|
351
|
-
watchEffect(() => {
|
|
352
|
-
if (!unref(uidRef))
|
|
353
|
-
return;
|
|
354
|
-
const data = dataTransfer[unref(uidRef)];
|
|
355
|
-
if (!setModalData || !isFunction(setModalData))
|
|
356
|
-
return;
|
|
357
|
-
nextTick(() => {
|
|
358
|
-
if (unref(isFirstRegister)) {
|
|
359
|
-
isFirstRegister.value = false;
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
setModalData(data ?? {});
|
|
363
|
-
if (!data)
|
|
364
|
-
return;
|
|
365
|
-
if (props?.title && isFunction(props?.title)) {
|
|
366
|
-
let title = props.title(data);
|
|
367
|
-
methods.setDrawerProps({ title });
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
});
|
|
371
|
-
const methods = {
|
|
372
|
-
changeLoading: (loading = true) => {
|
|
373
|
-
getInstance()?.setDrawerProps({ loading });
|
|
374
|
-
},
|
|
375
|
-
closeDrawer: (rsp) => {
|
|
376
|
-
if (cbTransfer[unref(uidRef)])
|
|
377
|
-
cbTransfer[unref(uidRef)](rsp);
|
|
378
|
-
getInstance()?.setDrawerProps({ visible: false });
|
|
379
|
-
},
|
|
380
|
-
setDrawerProps: (props2) => {
|
|
381
|
-
getInstance()?.setDrawerProps(props2);
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
return [register, methods];
|
|
385
|
-
}
|
|
386
|
-
const withInstall = (comp) => {
|
|
387
|
-
comp.install = (app) => {
|
|
388
|
-
app.component(comp.name, comp);
|
|
389
|
-
};
|
|
390
|
-
return comp;
|
|
391
|
-
};
|
|
392
|
-
const DtDrawer = withInstall(_sfc_main);
|
|
393
295
|
export {
|
|
394
|
-
DtDrawer,
|
|
296
|
+
_sfc_main as DtDrawer,
|
|
395
297
|
useDrawer,
|
|
396
298
|
useDrawerOut
|
|
397
299
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ButtonProps } from '../../../form
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ButtonProps } from '../../../form';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
authPrefix: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
};
|
|
6
|
+
buttons: globalThis.PropType<ButtonProps[]>;
|
|
5
7
|
showSave: {
|
|
6
8
|
type: BooleanConstructor;
|
|
7
9
|
default: boolean;
|
|
@@ -16,22 +18,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
16
18
|
cancelText: {
|
|
17
19
|
type: StringConstructor;
|
|
18
20
|
};
|
|
19
|
-
}, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
(key: string, locale: string, named: Record<string, unknown>): string;
|
|
25
|
-
(key: string, list: unknown[]): string;
|
|
26
|
-
(key: string, named: Record<string, unknown>): string;
|
|
27
|
-
};
|
|
28
|
-
emits: (event: "handleSave" | "handleCancel", ...args: any[]) => void;
|
|
29
|
-
props: any;
|
|
30
|
-
buttonList: import("vue").ComputedRef<ButtonProps[]>;
|
|
31
|
-
handleMethod: (item: ButtonProps) => void;
|
|
32
|
-
readonly DtFormButtons: import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
33
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("handleSave" | "handleCancel")[], "handleSave" | "handleCancel", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
|
-
buttons: PropType<ButtonProps[]>;
|
|
21
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("handleSave" | "handleCancel")[], "handleSave" | "handleCancel", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
authPrefix: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
};
|
|
25
|
+
buttons: globalThis.PropType<ButtonProps[]>;
|
|
35
26
|
showSave: {
|
|
36
27
|
type: BooleanConstructor;
|
|
37
28
|
default: boolean;
|
|
@@ -52,5 +43,12 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
52
43
|
}, {
|
|
53
44
|
showSave: boolean;
|
|
54
45
|
showCancel: boolean;
|
|
46
|
+
}, {}>, {
|
|
47
|
+
appendFooter?(_: {}): any;
|
|
55
48
|
}>;
|
|
56
|
-
export default
|
|
49
|
+
export default _default;
|
|
50
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DrawerProps, UseDrawerInnerReturnType, UseDrawerReturnType } from
|
|
1
|
+
import { DrawerProps, UseDrawerInnerReturnType, UseDrawerReturnType } from '../type/drawer.type';
|
|
2
2
|
export declare function useDrawerOut(): UseDrawerReturnType;
|
|
3
|
-
export declare function useDrawer(props: DrawerProps,
|
|
3
|
+
export declare function useDrawer(props: DrawerProps, setDrawerData?: (params: any) => void): UseDrawerInnerReturnType;
|