@ibiz-template/vue3-util 0.7.38-alpha.57 → 0.7.39
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/badge/badge.d.ts +1 -1
- package/es/common/code-list/code-list.d.ts +1 -1
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts +1 -1
- package/es/common/control-shell/control-shell.d.ts +1 -1
- package/es/common/custom-render/custom-render.d.ts +1 -1
- package/es/common/icon/icon.d.ts +1 -1
- package/es/common/router-view/router-view.d.ts +4 -3
- package/es/common/router-view/router-view.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.d.ts +8 -2
- 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 +1 -1
- package/es/control/panel/panel/panel.d.ts +1 -1
- package/es/control/panel/view-layout-panel/index.d.ts +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +2 -2
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
- package/es/index.mjs +1 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts +1 -1
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts +1 -1
- package/es/panel-component/grid-container/grid-container.d.ts +1 -1
- package/es/panel-component/grid-container/index.d.ts +1 -1
- package/es/panel-component/multi-data-container/index.d.ts +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.d.ts +2 -2
- package/es/panel-component/multi-data-container/multi-data-container.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/index.d.ts +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts +2 -2
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts.map +1 -1
- package/es/panel-component/nav-pos/index.d.ts +1 -1
- package/es/panel-component/nav-pos/nav-pos.d.ts +1 -1
- package/es/panel-component/panel-container/index.d.ts +1 -1
- package/es/panel-component/panel-container/panel-container.d.ts +1 -1
- package/es/panel-component/panel-container-group/index.d.ts +1 -1
- package/es/panel-component/panel-container-group/panel-container-group.d.ts +1 -1
- package/es/panel-component/panel-container-image/index.d.ts +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.d.ts +1 -1
- 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-container-tabs/index.d.ts +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts +1 -1
- package/es/panel-component/panel-ctrl-pos/index.d.ts +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts +1 -1
- package/es/panel-component/panel-ctrl-view-page-caption/index.d.ts +1 -1
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.d.ts +1 -1
- package/es/panel-component/panel-field/index.d.ts +1 -1
- package/es/panel-component/panel-field/panel-field.d.ts +1 -1
- package/es/panel-component/panel-item-render/index.d.ts +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.d.ts +1 -1
- package/es/panel-component/panel-rawitem/index.d.ts +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts +1 -1
- package/es/panel-component/panel-tab-page/index.d.ts +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +1 -1
- package/es/panel-component/scroll-container/index.d.ts +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts +1 -1
- package/es/panel-component/single-data-container/index.d.ts +1 -1
- package/es/panel-component/single-data-container/single-data-container.d.ts +2 -2
- package/es/panel-component/single-data-container/single-data-container.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/index.d.ts +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +1 -1
- package/es/use/click-outside/click-outside.d.ts.map +1 -1
- 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/util/install.d.ts.map +1 -1
- package/es/view/app-redirect-view/app-redirect-view.d.ts +1 -1
- package/es/view/app-redirect-view/app-redirect-view.d.ts.map +1 -1
- package/es/view/common/index.d.ts +1 -1
- package/es/view/common/view.d.ts +1 -1
- package/es/view/de-redirect-view/de-redirect-view.d.ts +1 -1
- package/es/view/de-redirect-view/index.d.ts +1 -1
- package/es/view/html-view/html-view.d.ts +8 -8
- 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 +6 -6
- package/es/view/portal-view/index.d.ts +1 -1
- package/es/view/portal-view/portal-view.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts.map +1 -1
- package/lib/common/view-shell/view-shell.cjs +9 -0
- 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/html-view/html-view.cjs +6 -8
- package/package.json +12 -14
|
@@ -23,7 +23,7 @@ export declare const IBizSingleDataContainer: import("../../util").TypeWithInsta
|
|
|
23
23
|
} | undefined) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
24
24
|
[key: string]: any;
|
|
25
25
|
}> | null;
|
|
26
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
26
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
27
|
modelData: {
|
|
28
28
|
type: import("vue").PropType<import("@ibiz/model-core").IPanelContainer>;
|
|
29
29
|
required: true;
|
|
@@ -22,8 +22,8 @@ export declare const SingleDataContainer: import("vue").DefineComponent<{
|
|
|
22
22
|
panelItems: {
|
|
23
23
|
[key: string]: IPanelItemController;
|
|
24
24
|
};
|
|
25
|
-
}) => VNode | null;
|
|
26
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
25
|
+
} | undefined) => VNode | null;
|
|
26
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
27
|
modelData: {
|
|
28
28
|
type: PropType<IPanelContainer>;
|
|
29
29
|
required: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-data-container.d.ts","sourceRoot":"","sources":["../../../src/panel-component/single-data-container/single-data-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAIL,QAAQ,EAER,KAAK,EACN,MAAM,KAAK,CAAC;AAEb,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,8BAA8B,CAAC;AAEtC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iCA0Bb,UAAU,
|
|
1
|
+
{"version":3,"file":"single-data-container.d.ts","sourceRoot":"","sources":["../../../src/panel-component/single-data-container/single-data-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAIL,QAAQ,EAER,KAAK,EACN,MAAM,KAAK,CAAC;AAEb,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,8BAA8B,CAAC;AAEtC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iCA0Bb,UAAU;;;;;;;sBASlB,KAAK,GAAG,IAAI;;;;;;;;;;YA0CrB,CAAC"}
|
|
@@ -13,7 +13,7 @@ export declare const IBizTeleportPlaceholder: import("../../util").TypeWithInsta
|
|
|
13
13
|
ns: import("@ibiz-template/core").Namespace;
|
|
14
14
|
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
15
15
|
tempStyle: import("vue").Ref<string>;
|
|
16
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
16
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
17
|
modelData: {
|
|
18
18
|
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
19
19
|
required: true;
|
|
@@ -15,7 +15,7 @@ export declare const TeleportPlaceholder: import("vue").DefineComponent<{
|
|
|
15
15
|
ns: import("@ibiz-template/core").Namespace;
|
|
16
16
|
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
17
17
|
tempStyle: import("vue").Ref<string>;
|
|
18
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
19
|
modelData: {
|
|
20
20
|
type: PropType<IPanelRawItem>;
|
|
21
21
|
required: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/use/click-outside/click-outside.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/use/click-outside/click-outside.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAmB,GAAG,EAAS,MAAM,KAAK,CAAC;AAElD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CA8CtB"}
|
package/es/use/index.d.ts
CHANGED
package/es/use/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/use/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,mCAAmC,CAAC;AAClD,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/use/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,mCAAmC,CAAC;AAClD,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC"}
|
package/es/use/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ export { EmptyVNode, getOrigin, isEmptyVNode, useController, useForce, useForceT
|
|
|
10
10
|
export { useCodeListListen } from './codeList-listen/codelist-listen.mjs';
|
|
11
11
|
export { useLocalCacheKey } from './storage/index.mjs';
|
|
12
12
|
export { useAutoFocusBlur } from './autofocus-blur/autofocus-blur.mjs';
|
|
13
|
+
export { shareCommonAncestor, usePopoverVisible, usePopoverzIndex } from './popover/popover.mjs';
|
|
13
14
|
export { useControlController } from './control/use-control-controller/use-control-controller.mjs';
|
|
14
15
|
export { useViewController } from './view/use-view-controller/use-view-controller.mjs';
|
|
15
16
|
export { useViewOperation } from './view/use-view-operation/use-view-operation.mjs';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 手动管理popover层级
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @param {string} uuid
|
|
7
|
+
* @param {string} zIndexClass
|
|
8
|
+
*/
|
|
9
|
+
export declare function usePopoverzIndex(): {
|
|
10
|
+
popoverid: string;
|
|
11
|
+
setPopoverZIndex: (zIndexClass: string) => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* 判断两个元素是否存在任意层级的共同祖先
|
|
15
|
+
*
|
|
16
|
+
* @param element1 第一个元素(允许为 null,表示未挂载的虚拟节点)
|
|
17
|
+
* @param element2 第二个元素(允许为 null,表示未挂载的虚拟节点)
|
|
18
|
+
* @returns 是否共享至少一个共同祖先(包括自身或父子关系)
|
|
19
|
+
*/
|
|
20
|
+
export declare function shareCommonAncestor(element1: Node | null, element2: Node | null): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 手动管理popover打开关闭状态
|
|
23
|
+
*
|
|
24
|
+
* @author tony001
|
|
25
|
+
* @date 2025-02-27 16:02:17
|
|
26
|
+
* @export
|
|
27
|
+
* @param {Ref<unknown>} triggerRef
|
|
28
|
+
* @param {(ele: IData) => Node} getElement
|
|
29
|
+
* @return {*} {{
|
|
30
|
+
* popoverVisible: Ref<boolean>;
|
|
31
|
+
* setPopoverVisible: (visible: boolean) => void;
|
|
32
|
+
* }}
|
|
33
|
+
*/
|
|
34
|
+
export declare function usePopoverVisible(triggerRef: Ref<unknown>, getElement: (ele: IData) => Node): {
|
|
35
|
+
popoverVisible: Ref<boolean>;
|
|
36
|
+
setPopoverVisible: (visible: boolean) => void;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/use/popover/popover.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,GAAG,EAAc,MAAM,KAAK,CAAC;AAInD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD,CAoBA;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,IAAI,GAAG,IAAI,EACrB,QAAQ,EAAE,IAAI,GAAG,IAAI,GACpB,OAAO,CA+BT;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,EACxB,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,GAC/B;IACD,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C,CA0CA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createUUID } from 'qx-util';
|
|
2
|
+
import { ref, watch, onUnmounted } from 'vue';
|
|
3
|
+
import { listenJSEvent } from '@ibiz-template/core';
|
|
4
|
+
import '../../util/index.mjs';
|
|
5
|
+
import { useUIStore } from '../../util/store/ui-store/ui-store.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
function usePopoverzIndex() {
|
|
9
|
+
const popoverid = "popover_".concat(createUUID());
|
|
10
|
+
const setPopoverZIndex = (zIndexClass) => {
|
|
11
|
+
const { zIndex } = useUIStore();
|
|
12
|
+
const transfer = document.getElementsByClassName(popoverid);
|
|
13
|
+
const modalZIndex = zIndex.increment();
|
|
14
|
+
if (transfer && transfer.length > 0 && zIndexClass) {
|
|
15
|
+
for (let i = 0; i < transfer.length; i++) {
|
|
16
|
+
transfer[i].style.setProperty(
|
|
17
|
+
zIndexClass,
|
|
18
|
+
"".concat(modalZIndex)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
popoverid,
|
|
25
|
+
setPopoverZIndex
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function shareCommonAncestor(element1, element2) {
|
|
29
|
+
if (!element1 || !element2)
|
|
30
|
+
return false;
|
|
31
|
+
if (element1 === element2)
|
|
32
|
+
return true;
|
|
33
|
+
const ancestorsOfElement1 = /* @__PURE__ */ new Set();
|
|
34
|
+
let current = element1;
|
|
35
|
+
while (current) {
|
|
36
|
+
ancestorsOfElement1.add(current);
|
|
37
|
+
const parentNode = current.parentNode;
|
|
38
|
+
if (parentNode && (parentNode.nodeName === "BODY" || parentNode.nodeName === "HTML")) {
|
|
39
|
+
current = null;
|
|
40
|
+
} else {
|
|
41
|
+
current = parentNode;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
current = element2;
|
|
45
|
+
while (current) {
|
|
46
|
+
if (ancestorsOfElement1.has(current)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
current = current.parentNode;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
function usePopoverVisible(triggerRef, getElement) {
|
|
54
|
+
let cleanup;
|
|
55
|
+
const popoverVisible = ref(false);
|
|
56
|
+
const setPopoverVisible = (visible) => {
|
|
57
|
+
popoverVisible.value = visible;
|
|
58
|
+
};
|
|
59
|
+
watch(
|
|
60
|
+
() => triggerRef.value,
|
|
61
|
+
(newValue) => {
|
|
62
|
+
if (newValue && !cleanup) {
|
|
63
|
+
cleanup = listenJSEvent(
|
|
64
|
+
window,
|
|
65
|
+
"click",
|
|
66
|
+
(evt) => {
|
|
67
|
+
if (popoverVisible.value && triggerRef.value) {
|
|
68
|
+
const result = shareCommonAncestor(
|
|
69
|
+
getElement(triggerRef.value),
|
|
70
|
+
evt.target
|
|
71
|
+
);
|
|
72
|
+
if (result) {
|
|
73
|
+
popoverVisible.value = false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{ capture: true }
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{ immediate: true }
|
|
82
|
+
);
|
|
83
|
+
onUnmounted(() => {
|
|
84
|
+
cleanup == null ? void 0 : cleanup();
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
popoverVisible,
|
|
88
|
+
setPopoverVisible
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { shareCommonAncestor, usePopoverVisible, usePopoverzIndex };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-view-operation.d.ts","sourceRoot":"","sources":["../../../../src/use/view/use-view-operation/use-view-operation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"use-view-operation.d.ts","sourceRoot":"","sources":["../../../../src/use/view/use-view-operation/use-view-operation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CA4B3D"}
|
|
@@ -10,9 +10,14 @@ function useViewOperation(view) {
|
|
|
10
10
|
if (!viewElement)
|
|
11
11
|
return;
|
|
12
12
|
listenJSEventFuncs = listenJSEventNames.map((eventName) => {
|
|
13
|
-
return listenJSEvent(
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return listenJSEvent(
|
|
14
|
+
viewElement,
|
|
15
|
+
eventName,
|
|
16
|
+
(event) => {
|
|
17
|
+
view.setOperateState("MANUAL");
|
|
18
|
+
},
|
|
19
|
+
{ once: true, capture: true }
|
|
20
|
+
);
|
|
16
21
|
});
|
|
17
22
|
});
|
|
18
23
|
onUnmounted(() => {
|
package/es/util/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/util/install.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAEvC,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAE5C,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/util/install.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAEvC,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAE5C,eAAO,MAAM,WAAW,6BAER,GAAG,KAAK,IAAI,uBAM3B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const AppRedirectView: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
export declare const AppRedirectView: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
//# sourceMappingURL=app-redirect-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-redirect-view.d.ts","sourceRoot":"","sources":["../../../src/view/app-redirect-view/app-redirect-view.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"app-redirect-view.d.ts","sourceRoot":"","sources":["../../../src/view/app-redirect-view/app-redirect-view.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,sSAqB1B,CAAC"}
|
|
@@ -30,7 +30,7 @@ export declare const IBizView: import("../../util").TypeWithInstall<import("vue"
|
|
|
30
30
|
}>;
|
|
31
31
|
getCtrlTeleportTag: (ctrl: import("@ibiz/model-core").IControl) => string | undefined;
|
|
32
32
|
getControlStyle: () => {};
|
|
33
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
33
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
34
|
context: import("vue").PropType<IContext>;
|
|
35
35
|
params: {
|
|
36
36
|
type: import("vue").PropType<IParams>;
|
package/es/view/common/view.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare const View: import("vue").DefineComponent<{
|
|
|
32
32
|
renderControl: (ctrl: IControl, slotProps?: IData) => VNode;
|
|
33
33
|
getCtrlTeleportTag: (ctrl: IControl) => string | undefined;
|
|
34
34
|
getControlStyle: () => {};
|
|
35
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
35
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
36
|
context: PropType<IContext>;
|
|
37
37
|
params: {
|
|
38
38
|
type: PropType<IParams>;
|
|
@@ -19,7 +19,7 @@ export declare const DeRedirectView: import("vue").DefineComponent<{
|
|
|
19
19
|
toViewId: import("vue").Ref<string | undefined>;
|
|
20
20
|
toViewContext: import("vue").Ref<IContext | undefined>;
|
|
21
21
|
toViewParams: import("vue").Ref<IParams | undefined>;
|
|
22
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
22
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
23
|
context: {
|
|
24
24
|
type: PropType<IContext>;
|
|
25
25
|
required: true;
|
|
@@ -16,7 +16,7 @@ export declare const IBizDeRedirectView: import("../../util").TypeWithInstall<im
|
|
|
16
16
|
toViewId: import("vue").Ref<string | undefined>;
|
|
17
17
|
toViewContext: import("vue").Ref<IContext | undefined>;
|
|
18
18
|
toViewParams: import("vue").Ref<IParams | undefined>;
|
|
19
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
19
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
20
|
context: {
|
|
21
21
|
type: import("vue").PropType<IContext>;
|
|
22
22
|
required: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IAppDEHtmlView } from '@ibiz/model-core';
|
|
2
|
+
import { ViewController } from '@ibiz-template/runtime';
|
|
3
3
|
import { PropType } from 'vue';
|
|
4
4
|
import './html-view.scss';
|
|
5
5
|
export declare const HtmlView: import("vue").DefineComponent<{
|
|
@@ -9,11 +9,11 @@ export declare const HtmlView: import("vue").DefineComponent<{
|
|
|
9
9
|
default: () => {};
|
|
10
10
|
};
|
|
11
11
|
modelData: {
|
|
12
|
-
type: PropType<
|
|
12
|
+
type: PropType<IAppDEHtmlView>;
|
|
13
13
|
required: true;
|
|
14
14
|
};
|
|
15
15
|
modal: {
|
|
16
|
-
type: PropType<
|
|
16
|
+
type: PropType<IAppDEHtmlView>;
|
|
17
17
|
};
|
|
18
18
|
state: {
|
|
19
19
|
type: PropType<IData>;
|
|
@@ -23,21 +23,21 @@ export declare const HtmlView: import("vue").DefineComponent<{
|
|
|
23
23
|
ns: import("@ibiz-template/core").Namespace;
|
|
24
24
|
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
25
25
|
viewClassNames: (string | undefined)[];
|
|
26
|
-
url: import("vue").ComputedRef<
|
|
26
|
+
url: import("vue").ComputedRef<string>;
|
|
27
27
|
isLoading: import("vue").Ref<boolean>;
|
|
28
28
|
onLoad: () => void;
|
|
29
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
29
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
30
|
context: PropType<IContext>;
|
|
31
31
|
params: {
|
|
32
32
|
type: PropType<IParams>;
|
|
33
33
|
default: () => {};
|
|
34
34
|
};
|
|
35
35
|
modelData: {
|
|
36
|
-
type: PropType<
|
|
36
|
+
type: PropType<IAppDEHtmlView>;
|
|
37
37
|
required: true;
|
|
38
38
|
};
|
|
39
39
|
modal: {
|
|
40
|
-
type: PropType<
|
|
40
|
+
type: PropType<IAppDEHtmlView>;
|
|
41
41
|
};
|
|
42
42
|
state: {
|
|
43
43
|
type: PropType<IData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-view.d.ts","sourceRoot":"","sources":["../../../src/view/html-view/html-view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html-view.d.ts","sourceRoot":"","sources":["../../../src/view/html-view/html-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAGL,QAAQ,EAKT,MAAM,KAAK,CAAC;AAEb,OAAO,kBAAkB,CAAC;AAE1B,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+DnB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, onBeforeMount, withDirectives, createVNode, resolveDirective, h, resolveComponent } from 'vue';
|
|
2
|
+
import { StringUtil } from '@ibiz-template/core';
|
|
2
3
|
import { ViewController, getErrorViewProvider } from '@ibiz-template/runtime';
|
|
3
4
|
import '../../use/index.mjs';
|
|
4
5
|
import './html-view.css';
|
|
@@ -40,14 +41,11 @@ const HtmlView = /* @__PURE__ */ defineComponent({
|
|
|
40
41
|
const viewClassNames = [ns.b(), ns.b(typeClass), ns.m(codeName), sysCssName];
|
|
41
42
|
const isLoading = ref(false);
|
|
42
43
|
const url = computed(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return htmlUrl;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
44
|
+
const {
|
|
45
|
+
htmlUrl
|
|
46
|
+
} = c.model;
|
|
47
|
+
if (htmlUrl)
|
|
48
|
+
return StringUtil.fill(htmlUrl, c.context, c.params);
|
|
51
49
|
return "";
|
|
52
50
|
});
|
|
53
51
|
onBeforeMount(() => {
|
|
@@ -5,11 +5,11 @@ export declare const IBizHtmlView: import("../../util").TypeWithInstall<import("
|
|
|
5
5
|
default: () => {};
|
|
6
6
|
};
|
|
7
7
|
modelData: {
|
|
8
|
-
type: import("vue").PropType<import("@ibiz/model-core").
|
|
8
|
+
type: import("vue").PropType<import("@ibiz/model-core").IAppDEHtmlView>;
|
|
9
9
|
required: true;
|
|
10
10
|
};
|
|
11
11
|
modal: {
|
|
12
|
-
type: import("vue").PropType<import("@ibiz-
|
|
12
|
+
type: import("vue").PropType<import("@ibiz/model-core").IAppDEHtmlView>;
|
|
13
13
|
};
|
|
14
14
|
state: {
|
|
15
15
|
type: import("vue").PropType<IData>;
|
|
@@ -19,21 +19,21 @@ export declare const IBizHtmlView: import("../../util").TypeWithInstall<import("
|
|
|
19
19
|
ns: import("@ibiz-template/core").Namespace;
|
|
20
20
|
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
21
21
|
viewClassNames: (string | undefined)[];
|
|
22
|
-
url: import("vue").ComputedRef<
|
|
22
|
+
url: import("vue").ComputedRef<string>;
|
|
23
23
|
isLoading: import("vue").Ref<boolean>;
|
|
24
24
|
onLoad: () => void;
|
|
25
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
25
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
26
|
context: import("vue").PropType<IContext>;
|
|
27
27
|
params: {
|
|
28
28
|
type: import("vue").PropType<IParams>;
|
|
29
29
|
default: () => {};
|
|
30
30
|
};
|
|
31
31
|
modelData: {
|
|
32
|
-
type: import("vue").PropType<import("@ibiz/model-core").
|
|
32
|
+
type: import("vue").PropType<import("@ibiz/model-core").IAppDEHtmlView>;
|
|
33
33
|
required: true;
|
|
34
34
|
};
|
|
35
35
|
modal: {
|
|
36
|
-
type: import("vue").PropType<import("@ibiz-
|
|
36
|
+
type: import("vue").PropType<import("@ibiz/model-core").IAppDEHtmlView>;
|
|
37
37
|
};
|
|
38
38
|
state: {
|
|
39
39
|
type: import("vue").PropType<IData>;
|
|
@@ -19,7 +19,7 @@ export declare const IBizPortalView: import("../../util").TypeWithInstall<import
|
|
|
19
19
|
ns: import("@ibiz-template/core").Namespace;
|
|
20
20
|
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
21
21
|
viewClassNames: (string | undefined)[];
|
|
22
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
22
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
23
|
context: import("vue").PropType<IContext>;
|
|
24
24
|
params: {
|
|
25
25
|
type: import("vue").PropType<IParams>;
|
|
@@ -22,7 +22,7 @@ export declare const PortalView: import("vue").DefineComponent<{
|
|
|
22
22
|
ns: import("@ibiz-template/core").Namespace;
|
|
23
23
|
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
24
24
|
viewClassNames: (string | undefined)[];
|
|
25
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
25
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
26
|
context: PropType<IContext>;
|
|
27
27
|
params: {
|
|
28
28
|
type: PropType<IParams>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const TodoRedirect: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
export declare const TodoRedirect: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
//# sourceMappingURL=todo-redirect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todo-redirect.d.ts","sourceRoot":"","sources":["../../../src/view/todo-redirect/todo-redirect.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"todo-redirect.d.ts","sourceRoot":"","sources":["../../../src/view/todo-redirect/todo-redirect.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,sSA8CvB,CAAC"}
|
|
@@ -25,6 +25,10 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
25
25
|
},
|
|
26
26
|
viewId: {
|
|
27
27
|
type: String
|
|
28
|
+
},
|
|
29
|
+
// 解决打开浮动容器(模态、抽屉、弹出框)ctx丢失问题
|
|
30
|
+
ctx: {
|
|
31
|
+
type: Object
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
setup(props, {
|
|
@@ -36,6 +40,9 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
36
40
|
const provider = vue.ref();
|
|
37
41
|
const viewModelData = vue.ref();
|
|
38
42
|
const hasAuthority = vue.ref(true);
|
|
43
|
+
if (props.ctx) {
|
|
44
|
+
vue.provide("ctx", props.ctx);
|
|
45
|
+
}
|
|
39
46
|
const context = vue.ref(props.context);
|
|
40
47
|
const params = vue.ref(props.params || {});
|
|
41
48
|
let dynaViewCacheKey = "";
|
|
@@ -130,6 +137,8 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
130
137
|
context.value.srfsessionid = domain.id;
|
|
131
138
|
}
|
|
132
139
|
const app = ibiz.hub.getApp(viewModel.appId);
|
|
140
|
+
if (!context.value.srfappid)
|
|
141
|
+
context.value.srfappid = viewModel.appId;
|
|
133
142
|
const service = await app.deService.getService(context.value, appDataEntityId);
|
|
134
143
|
const res = await service.get(context.value, params.value || {});
|
|
135
144
|
if (res.ok && res.data) {
|
package/lib/index.cjs
CHANGED
|
@@ -85,6 +85,7 @@ var vue = require('./use/vue/vue.cjs');
|
|
|
85
85
|
var codelistListen = require('./use/codeList-listen/codelist-listen.cjs');
|
|
86
86
|
var index$p = require('./use/storage/index.cjs');
|
|
87
87
|
var autofocusBlur = require('./use/autofocus-blur/autofocus-blur.cjs');
|
|
88
|
+
var popover = require('./use/popover/popover.cjs');
|
|
88
89
|
var overlayContainer = require('./util/overlay-container/overlay-container.cjs');
|
|
89
90
|
var overlayPopoverContainer = require('./util/overlay-popover-container/overlay-popover-container.cjs');
|
|
90
91
|
var routerCallback = require('./util/router-callback/router-callback.cjs');
|
|
@@ -211,6 +212,9 @@ exports.usePropsWatch = vue.usePropsWatch;
|
|
|
211
212
|
exports.useCodeListListen = codelistListen.useCodeListListen;
|
|
212
213
|
exports.useLocalCacheKey = index$p.useLocalCacheKey;
|
|
213
214
|
exports.useAutoFocusBlur = autofocusBlur.useAutoFocusBlur;
|
|
215
|
+
exports.shareCommonAncestor = popover.shareCommonAncestor;
|
|
216
|
+
exports.usePopoverVisible = popover.usePopoverVisible;
|
|
217
|
+
exports.usePopoverzIndex = popover.usePopoverzIndex;
|
|
214
218
|
exports.OverlayContainer = overlayContainer.OverlayContainer;
|
|
215
219
|
exports.OverlayPopoverContainer = overlayPopoverContainer.OverlayPopoverContainer;
|
|
216
220
|
exports.routerCallback = routerCallback.routerCallback;
|
|
@@ -39,7 +39,8 @@ const PanelContainerImage = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
39
|
let imgStr = "";
|
|
40
40
|
if (image == null ? void 0 : image.rawContent) {
|
|
41
41
|
if (core.isSvg(image.rawContent)) {
|
|
42
|
-
|
|
42
|
+
const rawContent = image.rawContent.replace(/[\u4e00-\u9fff]/g, "");
|
|
43
|
+
imgStr = "url(data:image/svg+xml;base64,".concat(btoa(rawContent), ")");
|
|
43
44
|
} else {
|
|
44
45
|
imgStr = "url(".concat(image.rawContent, ")");
|
|
45
46
|
}
|
package/lib/use/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ var vue = require('./vue/vue.cjs');
|
|
|
12
12
|
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
|
+
var popover = require('./popover/popover.cjs');
|
|
15
16
|
var useControlController = require('./control/use-control-controller/use-control-controller.cjs');
|
|
16
17
|
var useViewController = require('./view/use-view-controller/use-view-controller.cjs');
|
|
17
18
|
var useViewOperation = require('./view/use-view-operation/use-view-operation.cjs');
|
|
@@ -37,6 +38,9 @@ exports.usePropsWatch = vue.usePropsWatch;
|
|
|
37
38
|
exports.useCodeListListen = codelistListen.useCodeListListen;
|
|
38
39
|
exports.useLocalCacheKey = index$1.useLocalCacheKey;
|
|
39
40
|
exports.useAutoFocusBlur = autofocusBlur.useAutoFocusBlur;
|
|
41
|
+
exports.shareCommonAncestor = popover.shareCommonAncestor;
|
|
42
|
+
exports.usePopoverVisible = popover.usePopoverVisible;
|
|
43
|
+
exports.usePopoverzIndex = popover.usePopoverzIndex;
|
|
40
44
|
exports.useControlController = useControlController.useControlController;
|
|
41
45
|
exports.useViewController = useViewController.useViewController;
|
|
42
46
|
exports.useViewOperation = useViewOperation.useViewOperation;
|
|
@@ -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;
|