fast-element-plus 2.0.1 → 2.0.3

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +2 -0
  3. package/README.zh.md +2 -0
  4. package/dist/components/avatar/index.d.ts +2 -2
  5. package/dist/components/avatar/index.mjs.map +1 -1
  6. package/dist/components/button/index.d.ts +1 -1
  7. package/dist/components/button/index.mjs.map +1 -1
  8. package/dist/components/button/src/button.d.ts +1 -1
  9. package/dist/components/button/src/button.mjs +5 -3
  10. package/dist/components/button/src/button.mjs.map +1 -1
  11. package/dist/components/contextMenu/src/contextMenu.d.ts +4 -4
  12. package/dist/components/contextMenu/src/contextMenu.type.d.ts +3 -3
  13. package/dist/components/dialog/index.d.ts +1 -1
  14. package/dist/components/dialog/index.mjs.map +1 -1
  15. package/dist/components/dialog/src/dialog.d.ts +7 -7
  16. package/dist/components/dialog/src/dialog.mjs +35 -29
  17. package/dist/components/dialog/src/dialog.mjs.map +1 -1
  18. package/dist/components/drawer/index.d.ts +2 -2
  19. package/dist/components/drawer/index.mjs.map +1 -1
  20. package/dist/components/drawer/src/drawer.d.ts +7 -7
  21. package/dist/components/drawer/src/drawer.mjs +36 -29
  22. package/dist/components/drawer/src/drawer.mjs.map +1 -1
  23. package/dist/components/form/index.d.ts +1 -1
  24. package/dist/components/form/index.mjs.map +1 -1
  25. package/dist/components/form/src/form.d.ts +5 -2
  26. package/dist/components/form/src/form.mjs.map +1 -1
  27. package/dist/components/formItemTip/index.d.ts +1 -1
  28. package/dist/components/formItemTip/index.mjs.map +1 -1
  29. package/dist/components/icon/index.d.ts +2 -2
  30. package/dist/components/icon/index.mjs.map +1 -1
  31. package/dist/components/image/index.d.ts +1 -1
  32. package/dist/components/image/index.mjs.map +1 -1
  33. package/dist/components/inputDialogPage/index.d.ts +1 -1
  34. package/dist/components/inputDialogPage/index.mjs.map +1 -1
  35. package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +16 -16
  36. package/dist/components/inputDialogPage/src/inputDialogPage.mjs +5 -3
  37. package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
  38. package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
  39. package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
  40. package/dist/components/select/index.d.ts +2 -2
  41. package/dist/components/select/index.mjs.map +1 -1
  42. package/dist/components/select/src/select.d.ts +15 -14
  43. package/dist/components/select/src/select.mjs.map +1 -1
  44. package/dist/components/select/src/select.type.d.ts +4 -4
  45. package/dist/components/select/src/selectOption.d.ts +5 -5
  46. package/dist/components/selectPage/index.d.ts +1 -1
  47. package/dist/components/selectPage/index.mjs.map +1 -1
  48. package/dist/components/selectPage/src/selectPage.d.ts +10 -10
  49. package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
  50. package/dist/components/selectV2/index.d.ts +2 -2
  51. package/dist/components/selectV2/index.mjs.map +1 -1
  52. package/dist/components/selectV2/src/selectV2.d.ts +28 -36
  53. package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
  54. package/dist/components/table/index.d.ts +1 -1
  55. package/dist/components/table/index.mjs.map +1 -1
  56. package/dist/components/table/src/page.type.d.ts +3 -1
  57. package/dist/components/table/src/page.type.mjs.map +1 -1
  58. package/dist/components/table/src/table.d.ts +39 -40
  59. package/dist/components/table/src/table.mjs +12 -6
  60. package/dist/components/table/src/table.mjs.map +1 -1
  61. package/dist/components/table/src/table.state.d.ts +5 -5
  62. package/dist/components/table/src/table.type.d.ts +13 -10
  63. package/dist/components/table/src/table.type.mjs.map +1 -1
  64. package/dist/components/table/src/tableColumn.d.ts +3 -4
  65. package/dist/components/table/src/tableColumn.mjs +2 -2
  66. package/dist/components/table/src/tableColumn.mjs.map +1 -1
  67. package/dist/components/table/src/tableColumnSettingDialog.d.ts +1 -1
  68. package/dist/components/table/src/tableColumnSettingDialog.mjs +2 -2
  69. package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
  70. package/dist/components/table/src/tableSearchForm.d.ts +1 -1
  71. package/dist/components/table/src/tableSearchForm.mjs +3 -1
  72. package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
  73. package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
  74. package/dist/components/table/src/useTable.d.ts +6 -6
  75. package/dist/components/table/src/useTable.mjs +5 -3
  76. package/dist/components/table/src/useTable.mjs.map +1 -1
  77. package/dist/components/table/utils/table.d.ts +3 -2
  78. package/dist/components/table/utils/table.mjs +6 -8
  79. package/dist/components/table/utils/table.mjs.map +1 -1
  80. package/dist/components/tree/index.d.ts +1 -1
  81. package/dist/components/tree/index.mjs.map +1 -1
  82. package/dist/components/tree/src/tree.d.ts +33 -31
  83. package/dist/components/tree/src/tree.mjs +8 -6
  84. package/dist/components/tree/src/tree.mjs.map +1 -1
  85. package/dist/components/tree/src/tree.props.d.ts +1 -4
  86. package/dist/components/tree/src/tree.type.d.ts +4 -4
  87. package/dist/components/treeSelect/index.d.ts +1 -1
  88. package/dist/components/treeSelect/index.mjs.map +1 -1
  89. package/dist/components/treeSelect/src/treeSelect.d.ts +32 -31
  90. package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
  91. package/dist/components/upload/index.d.ts +1 -1
  92. package/dist/components/upload/index.mjs.map +1 -1
  93. package/dist/components/uploadImage/index.d.ts +1 -1
  94. package/dist/components/uploadImage/index.mjs.map +1 -1
  95. package/dist/components/uploadImages/index.d.ts +2 -2
  96. package/dist/components/uploadImages/index.mjs.map +1 -1
  97. package/dist/directives/click-icon-copy/index.mjs.map +1 -1
  98. package/dist/index.global.min.js +4 -4
  99. package/dist/index.global.min.js.map +1 -1
  100. package/dist/version.d.ts +1 -1
  101. package/dist/version.mjs +1 -1
  102. package/dist/version.mjs.map +1 -1
  103. package/package.json +1 -1
