@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.
- package/__tests__/__snapshots__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +461 -309
- package/__tests__/components/cascader.spec.tsx +53 -0
- package/__tests__/components/drawer.spec.tsx +67 -5
- package/components/button/index.d.ts +1 -1
- package/components/button/index.js +1 -1
- package/components/button/styles.js +1 -1
- package/components/cascader/index.d.ts +22 -11
- package/components/cascader/index.js +9 -12
- package/components/cascader/index.spec.js +81 -0
- package/components/cascader/index.vdt.js +10 -8
- package/components/cascader/styles.js +1 -1
- package/components/cascader/useFields.d.ts +2 -0
- package/components/cascader/useFields.js +18 -0
- package/components/cascader/useFilterable.d.ts +2 -1
- package/components/cascader/useFilterable.js +17 -6
- package/components/cascader/useLabel.d.ts +2 -1
- package/components/cascader/useLabel.js +4 -4
- package/components/cascader/useLoad.d.ts +2 -1
- package/components/cascader/useLoad.js +9 -7
- package/components/colorpicker/index.d.ts +2 -0
- package/components/colorpicker/index.js +7 -2
- package/components/colorpicker/index.vdt.js +3 -6
- package/components/copy/index.d.ts +17 -0
- package/components/copy/index.js +43 -0
- package/components/copy/index.spec.d.ts +1 -0
- package/components/copy/index.spec.js +52 -0
- package/components/copy/index.vdt.js +45 -0
- package/components/copy/styles.d.ts +2 -0
- package/components/copy/styles.js +14 -0
- package/components/copy/useCopy.d.ts +4 -0
- package/components/copy/useCopy.js +90 -0
- package/components/datepicker/index.spec.js +1 -1
- package/components/datepicker/index.vdt.js +1 -1
- package/components/datepicker/styles.js +1 -1
- package/components/diagram/shapes/callout.d.ts +1 -1
- package/components/diagram/shapes/circle.d.ts +1 -1
- package/components/diagram/shapes/document.d.ts +1 -1
- package/components/diagram/shapes/ellipse.d.ts +1 -1
- package/components/diagram/shapes/hexagon.d.ts +1 -1
- package/components/diagram/shapes/image.d.ts +1 -1
- package/components/diagram/shapes/parallelogram.d.ts +1 -1
- package/components/diagram/shapes/rectangle.d.ts +1 -1
- package/components/diagram/shapes/square.d.ts +1 -1
- package/components/diagram/shapes/text.d.ts +1 -1
- package/components/dialog/alert.vdt.js +6 -5
- package/components/dialog/index.spec.js +6 -6
- package/components/dropdown/dropdown.d.ts +6 -6
- package/components/dropdown/dropdown.js +58 -75
- package/components/dropdown/index.spec.js +96 -17
- package/components/dropdown/item.d.ts +1 -1
- package/components/dropdown/item.js +19 -7
- package/components/dropdown/menu.js +1 -1
- package/components/dropdown/usePosition.js +11 -2
- package/components/editable/index.d.ts +1 -0
- package/components/editable/index.js +20 -6
- package/components/editable/index.vdt.js +2 -1
- package/components/form/index.spec.js +4 -2
- package/components/form/item.vdt.js +2 -1
- package/components/form/styles.js +4 -4
- package/components/grid/useGutter.js +8 -8
- package/components/input/index.d.ts +11 -2
- package/components/input/index.js +13 -13
- package/components/input/index.spec.js +169 -1
- package/components/input/index.vdt.js +28 -7
- package/components/input/styles.js +20 -3
- package/components/input/useAutoRows.d.ts +2 -0
- package/components/input/useAutoRows.js +79 -0
- package/components/input/useAutoWidth.js +13 -3
- package/components/input/useShowPassword.d.ts +7 -0
- package/components/input/useShowPassword.js +31 -0
- package/components/menu/index.spec.js +26 -15
- package/components/menu/item.d.ts +2 -0
- package/components/menu/item.js +5 -0
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +3 -2
- package/components/pagination/index.spec.js +49 -0
- package/components/pagination/index.vdt.js +8 -10
- package/components/pagination/styles.js +1 -1
- package/components/popover/content.d.ts +19 -0
- package/components/popover/content.js +31 -0
- package/components/popover/content.vdt.js +68 -0
- package/components/popover/index.d.ts +16 -0
- package/components/popover/index.js +44 -0
- package/components/popover/index.spec.d.ts +1 -0
- package/components/popover/index.spec.js +195 -0
- package/components/popover/styles.d.ts +1 -0
- package/components/popover/styles.js +22 -0
- package/components/portal.d.ts +6 -2
- package/components/portal.js +4 -3
- package/components/position.js +2 -1
- package/components/progress/index.js +1 -1
- package/components/progress/index.vdt.js +46 -8
- package/components/progress/styles.js +19 -13
- package/components/rate/styles.js +1 -1
- package/components/select/base.d.ts +7 -3
- package/components/select/base.js +9 -3
- package/components/select/base.vdt.js +46 -35
- package/components/select/index.spec.js +2 -2
- package/components/select/menu.vdt.js +1 -1
- package/components/select/styles.js +11 -5
- package/components/select/useDraggble.d.ts +2 -0
- package/components/select/useDraggble.js +11 -0
- package/components/select/useNowrap.d.ts +3 -0
- package/components/select/useNowrap.js +19 -0
- package/components/slider/index.spec.js +48 -9
- package/components/slider/index.vdt.js +23 -12
- package/components/slider/styles.js +23 -14
- package/components/slider/useValue.d.ts +3 -1
- package/components/slider/useValue.js +12 -0
- package/components/spinner/index.d.ts +0 -1
- package/components/spinner/index.js +1 -19
- package/components/spinner/index.vdt.js +9 -4
- package/components/spinner/useChange.d.ts +1 -1
- package/components/spinner/useChange.js +2 -2
- package/components/spinner/useValue.d.ts +1 -0
- package/components/spinner/useValue.js +16 -1
- package/components/split/index.vdt.js +32 -20
- package/components/split/memo.d.ts +9 -0
- package/components/split/memo.js +26 -0
- package/components/steps/index.d.ts +1 -0
- package/components/steps/index.js +2 -1
- package/components/steps/index.spec.js +1 -1
- package/components/steps/index.vdt.js +7 -4
- package/components/steps/step.vdt.js +0 -1
- package/components/steps/styles.d.ts +1 -0
- package/components/steps/styles.js +45 -16
- package/components/switch/index.spec.js +82 -65
- package/components/table/cell.js +1 -6
- package/components/table/index.spec.js +130 -19
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +2 -1
- package/components/table/styles.js +1 -1
- package/components/table/table.d.ts +15 -0
- package/components/table/table.js +16 -7
- package/components/table/table.vdt.js +20 -6
- package/components/table/useChecked.d.ts +3 -2
- package/components/table/useChecked.js +23 -12
- package/components/table/useDisableRow.d.ts +2 -1
- package/components/table/useDisableRow.js +4 -4
- package/components/table/useDraggable.d.ts +3 -2
- package/components/table/useDraggable.js +11 -15
- package/components/table/useGroup.js +3 -0
- package/components/table/useMerge.d.ts +2 -1
- package/components/table/useMerge.js +5 -4
- package/components/table/usePagination.d.ts +8 -0
- package/components/table/usePagination.js +81 -0
- package/components/table/useStickyScrollbar.js +2 -2
- package/components/table/useTree.d.ts +2 -1
- package/components/table/useTree.js +3 -4
- package/components/table/useWidth.js +2 -2
- package/components/tabs/index.d.ts +1 -1
- package/components/tabs/index.js +1 -1
- package/components/tabs/index.spec.js +67 -0
- package/components/tabs/index.vdt.js +4 -4
- package/components/tabs/styles.js +32 -34
- package/components/tabs/useScroll.d.ts +1 -1
- package/components/tabs/useScroll.js +75 -48
- package/components/tag/base.d.ts +1 -0
- package/components/tag/base.js +1 -1
- package/components/tag/index.d.ts +1 -0
- package/components/tag/index.js +2 -1
- package/components/tag/index.spec.js +147 -4
- package/components/tag/styles.d.ts +67 -0
- package/components/tag/styles.js +33 -8
- package/components/tag/tags.d.ts +27 -0
- package/components/tag/tags.js +51 -0
- package/components/tag/tags.vdt.js +79 -0
- package/components/tag/useChildren.d.ts +2 -0
- package/components/tag/useChildren.js +39 -0
- package/components/tag/useDraggable.d.ts +3 -0
- package/components/tag/useDraggable.js +89 -0
- package/components/tag/useNowrap.d.ts +7 -0
- package/components/tag/useNowrap.js +115 -0
- package/components/timepicker/index.spec.js +1 -1
- package/components/tooltip/content.d.ts +3 -2
- package/components/tooltip/content.js +18 -1
- package/components/tooltip/content.vdt.js +22 -10
- package/components/tooltip/index.spec.js +147 -92
- package/components/tooltip/styles.d.ts +23 -0
- package/components/tooltip/styles.js +2 -2
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/tooltip/tooltip.js +11 -11
- package/components/upload/index.spec.js +5 -6
- package/components/upload/index.vdt.js +3 -1
- package/components/utils.d.ts +2 -0
- package/components/utils.js +24 -3
- package/components/virtual.d.ts +8 -0
- package/components/virtual.js +126 -0
- package/hooks/useResizeObserver.d.ts +1 -1
- package/hooks/useResizeObserver.js +19 -6
- package/i18n/en-US.d.ts +4 -1
- package/i18n/en-US.js +6 -2
- package/index.d.ts +5 -3
- package/index.js +5 -3
- package/package.json +2 -2
- package/styles/fonts/iconfont.js +1 -1
- package/styles/fonts/ionicons.js +3 -3
- package/styles/global.js +1 -1
- package/yarn-error.log +41 -43
- package/components/table/useResizeObserver.d.ts +0 -2
- package/components/table/useResizeObserver.js +0 -20
|
@@ -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
|
|
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 _$
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
var callBlock = function callBlock() {
|
|
43
|
+
return _$blocks['first'].call($this, $super, data);
|
|
44
|
+
};
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
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',
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
var callBlock = function callBlock() {
|
|
70
|
+
return _$blocks['last'].call($this, $super, data);
|
|
71
|
+
};
|
|
61
72
|
|
|
62
|
-
|
|
63
|
-
|
|
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)]
|
|
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>;
|
|
@@ -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
|
-
|
|
38
|
+
/* const width = (100 / stepIndex) + '%'; */
|
|
39
|
+
|
|
38
40
|
return _$cc(StepsContext.Provider, {
|
|
39
41
|
'value': {
|
|
40
42
|
value: value,
|
|
41
43
|
status: status,
|
|
42
|
-
|
|
44
|
+
|
|
45
|
+
/* width, */
|
|
43
46
|
type: type,
|
|
44
47
|
onChange: this.changeIndex
|
|
45
48
|
},
|
|
@@ -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
|
-
|
|
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: '
|
|
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
|
-
|
|
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-
|
|
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 =
|
|
137
|
-
|
|
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 =
|
|
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:
|
|
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 =
|
|
147
|
-
|
|
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
|
}
|