@king-design/intact 2.0.15 → 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 (177) 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/demos/basic.md +1 -1
  29. package/components/select/index.md +1 -1
  30. package/components/select/styles.ts +4 -27
  31. package/components/spinner/index.vdt +6 -4
  32. package/components/spinner/styles.ts +36 -36
  33. package/components/steps/demos/basic.md +2 -1
  34. package/components/steps/demos/clickable.md +6 -0
  35. package/components/steps/demos/error.md +25 -5
  36. package/components/steps/demos/line.md +7 -6
  37. package/components/steps/demos/simple.md +0 -6
  38. package/components/steps/index.md +1 -1
  39. package/components/steps/index.ts +4 -4
  40. package/components/steps/index.vdt +1 -0
  41. package/components/steps/step.vdt +16 -13
  42. package/components/steps/styles.ts +297 -259
  43. package/components/switch/demos/basic.md +1 -2
  44. package/components/switch/demos/disabled.md +20 -0
  45. package/components/switch/demos/onOff.md +5 -0
  46. package/components/switch/styles.ts +29 -37
  47. package/components/table/column.vdt +26 -10
  48. package/components/table/demos/rowExpandable.md +1 -1
  49. package/components/table/demos/selectedKeys.md +1 -1
  50. package/components/table/index.md +3 -3
  51. package/components/table/index.spec.ts +2 -2
  52. package/components/table/styles.ts +17 -6
  53. package/components/table/useGroup.ts +18 -2
  54. package/components/table/useSortable.ts +4 -1
  55. package/components/tabs/demos/basic.md +0 -1
  56. package/components/tabs/index.ts +2 -2
  57. package/components/tabs/index.vdt +3 -3
  58. package/components/tabs/styles.ts +202 -152
  59. package/components/tag/base.ts +1 -1
  60. package/components/tag/demos/border.md +2 -2
  61. package/components/tag/index.md +1 -1
  62. package/components/tag/styles.ts +12 -11
  63. package/components/tip/index.vdt +1 -3
  64. package/components/tip/styles.ts +8 -2
  65. package/components/tooltip/content.vdt +1 -1
  66. package/components/tooltip/styles.ts +8 -6
  67. package/components/transfer/index.vdt +3 -2
  68. package/components/transfer/styles.ts +1 -0
  69. package/components/transfer/useCheck.ts +9 -2
  70. package/components/upload/demos/manually.md +12 -13
  71. package/components/upload/index.vdt +40 -34
  72. package/components/upload/styles.ts +60 -64
  73. package/es/components/button/styles.js +2 -2
  74. package/es/components/card/styles.js +10 -2
  75. package/es/components/checkbox/styles.js +21 -10
  76. package/es/components/collapse/styles.js +6 -1
  77. package/es/components/datepicker/styles.d.ts +1 -1
  78. package/es/components/datepicker/styles.js +4 -1
  79. package/es/components/dialog/base.vdt.js +5 -6
  80. package/es/components/dialog/styles.js +16 -14
  81. package/es/components/drawer/styles.js +20 -5
  82. package/es/components/dropdown/styles.js +1 -1
  83. package/es/components/form/styles.js +1 -1
  84. package/es/components/icon/index.d.ts +1 -0
  85. package/es/components/icon/index.js +2 -1
  86. package/es/components/icon/index.vdt.js +4 -2
  87. package/es/components/icon/styles.js +10 -2
  88. package/es/components/input/styles.js +1 -11
  89. package/es/components/message/message.js +1 -1
  90. package/es/components/message/message.vdt.js +7 -6
  91. package/es/components/message/styles.js +8 -8
  92. package/es/components/pagination/index.vdt.js +8 -8
  93. package/es/components/pagination/styles.js +11 -2
  94. package/es/components/radio/styles.js +16 -6
  95. package/es/components/select/base.vdt.js +5 -6
  96. package/es/components/select/styles.js +4 -24
  97. package/es/components/spinner/index.vdt.js +6 -4
  98. package/es/components/spinner/styles.js +33 -5
  99. package/es/components/steps/index.d.ts +2 -2
  100. package/es/components/steps/index.js +2 -2
  101. package/es/components/steps/index.vdt.js +1 -0
  102. package/es/components/steps/step.vdt.js +17 -8
  103. package/es/components/steps/styles.d.ts +1 -1
  104. package/es/components/steps/styles.js +80 -75
  105. package/es/components/switch/styles.js +20 -34
  106. package/es/components/table/column.vdt.js +43 -7
  107. package/es/components/table/index.spec.js +2 -2
  108. package/es/components/table/styles.js +16 -5
  109. package/es/components/table/useGroup.d.ts +3 -0
  110. package/es/components/table/useGroup.js +24 -1
  111. package/es/components/table/useSortable.d.ts +3 -1
  112. package/es/components/table/useSortable.js +4 -1
  113. package/es/components/tabs/index.d.ts +1 -1
  114. package/es/components/tabs/index.js +1 -1
  115. package/es/components/tabs/index.vdt.js +1 -1
  116. package/es/components/tabs/styles.js +68 -22
  117. package/es/components/tag/base.js +1 -1
  118. package/es/components/tag/styles.js +15 -10
  119. package/es/components/tip/index.vdt.js +1 -3
  120. package/es/components/tip/styles.js +4 -3
  121. package/es/components/tooltip/content.vdt.js +4 -4
  122. package/es/components/tooltip/styles.js +12 -7
  123. package/es/components/transfer/index.vdt.js +3 -1
  124. package/es/components/transfer/styles.js +1 -1
  125. package/es/components/transfer/useCheck.d.ts +1 -0
  126. package/es/components/transfer/useCheck.js +8 -1
  127. package/es/components/upload/index.vdt.js +21 -20
  128. package/es/components/upload/styles.js +22 -30
  129. package/es/i18n/en-US.d.ts +2 -1
  130. package/es/i18n/en-US.js +2 -1
  131. package/es/index.d.ts +2 -2
  132. package/es/index.js +2 -2
  133. package/es/site/data/components/icon/demos/disabled/index.d.ts +6 -0
  134. package/es/site/data/components/icon/demos/disabled/index.js +18 -0
  135. package/es/site/data/components/icon/demos/disabled/react.d.ts +5 -0
  136. package/es/site/data/components/icon/demos/disabled/react.js +33 -0
  137. package/es/site/data/components/icon/demos/icons/index.js +1 -1
  138. package/es/site/data/components/icon/demos/icons/react.js +1 -1
  139. package/es/site/data/components/menu/demos/collapse/react.d.ts +11 -0
  140. package/es/site/data/components/menu/demos/size/react.d.ts +7 -0
  141. package/es/site/data/components/message/demos/duration/index.js +2 -2
  142. package/es/site/data/components/message/demos/duration/react.js +2 -2
  143. package/es/site/data/components/select/demos/basic/react.js +1 -2
  144. package/es/site/data/components/steps/demos/basic/react.js +1 -1
  145. package/es/site/data/components/steps/demos/clickable/react.js +15 -0
  146. package/es/site/data/components/steps/demos/error/react.js +22 -2
  147. package/es/site/data/components/steps/demos/line/react.js +15 -11
  148. package/es/site/data/components/steps/demos/simple/react.js +1 -11
  149. package/es/site/data/components/switch/demos/basic/react.js +0 -2
  150. package/es/site/data/components/switch/demos/disabled/index.d.ts +6 -0
  151. package/es/site/data/components/switch/demos/disabled/index.js +18 -0
  152. package/es/site/data/components/switch/demos/disabled/react.d.ts +5 -0
  153. package/es/site/data/components/switch/demos/disabled/react.js +27 -0
  154. package/es/site/data/components/switch/demos/onOff/react.js +13 -0
  155. package/es/site/data/components/tag/demos/border/index.js +1 -1
  156. package/es/site/data/components/tag/demos/border/react.js +1 -1
  157. package/es/site/data/components/upload/demos/manually/react.js +5 -7
  158. package/es/site/src/pages/document/index.js +3 -2
  159. package/es/site/src/pages/document/styles.js +1 -1
  160. package/es/styles/fonts/iconfont.eot +0 -0
  161. package/es/styles/fonts/iconfont.js +1 -1
  162. package/es/styles/fonts/iconfont.svg +189 -369
  163. package/es/styles/fonts/iconfont.ttf +0 -0
  164. package/es/styles/fonts/iconfont.woff +0 -0
  165. package/es/styles/theme.d.ts +10 -2
  166. package/es/styles/theme.js +23 -21
  167. package/i18n/en-US.ts +2 -1
  168. package/index.ts +2 -2
  169. package/package.json +4 -3
  170. package/styles/fonts/iconfont.css +172 -289
  171. package/styles/fonts/iconfont.eot +0 -0
  172. package/styles/fonts/iconfont.svg +189 -369
  173. package/styles/fonts/iconfont.ts +255 -369
  174. package/styles/fonts/iconfont.ttf +0 -0
  175. package/styles/fonts/iconfont.woff +0 -0
  176. package/styles/fonts/iconfont.woff2 +0 -0
  177. package/styles/theme.ts +23 -19
