@ibiz-template/vue3-util 0.7.41-alpha.2 → 0.7.41-alpha.20

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 (121) hide show
  1. package/dist/index.min.css +1 -1
  2. package/dist/index.system.min.js +1 -1
  3. package/es/common/badge/badge.css +1 -1
  4. package/es/common/control-base/control-base.css +1 -1
  5. package/es/common/control-base/control-base.d.ts +1 -0
  6. package/es/common/control-base/control-base.d.ts.map +1 -1
  7. package/es/common/control-base/control-base.mjs +38 -4
  8. package/es/common/custom-render/custom-render.d.ts.map +1 -1
  9. package/es/common/custom-render/custom-render.mjs +2 -2
  10. package/es/common/index.d.ts +1 -0
  11. package/es/common/index.d.ts.map +1 -1
  12. package/es/common/index.mjs +1 -0
  13. package/es/common/signature-pad/signature-pad.css +1 -0
  14. package/es/common/signature-pad/signature-pad.d.ts +19 -0
  15. package/es/common/signature-pad/signature-pad.d.ts.map +1 -0
  16. package/es/common/signature-pad/signature-pad.mjs +165 -0
  17. package/es/common/signature-pad/util/bezier.d.ts +58 -0
  18. package/es/common/signature-pad/util/bezier.d.ts.map +1 -0
  19. package/es/common/signature-pad/util/bezier.mjs +109 -0
  20. package/es/common/signature-pad/util/point.d.ts +55 -0
  21. package/es/common/signature-pad/util/point.d.ts.map +1 -0
  22. package/es/common/signature-pad/util/point.mjs +51 -0
  23. package/es/common/signature-pad/util/signature_pad.d.ts +593 -0
  24. package/es/common/signature-pad/util/signature_pad.d.ts.map +1 -0
  25. package/es/common/signature-pad/util/signature_pad.mjs +1018 -0
  26. package/es/common/view-shell/view-shell.d.ts +8 -1
  27. package/es/common/view-shell/view-shell.d.ts.map +1 -1
  28. package/es/common/view-shell/view-shell.mjs +13 -2
  29. package/es/control/panel/panel/panel.d.ts.map +1 -1
  30. package/es/control/panel/panel/panel.mjs +12 -1
  31. package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +1 -1
  32. package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
  33. package/es/control/panel/view-layout-panel/view-layout-panel.mjs +12 -1
  34. package/es/index.mjs +2 -0
  35. package/es/locale/en/index.d.ts +1 -0
  36. package/es/locale/en/index.d.ts.map +1 -1
  37. package/es/locale/en/index.mjs +2 -1
  38. package/es/locale/zh-CN/index.d.ts +1 -0
  39. package/es/locale/zh-CN/index.d.ts.map +1 -1
  40. package/es/locale/zh-CN/index.mjs +2 -1
  41. package/es/panel-component/multi-data-container/multi-data-container.d.ts +1 -1
  42. package/es/panel-component/multi-data-container/multi-data-container.d.ts.map +1 -1
  43. package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts +1 -1
  44. package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts.map +1 -1
  45. package/es/panel-component/nav-pos/nav-pos.controller.d.ts +1 -1
  46. package/es/panel-component/nav-pos/nav-pos.d.ts +1 -1
  47. package/es/panel-component/panel-container/panel-container.d.ts.map +1 -1
  48. package/es/panel-component/panel-container/panel-container.mjs +30 -2
  49. package/es/panel-component/panel-field/panel-field.controller.mjs +1 -1
  50. package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +1 -1
  51. package/es/panel-component/single-data-container/single-data-container.d.ts +1 -1
  52. package/es/panel-component/single-data-container/single-data-container.d.ts.map +1 -1
  53. package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +1 -0
  54. package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts.map +1 -1
  55. package/es/panel-component/teleport-placeholder/teleport-placeholder.state.d.ts +1 -1
  56. package/es/panel-component/teleport-placeholder/teleport-placeholder.state.mjs +1 -1
  57. package/es/plugin/plugin-factory/plugin-factory.d.ts +13 -12
  58. package/es/plugin/plugin-factory/plugin-factory.d.ts.map +1 -1
  59. package/es/plugin/plugin-factory/plugin-factory.mjs +24 -18
  60. package/es/use/index.d.ts +1 -0
  61. package/es/use/index.d.ts.map +1 -1
  62. package/es/use/index.mjs +2 -0
  63. package/es/use/storage/index.d.ts +4 -6
  64. package/es/use/storage/index.d.ts.map +1 -1
  65. package/es/use/storage/index.mjs +16 -11
  66. package/es/use/vue-use/computed-async.d.ts +51 -0
  67. package/es/use/vue-use/computed-async.d.ts.map +1 -0
  68. package/es/use/vue-use/computed-async.mjs +66 -0
  69. package/es/use/vue-use/index.d.ts +2 -0
  70. package/es/use/vue-use/index.d.ts.map +1 -0
  71. package/es/use/vue-use/index.mjs +3 -0
  72. package/es/util/install.d.ts.map +1 -1
  73. package/es/util/overlay-container/overlay-container.d.ts +1 -1
  74. package/es/util/overlay-container/overlay-container.d.ts.map +1 -1
  75. package/es/util/overlay-container/overlay-container.mjs +7 -2
  76. package/es/util/overlay-view-util/overlay-view-util.d.ts +2 -2
  77. package/es/util/overlay-view-util/overlay-view-util.d.ts.map +1 -1
  78. package/es/util/overlay-view-util/overlay-view-util.mjs +2 -1
  79. package/es/util/render/render.d.ts.map +1 -1
  80. package/es/util/render/render.mjs +4 -1
  81. package/es/util/route/route.d.ts.map +1 -1
  82. package/es/util/route/route.mjs +18 -3
  83. package/es/view/common/index.d.ts.map +1 -1
  84. package/es/view/common/index.mjs +2 -0
  85. package/es/view/common/view.d.ts.map +1 -1
  86. package/es/view/common/view.mjs +14 -1
  87. package/es/view/md-custom-view/md-custom-view.provider.d.ts +13 -0
  88. package/es/view/md-custom-view/md-custom-view.provider.d.ts.map +1 -0
  89. package/es/view/md-custom-view/md-custom-view.provider.mjs +13 -0
  90. package/lib/common/badge/badge.css +1 -1
  91. package/lib/common/control-base/control-base.cjs +37 -3
  92. package/lib/common/control-base/control-base.css +1 -1
  93. package/lib/common/custom-render/custom-render.cjs +1 -1
  94. package/lib/common/index.cjs +2 -0
  95. package/lib/common/signature-pad/signature-pad.cjs +167 -0
  96. package/lib/common/signature-pad/signature-pad.css +1 -0
  97. package/lib/common/signature-pad/util/bezier.cjs +111 -0
  98. package/lib/common/signature-pad/util/point.cjs +53 -0
  99. package/lib/common/signature-pad/util/signature_pad.cjs +1022 -0
  100. package/lib/common/view-shell/view-shell.cjs +13 -2
  101. package/lib/control/panel/panel/panel.cjs +12 -1
  102. package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +12 -1
  103. package/lib/index.cjs +4 -0
  104. package/lib/locale/en/index.cjs +2 -1
  105. package/lib/locale/zh-CN/index.cjs +2 -1
  106. package/lib/panel-component/panel-container/panel-container.cjs +29 -1
  107. package/lib/panel-component/panel-field/panel-field.controller.cjs +1 -1
  108. package/lib/panel-component/teleport-placeholder/teleport-placeholder.state.cjs +1 -1
  109. package/lib/plugin/plugin-factory/plugin-factory.cjs +24 -18
  110. package/lib/use/index.cjs +3 -0
  111. package/lib/use/storage/index.cjs +16 -11
  112. package/lib/use/vue-use/computed-async.cjs +68 -0
  113. package/lib/use/vue-use/index.cjs +7 -0
  114. package/lib/util/overlay-container/overlay-container.cjs +7 -2
  115. package/lib/util/overlay-view-util/overlay-view-util.cjs +2 -1
  116. package/lib/util/render/render.cjs +4 -1
  117. package/lib/util/route/route.cjs +18 -3
  118. package/lib/view/common/index.cjs +2 -0
  119. package/lib/view/common/view.cjs +13 -0
  120. package/lib/view/md-custom-view/md-custom-view.provider.cjs +15 -0
  121. package/package.json +7 -7
