@king-design/react 3.0.0-beta.0 → 3.0.0-beta.1

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 (202) hide show
  1. package/__tests__/__snapshots__/Dialog.md +1 -1
  2. package/__tests__/__snapshots__/React Demos.md +461 -309
  3. package/__tests__/components/cascader.spec.tsx +53 -0
  4. package/__tests__/components/drawer.spec.tsx +67 -5
  5. package/components/button/index.d.ts +1 -1
  6. package/components/button/index.js +1 -1
  7. package/components/button/styles.js +1 -1
  8. package/components/cascader/index.d.ts +22 -11
  9. package/components/cascader/index.js +9 -12
  10. package/components/cascader/index.spec.js +81 -0
  11. package/components/cascader/index.vdt.js +10 -8
  12. package/components/cascader/styles.js +1 -1
  13. package/components/cascader/useFields.d.ts +2 -0
  14. package/components/cascader/useFields.js +18 -0
  15. package/components/cascader/useFilterable.d.ts +2 -1
  16. package/components/cascader/useFilterable.js +17 -6
  17. package/components/cascader/useLabel.d.ts +2 -1
  18. package/components/cascader/useLabel.js +4 -4
  19. package/components/cascader/useLoad.d.ts +2 -1
  20. package/components/cascader/useLoad.js +9 -7
  21. package/components/colorpicker/index.d.ts +2 -0
  22. package/components/colorpicker/index.js +7 -2
  23. package/components/colorpicker/index.vdt.js +3 -6
  24. package/components/copy/index.d.ts +17 -0
  25. package/components/copy/index.js +43 -0
  26. package/components/copy/index.spec.d.ts +1 -0
  27. package/components/copy/index.spec.js +52 -0
  28. package/components/copy/index.vdt.js +45 -0
  29. package/components/copy/styles.d.ts +2 -0
  30. package/components/copy/styles.js +14 -0
  31. package/components/copy/useCopy.d.ts +4 -0
  32. package/components/copy/useCopy.js +90 -0
  33. package/components/datepicker/index.spec.js +1 -1
  34. package/components/datepicker/index.vdt.js +1 -1
  35. package/components/datepicker/styles.js +1 -1
  36. package/components/diagram/shapes/callout.d.ts +1 -1
  37. package/components/diagram/shapes/circle.d.ts +1 -1
  38. package/components/diagram/shapes/document.d.ts +1 -1
  39. package/components/diagram/shapes/ellipse.d.ts +1 -1
  40. package/components/diagram/shapes/hexagon.d.ts +1 -1
  41. package/components/diagram/shapes/image.d.ts +1 -1
  42. package/components/diagram/shapes/parallelogram.d.ts +1 -1
  43. package/components/diagram/shapes/rectangle.d.ts +1 -1
  44. package/components/diagram/shapes/square.d.ts +1 -1
  45. package/components/diagram/shapes/text.d.ts +1 -1
  46. package/components/dialog/alert.vdt.js +6 -5
  47. package/components/dialog/index.spec.js +6 -6
  48. package/components/dropdown/dropdown.d.ts +6 -6
  49. package/components/dropdown/dropdown.js +58 -75
  50. package/components/dropdown/index.spec.js +96 -17
  51. package/components/dropdown/item.d.ts +1 -1
  52. package/components/dropdown/item.js +19 -7
  53. package/components/dropdown/menu.js +1 -1
  54. package/components/dropdown/usePosition.js +11 -2
  55. package/components/editable/index.d.ts +1 -0
  56. package/components/editable/index.js +20 -6
  57. package/components/editable/index.vdt.js +2 -1
  58. package/components/form/index.spec.js +4 -2
  59. package/components/form/item.vdt.js +2 -1
  60. package/components/form/styles.js +4 -4
  61. package/components/grid/useGutter.js +8 -8
  62. package/components/input/index.d.ts +11 -2
  63. package/components/input/index.js +13 -13
  64. package/components/input/index.spec.js +169 -1
  65. package/components/input/index.vdt.js +28 -7
  66. package/components/input/styles.js +20 -3
  67. package/components/input/useAutoRows.d.ts +2 -0
  68. package/components/input/useAutoRows.js +79 -0
  69. package/components/input/useAutoWidth.js +13 -3
  70. package/components/input/useShowPassword.d.ts +7 -0
  71. package/components/input/useShowPassword.js +31 -0
  72. package/components/menu/index.spec.js +26 -15
  73. package/components/menu/item.d.ts +2 -0
  74. package/components/menu/item.js +5 -0
  75. package/components/pagination/index.d.ts +1 -1
  76. package/components/pagination/index.js +3 -2
  77. package/components/pagination/index.spec.js +49 -0
  78. package/components/pagination/index.vdt.js +8 -10
  79. package/components/pagination/styles.js +1 -1
  80. package/components/popover/content.d.ts +19 -0
  81. package/components/popover/content.js +31 -0
  82. package/components/popover/content.vdt.js +68 -0
  83. package/components/popover/index.d.ts +16 -0
  84. package/components/popover/index.js +44 -0
  85. package/components/popover/index.spec.d.ts +1 -0
  86. package/components/popover/index.spec.js +195 -0
  87. package/components/popover/styles.d.ts +1 -0
  88. package/components/popover/styles.js +22 -0
  89. package/components/portal.d.ts +6 -2
  90. package/components/portal.js +4 -3
  91. package/components/position.js +2 -1
  92. package/components/progress/index.js +1 -1
  93. package/components/progress/index.vdt.js +46 -8
  94. package/components/progress/styles.js +19 -13
  95. package/components/rate/styles.js +1 -1
  96. package/components/select/base.d.ts +7 -3
  97. package/components/select/base.js +9 -3
  98. package/components/select/base.vdt.js +46 -35
  99. package/components/select/index.spec.js +2 -2
  100. package/components/select/menu.vdt.js +1 -1
  101. package/components/select/styles.js +11 -5
  102. package/components/select/useDraggble.d.ts +2 -0
  103. package/components/select/useDraggble.js +11 -0
  104. package/components/select/useNowrap.d.ts +3 -0
  105. package/components/select/useNowrap.js +19 -0
  106. package/components/slider/index.spec.js +48 -9
  107. package/components/slider/index.vdt.js +23 -12
  108. package/components/slider/styles.js +23 -14
  109. package/components/slider/useValue.d.ts +3 -1
  110. package/components/slider/useValue.js +12 -0
  111. package/components/spinner/index.d.ts +0 -1
  112. package/components/spinner/index.js +1 -19
  113. package/components/spinner/index.vdt.js +9 -4
  114. package/components/spinner/useChange.d.ts +1 -1
  115. package/components/spinner/useChange.js +2 -2
  116. package/components/spinner/useValue.d.ts +1 -0
  117. package/components/spinner/useValue.js +16 -1
  118. package/components/split/index.vdt.js +32 -20
  119. package/components/split/memo.d.ts +9 -0
  120. package/components/split/memo.js +26 -0
  121. package/components/steps/index.d.ts +1 -0
  122. package/components/steps/index.js +2 -1
  123. package/components/steps/index.spec.js +1 -1
  124. package/components/steps/index.vdt.js +7 -4
  125. package/components/steps/step.vdt.js +0 -1
  126. package/components/steps/styles.d.ts +1 -0
  127. package/components/steps/styles.js +45 -16
  128. package/components/switch/index.spec.js +82 -65
  129. package/components/table/cell.js +1 -6
  130. package/components/table/index.spec.js +130 -19
  131. package/components/table/row.d.ts +1 -1
  132. package/components/table/row.js +2 -1
  133. package/components/table/styles.js +1 -1
  134. package/components/table/table.d.ts +15 -0
  135. package/components/table/table.js +16 -7
  136. package/components/table/table.vdt.js +20 -6
  137. package/components/table/useChecked.d.ts +3 -2
  138. package/components/table/useChecked.js +23 -12
  139. package/components/table/useDisableRow.d.ts +2 -1
  140. package/components/table/useDisableRow.js +4 -4
  141. package/components/table/useDraggable.d.ts +3 -2
  142. package/components/table/useDraggable.js +11 -15
  143. package/components/table/useGroup.js +3 -0
  144. package/components/table/useMerge.d.ts +2 -1
  145. package/components/table/useMerge.js +5 -4
  146. package/components/table/usePagination.d.ts +8 -0
  147. package/components/table/usePagination.js +81 -0
  148. package/components/table/useStickyScrollbar.js +2 -2
  149. package/components/table/useTree.d.ts +2 -1
  150. package/components/table/useTree.js +3 -4
  151. package/components/table/useWidth.js +2 -2
  152. package/components/tabs/index.d.ts +1 -1
  153. package/components/tabs/index.js +1 -1
  154. package/components/tabs/index.spec.js +67 -0
  155. package/components/tabs/index.vdt.js +4 -4
  156. package/components/tabs/styles.js +32 -34
  157. package/components/tabs/useScroll.d.ts +1 -1
  158. package/components/tabs/useScroll.js +75 -48
  159. package/components/tag/base.d.ts +1 -0
  160. package/components/tag/base.js +1 -1
  161. package/components/tag/index.d.ts +1 -0
  162. package/components/tag/index.js +2 -1
  163. package/components/tag/index.spec.js +147 -4
  164. package/components/tag/styles.d.ts +67 -0
  165. package/components/tag/styles.js +33 -8
  166. package/components/tag/tags.d.ts +27 -0
  167. package/components/tag/tags.js +51 -0
  168. package/components/tag/tags.vdt.js +79 -0
  169. package/components/tag/useChildren.d.ts +2 -0
  170. package/components/tag/useChildren.js +39 -0
  171. package/components/tag/useDraggable.d.ts +3 -0
  172. package/components/tag/useDraggable.js +89 -0
  173. package/components/tag/useNowrap.d.ts +7 -0
  174. package/components/tag/useNowrap.js +115 -0
  175. package/components/timepicker/index.spec.js +1 -1
  176. package/components/tooltip/content.d.ts +3 -2
  177. package/components/tooltip/content.js +18 -1
  178. package/components/tooltip/content.vdt.js +22 -10
  179. package/components/tooltip/index.spec.js +147 -92
  180. package/components/tooltip/styles.d.ts +23 -0
  181. package/components/tooltip/styles.js +2 -2
  182. package/components/tooltip/tooltip.d.ts +1 -1
  183. package/components/tooltip/tooltip.js +11 -11
  184. package/components/upload/index.spec.js +5 -6
  185. package/components/upload/index.vdt.js +3 -1
  186. package/components/utils.d.ts +2 -0
  187. package/components/utils.js +24 -3
  188. package/components/virtual.d.ts +8 -0
  189. package/components/virtual.js +126 -0
  190. package/hooks/useResizeObserver.d.ts +1 -1
  191. package/hooks/useResizeObserver.js +19 -6
  192. package/i18n/en-US.d.ts +4 -1
  193. package/i18n/en-US.js +6 -2
  194. package/index.d.ts +5 -3
  195. package/index.js +5 -3
  196. package/package.json +2 -2
  197. package/styles/fonts/iconfont.js +1 -1
  198. package/styles/fonts/ionicons.js +3 -3
  199. package/styles/global.js +1 -1
  200. package/yarn-error.log +41 -43
  201. package/components/table/useResizeObserver.d.ts +0 -2
  202. package/components/table/useResizeObserver.js +0 -20
