@ibiz-template/vue3-util 0.7.41-alpha.111 → 0.7.41-alpha.113

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.
Files changed (133) hide show
  1. package/dist/index.min.css +1 -1
  2. package/dist/index.system.min.js +1 -1
  3. package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
  4. package/es/control/panel/view-layout-panel/view-layout-panel.mjs +8 -3
  5. package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -1
  6. package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts +2 -0
  7. package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts.map +1 -1
  8. package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.mjs +16 -5
  9. package/es/panel-component/auth-wxmp-qrcode/index.d.ts +2 -0
  10. package/es/panel-component/auth-wxmp-qrcode/index.d.ts.map +1 -1
  11. package/es/panel-component/grid-container/grid-container.d.ts +2 -0
  12. package/es/panel-component/grid-container/grid-container.d.ts.map +1 -1
  13. package/es/panel-component/grid-container/grid-container.mjs +12 -2
  14. package/es/panel-component/grid-container/index.d.ts +2 -0
  15. package/es/panel-component/grid-container/index.d.ts.map +1 -1
  16. package/es/panel-component/multi-data-container/index.d.ts +2 -0
  17. package/es/panel-component/multi-data-container/index.d.ts.map +1 -1
  18. package/es/panel-component/multi-data-container/multi-data-container.d.ts +2 -0
  19. package/es/panel-component/multi-data-container/multi-data-container.d.ts.map +1 -1
  20. package/es/panel-component/multi-data-container/multi-data-container.mjs +16 -3
  21. package/es/panel-component/multi-data-container-raw/index.d.ts +2 -0
  22. package/es/panel-component/multi-data-container-raw/index.d.ts.map +1 -1
  23. package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts +2 -0
  24. package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts.map +1 -1
  25. package/es/panel-component/multi-data-container-raw/multi-data-container-raw.mjs +19 -4
  26. package/es/panel-component/nav-pos/index.d.ts +2 -0
  27. package/es/panel-component/nav-pos/index.d.ts.map +1 -1
  28. package/es/panel-component/nav-pos/nav-pos.d.ts +2 -0
  29. package/es/panel-component/nav-pos/nav-pos.d.ts.map +1 -1
  30. package/es/panel-component/nav-pos/nav-pos.mjs +18 -3
  31. package/es/panel-component/panel-container/index.d.ts +2 -0
  32. package/es/panel-component/panel-container/index.d.ts.map +1 -1
  33. package/es/panel-component/panel-container/panel-container.d.ts +2 -0
  34. package/es/panel-component/panel-container/panel-container.d.ts.map +1 -1
  35. package/es/panel-component/panel-container/panel-container.mjs +23 -5
  36. package/es/panel-component/panel-container-image/index.d.ts +2 -0
  37. package/es/panel-component/panel-container-image/index.d.ts.map +1 -1
  38. package/es/panel-component/panel-container-image/panel-container-image.d.ts +2 -0
  39. package/es/panel-component/panel-container-image/panel-container-image.d.ts.map +1 -1
  40. package/es/panel-component/panel-container-image/panel-container-image.mjs +19 -4
  41. package/es/panel-component/panel-ctrl-pos/index.d.ts +2 -0
  42. package/es/panel-component/panel-ctrl-pos/index.d.ts.map +1 -1
  43. package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts +2 -0
  44. package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts.map +1 -1
  45. package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.mjs +16 -4
  46. package/es/panel-component/panel-ctrl-view-page-caption/index.d.ts +2 -0
  47. package/es/panel-component/panel-ctrl-view-page-caption/index.d.ts.map +1 -1
  48. package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.d.ts +2 -0
  49. package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.d.ts.map +1 -1
  50. package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.mjs +12 -3
  51. package/es/panel-component/panel-field/index.d.ts +2 -0
  52. package/es/panel-component/panel-field/index.d.ts.map +1 -1
  53. package/es/panel-component/panel-field/panel-field.d.ts +2 -0
  54. package/es/panel-component/panel-field/panel-field.d.ts.map +1 -1
  55. package/es/panel-component/panel-field/panel-field.mjs +14 -5
  56. package/es/panel-component/panel-item-render/index.d.ts +2 -0
  57. package/es/panel-component/panel-item-render/index.d.ts.map +1 -1
  58. package/es/panel-component/panel-item-render/panel-item-render.d.ts +2 -0
  59. package/es/panel-component/panel-item-render/panel-item-render.d.ts.map +1 -1
  60. package/es/panel-component/panel-item-render/panel-item-render.mjs +10 -2
  61. package/es/panel-component/panel-rawitem/index.d.ts +2 -0
  62. package/es/panel-component/panel-rawitem/index.d.ts.map +1 -1
  63. package/es/panel-component/panel-rawitem/panel-rawitem.d.ts +2 -0
  64. package/es/panel-component/panel-rawitem/panel-rawitem.d.ts.map +1 -1
  65. package/es/panel-component/panel-rawitem/panel-rawitem.mjs +12 -4
  66. package/es/panel-component/panel-tab-page/index.d.ts +2 -0
  67. package/es/panel-component/panel-tab-page/index.d.ts.map +1 -1
  68. package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +2 -0
  69. package/es/panel-component/panel-tab-page/panel-tab-page.d.ts.map +1 -1
  70. package/es/panel-component/panel-tab-page/panel-tab-page.mjs +16 -2
  71. package/es/panel-component/scroll-container/index.d.ts +2 -0
  72. package/es/panel-component/scroll-container/index.d.ts.map +1 -1
  73. package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts +2 -0
  74. package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts.map +1 -1
  75. package/es/panel-component/scroll-container/scroll-container/scroll-container.mjs +22 -12
  76. package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts +2 -0
  77. package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts.map +1 -1
  78. package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.mjs +16 -2
  79. package/es/panel-component/single-data-container/index.d.ts +2 -0
  80. package/es/panel-component/single-data-container/index.d.ts.map +1 -1
  81. package/es/panel-component/single-data-container/single-data-container.d.ts +2 -0
  82. package/es/panel-component/single-data-container/single-data-container.d.ts.map +1 -1
  83. package/es/panel-component/single-data-container/single-data-container.mjs +18 -3
  84. package/es/panel-component/teleport-placeholder/index.d.ts +2 -0
  85. package/es/panel-component/teleport-placeholder/index.d.ts.map +1 -1
  86. package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +2 -0
  87. package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts.map +1 -1
  88. package/es/panel-component/teleport-placeholder/teleport-placeholder.mjs +10 -3
  89. package/es/use/use-semantic-node/use-semantic-node.d.ts +2 -2
  90. package/es/use/use-semantic-node/use-semantic-node.d.ts.map +1 -1
  91. package/es/use/use-semantic-node/use-semantic-node.mjs +12 -2
  92. package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +8 -3
  93. package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.cjs +16 -5
  94. package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -1
  95. package/lib/panel-component/grid-container/grid-container.cjs +12 -2
  96. package/lib/panel-component/multi-data-container/multi-data-container.cjs +16 -3
  97. package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.cjs +19 -4
  98. package/lib/panel-component/nav-pos/nav-pos.cjs +18 -3
  99. package/lib/panel-component/panel-container/panel-container.cjs +23 -5
  100. package/lib/panel-component/panel-container-image/panel-container-image.cjs +19 -4
  101. package/lib/panel-component/panel-ctrl-pos/panel-ctrl-pos.cjs +16 -4
  102. package/lib/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.cjs +12 -3
  103. package/lib/panel-component/panel-field/panel-field.cjs +14 -5
  104. package/lib/panel-component/panel-item-render/panel-item-render.cjs +10 -2
  105. package/lib/panel-component/panel-rawitem/panel-rawitem.cjs +12 -4
  106. package/lib/panel-component/panel-tab-page/panel-tab-page.cjs +16 -2
  107. package/lib/panel-component/scroll-container/scroll-container/scroll-container.cjs +22 -12
  108. package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.cjs +16 -2
  109. package/lib/panel-component/single-data-container/single-data-container.cjs +18 -3
  110. package/lib/panel-component/teleport-placeholder/teleport-placeholder.cjs +10 -3
  111. package/lib/use/use-semantic-node/use-semantic-node.cjs +12 -2
  112. package/package.json +6 -6
  113. package/src/control/panel/view-layout-panel/view-layout-panel.tsx +8 -2
  114. package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.scss +2 -0
  115. package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.tsx +19 -6
  116. package/src/panel-component/grid-container/grid-container.tsx +8 -2
  117. package/src/panel-component/multi-data-container/multi-data-container.tsx +13 -4
  118. package/src/panel-component/multi-data-container-raw/multi-data-container-raw.tsx +12 -4
  119. package/src/panel-component/nav-pos/nav-pos.tsx +16 -3
  120. package/src/panel-component/panel-container/panel-container.tsx +20 -6
  121. package/src/panel-component/panel-container-image/panel-container-image.tsx +13 -5
  122. package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.tsx +11 -4
  123. package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.tsx +10 -3
  124. package/src/panel-component/panel-field/panel-field.tsx +26 -5
  125. package/src/panel-component/panel-item-render/panel-item-render.tsx +5 -3
  126. package/src/panel-component/panel-rawitem/panel-rawitem.tsx +25 -4
  127. package/src/panel-component/panel-tab-page/panel-tab-page.tsx +18 -3
  128. package/src/panel-component/scroll-container/scroll-container/scroll-container.tsx +37 -9
  129. package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.tsx +7 -3
  130. package/src/panel-component/single-data-container/single-data-container.tsx +12 -4
  131. package/src/panel-component/teleport-placeholder/teleport-placeholder.tsx +5 -4
  132. package/src/use/use-semantic-node/use-semantic-node.ts +20 -6
  133. package/src/view/common/view.scss +3 -2
