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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.13",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
6
  "module": "dist/plain-design.commonjs.min.js",
@@ -1,12 +1,12 @@
1
1
  @include prefix(step-group) {
2
2
  .#{componentName(step)} {
3
3
  .step-title {
4
- font-size: 16px;
4
+ font-size: plv(font-size-normal);
5
5
  color: plv(text-1);
6
6
  }
7
7
 
8
8
  .step-content {
9
- font-size: 14px;
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: 16px;
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: 12px;
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: 14px;
331
+ font-size: plv(font-size-normal);
332
332
  }
333
333
 
334
334
  .step-content {
335
- font-size: 12px;
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
- setup({ props }) {
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 && props.item.slots.default()}
54
+ {!!state.init && slots.default()}
54
55
  </div>
55
56
  )
56
57
  };
@@ -14,7 +14,6 @@
14
14
 
15
15
  .tabs-header-item {
16
16
  display: inline-block;
17
- font-size: 14px;
18
17
  }
19
18
 
20
19
  &.tabs-header-show-more {
@@ -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
  );
@@ -33,4 +33,7 @@
33
33
  margin-left: 4px;
34
34
  }
35
35
  }
36
+
37
+ @include sizeMixin(tab-group, (font-size)) {
38
+ }
36
39
  }
@@ -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('用户管理 mouinted',)}
317
- onBeforeMount={() => console.log('用户管理 unmount',)}
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('立即初始化 mouinted',)}
324
- onBeforeMount={() => console.log('立即初始化 unmount',)}
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('关闭的时候销毁 mouinted',)}
332
- onBeforeMount={() => console.log('关闭的时候销毁 unmount',)}
331
+ onMounted={() => console.log('关闭的时候销毁 mounted',)}
332
+ onUnmounted={() => console.log('关闭的时候销毁 unmount',)}
333
333
  />
334
334
  </Tab>
335
335
  </TabGroup>