@king-design/react 2.1.1 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/__snapshots__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +410 -374
- package/__tests__/components/drawer.spec.tsx +67 -5
- package/components/button/index.d.ts +1 -1
- package/components/button/index.js +1 -1
- package/components/button/styles.js +3 -3
- package/components/card/styles.js +10 -2
- package/components/checkbox/styles.js +21 -10
- package/components/collapse/styles.js +6 -1
- package/components/copy/index.d.ts +17 -0
- package/components/copy/index.js +43 -0
- package/components/copy/index.spec.d.ts +1 -0
- package/components/copy/index.spec.js +52 -0
- package/components/copy/index.vdt.js +45 -0
- package/components/copy/styles.d.ts +2 -0
- package/components/copy/styles.js +14 -0
- package/components/copy/useCopy.d.ts +4 -0
- package/components/copy/useCopy.js +90 -0
- package/components/datepicker/index.spec.js +1 -1
- package/components/datepicker/index.vdt.js +1 -1
- package/components/datepicker/styles.d.ts +1 -1
- package/components/datepicker/styles.js +5 -2
- package/components/diagram/shapes/callout.d.ts +1 -1
- package/components/diagram/shapes/circle.d.ts +1 -1
- package/components/diagram/shapes/document.d.ts +1 -1
- package/components/diagram/shapes/ellipse.d.ts +1 -1
- package/components/diagram/shapes/hexagon.d.ts +1 -1
- package/components/diagram/shapes/image.d.ts +1 -1
- package/components/diagram/shapes/parallelogram.d.ts +1 -1
- package/components/diagram/shapes/rectangle.d.ts +1 -1
- package/components/diagram/shapes/square.d.ts +1 -1
- package/components/diagram/shapes/text.d.ts +1 -1
- package/components/dialog/alert.vdt.js +6 -5
- package/components/dialog/base.vdt.js +5 -6
- package/components/dialog/index.spec.js +4 -4
- package/components/dialog/styles.js +16 -14
- package/components/drawer/styles.js +20 -5
- package/components/dropdown/styles.js +1 -1
- package/components/form/index.spec.js +4 -2
- package/components/form/item.vdt.js +2 -1
- package/components/form/styles.js +5 -5
- package/components/grid/useGutter.js +8 -8
- package/components/icon/index.d.ts +1 -0
- package/components/icon/index.js +2 -1
- package/components/icon/index.vdt.js +4 -2
- package/components/icon/styles.js +10 -2
- package/components/input/index.d.ts +1 -0
- package/components/input/index.js +4 -11
- package/components/input/index.vdt.js +4 -2
- package/components/input/styles.js +13 -11
- package/components/message/message.js +1 -1
- package/components/message/message.vdt.js +7 -6
- package/components/message/styles.js +8 -8
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +1 -1
- package/components/pagination/index.spec.js +4 -2
- package/components/pagination/index.vdt.js +16 -18
- package/components/pagination/styles.js +12 -3
- package/components/popover/content.d.ts +19 -0
- package/components/popover/content.js +31 -0
- package/components/popover/content.vdt.js +68 -0
- package/components/popover/index.d.ts +16 -0
- package/components/popover/index.js +44 -0
- package/components/popover/index.spec.d.ts +1 -0
- package/components/popover/index.spec.js +195 -0
- package/components/popover/styles.d.ts +1 -0
- package/components/popover/styles.js +22 -0
- package/components/progress/index.js +1 -1
- package/components/progress/index.vdt.js +46 -8
- package/components/progress/styles.js +19 -13
- package/components/radio/styles.js +16 -6
- package/components/rate/styles.js +1 -1
- package/components/select/base.d.ts +5 -2
- package/components/select/base.js +7 -3
- package/components/select/base.vdt.js +46 -38
- package/components/select/index.spec.js +2 -2
- package/components/select/menu.vdt.js +1 -1
- package/components/select/styles.js +14 -28
- package/components/select/useDraggble.d.ts +2 -0
- package/components/select/useDraggble.js +11 -0
- package/components/select/useNowrap.d.ts +3 -0
- package/components/select/useNowrap.js +19 -0
- package/components/slider/index.spec.js +48 -9
- package/components/slider/index.vdt.js +23 -12
- package/components/slider/styles.js +23 -14
- package/components/slider/useValue.d.ts +3 -1
- package/components/slider/useValue.js +12 -0
- package/components/spinner/index.d.ts +0 -1
- package/components/spinner/index.js +1 -19
- package/components/spinner/index.vdt.js +15 -8
- package/components/spinner/styles.js +33 -5
- package/components/spinner/useChange.d.ts +1 -1
- package/components/spinner/useChange.js +2 -2
- package/components/spinner/useValue.d.ts +1 -0
- package/components/spinner/useValue.js +16 -1
- package/components/split/index.vdt.js +32 -20
- package/components/split/memo.d.ts +9 -0
- package/components/split/memo.js +26 -0
- package/components/steps/index.d.ts +3 -2
- package/components/steps/index.js +4 -3
- package/components/steps/index.spec.js +1 -1
- package/components/steps/index.vdt.js +8 -4
- package/components/steps/step.vdt.js +17 -9
- package/components/steps/styles.d.ts +2 -1
- package/components/steps/styles.js +106 -72
- package/components/switch/index.spec.js +82 -65
- package/components/switch/styles.js +20 -34
- package/components/table/styles.js +9 -4
- package/components/table/useDraggable.js +3 -10
- package/components/table/useStickyScrollbar.js +2 -2
- package/components/table/useWidth.js +2 -2
- package/components/tabs/index.d.ts +1 -1
- package/components/tabs/index.js +1 -1
- package/components/tabs/index.spec.js +67 -0
- package/components/tabs/index.vdt.js +5 -5
- package/components/tabs/styles.js +73 -29
- package/components/tabs/useScroll.d.ts +1 -1
- package/components/tabs/useScroll.js +75 -48
- package/components/tag/base.d.ts +1 -0
- package/components/tag/base.js +2 -2
- package/components/tag/index.d.ts +1 -0
- package/components/tag/index.js +2 -1
- package/components/tag/index.spec.js +147 -4
- package/components/tag/styles.d.ts +67 -0
- package/components/tag/styles.js +42 -12
- package/components/tag/tags.d.ts +27 -0
- package/components/tag/tags.js +51 -0
- package/components/tag/tags.vdt.js +79 -0
- package/components/tag/useChildren.d.ts +2 -0
- package/components/tag/useChildren.js +39 -0
- package/components/tag/useDraggable.d.ts +3 -0
- package/components/tag/useDraggable.js +89 -0
- package/components/tag/useNowrap.d.ts +7 -0
- package/components/tag/useNowrap.js +115 -0
- package/components/timepicker/index.spec.js +1 -1
- package/components/tip/index.vdt.js +1 -3
- package/components/tip/styles.js +4 -3
- package/components/tooltip/content.d.ts +2 -2
- package/components/tooltip/content.vdt.js +23 -13
- package/components/tooltip/index.spec.js +56 -108
- package/components/tooltip/styles.d.ts +1 -0
- package/components/tooltip/styles.js +13 -8
- package/components/transfer/index.vdt.js +3 -1
- package/components/transfer/styles.js +1 -1
- package/components/transfer/useCheck.d.ts +1 -0
- package/components/transfer/useCheck.js +8 -1
- package/components/upload/index.spec.js +5 -6
- package/components/upload/index.vdt.js +24 -21
- package/components/upload/styles.js +22 -30
- package/components/utils.d.ts +2 -0
- package/components/utils.js +24 -3
- package/hooks/useResizeObserver.d.ts +1 -1
- package/hooks/useResizeObserver.js +19 -6
- package/i18n/en-US.d.ts +6 -2
- package/i18n/en-US.js +8 -3
- package/index.d.ts +4 -2
- package/index.js +4 -2
- package/package.json +1 -1
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +2 -2
- package/styles/fonts/iconfont.svg +189 -369
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/ionicons.js +2 -2
- package/styles/global.js +1 -1
- package/styles/theme.d.ts +10 -2
- package/styles/theme.js +23 -21
- package/components/table/useResizeObserver.d.ts +0 -2
- package/components/table/useResizeObserver.js +0 -20
|
@@ -18,7 +18,7 @@ export declare class DImage extends DShape<DImageProps> {
|
|
|
18
18
|
rotatable?: boolean | undefined;
|
|
19
19
|
editable?: boolean | undefined;
|
|
20
20
|
connectable?: boolean | undefined;
|
|
21
|
-
strokeStyle?: "
|
|
21
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
22
22
|
label?: string | number | undefined;
|
|
23
23
|
style?: Record<string, string | number> | undefined;
|
|
24
24
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DParallelogram extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -18,7 +18,7 @@ export declare class DRectangle extends DShape<DRectangleProps> {
|
|
|
18
18
|
rotatable?: boolean | undefined;
|
|
19
19
|
editable?: boolean | undefined;
|
|
20
20
|
connectable?: boolean | undefined;
|
|
21
|
-
strokeStyle?: "
|
|
21
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
22
22
|
label?: string | number | undefined;
|
|
23
23
|
style?: Record<string, string | number> | undefined;
|
|
24
24
|
data?: any;
|
|
@@ -13,7 +13,7 @@ export declare class DSquare extends DRectangle {
|
|
|
13
13
|
rotatable?: boolean | undefined;
|
|
14
14
|
editable?: boolean | undefined;
|
|
15
15
|
connectable?: boolean | undefined;
|
|
16
|
-
strokeStyle?: "
|
|
16
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
17
17
|
label?: string | number | undefined;
|
|
18
18
|
style?: Record<string, string | number> | undefined;
|
|
19
19
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DText extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -41,11 +41,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
41
41
|
}), (_$blocks['body'] = function ($super) {
|
|
42
42
|
return [_$ce(2, 'div', [!hideIcon && !icon ? _$cc(Icon, {
|
|
43
43
|
'className': _$cn(iconClassName || {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
})
|
|
44
|
+
"k-icon-success-fill": type === 'success',
|
|
45
|
+
"k-icon-warning-fill": type === 'warning',
|
|
46
|
+
"k-icon-error-fill": type === 'error',
|
|
47
|
+
"k-icon-question-fill": type === 'confirm'
|
|
48
|
+
}),
|
|
49
|
+
'color': type === 'error' ? 'danger' : type === 'confirm' ? 'primary' : type
|
|
49
50
|
}) : undefined, icon], 0, 'k-dialog-tip-icon'), _$ce(2, 'div', [title ? _$ce(2, 'div', title, 0, 'k-alert-dialog-title') : undefined, content], 0, 'k-alert-dialog-wrapper')];
|
|
50
51
|
}, __$blocks['body'] = function ($super, data) {
|
|
51
52
|
var block = $blocks['body'];
|
|
@@ -7,7 +7,7 @@ import { Transition } from 'intact';
|
|
|
7
7
|
import { getRestProps, stopPropagation } from '../utils';
|
|
8
8
|
import { makeDialogStyles, makeWrapperStyles } from './styles';
|
|
9
9
|
var _$tmp0 = {
|
|
10
|
-
'className': '
|
|
10
|
+
'className': 'k-icon-close'
|
|
11
11
|
};
|
|
12
12
|
export default function ($props, $blocks, $__proto__) {
|
|
13
13
|
var _classNameObj, _$cn2;
|
|
@@ -79,17 +79,16 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
79
79
|
}, __$blocks['body'](_$no)), 0, 'k-dialog-body'), (_$blocks['footer-wrapper'] = function ($super) {
|
|
80
80
|
return _$ce(2, 'div', (_$blocks['footer'] = function ($super) {
|
|
81
81
|
return [_$cc(Button, {
|
|
82
|
+
'className': 'k-dialog-cancel',
|
|
83
|
+
'ev-click': this.cancel,
|
|
84
|
+
'children': cancelText
|
|
85
|
+
}), _$cc(Button, {
|
|
82
86
|
'className': 'k-dialog-ok',
|
|
83
87
|
'type': 'primary',
|
|
84
88
|
'ev-click': this.ok,
|
|
85
89
|
'loading': loading,
|
|
86
90
|
'disabled': disabledOk,
|
|
87
91
|
'children': okText
|
|
88
|
-
}), _$cc(Button, {
|
|
89
|
-
'className': 'k-dialog-cancel',
|
|
90
|
-
'type': 'secondary',
|
|
91
|
-
'ev-click': this.cancel,
|
|
92
|
-
'children': cancelText
|
|
93
92
|
})];
|
|
94
93
|
}, __$blocks['footer'] = function ($super, data) {
|
|
95
94
|
var block = $blocks['footer'];
|
|
@@ -201,7 +201,7 @@ describe('Dialog', function () {
|
|
|
201
201
|
var _mount4 = mount(Demo),
|
|
202
202
|
instance = _mount4[0];
|
|
203
203
|
|
|
204
|
-
expect(getElement('.k-dialog-footer').innerText).to.eql('dialog footer
|
|
204
|
+
expect(getElement('.k-dialog-footer').innerText).to.eql('dialog footer 取消确定');
|
|
205
205
|
});
|
|
206
206
|
it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
207
207
|
var _mount5, instance, element, btn, dialog;
|
|
@@ -439,7 +439,7 @@ describe('Dialog', function () {
|
|
|
439
439
|
|
|
440
440
|
case 4:
|
|
441
441
|
dialog = expectDialog();
|
|
442
|
-
dialog.querySelector('.k-
|
|
442
|
+
dialog.querySelector('.k-dialog-ok').click();
|
|
443
443
|
_context12.next = 8;
|
|
444
444
|
return wait();
|
|
445
445
|
|
|
@@ -472,7 +472,7 @@ describe('Dialog', function () {
|
|
|
472
472
|
|
|
473
473
|
case 21:
|
|
474
474
|
dialog = expectDialog();
|
|
475
|
-
dialog.querySelector('.k-
|
|
475
|
+
dialog.querySelector('.k-dialog-ok').click();
|
|
476
476
|
cb2 = sinon.spy();
|
|
477
477
|
Dialog.confirm({
|
|
478
478
|
content: 'test',
|
|
@@ -489,7 +489,7 @@ describe('Dialog', function () {
|
|
|
489
489
|
|
|
490
490
|
case 31:
|
|
491
491
|
expect(cb2.callCount).to.eql(0);
|
|
492
|
-
getElement('.k-dialog').querySelector('.k-
|
|
492
|
+
getElement('.k-dialog').querySelector('.k-dialog-ok').click();
|
|
493
493
|
|
|
494
494
|
case 33:
|
|
495
495
|
case "end":
|
|
@@ -16,7 +16,7 @@ var defaults = {
|
|
|
16
16
|
},
|
|
17
17
|
|
|
18
18
|
padding: '0',
|
|
19
|
-
margin: '0
|
|
19
|
+
margin: '0 24px',
|
|
20
20
|
|
|
21
21
|
get color() {
|
|
22
22
|
return theme.color.text;
|
|
@@ -27,32 +27,33 @@ var defaults = {
|
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
get boxShadow() {
|
|
30
|
-
return theme.
|
|
30
|
+
return theme.largeBoxShadow;
|
|
31
31
|
},
|
|
32
32
|
|
|
33
33
|
// header
|
|
34
34
|
header: {
|
|
35
|
-
fontSize: '
|
|
35
|
+
fontSize: '14px',
|
|
36
|
+
fontWeight: '500',
|
|
36
37
|
|
|
37
38
|
get color() {
|
|
38
39
|
return theme.color.title;
|
|
39
40
|
},
|
|
40
41
|
|
|
41
|
-
height: '
|
|
42
|
-
border: "1px solid #
|
|
43
|
-
closeTop: '
|
|
42
|
+
height: '52px',
|
|
43
|
+
border: "1px solid #e2e5e8",
|
|
44
|
+
closeTop: '9px',
|
|
44
45
|
closeRight: '-9px',
|
|
45
|
-
closeIconFontSize: '
|
|
46
|
+
closeIconFontSize: '16px'
|
|
46
47
|
},
|
|
47
48
|
// body
|
|
48
49
|
body: {
|
|
49
|
-
padding: "
|
|
50
|
+
padding: "24px"
|
|
50
51
|
},
|
|
51
52
|
// footer
|
|
52
53
|
footer: {
|
|
53
|
-
padding: "
|
|
54
|
-
btnGap: "
|
|
55
|
-
border: "1px solid #
|
|
54
|
+
padding: "16px 0",
|
|
55
|
+
btnGap: "8px",
|
|
56
|
+
border: "1px solid #e2e5e8"
|
|
56
57
|
},
|
|
57
58
|
// transition
|
|
58
59
|
transform: 'translateY(-10px) scale(1.05)',
|
|
@@ -62,12 +63,13 @@ var defaults = {
|
|
|
62
63
|
miniWidth: '400px',
|
|
63
64
|
// alert dialog
|
|
64
65
|
alert: {
|
|
65
|
-
padding: "0
|
|
66
|
+
padding: "0 24px",
|
|
66
67
|
bodyMarginTop: "-25px",
|
|
67
68
|
tipIconMarginBottom: '10px',
|
|
68
69
|
tipIconFontSize: '37px',
|
|
69
70
|
tipIconLineHeight: '37px',
|
|
70
71
|
// with title
|
|
72
|
+
titleFontWeight: '500',
|
|
71
73
|
titleTipIconFontSize: '37px',
|
|
72
74
|
titleFontSize: '14px',
|
|
73
75
|
wrapperPaddingLeft: '8px',
|
|
@@ -85,7 +87,7 @@ export function makeDialogStyles() {
|
|
|
85
87
|
|
|
86
88
|
return /*#__PURE__*/css("position:absolute;width:", dialog.width, ";border-radius:", dialog.borderRadius, ";background:", dialog.bgColor, ";font-size:", dialog.fontSize, ";color:", dialog.color, ";box-shadow:", dialog.boxShadow, ";max-width:100%;z-index:", theme.maxZIndex, ";&.k-dragging{cursor:move;user-select:none;}&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:all ", dialog.transition, ";}&.transition-enter-from,&.transition-leave-to,&.transition-appear-from{transform:", dialog.transform, ";opacity:0;}", _mapInstanceProperty(_context = ['large', 'small', 'mini']).call(_context, function (size) {
|
|
87
89
|
return /*#__PURE__*/css("&.k-", size, "{width:", dialog[size + "Width"], ";}");
|
|
88
|
-
}), ".k-dialog-header{padding:0 ", dialog.padding, ";margin:", dialog.margin, ";border-bottom:", dialog.header.border, ";height:", dialog.header.height, ";line-height:", dialog.header.height, ";font-size:", dialog.header.fontSize, ";color:", dialog.header.color, ";position:relative;}.k-dialog-title{display:inline-block;}.k-dialog-close{position:absolute;right:", dialog.header.closeRight, ";top:", dialog.header.closeTop, ";.k-icon{font-size:", dialog.header.closeIconFontSize, ";}}.k-dialog-body{padding:", dialog.body.padding, ";}.k-dialog-footer{text-align:right;padding:", dialog.footer.padding, ";margin:", dialog.margin, ";border-top:", dialog.footer.border, ";.k-btn{margin-left:", dialog.footer.btnGap, ";}}");
|
|
90
|
+
}), ".k-dialog-header{padding:0 ", dialog.padding, ";margin:", dialog.margin, ";border-bottom:", dialog.header.border, ";height:", dialog.header.height, ";line-height:", dialog.header.height, ";font-size:", dialog.header.fontSize, ";color:", dialog.header.color, ";position:relative;font-weight:", dialog.header.fontWeight, ";}.k-dialog-title{display:inline-block;}.k-dialog-close{position:absolute;right:", dialog.header.closeRight, ";top:", dialog.header.closeTop, ";.k-icon{font-size:", dialog.header.closeIconFontSize, ";}}.k-dialog-body{padding:", dialog.body.padding, ";}.k-dialog-footer{text-align:right;padding:", dialog.footer.padding, ";margin:", dialog.margin, ";border-top:", dialog.footer.border, ";.k-btn{margin-left:", dialog.footer.btnGap, ";}}");
|
|
89
91
|
}
|
|
90
92
|
export function makeWrapperStyles() {
|
|
91
93
|
// k-fade-leave-active will add position absolute to the styles
|
|
@@ -98,5 +100,5 @@ export function makeAlertStyles() {
|
|
|
98
100
|
return /*#__PURE__*/css("&.k-alert-dialog{.k-dialog-body{margin-top:", dialog.alert.bodyMarginTop, ";padding:", dialog.alert.padding, ";text-align:center;position:relative;z-index:1;}.k-dialog-header,.k-dialog-footer{border:none;}.k-dialog-tip-icon{margin-bottom:", dialog.alert.tipIconMarginBottom, ";.k-icon{font-size:", dialog.alert.tipIconFontSize, ";line-height:", dialog.alert.tipIconLineHeight, ";}}", _mapInstanceProperty(_context2 = ['success', 'warning', 'error', 'confirm']).call(_context2, function (type) {
|
|
99
101
|
var color = type === 'error' ? theme.color.danger : type === 'confirm' ? theme.color.primary : theme.color[type];
|
|
100
102
|
return /*#__PURE__*/css("&.k-", type, "{.k-dialog-tip-icon{color:", color, ";}}");
|
|
101
|
-
}), " &:not(.k-confirm){.k-dialog-cancel{display:none;}}&.k-with-title{.k-dialog-body{margin-top:", dialog.alert.titleBodyMarginTop, ";text-align:left;}.k-dialog-tip-icon{float:left;.k-icon{font-size:", dialog.alert.titleTipIconFontSize, ";}}.k-alert-dialog-wrapper{overflow:hidden;padding-left:", dialog.alert.wrapperPaddingLeft, ";}.k-alert-dialog-title{line-height:", dialog.alert.tipIconLineHeight, ";font-size:", dialog.alert.titleFontSize, ";}}}");
|
|
103
|
+
}), " &:not(.k-confirm){.k-dialog-cancel{display:none;}}&.k-with-title{.k-dialog-body{margin-top:", dialog.alert.titleBodyMarginTop, ";text-align:left;}.k-dialog-tip-icon{float:left;.k-icon{font-size:", dialog.alert.titleTipIconFontSize, ";}}.k-alert-dialog-wrapper{overflow:hidden;padding-left:", dialog.alert.wrapperPaddingLeft, ";}.k-alert-dialog-title{line-height:", dialog.alert.tipIconLineHeight, ";font-size:", dialog.alert.titleFontSize, ";font-weight:", dialog.alert.titleFontWeight, ";}}}");
|
|
102
104
|
}
|
|
@@ -10,7 +10,7 @@ var defaults = {
|
|
|
10
10
|
},
|
|
11
11
|
|
|
12
12
|
get boxShadow() {
|
|
13
|
-
return theme.
|
|
13
|
+
return theme.largeBoxShadow;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
};
|
|
@@ -21,9 +21,10 @@ setDefault(function () {
|
|
|
21
21
|
}).drawer;
|
|
22
22
|
});
|
|
23
23
|
export function makeStyles(overlay) {
|
|
24
|
-
return /*#__PURE__*/css("
|
|
24
|
+
return /*#__PURE__*/css("position:fixed!important;background:transparent!important;box-shadow:none!important;&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:opacity ", drawer.transition, "!important;overflow:hidden;.k-drawer-content{transition:transform ", drawer.transition, ";}}.k-drawer-content{height:100%;display:flex;background:#fff;flex-direction:column;transform:translateX(0);box-shadow:", drawer.boxShadow, ";.k-dialog-body{flex-grow:1;overflow:auto;}}", _mapInstanceProperty(placements).call(placements, function (placement) {
|
|
25
25
|
var positionValue = '';
|
|
26
26
|
var transformValue = '';
|
|
27
|
+
var borderRadius = '';
|
|
27
28
|
placements.forEach(function (p) {
|
|
28
29
|
// Set top to `0 !important` when overlay is false and placement is right or left
|
|
29
30
|
// Because dialog without overlay don't have positional parent element
|
|
@@ -32,12 +33,26 @@ export function makeStyles(overlay) {
|
|
|
32
33
|
|
|
33
34
|
if (placement === 'left' || placement === 'right') {
|
|
34
35
|
positionValue += 'height: 100% !important;';
|
|
35
|
-
|
|
36
|
+
|
|
37
|
+
if (placement === 'left') {
|
|
38
|
+
borderRadius = "0 " + theme.largeBorderRadius + " " + theme.largeBorderRadius + " 0";
|
|
39
|
+
transformValue = 'translateX(-100%)';
|
|
40
|
+
} else {
|
|
41
|
+
borderRadius = theme.largeBorderRadius + " 0 0 " + theme.largeBorderRadius;
|
|
42
|
+
transformValue = 'translateX(100%)';
|
|
43
|
+
}
|
|
36
44
|
} else {
|
|
37
45
|
positionValue += 'width: 100% !important;';
|
|
38
|
-
|
|
46
|
+
|
|
47
|
+
if (placement === 'top') {
|
|
48
|
+
borderRadius = "0 0 " + theme.largeBorderRadius + " " + theme.largeBorderRadius;
|
|
49
|
+
transformValue = 'translateY(-100%)';
|
|
50
|
+
} else {
|
|
51
|
+
borderRadius = theme.largeBorderRadius + " " + theme.largeBorderRadius + " 0 0";
|
|
52
|
+
transformValue = 'translateY(100%)';
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
|
|
41
|
-
return "\n &.k-" + placement + " {\n " + positionValue + "\n &.transition-enter-from,\n &.transition-leave-to,\n &.transition-appear-from {\n transform: none !important;\n .k-drawer-content {\n transform: " + transformValue + ";\n }\n }\n }\n ";
|
|
56
|
+
return "\n &.k-" + placement + " {\n " + positionValue + "\n &.transition-enter-from,\n &.transition-leave-to,\n &.transition-appear-from {\n transform: none !important;\n .k-drawer-content {\n transform: " + transformValue + ";\n }\n }\n .k-drawer-content {\n border-radius: " + borderRadius + ";\n }\n }\n ";
|
|
42
57
|
}), ";");
|
|
43
58
|
}
|
|
@@ -49,7 +49,7 @@ setDefault(function () {
|
|
|
49
49
|
}).dropdown;
|
|
50
50
|
});
|
|
51
51
|
export function makeMenuStyles() {
|
|
52
|
-
return /*#__PURE__*/css("position:absolute;min-width:", dropdown.menu.minWidth, ";background:", dropdown.menu.bgColor, ";border-radius:", dropdown.menu.borderRadius, ";box-shadow:", theme.
|
|
52
|
+
return /*#__PURE__*/css("position:absolute;min-width:", dropdown.menu.minWidth, ";background:", dropdown.menu.bgColor, ";border-radius:", dropdown.menu.borderRadius, ";box-shadow:", theme.middleBoxShadow, ";font-size:", dropdown.menu.fontSize, ";z-index:", dropdown.menu.zIndex, ";top:0;left:0;.k-dropdown{display:block;}");
|
|
53
53
|
}
|
|
54
54
|
export function makeItemStyles() {
|
|
55
55
|
return /*#__PURE__*/css("padding:", dropdown.item.padding, ";cursor:pointer;white-space:nowrap;height:", dropdown.item.height, ";line-height:", dropdown.item.height, ";&.k-hover{background:", dropdown.item.hoverBgColor, ";}&:first-of-type{border-radius:", dropdown.menu.borderRadius, " ", dropdown.menu.borderRadius, " 0 0;}&:last-of-type{border-radius:0 0 ", dropdown.menu.borderRadius, " ", dropdown.menu.borderRadius, ";}&.k-disabled{background:", dropdown.item.disabledBgColor, ";color:", dropdown.item.disabledColor, ";cursor:not-allowed;}.k-checkbox,.k-radio{display:flex;margin:0 -", getRight(dropdown.item.padding), " 0 -", getLeft(dropdown.item.padding), ";padding:", dropdown.item.padding, ";}.k-checkbox-wrapper,.k-radio-wrapper{vertical-align:text-bottom;}.k-checkbox-text,.k-radio-text{vertical-align:baseline;}");
|
|
@@ -8,7 +8,7 @@ import BasicDemo, { data as basicDemoData } from '~/components/form/demos/basic'
|
|
|
8
8
|
import CustomDemo from '~/components/form/demos/custom';
|
|
9
9
|
import VariableDemo from '~/components/form/demos/variable';
|
|
10
10
|
import RemoteDemo from '~/components/form/demos/remote';
|
|
11
|
-
import { mount, dispatchEvent, wait } from '../../test/utils';
|
|
11
|
+
import { mount, unmount, dispatchEvent, wait } from '../../test/utils';
|
|
12
12
|
import { Component } from 'intact-react';
|
|
13
13
|
import { Form, FormItem } from './';
|
|
14
14
|
import { Input } from '../input';
|
|
@@ -29,7 +29,9 @@ RemoteDemo.prototype.validateUserName = function (value) {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
describe('Form', function () {
|
|
32
|
-
|
|
32
|
+
afterEach(function () {
|
|
33
|
+
return unmount();
|
|
34
|
+
});
|
|
33
35
|
it('validate', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
34
36
|
var _mount, instance, element, form, item, input;
|
|
35
37
|
|
|
@@ -8,7 +8,8 @@ import { makeItemStyles } from './styles';
|
|
|
8
8
|
import { context as ErrorContext } from './useError';
|
|
9
9
|
var _$tmp0 = {
|
|
10
10
|
'className': 'ion-ios-information-outline k-form-error-more',
|
|
11
|
-
'size': 'small'
|
|
11
|
+
'size': 'small',
|
|
12
|
+
'color': 'inherit'
|
|
12
13
|
};
|
|
13
14
|
export default function ($props, $blocks, $__proto__) {
|
|
14
15
|
var _classNameObj, _$cn2;
|
|
@@ -8,12 +8,12 @@ var defaults = {
|
|
|
8
8
|
gap: "24px",
|
|
9
9
|
labelWidth: "80px",
|
|
10
10
|
|
|
11
|
-
get
|
|
11
|
+
get labelHeight() {
|
|
12
12
|
return theme.default.height;
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
labelTextAlign: 'right',
|
|
16
|
-
labelGap: '
|
|
16
|
+
labelGap: '16px',
|
|
17
17
|
|
|
18
18
|
get starColor() {
|
|
19
19
|
return theme.color.danger;
|
|
@@ -50,12 +50,12 @@ setDefault(function () {
|
|
|
50
50
|
}).form;
|
|
51
51
|
});
|
|
52
52
|
export function makeItemStyles() {
|
|
53
|
-
return /*#__PURE__*/css("display:
|
|
53
|
+
return /*#__PURE__*/css("display:flex;position:relative;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid>.k-form-content{flex:1;}.k-form-label{display:flex;align-items:center;justify-content:", form.item.labelTextAlign === 'right' ? 'end' : 'start', ";width:", form.item.labelWidth, ";padding-right:", form.item.labelGap, ";max-height:", form.item.labelHeight, ";}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-inner{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.k-select,.k-checkbox-wrapper,.k-radio-wrapper{border:", form.item.invalidBorder, "!important;}.k-select .k-input .k-input-inner{border:none;}}.k-form-append{padding:", form.item.appendPadding, ";vertical-align:middle;}");
|
|
54
54
|
}
|
|
55
55
|
export function makeFormStyles() {
|
|
56
56
|
var _context;
|
|
57
57
|
|
|
58
|
-
return /*#__PURE__*/css("&.k-inline{.k-form-item{display:inline-
|
|
59
|
-
return /*#__PURE__*/css("&.k-", size, "{.k-form-item:not(:last-of-type){margin:", form.item[size + "Gap"], ";}&.k-inline{.k-form-item{margin-right:", form.item[size + "InlineGap"], ";}}}");
|
|
58
|
+
return /*#__PURE__*/css("&.k-inline{.k-form-item{display:inline-flex;vertical-align:top;margin-right:", form.item.inlineGap, ";}.k-form-label{width:auto;}}&.k-vertical{.k-form-item{flex-direction:column;}.k-form-label{width:auto;text-align:left;padding:0;justify-content:start;margin-bottom:", form.item.verticalLabelGap, ";}}", _mapInstanceProperty(_context = ['small', 'mini']).call(_context, function (size) {
|
|
59
|
+
return /*#__PURE__*/css("&.k-", size, "{.k-form-item:not(:last-of-type){margin-bottom:", form.item[size + "Gap"], ";}&.k-inline{.k-form-item{margin-right:", form.item[size + "InlineGap"], ";}}}");
|
|
60
60
|
}), ";");
|
|
61
61
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import { useInstance } from 'intact-react';
|
|
3
3
|
import { createContext } from '../context';
|
|
4
|
-
import { hasDocumentAvailable, isObject, isNullOrUndefined } from 'intact-shared';
|
|
5
|
-
import { useState } from '../../hooks/useState';
|
|
6
|
-
import { responsiveMap } from './constants';
|
|
7
|
-
var enquire;
|
|
4
|
+
import { hasDocumentAvailable, isObject, isNullOrUndefined } from 'intact-shared'; // import type * as EnquireJs from 'enquire.js';
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
6
|
+
import enquire from 'enquire.js';
|
|
7
|
+
import { useState } from '../../hooks/useState';
|
|
8
|
+
import { responsiveMap } from './constants'; // let enquire: typeof EnquireJs;
|
|
9
|
+
// if (hasDocumentAvailable) {
|
|
10
|
+
// enquire = require('enquire.js');
|
|
11
|
+
// }
|
|
12
12
|
|
|
13
13
|
export var context = createContext(0);
|
|
14
14
|
export function useGutter() {
|
|
@@ -22,7 +22,7 @@ export function useGutter() {
|
|
|
22
22
|
xs: false
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
if (
|
|
25
|
+
if (hasDocumentAvailable) {
|
|
26
26
|
var _loop = function _loop(key) {
|
|
27
27
|
enquire.register(responsiveMap[key], {
|
|
28
28
|
match: function match() {
|
package/components/icon/index.js
CHANGED
|
@@ -10,7 +10,8 @@ var typeDefs = {
|
|
|
10
10
|
size: _concatInstanceProperty(_context = []).call(_context, sizes, ['default', String, Number]),
|
|
11
11
|
color: String,
|
|
12
12
|
rotate: Boolean,
|
|
13
|
-
hoverable: Boolean
|
|
13
|
+
hoverable: Boolean,
|
|
14
|
+
disabled: Boolean
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
var defaults = function defaults() {
|
|
@@ -16,12 +16,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
16
16
|
color = _this$get.color,
|
|
17
17
|
rotate = _this$get.rotate,
|
|
18
18
|
hoverable = _this$get.hoverable,
|
|
19
|
-
children = _this$get.children
|
|
19
|
+
children = _this$get.children,
|
|
20
|
+
disabled = _this$get.disabled;
|
|
20
21
|
|
|
21
22
|
var classNameObj = (_classNameObj = {
|
|
22
23
|
'k-icon': true,
|
|
23
24
|
'k-rotate': rotate,
|
|
24
|
-
'k-hoverable': hoverable
|
|
25
|
+
'k-hoverable': !disabled && hoverable,
|
|
26
|
+
'k-disabled': disabled
|
|
25
27
|
}, _classNameObj[className] = className, _classNameObj);
|
|
26
28
|
var _style = {};
|
|
27
29
|
|
|
@@ -11,6 +11,14 @@ var defaults = {
|
|
|
11
11
|
return theme.transition.small;
|
|
12
12
|
},
|
|
13
13
|
|
|
14
|
+
get disabledColor() {
|
|
15
|
+
return theme.color.disabled;
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
get color() {
|
|
19
|
+
return theme.color.lightBlack;
|
|
20
|
+
},
|
|
21
|
+
|
|
14
22
|
fontSize: {
|
|
15
23
|
default: '16px',
|
|
16
24
|
large: '22px',
|
|
@@ -27,11 +35,11 @@ setDefault(function () {
|
|
|
27
35
|
export var colors = ['primary', 'warning', 'danger', 'success'];
|
|
28
36
|
export var sizes = ['large', 'small', 'mini'];
|
|
29
37
|
export default function makeStyles(color) {
|
|
30
|
-
return /*#__PURE__*/css("font-size:", icon.fontSize.default, ";line-height:1;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
38
|
+
return /*#__PURE__*/css("color:", icon.color, ";font-size:", icon.fontSize.default, ";line-height:1;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
31
39
|
var fontSize = icon.fontSize[size];
|
|
32
40
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", fontSize, ";}");
|
|
33
41
|
}), " ", _mapInstanceProperty(colors).call(colors, function (color) {
|
|
34
42
|
var _color = theme.color[color];
|
|
35
43
|
return /*#__PURE__*/css("&.k-", color, "{color:", _color, ";&.k-hoverable:hover{color:", palette(_color, -2), ";}}");
|
|
36
|
-
}), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{position:relative;font-size:inherit;z-index:1;}&.k-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && "\n &:hover {\n color: " + palette(color, -2) + " !important;\n }\n ", ";&:hover{color:", theme.color.primary, ";}}");
|
|
44
|
+
}), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{position:relative;font-size:inherit;z-index:1;}&.k-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && "\n &:hover {\n color: " + palette(color, -2) + " !important;\n }\n ", ";&:hover{color:", theme.color.primary, ";}}&.k-disabled{cursor:not-allowed;color:", icon.disabledColor, "!important;}");
|
|
37
45
|
}
|
|
@@ -30,6 +30,7 @@ export interface InputProps<V extends Value = Value> extends InputHTMLAttributes
|
|
|
30
30
|
waveDisabled?: boolean;
|
|
31
31
|
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
32
32
|
showPassword?: boolean;
|
|
33
|
+
flat?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export declare type AutoRows = {
|
|
35
36
|
min?: number;
|
|
@@ -4,7 +4,7 @@ import { __decorate } from "tslib";
|
|
|
4
4
|
import { Component, createRef } from 'intact-react';
|
|
5
5
|
import { sizes } from '../../styles/utils';
|
|
6
6
|
import template from './index.vdt';
|
|
7
|
-
import { bind } from '../utils';
|
|
7
|
+
import { bind, selectValue } from '../utils';
|
|
8
8
|
import { useAutoWidth } from './useAutoWidth';
|
|
9
9
|
import { useFrozen } from './useFrozen';
|
|
10
10
|
import { useAutoRows } from './useAutoRows';
|
|
@@ -28,7 +28,8 @@ var typeDefs = {
|
|
|
28
28
|
inline: Boolean,
|
|
29
29
|
waveDisabled: Boolean,
|
|
30
30
|
resize: ['none', 'vertical', 'horizontal', 'both'],
|
|
31
|
-
showPassword: Boolean
|
|
31
|
+
showPassword: Boolean,
|
|
32
|
+
flat: Boolean
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
var defaults = function defaults() {
|
|
@@ -78,15 +79,7 @@ export var Input = /*#__PURE__*/function (_Component) {
|
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
_proto.select = function select() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (input.select) {
|
|
84
|
-
input.select();
|
|
85
|
-
} else if (input.setSelectionRange) {
|
|
86
|
-
// mobile safari
|
|
87
|
-
input.focus();
|
|
88
|
-
input.setSelectionRange(0, input.value.length);
|
|
89
|
-
}
|
|
82
|
+
selectValue(this.inputRef.value);
|
|
90
83
|
};
|
|
91
84
|
|
|
92
85
|
_proto.clear = function clear(e) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["className", "style", "type", "value", "defaultValue", "placeholder", "clearable", "disabled", "size", "rows", "autoWidth", "fluid", "width", "stackClearIcon", "frozenOnInput", "readonly", "inline", "waveDisabled", "resize", "ev-click", "ev-mounseenter", "ev-mouseleave"];
|
|
3
|
+
var _excluded = ["className", "style", "type", "value", "defaultValue", "placeholder", "clearable", "disabled", "size", "rows", "autoWidth", "fluid", "width", "stackClearIcon", "frozenOnInput", "readonly", "inline", "waveDisabled", "resize", "flat", "ev-click", "ev-mounseenter", "ev-mouseleave"];
|
|
4
|
+
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
4
5
|
import { createElementVNode as _$ce, className as _$cn, createUnknownComponentVNode as _$cc, noop as _$no, createVNode as _$cv } from 'intact-react';
|
|
5
6
|
import { Icon } from '../icon';
|
|
6
7
|
import { addStyle, isTextBlock, getRestProps } from '../utils';
|
|
@@ -40,6 +41,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
40
41
|
inline = _this$get.inline,
|
|
41
42
|
waveDisabled = _this$get.waveDisabled,
|
|
42
43
|
resize = _this$get.resize,
|
|
44
|
+
flat = _flatInstanceProperty(_this$get),
|
|
43
45
|
click = _this$get['ev-click'],
|
|
44
46
|
mouseenter = _this$get['ev-mounseenter'],
|
|
45
47
|
mouseleave = _this$get['ev-mouseleave'],
|
|
@@ -54,7 +56,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
54
56
|
var isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto';
|
|
55
57
|
var classNameObj = (_classNameObj = {
|
|
56
58
|
'k-input': true
|
|
57
|
-
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-with-prefix'] = $blocks.prefix, _classNameObj['k-with-suffix'] = $blocks.suffix, _classNameObj['k-clearable'] = clearable, _classNameObj['k-auto-width'] = autoWidth, _classNameObj['k-fluid'] = fluid, _classNameObj['k-stack-clear'] = stackClearIcon, _classNameObj['k-inline'] = inline, _classNameObj["k-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
59
|
+
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-with-prefix'] = $blocks.prefix, _classNameObj['k-with-suffix'] = $blocks.suffix, _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-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
58
60
|
var _this$showPassword = this.showPassword,
|
|
59
61
|
isShowPassword = _this$showPassword.isShow,
|
|
60
62
|
toggleShowPassword = _this$showPassword.toggleShow,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
1
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
3
|
import { css } from '@emotion/css';
|
|
3
4
|
import { theme, setDefault } from '../../styles/theme';
|
|
@@ -85,6 +86,17 @@ var defaults = deepDefaults({
|
|
|
85
86
|
// search input
|
|
86
87
|
search: {
|
|
87
88
|
suffixMarginRight: '15px'
|
|
89
|
+
},
|
|
90
|
+
// flat
|
|
91
|
+
flat: {
|
|
92
|
+
get color() {
|
|
93
|
+
return theme.color.lightBlack;
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
get bgColor() {
|
|
97
|
+
return theme.color.bg;
|
|
98
|
+
}
|
|
99
|
+
|
|
88
100
|
}
|
|
89
101
|
}, sizes.reduce(function (memo, size) {
|
|
90
102
|
var styles = theme[size];
|
|
@@ -102,16 +114,6 @@ var defaults = deepDefaults({
|
|
|
102
114
|
}
|
|
103
115
|
|
|
104
116
|
};
|
|
105
|
-
|
|
106
|
-
if (size === 'large') {
|
|
107
|
-
// use default padding for large size
|
|
108
|
-
Object.defineProperty(memo.large, 'paddingGap', {
|
|
109
|
-
get: function get() {
|
|
110
|
-
return theme.default.padding;
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
117
|
return memo;
|
|
116
118
|
}, {}));
|
|
117
119
|
var input;
|
|
@@ -123,7 +125,7 @@ setDefault(function () {
|
|
|
123
125
|
export function makeStyles() {
|
|
124
126
|
var _context;
|
|
125
127
|
|
|
126
|
-
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";vertical-align:middle;.k-input-wrapper{display:inline-block;width:100%;position:relative;}.k-input-inner{display:inline-block;width:100%;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";outline:none;position:relative;color:", input.color, ";&:hover{border:", input.hoverBorder, ";z-index:1;}&:focus{border:", input.focusBorder, ";z-index:1;}&::placeholder{color:", input.placeholderColor, ";}}&.k-fluid{width:100%;}.k-input-prefix,.k-input-suffix{position:absolute;top:50%;transform:translateY(-50%);z-index:2;}.k-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";+*{margin-left:", input.clearIconGap, ";}}&: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+i{transition:opacity ", input.transition, ";}}&:hover{.k-input-clear.k-input-show+i{opacity:0;}}}&.k-group{display:table;.k-input-inner{border-radius:0;}.k-input-wrapper:first-child{.k-input-inner{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-wrapper:last-child{.k-input-inner{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}}.k-input-prepend,.k-input-append{display:table-cell;width:1px;vertical-align:middle;background-color:", input.groupBgColor, ";border:", input.border, ";text-align:center;white-space:nowrap;.k-btn{margin:-1px
|
|
128
|
+
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";vertical-align:middle;.k-input-wrapper{display:inline-block;width:100%;position:relative;}.k-input-inner{display:inline-block;width:100%;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";outline:none;position:relative;color:", input.color, ";&:hover{border:", input.hoverBorder, ";z-index:1;}&:focus{border:", input.focusBorder, ";z-index:1;}&::placeholder{color:", input.placeholderColor, ";}}&.k-fluid{width:100%;}.k-input-prefix,.k-input-suffix{position:absolute;top:50%;transform:translateY(-50%);z-index:2;color:", theme.color.lightBlack, ";line-height:1;}.k-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";+*{margin-left:", input.clearIconGap, ";}}&: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+i{transition:opacity ", input.transition, ";}}&:hover{.k-input-clear.k-input-show+i{opacity:0;}}}&.k-group{display:table;.k-input-inner{border-radius:0;}.k-input-wrapper:first-child{.k-input-inner{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-wrapper:last-child{.k-input-inner{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}}.k-input-prepend,.k-input-append{display:table-cell;width:1px;vertical-align:middle;background-color:", input.groupBgColor, ";border:", input.border, ";text-align:center;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{.k-input-inner{border:none;background:", _flatInstanceProperty(input).bgColor, ";color:", _flatInstanceProperty(input).color, ";}}&.k-disabled{color:", input.disabledColor, ";cursor:not-allowed;.k-input-inner{color:", input.disabledColor, ";border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
127
129
|
var styles = input[size];
|
|
128
130
|
var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.k-input-inner{height:", styles.height, ";line-height:", styles.height, ";font-size:", styles.fontSize, ";padding:0 ", styles.paddingGap, ";}.k-input-prefix{left:", styles.paddingGap, ";}.k-input-suffix{right:", styles.paddingGap, ";}&.k-with-prefix{.k-input-inner{padding-left:calc(", styles.paddingGap, " + 1rem + ", input.clearIconGap, ");}}&.k-with-suffix,&.k-clearable{.k-input-inner{padding-right:calc(", styles.paddingGap, " + 1rem + ", input.clearIconGap, ");}}&:not(.k-stack-clear).k-with-suffix.k-clearable{.k-input-inner{padding-right:calc(", styles.paddingGap, " + 2rem + ", input.clearIconGap, " * 2);}}");
|
|
129
131
|
if (size === 'default') return sizeClassName;
|