@ibiz-template/vue3-util 0.6.14 → 0.6.16
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/control/panel/panel/panel.mjs +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +1 -1
- package/es/index.mjs +3 -0
- package/es/panel-component/index.d.ts +2 -0
- package/es/panel-component/index.d.ts.map +1 -1
- package/es/panel-component/index.mjs +3 -0
- package/es/panel-component/panel-container-tabs/index.d.ts +23 -0
- package/es/panel-component/panel-container-tabs/index.d.ts.map +1 -0
- package/es/panel-component/panel-container-tabs/index.mjs +19 -0
- package/es/panel-component/panel-container-tabs/panel-container-tabs.css +1 -0
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts +26 -0
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts.map +1 -0
- package/es/panel-component/panel-container-tabs/panel-container-tabs.mjs +35 -0
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.d.ts +16 -0
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.d.ts.map +1 -0
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.mjs +15 -0
- package/es/panel-component/panel-field/index.d.ts +8 -0
- package/es/panel-component/panel-field/index.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.d.ts +8 -0
- package/es/panel-component/panel-field/panel-field.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.mjs +5 -1
- package/es/panel-component/teleport-placeholder/index.d.ts +28 -0
- package/es/panel-component/teleport-placeholder/index.d.ts.map +1 -0
- package/es/panel-component/teleport-placeholder/index.mjs +19 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.css +1 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +29 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts.map +1 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.mjs +63 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.provider.d.ts +17 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.provider.d.ts.map +1 -0
- package/es/panel-component/teleport-placeholder/teleport-placeholder.provider.mjs +16 -0
- package/es/view/common/index.d.ts +5 -0
- package/es/view/common/index.d.ts.map +1 -1
- package/es/view/common/view.d.ts +6 -3
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +62 -43
- package/lib/control/panel/panel/panel.cjs +1 -1
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +1 -1
- package/lib/index.cjs +21 -15
- package/lib/panel-component/index.cjs +6 -0
- package/lib/panel-component/panel-container-tabs/index.cjs +24 -0
- package/lib/panel-component/panel-container-tabs/panel-container-tabs.cjs +37 -0
- package/lib/panel-component/panel-container-tabs/panel-container-tabs.css +1 -0
- package/lib/panel-component/panel-container-tabs/panel-container-tabs.provider.cjs +17 -0
- package/lib/panel-component/panel-field/panel-field.cjs +5 -1
- package/lib/panel-component/teleport-placeholder/index.cjs +25 -0
- package/lib/panel-component/teleport-placeholder/teleport-placeholder.cjs +65 -0
- package/lib/panel-component/teleport-placeholder/teleport-placeholder.css +1 -0
- package/lib/panel-component/teleport-placeholder/teleport-placeholder.provider.cjs +18 -0
- package/lib/view/common/view.cjs +60 -41
- package/package.json +5 -5
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent, h, resolveComponent } from 'vue';
|
|
2
|
+
import '../../use/index.mjs';
|
|
3
|
+
import './panel-container-tabs.css';
|
|
4
|
+
import { PanelContainerController } from '../panel-container/panel-container.controller.mjs';
|
|
5
|
+
import { useNamespace } from '../../use/namespace/namespace.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const PanelContainerTabs = /* @__PURE__ */ defineComponent({
|
|
9
|
+
name: "IBizPanelContainerTabs",
|
|
10
|
+
props: {
|
|
11
|
+
modelData: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
controller: {
|
|
16
|
+
type: PanelContainerController,
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup() {
|
|
21
|
+
const ns = useNamespace("panel-container-tabs");
|
|
22
|
+
return {
|
|
23
|
+
ns
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
render() {
|
|
27
|
+
return h(resolveComponent("IBizPanelContainer"), {
|
|
28
|
+
...this.$props,
|
|
29
|
+
...this.$attrs,
|
|
30
|
+
class: this.ns.b()
|
|
31
|
+
}, this.$slots);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { PanelContainerTabs };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IPanelItemProvider, PanelController, PanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPanelContainer } from '@ibiz/model-core';
|
|
3
|
+
/**
|
|
4
|
+
* 面板图片容器适配器
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2022-09-19 22:09:03
|
|
8
|
+
* @export
|
|
9
|
+
* @class PanelContainerTabsProvider
|
|
10
|
+
* @implements {EditorProvider}
|
|
11
|
+
*/
|
|
12
|
+
export declare class PanelContainerTabsProvider implements IPanelItemProvider {
|
|
13
|
+
component: string;
|
|
14
|
+
createController(panelItem: IPanelContainer, panel: PanelController, parent: PanelItemController | undefined): Promise<PanelItemController>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=panel-container-tabs.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-container-tabs.provider.d.ts","sourceRoot":"","sources":["../../../src/panel-component/panel-container-tabs/panel-container-tabs.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,YAAW,kBAAkB;IACnE,SAAS,EAAE,MAAM,CAA4B;IAEvC,gBAAgB,CACpB,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,mBAAmB,GAAG,SAAS,GACtC,OAAO,CAAC,mBAAmB,CAAC;CAKhC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PanelContainerController } from '../panel-container/panel-container.controller.mjs';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
class PanelContainerTabsProvider {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.component = "IBizPanelContainerTabs";
|
|
7
|
+
}
|
|
8
|
+
async createController(panelItem, panel, parent) {
|
|
9
|
+
const c = new PanelContainerController(panelItem, panel, parent);
|
|
10
|
+
await c.init();
|
|
11
|
+
return c;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { PanelContainerTabsProvider };
|
|
@@ -8,6 +8,10 @@ export declare const IBizPanelField: import("../../util").TypeWithInstall<import
|
|
|
8
8
|
type: typeof import("./panel-field.controller").PanelFieldController;
|
|
9
9
|
required: true;
|
|
10
10
|
};
|
|
11
|
+
attrs: {
|
|
12
|
+
type: import("vue").PropType<IData>;
|
|
13
|
+
require: boolean;
|
|
14
|
+
};
|
|
11
15
|
}, {
|
|
12
16
|
ns: import("@ibiz-template/core").Namespace;
|
|
13
17
|
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
@@ -21,6 +25,10 @@ export declare const IBizPanelField: import("../../util").TypeWithInstall<import
|
|
|
21
25
|
type: typeof import("./panel-field.controller").PanelFieldController;
|
|
22
26
|
required: true;
|
|
23
27
|
};
|
|
28
|
+
attrs: {
|
|
29
|
+
type: import("vue").PropType<IData>;
|
|
30
|
+
require: boolean;
|
|
31
|
+
};
|
|
24
32
|
}>>, {}, {}>>;
|
|
25
33
|
export default IBizPanelField;
|
|
26
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panel-component/panel-field/index.ts"],"names":[],"mappings":"AAMA,cAAc,0BAA0B,CAAC;AAEzC,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panel-component/panel-field/index.ts"],"names":[],"mappings":"AAMA,cAAc,0BAA0B,CAAC;AAEzC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAGzB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -11,6 +11,10 @@ export declare const PanelField: import("vue").DefineComponent<{
|
|
|
11
11
|
type: typeof PanelFieldController;
|
|
12
12
|
required: true;
|
|
13
13
|
};
|
|
14
|
+
attrs: {
|
|
15
|
+
type: PropType<IData>;
|
|
16
|
+
require: boolean;
|
|
17
|
+
};
|
|
14
18
|
}, {
|
|
15
19
|
ns: import("@ibiz-template/core").Namespace;
|
|
16
20
|
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
@@ -24,5 +28,9 @@ export declare const PanelField: import("vue").DefineComponent<{
|
|
|
24
28
|
type: typeof PanelFieldController;
|
|
25
29
|
required: true;
|
|
26
30
|
};
|
|
31
|
+
attrs: {
|
|
32
|
+
type: PropType<IData>;
|
|
33
|
+
require: boolean;
|
|
34
|
+
};
|
|
27
35
|
}>>, {}, {}>;
|
|
28
36
|
//# sourceMappingURL=panel-field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-field.d.ts","sourceRoot":"","sources":["../../../src/panel-component/panel-field/panel-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAA6B,QAAQ,EAAuB,MAAM,KAAK,CAAC;AAE/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,oBAAoB,CAAC;AAE5B,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"panel-field.d.ts","sourceRoot":"","sources":["../../../src/panel-component/panel-field/panel-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAA6B,QAAQ,EAAuB,MAAM,KAAK,CAAC;AAE/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,oBAAoB,CAAC;AAE5B,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;yBA2BS,OAAO,SAAS,MAAM,KAAG,IAAI;;;;;;;;;;;;;;YAoD3D,CAAC"}
|
|
@@ -15,6 +15,10 @@ const PanelField = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
controller: {
|
|
16
16
|
type: PanelFieldController,
|
|
17
17
|
required: true
|
|
18
|
+
},
|
|
19
|
+
attrs: {
|
|
20
|
+
type: Object,
|
|
21
|
+
require: false
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
setup(props) {
|
|
@@ -50,7 +54,7 @@ const PanelField = /* @__PURE__ */ defineComponent({
|
|
|
50
54
|
onFocus: (event) => this.controller.onFocus(event),
|
|
51
55
|
onBlur: (event) => this.controller.onBlur(event),
|
|
52
56
|
onEnter: (event) => this.controller.onEnter(event),
|
|
53
|
-
...this
|
|
57
|
+
...this.attrs
|
|
54
58
|
};
|
|
55
59
|
if (this.$slots.default) {
|
|
56
60
|
editor = this.$slots.default(editorProps);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TeleportPlaceholderProvider } from './teleport-placeholder.provider';
|
|
2
|
+
export { TeleportPlaceholderProvider };
|
|
3
|
+
export declare const IBizTeleportPlaceholder: import("../../util").TypeWithInstall<import("vue").DefineComponent<{
|
|
4
|
+
modelData: {
|
|
5
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
controller: {
|
|
9
|
+
type: import("vue").PropType<import("..").PanelRawItemController>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
14
|
+
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
15
|
+
tempStyle: import("vue").Ref<string>;
|
|
16
|
+
teleportTag: string;
|
|
17
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
modelData: {
|
|
19
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
controller: {
|
|
23
|
+
type: import("vue").PropType<import("..").PanelRawItemController>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
}>>, {}, {}>>;
|
|
27
|
+
export default IBizTeleportPlaceholder;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panel-component/teleport-placeholder/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,EAAE,2BAA2B,EAAE,CAAC;AAEvC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;aASnC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { registerPanelItemProvider } from '@ibiz-template/runtime';
|
|
2
|
+
import '../../util/index.mjs';
|
|
3
|
+
import { TeleportPlaceholder } from './teleport-placeholder.mjs';
|
|
4
|
+
import { TeleportPlaceholderProvider } from './teleport-placeholder.provider.mjs';
|
|
5
|
+
import { withInstall } from '../../util/install.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const IBizTeleportPlaceholder = withInstall(
|
|
9
|
+
TeleportPlaceholder,
|
|
10
|
+
function(v) {
|
|
11
|
+
v.component(TeleportPlaceholder.name, TeleportPlaceholder);
|
|
12
|
+
registerPanelItemProvider(
|
|
13
|
+
"RAWITEM_TELEPORT_PLACEHOLDER",
|
|
14
|
+
() => new TeleportPlaceholderProvider()
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export { IBizTeleportPlaceholder, TeleportPlaceholderProvider, IBizTeleportPlaceholder as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-teleport-placeholder{width:auto;height:auto}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IPanelRawItem } from '@ibiz/model-core';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { PanelRawItemController } from '../panel-rawitem';
|
|
4
|
+
import './teleport-placeholder.scss';
|
|
5
|
+
export declare const TeleportPlaceholder: import("vue").DefineComponent<{
|
|
6
|
+
modelData: {
|
|
7
|
+
type: PropType<IPanelRawItem>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
controller: {
|
|
11
|
+
type: PropType<PanelRawItemController>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
16
|
+
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
17
|
+
tempStyle: import("vue").Ref<string>;
|
|
18
|
+
teleportTag: string;
|
|
19
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
modelData: {
|
|
21
|
+
type: PropType<IPanelRawItem>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
controller: {
|
|
25
|
+
type: PropType<PanelRawItemController>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
}>>, {}, {}>;
|
|
29
|
+
//# sourceMappingURL=teleport-placeholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teleport-placeholder.d.ts","sourceRoot":"","sources":["../../../src/panel-component/teleport-placeholder/teleport-placeholder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAA6B,QAAQ,EAAO,MAAM,KAAK,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,6BAA6B,CAAC;AAErC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;YA2D9B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, createVNode } from 'vue';
|
|
2
|
+
import '../../use/index.mjs';
|
|
3
|
+
import './teleport-placeholder.css';
|
|
4
|
+
import { useNamespace } from '../../use/namespace/namespace.mjs';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const TeleportPlaceholder = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "IBizTeleportPlaceholder",
|
|
9
|
+
props: {
|
|
10
|
+
modelData: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
controller: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(props) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const ns = useNamespace("teleport-placeholder");
|
|
22
|
+
const tempStyle = ref("");
|
|
23
|
+
const {
|
|
24
|
+
rawItem
|
|
25
|
+
} = props.modelData;
|
|
26
|
+
if (rawItem && rawItem.cssStyle) {
|
|
27
|
+
tempStyle.value = rawItem.cssStyle;
|
|
28
|
+
}
|
|
29
|
+
const classArr = computed(() => {
|
|
30
|
+
const {
|
|
31
|
+
id
|
|
32
|
+
} = props.modelData;
|
|
33
|
+
const result = [ns.b(), ns.m(id)];
|
|
34
|
+
result.push(...props.controller.containerClass);
|
|
35
|
+
return result;
|
|
36
|
+
});
|
|
37
|
+
const viewCodeName = props.controller.panel.view.model.codeName;
|
|
38
|
+
let teleportTag = "".concat(viewCodeName == null ? void 0 : viewCodeName.toLowerCase(), "-").concat(props.modelData.id);
|
|
39
|
+
const paramTag = (_b = (_a = props.modelData.rawItem) == null ? void 0 : _a.rawItemParams) == null ? void 0 : _b.find((item) => item.key === "TeleportTag");
|
|
40
|
+
if (paramTag && paramTag.value) {
|
|
41
|
+
teleportTag = paramTag.value;
|
|
42
|
+
}
|
|
43
|
+
ibiz.log.debug("\u89C6\u56FE".concat(viewCodeName, "\u7684\u9762\u677F\u6210\u5458").concat(props.modelData.id, "\u7684\u5360\u4F4D\u6807\u8BC6\u662F\uFF1A"), teleportTag);
|
|
44
|
+
return {
|
|
45
|
+
ns,
|
|
46
|
+
classArr,
|
|
47
|
+
tempStyle,
|
|
48
|
+
teleportTag
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
render() {
|
|
52
|
+
if (!this.controller.state.visible) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
return createVNode("div", {
|
|
56
|
+
"id": this.teleportTag,
|
|
57
|
+
"class": this.classArr,
|
|
58
|
+
"style": this.tempStyle
|
|
59
|
+
}, null);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export { TeleportPlaceholder };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IPanelItemProvider, PanelController, PanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPanelCtrlPos } from '@ibiz/model-core';
|
|
3
|
+
import { PanelRawItemController } from '../panel-rawitem';
|
|
4
|
+
/**
|
|
5
|
+
* 面板控件teleport占位适配器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-09-19 22:09:03
|
|
9
|
+
* @export
|
|
10
|
+
* @class TeleportPlaceholderProvider
|
|
11
|
+
* @implements {EditorProvider}
|
|
12
|
+
*/
|
|
13
|
+
export declare class TeleportPlaceholderProvider implements IPanelItemProvider {
|
|
14
|
+
component: string;
|
|
15
|
+
createController(panelItem: IPanelCtrlPos, panel: PanelController, parent: PanelItemController | undefined): Promise<PanelRawItemController>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=teleport-placeholder.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teleport-placeholder.provider.d.ts","sourceRoot":"","sources":["../../../src/panel-component/teleport-placeholder/teleport-placeholder.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;;;;;;;GAQG;AACH,qBAAa,2BAA4B,YAAW,kBAAkB;IACpE,SAAS,EAAE,MAAM,CAA6B;IAExC,gBAAgB,CACpB,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,mBAAmB,GAAG,SAAS,GACtC,OAAO,CAAC,sBAAsB,CAAC;CAKnC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '../panel-rawitem/index.mjs';
|
|
2
|
+
import { PanelRawItemController } from '../panel-rawitem/panel-rawitem.controller.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
class TeleportPlaceholderProvider {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.component = "IBizTeleportPlaceholder";
|
|
8
|
+
}
|
|
9
|
+
async createController(panelItem, panel, parent) {
|
|
10
|
+
const c = new PanelRawItemController(panelItem, panel, parent);
|
|
11
|
+
await c.init();
|
|
12
|
+
return c;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { TeleportPlaceholderProvider };
|
|
@@ -20,9 +20,14 @@ export declare const IBizView: import("../../util").TypeWithInstall<import("vue"
|
|
|
20
20
|
}, {
|
|
21
21
|
c: import("@ibiz-template/runtime").ViewController<import("@ibiz/model-core").IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
22
22
|
controls: import("@ibiz/model-core").IControl[];
|
|
23
|
+
teleportControls: import("@ibiz/model-core").IControl[];
|
|
23
24
|
viewClassNames: import("vue").ComputedRef<(string | undefined)[]>;
|
|
24
25
|
onLayoutPanelCreated: (controller: import("@ibiz-template/runtime").IViewLayoutPanelController) => void;
|
|
25
26
|
renderViewMessage: (position: "TOP" | "BOTTOM" | "BODY") => JSX.Element | null;
|
|
27
|
+
getCtrlProps: (ctrl: import("@ibiz/model-core").IControl) => IParams;
|
|
28
|
+
renderControl: (ctrl: import("@ibiz/model-core").IControl) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>;
|
|
26
31
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
32
|
context: import("vue").PropType<IContext>;
|
|
28
33
|
params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/common/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/common/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAGnB,CAAC"}
|
package/es/view/common/view.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IModal, IViewLayoutPanelController, IViewProvider, ViewController } from '@ibiz-template/runtime';
|
|
2
|
-
import { IAppView } from '@ibiz/model-core';
|
|
3
|
-
import { PropType } from 'vue';
|
|
2
|
+
import { IAppView, IControl } from '@ibiz/model-core';
|
|
3
|
+
import { PropType, VNode } from 'vue';
|
|
4
4
|
import './view.scss';
|
|
5
5
|
export declare const View: import("vue").DefineComponent<{
|
|
6
6
|
context: PropType<IContext>;
|
|
@@ -23,10 +23,13 @@ export declare const View: import("vue").DefineComponent<{
|
|
|
23
23
|
};
|
|
24
24
|
}, {
|
|
25
25
|
c: ViewController<IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
26
|
-
controls:
|
|
26
|
+
controls: IControl[];
|
|
27
|
+
teleportControls: IControl[];
|
|
27
28
|
viewClassNames: import("vue").ComputedRef<(string | undefined)[]>;
|
|
28
29
|
onLayoutPanelCreated: (controller: IViewLayoutPanelController) => void;
|
|
29
30
|
renderViewMessage: (position: 'TOP' | 'BOTTOM' | 'BODY') => JSX.Element | null;
|
|
31
|
+
getCtrlProps: (ctrl: IControl) => IParams;
|
|
32
|
+
renderControl: (ctrl: IControl) => VNode;
|
|
30
33
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
34
|
context: PropType<IContext>;
|
|
32
35
|
params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/common/view.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/common/view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAGL,QAAQ,EAER,KAAK,EAIN,MAAM,KAAK,CAAC;AACb,OAAO,aAAa,CAAC;AAGrB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;uCAmCC,0BAA0B,KACrC,IAAI;kCAI8B,KAAK,GAAG,QAAQ,GAAG,MAAM;yBAsBlC,QAAQ,KAAG,OAAO;0BAiBjB,QAAQ,KAAG,KAAK;;;;;;;;;;;;;;;;;;;;;;MAiG/C,CAAC"}
|
package/es/view/common/view.mjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { defineComponent, computed, createVNode, resolveComponent, h, createTextVNode, withDirectives, resolveDirective } from 'vue';
|
|
2
|
-
import { ViewController, getControlsByView } from '@ibiz-template/runtime';
|
|
1
|
+
import { isVNode, defineComponent, computed, createVNode, resolveComponent, renderSlot, h, createTextVNode, Teleport, withDirectives, resolveDirective } from 'vue';
|
|
2
|
+
import { ViewController, getControlsByView, getCtrlTeleportTag } from '@ibiz-template/runtime';
|
|
3
3
|
import './view.css';
|
|
4
4
|
import '../../use/index.mjs';
|
|
5
5
|
import { useNamespace } from '../../use/namespace/namespace.mjs';
|
|
6
6
|
import { useViewController } from '../../use/view/use-view-controller/use-view-controller.mjs';
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
9
|
+
function _isSlot(s) {
|
|
10
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
11
|
+
}
|
|
9
12
|
const View = /* @__PURE__ */ defineComponent({
|
|
10
13
|
name: "IBizView",
|
|
11
14
|
props: {
|
|
@@ -28,10 +31,14 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
28
31
|
type: Object
|
|
29
32
|
}
|
|
30
33
|
},
|
|
31
|
-
setup(
|
|
34
|
+
setup(_props, {
|
|
35
|
+
slots
|
|
36
|
+
}) {
|
|
32
37
|
const ns = useNamespace("view");
|
|
33
38
|
const c = useViewController((...args) => new ViewController(...args));
|
|
34
|
-
const
|
|
39
|
+
const allControls = getControlsByView(c.model);
|
|
40
|
+
const teleportControls = allControls.filter((ctrl) => !!getCtrlTeleportTag(ctrl));
|
|
41
|
+
const controls = allControls.filter((ctrl) => !teleportControls.includes(ctrl));
|
|
35
42
|
const {
|
|
36
43
|
viewType,
|
|
37
44
|
sysCss,
|
|
@@ -55,59 +62,59 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
55
62
|
}
|
|
56
63
|
return null;
|
|
57
64
|
};
|
|
65
|
+
const getCtrlProps = (ctrl) => {
|
|
66
|
+
const slotKey = ctrl.name || ctrl.id;
|
|
67
|
+
return {
|
|
68
|
+
context: c.context,
|
|
69
|
+
params: c.params,
|
|
70
|
+
...c.slotProps[slotKey] || {},
|
|
71
|
+
modelData: ctrl
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const renderControl = (ctrl) => {
|
|
75
|
+
const slotKey = ctrl.name || ctrl.id;
|
|
76
|
+
const ctrlProps = getCtrlProps(ctrl);
|
|
77
|
+
if (slots[slotKey]) {
|
|
78
|
+
return renderSlot(slots, slotKey, ctrlProps);
|
|
79
|
+
}
|
|
80
|
+
const provider = c.providers[slotKey];
|
|
81
|
+
const comp = resolveComponent((provider == null ? void 0 : provider.component) || "IBizControlShell");
|
|
82
|
+
if (provider) {
|
|
83
|
+
ctrlProps.provider = provider;
|
|
84
|
+
}
|
|
85
|
+
return h(comp, ctrlProps);
|
|
86
|
+
};
|
|
58
87
|
return {
|
|
59
88
|
c,
|
|
60
89
|
controls,
|
|
90
|
+
teleportControls,
|
|
61
91
|
viewClassNames,
|
|
62
92
|
onLayoutPanelCreated,
|
|
63
|
-
renderViewMessage
|
|
93
|
+
renderViewMessage,
|
|
94
|
+
getCtrlProps,
|
|
95
|
+
renderControl
|
|
64
96
|
};
|
|
65
97
|
},
|
|
66
98
|
render() {
|
|
67
|
-
var _a;
|
|
99
|
+
var _a, _b;
|
|
68
100
|
let layoutPanel = null;
|
|
69
101
|
if (this.c.state.isCreated) {
|
|
70
|
-
const slots = {
|
|
71
|
-
...this.$slots
|
|
72
|
-
};
|
|
73
|
-
if ((_a = this.controls) == null ? void 0 : _a.length) {
|
|
74
|
-
this.controls.forEach((ctrl) => {
|
|
75
|
-
const slotKey = ctrl.name || ctrl.id;
|
|
76
|
-
const ctrlProps = {
|
|
77
|
-
context: this.c.context,
|
|
78
|
-
params: this.c.params
|
|
79
|
-
};
|
|
80
|
-
if (this.c.slotProps[slotKey]) {
|
|
81
|
-
Object.assign(ctrlProps, this.c.slotProps[slotKey]);
|
|
82
|
-
}
|
|
83
|
-
const outCtrlSlot = slots[slotKey];
|
|
84
|
-
if (outCtrlSlot) {
|
|
85
|
-
slots[slotKey] = () => {
|
|
86
|
-
return outCtrlSlot({
|
|
87
|
-
modelData: ctrl,
|
|
88
|
-
...ctrlProps
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const provider = this.c.providers[slotKey];
|
|
94
|
-
if (provider) {
|
|
95
|
-
slots[slotKey] = () => {
|
|
96
|
-
const comp = resolveComponent(provider.component);
|
|
97
|
-
return h(comp, {
|
|
98
|
-
modelData: ctrl,
|
|
99
|
-
...ctrlProps,
|
|
100
|
-
provider
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
102
|
if (this.c.engines.length === 0) {
|
|
107
103
|
layoutPanel = createVNode("span", {
|
|
108
104
|
"style": "color:red;"
|
|
109
105
|
}, [createTextVNode("\u89C6\u56FE\u7C7B\u578B"), this.modelData.viewType, createTextVNode("\u6682\u672A\u652F\u6301")]);
|
|
110
106
|
} else {
|
|
107
|
+
const slots = {
|
|
108
|
+
...this.$slots
|
|
109
|
+
};
|
|
110
|
+
if ((_a = this.controls) == null ? void 0 : _a.length) {
|
|
111
|
+
this.controls.forEach((ctrl) => {
|
|
112
|
+
const slotKey = ctrl.name || ctrl.id;
|
|
113
|
+
slots[slotKey] = () => {
|
|
114
|
+
return this.renderControl(ctrl);
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
111
118
|
const viewLayoutPanel = this.c.model.viewLayoutPanel;
|
|
112
119
|
const provider = this.c.providers[viewLayoutPanel.name];
|
|
113
120
|
layoutPanel = h(resolveComponent(provider.component), {
|
|
@@ -120,10 +127,22 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
120
127
|
}, slots);
|
|
121
128
|
}
|
|
122
129
|
}
|
|
130
|
+
let teleportContent = null;
|
|
131
|
+
if (this.c.state.isCreated && ((_b = this.teleportControls) == null ? void 0 : _b.length)) {
|
|
132
|
+
teleportContent = this.teleportControls.map((ctrl) => {
|
|
133
|
+
let _slot;
|
|
134
|
+
return createVNode(Teleport, {
|
|
135
|
+
"to": getCtrlTeleportTag(ctrl),
|
|
136
|
+
"disabled": !this.c.state.activated
|
|
137
|
+
}, _isSlot(_slot = this.renderControl(ctrl)) ? _slot : {
|
|
138
|
+
default: () => [_slot]
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
123
142
|
return withDirectives(createVNode("div", {
|
|
124
143
|
"class": this.viewClassNames,
|
|
125
144
|
"id": this.c.id
|
|
126
|
-
}, [this.renderViewMessage("TOP"), layoutPanel, this.renderViewMessage("BOTTOM")]), [[resolveDirective("loading"), this.c.state.isLoading]]);
|
|
145
|
+
}, [this.renderViewMessage("TOP"), layoutPanel, this.renderViewMessage("BOTTOM"), teleportContent]), [[resolveDirective("loading"), this.c.state.isLoading]]);
|
|
127
146
|
}
|
|
128
147
|
});
|
|
129
148
|
|
|
@@ -66,7 +66,7 @@ function renderPanelItem(panelItem, c, ins) {
|
|
|
66
66
|
controller: panelItemC,
|
|
67
67
|
key: panelItem.id,
|
|
68
68
|
style: tempStyle,
|
|
69
|
-
|
|
69
|
+
attrs: renderAttrs(panelItem, panelItemC)
|
|
70
70
|
}, children);
|
|
71
71
|
}
|
|
72
72
|
const PanelControl = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -111,7 +111,7 @@ const ViewLayoutPanelControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
111
111
|
controller: panelItemC,
|
|
112
112
|
key: panelItem.id,
|
|
113
113
|
style: tempStyle,
|
|
114
|
-
|
|
114
|
+
attrs: renderAttrs(panelItem, panelItemC)
|
|
115
115
|
}, children);
|
|
116
116
|
};
|
|
117
117
|
vue.provide("renderPanelItem", renderPanelItem);
|