@king-design/intact 2.0.16 → 3.0.0-beta.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.
Files changed (160) hide show
  1. package/components/button/styles.ts +4 -1
  2. package/components/card/styles.ts +3 -2
  3. package/components/checkbox/styles.ts +31 -6
  4. package/components/collapse/styles.ts +4 -1
  5. package/components/datepicker/styles.ts +3 -1
  6. package/components/dialog/base.vdt +4 -5
  7. package/components/dialog/styles.ts +18 -13
  8. package/components/drawer/styles.ts +20 -10
  9. package/components/dropdown/styles.ts +1 -1
  10. package/components/form/styles.ts +1 -1
  11. package/components/icon/demos/disabled.md +21 -0
  12. package/components/icon/demos/icons.md +87 -116
  13. package/components/icon/index.md +1 -0
  14. package/components/icon/index.ts +2 -0
  15. package/components/icon/index.vdt +6 -2
  16. package/components/icon/styles.ts +8 -1
  17. package/components/input/styles.ts +14 -20
  18. package/components/message/demos/basic.md +1 -1
  19. package/components/message/demos/duration.md +3 -3
  20. package/components/message/index.md +1 -1
  21. package/components/message/message.ts +2 -2
  22. package/components/message/message.vdt +6 -6
  23. package/components/message/styles.ts +10 -19
  24. package/components/pagination/index.vdt +9 -9
  25. package/components/pagination/styles.ts +11 -7
  26. package/components/radio/styles.ts +28 -9
  27. package/components/select/base.vdt +4 -5
  28. package/components/select/index.md +1 -1
  29. package/components/select/styles.ts +4 -27
  30. package/components/spinner/index.vdt +6 -4
  31. package/components/spinner/styles.ts +36 -36
  32. package/components/steps/demos/basic.md +2 -1
  33. package/components/steps/demos/clickable.md +6 -0
  34. package/components/steps/demos/error.md +25 -5
  35. package/components/steps/demos/line.md +7 -6
  36. package/components/steps/demos/simple.md +0 -6
  37. package/components/steps/index.md +1 -1
  38. package/components/steps/index.ts +4 -4
  39. package/components/steps/index.vdt +1 -0
  40. package/components/steps/step.vdt +16 -13
  41. package/components/steps/styles.ts +297 -259
  42. package/components/switch/demos/basic.md +1 -2
  43. package/components/switch/demos/disabled.md +20 -0
  44. package/components/switch/demos/onOff.md +5 -0
  45. package/components/switch/styles.ts +29 -37
  46. package/components/table/styles.ts +11 -6
  47. package/components/tabs/demos/basic.md +0 -1
  48. package/components/tabs/index.ts +2 -2
  49. package/components/tabs/index.vdt +3 -3
  50. package/components/tabs/styles.ts +202 -152
  51. package/components/tag/base.ts +1 -1
  52. package/components/tag/demos/border.md +2 -2
  53. package/components/tag/index.md +1 -1
  54. package/components/tag/styles.ts +12 -11
  55. package/components/tip/index.vdt +1 -3
  56. package/components/tip/styles.ts +8 -2
  57. package/components/tooltip/content.vdt +1 -1
  58. package/components/tooltip/styles.ts +8 -6
  59. package/components/transfer/index.vdt +3 -2
  60. package/components/transfer/styles.ts +1 -0
  61. package/components/transfer/useCheck.ts +9 -2
  62. package/components/upload/demos/manually.md +12 -13
  63. package/components/upload/index.vdt +40 -34
  64. package/components/upload/styles.ts +60 -64
  65. package/es/components/button/styles.js +2 -2
  66. package/es/components/card/styles.js +10 -2
  67. package/es/components/checkbox/styles.js +21 -10
  68. package/es/components/collapse/styles.js +6 -1
  69. package/es/components/datepicker/styles.d.ts +1 -1
  70. package/es/components/datepicker/styles.js +4 -1
  71. package/es/components/dialog/base.vdt.js +5 -6
  72. package/es/components/dialog/styles.js +16 -14
  73. package/es/components/drawer/styles.js +20 -5
  74. package/es/components/dropdown/styles.js +1 -1
  75. package/es/components/form/styles.js +1 -1
  76. package/es/components/icon/index.d.ts +1 -0
  77. package/es/components/icon/index.js +2 -1
  78. package/es/components/icon/index.vdt.js +4 -2
  79. package/es/components/icon/styles.js +10 -2
  80. package/es/components/input/styles.js +1 -11
  81. package/es/components/message/message.js +1 -1
  82. package/es/components/message/message.vdt.js +7 -6
  83. package/es/components/message/styles.js +8 -8
  84. package/es/components/pagination/index.vdt.js +8 -8
  85. package/es/components/pagination/styles.js +11 -2
  86. package/es/components/radio/styles.js +16 -6
  87. package/es/components/select/base.vdt.js +5 -6
  88. package/es/components/select/styles.js +4 -24
  89. package/es/components/spinner/index.vdt.js +6 -4
  90. package/es/components/spinner/styles.js +33 -5
  91. package/es/components/steps/index.d.ts +2 -2
  92. package/es/components/steps/index.js +2 -2
  93. package/es/components/steps/index.vdt.js +1 -0
  94. package/es/components/steps/step.vdt.js +17 -8
  95. package/es/components/steps/styles.d.ts +1 -1
  96. package/es/components/steps/styles.js +80 -75
  97. package/es/components/switch/styles.js +20 -34
  98. package/es/components/table/styles.js +9 -4
  99. package/es/components/tabs/index.d.ts +1 -1
  100. package/es/components/tabs/index.js +1 -1
  101. package/es/components/tabs/index.vdt.js +1 -1
  102. package/es/components/tabs/styles.js +68 -22
  103. package/es/components/tag/base.js +1 -1
  104. package/es/components/tag/styles.js +15 -10
  105. package/es/components/tip/index.vdt.js +1 -3
  106. package/es/components/tip/styles.js +4 -3
  107. package/es/components/tooltip/content.vdt.js +4 -4
  108. package/es/components/tooltip/styles.js +12 -7
  109. package/es/components/transfer/index.vdt.js +3 -1
  110. package/es/components/transfer/styles.js +1 -1
  111. package/es/components/transfer/useCheck.d.ts +1 -0
  112. package/es/components/transfer/useCheck.js +8 -1
  113. package/es/components/upload/index.vdt.js +21 -20
  114. package/es/components/upload/styles.js +22 -30
  115. package/es/i18n/en-US.d.ts +2 -1
  116. package/es/i18n/en-US.js +2 -1
  117. package/es/index.d.ts +2 -2
  118. package/es/index.js +2 -2
  119. package/es/site/data/components/icon/demos/disabled/index.d.ts +6 -0
  120. package/es/site/data/components/icon/demos/disabled/index.js +18 -0
  121. package/es/site/data/components/icon/demos/disabled/react.d.ts +5 -0
  122. package/es/site/data/components/icon/demos/disabled/react.js +33 -0
  123. package/es/site/data/components/icon/demos/icons/index.js +1 -1
  124. package/es/site/data/components/icon/demos/icons/react.js +1 -1
  125. package/es/site/data/components/message/demos/duration/index.js +2 -2
  126. package/es/site/data/components/message/demos/duration/react.js +2 -2
  127. package/es/site/data/components/steps/demos/basic/react.js +1 -1
  128. package/es/site/data/components/steps/demos/clickable/react.js +15 -0
  129. package/es/site/data/components/steps/demos/error/react.js +22 -2
  130. package/es/site/data/components/steps/demos/line/react.js +15 -11
  131. package/es/site/data/components/steps/demos/simple/react.js +1 -11
  132. package/es/site/data/components/switch/demos/basic/react.js +0 -2
  133. package/es/site/data/components/switch/demos/disabled/index.d.ts +6 -0
  134. package/es/site/data/components/switch/demos/disabled/index.js +18 -0
  135. package/es/site/data/components/switch/demos/disabled/react.d.ts +5 -0
  136. package/es/site/data/components/switch/demos/disabled/react.js +27 -0
  137. package/es/site/data/components/switch/demos/onOff/react.js +13 -0
  138. package/es/site/data/components/tag/demos/border/index.js +1 -1
  139. package/es/site/data/components/tag/demos/border/react.js +1 -1
  140. package/es/site/data/components/upload/demos/manually/react.js +5 -7
  141. package/es/site/src/pages/document/index.js +3 -2
  142. package/es/site/src/pages/document/styles.js +1 -1
  143. package/es/styles/fonts/iconfont.eot +0 -0
  144. package/es/styles/fonts/iconfont.js +1 -1
  145. package/es/styles/fonts/iconfont.svg +189 -369
  146. package/es/styles/fonts/iconfont.ttf +0 -0
  147. package/es/styles/fonts/iconfont.woff +0 -0
  148. package/es/styles/theme.d.ts +10 -2
  149. package/es/styles/theme.js +23 -21
  150. package/i18n/en-US.ts +2 -1
  151. package/index.ts +2 -2
  152. package/package.json +2 -1
  153. package/styles/fonts/iconfont.css +172 -289
  154. package/styles/fonts/iconfont.eot +0 -0
  155. package/styles/fonts/iconfont.svg +189 -369
  156. package/styles/fonts/iconfont.ts +255 -369
  157. package/styles/fonts/iconfont.ttf +0 -0
  158. package/styles/fonts/iconfont.woff +0 -0
  159. package/styles/fonts/iconfont.woff2 +0 -0
  160. package/styles/theme.ts +23 -19