@@ -4,13 +4,41 @@ import { deepDefaults, sizes } from '../../styles/utils';
4
4
  import { theme, setDefault } from '../../styles/theme';
5
5
  import '../../styles/global';
6
6
  var defaults = {
7
+ get borderRadius() {
8
+ return theme.borderRadius;
9
+ },
10
+
11
+ get border() {
12
+ return "1px solid " + theme.color.border;
13
+ },
14
+
15
+ get hoverBorderColor() {
16
+ return theme.color.primary;
17
+ },
18
+
19
+ get hoverBtnBg() {
20
+ return theme.color.bg;
21
+ },
22
+
23
+ get disabledBorderColor() {
24
+ return theme.color.disabledBorder;
25
+ },
26
+
27
+ get disabledBg() {
28
+ return theme.color.disabledBg;
29
+ },
30
+
31
+ get disabledColor() {
32
+ return theme.color.disabled;
33
+ },
34
+
7
35
  default: {
8
36
  inputWidth: '46px',
9
- iconFontSize: '24px'
37
+ iconFontSize: '16px'
10
38
  },
11
39
  large: {
12
40
  inputWidth: '60px',
13
- iconFontSize: '32px'
41
+ iconFontSize: '24px'
14
42
  },
15
43
  small: {
16
44
  inputWidth: '32px',
@@ -42,9 +70,9 @@ setDefault(function () {
42
70
  }).spinner;
43
71
  });