@@ -1,7 +1,7 @@
1
1
  import { CTX, IControlController } from '@ibiz-template/runtime';
2
2
  import { IPanelCtrlPos } from '@ibiz/model-core';
3
3
  import { defineComponent, inject, PropType, VNode } from 'vue';
4
- import { useNamespace } from '../../use';
4
+ import { useNamespace, useSemanticNode } from '../../use';
5
5
  import { PanelCtrlPosController } from './panel-ctrl-pos.controller';
6
6
  import './panel-ctrl-pos.scss';
7
7
 
@@ -29,6 +29,8 @@ export const PanelCtrlPos = defineComponent({
29
29
  },
30
30
  },
31
31
  setup(props) {
32
+ const ns = useNamespace('panel-ctrl-pos');
33
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
32
34
  // 上下文里提前预告部件
33
35
  const ctx = inject('ctx') as CTX;
34
36
  ctx.evt.on('onRegister', (name, c) => {
@@ -37,15 +39,18 @@ export const PanelCtrlPos = defineComponent({
37
39
  }
38
40
  });
39
41
 
40
- const ns = useNamespace('panel-ctrl-pos');
41
- return { ns };
42
+ return { ns, semanticClass, semanticStyle };
42
43
  },
43
44
  render() {
44
45
  const { state } = this.controller;
45
46
  let content: VNode | VNode[] | undefined;
46
47
 
47
48
  if (this.$slots.default) {
48
- content = this.$slots.default();
49
+ const props = {
50
+ class: this.semanticClass('content'),
51
+ style: this.semanticStyle('content'),
52
+ };
53
+ content = this.$slots.default(props);
49
54
  }
50
55
 
51
56
  return (
@@ -53,9 +58,11 @@ export const PanelCtrlPos = defineComponent({
53
58
  class={[
54
59
  this.ns.b(),
55
60
  this.ns.m(this.modelData.id),
61
+ this.semanticClass('root'),
56
62
  ...this.controller.containerClass,
57
63
  this.ns.is('hidden', !state.visible),
58
64
  ]}
65
+ style={this.semanticStyle('root')}
59
66
  >
60
67
  {content ||
61
68
  (ibiz.env.dev
@@ -1,6 +1,6 @@
1
1
  import { IPanelCtrlPos } from '@ibiz/model-core';
2
2
  import { computed, defineComponent, PropType } from 'vue';
3
- import { useNamespace } from '../../use';
3
+ import { useNamespace, useSemanticNode } from '../../use';
4
4
  import { PanelCtrlViewPageCaptionController } from './panel-ctrl-view-page-caption.controller';
5
5
  import './panel-ctrl-view-page-caption.scss';
6
6
 
@@ -29,6 +29,7 @@ export const PanelCtrlViewPageCaption = defineComponent({
29
29
  },
30
30
  setup(props) {
31
31
  const ns = useNamespace('panel-ctrl-view-page-caption');
32
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
32
33
 
33
34
  // 类名控制
34
35
  const classArr = computed(() => {
@@ -45,6 +46,8 @@ export const PanelCtrlViewPageCaption = defineComponent({
45
46
  return {
46
47
  ns,
47
48
  classArr,
49
+ semanticClass,
50
+ semanticStyle,
48
51
  };
49
52
  },
50
53
  render() {
@@ -52,7 +55,10 @@ export const PanelCtrlViewPageCaption = defineComponent({
52
55
  let editor = null;
53
56
  if (this.controller.data) {
54
57
  editor = (
55
- <span class={this.ns.b('content')}>
58
+ <span
59
+ class={[this.ns.b('content'), this.semanticClass('content')]}
60
+ style={this.semanticStyle('content')}
61
+ >
56
62
  {this.controller.state.caption}
57
63
  </span>
58
64
  );
@@ -60,7 +66,8 @@ export const PanelCtrlViewPageCaption = defineComponent({
60
66
 
61
67
  return (
62
68
  <div
63
- class={this.classArr}
69
+ class={[this.classArr, this.semanticClass('root')]}
70
+ style={this.semanticStyle('root')}
64
71
  onClick={event => this.controller.onClick(event)}
65
72
  >
66
73
  {editor}
@@ -1,6 +1,6 @@
1
1
  import { IPanelField } from '@ibiz/model-core';
2
2
  import { computed, defineComponent, PropType, resolveComponent, h } from 'vue';
3
- import { renderTooltip, useNamespace } from '../../use';
3
+ import { renderTooltip, useNamespace, useSemanticNode } from '../../use';
4
4
  import { PanelFieldController } from './panel-field.controller';
5
5
  import './panel-field.scss';
6
6
 
@@ -33,6 +33,7 @@ export const PanelField = defineComponent({
33
33
  },
34
34
  setup(props) {
35
35
  const ns = useNamespace('panel-field');
36
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
36
37
 
37
38
  // 类名控制
38
39
  const classArr = computed(() => {
@@ -43,7 +44,6 @@ export const PanelField = defineComponent({
43
44
  ns.is('error', !!props.controller.state.error),
44
45
  ns.is('mob', window.Environment && window.Environment.isMob),
45
46
  ];
46
- result.push(...props.controller.containerClass);
47
47
  return result;
48
48
  });
49
49
 
@@ -63,6 +63,8 @@ export const PanelField = defineComponent({
63
63
  classArr,
64
64
  showTitle,
65
65
  onValueChange,
66
+ semanticClass,
67
+ semanticStyle,
66
68
  };
67
69
  },
68
70
  render() {
@@ -74,7 +76,14 @@ export const PanelField = defineComponent({
74
76
  data: this.controller.data,
75
77
  controller: this.controller.editor,
76
78
  disabled: this.controller.state.disabled,
77
- class: this.ns.b('content'),
79
+ class: [
80
+ this.ns.b('content'),
81
+ ibiz.config.common.enhancedUI === true
82
+ ? this.controller.containerClass
83
+ : '',
84
+ this.semanticClass('content'),
85
+ ],
86
+ style: [this.semanticStyle('content')],
78
87
  showTitle: this.showTitle,
79
88
  readonly: this.controller.state.readonly,
80
89
  onChange: this.onValueChange,
@@ -99,7 +108,14 @@ export const PanelField = defineComponent({
99
108
 
100
109
  return (
101
110
  <div
102
- class={this.classArr}
111
+ class={[
112
+ this.classArr,
113
+ ibiz.config.common.enhancedUI === false
114
+ ? this.controller.containerClass
115
+ : '',
116
+ this.semanticClass('root'),
117
+ ]}
118
+ style={this.semanticStyle('root')}
103
119
  onClick={event => this.controller.onClick(event)}
104
120
  v-tooltip={renderTooltip(
105
121
  this.controller.data,
@@ -109,7 +125,12 @@ export const PanelField = defineComponent({
109
125
  >
110
126
  {editor}
111
127
  {this.controller.state.error && (
112
- <div class={this.ns.e('error')}>{this.controller.state.error}</div>
128
+ <div
129
+ class={[this.ns.e('error'), this.semanticClass('error')]}
130
+ style={this.semanticStyle('error')}
131
+ >
132
+ {this.controller.state.error}
133
+ </div>
113
134
  )}
114
135
  </div>
115
136
  );
@@ -1,6 +1,6 @@
1
1
  import { IPanelContainer } from '@ibiz/model-core';
2
2
  import { computed, defineComponent, PropType } from 'vue';
3
- import { useNamespace } from '../../use';
3
+ import { useNamespace, useSemanticNode } from '../../use';
4
4
  import { PanelItemRenderController } from './panel-item-render.controller';
5
5
 
6
6
  /**
@@ -28,6 +28,7 @@ export const PanelItemRender = defineComponent({
28
28
  },
29
29
  setup(props) {
30
30
  const ns = useNamespace('panel-item-render');
31
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
31
32
 
32
33
  const nsType = useNamespace(
33
34
  `panel-${props.modelData.itemType?.toLowerCase()}`,
@@ -53,12 +54,13 @@ export const PanelItemRender = defineComponent({
53
54
  );
54
55
  });
55
56
 
56
- return { ns, classArr, htmlCode };
57
+ return { ns, classArr, htmlCode, semanticClass, semanticStyle };
57
58
  },
58
59
  render() {
59
60
  return (
60
61
  <div
61
- class={this.classArr}
62
+ class={[this.classArr, this.semanticClass('content')]}
63
+ style={this.semanticStyle('content')}
62
64
  v-html={this.htmlCode}
63
65
  onClick={event => this.controller.onClick(event)}
64
66
  ></div>
@@ -1,6 +1,6 @@
1
1
  import { IHtmlItem, IPanelRawItem, ITextItem } from '@ibiz/model-core';
2
2
  import { computed, defineComponent, PropType, Ref, ref, watch } from 'vue';
3
- import { useNamespace } from '../../use';
3
+ import { useNamespace, useSemanticNode } from '../../use';
4
4
  import { PanelRawItemController } from './panel-rawitem.controller';
5
5
  import './panel-rawitem.scss';
6
6
 
@@ -30,6 +30,7 @@ export const PanelRawItem = defineComponent({
30
30
  setup(props) {
31
31
  const ns = useNamespace('panel-rawitem');
32
32
  const c = props.controller;
33
+ const { semanticClass, semanticStyle } = useSemanticNode(c);
33
34
 
34
35
  // 传入内容
35
36
  const content: Ref<string | number | undefined> = ref('');
@@ -46,7 +47,6 @@ export const PanelRawItem = defineComponent({
46
47
  const classArr = computed(() => {
47
48
  const { id } = props.modelData;
48
49
  const result: Array<string | false> = [ns.b(), ns.m(id)];
49
- result.push(...props.controller.containerClass);
50
50
  return result;
51
51
  });
52
52
 
@@ -84,6 +84,8 @@ export const PanelRawItem = defineComponent({
84
84
  classArr,
85
85
  tempStyle,
86
86
  content,
87
+ semanticClass,
88
+ semanticStyle,
87
89
  };
88
90
  },
89
91
  render() {
@@ -91,11 +93,30 @@ export const PanelRawItem = defineComponent({
91
93
  if (!this.controller.state.visible) return;
92
94
  return (
93
95
  <div
94
- class={this.classArr}
95
- style={this.tempStyle}
96
+ class={[
97
+ this.classArr,
98
+ ibiz.config.common.enhancedUI === false
99
+ ? this.controller.containerClass
100
+ : '',
101
+ this.semanticClass('root'),
102
+ ]}
103
+ style={[
104
+ ibiz.config.common.enhancedUI === false ? this.tempStyle : '',
105
+ this.semanticStyle('root'),
106
+ ]}
96
107
  onClick={event => this.controller.onClick(event)}
97
108
  >
98
109
  <iBizRawItem
110
+ class={[
111
+ ibiz.config.common.enhancedUI === true
112
+ ? this.controller.containerClass
113
+ : '',
114
+ this.semanticClass('content'),
115
+ ]}
116
+ style={[
117
+ ibiz.config.common.enhancedUI === true ? this.tempStyle : '',
118
+ this.semanticStyle('content'),
119
+ ]}
99
120
  rawItem={this.modelData}
100
121
  content={this.content}
101
122
  ></iBizRawItem>
@@ -1,7 +1,7 @@
1
1
  import { computed, defineComponent, PropType, VNode } from 'vue';
2
2
  import { IPanelContainer } from '@ibiz/model-core';
3
3
  import { PanelContainerController } from '@ibiz-template/runtime';
4
- import { useNamespace } from '../../use';
4
+ import { useNamespace, useSemanticNode } from '../../use';
5
5
 
6
6
  /**
7
7
  * 面板分页
@@ -29,6 +29,8 @@ export const PanelTabPage = defineComponent({
29
29
  },
30
30
  setup(props) {
31
31
  const ns = useNamespace('panel-tab-page');
32
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
33
+
32
34
  // 类名控制
33
35
  const classArr = computed(() => {
34
36
  const { id } = props.modelData;
@@ -39,13 +41,21 @@ export const PanelTabPage = defineComponent({
39
41
  return {
40
42
  ns,
41
43
  classArr,
44
+ semanticClass,
45
+ semanticStyle,
42
46
  };
43
47
  },
44
48
  render() {
45
49
  const defaultSlots: VNode[] = this.$slots.default?.() || [];
46
50
  return (
47
51
  <iBizRow
48
- class={[this.ns.b(), this.ns.m(this.modelData.codeName), this.classArr]}
52
+ class={[
53
+ this.ns.b(),
54
+ this.ns.m(this.modelData.codeName),
55
+ this.classArr,
56
+ this.semanticClass('root'),
57
+ ]}
58
+ style={this.semanticStyle('root')}
49
59
  layout={this.modelData.layout}
50
60
  v-loading={this.controller.state.loading}
51
61
  element-loading-text={this.controller.state.loadingText}
@@ -57,7 +67,12 @@ export const PanelTabPage = defineComponent({
57
67
  }
58
68
  const c = props.controller;
59
69
  return (
60
- <iBizCol layoutPos={c.model.layoutPos} state={c.state}>
70
+ <iBizCol
71
+ class={this.semanticClass('item', { props })}
72
+ style={this.semanticStyle('item', { props })}
73
+ layoutPos={c.model.layoutPos}
74
+ state={c.state}
75
+ >
61
76
  {slot}
62
77
  </iBizCol>
63
78
  );
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-restricted-syntax */
2
2
  import { IPanelContainer } from '@ibiz/model-core';
3
3
  import { computed, defineComponent, PropType, VNode } from 'vue';
4
- import { useNamespace } from '../../../use';
4
+ import { useNamespace, useSemanticNode } from '../../../use';
5
5
  import { ScrollContainerController } from './scroll-container.controller';
6
6
  import './scroll-container.scss';
7
7
 
@@ -31,6 +31,7 @@ export const ScrollContainer = defineComponent({
31
31
  setup(props) {
32
32
  const ns = useNamespace('scroll-container');
33
33
  const { id } = props.modelData;
34
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
34
35
 
35
36
  // 类名控制
36
37
  const classArr = computed(() => {
@@ -43,7 +44,7 @@ export const ScrollContainer = defineComponent({
43
44
  return result;
44
45
  });
45
46
 
46
- return { ns, classArr };
47
+ return { ns, classArr, semanticClass, semanticStyle };
47
48
  },
48
49
  render() {
49
50
  let left: VNode | null = null;
@@ -102,23 +103,50 @@ export const ScrollContainer = defineComponent({
102
103
 
103
104
  return (
104
105
  <div
105
- class={this.classArr}
106
+ class={[this.classArr, this.semanticClass('root')]}
107
+ style={this.semanticStyle('root')}
106
108
  v-loading={this.controller.state.loading}
107
109
  element-loading-text={this.controller.state.loadingText}
108
110
  >
109
- <div class={[this.ns.e('header')]} style={slotStylle.top}>
111
+ <div
112
+ class={[this.ns.e('header'), this.semanticClass('header')]}
113
+ style={[slotStylle.top, this.semanticStyle('header')]}
114
+ >
110
115
  {top}
111
116
  </div>
112
- <div class={[this.ns.b('content')]}>
113
- <div class={this.ns.be('content', 'left')} style={slotStylle.left}>
117
+ <div
118
+ class={[this.ns.b('content'), this.semanticClass('content')]}
119
+ style={this.semanticStyle('content')}
120
+ >
121
+ <div
122
+ class={[this.ns.be('content', 'left'), this.semanticClass('left')]}
123
+ style={[slotStylle.left, this.semanticStyle('left')]}
124
+ >
114
125
  {left}
115
126
  </div>
116
- <div class={this.ns.be('content', 'center')}>{center}</div>
117
- <div class={this.ns.be('content', 'right')} style={slotStylle.right}>
127
+ <div
128
+ class={[
129
+ this.ns.be('content', 'center'),
130
+ this.semanticClass('center'),
131
+ ]}
132
+ style={this.semanticStyle('center')}
133
+ >
134
+ {center}
135
+ </div>
136
+ <div
137
+ class={[
138
+ this.ns.be('content', 'right'),
139
+ this.semanticClass('right'),
140
+ ]}
141
+ style={[slotStylle.right, this.semanticStyle('right')]}
142
+ >
118
143
  {right}
119
144
  </div>
120
145
  </div>
121
- <div class={[this.ns.e('footer')]} style={slotStylle.bottom}>
146
+ <div
147
+ class={[this.ns.e('footer'), this.semanticClass('footer')]}
148
+ style={[slotStylle.bottom, this.semanticStyle('footer')]}
149
+ >
122
150
  {bottom}
123
151
  </div>
124
152
  </div>
@@ -1,6 +1,6 @@
1
1
  import { IPanelContainer } from '@ibiz/model-core';
2
2
  import { computed, defineComponent, PropType, VNode } from 'vue';
3
- import { useNamespace } from '../../../use';
3
+ import { useNamespace, useSemanticNode } from '../../../use';
4
4
  import { ScrollContainerItemController } from './scroll-container-item.controller';
5
5
  import './scroll-container-item.scss';
6
6
 
@@ -30,6 +30,7 @@ export const ScrollContainerItem = defineComponent({
30
30
  setup(props) {
31
31
  const ns = useNamespace('scroll-container-item');
32
32
  const { id } = props.modelData;
33
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
33
34
 
34
35
  // 类名控制
35
36
  const classArr = computed(() => {
@@ -41,7 +42,7 @@ export const ScrollContainerItem = defineComponent({
41
42
  return result;
42
43
  });
43
44
 
44
- return { ns, classArr };
45
+ return { ns, classArr, semanticClass, semanticStyle };
45
46
  },
46
47
  render() {
47
48
  // 内容区默认插槽处理,封装app-col
@@ -49,7 +50,8 @@ export const ScrollContainerItem = defineComponent({
49
50
 
50
51
  return (
51
52
  <iBizRow
52
- class={this.classArr}
53
+ class={[this.classArr, this.semanticClass('root')]}
54
+ style={this.semanticStyle('root')}
53
55
  layout={{ layout: 'FLEX' }}
54
56
  v-loading={this.controller.state.loading}
55
57
  element-loading-text={this.controller.state.loadingText}
@@ -63,6 +65,8 @@ export const ScrollContainerItem = defineComponent({
63
65
  props.modelData.layoutPos.layout = 'FLEX';
64
66
  return (
65
67
  <iBizCol
68
+ class={this.semanticClass('item', { props })}
69
+ style={this.semanticStyle('item', { props })}
66
70
  layoutPos={props.modelData.layoutPos}
67
71
  state={props.controller.state}
68
72
  >
@@ -11,7 +11,7 @@ import {
11
11
  reactive,
12
12
  VNode,
13
13
  } from 'vue';
14
- import { useNamespace } from '../../use';
14
+ import { useNamespace, useSemanticNode } from '../../use';
15
15
  import { SingleDataContainerController } from './single-data-container.controller';
16
16
  import './single-data-container.scss';
17
17
 
@@ -43,6 +43,7 @@ export const SingleDataContainer = defineComponent({
43
43
  setup(props) {
44
44
  const ns = useNamespace('single-data-container');
45
45
  const { id } = props.modelData;
46
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
46
47
 
47
48
  // 面板成员state响应式
48
49
  const keys = Object.keys(props.controller.panelItems);
@@ -76,7 +77,7 @@ export const SingleDataContainer = defineComponent({
76
77
  return result;
77
78
  });
78
79
 
79
- return { ns, classArr, renderPanelItem };
80
+ return { ns, classArr, renderPanelItem, semanticClass, semanticStyle };
80
81
  },
81
82
  render() {
82
83
  let content: VNode | VNode[];
@@ -85,11 +86,17 @@ export const SingleDataContainer = defineComponent({
85
86
  } else {
86
87
  // 内容区默认插槽处理,封装app-col
87
88
  content = (
88
- <iBizRow class={this.ns.b('content')} layout={this.modelData.layout}>
89
+ <iBizRow
90
+ class={[this.ns.b('content'), this.semanticClass('content')]}
91
+ style={this.semanticStyle('content')}
92
+ layout={this.modelData.layout}
93
+ >
89
94
  {this.modelData.panelItems?.map(panelItem => {
90
95
  const childController = this.controller.panelItems[panelItem.id!];
91
96
  return (
92
97
  <iBizCol
98
+ class={this.semanticClass('item', { item: childController })}
99
+ style={this.semanticStyle('item', { item: childController })}
93
100
  layoutPos={panelItem.layoutPos}
94
101
  state={childController.state}
95
102
  >
@@ -105,7 +112,8 @@ export const SingleDataContainer = defineComponent({
105
112
  }
106
113
  return (
107
114
  <div
108
- class={this.classArr}
115
+ class={[this.classArr, this.semanticClass('root')]}
116
+ style={this.semanticStyle('root')}
109
117
  v-loading={this.controller.state.loading}
110
118
  element-loading-text={this.controller.state.loadingText}
111
119
  >
@@ -1,6 +1,6 @@
1
1
  import { IPanelRawItem } from '@ibiz/model-core';
2
2
  import { computed, defineComponent, PropType, ref } from 'vue';
3
- import { useNamespace } from '../../use';
3
+ import { useNamespace, useSemanticNode } from '../../use';
4
4
  import './teleport-placeholder.scss';
5
5
  import { TeleportPlaceholderController } from './teleport-placeholder.controller';
6
6
 
@@ -31,6 +31,7 @@ export const TeleportPlaceholder = defineComponent({
31
31
  setup(props) {
32
32
  const ns = useNamespace('teleport-placeholder');
33
33
  const tempStyle = ref('');
34
+ const { semanticClass, semanticStyle } = useSemanticNode(props.controller);
34
35
 
35
36
  const { rawItem } = props.modelData;
36
37
 
@@ -46,7 +47,7 @@ export const TeleportPlaceholder = defineComponent({
46
47
  return result;
47
48
  });
48
49
 
49
- return { ns, classArr, tempStyle };
50
+ return { ns, classArr, tempStyle, semanticClass, semanticStyle };
50
51
  },
51
52
  render() {
52
53
  // 动态控制显示
@@ -56,8 +57,8 @@ export const TeleportPlaceholder = defineComponent({
56
57
  return (
57
58
  <div
58
59
  id={this.controller.state.teleportTag}
59
- class={this.classArr}
60
- style={this.tempStyle}
60
+ class={[this.classArr, this.semanticClass('content')]}
61
+ style={[this.tempStyle, this.semanticStyle('content')]}
61
62
  ></div>
62
63
  );
63
64
  },
@@ -1,10 +1,11 @@
1
1
  import {
2
+ ScriptFactory,
3
+ EditorController,
2
4
  ControlController,
3
5
  PanelItemController,
4
6
  PredefinedAttributes,
5
- ScriptFactory,
6
7
  } from '@ibiz-template/runtime';
7
- import { IControl } from '@ibiz/model-core';
8
+ import { IControl, IEditor } from '@ibiz/model-core';
8
9
  import { useAttrs } from 'vue';
9
10
 
10
11
  /** 语义化节点class */
@@ -25,23 +26,31 @@ export type UseSemanticStyleReturn = (
25
26
  * @returns
26
27
  */
27
28
  export function useSemanticNode(
28
- controller: ControlController | PanelItemController,
29
+ controller: ControlController | PanelItemController | EditorController,
29
30
  ): {
30
31
  semanticClass: UseSemanticClassReturn;
31
32
  semanticStyle: UseSemanticStyleReturn;
32
33
  } {
34
+ const controlType = (controller.model as IControl).controlType;
35
+ const editorType = (controller.model as IEditor).editorType;
36
+
33
37
  // class埋点信息,可通过部件注入属性classNames设置,也可通过组件参数classNames设置,格式为字符串或函数,如 { root: 'semantic-mark-root' } 或 { root: (args) => 'semantic-mark-root' }
34
38
  let classItems: IData = {};
35
39
  const classNameAttr = controller.model.controlAttributes?.find(
36
40
  item => item.attrName === PredefinedAttributes.CLASSNAMES,
37
41
  );
38
42
  if (classNameAttr && classNameAttr.attrValue) {
39
- const { controlType } = controller.model as IControl;
40
- // 存在部件类型即为部件
41
43
  if (controlType) {
44
+ // 存在部件类型即为部件
42
45
  classItems = ScriptFactory.execSingleLine(classNameAttr.attrValue, {
43
46
  ...(controller as ControlController).getEventArgs(),
44
47
  }) as IData;
48
+ } else if (editorType) {
49
+ // 存在编辑器类型即为编辑器
50
+ const editor = controller as EditorController;
51
+ classItems = ScriptFactory.execSingleLine(classNameAttr.attrValue, {
52
+ ...editor.ctrl.getEventArgs(),
53
+ }) as IData;
45
54
  } else {
46
55
  const panelItem = controller as PanelItemController;
47
56
  classItems = ScriptFactory.execSingleLine(classNameAttr.attrValue, {
@@ -84,12 +93,17 @@ export function useSemanticNode(
84
93
  item => item.attrName === PredefinedAttributes.STYLES,
85
94
  );
86
95
  if (styleAttr && styleAttr.attrValue) {
87
- const { controlType } = controller.model as IControl;
88
96
  // 存在部件类型即为部件
89
97
  if (controlType) {
90
98
  styleItems = ScriptFactory.execSingleLine(styleAttr.attrValue, {
91
99
  ...(controller as ControlController).getEventArgs(),
92
100
  }) as IData;
101
+ } else if (editorType) {
102
+ // 存在编辑器类型即为编辑器
103
+ const editor = controller as EditorController;
104
+ styleItems = ScriptFactory.execSingleLine(styleAttr.attrValue, {
105
+ ...editor.ctrl.getEventArgs(),
106
+ }) as IData;
93
107
  } else {
94
108
  const panelItem = controller as PanelItemController;
95
109
  styleItems = ScriptFactory.execSingleLine(styleAttr.attrValue, {
@@ -1,6 +1,7 @@
1
+ // 视图样式
1
2
  $view: (
2
- bg-color: getCssVar(color, bg, 1),
3
- border-radius: getCssVar(border-radius, medium),
3
+ bg-color: getCssVar(color, bg, 1), // 视图背景色
4
+ border-radius: getCssVar(border-radius, medium), // 视图圆角
4
5
  );
5
6
 
6
7
  // 视图默认撑满父容器