@king-design/react 3.0.1 → 3.1.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/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/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 +1 -0
- package/components/layout/body.js +4 -3
- package/components/layout/footer.d.ts +1 -0
- package/components/layout/footer.js +15 -4
- package/components/layout/header.d.ts +1 -0
- package/components/layout/header.js +4 -6
- package/components/layout/layout.d.ts +1 -0
- package/components/layout/layout.js +4 -3
- package/components/layout/styles.d.ts +3 -3
- package/components/layout/styles.js +8 -8
- 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 +10 -10
- 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/row.d.ts +1 -0
- package/components/table/row.js +13 -1
- 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 +1 -0
- package/components/table/table.js +2 -0
- 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/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 +2 -1
- package/components/utils.js +20 -9
- 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/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
|
@@ -31,24 +31,23 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
31
31
|
strokeWidth = _this$get.strokeWidth,
|
|
32
32
|
children = _this$get.children;
|
|
33
33
|
|
|
34
|
+
var k = this.config.k;
|
|
34
35
|
var status = this.status.value;
|
|
35
36
|
var background = this.color.value || '';
|
|
36
|
-
var classNameObj = (_classNameObj = {
|
|
37
|
-
'k-progress': true
|
|
38
|
-
}, _classNameObj["k-" + type] = type, _classNameObj[className] = className, _classNameObj["k-" + status] = status !== 'normal', _classNameObj["k-" + size] = size !== 'default', _classNameObj[makeStyles()] = true, _classNameObj);
|
|
37
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-progress"] = true, _classNameObj[k + "-" + type] = type, _classNameObj[className] = className, _classNameObj[k + "-" + status] = status !== 'normal', _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
39
38
|
return _$cv('div', _extends({
|
|
40
39
|
'className': _$cn(classNameObj)
|
|
41
|
-
}, getRestProps(this)), [type === 'bar' ? _$ce(2, 'div', _$ce(2, 'div', _$ce(2, 'div', showInnerText ? _$ce(2, 'div', [percent, _$ct(' %\n ')], 0,
|
|
40
|
+
}, getRestProps(this)), [type === 'bar' ? _$ce(2, 'div', _$ce(2, 'div', _$ce(2, 'div', showInnerText ? _$ce(2, 'div', [percent, _$ct(' %\n ')], 0, _$cn(k + "-progress-inner-text")) : undefined, 0, _$cn(k + "-progress-bg"), {
|
|
42
41
|
'style': {
|
|
43
42
|
width: percent + '%',
|
|
44
43
|
background: background
|
|
45
44
|
}
|
|
46
|
-
}), 2,
|
|
45
|
+
}), 2, _$cn(k + "-progress-content")), 2, _$cn(k + "-progress-container")) : undefined, type === 'circle' ? _$ce(512, 'svg', (r = (120 - strokeWidth) / 2, circumference = 2 * Math.PI * r, [_$ce(2, 'circle', null, 1, _$cn(k + "-progress-meter"), {
|
|
47
46
|
'cx': '60',
|
|
48
47
|
'cy': '60',
|
|
49
48
|
'r': r,
|
|
50
49
|
'stroke-width': strokeWidth
|
|
51
|
-
}), _$ce(2, 'circle', null, 1,
|
|
50
|
+
}), _$ce(2, 'circle', null, 1, _$cn(k + "-progress-value"), {
|
|
52
51
|
'cx': '60',
|
|
53
52
|
'cy': '60',
|
|
54
53
|
'r': r,
|
|
@@ -62,26 +61,26 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
62
61
|
'repeatCount': 'indefinite',
|
|
63
62
|
'from': circumference,
|
|
64
63
|
'to': circumference * (1 - percent / 100)
|
|
65
|
-
}), _$ce(2, 'animate', null, 1, null, _$tmp0)], 4,
|
|
64
|
+
}), _$ce(2, 'animate', null, 1, null, _$tmp0)], 4, _$cn(k + "-progress-animate"), {
|
|
66
65
|
'cx': '60',
|
|
67
66
|
'cy': '60',
|
|
68
67
|
'r': r,
|
|
69
68
|
'stroke-width': strokeWidth,
|
|
70
69
|
'stroke-dasharray': circumference,
|
|
71
70
|
'stroke-dashoffset': circumference
|
|
72
|
-
}) : undefined]), 0,
|
|
71
|
+
}) : undefined]), 0, _$cn(k + "-progress-canvas"), _$tmp1) : undefined, children ? _$ce(2, 'div', children, 0, _$cn(k + "-progress-text")) : showOuterText ? _$ce(2, 'div', function () {
|
|
73
72
|
if (type !== 'circle') {
|
|
74
73
|
switch (status) {
|
|
75
74
|
case 'success':
|
|
76
|
-
icon =
|
|
75
|
+
icon = [k + "-icon-success-fill"];
|
|
77
76
|
break;
|
|
78
77
|
|
|
79
78
|
case 'error':
|
|
80
|
-
icon =
|
|
79
|
+
icon = [k + "-icon-error-fill"];
|
|
81
80
|
break;
|
|
82
81
|
|
|
83
82
|
case 'warning':
|
|
84
|
-
icon =
|
|
83
|
+
icon = [k + "-icon-warning-fill"];
|
|
85
84
|
break;
|
|
86
85
|
|
|
87
86
|
default:
|
|
@@ -90,12 +89,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
90
89
|
} else {
|
|
91
90
|
switch (status) {
|
|
92
91
|
case 'success':
|
|
93
|
-
icon =
|
|
92
|
+
icon = [k + "-icon-check"];
|
|
94
93
|
break;
|
|
95
94
|
|
|
96
95
|
case 'error':
|
|
97
96
|
case 'warning':
|
|
98
|
-
icon =
|
|
97
|
+
icon = [k + "-icon-close"];
|
|
99
98
|
break;
|
|
100
99
|
|
|
101
100
|
default:
|
|
@@ -105,14 +104,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
105
104
|
|
|
106
105
|
if (icon) {
|
|
107
106
|
return _$cc(Icon, {
|
|
108
|
-
'className': _$cn((_$cn2 = {
|
|
109
|
-
"k-progress-icon": true
|
|
110
|
-
}, _$cn2[icon] = true, _$cn2)),
|
|
107
|
+
'className': _$cn((_$cn2 = {}, _$cn2[k + "-progress-icon"] = true, _$cn2[icon] = true, _$cn2)),
|
|
111
108
|
'color': status === 'error' ? 'danger' : status
|
|
112
109
|
});
|
|
113
110
|
} else {
|
|
114
111
|
return _$ce(2, 'span', [percent, _$ct('%')], 0);
|
|
115
112
|
}
|
|
116
|
-
}(), 0,
|
|
113
|
+
}(), 0, _$cn(k + "-progress-text")) : undefined]);
|
|
117
114
|
}
|
|
118
115
|
;
|
|
@@ -82,11 +82,11 @@ setDefault(function () {
|
|
|
82
82
|
progress: defaults
|
|
83
83
|
}).progress;
|
|
84
84
|
});
|
|
85
|
-
export function makeStyles() {
|
|
86
|
-
return /*#__PURE__*/css("position:relative;line-height:1;&.k-bar{display:flex;align-items:center;.k-progress-container{height:", progress.bar.height, ";border-radius:", progress.bar.height, ";background-color:", progress.stokeColor.color, ";overflow:hidden;position:relative;vertical-align:middle;font-size:", progress.bar.innerText.fontSize, ";flex:1;}.k-progress-content{position:relative;left:0;top:0;white-space:nowrap;width:100%;height:100%;border-radius:", progress.bar.height, ";}.k-progress-bg{background-color:", progress.stokeColor.normal, ";height:100%;border-radius:", progress.bar.height, ";transition:", progress.animation.transition, ";position:relative;}.k-progress-inner-text{display:inline-block;vertical-align:top;color:#ffffff;line-height:", progress.bar.height, ";width:100%;text-align:right;padding:", progress.bar.innerText.padding, ";}&.k-success{.k-progress-bg{background:", progress.stokeColor.success, ";}}&.k-error{.k-progress-bg{background:", progress.stokeColor.error, ";}}&.k-warning{.k-progress-bg{background:", progress.stokeColor.warning, ";}}&.k-active{.k-progress-bg{&:before{content:\"\";position:absolute;top:0;bottom:0;right:0;left:0;background-color:#fff;animation:", progressBarAnimation, " 2s ease infinite;border-radius:", progress.bar.height, ";}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
87
|
-
return /*#__PURE__*/css("&.k-", size, "{font-size:", progress.bar[size].fontSize, ";.k-progress-container{height:", progress.bar[size].height, ";}}");
|
|
88
|
-
}), " .k-progress-text{margin-left:", progress.bar.textMarginLeft, ";width:", progress.bar.textWidth, ";line-height:", progress.bar.outerText.height, ";height:", progress.bar.outerText.height, ";}}&.k-circle{width:", progress.circle.width, ";height:", progress.circle.width, ";font-size:", progress.circle.fontSize, ";", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
85
|
+
export function makeStyles(k) {
|
|
86
|
+
return /*#__PURE__*/css("position:relative;line-height:1;&.", k, "-bar{display:flex;align-items:center;.", k, "-progress-container{height:", progress.bar.height, ";border-radius:", progress.bar.height, ";background-color:", progress.stokeColor.color, ";overflow:hidden;position:relative;vertical-align:middle;font-size:", progress.bar.innerText.fontSize, ";flex:1;}.", k, "-progress-content{position:relative;left:0;top:0;white-space:nowrap;width:100%;height:100%;border-radius:", progress.bar.height, ";}.", k, "-progress-bg{background-color:", progress.stokeColor.normal, ";height:100%;border-radius:", progress.bar.height, ";transition:", progress.animation.transition, ";position:relative;}.", k, "-progress-inner-text{display:inline-block;vertical-align:top;color:#ffffff;line-height:", progress.bar.height, ";width:100%;text-align:right;padding:", progress.bar.innerText.padding, ";}&.", k, "-success{.", k, "-progress-bg{background:", progress.stokeColor.success, ";}}&.", k, "-error{.", k, "-progress-bg{background:", progress.stokeColor.error, ";}}&.", k, "-warning{.", k, "-progress-bg{background:", progress.stokeColor.warning, ";}}&.", k, "-active{.", k, "-progress-bg{&:before{content:\"\";position:absolute;top:0;bottom:0;right:0;left:0;background-color:#fff;animation:", progressBarAnimation, " 2s ease infinite;border-radius:", progress.bar.height, ";}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
87
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", progress.bar[size].fontSize, ";.", k, "-progress-container{height:", progress.bar[size].height, ";}}");
|
|
88
|
+
}), " .", k, "-progress-text{margin-left:", progress.bar.textMarginLeft, ";width:", progress.bar.textWidth, ";line-height:", progress.bar.outerText.height, ";height:", progress.bar.outerText.height, ";}}&.", k, "-circle{width:", progress.circle.width, ";height:", progress.circle.width, ";font-size:", progress.circle.fontSize, ";", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
89
89
|
var styles = progress.circle[size];
|
|
90
|
-
return /*#__PURE__*/css("&.k-", size, "{width:", styles.width, ";height:", styles.width, ";font-size:", styles.fontSize, ";.k-progress-icon{font-size:", styles.iconFontSize, ";}}");
|
|
91
|
-
}), ";.k-progress-canvas{transform:rotate(-90deg);}.k-progress-meter,.k-progress-value,.k-progress-animate{fill:none;}.k-progress-meter{stroke:", progress.stokeColor.color, ";}.k-progress-value{stroke:", progress.stokeColor.normal, ";stroke-linecap:round;transition:", progress.animation.transition, ";}.k-progress-animate{stroke:#fff;stroke-linecap:round;}.k-progress-text{position:absolute;top:50%;text-align:center;width:100%;transform:translateY(-50%);}.k-progress-icon{font-size:", progress.circle.iconFontSize, ";}&.k-success{.k-progress-value{stroke:", progress.stokeColor.success, ";}}&.k-error{.k-progress-value{stroke:", progress.stokeColor.error, ";}}&.k-warning{.k-progress-value{stroke:", progress.stokeColor.warning, ";}}}");
|
|
90
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";height:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-progress-icon{font-size:", styles.iconFontSize, ";}}");
|
|
91
|
+
}), ";.", k, "-progress-canvas{transform:rotate(-90deg);}.", k, "-progress-meter,.", k, "-progress-value,.", k, "-progress-animate{fill:none;}.", k, "-progress-meter{stroke:", progress.stokeColor.color, ";}.", k, "-progress-value{stroke:", progress.stokeColor.normal, ";stroke-linecap:round;transition:", progress.animation.transition, ";}.", k, "-progress-animate{stroke:#fff;stroke-linecap:round;}.", k, "-progress-text{position:absolute;top:50%;text-align:center;width:100%;transform:translateY(-50%);}.", k, "-progress-icon{font-size:", progress.circle.iconFontSize, ";}&.", k, "-success{.", k, "-progress-value{stroke:", progress.stokeColor.success, ";}}&.", k, "-error{.", k, "-progress-value{stroke:", progress.stokeColor.error, ";}}&.", k, "-warning{.", k, "-progress-value{stroke:", progress.stokeColor.warning, ";}}}");
|
|
92
92
|
}
|
|
@@ -15,6 +15,7 @@ export declare class Radio<Value = false, True = true> extends Component<RadioPr
|
|
|
15
15
|
static defaults: () => Partial<RadioProps<false, true>>;
|
|
16
16
|
static events: Events<RadioEvents<true>>;
|
|
17
17
|
private elementRef;
|
|
18
|
+
private config;
|
|
18
19
|
private onKeypress;
|
|
19
20
|
private onClick;
|
|
20
21
|
private fixClick;
|
|
@@ -4,6 +4,7 @@ import { __decorate } from "tslib";
|
|
|
4
4
|
import { Component, createRef } from 'intact-react';
|
|
5
5
|
import { bind } from '../utils';
|
|
6
6
|
import template from './index.vdt';
|
|
7
|
+
import { useConfigContext } from '../config';
|
|
7
8
|
var typeDefs = {
|
|
8
9
|
disabled: Boolean,
|
|
9
10
|
value: null,
|
|
@@ -35,6 +36,7 @@ export var Radio = /*#__PURE__*/function (_Component) {
|
|
|
35
36
|
|
|
36
37
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
37
38
|
_this.elementRef = createRef();
|
|
39
|
+
_this.config = useConfigContext();
|
|
38
40
|
return _this;
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -25,11 +25,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
25
25
|
rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
|
|
26
26
|
|
|
27
27
|
var isChecked = value === trueValue;
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
'k-disabled': disabled,
|
|
31
|
-
'k-checked': isChecked
|
|
32
|
-
}, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj); // let evClick;
|
|
28
|
+
var k = this.config.k;
|
|
29
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-radio"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-checked"] = isChecked, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj); // let evClick;
|
|
33
30
|
|
|
34
31
|
var events = ['ev-click', 'ev-change', 'ev-mouseenter', 'ev-mouseleave'].reduce(function (memo, name) {
|
|
35
32
|
if (rest[name]) {
|
|
@@ -63,7 +60,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
63
60
|
'ref': this.elementRef,
|
|
64
61
|
'checked': isChecked,
|
|
65
62
|
'ev-click': this.onClick
|
|
66
|
-
})), 2,
|
|
67
|
-
}), children ? _$ce(2, 'span', children, 0,
|
|
63
|
+
})), 2, _$cn(k + "-radio-wrapper"))
|
|
64
|
+
}), children ? _$ce(2, 'span', children, 0, _$cn(k + "-radio-text")) : undefined]);
|
|
68
65
|
}
|
|
69
66
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -60,6 +60,6 @@ setDefault(function () {
|
|
|
60
60
|
radio: defaults
|
|
61
61
|
}).radio;
|
|
62
62
|
});
|
|
63
|
-
export function makeStyles() {
|
|
64
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-radio-wrapper{width:", radio.width, ";height:", radio.width, ";border:1px solid ", radio.borderColor, ";border-radius:50%;transition:all ", radio.transition, ";position:relative;background:", radio.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", radio.innerWidth, ";height:", radio.innerWidth, ";top:50%;left:50%;margin-left:calc(-", radio.innerWidth, " / 2);margin-top:calc(-", radio.innerWidth, " / 2);border-radius:50%;background-color:", radio.checkedColor, ";transform:scale(0);transition:all ", radio.transition, ";}}&:hover{.k-radio-wrapper{border:1px solid ", radio.hoverBorderColor, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;}.k-radio-text{margin-left:", radio.textGap, ";flex:0 1 auto;}&.k-checked{.k-radio-wrapper{border-color:", radio.checkedColor, ";&:before{transform:scale(1);}}}&:focus{outline:none;.k-radio-wrapper{border-color:", radio.checkedColor, ";}}&.k-disabled{color:", radio.disabled.color, ";cursor:not-allowed;.k-radio-wrapper{border-color:", radio.disabled.borderColor, ";background:", radio.disabled.bgColor, ";}input{cursor:not-allowed;}&.k-checked{.k-radio-wrapper{border-color:", radio.disabled.checked.borderColor, ";background:", radio.disabled.checked.bgColor, ";&:before{background:", radio.disabled.checked.innerColor, ";}}}}");
|
|
63
|
+
export function makeStyles(k) {
|
|
64
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.", k, "-radio-wrapper{width:", radio.width, ";height:", radio.width, ";border:1px solid ", radio.borderColor, ";border-radius:50%;transition:all ", radio.transition, ";position:relative;background:", radio.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", radio.innerWidth, ";height:", radio.innerWidth, ";top:50%;left:50%;margin-left:calc(-", radio.innerWidth, " / 2);margin-top:calc(-", radio.innerWidth, " / 2);border-radius:50%;background-color:", radio.checkedColor, ";transform:scale(0);transition:all ", radio.transition, ";}}&:hover{.", k, "-radio-wrapper{border:1px solid ", radio.hoverBorderColor, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;}.", k, "-radio-text{margin-left:", radio.textGap, ";flex:0 1 auto;}&.", k, "-checked{.", k, "-radio-wrapper{border-color:", radio.checkedColor, ";&:before{transform:scale(1);}}}&:focus{outline:none;.", k, "-radio-wrapper{border-color:", radio.checkedColor, ";}}&.", k, "-disabled{color:", radio.disabled.color, ";cursor:not-allowed;.", k, "-radio-wrapper{border-color:", radio.disabled.borderColor, ";background:", radio.disabled.bgColor, ";}input{cursor:not-allowed;}&.", k, "-checked{.", k, "-radio-wrapper{border-color:", radio.disabled.checked.borderColor, ";background:", radio.disabled.checked.bgColor, ";&:before{background:", radio.disabled.checked.innerColor, ";}}}}");
|
|
65
65
|
}
|
package/components/rate/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
|
|
|
3
3
|
import { Component } from 'intact-react';
|
|
4
4
|
import template from './index.vdt';
|
|
5
5
|
import { useActiveValue } from './useActiveValue';
|
|
6
|
+
import { useConfigContext } from '../config';
|
|
6
7
|
var typeDefs = {
|
|
7
8
|
value: Number,
|
|
8
9
|
count: Number,
|
|
@@ -35,6 +36,7 @@ export var Rate = /*#__PURE__*/function (_Component) {
|
|
|
35
36
|
|
|
36
37
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
37
38
|
_this.activeValue = useActiveValue();
|
|
39
|
+
_this.config = useConfigContext();
|
|
38
40
|
return _this;
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -27,10 +27,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
27
27
|
onClick = _this$activeValue.onClick,
|
|
28
28
|
onMouseEnter = _this$activeValue.onMouseEnter,
|
|
29
29
|
onMouseLeaveComponent = _this$activeValue.onMouseLeaveComponent;
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
'k-disabled': disabled
|
|
33
|
-
}, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
30
|
+
var k = this.config.k;
|
|
31
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-rate"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
34
32
|
var icon = (_$blocks['icon'] = function ($super) {
|
|
35
33
|
return _$cc(Icon, _$tmp0);
|
|
36
34
|
}, __$blocks['icon'] = function ($super, data) {
|
|
@@ -55,13 +53,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
55
53
|
for (var i = 0; i < count; i++) {
|
|
56
54
|
var _$cn2;
|
|
57
55
|
|
|
58
|
-
var _className = activeValue.value >= i + 1 ?
|
|
56
|
+
var _className = activeValue.value >= i + 1 ? [k + "-full"] : activeValue.value === i + 0.5 ? [k + "-half"] : null;
|
|
59
57
|
|
|
60
58
|
var halfStep = half ? i + 0.5 : i + 1;
|
|
61
59
|
|
|
62
|
-
var item = _$ce(2, 'div', [rateIcon("
|
|
63
|
-
"k-rate-item": true
|
|
64
|
-
}, _$cn2[_className] = _className, _$cn2)));
|
|
60
|
+
var item = _$ce(2, 'div', [rateIcon(k + "-rate-first", halfStep), _$ct('\n '), rateIcon(k + "-rate-second", i + 1)], 0, _$cn((_$cn2 = {}, _$cn2[k + "-rate-item"] = true, _$cn2[_className] = _className, _$cn2)));
|
|
65
61
|
|
|
66
62
|
items.push(item);
|
|
67
63
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -25,6 +25,6 @@ setDefault(function () {
|
|
|
25
25
|
rate: defaults
|
|
26
26
|
}).rate;
|
|
27
27
|
});
|
|
28
|
-
export function makeStyles() {
|
|
29
|
-
return /*#__PURE__*/css("display:inline-block;.k-rate-item{display:inline-block;margin-right:", rate.item.gap, ";cursor:pointer;position:relative;color:", rate.color, ";transition:all ", rate.transition, ";&:hover{transform:", rate.item.hoverTransform, ";}&.k-full{color:", rate.activeColor, ";}&.k-half{.k-rate-first{color:", rate.activeColor, ";}}}.k-rate-first{position:absolute;top:0;left:0;width:50%;height:100%;overflow:hidden;}.k-icon{font-size:", rate.iconFontSize, ";color:inherit;}&.k-disabled{.k-rate-item{cursor:default;&:hover{transform:none;}}}");
|
|
28
|
+
export function makeStyles(k) {
|
|
29
|
+
return /*#__PURE__*/css("display:inline-block;.", k, "-rate-item{display:inline-block;margin-right:", rate.item.gap, ";cursor:pointer;position:relative;color:", rate.color, ";transition:all ", rate.transition, ";&:hover{transform:", rate.item.hoverTransform, ";}&.", k, "-full{color:", rate.activeColor, ";}&.", k, "-half{.", k, "-rate-first{color:", rate.activeColor, ";}}}.", k, "-rate-first{position:absolute;top:0;left:0;width:50%;height:100%;overflow:hidden;}.", k, "-icon{font-size:", rate.iconFontSize, ";color:inherit;}&.", k, "-disabled{.", k, "-rate-item{cursor:default;&:hover{transform:none;}}}");
|
|
30
30
|
}
|
|
@@ -5,6 +5,7 @@ import template from './index.vdt';
|
|
|
5
5
|
import { useList } from './useList';
|
|
6
6
|
import { useTranslate } from './useTranslate';
|
|
7
7
|
import { useMouseEvents } from './useMouseEvents';
|
|
8
|
+
import { useConfigContext } from '../config';
|
|
8
9
|
var typeDefs = {
|
|
9
10
|
value: null,
|
|
10
11
|
count: Number,
|
|
@@ -36,6 +37,7 @@ export var ScrollSelect = /*#__PURE__*/function (_Component) {
|
|
|
36
37
|
_this.list = useList();
|
|
37
38
|
_this.translate = useTranslate();
|
|
38
39
|
_this.mouseEvents = useMouseEvents(_this.translate.translate, _this.list);
|
|
40
|
+
_this.config = useConfigContext();
|
|
39
41
|
return _this;
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -16,11 +16,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
16
16
|
disabled = _this$get.disabled,
|
|
17
17
|
disable = _this$get.disable;
|
|
18
18
|
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
'k-dragging': this.mouseEvents.dragging.value,
|
|
22
|
-
'k-disabled': disabled
|
|
23
|
-
}, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
19
|
+
var k = this.config.k;
|
|
20
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-scroll-select"] = true, _classNameObj[k + "-dragging"] = this.mouseEvents.dragging.value, _classNameObj[k + "-disabled"] = disabled, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
24
21
|
var _this$mouseEvents = this.mouseEvents,
|
|
25
22
|
onStart = _this$mouseEvents.onStart,
|
|
26
23
|
onWheel = _this$mouseEvents.onWheel,
|
|
@@ -28,14 +25,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
28
25
|
return _$cv('div', _extends({}, getRestProps(this), {
|
|
29
26
|
'className': _$cn(classNameObj)
|
|
30
27
|
}), [_$ce(2, 'div', _$ma(this.list.data.value, function ($value, $key) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"k-disabled": disabled || disable && disable.call(this, $value.value)
|
|
35
|
-
}), {
|
|
28
|
+
var _$cn2;
|
|
29
|
+
|
|
30
|
+
return _$ce(2, 'div', $value.label, 0, _$cn((_$cn2 = {}, _$cn2[k + "-scroll-select-item"] = true, _$cn2[k + "-active"] = $value.value === value, _$cn2[k + "-disabled"] = disabled || disable && disable.call(this, $value.value), _$cn2)), {
|
|
36
31
|
'ev-click': !disabled ? onClick.bind(this, $value, $key) : null
|
|
37
32
|
});
|
|
38
|
-
}, $this), 4,
|
|
33
|
+
}, $this), 4, _$cn(k + "-scroll-select-wrapper"), {
|
|
39
34
|
'style': {
|
|
40
35
|
transform: "translateY(" + this.translate.translate.value + "px)",
|
|
41
36
|
marginTop: this.mouseEvents.marginTop.value + "px"
|
|
@@ -52,6 +47,6 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
52
47
|
};
|
|
53
48
|
|
|
54
49
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
55
|
-
}, __$blocks['append'](_$no)), 0,
|
|
50
|
+
}, __$blocks['append'](_$no)), 0, _$cn(k + "-scroll-select-append")) : undefined, _$ce(2, 'div', null, 1, _$cn(k + "-scroll-select-border"))]);
|
|
56
51
|
}
|
|
57
52
|
;
|
|
@@ -39,6 +39,6 @@ setDefault(function () {
|
|
|
39
39
|
}).scrollSelect;
|
|
40
40
|
});
|
|
41
41
|
export { scrollSelect };
|
|
42
|
-
export function makeStyles() {
|
|
43
|
-
return /*#__PURE__*/css("text-align:center;overflow:hidden;max-height:100%;height:", scrollSelect.height, ";user-select:none;position:relative;.k-scroll-select-wrapper{transition:transform ", scrollSelect.transition, ";}&.k-dragging{.k-scroll-select-wrapper{transition:none;}}&.k-disabled{.k-scroll-select-item{cursor:not-allowed;color:", scrollSelect.item.disabledColor, ";}}.k-scroll-select-item{line-height:", scrollSelect.item.height, ";color:", scrollSelect.item.color, ";cursor:pointer;white-space:nowrap;&:hover{background:", scrollSelect.item.hoverBgColor, ";}&.k-active{color:", scrollSelect.item.activeColor, ";font-size:", scrollSelect.item.activeFontSize, ";}&.k-disabled{color:", scrollSelect.item.disabledColor, ";}}.k-scroll-select-append{position:absolute;top:50%;right:0;transform:translateY(-50%);}.k-scroll-select-border{position:absolute;width:100%;top:50%;margin-top:calc(-", scrollSelect.item.height, " / 2);height:", scrollSelect.item.height, ";border-top:", scrollSelect.item.border, ";border-bottom:", scrollSelect.item.border, ";pointer-events:none;}");
|
|
42
|
+
export function makeStyles(k) {
|
|
43
|
+
return /*#__PURE__*/css("text-align:center;overflow:hidden;max-height:100%;height:", scrollSelect.height, ";user-select:none;position:relative;.", k, "-scroll-select-wrapper{transition:transform ", scrollSelect.transition, ";}&.", k, "-dragging{.", k, "-scroll-select-wrapper{transition:none;}}&.", k, "-disabled{.", k, "-scroll-select-item{cursor:not-allowed;color:", scrollSelect.item.disabledColor, ";}}.", k, "-scroll-select-item{line-height:", scrollSelect.item.height, ";color:", scrollSelect.item.color, ";cursor:pointer;white-space:nowrap;&:hover{background:", scrollSelect.item.hoverBgColor, ";}&.", k, "-active{color:", scrollSelect.item.activeColor, ";font-size:", scrollSelect.item.activeFontSize, ";}&.", k, "-disabled{color:", scrollSelect.item.disabledColor, ";}}.", k, "-scroll-select-append{position:absolute;top:50%;right:0;transform:translateY(-50%);}.", k, "-scroll-select-border{position:absolute;width:100%;top:50%;margin-top:calc(-", scrollSelect.item.height, " / 2);height:", scrollSelect.item.height, ";border-top:", scrollSelect.item.border, ";border-bottom:", scrollSelect.item.border, ";pointer-events:none;}");
|
|
44
44
|
}
|
|
@@ -51,6 +51,10 @@ export declare abstract class BaseSelect<T extends BaseSelectProps<any> = BaseSe
|
|
|
51
51
|
};
|
|
52
52
|
private focusout;
|
|
53
53
|
private draggable;
|
|
54
|
+
protected config: {
|
|
55
|
+
cls: (name: string) => string;
|
|
56
|
+
readonly k: string;
|
|
57
|
+
};
|
|
54
58
|
init(): void;
|
|
55
59
|
protected abstract getPlaceholder(): Children;
|
|
56
60
|
protected abstract getLabel(): Children;
|
|
@@ -14,6 +14,7 @@ import { useInput } from './useInput';
|
|
|
14
14
|
import { useFocusout } from './useFocusout';
|
|
15
15
|
import { isNullOrUndefined } from 'intact-shared';
|
|
16
16
|
import { useDraggable } from './useDraggble';
|
|
17
|
+
import { useConfigContext } from '../config';
|
|
17
18
|
var typeDefs = {
|
|
18
19
|
value: null,
|
|
19
20
|
multiple: Boolean,
|
|
@@ -65,6 +66,7 @@ export var BaseSelect = /*#__PURE__*/function (_Component) {
|
|
|
65
66
|
_this.input = useInput(_this.resetKeywords);
|
|
66
67
|
_this.focusout = useFocusout();
|
|
67
68
|
_this.draggable = useDraggable();
|
|
69
|
+
_this.config = useConfigContext();
|
|
68
70
|
return _this;
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
3
3
|
import _valuesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/values";
|
|
4
|
-
import { createUnknownComponentVNode as _$cc,
|
|
4
|
+
import { createUnknownComponentVNode as _$cc, className as _$cn, createVNode as _$cv, createElementVNode as _$ce, noop as _$no, map as _$ma, extend as _$ex, EMPTY_OBJ as _$em } from 'intact-react';
|
|
5
5
|
import { TransitionGroup, Transition } from 'intact';
|
|
6
6
|
import { Input } from '../input';
|
|
7
7
|
import { Icon } from '../icon';
|
|
@@ -16,9 +16,6 @@ var _$tmp0 = {
|
|
|
16
16
|
'className': 'ion-load-c',
|
|
17
17
|
'rotate': true
|
|
18
18
|
};
|
|
19
|
-
var _$tmp1 = {
|
|
20
|
-
'className': 'k-icon-search'
|
|
21
|
-
};
|
|
22
19
|
export default function ($props, $blocks, $__proto__) {
|
|
23
20
|
var _classNameObj,
|
|
24
21
|
_this = this;
|
|
@@ -51,10 +48,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
51
48
|
nowrap = _this$get.nowrap,
|
|
52
49
|
draggable = _this$get.draggable;
|
|
53
50
|
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
'k-disabled': disabled
|
|
57
|
-
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-fluid'] = fluid, _classNameObj['k-inline'] = inline, _classNameObj['k-flat'] = flat, _classNameObj['k-nowrap'] = nowrap, _classNameObj[className] = className, _classNameObj[$props.className] = $props.className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
51
|
+
var k = this.config.k;
|
|
52
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-select"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-fluid"] = fluid, _classNameObj[k + "-inline"] = inline, _classNameObj[k + "-flat"] = flat, _classNameObj[k + "-nowrap"] = nowrap, _classNameObj[className] = className, _classNameObj[$props.className] = $props.className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
58
53
|
var placeholder = this.getPlaceholder();
|
|
59
54
|
var label = this.getLabel();
|
|
60
55
|
var hasValue = this.hasValue();
|
|
@@ -66,7 +61,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
66
61
|
onFocusout = _this$focusout.onFocusout,
|
|
67
62
|
triggerRef = _this$focusout.triggerRef;
|
|
68
63
|
var filterInput = filterable ? _$cc(Input, {
|
|
69
|
-
'className':
|
|
64
|
+
'className': _$cn(k + "-select-input"),
|
|
70
65
|
'value': keywords,
|
|
71
66
|
'ev-$change:value': onInput,
|
|
72
67
|
'disabled': disabled,
|
|
@@ -83,6 +78,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
83
78
|
return _$cc(ErrorContext.Consumer, {
|
|
84
79
|
'defaultValue': false,
|
|
85
80
|
'children': function children(isInvalid) {
|
|
81
|
+
var _$cn2;
|
|
82
|
+
|
|
86
83
|
return _$cc(Wave, {
|
|
87
84
|
'disabled': disabled || isInvalid || inline,
|
|
88
85
|
'inset': '-2px',
|
|
@@ -111,7 +108,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
111
108
|
};
|
|
112
109
|
|
|
113
110
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
114
|
-
}, __$blocks['prefix'](_$no)), 0,
|
|
111
|
+
}, __$blocks['prefix'](_$no)), 0, _$cn(k + "-select-prefix")) : undefined, _$ce(2, 'div', [_$ce(64, 'input', null, 1, null, {
|
|
115
112
|
'type': 'hidden',
|
|
116
113
|
'value': value,
|
|
117
114
|
'name': name
|
|
@@ -131,7 +128,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
131
128
|
'readonly': !show,
|
|
132
129
|
'waveDisabled': true,
|
|
133
130
|
'flat': flat
|
|
134
|
-
}, 'input', inputRef) : !filterable && !hasValue ? _$ce(2, 'div', placeholder, 0,
|
|
131
|
+
}, 'input', inputRef) : !filterable && !hasValue ? _$ce(2, 'div', placeholder, 0, _$cn(k + "-select-placeholder c-ellipsis"), null, 'placeholder') : !multiple ? _$ce(2, 'div', (_$blocks['value'] = function ($super) {
|
|
135
132
|
return label;
|
|
136
133
|
}, __$blocks['value'] = function ($super, data) {
|
|
137
134
|
var block = $blocks['value'];
|
|
@@ -141,7 +138,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
141
138
|
};
|
|
142
139
|
|
|
143
140
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
144
|
-
}, __$blocks['value'](_$no, [value, label])), 0,
|
|
141
|
+
}, __$blocks['value'](_$no, [value, label])), 0, _$cn(k + "-select-value c-ellipsis"), null, 'value') : _$ce(2, 'div', [(_$blocks['values'] = function ($super) {
|
|
145
142
|
return label && label.length || filterable ? _$cc(Tags, {
|
|
146
143
|
'nowrap': nowrap,
|
|
147
144
|
'size': size,
|
|
@@ -192,17 +189,16 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
192
189
|
};
|
|
193
190
|
|
|
194
191
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
195
|
-
}, _valuesInstanceProperty(__$blocks).call(__$blocks, _$no, [value, label])), $blocks && _valuesInstanceProperty($blocks) ? filterInput : undefined], 0,
|
|
196
|
-
})], 0,
|
|
197
|
-
'className': _$cn({
|
|
198
|
-
"k-select-clear ion-ios-close": true,
|
|
199
|
-
"k-show": hasValue
|
|
200
|
-
}),
|
|
192
|
+
}, _valuesInstanceProperty(__$blocks).call(__$blocks, _$no, [value, label])), $blocks && _valuesInstanceProperty($blocks) ? filterInput : undefined], 0, _$cn(k + "-select-values"), null, 'values')
|
|
193
|
+
})], 0, _$cn(k + "-select-main")), !hideIcon || clearable || loading || $blocks.suffix ? _$ce(2, 'span', [clearable && !disabled ? _$cc(Icon, {
|
|
194
|
+
'className': _$cn((_$cn2 = {}, _$cn2[k + "-select-clear ion-ios-close"] = true, _$cn2[k + "-show"] = hasValue, _$cn2)),
|
|
201
195
|
'ev-click': _this.clear,
|
|
202
196
|
'hoverable': true
|
|
203
197
|
}) : undefined, _$ce(2, 'span', (_$blocks['suffix'] = function ($super) {
|
|
204
|
-
return loading ? _$cc(Icon, _$tmp0) : !hideIcon ? filterable && show ? _$cc(Icon,
|
|
205
|
-
'className':
|
|
198
|
+
return loading ? _$cc(Icon, _$tmp0) : !hideIcon ? filterable && show ? _$cc(Icon, {
|
|
199
|
+
'className': _$cn(k + "-icon-search")
|
|
200
|
+
}) : _$cc(Icon, {
|
|
201
|
+
'className': _$cn(k + "-select-arrow " + k + "-icon-down"),
|
|
206
202
|
'disabled': $props.isDisableArrow
|
|
207
203
|
}) : undefined;
|
|
208
204
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
@@ -213,7 +209,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
213
209
|
};
|
|
214
210
|
|
|
215
211
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
216
|
-
}, __$blocks['suffix'](_$no)), 0,
|
|
212
|
+
}, __$blocks['suffix'](_$no)), 0, _$cn(k + "-select-suffix-icon"))], 0, _$cn(k + "-select-suffix")) : undefined]), (_$blocks['base-menu'] = function ($super) {
|
|
217
213
|
return _$ce(2, 'div', 'should be implemeted', 16);
|
|
218
214
|
}, __$blocks['base-menu'] = function ($super, data) {
|
|
219
215
|
var block = $blocks['base-menu'];
|
|
@@ -3,6 +3,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
|
|
|
3
3
|
import { Component, inject, VNode } from 'intact-react';
|
|
4
4
|
import template from './group.vdt';
|
|
5
5
|
import { SELECT } from './constants';
|
|
6
|
+
import { useConfigContext } from '../config';
|
|
6
7
|
var typeDefs = {
|
|
7
8
|
label: [String, Number, VNode]
|
|
8
9
|
};
|
|
@@ -20,6 +21,7 @@ export var OptionGroup = /*#__PURE__*/function (_Component) {
|
|
|
20
21
|
|
|
21
22
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
22
23
|
_this.select = inject(SELECT);
|
|
24
|
+
_this.config = useConfigContext();
|
|
23
25
|
return _this;
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -19,9 +19,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
19
19
|
var _this$select$get = this.select.get(),
|
|
20
20
|
card = _this$select$get.card;
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
}, _classNameObj[className] = className, _classNameObj[makeGroupStyles()] = true, _classNameObj);
|
|
22
|
+
var k = this.config.k;
|
|
23
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-select-group"] = true, _classNameObj[className] = className, _classNameObj[makeGroupStyles(k)] = true, _classNameObj);
|
|
25
24
|
return _$cv('div', _extends({}, getRestProps(this), {
|
|
26
25
|
'className': _$cn(classNameObj)
|
|
27
26
|
}), [!card ? _$ce(2, 'div', (_$blocks['label'] = function ($super) {
|
|
@@ -34,6 +33,6 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
37
|
-
}, __$blocks['label'](_$no)), 0,
|
|
36
|
+
}, __$blocks['label'](_$no)), 0, _$cn(k + "-select-group-label")) : undefined, children]);
|
|
38
37
|
}
|
|
39
38
|
;
|
|
@@ -5,6 +5,7 @@ import template from './menu.vdt';
|
|
|
5
5
|
import { SELECT } from './constants';
|
|
6
6
|
import { useCard } from './useCard';
|
|
7
7
|
import { useSearchable } from './useSearchable';
|
|
8
|
+
import { useConfigContext } from '../config';
|
|
8
9
|
export var SelectMenu = /*#__PURE__*/function (_Component) {
|
|
9
10
|
_inheritsLoose(SelectMenu, _Component);
|
|
10
11
|
|
|
@@ -21,6 +22,7 @@ export var SelectMenu = /*#__PURE__*/function (_Component) {
|
|
|
21
22
|
_this.select = inject(SELECT);
|
|
22
23
|
_this.card = useCard(_this.select.label.activeIndices);
|
|
23
24
|
_this.searchable = useSearchable();
|
|
25
|
+
_this.config = useConfigContext();
|
|
24
26
|
return _this;
|
|
25
27
|
}
|
|
26
28
|
|