@@ -7,6 +7,7 @@ export declare function useValue(getStep: NormalizedGetStep, formatter: ReturnTy
7
7
  valueString: string;
8
8
  value: number;
9
9
  };
10
+ onInput: (e: InputEvent) => void;
10
11
  };
11
12
  /**
12
13
  * return max min or multiple by step
@@ -1,4 +1,5 @@
1
1
  import _Number$isNaN from "@babel/runtime-corejs3/core-js/number/is-nan";
2
+ import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
2
3
  import { useInstance } from 'intact-react';
3
4
  import { useReceive } from '../../hooks/useReceive';
4
5
  import { error, isNullOrUndefined, isString } from 'intact-shared';
@@ -63,12 +64,26 @@ export function useValue(getStep, formatter) {
63
64
  valueString: valueString,
64
65
  value: value
65
66
  };
67
+ } // we need change value as long as the input is valid, #213
68
+
69
+
70
+ function onInput(e) {
71
+ var val = e.target.value;
72
+
73
+ var _getFixedValue2 = getFixedValue(_trimInstanceProperty(val).call(val), instance.get('value')),
74
+ value = _getFixedValue2.value;
75
+
76
+ showValue.set(val);
77
+ instance.set({
78
+ value: value
79
+ });
66
80
  }
67
81
 
68
82
  return {
69
83
  showValue: showValue,
70
84
  fixValue: fixValue,
71
- getFixedValue: getFixedValue
85
+ getFixedValue: getFixedValue,
86
+ onInput: onInput
72
87
  };
73
88
  }
74
89
  /**
@@ -1,6 +1,9 @@
1
- import { createElementVNode as _$ce, noop as _$no, className as _$cn } from 'intact-react';
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, createUnknownComponentVNode as _$cc, noop as _$no } from 'intact-react';
2
3
  import { makeStyles } from './style';
3
4
  import { kls } from './style';
5
+ import { MemoBlock } from './memo';
6
+ import { getRestProps } from '../utils';
4
7
  export default function ($props, $blocks, $__proto__) {
5
8
  var _classNameObj, _style, _style2;
6
9
 
@@ -26,17 +29,23 @@ export default function ($props, $blocks, $__proto__) {
26
29
  'k-split': true
27
30
  }, _classNameObj["k-" + mode] = true, _classNameObj[makeStyles()] = true, _classNameObj['k-first-auto'] = firstSize.value === 'auto', _classNameObj['k-last-auto'] = lastSize.value === 'auto', _classNameObj['k-resizing'] = dragging.value, _classNameObj);
28
31
  var stylePropName = mode === 'horizontal' ? 'width' : 'height';
29
- return _$ce(2, 'div', [_$ce(2, 'div', (_$blocks['first'] = function ($super) {
30
- return null;
31
- }, __$blocks['first'] = function ($super, data) {
32
- var block = $blocks['first'];
32
+ return _$cv('div', _extends({
33
+ 'className': _$cn(classNameObj),
34
+ 'ref': elementRef
35
+ }, getRestProps(this)), [_$ce(2, 'div', _$cc(MemoBlock, {
36
+ 'block': $blocks.first,
37
+ 'children': (_$blocks['first'] = function ($super) {
38
+ return null;
39
+ }, __$blocks['first'] = function ($super, data) {
40
+ var block = $blocks['first'];
33
41
 
34
- var callBlock = function callBlock() {
35
- return _$blocks['first'].call($this, $super, data);
36
- };
42
+ var callBlock = function callBlock() {
43
+ return _$blocks['first'].call($this, $super, data);
44
+ };
37
45
 
38
- return block ? block.call($this, callBlock, data) : callBlock();
39
- }, __$blocks['first'](_$no)), 0, _$cn(kls('first')), {
46
+ return block ? block.call($this, callBlock, data) : callBlock();
47
+ }, __$blocks['first'](_$no))
48
+ }), 2, _$cn(kls('first')), {
40
49
  'style': (_style = {}, _style[stylePropName] = firstSize.value, _style)
41
50
  }, null, firstRef), _$ce(2, 'div', (_$blocks['drag'] = function ($super) {
42
51
  return _$ce(2, 'div', _$ce(2, 'div', null, 1, _$cn(kls('drag-lines'))), 2, _$cn(kls('line')));
@@ -50,18 +59,21 @@ export default function ($props, $blocks, $__proto__) {
50
59
  return block ? block.call($this, callBlock, data) : callBlock();
51
60
  }, __$blocks['drag'](_$no)), 0, _$cn(kls('line-wrapper')), {
52
61
  'ev-mousedown': start
53
- }), _$ce(2, 'div', (_$blocks['last'] = function ($super) {
54
- return null;
55
- }, __$blocks['last'] = function ($super, data) {
56
- var block = $blocks['last'];
62
+ }), _$ce(2, 'div', _$cc(MemoBlock, {
63
+ 'block': $blocks.last,
64
+ 'children': (_$blocks['last'] = function ($super) {
65
+ return null;
66
+ }, __$blocks['last'] = function ($super, data) {
67
+ var block = $blocks['last'];
57
68
 
58
- var callBlock = function callBlock() {
59
- return _$blocks['last'].call($this, $super, data);
60
- };
69
+ var callBlock = function callBlock() {
70
+ return _$blocks['last'].call($this, $super, data);
71
+ };
61
72
 
62
- return block ? block.call($this, callBlock, data) : callBlock();
63
- }, __$blocks['last'](_$no)), 0, _$cn(kls('last')), {
73
+ return block ? block.call($this, callBlock, data) : callBlock();
74
+ }, __$blocks['last'](_$no))
75
+ }), 2, _$cn(kls('last')), {
64
76
  'style': (_style2 = {}, _style2[stylePropName] = lastSize.value, _style2)
65
- }, null, lastRef)], 4, _$cn(classNameObj), null, null, elementRef);
77
+ }, null, lastRef)]);
66
78
  }
67
79
  ;
@@ -0,0 +1,9 @@
1
+ import { Component, VNodeComponentClass, IntactDom } from 'intact-react';
2
+ interface MemoBlockProps {
3
+ block: Function;
4
+ }
5
+ export declare class MemoBlock extends Component<MemoBlockProps> {
6
+ static template: (this: MemoBlock) => import("intact").Children;
7
+ $update(lastVNode: VNodeComponentClass<this>, nextVNode: VNodeComponentClass<this>, parentDom: Element, anchor: IntactDom | null, mountedQueue: Function[], force: boolean): void;
8
+ }
9
+ export {};
@@ -0,0 +1,26 @@
1
+ import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
2
+ import { Component } from 'intact-react';
3
+ export var MemoBlock = /*#__PURE__*/function (_Component) {
4
+ _inheritsLoose(MemoBlock, _Component);
5
+
6
+ function MemoBlock() {
7
+ return _Component.apply(this, arguments) || this;
8
+ }
9
+
10
+ var _proto = MemoBlock.prototype;
11
+
12
+ _proto.$update = function $update(lastVNode, nextVNode, parentDom, anchor, mountedQueue, force) {
13
+ var lastProps = lastVNode.props;
14
+ var nextProps = nextVNode.props;
15
+ if (lastProps.block === nextProps.block) return;
16
+
17
+ _Component.prototype.$update.call(this, lastVNode, nextVNode, parentDom, anchor, mountedQueue, force);
18
+ };
19
+
20
+ return MemoBlock;
21
+ }(Component);
22
+
23
+ MemoBlock.template = function () {
24
+ var props = this.$props;
25
+ return props.children;
26
+ };
@@ -5,6 +5,7 @@ export interface StepsProps {
5
5
  status?: 'normal' | 'error' | 'done';
6
6
  type?: 'default' | 'line' | 'simple' | 'line-compact' | 'dot';
7
7
  clickable?: boolean;
8
+ vertical?: boolean;
8
9
  }
