plain-design 1.0.0-beta.11 → 1.0.0-beta.13
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/plain-design.commonjs.min.js +1 -1
- package/dist/plain-design.min.css +3 -3
- package/dist/plain-design.min.js +1 -1
- package/dist/report.html +2 -2
- package/package.json +1 -1
- package/src/packages/components/StepGroup/step-group.scss +6 -6
- package/src/packages/components/TabGroup/TabsInner.tsx +3 -2
- package/src/packages/components/TabGroup/header/horizontal/tabs-header-horizontal.scss +0 -1
- package/src/packages/components/TabGroup/index.tsx +7 -1
- package/src/packages/components/TabGroup/tabs.scss +3 -0
- package/src/pages/index/components/normal/DemoTab.tsx +6 -6
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
@include prefix(step-group) {
|
2
2
|
.#{componentName(step)} {
|
3
3
|
.step-title {
|
4
|
-
font-size:
|
4
|
+
font-size: plv(font-size-normal);
|
5
5
|
color: plv(text-1);
|
6
6
|
}
|
7
7
|
|
8
8
|
.step-content {
|
9
|
-
font-size:
|
9
|
+
font-size: plv(font-size-small);
|
10
10
|
}
|
11
11
|
|
12
12
|
.step-dot {
|
@@ -21,7 +21,7 @@
|
|
21
21
|
.step-icon {
|
22
22
|
width: 32px;
|
23
23
|
height: 32px;
|
24
|
-
font-size:
|
24
|
+
font-size: plv(font-size-normal);
|
25
25
|
line-height: 32px;
|
26
26
|
text-align: center;
|
27
27
|
border-radius: 32px;
|
@@ -304,7 +304,7 @@
|
|
304
304
|
.step-icon {
|
305
305
|
width: 20px;
|
306
306
|
height: 20px;
|
307
|
-
font-size:
|
307
|
+
font-size: plv(font-size-small);
|
308
308
|
line-height: 20px;
|
309
309
|
text-align: center;
|
310
310
|
border-radius: 20px;
|
@@ -328,11 +328,11 @@
|
|
328
328
|
}
|
329
329
|
|
330
330
|
.step-title {
|
331
|
-
font-size:
|
331
|
+
font-size: plv(font-size-normal);
|
332
332
|
}
|
333
333
|
|
334
334
|
.step-content {
|
335
|
-
font-size:
|
335
|
+
font-size: plv(font-size-small);
|
336
336
|
}
|
337
337
|
|
338
338
|
&.step-group-vertical {
|
@@ -6,7 +6,8 @@ export const TabsInner = designComponent({
|
|
6
6
|
item: { type: Object as PropType<PlTabComponent>, required: true },
|
7
7
|
active: { type: Boolean },
|
8
8
|
},
|
9
|
-
|
9
|
+
slots: ['default'],
|
10
|
+
setup({ props, slots }) {
|
10
11
|
|
11
12
|
const state = reactive({
|
12
13
|
show: false,
|
@@ -50,7 +51,7 @@ export const TabsInner = designComponent({
|
|
50
51
|
{ class: 'inner-tab', style: styles.value },
|
51
52
|
props.item.attrs
|
52
53
|
)}>
|
53
|
-
{!!state.init &&
|
54
|
+
{!!state.init && slots.default()}
|
54
55
|
</div>
|
55
56
|
)
|
56
57
|
};
|
@@ -6,10 +6,12 @@ import {TabsHeaderHorizontal} from "./header/horizontal/TabsHeaderHorizontal";
|
|
6
6
|
import {TabsHeaderVertical} from "./header/vertical/TabsHeaderVertical";
|
7
7
|
import Tab from "../Tab";
|
8
8
|
import Icon from "../Icon";
|
9
|
+
import {StyleProps, useStyle} from "../../uses/useStyle";
|
9
10
|
|
10
11
|
export const TabGroup = designComponent({
|
11
12
|
name: 'tab-group',
|
12
13
|
props: {
|
14
|
+
...StyleProps,
|
13
15
|
modelValue: { type: [String, Number] }, // 双向绑定值,控制当前显示的tab
|
14
16
|
closeable: { type: Boolean }, // 是否显示关闭按钮,会派发onClose事件
|
15
17
|
fitHeight: { type: Boolean }, // 适配高度
|
@@ -21,6 +23,7 @@ export const TabGroup = designComponent({
|
|
21
23
|
slots: ['default', 'operator'],
|
22
24
|
setup({ props, event: { emit }, slots }) {
|
23
25
|
|
26
|
+
const { styleComputed } = useStyle();
|
24
27
|
const model = useModel(() => props.modelValue, emit.onUpdateModelValue);
|
25
28
|
const items = TabCollector.parent();
|
26
29
|
|
@@ -53,6 +56,7 @@ export const TabGroup = designComponent({
|
|
53
56
|
getComponentCls('tab-group'),
|
54
57
|
`tabs-head-position-${props.headPosition}`,
|
55
58
|
`tabs-head-type-${props.headType}`,
|
59
|
+
`tab-group-size-${styleComputed.value.size}`,
|
56
60
|
{
|
57
61
|
'tabs-fit-height': props.fitHeight
|
58
62
|
},
|
@@ -97,7 +101,9 @@ export const TabGroup = designComponent({
|
|
97
101
|
const body = (
|
98
102
|
<div className="tabs-body">
|
99
103
|
{[...tabs.value].sort((a, b) => String(a.val).localeCompare(String(b.val))).map((tab, index) => (
|
100
|
-
<TabsInner item={tab.item} key={index} active={tab.active}
|
104
|
+
<TabsInner item={tab.item} key={index} active={tab.active}>
|
105
|
+
{tab.item.slots.default()}
|
106
|
+
</TabsInner>
|
101
107
|
))}
|
102
108
|
</div>
|
103
109
|
);
|
@@ -313,23 +313,23 @@ export const demoInit = designPage(() => {
|
|
313
313
|
<Tab title="用户管理" style={{ padding: '20px 0' }}>
|
314
314
|
<span>用户管理:</span>
|
315
315
|
<Input
|
316
|
-
onMounted={() => console.log('用户管理
|
317
|
-
|
316
|
+
onMounted={() => console.log('用户管理 mounted',)}
|
317
|
+
onUnmounted={() => console.log('用户管理 unmount',)}
|
318
318
|
/>
|
319
319
|
</Tab>
|
320
320
|
<Tab title="立即初始化" style={{ padding: '20px 0' }} init>
|
321
321
|
<span>子模块数据管理:</span>
|
322
322
|
<Input
|
323
|
-
onMounted={() => console.log('立即初始化
|
324
|
-
|
323
|
+
onMounted={() => console.log('立即初始化 mounted',)}
|
324
|
+
onUnmounted={() => console.log('立即初始化 unmount',)}
|
325
325
|
/>
|
326
326
|
</Tab>
|
327
327
|
<Tab title="关闭的时候销毁" style={{ padding: '20px 0' }} destroyOnHide>
|
328
328
|
<span>数据集:</span>
|
329
329
|
<Input
|
330
330
|
modelValue={'初始值'}
|
331
|
-
onMounted={() => console.log('关闭的时候销毁
|
332
|
-
|
331
|
+
onMounted={() => console.log('关闭的时候销毁 mounted',)}
|
332
|
+
onUnmounted={() => console.log('关闭的时候销毁 unmount',)}
|
333
333
|
/>
|
334
334
|
</Tab>
|
335
335
|
</TabGroup>
|