@@ -29,6 +29,9 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
29
29
  // 解决打开浮动容器(模态、抽屉、弹出框)ctx丢失问题
30
30
  ctx: {
31
31
  type: Object
32
+ },
33
+ viewShellHooks: {
34
+ type: Object
32
35
  }
33
36
  },
34
37
  setup(props, {
@@ -133,7 +136,7 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
133
136
  const noSrfSessionId = ramda.isNil(context.value.srfsessionid) || ramda.isEmpty(context.value.srfsessionid);
134
137
  const id = qxUtil.createUUID();
135
138
  if (noSrfSessionId) {
136
- const domain = ibiz.uiDomainManager.create(id);
139
+ const domain = ibiz.uiDomainManager.create(id, appDataEntityId);
137
140
  context.value.srfsessionid = domain.id;
138
141
  }
139
142
  const app = ibiz.hub.getApp(viewModel.appId);
@@ -198,6 +201,7 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
198
201
  Object.assign(params.value, redrawData.params);
199
202
  const modal = attrs.modal;
200
203
  if (modal) {
204
+ modal.hooks.preDismiss.clear();
201
205
  modal.hooks.shouldDismiss.clear();
202
206
  modal.hooks.beforeDismiss.clear();
203
207
  }
@@ -209,6 +213,11 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
209
213
  });
210
214
  }
