@king-design/react 3.0.0 → 3.1.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.
- package/__tests__/__snapshots__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +268 -268
- package/components/affix/index.d.ts +1 -0
- package/components/affix/index.js +2 -0
- package/components/affix/index.vdt.js +5 -5
- package/components/affix/styles.d.ts +1 -1
- package/components/affix/styles.js +1 -1
- package/components/badge/index.d.ts +1 -0
- package/components/badge/index.js +13 -1
- package/components/badge/index.vdt.js +5 -4
- package/components/badge/styles.d.ts +1 -1
- package/components/badge/styles.js +2 -2
- package/components/breadcrumb/index.d.ts +1 -0
- package/components/breadcrumb/index.js +13 -1
- package/components/breadcrumb/index.vdt.js +4 -5
- package/components/breadcrumb/item.d.ts +1 -0
- package/components/breadcrumb/item.js +2 -0
- package/components/breadcrumb/item.vdt.js +4 -5
- package/components/breadcrumb/styles.d.ts +1 -1
- package/components/breadcrumb/styles.js +2 -2
- package/components/button/group.d.ts +1 -0
- package/components/button/group.js +13 -1
- package/components/button/group.vdt.js +2 -6
- package/components/button/index.d.ts +1 -0
- package/components/button/index.js +2 -0
- package/components/button/index.vdt.js +7 -7
- package/components/button/styles.d.ts +2 -4
- package/components/button/styles.js +19 -20
- package/components/card/column.d.ts +1 -0
- package/components/card/column.js +13 -1
- package/components/card/column.vdt.js +2 -5
- package/components/card/index.d.ts +1 -0
- package/components/card/index.js +13 -1
- package/components/card/index.vdt.js +5 -11
- package/components/card/styles.d.ts +1 -1
- package/components/card/styles.js +2 -2
- package/components/carousel/index.d.ts +1 -0
- package/components/carousel/index.js +2 -0
- package/components/carousel/index.vdt.js +15 -19
- package/components/carousel/item.d.ts +1 -0
- package/components/carousel/item.js +13 -1
- package/components/carousel/item.vdt.js +2 -3
- package/components/carousel/styles.d.ts +2 -2
- package/components/carousel/styles.js +4 -4
- package/components/cascader/index.vdt.js +20 -29
- package/components/cascader/styles.d.ts +2 -2
- package/components/cascader/styles.js +3 -3
- package/components/checkbox/index.d.ts +1 -0
- package/components/checkbox/index.js +2 -0
- package/components/checkbox/index.vdt.js +4 -8
- package/components/checkbox/styles.d.ts +1 -1
- package/components/checkbox/styles.js +2 -2
- package/components/code/index.d.ts +1 -0
- package/components/code/index.js +2 -0
- package/components/code/index.vdt.js +2 -3
- package/components/code/styles.d.ts +1 -1
- package/components/code/styles.js +1 -1
- package/components/collapse/index.d.ts +1 -0
- package/components/collapse/index.js +13 -1
- package/components/collapse/index.vdt.js +2 -3
- package/components/collapse/item.d.ts +1 -0
- package/components/collapse/item.js +2 -0
- package/components/collapse/item.vdt.js +6 -8
- package/components/collapse/styles.d.ts +2 -3
- package/components/collapse/styles.js +5 -9
- package/components/colorpicker/drag.d.ts +1 -0
- package/components/colorpicker/drag.js +2 -0
- package/components/colorpicker/drag.vdt.js +3 -2
- package/components/colorpicker/index.d.ts +1 -0
- package/components/colorpicker/index.js +13 -1
- package/components/colorpicker/index.vdt.js +5 -6
- package/components/colorpicker/panel.d.ts +1 -0
- package/components/colorpicker/panel.js +2 -0
- package/components/colorpicker/panel.vdt.js +16 -19
- package/components/colorpicker/styles.d.ts +3 -3
- package/components/colorpicker/styles.js +8 -8
- package/components/config/index.d.ts +10 -0
- package/components/config/index.js +23 -0
- package/components/config/index.spec.d.ts +1 -0
- package/components/config/index.spec.js +71 -0
- package/components/context.d.ts +2 -1
- package/components/context.js +8 -2
- package/components/copy/index.d.ts +1 -0
- package/components/copy/index.js +2 -0
- package/components/copy/index.vdt.js +9 -9
- package/components/copy/styles.d.ts +1 -1
- package/components/copy/styles.js +1 -1
- package/components/datepicker/calendar.d.ts +1 -0
- package/components/datepicker/calendar.js +2 -0
- package/components/datepicker/calendar.vdt.js +38 -51
- package/components/datepicker/index.vdt.js +13 -16
- package/components/datepicker/styles.d.ts +3 -3
- package/components/datepicker/styles.js +6 -6
- package/components/datepicker/time.d.ts +1 -0
- package/components/datepicker/time.js +2 -0
- package/components/datepicker/time.vdt.js +2 -3
- package/components/diagram/diagram.d.ts +1 -0
- package/components/diagram/diagram.js +2 -0
- package/components/diagram/diagram.vdt.js +3 -4
- package/components/diagram/styles.d.ts +1 -1
- package/components/diagram/styles.js +1 -1
- package/components/dialog/alert.vdt.js +6 -10
- package/components/dialog/base.d.ts +4 -0
- package/components/dialog/base.js +2 -0
- package/components/dialog/base.vdt.js +15 -21
- package/components/dialog/index.d.ts +1 -1
- package/components/dialog/styles.d.ts +3 -3
- package/components/dialog/styles.js +12 -12
- package/components/drawer/index.vdt.js +3 -4
- package/components/drawer/styles.d.ts +1 -1
- package/components/drawer/styles.js +3 -3
- package/components/dropdown/dropdown.d.ts +1 -0
- package/components/dropdown/dropdown.js +4 -3
- package/components/dropdown/item.d.ts +1 -0
- package/components/dropdown/item.js +2 -0
- package/components/dropdown/item.vdt.js +2 -4
- package/components/dropdown/menu.d.ts +1 -0
- package/components/dropdown/menu.js +2 -0
- package/components/dropdown/menu.vdt.js +2 -3
- package/components/dropdown/styles.d.ts +2 -2
- package/components/dropdown/styles.js +4 -4
- package/components/dropdown/usePosition.js +2 -2
- package/components/editable/index.d.ts +1 -0
- package/components/editable/index.js +2 -0
- package/components/editable/index.vdt.js +3 -7
- package/components/editable/styles.d.ts +1 -1
- package/components/editable/styles.js +2 -2
- package/components/form/form.d.ts +1 -0
- package/components/form/form.js +2 -0
- package/components/form/form.vdt.js +2 -3
- package/components/form/item.d.ts +1 -0
- package/components/form/item.js +2 -0
- package/components/form/item.vdt.js +13 -19
- package/components/form/styles.d.ts +2 -2
- package/components/form/styles.js +5 -5
- package/components/form/useError.d.ts +1 -0
- package/components/grid/col.d.ts +1 -0
- package/components/grid/col.js +2 -0
- package/components/grid/col.vdt.js +3 -6
- package/components/grid/row.d.ts +1 -0
- package/components/grid/row.js +2 -0
- package/components/grid/row.vdt.js +2 -3
- package/components/grid/styles.d.ts +2 -2
- package/components/grid/styles.js +8 -18
- package/components/grid/useBreakpoints.d.ts +1 -1
- package/components/grid/useBreakpoints.js +2 -2
- package/components/grid/useGutter.d.ts +1 -0
- package/components/icon/index.d.ts +1 -0
- package/components/icon/index.js +2 -0
- package/components/icon/index.vdt.js +7 -11
- package/components/icon/styles.d.ts +1 -2
- package/components/icon/styles.js +7 -5
- package/components/input/index.d.ts +1 -0
- package/components/input/index.js +2 -0
- package/components/input/index.vdt.js +16 -26
- package/components/input/search.d.ts +1 -0
- package/components/input/search.js +2 -0
- package/components/input/search.vdt.js +5 -7
- package/components/input/styles.d.ts +2 -2
- package/components/input/styles.js +11 -11
- package/components/layout/aside.d.ts +1 -0
- package/components/layout/aside.js +2 -0
- package/components/layout/aside.vdt.js +5 -8
- package/components/layout/body.d.ts +2 -0
- package/components/layout/body.js +11 -5
- package/components/layout/footer.d.ts +1 -0
- package/components/layout/footer.js +15 -4
- package/components/layout/header.d.ts +3 -0
- package/components/layout/header.js +10 -6
- package/components/layout/helpers.d.ts +1 -0
- package/components/layout/helpers.js +1 -0
- package/components/layout/index.spec.d.ts +1 -0
- package/components/layout/index.spec.js +53 -0
- package/components/layout/layout.d.ts +2 -0
- package/components/layout/layout.js +7 -5
- package/components/layout/styles.d.ts +3 -3
- package/components/layout/styles.js +11 -11
- package/components/layout/template.vdt.js +2 -1
- package/components/menu/item.d.ts +1 -0
- package/components/menu/item.js +2 -0
- package/components/menu/item.vdt.js +7 -12
- package/components/menu/menu.d.ts +1 -0
- package/components/menu/menu.js +2 -0
- package/components/menu/menu.vdt.js +3 -6
- package/components/menu/styles.d.ts +3 -3
- package/components/menu/styles.js +11 -11
- package/components/menu/useDropdown.js +6 -1
- package/components/message/message.d.ts +1 -0
- package/components/message/message.js +2 -0
- package/components/message/message.vdt.js +12 -17
- package/components/message/messages.d.ts +1 -0
- package/components/message/messages.js +2 -0
- package/components/message/messages.vdt.js +2 -3
- package/components/message/styles.d.ts +2 -2
- package/components/message/styles.js +4 -4
- package/components/pagination/index.d.ts +1 -0
- package/components/pagination/index.js +2 -0
- package/components/pagination/index.vdt.js +14 -17
- package/components/pagination/styles.d.ts +1 -1
- package/components/pagination/styles.js +4 -4
- package/components/popover/content.vdt.js +5 -4
- package/components/popover/styles.d.ts +1 -1
- package/components/popover/styles.js +2 -2
- package/components/portal.d.ts +1 -0
- package/components/portal.js +3 -1
- package/components/progress/index.d.ts +1 -0
- package/components/progress/index.js +2 -0
- package/components/progress/index.vdt.js +14 -17
- package/components/progress/styles.d.ts +1 -1
- package/components/progress/styles.js +6 -6
- package/components/radio/index.d.ts +1 -0
- package/components/radio/index.js +2 -0
- package/components/radio/index.vdt.js +4 -7
- package/components/radio/styles.d.ts +1 -1
- package/components/radio/styles.js +2 -2
- package/components/rate/index.d.ts +1 -0
- package/components/rate/index.js +2 -0
- package/components/rate/index.vdt.js +4 -8
- package/components/rate/styles.d.ts +1 -1
- package/components/rate/styles.js +2 -2
- package/components/scrollSelect/index.d.ts +1 -0
- package/components/scrollSelect/index.js +2 -0
- package/components/scrollSelect/index.vdt.js +7 -12
- package/components/scrollSelect/styles.d.ts +1 -1
- package/components/scrollSelect/styles.js +2 -2
- package/components/select/base.d.ts +4 -0
- package/components/select/base.js +2 -0
- package/components/select/base.vdt.js +17 -21
- package/components/select/group.d.ts +1 -0
- package/components/select/group.js +2 -0
- package/components/select/group.vdt.js +3 -4
- package/components/select/menu.d.ts +1 -0
- package/components/select/menu.js +2 -0
- package/components/select/menu.vdt.js +9 -13
- package/components/select/option.d.ts +1 -0
- package/components/select/option.js +2 -0
- package/components/select/option.vdt.js +6 -8
- package/components/select/styles.d.ts +3 -3
- package/components/select/styles.js +8 -8
- package/components/select/useSearchable.d.ts +1 -0
- package/components/skeleton/item.d.ts +1 -0
- package/components/skeleton/item.js +13 -1
- package/components/skeleton/item.vdt.js +4 -7
- package/components/skeleton/skeleton.d.ts +1 -0
- package/components/skeleton/skeleton.js +13 -1
- package/components/skeleton/skeleton.vdt.js +4 -6
- package/components/skeleton/styles.d.ts +6 -0
- package/components/skeleton/styles.js +35 -0
- package/components/slider/index.d.ts +1 -0
- package/components/slider/index.js +2 -0
- package/components/slider/index.vdt.js +18 -22
- package/components/slider/styles.d.ts +1 -1
- package/components/slider/styles.js +2 -2
- package/components/spin/index.d.ts +1 -0
- package/components/spin/index.js +13 -1
- package/components/spin/index.vdt.js +6 -7
- package/components/spin/styles.d.ts +1 -1
- package/components/spin/styles.js +4 -4
- package/components/spinner/index.d.ts +1 -0
- package/components/spinner/index.js +2 -0
- package/components/spinner/index.vdt.js +15 -21
- package/components/spinner/styles.d.ts +1 -1
- package/components/spinner/styles.js +7 -7
- package/components/split/index.d.ts +2 -1
- package/components/split/index.js +2 -0
- package/components/split/index.vdt.js +7 -9
- package/components/split/styles.d.ts +4 -0
- package/components/split/styles.js +55 -0
- package/components/steps/context.d.ts +1 -0
- package/components/steps/index.d.ts +1 -0
- package/components/steps/index.js +13 -1
- package/components/steps/index.vdt.js +2 -3
- package/components/steps/step.d.ts +1 -0
- package/components/steps/step.js +13 -1
- package/components/steps/step.vdt.js +10 -16
- package/components/steps/styles.d.ts +3 -3
- package/components/steps/styles.js +18 -18
- package/components/switch/index.d.ts +1 -0
- package/components/switch/index.js +2 -0
- package/components/switch/index.vdt.js +6 -7
- package/components/switch/styles.d.ts +1 -1
- package/components/switch/styles.js +4 -4
- package/components/table/cell.d.ts +1 -0
- package/components/table/cell.js +13 -1
- package/components/table/cell.vdt.js +6 -6
- package/components/table/column.d.ts +1 -0
- package/components/table/column.js +2 -0
- package/components/table/column.vdt.js +24 -32
- package/components/table/index.spec.js +1 -1
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +21 -2
- package/components/table/row.vdt.js +3 -10
- package/components/table/styles.d.ts +2 -2
- package/components/table/styles.js +6 -6
- package/components/table/table.d.ts +2 -1
- package/components/table/table.js +3 -1
- package/components/table/table.vdt.js +16 -20
- package/components/table/useColumns.d.ts +1 -0
- package/components/table/useFixedColumns.d.ts +2 -1
- package/components/table/useGroup.d.ts +1 -0
- package/components/table/usePagination.js +1 -1
- package/components/table/useResizable.d.ts +1 -0
- package/components/table/useSortable.d.ts +1 -0
- package/components/tabs/index.d.ts +4 -0
- package/components/tabs/index.js +2 -0
- package/components/tabs/index.vdt.js +9 -10
- package/components/tabs/styles.d.ts +1 -1
- package/components/tabs/styles.js +15 -15
- package/components/tabs/tab.d.ts +1 -0
- package/components/tabs/tab.js +2 -0
- package/components/tabs/tab.vdt.js +3 -5
- package/components/tabs/useActiveBar.js +2 -1
- package/components/tabs/useScroll.js +2 -1
- package/components/tag/base.d.ts +1 -0
- package/components/tag/base.js +13 -1
- package/components/tag/index.vdt.js +4 -5
- package/components/tag/styles.d.ts +2 -2
- package/components/tag/styles.js +7 -7
- package/components/tag/tags.d.ts +1 -0
- package/components/tag/tags.js +2 -0
- package/components/tag/tags.vdt.js +5 -11
- package/components/timeline/item.d.ts +1 -0
- package/components/timeline/item.js +13 -1
- package/components/timeline/item.vdt.js +4 -5
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +6 -6
- package/components/timeline/timeline.d.ts +1 -0
- package/components/timeline/timeline.js +13 -1
- package/components/timeline/timeline.vdt.js +2 -3
- package/components/timepicker/index.d.ts +2 -1
- package/components/timepicker/panelPicker.vdt.js +13 -17
- package/components/timepicker/selectPicker.d.ts +1 -0
- package/components/timepicker/selectPicker.js +2 -0
- package/components/timepicker/selectPicker.vdt.js +4 -4
- package/components/timepicker/styles.d.ts +1 -1
- package/components/timepicker/styles.js +2 -2
- package/components/tip/index.vdt.js +5 -6
- package/components/tip/styles.d.ts +1 -1
- package/components/tip/styles.js +2 -2
- package/components/tooltip/content.vdt.js +4 -9
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +6 -6
- package/components/transfer/index.d.ts +1 -0
- package/components/transfer/index.js +2 -0
- package/components/transfer/index.vdt.js +20 -25
- package/components/transfer/styles.d.ts +1 -1
- package/components/transfer/styles.js +2 -2
- package/components/tree/index.d.ts +1 -0
- package/components/tree/index.js +2 -0
- package/components/tree/index.vdt.js +19 -30
- package/components/tree/styles.d.ts +1 -1
- package/components/tree/styles.js +2 -2
- package/components/treeSelect/index.vdt.js +2 -3
- package/components/treeSelect/styles.d.ts +1 -1
- package/components/treeSelect/styles.js +1 -1
- package/components/upload/index.d.ts +1 -0
- package/components/upload/index.js +2 -0
- package/components/upload/index.vdt.js +39 -50
- package/components/upload/styles.d.ts +2 -2
- package/components/upload/styles.js +3 -3
- package/components/utils.d.ts +3 -1
- package/components/utils.js +36 -9
- package/components/virtual.js +5 -2
- package/components/wave/index.d.ts +1 -0
- package/components/wave/index.js +4 -2
- package/components/wave/styles.d.ts +1 -1
- package/components/wave/styles.js +2 -2
- package/index.d.ts +3 -2
- package/index.js +3 -2
- package/package.json +2 -2
- package/styles/fonts/iconfont.d.ts +1 -1
- package/styles/fonts/iconfont.js +4 -1
- package/styles/global.js +4 -4
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +4 -53
- package/styles/utils.d.ts +1 -0
- package/styles/utils.js +3 -0
- package/components/skeleton/style.d.ts +0 -6
- package/components/skeleton/style.js +0 -35
- package/components/split/style.d.ts +0 -4
- package/components/split/style.js +0 -55
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
-
import { noop as _$no, createElementVNode as _$ce, createUnknownComponentVNode as _$cc,
|
|
2
|
+
import { noop as _$no, createElementVNode as _$ce, createUnknownComponentVNode as _$cc, className as _$cn, extend as _$ex, EMPTY_OBJ as _$em, createVNode as _$cv, map as _$ma } from 'intact-react';
|
|
3
3
|
import { linkEvent } from 'intact';
|
|
4
4
|
import { Spinner } from '../spinner';
|
|
5
5
|
import { Tooltip } from '../tooltip';
|
|
@@ -37,11 +37,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
37
37
|
firstThumbRef = _this$draggable.firstThumbRef,
|
|
38
38
|
secondThumbRef = _this$draggable.secondThumbRef,
|
|
39
39
|
onFocusin = _this$draggable.onFocusin;
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
'k-disabled': disabled,
|
|
43
|
-
'k-dragging': dragging.value || !animate
|
|
44
|
-
}, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
40
|
+
var k = this.config.k;
|
|
41
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-slider"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-dragging"] = dragging.value || !animate, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
45
42
|
|
|
46
43
|
var _this$styles = this.styles(),
|
|
47
44
|
barStyle = _this$styles.barStyle,
|
|
@@ -81,8 +78,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
81
78
|
'disabled': !showTooltip,
|
|
82
79
|
'ref': tooltipRef
|
|
83
80
|
}, tooltipProps, {
|
|
84
|
-
'className':
|
|
85
|
-
'children': _$ce(2, 'div', null, 1,
|
|
81
|
+
'className': _$cn(k + "-slider-tooltip"),
|
|
82
|
+
'children': _$ce(2, 'div', null, 1, _$cn(k + "-slider-thumb"), {
|
|
86
83
|
'tabindex': disabled ? '-1' : '0',
|
|
87
84
|
'ev-mousedown': onStart,
|
|
88
85
|
'ev-focusin': linkEvent(isFirst, onFocusin),
|
|
@@ -106,7 +103,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
106
103
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
107
104
|
}), __$blocks;
|
|
108
105
|
}.call($this, _$em)
|
|
109
|
-
}), null, tooltipRef), 2,
|
|
106
|
+
}), null, tooltipRef), 2, _$cn(k + "-slider-thumb-wrapper"), {
|
|
110
107
|
'style': thumbStyle
|
|
111
108
|
});
|
|
112
109
|
};
|
|
@@ -118,29 +115,28 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
118
115
|
var marks = this.marks();
|
|
119
116
|
return _$cv('div', _extends({
|
|
120
117
|
'className': _$cn(classNameObj)
|
|
121
|
-
}, getRestProps(this)), [_$ce(2, 'div', [_$ce(2, 'div', _$ce(2, 'div', [_$ce(2, 'div', null, 1,
|
|
118
|
+
}, getRestProps(this)), [_$ce(2, 'div', [_$ce(2, 'div', _$ce(2, 'div', [_$ce(2, 'div', null, 1, _$cn(k + "-slider-bar"), {
|
|
122
119
|
'style': barStyle
|
|
123
120
|
}), createThumb(thumbFirstStyle, true, firstThumbRef, range ? value[0] : value, firstTooltipRef), range ? createThumb(thumbSecondStyle, false, secondThumbRef, value[1], secondTooltipRef) : undefined, _$ma(points, function ($value, $key) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}), {
|
|
121
|
+
var _$cn2;
|
|
122
|
+
|
|
123
|
+
return _$ce(2, 'i', null, 1, _$cn((_$cn2 = {}, _$cn2[k + "-slider-point"] = true, _$cn2[k + "-active"] = $value.active, _$cn2)), {
|
|
128
124
|
'style': $value.style
|
|
129
125
|
});
|
|
130
|
-
}, $this)], 0,
|
|
126
|
+
}, $this)], 0, _$cn(k + "-slider-track"), null, null, trackRef), 2, _$cn(k + "-slider-track-wrapper"), {
|
|
131
127
|
'ev-click': onClickTrack
|
|
132
128
|
}), marks.length ? _$ce(2, 'div', _$ma(marks, function ($value, $key) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}), {
|
|
129
|
+
var _$cn3;
|
|
130
|
+
|
|
131
|
+
return _$ce(2, 'span', $value.text, 0, _$cn((_$cn3 = {}, _$cn3[k + "-active"] = $value.active, _$cn3)), {
|
|
136
132
|
'style': $value.style,
|
|
137
133
|
'ev-click': linkEvent($value.value, setOneValue)
|
|
138
134
|
});
|
|
139
|
-
}, $this), 4,
|
|
135
|
+
}, $this), 4, _$cn(k + "-slider-marks")) : showEnd ? _$ce(2, 'div', [_$ce(2, 'span', min + unit, 0, null, {
|
|
140
136
|
'ev-click': linkEvent(min, setOneValue)
|
|
141
137
|
}), _$ce(2, 'span', max + unit, 0, null, {
|
|
142
138
|
'ev-click': linkEvent(max, setOneValue)
|
|
143
|
-
})], 4,
|
|
139
|
+
})], 4, _$cn(k + "-slider-ends")) : undefined], 0, _$cn(k + "-slider-main")), showInput ? _$ce(2, 'div', function () {
|
|
144
140
|
var props = {
|
|
145
141
|
disabled: disabled,
|
|
146
142
|
min: min,
|
|
@@ -153,11 +149,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
153
149
|
return [_$cc(Spinner, _extends({}, props, {
|
|
154
150
|
'value': range ? value[0] : value,
|
|
155
151
|
'ev-$change:value': range ? onLeftSpinnerChange : onSpinnerChange
|
|
156
|
-
}, spinnerProps)), range ? [_$ce(2, 'span', '-', 16,
|
|
152
|
+
}, spinnerProps)), range ? [_$ce(2, 'span', '-', 16, _$cn(k + "-slider-spinner-sep")), _$cc(Spinner, _extends({}, props, {
|
|
157
153
|
'min': value[0],
|
|
158
154
|
'value': range ? value[1] : value,
|
|
159
155
|
'ev-$change:value': onRightSpinnerChange
|
|
160
156
|
}, spinnerProps))] : undefined];
|
|
161
|
-
}(), 0,
|
|
157
|
+
}(), 0, _$cn(k + "-slider-spinner")) : undefined]);
|
|
162
158
|
}
|
|
163
159
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -85,6 +85,6 @@ setDefault(function () {
|
|
|
85
85
|
slider: defaults
|
|
86
86
|
}).slider;
|
|
87
87
|
});
|
|
88
|
-
export function makeStyles() {
|
|
89
|
-
return /*#__PURE__*/css("position:relative;outline:none;display:flex;.k-slider-main{flex:1;}.k-slider-track-wrapper{cursor:pointer;height:32px;display:flex;align-items:center;}.k-slider-track{flex:1;height:", slider.height, ";background-color:", slider.bgColor, ";border-radius:", slider.borderRadius, ";position:relative;user-select:none;}.k-slider-bar{background-color:", slider.barColor, ";position:absolute;height:100%;border-radius:", slider.borderRadius, ";transition:all ", slider.transition, ";}.k-slider-thumb-wrapper{position:absolute;top:50%;transform:translate(-50%, -50%);transition:left ", slider.transition, ";z-index:1;}.k-slider-thumb{box-sizing:content-box;height:", slider.thumb.height, ";width:", slider.thumb.width, ";transition:all ", slider.transition, ";border:", slider.thumb.border, ";border-radius:", slider.thumb.borderRadius, ";background-color:", slider.thumb.bgColor, ";box-shadow:", slider.thumb.boxShadow, ";outline:none;&:hover,&:focus{transform:", slider.thumb.hoverTransform, ";cursor:grab;background-color:", slider.thumb.hoverBgColor, ";}}.k-slider-ends{display:flex;justify-content:space-between;span{cursor:pointer;}}.k-slider-spinner{margin-left:", slider.spinnerGap, ";}.k-slider-spinner-sep{display:inline-block;margin:auto 8px;}&.k-dragging{.k-slider-bar{transition:none;}.k-slider-thumb-wrapper{transition:none;}}&.k-disabled{color:", slider.disabled.color, ";.k-slider-track-wrapper{cursor:not-allowed;}.k-slider-bar{background-color:", slider.disabled.bgColor, ";}.k-slider-thumb{border-color:#fff;background-color:", slider.disabled.bgColor, ";&:hover,&:focus{background-color:", slider.disabled.bgColor, ";cursor:not-allowed;transform:none;}}.k-slider-ends{span{cursor:not-allowed;}}}.k-slider-point{position:absolute;top:calc((", slider.height, " - ", slider.point.height, ") / 2 );width:", slider.point.width, ";height:", slider.point.height, ";background:", slider.point.bgColor, ";transform:translateX(-50%);border-radius:", slider.point.borderRadius, ";border:", slider.point.border, ";&.k-active{border-color:", slider.point.activeBorderColor, ";}}.k-slider-marks{position:relative;height:", slider.marks.height, ";>span{position:absolute;transform:translateX(-50%);white-space:nowrap;cursor:pointer;&:first-child{transform:none;}&:last-child{transform:translateX(-100%);}&.k-active{color:", slider.marks.activeColor, ";}}}.k-slider-tooltip{white-space:nowrap;}");
|
|
88
|
+
export function makeStyles(k) {
|
|
89
|
+
return /*#__PURE__*/css("position:relative;outline:none;display:flex;.", k, "-slider-main{flex:1;}.", k, "-slider-track-wrapper{cursor:pointer;height:32px;display:flex;align-items:center;}.", k, "-slider-track{flex:1;height:", slider.height, ";background-color:", slider.bgColor, ";border-radius:", slider.borderRadius, ";position:relative;user-select:none;}.", k, "-slider-bar{background-color:", slider.barColor, ";position:absolute;height:100%;border-radius:", slider.borderRadius, ";transition:all ", slider.transition, ";}.", k, "-slider-thumb-wrapper{position:absolute;top:50%;transform:translate(-50%, -50%);transition:left ", slider.transition, ";z-index:1;}.", k, "-slider-thumb{box-sizing:content-box;height:", slider.thumb.height, ";width:", slider.thumb.width, ";transition:all ", slider.transition, ";border:", slider.thumb.border, ";border-radius:", slider.thumb.borderRadius, ";background-color:", slider.thumb.bgColor, ";box-shadow:", slider.thumb.boxShadow, ";outline:none;&:hover,&:focus{transform:", slider.thumb.hoverTransform, ";cursor:grab;background-color:", slider.thumb.hoverBgColor, ";}}.", k, "-slider-ends{display:flex;justify-content:space-between;span{cursor:pointer;}}.", k, "-slider-spinner{margin-left:", slider.spinnerGap, ";}.", k, "-slider-spinner-sep{display:inline-block;margin:auto 8px;}&.", k, "-dragging{.", k, "-slider-bar{transition:none;}.", k, "-slider-thumb-wrapper{transition:none;}}&.", k, "-disabled{color:", slider.disabled.color, ";.", k, "-slider-track-wrapper{cursor:not-allowed;}.", k, "-slider-bar{background-color:", slider.disabled.bgColor, ";}.", k, "-slider-thumb{border-color:#fff;background-color:", slider.disabled.bgColor, ";&:hover,&:focus{background-color:", slider.disabled.bgColor, ";cursor:not-allowed;transform:none;}}.", k, "-slider-ends{span{cursor:not-allowed;}}}.", k, "-slider-point{position:absolute;top:calc((", slider.height, " - ", slider.point.height, ") / 2 );width:", slider.point.width, ";height:", slider.point.height, ";background:", slider.point.bgColor, ";transform:translateX(-50%);border-radius:", slider.point.borderRadius, ";border:", slider.point.border, ";&.", k, "-active{border-color:", slider.point.activeBorderColor, ";}}.", k, "-slider-marks{position:relative;height:", slider.marks.height, ";>span{position:absolute;transform:translateX(-50%);white-space:nowrap;cursor:pointer;&:first-child{transform:none;}&:last-child{transform:translateX(-100%);}&.", k, "-active{color:", slider.marks.activeColor, ";}}}.", k, "-slider-tooltip{white-space:nowrap;}");
|
|
90
90
|
}
|
package/components/spin/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
3
|
import { Component } from 'intact-react';
|
|
3
4
|
import template from './index.vdt';
|
|
4
5
|
import { sizes } from '../../styles/utils';
|
|
6
|
+
import { useConfigContext } from '../config';
|
|
5
7
|
var typeDefs = {
|
|
6
8
|
size: sizes,
|
|
7
9
|
center: Boolean,
|
|
@@ -18,7 +20,17 @@ export var Spin = /*#__PURE__*/function (_Component) {
|
|
|
18
20
|
_inheritsLoose(Spin, _Component);
|
|
19
21
|
|
|
20
22
|
function Spin() {
|
|
21
|
-
|
|
23
|
+
var _context;
|
|
24
|
+
|
|
25
|
+
var _this;
|
|
26
|
+
|
|
27
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
|
+
args[_key] = arguments[_key];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
32
|
+
_this.config = useConfigContext();
|
|
33
|
+
return _this;
|
|
22
34
|
}
|
|
23
35
|
|
|
24
36
|
return Spin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
-
import { createElementVNode as _$ce,
|
|
2
|
+
import { createElementVNode as _$ce, className as _$cn, noop as _$no, createVNode as _$cv } from 'intact-react';
|
|
3
3
|
import { Transition } from 'intact';
|
|
4
4
|
import { getRestProps } from '../utils';
|
|
5
5
|
import { makeStyles } from './styles';
|
|
@@ -26,12 +26,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
26
26
|
className = _this$get.className,
|
|
27
27
|
overlay = _this$get.overlay;
|
|
28
28
|
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-center'] = !overlay && center, _classNameObj['k-overlay'] = overlay, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
29
|
+
var k = this.config.k;
|
|
30
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-spin"] = true, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-center"] = !overlay && center, _classNameObj[k + "-overlay"] = overlay, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
32
31
|
|
|
33
32
|
var canvas = _$ce(2, 'div', (_$blocks['canvas'] = function ($super) {
|
|
34
|
-
return _$ce(512, 'svg', _$ce(2, 'circle', null, 1,
|
|
33
|
+
return _$ce(512, 'svg', _$ce(2, 'circle', null, 1, _$cn(k + "-spin-circle"), _$tmp0), 2, null, _$tmp1);
|
|
35
34
|
}, __$blocks['canvas'] = function ($super, data) {
|
|
36
35
|
var block = $blocks['canvas'];
|
|
37
36
|
|
|
@@ -40,10 +39,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
43
|
-
}, __$blocks['canvas'](_$no)), 0,
|
|
42
|
+
}, __$blocks['canvas'](_$no)), 0, _$cn(k + "-spin-canvas"));
|
|
44
43
|
|
|
45
44
|
return _$cv('div', _extends({
|
|
46
45
|
'className': _$cn(classNameObj)
|
|
47
|
-
}, getRestProps(this)), overlay ? _$ce(2, 'div', canvas, 0,
|
|
46
|
+
}, getRestProps(this)), overlay ? _$ce(2, 'div', canvas, 0, _$cn(k + "-spin-wrapper")) : canvas);
|
|
48
47
|
}
|
|
49
48
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -21,14 +21,14 @@ setDefault(function () {
|
|
|
21
21
|
spin: defaults
|
|
22
22
|
}).spin;
|
|
23
23
|
});
|
|
24
|
-
export function makeStyles() {
|
|
24
|
+
export function makeStyles(k) {
|
|
25
25
|
var width = spin.strokeWidth;
|
|
26
26
|
var r = 120 - 60 - width / 2;
|
|
27
27
|
var c = Math.round(2 * 3.14 * r);
|
|
28
28
|
var spinDash = /*#__PURE__*/keyframes("0%{stroke-dasharray:1,", c, ";stroke-dashoffset:0;}50%{stroke-dasharray:", Math.round(c * 0.75), ",", c, ";stroke-dashoffset:", -c * 0.25, ";}to{stroke-dasharray:", Math.round(c * 0.75), ",", c, ";stroke-dashoffset:", -c, ";}");
|
|
29
|
-
return /*#__PURE__*/css("display:inline-block;.k-spin-canvas{width:", spin.width, ";height:", spin.width, ";animation
|
|
29
|
+
return /*#__PURE__*/css("display:inline-block;.", k, "-spin-canvas{width:", spin.width, ";height:", spin.width, ";animation:.", k, "-rotate 2s linear infinite;}.", k, "-spin-circle{stroke-dasharray:", Math.round(c * 0.75), ",", c, ";stroke-dashoffset:0;fill:none;stroke-width:", width, ";stroke:", spin.color, ";r:", r, ";animation:", spinDash, " 1.5s ease-in-out infinite;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
30
30
|
if (size === 'default') return;
|
|
31
31
|
var width = spin[size + "Width"];
|
|
32
|
-
return /*#__PURE__*/css("&.k-", size, "{.k-spin-canvas{width:", width, ";height:", width, ";}}");
|
|
33
|
-
}), " &.k-center,&.k-overlay .k-spin-wrapper{position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%, -50%);}&.k-overlay{position:absolute;z-index:", theme.midZIndex, ";top:0;bottom:0;left:0;right:0;background:rgba(255, 255, 255, .5);}");
|
|
32
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{.", k, "-spin-canvas{width:", width, ";height:", width, ";}}");
|
|
33
|
+
}), " &.", k, "-center,&.", k, "-overlay .", k, "-spin-wrapper{position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%, -50%);}&.", k, "-overlay{position:absolute;z-index:", theme.midZIndex, ";top:0;bottom:0;left:0;right:0;background:rgba(255, 255, 255, .5);}");
|
|
34
34
|
}
|
|
@@ -7,6 +7,7 @@ import { useStep } from './useStep';
|
|
|
7
7
|
import { useFormatter } from './useFormatter';
|
|
8
8
|
import { useValue } from './useValue';
|
|
9
9
|
import { useChange } from './useChange';
|
|
10
|
+
import { useConfigContext } from '../config';
|
|
10
11
|
var typeDefs = {
|
|
11
12
|
value: Number,
|
|
12
13
|
disabled: Boolean,
|
|
@@ -55,6 +56,7 @@ export var Spinner = /*#__PURE__*/function (_Component) {
|
|
|
55
56
|
_this.formatter = useFormatter();
|
|
56
57
|
_this.value = useValue(_this.step, _this.formatter);
|
|
57
58
|
_this.change = useChange(_this.step, _this.value.fixValue);
|
|
59
|
+
_this.config = useConfigContext();
|
|
58
60
|
return _this;
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -5,18 +5,6 @@ import { Icon } from '../icon';
|
|
|
5
5
|
import { Input } from '../input';
|
|
6
6
|
import { getRestProps } from '../utils';
|
|
7
7
|
import { makeStyles } from './styles';
|
|
8
|
-
var _$tmp0 = {
|
|
9
|
-
'className': 'k-spinner-icon k-icon-minus'
|
|
10
|
-
};
|
|
11
|
-
var _$tmp1 = {
|
|
12
|
-
'className': 'k-spinner-icon k-icon-down'
|
|
13
|
-
};
|
|
14
|
-
var _$tmp2 = {
|
|
15
|
-
'className': 'k-spinner-icon k-icon-add'
|
|
16
|
-
};
|
|
17
|
-
var _$tmp3 = {
|
|
18
|
-
'className': 'k-spinner-icon k-icon-up'
|
|
19
|
-
};
|
|
20
8
|
export default function ($props, $blocks, $__proto__) {
|
|
21
9
|
var _classNameObj;
|
|
22
10
|
|
|
@@ -32,10 +20,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
32
20
|
value = _this$get.value,
|
|
33
21
|
width = _this$get.width;
|
|
34
22
|
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
'k-disabled': disabled
|
|
38
|
-
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj[className] = className, _classNameObj['k-vertical'] = vertical, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
23
|
+
var k = this.config.k;
|
|
24
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-spinner"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[className] = className, _classNameObj[k + "-vertical"] = vertical, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
39
25
|
var _this$change = this.change,
|
|
40
26
|
decrease = _this$change.decrease,
|
|
41
27
|
increase = _this$change.increase,
|
|
@@ -50,13 +36,17 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
50
36
|
'icon': true,
|
|
51
37
|
'ev-click': decrease,
|
|
52
38
|
'disabled': this.isDisabledDecrease(),
|
|
53
|
-
'className':
|
|
39
|
+
'className': _$cn(k + "-spinner-btn " + k + "-left"),
|
|
54
40
|
'size': size,
|
|
55
41
|
'type': 'none',
|
|
56
42
|
'tabindex': '-1',
|
|
57
|
-
'children': !vertical ? _$cc(Icon,
|
|
43
|
+
'children': !vertical ? _$cc(Icon, {
|
|
44
|
+
'className': _$cn(k + "-spinner-icon " + k + "-icon-minus")
|
|
45
|
+
}) : _$cc(Icon, {
|
|
46
|
+
'className': _$cn(k + "-spinner-icon " + k + "-icon-down")
|
|
47
|
+
})
|
|
58
48
|
}), _$cc(Input, {
|
|
59
|
-
'className':
|
|
49
|
+
'className': _$cn(k + "-spinner-input"),
|
|
60
50
|
'disabled': disabled,
|
|
61
51
|
'ev-change': onChangeValue,
|
|
62
52
|
'ev-focusin': onFocusin,
|
|
@@ -68,11 +58,15 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
68
58
|
'icon': true,
|
|
69
59
|
'ev-click': increase,
|
|
70
60
|
'disabled': this.isDisabledIncrease(),
|
|
71
|
-
'className':
|
|
61
|
+
'className': _$cn(k + "-spinner-btn " + k + "-right"),
|
|
72
62
|
'size': size,
|
|
73
63
|
'type': 'none',
|
|
74
64
|
'tabindex': '-1',
|
|
75
|
-
'children': !vertical ? _$cc(Icon,
|
|
65
|
+
'children': !vertical ? _$cc(Icon, {
|
|
66
|
+
'className': _$cn(k + "-spinner-icon " + k + "-icon-add")
|
|
67
|
+
}) : _$cc(Icon, {
|
|
68
|
+
'className': _$cn(k + "-spinner-icon " + k + "-icon-up")
|
|
69
|
+
})
|
|
76
70
|
})]);
|
|
77
71
|
}
|
|
78
72
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -69,28 +69,28 @@ setDefault(function () {
|
|
|
69
69
|
spinner: defaults
|
|
70
70
|
}).spinner;
|
|
71
71
|
});
|
|
72
|
-
export function makeStyles() {
|
|
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-wrapper{border:none;border-radius:0;&:hover{border:none;}}&.k-focus .k-input-wrapper{border:none;}.k-input-inner{text-align:center;}}.k-spinner-icon{font-size:", spinner.default.iconFontSize, ";}&.k-vertical{position:relative;font-size:0;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
72
|
+
export function makeStyles(k) {
|
|
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-wrapper{border:none;border-radius:0;&:hover{border:none;}}&.", k, "-focus .", k, "-input-wrapper{border:none;}.", k, "-input-inner{text-align:center;}}.", k, "-spinner-icon{font-size:", spinner.default.iconFontSize, ";}&.", k, "-vertical{position:relative;font-size:0;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
74
74
|
var generate = function generate() {
|
|
75
|
-
return "
|
|
75
|
+
return /*#__PURE__*/css(".", k, "-spinner-input{padding-right:", theme[size].height, ";width:", spinner.vertical[size].width, ";}");
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
if (size === 'default') {
|
|
79
79
|
return generate();
|
|
80
80
|
} else {
|
|
81
|
-
return "
|
|
81
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{", generate(), ";}");
|
|
82
82
|
}
|
|
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{.k-input-wrapper{border-radius:", spinner.borderRadius, " 0 0 ", spinner.borderRadius, ";}}}&.k-disabled{border-color:", spinner.disabledBorderColor, ";background:", spinner.disabledBg, ";}", _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{.", k, "-input-wrapper{border-radius:", spinner.borderRadius, " 0 0 ", spinner.borderRadius, ";}}}&.", k, "-disabled{border-color:", spinner.disabledBorderColor, ";background:", spinner.disabledBg, ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
84
84
|
var styles = spinner[size];
|
|
85
85
|
|
|
86
86
|
var generate = function generate() {
|
|
87
|
-
return "
|
|
87
|
+
return /*#__PURE__*/css(".", k, "-spinner-icon{font-size:", styles.iconFontSize, ";}.", k, "-spinner-input{width:", styles.inputWidth, ";}");
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
if (size === 'default') {
|
|
91
91
|
return generate();
|
|
92
92
|
} else {
|
|
93
|
-
return "
|
|
93
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{", generate(), ";}");
|
|
94
94
|
}
|
|
95
95
|
}), ";");
|
|
96
96
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, TypeDefs } from 'intact-react';
|
|
2
|
-
import { Mode } from './
|
|
2
|
+
import { Mode } from './styles';
|
|
3
3
|
import type { Events } from '../types';
|
|
4
4
|
export interface SplitProps {
|
|
5
5
|
mode?: Mode;
|
|
@@ -25,4 +25,5 @@ export declare class Split extends Component<SplitProps, SplitEvents, SplitBlock
|
|
|
25
25
|
static events: Events<SplitEvents>;
|
|
26
26
|
private size;
|
|
27
27
|
private drag;
|
|
28
|
+
private config;
|
|
28
29
|
}
|
|
@@ -4,6 +4,7 @@ import { Component } from 'intact-react';
|
|
|
4
4
|
import template from './index.vdt';
|
|
5
5
|
import { useSize } from './useSize';
|
|
6
6
|
import { useDraggable } from './useDraggable';
|
|
7
|
+
import { useConfigContext } from '../config';
|
|
7
8
|
var typeDefs = {
|
|
8
9
|
mode: String,
|
|
9
10
|
firstSize: String,
|
|
@@ -42,6 +43,7 @@ export var Split = /*#__PURE__*/function (_Component) {
|
|
|
42
43
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
43
44
|
_this.size = useSize();
|
|
44
45
|
_this.drag = useDraggable(_this.size.firstSize, _this.size.lastSize);
|
|
46
|
+
_this.config = useConfigContext();
|
|
45
47
|
return _this;
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, createUnknownComponentVNode as _$cc, noop as _$no } from 'intact-react';
|
|
3
|
-
import { makeStyles } from './
|
|
4
|
-
import { kls } from './style';
|
|
3
|
+
import { makeStyles, kls } from './styles';
|
|
5
4
|
import { MemoBlock } from './memo';
|
|
6
5
|
import { getRestProps } from '../utils';
|
|
7
6
|
export default function ($props, $blocks, $__proto__) {
|
|
@@ -25,9 +24,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
25
24
|
elementRef = _this$drag.elementRef,
|
|
26
25
|
start = _this$drag.start,
|
|
27
26
|
dragging = _this$drag.dragging;
|
|
28
|
-
var
|
|
29
|
-
|
|
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);
|
|
27
|
+
var k = this.config.k;
|
|
28
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-split"] = true, _classNameObj[k + "-" + mode] = true, _classNameObj[makeStyles(k)] = true, _classNameObj[[k + "-first-auto"]] = firstSize.value === 'auto', _classNameObj[[k + "-last-auto"]] = lastSize.value === 'auto', _classNameObj[[k + "-resizing"]] = dragging.value, _classNameObj);
|
|
31
29
|
var stylePropName = mode === 'horizontal' ? 'width' : 'height';
|
|
32
30
|
return _$cv('div', _extends({
|
|
33
31
|
'className': _$cn(classNameObj),
|
|
@@ -45,10 +43,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
45
43
|
|
|
46
44
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
47
45
|
}, __$blocks['first'](_$no))
|
|
48
|
-
}), 2, _$cn(kls('first')), {
|
|
46
|
+
}), 2, _$cn(kls('first', k)), {
|
|
49
47
|
'style': (_style = {}, _style[stylePropName] = firstSize.value, _style)
|
|
50
48
|
}, null, firstRef), _$ce(2, 'div', (_$blocks['drag'] = function ($super) {
|
|
51
|
-
return _$ce(2, 'div', _$ce(2, 'div', null, 1, _$cn(kls('drag-lines'))), 2, _$cn(kls('line')));
|
|
49
|
+
return _$ce(2, 'div', _$ce(2, 'div', null, 1, _$cn(kls('drag-lines', k))), 2, _$cn(kls('line', k)));
|
|
52
50
|
}, __$blocks['drag'] = function ($super, data) {
|
|
53
51
|
var block = $blocks['drag'];
|
|
54
52
|
|
|
@@ -57,7 +55,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
57
55
|
};
|
|
58
56
|
|
|
59
57
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
60
|
-
}, __$blocks['drag'](_$no)), 0, _$cn(kls('line-wrapper')), {
|
|
58
|
+
}, __$blocks['drag'](_$no)), 0, _$cn(kls('line-wrapper', k)), {
|
|
61
59
|
'ev-mousedown': start
|
|
62
60
|
}), _$ce(2, 'div', _$cc(MemoBlock, {
|
|
63
61
|
'block': $blocks.last,
|
|
@@ -72,7 +70,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
72
70
|
|
|
73
71
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
74
72
|
}, __$blocks['last'](_$no))
|
|
75
|
-
}), 2, _$cn(kls('last')), {
|
|
73
|
+
}), 2, _$cn(kls('last', k)), {
|
|
76
74
|
'style': (_style2 = {}, _style2[stylePropName] = lastSize.value, _style2)
|
|
77
75
|
}, null, lastRef)]);
|
|
78
76
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { theme, setDefault } from '../../styles/theme';
|
|
2
|
+
import { css } from '@emotion/css';
|
|
3
|
+
import '../../styles/global';
|
|
4
|
+
import { deepDefaults } from '../../styles/utils';
|
|
5
|
+
export var kls = function kls(className, k) {
|
|
6
|
+
return k + "-split-" + className;
|
|
7
|
+
};
|
|
8
|
+
var defaults = {
|
|
9
|
+
splitLineSize: '6px',
|
|
10
|
+
dragLinesSize: '1px',
|
|
11
|
+
dragLinesCount: 5,
|
|
12
|
+
dragLiensGutter: 5,
|
|
13
|
+
|
|
14
|
+
get bgColor() {
|
|
15
|
+
return theme.color.bg;
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
get baseBorder() {
|
|
19
|
+
return "1px solid " + theme.color.border;
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
get transition() {
|
|
23
|
+
return theme.transition.middle;
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
get boderColor() {
|
|
27
|
+
return theme.color.border;
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
get dragLineMargin() {
|
|
31
|
+
return "-" + split.dragLinesCount * (split.dragLiensGutter + 1) / 2 + "px";
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
boxShadow: function boxShadow(direction) {
|
|
35
|
+
var i = 1;
|
|
36
|
+
var tmp = [];
|
|
37
|
+
|
|
38
|
+
while (i <= split.dragLinesCount) {
|
|
39
|
+
var shadowVal = direction === 'horizontal' ? "0 " + i * split.dragLiensGutter + "px 0 0" : i * split.dragLiensGutter + "px 0 0 0";
|
|
40
|
+
tmp.push(shadowVal + " " + split.boderColor);
|
|
41
|
+
i++;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return "" + tmp.join(',');
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var split;
|
|
48
|
+
setDefault(function () {
|
|
49
|
+
split = deepDefaults(theme, {
|
|
50
|
+
split: defaults
|
|
51
|
+
}).split;
|
|
52
|
+
});
|
|
53
|
+
export function makeStyles(k) {
|
|
54
|
+
return /*#__PURE__*/css("display:flex;height:100%;&>.", kls('first', k), ",&>.", kls('last', k), "{overflow:auto;position:relative;}&>.", kls('first', k), "{flex:0 0 auto;}&>.", kls('last', k), "{flex:auto;}&.", k, "-first-auto{&>.", kls('first', k), "{flex:auto;}&>.", kls('last', k), "{flex:0 0 auto;}}&:not(.", k, "-resizing){&>.", kls('first', k), ",&>.", kls('last', k), "{transition:all ", split.transition, ";}}&>.", kls('line-wrapper', k), "{flex:0 0 auto;text-align:center;overflow:hidden;.", kls('line', k), "{height:100%;background:", split.bgColor, ";position:relative;}.", kls('drag-lines', k), "{background:", split.boderColor, ";position:absolute;}}&.", k, "-horizontal{&>.", kls('line-wrapper', k), "{cursor:col-resize;width:", split.splitLineSize, ";.", kls('line', k), "{border-left:", split.baseBorder, ";border-right:", split.baseBorder, ";}.", kls('drag-lines', k), "{height:", split.dragLinesSize, ";width:100%;top:50%;margin-top:", split.dragLineMargin, ";box-shadow:", split.boxShadow('horizontal'), ";}}}&.", k, "-vertical{flex-direction:column;&>.", kls('line-wrapper', k), "{cursor:row-resize;height:", split.splitLineSize, ";.", kls('line', k), "{border-top:", split.baseBorder, ";border-bottom:", split.baseBorder, ";}.", kls('drag-lines', k), "{width:", split.dragLinesSize, ";height:100%;left:50%;margin-left:", split.dragLineMargin, ";box-shadow:", split.boxShadow('vertical'), ";}}}");
|
|
55
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const context: {
|
|
2
2
|
Provider: import("misstime").ComponentConstructor<import('intact-react').Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
3
|
Consumer: import("misstime").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
|
+
useContext: () => import("misstime").RefObject<any>;
|
|
4
5
|
};
|
|
@@ -11,5 +11,6 @@ export declare class Steps extends Component<StepsProps> {
|
|
|
11
11
|
static template: string | import("intact").Template<any>;
|
|
12
12
|
static typeDefs: Required<TypeDefs<StepsProps>>;
|
|
13
13
|
static defaults: () => Partial<StepsProps>;
|
|
14
|
+
private config;
|
|
14
15
|
private changeIndex;
|
|
15
16
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
3
|
import { __decorate } from "tslib";
|
|
3
4
|
import { Component } from 'intact-react';
|
|
4
5
|
import template from './index.vdt';
|
|
5
6
|
import { bind } from '../utils';
|
|
7
|
+
import { useConfigContext } from '../config';
|
|
6
8
|
export * from './step';
|
|
7
9
|
var typeDefs = {
|
|
8
10
|
value: Number,
|
|
@@ -24,7 +26,17 @@ export var Steps = /*#__PURE__*/function (_Component) {
|
|
|
24
26
|
_inheritsLoose(Steps, _Component);
|
|
25
27
|
|
|
26
28
|
function Steps() {
|
|
27
|
-
|
|
29
|
+
var _context;
|
|
30
|
+
|
|
31
|
+
var _this;
|
|
32
|
+
|
|
33
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
|
+
args[_key] = arguments[_key];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
38
|
+
_this.config = useConfigContext();
|
|
39
|
+
return _this;
|
|
28
40
|
}
|
|
29
41
|
|
|
30
42
|
var _proto = Steps.prototype;
|
|
@@ -20,9 +20,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
20
20
|
clickable = _this$get.clickable,
|
|
21
21
|
vertical = _this$get.vertical;
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
}, _classNameObj[className] = className, _classNameObj["k-" + type] = true, _classNameObj['k-clickable'] = clickable, _classNameObj['k-vertical'] = vertical, _classNameObj[makeStepsStyles()] = true, _classNameObj);
|
|
23
|
+
var k = this.config.k;
|
|
24
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-steps"] = true, _classNameObj[className] = className, _classNameObj[k + "-" + type] = true, _classNameObj[k + "-clickable"] = clickable, _classNameObj[k + "-vertical"] = vertical, _classNameObj[makeStepsStyles(k)] = true, _classNameObj);
|
|
26
25
|
var stepIndex = 0;
|
|
27
26
|
var steps = [];
|
|
28
27
|
eachChildren(children, function (vNode) {
|
package/components/steps/step.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
3
|
import { Component } from 'intact-react';
|
|
3
4
|
import template from './step.vdt';
|
|
5
|
+
import { useConfigContext } from '../config';
|
|
4
6
|
var typeDefs = {
|
|
5
7
|
title: String,
|
|
6
8
|
index: Number
|
|
@@ -9,7 +11,17 @@ export var Step = /*#__PURE__*/function (_Component) {
|
|
|
9
11
|
_inheritsLoose(Step, _Component);
|
|
10
12
|
|
|
11
13
|
function Step() {
|
|
12
|
-
|
|
14
|
+
var _context;
|
|
15
|
+
|
|
16
|
+
var _this;
|
|
17
|
+
|
|
18
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
|
+
args[_key] = arguments[_key];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
23
|
+
_this.config = useConfigContext();
|
|
24
|
+
return _this;
|
|
13
25
|
}
|
|
14
26
|
|
|
15
27
|
return Step;
|