el-plus 0.0.81 → 0.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.css +1 -1
- package/dist/index.full.js +73 -20
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +74 -21
- package/es/components/attachment/src/attachment.vue2.mjs +12 -2
- package/es/components/attachment/src/attachment.vue2.mjs.map +1 -1
- package/es/components/form/index.d.ts +3 -0
- package/es/components/form/src/form-item-vue.mjs +1 -1
- package/es/components/form/src/form-item-vue.mjs.map +1 -1
- package/es/components/form/src/form.vue.d.ts +1 -0
- package/es/components/form/src/form.vue2.mjs +14 -3
- package/es/components/form/src/form.vue2.mjs.map +1 -1
- package/es/components/form/src/hooks/use-form-item.d.ts +1 -1
- package/es/components/form/src/hooks/use-form-item.mjs +7 -2
- package/es/components/form/src/hooks/use-form-item.mjs.map +1 -1
- package/es/components/form/src/hooks/use-form.d.ts +2 -0
- package/es/components/form/src/hooks/use-form.mjs +16 -2
- package/es/components/form/src/hooks/use-form.mjs.map +1 -1
- package/es/components/search-list-page/index.d.ts +18 -6
- package/es/components/search-list-page/src/search-list-page.vue.d.ts +6 -2
- package/es/components/search-list-page/src/use-search-list-page.d.ts +6 -2
- package/es/components/table/index.d.ts +3 -0
- package/es/components/table/src/table.vue.d.ts +1 -0
- package/es/components/table/src/table.vue2.mjs +2 -0
- package/es/components/table/src/table.vue2.mjs.map +1 -1
- package/es/components/table/src/use-table.d.ts +1 -0
- package/es/components/table/src/use-table.mjs +4 -0
- package/es/components/table/src/use-table.mjs.map +1 -1
- package/es/hooks/dialog/use-dialog.d.ts +1 -0
- package/es/hooks/dialog/use-dialog.mjs +3 -0
- package/es/hooks/dialog/use-dialog.mjs.map +1 -1
- package/es/hooks/use-request.mjs +13 -8
- package/es/hooks/use-request.mjs.map +1 -1
- package/es/hooks/use-template-promise.d.ts +1 -0
- package/es/hooks/use-template-promise.mjs +1 -1
- package/es/hooks/use-template-promise.mjs.map +1 -1
- package/es/package.json.mjs +1 -1
- package/lib/components/attachment/src/attachment.vue2.js +12 -2
- package/lib/components/attachment/src/attachment.vue2.js.map +1 -1
- package/lib/components/form/index.d.ts +3 -0
- package/lib/components/form/src/form-item-vue.js +1 -1
- package/lib/components/form/src/form-item-vue.js.map +1 -1
- package/lib/components/form/src/form.vue.d.ts +1 -0
- package/lib/components/form/src/form.vue2.js +14 -3
- package/lib/components/form/src/form.vue2.js.map +1 -1
- package/lib/components/form/src/hooks/use-form-item.d.ts +1 -1
- package/lib/components/form/src/hooks/use-form-item.js +7 -2
- package/lib/components/form/src/hooks/use-form-item.js.map +1 -1
- package/lib/components/form/src/hooks/use-form.d.ts +2 -0
- package/lib/components/form/src/hooks/use-form.js +15 -1
- package/lib/components/form/src/hooks/use-form.js.map +1 -1
- package/lib/components/search-list-page/index.d.ts +18 -6
- package/lib/components/search-list-page/src/search-list-page.vue.d.ts +6 -2
- package/lib/components/search-list-page/src/use-search-list-page.d.ts +6 -2
- package/lib/components/table/index.d.ts +3 -0
- package/lib/components/table/src/table.vue.d.ts +1 -0
- package/lib/components/table/src/table.vue2.js +2 -0
- package/lib/components/table/src/table.vue2.js.map +1 -1
- package/lib/components/table/src/use-table.d.ts +1 -0
- package/lib/components/table/src/use-table.js +4 -0
- package/lib/components/table/src/use-table.js.map +1 -1
- package/lib/hooks/dialog/use-dialog.d.ts +1 -0
- package/lib/hooks/dialog/use-dialog.js +3 -0
- package/lib/hooks/dialog/use-dialog.js.map +1 -1
- package/lib/hooks/use-request.js +13 -8
- package/lib/hooks/use-request.js.map +1 -1
- package/lib/hooks/use-template-promise.d.ts +1 -0
- package/lib/hooks/use-template-promise.js +1 -1
- package/lib/hooks/use-template-promise.js.map +1 -1
- package/lib/package.json.js +1 -1
- package/package.json +1 -1
- package/theme-chalk/attachment.css +1 -1
- package/theme-chalk/header.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/attachment.scss +3 -0
- package/theme-chalk/src/header.scss +1 -1
- package/theme-chalk/src/table.scss +1 -0
- package/theme-chalk/src/title.scss +41 -43
- package/theme-chalk/table.css +1 -1
- package/theme-chalk/title.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dialog.mjs","sources":["../../../../../packages/hooks/dialog/use-dialog.tsx"],"sourcesContent":["import { useTemplatePromise } from '../use-template-promise'\nimport { h, getCurrentInstance, render as vRender, inject, nextTick } from 'vue'\nimport type { ComponentInternalInstance } from 'vue'\nimport {\n ElDialog,\n ElButton,\n configProviderContextKey,\n ElConfigProvider,\n} from 'element-plus'\nimport type { VNode } from 'vue'\nimport type { DialogProps } from 'element-plus'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareProps } from '@el-plus/utils/props'\nimport { useLocale } from '../use-locale'\n\nexport type DialogOptions = Partial<\n DialogProps & {\n instance: ComponentInternalInstance | null\n render: (props) => VNode\n scopedSlots: Record<string, (props) => VNode>\n class: string\n onCancel: (reject) => void\n onBeforeCancel: (reject) => void\n cancelText?: string\n onConfirm: (resolve) => void\n onBeforeConfirm: (resolve) => void\n confirmText?: string\n showFooter: boolean\n }\n>\nexport type ExpandDialogOptions = {\n title?: string\n dialogProps?: DialogOptions\n}\nconst bem = createNameSpace('dialog')\n\nexport const useDialog = (options: DialogOptions = {}) => {\n const { t } = useLocale()\n const {\n scopedSlots = {},\n instance,\n render,\n destroyOnClose,\n onConfirm,\n onBeforeConfirm,\n confirmText,\n onCancel,\n onBeforeCancel,\n cancelText,\n showFooter = true,\n ...dialogProps\n } = options\n\n const Dialog = useTemplatePromise<any>({\n destroy: destroyOnClose,\n render: (promiseOptions, ctx) => {\n // 插槽参数增加promiseOptions\n for (const key in scopedSlots) {\n scopedSlots[key] = scopedSlots[key].bind(null, promiseOptions)\n }\n const { resolve, reject, isResolving } = promiseOptions\n const renderFunc = () => {\n return render\n ? render(promiseOptions)\n : ctx.slots.default?.(promiseOptions)\n }\n const slots: DialogOptions['scopedSlots'] = {}\n if (showFooter) {\n slots.footer = () => (\n <div class={bem.e('footer')}>\n {scopedSlots.footerPrepend?.(promiseOptions)}\n <ElButton\n size=\"default\"\n onClick={async () => {\n if (onBeforeCancel) {\n await onBeforeCancel(reject)\n }\n if (onCancel) {\n onCancel(reject)\n } else {\n reject('cancel')\n }\n }}\n >\n {cancelText || t('ep.dialog.cancel')}\n </ElButton>\n {scopedSlots.footerInner?.(promiseOptions)}\n <ElButton\n type=\"primary\"\n onClick={async () => {\n if (onBeforeConfirm) {\n await onBeforeConfirm(resolve)\n }\n if (onConfirm) {\n onConfirm(resolve)\n } else {\n resolve('confirm')\n }\n }}\n loading={isResolving}\n >\n {confirmText || t('ep.dialog.confirm')}\n </ElButton>\n {scopedSlots.footerAppend?.(promiseOptions)}\n </div>\n )\n }\n return (\n <ElDialog\n class={bem.b()}\n modelValue={true}\n {...{\n closeOnClickModal: false,\n closeOnPressEscape: false,\n title: t('ep.dialog.title'),\n center: false,\n // 'append-to-body': true,\n beforeClose: () => {\n reject('cancel')\n },\n ...prepareProps(dialogProps, ['modelValue']),\n }}\n v-slots={{\n ...slots,\n ...scopedSlots,\n }}\n >\n {renderFunc()}\n </ElDialog>\n )\n },\n })\n if (render) {\n // const app = createApp(component)\n // Object.assign(app._context, parentInstance.appContext)\n // app.mount(container)\n const container = document.createElement('div')\n // container.setAttribute('id', 'ep-dialog-container')\n const newInstance = instance || getCurrentInstance()\n const config = inject(configProviderContextKey) as any\n // const parentConfig =\n // newInstance?.provides[configProviderContextKey] ||\n // newInstance?.appContext?.provides[configProviderContextKey]\n // const vnode = h(Dialog)\n const vnode = h(\n ElConfigProvider,\n { locale: config?.locale },\n { default: () => h(Dialog) },\n )\n if (newInstance && newInstance.appContext) {\n // 强制继承父应用的全局组件、指令和插件\n vnode.appContext = newInstance.appContext\n }\n nextTick(() => {\n vRender(vnode, container)\n document.body.appendChild(container)\n })\n }\n\n return Dialog\n}\n"],"names":["bem","createNameSpace","useDialog","options","t","useLocale","scopedSlots","instance","render","destroyOnClose","onConfirm","onBeforeConfirm","confirmText","onCancel","onBeforeCancel","cancelText","showFooter","dialogProps","Dialog","useTemplatePromise","destroy","promiseOptions","ctx","key","bind","resolve","reject","isResolving","renderFunc","slots","default","footer","_createVNode","e","footerPrepend","ElButton","footerInner","footerAppend","ElDialog","_mergeProps","b","closeOnClickModal","closeOnPressEscape","title","center","beforeClose","prepareProps","container","document","createElement","newInstance","getCurrentInstance","config","inject","configProviderContextKey","vnode","h","ElConfigProvider","locale","appContext","nextTick","vRender","body","appendChild"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"use-dialog.mjs","sources":["../../../../../packages/hooks/dialog/use-dialog.tsx"],"sourcesContent":["import { useTemplatePromise } from '../use-template-promise'\nimport { h, getCurrentInstance, render as vRender, inject, nextTick } from 'vue'\nimport type { ComponentInternalInstance } from 'vue'\nimport {\n ElDialog,\n ElButton,\n configProviderContextKey,\n ElConfigProvider,\n} from 'element-plus'\nimport type { VNode } from 'vue'\nimport type { DialogProps } from 'element-plus'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareProps } from '@el-plus/utils/props'\nimport { useLocale } from '../use-locale'\n\nexport type DialogOptions = Partial<\n DialogProps & {\n instance: ComponentInternalInstance | null\n render: (props) => VNode\n scopedSlots: Record<string, (props) => VNode>\n class: string\n templatePromiseClass: string\n onCancel: (reject) => void\n onBeforeCancel: (reject) => void\n cancelText?: string\n onConfirm: (resolve) => void\n onBeforeConfirm: (resolve) => void\n confirmText?: string\n showFooter: boolean\n }\n>\nexport type ExpandDialogOptions = {\n title?: string\n dialogProps?: DialogOptions\n}\nconst bem = createNameSpace('dialog')\n\nexport const useDialog = (options: DialogOptions = {}) => {\n const { t } = useLocale()\n const {\n scopedSlots = {},\n instance,\n render,\n destroyOnClose,\n onConfirm,\n onBeforeConfirm,\n confirmText,\n onCancel,\n onBeforeCancel,\n cancelText,\n showFooter = true,\n templatePromiseClass,\n ...dialogProps\n } = options\n\n const Dialog = useTemplatePromise<any>({\n destroy: destroyOnClose,\n class: templatePromiseClass,\n render: (promiseOptions, ctx) => {\n // 插槽参数增加promiseOptions\n for (const key in scopedSlots) {\n scopedSlots[key] = scopedSlots[key].bind(null, promiseOptions)\n }\n const { resolve, reject, isResolving } = promiseOptions\n const renderFunc = () => {\n return render\n ? render(promiseOptions)\n : ctx.slots.default?.(promiseOptions)\n }\n const slots: DialogOptions['scopedSlots'] = {}\n if (showFooter) {\n slots.footer = () => (\n <div class={bem.e('footer')}>\n {scopedSlots.footerPrepend?.(promiseOptions)}\n <ElButton\n size=\"default\"\n onClick={async () => {\n if (onBeforeCancel) {\n await onBeforeCancel(reject)\n }\n if (onCancel) {\n onCancel(reject)\n } else {\n reject('cancel')\n }\n }}\n >\n {cancelText || t('ep.dialog.cancel')}\n </ElButton>\n {scopedSlots.footerInner?.(promiseOptions)}\n <ElButton\n type=\"primary\"\n onClick={async () => {\n console.log(111);\n \n if (onBeforeConfirm) {\n await onBeforeConfirm(resolve)\n }\n if (onConfirm) {\n onConfirm(resolve)\n } else {\n resolve('confirm')\n }\n }}\n loading={isResolving}\n >\n {confirmText || t('ep.dialog.confirm')}\n </ElButton>\n {scopedSlots.footerAppend?.(promiseOptions)}\n </div>\n )\n }\n return (\n <ElDialog\n class={bem.b()}\n modelValue={true}\n {...{\n closeOnClickModal: false,\n closeOnPressEscape: false,\n title: t('ep.dialog.title'),\n center: false,\n // 'append-to-body': true,\n beforeClose: () => {\n reject('cancel')\n },\n ...prepareProps(dialogProps, ['modelValue']),\n }}\n v-slots={{\n ...slots,\n ...scopedSlots,\n }}\n >\n {renderFunc()}\n </ElDialog>\n )\n },\n })\n if (render) {\n // const app = createApp(component)\n // Object.assign(app._context, parentInstance.appContext)\n // app.mount(container)\n const container = document.createElement('div')\n // container.setAttribute('id', 'ep-dialog-container')\n const newInstance = instance || getCurrentInstance()\n const config = inject(configProviderContextKey) as any\n // const parentConfig =\n // newInstance?.provides[configProviderContextKey] ||\n // newInstance?.appContext?.provides[configProviderContextKey]\n // const vnode = h(Dialog)\n const vnode = h(\n ElConfigProvider,\n { locale: config?.locale },\n { default: () => h(Dialog) },\n )\n if (newInstance && newInstance.appContext) {\n // 强制继承父应用的全局组件、指令和插件\n vnode.appContext = newInstance.appContext\n }\n nextTick(() => {\n vRender(vnode, container)\n document.body.appendChild(container)\n })\n }\n\n return Dialog\n}\n"],"names":["bem","createNameSpace","useDialog","options","t","useLocale","scopedSlots","instance","render","destroyOnClose","onConfirm","onBeforeConfirm","confirmText","onCancel","onBeforeCancel","cancelText","showFooter","templatePromiseClass","dialogProps","Dialog","useTemplatePromise","destroy","class","promiseOptions","ctx","key","bind","resolve","reject","isResolving","renderFunc","slots","default","footer","_createVNode","e","footerPrepend","ElButton","footerInner","console","log","footerAppend","ElDialog","_mergeProps","b","closeOnClickModal","closeOnPressEscape","title","center","beforeClose","prepareProps","container","document","createElement","newInstance","getCurrentInstance","config","inject","configProviderContextKey","vnode","h","ElConfigProvider","locale","appContext","nextTick","vRender","body","appendChild"],"mappings":";;;;;;;AAmCA,MAAMA,GAAAA,GAAMC,gBAAgB,QAAQ,CAAA;AAE7B,MAAMC,SAAAA,GAAYA,CAACC,OAAAA,GAAyB,EAAC,KAAM;AACxD,EAAA,MAAM;AAAA,IAAEC;AAAAA,MAAMC,SAAAA,EAAU;AACxB,EAAA,MAAM;AAAA,IACJC,cAAc,EAAC;AAAA,IACfC,QAAAA;AAAAA,YACAC,QAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA,GAAa,IAAA;AAAA,IACbC,oBAAAA;AAAAA,IACA,GAAGC;AAAAA,GACL,GAAI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A,CAO7CF,UAAAA,EAAY,CAAA;AAAA,QAJX,GAAGC,KAAAA;AAAAA,QACH,GAAGzB;AAAAA,OAAW,CAAA;AAAA,IAMtB;AAAA,GACD,CAAA;AACD,EAAA,IAAIE,QAAAA,EAAQ;AAIV,IAAA,MAAM2C,SAAAA,GAAYC,QAAAA,CAASC,aAAAA,CAAc,KAAK,CAAA;AAE9C,IAAA,MAAMC,WAAAA,GAAc/C,YAAYgD,kBAAAA,EAAmB;AACnD,IAAA,MAAMC,MAAAA,GAASC,OAAOC,wBAAwB,CAAA;AAK9C,IAAA,MAAMC,KAAAA,GAAQC,EACZC,gBAAAA,EACA;AAAA,MAAEC,QAAQN,MAAAA,EAAQM;AAAAA,KAAO,EACzB;AAAA,MAAE9B,OAAAA,EAASA,MAAM4B,CAAAA,CAAEzC,MAAM;AAAA,KAC3B,CAAA;AACA,IAAA,IAAImC,WAAAA,IAAeA,YAAYS,UAAAA,EAAY;AAEzCJ,MAAAA,KAAAA,CAAMI,aAAaT,WAAAA,CAAYS,UAAAA;AAAAA,IACjC;AACAC,IAAAA,QAAAA,CAAS,MAAM;AACbC,MAAAA,MAAAA,CAAQN,OAAOR,SAAS,CAAA;AACxBC,MAAAA,QAAAA,CAASc,IAAAA,CAAKC,YAAYhB,SAAS,CAAA;AAAA,IACrC,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAOhC,MAAAA;AACT;;;;"}
|
package/es/hooks/use-request.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ref } from 'vue';
|
|
2
|
+
import axios from 'axios';
|
|
2
3
|
import { http } from '../utils/http/index.mjs';
|
|
3
4
|
|
|
4
5
|
const useRequest = ({
|
|
@@ -19,11 +20,6 @@ const useRequest = ({
|
|
|
19
20
|
const config = {
|
|
20
21
|
method
|
|
21
22
|
};
|
|
22
|
-
if (cancelToken) {
|
|
23
|
-
config.cancelRequest = (cancel) => {
|
|
24
|
-
cancelRequest = cancel;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
23
|
apiFn = (data = {}, params) => {
|
|
28
24
|
if (config.method === "get") {
|
|
29
25
|
config.params = data;
|
|
@@ -47,29 +43,38 @@ const useRequest = ({
|
|
|
47
43
|
if (reqBefore) {
|
|
48
44
|
reqBefore(config);
|
|
49
45
|
}
|
|
46
|
+
if (cancelToken) {
|
|
47
|
+
config.cancelToken = new axios.CancelToken(function(cancel) {
|
|
48
|
+
cancelRequest = cancel;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
50
51
|
return http.request(api, config);
|
|
51
52
|
};
|
|
52
53
|
} else {
|
|
53
54
|
apiFn = api;
|
|
54
55
|
}
|
|
55
|
-
const requestFn = async (data = {}) => {
|
|
56
|
+
const requestFn = async (data = {}, params) => {
|
|
56
57
|
if (loading.value && !cancelToken) return;
|
|
57
58
|
loading.value = true;
|
|
58
59
|
try {
|
|
59
60
|
cancelRequest && cancelRequest();
|
|
60
|
-
const res = await apiFn(data);
|
|
61
|
+
const res = await apiFn(data, params);
|
|
61
62
|
if (reqAfter) {
|
|
62
63
|
reqAfter(res);
|
|
63
64
|
}
|
|
64
65
|
if (hooks?.success) {
|
|
65
66
|
hooks.success(typeof api === "function" ? res : res.data);
|
|
66
67
|
}
|
|
68
|
+
loading.value = false;
|
|
67
69
|
} catch (error) {
|
|
68
70
|
if (hooks?.fail) {
|
|
69
71
|
hooks.fail(error);
|
|
70
72
|
}
|
|
71
|
-
|
|
73
|
+
if (axios.isCancel(error)) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
72
76
|
loading.value = false;
|
|
77
|
+
} finally {
|
|
73
78
|
}
|
|
74
79
|
};
|
|
75
80
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-request.mjs","sources":["../../../../packages/hooks/use-request.ts"],"sourcesContent":["import { ref } from 'vue'\nimport { type Ref } from 'vue'\nimport type { Api, ReqAfter, ReqBefore, Method } from '@el-plus/types'\nimport type { Canceler } from 'axios'\nimport { http } from '@el-plus/utils/http'\ntype UseRequest = (config: {\n api?: Api\n method?: Method\n reqData?: Record<string, unknown>\n reqParams?: Record<string, unknown>\n reqBefore?: ReqBefore\n reqAfter?: ReqAfter\n cancelToken?: boolean\n hooks?: {\n success?: (data: unknown) => void\n fail?: (error: unknown) => void\n }\n}) => {\n loading?: Ref<boolean>\n requestFn?: (data?: Record<string, unknown>) => Promise<void>\n}\n\nexport const useRequest: UseRequest = ({\n api,\n method = 'post',\n reqData,\n reqParams,\n reqBefore,\n reqAfter,\n cancelToken,\n hooks,\n}) => {\n if (!api) return {}\n const loading = ref(false)\n let cancelRequest: Canceler\n let apiFn\n if (typeof api === 'string') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const config: Record<string, any> = {\n method,\n }\n
|
|
1
|
+
{"version":3,"file":"use-request.mjs","sources":["../../../../packages/hooks/use-request.ts"],"sourcesContent":["import { ref } from 'vue'\nimport { type Ref } from 'vue'\nimport type { Api, ReqAfter, ReqBefore, Method } from '@el-plus/types'\nimport type { Canceler } from 'axios'\nimport axios from 'axios'\nimport { http } from '@el-plus/utils/http'\ntype UseRequest = (config: {\n api?: Api\n method?: Method\n reqData?: Record<string, unknown>\n reqParams?: Record<string, unknown>\n reqBefore?: ReqBefore\n reqAfter?: ReqAfter\n cancelToken?: boolean\n hooks?: {\n success?: (data: unknown) => void\n fail?: (error: unknown) => void\n }\n}) => {\n loading?: Ref<boolean>\n requestFn?: (data?: Record<string, unknown>) => Promise<void>\n}\n\nexport const useRequest: UseRequest = ({\n api,\n method = 'post',\n reqData,\n reqParams,\n reqBefore,\n reqAfter,\n cancelToken,\n hooks,\n}) => {\n if (!api) return {}\n const loading = ref(false)\n let cancelRequest: Canceler\n let apiFn\n if (typeof api === 'string') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const config: Record<string, any> = {\n method,\n }\n apiFn = (data: Record<string, any> = {}, params?: Record<string, any>) => {\n if (config.method === 'get') {\n config.params = data\n } else {\n config.data = data\n config.params = params\n }\n config.data = {\n ...reqData,\n ...config.data,\n }\n config.params = {\n ...reqParams,\n ...config.params,\n }\n // 替换$query为$searchValue\n if (config.data.$query) {\n config.data[config.data.$query] = data.$searchValue\n delete config.data.$searchValue\n delete config.data.$query\n }\n\n if (reqBefore) {\n reqBefore(config)\n }\n if (cancelToken) {\n config.cancelToken = new axios.CancelToken(function (cancel) {\n cancelRequest = cancel\n })\n }\n return http.request(api, config)\n }\n } else {\n apiFn = api\n }\n const requestFn = async (data: Record<string, unknown> = {}, params?: Record<string, unknown>) => {\n if (loading.value && !cancelToken) return\n loading.value = true\n try {\n cancelRequest && cancelRequest()\n const res = await apiFn(data, params)\n // 如果api是函数,直接追加success,data\n if (reqAfter) {\n reqAfter(res)\n }\n if (hooks?.success) {\n hooks.success(typeof api === 'function' ? res : res.data)\n }\n loading.value = false\n\n } catch (error) {\n if (hooks?.fail) {\n hooks.fail(error)\n }\n if(axios.isCancel(error)){\n return\n }\n loading.value = false\n } finally {\n }\n }\n return {\n loading,\n requestFn,\n }\n}\n"],"names":[],"mappings":";;;;AAuBO,MAAM,aAAyB,CAAC;AAAA,EACrC,GAAA;AAAA,EACA,MAAA,GAAS,MAAA;AAAA,EACT,OAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,IAAI,CAAC,GAAA,EAAK,OAAO,EAAC;AAClB,EAAA,MAAM,OAAA,GAAU,IAAI,KAAK,CAAA;AACzB,EAAA,IAAI,aAAA;AACJ,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI,OAAO,QAAQ,QAAA,EAAU;AAE3B,IAAA,MAAM,MAAA,GAA8B;AAAA,MAClC;AAAA,KACF;AACA,IAAA,KAAA,GAAQ,CAAC,IAAA,GAA4B,EAAC,EAAG,MAAA,KAAiC;AACxE,MAAA,IAAI,MAAA,CAAO,WAAW,KAAA,EAAO;AAC3B,QAAA,MAAA,CAAO,MAAA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AM,KAAA,CAAM,IAAA,EAAM,MAAM,CAAA;AAEpC,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,QAAA,CAAS,GAAG,CAAA;AAAA,MACd;AACA,MAAA,IAAI,OAAO,OAAA,EAAS;AAClB,QAAA,KAAA,CAAM,QAAQ,OAAO,GAAA,KAAQ,UAAA,GAAa,GAAA,GAAM,IAAI,IAAI,CAAA;AAAA,MAC1D;AACA,MAAA,OAAA,CAAQ,KAAA,GAAQ,KAAA;AAAA,IAElB,SAAS,KAAA,EAAO;AACd,MAAA,IAAI,OAAO,IAAA,EAAM;AACf,QAAA,KAAA,CAAM,KAAK,KAAK,CAAA;AAAA,MAClB;AACA,MAAA,IAAG,KAAA,CAAM,QAAA,CAAS,KAAK,CAAA,EAAE;AACvB,QAAA;AAAA,MACF;AACA,MAAA,OAAA,CAAQ,KAAA,GAAQ,KAAA;AAAA,IAClB,CAAA,SAAE;AAAA,IACF;AAAA,EACF,CAAA;AACA,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
|
@@ -3,6 +3,7 @@ export interface TemplatePromiseOptions {
|
|
|
3
3
|
transition?: TransitionProps;
|
|
4
4
|
destroy?: boolean;
|
|
5
5
|
render?: (props: any, ctx: SetupContext) => VNode;
|
|
6
|
+
class?: string;
|
|
6
7
|
}
|
|
7
8
|
export type TemplatePromise<Return, Args extends any[] = []> = DefineComponent<object> & {} & {
|
|
8
9
|
open: (...args: Args) => Promise<Return>;
|
|
@@ -69,7 +69,7 @@ const useTemplatePromise = (options = {}) => {
|
|
|
69
69
|
const renderList = () => instances.value.map((props) => {
|
|
70
70
|
return withDirectives(h("div", {
|
|
71
71
|
// key: props.key,
|
|
72
|
-
class:
|
|
72
|
+
class: `ep-template-promise is-init ${options.class || ""}`
|
|
73
73
|
}, render ? render(props, ctx) : slots.default?.(props)), [[vShow, props.isVisible]]);
|
|
74
74
|
});
|
|
75
75
|
if (transition) return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-template-promise.mjs","sources":["../../../../packages/hooks/use-template-promise.tsx"],"sourcesContent":["// 参考 https://github.com/vueuse/vueuse/blob/main/packages/core/createTemplatePromise/index.ts\n\nimport type {\n DefineComponent,\n Ref,\n TransitionProps,\n VNode,\n SetupContext,\n} from 'vue'\nimport {\n defineComponent,\n ref,\n shallowReactive,\n Transition,\n Fragment,\n h,\n createApp,\n getCurrentInstance,\n render as vRender,\n markRaw,\n withDirectives,\n vShow,\n nextTick,\n} from 'vue'\n\nexport interface TemplatePromiseOptions {\n // 过渡\n transition?: TransitionProps\n // 是否销毁\n destroy?: boolean\n // 自定义渲染\n render?: (props, ctx: SetupContext) => VNode\n}\nexport type TemplatePromise<\n Return,\n Args extends any[] = [],\n> = DefineComponent<object> & {\n // new (): {\n // $slots: {\n // default: (_: TemplatePromiseProps<Return, Args>) => any\n // }\n // }\n} & {\n open: (...args: Args) => Promise<Return>\n}\nexport interface TemplatePromiseProps<Return, Args extends any[] = []> {\n promise: Promise<Return> | undefined\n resolve: (v: Return) => void\n reject: (v: any) => void\n args: Args\n options: TemplatePromiseOptions\n isResolving: boolean\n isVisible: boolean\n key: number\n}\nexport const useTemplatePromise = <Return, Args extends any[] = []>(\n options: TemplatePromiseOptions = {},\n): TemplatePromise<Return, Args> => {\n const {\n destroy = false,\n render,\n transition = {\n name: 'fade',\n appear: true,\n },\n } = options\n const instances = ref([]) as Ref<TemplatePromiseProps<Return, Args>[]>\n let index = 0\n\n const create = (...args: Args) => {\n const key = index++\n const props = shallowReactive<TemplatePromiseProps<Return, Args>>({\n key,\n args,\n promise: undefined,\n resolve: () => {},\n reject: () => {},\n isResolving: false,\n isVisible: true,\n options,\n })\n instances.value.push(props)\n props.promise = new Promise<Return>((_resolve, _reject) => {\n props.resolve = (v) => {\n props.isResolving = true\n return _resolve(v)\n }\n props.reject = _reject\n }).finally(() => {\n if (destroy) {\n props.promise = undefined\n const index = instances.value.indexOf(props)\n if (index !== -1) instances.value.splice(index, 1)\n } else {\n props.isVisible = false\n // const wrapper = document.querySelector(\n // '.ep-template-promise',\n // ) as HTMLElement\n // if (wrapper.style['zIndex']) {\n // return\n // }\n // const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n // const zIndex = dialog ? dialog.style['z-index'] : ''\n // if (zIndex && wrapper) {\n // wrapper.style.zIndex = zIndex\n // }\n }\n })\n return props.promise\n }\n const open = (...args: Args) => {\n instances.value = []\n const com = create(...args)\n nextTick(() => {\n const wrapper = document.querySelector(\n '.ep-template-promise.is-init',\n ) as HTMLElement\n if (wrapper) {\n const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n const zIndex = dialog ? dialog.style['z-index'] : ''\n if (zIndex && wrapper) {\n wrapper.style.zIndex = zIndex\n }\n // 删除is-init的class\n wrapper.classList.remove('is-init')\n }\n })\n return com\n }\n const component = defineComponent((_, ctx) => {\n const { slots } = ctx\n const renderList = () =>\n instances.value.map((props) => {\n return withDirectives(\n h(\n 'div',\n {\n // key: props.key,\n class:
|
|
1
|
+
{"version":3,"file":"use-template-promise.mjs","sources":["../../../../packages/hooks/use-template-promise.tsx"],"sourcesContent":["// 参考 https://github.com/vueuse/vueuse/blob/main/packages/core/createTemplatePromise/index.ts\n\nimport type {\n DefineComponent,\n Ref,\n TransitionProps,\n VNode,\n SetupContext,\n} from 'vue'\nimport {\n defineComponent,\n ref,\n shallowReactive,\n Transition,\n Fragment,\n h,\n createApp,\n getCurrentInstance,\n render as vRender,\n markRaw,\n withDirectives,\n vShow,\n nextTick,\n} from 'vue'\n\nexport interface TemplatePromiseOptions {\n // 过渡\n transition?: TransitionProps\n // 是否销毁\n destroy?: boolean\n // 自定义渲染\n render?: (props, ctx: SetupContext) => VNode\n // class 名\n class?: string\n}\nexport type TemplatePromise<\n Return,\n Args extends any[] = [],\n> = DefineComponent<object> & {\n // new (): {\n // $slots: {\n // default: (_: TemplatePromiseProps<Return, Args>) => any\n // }\n // }\n} & {\n open: (...args: Args) => Promise<Return>\n}\nexport interface TemplatePromiseProps<Return, Args extends any[] = []> {\n promise: Promise<Return> | undefined\n resolve: (v: Return) => void\n reject: (v: any) => void\n args: Args\n options: TemplatePromiseOptions\n isResolving: boolean\n isVisible: boolean\n key: number\n}\nexport const useTemplatePromise = <Return, Args extends any[] = []>(\n options: TemplatePromiseOptions = {},\n): TemplatePromise<Return, Args> => {\n const {\n destroy = false,\n render,\n transition = {\n name: 'fade',\n appear: true,\n },\n } = options\n const instances = ref([]) as Ref<TemplatePromiseProps<Return, Args>[]>\n let index = 0\n\n const create = (...args: Args) => {\n const key = index++\n const props = shallowReactive<TemplatePromiseProps<Return, Args>>({\n key,\n args,\n promise: undefined,\n resolve: () => {},\n reject: () => {},\n isResolving: false,\n isVisible: true,\n options,\n })\n instances.value.push(props)\n props.promise = new Promise<Return>((_resolve, _reject) => {\n props.resolve = (v) => {\n props.isResolving = true\n return _resolve(v)\n }\n props.reject = _reject\n }).finally(() => {\n if (destroy) {\n props.promise = undefined\n const index = instances.value.indexOf(props)\n if (index !== -1) instances.value.splice(index, 1)\n } else {\n props.isVisible = false\n // const wrapper = document.querySelector(\n // '.ep-template-promise',\n // ) as HTMLElement\n // if (wrapper.style['zIndex']) {\n // return\n // }\n // const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n // const zIndex = dialog ? dialog.style['z-index'] : ''\n // if (zIndex && wrapper) {\n // wrapper.style.zIndex = zIndex\n // }\n }\n })\n return props.promise\n }\n const open = (...args: Args) => {\n instances.value = []\n const com = create(...args)\n nextTick(() => {\n const wrapper = document.querySelector(\n '.ep-template-promise.is-init',\n ) as HTMLElement\n if (wrapper) {\n const dialog = wrapper?.querySelector('.el-modal-dialog') as HTMLElement\n const zIndex = dialog ? dialog.style['z-index'] : ''\n if (zIndex && wrapper) {\n wrapper.style.zIndex = zIndex\n }\n // 删除is-init的class\n wrapper.classList.remove('is-init')\n }\n })\n return com\n }\n const component = defineComponent((_, ctx) => {\n const { slots } = ctx\n const renderList = () =>\n instances.value.map((props) => {\n return withDirectives(\n h(\n 'div',\n {\n // key: props.key,\n class: `ep-template-promise is-init ${options.class || ''}`,\n },\n render ? render(props, ctx) : slots.default?.(props),\n ),\n [[vShow, props.isVisible]],\n )\n })\n if (transition)\n return () => <Transition {...transition}>{renderList()}</Transition>\n\n return renderList\n })\n // @ts-expect-error There's a breaking type change in Vue 3.3 <https://github.com/vuejs/core/pull/7963>\n component.open = open\n return markRaw(component as TemplatePromise<Return, Args>)\n}\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","useTemplatePromise","options","destroy","render","transition","name","appear","instances","ref","index","create","args","key","props","shallowReactive","promise","undefined","resolve","reject","isResolving","isVisible","value","push","Promise","_resolve","_reject","v","finally","indexOf","splice","open","com","nextTick","wrapper","document","querySelector","dialog","zIndex","style","classList","remove","component","defineComponent","_","ctx","slots","renderList","map","withDirectives","h","class","default","vShow","_slot","_createVNode","Transition","markRaw"],"mappings":";;AAuBY,SAAAA,QAAAC,CAAAA,EAAA;AAAA,EAAA,OAAA,OAAAA,CAAAA,KAAA,UAAA,IAAAC,MAAAA,CAAAC,SAAAA,CAAAC,QAAAA,CAAAC,IAAAA,CAAAJ,CAAA,CAAA,KAAA,iBAAA,IAAA,CAAAK,OAAAA,CAAAL,CAAA,CAAA;AAAA;AAkCL,MAAMM,kBAAAA,GAAqBA,CAChCC,OAAAA,GAAkC,EAAC,KACD;AAClC,EAAA,MAAM;AAAA,IACJC,OAAAA,GAAU,KAAA;AAAA,IACVC,MAAAA;AAAAA,IACAC,UAAAA,GAAa;AAAA,MACXC,IAAAA,EAAM,MAAA;AAAA,MACNC,MAAAA,EAAQ;AAAA;AACV,GACF,GAAIL,OAAAA;AACJ,EAAA,MAAMM,SAAAA,GAAYC,GAAAA,CAAI,EAAE,CAAA;AACxB,EAAA,IAAIC,KAAAA,GAAQ,CAAA;AAEZ,EAAA,MAAMC,MAAAA,GAASA,IAAIC,IAAAA,KAAe;AAChC,IAAA,MA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C3B,CAAA;AAAA,IACF,CAAC,CAAA;AACH,IAAA,IAAIhB,UAAAA,SACK,MAAA;AAAA,MAAA,IAAAiD,KAAAA;AAAA,MAAA,OAAAC,WAAAA,CAAAC,YAAsBnD,UAAAA,EAAUX,OAAAA,CAAA4D,QAAGP,UAAAA,EAAY,IAAAO,KAAAA,GAAA;AAAA,QAAAF,OAAAA,EAAAA,MAAA,CAAAE,KAAA;AAAA,OAAA,CAAA;AAAA,IAAA,CAAA;AAExD,IAAA,OAAOP,UAAAA;AAAAA,EACT,CAAC,CAAA;AAEDL,EAAAA,SAAAA,CAAUX,IAAAA,GAAOA,IAAAA;AACjB,EAAA,OAAO0B,QAAQf,SAA0C,CAAA;AAC3D;;;;"}
|
package/es/package.json.mjs
CHANGED
|
@@ -29,11 +29,20 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
29
29
|
const bem$1 = bem.createNameSpace("attachment");
|
|
30
30
|
const props$1 = __props;
|
|
31
31
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
32
|
-
const {
|
|
32
|
+
const {
|
|
33
|
+
columns,
|
|
34
|
+
actionButtons,
|
|
35
|
+
addAttachment,
|
|
36
|
+
isNormalOpen,
|
|
37
|
+
permission,
|
|
38
|
+
onConfirm,
|
|
39
|
+
onCancel,
|
|
40
|
+
mode
|
|
41
|
+
} = useAttachment.useAttachment(props$1, {
|
|
33
42
|
data: modelValue
|
|
34
43
|
});
|
|
35
44
|
const AttachmentDialog = useDialog.useDialog({
|
|
36
|
-
width: 850,
|
|
45
|
+
width: isNormalOpen ? "" : 850,
|
|
37
46
|
center: true,
|
|
38
47
|
title: isNormalOpen ? "" : t("ep.attachment.manageAttachment"),
|
|
39
48
|
modal: !isNormalOpen,
|
|
@@ -44,6 +53,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
53
|
"dialog",
|
|
45
54
|
props$1.openType === "normal" ? props$1.openType : ""
|
|
46
55
|
),
|
|
56
|
+
templatePromiseClass: bem$1.e("promise"),
|
|
47
57
|
onConfirm: async (resolve) => {
|
|
48
58
|
onConfirm(resolve);
|
|
49
59
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.vue2.js","sources":["../../../../../../packages/components/attachment/src/attachment.vue"],"sourcesContent":["<template>\n <ElButton\n v-if=\"props.isShowOpenDialogButton\"\n type=\"primary\"\n plain\n size=\"small\"\n :class=\"bem.e('handler')\"\n @click=\"open\"\n v-permission=\"permission\"\n >\n {{ t('ep.attachment.manageAttachment') }}({{ modelValue?.length || 0 }})\n </ElButton>\n <AttachmentDialog>\n <div style=\"margin-bottom: 10px; text-align: right\">\n <EpButtons\n v-if=\"props.openType === 'dialog' && mode !== 'browse'\"\n type=\"primary\"\n :list=\"[\n {\n name: t('ep.attachment.addAttachment'),\n type: 'primary',\n onClick: addAttachment,\n },\n ]\"\n />\n </div>\n\n <EpTable\n ref=\"tableRef\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n :style=\"{\n ...prepareStyles(),\n }\"\n :columns=\"columns\"\n :action-buttons=\"actionButtons\"\n
|
|
1
|
+
{"version":3,"file":"attachment.vue2.js","sources":["../../../../../../packages/components/attachment/src/attachment.vue"],"sourcesContent":["<template>\n <ElButton\n v-if=\"props.isShowOpenDialogButton\"\n type=\"primary\"\n plain\n size=\"small\"\n :class=\"bem.e('handler')\"\n @click=\"open\"\n v-permission=\"permission\"\n >\n {{ t('ep.attachment.manageAttachment') }}({{ modelValue?.length || 0 }})\n </ElButton>\n <AttachmentDialog>\n <div style=\"margin-bottom: 10px; text-align: right\">\n <EpButtons\n v-if=\"props.openType === 'dialog' && mode !== 'browse'\"\n type=\"primary\"\n :list=\"[\n {\n name: t('ep.attachment.addAttachment'),\n type: 'primary',\n onClick: addAttachment,\n },\n ]\"\n />\n </div>\n\n <EpTable\n ref=\"tableRef\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n :style=\"{\n ...prepareStyles(),\n }\"\n :columns=\"columns\"\n :action-buttons=\"actionButtons\"\n actionColWidth=\"110\"\n :data=\"modelValue\"\n v-bind=\"props\"\n >\n </EpTable>\n </AttachmentDialog>\n</template>\n<script setup lang=\"ts\">\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareClassNames, prepareStyles } from '@el-plus/utils/props'\nimport { attachmentProps } from './attachment'\nimport EpTable from '@el-plus/components/table'\nimport { useAttachment } from './use-attachment'\nimport type { TableProps } from '@el-plus/components/table'\nimport { useDialog } from '@el-plus/hooks/dialog/use-dialog'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nimport { ElButton } from 'element-plus'\nimport { vPermission } from '@el-plus/directives'\n\nconst { t } = useLocale()\ndefineOptions({\n name: 'EpAttachment',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('attachment')\nconst props = defineProps(attachmentProps)\nconst modelValue = defineModel<TableProps['data']>()\nconst {\n columns,\n actionButtons,\n addAttachment,\n isNormalOpen,\n permission,\n onConfirm,\n onCancel,\n mode,\n} = useAttachment(props, {\n data: modelValue,\n})\nconst AttachmentDialog = useDialog({\n width: isNormalOpen ? '' : 850,\n center: true,\n title: isNormalOpen ? '' : t('ep.attachment.manageAttachment'),\n modal: !isNormalOpen,\n showClose: !isNormalOpen,\n showFooter: !isNormalOpen,\n transition: isNormalOpen ? '' : 'dialog-fade',\n modalClass: bem.em(\n 'dialog',\n props.openType === 'normal' ? props.openType : '',\n ),\n templatePromiseClass: bem.e('promise'),\n onConfirm: async (resolve) => {\n onConfirm(resolve)\n },\n onCancel: (resolve) => {\n onCancel(resolve)\n },\n})\nconst open = AttachmentDialog.open\nif (isNormalOpen) {\n open()\n}\ndefineExpose({\n open,\n})\n</script>\n"],"names":["useLocale","bem","createNameSpace","props","_useModel","useAttachment","useDialog","_createBlock","_unref","ElButton","_normalizeClass","_createTextVNode","_toDisplayString","_createVNode","_createElementVNode","_mergeProps","prepareClassNames","prepareStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA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,SAAA,CAAAQ,uBAAA,CAAA,EAAiB,CAAA,CAAA;AAAA,cACtC,KAAA,EAAK;AAAA,mBAAeR,SAAA,CAAAS,mBAAA,CAAA;AAAa;cAGjC,OAAA,EAAST,UAAA,OAAA,CAAA;AAAA,cACT,gBAAA,EAAgBA,UAAA,aAAA,CAAA;AAAA,cACjB,cAAA,EAAe,KAAA;AAAA,cACd,MAAM,UAAA,CAAA;AAAA,eACCL,OAAK,CAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAAA;;;;;;;;;;"}
|
|
@@ -68,6 +68,7 @@ export declare const EpForm: {
|
|
|
68
68
|
validate: () => import("element-plus").FormValidationResult;
|
|
69
69
|
resetFields: (props: import("element-plus").FormItemProp) => void;
|
|
70
70
|
clearValidate: (props: import("element-plus").FormItemProp) => void;
|
|
71
|
+
getFormItemRenderRef: (refName: string) => any;
|
|
71
72
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
73
|
toggleStatus: (status: boolean) => void;
|
|
73
74
|
validate: (prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => void;
|
|
@@ -165,6 +166,7 @@ export declare const EpForm: {
|
|
|
165
166
|
validate: () => import("element-plus").FormValidationResult;
|
|
166
167
|
resetFields: (props: import("element-plus").FormItemProp) => void;
|
|
167
168
|
clearValidate: (props: import("element-plus").FormItemProp) => void;
|
|
169
|
+
getFormItemRenderRef: (refName: string) => any;
|
|
168
170
|
}, {}, {}, {}, {
|
|
169
171
|
col: number;
|
|
170
172
|
size: import("element-plus/es/utils/index.js").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>;
|
|
@@ -255,6 +257,7 @@ export declare const EpForm: {
|
|
|
255
257
|
validate: () => import("element-plus").FormValidationResult;
|
|
256
258
|
resetFields: (props: import("element-plus").FormItemProp) => void;
|
|
257
259
|
clearValidate: (props: import("element-plus").FormItemProp) => void;
|
|
260
|
+
getFormItemRenderRef: (refName: string) => any;
|
|
258
261
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
259
262
|
toggleStatus: (status: boolean) => void;
|
|
260
263
|
validate: (prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => void;
|
|
@@ -20,7 +20,7 @@ var EpFormItem = /* @__PURE__ */ vue.defineComponent({
|
|
|
20
20
|
const attrs = vue.useAttrs();
|
|
21
21
|
const {
|
|
22
22
|
scopedSlots
|
|
23
|
-
} = useFormItem.useFormItemSlots(props$1);
|
|
23
|
+
} = useFormItem.useFormItemSlots(props$1, emit);
|
|
24
24
|
const {
|
|
25
25
|
rules
|
|
26
26
|
} = useFormItem.useFormItemRules(props$1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item-vue.js","sources":["../../../../../../packages/components/form/src/form-item-vue.tsx"],"sourcesContent":["import { defineComponent, useAttrs } from 'vue'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { useFormItemRules, useFormItemSlots } from './hooks/use-form-item'\nimport { ElFormItem } from 'element-plus'\n\nimport { formItemProps, expandFormItemPropsKeys } from './form-item'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\nconst bem = createNameSpace('form-item')\nexport default defineComponent({\n name: 'EpFormItem',\n inheritAttrs: false,\n props: formItemProps,\n setup(props, { emit }) {\n // const {} = useFormItem(props)\n const attrs = useAttrs()\n const { scopedSlots } = useFormItemSlots(props)\n const { rules } = useFormItemRules(props)\n const { props: childProps, disabled, ...formItemProps } = props // eslint-disable-line\n return () => {\n return (\n <ElFormItem\n class={[\n bem.b(),\n bem.is('hide-label', !props.isShowLabel),\n prepareClassNames(),\n ]}\n style={prepareStyles()}\n v-slots={scopedSlots}\n {...{\n ...prepareProps(formItemProps, [...expandFormItemPropsKeys]),\n rules,\n 'label-width': attrs['form-label-width'],\n }}\n // scopedSlots={scopedSlots}\n // label={label}\n // prop={prop}\n // rules={mergeRules}\n // {...{ props: formItemProps }}\n />\n )\n }\n },\n})\n"],"names":["bem","createNameSpace","name","inheritAttrs","props","formItemProps","setup","emit","attrs","useAttrs","scopedSlots","useFormItemSlots","rules","useFormItemRules","childProps","disabled","_createVNode","ElFormItem","_mergeProps","b","is","isShowLabel","prepareClassNames","prepareStyles","prepareProps","expandFormItemPropsKeys"],"mappings":";;;;;;;;;;;AAYA,MAAMA,GAAAA,GAAMC,sBAAgB,WAAW,CAAA;AACvC,qDAA+B;AAAA,EAC7BC,IAAAA,EAAM,YAAA;AAAA,EACNC,YAAAA,EAAc,KAAA;AAAA,EACdC,KAAAA,EAAOC,sBAAAA;AAAAA,EACPC,MAAMF,OAAAA,EAAO;AAAA,IAAEG;AAAAA,GAAK,EAAG;AAErB,IAAA,MAAMC,QAAQC,YAAAA,EAAS;AACvB,IAAA,MAAM;AAAA,MAAEC;AAAAA,KAAY,GAAIC,
|
|
1
|
+
{"version":3,"file":"form-item-vue.js","sources":["../../../../../../packages/components/form/src/form-item-vue.tsx"],"sourcesContent":["import { defineComponent, useAttrs } from 'vue'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { useFormItemRules, useFormItemSlots } from './hooks/use-form-item'\nimport { ElFormItem } from 'element-plus'\n\nimport { formItemProps, expandFormItemPropsKeys } from './form-item'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\nconst bem = createNameSpace('form-item')\nexport default defineComponent({\n name: 'EpFormItem',\n inheritAttrs: false,\n props: formItemProps,\n setup(props, { emit }) {\n // const {} = useFormItem(props)\n const attrs = useAttrs()\n const { scopedSlots } = useFormItemSlots(props,emit)\n const { rules } = useFormItemRules(props)\n const { props: childProps, disabled, ...formItemProps } = props // eslint-disable-line\n return () => {\n return (\n <ElFormItem\n class={[\n bem.b(),\n bem.is('hide-label', !props.isShowLabel),\n prepareClassNames(),\n ]}\n style={prepareStyles()}\n v-slots={scopedSlots}\n {...{\n ...prepareProps(formItemProps, [...expandFormItemPropsKeys]),\n rules,\n 'label-width': attrs['form-label-width'],\n }}\n // scopedSlots={scopedSlots}\n // label={label}\n // prop={prop}\n // rules={mergeRules}\n // {...{ props: formItemProps }}\n />\n )\n }\n },\n})\n"],"names":["bem","createNameSpace","name","inheritAttrs","props","formItemProps","setup","emit","attrs","useAttrs","scopedSlots","useFormItemSlots","rules","useFormItemRules","childProps","disabled","_createVNode","ElFormItem","_mergeProps","b","is","isShowLabel","prepareClassNames","prepareStyles","prepareProps","expandFormItemPropsKeys"],"mappings":";;;;;;;;;;;AAYA,MAAMA,GAAAA,GAAMC,sBAAgB,WAAW,CAAA;AACvC,qDAA+B;AAAA,EAC7BC,IAAAA,EAAM,YAAA;AAAA,EACNC,YAAAA,EAAc,KAAA;AAAA,EACdC,KAAAA,EAAOC,sBAAAA;AAAAA,EACPC,MAAMF,OAAAA,EAAO;AAAA,IAAEG;AAAAA,GAAK,EAAG;AAErB,IAAA,MAAMC,QAAQC,YAAAA,EAAS;AACvB,IAAA,MAAM;AAAA,MAAEC;AAAAA,KAAY,GAAIC,4BAAAA,CAAiBP,OAAAA,EAAMG,IAAI,CAAA;AACnD,IAAA,MAAM;AAAA,MAAEK;AAAAA,KAAM,GAAIC,6BAAiBT,OAAK,CAAA;AACxC,IAAA,MAAM;AAAA,MAAEA,KAAAA,EAAOU,UAAAA;AAAAA,MAAYC,QAAAA;AAAAA,MAAU,GAAGV;AAAAA,KAAc,GAAID,OAAAA;AAC1D,IAAA,OAAO,MAAM;AACX,MAAA,OAAAY,eAAAA,CAAAC,wBAAAC,cAAAA,CAAA;AAAA,QAAA,OAAA,EAEW,CACLlB,GAAAA,CAAImB,CAAAA,EAAE,EACNnB,GAAAA,CAAIoB,EAAAA,CAAG,YAAA,EAAc,CAAChB,OAAAA,CAAMiB,WAAW,CAAA,EACvCC,yBAAmB,CAAA;AAAA,QACpB,SACMC,mBAAAA;AAAc,OAAC,EAAA;AAAA,QAGpB,GAAGC,kBAAAA,CAAanB,cAAAA,EAAe,CAAC,GAAGoB,gCAAuB,CAAC,CAAA;AAAA,QAC3Db,KAAAA;AAAAA,QACA,aAAA,EAAeJ,MAAM,kBAAkB;AAAA,OAAC,GAJjCE,WAAW,CAAA;AAAA,IAa1B,CAAA;AAAA,EACF;AACF,CAAC,CAAA;;;;"}
|
|
@@ -65,6 +65,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
65
65
|
validate: () => import("element-plus").FormValidationResult;
|
|
66
66
|
resetFields: (props: import("element-plus").FormItemProp) => void;
|
|
67
67
|
clearValidate: (props: import("element-plus").FormItemProp) => void;
|
|
68
|
+
getFormItemRenderRef: (refName: string) => any;
|
|
68
69
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
69
70
|
toggleStatus: (status: boolean) => void;
|
|
70
71
|
validate: (prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => void;
|
|
@@ -39,7 +39,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
41
|
const formData = vue.useModel(__props, "modelValue");
|
|
42
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
filterFormItemList,
|
|
44
|
+
elFormRef,
|
|
45
|
+
validate,
|
|
46
|
+
resetFields,
|
|
47
|
+
clearValidate,
|
|
48
|
+
getFormItemRenderRef,
|
|
49
|
+
registerFormItemRenderRef
|
|
50
|
+
} = useForm.useForm(props$1);
|
|
43
51
|
const { open, toggleStatus, isShowFoldBtn, isShowFormItem } = useForm.useCollapse(
|
|
44
52
|
{
|
|
45
53
|
filterFormItemList,
|
|
@@ -52,7 +60,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
52
60
|
elFormRef,
|
|
53
61
|
validate,
|
|
54
62
|
resetFields,
|
|
55
|
-
clearValidate
|
|
63
|
+
clearValidate,
|
|
64
|
+
getFormItemRenderRef
|
|
56
65
|
});
|
|
57
66
|
return (_ctx, _cache) => {
|
|
58
67
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -85,7 +94,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
85
94
|
vue.createVNode(vue.unref(formItemVue.default), vue.mergeProps({
|
|
86
95
|
"form-data": formData.value,
|
|
87
96
|
"form-label-width": _ctx.labelWidth
|
|
88
|
-
}, { ref_for: true }, item
|
|
97
|
+
}, { ref_for: true }, item, {
|
|
98
|
+
onRegisterFormItemRenderRef: (ref2) => vue.unref(registerFormItemRenderRef)(item.props?.ref, ref2)
|
|
99
|
+
}), null, 16, ["form-data", "form-label-width", "onRegisterFormItemRenderRef"])
|
|
89
100
|
]),
|
|
90
101
|
_: 2
|
|
91
102
|
}, 1032, ["class", "span"])), [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.vue2.js","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n bem.b(),\n prepareClassNames(),\n bem.is('open', open),\n bem.is('fold', isShowFoldBtn),\n ]\"\n :style=\"{\n ...prepareStyles(),\n }\"\n >\n <el-form ref=\"elFormRef\" :model=\"formData\" v-bind=\"customAttrs\">\n <slot>\n <el-row>\n <el-col\n v-for=\"(item, index) in filterFormItemList\"\n v-show=\"isShowFormItem(index)\"\n :key=\"item.prop || index\"\n :class=\"bem.e('col')\"\n :span=\"item.col || 24 / col\"\n >\n <FormItem\n :form-data=\"formData\"\n :form-label-width=\"labelWidth\"\n v-bind=\"item\"\n />\n </el-col>\n </el-row>\n </slot>\n </el-form>\n <div v-if=\"isShowFoldBtn\" :class=\"bem.e('fold')\" @click=\"toggleStatus\">\n {{ open ? t('ep.form.collapse') : t('ep.form.more') }}\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, reactive, ref, useTemplateRef } from 'vue'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport {\n formProps,\n formEmits,\n formEmitsKeys,\n expandFormPropsKeys,\n} from './form'\nimport type { FormEmits } from './form'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\nimport { ElForm, ElRow, ElCol } from 'element-plus'\nimport { useCollapse, useForm } from './hooks/use-form'\nimport FormItem from './form-item-vue'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nconst { t } = useLocale()\ndefineOptions({\n name: 'EpForm',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('form')\nconst props = defineProps(formProps)\nconst emit = defineEmits(formEmits)\nconst customAttrs = computed(() => {\n return {\n ...prepareProps(props, ['modelValue', 'model', ...expandFormPropsKeys]),\n hideRequiredAsterisk: true, // 隐藏必填星号, 使用自己的*\n scrollToError: true,\n ...prepareEvents<FormEmits>(emit, formEmitsKeys),\n }\n})\nconst formData = defineModel<Record<string, unknown>>({\n default: () => reactive({}),\n})\n\nconst {
|
|
1
|
+
{"version":3,"file":"form.vue2.js","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n bem.b(),\n prepareClassNames(),\n bem.is('open', open),\n bem.is('fold', isShowFoldBtn),\n ]\"\n :style=\"{\n ...prepareStyles(),\n }\"\n >\n <el-form ref=\"elFormRef\" :model=\"formData\" v-bind=\"customAttrs\">\n <slot>\n <el-row>\n <el-col\n v-for=\"(item, index) in filterFormItemList\"\n v-show=\"isShowFormItem(index)\"\n :key=\"item.prop || index\"\n :class=\"bem.e('col')\"\n :span=\"item.col || 24 / col\"\n >\n <FormItem\n :form-data=\"formData\"\n :form-label-width=\"labelWidth\"\n v-bind=\"item\"\n @registerFormItemRenderRef=\"\n (ref) => registerFormItemRenderRef(item.props?.ref, ref)\n \"\n />\n </el-col>\n </el-row>\n </slot>\n </el-form>\n <div v-if=\"isShowFoldBtn\" :class=\"bem.e('fold')\" @click=\"toggleStatus\">\n {{ open ? t('ep.form.collapse') : t('ep.form.more') }}\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, reactive, ref, useTemplateRef } from 'vue'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport {\n formProps,\n formEmits,\n formEmitsKeys,\n expandFormPropsKeys,\n} from './form'\nimport type { FormEmits } from './form'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\nimport { ElForm, ElRow, ElCol } from 'element-plus'\nimport { useCollapse, useForm } from './hooks/use-form'\nimport FormItem from './form-item-vue'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nconst { t } = useLocale()\ndefineOptions({\n name: 'EpForm',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('form')\nconst props = defineProps(formProps)\nconst emit = defineEmits(formEmits)\nconst customAttrs = computed(() => {\n return {\n ...prepareProps(props, ['modelValue', 'model', ...expandFormPropsKeys]),\n hideRequiredAsterisk: true, // 隐藏必填星号, 使用自己的*\n scrollToError: true,\n ...prepareEvents<FormEmits>(emit, formEmitsKeys),\n }\n})\nconst formData = defineModel<Record<string, unknown>>({\n default: () => reactive({}),\n})\n\nconst {\n filterFormItemList,\n elFormRef,\n validate,\n resetFields,\n clearValidate,\n getFormItemRenderRef,\n registerFormItemRenderRef,\n} = useForm(props)\n\nconst { open, toggleStatus, isShowFoldBtn, isShowFormItem } = useCollapse(\n {\n filterFormItemList,\n isShowFold: props.isShowFold,\n showFieldCount: props.showFieldCount,\n },\n emit,\n)\n\ndefineExpose({\n elFormRef,\n validate,\n resetFields,\n clearValidate,\n getFormItemRenderRef\n})\n</script>\n"],"names":["useLocale","bem","createNameSpace","props","computed","prepareProps","expandFormPropsKeys","prepareEvents","formEmitsKeys","_useModel","useForm","useCollapse","_createElementBlock","_normalizeClass","_unref","prepareClassNames","_normalizeStyle","prepareStyles","_createVNode","_mergeProps","_renderSlot","ElRow","_openBlock","_Fragment","_renderList","_createBlock","ElCol","col","labelWidth","ref","_vShow"],"mappings":";;;;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,0BACX,2BAAA,GAA6CC,IAAAA,KAAQf,SAAA,4BAA0B,IAAA,CAAK,KAAA,EAAO,GAAA,EAAKe,IAAG;AAAA;;;;sBAT9F,CAAAC,SAAA,EAAAhB,SAAA,CAAA,cAAA,CAAA,CAAe,KAAK,CAAA;AAAA;;;;;;;;;QAiBzBA,UAAA,aAAA,CAAA,qBAAXF,uBAEM,KAAA,EAAA;AAAA;UAFqB,OAAKC,kBAAA,CAAEC,SAAA,CAAAb,KAAA,CAAA,CAAI,CAAA,CAAC,MAAA,CAAA,CAAA;AAAA,UAAW,OAAA,EAAOa,UAAA,YAAA;AAAA,+BACpDA,SAAA,CAAA,IAAA,IAAOA,SAAA,CAAA,CAAA,CAAA,CAAC,kBAAA,CAAA,GAAuBA,SAAA,CAAA,CAAA,CAAA,CAAC,cAAA,CAAA,CAAA,EAAA,EAAA,EAAA,CAAA,SAAA,CAAA,CAAA;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FormItemProps } from '../form-item';
|
|
2
2
|
import type { FormItemRule } from 'element-plus';
|
|
3
3
|
export declare const useFormItem: () => {};
|
|
4
|
-
export declare const useFormItemSlots: (props: FormItemProps) => {
|
|
4
|
+
export declare const useFormItemSlots: (props: FormItemProps, emit: any) => {
|
|
5
5
|
scopedSlots: {
|
|
6
6
|
default: () => unknown;
|
|
7
7
|
label: () => import("vue/jsx-runtime").JSX.Element;
|
|
@@ -7,7 +7,7 @@ var useLocale = require('../../../../hooks/use-locale.js');
|
|
|
7
7
|
const useFormItem = () => {
|
|
8
8
|
return {};
|
|
9
9
|
};
|
|
10
|
-
const useFormItemSlots = (props) => {
|
|
10
|
+
const useFormItemSlots = (props, emit) => {
|
|
11
11
|
const attrs = vue.useAttrs();
|
|
12
12
|
const {
|
|
13
13
|
render,
|
|
@@ -48,7 +48,12 @@ const useFormItemSlots = (props) => {
|
|
|
48
48
|
disabled,
|
|
49
49
|
clearable: true,
|
|
50
50
|
...renderProps,
|
|
51
|
-
...events
|
|
51
|
+
...events,
|
|
52
|
+
ref: (el) => {
|
|
53
|
+
if (el) {
|
|
54
|
+
emit("registerFormItemRenderRef", el);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
52
57
|
}, renderScopedSlots) : formData[prop];
|
|
53
58
|
},
|
|
54
59
|
label: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-form-item.js","sources":["../../../../../../../packages/components/form/src/hooks/use-form-item.tsx"],"sourcesContent":["import { h, resolveComponent, useAttrs, ref } from 'vue'\nimport type { FormItemProps } from '../form-item'\nimport type { FormItemRule } from 'element-plus'\nimport { ElTooltip } from 'element-plus'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nexport const useFormItem = () => {\n return {}\n}\nexport const useFormItemSlots = (props: FormItemProps) => {\n const attrs = useAttrs()\n const { render, labelRender } = props\n const prop = props.tableProp || props.prop\n const events: Record<string, (...args: any[]) => void> = {}\n for (const key in attrs) {\n if (key.startsWith('on')) {\n // 包装事件处理函数,确保在事件触发时使用最新的 scope\n // fix: table筛选后,点击事件触发时,scope.row仍为筛选前的行数据\n events[key] = (...args: any[]) => {\n const tableScope = attrs['table-scope']\n const eventFn = attrs[key] as (...args: any[]) => void\n return eventFn(...args, tableScope)\n }\n }\n }\n const isTipDisabled = ref(true) // 默认禁用提示\n const checkOverflow = (e: MouseEvent) => {\n const el = e.currentTarget as HTMLElement\n isTipDisabled.value = el.scrollWidth <= el.clientWidth\n }\n const scopedSlots = {\n default: () => {\n const formData = attrs['form-data'] as Record<string, unknown>\n const { scopedSlots: renderScopedSlots, ...renderProps } =\n props.props || {}\n let disabled = props.disabled\n if (typeof props.disabled === 'function') {\n disabled = props.disabled(formData)\n }\n return props.type\n ? h(\n resolveComponent(props.type),\n {\n modelValue: formData[prop as string],\n 'onUpdate:modelValue': (value: unknown) => {\n formData[prop as string] = value\n },\n disabled,\n clearable: true,\n ...renderProps,\n ...events,\n },\n renderScopedSlots,\n )\n : formData[prop as string]\n },\n label: () => {\n return (\n <ElTooltip\n placement=\"top\"\n effect=\"dark\"\n content={props.label}\n disabled={!props.isShowLabel || isTipDisabled.value}\n >\n <span\n onMouseenter={checkOverflow}\n style=\"display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\"\n >\n {!props.hideRequiredAsterisk && props.required ? (\n <span style=\"color: var(--el-color-danger);\">*</span>\n ) : null}\n {props.isShowLabel ? <span>{props.label}</span> : ''}\n </span>\n </ElTooltip>\n )\n },\n }\n\n if (labelRender) {\n scopedSlots.label = () => labelRender({ label: props.label })\n }\n if (render) {\n scopedSlots.default = () => {\n return render(attrs['table-scope'])\n }\n }\n return {\n scopedSlots,\n }\n}\nexport const useFormItemRules = (props: FormItemProps) => {\n const { t } = useLocale()\n const { required, rules, label } = props\n let mergeRules: FormItemRule[] = []\n if (required) {\n const requiredDefault = { required: true }\n mergeRules.push(requiredDefault)\n }\n if (rules) {\n if (Array.isArray(rules)) {\n mergeRules = mergeRules.concat(rules)\n }\n\n if (Object.prototype.toString.call(rules) === '[object Object]') {\n mergeRules.push(rules as FormItemRule)\n }\n }\n\n if (mergeRules) {\n mergeRules.forEach((r) => {\n if (r.required && typeof r.message === 'undefined') {\n r.message = `${label || ''}${t('ep.formItem.required')}`\n }\n })\n }\n return { rules: mergeRules }\n}\n"],"names":["useFormItem","useFormItemSlots","props","attrs","useAttrs","render","labelRender","prop","tableProp","events","key","startsWith","args","tableScope","eventFn","isTipDisabled","ref","checkOverflow","e","el","currentTarget","value","scrollWidth","clientWidth","scopedSlots","default","formData","renderScopedSlots","renderProps","disabled","type","h","resolveComponent","modelValue","clearable","label","_createVNode","ElTooltip","isShowLabel","hideRequiredAsterisk","required","_createTextVNode","useFormItemRules","t","useLocale","rules","mergeRules","requiredDefault","push","Array","isArray","concat","Object","prototype","toString","call","forEach","r","message"],"mappings":";;;;;;AAKO,MAAMA,cAAcA,MAAM;AAC/B,EAAA,OAAO,EAAC;AACV;AACO,MAAMC,
|
|
1
|
+
{"version":3,"file":"use-form-item.js","sources":["../../../../../../../packages/components/form/src/hooks/use-form-item.tsx"],"sourcesContent":["import { h, resolveComponent, useAttrs, ref } from 'vue'\nimport type { FormItemProps } from '../form-item'\nimport type { FormItemRule } from 'element-plus'\nimport { ElTooltip } from 'element-plus'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nexport const useFormItem = () => {\n return {}\n}\nexport const useFormItemSlots = (props: FormItemProps,emit) => {\n const attrs = useAttrs()\n const { render, labelRender } = props\n const prop = props.tableProp || props.prop\n const events: Record<string, (...args: any[]) => void> = {}\n for (const key in attrs) {\n if (key.startsWith('on')) {\n // 包装事件处理函数,确保在事件触发时使用最新的 scope\n // fix: table筛选后,点击事件触发时,scope.row仍为筛选前的行数据\n events[key] = (...args: any[]) => {\n const tableScope = attrs['table-scope']\n const eventFn = attrs[key] as (...args: any[]) => void\n return eventFn(...args, tableScope)\n }\n }\n }\n const isTipDisabled = ref(true) // 默认禁用提示\n const checkOverflow = (e: MouseEvent) => {\n const el = e.currentTarget as HTMLElement\n isTipDisabled.value = el.scrollWidth <= el.clientWidth\n }\n const scopedSlots = {\n default: () => {\n const formData = attrs['form-data'] as Record<string, unknown>\n const { scopedSlots: renderScopedSlots, ...renderProps } =\n props.props || {}\n let disabled = props.disabled\n if (typeof props.disabled === 'function') {\n disabled = props.disabled(formData)\n }\n return props.type\n ? h(\n resolveComponent(props.type),\n {\n modelValue: formData[prop as string],\n 'onUpdate:modelValue': (value: unknown) => {\n formData[prop as string] = value\n },\n disabled,\n clearable: true,\n ...renderProps,\n ...events,\n ref: (el: any) => {\n if (el) {\n emit('registerFormItemRenderRef', el)\n }\n },\n },\n renderScopedSlots,\n )\n : formData[prop as string]\n },\n label: () => {\n return (\n <ElTooltip\n placement=\"top\"\n effect=\"dark\"\n content={props.label}\n disabled={!props.isShowLabel || isTipDisabled.value}\n >\n <span\n onMouseenter={checkOverflow}\n style=\"display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\"\n >\n {!props.hideRequiredAsterisk && props.required ? (\n <span style=\"color: var(--el-color-danger);\">*</span>\n ) : null}\n {props.isShowLabel ? <span>{props.label}</span> : ''}\n </span>\n </ElTooltip>\n )\n },\n }\n\n if (labelRender) {\n scopedSlots.label = () => labelRender({ label: props.label })\n }\n if (render) {\n scopedSlots.default = () => {\n return render(attrs['table-scope'])\n }\n }\n return {\n scopedSlots,\n }\n}\nexport const useFormItemRules = (props: FormItemProps) => {\n const { t } = useLocale()\n const { required, rules, label } = props\n let mergeRules: FormItemRule[] = []\n if (required) {\n const requiredDefault = { required: true }\n mergeRules.push(requiredDefault)\n }\n if (rules) {\n if (Array.isArray(rules)) {\n mergeRules = mergeRules.concat(rules)\n }\n\n if (Object.prototype.toString.call(rules) === '[object Object]') {\n mergeRules.push(rules as FormItemRule)\n }\n }\n\n if (mergeRules) {\n mergeRules.forEach((r) => {\n if (r.required && typeof r.message === 'undefined') {\n r.message = `${label || ''}${t('ep.formItem.required')}`\n }\n })\n }\n return { rules: mergeRules }\n}\n"],"names":["useFormItem","useFormItemSlots","props","emit","attrs","useAttrs","render","labelRender","prop","tableProp","events","key","startsWith","args","tableScope","eventFn","isTipDisabled","ref","checkOverflow","e","el","currentTarget","value","scrollWidth","clientWidth","scopedSlots","default","formData","renderScopedSlots","renderProps","disabled","type","h","resolveComponent","modelValue","clearable","label","_createVNode","ElTooltip","isShowLabel","hideRequiredAsterisk","required","_createTextVNode","useFormItemRules","t","useLocale","rules","mergeRules","requiredDefault","push","Array","isArray","concat","Object","prototype","toString","call","forEach","r","message"],"mappings":";;;;;;AAKO,MAAMA,cAAcA,MAAM;AAC/B,EAAA,OAAO,EAAC;AACV;AACO,MAAMC,gBAAAA,GAAmBA,CAACC,KAAAA,EAAqBC,IAAAA,KAAS;AAC7D,EAAA,MAAMC,QAAQC,YAAAA,EAAS;AACvB,EAAA,MAAM;AAAA,IAAEC,MAAAA;AAAAA,IAAQC;AAAAA,GAAY,GAAIL,KAAAA;AAChC,EAAA,MAAM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;AAEA,EAAA,IAAIC,UAAAA,EAAY;AACdA,IAAAA,UAAAA,CAAWU,QAASC,CAAAA,CAAAA,KAAM;AACxB,MAAA,IAAIA,CAAAA,CAAEjB,QAAAA,IAAY,OAAOiB,CAAAA,CAAEC,YAAY,WAAA,EAAa;AAClDD,QAAAA,CAAAA,CAAEC,UAAU,CAAA,EAAGvB,KAAAA,IAAS,EAAE,CAAA,EAAGQ,CAAAA,CAAE,sBAAsB,CAAC,CAAA,CAAA;AAAA,MACxD;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACA,EAAA,OAAO;AAAA,IAAEE,KAAAA,EAAOC;AAAAA,GAAW;AAC7B;;;;;;"}
|
|
@@ -21,5 +21,7 @@ export declare const useForm: (props: FormProps) => {
|
|
|
21
21
|
validate: () => import("element-plus").FormValidationResult;
|
|
22
22
|
resetFields: (props: FormItemProp) => void;
|
|
23
23
|
clearValidate: (props: FormItemProp) => void;
|
|
24
|
+
getFormItemRenderRef: (refName: string) => any;
|
|
25
|
+
registerFormItemRenderRef: (refName: string, ref: any) => void;
|
|
24
26
|
};
|
|
25
27
|
export {};
|
|
@@ -42,12 +42,26 @@ const useForm = (props) => {
|
|
|
42
42
|
const clearValidate = (props2) => {
|
|
43
43
|
return elFormRef.value.clearValidate(props2);
|
|
44
44
|
};
|
|
45
|
+
const formItemRenderRefs = vue.reactive(/* @__PURE__ */ new Map());
|
|
46
|
+
vue.onBeforeUpdate(() => {
|
|
47
|
+
formItemRenderRefs.clear();
|
|
48
|
+
});
|
|
49
|
+
const getFormItemRenderRef = (refName) => {
|
|
50
|
+
return formItemRenderRefs.get(refName);
|
|
51
|
+
};
|
|
52
|
+
const registerFormItemRenderRef = (refName, ref2) => {
|
|
53
|
+
if (refName && ref2) {
|
|
54
|
+
formItemRenderRefs.set(refName, ref2);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
45
57
|
return {
|
|
46
58
|
filterFormItemList,
|
|
47
59
|
elFormRef,
|
|
48
60
|
validate,
|
|
49
61
|
resetFields,
|
|
50
|
-
clearValidate
|
|
62
|
+
clearValidate,
|
|
63
|
+
getFormItemRenderRef,
|
|
64
|
+
registerFormItemRenderRef
|
|
51
65
|
};
|
|
52
66
|
};
|
|
53
67
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-form.js","sources":["../../../../../../../packages/components/form/src/hooks/use-form.ts"],"sourcesContent":["import { ref, computed, useTemplateRef, type SetupContext } from 'vue'\nimport type { FormItemProps } from '../form-item'\nimport type { FormProps, FormEmits } from '../form'\nimport type { FormInstance, FormItemProp } from 'element-plus'\n\ninterface UseCollapseParams {\n isShowFold: boolean\n showFieldCount: number\n filterFormItemList: { value: FormItemProps[] }\n}\nexport const useCollapse = (\n { isShowFold, showFieldCount, filterFormItemList }: UseCollapseParams,\n emit: SetupContext<FormEmits>['emit'],\n) => {\n const open = ref(false)\n const toggleStatus = () => {\n open.value = !open.value\n emit('toggleStatus', open.value)\n }\n // 是否显示折叠按钮\n const isShowFoldBtn = computed(() => {\n return isShowFold && filterFormItemList.value.length > showFieldCount\n })\n // 展开收起隐藏formItem逻辑\n const isShowFormItem = (index: number) => {\n return index < showFieldCount || open.value || !isShowFoldBtn.value\n }\n return {\n open,\n toggleStatus,\n isShowFoldBtn,\n isShowFormItem,\n }\n}\n\nexport const useForm = (props: FormProps) => {\n const elFormRef = useTemplateRef<FormInstance>('elFormRef')\n const filterFormItemList = computed(() => {\n return (props.formItemList || []).filter((item: FormItemProps) => {\n if ('show' in item) {\n return typeof item.show === 'function' ? item.show(item) : item.show\n } else if ('hide' in item) {\n return typeof item.hide === 'function' ? !item.hide(item) : !item.hide\n }\n return true\n })\n })\n // 校验\n const validate = () => {\n return elFormRef.value!.validate()\n }\n // 重置校验\n const resetFields = (props: FormItemProp) => {\n return elFormRef.value!.resetFields(props)\n }\n // 清理某个字段的表单验证信息\n const clearValidate = (props: FormItemProp) => {\n return elFormRef.value!.clearValidate(props)\n }\n\n return {\n filterFormItemList,\n elFormR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AAa,CAAC,KAAK,IAAA,CAAK,IAAI,CAAA,GAAI,CAAC,IAAA,CAAK,IAAA;AAAA,MACpE;AACA,MAAA,OAAO,IAAA;AAAA,IACT,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AAED,EAAA,MAAM,WAAW,MAAM;AACrB,IAAA,OAAO,SAAA,CAAU,MAAO,QAAA,EAAS;AAAA,EACnC,CAAA;AAEA,EAAA,MAAM,WAAA,GAAc,CAACE,MAAAA,KAAwB;AAC3C,IAAA,OAAO,SAAA,CAAU,KAAA,CAAO,WAAA,CAAYA,MAAK,CAAA;AAAA,EAC3C,CAAA;AAEA,EAAA,MAAM,aAAA,GAAgB,CAACA,MAAAA,KAAwB;AAC7C,IAAA,OAAO,SAAA,CAAU,KAAA,CAAO,aAAA,CAAcA,MAAK,CAAA;AAAA,EAC7C,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,kBAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;;"}
|
|
1
|
+
{"version":3,"file":"use-form.js","sources":["../../../../../../../packages/components/form/src/hooks/use-form.ts"],"sourcesContent":["import { ref, reactive, computed, useTemplateRef, type SetupContext, onBeforeUpdate } from 'vue'\nimport type { FormItemProps } from '../form-item'\nimport type { FormProps, FormEmits } from '../form'\nimport type { FormInstance, FormItemProp } from 'element-plus'\n\ninterface UseCollapseParams {\n isShowFold: boolean\n showFieldCount: number\n filterFormItemList: { value: FormItemProps[] }\n}\nexport const useCollapse = (\n { isShowFold, showFieldCount, filterFormItemList }: UseCollapseParams,\n emit: SetupContext<FormEmits>['emit'],\n) => {\n const open = ref(false)\n const toggleStatus = () => {\n open.value = !open.value\n emit('toggleStatus', open.value)\n }\n // 是否显示折叠按钮\n const isShowFoldBtn = computed(() => {\n return isShowFold && filterFormItemList.value.length > showFieldCount\n })\n // 展开收起隐藏formItem逻辑\n const isShowFormItem = (index: number) => {\n return index < showFieldCount || open.value || !isShowFoldBtn.value\n }\n return {\n open,\n toggleStatus,\n isShowFoldBtn,\n isShowFormItem,\n }\n}\n\nexport const useForm = (props: FormProps) => {\n const elFormRef = useTemplateRef<FormInstance>('elFormRef')\n const filterFormItemList = computed(() => {\n return (props.formItemList || []).filter((item: FormItemProps) => {\n if ('show' in item) {\n return typeof item.show === 'function' ? item.show(item) : item.show\n } else if ('hide' in item) {\n return typeof item.hide === 'function' ? !item.hide(item) : !item.hide\n }\n return true\n })\n })\n // 校验\n const validate = () => {\n return elFormRef.value!.validate()\n }\n // 重置校验\n const resetFields = (props: FormItemProp) => {\n return elFormRef.value!.resetFields(props)\n }\n // 清理某个字段的表单验证信息\n const clearValidate = (props: FormItemProp) => {\n return elFormRef.value!.clearValidate(props)\n }\n // 存储form-item的ref\n const formItemRenderRefs = reactive(new Map())\n // 每次更新前清空,防止内存泄漏或引用过时\n onBeforeUpdate(() => {\n formItemRenderRefs.clear();\n });\n // 获取form-item渲染render的ref\n const getFormItemRenderRef = (refName: string) => {\n return formItemRenderRefs.get(refName)\n }\n // 注册form-item的ref\n const registerFormItemRenderRef = (refName: string, ref: any) => {\n if (refName && ref) {\n formItemRenderRefs.set(refName, ref)\n }\n }\n\n return {\n filterFormItemList,\n elFormRef,\n validate,\n resetFields,\n clearValidate,\n getFormItemRenderRef,\n registerFormItemRenderRef,\n }\n}\n"],"names":["ref","computed","useTemplateRef","props","reactive","onBeforeUpdate"],"mappings":";;;;AAUO,MAAM,cAAc,CACzB,EAAE,YAAY,cAAA,EAAgB,kBAAA,IAC9B,IAAA,KACG;AACH,EAAA,MAAM,IAAA,GAAOA,QAAI,KAAK,CAAA;AACtB,EAAA,MAAM,eAAe,MAAM;AACzB,IAAA,IAAA,CAAK,KAAA,GAAQ,CAAC,IAAA,CAAK,KAAA;AACnB,IAAA,IAAA,CAAK,cAAA,EAAgB,KAAK,KAAK,CAAA;AAAA,EACjC,CAAA;AAEA,EAAA,MAAM,aAAA,GAAgBC,aAAS,MAAM;AACnC,IA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