211
215
  };
216
+ const onCreated = (event) => {
217
+ if (props.viewShellHooks) {
218
+ props.viewShellHooks.hooks.viewCreated.call(event);
219
+ }
220
+ };
212
221
  return {
213
222
  ns,
214
223
  errMsg,
@@ -217,6 +226,7 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
217
226
  hasAuthority,
218
227
  viewModelData,
219
228
  redrawView,
229
+ onCreated,
220
230
  curContext: context,
221
231
  curParams: params
222
232
  };
@@ -229,7 +239,8 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
229
239
  modelData: ramda.clone(this.viewModelData),
230
240
  ...this.$attrs,
231
241
  provider: this.provider,
232
- onRedrawView: this.redrawView
242
+ onRedrawView: this.redrawView,
243
+ onCreated: this.onCreated
233
244
  }, this.$slots);
234
245
  }
235
246
  if (!this.hasAuthority) {
@@ -66,12 +66,23 @@ function renderPanelItem(panelItem, c, ins) {
66
66
  tempStyle = panelItem.cssStyle;
67
67
  }
68
68
  const panelItemC = panelItems[panelItem.id];
69
+ const attrs = renderAttrs(panelItem, panelItemC);
70
+ if (attrs.dynamicstyle) {
71
+ if (typeof attrs.dynamicstyle === "object") {
72
+ tempStyle += Object.entries(attrs.dynamicstyle).map(([key, value]) => {
73
+ return "".concat(key, ":").concat(value, ";");
74
+ }).join("");
75
+ } else {
76
+ tempStyle += attrs.dynamicstyle;
77
+ }
78
+ delete attrs.dynamicstyle;
79
+ }
69
80
  return vue.h(component, {
70
81
  modelData: panelItem,
71
82
  controller: panelItemC,
72
83
  key: panelItem.id,
73
84
  style: tempStyle,
74
- attrs: renderAttrs(panelItem, panelItemC)
85
+ attrs
75
86
  }, children);
76
87
  }
