@airpower/web 1.11.4 → 1.11.5

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.
@@ -1,5 +1,5 @@
1
1
  import { IJson } from '@airpower/transformer';
2
- import { Component } from 'vue';
2
+ import { Component, Plugin } from 'vue';
3
3
  import { IFile } from '../interface/IFile';
4
4
  import { IUploadProps } from '../interface/IUploadProps';
5
5
  import { ExportModel } from '../model/export/ExportModel';
@@ -9,37 +9,44 @@ import { RootEntity } from '../model/RootEntity';
9
9
  * @author Hamm.cn
10
10
  */
11
11
  export declare class DialogUtil {
12
+ /**
13
+ * ### vue plugins
14
+ * 构建弹窗实例时,会默认注入 `ElementPlus` 相关插件
15
+ * @description 此配置用于弹窗实例构建时额外需要注册的 vue 插件
16
+ */
17
+ static plugins: Plugin[];
12
18
  /**
13
19
  * ### 弹出对话框的内部方法
14
20
  * @param view 使用的视图组件 传入一个 `import` 的 `vue`
15
21
  * @param param 弹窗参数 将传入到合并到 `props` 上
22
+ * @param plugins Vue Plugins
16
23
  */
17
- static build<T>(view: Component, param: IJson): Promise<T>;
24
+ static build<T>(view: Component, param: IJson, plugins?: Plugin[]): Promise<T>;
18
25
  /**
19
26
  * ### 弹出一个弹窗
20
27
  * @param view 使用的视图组件 传入一个 `import` 的 `vue`
21
28
  * @param param `可选` 参数 将传入到目标对象的 `props.param` 参数上
22
29
  */
23
- static show<T>(view: Component, param?: unknown): Promise<T>;
30
+ static show<T>(view: Component, param?: unknown, plugins?: Plugin[]): Promise<T>;
24
31
  /**
25
32
  * ### 弹出上传文件对话框
26
33
  * @param config `可选` 上传自定义配置
27
34
  * @param customConfirm `可选` 自定义确认按钮回调方法
28
35
  */
29
- static showUpload<F extends IFile & RootEntity>(config?: IUploadProps<F>, customConfirm?: () => void): Promise<F>;
36
+ static showUpload<F extends IFile & RootEntity>(config?: IUploadProps<F>, customConfirm?: () => void, plugins?: Plugin[]): Promise<F>;
30
37
  /**
31
38
  * ### 弹出一个单选选择器
32
39
  * @param view 使用的视图组件 传入一个 `import` 的 `vue`
33
40
  * @param param `可选` 普通参数 将传入到目标对象的 `props.param` 参数上
34
41
  */
35
- static select<E extends RootEntity>(view: Component, param?: E | undefined): Promise<E>;
42
+ static select<E extends RootEntity>(view: Component, param?: E | undefined, plugins?: Plugin[]): Promise<E>;
36
43
  /**
37
44
  * ### 弹出一个多选选择器
38
45
  * @param view 使用的视图组件 传入一个 `import` 的 `vue`
39
46
  * @param selectList `可选` 已选列表 将传入到目标对象的 `props.selectList` 参数上
40
47
  * @param param `可选` 普通参数 将传入到目标对象的 `props.param` 参数上
41
48
  */
42
- static selectList<E extends RootEntity>(view: Component, selectList?: E[], param?: E | undefined): Promise<E[]>;
49
+ static selectList<E extends RootEntity>(view: Component, selectList?: E[], param?: E | undefined, plugins?: Plugin[]): Promise<E[]>;
43
50
  /**
44
51
  * ### 创建一个导出任务
45
52
  * @param exportModel `可选` 导出参数对象
package/dist/main.js CHANGED
@@ -14984,12 +14984,19 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
14984
14984
  }
14985
14985
  });
14986
14986
  class DialogUtil {
14987
+ /**
14988
+ * ### vue plugins
14989
+ * 构建弹窗实例时,会默认注入 `ElementPlus` 相关插件
14990
+ * @description 此配置用于弹窗实例构建时额外需要注册的 vue 插件
14991
+ */
14992
+ static plugins = [];
14987
14993
  /**
14988
14994
  * ### 弹出对话框的内部方法
14989
14995
  * @param view 使用的视图组件 传入一个 `import` 的 `vue`
14990
14996
  * @param param 弹窗参数 将传入到合并到 `props` 上
14997
+ * @param plugins Vue Plugins
14991
14998
  */
14992
- static async build(view, param) {
14999
+ static async build(view, param, plugins = this.plugins) {
14993
15000
  const parentNode = document.createElement("div");
14994
15001
  const domId = `dialog_${Math.random()}`;
14995
15002
  parentNode.setAttribute("id", domId);
@@ -15021,6 +15028,9 @@ class DialogUtil {
15021
15028
  };
15022
15029
  app = createApp(view, dialogParam);
15023
15030
  app.use(ElementPlus, { locale: WebConfig.elementPlusLocale });
15031
+ plugins.forEach((plugin) => {
15032
+ app?.use(plugin);
15033
+ });
15024
15034
  document.body.appendChild(parentNode);
15025
15035
  app.mount(parentNode);
15026
15036
  });
@@ -15030,17 +15040,17 @@ class DialogUtil {
15030
15040
  * @param view 使用的视图组件 传入一个 `import` 的 `vue`
15031
15041
  * @param param `可选` 参数 将传入到目标对象的 `props.param` 参数上
15032
15042
  */
15033
- static async show(view, param) {
15043
+ static async show(view, param, plugins) {
15034
15044
  return this.build(view, {
15035
15045
  param
15036
- });
15046
+ }, plugins);
15037
15047
  }
15038
15048
  /**
15039
15049
  * ### 弹出上传文件对话框
15040
15050
  * @param config `可选` 上传自定义配置
15041
15051
  * @param customConfirm `可选` 自定义确认按钮回调方法
15042
15052
  */
15043
- static async showUpload(config, customConfirm) {
15053
+ static async showUpload(config, customConfirm, plugins) {
15044
15054
  return this.build(_sfc_main$e, {
15045
15055
  onCustomConfirm: () => {
15046
15056
  if (customConfirm) {
@@ -15048,17 +15058,17 @@ class DialogUtil {
15048
15058
  }
15049
15059
  },
15050
15060
  ...config
15051
- });
15061
+ }, plugins);
15052
15062
  }
15053
15063
  /**
15054
15064
  * ### 弹出一个单选选择器
15055
15065
  * @param view 使用的视图组件 传入一个 `import` 的 `vue`
15056
15066
  * @param param `可选` 普通参数 将传入到目标对象的 `props.param` 参数上
15057
15067
  */
15058
- static async select(view, param = void 0) {
15068
+ static async select(view, param = void 0, plugins) {
15059
15069
  return this.build(view, {
15060
15070
  param
15061
- });
15071
+ }, plugins);
15062
15072
  }
15063
15073
  /**
15064
15074
  * ### 弹出一个多选选择器
@@ -15066,12 +15076,12 @@ class DialogUtil {
15066
15076
  * @param selectList `可选` 已选列表 将传入到目标对象的 `props.selectList` 参数上
15067
15077
  * @param param `可选` 普通参数 将传入到目标对象的 `props.param` 参数上
15068
15078
  */
15069
- static async selectList(view, selectList = [], param = void 0) {
15079
+ static async selectList(view, selectList = [], param = void 0, plugins) {
15070
15080
  return this.build(view, {
15071
15081
  selectList,
15072
15082
  isMultiple: true,
15073
15083
  param
15074
- });
15084
+ }, plugins);
15075
15085
  }
15076
15086
  /**
15077
15087
  * ### 创建一个导出任务
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airpower/web",
3
3
  "type": "module",
4
- "version": "1.11.4",
4
+ "version": "1.11.5",
5
5
  "description": "AirPower-Web",
6
6
  "author": {
7
7
  "name": "Hamm",