44
72
  export function makeStyles() {
45
- return /*#__PURE__*/css("display:inline-block;vertical-align:middle;line-height:1;.k-spinner-btn{vertical-align:top;&:hover,&:focus{z-index:1;position:relative;}&.k-left{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-1px;}&.k-right{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px;}}.k-spinner-input{width:", spinner.default.inputWidth, ";vertical-align:top;.k-input-inner{text-align:center;padding:0;border-radius:0;}}.k-spinner-icon{font-size:", spinner.default.iconFontSize, ";}&.k-vertical{position:relative;font-size:0;", _mapInstanceProperty(sizes).call(sizes, function (size) {
73
+ return /*#__PURE__*/css("display:inline-block;vertical-align:middle;border:", spinner.border, ";border-radius:", spinner.borderRadius, ";&:hover{border-color:", spinner.hoverBorderColor, ";.k-spinner-btn{background:", spinner.hoverBtnBg, ";}.k-left{border-radius:", spinner.borderRadius, " 0 0 ", spinner.borderRadius, ";}.k-right{border-radius:0 ", spinner.borderRadius, " ", spinner.borderRadius, " 0;}}.k-spinner-input{width:", spinner.default.inputWidth, ";.k-input-inner{text-align:center;border:none;border-radius:0;&:hover,&:focus{border:none;}}}.k-spinner-icon{font-size:", spinner.default.iconFontSize, ";}&.k-vertical{position:relative;font-size:0;", _mapInstanceProperty(sizes).call(sizes, function (size) {
46
74
  var generate = function generate() {
47
- return "\n .k-spinner-input {\n padding-right: calc(" + theme[size].height + " - 1px);\n width: " + spinner.vertical[size].width + ";\n }\n ";
75
+ return "\n .k-spinner-input {\n padding-right: " + theme[size].height + ";\n width: " + spinner.vertical[size].width + ";\n }\n ";
48
76
  };
49
77
 
50
78
  if (size === 'default') {
@@ -52,7 +80,7 @@ export function makeStyles() {
52
80
  } else {
53
81
  return "\n &.k-" + size + " {\n " + generate() + "\n }\n ";
54
82
  }
55
- }), ";.k-spinner-btn{position:absolute;right:0;margin:0;height:calc(50% + 1px);line-height:50%;}.k-spinner-icon{line-height:50%!important;font-size:inherit!important;}.k-spinner-btn.k-left{bottom:0;border-radius:0 0 ", theme.borderRadius, " 0;}.k-spinner-btn.k-right{top:0;border-radius:0 ", theme.borderRadius, " 0 0;}.k-spinner-input{font-size:0;.k-input-inner{border-radius:", theme.borderRadius, " 0 0 ", theme.borderRadius, ";}}}&.k-disabled{.k-spinner-btn{&:hover,&:focus{z-index:0;}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
83
+ }), ";.k-spinner-btn{position:absolute;right:0;margin:0;height:calc(50% - 2px);line-height:50%;}.k-spinner-icon{font-size:inherit!important;}.k-spinner-btn.k-left{bottom:1px;border-radius:0 0 ", spinner.borderRadius, " 0;}.k-spinner-btn.k-right{top:1px;border-radius:0 ", spinner.borderRadius, " 0 0;}.k-spinner-input{font-size:0;.k-input-inner{border-radius:", spinner.borderRadius, " 0 0 ", spinner.borderRadius, ";}}}&.k-disabled{border-color:", spinner.disabledBorderColor, ";background:", spinner.disabledBg, ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
56
84
  var styles = spinner[size];
57
85
 
58
86
  var generate = function generate() {
@@ -2,8 +2,8 @@ import { Component, TypeDefs } from 'intact';
2
2
  export * from './step';
3
3
  export interface StepsProps {
4
4
  value?: number;
5
- status?: 'normal' | 'error';
6
- type?: 'default' | 'line' | 'simple';
5
+ status?: 'normal' | 'error' | 'done';
6
+ type?: 'default' | 'line' | 'simple' | 'line-compact' | 'dot';
7
7
  clickable?: boolean;
8
8
  }
9
9
  export declare class Steps extends Component<StepsProps> {
@@ -6,8 +6,8 @@ import { bind } from '../utils';
6
6
  export * from './step';
7
7
  var typeDefs = {
8
8
  value: Number,
9
- status: ['normal', 'error'],
10
- type: ['default', 'line', 'simple'],
9
+ status: ['normal', 'error', 'done'],
10
+ type: ['default', 'line', 'simple', 'line-compact', 'dot'],
11
11
  clickable: Boolean
12
12
  };
13
13
 
@@ -40,6 +40,7 @@ export default function ($props, $blocks, $__proto__) {
40
40
  value: value,
41
41
  status: status,
42
42
  width: width,
43
+ type: type,
43
44
  onChange: this.changeIndex
44
45
  },
45
46
  'children': _$cv('div', _extends({
@@ -2,8 +2,16 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import { createUnknownComponentVNode as _$cc, createVNode as _$cv, className as _$cn, createElementVNode as _$ce } from 'intact';
3
3
  import { linkEvent } from 'intact';
4
4
  import { getRestProps, addStyle } from '../utils';
5
- import { makeStepStyles } from './styles';
6
5
  import { context as StepsContext } from './context';
6
+ import { Icon } from '../icon';
7
+ var _$tmp0 = {
8
+ 'className': 'k-icon-close-big',
9
+ 'color': 'danger'
10
+ };
11
+ var _$tmp1 = {
12
+ 'className': 'k-icon-check',
13
+ 'color': 'primary'
14
+ };
7
15
  export default function ($props, $blocks, $__proto__) {
8
16
  var _this = this;
9
17
 
@@ -25,22 +33,23 @@ export default function ($props, $blocks, $__proto__) {
25
33
  var value = _ref.value,
26
34
  status = _ref.status,
27
35
  width = _ref.width,
28
- onChange = _ref.onChange;
36
+ onChange = _ref.onChange,
37
+ type = _ref.type;
29
38
  var selected = value === index;
30
39
  var error = selected && status === 'error';
40
+ var done = value > index;
31
41
  var classNameObj = (_classNameObj = {
32
42
  'k-step': true,
33
43
  'k-active': selected,
34
- 'k-done': value > index,
44
+ 'k-done': done,
35
45
  'k-error': error
36
- }, _classNameObj[className] = className, _classNameObj[makeStepStyles()] = true, _classNameObj);
46
+ }, _classNameObj[className] = className, _classNameObj);
37
47
  return _$cv('div', _extends({}, getRestProps(_this), {
38
48
  'className': _$cn(classNameObj),
39
- 'style': addStyle(style, {
40
- width: width
41
- }),
49
+ 'style': style
50
+ }), [_$ce(2, 'div', [_$ce(2, 'div', error && type !== 'simple' ? _$cc(Icon, _$tmp0) : done && (type === 'line' || type === 'line-compact') ? _$cc(Icon, _$tmp1) : type !== 'simple' ? _$ce(2, 'span', index + 1, 0) : undefined, 0, 'k-step-mark'), _$ce(2, 'div', [_$ce(2, 'div', title, 0, 'k-step-title'), _$ce(2, 'div', _children, 0, 'k-step-content')], 4, 'k-step-main')], 4, 'k-step-wrapper', {
42
51
  'ev-click': linkEvent(index, onChange)
43
- }), [_$ce(2, 'div', null, 1, 'k-step-tail'), _$ce(2, 'div', [_$ce(2, 'div', _$ce(2, 'div', error ? _$ce(2, 'i', null, 1, 'k-step-icon ion-ios-close-empty') : _$ce(2, 'span', index + 1, 0), 2, 'k-step-inner'), 2, 'k-step-head'), _$ce(2, 'div', [_$ce(2, 'div', title, 0, 'k-step-title'), _$ce(2, 'div', _children, 0, 'k-step-content')], 4, 'k-step-main')], 4, 'k-step-wrapper')]);
52
+ }), _$ce(2, 'div', null, 1, 'k-step-tail')]);
44
53
  }
45
54
  });
46
55
  }
@@ -1,3 +1,3 @@
1
1
  import '../../styles/global';
2
2
  export declare function makeStepsStyles(): string;
3
- export declare function makeStepStyles(): string;
3
+ export declare function makeCommonStyles(): string;
@@ -4,137 +4,116 @@ import { theme, setDefault } from '../../styles/theme';
4
4
  import { deepDefaults } from '../../styles/utils';
5
5
  import '../../styles/global';
6
6
  var defaults = {
7
- get transition() {
8
- return theme.transition.middle;
9
- },
7
+ gap: '10px',
10
8
 
11
- get height() {
12
- return theme.default.height;
9
+ get titleColor() {
10
+ return theme.color.title;
13
11
  },
14
12
 
15
- get bgColor() {
16
- return theme.color.bg;
13
+ get desColor() {
14
+ return theme.color.lightBlack;
17
15
  },
18
16
 
19
- gutter: '10px',
20
- gapTop: '-2px',
21
- // head
22
- head: {
23
- innerWidth: '16px',
24
-
25
- get innerBorder() {
26
- return "1px solid " + theme.color.placeholder;
27
- },
17
+ get markColor() {
18
+ return theme.color.placeholder;
19
+ },
28
20
 
29
- iconFontSize: '24px',
30
- paddingRight: '10px'
21
+ get markborder() {
22
+ return "1px solid " + theme.color.placeholder;
31
23
  },
32
- main: {
33
- get color() {
34
- return theme.color.text;
24
+
25
+ markBgColor: '#fff',
26
+ default: {
27
+ get height() {
28
+ return theme.default.height;
35
29
  },
36
30
 
37
- get titlePaddingRight() {
38
- return steps.head.paddingRight;
31
+ get bgColor() {
32
+ return theme.color.bg;
39
33
  },
40
34
 
41
- contentFontSize: '12px'
35
+ markWidth: '16px'
42
36
  },
43
37
  // done
44
38
  done: {
45
- get headColor() {
39
+ get markColor() {
46
40
  return theme.color.primary;
47
41
  },
48
42
 
49
- get headInnerBorderColor() {
43
+ get markBorderColor() {
50
44
  return theme.color.primary;
51
45
  },
52
46
 
53
- headInnerBgColor: 'transparent',
47
+ markBgColor: '#fff',
54
48
 
55
49
  get mainColor() {
56
50
  return theme.color.primary;
57
- },
58
-
59
- get simpleColor() {
60
- return theme.color.text;
61
51
  }
62
52
 
63
53
  },
64
54
  // active
65
55
  active: {
66
- headColor: '#fff',
56
+ markColor: '#fff',
67
57
 
68
- get headInnerBorderColor() {
58
+ get markBorderColor() {
69
59
  return theme.color.primary;
70
60
  },
71
61
 
72
- get headInnerBgColor() {
62
+ get markBgColor() {
73
63
  return theme.color.primary;
74
64
  },
75
65
 
76
66
  get mainColor() {
77
67
  return theme.color.primary;
78
- },
79
-
80
- get simpleColor() {
81
- return theme.color.primary;
82
68
  }
83
69
 
84
70
  },
85
71
  // error
86
72
  error: {
87
- get headColor() {
73
+ get markColor() {
88
74
  return theme.color.danger;
89
75
  },
90
76
 
91
- get headInnerBorderColor() {
77
+ get markBorderColor() {
92
78
  return theme.color.danger;
93
79
  },
94
80
 
95
- headInnerBgColor: 'transparent',
81
+ markBgColor: '#fff',
96
82
 
97
83
  get mainColor() {
98
84
  return theme.color.danger;
99
- },
100
-
101
- get simpleColor() {
102
- return theme.color.danger;
103
85
  }
104
86
 
105
87
  },
106
88
  // line
107
89
  line: {
108
- bgColor: '#fff',
109
- mainContentGap: '5px 0 0',
110
-
111
- get tailBgColor() {
112
- return theme.color.placeholder;
113
- },
90
+ markWidth: '32px',
91
+ markFontSize: '24px',
114
92
 
115
- get doneTailBgColor() {
116
- return theme.color.primary;
93
+ get lineColor() {
94
+ return theme.color.border;
117
95
  },
118
96
 
119
- innerWidth: '32px',
120
- innerLineHeight: '30px',
121
- innerFontSize: '18px',
122
- headTop: '16px',
123
- titleFontSize: '14px',
124
- titleGopTop: '16px',
125
- iconLineHeight: '30px',
126
- tailTop: '16px',
127
- width: '160px'
97
+ titleGap: '16px',
98
+ descGap: '4px',
99
+ contentMaxWidth: '200px'
128
100
  },
129
101
  // simple
130
102
  simple: {
131
- fontSize: '14px',
103
+ markWidth: '12px',
104
+
105
+ get markBgColor() {
106
+ return theme.color.placeholder;
107
+ },
132
108
 
133
- get color() {
134
- return theme.color.disabled;
109
+ get doneMarkBgColor() {
110
+ return theme.color.primary;
135
111
  },
136
112
 
137
- headPaddingRight: '6px'
113
+ get errorMarkBgColor() {
114
+ return theme.color.danger;
115
+ }
116
+
138
117
  }
139
118
  };
140
119
  var steps;
@@ -145,14 +124,40 @@ setDefault(function () {
145
124
  });
146
125
  var stepStatus = ['done', 'active', 'error'];
147
126
  export function makeStepsStyles() {
148
- return /*#__PURE__*/css("display:flex;&.k-default,&.k-line{", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
149
- var styles = steps[status];
150
- return /*#__PURE__*/css(".k-", status, "{.k-step-inner{color:", styles.headColor, ";border-color:", styles.headInnerBorderColor, "!important;background:", styles.headInnerBgColor, ";}.k-step-main{color:", styles.mainColor, ";}}");
151
- }), ";.k-step-head{padding-right:", steps.head.paddingRight, ";}.k-step-inner{width:", steps.head.innerWidth, ";height:", steps.head.innerWidth, ";line-height:calc(", steps.head.innerWidth, " - 2px);border-radius:50%;text-align:center;border:", steps.head.innerBorder, ";}.k-step-icon:before{line-height:calc(", steps.head.innerWidth, " - 2px);}.k-step-main{color:", steps.main.color, ";}.k-step-tail{position:absolute;}.k-step:last-of-type{.k-step-tail{display:none;}}}&.k-simple,&.k-default{text-align:center;height:", steps.height, ";line-height:", steps.height, ";overflow:hidden;.k-step-head,.k-step-main,.k-step-content,.k-step-inner{display:inline-block;}.k-step{white-space:nowrap;}.k-step-wrapper{overflow:hidden;}}&.k-default{background:", steps.bgColor, ";.k-step-tail{top:0;right:calc(-1 * (", steps.height, " / 2 + ", steps.gutter, "));width:calc(", steps.height, " / 2 + ", steps.gutter, ");height:", steps.height, ";overflow:hidden;z-index:1;&:after,&:before{content:'';border-width:calc(", steps.height, " / 2 + ", steps.gutter, ");border-style:solid;border-color:transparent;position:absolute;top:calc(-1 * ", steps.gutter, ");}&:after{border-left-color:", steps.bgColor, ";left:calc(-1 * ", steps.head.paddingRight, ");}&:before{border-left-color:", steps.line.bgColor, ";left:0;}}.k-step-head,.k-step-inner{vertical-align:middle;margin-top:", steps.gapTop, ";}.k-step:not(:first-of-type){padding-left:calc(", steps.height, " / 2 + ", steps.gutter, ");}}&.k-line{.k-step{width:auto!important;&:last-of-type{flex:0 0 auto;.k-step-wrapper{display:flex;}.k-step-title{padding-right:0;}}}.k-step-head{background:", steps.line.bgColor, ";position:relative;display:flex;padding:0;&:before,&:after{content:'';display:block;flex:1;height:1px;background:", theme.color.placeholder, ";top:", steps.line.headTop, ";position:relative;}}.k-step-inner{width:", steps.line.innerWidth, ";height:", steps.line.innerWidth, ";line-height:", steps.line.innerLineHeight, ";font-size:", steps.line.innerFontSize, ";}.k-step-main{position:relative;width:", steps.line.width, ";}.k-step-title{line-height:", steps.head.innerWidth, ";background:", steps.line.bgColor, ";font-size:", steps.line.titleFontSize, ";padding:0;margin-top:", steps.line.titleGopTop, ";}.k-step-content{margin:", steps.line.mainContentGap, ";}.k-step-tail{left:0;right:", steps.head.paddingRight, ";top:calc(", steps.head.innerWidth, " / 2);height:1px;background:", steps.line.tailBgColor, ";}.k-step:first-of-type .k-step-head:before,.k-step:last-of-type .k-step-head:after{background:transparent;}.k-done{.k-step-tail{background:", steps.line.doneTailBgColor, ";}.k-step-head{&:before,&:after{background:", theme.color.primary, ";}}}.k-active{.k-step-head{&:before{background:", theme.color.primary, ";}}}.k-step-icon:before{line-height:", steps.line.iconLineHeight, ";}.k-step-wrapper{display:inline-block!important;text-align:center;}.k-step-tail{right:0;top:", steps.line.tailTop, ";}}&.k-simple{font-size:", steps.simple.fontSize, ";", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
152
- var styles = steps[status];
153
- return /*#__PURE__*/css(".k-", status, "{.k-step-main,.k-step-inner{color:", styles.simpleColor, ";}}");
154
- }), ";.k-step,.k-step-main{color:", steps.simple.color, ";}.k-step-head{padding-right:", steps.simple.headPaddingRight, ";vertical-align:top;}}&.k-clickable{.k-done{cursor:pointer;}}");
127
+ return /*#__PURE__*/css("display:flex;", makeCommonStyles(), ";&.k-default{", makeDefaultStyles(), ";}&.k-line,&.k-line-compact,&.k-simple{", makeLineStyles(), ";}&.k-line-compact{", makeLineCompactStyles(), ";}&.k-simple{", makeSimpleStyles(), ";}&.k-clickable{.k-done{cursor:pointer;}}");
128
+ }
129
+
130
+ function makeDefaultStyles() {
131
+ var defaults = steps.default;
132
+ return /*#__PURE__*/css("text-align:center;height:", defaults.height, ";background:", defaults.bgColor, ";.k-step-wrapper{", center(), ";height:100%;}.k-step-mark{width:", defaults.markWidth, ";height:", defaults.markWidth, ";margin-right:", steps.gap, ";}.k-step-main{display:flex;overflow:hidden;white-space:nowrap;}.k-step-title{padding-right:", steps.gap, ";}.k-step:last-of-type{.k-step-tail{display:none;}}.k-step-tail{position:absolute;top:0;right:calc(-1 * (", defaults.height, " / 2 + ", steps.gap, "));width:calc(", defaults.height, " / 2 + ", steps.gap, ");height:", defaults.height, ";overflow:hidden;z-index:1;&:after,&:before{content:'';border-width:calc(", defaults.height, " / 2 + ", steps.gap, ");border-style:solid;border-color:transparent;position:absolute;top:calc(-1 * ", steps.gap, ");}&:after{border-left-color:", defaults.bgColor, ";left:calc(-1 * ", steps.gap, ");}&:before{border-left-color:#fff;left:0;}}.k-step:not(:first-of-type){padding-left:calc(", defaults.height, " / 2 + ", steps.gap, ");}");
133
+ }
134
+
135
+ function makeLineStyles() {
136
+ var line = defaults.line;
137
+ return /*#__PURE__*/css(".k-step{display:flex;}.k-step-wrapper{display:inline-block;text-align:center;position:relative;}.k-step:last-of-type{flex:0 0 auto;}.k-step-mark{width:", line.markWidth, ";height:", line.markWidth, ";position:relative;z-index:1;&,.k-icon{font-size:", line.markFontSize, ";}}.k-step-main{padding-top:", line.titleGap, ";}.k-step-title{font-size:14px;color:", theme.color.text, ";}.k-step-content{margin-top:", line.descGap, ";color:", theme.color.placeholder, ";max-width:", line.contentMaxWidth, ";}.k-step-wrapper{&:before,&:after{content:'';display:block;height:1px;background:", line.lineColor, ";width:50%;position:absolute;top:calc(", line.markWidth, " / 2);}&:after{right:0;}}.k-step{&:first-of-type .k-step-wrapper:before,&:last-of-type .k-step-wrapper:after{background:transparent;}}.k-step-tail{flex:1;height:1px;background:", line.lineColor, ";margin-top:calc(", line.markWidth, " / 2);}.k-step{&.k-done{.k-step-tail,&:not(:last-of-type) .k-step-wrapper:after,&:not(:first-of-type) .k-step-wrapper:before{background:", theme.color.primary, ";}}&:not(:first-of-type).k-active{.k-step-wrapper:before{background:", theme.color.primary, ";}}&.k-active .k-step-title{color:", theme.color.primary, ";}&.k-error .k-step-title{color:", theme.color.danger, ";}}");
155
138
  }
156
- export function makeStepStyles() {
157
- return /*#__PURE__*/css("position:relative;flex:1;.k-step-icon:before{font-size:", steps.head.iconFontSize, ";}.k-step-title{display:inline-block;padding-right:", steps.main.titlePaddingRight, ";white-space:nowrap;}.k-step-content{font-size:", steps.main.contentFontSize, ";}.k-step-inner,.k-step-main{transition:all ", steps.transition, ";}");
139
+
140
+ function makeLineCompactStyles() {
141
+ var line = defaults.line;
142
+ return /*#__PURE__*/css(".k-step-wrapper{display:inline-flex;text-align:left;&:before,&:after{display:none;}}.k-step-main{flex:1;padding:0 0 0 ", line.titleGap, ";}.k-step-content{margin:0;}.k-step-tail{margin-right:", line.titleGap, ";}.k-step-title{display:flex;align-items:center;height:", line.markWidth, ";&:after{content:'';display:block;flex:1;height:1px;background:", line.lineColor, ";margin-left:", line.titleGap, ";}}.k-step:last-of-type .k-step-title:after{display:none;}.k-step{&.k-done{.k-step-title:after{background:", theme.color.primary, ";}}}");
143
+ }
144
+
145
+ function makeSimpleStyles() {
146
+ var simple = defaults.simple;
147
+ return /*#__PURE__*/css(".k-step-mark{width:", simple.markWidth, ";height:", simple.markWidth, ";background:", simple.markBgColor, ";}.k-step-wrapper{font-size:0;&:before,&:after{top:calc(", simple.markWidth, " / 2);}}.k-step-main{font-size:", theme.default.fontSize, ";}.k-step-tail{margin-top:calc(", simple.markWidth, " / 2);}.k-step{&.k-done{.k-step-mark{background:", simple.doneMarkBgColor, ";}}&.k-error{.k-step-mark{background:", simple.errorMarkBgColor, ";}}}");
148
+ }
149
+
150
+ function center(flex) {
151
+ if (flex === void 0) {
152
+ flex = 'flex';
153
+ }
154
+
155
+ return /*#__PURE__*/css("display:", flex, ";align-items:center;justify-content:center;");
156
+ }
157
+
158
+ export function makeCommonStyles() {
159
+ return /*#__PURE__*/css(".k-step{position:relative;flex:1;", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
160
+ var styles = steps[status];
161
+ return /*#__PURE__*/css("&.k-", status, "{.k-step-mark{color:", styles.markColor, ";border-color:", styles.markBorderColor, ";background:", styles.markBgColor, ";}.k-step-main{color:", styles.mainColor, ";}}");
162
+ }), ";}.k-step-mark{", center('inline-flex'), ";border:", steps.markborder, ";border-radius:50%;vertical-align:top;color:", steps.markColor, ";background:", steps.markBgColor, ";}");
158
163
  }
@@ -1,68 +1,54 @@
1
1
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
2
2
  import { css } from '@emotion/css';
3
3
  import { theme, setDefault } from '../../styles/theme';
4
- import { deepDefaults, sizes } from '../../styles/utils';
4
+ import { deepDefaults, sizes, palette } from '../../styles/utils';
5
5
  import '../../styles/global';
6
6
  var defaults = {
7
7
  get transition() {
8
8
  return theme.transition.middle;
9
9
  },
10
10
 
11
- bgColor: "#fff",
12
- fontSize: "12px",
13
-
14
- get color() {
15
- return theme.color.text;
16
- },
17
-
18
- checkedBgColor: "#fff",
19
- handleBorderRadius: "100%",
20
-
21
- get handleBgColor() {
11
+ get bgColor() {
22
12
  return theme.color.border;
23
13
  },
24
14
 
25
- get border() {
26
- return "1px solid " + theme.color.border;
27
- },
28
-
15
+ fontSize: "12px",
16
+ color: '#fff',
17
+ handleBorderRadius: "100%",
18
+ handleBgColor: '#fff',
29
19
  // checked
30
20
  checked: {
31
- get borderColor() {
32
- return theme.color.primary;
33
- },
34
-
35
- get color() {
21
+ get bgColor() {
36
22
  return theme.color.primary;
37
23
  },
38
24
 
39
- get bgColor() {
40
- return theme.color.primary;
25
+ get disabledBgColor() {
26
+ return palette(theme.color.primary, -3);
41
27
  }
42
28
 
43
29
  },
44
30
  // default
45
31
  default: {
46
- width: "36px",
47
- height: "18px",
48
- padding: "2px"
32
+ width: "45px",
33
+ height: "24px",
34
+ padding: "3px"
49
35
  },
50
36
  // large
51
37
  large: {
52
- width: "52px",
53
- height: "26px",
54
- padding: "2px"
38
+ width: "58px",
39
+ height: "30px",
40
+ padding: "3px"
55
41
  },
56
42
  // small
57
43
  small: {
58
- width: "32px",
44
+ width: "30px",
59
45
  height: "16px",
60
46
  padding: "2px"
61
47
  },
62
48
  // mini
63
49
  mini: {
64
- width: "24px",
65
- height: "12px",
50
+ width: "18px",
51
+ height: "10px",
66
52
  padding: "1px"
67
53
  },
68
54
 
@@ -79,11 +65,11 @@ setDefault(function () {
79
65
  }).switch;
80
66
  });
81
67
  export function makeStyles() {
82
- return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;border:", kswitch.border, ";box-sizing:content-box;input{opacity:0;position:absolute;}.k-switch-bar,.k-switch-off{box-sizing:border-box;}.k-switch-bar{position:absolute;text-align:right;overflow:hidden;}.k-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.k-switch-bar,.k-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}.k-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.k-switch-on,.k-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.k-dragging{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checkedBgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;border-color:", kswitch.checked.borderColor, ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
68
+ return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;box-sizing:content-box;input{opacity:0;position:absolute;}.k-switch-bar,.k-switch-off{box-sizing:border-box;}.k-switch-bar{position:absolute;text-align:right;overflow:hidden;}.k-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.k-switch-bar,.k-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}.k-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.k-switch-on,.k-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.k-dragging{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.bgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
83
69
  var _kswitch$size = kswitch[size],
84
70
  width = _kswitch$size.width,
85
71
  height = _kswitch$size.height,
86
72
  padding = _kswitch$size.padding;
87
73
  return /*#__PURE__*/css("&.k-", size, ",&.k-", size, " .k-switch-on,&.k-", size, " .k-switch-off{width:", width, ";height:", height, ";}&.k-", size, "{border-radius:", height, ";.k-switch-bar{width:", height, ";border-radius:", height, ";}.k-switch-wrapper{padding:", padding, ";}.k-switch-on,.k-switch-off{line-height:", height, ";left:0;}.k-switch-on{padding:0 ", height, " 0 calc(", height, " / 3);}.k-switch-off{padding:0 calc(", height, " / 3) 0 ", height, ";}}");
88
- }), "&.k-checked{border-color:", kswitch.checked.borderColor, ";.k-switch-on{color:", kswitch.checked.color, ";}.k-switch-handle{background:", kswitch.checked.bgColor, ";}.k-switch-bar,.k-switch-wrapper{background:", kswitch.checkedBgColor, ";}.k-switch-bar{width:100%;}}&.k-disabled{background:", kswitch.disabledBgColor, ";cursor:not-allowed;.k-switch-bar,.k-switch-wrapper{background:", kswitch.disabledBgColor, ";}}&:not(.k-checked){.k-switch-bar,.k-switch-wrapper{border-top-right-radius:0;border-bottom-right-radius:0;}}");
74
+ }), "&.k-checked{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.bgColor, ";}.k-switch-bar{width:100%;}}&.k-disabled{&,.k-switch-handle{cursor:not-allowed;}&,.k-switch-bar,.k-switch-wrapper{background:", kswitch.disabledBgColor, ";}&.k-checked{&,.k-switch-bar,.k-switch-wrapper{background:", kswitch.checked.disabledBgColor, ";}}}");
89
75
  }
@@ -1,5 +1,5 @@
1
1
  import _sortInstanceProperty from "@babel/runtime-corejs3/core-js/instance/sort";
2
- import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, noop as _$no, className as _$cn, map as _$ma } from 'intact';
2
+ import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, noop as _$no, className as _$cn, extend as _$ex, EMPTY_OBJ as _$em, map as _$ma } from 'intact';
3
3
  import { getClassAndStyleForFixed } from './useFixedColumns';
4
4
  import { Dropdown, DropdownMenu, DropdownItem } from '../dropdown';
5
5
  import { Button } from '../button';
@@ -14,13 +14,18 @@ import { context as TableContext } from './useColumns';
14
14
  import { context as ResizableContext } from './useResizable';
15
15
  import { context as FixedColumnsContext } from './useFixedColumns';
16
16
  import { stopPropagation } from '../utils';
17
+ import { Input } from '../input';
18
+ import { _$ } from '../../i18n';
17
19
  var _$tmp0 = {
18
20
  'className': 'ion-android-arrow-dropdown'
19
21
  };
20
22
  var _$tmp1 = {
21
- 'className': 'ion-android-arrow-dropup k-asc'
23
+ 'className': 'ion-ios-search'
22
24
  };
23
25
  var _$tmp2 = {
26
+ 'className': 'ion-android-arrow-dropup k-asc'
27
+ };
28
+ var _$tmp3 = {
24
29
  'className': 'ion-android-arrow-dropdown k-desc'
25
30
  };
26
31
  export default function ($props, $blocks, $__proto__) {
@@ -45,7 +50,9 @@ export default function ($props, $blocks, $__proto__) {
45
50
  var _this$group = this.group,
46
51
  onSelect = _this$group.onSelect,
47
52
  isChecked = _this$group.isChecked,
48
- getGroupText = _this$group.getGroupText;
53
+ getGroupText = _this$group.getGroupText,
54
+ keywords = _this$group.keywords,
55
+ filteredGroup = _this$group.filteredGroup;
49
56
  return _$cc(TableContext.Consumer, {
50
57
  'children': function children(checkType) {
51
58
  return _$cc(GroupContext.Consumer, {
@@ -98,17 +105,46 @@ export default function ($props, $blocks, $__proto__) {
98
105
  collision: 'flipfit'
99
106
  },
100
107
  'key': 'dropdown',
108
+ 'trigger': 'click',
109
+ 'ev-show': function evShow() {
110
+ return keywords.set('');
111
+ },
101
112
  'children': [_$cc(Button, {
102
113
  'icon': true,
103
114
  'size': 'mini',
104
115
  'className': 'k-table-group',
105
- 'ev-click': stopPropagation,
116
+ 'ev-click': function evClick(e) {
117
+ return e._ignoreSortable = true;
118
+ },
106
119
  'children': _$cc(Icon, _$tmp0)
107
120
  }), _$cc(DropdownMenu, {
108
121
  'className': _$cn((_$cn2 = {
109
122
  "k-table-group-dropdown": true
110
123
  }, _$cn2[makeGroupMenuStyles()] = true, _$cn2)),
111
- 'children': _$ma(group, function ($value, $key) {
124
+ 'children': [_$ce(2, 'div', _$cc(Input, {
125
+ 'size': 'small',
126
+ 'fluid': true,
127
+ 'placeholder': _$('请输入关键字'),
128
+ 'value': keywords.value,
129
+ 'ev-$change:value': keywords.set,
130
+ 'clearable': true,
131
+ '$blocks': function ($blocks) {
132
+ var _$blocks = {},
133
+ __$blocks = _$ex({}, $blocks);
134
+
135
+ return (_$blocks['suffix'] = function ($super) {
136
+ return _$cc(Icon, _$tmp1);
137
+ }, __$blocks['suffix'] = function ($super, data) {
138
+ var block = $blocks['suffix'];
139
+
140
+ var callBlock = function callBlock() {
141
+ return _$blocks['suffix'].call($this, $super, data);
142
+ };
143
+
144
+ return block ? block.call($this, callBlock, data) : callBlock();
145
+ }), __$blocks;
146
+ }.call($this, _$em)
147
+ }), 2, 'k-table-group-header'), _$ce(2, 'div', _$ma(filteredGroup.value, function ($value, $key) {
112
148
  return _$cc(DropdownItem, {
113
149
  'ev-select': function evSelect() {
114
150
  return onSelect($value.value, groupValue, onChange);
@@ -122,9 +158,9 @@ export default function ($props, $blocks, $__proto__) {
122
158
  'children': $value.label
123
159
  }) : _$ce(2, 'span', $value.label, 0)
124
160
  });
125
- }, $this)
161
+ }, $this), 4, 'k-table-group-body')]
126
162
  })]
127
- }, 'dropdown') : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, _$tmp1), _$cc(Icon, _$tmp2)], 4, _$cn((_$cn3 = {
163
+ }, 'dropdown') : undefined, sortable ? _$ce(2, 'div', [_$cc(Icon, _$tmp2), _$cc(Icon, _$tmp3)], 4, _$cn((_$cn3 = {
128
164
  'k-column-sort': true
129
165
  }, _$cn3["k-" + type] = type, _$cn3))) : undefined], 0, 'k-table-title')], 0, _$cn(classNameObj), {
130
166
  'style': style,
@@ -352,7 +352,7 @@ describe('Table', function () {
352
352
  _instance$refs4 = instance.refs, __test1 = _instance$refs4.__test1, __test2 = _instance$refs4.__test2;
353
353
  _element$querySelecto8 = element.querySelectorAll('.k-table'), table1 = _element$querySelecto8[0], table2 = _element$querySelecto8[1];
354
354
  icon = table1.querySelector('.k-table-group');
355
- dispatchEvent(icon, 'mouseenter');
355
+ dispatchEvent(icon, 'click');
356
356
  _context7.next = 7;
357
357
  return wait();
358
358
 
@@ -370,7 +370,7 @@ describe('Table', function () {
370
370
  });
371
371
  expect(table1.innerHTML).to.matchSnapshot();
372
372
  icon2 = table2.querySelector('.k-table-group');
373
- dispatchEvent(icon2, 'mouseenter');
373
+ dispatchEvent(icon2, 'click');
374
374
  _context7.next = 19;
375
375
  return wait();
376
376