@dazhicheng/ui 1.5.199 → 1.5.202
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/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/api/dataTypeContext.js +17 -0
- package/dist/assets/img/empty_images/no_data.png.js +4 -0
- package/dist/assets/img/empty_images/search.png.js +4 -0
- package/dist/assets/img/image_status/develop.png.js +4 -0
- package/dist/assets/img/image_status/loading.gif.js +4 -0
- package/dist/assets/img/image_status/loading_fail.png.js +4 -0
- package/dist/assets/img/image_status/no_network.png.js +4 -0
- package/dist/assets/img/image_status/no_permission.png.js +4 -0
- package/dist/assets/svg/RiRefreshLine.svg.js +4 -0
- package/dist/assets/svg/action_more.svg.js +4 -0
- package/dist/assets/svg/add.svg.js +4 -0
- package/dist/assets/svg/addCircleLine.svg.js +4 -0
- package/dist/assets/svg/arrowDown.svg.js +4 -0
- package/dist/assets/svg/arrowLineDown.svg.js +5 -0
- package/dist/assets/svg/arrowSUp.svg.js +4 -0
- package/dist/assets/svg/arrowUp.svg.js +4 -0
- package/dist/assets/svg/close.svg.js +4 -0
- package/dist/assets/svg/columnSet.svg.js +4 -0
- package/dist/assets/svg/determinateCircleLine.svg.js +5 -0
- package/dist/assets/svg/drag.svg.js +5 -0
- package/dist/assets/svg/exportSvg.svg.js +4 -0
- package/dist/assets/svg/fileSvg.svg.js +4 -0
- package/dist/assets/svg/help.svg.js +4 -0
- package/dist/assets/svg/item_error.svg.js +4 -0
- package/dist/assets/svg/paixu-jiangxu.svg.js +4 -0
- package/dist/assets/svg/paixu-moren.svg.js +4 -0
- package/dist/assets/svg/paixu-shengxu.svg.js +4 -0
- package/dist/assets/svg/quanping.svg.js +4 -0
- package/dist/assets/svg/suoxiao.svg.js +4 -0
- package/dist/components/tt-api-component/index.js +7 -0
- package/dist/components/tt-api-component/index.vue.js +7 -0
- package/dist/components/tt-api-component/index.vue2.js +199 -0
- package/dist/components/tt-area/TtArea.vue.js +7 -0
- package/dist/components/tt-area/TtArea.vue3.js +36 -0
- package/dist/components/tt-button/components/AddButton.vue.js +24 -0
- package/dist/components/tt-button/components/AddButton.vue2.js +4 -0
- package/dist/components/tt-button/index.js +9 -0
- package/dist/components/tt-button/index.vue.js +7 -0
- package/dist/components/tt-button/index.vue2.js +68 -0
- package/dist/components/tt-checkbox/index.js +7 -0
- package/dist/components/tt-checkbox/index.vue.js +77 -0
- package/dist/components/tt-checkbox/index.vue2.js +4 -0
- package/dist/components/tt-drawer/index.js +14 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +157 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +56 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +7 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +21 -0
- package/dist/components/tt-drawer/src/hooks/useDrawerRender.js +124 -0
- package/dist/components/tt-drawer/src/hooks/useResizable.js +98 -0
- package/dist/components/tt-drawer/src/index.js +17 -0
- package/dist/components/tt-drawer/src/props.js +72 -0
- package/dist/components/tt-drawer/src/utils/drawer-api.js +191 -0
- package/dist/components/tt-empty/index.js +34 -0
- package/dist/components/tt-form/index.js +59 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +38 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormActions.vue2.js +177 -0
- package/dist/components/tt-form/src/components/FormActions.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormElInput.vue.js +80 -0
- package/dist/components/tt-form/src/components/FormElInput.vue2.js +4 -0
- package/dist/components/tt-form/src/components/Slot.js +28 -0
- package/dist/components/tt-form/src/config.js +57 -0
- package/dist/components/tt-form/src/form/FormControl.vue.js +16 -0
- package/dist/components/tt-form/src/form/FormControl.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormDescription.vue.js +21 -0
- package/dist/components/tt-form/src/form/FormDescription.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormItem.vue.js +20 -0
- package/dist/components/tt-form/src/form/FormItem.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormLabel.vue.js +19 -0
- package/dist/components/tt-form/src/form/FormLabel.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessage.vue.js +18 -0
- package/dist/components/tt-form/src/form/FormMessage.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue.js +30 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue2.js +4 -0
- package/dist/components/tt-form/src/form/RenderContent.vue.js +31 -0
- package/dist/components/tt-form/src/form/RenderContent.vue2.js +4 -0
- package/dist/components/tt-form/src/form/injectionKeys.js +4 -0
- package/dist/components/tt-form/src/form/useFormField.js +24 -0
- package/dist/components/tt-form/src/form-render/FormField.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +345 -0
- package/dist/components/tt-form/src/form-render/FormFieldContact.js +54 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +101 -0
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +195 -0
- package/dist/components/tt-form/src/form-render/array-register/props.js +47 -0
- package/dist/components/tt-form/src/form-render/array-register/utils.js +12 -0
- package/dist/components/tt-form/src/form-render/context.js +15 -0
- package/dist/components/tt-form/src/form-render/dependencies.js +51 -0
- package/dist/components/tt-form/src/form-render/expandable.js +46 -0
- package/dist/components/tt-form/src/form-render/form.vue2.js +196 -0
- package/dist/components/tt-form/src/form-render/form.vue3.js +5 -0
- package/dist/components/tt-form/src/form-render/helper.js +22 -0
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +10 -0
- package/dist/components/tt-form/src/formApi.js +790 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +223 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +277 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +153 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/groupFormApi.js +700 -0
- package/dist/components/tt-form/src/group-form/lazyContext.js +38 -0
- package/dist/components/tt-form/src/group-form/useGroupForm.js +83 -0
- package/dist/components/tt-form/src/group-form/utils.js +106 -0
- package/dist/components/tt-form/src/hooks/useArrayRegistry.js +22 -0
- package/dist/components/tt-form/src/hooks/useFieldArray.js +137 -0
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +33 -0
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +81 -0
- package/dist/components/tt-form/src/index.vue2.js +147 -0
- package/dist/components/tt-form/src/index.vue3.js +5 -0
- package/dist/components/tt-form/src/shared/createContext.js +14 -0
- package/dist/components/tt-form/src/shared/global-state.js +22 -0
- package/dist/components/tt-form/src/shared/zod-defaults.js +47 -0
- package/dist/components/tt-form/src/types/forms.js +6 -0
- package/dist/components/tt-form/src/useForm.js +28 -0
- package/dist/components/tt-form/src/useFormContext.js +320 -0
- package/dist/components/tt-form/src/utils/array-path.js +18 -0
- package/dist/components/tt-form-item-error-tooltip/index.js +9 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +183 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue3.js +5 -0
- package/dist/components/tt-icon/components/AddIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/AddIcon.vue2.js +4 -0
- package/dist/components/tt-icon/components/SubIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/SubIcon.vue2.js +4 -0
- package/dist/components/tt-icon/index.js +11 -0
- package/dist/components/tt-icon/index.vue.js +8 -0
- package/dist/components/tt-icon/index.vue2.js +115 -0
- package/dist/components/tt-image/index.js +9 -0
- package/dist/components/tt-image/src/components/ImageViewer.js +41 -0
- package/dist/components/tt-image/tt-image.js +55 -0
- package/dist/components/tt-loading/index.js +8 -0
- package/dist/components/tt-loading/src/directive.js +51 -0
- package/dist/components/tt-loading/src/loading.vue.js +7 -0
- package/dist/components/tt-loading/src/loading.vue2.js +75 -0
- package/dist/components/tt-loading/src/service.js +79 -0
- package/dist/components/tt-log/index.js +7 -0
- package/dist/components/tt-log/index.vue.js +31 -0
- package/dist/components/tt-log/index.vue2.js +4 -0
- package/dist/components/tt-modal/index.js +14 -0
- package/dist/components/tt-modal/src/RenderModal.vue.js +310 -0
- package/dist/components/tt-modal/src/RenderModal.vue3.js +5 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +74 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +22 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +48 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue2.js +4 -0
- package/dist/components/tt-modal/src/hooks/useModalRender.js +131 -0
- package/dist/components/tt-modal/src/index.js +17 -0
- package/dist/components/tt-modal/src/props.js +75 -0
- package/dist/components/tt-modal/src/utils/modal-api.js +200 -0
- package/dist/components/tt-modal/src/utils/modal-stack.js +28 -0
- package/dist/components/tt-modal-form/hooks/useModalFormSlot.js +22 -0
- package/dist/components/tt-modal-form/index.vue.js +201 -0
- package/dist/components/tt-modal-form/index.vue2.js +4 -0
- package/dist/components/tt-modal-form/useModalForm.js +30 -0
- package/dist/components/tt-nav-anchor/index.js +8 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +234 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue3.js +5 -0
- package/dist/components/tt-nav-anchor/src/constants.js +4 -0
- package/dist/components/tt-panel-select/index.js +7 -0
- package/dist/components/tt-panel-select/src/common.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +56 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +277 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +108 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +184 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +91 -0
- package/dist/components/tt-panel-select/src/index.vue.js +386 -0
- package/dist/components/tt-panel-select/src/index.vue2.js +4 -0
- package/dist/components/tt-select/index.js +8 -0
- package/dist/components/tt-select/src/Select.vue.js +315 -0
- package/dist/components/tt-select/src/Select.vue3.js +5 -0
- package/dist/components/tt-select/src/components/SelectTable.vue.js +86 -0
- package/dist/components/tt-select/src/components/SelectTable.vue3.js +5 -0
- package/dist/components/tt-select/src/components/Table.vue.js +307 -0
- package/dist/components/tt-select/src/components/Table.vue3.js +5 -0
- package/dist/components/tt-select/src/const.js +19 -0
- package/dist/components/tt-select/src/hooks/useDataSource.js +196 -0
- package/dist/components/tt-select/src/hooks/useGrid.js +97 -0
- package/dist/components/tt-select/src/hooks/useKeyboard.js +63 -0
- package/dist/components/tt-select/src/hooks/usePagination.js +45 -0
- package/dist/components/tt-select/src/hooks/useSelect.js +100 -0
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +345 -0
- package/dist/components/tt-select/src/props.js +201 -0
- package/dist/components/tt-select/src/utils/index.js +16 -0
- package/dist/components/tt-table/index.js +63 -0
- package/dist/components/tt-table/src/Table.vue.js +623 -0
- package/dist/components/tt-table/src/Table.vue3.js +5 -0
- package/dist/components/tt-table/src/TableForm.vue.js +356 -0
- package/dist/components/tt-table/src/TableForm.vue2.js +4 -0
- package/dist/components/tt-table/src/componentMap.js +4 -0
- package/dist/components/tt-table/src/components/RowContext.js +24 -0
- package/dist/components/tt-table/src/components/TableAction.vue.js +222 -0
- package/dist/components/tt-table/src/components/TableAction.vue2.js +4 -0
- package/dist/components/tt-table/src/components/TableButtons.js +117 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +234 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue3.js +5 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue.js +87 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +4 -0
- package/dist/components/tt-table/src/emits.js +15 -0
- package/dist/components/tt-table/src/hooks/useCellArea.js +15 -0
- package/dist/components/tt-table/src/hooks/useColumns.js +275 -0
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +53 -0
- package/dist/components/tt-table/src/hooks/useDataSource.js +224 -0
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +64 -0
- package/dist/components/tt-table/src/hooks/usePagination.js +44 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.js +84 -0
- package/dist/components/tt-table/src/hooks/useTableContext.js +20 -0
- package/dist/components/tt-table/src/hooks/useTableEvent.js +197 -0
- package/dist/components/tt-table/src/hooks/useTableForm.js +60 -0
- package/dist/components/tt-table/src/hooks/useTableRender.js +33 -0
- package/dist/components/tt-table/src/hooks/useTableSlot.js +17 -0
- package/dist/components/tt-table/src/props.js +482 -0
- package/dist/components/tt-table/src/toolProps.js +30 -0
- package/dist/components/tt-table/src/utils/context.js +17 -0
- package/dist/components/tt-table/src/utils/table-api.js +386 -0
- package/dist/components/tt-table/src/utils/table-form-api.js +122 -0
- package/dist/components/tt-text/index.js +7 -0
- package/dist/components/tt-text/index.vue.js +7 -0
- package/dist/components/tt-text/index.vue2.js +73 -0
- package/dist/components/tt-upload/index.js +9 -0
- package/dist/components/tt-upload/src/TtUpload.vue.js +306 -0
- package/dist/components/tt-upload/src/TtUpload.vue2.js +4 -0
- package/dist/components/tt-upload/src/typing.js +107 -0
- package/dist/directives/auto-tip/index.js +62 -0
- package/dist/directives/dialog-resize/index.js +49 -0
- package/dist/directives/dialog-resize/use-css-variable.js +44 -0
- package/dist/directives/dialog-resize/use-draggable.js +35 -0
- package/dist/directives/dialog-resize/use-fullscreen.js +38 -0
- package/dist/directives/dialog-resize/use-parse-translate.js +9 -0
- package/dist/directives/dialog-resize/use-resizer.js +37 -0
- package/dist/directives/disabled-tip/index.js +78 -0
- package/dist/directives/index.js +8 -0
- package/dist/hooks/useDataPermissionOptions.js +142 -0
- package/dist/hooks/useFormSchemasLink.js +261 -0
- package/dist/hooks/useFormat.js +44 -0
- package/dist/hooks/useLoading.js +22 -0
- package/dist/hooks/useScreenshotOss.js +69 -0
- package/dist/hooks/useSetup.js +59 -0
- package/dist/hooks/useTable.js +13 -0
- package/dist/hooks/useTemplateSlot.js +13 -0
- package/dist/index.js +142 -60274
- package/dist/plugins/default/renderCellContent.js +58 -0
- package/dist/plugins/vxeTable/switchStatus.js +91 -0
- package/dist/plugins.js +4 -146
- package/dist/style.css +1 -1
- package/dist/utils/xhr.js +8 -0
- package/package.json +5 -3
- package/dist/index-NG5FNCLD.js +0 -3430
- package/dist/index.modern-4Cf3dcJP.js +0 -3069
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { defineComponent as Y, useAttrs as Z, ref as $, useId as ee, getCurrentInstance as oe, reactive as te, computed as l, unref as o, toValue as r, watch as re, nextTick as se, onMounted as ne, createBlock as B, createCommentVNode as S, openBlock as w, mergeProps as V, createSlots as D, withCtx as i, withDirectives as ie, createVNode as T, createElementBlock as ae, normalizeClass as le, normalizeStyle as ce, renderSlot as c, renderList as ue, normalizeProps as de, guardReactiveProps as me } from "vue";
|
|
2
|
+
import { useDesign as pe, usePriorityValues as fe, getPriorityValues as he } from "@dazhicheng/hooks";
|
|
3
|
+
import { isNumber as ge } from "@dazhicheng/utils";
|
|
4
|
+
import { omit as ke, pick as O } from "lodash-es";
|
|
5
|
+
import "../../tt-loading/index.js";
|
|
6
|
+
import { useStore as we } from "@tanstack/vue-store";
|
|
7
|
+
import { drawerProps as R, ElDrawer as be } from "element-plus";
|
|
8
|
+
import Ce from "./components/DrawerFooter.vue.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import ve from "./components/DrawerHeader.vue.js";
|
|
11
|
+
import { useDrawerResizable as Pe } from "./hooks/useResizable.js";
|
|
12
|
+
import { basicProps as ye } from "./props.js";
|
|
13
|
+
import { DrawerApi as $e } from "./utils/drawer-api.js";
|
|
14
|
+
import { vTtLoading as Be } from "../../tt-loading/src/directive.js";
|
|
15
|
+
const je = /* @__PURE__ */ Y({
|
|
16
|
+
name: "TtDrawer",
|
|
17
|
+
__name: "RenderDrawer",
|
|
18
|
+
props: {
|
|
19
|
+
...R,
|
|
20
|
+
...ye,
|
|
21
|
+
/** drawerApi */
|
|
22
|
+
drawerApi: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: void 0
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ["visible-change", "register", "update:visible"],
|
|
28
|
+
setup(x, { expose: F, emit: H }) {
|
|
29
|
+
var P;
|
|
30
|
+
const u = x, d = H, m = Z(), p = $(!1), b = ee(), f = $(null), { prefixCls: C } = pe("drawer"), s = oe();
|
|
31
|
+
let t = u.drawerApi;
|
|
32
|
+
t || (t = new $e(u), t.useStore = (e) => we(t.store, e));
|
|
33
|
+
const a = te({
|
|
34
|
+
setDrawerProps: t.setState,
|
|
35
|
+
emitVisible: void 0
|
|
36
|
+
}), z = (P = t.useStore) == null ? void 0 : P.call(t), {
|
|
37
|
+
confirmLoading: A,
|
|
38
|
+
visible: h,
|
|
39
|
+
showFooter: g,
|
|
40
|
+
footerHeight: v,
|
|
41
|
+
cancelButtonProps: L,
|
|
42
|
+
showCancelBtn: _,
|
|
43
|
+
cancelText: N,
|
|
44
|
+
showOkBtn: j,
|
|
45
|
+
okButtonProps: E,
|
|
46
|
+
okText: I,
|
|
47
|
+
title: M,
|
|
48
|
+
loading: U,
|
|
49
|
+
loadingText: q,
|
|
50
|
+
...G
|
|
51
|
+
} = fe(u, z), J = l(() => {
|
|
52
|
+
const e = he(G), n = ke(m, ["onOk", "onClosed", "onClose", "onVisibleChange", "onReceiveSharedData"]);
|
|
53
|
+
return {
|
|
54
|
+
...O(e, Object.keys(R)),
|
|
55
|
+
...n,
|
|
56
|
+
modelValue: o(h),
|
|
57
|
+
class: `${C} ${o(e).class || ""}`,
|
|
58
|
+
modalClass: `${o(e).modalClass || o(e).class}`
|
|
59
|
+
};
|
|
60
|
+
}), K = l(() => ({
|
|
61
|
+
confirmLoading: r(A),
|
|
62
|
+
showFooter: r(g),
|
|
63
|
+
footerHeight: r(v),
|
|
64
|
+
cancelButtonProps: r(L),
|
|
65
|
+
cancelText: r(N),
|
|
66
|
+
showOkBtn: r(j),
|
|
67
|
+
okText: r(I),
|
|
68
|
+
okButtonProps: r(E),
|
|
69
|
+
showCancelBtn: r(_)
|
|
70
|
+
})), Q = l(() => {
|
|
71
|
+
const e = r(v);
|
|
72
|
+
return r(g) && e ? `${ge(e) ? e : Number.parseFloat(e)}px` : "0px";
|
|
73
|
+
}), W = l(() => ({
|
|
74
|
+
height: `calc(100% - ${o(Q)})`
|
|
75
|
+
}));
|
|
76
|
+
re(
|
|
77
|
+
() => h.value,
|
|
78
|
+
(e) => {
|
|
79
|
+
se(() => {
|
|
80
|
+
var n;
|
|
81
|
+
d("update:visible", e), d("visible-change", e), s && ((n = a.emitVisible) == null || n.call(a, e, s == null ? void 0 : s.uid)), e ? p.value = e : (setTimeout(() => {
|
|
82
|
+
p.value = e;
|
|
83
|
+
}, 300), t.changeOkLoading(!1));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
const [X] = Pe(b, h, t.setState);
|
|
88
|
+
return s && d("register", a, s == null ? void 0 : s.uid), ne(() => {
|
|
89
|
+
const e = O(m, ["onOk", "onClosed", "onVisibleChange"]);
|
|
90
|
+
t.mount(f.value, {
|
|
91
|
+
...e,
|
|
92
|
+
// 兼容 BasicDrawer 组件的 onClose 事件
|
|
93
|
+
onClosed: e.onClosed || m.onClose
|
|
94
|
+
});
|
|
95
|
+
}), F({
|
|
96
|
+
drawerRef: f,
|
|
97
|
+
drawerApi: t
|
|
98
|
+
}), (e, n) => p.value ? (w(), B(o(be), V({
|
|
99
|
+
key: 0,
|
|
100
|
+
id: o(b),
|
|
101
|
+
ref_key: "drawerRef",
|
|
102
|
+
ref: f
|
|
103
|
+
}, J.value, {
|
|
104
|
+
"destroy-on-close": !0,
|
|
105
|
+
"before-close": o(t).onClosed
|
|
106
|
+
}), D({
|
|
107
|
+
default: i(() => [
|
|
108
|
+
ie((w(), ae("div", {
|
|
109
|
+
style: ce(W.value),
|
|
110
|
+
class: le(`${o(C)}-content`)
|
|
111
|
+
}, [
|
|
112
|
+
c(e.$slots, "default")
|
|
113
|
+
], 6)), [
|
|
114
|
+
[o(Be), {
|
|
115
|
+
visible: o(U),
|
|
116
|
+
text: o(q)
|
|
117
|
+
}]
|
|
118
|
+
]),
|
|
119
|
+
o(g) || e.$slots.footer ? (w(), B(Ce, V({ key: 0 }, K.value, {
|
|
120
|
+
onClose: o(t).onClosed,
|
|
121
|
+
onFooterok: o(t).onOk
|
|
122
|
+
}), D({ _: 2 }, [
|
|
123
|
+
ue(Object.keys(e.$slots), (k) => ({
|
|
124
|
+
name: k,
|
|
125
|
+
fn: i((y) => [
|
|
126
|
+
c(e.$slots, k, de(me(y)))
|
|
127
|
+
])
|
|
128
|
+
}))
|
|
129
|
+
]), 1040, ["onClose", "onFooterok"])) : S("", !0),
|
|
130
|
+
T(o(X))
|
|
131
|
+
]),
|
|
132
|
+
_: 2
|
|
133
|
+
}, [
|
|
134
|
+
e.$slots.header ? {
|
|
135
|
+
name: "header",
|
|
136
|
+
fn: i(() => [
|
|
137
|
+
c(e.$slots, "header")
|
|
138
|
+
]),
|
|
139
|
+
key: "1"
|
|
140
|
+
} : {
|
|
141
|
+
name: "header",
|
|
142
|
+
fn: i(() => [
|
|
143
|
+
T(ve, { title: o(M) }, {
|
|
144
|
+
titleToolbar: i(() => [
|
|
145
|
+
c(e.$slots, "titleToolbar")
|
|
146
|
+
]),
|
|
147
|
+
_: 3
|
|
148
|
+
}, 8, ["title"])
|
|
149
|
+
]),
|
|
150
|
+
key: "0"
|
|
151
|
+
}
|
|
152
|
+
]), 1040, ["id", "before-close"])) : S("", !0);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
export {
|
|
156
|
+
je as default
|
|
157
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent as v, inject as I, computed as t, toValue as D, createElementBlock as i, openBlock as o, normalizeStyle as P, normalizeClass as S, unref as n, renderSlot as r, Fragment as V, createBlock as l, createCommentVNode as d, withModifiers as c, withCtx as m, createTextVNode as p, toDisplayString as f, mergeProps as b } from "vue";
|
|
2
|
+
import { useDesign as j } from "@dazhicheng/hooks";
|
|
3
|
+
import { generateTestId as u } from "@dazhicheng/utils";
|
|
4
|
+
import { TtButton as k } from "../../../tt-button/index.js";
|
|
5
|
+
import { footerProps as x } from "../props.js";
|
|
6
|
+
const L = /* @__PURE__ */ v({
|
|
7
|
+
name: "DrawerFooter",
|
|
8
|
+
__name: "DrawerFooter",
|
|
9
|
+
props: x,
|
|
10
|
+
emits: ["close"],
|
|
11
|
+
setup(g, { emit: C }) {
|
|
12
|
+
const s = g, h = C, { prefixCls: w } = j("drawer-footer"), a = I("drawerIdContext", ""), B = t(() => u(a, "btn-confirm")), y = t(() => u(a, "btn-cancel")), F = t(() => ({
|
|
13
|
+
height: `${s.footerHeight}px`,
|
|
14
|
+
padding: "0 12px",
|
|
15
|
+
textAlign: "right"
|
|
16
|
+
})), T = t(() => D(s.okButtonProps) || {});
|
|
17
|
+
function $(e) {
|
|
18
|
+
h("close", e);
|
|
19
|
+
}
|
|
20
|
+
return (e, z) => (o(), i("div", {
|
|
21
|
+
class: S([n(w), "w-full flex items-center justify-end"]),
|
|
22
|
+
style: P(F.value)
|
|
23
|
+
}, [
|
|
24
|
+
e.$slots.footer ? r(e.$slots, "footer", { key: 1 }) : (o(), i(V, { key: 0 }, [
|
|
25
|
+
r(e.$slots, "insertFooter"),
|
|
26
|
+
e.showCancelBtn ? (o(), l(n(k), {
|
|
27
|
+
key: 0,
|
|
28
|
+
"data-testid": y.value,
|
|
29
|
+
onClick: c($, ["stop"])
|
|
30
|
+
}, {
|
|
31
|
+
default: m(() => [
|
|
32
|
+
p(f(e.cancelText), 1)
|
|
33
|
+
]),
|
|
34
|
+
_: 1
|
|
35
|
+
}, 8, ["data-testid"])) : d("", !0),
|
|
36
|
+
r(e.$slots, "centerFooter"),
|
|
37
|
+
e.showOkBtn ? (o(), l(n(k), b({
|
|
38
|
+
key: 1,
|
|
39
|
+
loading: e.confirmLoading
|
|
40
|
+
}, T.value, {
|
|
41
|
+
"data-testid": B.value,
|
|
42
|
+
onClick: c(e.$attrs.onFooterok, ["stop"])
|
|
43
|
+
}), {
|
|
44
|
+
default: m(() => [
|
|
45
|
+
p(f(e.okText), 1)
|
|
46
|
+
]),
|
|
47
|
+
_: 1
|
|
48
|
+
}, 16, ["loading", "data-testid", "onClick"])) : d("", !0),
|
|
49
|
+
r(e.$slots, "appendFooter")
|
|
50
|
+
], 64))
|
|
51
|
+
], 6));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
L as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as n, createElementBlock as a, openBlock as s, normalizeClass as o, unref as l, createElementVNode as i, toDisplayString as p } from "vue";
|
|
2
|
+
import { propTypes as m, useDesign as c } from "@dazhicheng/hooks";
|
|
3
|
+
const _ = /* @__PURE__ */ n({
|
|
4
|
+
name: "DrawerHeader",
|
|
5
|
+
__name: "DrawerHeader",
|
|
6
|
+
props: {
|
|
7
|
+
/** 标题 */
|
|
8
|
+
title: m.string
|
|
9
|
+
},
|
|
10
|
+
setup(e) {
|
|
11
|
+
const { prefixCls: r } = c("drawer-header");
|
|
12
|
+
return (t, d) => (s(), a("div", {
|
|
13
|
+
class: o(l(r))
|
|
14
|
+
}, [
|
|
15
|
+
i("span", null, p(t.$slots.title ? "" : e.title), 1)
|
|
16
|
+
], 2));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
_ as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { useStore as h } from "@tanstack/vue-store";
|
|
2
|
+
import { reactive as x, ref as R, defineComponent as p, provide as _, nextTick as y, h as u, inject as O, onMounted as E, watch as S, render as C } from "vue";
|
|
3
|
+
import { RouterView as g } from "vue-router";
|
|
4
|
+
import v from "../RenderDrawer.vue.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { DrawerApi as T } from "../utils/drawer-api.js";
|
|
7
|
+
const P = Symbol("TT_DRAWER_INJECT"), k = {};
|
|
8
|
+
function F(o = {}, c = P) {
|
|
9
|
+
var d;
|
|
10
|
+
const { connectedComponent: a } = o;
|
|
11
|
+
if (a) {
|
|
12
|
+
const r = x({}), n = R(!0);
|
|
13
|
+
return [p(
|
|
14
|
+
(m, { attrs: D, slots: A }) => (_(c, {
|
|
15
|
+
extendApi(b) {
|
|
16
|
+
Object.setPrototypeOf(r, b);
|
|
17
|
+
},
|
|
18
|
+
options: o,
|
|
19
|
+
async reCreateDrawer() {
|
|
20
|
+
n.value = !1, await y(), n.value = !0;
|
|
21
|
+
}
|
|
22
|
+
}), V(r, {
|
|
23
|
+
...m,
|
|
24
|
+
...D,
|
|
25
|
+
...A
|
|
26
|
+
}), () => u(n.value ? a : "div", { ...m, ...D }, A)),
|
|
27
|
+
{
|
|
28
|
+
name: "TtParentDrawer",
|
|
29
|
+
inheritAttrs: !1
|
|
30
|
+
}
|
|
31
|
+
), r];
|
|
32
|
+
}
|
|
33
|
+
const t = O(c, {}), e = {
|
|
34
|
+
...k,
|
|
35
|
+
...t.options,
|
|
36
|
+
...o
|
|
37
|
+
};
|
|
38
|
+
e.onVisibleChange = (r) => {
|
|
39
|
+
var n, i, m;
|
|
40
|
+
(n = o.onVisibleChange) == null || n.call(o, r), (m = (i = t.options) == null ? void 0 : i.onVisibleChange) == null || m.call(i, r);
|
|
41
|
+
};
|
|
42
|
+
const s = e.onClosed;
|
|
43
|
+
e.onClosed = () => {
|
|
44
|
+
var r;
|
|
45
|
+
s == null || s(), e.destroyOnClose && ((r = t.reCreateDrawer) == null || r.call(t));
|
|
46
|
+
};
|
|
47
|
+
const f = new T(e), w = f;
|
|
48
|
+
w.useStore = (r) => h(f.store, r);
|
|
49
|
+
const l = p(
|
|
50
|
+
(r, { attrs: n, slots: i }) => () => u(
|
|
51
|
+
v,
|
|
52
|
+
{
|
|
53
|
+
...r,
|
|
54
|
+
...n,
|
|
55
|
+
drawerApi: w
|
|
56
|
+
},
|
|
57
|
+
i
|
|
58
|
+
),
|
|
59
|
+
{
|
|
60
|
+
name: "TtDrawer",
|
|
61
|
+
inheritAttrs: !1
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
return (d = t.extendApi) == null || d.call(t, w), [l, f];
|
|
65
|
+
}
|
|
66
|
+
function K(o, c, a) {
|
|
67
|
+
const t = new T(a), e = t;
|
|
68
|
+
e.useStore = (d) => h(t.store, d);
|
|
69
|
+
const s = document.createElement("div");
|
|
70
|
+
document.body.appendChild(s);
|
|
71
|
+
const f = p(
|
|
72
|
+
(d, { slots: r }) => (E(() => {
|
|
73
|
+
a && e.setDrawerProps(a), e.openDrawer();
|
|
74
|
+
}), S(
|
|
75
|
+
() => {
|
|
76
|
+
var n;
|
|
77
|
+
return (n = e.getVisible) == null ? void 0 : n.value;
|
|
78
|
+
},
|
|
79
|
+
(n) => {
|
|
80
|
+
n || (C(null, s), s.remove());
|
|
81
|
+
}
|
|
82
|
+
), () => u(
|
|
83
|
+
v,
|
|
84
|
+
{
|
|
85
|
+
...d,
|
|
86
|
+
drawerApi: e
|
|
87
|
+
},
|
|
88
|
+
r
|
|
89
|
+
)),
|
|
90
|
+
{
|
|
91
|
+
name: "TtDrawer",
|
|
92
|
+
inheritAttrs: !1
|
|
93
|
+
}
|
|
94
|
+
), w = u(c, {}), l = u(
|
|
95
|
+
g,
|
|
96
|
+
{},
|
|
97
|
+
() => u(
|
|
98
|
+
f,
|
|
99
|
+
{
|
|
100
|
+
...a
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
default: () => w
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
return l.appContext = o._context, C(l, s), e;
|
|
108
|
+
}
|
|
109
|
+
async function V(o, c) {
|
|
110
|
+
var e;
|
|
111
|
+
if (!c || Object.keys(c).length === 0)
|
|
112
|
+
return;
|
|
113
|
+
await y();
|
|
114
|
+
const a = (e = o == null ? void 0 : o.store) == null ? void 0 : e.state;
|
|
115
|
+
if (!a)
|
|
116
|
+
return;
|
|
117
|
+
const t = new Set(Object.keys(a));
|
|
118
|
+
for (const s of Object.keys(c))
|
|
119
|
+
t.has(s) && ["class"].includes(s);
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
K as showTtDrawer,
|
|
123
|
+
F as useDrawerRender
|
|
124
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ref as l, defineComponent as D, h as f, watch as M } from "vue";
|
|
2
|
+
function Y(d, p, v) {
|
|
3
|
+
const o = l(!1), u = l(!1), a = l(0), n = l(0), e = l(), s = l();
|
|
4
|
+
function m(t) {
|
|
5
|
+
t.stopPropagation(), t.preventDefault(), o.value = !0;
|
|
6
|
+
const { clientX: i } = t;
|
|
7
|
+
if (!e.value) return;
|
|
8
|
+
const b = e.value.clientWidth, x = e.value.style.transition;
|
|
9
|
+
e.value.style.transition = "none", document.onmousemove = z, document.onmouseup = function() {
|
|
10
|
+
document.onmousemove = null, document.onmouseup = null, u.value = !1, o.value = !1, e.value && (e.value.style.transition = x);
|
|
11
|
+
};
|
|
12
|
+
function z(r) {
|
|
13
|
+
r.stopPropagation(), r.preventDefault();
|
|
14
|
+
const y = r.clientX - i;
|
|
15
|
+
n.value = b - y, n.value <= 20 ? n.value = 20 : n.value >= window.innerWidth && (n.value = window.innerWidth), a.value = r.clientY > window.innerHeight ? window.innerHeight : r.clientY, requestAnimationFrame(() => {
|
|
16
|
+
if (c(), o.value)
|
|
17
|
+
if (v)
|
|
18
|
+
v({
|
|
19
|
+
size: `${n.value}px`
|
|
20
|
+
});
|
|
21
|
+
else {
|
|
22
|
+
if (!e.value) return;
|
|
23
|
+
e.value.style.width = `${n.value}px`;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function w(t) {
|
|
29
|
+
u.value = !0, a.value = t.clientY, !o.value && (document.onmousemove = function(i) {
|
|
30
|
+
a.value = i.clientY > window.innerHeight ? window.innerHeight : i.clientY, requestAnimationFrame(() => {
|
|
31
|
+
c();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function h(t) {
|
|
36
|
+
o.value || (u.value = !1, document.onmousemove = null);
|
|
37
|
+
}
|
|
38
|
+
function c() {
|
|
39
|
+
s.value && (s.value.textContent = `width: ${n.value}px`);
|
|
40
|
+
}
|
|
41
|
+
const g = D(
|
|
42
|
+
() => () => f(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
class: "drag-line",
|
|
46
|
+
onMouseover: w,
|
|
47
|
+
onMouseleave: h,
|
|
48
|
+
onMousedown: m,
|
|
49
|
+
style: {
|
|
50
|
+
position: "absolute",
|
|
51
|
+
top: "0",
|
|
52
|
+
left: "0",
|
|
53
|
+
width: "10px",
|
|
54
|
+
height: "100%",
|
|
55
|
+
cursor: "w-resize",
|
|
56
|
+
borderLeft: u.value ? "2px solid #2779ff" : "none"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
[
|
|
60
|
+
f("div", {
|
|
61
|
+
class: "drag-line-tip",
|
|
62
|
+
style: {
|
|
63
|
+
position: "absolute",
|
|
64
|
+
top: `${a.value < 0 ? 0 : a.value}px`,
|
|
65
|
+
left: "0px",
|
|
66
|
+
background: "#2779ff",
|
|
67
|
+
color: "#fff",
|
|
68
|
+
display: u.value ? "block" : "none",
|
|
69
|
+
whiteSpace: "nowrap",
|
|
70
|
+
zIndex: "9999",
|
|
71
|
+
padding: "4px 5px"
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
),
|
|
76
|
+
{
|
|
77
|
+
inheritAttrs: !1,
|
|
78
|
+
name: "ResizableBar"
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
return M(
|
|
82
|
+
() => p.value,
|
|
83
|
+
(t) => {
|
|
84
|
+
t && setTimeout(() => {
|
|
85
|
+
var i;
|
|
86
|
+
e.value = document.querySelector(`#${d}`), e.value && (n.value = e.value.clientWidth, s.value = (i = e.value) == null ? void 0 : i.querySelector(".drag-line-tip"));
|
|
87
|
+
}, 200);
|
|
88
|
+
}
|
|
89
|
+
), [
|
|
90
|
+
g,
|
|
91
|
+
{
|
|
92
|
+
isDragging: o
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
Y as useDrawerResizable
|
|
98
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { inject as n } from "vue";
|
|
2
|
+
import { showTtDrawer as s } from "./hooks/useDrawerRender.js";
|
|
3
|
+
const o = Symbol("SHOW_DRAWER");
|
|
4
|
+
function i(r) {
|
|
5
|
+
const e = (t, w) => s(r, t, w);
|
|
6
|
+
r.provide(o, e);
|
|
7
|
+
}
|
|
8
|
+
function u() {
|
|
9
|
+
const r = n(o);
|
|
10
|
+
if (!r)
|
|
11
|
+
throw new Error("[TtDrawer]: useShowDrawer() 需要先调用 setupDrawer(app) 进行注册");
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as setupDrawer,
|
|
16
|
+
u as useShowDrawer
|
|
17
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { propTypes as o } from "@dazhicheng/hooks";
|
|
2
|
+
import { GlobalConfig as e } from "../../../hooks/useSetup.js";
|
|
3
|
+
const t = {
|
|
4
|
+
/** 确定抽屉的loading */
|
|
5
|
+
confirmLoading: o.bool.def(!1),
|
|
6
|
+
/** 是否显示取消按钮 */
|
|
7
|
+
showCancelBtn: o.bool.def(!0),
|
|
8
|
+
/** 取消按钮的props */
|
|
9
|
+
cancelButtonProps: {
|
|
10
|
+
type: Object,
|
|
11
|
+
default: {}
|
|
12
|
+
},
|
|
13
|
+
/** 取消按钮的文本 */
|
|
14
|
+
cancelText: o.string.def("取消"),
|
|
15
|
+
/** 是否显示确定按钮 */
|
|
16
|
+
showOkBtn: o.bool.def(!0),
|
|
17
|
+
/** 确定按钮的props */
|
|
18
|
+
okButtonProps: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: {
|
|
21
|
+
type: "primary"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
/** 确定按钮的文本 */
|
|
25
|
+
okText: o.string.def("确认"),
|
|
26
|
+
/** 确定按钮的类型 */
|
|
27
|
+
okType: o.string.def("primary"),
|
|
28
|
+
/** 是否显示footer */
|
|
29
|
+
showFooter: o.bool,
|
|
30
|
+
/** footer高度 */
|
|
31
|
+
footerHeight: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
default: 44
|
|
34
|
+
},
|
|
35
|
+
height: o.string.def("56px"),
|
|
36
|
+
size: o.string.def("30%")
|
|
37
|
+
}, r = {
|
|
38
|
+
/** class */
|
|
39
|
+
class: o.string.def(""),
|
|
40
|
+
/** 标题 */
|
|
41
|
+
title: o.string.def(""),
|
|
42
|
+
/** 测试标识 */
|
|
43
|
+
testId: o.string,
|
|
44
|
+
/** loading文本 */
|
|
45
|
+
loadingText: o.string,
|
|
46
|
+
/** 显示 */
|
|
47
|
+
visible: o.bool.def(!1),
|
|
48
|
+
/** 显示loading */
|
|
49
|
+
loading: o.bool.def(!1),
|
|
50
|
+
/** 是否点击遮罩关闭弹窗 */
|
|
51
|
+
maskClosable: o.bool.def(!0),
|
|
52
|
+
/** 是否关闭销毁组件 */
|
|
53
|
+
destroyOnClose: { type: Boolean },
|
|
54
|
+
/** 取消前事件 */
|
|
55
|
+
closeFunc: {
|
|
56
|
+
type: Function
|
|
57
|
+
},
|
|
58
|
+
/** 取消前是否显示确认弹窗 */
|
|
59
|
+
showConfirm: o.bool.def(!1),
|
|
60
|
+
/** 确认弹窗文本内容 */
|
|
61
|
+
confirmContent: o.string.def(e.confirmContent || ""),
|
|
62
|
+
/** 是否显示modal */
|
|
63
|
+
modal: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: () => e.showMask
|
|
66
|
+
},
|
|
67
|
+
...t
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
r as basicProps,
|
|
71
|
+
t as footerProps
|
|
72
|
+
};
|