@ibiz-template/vue3-util 0.3.1 → 0.3.3
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.d.ts +6 -2
- package/es/common/code-list/code-list.d.ts.map +1 -1
- package/es/common/code-list/code-list.mjs +14 -1
- package/es/common/control-base/control-base.d.ts.map +1 -1
- package/es/common/control-base/control-base.mjs +1 -0
- package/es/index.mjs +3 -0
- package/es/panel-component/index.d.ts +1 -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-image/index.d.ts +28 -0
- package/es/panel-component/panel-container-image/index.d.ts.map +1 -0
- package/es/panel-component/panel-container-image/index.mjs +21 -0
- package/es/panel-component/panel-container-image/panel-container-image.controller.d.ts +15 -0
- package/es/panel-component/panel-container-image/panel-container-image.controller.d.ts.map +1 -0
- package/es/panel-component/panel-container-image/panel-container-image.controller.mjs +12 -0
- package/es/panel-component/panel-container-image/panel-container-image.css +1 -0
- package/es/panel-component/panel-container-image/panel-container-image.d.ts +28 -0
- package/es/panel-component/panel-container-image/panel-container-image.d.ts.map +1 -0
- package/es/panel-component/panel-container-image/panel-container-image.mjs +93 -0
- package/es/panel-component/panel-container-image/panel-container-image.provider.d.ts +16 -0
- package/es/panel-component/panel-container-image/panel-container-image.provider.d.ts.map +1 -0
- package/es/panel-component/panel-container-image/panel-container-image.provider.mjs +15 -0
- package/es/panel-component/panel-container-image/panel-container-image.state.d.ts +13 -0
- package/es/panel-component/panel-container-image/panel-container-image.state.d.ts.map +1 -0
- package/es/panel-component/panel-container-image/panel-container-image.state.mjs +7 -0
- package/es/props/editor/array.d.ts +6 -0
- package/es/props/editor/array.d.ts.map +1 -1
- package/es/props/editor/autocomplete.d.ts +6 -0
- package/es/props/editor/autocomplete.d.ts.map +1 -1
- package/es/props/editor/cascader.d.ts +6 -0
- package/es/props/editor/cascader.d.ts.map +1 -1
- package/es/props/editor/check-box-list.d.ts +6 -0
- package/es/props/editor/check-box-list.d.ts.map +1 -1
- package/es/props/editor/check-box.d.ts +6 -0
- package/es/props/editor/check-box.d.ts.map +1 -1
- package/es/props/editor/code.d.ts +6 -0
- package/es/props/editor/code.d.ts.map +1 -1
- package/es/props/editor/color-picker.d.ts +6 -0
- package/es/props/editor/color-picker.d.ts.map +1 -1
- package/es/props/editor/common.d.ts +5 -0
- package/es/props/editor/common.d.ts.map +1 -1
- package/es/props/editor/common.mjs +5 -2
- package/es/props/editor/data-picker.d.ts +6 -0
- package/es/props/editor/data-picker.d.ts.map +1 -1
- package/es/props/editor/date-picker.d.ts +6 -0
- package/es/props/editor/date-picker.d.ts.map +1 -1
- package/es/props/editor/date-range.d.ts +6 -0
- package/es/props/editor/date-range.d.ts.map +1 -1
- package/es/props/editor/dropdown-list.d.ts +6 -0
- package/es/props/editor/dropdown-list.d.ts.map +1 -1
- package/es/props/editor/html.d.ts +6 -0
- package/es/props/editor/html.d.ts.map +1 -1
- package/es/props/editor/list-box.d.ts +6 -0
- package/es/props/editor/list-box.d.ts.map +1 -1
- package/es/props/editor/markdown.d.ts +6 -0
- package/es/props/editor/markdown.d.ts.map +1 -1
- package/es/props/editor/number-range.d.ts +6 -0
- package/es/props/editor/number-range.d.ts.map +1 -1
- package/es/props/editor/radio-button-list.d.ts +6 -0
- package/es/props/editor/radio-button-list.d.ts.map +1 -1
- package/es/props/editor/rate.d.ts +6 -0
- package/es/props/editor/rate.d.ts.map +1 -1
- package/es/props/editor/raw.d.ts +6 -0
- package/es/props/editor/raw.d.ts.map +1 -1
- package/es/props/editor/slider.d.ts +6 -0
- package/es/props/editor/slider.d.ts.map +1 -1
- package/es/props/editor/span.d.ts +6 -0
- package/es/props/editor/span.d.ts.map +1 -1
- package/es/props/editor/stepper.d.ts +6 -0
- package/es/props/editor/stepper.d.ts.map +1 -1
- package/es/props/editor/switch.d.ts +6 -0
- package/es/props/editor/switch.d.ts.map +1 -1
- package/es/props/editor/text-box.d.ts +18 -0
- package/es/props/editor/text-box.d.ts.map +1 -1
- package/es/props/editor/upload.d.ts +6 -0
- package/es/props/editor/upload.d.ts.map +1 -1
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +1 -0
- package/lib/index.cjs +15 -9
- package/package.json +5 -5
- package/src/common/code-list/code-list.tsx +14 -1
- package/src/common/control-base/control-base.tsx +1 -0
- package/src/panel-component/index.ts +1 -0
- package/src/panel-component/panel-container-image/index.ts +22 -0
- package/src/panel-component/panel-container-image/panel-container-image.controller.ts +18 -0
- package/src/panel-component/panel-container-image/panel-container-image.provider.ts +30 -0
- package/src/panel-component/panel-container-image/panel-container-image.scss +18 -0
- package/src/panel-component/panel-container-image/panel-container-image.state.ts +12 -0
- package/src/panel-component/panel-container-image/panel-container-image.tsx +95 -0
- package/src/props/editor/common.ts +3 -0
- package/src/view/common/view.tsx +1 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IPanelItemProvider,
|
|
3
|
+
PanelController,
|
|
4
|
+
PanelItemController,
|
|
5
|
+
} from '@ibiz-template/runtime';
|
|
6
|
+
import { IPanelContainer } from '@ibiz/model-core';
|
|
7
|
+
import { PanelContainerImageController } from './panel-container-image.controller';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 面板图片容器适配器
|
|
11
|
+
*
|
|
12
|
+
* @author lxm
|
|
13
|
+
* @date 2022-09-19 22:09:03
|
|
14
|
+
* @export
|
|
15
|
+
* @class PanelContainerImageProvider
|
|
16
|
+
* @implements {EditorProvider}
|
|
17
|
+
*/
|
|
18
|
+
export class PanelContainerImageProvider implements IPanelItemProvider {
|
|
19
|
+
component: string = 'IBizPanelContainerImage';
|
|
20
|
+
|
|
21
|
+
async createController(
|
|
22
|
+
panelItem: IPanelContainer,
|
|
23
|
+
panel: PanelController,
|
|
24
|
+
parent: PanelItemController | undefined,
|
|
25
|
+
): Promise<PanelItemController> {
|
|
26
|
+
const c = new PanelContainerImageController(panelItem, panel, parent);
|
|
27
|
+
await c.init();
|
|
28
|
+
return c;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// 默认样式
|
|
2
|
+
@include b(panel-container-image) {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
background-repeat: no-repeat;
|
|
7
|
+
background-position: center center;
|
|
8
|
+
> .#{bem('row')} {
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow-x: hidden;
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@include when(hidden) {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PanelItemState } from '@ibiz-template/runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 面板图片容器状态
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2023-02-07 06:04:27
|
|
8
|
+
* @export
|
|
9
|
+
* @class PanelContainerImageState
|
|
10
|
+
* @extends {PanelItemState}
|
|
11
|
+
*/
|
|
12
|
+
export class PanelContainerImageState extends PanelItemState {}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { IPanelContainer } from '@ibiz/model-core';
|
|
2
|
+
import { computed, defineComponent, PropType, VNode } from 'vue';
|
|
3
|
+
import { isSvg } from '@ibiz-template/core';
|
|
4
|
+
import { useNamespace } from '../../use';
|
|
5
|
+
import { PanelContainerImageController } from './panel-container-image.controller';
|
|
6
|
+
import './panel-container-image.scss';
|
|
7
|
+
|
|
8
|
+
export const PanelContainerImage = defineComponent({
|
|
9
|
+
name: 'IBizPanelContainerImage',
|
|
10
|
+
props: {
|
|
11
|
+
modelData: {
|
|
12
|
+
type: Object as PropType<IPanelContainer>,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
controller: {
|
|
16
|
+
type: PanelContainerImageController,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
setup(props) {
|
|
21
|
+
const ns = useNamespace('panel-container-image');
|
|
22
|
+
const { id } = props.modelData;
|
|
23
|
+
|
|
24
|
+
// 类名控制
|
|
25
|
+
const classArr = computed(() => {
|
|
26
|
+
let result: Array<string | false> = [ns.b(), ns.m(id)];
|
|
27
|
+
result = [
|
|
28
|
+
...result,
|
|
29
|
+
...props.controller.containerClass,
|
|
30
|
+
ns.is('hidden', !props.controller.state.visible),
|
|
31
|
+
];
|
|
32
|
+
return result;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const backgroundStyle = computed(() => {
|
|
36
|
+
const image = props.controller.model.sysImage;
|
|
37
|
+
const styles = {};
|
|
38
|
+
let imgStr = '';
|
|
39
|
+
if (image?.rawContent) {
|
|
40
|
+
if (isSvg(image.rawContent)) {
|
|
41
|
+
imgStr = `url(data:image/svg+xml;base64,${btoa(image.rawContent)})`;
|
|
42
|
+
} else {
|
|
43
|
+
imgStr = `url(${image.rawContent})`;
|
|
44
|
+
}
|
|
45
|
+
} else if (image?.imagePath) {
|
|
46
|
+
imgStr = `url(${image.imagePath})`;
|
|
47
|
+
}
|
|
48
|
+
if (imgStr) {
|
|
49
|
+
Object.assign(styles, {
|
|
50
|
+
backgroundImage: imgStr,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return styles;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return { ns, classArr, backgroundStyle };
|
|
57
|
+
},
|
|
58
|
+
render() {
|
|
59
|
+
// 内容区默认插槽处理,封装app-col
|
|
60
|
+
const defaultSlots: VNode[] = this.$slots.default?.() || [];
|
|
61
|
+
const content = (
|
|
62
|
+
<iBizRow slot='content' layout={this.modelData.layout}>
|
|
63
|
+
{defaultSlots.map(slot => {
|
|
64
|
+
const props = slot.props as IData;
|
|
65
|
+
if (!props || !props.controller) {
|
|
66
|
+
return slot;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<iBizCol
|
|
71
|
+
layoutPos={props.modelData.layoutPos}
|
|
72
|
+
state={props.controller.state}
|
|
73
|
+
>
|
|
74
|
+
{slot}
|
|
75
|
+
</iBizCol>
|
|
76
|
+
);
|
|
77
|
+
})}
|
|
78
|
+
</iBizRow>
|
|
79
|
+
);
|
|
80
|
+
return (
|
|
81
|
+
<div
|
|
82
|
+
class={this.classArr}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
this.controller.onClick();
|
|
85
|
+
}}
|
|
86
|
+
style={this.backgroundStyle}
|
|
87
|
+
>
|
|
88
|
+
{this.controller.model.cssStyle ? (
|
|
89
|
+
<style type='text/css'>{this.controller.model.cssStyle}</style>
|
|
90
|
+
) : null}
|
|
91
|
+
{content}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
});
|
|
@@ -27,6 +27,7 @@ export function getEditorProps<C>() {
|
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: false,
|
|
29
29
|
},
|
|
30
|
+
overflowMode: { type: String },
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -49,6 +50,8 @@ export function getEditorEmits<V>() {
|
|
|
49
50
|
focus: (_event?: IData) => true,
|
|
50
51
|
/** 回车事件 */
|
|
51
52
|
enter: (_event?: IData) => true,
|
|
53
|
+
/** 信息文本变更事件 */
|
|
54
|
+
infoTextChange: (_text: string) => true,
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
57
|
|