@king-design/react 3.1.1-beta.1 → 3.1.1-beta.3
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/dialog/base.vdt.js +65 -55
- package/components/drawer/index.spec.js +1 -1
- package/components/drawer/index.vdt.js +4 -4
- package/components/drawer/styles.js +5 -34
- package/components/input/index.vdt.js +1 -1
- package/components/input/styles.js +1 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
|
@@ -40,80 +40,90 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
40
40
|
'appear': value,
|
|
41
41
|
'key': 'dialog',
|
|
42
42
|
'onAfterLeave': this.onAfterLeave,
|
|
43
|
-
'children': (isHide ? true : value) ? _$ce(2, 'div', (_$blocks['
|
|
44
|
-
return
|
|
45
|
-
return _$ce(2, '
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
'children': (isHide ? true : value) ? _$ce(2, 'div', [null, (_$blocks['_content'] = function ($super) {
|
|
44
|
+
return _$blocks['content'] = function ($super) {
|
|
45
|
+
return [_$ce(2, 'div', [(_$blocks['header'] = function ($super) {
|
|
46
|
+
return _$ce(2, 'span', title, 0, _$cn(k + "-dialog-title"));
|
|
47
|
+
}, __$blocks['header'] = function ($super, data) {
|
|
48
|
+
var block = $blocks['header'];
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
var callBlock = function callBlock() {
|
|
51
|
+
return _$blocks['header'].call($this, $super, data);
|
|
52
|
+
};
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
55
|
+
}, __$blocks['header'](_$no)), !hideClose && !$props.hideClose ? _$cc(Button, {
|
|
56
|
+
'type': 'none',
|
|
57
|
+
'icon': true,
|
|
58
|
+
'title': _$("关闭"),
|
|
59
|
+
'className': _$cn(k + "-dialog-close"),
|
|
60
|
+
'ev-click': this.terminate,
|
|
61
|
+
'ev-mousedown': stopPropagation,
|
|
62
|
+
'children': _$cc(Icon, {
|
|
63
|
+
'className': _$cn(k + "-icon-close")
|
|
64
|
+
})
|
|
65
|
+
}) : undefined], 0, _$cn(k + "-dialog-header"), {
|
|
66
|
+
'ev-mousedown': this.drag.start
|
|
67
|
+
}), _$ce(2, 'div', (_$blocks['body'] = function ($super) {
|
|
68
|
+
return children;
|
|
69
|
+
}, __$blocks['body'] = function ($super, data) {
|
|
70
|
+
var block = $blocks['body'];
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
var callBlock = function callBlock() {
|
|
73
|
+
return _$blocks['body'].call($this, $super, data);
|
|
74
|
+
};
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
76
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
77
|
+
}, __$blocks['body'](_$no)), 0, _$cn(k + "-dialog-body")), (_$blocks['footer-wrapper'] = function ($super) {
|
|
78
|
+
return _$ce(2, 'div', (_$blocks['footer'] = function ($super) {
|
|
79
|
+
return [_$cc(Button, {
|
|
80
|
+
'className': _$cn(k + "-dialog-cancel"),
|
|
81
|
+
'ev-click': this.cancel,
|
|
82
|
+
'children': cancelText
|
|
83
|
+
}), _$cc(Button, {
|
|
84
|
+
'className': _$cn(k + "-dialog-ok"),
|
|
85
|
+
'type': 'primary',
|
|
86
|
+
'ev-click': this.ok,
|
|
87
|
+
'loading': loading,
|
|
88
|
+
'disabled': disabledOk,
|
|
89
|
+
'children': okText
|
|
90
|
+
})];
|
|
91
|
+
}, __$blocks['footer'] = function ($super, data) {
|
|
92
|
+
var block = $blocks['footer'];
|
|
93
|
+
|
|
94
|
+
var callBlock = function callBlock() {
|
|
95
|
+
return _$blocks['footer'].call($this, $super, data);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
99
|
+
}, __$blocks['footer'](_$no)), 0, _$cn(k + "-dialog-footer"));
|
|
100
|
+
}, __$blocks['footer-wrapper'] = function ($super, data) {
|
|
101
|
+
var block = $blocks['footer-wrapper'];
|
|
92
102
|
|
|
93
103
|
var callBlock = function callBlock() {
|
|
94
|
-
return _$blocks['footer'].call($this, $super, data);
|
|
104
|
+
return _$blocks['footer-wrapper'].call($this, $super, data);
|
|
95
105
|
};
|
|
96
106
|
|
|
97
107
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
98
|
-
}, __$blocks['footer'](_$no))
|
|
99
|
-
}, __$blocks['
|
|
100
|
-
var block = $blocks['
|
|
108
|
+
}, __$blocks['footer-wrapper'](_$no))];
|
|
109
|
+
}, __$blocks['content'] = function ($super, data) {
|
|
110
|
+
var block = $blocks['content'];
|
|
101
111
|
|
|
102
112
|
var callBlock = function callBlock() {
|
|
103
|
-
return _$blocks['
|
|
113
|
+
return _$blocks['content'].call($this, $super, data);
|
|
104
114
|
};
|
|
105
115
|
|
|
106
116
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
107
|
-
}, __$blocks['
|
|
108
|
-
}, __$blocks['
|
|
109
|
-
var block = $blocks['
|
|
117
|
+
}, __$blocks['content'](_$no);
|
|
118
|
+
}, __$blocks['_content'] = function ($super, data) {
|
|
119
|
+
var block = $blocks['_content'];
|
|
110
120
|
|
|
111
121
|
var callBlock = function callBlock() {
|
|
112
|
-
return _$blocks['
|
|
122
|
+
return _$blocks['_content'].call($this, $super, data);
|
|
113
123
|
};
|
|
114
124
|
|
|
115
125
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
116
|
-
}, __$blocks['
|
|
126
|
+
}, __$blocks['_content'](_$no))], 0, _$cn(classNameObj), {
|
|
117
127
|
'style': {
|
|
118
128
|
width: typeof width === 'number' ? width + "px" : width
|
|
119
129
|
},
|
|
@@ -60,7 +60,7 @@ describe('Drawer', function () {
|
|
|
60
60
|
case 0:
|
|
61
61
|
this.timeout(0);
|
|
62
62
|
_mount2 = mount(PlacementDemo), instance = _mount2[0], element = _mount2[1];
|
|
63
|
-
_element$querySelecto = element.querySelectorAll('.
|
|
63
|
+
_element$querySelecto = element.querySelectorAll('.placement-btn'), top = _element$querySelecto[0], bottom = _element$querySelecto[1], left = _element$querySelecto[2], right = _element$querySelecto[3];
|
|
64
64
|
|
|
65
65
|
test = /*#__PURE__*/function () {
|
|
66
66
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(btn, className) {
|
|
@@ -19,13 +19,13 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
19
19
|
var _$blocks = {},
|
|
20
20
|
__$blocks = _$ex({}, $blocks);
|
|
21
21
|
|
|
22
|
-
return (_$blocks['
|
|
22
|
+
return (_$blocks['_content'] = function ($super) {
|
|
23
23
|
return _$ce(2, 'div', $super(), 0, _$cn(k + "-drawer-content"));
|
|
24
|
-
}, __$blocks['
|
|
25
|
-
var block = $blocks['
|
|
24
|
+
}, __$blocks['_content'] = function ($super, data) {
|
|
25
|
+
var block = $blocks['_content'];
|
|
26
26
|
|
|
27
27
|
var callBlock = function callBlock() {
|
|
28
|
-
return _$blocks['
|
|
28
|
+
return _$blocks['_content'].call($this, $super, data);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
1
|
import { css } from '@emotion/css';
|
|
3
2
|
import { theme, setDefault } from '../../styles/theme';
|
|
4
3
|
import { deepDefaults } from '../../styles/utils';
|
|
@@ -21,38 +20,10 @@ setDefault(function () {
|
|
|
21
20
|
}).drawer;
|
|
22
21
|
});
|
|
23
22
|
export function makeStyles(overlay, k) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var borderRadius = '';
|
|
28
|
-
placements.forEach(function (p) {
|
|
29
|
-
// Set top to `0 !important` when overlay is false and placement is right or left
|
|
30
|
-
// Because dialog without overlay don't have positional parent element
|
|
31
|
-
positionValue += p !== placement ? (placement === 'right' || placement === 'left') && !overlay && p === 'top' ? p + ": 0;" : p + ": auto;" : p + ": 0;";
|
|
32
|
-
});
|
|
23
|
+
var borderRadius = theme.largeBorderRadius;
|
|
24
|
+
return /*#__PURE__*/css("&.k-drawer{position:fixed;background:transparent;box-shadow:none;border-radius:0;}&.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;}}", makePlacementStyles(k, 'right', "right: 0; height: 100%;", "translateX(100%)", borderRadius + " 0 0 " + borderRadius), " ", makePlacementStyles(k, 'left', 'left: 0; height: 100%;', "translateX(-100%)", "0 " + borderRadius + " " + borderRadius + " 0"), " ", makePlacementStyles(k, 'top', 'left: 50%; top: 0; transform: translateX(-50%);', "translateY(-100%)", "0 0 " + borderRadius + " " + borderRadius), " ", makePlacementStyles(k, 'bottom', 'left: 50%; bottom: 0; transform: translateX(-50%);', "translateY(100%)", "0 " + borderRadius + " " + borderRadius + " 0"), " &.", k, "-top,&.", k, "-bottom{width:100%;}");
|
|
25
|
+
}
|
|
33
26
|
|
|
34
|
-
|
|
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
|
-
}
|
|
44
|
-
} else {
|
|
45
|
-
positionValue += 'width: 100% !important;';
|
|
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
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return /*#__PURE__*/css("&.", k, "-", placement, "{", positionValue, " &.transition-enter-from,&.transition-leave-to,&.transition-appear-from{transform:none!important;.", k, "-drawer-content{transform:", transformValue, ";}}.", k, "-drawer-content{border-radius:", borderRadius, ";}}");
|
|
57
|
-
}), ";");
|
|
27
|
+
function makePlacementStyles(k, placement, styles, transform, borderRadius) {
|
|
28
|
+
return /*#__PURE__*/css("&.", k, "-drawer.", k, "-", placement, "{", styles, " &.transition-enter-from,&.transition-leave-to,&.transition-appear-from{.", k, "-drawer-content{transform:", transform, ";}}.", k, "-drawer-content{border-radius:", borderRadius, ";}}");
|
|
58
29
|
}
|
|
@@ -144,7 +144,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
144
144
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
145
145
|
}, __$blocks['suffix'](_$no))], 0, _$cn(k + "-input-suffix"), {
|
|
146
146
|
'ev-click': stopPropagation
|
|
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"), {
|
|
147
|
+
}) : undefined, autoWidth ? _$ce(2, 'div', _$ce(2, 'span', !hasValue ? hasInputValue || !defaultValue ? placeholder : defaultValue : inputValue, 0, null, null, null, fakeRef), 2, _$cn(k + "-input-fake")) : undefined], 0, _$cn(k + "-input-wrapper"), {
|
|
148
148
|
'ev-click': focusInputOnClick
|
|
149
149
|
})
|
|
150
150
|
});
|
|
@@ -139,7 +139,7 @@ export function makeStyles(k) {
|
|
|
139
139
|
return /*#__PURE__*/css("&.", k, "-", size, "{", sizeClassName, ";}");
|
|
140
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
141
|
return /*#__PURE__*/css("&.", k, "-resize-", type, "{.", k, "-textarea{resize:", type, ";}}");
|
|
142
|
-
}), ".", k, "-input-fake{left:0;top:0;
|
|
142
|
+
}), ".", k, "-input-fake{left:0;top:0;position:absolute;overflow:hidden;visibility:hidden;white-space:nowrap;}&.", k, "-auto-width{width:auto;max-width:100%;}.", k, "-input-count{color:", input.count.color, ";}");
|
|
143
143
|
}
|
|
144
144
|
export function makeSearchStyles(k) {
|
|
145
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) {
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.1-beta.
|
|
2
|
+
* @king-design v3.1.1-beta.3
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -60,7 +60,7 @@ export * from './components/tree';
|
|
|
60
60
|
export * from './components/treeSelect';
|
|
61
61
|
export * from './components/upload';
|
|
62
62
|
export * from './components/wave';
|
|
63
|
-
export declare const version = "3.1.1-beta.
|
|
63
|
+
export declare const version = "3.1.1-beta.3";
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
export {normalize} from 'intact-react';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.1-beta.
|
|
2
|
+
* @king-design v3.1.1-beta.3
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -62,7 +62,7 @@ export * from './components/tree';
|
|
|
62
62
|
export * from './components/treeSelect';
|
|
63
63
|
export * from './components/upload';
|
|
64
64
|
export * from './components/wave';
|
|
65
|
-
export var version = '3.1.1-beta.
|
|
65
|
+
export var version = '3.1.1-beta.3';
|
|
66
66
|
/* generate end */
|
|
67
67
|
|
|
68
68
|
export {normalize} from 'intact-react';
|