@ibiz-template/vue3-util 0.7.38-alpha.57 → 0.7.40-alpha.8
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/LICENSE +1 -1
- package/README.md +105 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/code-list/code-list.d.ts +1 -1
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts +7 -7
- package/es/common/view-shell/view-shell.d.ts +13 -7
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +10 -1
- package/es/control/panel/panel/index.d.ts +7 -7
- package/es/control/panel/panel/panel.d.ts +7 -7
- package/es/control/panel/view-layout-panel/index.d.ts +7 -7
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +7 -7
- package/es/hooks/app/app.hooks.d.ts +38 -13
- package/es/hooks/app/app.hooks.d.ts.map +1 -1
- package/es/hooks/app/app.hooks.mjs +29 -10
- package/es/index.mjs +1 -0
- package/es/panel-component/panel-container-image/panel-container-image.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.mjs +2 -1
- package/es/panel-component/panel-field/index.d.ts +2 -2
- package/es/panel-component/panel-field/panel-field.d.ts +2 -2
- package/es/props/editor/array.d.ts +2 -2
- package/es/props/editor/autocomplete.d.ts +2 -2
- package/es/props/editor/cascader.d.ts +2 -2
- package/es/props/editor/check-box-list.d.ts +2 -2
- package/es/props/editor/check-box.d.ts +2 -2
- package/es/props/editor/code.d.ts +2 -2
- package/es/props/editor/color-picker.d.ts +2 -2
- package/es/props/editor/common.d.ts +1 -1
- package/es/props/editor/data-picker.d.ts +2 -2
- package/es/props/editor/date-picker.d.ts +2 -2
- package/es/props/editor/date-range.d.ts +2 -2
- package/es/props/editor/dropdown-list.d.ts +2 -2
- package/es/props/editor/html.d.ts +2 -2
- package/es/props/editor/list-box.d.ts +2 -2
- package/es/props/editor/number-range.d.ts +2 -2
- package/es/props/editor/radio-button-list.d.ts +2 -2
- package/es/props/editor/rate.d.ts +2 -2
- package/es/props/editor/raw.d.ts +2 -2
- package/es/props/editor/slider.d.ts +2 -2
- package/es/props/editor/span.d.ts +2 -2
- package/es/props/editor/stepper.d.ts +2 -2
- package/es/props/editor/switch.d.ts +2 -2
- package/es/props/editor/text-box.d.ts +6 -6
- package/es/props/editor/upload.d.ts +2 -2
- package/es/use/index.d.ts +1 -0
- package/es/use/index.d.ts.map +1 -1
- package/es/use/index.mjs +1 -0
- package/es/use/popover/popover.d.ts +38 -0
- package/es/use/popover/popover.d.ts.map +1 -0
- package/es/use/popover/popover.mjs +92 -0
- package/es/use/view/use-view-operation/use-view-operation.d.ts.map +1 -1
- package/es/use/view/use-view-operation/use-view-operation.mjs +8 -3
- package/es/view/common/index.d.ts +9 -9
- package/es/view/common/view.d.ts +7 -7
- package/es/view/de-redirect-view/de-redirect-view.d.ts +16 -7
- package/es/view/de-redirect-view/de-redirect-view.d.ts.map +1 -1
- package/es/view/de-redirect-view/de-redirect-view.mjs +17 -1
- package/es/view/de-redirect-view/index.d.ts +16 -7
- package/es/view/de-redirect-view/index.d.ts.map +1 -1
- package/es/view/html-view/html-view.d.ts +14 -14
- package/es/view/html-view/html-view.d.ts.map +1 -1
- package/es/view/html-view/html-view.mjs +6 -8
- package/es/view/html-view/index.d.ts +12 -12
- package/es/view/portal-view/index.d.ts +7 -7
- package/es/view/portal-view/portal-view.d.ts +7 -7
- package/lib/common/view-shell/view-shell.cjs +9 -0
- package/lib/hooks/app/app.hooks.cjs +28 -9
- package/lib/index.cjs +4 -0
- package/lib/panel-component/panel-container-image/panel-container-image.cjs +2 -1
- package/lib/use/index.cjs +4 -0
- package/lib/use/popover/popover.cjs +96 -0
- package/lib/use/view/use-view-operation/use-view-operation.cjs +8 -3
- package/lib/view/de-redirect-view/de-redirect-view.cjs +16 -0
- package/lib/view/html-view/html-view.cjs +6 -8
- package/package.json +10 -13
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var qxUtil = require('qx-util');
|
|
4
|
+
var vue = require('vue');
|
|
5
|
+
var core = require('@ibiz-template/core');
|
|
6
|
+
require('../../util/index.cjs');
|
|
7
|
+
var uiStore = require('../../util/store/ui-store/ui-store.cjs');
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
function usePopoverzIndex() {
|
|
11
|
+
const popoverid = "popover_".concat(qxUtil.createUUID());
|
|
12
|
+
const setPopoverZIndex = (zIndexClass) => {
|
|
13
|
+
const { zIndex } = uiStore.useUIStore();
|
|
14
|
+
const transfer = document.getElementsByClassName(popoverid);
|
|
15
|
+
const modalZIndex = zIndex.increment();
|
|
16
|
+
if (transfer && transfer.length > 0 && zIndexClass) {
|
|
17
|
+
for (let i = 0; i < transfer.length; i++) {
|
|
18
|
+
transfer[i].style.setProperty(
|
|
19
|
+
zIndexClass,
|
|
20
|
+
"".concat(modalZIndex)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
popoverid,
|
|
27
|
+
setPopoverZIndex
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function shareCommonAncestor(element1, element2) {
|
|
31
|
+
if (!element1 || !element2)
|
|
32
|
+
return false;
|
|
33
|
+
if (element1 === element2)
|
|
34
|
+
return true;
|
|
35
|
+
const ancestorsOfElement1 = /* @__PURE__ */ new Set();
|
|
36
|
+
let current = element1;
|
|
37
|
+
while (current) {
|
|
38
|
+
ancestorsOfElement1.add(current);
|
|
39
|
+
const parentNode = current.parentNode;
|
|
40
|
+
if (parentNode && (parentNode.nodeName === "BODY" || parentNode.nodeName === "HTML")) {
|
|
41
|
+
current = null;
|
|
42
|
+
} else {
|
|
43
|
+
current = parentNode;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
current = element2;
|
|
47
|
+
while (current) {
|
|
48
|
+
if (ancestorsOfElement1.has(current)) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
current = current.parentNode;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
function usePopoverVisible(triggerRef, getElement) {
|
|
56
|
+
let cleanup;
|
|
57
|
+
const popoverVisible = vue.ref(false);
|
|
58
|
+
const setPopoverVisible = (visible) => {
|
|
59
|
+
popoverVisible.value = visible;
|
|
60
|
+
};
|
|
61
|
+
vue.watch(
|
|
62
|
+
() => triggerRef.value,
|
|
63
|
+
(newValue) => {
|
|
64
|
+
if (newValue && !cleanup) {
|
|
65
|
+
cleanup = core.listenJSEvent(
|
|
66
|
+
window,
|
|
67
|
+
"click",
|
|
68
|
+
(evt) => {
|
|
69
|
+
if (popoverVisible.value && triggerRef.value) {
|
|
70
|
+
const result = shareCommonAncestor(
|
|
71
|
+
getElement(triggerRef.value),
|
|
72
|
+
evt.target
|
|
73
|
+
);
|
|
74
|
+
if (result) {
|
|
75
|
+
popoverVisible.value = false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{ capture: true }
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{ immediate: true }
|
|
84
|
+
);
|
|
85
|
+
vue.onUnmounted(() => {
|
|
86
|
+
cleanup == null ? void 0 : cleanup();
|
|
87
|
+
});
|
|
88
|
+
return {
|
|
89
|
+
popoverVisible,
|
|
90
|
+
setPopoverVisible
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
exports.shareCommonAncestor = shareCommonAncestor;
|
|
95
|
+
exports.usePopoverVisible = usePopoverVisible;
|
|
96
|
+
exports.usePopoverzIndex = usePopoverzIndex;
|
|
@@ -12,9 +12,14 @@ function useViewOperation(view) {
|
|
|
12
12
|
if (!viewElement)
|
|
13
13
|
return;
|
|
14
14
|
listenJSEventFuncs = listenJSEventNames.map((eventName) => {
|
|
15
|
-
return core.listenJSEvent(
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
return core.listenJSEvent(
|
|
16
|
+
viewElement,
|
|
17
|
+
eventName,
|
|
18
|
+
(event) => {
|
|
19
|
+
view.setOperateState("MANUAL");
|
|
20
|
+
},
|
|
21
|
+
{ once: true, capture: true }
|
|
22
|
+
);
|
|
18
23
|
});
|
|
19
24
|
});
|
|
20
25
|
vue.onUnmounted(() => {
|
|
@@ -21,6 +21,10 @@ const DeRedirectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
21
21
|
modelData: {
|
|
22
22
|
type: Object,
|
|
23
23
|
required: true
|
|
24
|
+
},
|
|
25
|
+
isEmbedCtrlNav: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
setup(props) {
|
|
@@ -39,6 +43,18 @@ const DeRedirectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
43
|
}
|
|
40
44
|
});
|
|
41
45
|
});
|
|
46
|
+
if (props.isEmbedCtrlNav) {
|
|
47
|
+
vue.watch(() => [c.context, c.params], () => {
|
|
48
|
+
runtime.getDERedirectToView(vue.toRaw(props.modelData), vue.toRaw(c.context), vue.toRaw(c.params)).then(async (result) => {
|
|
49
|
+
if (result.type === "view") {
|
|
50
|
+
toViewId.value = result.viewId;
|
|
51
|
+
toViewContext.value = result.context;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}, {
|
|
55
|
+
deep: true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
42
58
|
return {
|
|
43
59
|
c,
|
|
44
60
|
toViewId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
+
var core = require('@ibiz-template/core');
|
|
4
5
|
var runtime = require('@ibiz-template/runtime');
|
|
5
6
|
require('../../use/index.cjs');
|
|
6
7
|
require('./html-view.css');
|
|
@@ -42,14 +43,11 @@ const HtmlView = /* @__PURE__ */ vue.defineComponent({
|
|
|
42
43
|
const viewClassNames = [ns.b(), ns.b(typeClass), ns.m(codeName), sysCssName];
|
|
43
44
|
const isLoading = vue.ref(false);
|
|
44
45
|
const url = vue.computed(() => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return htmlUrl;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
46
|
+
const {
|
|
47
|
+
htmlUrl
|
|
48
|
+
} = c.model;
|
|
49
|
+
if (htmlUrl)
|
|
50
|
+
return core.StringUtil.fill(htmlUrl, c.context, c.params);
|
|
53
51
|
return "";
|
|
54
52
|
});
|
|
55
53
|
vue.onBeforeMount(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-util",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "vue3
|
|
3
|
+
"version": "0.7.40-alpha.8",
|
|
4
|
+
"description": "通用组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
7
7
|
"system": "./dist/index.system.js",
|
|
@@ -11,14 +11,11 @@
|
|
|
11
11
|
"require": "./lib/index.cjs"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://gitee.com/iBizModeling/ibiz-template.git"
|
|
17
|
-
},
|
|
18
14
|
"files": [
|
|
19
15
|
"dist",
|
|
20
16
|
"es",
|
|
21
|
-
"lib"
|
|
17
|
+
"lib",
|
|
18
|
+
"README.md"
|
|
22
19
|
],
|
|
23
20
|
"scripts": {
|
|
24
21
|
"dev": "ibiz-temp build -w",
|
|
@@ -36,14 +33,14 @@
|
|
|
36
33
|
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/",
|
|
37
34
|
"publish:local": "npm run build && npm publish --access public --registry=http://172.16.240.221:8081/repository/local/"
|
|
38
35
|
},
|
|
39
|
-
"author": "
|
|
36
|
+
"author": "iBiz",
|
|
40
37
|
"license": "MIT",
|
|
41
38
|
"devDependencies": {
|
|
42
39
|
"@ibiz-template/cli": "^0.3.10",
|
|
43
|
-
"@ibiz-template/core": "^0.7.
|
|
44
|
-
"@ibiz-template/runtime": "^0.7.
|
|
45
|
-
"@ibiz-template/theme": "^0.7.
|
|
46
|
-
"@ibiz/model-core": "^0.1.
|
|
40
|
+
"@ibiz-template/core": "^0.7.40-alpha.7",
|
|
41
|
+
"@ibiz-template/runtime": "^0.7.40-alpha.8",
|
|
42
|
+
"@ibiz-template/theme": "^0.7.39",
|
|
43
|
+
"@ibiz/model-core": "^0.1.71",
|
|
47
44
|
"@types/path-browserify": "^1.0.2",
|
|
48
45
|
"@types/qs": "^6.9.11",
|
|
49
46
|
"@types/systemjs": "^6.13.5",
|
|
@@ -60,7 +57,7 @@
|
|
|
60
57
|
"peerDependencies": {
|
|
61
58
|
"@ibiz-template/core": "^0.6.0",
|
|
62
59
|
"@ibiz-template/runtime": "^0.6.0",
|
|
63
|
-
"@ibiz/model-core": "^0.1.
|
|
60
|
+
"@ibiz/model-core": "^0.1.71",
|
|
64
61
|
"dayjs": "^1.11.10",
|
|
65
62
|
"path-browserify": "^1.0.1",
|
|
66
63
|
"pinia": "^2.1.7",
|