9
10
  export declare class Steps extends Component<StepsProps> {
10
11
  static template: string | import("intact").Template<any>;
@@ -8,7 +8,8 @@ var typeDefs = {
8
8
  value: Number,
9
9
  status: ['normal', 'error', 'done'],
10
10
  type: ['default', 'line', 'simple', 'line-compact', 'dot'],
11
- clickable: Boolean
11
+ clickable: Boolean,
12
+ vertical: Boolean
12
13
  };
13
14
 
14
15
  var defaults = function defaults() {
@@ -21,7 +21,7 @@ describe('Steps', function () {
21
21
 
22
22
  case 5:
23
23
  expect(element.innerHTML).to.matchSnapshot();
24
- _element$querySelecto2 = element.querySelectorAll('.k-step'), step1 = _element$querySelecto2[0], step2 = _element$querySelecto2[1];
24
+ _element$querySelecto2 = element.querySelectorAll('.k-step-wrapper'), step1 = _element$querySelecto2[0], step2 = _element$querySelecto2[1];
25
25
  step1.click();
26
26
  _context.next = 10;
27
27
  return wait();
@@ -17,11 +17,12 @@ export default function ($props, $blocks, $__proto__) {
17
17
  value = _this$get.value,
18
18
  status = _this$get.status,
19
19
  type = _this$get.type,
20
- clickable = _this$get.clickable;
20
+ clickable = _this$get.clickable,
21
+ vertical = _this$get.vertical;
21
22
 
22
23
  var classNameObj = (_classNameObj = {
23
24
  'k-steps': true
24
- }, _classNameObj[className] = className, _classNameObj["k-" + type] = true, _classNameObj['k-clickable'] = clickable, _classNameObj[makeStepsStyles()] = true, _classNameObj);
25
+ }, _classNameObj[className] = className, _classNameObj["k-" + type] = true, _classNameObj['k-clickable'] = clickable, _classNameObj['k-vertical'] = vertical, _classNameObj[makeStepsStyles()] = true, _classNameObj);
25
26
  var stepIndex = 0;
26
27
  var steps = [];
27
28
  eachChildren(children, function (vNode) {
@@ -34,12 +35,14 @@ export default function ($props, $blocks, $__proto__) {
34
35
  }
35
36
  }); // add width
36
37
 
37
- var width = 100 / stepIndex + '%';
38
+ /* const width = (100 / stepIndex) + '%'; */
39
+
38
40
  return _$cc(StepsContext.Provider, {
39
41
  'value': {
40
42
  value: value,
41
43
  status: status,
42
- width: width,
44
+
45
+ /* width, */
43
46
  type: type,
44
47
  onChange: this.changeIndex
45
48
  },
@@ -32,7 +32,6 @@ export default function ($props, $blocks, $__proto__) {
32
32
 
33
33
  var value = _ref.value,
34
34
  status = _ref.status,
35
- width = _ref.width,
36
35
  onChange = _ref.onChange,
37
36
  type = _ref.type;
38
37
  var selected = value === index;
@@ -1,3 +1,4 @@
1
1
  import '../../styles/global';
2
2
  export declare function makeStepsStyles(): string;
3
3
  export declare function makeCommonStyles(): string;
4
+ export declare function makeVerticalStyles(): string;
@@ -18,10 +18,6 @@ var defaults = {
18
18
  return theme.color.placeholder;
19
19
  },
20
20
 
21
- get markborder() {
22
- return "1px solid " + theme.color.placeholder;
23
- },
24
-
25
21
  markBgColor: '#fff',
26
22
  default: {
27
23
  get height() {
@@ -32,7 +28,12 @@ var defaults = {
32
28
  return theme.color.bg;
33
29
  },
34
30
 
35
- markWidth: '16px'
31
+ get markborder() {
32
+ return "1px solid " + theme.color.placeholder;
33
+ },
34
+
35
+ markWidth: '16px',
36
+ padding: '16px'
36
37
  },
37
38
  // done
38
39
  done: {
@@ -87,16 +88,21 @@ var defaults = {
87
88
  },
88
89
  // line
89
90
  line: {
91
+ get markborder() {
92
+ return "2px solid " + theme.color.placeholder;
93
+ },
94
+
90
95
  markWidth: '32px',
91
- markFontSize: '24px',
96
+ markFontSize: '18px',
92
97
 
93
98
  get lineColor() {
94
99
  return theme.color.border;
95
100
  },
96
101
 
102
+ lineWidth: '2px',
97
103
  titleGap: '16px',
98
104
  descGap: '4px',
99
- contentMaxWidth: '200px'
105
+ contentWidth: '200px'
100
106
  },
101
107
  // simple
102
108
  simple: {
@@ -114,6 +120,16 @@ var defaults = {
114
120
  return theme.color.danger;
115
121
  }
116
122
 
123
+ },
124
+ // vertical
125
+ vertical: {
126
+ line: {
127
+ minHeight: '100px',
128
+ padding: '16px'
129
+ },
130
+ simple: {
131
+ titleGap: '8px'
132
+ }
117
133
  }
118
134
  };
119
135
  var steps;
@@ -124,27 +140,36 @@ setDefault(function () {
124
140
  });
125
141
  var stepStatus = ['done', 'active', 'error'];
126
142
  export function makeStepsStyles() {
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;}}");
143
+ 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;}}", makeVerticalStyles(), ";");
128
144
  }
129
145
 
130
146
  function makeDefaultStyles() {
131
147
  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, ");}");
148
+ return /*#__PURE__*/css("text-align:center;height:", defaults.height, ";background:", defaults.bgColor, ";.k-step-wrapper{", center(), ";height:100%;padding:0 ", defaults.padding, ";}.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;}}&:not(.k-vertical){", makeArrow(false), ";}");
149
+ }
150
+
151
+ function makeArrow(isVertical) {
152
+ var defaults = steps.default;
153
+ var offset = "calc(-1 * (" + defaults.height + " / 2 + " + steps.gap + "))";
154
+ var size = "calc(" + defaults.height + " / 2 + " + steps.gap + ")";
155
+ return /*#__PURE__*/css(".k-step-tail{position:absolute;", !isVertical ? "\n top: 0;\n right: " + offset + ";\n width: " + size + ";\n height: " + defaults.height + ";\n " : "\n left: 0;\n bottom: " + offset + ";\n height: " + size + ";\n width: " + defaults.height + ";\n ", " overflow:hidden;z-index:1;&:after,&:before{content:'';border-width:calc(", defaults.height, " / 2 + ", steps.gap, ");border-style:solid;border-color:transparent;position:absolute;", isVertical ? 'left' : 'top', ":calc(-1 * ", steps.gap, ");}&:after{border-", isVertical ? 'top' : 'left', "-color:", defaults.bgColor, ";", isVertical ? 'top' : 'left', ":calc(-1 * ", steps.gap, ");}&:before{border-", isVertical ? 'top' : 'left', "-color:#fff;", isVertical ? 'top' : 'left', ":0;}}.k-step:not(:first-of-type){padding-", isVertical ? 'top' : 'left', ":calc(", defaults.height, " / 2 + ", steps.gap, ");}");
133
156
  }
134
157
 
135
158
  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, ";}}");
159
+ var line = steps.line;
160
+ var top = "calc(" + line.markWidth + " / 2 - " + line.lineWidth + " / 2)";
161
+ return /*#__PURE__*/css(".k-step{display:flex;}.k-step-wrapper{display:inline-block;text-align:center;position:relative;width:", line.contentWidth, ";}.k-step:last-of-type{flex:0 0 auto;}.k-step-mark{border:", line.markborder, ";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, ";}.k-step-wrapper{&:before,&:after{content:'';display:block;height:", line.lineWidth, ";background:", line.lineColor, ";width:50%;position:absolute;top:", top, ";}&: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:", line.lineWidth, ";background:", line.lineColor, ";margin-top:", top, ";}.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, ";}}");
138
162
  }