@@ -84,7 +84,7 @@ var drawer_default = defineComponent({
84
84
  const _globalSize = useGlobalSize();
85
85
  const state = reactive({
86
86
  loading: false,
87
- visible: props.modelValue,
87
+ visible: false,
88
88
  fullscreen: false,
89
89
  size: props.size ?? "30%",
90
90
  dragging: false,
@@ -92,44 +92,52 @@ var drawer_default = defineComponent({
92
92
  });
93
93
  const drawerRef = ref();
94
94
  let cacheOpenFunction;
95
- const handleOpen = (openFunction) => {
95
+ const handleOpen = async (openFunction) => {
96
96
  state.visible = true;
97
97
  cacheOpenFunction = openFunction;
98
- nextTick(() => {
99
- state.loading = true;
100
- callOptionalFunction(props.afterOpen ?? openFunction).then(() => {
101
- emit("open");
102
- }).catch((error) => {
103
- state.visible = false;
104
- throw error;
105
- }).finally(() => {
106
- state.loading = false;
107
- });
108
- });
98
+ await nextTick();
99
+ state.loading = true;
100
+ try {
101
+ await callOptionalFunction(props.afterOpen ?? openFunction);
102
+ emit("open");
103
+ } catch (error) {
104
+ state.visible = false;
105
+ throw error;
106
+ } finally {
107
+ state.loading = false;
108
+ }
109
109
  };
110
- const handleClose = (closeFunction) => {
110
+ const handleClose = async (closeFunction) => {
111
111
  state.loading = true;
112
- callOptionalFunction(closeFunction).then(() => {
112
+ try {
113
+ await callOptionalFunction(closeFunction);
113
114
  emit("close");
114
115
  state.visible = false;
115
- }).finally(() => {
116
+ } finally {
116
117
  state.loading = false;
117
- });
118
+ }
118
119
  };
119
- const handleLoading = (loadingFunction) => {
120
+ const handleLoading = async (loadingFunction) => {
120
121
  state.loading = true;
121
- callOptionalFunction(loadingFunction).finally(() => {
122
+ try {
123
+ await callOptionalFunction(loadingFunction);
124
+ } finally {
122
125
  state.loading = false;
123
- });
126
+ }
124
127
  };
125
- const handleRefresh = () => {
128
+ const handleRefresh = async () => {
129
+ if (state.loading) return;
126
130
  state.refreshing = true;
127
131
  state.loading = true;
128
- setTimeout(() => {
132
+ try {
133
+ await new Promise((resolve) => setTimeout(resolve, 500));
129
134
  state.refreshing = false;
130
- handleOpen(cacheOpenFunction);
135
+ await handleOpen(cacheOpenFunction);
131
136
  ElMessage.success("刷新成功");
132
- }, 500);
137
+ } finally {
138
+ state.refreshing = false;
139
+ state.loading = false;
140
+ }
133
141
  };
134
142
  const handleBeforeClose = (done) => {
135
143
  if (state.loading) return;
@@ -155,11 +163,8 @@ var drawer_default = defineComponent({
155
163
  if (state.loading) return;
156
164
  handleClose();
157
165
  };
158
- watch(() => props.modelValue, (newValue) => {
159
- if (state.visible !== newValue) state.visible = newValue;
160
- });
161
166
  watch(() => state.visible, (newValue) => {
162
- if (props.modelValue !== newValue) emit("update:modelValue", newValue);
167
+ emit("update:modelValue", newValue);
163
168
  });
164
169
  watch(() => props.size, (newValue) => {
165
170
  if (newValue !== void 0) state.size = newValue;
@@ -238,7 +243,9 @@ var drawer_default = defineComponent({
238
243
  props.showRefresh && createVNode("div", {
239
244
  "title": "刷新",
240
245
  "class": ["fa-drawer__header-icon", state.loading ? "fa__click__disabled fa__click__disabled__cursor " : "fa__hover__twinkle"],
241
- "onClick": handleRefresh
246
+ "onClick": () => {
247
+ handleRefresh();
248
+ }
242
249
  }, [createVNode(ElIcon, { "class": "icon" }, { default: () => [createVNode(Refresh, null, null)] })]),
243
250
  props.showFullscreen && createVNode("div", {
244
251
  "title": state.fullscreen ? "关闭全屏显示" : "全屏显示",
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.mjs","names":["update:modelValue"],"sources":["../../../../src/components/drawer/src/drawer.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, nextTick, onBeforeUnmount, reactive, ref, watch } from \"vue\";\nimport { Close, Eleme, Refresh } from \"@element-plus/icons-vue\";\nimport { ElButton, ElDrawer, ElIcon, ElMessage, ElMessageBox, ElScrollbar, drawerEmits, drawerProps, useGlobalSize } from \"element-plus\";\nimport { FullScreen, FullScreenExit } from \"@fast-element-plus/icons-vue\";\nimport { isBoolean } from \"lodash-unified\";\nimport { callOptionalFunction, definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { VNode } from \"vue\";\n\n/** FaDrawer 的运行时 Props 定义。 */\nexport const faDrawerProps = {\n\t...drawerProps,\n\t/** @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */\n\tappendToBody: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description enable dragging feature for Dialog */\n\tdraggable: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description destroy elements in Dialog when closed */\n\tdestroyOnClose: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示刷新按钮 */\n\tshowRefresh: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示全屏图标 */\n\tshowFullscreen: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示关闭按钮 */\n\tshowCloseButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示确认按钮 */\n\tshowConfirmButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 禁用确认按钮 */\n\tdisabledConfirmButton: Boolean,\n\t/** @description 关闭按钮文字,默认取消 */\n\tcloseButtonText: {\n\t\ttype: String,\n\t\tdefault: \"取消\",\n\t},\n\t/** @description 确认按钮文字,默认确认 */\n\tconfirmButtonText: {\n\t\ttype: String,\n\t\tdefault: \"确认\",\n\t},\n\t/** @description 隐藏底部操作 */\n\thideFooter: Boolean,\n\t/** @description 显示关闭回调 */\n\tshowBeforeClose: Boolean,\n\t/** @description 打开之后 */\n\tafterOpen: {\n\t\ttype: definePropType<() => void>(Function),\n\t},\n};\n\n/** FaDrawer 的运行时 Emits 定义。 */\nexport const faDrawerEmits = {\n\t...drawerEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: boolean): boolean => isBoolean(value),\n\t/** @description 确认按钮点击事件 */\n\tconfirmClick: (): boolean => true,\n};\n\n/** FaDrawer 的插槽参数。 */\nexport interface FaDrawerSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { loading: boolean };\n\t/** @description 头部插槽 */\n\theader: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 标题插槽 */\n\ttitle: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 底部插槽 */\n\tfooter: { loading: boolean; close: () => void };\n}\n\nexport default defineComponent({\n\tname: \"FaDrawer\",\n\tprops: faDrawerProps,\n\temits: faDrawerEmits,\n\tslots: makeSlots<FaDrawerSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t\tvisible: props.modelValue,\n\t\t\tfullscreen: false,\n\t\t\tsize: props.size ?? \"30%\",\n\t\t\tdragging: false,\n\t\t\trefreshing: false,\n\t\t});\n\n\t\tconst drawerRef = ref<InstanceType<typeof ElDrawer>>();\n\n\t\tlet cacheOpenFunction: (() => void | Promise<void>) | undefined;\n\n\t\tconst handleOpen = (openFunction?: () => void | Promise<void>): void => {\n\t\t\tstate.visible = true;\n\t\t\tcacheOpenFunction = openFunction;\n\t\t\tvoid nextTick(() => {\n\t\t\t\tstate.loading = true;\n\t\t\t\tvoid callOptionalFunction(props.afterOpen ?? openFunction)\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\temit(\"open\");\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t// 打开回调失败时保持原有的自动关闭行为,并将异常继续交给运行时。\n\t\t\t\t\t\tstate.visible = false;\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t})\n\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\tstate.loading = false;\n\t\t\t\t\t});\n\t\t\t});\n\t\t};\n\n\t\tconst handleClose = (closeFunction?: () => void | Promise<void>): void => {\n\t\t\tstate.loading = true;\n\t\t\tvoid callOptionalFunction(closeFunction)\n\t\t\t\t.then(() => {\n\t\t\t\t\temit(\"close\");\n\t\t\t\t\tstate.visible = false;\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t});\n\t\t};\n\n\t\tconst handleLoading = (loadingFunction: () => void | Promise<void>): void => {\n\t\t\tstate.loading = true;\n\t\t\tvoid callOptionalFunction(loadingFunction).finally(() => {\n\t\t\t\tstate.loading = false;\n\t\t\t});\n\t\t};\n\n\t\tconst handleRefresh = (): void => {\n\t\t\tstate.refreshing = true;\n\t\t\tstate.loading = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tstate.refreshing = false;\n\t\t\t\thandleOpen(cacheOpenFunction);\n\t\t\t\tElMessage.success(\"刷新成功\");\n\t\t\t}, 500);\n\t\t};\n\n\t\tconst handleBeforeClose = (done: () => void): void => {\n\t\t\tif (state.loading) return;\n\t\t\t// 解决 image 预览摁下 ese 会关闭弹窗的问题\n\t\t\tif (document.querySelector(\".el-image-viewer__wrapper\")) return;\n\n\t\t\tconst newDone = (): Promise<void> => {\n\t\t\t\t// 组件对外约定为无参数完成钩子,不采用 Element Plus 的 done 回调签名。\n\t\t\t\treturn callOptionalFunction(props.beforeClose as unknown as (() => void | PromiseLike<void>) | undefined).then(() => {\n\t\t\t\t\temit(\"close\");\n\t\t\t\t\tdone();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tif (props.showBeforeClose) {\n\t\t\t\t// 用户取消关闭属于正常分支,无需继续执行 beforeClose。\n\t\t\t\tvoid ElMessageBox.confirm(\"确定关闭?\", { type: \"warning\" }).then(() => newDone());\n\t\t\t} else {\n\t\t\t\tvoid newDone();\n\t\t\t}\n\t\t};\n\n\t\tconst handleFullscreen = (): void => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.fullscreen = !state.fullscreen;\n\t\t};\n\n\t\tconst handleConfirmClick = (): void => {\n\t\t\tif (state.loading) return;\n\t\t\temit(\"confirmClick\");\n\t\t};\n\n\t\tconst handleCloseClick = (): void => {\n\t\t\tif (state.loading) return;\n\t\t\thandleClose();\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.visible !== newValue) state.visible = newValue;\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => state.visible,\n\t\t\t(newValue) => {\n\t\t\t\tif (props.modelValue !== newValue) emit(\"update:modelValue\", newValue);\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.size,\n\t\t\t(newValue) => {\n\t\t\t\tif (newValue !== undefined) state.size = newValue;\n\t\t\t}\n\t\t);\n\n\t\tconst handleDraggablePointermove = (event: PointerEvent): void => {\n\t\t\tconst horizontal = props.direction === \"rtl\" || props.direction === \"ltr\";\n\t\t\tconst viewportSize = horizontal ? document.documentElement.clientWidth : document.documentElement.clientHeight;\n\t\t\tlet nextSize: number;\n\t\t\tswitch (props.direction) {\n\t\t\t\tcase \"ltr\":\n\t\t\t\t\tnextSize = event.clientX;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"ttb\":\n\t\t\t\t\tnextSize = event.clientY;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"btt\":\n\t\t\t\t\tnextSize = viewportSize - event.clientY;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tnextSize = viewportSize - event.clientX;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstate.size = `${Math.min(Math.max(nextSize, viewportSize * 0.2), viewportSize * 0.95).toString()}px`;\n\t\t};\n\n\t\tconst stopDraggable = (): void => {\n\t\t\tstate.dragging = false;\n\t\t\tdocument.removeEventListener(\"pointermove\", handleDraggablePointermove);\n\t\t\tdocument.removeEventListener(\"pointerup\", stopDraggable);\n\t\t};\n\n\t\tconst handleDraggablePointerdown = (event: PointerEvent): void => {\n\t\t\tevent.preventDefault();\n\t\t\tstate.dragging = true;\n\t\t\tdocument.addEventListener(\"pointermove\", handleDraggablePointermove);\n\t\t\tdocument.addEventListener(\"pointerup\", stopDraggable, { once: true });\n\t\t};\n\n\t\tonBeforeUnmount(stopDraggable);\n\n\t\tconst elDrawerProps = useProps(props, drawerProps, [\"modelValue\", \"size\", \"showClose\", \"beforeClose\"]);\n\t\t// open、close 是 Fast 异步业务流程完成事件,不直接透传 Element Plus 的同名生命周期事件。\n\t\tconst elDrawerEmits = useEmits(drawerEmits, emit, [\"open\", \"close\", \"update:modelValue\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElDrawer\n\t\t\t\t{...elDrawerProps.value}\n\t\t\t\t{...elDrawerEmits.value}\n\t\t\t\tref={drawerRef}\n\t\t\t\tclass={[\n\t\t\t\t\t\"fa-drawer\",\n\t\t\t\t\t`fa-drawer-${_globalSize.value}`,\n\t\t\t\t\t{ \"fa-drawer__fullscreen\": state.fullscreen, \"fa-drawer__dragging\": state.dragging },\n\t\t\t\t]}\n\t\t\t\tvModel={state.visible}\n\t\t\t\tsize={state.size}\n\t\t\t\tshowClose={false}\n\t\t\t\tbeforeClose={handleBeforeClose}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\theader: ({ titleId, titleClass }: { close: () => void; titleId: string; titleClass: string }) => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div id={titleId} class={[\"fa-drawer__header-title\", titleClass]}>\n\t\t\t\t\t\t\t\t{slots.title?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass }) ?? props.title}\n\t\t\t\t\t\t\t\t{slots.header?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass })}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{props.showRefresh && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"刷新\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-drawer__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleRefresh}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t\t<Refresh />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showFullscreen && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={state.fullscreen ? \"关闭全屏显示\" : \"全屏显示\"}\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-drawer__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleFullscreen}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>{state.fullscreen ? <FullScreenExit /> : <FullScreen />}</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showClose && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"关闭\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-drawer__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleCloseClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t{props.draggable && <div class=\"fa-drawer__draggable\" onPointerdown={handleDraggablePointerdown} />}\n\t\t\t\t\t\t\t<ElScrollbar vLoading={state.loading} element-loading-text=\"加载中...\">\n\t\t\t\t\t\t\t\t{!state.refreshing && slots.default?.(state)}\n\t\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\t...(!props.hideFooter && {\n\t\t\t\t\t\tfooter: (): VNode[] => [\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{slots.footer?.({ loading: state.loading, close: handleCloseClick })}\n\t\t\t\t\t\t\t\t{props.showCloseButton && (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.loading} onClick={handleCloseClick}>\n\t\t\t\t\t\t\t\t\t\t{props.closeButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.showConfirmButton && (\n\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\tloadingIcon={Eleme}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabledConfirmButton}\n\t\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{state.loading ? \"加载中...\" : props.confirmButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElDrawer>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 用于关闭 Drawer, 该方法会调用传入的 before-close 方法 */\n\t\t\thandleClose: computed(() => drawerRef.value?.handleClose),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 是否显示 */\n\t\t\tvisible: computed(() => state.visible),\n\t\t\t/** @description 打开弹窗 */\n\t\t\topen: handleOpen,\n\t\t\t/** @description 关闭弹窗 */\n\t\t\tclose: handleClose,\n\t\t\t/** @description 刷新弹窗 */\n\t\t\trefresh: handleRefresh,\n\t\t\t/** @description 弹窗加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AASA,MAAa,gBAAgB;CAC5B,GAAG;;CAEH,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,WAAW;EACV,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EAClB,MAAM;EACN,SAAS;CACV;;CAEA,uBAAuB;;CAEvB,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EAClB,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;;CAEZ,iBAAiB;;CAEjB,WAAW,EACV,MAAM,eAA2B,QAAQ,EAC1C;AACD;;AAGA,MAAa,gBAAgB;CAC5B,GAAG;;CAEH,sBAAsB,UAA4B,UAAU,KAAK;;CAEjE,oBAA6B;AAC9B;AAcA,IAAA,iBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAAyB;CAChC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,cAAc,cAAc;EAElC,MAAM,QAAQ,SAAS;GACtB,SAAS;GACT,SAAS,MAAM;GACf,YAAY;GACZ,MAAM,MAAM,QAAQ;GACpB,UAAU;GACV,YAAY;EACb,CAAC;EAED,MAAM,YAAY,IAAmC;EAErD,IAAI;EAEJ,MAAM,cAAc,iBAAoD;GACvE,MAAM,UAAU;GAChB,oBAAoB;GACpB,eAAoB;IACnB,MAAM,UAAU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OAAA;IAAA,SAAA;IAAA,iBAAqD;GAA0B,GAAA,IAAA,GAAI,eAAA,YAAA,aAAA,EAAA,wBAAA,SAAA,GAAA,EAAA,eAAA,CAEjG,CAAC,MAAM,cAAc,MAAM,UAAU,KAAK,CAAC,EAAA,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GADtB,MAAM,OAAO,CAAA,CAAA,CAAA,CAAA;GAKtC,GAAI,CAAC,MAAM,cAAc,EACxB,cAAuB,CAAA,YAAA,UAAA,MAAA;IAEpB,MAAM,SAAS;KAAE,SAAS,MAAM;KAAS,OAAO;IAAiB,CAAC;IAClE,MAAM,mBAAe,YAAA,UAAA;KAAA,YACD,MAAM;KAAO,WAAW;IAAgB,GAAA,EAAA,eAAA,CAC1D,MAAM,eAAe,EAAA,CAAA;IAGvB,MAAM,qBAAiB,YAAA,UAAA;KAAA,WAEb,MAAM;KAAO,eACT;KAAK,YACR,MAAM;KAAqB,QAAA;KAAA,WAE5B;IAAkB,GAAA,EAAA,eAAA,CAE1B,MAAM,UAAU,WAAW,MAAM,iBAAiB,EAAA,CAAA;GAEpD,CAAA,CAAA,EAGJ;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS,eAAe,MAAM,OAAO;;GAErC,MAAM;;GAEN,OAAO;;GAEP,SAAS;;GAET,WAAW;EACZ,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"drawer.mjs","names":["update:modelValue"],"sources":["../../../../src/components/drawer/src/drawer.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, nextTick, onBeforeUnmount, reactive, ref, watch } from \"vue\";\nimport { Close, Eleme, Refresh } from \"@element-plus/icons-vue\";\nimport { ElButton, ElDrawer, ElIcon, ElMessage, ElMessageBox, ElScrollbar, drawerEmits, drawerProps, useGlobalSize } from \"element-plus\";\nimport { FullScreen, FullScreenExit } from \"@fast-element-plus/icons-vue\";\nimport { isBoolean } from \"lodash-unified\";\nimport { callOptionalFunction, definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { VNode } from \"vue\";\n\n/** FaDrawer 的运行时 Props 定义。 */\nexport const faDrawerProps = {\n\t...drawerProps,\n\t/** @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true` */\n\tappendToBody: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description enable dragging feature for Dialog */\n\tdraggable: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description destroy elements in Dialog when closed */\n\tdestroyOnClose: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示刷新按钮 */\n\tshowRefresh: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示全屏图标 */\n\tshowFullscreen: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示关闭按钮 */\n\tshowCloseButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 显示确认按钮 */\n\tshowConfirmButton: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 禁用确认按钮 */\n\tdisabledConfirmButton: Boolean,\n\t/** @description 关闭按钮文字,默认取消 */\n\tcloseButtonText: {\n\t\ttype: String,\n\t\tdefault: \"取消\",\n\t},\n\t/** @description 确认按钮文字,默认确认 */\n\tconfirmButtonText: {\n\t\ttype: String,\n\t\tdefault: \"确认\",\n\t},\n\t/** @description 隐藏底部操作 */\n\thideFooter: Boolean,\n\t/** @description 显示关闭回调 */\n\tshowBeforeClose: Boolean,\n\t/** @description 打开之后 */\n\tafterOpen: {\n\t\ttype: definePropType<() => void | Promise<void>>(Function),\n\t},\n};\n\n/** FaDrawer 的运行时 Emits 定义。 */\nexport const faDrawerEmits = {\n\t...drawerEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: boolean): boolean => isBoolean(value),\n\t/** @description 确认按钮点击事件 */\n\tconfirmClick: (): boolean => true,\n};\n\n/** FaDrawer 的插槽参数。 */\nexport interface FaDrawerSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { loading: boolean };\n\t/** @description 头部插槽 */\n\theader: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 标题插槽 */\n\ttitle: { loading: boolean; close: () => void; titleId: string; titleClass: string };\n\t/** @description 底部插槽 */\n\tfooter: { loading: boolean; close: () => void };\n}\n\nexport default defineComponent({\n\tname: \"FaDrawer\",\n\tprops: faDrawerProps,\n\temits: faDrawerEmits,\n\tslots: makeSlots<FaDrawerSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tloading: false,\n\t\t\tvisible: false,\n\t\t\tfullscreen: false,\n\t\t\tsize: props.size ?? \"30%\",\n\t\t\tdragging: false,\n\t\t\trefreshing: false,\n\t\t});\n\n\t\tconst drawerRef = ref<InstanceType<typeof ElDrawer>>();\n\n\t\tlet cacheOpenFunction: (() => void | Promise<void>) | undefined;\n\n\t\tconst handleOpen = async (openFunction?: () => void | Promise<void>): Promise<void> => {\n\t\t\tstate.visible = true;\n\t\t\tcacheOpenFunction = openFunction;\n\t\t\tawait nextTick();\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(props.afterOpen ?? openFunction);\n\t\t\t\temit(\"open\");\n\t\t\t} catch (error) {\n\t\t\t\tstate.visible = false;\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleClose = async (closeFunction?: () => void | Promise<void>): Promise<void> => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(closeFunction);\n\t\t\t\temit(\"close\");\n\t\t\t\tstate.visible = false;\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleLoading = async (loadingFunction: () => void | Promise<void>): Promise<void> => {\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait callOptionalFunction(loadingFunction);\n\t\t\t} finally {\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleRefresh = async (): Promise<void> => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.refreshing = true;\n\t\t\tstate.loading = true;\n\t\t\ttry {\n\t\t\t\tawait new Promise<void>((resolve) => setTimeout(resolve, 500));\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tawait handleOpen(cacheOpenFunction);\n\t\t\t\tElMessage.success(\"刷新成功\");\n\t\t\t} finally {\n\t\t\t\tstate.refreshing = false;\n\t\t\t\tstate.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeClose = (done: () => void): void => {\n\t\t\tif (state.loading) return;\n\t\t\t// 解决 image 预览摁下 ese 会关闭弹窗的问题\n\t\t\tif (document.querySelector(\".el-image-viewer__wrapper\")) return;\n\n\t\t\tconst newDone = (): Promise<void> => {\n\t\t\t\t// 组件对外约定为无参数完成钩子,不采用 Element Plus 的 done 回调签名。\n\t\t\t\treturn callOptionalFunction(props.beforeClose as unknown as (() => void | PromiseLike<void>) | undefined).then(() => {\n\t\t\t\t\temit(\"close\");\n\t\t\t\t\tdone();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tif (props.showBeforeClose) {\n\t\t\t\t// 用户取消关闭属于正常分支,无需继续执行 beforeClose。\n\t\t\t\tvoid ElMessageBox.confirm(\"确定关闭?\", { type: \"warning\" }).then(() => newDone());\n\t\t\t} else {\n\t\t\t\tvoid newDone();\n\t\t\t}\n\t\t};\n\n\t\tconst handleFullscreen = (): void => {\n\t\t\tif (state.loading) return;\n\t\t\tstate.fullscreen = !state.fullscreen;\n\t\t};\n\n\t\tconst handleConfirmClick = (): void => {\n\t\t\tif (state.loading) return;\n\t\t\temit(\"confirmClick\");\n\t\t};\n\n\t\tconst handleCloseClick = (): void => {\n\t\t\tif (state.loading) return;\n\t\t\tvoid handleClose();\n\t\t};\n\n\t\twatch(\n\t\t\t() => state.visible,\n\t\t\t(newValue) => {\n\t\t\t\temit(\"update:modelValue\", newValue);\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.size,\n\t\t\t(newValue) => {\n\t\t\t\tif (newValue !== undefined) state.size = newValue;\n\t\t\t}\n\t\t);\n\n\t\tconst handleDraggablePointermove = (event: PointerEvent): void => {\n\t\t\tconst horizontal = props.direction === \"rtl\" || props.direction === \"ltr\";\n\t\t\tconst viewportSize = horizontal ? document.documentElement.clientWidth : document.documentElement.clientHeight;\n\t\t\tlet nextSize: number;\n\t\t\tswitch (props.direction) {\n\t\t\t\tcase \"ltr\":\n\t\t\t\t\tnextSize = event.clientX;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"ttb\":\n\t\t\t\t\tnextSize = event.clientY;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"btt\":\n\t\t\t\t\tnextSize = viewportSize - event.clientY;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tnextSize = viewportSize - event.clientX;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstate.size = `${Math.min(Math.max(nextSize, viewportSize * 0.2), viewportSize * 0.95).toString()}px`;\n\t\t};\n\n\t\tconst stopDraggable = (): void => {\n\t\t\tstate.dragging = false;\n\t\t\tdocument.removeEventListener(\"pointermove\", handleDraggablePointermove);\n\t\t\tdocument.removeEventListener(\"pointerup\", stopDraggable);\n\t\t};\n\n\t\tconst handleDraggablePointerdown = (event: PointerEvent): void => {\n\t\t\tevent.preventDefault();\n\t\t\tstate.dragging = true;\n\t\t\tdocument.addEventListener(\"pointermove\", handleDraggablePointermove);\n\t\t\tdocument.addEventListener(\"pointerup\", stopDraggable, { once: true });\n\t\t};\n\n\t\tonBeforeUnmount(stopDraggable);\n\n\t\tconst elDrawerProps = useProps(props, drawerProps, [\"modelValue\", \"size\", \"showClose\", \"beforeClose\"]);\n\t\t// open、close 是 Fast 异步业务流程完成事件,不直接透传 Element Plus 的同名生命周期事件。\n\t\tconst elDrawerEmits = useEmits(drawerEmits, emit, [\"open\", \"close\", \"update:modelValue\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElDrawer\n\t\t\t\t{...elDrawerProps.value}\n\t\t\t\t{...elDrawerEmits.value}\n\t\t\t\tref={drawerRef}\n\t\t\t\tclass={[\n\t\t\t\t\t\"fa-drawer\",\n\t\t\t\t\t`fa-drawer-${_globalSize.value}`,\n\t\t\t\t\t{ \"fa-drawer__fullscreen\": state.fullscreen, \"fa-drawer__dragging\": state.dragging },\n\t\t\t\t]}\n\t\t\t\tvModel={state.visible}\n\t\t\t\tsize={state.size}\n\t\t\t\tshowClose={false}\n\t\t\t\tbeforeClose={handleBeforeClose}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\theader: ({ titleId, titleClass }: { close: () => void; titleId: string; titleClass: string }) => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div id={titleId} class={[\"fa-drawer__header-title\", titleClass]}>\n\t\t\t\t\t\t\t\t{slots.title?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass }) ?? props.title}\n\t\t\t\t\t\t\t\t{slots.header?.({ loading: state.loading, close: handleCloseClick, titleId, titleClass })}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{props.showRefresh && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"刷新\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-drawer__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tvoid handleRefresh();\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t\t<Refresh />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showFullscreen && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle={state.fullscreen ? \"关闭全屏显示\" : \"全屏显示\"}\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-drawer__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleFullscreen}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon>{state.fullscreen ? <FullScreenExit /> : <FullScreen />}</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.showClose && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\ttitle=\"关闭\"\n\t\t\t\t\t\t\t\t\tclass={[\n\t\t\t\t\t\t\t\t\t\t\"fa-drawer__header-icon\",\n\t\t\t\t\t\t\t\t\t\tstate.loading ? \"fa__click__disabled fa__click__disabled__cursor \" : \"fa__hover__twinkle\",\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\tonClick={handleCloseClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t{props.draggable && <div class=\"fa-drawer__draggable\" onPointerdown={handleDraggablePointerdown} />}\n\t\t\t\t\t\t\t<ElScrollbar vLoading={state.loading} element-loading-text=\"加载中...\">\n\t\t\t\t\t\t\t\t{!state.refreshing && slots.default?.(state)}\n\t\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\t...(!props.hideFooter && {\n\t\t\t\t\t\tfooter: (): VNode[] => [\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{slots.footer?.({ loading: state.loading, close: handleCloseClick })}\n\t\t\t\t\t\t\t\t{props.showCloseButton && (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.loading} onClick={handleCloseClick}>\n\t\t\t\t\t\t\t\t\t\t{props.closeButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.showConfirmButton && (\n\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\tloadingIcon={Eleme}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabledConfirmButton}\n\t\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{state.loading ? \"加载中...\" : props.confirmButtonText}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t\t],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElDrawer>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 用于关闭 Drawer, 该方法会调用传入的 before-close 方法 */\n\t\t\thandleClose: computed(() => drawerRef.value?.handleClose),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 是否显示 */\n\t\t\tvisible: computed(() => state.visible),\n\t\t\t/** @description 打开弹窗 */\n\t\t\topen: handleOpen,\n\t\t\t/** @description 关闭弹窗 */\n\t\t\tclose: handleClose,\n\t\t\t/** @description 刷新弹窗 */\n\t\t\trefresh: handleRefresh,\n\t\t\t/** @description 弹窗加载 */\n\t\t\tdoLoading: handleLoading,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AASA,MAAa,gBAAgB;CAC5B,GAAG;;CAEH,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,WAAW;EACV,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,gBAAgB;EACf,MAAM;EACN,SAAS;CACV;;CAEA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EAClB,MAAM;EACN,SAAS;CACV;;CAEA,uBAAuB;;CAEvB,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EAClB,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;;CAEZ,iBAAiB;;CAEjB,WAAW,EACV,MAAM,eAA2C,QAAQ,EAC1D;AACD;;AAGA,MAAa,gBAAgB;CAC5B,GAAG;;CAEH,sBAAsB,UAA4B,UAAU,KAAK;;CAEjE,oBAA6B;AAC9B;AAcA,IAAA,iBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAAyB;CAChC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,cAAc,cAAc;EAElC,MAAM,QAAQ,SAAS;GACtB,SAAS;GACT,SAAS;GACT,YAAY;GACZ,MAAM,MAAM,QAAQ;GACpB,UAAU;GACV,YAAY;EACb,CAAC;EAED,MAAM,YAAY,IAAmC;EAErD,IAAI;E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CAAA,CAAA;GAM1B,CAAA;GAGH,eAAS,YAAA,UAAA,MAAA,CAEN,MAAM,aAAS,YAAA,OAAA;IAAA,SAAA;IAAA,iBAAqD;GAA0B,GAAA,IAAA,GAAI,eAAA,YAAA,aAAA,EAAA,wBAAA,SAAA,GAAA,EAAA,eAAA,CAEjG,CAAC,MAAM,cAAc,MAAM,UAAU,KAAK,CAAC,EAAA,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GADtB,MAAM,OAAO,CAAA,CAAA,CAAA,CAAA;GAKtC,GAAI,CAAC,MAAM,cAAc,EACxB,cAAuB,CAAA,YAAA,UAAA,MAAA;IAEpB,MAAM,SAAS;KAAE,SAAS,MAAM;KAAS,OAAO;IAAiB,CAAC;IAClE,MAAM,mBAAe,YAAA,UAAA;KAAA,YACD,MAAM;KAAO,WAAW;IAAgB,GAAA,EAAA,eAAA,CAC1D,MAAM,eAAe,EAAA,CAAA;IAGvB,MAAM,qBAAiB,YAAA,UAAA;KAAA,WAEb,MAAM;KAAO,eACT;KAAK,YACR,MAAM;KAAqB,QAAA;KAAA,WAE5B;IAAkB,GAAA,EAAA,eAAA,CAE1B,MAAM,UAAU,WAAW,MAAM,iBAAiB,EAAA,CAAA;GAEpD,CAAA,CAAA,EAGJ;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS,eAAe,MAAM,OAAO;;GAErC,MAAM;;GAEN,OAAO;;GAEP,SAAS;;GAET,WAAW;EACZ,CAAC;CACF;AACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import Form, { faFormEmits, faFormProps } from "./src/form";
2
2
  import FormItem, { faFormItemProps } from "./src/formItem";
3
- import type { TSXWithInstall } from "../../utils";
4
3
  import type { ExtractPropTypes } from "vue";
4
+ import type { TSXWithInstall } from "../../utils";
5
5
  /** 支持响应式布局和表单项配置的业务表单组件。 */
6
6
  export declare const FaForm: TSXWithInstall<typeof Form> & {
7
7
  FormItem: typeof FormItem;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Form","FormItem"],"sources":["../../../src/components/form/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from \"../../utils\";\nimport Form, { faFormEmits, faFormProps } from \"./src/form\";\nimport FormItem, { faFormItemProps } from \"./src/formItem\";\nimport type { TSXWithInstall } from \"../../utils\";\nimport type { ExtractPropTypes } from \"vue\";\n\n/** 支持响应式布局和表单项配置的业务表单组件。 */\nexport const FaForm: TSXWithInstall<typeof Form> & { FormItem: typeof FormItem } = withInstall(Form, {\n\tFormItem,\n});\nexport default FaForm;\n\n/** 可独立注册的 FaForm 表单项组件。 */\nexport const FaFormItem: TSXWithInstall<typeof FormItem> = withNoopInstall(FormItem);\n\nexport { faFormEmits, faFormProps, faFormItemProps };\nexport type { FaFormSlots } from \"./src/form\";\nexport type { FaFormItemSlots } from \"./src/formItem\";\n\n/** FaForm 暴露的组件实例类型。 */\nexport type FaFormInstance = InstanceType<typeof Form>;\n\n/** FaForm 的完整 Props 类型。 */\nexport type FaFormProps = ExtractPropTypes<typeof faFormProps>;\n\n/** FaFormItem 暴露的组件实例类型。 */\nexport type FaFormItemInstance = InstanceType<typeof FormItem>;\n\n/** FaFormItem 的完整 Props 类型。 */\nexport type FaFormItemProps = ExtractPropTypes<typeof faFormItemProps>;\n\nexport * from \"./utils/form\";\n"],"mappings":";;;;;;AAOA,MAAa,SAAsE,YAAYA,cAAM,EACpG,UAAA,iBACD,CAAC;;AAID,MAAa,aAA8C,gBAAgBC,gBAAQ"}
1
+ {"version":3,"file":"index.mjs","names":["Form","FormItem"],"sources":["../../../src/components/form/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from \"../../utils\";\nimport Form, { faFormEmits, faFormProps } from \"./src/form\";\nimport FormItem, { faFormItemProps } from \"./src/formItem\";\nimport type { ExtractPropTypes } from \"vue\";\nimport type { TSXWithInstall } from \"../../utils\";\n\n/** 支持响应式布局和表单项配置的业务表单组件。 */\nexport const FaForm: TSXWithInstall<typeof Form> & { FormItem: typeof FormItem } = withInstall(Form, {\n\tFormItem,\n});\nexport default FaForm;\n\n/** 可独立注册的 FaForm 表单项组件。 */\nexport const FaFormItem: TSXWithInstall<typeof FormItem> = withNoopInstall(FormItem);\n\nexport { faFormEmits, faFormProps, faFormItemProps };\nexport type { FaFormSlots } from \"./src/form\";\nexport type { FaFormItemSlots } from \"./src/formItem\";\n\n/** FaForm 暴露的组件实例类型。 */\nexport type FaFormInstance = InstanceType<typeof Form>;\n\n/** FaForm 的完整 Props 类型。 */\nexport type FaFormProps = ExtractPropTypes<typeof faFormProps>;\n\n/** FaFormItem 暴露的组件实例类型。 */\nexport type FaFormItemInstance = InstanceType<typeof FormItem>;\n\n/** FaFormItem 的完整 Props 类型。 */\nexport type FaFormItemProps = ExtractPropTypes<typeof faFormItemProps>;\n\nexport * from \"./utils/form\";\n"],"mappings":";;;;;;AAOA,MAAa,SAAsE,YAAYA,cAAM,EACpG,UAAA,iBACD,CAAC;;AAID,MAAa,aAA8C,gBAAgBC,gBAAQ"}
@@ -1,5 +1,5 @@
1
- import type { FaLayoutGridBreakPoint } from "../../layoutGrid";
2
1
  import type { FormItemContext, FormValidateCallback, FormValidationResult } from "element-plus";
2
+ import type { FaLayoutGridBreakPoint } from "../../layoutGrid";
3
3
  /** FaForm 的运行时 Props 定义。 */
4
4
  export declare const faFormProps: {
5
5
  /** @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported. */
@@ -60,7 +60,10 @@ export declare const faFormEmits: {
60
60
  /** FaForm 的插槽参数。 */
61
61
  export interface FaFormSlots extends Record<string, unknown> {
62
62
  /** @description 默认内容插槽 */
63
- default: unknown;
63
+ default: {
64
+ cols: Record<FaLayoutGridBreakPoint, number>;
65
+ gap: [number, number];
66
+ };
64
67
  }
65
68
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
66
69
  /** @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported. */
@@ -1 +1 @@
1
- {"version":3,"file":"form.mjs","names":[],"sources":["../../../../src/components/form/src/form.tsx"],"sourcesContent":["import { computed, defineComponent, provide, reactive, ref } from \"vue\";\nimport { ElForm, formEmits, formProps, useGlobalSize } from \"element-plus\";\nimport { isNumber, isObject } from \"lodash-unified\";\nimport { definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaLayoutGrid } from \"../../layoutGrid\";\nimport { formUtil } from \"../utils/form\";\nimport type { FaLayoutGridBreakPoint } from \"../../layoutGrid\";\nimport type { FormInstance, FormItemContext, FormValidateCallback, FormValidationResult } from \"element-plus\";\n\n/** FaForm 的运行时 Props 定义。 */\nexport const faFormProps = {\n\t...formProps,\n\t/** @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported. */\n\tlabelWidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"auto\",\n\t},\n\t/** @description Suffix of the label. */\n\tlabelSuffix: {\n\t\ttype: String,\n\t\tdefault: \":\",\n\t},\n\t/** @description When validation fails, scroll to the first error form entry. */\n\tscrollToError: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 详情From,会删除 FormItem 的 paddinfa-bottom */\n\tdetailForm: Boolean,\n\t/** @description Grid布局*/\n\tgrid: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description Grid布局列配置 */\n\tcols: {\n\t\ttype: definePropType<string | number | Record<FaLayoutGridBreakPoint, number>>([String, Number, Object]),\n\t\tdefault: (): Record<FaLayoutGridBreakPoint, number> => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t},\n};\n\n/** FaForm 的运行时事件定义。 */\nexport const faFormEmits = {\n\t...formEmits,\n};\n\n/** FaForm 的插槽参数。 */\nexport interface FaFormSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: unknown;\n}\n\nexport default defineComponent({\n\tname: \"FaForm\",\n\tprops: faFormProps,\n\temits: faFormEmits,\n\tslots: makeSlots<FaFormSlots>(),\n\tsetup(props, { slots, expose, emit }) {\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tcols: computed(() => {\n\t\t\t\tif (isObject(props.cols)) {\n\t\t\t\t\treturn props.cols;\n\t\t\t\t} else {\n\t\t\t\t\tconst colsNumber = isNumber(props.cols) ? props.cols : Number(props.cols);\n\t\t\t\t\treturn { xs: 1, sm: colsNumber, md: colsNumber, lg: colsNumber, xl: colsNumber };\n\t\t\t\t}\n\t\t\t}),\n\t\t\tgap: computed<[number, number]>(() => (_globalSize.value === \"small\" ? [15, 0] : [20, 0])),\n\t\t});\n\n\t\tconst formRef = ref<FormInstance>();\n\n\t\t// 注入 cols\n\t\tprovide(\"faFormCols\", state.cols);\n\n\t\tconst elFormProps = useProps(props, formProps);\n\t\tconst elFormEmits = useEmits(formEmits, emit);\n\n\t\tuseRender(() => (\n\t\t\t<ElForm\n\t\t\t\t{...elFormProps.value}\n\t\t\t\t{...elFormEmits.value}\n\t\t\t\tref={formRef}\n\t\t\t\tclass={[\"fa-form\", `fa-form-${_globalSize.value}`, { [`fa-form-detail fa-form-detail_${_globalSize.value}`]: props.detailForm }]}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tprops.grid ? (\n\t\t\t\t\t\t\t<FaLayoutGrid collapsed gap={state.gap} cols={state.cols}>\n\t\t\t\t\t\t\t\t{slots.default?.(state)}\n\t\t\t\t\t\t\t</FaLayoutGrid>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tslots.default?.(state)\n\t\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElForm>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 对整个表单的内容进行验证。 接收一个回调函数,或返回 Promise。 */\n\t\t\tvalidate: (callback?: FormValidateCallback): FormValidationResult =>\n\t\t\t\tcallback ? (formRef.value?.validate(callback) ?? Promise.reject(new Error(\"ElForm 实例尚未挂载。\"))) : formUtil.validate(formRef),\n\t\t\t/** @description 验证具体的某个字段。 */\n\t\t\tvalidateField: computed(() => formRef.value?.validateField),\n\t\t\t/** @description 重置该表单项,将其值重置为初始值,并移除校验结果 */\n\t\t\tresetFields: computed(() => formRef.value?.resetFields),\n\t\t\t/** @description 清理某个字段的表单验证信息。 */\n\t\t\tclearValidate: computed(() => formRef.value?.clearValidate),\n\t\t\t/** @description 滚动到指定的字段 */\n\t\t\tscrollToField: computed(() => formRef.value?.scrollToField),\n\t\t\t/** @description 获取所有字段的 context */\n\t\t\tfields: computed(() => formRef.value?.fields as FormItemContext[]),\n\t\t\t/** @description 获取指定字段的 context。 */\n\t\t\tgetField: computed(() => formRef.value?.getField),\n\t\t\t/** @description 设置表单字段的初始值。 */\n\t\t\tsetInitialValues: computed(() => formRef.value?.setInitialValues),\n\t\t\t/** @description 对整个表单的内容进行验证,带滚动。 接收一个回调函数,或返回 Promise。 */\n\t\t\tvalidateScrollToField: (): FormValidationResult => formUtil.validateScrollToField(formRef),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAUA,MAAa,cAAc;CAC1B,GAAG;;CAEH,YAAY;EACX,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,eAAe;EACd,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;;CAEZ,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,MAAM;EACL,MAAM,eAAyE;GAAC;GAAQ;GAAQ;EAAM,CAAC;EACvG,gBAAwD;GAAE,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,IAAI;EAAE;CAC7F;AACD;;AAGA,MAAa,cAAc,EAC1B,GAAG,UACJ;AAQA,IAAA,eAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAAu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AAa;;GAE1D,QAAQ,eAAe,QAAQ,OAAO,MAA2B;;GAEjE,UAAU,eAAe,QAAQ,OAAO,QAAQ;;GAEhD,kBAAkB,eAAe,QAAQ,OAAO,gBAAgB;;GAEhE,6BAAmD,SAAS,sBAAsB,OAAO;EAC1F,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"form.mjs","names":[],"sources":["../../../../src/components/form/src/form.tsx"],"sourcesContent":["import { computed, defineComponent, provide, reactive, ref } from \"vue\";\nimport { ElForm, formEmits, formProps, useGlobalSize } from \"element-plus\";\nimport { isNumber, isObject } from \"lodash-unified\";\nimport { definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaLayoutGrid } from \"../../layoutGrid\";\nimport { formUtil } from \"../utils/form\";\nimport type { FormInstance, FormItemContext, FormValidateCallback, FormValidationResult } from \"element-plus\";\nimport type { FaLayoutGridBreakPoint } from \"../../layoutGrid\";\n\n/** FaForm 的运行时 Props 定义。 */\nexport const faFormProps = {\n\t...formProps,\n\t/** @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported. */\n\tlabelWidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"auto\",\n\t},\n\t/** @description Suffix of the label. */\n\tlabelSuffix: {\n\t\ttype: String,\n\t\tdefault: \":\",\n\t},\n\t/** @description When validation fails, scroll to the first error form entry. */\n\tscrollToError: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 详情From,会删除 FormItem 的 paddinfa-bottom */\n\tdetailForm: Boolean,\n\t/** @description Grid布局*/\n\tgrid: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description Grid布局列配置 */\n\tcols: {\n\t\ttype: definePropType<string | number | Record<FaLayoutGridBreakPoint, number>>([String, Number, Object]),\n\t\tdefault: (): Record<FaLayoutGridBreakPoint, number> => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t},\n};\n\n/** FaForm 的运行时事件定义。 */\nexport const faFormEmits = {\n\t...formEmits,\n};\n\n/** FaForm 的插槽参数。 */\nexport interface FaFormSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { cols: Record<FaLayoutGridBreakPoint, number>; gap: [number, number] };\n}\n\nexport default defineComponent({\n\tname: \"FaForm\",\n\tprops: faFormProps,\n\temits: faFormEmits,\n\tslots: makeSlots<FaFormSlots>(),\n\tsetup(props, { slots, expose, emit }) {\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tcols: computed(() => {\n\t\t\t\tif (isObject(props.cols)) {\n\t\t\t\t\treturn props.cols;\n\t\t\t\t} else {\n\t\t\t\t\tconst colsNumber = isNumber(props.cols) ? props.cols : Number(props.cols);\n\t\t\t\t\treturn { xs: 1, sm: colsNumber, md: colsNumber, lg: colsNumber, xl: colsNumber };\n\t\t\t\t}\n\t\t\t}),\n\t\t\tgap: computed<[number, number]>(() => (_globalSize.value === \"small\" ? [15, 0] : [20, 0])),\n\t\t});\n\n\t\tconst formRef = ref<FormInstance>();\n\n\t\t// 注入 cols\n\t\tprovide(\"faFormCols\", state.cols);\n\n\t\tconst elFormProps = useProps(props, formProps);\n\t\tconst elFormEmits = useEmits(formEmits, emit);\n\n\t\tuseRender(() => (\n\t\t\t<ElForm\n\t\t\t\t{...elFormProps.value}\n\t\t\t\t{...elFormEmits.value}\n\t\t\t\tref={formRef}\n\t\t\t\tclass={[\"fa-form\", `fa-form-${_globalSize.value}`, { [`fa-form-detail fa-form-detail_${_globalSize.value}`]: props.detailForm }]}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tprops.grid ? (\n\t\t\t\t\t\t\t<FaLayoutGrid collapsed gap={state.gap} cols={state.cols}>\n\t\t\t\t\t\t\t\t{slots.default?.(state)}\n\t\t\t\t\t\t\t</FaLayoutGrid>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tslots.default?.(state)\n\t\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElForm>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 对整个表单的内容进行验证。 接收一个回调函数,或返回 Promise。 */\n\t\t\tvalidate: (callback?: FormValidateCallback): FormValidationResult =>\n\t\t\t\tcallback ? (formRef.value?.validate(callback) ?? Promise.reject(new Error(\"ElForm 实例尚未挂载。\"))) : formUtil.validate(formRef),\n\t\t\t/** @description 验证具体的某个字段。 */\n\t\t\tvalidateField: computed(() => formRef.value?.validateField),\n\t\t\t/** @description 重置该表单项,将其值重置为初始值,并移除校验结果 */\n\t\t\tresetFields: computed(() => formRef.value?.resetFields),\n\t\t\t/** @description 清理某个字段的表单验证信息。 */\n\t\t\tclearValidate: computed(() => formRef.value?.clearValidate),\n\t\t\t/** @description 滚动到指定的字段 */\n\t\t\tscrollToField: computed(() => formRef.value?.scrollToField),\n\t\t\t/** @description 获取所有字段的 context */\n\t\t\tfields: computed(() => formRef.value?.fields as FormItemContext[]),\n\t\t\t/** @description 获取指定字段的 context。 */\n\t\t\tgetField: computed(() => formRef.value?.getField),\n\t\t\t/** @description 设置表单字段的初始值。 */\n\t\t\tsetInitialValues: computed(() => formRef.value?.setInitialValues),\n\t\t\t/** @description 对整个表单的内容进行验证,带滚动。 接收一个回调函数,或返回 Promise。 */\n\t\t\tvalidateScrollToField: (): FormValidationResult => formUtil.validateScrollToField(formRef),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAUA,MAAa,cAAc;CAC1B,GAAG;;CAEH,YAAY;EACX,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,eAAe;EACd,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;;CAEZ,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,MAAM;EACL,MAAM,eAAyE;GAAC;GAAQ;GAAQ;EAAM,CAAC;EACvG,gBAAwD;GAAE,IAAI;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AC,IAAK,SAAS,SAAS,OAAO;;GAE1H,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,QAAQ,eAAe,QAAQ,OAAO,MAA2B;;GAEjE,UAAU,eAAe,QAAQ,OAAO,QAAQ;;GAEhD,kBAAkB,eAAe,QAAQ,OAAO,gBAAgB;;GAEhE,6BAAmD,SAAS,sBAAsB,OAAO;EAC1F,CAAC;CACF;AACD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import FormItemTip, { faFormItemTipProps } from "./src/formItemTip";
2
- import type { TSXWithInstall } from "../../utils";
3
2
  import type { ExtractPropTypes } from "vue";
3
+ import type { TSXWithInstall } from "../../utils";
4
4
  /** 为表单项标签提供补充说明的提示组件。 */
5
5
  export declare const FaFormItemTip: TSXWithInstall<typeof FormItemTip>;
6
6
  export default FaFormItemTip;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["FormItemTip"],"sources":["../../../src/components/formItemTip/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport FormItemTip, { faFormItemTipProps } from \"./src/formItemTip\";\nimport type { TSXWithInstall } from \"../../utils\";\nimport type { ExtractPropTypes } from \"vue\";\n\n/** 为表单项标签提供补充说明的提示组件。 */\nexport const FaFormItemTip: TSXWithInstall<typeof FormItemTip> = withInstall(FormItemTip);\nexport default FaFormItemTip;\n\nexport { faFormItemTipProps };\nexport type { FaFormItemTipSlots } from \"./src/formItemTip\";\n\n/** FaFormItemTip 暴露的组件实例类型。 */\nexport type FaFormItemTipInstance = InstanceType<typeof FormItemTip>;\n\n/** FaFormItemTip 的完整 Props 类型。 */\nexport type FaFormItemTipProps = ExtractPropTypes<typeof faFormItemTipProps>;\n"],"mappings":";;;;AAMA,MAAa,gBAAoD,YAAYA,mBAAW"}
1
+ {"version":3,"file":"index.mjs","names":["FormItemTip"],"sources":["../../../src/components/formItemTip/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport FormItemTip, { faFormItemTipProps } from \"./src/formItemTip\";\nimport type { ExtractPropTypes } from \"vue\";\nimport type { TSXWithInstall } from \"../../utils\";\n\n/** 为表单项标签提供补充说明的提示组件。 */\nexport const FaFormItemTip: TSXWithInstall<typeof FormItemTip> = withInstall(FormItemTip);\nexport default FaFormItemTip;\n\nexport { faFormItemTipProps };\nexport type { FaFormItemTipSlots } from \"./src/formItemTip\";\n\n/** FaFormItemTip 暴露的组件实例类型。 */\nexport type FaFormItemTipInstance = InstanceType<typeof FormItemTip>;\n\n/** FaFormItemTip 的完整 Props 类型。 */\nexport type FaFormItemTipProps = ExtractPropTypes<typeof faFormItemTipProps>;\n"],"mappings":";;;;AAMA,MAAa,gBAAoD,YAAYA,mBAAW"}
@@ -1,7 +1,7 @@
1
1
  import Icon from "./src/icon";
2
- import type { faIconProps } from "./src/icon";
3
- import type { TSXWithInstall } from "../../utils";
4
2
  import type { ExtractPropTypes } from "vue";
3
+ import type { TSXWithInstall } from "../../utils";
4
+ import type { faIconProps } from "./src/icon";
5
5
  /** 按名称或组件渲染图标的统一图标组件。 */
6
6
  export declare const FaIcon: TSXWithInstall<typeof Icon>;
7
7
  export default FaIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Icon"],"sources":["../../../src/components/icon/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport Icon from \"./src/icon\";\nimport type { faIconProps } from \"./src/icon\";\nimport type { TSXWithInstall } from \"../../utils\";\nimport type { ExtractPropTypes } from \"vue\";\n\n/** 按名称或组件渲染图标的统一图标组件。 */\nexport const FaIcon: TSXWithInstall<typeof Icon> = withInstall(Icon);\nexport default FaIcon;\n\nexport { faIconProps } from \"./src/icon\";\n\n/** FaIcon 暴露的组件实例类型。 */\nexport type FaIconInstance = InstanceType<typeof Icon>;\n\n/** FaIcon 的完整 Props 类型。 */\nexport type FaIconProps = ExtractPropTypes<typeof faIconProps>;\n"],"mappings":";;;;AAOA,MAAa,SAAsC,YAAYA,YAAI"}
1
+ {"version":3,"file":"index.mjs","names":["Icon"],"sources":["../../../src/components/icon/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport Icon from \"./src/icon\";\nimport type { ExtractPropTypes } from \"vue\";\nimport type { TSXWithInstall } from \"../../utils\";\nimport type { faIconProps } from \"./src/icon\";\n\n/** 按名称或组件渲染图标的统一图标组件。 */\nexport const FaIcon: TSXWithInstall<typeof Icon> = withInstall(Icon);\nexport default FaIcon;\n\nexport { faIconProps } from \"./src/icon\";\n\n/** FaIcon 暴露的组件实例类型。 */\nexport type FaIconInstance = InstanceType<typeof Icon>;\n\n/** FaIcon 的完整 Props 类型。 */\nexport type FaIconProps = ExtractPropTypes<typeof faIconProps>;\n"],"mappings":";;;;AAOA,MAAa,SAAsC,YAAYA,YAAI"}
@@ -1,6 +1,6 @@
1
1
  import Image, { faImageEmits, faImageProps } from "./src/image";
2
- import type { TSXWithInstall } from "../../utils";
3
2
  import type { ExtractPropTypes } from "vue";
3
+ import type { TSXWithInstall } from "../../utils";
4
4
  /** 支持占位、失败回退和地址处理的图片组件。 */
5
5
  export declare const FaImage: TSXWithInstall<typeof Image>;
6
6
  export default FaImage;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Image"],"sources":["../../../src/components/image/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport Image, { faImageEmits, faImageProps } from \"./src/image\";\nimport type { TSXWithInstall } from \"../../utils\";\nimport type { ExtractPropTypes } from \"vue\";\n\n/** 支持占位、失败回退和地址处理的图片组件。 */\nexport const FaImage: TSXWithInstall<typeof Image> = withInstall(Image);\nexport default FaImage;\n\nexport { faImageEmits, faImageProps };\nexport type { FaImageSlots } from \"./src/image\";\n\n/** FaImage 暴露的组件实例类型。 */\nexport type FaImageInstance = InstanceType<typeof Image>;\n\n/** FaImage 的完整 Props 类型。 */\nexport type FaImageProps = ExtractPropTypes<typeof faImageProps>;\n"],"mappings":";;;;AAMA,MAAa,UAAwC,YAAYA,aAAK"}
1
+ {"version":3,"file":"index.mjs","names":["Image"],"sources":["../../../src/components/image/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport Image, { faImageEmits, faImageProps } from \"./src/image\";\nimport type { ExtractPropTypes } from \"vue\";\nimport type { TSXWithInstall } from \"../../utils\";\n\n/** 支持占位、失败回退和地址处理的图片组件。 */\nexport const FaImage: TSXWithInstall<typeof Image> = withInstall(Image);\nexport default FaImage;\n\nexport { faImageEmits, faImageProps };\nexport type { FaImageSlots } from \"./src/image\";\n\n/** FaImage 暴露的组件实例类型。 */\nexport type FaImageInstance = InstanceType<typeof Image>;\n\n/** FaImage 的完整 Props 类型。 */\nexport type FaImageProps = ExtractPropTypes<typeof faImageProps>;\n"],"mappings":";;;;AAMA,MAAa,UAAwC,YAAYA,aAAK"}
@@ -1,6 +1,6 @@
1
1
  import InputDialogPage, { faInputDialogPageEmits, faInputDialogPageProps } from "./src/inputDialogPage";
2
- import type { TSXWithInstall } from "../../utils";
3
2
  import type { ExtractPropTypes } from "vue";
3
+ import type { TSXWithInstall } from "../../utils";
4
4
  /** 在对话框中提供分页选择与输入交互的组件。 */
5
5
  export declare const FaInputDialogPage: TSXWithInstall<typeof InputDialogPage>;
6
6
  export default FaInputDialogPage;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["InputDialogPage"],"sources":["../../../src/components/inputDialogPage/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport InputDialogPage, { faInputDialogPageEmits, faInputDialogPageProps } from \"./src/inputDialogPage\";\nimport type { TSXWithInstall } from \"../../utils\";\nimport type { ExtractPropTypes } from \"vue\";\n\n/** 在对话框中提供分页选择与输入交互的组件。 */\nexport const FaInputDialogPage: TSXWithInstall<typeof InputDialogPage> = withInstall(InputDialogPage);\nexport default FaInputDialogPage;\n\nexport { faInputDialogPageProps, faInputDialogPageEmits };\nexport type { FaInputDialogPageSlots } from \"./src/inputDialogPage\";\n\n/** FaInputDialogPage 暴露的组件实例类型。 */\nexport type FaInputDialogPageInstance = InstanceType<typeof InputDialogPage>;\n\n/** FaInputDialogPage 的完整 Props 类型。 */\nexport type FaInputDialogPageProps = ExtractPropTypes<typeof faInputDialogPageProps>;\n\n/** FaInputDialogPage 的 Emits 类型。 */\nexport type FaInputDialogPageEmits = typeof faInputDialogPageEmits;\n"],"mappings":";;;;AAMA,MAAa,oBAA4D,YAAYA,uBAAe"}
1
+ {"version":3,"file":"index.mjs","names":["InputDialogPage"],"sources":["../../../src/components/inputDialogPage/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport InputDialogPage, { faInputDialogPageEmits, faInputDialogPageProps } from \"./src/inputDialogPage\";\nimport type { ExtractPropTypes } from \"vue\";\nimport type { TSXWithInstall } from \"../../utils\";\n\n/** 在对话框中提供分页选择与输入交互的组件。 */\nexport const FaInputDialogPage: TSXWithInstall<typeof InputDialogPage> = withInstall(InputDialogPage);\nexport default FaInputDialogPage;\n\nexport { faInputDialogPageProps, faInputDialogPageEmits };\nexport type { FaInputDialogPageSlots } from \"./src/inputDialogPage\";\n\n/** FaInputDialogPage 暴露的组件实例类型。 */\nexport type FaInputDialogPageInstance = InstanceType<typeof InputDialogPage>;\n\n/** FaInputDialogPage 的完整 Props 类型。 */\nexport type FaInputDialogPageProps = ExtractPropTypes<typeof faInputDialogPageProps>;\n\n/** FaInputDialogPage 的 Emits 类型。 */\nexport type FaInputDialogPageEmits = typeof faInputDialogPageEmits;\n"],"mappings":";;;;AAMA,MAAa,oBAA4D,YAAYA,uBAAe"}
@@ -1,11 +1,11 @@
1
- import { type PagedInput, type PagedResult } from "../../table";
2
1
  import type { TableProps } from "element-plus";
3
2
  import type { PropType } from "vue";
3
+ import type { DefaultRow, PagedInput, PagedResult } from "../../table";
4
4
  /** FaInputDialogPage 的运行时 Props 定义。 */
5
5
  export declare const faInputDialogPageProps: {
6
6
  /** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */
7
7
  rowKey: {
8
- type: PropType<TableProps<Record<string, unknown>>["rowKey"]>;
8
+ type: PropType<TableProps<DefaultRow>["rowKey"]>;
9
9
  default: string;
10
10
  };
11
11
  /** @description v-model绑定值 */
@@ -23,10 +23,10 @@ export declare const faInputDialogPageProps: {
23
23
  title: StringConstructor;
24
24
  /** @description 请求api */
25
25
  requestApi: {
26
- type: PropType<(params?: PagedInput) => Promise<PagedResult | Record<string, unknown>[]>>;
26
+ type: PropType<(params?: PagedInput) => Promise<PagedResult | DefaultRow[]>>;
27
27
  };
28
28
  /** 初始化参数 */
29
- initParam: PropType<unknown>;
29
+ initParam: PropType<string | number | PagedInput>;
30
30
  /** @description 显示文本 Key */
31
31
  labelKey: {
32
32
  type: StringConstructor;
@@ -40,7 +40,7 @@ export declare const faInputDialogPageEmits: {
40
40
  /** @description v-model:label 回调 */
41
41
  "update:label": (value: string | null) => boolean;
42
42
  /** @description 改变 */
43
- change: (_data: unknown, _value?: string | number | null) => boolean;
43
+ change: (_data: DefaultRow | null, _value?: string | number | null) => boolean;
44
44
  };
45
45
  /** FaInputDialogPage 的插槽参数。 */
46
46
  export interface FaInputDialogPageSlots extends Record<string, unknown> {
@@ -50,7 +50,7 @@ export interface FaInputDialogPageSlots extends Record<string, unknown> {
50
50
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
51
51
  /** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */
52
52
  rowKey: {
53
- type: PropType<TableProps<Record<string, unknown>>["rowKey"]>;
53
+ type: PropType<TableProps<DefaultRow>["rowKey"]>;
54
54
  default: string;
55
55
  };
56
56
  /** @description v-model绑定值 */
@@ -68,10 +68,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
68
68
  title: StringConstructor;
69
69
  /** @description 请求api */
70
70
  requestApi: {
71
- type: PropType<(params?: PagedInput) => Promise<PagedResult | Record<string, unknown>[]>>;
71
+ type: PropType<(params?: PagedInput) => Promise<PagedResult | DefaultRow[]>>;
72
72
  };
73
73
  /** 初始化参数 */
74
- initParam: PropType<unknown>;
74
+ initParam: PropType<string | number | PagedInput>;
75
75
  /** @description 显示文本 Key */
76
76
  labelKey: {
77
77
  type: StringConstructor;
@@ -79,9 +79,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
79
79
  };
80
80
  }>, {
81
81
  /** @description 选择行数据 */
82
- selectionRow: import("vue").ComputedRef<Record<string, unknown>>;
82
+ selectionRow: import("vue").ComputedRef<DefaultRow>;
83
83
  /** @description 打开选择器弹窗 */
84
- open: () => void;
84
+ open: () => Promise<void>;
85
85
  /** @description 清除选择 */
86
86
  clear: () => void;
87
87
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -90,11 +90,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
90
90
  /** @description v-model:label 回调 */
91
91
  "update:label": (value: string | null) => boolean;
92
92
  /** @description 改变 */
93
- change: (_data: unknown, _value?: string | number | null) => boolean;
93
+ change: (_data: DefaultRow | null, _value?: string | number | null) => boolean;
94
94
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
95
95
  /** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */
96
96
  rowKey: {
97
- type: PropType<TableProps<Record<string, unknown>>["rowKey"]>;
97
+ type: PropType<TableProps<DefaultRow>["rowKey"]>;
98
98
  default: string;
99
99
  };
100
100
  /** @description v-model绑定值 */
@@ -112,23 +112,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
112
112
  title: StringConstructor;
113
113
  /** @description 请求api */
114
114
  requestApi: {
115
- type: PropType<(params?: PagedInput) => Promise<PagedResult | Record<string, unknown>[]>>;
115
+ type: PropType<(params?: PagedInput) => Promise<PagedResult | DefaultRow[]>>;
116
116
  };
117
117
  /** 初始化参数 */
118
- initParam: PropType<unknown>;
118
+ initParam: PropType<string | number | PagedInput>;
119
119
  /** @description 显示文本 Key */
120
120
  labelKey: {
121
121
  type: StringConstructor;
122
122
  default: string;
123
123
  };
124
124
  }>> & Readonly<{
125
- onChange?: ((_data: unknown, _value?: string | number | null | undefined) => any) | undefined;
125
+ onChange?: ((_data: DefaultRow | null, _value?: string | number | null | undefined) => any) | undefined;
126
126
  "onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
127
127
  "onUpdate:label"?: ((value: string | null) => any) | undefined;
128
128
  }>, {
129
129
  disabled: boolean;
130
130
  placeholder: string;
131
- rowKey: string | ((row: Record<string, unknown>) => string) | undefined;
131
+ rowKey: string | ((row: DefaultRow) => string) | undefined;
132
132
  labelKey: string;
133
133
  }, import("../../../utils").TypedSlotsDeclaration<FaInputDialogPageSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
134
134
  export default _default;
@@ -70,8 +70,8 @@ var inputDialogPage_default = defineComponent({
70
70
  selectedLabel.value = null;
71
71
  emit("change", null);
72
72
  };
73
- const handleSearchClick = () => {
74
- faDialogRef.value?.open(() => {
73
+ const handleSearchClick = async () => {
74
+ await faDialogRef.value?.open(() => {
75
75
  const table = faTableRef.value;
76
76
  if (table === void 0) return;
77
77
  if (state.selectionRow) {
@@ -116,7 +116,9 @@ var inputDialogPage_default = defineComponent({
116
116
  }, null), createVNode(ElButton, {
117
117
  "disabled": props.disabled,
118
118
  "icon": Search,
119
- "onClick": handleSearchClick
119
+ "onClick": () => {
120
+ handleSearchClick();
121
+ }
120
122
  }, null)] }) }), createVNode(FaDialog, {
121
123
  "ref": faDialogRef,
122
124
  "style": "--height: 70%;",
@@ -1 +1 @@
1
- {"version":3,"file":"inputDialogPage.mjs","names":["update:modelValue","update:label"],"sources":["../../../../src/components/inputDialogPage/src/inputDialogPage.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, reactive, ref } from \"vue\";\nimport { Delete, Search } from \"@element-plus/icons-vue\";\nimport { ElButton, ElButtonGroup, ElInput } from \"element-plus\";\nimport { isFunction, isNull, isNumber, isString } from \"lodash-unified\";\nimport { definePropType, makeSlots, useExpose, useRender, withDefineType } from \"../../../utils\";\nimport FaDialog from \"../../dialog\";\nimport { FaTable, type FaTableInstance, type PagedInput, type PagedResult } from \"../../table\";\nimport type { FaDialogInstance } from \"../../dialog\";\nimport type { TableProps } from \"element-plus\";\nimport type { PropType } from \"vue\";\n\n/** FaInputDialogPage 的运行时 Props 定义。 */\nexport const faInputDialogPageProps = {\n\t/** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */\n\trowKey: {\n\t\ttype: [String, Function] as PropType<TableProps<Record<string, unknown>>[\"rowKey\"]>,\n\t\tdefault: \"id\",\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: [String, Number] as PropType<string | number | null>,\n\t/** @description v-model:label绑定值 */\n\tlabel: String as PropType<string | null>,\n\t/** @description 输入框占位文本 */\n\tplaceholder: {\n\t\ttype: String,\n\t\tdefault: \"请选择\",\n\t},\n\t/** @description 禁用 */\n\tdisabled: Boolean,\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: PagedInput) => Promise<PagedResult | Record<string, unknown>[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<unknown>([String, Number, Object]),\n\t/** @description 显示文本 Key */\n\tlabelKey: {\n\t\ttype: String,\n\t\tdefault: \"name\",\n\t},\n};\n\n/** FaInputDialogPage 的运行时 Emits 定义。 */\nexport const faInputDialogPageEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | null): boolean => isString(value) || isNumber(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | null): boolean => isString(value) || isNull(value),\n\t/** @description 改变 */\n\tchange: (_data: unknown, _value?: string | number | null): boolean => true,\n};\n\n/** FaInputDialogPage 的插槽参数。 */\nexport interface FaInputDialogPageSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaInputDialogPage\",\n\tprops: faInputDialogPageProps,\n\temits: faInputDialogPageEmits,\n\tslots: makeSlots<FaInputDialogPageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst modelValue = useVModel(props, \"modelValue\", emit, { passive: true });\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\n\t\tconst state = reactive({\n\t\t\tselectionRow: withDefineType<Record<string, unknown>>(),\n\t\t});\n\n\t\tconst faDialogRef = ref<FaDialogInstance>();\n\t\tconst faTableRef = ref<FaTableInstance>();\n\n\t\tconst handleDeleteClick = (): void => {\n\t\t\tmodelValue.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"change\", null);\n\t\t};\n\n\t\tconst handleSearchClick = (): void => {\n\t\t\tfaDialogRef.value?.open(() => {\n\t\t\t\tconst table = faTableRef.value;\n\t\t\t\tif (table === undefined) return;\n\t\t\t\tif (state.selectionRow) {\n\t\t\t\t\t// 判断当前行是否选中\n\t\t\t\t\tconst rawRowKey = isFunction(props.rowKey) ? props.rowKey(state.selectionRow) : state.selectionRow[props.rowKey];\n\t\t\t\t\tconst rowSelected = (typeof rawRowKey === \"string\" || typeof rawRowKey === \"number\") && table.selectedListIds.includes(rawRowKey);\n\t\t\t\t\tif (!rowSelected) {\n\t\t\t\t\t\ttable.toggleRowSelection?.(state.selectionRow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst handleConfirmClick = (): void => {\n\t\t\tfaDialogRef.value?.close(() => {\n\t\t\t\tconst table = faTableRef.value;\n\t\t\t\tconst selectedData = table?.selectedList[0];\n\t\t\t\tif (table?.selected && selectedData) {\n\t\t\t\t\tconst selectedValue = isFunction(props.rowKey) ? props.rowKey(selectedData) : selectedData[props.rowKey];\n\t\t\t\t\tmodelValue.value = typeof selectedValue === \"string\" || typeof selectedValue === \"number\" ? selectedValue : null;\n\t\t\t\t\tconst label = selectedData[props.labelKey];\n\t\t\t\t\tselectedLabel.value = typeof label === \"string\" ? label : null;\n\t\t\t\t\temit(\"change\", selectedData, modelValue.value);\n\t\t\t\t} else {\n\t\t\t\t\tmodelValue.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst handleTableRowDblclick = (row: Record<string, unknown>): void => {\n\t\t\tfaTableRef.value?.clearSelection?.();\n\t\t\tfaTableRef.value?.toggleRowSelection?.(row);\n\t\t\tstate.selectionRow = row;\n\t\t\thandleConfirmClick();\n\t\t};\n\n\t\tuseRender(() => (\n\t\t\t<div class=\"fa-input-dialog-page\">\n\t\t\t\t<ElInput vModel={selectedLabel.value} placeholder={props.placeholder} disabled={props.disabled} readonly>\n\t\t\t\t\t{{\n\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t<ElButtonGroup>\n\t\t\t\t\t\t\t\t<ElButton disabled={props.disabled} icon={Delete} onClick={handleDeleteClick} />\n\t\t\t\t\t\t\t\t<ElButton disabled={props.disabled} icon={Search} onClick={handleSearchClick} />\n\t\t\t\t\t\t\t</ElButtonGroup>\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t</ElInput>\n\t\t\t\t<FaDialog\n\t\t\t\t\tref={faDialogRef}\n\t\t\t\t\tstyle=\"--height: 70%;\"\n\t\t\t\t\twidth=\"50%\"\n\t\t\t\t\ttitle={props.title}\n\t\t\t\t\tfullHeight\n\t\t\t\t\tdisabledConfirmButton={!faTableRef.value?.selected}\n\t\t\t\t\tonConfirmClick={handleConfirmClick}\n\t\t\t\t>\n\t\t\t\t\t<FaTable\n\t\t\t\t\t\tref={faTableRef}\n\t\t\t\t\t\trowKey={props.rowKey}\n\t\t\t\t\t\trequestApi={props.requestApi}\n\t\t\t\t\t\tinitParam={props.initParam}\n\t\t\t\t\t\tsingle\n\t\t\t\t\t\trowClickSelection\n\t\t\t\t\t\thideSearchTime\n\t\t\t\t\t\tonRowDblclick={handleTableRowDblclick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: () => slots.default?.(),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</FaTable>\n\t\t\t\t</FaDialog>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 选择行数据 */\n\t\t\tselectionRow: computed(() => state.selectionRow),\n\t\t\t/** @description 打开选择器弹窗 */\n\t\t\topen: handleSearchClick,\n\t\t\t/** @description 清除选择 */\n\t\t\tclear: handleDeleteClick,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,yBAAyB;;CAErC,QAAQ;EACP,MAAM,CAAC,QAAQ,QAAQ;EACvB,SAAS;CACV;;CAEA,YAAY,CAAC,QAAQ,MAAM;;CAE3B,OAAO;;CAEP,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,UAAU;;CAEV,OAAO;;CAEP,YAAY,EACX,MAAM,eAA0F,QAAQ,EACzG;;CAEA,WAAW,eAAwB;EAAC;EAAQ;EAAQ;CAAM,CAAC;;CAE3D,UAAU;EACT,MAAM;EACN,SAAS;CACV;AACD;;AAGA,MAAa,yBAAyB;;CAErC,sBAAsB,UAA2C,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,OAAO,KAAK;;CAEnH,iBAAiB,UAAkC,SAAS,KAAK,KAAK,OAAO,KAAK;;CAElF,SAAS,OAAgB,WAA6C;AACvE;AA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;KACnB,cAAc,QAAQ;KACtB,KAAK,UAAU,MAAM,IAAI;IAC1B;GACD,CAAC;EACF;EAEA,MAAM,0BAA0B,QAAuC;GACtE,WAAW,OAAO,iBAAiB;GACnC,WAAW,OAAO,qBAAqB,GAAG;GAC1C,MAAM,eAAe;GACrB,mBAAmB;EACpB;EAEA,gBAAU,YAAA,OAAA,EAAA,SAAA,uBAAA,GAAA,CAAA,YAAA,SAAA;GAAA,cAES,cAAc;GAAK,wBAAA,WAAnB,cAAc,QAAK;GAAA,eAAe,MAAM;GAAW,YAAY,MAAM;GAAQ,YAAA;EAAA,GAAA,EAE5F,cAAQ,YAAA,eAAA,MAAA,EAAA,eAAA,CAAA,YAAA,UAAA;GAAA,YAEc,MAAM;GAAQ,QAAQ;GAAM,WAAW;EAAiB,GAAA,IAAA,GAAA,YAAA,UAAA;GAAA,YACxD,MAAM;GAAQ,QAAQ;GAAM,WAAW;EAAiB,GAAA,IAAA,CAAA,EAAA,CAAA,EAE7E,CAAA,GAAA,YAAA,UAAA;GAAA,OAIG;GAAW,SAAA;GAAA,SAAA;GAAA,SAGT,MAAM;GAAK,cAAA;GAAA,yBAEK,CAAC,WAAW,OAAO;GAAQ,kBAClC;EAAkB,GAAA,EAAA,eAAA,CAAA,YAAA,SAAA;GAAA,OAG5B;GAAU,UACP,MAAM;GAAM,cACR,MAAM;GAAU,aACjB,MAAM;GAAS,UAAA;GAAA,qBAAA;GAAA,kBAAA;GAAA,iBAIX;EAAsB,GAAA,EAGpC,eAAe,MAAM,UAAU,EAAC,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAKpC;EAED,OAAO,UAAU,QAAQ;;GAExB,cAAc,eAAe,MAAM,YAAY;;GAE/C,MAAM;;GAEN,OAAO;EACR,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"inputDialogPage.mjs","names":["update:modelValue","update:label"],"sources":["../../../../src/components/inputDialogPage/src/inputDialogPage.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, reactive, ref } from \"vue\";\nimport { Delete, Search } from \"@element-plus/icons-vue\";\nimport { ElButton, ElButtonGroup, ElInput } from \"element-plus\";\nimport { isFunction, isNull, isNumber, isString } from \"lodash-unified\";\nimport { definePropType, makeSlots, useExpose, useRender, withDefineType } from \"../../../utils\";\nimport FaDialog from \"../../dialog\";\nimport { FaTable } from \"../../table\";\nimport type { TableProps } from \"element-plus\";\nimport type { PropType } from \"vue\";\nimport type { FaDialogInstance } from \"../../dialog\";\nimport type { DefaultRow, FaTableInstance, PagedInput, PagedResult } from \"../../table\";\n\n/** FaInputDialogPage 的运行时 Props 定义。 */\nexport const faInputDialogPageProps = {\n\t/** @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used */\n\trowKey: {\n\t\ttype: [String, Function] as PropType<TableProps<DefaultRow>[\"rowKey\"]>,\n\t\tdefault: \"id\",\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: [String, Number] as PropType<string | number | null>,\n\t/** @description v-model:label绑定值 */\n\tlabel: String as PropType<string | null>,\n\t/** @description 输入框占位文本 */\n\tplaceholder: {\n\t\ttype: String,\n\t\tdefault: \"请选择\",\n\t},\n\t/** @description 禁用 */\n\tdisabled: Boolean,\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: PagedInput) => Promise<PagedResult | DefaultRow[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n\t/** @description 显示文本 Key */\n\tlabelKey: {\n\t\ttype: String,\n\t\tdefault: \"name\",\n\t},\n};\n\n/** FaInputDialogPage 的运行时 Emits 定义。 */\nexport const faInputDialogPageEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | null): boolean => isString(value) || isNumber(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | null): boolean => isString(value) || isNull(value),\n\t/** @description 改变 */\n\tchange: (_data: DefaultRow | null, _value?: string | number | null): boolean => true,\n};\n\n/** FaInputDialogPage 的插槽参数。 */\nexport interface FaInputDialogPageSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaInputDialogPage\",\n\tprops: faInputDialogPageProps,\n\temits: faInputDialogPageEmits,\n\tslots: makeSlots<FaInputDialogPageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst modelValue = useVModel(props, \"modelValue\", emit, { passive: true });\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\n\t\tconst state = reactive({\n\t\t\tselectionRow: withDefineType<DefaultRow>(),\n\t\t});\n\n\t\tconst faDialogRef = ref<FaDialogInstance>();\n\t\tconst faTableRef = ref<FaTableInstance>();\n\n\t\tconst handleDeleteClick = (): void => {\n\t\t\tmodelValue.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\temit(\"change\", null);\n\t\t};\n\n\t\tconst handleSearchClick = async (): Promise<void> => {\n\t\t\tawait faDialogRef.value?.open(() => {\n\t\t\t\tconst table = faTableRef.value;\n\t\t\t\tif (table === undefined) return;\n\t\t\t\tif (state.selectionRow) {\n\t\t\t\t\t// 判断当前行是否选中\n\t\t\t\t\tconst rawRowKey: unknown = isFunction(props.rowKey) ? props.rowKey(state.selectionRow) : state.selectionRow[props.rowKey];\n\t\t\t\t\tconst rowSelected = (typeof rawRowKey === \"string\" || typeof rawRowKey === \"number\") && table.selectedListIds.includes(rawRowKey);\n\t\t\t\t\tif (!rowSelected) {\n\t\t\t\t\t\ttable.toggleRowSelection?.(state.selectionRow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst handleConfirmClick = (): void => {\n\t\t\tvoid faDialogRef.value?.close(() => {\n\t\t\t\tconst table = faTableRef.value;\n\t\t\t\tconst selectedData = table?.selectedList[0];\n\t\t\t\tif (table?.selected && selectedData) {\n\t\t\t\t\tconst selectedValue: unknown = isFunction(props.rowKey) ? props.rowKey(selectedData) : selectedData[props.rowKey];\n\t\t\t\t\tmodelValue.value = typeof selectedValue === \"string\" || typeof selectedValue === \"number\" ? selectedValue : null;\n\t\t\t\t\tconst label: unknown = selectedData[props.labelKey];\n\t\t\t\t\tselectedLabel.value = typeof label === \"string\" ? label : null;\n\t\t\t\t\temit(\"change\", selectedData, modelValue.value);\n\t\t\t\t} else {\n\t\t\t\t\tmodelValue.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tconst handleTableRowDblclick = (row: DefaultRow): void => {\n\t\t\tfaTableRef.value?.clearSelection?.();\n\t\t\tfaTableRef.value?.toggleRowSelection?.(row);\n\t\t\tstate.selectionRow = row;\n\t\t\thandleConfirmClick();\n\t\t};\n\n\t\tuseRender(() => (\n\t\t\t<div class=\"fa-input-dialog-page\">\n\t\t\t\t<ElInput vModel={selectedLabel.value} placeholder={props.placeholder} disabled={props.disabled} readonly>\n\t\t\t\t\t{{\n\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t<ElButtonGroup>\n\t\t\t\t\t\t\t\t<ElButton disabled={props.disabled} icon={Delete} onClick={handleDeleteClick} />\n\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\t\t\t\ticon={Search}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tvoid handleSearchClick();\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ElButtonGroup>\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t</ElInput>\n\t\t\t\t<FaDialog\n\t\t\t\t\tref={faDialogRef}\n\t\t\t\t\tstyle=\"--height: 70%;\"\n\t\t\t\t\twidth=\"50%\"\n\t\t\t\t\ttitle={props.title}\n\t\t\t\t\tfullHeight\n\t\t\t\t\tdisabledConfirmButton={!faTableRef.value?.selected}\n\t\t\t\t\tonConfirmClick={handleConfirmClick}\n\t\t\t\t>\n\t\t\t\t\t<FaTable\n\t\t\t\t\t\tref={faTableRef}\n\t\t\t\t\t\trowKey={props.rowKey}\n\t\t\t\t\t\trequestApi={props.requestApi}\n\t\t\t\t\t\tinitParam={props.initParam}\n\t\t\t\t\t\tsingle\n\t\t\t\t\t\trowClickSelection\n\t\t\t\t\t\thideSearchTime\n\t\t\t\t\t\tonRowDblclick={handleTableRowDblclick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: () => slots.default?.(),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</FaTable>\n\t\t\t\t</FaDialog>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 选择行数据 */\n\t\t\tselectionRow: computed(() => state.selectionRow),\n\t\t\t/** @description 打开选择器弹窗 */\n\t\t\topen: handleSearchClick,\n\t\t\t/** @description 清除选择 */\n\t\t\tclear: handleDeleteClick,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAa,yBAAyB;;CAErC,QAAQ;EACP,MAAM,CAAC,QAAQ,QAAQ;EACvB,SAAS;CACV;;CAEA,YAAY,CAAC,QAAQ,MAAM;;CAE3B,OAAO;;CAEP,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,UAAU;;CAEV,OAAO;;CAEP,YAAY,EACX,MAAM,eAA6E,QAAQ,EAC5F;;CAEA,WAAW,eAA6C;EAAC;EAAQ;EAAQ;CAAM,CAAC;;CAEhF,UAAU;EACT,MAAM;EACN,SAAS;CACV;AACD;;AAGA,MAAa,yBAAyB;;CAErC,sBAAsB,UAA2C,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,OAAO,KAAK;;C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-1 +1 @@
1
- {"version":3,"file":"layoutGrid.mjs","names":[],"sources":["../../../../src/components/layoutGrid/src/layoutGrid.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onActivated, onDeactivated, onMounted, onUnmounted, provide, ref, watch } from \"vue\";\nimport { isArray, isNumber, isObject } from \"lodash-unified\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"../../../utils\";\nimport type { FaLayoutGridBreakPoint, FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\nimport type { VNode, VNodeArrayChildren } from \"vue\";\n\n/** FaLayoutGrid 的插槽参数。 */\nexport interface FaLayoutGridSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaLayoutGrid\",\n\tprops: {\n\t\t/** @description Grid布局列配置 */\n\t\tcols: {\n\t\t\ttype: definePropType<string | number | Record<FaLayoutGridBreakPoint, number>>([String, Number, Object]),\n\t\t\tdefault: (): Record<FaLayoutGridBreakPoint, number> => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t\t},\n\t\t/** @description 折叠 */\n\t\tcollapsed: Boolean,\n\t\t/** @description 折叠行数 */\n\t\tcollapsedRows: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** @description 间距,偏移 */\n\t\tgap: {\n\t\t\ttype: definePropType<number | [number, number]>([Number, Array]),\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 断点变化事件 */\n\t\tbreakPointChange: ({ breakPoint: _breakPoint }: { breakPoint: FaLayoutGridBreakPoint }) => true,\n\t},\n\tslots: makeSlots<FaLayoutGridSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst divElRef = ref<HTMLElement>();\n\n\t\t// 注入 gap 间距\n\t\tprovide(\"gap\", isArray(props.gap) ? props.gap[0] : props.gap);\n\n\t\t// 注入响应式断点\n\t\tconst breakPoint = ref<FaLayoutGridBreakPoint>(\"xl\");\n\t\tprovide(\"breakPoint\", breakPoint);\n\n\t\t// 注入要开始折叠的 index\n\t\tconst hiddenIndex = ref(-1);\n\t\tprovide(\"shouldHiddenIndex\", hiddenIndex);\n\n\t\t// 注入 cols\n\t\tconst cols = computed<string | number>(() => {\n\t\t\tif (isObject(props.cols)) return props.cols[breakPoint.value] ?? 1;\n\t\t\treturn props.cols;\n\t\t});\n\t\tprovide(\"cols\", cols);\n\n\t\tconst collapsedRows = isNumber(props.collapsedRows) ? props.collapsedRows : Number(props.collapsedRows);\n\n\t\t// 断点映射\n\t\tconst breakpoints = {\n\t\t\t// 小于480屏幕(如手机)\n\t\t\txs: { min: 0, max: 479 },\n\t\t\t// 平板竖屏\n\t\t\tsm: { min: 480, max: 768 },\n\t\t\t// 平板横屏\n\t\t\tmd: { min: 768, max: 1024 },\n\t\t\t// 小型桌面\n\t\t\tlg: { min: 1024, max: 1440 },\n\t\t\t// 大型桌面\n\t\t\txl: { min: 1440, max: Infinity },\n\t\t};\n\n\t\t// 监听屏幕变化\n\t\tconst resize = (e: ResizeObserverEntry[]): void => {\n\t\t\t// 当前只监听布局容器,ResizeObserver 每次回调应当只有一个目标。\n\t\t\tif (e.length !== 1 || e[0] === undefined) throw new Error(\"FaLayoutGrid 监听到了非预期数量的布局容器。\");\n\t\t\tconst curEl = e[0];\n\t\t\tconst width = curEl.target.scrollWidth;\n\n\t\t\tfor (const [key, { min, max }] of Object.entries(breakpoints)) {\n\t\t\t\tif (width >= min && width <= max) {\n\t\t\t\t\tbreakPoint.value = key as FaLayoutGridBreakPoint;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet resizeObserver: ResizeObserver | undefined;\n\t\tconst observeResize = (): void => {\n\t\t\tconst element = divElRef.value;\n\t\t\tif (!element) return;\n\t\t\tresizeObserver?.disconnect();\n\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\tresizeObserver.observe(element);\n\t\t};\n\n\t\tonMounted(() => {\n\t\t\tvoid nextTick(observeResize);\n\n\t\t\t// 断点变化时 执行 findIndex\n\t\t\twatch(\n\t\t\t\t() => breakPoint.value,\n\t\t\t\t(newValue) => {\n\t\t\t\t\temit(\"breakPointChange\", { breakPoint: newValue });\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timmediate: true,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tonActivated(() => {\n\t\t\tvoid nextTick(observeResize);\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tonDeactivated(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\t// 设置间距\n\t\tconst gap = computed(() => {\n\t\t\tif (isNumber(props.gap)) return `${props.gap}px`;\n\t\t\tif (isArray(props.gap)) return `${props.gap[1]}px ${props.gap[0]}px`;\n\t\t\treturn \"unset\";\n\t\t});\n\n\t\t// 设置 style\n\t\tconst style = computed(() => {\n\t\t\treturn {\n\t\t\t\tdisplay: \"grid\",\n\t\t\t\tgridGap: gap.value,\n\t\t\t\tgridTemplateColumns: `repeat(${cols.value}, minmax(0, 1fr))`,\n\t\t\t};\n\t\t});\n\n\t\tuseRender(() => {\n\t\t\tconst defaultSlot = slots.default?.() ?? [];\n\n\t\t\tif (props.collapsed) {\n\t\t\t\tconst fields: VNodeArrayChildren = [];\n\t\t\t\tlet suffix: VNode | undefined;\n\n\t\t\t\tdefaultSlot.forEach((slot) => {\n\t\t\t\t\t// suffix\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof slot.type === \"object\" &&\n\t\t\t\t\t\tslot.type !== null &&\n\t\t\t\t\t\t\"name\" in slot.type &&\n\t\t\t\t\t\tslot.type.name === \"FaLayoutGridItem\" &&\n\t\t\t\t\t\tslot.props?.[\"suffix\"] !== undefined\n\t\t\t\t\t)\n\t\t\t\t\t\tsuffix = slot;\n\t\t\t\t\t// slot children\n\t\t\t\t\tif (typeof slot.type === \"symbol\" && Array.isArray(slot?.children)) fields.push(...slot.children);\n\t\t\t\t});\n\n\t\t\t\t// 计算 suffix 所占用的列\n\t\t\t\tlet suffixCols = 0;\n\t\t\t\tif (suffix?.props) {\n\t\t\t\t\tconst breakPointProps = suffix.props[breakPoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\tsuffixCols =\n\t\t\t\t\t\t(breakPointProps?.span ?? Number(suffix.props[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(breakPointProps?.offset ?? Number(suffix.props[\"offset\"] ?? 0));\n\t\t\t\t}\n\n\t\t\t\tlet occupiedCols = 0;\n\t\t\t\thiddenIndex.value = -1;\n\t\t\t\tfor (const [index, current] of fields.entries()) {\n\t\t\t\t\tconst currentVNode = current as VNode;\n\t\t\t\t\tconst currentProps = currentVNode.props;\n\t\t\t\t\tif (currentProps === null) continue;\n\t\t\t\t\tconst breakPointProps = currentProps[breakPoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\toccupiedCols +=\n\t\t\t\t\t\t(breakPointProps?.span ?? Number(currentProps[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(breakPointProps?.offset ?? Number(currentProps[\"offset\"] ?? 0));\n\t\t\t\t\tif (occupiedCols > collapsedRows * Number(cols.value) - suffixCols) {\n\t\t\t\t\t\thiddenIndex.value = index;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thiddenIndex.value = -1;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div ref={divElRef} style={style.value}>\n\t\t\t\t\t{defaultSlot}\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 响应式断点 */\n\t\t\tbreakPoint,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;AAYA,IAAA,qBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;EAEN,MAAM;GACL,MAAM,eAAyE;IAAC;IAAQ;IAAQ;GAAM,CAAC;GACv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K,QAAQ;IACjG,CAAC;IAGD,IAAI,aAAa;IACjB,IAAI,QAAQ,OAAO;KAClB,MAAM,kBAAkB,OAAO,MAAM,WAAW;KAChD,cACE,iBAAiB,QAAQ,OAAO,OAAO,MAAM,WAAW,CAAC,MACzD,iBAAiB,UAAU,OAAO,OAAO,MAAM,aAAa,CAAC;IAChE;IAEA,IAAI,eAAe;IACnB,YAAY,QAAQ;IACpB,KAAK,MAAM,CAAC,OAAO,YAAY,OAAO,QAAQ,GAAG;KAEhD,MAAM,eAAe,QAAa;KAClC,IAAI,iBAAiB,MAAM;KAC3B,MAAM,kBAAkB,aAAa,WAAW;KAChD,iBACE,iBAAiB,QAAQ,OAAO,aAAa,WAAW,CAAC,MACzD,iBAAiB,UAAU,OAAO,aAAa,aAAa,CAAC;KAC/D,IAAI,eAAe,gBAAgB,OAAO,KAAK,KAAK,IAAI,YAAY;MACnE,YAAY,QAAQ;MACpB;KACD;IACD;GACD,OACC,YAAY,QAAQ;GAGrB,OAAA,YAAA,OAAA;IAAA,OACW;IAAQ,SAAS,MAAM;GAAK,GAAA,CACpC,WAAW,CAAA;EAGf,CAAC;EAED,OAAO,UAAU,QAAQ;;AAExB,WACD,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"layoutGrid.mjs","names":[],"sources":["../../../../src/components/layoutGrid/src/layoutGrid.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onActivated, onDeactivated, onMounted, onUnmounted, provide, ref, watch } from \"vue\";\nimport { isArray, isNumber, isObject } from \"lodash-unified\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"../../../utils\";\nimport type { VNode, VNodeArrayChildren } from \"vue\";\nimport type { FaLayoutGridBreakPoint, FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\n\n/** FaLayoutGrid 的插槽参数。 */\nexport interface FaLayoutGridSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaLayoutGrid\",\n\tprops: {\n\t\t/** @description Grid布局列配置 */\n\t\tcols: {\n\t\t\ttype: definePropType<string | number | Record<FaLayoutGridBreakPoint, number>>([String, Number, Object]),\n\t\t\tdefault: (): Record<FaLayoutGridBreakPoint, number> => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t\t},\n\t\t/** @description 折叠 */\n\t\tcollapsed: Boolean,\n\t\t/** @description 折叠行数 */\n\t\tcollapsedRows: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** @description 间距,偏移 */\n\t\tgap: {\n\t\t\ttype: definePropType<number | [number, number]>([Number, Array]),\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 断点变化事件 */\n\t\tbreakPointChange: ({ breakPoint: _breakPoint }: { breakPoint: FaLayoutGridBreakPoint }) => true,\n\t},\n\tslots: makeSlots<FaLayoutGridSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst divElRef = ref<HTMLElement>();\n\n\t\t// 注入 gap 间距\n\t\tprovide(\"gap\", isArray(props.gap) ? props.gap[0] : props.gap);\n\n\t\t// 注入响应式断点\n\t\tconst breakPoint = ref<FaLayoutGridBreakPoint>(\"xl\");\n\t\tprovide(\"breakPoint\", breakPoint);\n\n\t\t// 注入要开始折叠的 index\n\t\tconst hiddenIndex = ref(-1);\n\t\tprovide(\"shouldHiddenIndex\", hiddenIndex);\n\n\t\t// 注入 cols\n\t\tconst cols = computed<string | number>(() => {\n\t\t\tif (isObject(props.cols)) return props.cols[breakPoint.value] ?? 1;\n\t\t\treturn props.cols;\n\t\t});\n\t\tprovide(\"cols\", cols);\n\n\t\tconst collapsedRows = isNumber(props.collapsedRows) ? props.collapsedRows : Number(props.collapsedRows);\n\n\t\t// 断点映射\n\t\tconst breakpoints = {\n\t\t\t// 小于480屏幕(如手机)\n\t\t\txs: { min: 0, max: 479 },\n\t\t\t// 平板竖屏\n\t\t\tsm: { min: 480, max: 768 },\n\t\t\t// 平板横屏\n\t\t\tmd: { min: 768, max: 1024 },\n\t\t\t// 小型桌面\n\t\t\tlg: { min: 1024, max: 1440 },\n\t\t\t// 大型桌面\n\t\t\txl: { min: 1440, max: Infinity },\n\t\t};\n\n\t\t// 监听屏幕变化\n\t\tconst resize = (e: ResizeObserverEntry[]): void => {\n\t\t\t// 当前只监听布局容器,ResizeObserver 每次回调应当只有一个目标。\n\t\t\tif (e.length !== 1 || e[0] === undefined) throw new Error(\"FaLayoutGrid 监听到了非预期数量的布局容器。\");\n\t\t\tconst curEl = e[0];\n\t\t\tconst width = curEl.target.scrollWidth;\n\n\t\t\tfor (const [key, { min, max }] of Object.entries(breakpoints)) {\n\t\t\t\tif (width >= min && width <= max) {\n\t\t\t\t\tbreakPoint.value = key as FaLayoutGridBreakPoint;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet resizeObserver: ResizeObserver | undefined;\n\t\tconst observeResize = (): void => {\n\t\t\tconst element = divElRef.value;\n\t\t\tif (!element) return;\n\t\t\tresizeObserver?.disconnect();\n\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\tresizeObserver.observe(element);\n\t\t};\n\n\t\tonMounted(() => {\n\t\t\tvoid nextTick(observeResize);\n\n\t\t\t// 断点变化时 执行 findIndex\n\t\t\twatch(\n\t\t\t\t() => breakPoint.value,\n\t\t\t\t(newValue) => {\n\t\t\t\t\temit(\"breakPointChange\", { breakPoint: newValue });\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timmediate: true,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tonActivated(() => {\n\t\t\tvoid nextTick(observeResize);\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tonDeactivated(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\t// 设置间距\n\t\tconst gap = computed(() => {\n\t\t\tif (isNumber(props.gap)) return `${props.gap}px`;\n\t\t\tif (isArray(props.gap)) return `${props.gap[1]}px ${props.gap[0]}px`;\n\t\t\treturn \"unset\";\n\t\t});\n\n\t\t// 设置 style\n\t\tconst style = computed(() => {\n\t\t\treturn {\n\t\t\t\tdisplay: \"grid\",\n\t\t\t\tgridGap: gap.value,\n\t\t\t\tgridTemplateColumns: `repeat(${cols.value}, minmax(0, 1fr))`,\n\t\t\t};\n\t\t});\n\n\t\tuseRender(() => {\n\t\t\tconst defaultSlot = slots.default?.() ?? [];\n\n\t\t\tif (props.collapsed) {\n\t\t\t\tconst fields: VNodeArrayChildren = [];\n\t\t\t\tlet suffix: VNode | undefined;\n\n\t\t\t\tdefaultSlot.forEach((slot) => {\n\t\t\t\t\t// suffix\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof slot.type === \"object\" &&\n\t\t\t\t\t\tslot.type !== null &&\n\t\t\t\t\t\t\"name\" in slot.type &&\n\t\t\t\t\t\tslot.type.name === \"FaLayoutGridItem\" &&\n\t\t\t\t\t\tslot.props?.[\"suffix\"] !== undefined\n\t\t\t\t\t)\n\t\t\t\t\t\tsuffix = slot;\n\t\t\t\t\t// slot children\n\t\t\t\t\tif (typeof slot.type === \"symbol\" && Array.isArray(slot?.children)) fields.push(...slot.children);\n\t\t\t\t});\n\n\t\t\t\t// 计算 suffix 所占用的列\n\t\t\t\tlet suffixCols = 0;\n\t\t\t\tif (suffix?.props) {\n\t\t\t\t\tconst breakPointProps = suffix.props[breakPoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\tsuffixCols =\n\t\t\t\t\t\t(breakPointProps?.span ?? Number(suffix.props[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(breakPointProps?.offset ?? Number(suffix.props[\"offset\"] ?? 0));\n\t\t\t\t}\n\n\t\t\t\tlet occupiedCols = 0;\n\t\t\t\thiddenIndex.value = -1;\n\t\t\t\tfor (const [index, current] of fields.entries()) {\n\t\t\t\t\tconst currentVNode = current as VNode;\n\t\t\t\t\tconst currentProps = currentVNode.props;\n\t\t\t\t\tif (currentProps === null) continue;\n\t\t\t\t\tconst breakPointProps = currentProps[breakPoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\toccupiedCols +=\n\t\t\t\t\t\t(breakPointProps?.span ?? Number(currentProps[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(breakPointProps?.offset ?? Number(currentProps[\"offset\"] ?? 0));\n\t\t\t\t\tif (occupiedCols > collapsedRows * Number(cols.value) - suffixCols) {\n\t\t\t\t\t\thiddenIndex.value = index;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thiddenIndex.value = -1;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div ref={divElRef} style={style.value}>\n\t\t\t\t\t{defaultSlot}\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 响应式断点 */\n\t\t\tbreakPoint,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;AAYA,IAAA,qBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;EAEN,MAAM;GACL,MAAM,eAAyE;IAAC;IAAQ;IAAQ;GAAM,CAAC;GACvG,gBAAwD;IAAE,IAAI;IAAG,IAAI;IAAG,IAAI;IAAG,IAAI;IAAG,IAAI;GAAE;EAC7F;;EAEA,WAAW;;EAEX,eAAe;GACd,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,KAAK;GACJ,MAAM,eAA0C,CAAC,QAAQ,KAAK,CAAC;GAC/D,SAAS;EACV;CACD;CACA,OAAO;;AAEN,mBAAmB,EAAE,YAAY,kBAA0D,KAC5F;CACA,OAAO,UAA6B;CACpC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,WAAW,IAAiB;EAGlC,QAAQ,OAAO,QAAQ,MAAM,GAAG,IAAI,MAAM,IAAI,KAAK,MAAM,GAAG;EAG5D,MAAM,aAAa,IAA4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