@@ -2,15 +2,24 @@ import {css} from '@emotion/css';
2
2
  import {deepDefaults, sizes, palette} from '../../styles/utils';
3
3
  import {theme, setDefault} from '../../styles/theme';
4
4
  import '../../styles/global';
5
+ import spin from '~/components/spin';
5
6
 
6
7
  const defaults = {
8
+ get borderRadius() { return theme.borderRadius },
9
+ get border() { return `1px solid ${theme.color.border}` },
10
+ get hoverBorderColor() { return theme.color.primary },
11
+ get hoverBtnBg() { return theme.color.bg },
12
+ get disabledBorderColor() { return theme.color.disabledBorder },
13
+ get disabledBg() { return theme.color.disabledBg },
14
+ get disabledColor() { return theme.color.disabled },
15
+
7
16
  default: {
8
17
  inputWidth: '46px',
9
- iconFontSize: '24px'
18
+ iconFontSize: '16px'
10
19
  },
11
20
  large: {
12
21
  inputWidth: '60px',
13
- iconFontSize: '32px'
22
+ iconFontSize: '24px'
14
23
  },
15
24
  small: {
16
25
  inputWidth: '32px',
@@ -46,39 +55,35 @@ export function makeStyles() {
46
55
  return css`
47
56
  display: inline-block;
48
57
  vertical-align: middle;
49
- line-height: 1;
50
- .k-spinner-btn {
51
- vertical-align: top;
52
- &:hover,
53
- &:focus {
54
- z-index: 1;
55
- position: relative;
58
+ border: ${spinner.border};
59
+ border-radius: ${spinner.borderRadius};
60
+ &:hover {
61
+ border-color: ${spinner.hoverBorderColor};
62
+ .k-spinner-btn {
63
+ background: ${spinner.hoverBtnBg};
56
64
  }
57
-
58
- &.k-left {
59
- border-top-right-radius: 0;
60
- border-bottom-right-radius: 0;
61
- margin-right: -1px;
65
+ .k-left {
66
+ border-radius: ${spinner.borderRadius} 0 0 ${spinner.borderRadius};
62
67
  }
63
- &.k-right {
64
- border-top-left-radius: 0;
65
- border-bottom-left-radius: 0;
66
- margin-left: -1px;
68
+ .k-right {
69
+ border-radius: 0 ${spinner.borderRadius} ${spinner.borderRadius} 0;
67
70
  }
68
71
  }
69
72
  .k-spinner-input {
70
73
  width: ${spinner.default.inputWidth};
71
- vertical-align: top;
72
74
  .k-input-inner {
73
75
  text-align: center;
74
- padding: 0;
76
+ border:none;
75
77
  border-radius: 0;
78
+ &:hover,
79
+ &:focus {
80
+ border: none
81
+ }
76
82
  }
77
83
  }
78
84
  .k-spinner-icon {
79
85
  font-size: ${spinner.default.iconFontSize};
80
86
  }
81
-
82
87
  &.k-vertical {
83
88
  position: relative;
84
89
  font-size: 0;
@@ -86,31 +91,30 @@ export function makeStyles() {
86
91
  position: absolute;
87
92
  right: 0;
88
93
  margin: 0;
89
- height: calc(50% + 1px);
94
+ height: calc(50% - 2px);
90
95
  line-height: 50%;
91
96
  }
92
97
  .k-spinner-icon {
93
- line-height: 50% !important;
94
98
  font-size: inherit !important;
95
99
  }
96
100
  .k-spinner-btn.k-left {
97
- bottom: 0;
98
- border-radius: 0 0 ${theme.borderRadius} 0;
101
+ bottom: 1px;
102
+ border-radius: 0 0 ${spinner.borderRadius} 0;
99
103
  }
100
104
  .k-spinner-btn.k-right {
101
- top: 0;
102
- border-radius: 0 ${theme.borderRadius} 0 0;
105
+ top: 1px;
106
+ border-radius: 0 ${spinner.borderRadius} 0 0;
103
107
  }
104
108
  .k-spinner-input {
105
109
  font-size: 0;
106
110
  .k-input-inner {
107
- border-radius: ${theme.borderRadius} 0 0 ${theme.borderRadius};
111
+ border-radius: ${spinner.borderRadius} 0 0 ${spinner.borderRadius};
108
112
  }
109
113
  }
110
114
  ${sizes.map(size => {
111
115
  const generate = () => `
112
116
  .k-spinner-input {
113
- padding-right: calc(${theme[size].height} - 1px);
117
+ padding-right: ${theme[size].height};
114
118
  width: ${spinner.vertical[size].width};
115
119
  }
116
120
  `
@@ -125,14 +129,10 @@ export function makeStyles() {
125
129
  }
126
130
  })}
127
131
  }
128
-
132
+
129
133
  &.k-disabled {
130
- .k-spinner-btn {
131
- &:hover,
132
- &:focus {
133
- z-index: 0;
134
- }
135
- }
134
+ border-color: ${spinner.disabledBorderColor};
135
+ background: ${spinner.disabledBg};
136
136
  }
137
137
 
138
138
  ${sizes.map(size => {
@@ -14,11 +14,12 @@ import {Steps, Step, Button} from 'kpc';
14
14
  <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
15
15
  <Step title="设置VPC" />
16
16
  </Steps>
17
+
17
18
  <Button type="primary" ev-click={this.previous}
18
19
  disabled={this.get('index') === 0}
19
20
  >Previous Step</Button>
20
21
  <Button type="primary" ev-click={this.next}
21
- disabled={this.get('index') === 2}
22
+ disabled={this.get('index') === 3}
22
23
  >Next Step</Button>
23
24
  </div>
24
25
  ```
@@ -14,6 +14,12 @@ import {Steps, Step, Button} from 'kpc';
14
14
  <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
15
15
  <Step title="设置VPC" />
16
16
  </Steps>
17
+ <br />
18
+ <Steps v-model="index" type="line" clickable>
19
+ <Step title="选择配置">请选择主机的配置信息</Step>
20
+ <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
21
+ <Step title="设置VPC" />
22
+ </Steps>
17
23
  <Button type="primary" ev-click={this.previous}
18
24
  disabled={this.get('index') === 0}
19
25
  >Previous Step</Button>
@@ -8,9 +8,29 @@ order: 1
8
8
  ```vdt
9
9
  import {Steps, Step} from 'kpc';
10
10
 
11
- <Steps value={1} status="error">
12
- <Step title="选择配置">请选择主机的配置信息</Step>
13
- <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
14
- <Step title="设置VPC" />
15
- </Steps>
11
+ <div>
12
+ <Steps value={1} status="error">
13
+ <Step title="选择配置">请选择主机的配置信息</Step>
14
+ <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
15
+ <Step title="设置VPC" />
16
+ </Steps>
17
+
18
+ <br />
19
+ <br />
20
+
21
+ <Steps value={1} status="error" type="line">
22
+ <Step title="选择配置">请选择主机的配置信息</Step>
23
+ <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
24
+ <Step title="设置VPC" />
25
+ </Steps>
26
+
27
+ <br />
28
+ <br />
29
+
30
+ <Steps value={1} status="error" type="simple">
31
+ <Step title="选择配置">请选择主机的配置信息</Step>
32
+ <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
33
+ <Step title="设置VPC" />
34
+ </Steps>
35
+ </div>
16
36
  ```
@@ -14,6 +14,11 @@ import {Steps, Step, Button} from 'kpc';
14
14
  <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
15
15
  <Step title="设置VPC" />
16
16
  </Steps>
17
+ <Steps v-model="index" type="line-compact">
18
+ <Step title="选择配置">请选择主机的配置信息</Step>
19
+ <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
20
+ <Step title="设置VPC" />
21
+ </Steps>
17
22
 
18
23
  <Button type="primary" ev-click={this.previous}
19
24
  disabled={this.get('index') === 0}
@@ -21,16 +26,12 @@ import {Steps, Step, Button} from 'kpc';
21
26
  <Button type="primary" ev-click={this.next}
22
27
  disabled={this.get('index') === 2}
23
28
  >Next Step</Button>
24
-
25
- <Steps value={1} status="error" type="line">
26
- <Step title="选择配置">请选择主机的配置信息</Step>
27
- <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
28
- <Step title="设置VPC" />
29
- </Steps>
30
29
  </div>
31
30
  ```
32
31
 
33
32
  ```styl
33
+ .k-steps
34
+ margin-bottom 16px
34
35
  .k-btn
35
36
  margin 20px 20px 20px 0
36
37
  ```
@@ -21,12 +21,6 @@ import {Steps, Step, Button} from 'kpc';
21
21
  <Button type="primary" ev-click={this.next}
22
22
  disabled={this.get('index') === 2}
23
23
  >Next Step</Button>
24
-
25
- <Steps value={1} status="error" type="simple">
26
- <Step title="选择配置">请选择主机的配置信息</Step>
27
- <Step title="选择弹性IP">请选择主机弹性IP的配置信息</Step>
28
- <Step title="设置VPC" />
29
- </Steps>
30
24
  </div>
31
25
  ```
32
26
 
@@ -13,7 +13,7 @@ sidebar: doc
13
13
  | --- | --- | --- | --- |
14
14
  | value | 标识当前第几步,从`0`开始 | `number` | `undefined` |
15
15
  | status | 步骤条的状态 | `"normal"` &#124; `"error"` | `"normal"` |
16
- | type | 步骤条样式 | `"default"` &#124; `"line"` &#124; `"simple"` | `"default"` |
16
+ | type | 步骤条样式 | `"default"` &#124; `"line"` &#124; `"simple"` &#124; `"line-compact"` |`"default"`
17
17
  | clickable | 是否支持快速切换【已完成】的步骤 | `boolean` | `false` |
18
18
 
19
19
  ## Step
@@ -5,15 +5,15 @@ export * from './step';
5
5
 
6
6
  export interface StepsProps {
7
7
  value?: number
8
- status?: 'normal' | 'error'
9
- type?: 'default' | 'line' | 'simple'
8
+ status?: 'normal' | 'error' | 'done'
9
+ type?: 'default' | 'line' | 'simple' | 'line-compact' | 'dot'
10
10
  clickable?: boolean
11
11
  }
12
12
 
13
13
  const typeDefs: Required<TypeDefs<StepsProps>> = {
14
14
  value: Number,
15
- status: ['normal', 'error'],
16
- type: ['default', 'line', 'simple'],
15
+ status: ['normal', 'error', 'done'],
16
+ type: ['default', 'line', 'simple','line-compact', 'dot'],
17
17
  clickable: Boolean
18
18
  };
19
19
 
@@ -33,6 +33,7 @@ const width = (100 / stepIndex) + '%';
33
33
  value,
34
34
  status,
35
35
  width,
36
+ type,
36
37
  onChange: this.changeIndex
37
38
  }}>
38
39
  <div class={classNameObj} {...getRestProps(this)}>{steps}</div>
@@ -1,41 +1,44 @@
1
1
  import {linkEvent} from 'intact';
2
2
  import {getRestProps, addStyle} from '../utils';
3
- import {makeStepStyles} from './styles';
4
3
  import {context as StepsContext} from './context';
4
+ import {Icon} from '../icon';
5
5
 
6
6
  const {children, title, index, className, style} = this.get();
7
7
 
8
8
  <StepsContext.Consumer>
9
- {({value, status, width, onChange}) => {
9
+ {({value, status, width, onChange, type}) => {
10
10
  const selected = value === index;
11
11
  const error = selected && status === 'error';
12
+ const done = value > index;
12
13
  const classNameObj = {
13
14
  'k-step': true,
14
15
  'k-active': selected,
15
- 'k-done': value > index,
16
+ 'k-done': done,
16
17
  'k-error': error,
17
18
  [className]: className,
18
- [makeStepStyles()]: true,
19
19
  };
20
20
 
21
21
  return <div {...getRestProps(this)}
22
22
  class={classNameObj}
23
- style={addStyle(style, {width})}
24
- ev-click={linkEvent(index, onChange)}
23
+ style={style}
25
24
  >
26
- <div class="k-step-tail"></div>
27
- <div class="k-step-wrapper">
28
- <div class="k-step-head">
29
- <div class="k-step-inner">
30
- <i class="k-step-icon ion-ios-close-empty" v-if={error}></i>
31
- <span v-else>{index + 1}</span>
32
- </div>
25
+ <div class="k-step-wrapper"
26
+ ev-click={linkEvent(index, onChange)}
27
+ >
28
+ <div class="k-step-mark">
29
+ <Icon v-if={error && type !== 'simple'} class="k-icon-close-big" color="danger" />
30
+ <Icon v-else-if={done && (type === 'line' || type === 'line-compact')}
31
+ class="k-icon-check"
32
+ color="primary"
33
+ />
34
+ <span v-else-if={type !== 'simple'}>{index + 1}</span>
33
35
  </div>
34
36
  <div class="k-step-main">
35
37
  <div class="k-step-title">{title}</div>
36
38
  <div class="k-step-content">{children}</div>
37
39
  </div>
38
40
  </div>
41
+ <div class="k-step-tail"></div>
39
42
  </div>
40
43
  }}
41
44
  </StepsContext.Consumer>