139
163
 
140
164
  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, ";}}}");
165
+ var line = steps.line;
166
+ return /*#__PURE__*/css(".k-step-wrapper{display:inline-flex;text-align:left;width:auto;&: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:", line.lineWidth, ";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
167
  }
144
168
 
145
169
  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, ";}}}");
170
+ var simple = steps.simple;
171
+ var top = "calc(" + simple.markWidth + " / 2 - " + steps.line.lineWidth + " / 2)";
172
+ return /*#__PURE__*/css(".k-step-mark{width:", simple.markWidth, ";height:", simple.markWidth, ";background:", simple.markBgColor, ";}.k-step-wrapper{font-size:0;&:before,&:after{top:", top, ";}}.k-step-main{font-size:", theme.default.fontSize, ";}.k-step-tail{margin-top:", top, ";}.k-step{&.k-done{.k-step-mark{background:", simple.doneMarkBgColor, ";}}&.k-error{.k-step-mark{background:", simple.errorMarkBgColor, ";}}}");
148
173
  }
149
174
 
150
175
  function center(flex) {
@@ -159,5 +184,9 @@ export function makeCommonStyles() {
159
184
  return /*#__PURE__*/css(".k-step{position:relative;flex:1;", _mapInstanceProperty(stepStatus).call(stepStatus, function (status) {
160
185
  var styles = steps[status];
161
186
  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, ";}");
187
+ }), ";}.k-step-mark{", center('inline-flex'), ";border:", steps.default.markborder, ";border-radius:50%;vertical-align:top;color:", steps.markColor, ";background:", steps.markBgColor, ";}");
188
+ }
189
+ export function makeVerticalStyles() {
190
+ var verticalLine = steps.vertical.line;
191
+ return /*#__PURE__*/css("&.k-vertical{&.k-default{height:auto;width:", steps.default.height, ";writing-mode:vertical-rl;letter-spacing:1px;", makeArrow(true), ";.k-step-wrapper{width:100%;padding:", steps.default.padding, " 0;}.k-step-mark{margin-right:0;margin-bottom:", steps.gap, ";}.k-step-title{padding-right:0;padding-bottom:", steps.gap, ";}}&.k-line,&.k-line-compact,&.k-simple{flex-direction:column;.k-step{flex:none;min-height:", verticalLine.minHeight, ";}.k-step-wrapper{display:flex;width:auto;text-align:left;}.k-step-main{flex:1;padding:0 0 ", verticalLine.padding, " ", verticalLine.padding, ";}.k-step-title{display:flex;align-items:center;height:", steps.line.markWidth, ";&:after{display:none;}}.k-step-wrapper{&:before,&:after{display:none;}}.k-step-tail{position:absolute;left:calc(", steps.line.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);height:100%;width:", steps.line.lineWidth, ";background:", steps.line.lineColor, ";}.k-step:last-of-type{.k-step-tail{display:none;}}}&.k-simple{.k-step-tail{left:calc(", steps.simple.markWidth, " / 2 - ", steps.line.lineWidth, " / 2);}.k-step-title{height:", steps.simple.markWidth, ";margin-bottom:", steps.vertical.simple.titleGap, ";}}}");
163
192
  }