@ibiz-template/vue3-util 0.3.5-alpha.1 → 0.3.6-dev.0
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/dist/index.system.min.js.map +1 -1
- package/es/common/code-list/code-list.mjs +2 -1
- package/es/control/index.d.ts +2 -0
- package/es/control/index.d.ts.map +1 -0
- package/es/control/index.mjs +5 -0
- package/es/control/panel/index.d.ts +3 -0
- package/es/control/panel/index.d.ts.map +1 -0
- package/es/control/panel/index.mjs +4 -0
- package/es/control/panel/panel/index.d.ts +57 -0
- package/es/control/panel/panel/index.d.ts.map +1 -0
- package/es/control/panel/panel/index.mjs +13 -0
- package/es/control/panel/panel/panel.css +1 -0
- package/es/control/panel/panel/panel.d.ts +63 -0
- package/es/control/panel/panel/panel.d.ts.map +1 -0
- package/es/control/panel/panel/panel.mjs +135 -0
- package/es/control/panel/panel/panel.provider.d.ts +14 -0
- package/es/control/panel/panel/panel.provider.d.ts.map +1 -0
- package/es/control/panel/panel/panel.provider.mjs +8 -0
- package/es/control/panel/view-layout-panel/index.d.ts +58 -0
- package/es/control/panel/view-layout-panel/index.d.ts.map +1 -0
- package/es/control/panel/view-layout-panel/index.mjs +19 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.css +1 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +62 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +137 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.provider.d.ts +14 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.provider.d.ts.map +1 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.provider.mjs +8 -0
- package/es/index.d.ts +1 -0
- package/es/index.d.ts.map +1 -1
- package/es/index.mjs +3 -0
- package/es/plugin/plugin-factory/plugin-factory.d.ts.map +1 -1
- package/es/plugin/plugin-factory/plugin-factory.mjs +1 -2
- package/es/use/control/use-control-controller/use-control-controller.d.ts +10 -1
- package/es/use/control/use-control-controller/use-control-controller.d.ts.map +1 -1
- package/es/use/control/use-control-controller/use-control-controller.mjs +4 -4
- package/lib/index.cjs +10 -5
- package/package.json +6 -6
- package/src/common/code-list/code-list.tsx +1 -1
- package/src/control/index.ts +1 -0
- package/src/control/panel/index.ts +2 -0
- package/src/control/panel/panel/index.ts +12 -0
- package/src/control/panel/panel/panel.provider.ts +14 -0
- package/src/control/panel/panel/panel.scss +9 -0
- package/src/control/panel/panel/panel.tsx +160 -0
- package/src/control/panel/view-layout-panel/index.ts +18 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.provider.ts +14 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.scss +9 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.tsx +172 -0
- package/src/index.ts +1 -0
- package/src/plugin/plugin-factory/plugin-factory.ts +1 -2
- package/src/use/control/use-control-controller/use-control-controller.ts +18 -3
|
@@ -50,13 +50,14 @@ const IBizCodeList = /* @__PURE__ */ defineComponent({
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
watch(() => props.value, (newVal, oldVal) => {
|
|
53
|
+
var _a;
|
|
53
54
|
if (newVal !== oldVal) {
|
|
54
55
|
if (isNil(newVal) || newVal === "") {
|
|
55
56
|
items.value = [];
|
|
56
57
|
} else {
|
|
57
58
|
let values;
|
|
58
59
|
if (typeof newVal === "string") {
|
|
59
|
-
values = newVal.split(",");
|
|
60
|
+
values = newVal.split(((_a = props.codeList) == null ? void 0 : _a.valueSeparator) || ",");
|
|
60
61
|
} else {
|
|
61
62
|
values = [newVal];
|
|
62
63
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/control/panel/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const IBizPanelControl: import("../../../util").TypeWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
modelData: {
|
|
3
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanel>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
context: {
|
|
7
|
+
type: import("vue").PropType<IContext>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
params: {
|
|
11
|
+
type: import("vue").PropType<IParams>;
|
|
12
|
+
default: () => {};
|
|
13
|
+
};
|
|
14
|
+
provider: {
|
|
15
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IControlProvider>;
|
|
16
|
+
};
|
|
17
|
+
container: {
|
|
18
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
19
|
+
};
|
|
20
|
+
data: import("vue").PropType<IData>;
|
|
21
|
+
loadDefault: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
c: import("@ibiz-template/runtime").PanelController<import("@ibiz/model-core").IPanel, import("@ibiz-template/runtime").IPanelState, import("@ibiz-template/runtime").IPanelEvent>;
|
|
27
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
28
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
modelData: {
|
|
30
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanel>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
context: {
|
|
34
|
+
type: import("vue").PropType<IContext>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
params: {
|
|
38
|
+
type: import("vue").PropType<IParams>;
|
|
39
|
+
default: () => {};
|
|
40
|
+
};
|
|
41
|
+
provider: {
|
|
42
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IControlProvider>;
|
|
43
|
+
};
|
|
44
|
+
container: {
|
|
45
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
46
|
+
};
|
|
47
|
+
data: import("vue").PropType<IData>;
|
|
48
|
+
loadDefault: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
52
|
+
}>>, {
|
|
53
|
+
params: IParams;
|
|
54
|
+
loadDefault: boolean;
|
|
55
|
+
}, {}>>;
|
|
56
|
+
export default IBizPanelControl;
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/control/panel/panel/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAG3B,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ControlType, registerControlProvider } from '@ibiz-template/runtime';
|
|
2
|
+
import { PanelControl } from './panel.mjs';
|
|
3
|
+
import { PanelProvider } from './panel.provider.mjs';
|
|
4
|
+
import '../../../util/index.mjs';
|
|
5
|
+
import { withInstall } from '../../../util/install.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const IBizPanelControl = withInstall(PanelControl, function(v) {
|
|
9
|
+
v.component(PanelControl.name, PanelControl);
|
|
10
|
+
registerControlProvider(ControlType.PANEL, () => new PanelProvider());
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { IBizPanelControl, IBizPanelControl as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-control-panel{width:100%;height:100%}.ibiz-control-panel-content{width:100%;height:100%}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IPanel } from '@ibiz/model-core';
|
|
3
|
+
import './panel.scss';
|
|
4
|
+
import { IControlProvider, IController, PanelController } from '@ibiz-template/runtime';
|
|
5
|
+
/**
|
|
6
|
+
* 视图布局面板组件
|
|
7
|
+
*/
|
|
8
|
+
export declare const PanelControl: import("vue").DefineComponent<{
|
|
9
|
+
modelData: {
|
|
10
|
+
type: PropType<IPanel>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
context: {
|
|
14
|
+
type: PropType<IContext>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
params: {
|
|
18
|
+
type: PropType<IParams>;
|
|
19
|
+
default: () => {};
|
|
20
|
+
};
|
|
21
|
+
provider: {
|
|
22
|
+
type: PropType<IControlProvider>;
|
|
23
|
+
};
|
|
24
|
+
container: {
|
|
25
|
+
type: PropType<IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
26
|
+
};
|
|
27
|
+
data: PropType<IData>;
|
|
28
|
+
loadDefault: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
c: PanelController<IPanel, import("@ibiz-template/runtime").IPanelState, import("@ibiz-template/runtime").IPanelEvent>;
|
|
34
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
35
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
modelData: {
|
|
37
|
+
type: PropType<IPanel>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
context: {
|
|
41
|
+
type: PropType<IContext>;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
params: {
|
|
45
|
+
type: PropType<IParams>;
|
|
46
|
+
default: () => {};
|
|
47
|
+
};
|
|
48
|
+
provider: {
|
|
49
|
+
type: PropType<IControlProvider>;
|
|
50
|
+
};
|
|
51
|
+
container: {
|
|
52
|
+
type: PropType<IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
53
|
+
};
|
|
54
|
+
data: PropType<IData>;
|
|
55
|
+
loadDefault: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
59
|
+
}>>, {
|
|
60
|
+
params: IParams;
|
|
61
|
+
loadDefault: boolean;
|
|
62
|
+
}, {}>;
|
|
63
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../../src/control/panel/panel/panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAOT,MAAM,KAAK,CAAC;AACb,OAAO,EACL,MAAM,EAKP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAiEhC;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqEvB,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { isVNode, createTextVNode, createVNode, resolveComponent, h, watch, reactive, defineComponent } from 'vue';
|
|
2
|
+
import './panel.css';
|
|
3
|
+
import { PanelController } from '@ibiz-template/runtime';
|
|
4
|
+
import '../../../use/index.mjs';
|
|
5
|
+
import { useControlController } from '../../../use/control/use-control-controller/use-control-controller.mjs';
|
|
6
|
+
import { useNamespace } from '../../../use/namespace/namespace.mjs';
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
function _isSlot(s) {
|
|
10
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
11
|
+
}
|
|
12
|
+
function renderPanelItem(panelItem, c, ins) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
if (panelItem.hidden) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const {
|
|
18
|
+
providers,
|
|
19
|
+
panelItems
|
|
20
|
+
} = c;
|
|
21
|
+
const provider = providers[panelItem.id];
|
|
22
|
+
if (!provider) {
|
|
23
|
+
return createVNode("div", null, [createTextVNode("\u6682\u672A\u652F\u6301\u7684\u9762\u677F\u9879: "), panelItem.id, createTextVNode(" - "), panelItem.itemType]);
|
|
24
|
+
}
|
|
25
|
+
const component = resolveComponent(provider.component);
|
|
26
|
+
let children;
|
|
27
|
+
if (panelItem.itemType === "CTRLPOS" && ins.$slots[panelItem.id]) {
|
|
28
|
+
children = () => {
|
|
29
|
+
return ins.$slots[panelItem.id]();
|
|
30
|
+
};
|
|
31
|
+
} else if (panelItem.itemType === "TABPANEL" && ((_a = panelItem.panelTabPages) == null ? void 0 : _a.length)) {
|
|
32
|
+
children = () => {
|
|
33
|
+
return panelItem.panelTabPages.map((child) => {
|
|
34
|
+
return renderPanelItem(child, c, ins);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
} else if ((_b = panelItem.panelItems) == null ? void 0 : _b.length) {
|
|
38
|
+
children = () => {
|
|
39
|
+
return panelItem.panelItems.map((child) => {
|
|
40
|
+
return renderPanelItem(child, c, ins);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return h(component, {
|
|
45
|
+
modelData: panelItem,
|
|
46
|
+
controller: panelItems[panelItem.id],
|
|
47
|
+
key: panelItem.id
|
|
48
|
+
}, children);
|
|
49
|
+
}
|
|
50
|
+
const PanelControl = /* @__PURE__ */ defineComponent({
|
|
51
|
+
name: "IBizPanelControl",
|
|
52
|
+
props: {
|
|
53
|
+
modelData: {
|
|
54
|
+
type: Object,
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
context: {
|
|
58
|
+
type: Object,
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
61
|
+
params: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default: () => ({})
|
|
64
|
+
},
|
|
65
|
+
provider: {
|
|
66
|
+
type: Object
|
|
67
|
+
},
|
|
68
|
+
container: {
|
|
69
|
+
type: Object
|
|
70
|
+
},
|
|
71
|
+
data: Object,
|
|
72
|
+
loadDefault: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
setup(props) {
|
|
78
|
+
const c = useControlController((...args) => new PanelController(...args, props.container));
|
|
79
|
+
const ns = useNamespace(`control-${c.model.controlType.toLowerCase()}`);
|
|
80
|
+
watch(() => props.data, (newVal) => {
|
|
81
|
+
if (newVal) {
|
|
82
|
+
c.setInputData(newVal);
|
|
83
|
+
c.load();
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
immediate: true
|
|
87
|
+
});
|
|
88
|
+
c.evt.on("onCreated", () => {
|
|
89
|
+
const keys = Object.keys(c.panelItems);
|
|
90
|
+
keys.forEach((key) => {
|
|
91
|
+
const panelItem = c.panelItems[key];
|
|
92
|
+
panelItem.state = reactive(panelItem.state);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
c,
|
|
97
|
+
ns
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
render() {
|
|
101
|
+
const {
|
|
102
|
+
state,
|
|
103
|
+
model
|
|
104
|
+
} = this.c;
|
|
105
|
+
return createVNode(resolveComponent("iBizControlBase"), {
|
|
106
|
+
"controller": this.c
|
|
107
|
+
}, {
|
|
108
|
+
default: () => [createVNode(resolveComponent("iBizRow"), {
|
|
109
|
+
"class": this.ns.b("content"),
|
|
110
|
+
"layout": {
|
|
111
|
+
layout: "FLEX"
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
default: () => {
|
|
115
|
+
var _a;
|
|
116
|
+
return [state.isCreated && (this.$slots.default ? this.$slots.default({
|
|
117
|
+
panelItems: this.c.panelItems
|
|
118
|
+
}) : (_a = model.rootPanelItems) == null ? void 0 : _a.map((panelItem) => {
|
|
119
|
+
let _slot;
|
|
120
|
+
const subC = this.c.panelItems[panelItem.id];
|
|
121
|
+
panelItem.layoutPos.layout = "FLEX";
|
|
122
|
+
return createVNode(resolveComponent("iBizCol"), {
|
|
123
|
+
"layoutPos": panelItem.layoutPos,
|
|
124
|
+
"state": subC.state
|
|
125
|
+
}, _isSlot(_slot = renderPanelItem(panelItem, this.c, this)) ? _slot : {
|
|
126
|
+
default: () => [_slot]
|
|
127
|
+
});
|
|
128
|
+
}))];
|
|
129
|
+
}
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export { PanelControl };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IControlProvider } from '@ibiz-template/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* 面板部件适配器
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-25 18:10:57
|
|
7
|
+
* @export
|
|
8
|
+
* @class ViewLayoutPanelProvider
|
|
9
|
+
* @implements {IControlProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class PanelProvider implements IControlProvider {
|
|
12
|
+
component: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=panel.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.provider.d.ts","sourceRoot":"","sources":["../../../../src/control/panel/panel/panel.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;;;;GAQG;AACH,qBAAa,aAAc,YAAW,gBAAgB;IACpD,SAAS,EAAE,MAAM,CAAsB;CACxC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const IBizViewLayoutPanelControl: import("../../../util").TypeWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
modelData: {
|
|
3
|
+
type: import("vue").PropType<import("@ibiz/model-core").IViewLayoutPanel>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
context: {
|
|
7
|
+
type: import("vue").PropType<IContext>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
params: {
|
|
11
|
+
type: import("vue").PropType<IParams>;
|
|
12
|
+
default: () => {};
|
|
13
|
+
};
|
|
14
|
+
provider: {
|
|
15
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IControlProvider>;
|
|
16
|
+
};
|
|
17
|
+
container: {
|
|
18
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
19
|
+
};
|
|
20
|
+
data: import("vue").PropType<IData>;
|
|
21
|
+
}, {
|
|
22
|
+
c: import("@ibiz-template/runtime").ViewLayoutPanelController;
|
|
23
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
24
|
+
renderPanelItem: (panelItem: import("@ibiz/model-core").IPanelItem, options?: {
|
|
25
|
+
providers: {
|
|
26
|
+
[key: string]: import("@ibiz-template/runtime").IPanelItemProvider;
|
|
27
|
+
};
|
|
28
|
+
panelItems: {
|
|
29
|
+
[key: string]: import("@ibiz-template/runtime").IPanelItemController;
|
|
30
|
+
};
|
|
31
|
+
} | undefined) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}> | null;
|
|
34
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
|
+
modelData: {
|
|
36
|
+
type: import("vue").PropType<import("@ibiz/model-core").IViewLayoutPanel>;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
context: {
|
|
40
|
+
type: import("vue").PropType<IContext>;
|
|
41
|
+
required: true;
|
|
42
|
+
};
|
|
43
|
+
params: {
|
|
44
|
+
type: import("vue").PropType<IParams>;
|
|
45
|
+
default: () => {};
|
|
46
|
+
};
|
|
47
|
+
provider: {
|
|
48
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IControlProvider>;
|
|
49
|
+
};
|
|
50
|
+
container: {
|
|
51
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
52
|
+
};
|
|
53
|
+
data: import("vue").PropType<IData>;
|
|
54
|
+
}>>, {
|
|
55
|
+
params: IParams;
|
|
56
|
+
}, {}>>;
|
|
57
|
+
export default IBizViewLayoutPanelControl;
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/control/panel/view-layout-panel/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAStC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ControlType, registerControlProvider } from '@ibiz-template/runtime';
|
|
2
|
+
import { ViewLayoutPanelControl } from './view-layout-panel.mjs';
|
|
3
|
+
import { ViewLayoutPanelProvider } from './view-layout-panel.provider.mjs';
|
|
4
|
+
import '../../../util/index.mjs';
|
|
5
|
+
import { withInstall } from '../../../util/install.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const IBizViewLayoutPanelControl = withInstall(
|
|
9
|
+
ViewLayoutPanelControl,
|
|
10
|
+
function(v) {
|
|
11
|
+
v.component(ViewLayoutPanelControl.name, ViewLayoutPanelControl);
|
|
12
|
+
registerControlProvider(
|
|
13
|
+
ControlType.VIEW_LAYOUT_PANEL,
|
|
14
|
+
() => new ViewLayoutPanelProvider()
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export { IBizViewLayoutPanelControl, IBizViewLayoutPanelControl as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-control-viewlayoutpanel{width:100%;height:100%}.ibiz-control-viewlayoutpanel-content{width:100%;height:100%}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PropType, VNode } from 'vue';
|
|
2
|
+
import { IPanelItem, IViewLayoutPanel } from '@ibiz/model-core';
|
|
3
|
+
import './view-layout-panel.scss';
|
|
4
|
+
import { IController, IControlProvider, IPanelItemController, IPanelItemProvider, ViewLayoutPanelController } from '@ibiz-template/runtime';
|
|
5
|
+
/**
|
|
6
|
+
* 视图布局面板组件
|
|
7
|
+
*/
|
|
8
|
+
export declare const ViewLayoutPanelControl: import("vue").DefineComponent<{
|
|
9
|
+
modelData: {
|
|
10
|
+
type: PropType<IViewLayoutPanel>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
context: {
|
|
14
|
+
type: PropType<IContext>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
params: {
|
|
18
|
+
type: PropType<IParams>;
|
|
19
|
+
default: () => {};
|
|
20
|
+
};
|
|
21
|
+
provider: {
|
|
22
|
+
type: PropType<IControlProvider>;
|
|
23
|
+
};
|
|
24
|
+
container: {
|
|
25
|
+
type: PropType<IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
26
|
+
};
|
|
27
|
+
data: PropType<IData>;
|
|
28
|
+
}, {
|
|
29
|
+
c: ViewLayoutPanelController;
|
|
30
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
31
|
+
renderPanelItem: (panelItem: IPanelItem, options?: {
|
|
32
|
+
providers: {
|
|
33
|
+
[key: string]: IPanelItemProvider;
|
|
34
|
+
};
|
|
35
|
+
panelItems: {
|
|
36
|
+
[key: string]: IPanelItemController;
|
|
37
|
+
};
|
|
38
|
+
} | undefined) => VNode | null;
|
|
39
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
modelData: {
|
|
41
|
+
type: PropType<IViewLayoutPanel>;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
context: {
|
|
45
|
+
type: PropType<IContext>;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
params: {
|
|
49
|
+
type: PropType<IParams>;
|
|
50
|
+
default: () => {};
|
|
51
|
+
};
|
|
52
|
+
provider: {
|
|
53
|
+
type: PropType<IControlProvider>;
|
|
54
|
+
};
|
|
55
|
+
container: {
|
|
56
|
+
type: PropType<IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
57
|
+
};
|
|
58
|
+
data: PropType<IData>;
|
|
59
|
+
}>>, {
|
|
60
|
+
params: IParams;
|
|
61
|
+
}, {}>;
|
|
62
|
+
//# sourceMappingURL=view-layout-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-layout-panel.d.ts","sourceRoot":"","sources":["../../../../src/control/panel/view-layout-panel/view-layout-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,KAAK,EAIN,MAAM,KAAK,CAAC;AACb,OAAO,EAGL,UAAU,EAEV,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,0BAA0B,CAAC;AAClC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAElB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;iCAiDlB,UAAU;;;;;;;sBASpB,KAAK,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;MAkFjB,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { isVNode, watch, reactive, createTextVNode, createVNode, resolveComponent, h, provide, defineComponent } from 'vue';
|
|
2
|
+
import './view-layout-panel.css';
|
|
3
|
+
import { ViewLayoutPanelController, isDataContainer } from '@ibiz-template/runtime';
|
|
4
|
+
import '../../../use/index.mjs';
|
|
5
|
+
import { useControlController } from '../../../use/control/use-control-controller/use-control-controller.mjs';
|
|
6
|
+
import { useNamespace } from '../../../use/namespace/namespace.mjs';
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
function _isSlot(s) {
|
|
10
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
11
|
+
}
|
|
12
|
+
const ViewLayoutPanelControl = /* @__PURE__ */ defineComponent({
|
|
13
|
+
name: "IBizViewLayoutPanelControl",
|
|
14
|
+
props: {
|
|
15
|
+
modelData: {
|
|
16
|
+
type: Object,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
context: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
params: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => ({})
|
|
26
|
+
},
|
|
27
|
+
provider: {
|
|
28
|
+
type: Object
|
|
29
|
+
},
|
|
30
|
+
container: {
|
|
31
|
+
type: Object
|
|
32
|
+
},
|
|
33
|
+
data: Object
|
|
34
|
+
},
|
|
35
|
+
setup(props, {
|
|
36
|
+
slots
|
|
37
|
+
}) {
|
|
38
|
+
const c = useControlController((...args) => new ViewLayoutPanelController(...args, props.container));
|
|
39
|
+
const ns = useNamespace(`control-${c.model.controlType.toLowerCase()}`);
|
|
40
|
+
watch(() => props.data, (newVal) => {
|
|
41
|
+
if (newVal) {
|
|
42
|
+
c.setInputData(newVal);
|
|
43
|
+
c.load();
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
immediate: true
|
|
47
|
+
});
|
|
48
|
+
c.evt.on("onCreated", () => {
|
|
49
|
+
const keys = Object.keys(c.panelItems);
|
|
50
|
+
keys.forEach((key) => {
|
|
51
|
+
const panelItem = c.panelItems[key];
|
|
52
|
+
panelItem.state = reactive(panelItem.state);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
const renderPanelItem = (panelItem, options) => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
if (panelItem.hidden) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const {
|
|
61
|
+
providers,
|
|
62
|
+
panelItems
|
|
63
|
+
} = options || c;
|
|
64
|
+
const provider = providers[panelItem.id];
|
|
65
|
+
if (!provider) {
|
|
66
|
+
return createVNode("div", null, [createTextVNode("\u6682\u672A\u652F\u6301\u7684\u9762\u677F\u9879: "), panelItem.id, createTextVNode(" - "), panelItem.itemType]);
|
|
67
|
+
}
|
|
68
|
+
const component = resolveComponent(provider.component);
|
|
69
|
+
let children;
|
|
70
|
+
if (panelItem.itemType === "CTRLPOS" && slots[panelItem.id]) {
|
|
71
|
+
children = () => {
|
|
72
|
+
return slots[panelItem.id]();
|
|
73
|
+
};
|
|
74
|
+
} else if (panelItem.itemType === "TABPANEL" && ((_a = panelItem.panelTabPages) == null ? void 0 : _a.length)) {
|
|
75
|
+
children = () => {
|
|
76
|
+
return panelItem.panelTabPages.map((child) => {
|
|
77
|
+
return renderPanelItem(child, options);
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
} else if (isDataContainer(panelItem)) {
|
|
81
|
+
children = void 0;
|
|
82
|
+
} else if ((_b = panelItem.panelItems) == null ? void 0 : _b.length) {
|
|
83
|
+
children = () => {
|
|
84
|
+
return panelItem.panelItems.map((child) => {
|
|
85
|
+
return renderPanelItem(child, options);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return h(component, {
|
|
90
|
+
modelData: panelItem,
|
|
91
|
+
controller: panelItems[panelItem.id],
|
|
92
|
+
key: panelItem.id
|
|
93
|
+
}, children);
|
|
94
|
+
};
|
|
95
|
+
provide("renderPanelItem", renderPanelItem);
|
|
96
|
+
return {
|
|
97
|
+
c,
|
|
98
|
+
ns,
|
|
99
|
+
renderPanelItem
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
render() {
|
|
103
|
+
const {
|
|
104
|
+
state,
|
|
105
|
+
model
|
|
106
|
+
} = this.c;
|
|
107
|
+
return createVNode(resolveComponent("iBizControlBase"), {
|
|
108
|
+
"controller": this.c
|
|
109
|
+
}, {
|
|
110
|
+
default: () => [createVNode(resolveComponent("iBizRow"), {
|
|
111
|
+
"class": this.ns.b("content"),
|
|
112
|
+
"layout": {
|
|
113
|
+
layout: "FLEX"
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
default: () => {
|
|
117
|
+
var _a;
|
|
118
|
+
return [state.isCreated && (this.$slots.default ? this.$slots.default({
|
|
119
|
+
panelItems: this.c.panelItems
|
|
120
|
+
}) : (_a = model.rootPanelItems) == null ? void 0 : _a.map((panelItem) => {
|
|
121
|
+
let _slot;
|
|
122
|
+
const subC = this.c.panelItems[panelItem.id];
|
|
123
|
+
panelItem.layoutPos.layout = "FLEX";
|
|
124
|
+
return createVNode(resolveComponent("iBizCol"), {
|
|
125
|
+
"layoutPos": panelItem.layoutPos,
|
|
126
|
+
"state": subC.state
|
|
127
|
+
}, _isSlot(_slot = this.renderPanelItem(panelItem)) ? _slot : {
|
|
128
|
+
default: () => [_slot]
|
|
129
|
+
});
|
|
130
|
+
}))];
|
|
131
|
+
}
|
|
132
|
+
})]
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export { ViewLayoutPanelControl };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IControlProvider } from '@ibiz-template/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* 视图布局面板部件适配器
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-25 18:10:57
|
|
7
|
+
* @export
|
|
8
|
+
* @class ViewLayoutPanelProvider
|
|
9
|
+
* @implements {IControlProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class ViewLayoutPanelProvider implements IControlProvider {
|
|
12
|
+
component: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=view-layout-panel.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-layout-panel.provider.d.ts","sourceRoot":"","sources":["../../../../src/control/panel/view-layout-panel/view-layout-panel.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,YAAW,gBAAgB;IAC9D,SAAS,EAAE,MAAM,CAAgC;CAClD"}
|