77
88
  const PanelControl = /* @__PURE__ */ vue.defineComponent({
@@ -146,12 +146,23 @@ const ViewLayoutPanelControl = /* @__PURE__ */ vue.defineComponent({
146
146
  tempStyle = panelItem.cssStyle;
147
147
  }
148
148
  const panelItemC = panelItems[panelItem.id];
149
+ const attrs = renderAttrs(panelItem, panelItemC);
150
+ if (attrs.dynamicstyle) {
151
+ if (typeof attrs.dynamicstyle === "object") {
152
+ tempStyle += Object.entries(attrs.dynamicstyle).map(([key, value]) => {
153
+ return "".concat(key, ":").concat(value, ";");
154
+ }).join("");
155
+ } else {
156
+ tempStyle += attrs.dynamicstyle;
157
+ }
158
+ delete attrs.dynamicstyle;
159
+ }
149
160
  return vue.h(component, {
150
161
  modelData: panelItem,
151
162
  controller: panelItemC,
152
163
  key: panelItem.id,
153
164
  style: tempStyle,
154
- attrs: renderAttrs(panelItem, panelItemC)
165
+ attrs
155
166
  }, children);
156
167
  };
157
168
  vue.provide("renderPanelItem", renderPanelItem);
package/lib/index.cjs CHANGED
@@ -21,6 +21,7 @@ var codeList = require('./common/code-list/code-list.cjs');
21
21
  var controlLoadingPlaceholder = require('./common/control-loading-placeholder/control-loading-placeholder.cjs');
22
22
  var badge = require('./common/badge/badge.cjs');
23
23
  var customRender = require('./common/custom-render/custom-render.cjs');
24
+ var signaturePad = require('./common/signature-pad/signature-pad.cjs');
24
25
  var panelContainer_state = require('./panel-component/panel-container/panel-container.state.cjs');
25
26
  var panelContainer_controller = require('./panel-component/panel-container/panel-container.controller.cjs');
26
27
  var index = require('./panel-component/panel-container/index.cjs');
@@ -86,6 +87,7 @@ var codelistListen = require('./use/codeList-listen/codelist-listen.cjs');
86
87
  var index$p = require('./use/storage/index.cjs');
87
88
  var autofocusBlur = require('./use/autofocus-blur/autofocus-blur.cjs');
88
89
  var popover = require('./use/popover/popover.cjs');
90
+ var computedAsync = require('./use/vue-use/computed-async.cjs');
89
91
  var overlayContainer = require('./util/overlay-container/overlay-container.cjs');
90
92
  var overlayPopoverContainer = require('./util/overlay-popover-container/overlay-popover-container.cjs');
91
93
  var routerCallback = require('./util/router-callback/router-callback.cjs');
@@ -143,6 +145,7 @@ exports.IBizCodeList = codeList.IBizCodeList;
143
145
  exports.ControlLoadingPlaceholder = controlLoadingPlaceholder.ControlLoadingPlaceholder;
144
146
  exports.IBizBadge = badge.IBizBadge;
145
147
  exports.IBizCustomRender = customRender.IBizCustomRender;
148
+ exports.IBizSignaturePad = signaturePad.IBizSignaturePad;
146
149
  exports.PanelContainerState = panelContainer_state.PanelContainerState;
147
150
  exports.PanelContainerController = panelContainer_controller.PanelContainerController;
148
151
  exports.IBizPanelContainer = index.IBizPanelContainer;
@@ -219,6 +222,7 @@ exports.useAutoFocusBlur = autofocusBlur.useAutoFocusBlur;
219
222
  exports.shareCommonAncestor = popover.shareCommonAncestor;
220
223
  exports.usePopoverVisible = popover.usePopoverVisible;
221
224
  exports.usePopoverzIndex = popover.usePopoverzIndex;
225
+ exports.computedAsync = computedAsync.computedAsync;
222
226
  exports.OverlayContainer = overlayContainer.OverlayContainer;
223
227
  exports.OverlayPopoverContainer = overlayPopoverContainer.OverlayPopoverContainer;
224
228
  exports.routerCallback = routerCallback.routerCallback;
@@ -7,7 +7,8 @@ const en = {
7
7
  undefined: "undefined",
8
8
  onFoundCorrespondingPart: "Undefined adapter with no corresponding part found",
9
9
  noFoundViewModel: "View model not found",
10
- noSupportLoadingDynamic: "{codeName}No entity, do not support loading dynamic models at this time"
10
+ noSupportLoadingDynamic: "{codeName}No entity, do not support loading dynamic models at this time",
11
+ invalidPointCoordinates: "Invalid point coordinates: ({x}, {y})"
11
12
  },
12
13
  control: {
13
14
  unsupportedPanel: "Unsupported panel items: {id} - {itemType}"
@@ -7,7 +7,8 @@ const zhCn = {
7
7
  undefined: "\u672A\u5B9A\u4E49",
8
8
  onFoundCorrespondingPart: "\u672A\u5B9A\u4E49\u672A\u627E\u5230\u5BF9\u5E94\u90E8\u4EF6\u7684\u9002\u914D\u5668",
9
9
  noFoundViewModel: "\u672A\u627E\u5230\u89C6\u56FE\u6A21\u578B",
10
- noSupportLoadingDynamic: "{codeName}\u65E0\u5B9E\u4F53,\u6682\u4E0D\u652F\u6301\u52A0\u8F7D\u52A8\u6001\u6A21\u578B"
10
+ noSupportLoadingDynamic: "{codeName}\u65E0\u5B9E\u4F53,\u6682\u4E0D\u652F\u6301\u52A0\u8F7D\u52A8\u6001\u6A21\u578B",
11
+ invalidPointCoordinates: "\u70B9\u5750\u6807\u65E0\u6548: ({x}, {y})"
11
12
  },
12
13
  control: {
13
14
  unsupportedPanel: "\u6682\u672A\u652F\u6301\u7684\u9762\u677F\u9879: {id} - {itemType}"
@@ -44,7 +44,7 @@ const PanelContainer = /* @__PURE__ */ vue.defineComponent({
44
44
  };
45
45
  },
46
46
  render() {
47
- var _a, _b;
47
+ var _a, _b, _c;
48
48
  let _slot;
49
49
  const defaultSlots = ((_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)) || [];
50
50
  const content = vue.createVNode(vue.resolveComponent("iBizRow"), {
@@ -64,6 +64,34 @@ const PanelContainer = /* @__PURE__ */ vue.defineComponent({
64
64
  })) ? _slot : {
65
65
  default: () => [_slot]
66
66
  });
67
+ const attrs = (_c = this.$attrs) == null ? void 0 : _c.attrs;
68
+ if (attrs && attrs.dynamictooltip) {
69
+ const attributes = {
70
+ ...attrs.dynamictooltip
71
+ };
72
+ delete attributes.content;
73
+ return vue.createVNode(vue.resolveComponent("el-tooltip"), vue.mergeProps({
74
+ "placement": "right",
75
+ "popper-class": this.ns.e("dynamic-tooltip")
76
+ }, attributes), {
77
+ default: () => {
78
+ return vue.createVNode("div", vue.mergeProps({
79
+ "class": this.classArr,
80
+ "onClick": () => {
81
+ this.controller.onClick();
82
+ }
83
+ }, this.$attrs), [this.controller.model.cssStyle ? vue.createVNode("style", {
84
+ "type": "text/css"
85
+ }, [this.controller.model.cssStyle]) : null, content]);
86
+ },
87
+ content: () => {
88
+ return vue.createVNode("div", {
89
+ "class": this.ns.e("dynamic-tooltip-content"),
90
+ "innerHTML": attrs.dynamictooltip.content
91
+ }, null);
92
+ }
93
+ });
94
+ }
67
95
  return vue.createVNode("div", {
68
96
  "class": this.classArr,
69
97
  "onClick": () => {
@@ -86,7 +86,7 @@ class PanelFieldController extends runtime.PanelItemController {
86
86
  */
87
87
  async validate() {
88
88
  var _a;
89
- if (this.state.visible && !this.model.allowEmpty && !this.value) {
89
+ if (this.state.visible && this.state.required && !this.value) {
90
90
  this.state.error = ((_a = this.editor) == null ? void 0 : _a.model.placeHolder) || ibiz.i18n.t("vue3Util.panelComponent.cannotEmpty", {
91
91
  caption: this.model.caption
92
92
  });
@@ -7,7 +7,7 @@ class TeleportPlaceholderState extends runtime.PanelItemState {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  /**
10
- * @description 可根据该参数从嵌入视图里找到占位面板成员用于渲染,通过自定义补充参数配置
10
+ * @description 嵌入视图中的部件可依据该参数找到传送占位面板项进行位置替换,参数默认格式为 “当前视图标识-需传送部件标识”;也可通过面板项参数(TeleportTag)来指定
11
11
  * @exposedoc
12
12
  * @type {string}
13
13
  * @memberof TeleportPlaceholderState
@@ -36,12 +36,10 @@ class PluginFactory {
36
36
  */
37
37
  this.pluginCache = /* @__PURE__ */ new Map();
38
38
  /**
39
- * 所有的插件
40
- *
41
- * @author chitanda
42
- * @date 2023-02-02 16:02:55
39
+ * @description 所有的插件
43
40
  * @protected
44
- * @type {Plugin[]}
41
+ * @type {{ code: Plugin; extraParams: IParams }[]}
42
+ * @memberof PluginFactory
45
43
  */
46
44
  this.pluginCodes = [];
47
45
  /**
@@ -118,7 +116,7 @@ class PluginFactory {
118
116
  */
119
117
  register(app) {
120
118
  this.pluginCodes.forEach((plugin) => {
121
- app.use(plugin);
119
+ app.use(plugin.code, plugin.extraParams);
122
120
  });
123
121
  }
124
122
  /**
@@ -138,16 +136,15 @@ class PluginFactory {
138
136
  }
139
137
  }
140
138
  /**
141
- * 插件刚加载完成回来,设置到目前所有的 vue 实例当中
142
- *
143
- * @author chitanda
144
- * @date 2023-02-02 17:02:38
139
+ * @description 插件刚加载完成回来,设置到目前所有的 vue 实例当中
145
140
  * @protected
146
141
  * @param {Plugin} code
142
+ * @param {IParams} [extraParams={}]
143
+ * @memberof PluginFactory
147
144
  */
148
- setPluginCode(code) {
149
- this.pluginCodes.push(code);
150
- app_hooks.AppHooks.useComponent.callSync(null, code);
145
+ setPluginCode(code, extraParams = {}) {
146
+ this.pluginCodes.push({ code, extraParams });
147
+ app_hooks.AppHooks.useComponent.callSync(null, code, extraParams);
151
148
  }
152
149
  /**
153
150
  * @description 加载插件
@@ -162,6 +159,7 @@ class PluginFactory {
162
159
  if (pluginRef) {
163
160
  const rtObjectName = pluginRef.rtobjectName;
164
161
  const rtObjectRepo = pluginRef.rtobjectRepo;
162
+ const pluginParams = pluginRef.pluginParams || {};
165
163
  if (this.isIgnore(rtObjectRepo)) {
166
164
  return true;
167
165
  }
@@ -181,7 +179,8 @@ class PluginFactory {
181
179
  const p = this.loadPluginRef(
182
180
  pluginRef.rtobjectName,
183
181
  pluginRef.rtobjectRepo,
184
- appId
182
+ appId,
183
+ { ...pluginParams }
185
184
  );
186
185
  this.loadQueue.set(rtObjectRepo, p);
187
186
  const result = await p;
@@ -203,10 +202,11 @@ class PluginFactory {
203
202
  * @param {string} rtObjectName
204
203
  * @param {string} rtObjectRepo
205
204
  * @param {string} [appId=ibiz.env.appId]
205
+ * @param {IParams} [params={}]
206
206
  * @returns {*} {Promise<boolean>}
207
207
  * @memberof PluginFactory
208
208
  */
209
- async loadPluginRef(rtObjectName, rtObjectRepo, appId = ibiz.env.appId) {
209
+ async loadPluginRef(rtObjectName, rtObjectRepo, appId = ibiz.env.appId, extraParams = {}) {
210
210
  if (this.isIgnore(rtObjectRepo)) {
211
211
  return true;
212
212
  }
@@ -229,7 +229,7 @@ class PluginFactory {
229
229
  }
230
230
  configData = res.data;
231
231
  }
232
- Object.assign(configData, { appId });
232
+ Object.assign(configData, { appId, extraParams });
233
233
  const remotePlugin = new runtime.RemotePluginItem(
234
234
  rtObjectName,
235
235
  rtObjectRepo,
@@ -258,7 +258,13 @@ class PluginFactory {
258
258
  */
259
259
  async loadScript(remotePlugin) {
260
260
  const pluginPath = remotePlugin.repo;
261
- const { name, appId, system, styles = [] } = remotePlugin.config;
261
+ const {
262
+ name,
263
+ appId,
264
+ system,
265
+ styles = [],
266
+ extraParams = {}
267
+ } = remotePlugin.config;
262
268
  let scriptUrl = "";
263
269
  scriptUrl = index.pathBrowserify.join(pluginPath, system);
264
270
  if (scriptUrl) {
@@ -283,7 +289,7 @@ class PluginFactory {
283
289
  data = await System.import(name);
284
290
  if (data) {
285
291
  if (data.default) {
286
- this.setPluginCode(data.default);
292
+ this.setPluginCode(data.default, extraParams);
287
293
  } else {
288
294
  throw new core.RuntimeError(
289
295
  ibiz.i18n.t("vue3Util.plugin.failedRemotePluginLoad")
package/lib/use/index.cjs CHANGED
@@ -13,9 +13,11 @@ var codelistListen = require('./codeList-listen/codelist-listen.cjs');
13
13
  var index$1 = require('./storage/index.cjs');
14
14
  var autofocusBlur = require('./autofocus-blur/autofocus-blur.cjs');
15
15
  var popover = require('./popover/popover.cjs');
16
+ require('./vue-use/index.cjs');
16
17
  var useControlController = require('./control/use-control-controller/use-control-controller.cjs');
17
18
  var useViewController = require('./view/use-view-controller/use-view-controller.cjs');
18
19
  var useViewOperation = require('./view/use-view-operation/use-view-operation.cjs');
20
+ var computedAsync = require('./vue-use/computed-async.cjs');
19
21
 
20
22
  "use strict";
21
23
 
@@ -44,3 +46,4 @@ exports.usePopoverzIndex = popover.usePopoverzIndex;
44
46
  exports.useControlController = useControlController.useControlController;
45
47
  exports.useViewController = useViewController.useViewController;
46
48
  exports.useViewOperation = useViewOperation.useViewOperation;
49
+ exports.computedAsync = computedAsync.computedAsync;
@@ -5,24 +5,29 @@ require('../../util/index.cjs');
5
5
  var route = require('../../util/route/route.cjs');
6
6
 
7
7
  "use strict";
8
- function useLocalCacheKey(context, type, routeDepth, splitter = "@") {
8
+ function useLocalCacheKey(context, type, routeDepth, splitter = "@", noRouteTag = "") {
9
9
  const router = vueRouter.useRouter();
10
10
  return () => {
11
11
  if (!router) {
12
12
  return;
13
13
  }
14
14
  const userId = context.srfuserid;
15
- const routePath = route.route2routePath(router.currentRoute.value);
16
15
  routeDepth = context.srfdefaulttoroutedepth || routeDepth;
17
- if (userId && routeDepth && routePath.pathNodes[routeDepth - 2]) {
18
- routePath.pathNodes = routePath.pathNodes.slice(0, routeDepth - 1);
19
- routePath.pathNodes.forEach((pathNode) => {
20
- if (pathNode.context) {
21
- delete pathNode.context.srfnavctrlid;
22
- }
23
- });
24
- const url = route.routePath2string(routePath);
25
- return "".concat(type).concat(splitter).concat(userId).concat(splitter).concat(url);
16
+ if (routeDepth) {
17
+ const routePath = route.route2routePath(router.currentRoute.value);
18
+ if (userId && routePath.pathNodes[routeDepth - 2]) {
19
+ routePath.pathNodes = routePath.pathNodes.slice(0, routeDepth - 1);
20
+ routePath.pathNodes.forEach((pathNode) => {
21
+ if (pathNode.context) {
22
+ delete pathNode.context.srfnavctrlid;
23
+ }
24
+ });
25
+ const url = route.routePath2string(routePath);
26
+ return "".concat(type).concat(splitter).concat(userId).concat(splitter).concat(url);
27
+ }
28
+ }
29
+ if (noRouteTag) {
30
+ return "".concat(type).concat(splitter).concat(userId).concat(splitter).concat(noRouteTag);
26
31
  }
27
32
  };
28
33
  }
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ var core = require('@ibiz-template/core');
4
+ var vue = require('vue');
5
+
6
+ "use strict";
7
+ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
8
+ let options;
9
+ if (vue.isRef(optionsOrRef)) {
10
+ options = {
11
+ evaluating: optionsOrRef
12
+ };
13
+ } else {
14
+ options = optionsOrRef || {};
15
+ }
16
+ const {
17
+ lazy = false,
18
+ flush = "pre",
19
+ evaluating = void 0,
20
+ shallow = true,
21
+ onError = core.NOOP
22
+ } = options;
23
+ const started = vue.shallowRef(!lazy);
24
+ const current = shallow ? vue.shallowRef(initialState) : vue.ref(initialState);
25
+ let counter = 0;
26
+ vue.watchEffect(
27
+ async (onInvalidate) => {
28
+ if (!started.value)
29
+ return;
30
+ counter++;
31
+ const counterAtBeginning = counter;
32
+ let hasFinished = false;
33
+ if (evaluating) {
34
+ Promise.resolve().then(() => {
35
+ evaluating.value = true;
36
+ });
37
+ }
38
+ try {
39
+ const result = await evaluationCallback((cancelCallback) => {
40
+ onInvalidate(() => {
41
+ if (evaluating)
42
+ evaluating.value = false;
43
+ if (!hasFinished)
44
+ cancelCallback();
45
+ });
46
+ });
47
+ if (counterAtBeginning === counter)
48
+ current.value = result;
49
+ } catch (e) {
50
+ onError(e);
51
+ } finally {
52
+ if (evaluating && counterAtBeginning === counter)
53
+ evaluating.value = false;
54
+ hasFinished = true;
55
+ }
56
+ },
57
+ { flush }
58
+ );
59
+ if (lazy) {
60
+ return vue.computed(() => {
61
+ started.value = true;
62
+ return current.value;
63
+ });
64
+ }
65
+ return current;
66
+ }
67
+
68
+ exports.computedAsync = computedAsync;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ var computedAsync = require('./computed-async.cjs');
4
+
5
+ "use strict";
6
+
7
+ exports.computedAsync = computedAsync.computedAsync;
@@ -3,6 +3,7 @@
3
3
  var qxUtil = require('qx-util');
4
4
  var vue = require('vue');
5
5
  var core = require('@ibiz-template/core');
6
+ var lodashEs = require('lodash-es');
6
7
 
7
8
  "use strict";
8
9
  class OverlayContainer {
@@ -44,13 +45,17 @@ class OverlayContainer {
44
45
  const self = this;
45
46
  const { render, opts } = this;
46
47
  const container = document.createElement("div");
47
- document.body.appendChild(container);
48
+ let appendTo = document.body;
49
+ if (lodashEs.isElement(opts == null ? void 0 : opts.appendTo)) {
50
+ appendTo = opts == null ? void 0 : opts.appendTo;
51
+ }
52
+ appendTo.appendChild(container);
48
53
  const vm = OverlayContainer.createVueApp({
49
54
  mounted() {
50
55
  self.modal = this.$refs.root;
51
56
  },
52
57
  unmounted() {
53
- document.body.removeChild(container);
58
+ appendTo.removeChild(container);
54
59
  self.evt.emit("dismiss", self.result);
55
60
  },
56
61
  render() {
@@ -4,10 +4,11 @@ var vue = require('vue');
4
4
 
5
5
  "use strict";
6
6
  function createOverlayView(props) {
7
- return (modal) => {
7
+ return (modal, viewShellHooks) => {
8
8
  const viewShell = vue.resolveComponent("IBizViewShell");
9
9
  return vue.h(viewShell, {
10
10
  ...props,
11
+ viewShellHooks,
11
12
  modal
12
13
  });
13
14
  };
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var ramda = require('ramda');
4
+ var runtime = require('@ibiz-template/runtime');
4
5
 
5
6
  "use strict";
6
7
  function renderString(value) {
@@ -26,7 +27,9 @@ const hasEmptyPanelRenderer = (c) => {
26
27
  if (!controlRenders || controlRenders.length === 0) {
27
28
  return false;
28
29
  }
29
- return !!controlRenders.find((item) => item.id === "emptypanel");
30
+ return !!controlRenders.find(
31
+ (item) => item.id === runtime.PredefinedControlRender.EMPTYPANEL
32
+ );
30
33
  };
31
34
 
32
35
  exports.hasEmptyPanelRenderer = hasEmptyPanelRenderer;
@@ -38,7 +38,7 @@ function route2routePath(route, isRouteModal = false) {
38
38
  params = void 0;
39
39
  } else {
40
40
  if (params.srfnavctx) {
41
- context = JSON.parse(decodeURIComponent(params.srfnavctx));
41
+ context = JSON.parse(params.srfnavctx);
42
42
  delete params.srfnavctx;
43
43
  }
44
44
  if (params.srfnav) {
@@ -119,8 +119,13 @@ function getOwnRouteContext(context) {
119
119
  }
120
120
  delete ownContext.attributekeys;
121
121
  }
122
+ let srfKeepNull = false;
123
+ if (Object.prototype.hasOwnProperty.call(ownContext, "srfkeepnull")) {
124
+ srfKeepNull = ownContext.srfkeepnull === true || ownContext.srfkeepnull === "true";
125
+ delete ownContext.srfkeepnull;
126
+ }
122
127
  Object.keys(ownContext).forEach((key) => {
123
- if (excludeKeys.includes(key) || ramda.isNil(ownContext[key])) {
128
+ if (excludeKeys.includes(key) || !srfKeepNull && ramda.isNil(ownContext[key])) {
124
129
  delete ownContext[key];
125
130
  }
126
131
  });
@@ -176,6 +181,7 @@ async function calcResRoutePath(routePath, context, appDataEntityId, appId) {
176
181
  }
177
182
  }
178
183
  async function generateRoutePath(appView, route, context, params) {
184
+ var _a;
179
185
  const routePath = route2routePath(route);
180
186
  let depth = context.srfdefaulttoroutedepth || 2;
181
187
  if (context.toRouteDepth) {
@@ -188,6 +194,10 @@ async function generateRoutePath(appView, route, context, params) {
188
194
  };
189
195
  }
190
196
  }
197
+ let srfmenuitem = params == null ? void 0 : params.srfmenuitem;
198
+ if (!srfmenuitem && routePath.pathNodes.length > 1) {
199
+ srfmenuitem = (_a = routePath.pathNodes[1].params) == null ? void 0 : _a.srfmenuitem;
200
+ }
191
201
  routePath.pathNodes.splice(depth - 1, routePath.pathNodes.length - depth + 1);
192
202
  if (context.currentSrfNav) {
193
203
  const currentNode = routePath.pathNodes[routePath.pathNodes.length - 1];
@@ -221,6 +231,10 @@ async function generateRoutePath(appView, route, context, params) {
221
231
  delete routePath.pathNodes[0].context[deName];
222
232
  }
223
233
  }
234
+ if (srfmenuitem && routePath.pathNodes.length > 1) {
235
+ const tempParams = routePath.pathNodes[1].params || {};
236
+ routePath.pathNodes[1].params = { ...tempParams, srfmenuitem };
237
+ }
224
238
  return { path: routePath2string(routePath) };
225
239
  }
226
240
  async function generateRoutePathByModal(appView, route, context, params) {
@@ -321,7 +335,8 @@ function onRouteChange(callback, depth) {
321
335
  throw new core.RuntimeError(ibiz.i18n.t("vue3Util.util.routeCorrectly"));
322
336
  }
323
337
  vue.watch(
324
- () => route == null ? void 0 : route.path,
338
+ // fix: odoo脚本触发路径query变更未触发路由变更事件
339
+ () => route == null ? void 0 : route.fullPath,
325
340
  () => {
326
341
  const currentKey = getNestedRoutePath(route, depth);
327
342
  callback({ currentKey, fullPath: route.fullPath });
@@ -5,6 +5,7 @@ require('../../util/index.cjs');
5
5
  var view_provider = require('./view.provider.cjs');
6
6
  var view = require('./view.cjs');
7
7
  var appDataUploadView_provider = require('../app-data-upload-view/app-data-upload-view.provider.cjs');
8
+ var mdCustomView_provider = require('../md-custom-view/md-custom-view.provider.cjs');
8
9
  var install = require('../../util/install.cjs');
9
10
 
10
11
  "use strict";
@@ -15,6 +16,7 @@ const IBizView = install.withInstall(view.View, function(v) {
15
16
  "APPDATAUPLOADVIEW",
16
17
  () => new appDataUploadView_provider.AppDataUploadViewProvider()
17
18
  );
19
+ runtime.registerViewProvider("DEMDCUSTOMVIEW", () => new mdCustomView_provider.MDCustomViewProvider());
18
20
  });
19
21
 
20
22
  exports.IBizView = IBizView;
@@ -129,6 +129,19 @@ const View = /* @__PURE__ */ vue.defineComponent({
129
129
  }
130
130
  return vue.h(comp, ctrlProps);
131
131
  };
132
+ let watermarkDestroy;
133
+ vue.onMounted(() => {
134
+ vue.nextTick(async () => {
135
+ const container = document.getElementById(c.id);
136
+ const appView = await ibiz.hub.config.view.get(c.model.id);
137
+ if (!container || !(appView == null ? void 0 : appView.waterMarkOption))
138
+ return;
139
+ watermarkDestroy = ibiz.util.watermark.mount(appView.waterMarkOption, container, c.context, c.params, c.state.srfactiveviewdata || {});
140
+ });
141
+ });
142
+ vue.onBeforeUnmount(() => {
143
+ watermarkDestroy == null ? void 0 : watermarkDestroy();
144
+ });
132
145
  return {
133
146
  c,
134
147
  ns,
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var runtime = require('@ibiz-template/runtime');
4
+
5
+ "use strict";
6
+ class MDCustomViewProvider {
7
+ constructor() {
8
+ this.component = "IBizView";
9
+ }
10
+ createController(model, context, params, ctx) {
11
+ return new runtime.MDCustomViewController(model, context, params, ctx);
12
+ }
13
+ }
14
+
15
+ exports.MDCustomViewProvider = MDCustomViewProvider;