@ibiz-template/vue3-util 0.7.41-alpha.1 → 0.7.41-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/control-base/control-base.css +1 -1
- package/es/common/control-base/control-base.d.ts +1 -0
- package/es/common/control-base/control-base.d.ts.map +1 -1
- package/es/common/control-base/control-base.mjs +38 -4
- package/es/common/custom-render/custom-render.d.ts.map +1 -1
- package/es/common/custom-render/custom-render.mjs +2 -2
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +1 -0
- package/es/control/panel/panel/panel.d.ts.map +1 -1
- package/es/control/panel/panel/panel.mjs +12 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +12 -1
- package/es/panel-component/panel-container/panel-container.d.ts.map +1 -1
- package/es/panel-component/panel-container/panel-container.mjs +26 -2
- package/es/panel-component/panel-field/panel-field.controller.mjs +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +1 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.state.d.ts +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.state.mjs +1 -1
- package/es/plugin/plugin-factory/plugin-factory.d.ts +17 -19
- package/es/plugin/plugin-factory/plugin-factory.d.ts.map +1 -1
- package/es/plugin/plugin-factory/plugin-factory.mjs +35 -26
- package/es/util/render/render.d.ts.map +1 -1
- package/es/util/render/render.mjs +4 -1
- package/es/util/route/route.mjs +1 -1
- package/lib/common/control-base/control-base.cjs +37 -3
- package/lib/common/control-base/control-base.css +1 -1
- package/lib/common/custom-render/custom-render.cjs +1 -1
- package/lib/common/view-shell/view-shell.cjs +1 -0
- package/lib/control/panel/panel/panel.cjs +12 -1
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +12 -1
- package/lib/panel-component/panel-container/panel-container.cjs +25 -1
- package/lib/panel-component/panel-field/panel-field.controller.cjs +1 -1
- package/lib/panel-component/teleport-placeholder/teleport-placeholder.state.cjs +1 -1
- package/lib/plugin/plugin-factory/plugin-factory.cjs +35 -26
- package/lib/util/render/render.cjs +4 -1
- package/lib/util/route/route.cjs +1 -1
- package/package.json +6 -6
|
@@ -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
|
|
165
|
+
attrs
|
|
155
166
|
}, children);
|
|
156
167
|
};
|
|
157
168
|
vue.provide("renderPanelItem", renderPanelItem);
|
|
@@ -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,30 @@ 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
|
+
return vue.createVNode(vue.resolveComponent("el-tooltip"), {
|
|
70
|
+
"placement": "right",
|
|
71
|
+
"popper-class": this.ns.e("dynamic-tooltip")
|
|
72
|
+
}, {
|
|
73
|
+
default: () => {
|
|
74
|
+
return vue.createVNode("div", vue.mergeProps({
|
|
75
|
+
"class": this.classArr,
|
|
76
|
+
"onClick": () => {
|
|
77
|
+
this.controller.onClick();
|
|
78
|
+
}
|
|
79
|
+
}, this.$attrs), [this.controller.model.cssStyle ? vue.createVNode("style", {
|
|
80
|
+
"type": "text/css"
|
|
81
|
+
}, [this.controller.model.cssStyle]) : null, content]);
|
|
82
|
+
},
|
|
83
|
+
content: () => {
|
|
84
|
+
return vue.createVNode("div", {
|
|
85
|
+
"class": this.ns.e("dynamic-tooltip-content"),
|
|
86
|
+
"innerHTML": attrs.dynamictooltip
|
|
87
|
+
}, null);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
67
91
|
return vue.createVNode("div", {
|
|
68
92
|
"class": this.classArr,
|
|
69
93
|
"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 &&
|
|
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
|
|
@@ -150,14 +150,13 @@ class PluginFactory {
|
|
|
150
150
|
app_hooks.AppHooks.useComponent.callSync(null, code);
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
|
-
* 加载插件
|
|
154
|
-
*
|
|
155
|
-
* @author chitanda
|
|
156
|
-
* @date 2022-10-31 14:10:13
|
|
153
|
+
* @description 加载插件
|
|
157
154
|
* @param {ISysPFPlugin} plugin
|
|
158
|
-
* @
|
|
155
|
+
* @param {string} [appId=ibiz.env.appId]
|
|
156
|
+
* @returns {*} {Promise<boolean>}
|
|
157
|
+
* @memberof PluginFactory
|
|
159
158
|
*/
|
|
160
|
-
async loadPlugin(plugin) {
|
|
159
|
+
async loadPlugin(plugin, appId = ibiz.env.appId) {
|
|
161
160
|
if (plugin.runtimeObject === true) {
|
|
162
161
|
const pluginRef = plugin;
|
|
163
162
|
if (pluginRef) {
|
|
@@ -181,7 +180,8 @@ class PluginFactory {
|
|
|
181
180
|
try {
|
|
182
181
|
const p = this.loadPluginRef(
|
|
183
182
|
pluginRef.rtobjectName,
|
|
184
|
-
pluginRef.rtobjectRepo
|
|
183
|
+
pluginRef.rtobjectRepo,
|
|
184
|
+
appId
|
|
185
185
|
);
|
|
186
186
|
this.loadQueue.set(rtObjectRepo, p);
|
|
187
187
|
const result = await p;
|
|
@@ -199,14 +199,14 @@ class PluginFactory {
|
|
|
199
199
|
return false;
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
|
-
* 加载应用插件
|
|
203
|
-
*
|
|
204
|
-
* @
|
|
205
|
-
* @
|
|
206
|
-
* @
|
|
207
|
-
* @
|
|
202
|
+
* @description 加载应用插件
|
|
203
|
+
* @param {string} rtObjectName
|
|
204
|
+
* @param {string} rtObjectRepo
|
|
205
|
+
* @param {string} [appId=ibiz.env.appId]
|
|
206
|
+
* @returns {*} {Promise<boolean>}
|
|
207
|
+
* @memberof PluginFactory
|
|
208
208
|
*/
|
|
209
|
-
async loadPluginRef(rtObjectName, rtObjectRepo) {
|
|
209
|
+
async loadPluginRef(rtObjectName, rtObjectRepo, appId = ibiz.env.appId) {
|
|
210
210
|
if (this.isIgnore(rtObjectRepo)) {
|
|
211
211
|
return true;
|
|
212
212
|
}
|
|
@@ -216,7 +216,7 @@ class PluginFactory {
|
|
|
216
216
|
let configData = null;
|
|
217
217
|
{
|
|
218
218
|
const pluginPath = rtObjectRepo;
|
|
219
|
-
const configUrl = this.urlReg.test(pluginPath) ? "".concat(pluginPath, "/package.json") : "".concat(ibiz.env.pluginBaseUrl, "/").concat(index.pathBrowserify.join(pluginPath, "package.json"));
|
|
219
|
+
const configUrl = this.urlReg.test(pluginPath) ? "".concat(pluginPath, "/package.json") : "".concat(ibiz.env.runContainer === "FULLCODE" && appId !== ibiz.env.appId ? ibiz.hub.microAppConfigCenter.getPluginBaseUrl(appId) : ibiz.env.pluginBaseUrl, "/").concat(index.pathBrowserify.join(pluginPath, "package.json"));
|
|
220
220
|
const res = await ibiz.net.axios({
|
|
221
221
|
method: "get",
|
|
222
222
|
headers: { "Access-Control-Allow-Origin": "*" },
|
|
@@ -229,6 +229,7 @@ class PluginFactory {
|
|
|
229
229
|
}
|
|
230
230
|
configData = res.data;
|
|
231
231
|
}
|
|
232
|
+
Object.assign(configData, { appId });
|
|
232
233
|
const remotePlugin = new runtime.RemotePluginItem(
|
|
233
234
|
rtObjectName,
|
|
234
235
|
rtObjectRepo,
|
|
@@ -257,17 +258,18 @@ class PluginFactory {
|
|
|
257
258
|
*/
|
|
258
259
|
async loadScript(remotePlugin) {
|
|
259
260
|
const pluginPath = remotePlugin.repo;
|
|
260
|
-
const { name, system, styles = [] } = remotePlugin.config;
|
|
261
|
+
const { name, appId, system, styles = [] } = remotePlugin.config;
|
|
261
262
|
let scriptUrl = "";
|
|
262
263
|
scriptUrl = index.pathBrowserify.join(pluginPath, system);
|
|
263
264
|
if (scriptUrl) {
|
|
264
265
|
if (this.cache.has(scriptUrl)) {
|
|
265
266
|
return;
|
|
266
267
|
}
|
|
268
|
+
const baseUrl = ibiz.env.runContainer === "FULLCODE" && appId !== ibiz.env.appId ? ibiz.hub.microAppConfigCenter.getPluginBaseUrl(appId) : ibiz.env.pluginBaseUrl;
|
|
267
269
|
let data = null;
|
|
268
|
-
const url = this.parseUrl(scriptUrl);
|
|
270
|
+
const url = this.parseUrl(scriptUrl, baseUrl);
|
|
269
271
|
const styleUrls = (typeof styles === "string" ? [styles] : styles).map(
|
|
270
|
-
(styleUrl) => this.parseUrl(index.default.join(pluginPath, styleUrl))
|
|
272
|
+
(styleUrl) => this.parseUrl(index.default.join(pluginPath, styleUrl), baseUrl)
|
|
271
273
|
);
|
|
272
274
|
System.addImportMap({
|
|
273
275
|
imports: {
|
|
@@ -341,7 +343,10 @@ class PluginFactory {
|
|
|
341
343
|
if (!config["systemjs-importmap"]) {
|
|
342
344
|
return;
|
|
343
345
|
}
|
|
344
|
-
const importMap = this.handleSystemImportMap(
|
|
346
|
+
const importMap = this.handleSystemImportMap(
|
|
347
|
+
config["systemjs-importmap"],
|
|
348
|
+
config.appId
|
|
349
|
+
);
|
|
345
350
|
if (importMap.packages) {
|
|
346
351
|
const pkgs = importMap.packages;
|
|
347
352
|
for (const key in pkgs) {
|
|
@@ -356,22 +361,26 @@ class PluginFactory {
|
|
|
356
361
|
ibiz.i18n.t("vue3Util.plugin.failureConfigurationLoad")
|
|
357
362
|
);
|
|
358
363
|
}
|
|
359
|
-
|
|
364
|
+
const result = res.data;
|
|
365
|
+
Object.assign(result, { appId: config.appId });
|
|
366
|
+
await this.loadPluginExternal(result);
|
|
360
367
|
}
|
|
361
368
|
}
|
|
362
369
|
System.addImportMap(importMap);
|
|
363
370
|
}
|
|
364
371
|
/**
|
|
365
|
-
* 处理 systemjs importmap 配置
|
|
366
|
-
*
|
|
367
|
-
* @author chitanda
|
|
368
|
-
* @date 2024-01-11 20:01:07
|
|
372
|
+
* @description 处理 systemjs importmap 配置
|
|
369
373
|
* @protected
|
|
370
374
|
* @param {ISystemImportMap} importMap
|
|
371
|
-
* @
|
|
375
|
+
* @param {string} appId
|
|
376
|
+
* @returns {*} {(ISystemImportMap | null)}
|
|
377
|
+
* @memberof PluginFactory
|
|
372
378
|
*/
|
|
373
|
-
handleSystemImportMap(importMap) {
|
|
379
|
+
handleSystemImportMap(importMap, appId) {
|
|
374
380
|
if (importMap) {
|
|
381
|
+
if (!importMap.baseUrl && ibiz.env.runContainer === "FULLCODE" && appId !== ibiz.env.appId) {
|
|
382
|
+
importMap.baseUrl = ibiz.hub.microAppConfigCenter.getPluginBaseUrl(appId);
|
|
383
|
+
}
|
|
375
384
|
if (importMap.packages) {
|
|
376
385
|
const pkgs = importMap.packages;
|
|
377
386
|
for (const key in pkgs) {
|
|
@@ -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(
|
|
30
|
+
return !!controlRenders.find(
|
|
31
|
+
(item) => item.id === runtime.PredefinedControlRender.EMPTYPANEL
|
|
32
|
+
);
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
exports.hasEmptyPanelRenderer = hasEmptyPanelRenderer;
|
package/lib/util/route/route.cjs
CHANGED
|
@@ -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(
|
|
41
|
+
context = JSON.parse(params.srfnavctx);
|
|
42
42
|
delete params.srfnavctx;
|
|
43
43
|
}
|
|
44
44
|
if (params.srfnav) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-util",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.10",
|
|
4
4
|
"description": "通用组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@ibiz-template/cli": "^0.3.10",
|
|
40
|
-
"@ibiz-template/core": "^0.7.41-alpha.
|
|
41
|
-
"@ibiz-template/runtime": "^0.7.41-alpha.
|
|
40
|
+
"@ibiz-template/core": "^0.7.41-alpha.9",
|
|
41
|
+
"@ibiz-template/runtime": "^0.7.41-alpha.10",
|
|
42
42
|
"@ibiz-template/theme": "^0.7.39",
|
|
43
|
-
"@ibiz/model-core": "^0.1.
|
|
43
|
+
"@ibiz/model-core": "^0.1.78",
|
|
44
44
|
"@types/path-browserify": "^1.0.2",
|
|
45
45
|
"@types/qs": "^6.9.11",
|
|
46
46
|
"@types/systemjs": "^6.13.5",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@ibiz-template/core": "^0.6.0",
|
|
59
59
|
"@ibiz-template/runtime": "^0.6.0",
|
|
60
|
-
"@ibiz/model-core": "^0.1.
|
|
60
|
+
"@ibiz/model-core": "^0.1.78",
|
|
61
61
|
"dayjs": "^1.11.10",
|
|
62
62
|
"path-browserify": "^1.0.1",
|
|
63
63
|
"pinia": "^2.1.7",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"vue": "^3.3.8",
|
|
68
68
|
"vue-router": "^4.2.4"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "6335f61a9cf619f1f8d36fd975ba57ca420ff9c1"
|
|
71
71
|
}
|