@king-design/react 3.0.1 → 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/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 +1 -1
- 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
package/components/icon/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
|
|
|
6
6
|
import { Component } from 'intact-react';
|
|
7
7
|
import template from './index.vdt';
|
|
8
8
|
import { colors, sizes } from './styles';
|
|
9
|
+
import { useConfigContext } from '../config';
|
|
9
10
|
var typeDefs = {
|
|
10
11
|
size: _concatInstanceProperty(_context = []).call(_context, sizes, ['default', String, Number]),
|
|
11
12
|
color: String,
|
|
@@ -36,6 +37,7 @@ export var Icon = /*#__PURE__*/function (_Component) {
|
|
|
36
37
|
|
|
37
38
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context3 = [this]).call(_context3, args)) || this;
|
|
38
39
|
_this.colors = defaultColors;
|
|
40
|
+
_this.config = useConfigContext();
|
|
39
41
|
return _this;
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -19,28 +19,24 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
19
19
|
children = _this$get.children,
|
|
20
20
|
disabled = _this$get.disabled;
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
'k-rotate': rotate,
|
|
25
|
-
'k-hoverable': !disabled && hoverable,
|
|
26
|
-
'k-disabled': disabled
|
|
27
|
-
}, _classNameObj[className] = className, _classNameObj);
|
|
22
|
+
var k = this.config.k;
|
|
23
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-icon"] = true, _classNameObj[k + "-rotate"] = rotate, _classNameObj[k + "-hoverable"] = !disabled && hoverable, _classNameObj[k + "-disabled"] = disabled, _classNameObj[className] = className, _classNameObj);
|
|
28
24
|
var _style = {};
|
|
29
25
|
|
|
30
26
|
if (/^\d+$/.test(size)) {
|
|
31
27
|
_style.fontSize = size + 'px';
|
|
32
28
|
} else if (size !== 'default') {
|
|
33
|
-
classNameObj["
|
|
29
|
+
classNameObj[k + "-" + size] = true;
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
if (this.colors.indexOf(color) > -1) {
|
|
37
|
-
classNameObj["
|
|
38
|
-
classNameObj[makeStyles()] = true;
|
|
33
|
+
classNameObj[k + "-" + color] = color !== 'default';
|
|
34
|
+
classNameObj[makeStyles(k)] = true;
|
|
39
35
|
} else if (color) {
|
|
40
36
|
_style.color = color;
|
|
41
|
-
classNameObj[makeStyles(color)] = true;
|
|
37
|
+
classNameObj[makeStyles(k, color)] = true;
|
|
42
38
|
} else {
|
|
43
|
-
classNameObj[makeStyles()] = true;
|
|
39
|
+
classNameObj[makeStyles(k)] = true;
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
return _$cv('i', _extends({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../../styles/fonts/iconfont';
|
|
2
1
|
import '../../styles/fonts/ionicons';
|
|
3
2
|
import '../../styles/global';
|
|
4
3
|
export declare const colors: readonly ["primary", "warning", "danger", "success"];
|
|
5
4
|
export declare const sizes: readonly ["large", "small", "mini"];
|
|
6
|
-
export default function makeStyles(color?: string): string;
|
|
5
|
+
export default function makeStyles(k: string, color?: string): string;
|
|
@@ -3,7 +3,7 @@ import { css } from '@emotion/css';
|
|
|
3
3
|
import { theme, setDefault } from '../../styles/theme';
|
|
4
4
|
import { deepDefaults, palette } from '../../styles/utils';
|
|
5
5
|
import { rotate } from '../../styles/keyframes';
|
|
6
|
-
import '../../styles/fonts/iconfont';
|
|
6
|
+
import { makeIconStyles } from '../../styles/fonts/iconfont';
|
|
7
7
|
import '../../styles/fonts/ionicons';
|
|
8
8
|
import '../../styles/global';
|
|
9
9
|
var defaults = {
|
|
@@ -34,12 +34,14 @@ setDefault(function () {
|
|
|
34
34
|
});
|
|
35
35
|
export var colors = ['primary', 'warning', 'danger', 'success'];
|
|
36
36
|
export var sizes = ['large', 'small', 'mini'];
|
|
37
|
-
export default function makeStyles(color) {
|
|
37
|
+
export default function makeStyles(k, color) {
|
|
38
|
+
// create the global icon styles
|
|
39
|
+
makeIconStyles(k);
|
|
38
40
|
return /*#__PURE__*/css("color:", icon.color, ";font-size:", icon.fontSize.default, ";line-height:1;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
39
41
|
var fontSize = icon.fontSize[size];
|
|
40
|
-
return /*#__PURE__*/css("&.k-", size, "{font-size:", fontSize, ";}");
|
|
42
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", fontSize, ";}");
|
|
41
43
|
}), " ", _mapInstanceProperty(colors).call(colors, function (color) {
|
|
42
44
|
var _color = theme.color[color];
|
|
43
|
-
return /*#__PURE__*/css("&.k-", color, "{color:", _color, ";&.k-hoverable:hover{color:", palette(_color, -2), ";}}");
|
|
44
|
-
}), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{font-size:inherit;}&.k-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && "
|
|
45
|
+
return /*#__PURE__*/css("&.", k, "-", color, "{color:", _color, ";&.", k, "-hoverable:hover{color:", palette(_color, -2), ";}}");
|
|
46
|
+
}), " &.", k, "-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{font-size:inherit;}&.", k, "-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && /*#__PURE__*/css("&:hover{color:", palette(color, -2), "!important;}"), ";&:hover{color:", theme.color.primary, ";}}&.", k, "-disabled{cursor:not-allowed;color:", icon.disabledColor, "!important;}");
|
|
45
47
|
}
|
|
@@ -10,6 +10,7 @@ import { useFrozen } from './useFrozen';
|
|
|
10
10
|
import { useAutoRows } from './useAutoRows';
|
|
11
11
|
import { useShowPassword } from './useShowPassword';
|
|
12
12
|
import { useFocus } from './useFocus';
|
|
13
|
+
import { useConfigContext } from '../config';
|
|
13
14
|
export * from './search';
|
|
14
15
|
var typeDefs = {
|
|
15
16
|
type: String,
|
|
@@ -68,6 +69,7 @@ export var Input = /*#__PURE__*/function (_Component) {
|
|
|
68
69
|
_this.autoRows = useAutoRows(_this.inputRef);
|
|
69
70
|
_this.showPassword = useShowPassword();
|
|
70
71
|
_this.focusHook = useFocus();
|
|
72
|
+
_this.config = useConfigContext();
|
|
71
73
|
return _this;
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -11,8 +11,10 @@ import { Wave } from '../wave';
|
|
|
11
11
|
import { context as ErrorContext } from '../form/useError';
|
|
12
12
|
export default function ($props, $blocks, $__proto__) {
|
|
13
13
|
var _classNameObj,
|
|
14
|
+
_$cn2,
|
|
14
15
|
children,
|
|
15
16
|
_this = this,
|
|
17
|
+
_$cn5,
|
|
16
18
|
_children;
|
|
17
19
|
|
|
18
20
|
$blocks || ($blocks = {});
|
|
@@ -59,9 +61,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
59
61
|
isFocus = _this$focusHook.isFocus,
|
|
60
62
|
focusInputOnClick = _this$focusHook.focusInputOnClick;
|
|
61
63
|
var isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto';
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-clearable'] = clearable, _classNameObj['k-auto-width'] = autoWidth, _classNameObj['k-fluid'] = fluid, _classNameObj['k-stack-clear'] = stackClearIcon, _classNameObj['k-inline'] = inline, _classNameObj['k-flat'] = flat, _classNameObj['k-type-textarea'] = type === 'textarea', _classNameObj['k-focus'] = isFocus.value, _classNameObj["k-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
64
|
+
var k = this.config.k;
|
|
65
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-input"] = true, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-group"] = $blocks.prepend || $blocks.append, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-clearable"] = clearable, _classNameObj[k + "-auto-width"] = autoWidth, _classNameObj[k + "-fluid"] = fluid, _classNameObj[k + "-stack-clear"] = stackClearIcon, _classNameObj[k + "-inline"] = inline, _classNameObj[k + "-flat"] = flat, _classNameObj[k + "-type-textarea"] = type === 'textarea', _classNameObj[k + "-focus"] = isFocus.value, _classNameObj[k + "-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj[k + "-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
65
66
|
var _this$showPassword = this.showPassword,
|
|
66
67
|
isShowPassword = _this$showPassword.isShow,
|
|
67
68
|
toggleShowPassword = _this$showPassword.toggleShow,
|
|
@@ -96,12 +97,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
96
97
|
inputProps.value = inputValue;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
return _$ce(2, 'div', [$blocks.prepend ? (children = $blocks.prepend(noop), _$ce(2, 'div', children, 0, _$cn({
|
|
100
|
-
"k-input-prepend": true,
|
|
101
|
-
"k-input-padding": isTextBlock(children)
|
|
102
|
-
}))) : void 0, _$cc(ErrorContext.Consumer, {
|
|
100
|
+
return _$ce(2, 'div', [$blocks.prepend ? (children = $blocks.prepend(noop), _$ce(2, 'div', children, 0, _$cn((_$cn2 = {}, _$cn2[k + "-input-prepend"] = true, _$cn2[k + "-input-padding"] = isTextBlock(children), _$cn2)))) : void 0, _$cc(ErrorContext.Consumer, {
|
|
103
101
|
'defaultValue': false,
|
|
104
102
|
'children': function children(isInvalid) {
|
|
103
|
+
var _$cn3, _$cn4;
|
|
104
|
+
|
|
105
105
|
return _$cc(Wave, {
|
|
106
106
|
'disabled': waveDisabled || disabled || isInvalid,
|
|
107
107
|
'inset': '-2px',
|
|
@@ -115,31 +115,24 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
118
|
-
}, __$blocks['prefix'](_$no)), 0,
|
|
119
|
-
'className':
|
|
118
|
+
}, __$blocks['prefix'](_$no)), 0, _$cn(k + "-input-prefix")) : undefined, type !== 'textarea' ? _$cv('input', _extends({}, inputProps, {
|
|
119
|
+
'className': _$cn(k + "-input-inner"),
|
|
120
120
|
'type': showPasswordType.value
|
|
121
121
|
})) : _$cv('textarea', _extends({}, inputProps, {
|
|
122
|
-
'className':
|
|
122
|
+
'className': _$cn(k + "-input-inner " + k + "-textarea"),
|
|
123
123
|
'rows': isNotAutoRows ? rows : 1,
|
|
124
124
|
'style': height.value ? addStyle(inputProps.style, {
|
|
125
125
|
height: height.value + 'px'
|
|
126
126
|
}) : inputProps.style
|
|
127
127
|
})), $blocks.suffix || clearable && !disabled || showPasswordIcon.value || showCount ? _$ce(2, 'div', [showPasswordIcon.value ? [_$cc(Icon, {
|
|
128
128
|
'hoverable': true,
|
|
129
|
-
'className': _$cn({
|
|
130
|
-
"k-input-show-password": true,
|
|
131
|
-
"k-icon-hidden": !isShowPassword.value,
|
|
132
|
-
"k-icon-visible": isShowPassword.value
|
|
133
|
-
}),
|
|
129
|
+
'className': _$cn((_$cn3 = {}, _$cn3[k + "-input-show-password"] = true, _$cn3[k + "-icon-hidden"] = !isShowPassword.value, _$cn3[k + "-icon-visible"] = isShowPassword.value, _$cn3)),
|
|
134
130
|
'ev-click': toggleShowPassword
|
|
135
131
|
}), ' '] : undefined, clearable && !disabled ? _$cc(Icon, {
|
|
136
|
-
'className': _$cn({
|
|
137
|
-
"k-input-clear k-icon-error-fill": true,
|
|
138
|
-
"k-input-show": hasValue
|
|
139
|
-
}),
|
|
132
|
+
'className': _$cn((_$cn4 = {}, _$cn4[k + "-input-clear " + k + "-icon-error-fill"] = true, _$cn4[k + "-input-show"] = hasValue, _$cn4)),
|
|
140
133
|
'ev-click': _this.clear,
|
|
141
134
|
'hoverable': true
|
|
142
|
-
}) : undefined, ' ', showCount ? _$ce(2, 'span', [hasValue ? value.length : 0, maxlength ? _$ce(2, 'span', [_$ct(' / '), maxlength], 0) : undefined], 0,
|
|
135
|
+
}) : undefined, ' ', showCount ? _$ce(2, 'span', [hasValue ? value.length : 0, maxlength ? _$ce(2, 'span', [_$ct(' / '), maxlength], 0) : undefined], 0, _$cn(k + "-input-count")) : undefined, (_$blocks['suffix'] = function ($super) {
|
|
143
136
|
return null;
|
|
144
137
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
145
138
|
var block = $blocks['suffix'];
|
|
@@ -149,17 +142,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
149
142
|
};
|
|
150
143
|
|
|
151
144
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
152
|
-
}, __$blocks['suffix'](_$no))], 0,
|
|
145
|
+
}, __$blocks['suffix'](_$no))], 0, _$cn(k + "-input-suffix"), {
|
|
153
146
|
'ev-click': stopPropagation
|
|
154
|
-
}) : undefined, autoWidth ? _$ce(2, 'div', _$ce(2, 'span', !hasValue ? placeholder : inputValue, 0, null, null, null, fakeRef), 2,
|
|
147
|
+
}) : undefined, autoWidth ? _$ce(2, 'div', _$ce(2, 'span', !hasValue ? placeholder : inputValue, 0, null, null, null, fakeRef), 2, _$cn(k + "-input-fake")) : undefined], 0, _$cn(k + "-input-wrapper"), {
|
|
155
148
|
'ev-click': focusInputOnClick
|
|
156
149
|
})
|
|
157
150
|
});
|
|
158
151
|
}
|
|
159
|
-
}), $blocks.append ? (_children = $blocks.append(noop), _$ce(2, 'div', _children, 0, _$cn({
|
|
160
|
-
"k-input-append": true,
|
|
161
|
-
"k-input-padding": isTextBlock(_children)
|
|
162
|
-
}))) : void 0], 0, _$cn(classNameObj), {
|
|
152
|
+
}), $blocks.append ? (_children = $blocks.append(noop), _$ce(2, 'div', _children, 0, _$cn((_$cn5 = {}, _$cn5[k + "-input-append"] = true, _$cn5[k + "-input-padding"] = isTextBlock(_children), _$cn5)))) : void 0], 0, _$cn(classNameObj), {
|
|
163
153
|
'style': width != null ? addStyle(style, {
|
|
164
154
|
width: width + "px"
|
|
165
155
|
}) : style,
|
|
@@ -8,6 +8,7 @@ import { sizes } from '../../styles/utils';
|
|
|
8
8
|
import { _$ } from '../../i18n';
|
|
9
9
|
import { bind } from '../utils';
|
|
10
10
|
import { useDocumentClick } from '../../hooks/useDocumentClick';
|
|
11
|
+
import { useConfigContext } from '../config';
|
|
11
12
|
var typeDefs = {
|
|
12
13
|
placeholder: String,
|
|
13
14
|
value: String,
|
|
@@ -44,6 +45,7 @@ export var Search = /*#__PURE__*/function (_Component) {
|
|
|
44
45
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
45
46
|
_this.elementRef = createRef();
|
|
46
47
|
_this.inputRef = createRef();
|
|
48
|
+
_this.config = useConfigContext();
|
|
47
49
|
return _this;
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -5,9 +5,6 @@ import { Icon } from '../icon';
|
|
|
5
5
|
import { Button } from '../button';
|
|
6
6
|
import { getRestProps } from '../utils';
|
|
7
7
|
import { makeSearchStyles } from './styles';
|
|
8
|
-
var _$tmp0 = {
|
|
9
|
-
'className': 'k-icon-search k-search-icon'
|
|
10
|
-
};
|
|
11
8
|
export default function ($props, $blocks, $__proto__) {
|
|
12
9
|
var _classNameObj;
|
|
13
10
|
|
|
@@ -23,9 +20,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
23
20
|
size = _this$get.size,
|
|
24
21
|
open = _this$get.open;
|
|
25
22
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
}, _classNameObj[className] = className, _classNameObj['k-open'] = open, _classNameObj['k-hide'] = !open, _classNameObj["k-" + type] = type, _classNameObj[makeSearchStyles()] = true, _classNameObj);
|
|
23
|
+
var k = this.config.k;
|
|
24
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-search"] = true, _classNameObj[className] = className, _classNameObj[k + "-open"] = open, _classNameObj[k + "-hide"] = !open, _classNameObj[k + "-" + type] = type, _classNameObj[makeSearchStyles(k)] = true, _classNameObj);
|
|
29
25
|
return _$cv('form', _extends({}, getRestProps(this), {
|
|
30
26
|
'className': _$cn(classNameObj),
|
|
31
27
|
'ev-submit': this.onSubmit,
|
|
@@ -44,7 +40,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
44
40
|
'type': 'none',
|
|
45
41
|
'ev-click': this.onClickBtn,
|
|
46
42
|
'size': size,
|
|
47
|
-
'children': _$cc(Icon,
|
|
43
|
+
'children': _$cc(Icon, {
|
|
44
|
+
'className': _$cn(k + "-icon-search " + k + "-search-icon")
|
|
45
|
+
})
|
|
48
46
|
})]);
|
|
49
47
|
}
|
|
50
48
|
;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
3
|
-
export declare function makeSearchStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
3
|
+
export declare function makeSearchStyles(k: string): string;
|
|
@@ -129,21 +129,21 @@ setDefault(function () {
|
|
|
129
129
|
input: defaults
|
|
130
130
|
}).input;
|
|
131
131
|
});
|
|
132
|
-
export function makeStyles() {
|
|
132
|
+
export function makeStyles(k) {
|
|
133
133
|
var _context;
|
|
134
134
|
|
|
135
|
-
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";color:", input.color, ";vertical-align:middle;.k-input-wrapper{display:inline-flex;align-items:center;width:100%;position:relative;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";&:hover{border:", input.hoverBorder, ";z-index:1;}}&.k-focus .k-input-wrapper{border:", input.focusBorder, ";z-index:1;}.k-input-inner{flex:1;outline:none;color:inherit;font-size:inherit;border:none;background:transparent;padding:0;width:0;&::placeholder{color:", input.placeholderColor, ";}}&.k-fluid{width:100%;}.k-input-prefix,.k-input-suffix{display:flex;align-items:center;gap:", input.clearIconGap, ";color:", theme.color.lightBlack, ";position:relative;}.k-input-prefix{margin-right:", input.clearIconGap, ";}.k-input-suffix{margin-left:", input.clearIconGap, ";}.k-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";}&:hover .k-input-clear.k-input-show{opacity:1;pointer-events:all;}.k-input-show-password{color:", input.clearIconColor, ";}&.k-stack-clear{.k-input-clear{position:absolute;z-index:1;right:0;&.k-input-show+*{transition:opacity ", input.transition, ";}}&:hover{.k-input-clear.k-input-show+*{opacity:0;}}}&.k-group{display:inline-flex;.k-input-wrapper{border-radius:0;}.k-input-wrapper:first-child{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}.k-input-wrapper:last-child{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.k-input-prepend,.k-input-append{display:inline-flex;align-items:center;background-color:", input.groupBgColor, ";border:", input.border, ";white-space:nowrap;.k-btn{margin:-1px;border:none;&.k-none:hover{background:transparent;}}.k-select{margin:-1px;text-align:left;}}.k-input-prepend{&,.k-btn,.k-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-append{&,.k-btn,.k-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.k-input-padding{padding:0 ", input.groupPaddingGap, ";}.k-input-prepend{border-right:none;}.k-input-append{border-left:none;}&.k-flat{color:", _flatInstanceProperty(input).color, ";.k-input-wrapper{border:none;background:", _flatInstanceProperty(input).bgColor, ";}}&.k-disabled{color:", input.disabledColor, ";cursor:not-allowed;.k-input-wrapper{border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";}.k-input-inner{cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
135
|
+
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";color:", input.color, ";vertical-align:middle;.", k, "-input-wrapper{display:inline-flex;align-items:center;width:100%;position:relative;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";&:hover{border:", input.hoverBorder, ";z-index:1;}}&.", k, "-focus .", k, "-input-wrapper{border:", input.focusBorder, ";z-index:1;}.", k, "-input-inner{flex:1;outline:none;color:inherit;font-size:inherit;border:none;background:transparent;padding:0;width:0;&::placeholder{color:", input.placeholderColor, ";}}&.", k, "-fluid{width:100%;}.", k, "-input-prefix,.", k, "-input-suffix{display:flex;align-items:center;gap:", input.clearIconGap, ";color:", theme.color.lightBlack, ";position:relative;}.", k, "-input-prefix{margin-right:", input.clearIconGap, ";}.", k, "-input-suffix{margin-left:", input.clearIconGap, ";}.", k, "-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";}&:hover .", k, "-input-clear.", k, "-input-show{opacity:1;pointer-events:all;}.", k, "-input-show-password{color:", input.clearIconColor, ";}&.", k, "-stack-clear{.", k, "-input-clear{position:absolute;z-index:1;right:0;&.", k, "-input-show+*{transition:opacity ", input.transition, ";}}&:hover{.", k, "-input-clear.", k, "-input-show+*{opacity:0;}}}&.", k, "-group{display:inline-flex;.", k, "-input-wrapper{border-radius:0;}.", k, "-input-wrapper:first-child{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}.", k, "-input-wrapper:last-child{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-prepend,.", k, "-input-append{display:inline-flex;align-items:center;background-color:", input.groupBgColor, ";border:", input.border, ";white-space:nowrap;.", k, "-btn{margin:-1px;border:none;&.", k, "-none:hover{background:transparent;}}.", k, "-select{margin:-1px;text-align:left;}}.", k, "-input-prepend{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.", k, "-input-append{&,.", k, "-btn,.", k, "-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.", k, "-input-padding{padding:0 ", input.groupPaddingGap, ";}.", k, "-input-prepend{border-right:none;}.", k, "-input-append{border-left:none;}&.", k, "-flat{color:", _flatInstanceProperty(input).color, ";.", k, "-input-wrapper{border:none;background:", _flatInstanceProperty(input).bgColor, ";}}&.", k, "-disabled{color:", input.disabledColor, ";cursor:not-allowed;.", k, "-input-wrapper{border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";}.", k, "-input-inner{cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
136
136
|
var styles = input[size];
|
|
137
|
-
var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.k-input-wrapper{height:", styles.height, ";padding:0 ", styles.paddingGap, ";}");
|
|
137
|
+
var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.", k, "-input-wrapper{height:", styles.height, ";padding:0 ", styles.paddingGap, ";}");
|
|
138
138
|
if (size === 'default') return sizeClassName;
|
|
139
|
-
return /*#__PURE__*/css("&.k-", size, "{", sizeClassName, ";}");
|
|
140
|
-
}), "&.k-inline{.k-input-wrapper{height:auto;border:none;border-radius:0;padding:0;}}&.k-type-textarea{.k-input-wrapper{display:inline-block;padding:0;height:auto;}.k-textarea{width:100%;padding:", input.textareaPadding, ";line-height:1.5;vertical-align:top;}.k-input-suffix{margin:0;justify-content:flex-end;}}", _mapInstanceProperty(_context = Input.typeDefs.resize).call(_context, function (type) {
|
|
141
|
-
return /*#__PURE__*/css("&.k-resize-", type, "{.k-textarea{resize:", type, ";}}");
|
|
142
|
-
}), ".k-input-fake{left:0;top:0;right:0;position:absolute;overflow:hidden;width:100%;visibility:hidden;white-space:nowrap;}&.k-auto-width{width:auto;max-width:100%;}.k-input-count{color:", input.count.color, ";}");
|
|
139
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{", sizeClassName, ";}");
|
|
140
|
+
}), "&.", k, "-inline{.", k, "-input-wrapper{height:auto;border:none;border-radius:0;padding:0;}}&.", k, "-type-textarea{.", k, "-input-wrapper{display:inline-block;padding:0;height:auto;}.", k, "-textarea{width:100%;padding:", input.textareaPadding, ";line-height:1.5;vertical-align:top;}.", k, "-input-suffix{margin:0;justify-content:flex-end;}}", _mapInstanceProperty(_context = Input.typeDefs.resize).call(_context, function (type) {
|
|
141
|
+
return /*#__PURE__*/css("&.", k, "-resize-", type, "{.", k, "-textarea{resize:", type, ";}}");
|
|
142
|
+
}), ".", k, "-input-fake{left:0;top:0;right:0;position:absolute;overflow:hidden;width:100%;visibility:hidden;white-space:nowrap;}&.", k, "-auto-width{width:auto;max-width:100%;}.", k, "-input-count{color:", input.count.color, ";}");
|
|
143
143
|
}
|
|
144
|
-
export function makeSearchStyles() {
|
|
145
|
-
return /*#__PURE__*/css("position:relative;display:inline-block;.k-input{transition:width ", input.transition, ";}.k-btn{position:absolute;top:0;right:0;z-index:1;}&.k-default .k-btn:hover{background:transparent;}.k-input-suffix{margin-right:", input.search.suffixMarginRight, ";}&.k-hide{", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
144
|
+
export function makeSearchStyles(k) {
|
|
145
|
+
return /*#__PURE__*/css("position:relative;display:inline-block;.", k, "-input{transition:width ", input.transition, ";}.", k, "-btn{position:absolute;top:0;right:0;z-index:1;}&.", k, "-default .", k, "-btn:hover{background:transparent;}.", k, "-input-suffix{margin-right:", input.search.suffixMarginRight, ";}&.", k, "-hide{", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
146
146
|
if (size == 'default') return;
|
|
147
|
-
return /*#__PURE__*/css(".k-input.k-", size, "{width:", input[size].height, ";}");
|
|
148
|
-
}), ";.k-input{width:", input.default.height, ";}.k-input-inner{padding:0!important;}}&.k-line{.k-input-wrapper{border-width:0;}&.k-open{.k-input-wrapper{border-bottom-width:1px;}.k-btn:hover{background:transparent;}}}");
|
|
147
|
+
return /*#__PURE__*/css(".", k, "-input.", k, "-", size, "{width:", input[size].height, ";}");
|
|
148
|
+
}), ";.", k, "-input{width:", input.default.height, ";}.", k, "-input-inner{padding:0!important;}}&.", k, "-line{.", k, "-input-wrapper{border-width:0;}&.", k, "-open{.", k, "-input-wrapper{border-bottom-width:1px;}.", k, "-btn:hover{background:transparent;}}}");
|
|
149
149
|
}
|
|
@@ -5,6 +5,7 @@ import { themes, getCollapseWidth } from './styles';
|
|
|
5
5
|
import template from './aside.vdt';
|
|
6
6
|
import { ROOT_LAYOUT, getStyle, defaultWidth } from './helpers';
|
|
7
7
|
import { addStyle } from '../utils';
|
|
8
|
+
import { useConfigContext } from '../config';
|
|
8
9
|
var typeDefs = {
|
|
9
10
|
collapse: Boolean,
|
|
10
11
|
fixed: Boolean,
|
|
@@ -33,6 +34,7 @@ export var Aside = /*#__PURE__*/function (_Component) {
|
|
|
33
34
|
|
|
34
35
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
35
36
|
_this.rootLayout = inject(ROOT_LAYOUT);
|
|
37
|
+
_this.config = useConfigContext();
|
|
36
38
|
return _this;
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -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, createVNode as _$cv } from 'intact-react';
|
|
3
3
|
import { directClone } from 'intact';
|
|
4
4
|
import { mapChildren, getRestProps } from '../utils';
|
|
5
5
|
import { Menu } from '../menu';
|
|
@@ -18,25 +18,22 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
18
18
|
fixed = _this$get.fixed,
|
|
19
19
|
theme = _this$get.theme;
|
|
20
20
|
|
|
21
|
+
var k = this.config.k;
|
|
21
22
|
var vNodes = mapChildren(children, function (vNode) {
|
|
22
23
|
if (vNode.tag === Menu) {
|
|
23
24
|
var vNodeClone = directClone(vNode);
|
|
24
25
|
vNodeClone.props = _extends({}, vNode.props, {
|
|
25
26
|
collapse: collapse
|
|
26
27
|
});
|
|
27
|
-
return _$ce(2, 'div', vNodeClone, 0,
|
|
28
|
+
return _$ce(2, 'div', vNodeClone, 0, _$cn(k + "-layout-wrapper"));
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
return vNode;
|
|
31
32
|
});
|
|
32
|
-
var classNameObj = (_classNameObj = {
|
|
33
|
-
'k-layout-aside': true,
|
|
34
|
-
'k-collapsed': collapse,
|
|
35
|
-
'k-fixed': fixed
|
|
36
|
-
}, _classNameObj["k-" + theme] = true, _classNameObj[className] = className, _classNameObj[makeAsideStyles()] = true, _classNameObj);
|
|
33
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-layout-aside"] = true, _classNameObj[k + "-collapsed"] = collapse, _classNameObj[k + "-fixed"] = fixed, _classNameObj[k + "-" + theme] = true, _classNameObj[className] = className, _classNameObj[makeAsideStyles(k)] = true, _classNameObj);
|
|
37
34
|
return _$cv('div', _extends({}, getRestProps(this), {
|
|
38
35
|
'className': _$cn(classNameObj),
|
|
39
|
-
'style': this.getStyles()
|
|
36
|
+
'style': this.getStyles(k)
|
|
40
37
|
}), vNodes);
|
|
41
38
|
}
|
|
42
39
|
;
|
|
@@ -4,6 +4,7 @@ import { Component, inject, provide } from 'intact-react';
|
|
|
4
4
|
import template from './template.vdt';
|
|
5
5
|
import { LAYOUT, getStyle, BODY } from './helpers';
|
|
6
6
|
import { addStyle } from '../utils';
|
|
7
|
+
import { useConfigContext } from '../config';
|
|
7
8
|
export var Body = /*#__PURE__*/function (_Component) {
|
|
8
9
|
_inheritsLoose(Body, _Component);
|
|
9
10
|
|
|
@@ -18,6 +19,7 @@ export var Body = /*#__PURE__*/function (_Component) {
|
|
|
18
19
|
|
|
19
20
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
20
21
|
_this.layout = inject(LAYOUT);
|
|
22
|
+
_this.config = useConfigContext();
|
|
21
23
|
return _this;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -33,9 +35,8 @@ export var Body = /*#__PURE__*/function (_Component) {
|
|
|
33
35
|
var _this$get = this.get(),
|
|
34
36
|
className = _this$get.className;
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, _ref[className] = className, _ref;
|
|
38
|
+
var k = this.config.k;
|
|
39
|
+
return _ref = {}, _ref[k + "-layout-body"] = true, _ref[className] = className, _ref;
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
_proto.getStyles = function getStyles() {
|
|
@@ -1,11 +1,23 @@
|
|
|
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 './template.vdt';
|
|
5
|
+
import { useConfigContext } from '../config';
|
|
4
6
|
export var Footer = /*#__PURE__*/function (_Component) {
|
|
5
7
|
_inheritsLoose(Footer, _Component);
|
|
6
8
|
|
|
7
9
|
function Footer() {
|
|
8
|
-
|
|
10
|
+
var _context;
|
|
11
|
+
|
|
12
|
+
var _this;
|
|
13
|
+
|
|
14
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
|
+
args[_key] = arguments[_key];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
19
|
+
_this.config = useConfigContext();
|
|
20
|
+
return _this;
|
|
9
21
|
}
|
|
10
22
|
|
|
11
23
|
var _proto = Footer.prototype;
|
|
@@ -16,9 +28,8 @@ export var Footer = /*#__PURE__*/function (_Component) {
|
|
|
16
28
|
var _this$get = this.get(),
|
|
17
29
|
className = _this$get.className;
|
|
18
30
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, _ref[className] = className, _ref;
|
|
31
|
+
var k = this.config.k;
|
|
32
|
+
return _ref = {}, _ref[k + "-layout-footer"] = true, _ref[className] = className, _ref;
|
|
22
33
|
};
|
|
23
34
|
|
|
24
35
|
return Footer;
|
|
@@ -5,6 +5,7 @@ import template from './template.vdt';
|
|
|
5
5
|
import { addStyle } from '../utils';
|
|
6
6
|
import { makeHeaderStyles, themes } from './styles';
|
|
7
7
|
import { defaultHeight, ROOT_LAYOUT, getStyle } from './helpers';
|
|
8
|
+
import { useConfigContext } from '../config';
|
|
8
9
|
var typeDefs = {
|
|
9
10
|
fixed: Boolean,
|
|
10
11
|
height: [Number, String],
|
|
@@ -35,6 +36,7 @@ export var Header = /*#__PURE__*/function (_Component) {
|
|
|
35
36
|
|
|
36
37
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
37
38
|
_this.rootLayout = inject(ROOT_LAYOUT);
|
|
39
|
+
_this.config = useConfigContext();
|
|
38
40
|
return _this;
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -50,12 +52,8 @@ export var Header = /*#__PURE__*/function (_Component) {
|
|
|
50
52
|
blur = _this$get.blur,
|
|
51
53
|
boxShadow = _this$get.boxShadow;
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'k-fixed': fixed,
|
|
56
|
-
'k-blur': blur,
|
|
57
|
-
'k-box-shadow': boxShadow
|
|
58
|
-
}, _ref["k-" + theme] = true, _ref[className] = className, _ref[makeHeaderStyles()] = true, _ref;
|
|
55
|
+
var k = this.config.k;
|
|
56
|
+
return _ref = {}, _ref[k + "-layout-header"] = true, _ref[k + "-fixed"] = fixed, _ref[k + "-blur"] = blur, _ref[k + "-box-shadow"] = boxShadow, _ref[k + "-" + theme] = true, _ref[className] = className, _ref[makeHeaderStyles(k)] = true, _ref;
|
|
59
57
|
};
|
|
60
58
|
|
|
61
59
|
_proto.getStyles = function getStyles() {
|
|
@@ -6,6 +6,7 @@ import { makeLayoutStyles } from './styles';
|
|
|
6
6
|
import { addStyle } from '../utils';
|
|
7
7
|
import { ROOT_LAYOUT, LAYOUT, getStyle, BODY } from './helpers';
|
|
8
8
|
import { useParse } from './useParse';
|
|
9
|
+
import { useConfigContext } from '../config';
|
|
9
10
|
export var Layout = /*#__PURE__*/function (_Component) {
|
|
10
11
|
_inheritsLoose(Layout, _Component);
|
|
11
12
|
|
|
@@ -22,6 +23,7 @@ export var Layout = /*#__PURE__*/function (_Component) {
|
|
|
22
23
|
_this.parse = useParse();
|
|
23
24
|
_this.layout = inject(LAYOUT, null);
|
|
24
25
|
_this.body = inject(BODY, null);
|
|
26
|
+
_this.config = useConfigContext();
|
|
25
27
|
return _this;
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -45,9 +47,8 @@ export var Layout = /*#__PURE__*/function (_Component) {
|
|
|
45
47
|
var _this$parse = this.parse(),
|
|
46
48
|
hasAside = _this$parse.hasAside;
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, _ref["k-has-aside"] = hasAside, _ref[makeLayoutStyles()] = true, _ref[className] = className, _ref;
|
|
50
|
+
var k = this.config.k;
|
|
51
|
+
return _ref = {}, _ref[k + "-layout"] = true, _ref[k + "-has-aside"] = hasAside, _ref[makeLayoutStyles(k)] = true, _ref[className] = className, _ref;
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
_proto.getStyles = function getStyles() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
2
|
export declare const themes: readonly ["light", "dark", "white"];
|
|
3
3
|
export declare function getCollapseWidth(): string;
|
|
4
|
-
export declare function makeLayoutStyles(): string;
|
|
5
|
-
export declare function makeHeaderStyles(): string;
|
|
6
|
-
export declare function makeAsideStyles(): string;
|
|
4
|
+
export declare function makeLayoutStyles(k: string): string;
|
|
5
|
+
export declare function makeHeaderStyles(k: string): string;
|
|
6
|
+
export declare function makeAsideStyles(k: string): string;
|
|
@@ -64,20 +64,20 @@ setDefault(function () {
|
|
|
64
64
|
export function getCollapseWidth() {
|
|
65
65
|
return layout.collapsedWidth;
|
|
66
66
|
}
|
|
67
|
-
export function makeLayoutStyles() {
|
|
68
|
-
return /*#__PURE__*/css("display:flex;flex-direction:column;flex:1;transition:padding-left ", layout.transition, ";&.k-has-aside{flex-direction:row;}.k-layout-footer{padding:", layout.footerPadding, ";}.k-layout-body{flex:1;}");
|
|
67
|
+
export function makeLayoutStyles(k) {
|
|
68
|
+
return /*#__PURE__*/css("display:flex;flex-direction:column;flex:1;transition:padding-left ", layout.transition, ";&.", k, "-has-aside{flex-direction:row;}.", k, "-layout-footer{padding:", layout.footerPadding, ";}.", k, "-layout-body{flex:1;}");
|
|
69
69
|
}
|
|
70
|
-
export function makeHeaderStyles() {
|
|
71
|
-
return /*#__PURE__*/css("display:flex;align-items:center;color:", layout.color, ";background:", layout.bgColor, ";left:0;transition:left ", layout.transition, ";&.k-fixed{position:fixed;left:0;right:0;top:0;z-index:", theme.midZIndex + 1, ";}>.k-menu{background:transparent!important;}&.k-blur{backdrop-filter:blur(20px);background:", setAlpha(layout.bgColor, 0.1), ";}&.k-box-shadow{border-bottom:none!important;box-shadow:", theme.boxShadow, ";}", _mapInstanceProperty(themes).call(themes, function (theme) {
|
|
70
|
+
export function makeHeaderStyles(k) {
|
|
71
|
+
return /*#__PURE__*/css("display:flex;align-items:center;color:", layout.color, ";background:", layout.bgColor, ";left:0;transition:left ", layout.transition, ";&.", k, "-fixed{position:fixed;left:0;right:0;top:0;z-index:", theme.midZIndex + 1, ";}>.", k, "-menu{background:transparent!important;}&.", k, "-blur{backdrop-filter:blur(20px);background:", setAlpha(layout.bgColor, 0.1), ";}&.", k, "-box-shadow{border-bottom:none!important;box-shadow:", theme.boxShadow, ";}", _mapInstanceProperty(themes).call(themes, function (theme) {
|
|
72
72
|
if (theme === 'dark') return;
|
|
73
73
|
var styles = layout[theme];
|
|
74
|
-
return /*#__PURE__*/css("&.k-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-bottom:", styles.border, ";&.k-blur{background:", setAlpha(styles.bgColor, 0.1), ";}}");
|
|
74
|
+
return /*#__PURE__*/css("&.", k, "-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-bottom:", styles.border, ";&.", k, "-blur{background:", setAlpha(styles.bgColor, 0.1), ";}}");
|
|
75
75
|
}), ";");
|
|
76
76
|
}
|
|
77
|
-
export function makeAsideStyles() {
|
|
77
|
+
export function makeAsideStyles(k) {
|
|
78
78
|
return /*#__PURE__*/css("transition:width ", layout.transition, ";display:flex;flex-direction:column;background:", layout.bgColor, ";color:", layout.color, ";", _mapInstanceProperty(themes).call(themes, function (theme) {
|
|
79
79
|
if (theme === 'dark') return;
|
|
80
80
|
var styles = layout[theme];
|
|
81
|
-
return /*#__PURE__*/css("&.k-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-right:", styles.border, ";}");
|
|
82
|
-
}), " &.k-fixed{position:fixed;overflow:auto;left:0;top:0;bottom:0;z-index:", theme.midZIndex, ";}.k-menu{width:auto!important;}");
|
|
81
|
+
return /*#__PURE__*/css("&.", k, "-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-right:", styles.border, ";}");
|
|
82
|
+
}), " &.", k, "-fixed{position:fixed;overflow:auto;left:0;top:0;bottom:0;z-index:", theme.midZIndex, ";}.", k, "-menu{width:auto!important;}");
|
|
83
83
|
}
|
|
@@ -10,9 +10,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
10
10
|
children = _this$get.children,
|
|
11
11
|
style = _this$get.style;
|
|
12
12
|
|
|
13
|
+
var k = this.config.k;
|
|
13
14
|
return _$cv('div', _extends({
|
|
14
15
|
'className': _$cn(this.getClassNames()),
|
|
15
|
-
'style': this.getStyles ? this.getStyles() : style
|
|
16
|
+
'style': this.getStyles ? this.getStyles(k) : style
|
|
16
17
|
}, getRestProps(this)), children);
|
|
17
18
|
}
|
|
18
19
|
;
|