shineout 1.8.0-rc.5 → 1.8.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/css/AnimationList/AbsoluteList.js +59 -68
- package/css/Button/Button.js +1 -0
- package/css/Button/styles/button.css +6 -0
- package/css/Cascader/Result.js +3 -2
- package/css/Cascader/styles/cascader.css +9 -1
- package/css/Checkbox/Group.js +6 -3
- package/css/Checkbox/index.d.ts +1 -1
- package/css/DatePicker/Month.js +7 -1
- package/css/Datum/Tree.js +2 -1
- package/css/Menu/Root.js +10 -4
- package/css/Rule/index.d.ts +26 -3
- package/css/Select/Result.js +5 -4
- package/css/Select/styles/select.css +8 -4
- package/css/Spin/index.d.ts +3 -1
- package/css/Table/index.d.ts +10 -0
- package/css/Textarea/index.d.ts +34 -23
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/css/utils/zoom.js +37 -0
- package/dist/shineout.js +216 -162
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/theme.antd.css +1 -1
- package/dist/theme.antd2.css +1 -1
- package/dist/theme.default.css +1 -1
- package/dist/theme.shineout.css +1 -1
- package/es/AnimationList/AbsoluteList.js +59 -69
- package/es/Button/Button.js +1 -0
- package/es/Button/styles/button.less +2 -0
- package/es/Cascader/Result.js +3 -2
- package/es/Cascader/styles/cascader.less +11 -1
- package/es/Checkbox/Group.js +6 -3
- package/es/Checkbox/index.d.ts +1 -1
- package/es/DatePicker/Month.js +7 -1
- package/es/Datum/Tree.js +2 -1
- package/es/Menu/Root.js +9 -4
- package/es/Rule/index.d.ts +26 -3
- package/es/Select/Result.js +5 -4
- package/es/Select/styles/select.less +8 -3
- package/es/Spin/index.d.ts +3 -1
- package/es/Table/index.d.ts +10 -0
- package/es/Textarea/index.d.ts +34 -23
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/utils/zoom.js +27 -0
- package/lib/AnimationList/AbsoluteList.js +59 -68
- package/lib/Button/Button.js +1 -0
- package/lib/Button/styles/button.less +2 -0
- package/lib/Cascader/Result.js +3 -2
- package/lib/Cascader/styles/cascader.less +11 -1
- package/lib/Checkbox/Group.js +6 -3
- package/lib/Checkbox/index.d.ts +1 -1
- package/lib/DatePicker/Month.js +7 -1
- package/lib/Datum/Tree.js +2 -1
- package/lib/Menu/Root.js +10 -4
- package/lib/Rule/index.d.ts +26 -3
- package/lib/Select/Result.js +5 -4
- package/lib/Select/styles/select.less +8 -3
- package/lib/Spin/index.d.ts +3 -1
- package/lib/Table/index.d.ts +10 -0
- package/lib/Textarea/index.d.ts +34 -23
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/zoom.js +37 -0
- package/package.json +1 -1
|
@@ -41,6 +41,8 @@ var _context2 = _interopRequireDefault(require("../Modal/context"));
|
|
|
41
41
|
|
|
42
42
|
var _config = require("../config");
|
|
43
43
|
|
|
44
|
+
var _zoom = require("../utils/zoom");
|
|
45
|
+
|
|
44
46
|
var PICKER_V_MARGIN = 4;
|
|
45
47
|
var root;
|
|
46
48
|
|
|
@@ -89,6 +91,7 @@ function _default(List) {
|
|
|
89
91
|
props.getResetPosition(_this.resetPosition.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this))));
|
|
90
92
|
}
|
|
91
93
|
|
|
94
|
+
_this.zoomChangeHandler = _this.zoomChangeHandler.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
92
95
|
return _this;
|
|
93
96
|
}
|
|
94
97
|
|
|
@@ -103,6 +106,10 @@ function _default(List) {
|
|
|
103
106
|
this.forceUpdate();
|
|
104
107
|
}
|
|
105
108
|
}
|
|
109
|
+
|
|
110
|
+
if (this.props.absolute) {
|
|
111
|
+
(0, _zoom.addZoomListener)(this.zoomChangeHandler);
|
|
112
|
+
}
|
|
106
113
|
};
|
|
107
114
|
|
|
108
115
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
@@ -118,6 +125,7 @@ function _default(List) {
|
|
|
118
125
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
119
126
|
var absolute = this.props.absolute;
|
|
120
127
|
if (!absolute) return;
|
|
128
|
+
(0, _zoom.removeZoomListener)(this.zoomChangeHandler);
|
|
121
129
|
|
|
122
130
|
if (this.container) {
|
|
123
131
|
this.container.removeChild(this.element);
|
|
@@ -125,9 +133,7 @@ function _default(List) {
|
|
|
125
133
|
};
|
|
126
134
|
|
|
127
135
|
_proto.getPosition = function getPosition(rect) {
|
|
128
|
-
var
|
|
129
|
-
fixed = _this$props.fixed,
|
|
130
|
-
absolute = _this$props.absolute;
|
|
136
|
+
var fixed = this.props.fixed;
|
|
131
137
|
var position = this.props.position;
|
|
132
138
|
var rtl = (0, _config.isRTL)();
|
|
133
139
|
var style = {
|
|
@@ -148,34 +154,13 @@ function _default(List) {
|
|
|
148
154
|
position = (0, _strings.getRTLPosition)(position);
|
|
149
155
|
}
|
|
150
156
|
|
|
151
|
-
var containerScroll;
|
|
152
|
-
var containerRect;
|
|
153
157
|
var container = this.container;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
if (rtl) {
|
|
163
|
-
containerScroll.width = container.scrollWidth;
|
|
164
|
-
}
|
|
165
|
-
} else {
|
|
166
|
-
containerRect = {
|
|
167
|
-
left: 0,
|
|
168
|
-
top: 0,
|
|
169
|
-
right: 0,
|
|
170
|
-
bottom: 0
|
|
171
|
-
};
|
|
172
|
-
containerScroll = _document.docScroll;
|
|
173
|
-
|
|
174
|
-
if (rtl) {
|
|
175
|
-
containerRect.width = document.documentElement.clientWidth || document.body.clientWidth;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
158
|
+
var rootContainer = container === root || !container ? document.body : container;
|
|
159
|
+
var containerRect = rootContainer.getBoundingClientRect();
|
|
160
|
+
var containerScroll = {
|
|
161
|
+
left: rootContainer.scrollLeft,
|
|
162
|
+
top: rootContainer.scrollTop
|
|
163
|
+
};
|
|
179
164
|
this.containerRect = containerRect;
|
|
180
165
|
|
|
181
166
|
if (listPosition.includes(position)) {
|
|
@@ -194,12 +179,12 @@ function _default(List) {
|
|
|
194
179
|
if (h === 'left') {
|
|
195
180
|
style.left = rect.left - containerRect.left + containerScroll.left;
|
|
196
181
|
} else {
|
|
197
|
-
style.left = rect.right - containerRect.
|
|
182
|
+
style.left = rect.right - containerRect.left + containerScroll.left;
|
|
198
183
|
style.transform = 'translateX(-100%)';
|
|
199
184
|
}
|
|
200
185
|
|
|
201
186
|
if (v === 'bottom') {
|
|
202
|
-
style.top = rect.bottom - containerRect.
|
|
187
|
+
style.top = rect.bottom - containerRect.top + containerScroll.top + PICKER_V_MARGIN;
|
|
203
188
|
} else {
|
|
204
189
|
style.top = rect.top - containerRect.top + containerScroll.top - PICKER_V_MARGIN;
|
|
205
190
|
style.transform = style.transform ? 'translate(-100%, -100%)' : 'translateY(-100%)';
|
|
@@ -215,10 +200,10 @@ function _default(List) {
|
|
|
215
200
|
};
|
|
216
201
|
|
|
217
202
|
_proto.getStyle = function getStyle() {
|
|
218
|
-
var _this$
|
|
219
|
-
parentElement = _this$
|
|
220
|
-
scrollElement = _this$
|
|
221
|
-
focus = _this$
|
|
203
|
+
var _this$props = this.props,
|
|
204
|
+
parentElement = _this$props.parentElement,
|
|
205
|
+
scrollElement = _this$props.scrollElement,
|
|
206
|
+
focus = _this$props.focus;
|
|
222
207
|
var lazyResult = {
|
|
223
208
|
focus: focus,
|
|
224
209
|
style: this.lastStyle
|
|
@@ -248,10 +233,16 @@ function _default(List) {
|
|
|
248
233
|
};
|
|
249
234
|
};
|
|
250
235
|
|
|
236
|
+
_proto.zoomChangeHandler = function zoomChangeHandler() {
|
|
237
|
+
if (this.props.focus) {
|
|
238
|
+
this.forceUpdate();
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
251
242
|
_proto.resetPosition = function resetPosition(clean) {
|
|
252
|
-
var _this$
|
|
253
|
-
focus = _this$
|
|
254
|
-
parentElement = _this$
|
|
243
|
+
var _this$props2 = this.props,
|
|
244
|
+
focus = _this$props2.focus,
|
|
245
|
+
parentElement = _this$props2.parentElement;
|
|
255
246
|
if (!this.el || !focus || this.ajustdoc && !clean) return;
|
|
256
247
|
var pos = this.el.getBoundingClientRect();
|
|
257
248
|
var left = pos.left;
|
|
@@ -286,21 +277,21 @@ function _default(List) {
|
|
|
286
277
|
};
|
|
287
278
|
|
|
288
279
|
_proto.renderList = function renderList() {
|
|
289
|
-
var _this$
|
|
290
|
-
parentElement = _this$
|
|
291
|
-
absolute = _this$
|
|
292
|
-
focus = _this$
|
|
293
|
-
rootClass = _this$
|
|
294
|
-
position = _this$
|
|
295
|
-
scrollLeft = _this$
|
|
296
|
-
scrollTop = _this$
|
|
297
|
-
scrollElement = _this$
|
|
298
|
-
_this$
|
|
299
|
-
style = _this$
|
|
300
|
-
zIndex = _this$
|
|
301
|
-
getResetPosition = _this$
|
|
302
|
-
ignore = _this$
|
|
303
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_this$
|
|
280
|
+
var _this$props3 = this.props,
|
|
281
|
+
parentElement = _this$props3.parentElement,
|
|
282
|
+
absolute = _this$props3.absolute,
|
|
283
|
+
focus = _this$props3.focus,
|
|
284
|
+
rootClass = _this$props3.rootClass,
|
|
285
|
+
position = _this$props3.position,
|
|
286
|
+
scrollLeft = _this$props3.scrollLeft,
|
|
287
|
+
scrollTop = _this$props3.scrollTop,
|
|
288
|
+
scrollElement = _this$props3.scrollElement,
|
|
289
|
+
_this$props3$style = _this$props3.style,
|
|
290
|
+
style = _this$props3$style === void 0 ? {} : _this$props3$style,
|
|
291
|
+
zIndex = _this$props3.zIndex,
|
|
292
|
+
getResetPosition = _this$props3.getResetPosition,
|
|
293
|
+
ignore = _this$props3.autoAdapt,
|
|
294
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props3, ["parentElement", "absolute", "focus", "rootClass", "position", "scrollLeft", "scrollTop", "scrollElement", "style", "zIndex", "getResetPosition", "autoAdapt"]);
|
|
304
295
|
var parsed = parseInt(zIndex, 10);
|
|
305
296
|
if (!Number.isNaN(parsed)) style.zIndex = parsed;
|
|
306
297
|
var mergeStyle = Object.assign({}, style, this.state.overdoc ? getOverDocStyle() : undefined);
|
|
@@ -325,20 +316,20 @@ function _default(List) {
|
|
|
325
316
|
}
|
|
326
317
|
|
|
327
318
|
if (!this.container) return null;
|
|
328
|
-
var _this$
|
|
329
|
-
parentElement = _this$
|
|
330
|
-
rootClass = _this$
|
|
331
|
-
absolute = _this$
|
|
332
|
-
position = _this$
|
|
333
|
-
scrollLeft = _this$
|
|
334
|
-
scrollTop = _this$
|
|
335
|
-
scrollElement = _this$
|
|
336
|
-
autoClass = _this$
|
|
337
|
-
zIndex = _this$
|
|
338
|
-
getResetPosition = _this$
|
|
339
|
-
value = _this$
|
|
340
|
-
ignore = _this$
|
|
341
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_this$
|
|
319
|
+
var _this$props4 = this.props,
|
|
320
|
+
parentElement = _this$props4.parentElement,
|
|
321
|
+
rootClass = _this$props4.rootClass,
|
|
322
|
+
absolute = _this$props4.absolute,
|
|
323
|
+
position = _this$props4.position,
|
|
324
|
+
scrollLeft = _this$props4.scrollLeft,
|
|
325
|
+
scrollTop = _this$props4.scrollTop,
|
|
326
|
+
scrollElement = _this$props4.scrollElement,
|
|
327
|
+
autoClass = _this$props4.autoClass,
|
|
328
|
+
zIndex = _this$props4.zIndex,
|
|
329
|
+
getResetPosition = _this$props4.getResetPosition,
|
|
330
|
+
value = _this$props4.value,
|
|
331
|
+
ignore = _this$props4.autoAdapt,
|
|
332
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props4, ["parentElement", "rootClass", "absolute", "position", "scrollLeft", "scrollTop", "scrollElement", "autoClass", "zIndex", "getResetPosition", "value", "autoAdapt"]);
|
|
342
333
|
var mergeClass = (0, _classnames.default)((0, _styles.listClass)('absolute-wrapper'), rootClass, autoClass);
|
|
343
334
|
|
|
344
335
|
var _ref = props.focus ? this.getStyle() : {
|
package/css/Button/Button.js
CHANGED
|
@@ -75,6 +75,7 @@ function (_PureComponent) {
|
|
|
75
75
|
var type = isSecondary ? 'primary' : typeProp;
|
|
76
76
|
var outline = outlineProp || isSecondary;
|
|
77
77
|
var color = outline || type === 'default' ? undefined : '#fff';
|
|
78
|
+
if (text) color = 'currentColor';
|
|
78
79
|
var className = (0, _classnames.default)((0, _styles.buttonClass)('_', shape, type, outline && 'outline', {
|
|
79
80
|
large: size === 'large',
|
|
80
81
|
small: size === 'small',
|
|
@@ -762,6 +762,12 @@ fieldset[disabled] .so-button-danger.so-button-outline:not(.so-button-disabled):
|
|
|
762
762
|
box-shadow: none;
|
|
763
763
|
padding-left: 4px;
|
|
764
764
|
padding-right: 4px;
|
|
765
|
+
display: -webkit-inline-box;
|
|
766
|
+
display: -ms-inline-flexbox;
|
|
767
|
+
display: inline-flex;
|
|
768
|
+
-webkit-box-align: center;
|
|
769
|
+
-ms-flex-align: center;
|
|
770
|
+
align-items: center;
|
|
765
771
|
}
|
|
766
772
|
.so-button-text:not(:disabled):hover {
|
|
767
773
|
opacity: 0.8;
|
package/css/Cascader/Result.js
CHANGED
|
@@ -349,11 +349,12 @@ function (_PureComponent) {
|
|
|
349
349
|
compressed = _this$props8.compressed,
|
|
350
350
|
multiple = _this$props8.multiple;
|
|
351
351
|
var result = value.length === 0 ? this.renderPlaceholder() : this.renderResult();
|
|
352
|
+
var clearEl = this.renderClear();
|
|
352
353
|
return _react.default.createElement("div", {
|
|
353
354
|
ref: this.bindResult,
|
|
354
|
-
className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed'),
|
|
355
|
+
className: (0, _styles3.cascaderClass)('result', multiple && compressed && 'compressed', clearEl && 'result-clearable'),
|
|
355
356
|
style: style
|
|
356
|
-
}, result, this.renderIndicator(),
|
|
357
|
+
}, result, this.renderIndicator(), clearEl);
|
|
357
358
|
};
|
|
358
359
|
|
|
359
360
|
return Result;
|
|
@@ -127,10 +127,18 @@
|
|
|
127
127
|
background-color: inherit;
|
|
128
128
|
color: inherit;
|
|
129
129
|
}
|
|
130
|
-
.so-cascader
|
|
130
|
+
.so-cascader-disabled .so-cascader-result .so-select-multi {
|
|
131
|
+
visibility: visible;
|
|
132
|
+
cursor: not-allowed;
|
|
133
|
+
}
|
|
134
|
+
.so-cascader:not(.so-cascader-disabled).so-cascader-focus .so-cascader-close,
|
|
131
135
|
.so-cascader:not(.so-cascader-disabled) .so-cascader-result:hover .so-cascader-close {
|
|
132
136
|
display: block;
|
|
133
137
|
}
|
|
138
|
+
.so-cascader:not(.so-cascader-disabled).so-cascader-focus .so-cascader-result-clearable .so-select-multi,
|
|
139
|
+
.so-cascader:not(.so-cascader-disabled) .so-cascader-result-clearable:hover .so-select-multi {
|
|
140
|
+
visibility: hidden;
|
|
141
|
+
}
|
|
134
142
|
.so-cascader-multiple .so-cascader-close {
|
|
135
143
|
right: 19px;
|
|
136
144
|
}
|
package/css/Checkbox/Group.js
CHANGED
|
@@ -108,12 +108,14 @@ function (_PureComponent) {
|
|
|
108
108
|
data = _this$props2.data,
|
|
109
109
|
datum = _this$props2.datum,
|
|
110
110
|
keygen = _this$props2.keygen,
|
|
111
|
-
children = _this$props2.children
|
|
111
|
+
children = _this$props2.children,
|
|
112
|
+
style = _this$props2.style;
|
|
112
113
|
var className = (0, _classnames.default)((0, _styles.checkinputClass)('group', ['no-block', 'block'][Number(block)]), this.props.className);
|
|
113
114
|
|
|
114
115
|
if (data === undefined) {
|
|
115
116
|
return _react.default.createElement("div", {
|
|
116
|
-
className: className
|
|
117
|
+
className: className,
|
|
118
|
+
style: style
|
|
117
119
|
}, _react.default.createElement(_context.Provider, {
|
|
118
120
|
value: {
|
|
119
121
|
onRawChange: this.handleRawChange,
|
|
@@ -123,7 +125,8 @@ function (_PureComponent) {
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
return _react.default.createElement("div", {
|
|
126
|
-
className: className
|
|
128
|
+
className: className,
|
|
129
|
+
style: style
|
|
127
130
|
}, data.map(function (d, i) {
|
|
128
131
|
return _react.default.createElement(_Checkbox.default, {
|
|
129
132
|
checked: datum.check(d),
|
package/css/Checkbox/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
|
|
|
47
47
|
|
|
48
48
|
// attention: checkbox group value is array
|
|
49
49
|
|
|
50
|
-
export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T
|
|
50
|
+
export interface CheckboxGroupProps<Data, T> extends ListItemStandardProps<Data, T>, Omit<FormItemStandardProps<T[]>, 'placeholder'>, StandardProps {
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The data item
|
package/css/DatePicker/Month.js
CHANGED
|
@@ -76,7 +76,8 @@ function (_PureComponent) {
|
|
|
76
76
|
type = _this$props3.type,
|
|
77
77
|
current = _this$props3.current,
|
|
78
78
|
index = _this$props3.index,
|
|
79
|
-
rangeDate = _this$props3.rangeDate
|
|
79
|
+
rangeDate = _this$props3.rangeDate,
|
|
80
|
+
max = _this$props3.max;
|
|
80
81
|
|
|
81
82
|
var date = _utils.default.toDate(MONTHBASE);
|
|
82
83
|
|
|
@@ -84,6 +85,10 @@ function (_PureComponent) {
|
|
|
84
85
|
date.setFullYear(current.getFullYear());
|
|
85
86
|
var isDisabled = min && _utils.default.compareMonth(min, date, 1) >= 0;
|
|
86
87
|
|
|
88
|
+
if (!isDisabled) {
|
|
89
|
+
isDisabled = max && _utils.default.compareMonth(date, max, 1) >= 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
87
92
|
if (!isDisabled && type === 'month' && typeof disabled === 'function') {
|
|
88
93
|
isDisabled = disabled(date);
|
|
89
94
|
}
|
|
@@ -137,6 +142,7 @@ Month.propTypes = {
|
|
|
137
142
|
current: _propTypes.default.object.isRequired,
|
|
138
143
|
disabled: _propTypes.default.func,
|
|
139
144
|
// max: PropTypes.object,
|
|
145
|
+
max: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
140
146
|
min: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
141
147
|
onChange: _propTypes.default.func.isRequired,
|
|
142
148
|
onModeChange: _propTypes.default.func.isRequired,
|
package/css/Datum/Tree.js
CHANGED
|
@@ -303,7 +303,8 @@ function () {
|
|
|
303
303
|
var id = _this5.getKey(d, path[path.length - 1], i);
|
|
304
304
|
|
|
305
305
|
if (_this5.dataMap.get(id)) {
|
|
306
|
-
console.
|
|
306
|
+
console.error("There is already a key \"" + id + "\" exists. The key must be unique.");
|
|
307
|
+
return;
|
|
307
308
|
}
|
|
308
309
|
|
|
309
310
|
_this5.dataMap.set(id, d);
|
package/css/Menu/Root.js
CHANGED
|
@@ -37,6 +37,8 @@ var _is = require("../utils/is");
|
|
|
37
37
|
|
|
38
38
|
var _config = require("../config");
|
|
39
39
|
|
|
40
|
+
var _component = require("../component");
|
|
41
|
+
|
|
40
42
|
var modeDirection = {
|
|
41
43
|
'vertical-auto': 'y',
|
|
42
44
|
vertical: 'y',
|
|
@@ -78,13 +80,13 @@ function keyToMap(keys, value) {
|
|
|
78
80
|
|
|
79
81
|
var Root =
|
|
80
82
|
/*#__PURE__*/
|
|
81
|
-
function (
|
|
82
|
-
(0, _inheritsLoose2.default)(Root,
|
|
83
|
+
function (_Component) {
|
|
84
|
+
(0, _inheritsLoose2.default)(Root, _Component);
|
|
83
85
|
|
|
84
86
|
function Root(props) {
|
|
85
87
|
var _this;
|
|
86
88
|
|
|
87
|
-
_this =
|
|
89
|
+
_this = _Component.call(this, props) || this;
|
|
88
90
|
_this.state = {
|
|
89
91
|
activeKey: null,
|
|
90
92
|
scrollTop: 0,
|
|
@@ -115,6 +117,8 @@ function (_React$Component) {
|
|
|
115
117
|
var _proto = Root.prototype;
|
|
116
118
|
|
|
117
119
|
_proto.componentDidMount = function componentDidMount() {
|
|
120
|
+
_Component.prototype.componentDidMount.call(this);
|
|
121
|
+
|
|
118
122
|
this.updateState();
|
|
119
123
|
};
|
|
120
124
|
|
|
@@ -124,6 +128,8 @@ function (_React$Component) {
|
|
|
124
128
|
|
|
125
129
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
126
130
|
this.container.removeEventListener('wheel', this.handleWheel);
|
|
131
|
+
|
|
132
|
+
_Component.prototype.componentWillUnmount.call(this);
|
|
127
133
|
};
|
|
128
134
|
|
|
129
135
|
_proto.getOpenKeys = function getOpenKeys() {
|
|
@@ -419,7 +425,7 @@ function (_React$Component) {
|
|
|
419
425
|
};
|
|
420
426
|
|
|
421
427
|
return Root;
|
|
422
|
-
}(
|
|
428
|
+
}(_component.Component);
|
|
423
429
|
|
|
424
430
|
Root.propTypes = (0, _objectSpread2.default)({}, (0, _proptypes.getProps)(_propTypes.default, 'style', 'keygen'), {
|
|
425
431
|
active: _propTypes.default.func,
|
package/css/Rule/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface RuleParams {
|
|
|
51
51
|
} | validFunc | any) ;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams
|
|
54
|
+
export type RuleParamsType<Value, P = any, FormData = any> = Array<RuleParams | ((value?: Value, formData?: FormData, callback?: ((cbArgs: true | Error) => void), props?: P) => void) | object>
|
|
55
55
|
|
|
56
56
|
export interface RuleResult {
|
|
57
57
|
required (message?: string): Required;
|
|
@@ -82,8 +82,31 @@ export interface RuleResult {
|
|
|
82
82
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
export interface paramFunc<U> {
|
|
86
|
+
(args?: U ): {args: U, func: validFunc, message?: string}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare function Rule<U>() : RuleResult
|
|
90
|
+
|
|
91
|
+
declare function Rule<A extends RuleParams, U>(a: A) : {
|
|
92
|
+
[P in keyof A]: paramFunc<U>
|
|
93
|
+
} & RuleResult
|
|
94
|
+
|
|
95
|
+
declare function Rule<A extends RuleParams, B extends RuleParams, U>(a: A, b: B) : {
|
|
96
|
+
[P in keyof (A & B)]: paramFunc<U>
|
|
97
|
+
} & RuleResult
|
|
98
|
+
|
|
99
|
+
declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, U>(a: A, b: B, c: C) : {
|
|
100
|
+
[P in keyof (A & B & C)]: paramFunc<U>
|
|
101
|
+
} & RuleResult
|
|
102
|
+
|
|
103
|
+
declare function Rule<A extends RuleParams, B extends RuleParams, C extends RuleParams, D extends RuleParams, U>(a: A, b: B, c: C, d: D) : {
|
|
104
|
+
[P in keyof (A & B & C & D)]: paramFunc<U>
|
|
105
|
+
} & RuleResult
|
|
106
|
+
|
|
107
|
+
declare function Rule<
|
|
108
|
+
U>(...args: RuleParams[]) : {
|
|
109
|
+
[key: string]: paramFunc<U>
|
|
87
110
|
} & RuleResult
|
|
88
111
|
|
|
89
112
|
|
package/css/Select/Result.js
CHANGED
|
@@ -362,18 +362,19 @@ function (_PureComponent) {
|
|
|
362
362
|
var showPlaceholder = this.isEmptyResult();
|
|
363
363
|
var result = showPlaceholder ? this.renderPlaceholder() : this.renderResult();
|
|
364
364
|
var rtl = (0, _config.isRTL)();
|
|
365
|
+
var clearEl = this.renderClear();
|
|
365
366
|
|
|
366
367
|
if (rtl) {
|
|
367
368
|
return _react.default.createElement("div", {
|
|
368
369
|
ref: this.bindResult,
|
|
369
|
-
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty')
|
|
370
|
-
},
|
|
370
|
+
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
|
|
371
|
+
}, clearEl, this.renderIndicator(), result);
|
|
371
372
|
}
|
|
372
373
|
|
|
373
374
|
return _react.default.createElement("div", {
|
|
374
375
|
ref: this.bindResult,
|
|
375
|
-
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty')
|
|
376
|
-
}, result, this.renderIndicator(),
|
|
376
|
+
className: (0, _styles.selectClass)('result', compressed && 'compressed', showPlaceholder && 'empty', clearEl && 'result-clearable')
|
|
377
|
+
}, result, this.renderIndicator(), clearEl);
|
|
377
378
|
};
|
|
378
379
|
|
|
379
380
|
return Result;
|
|
@@ -170,10 +170,6 @@
|
|
|
170
170
|
margin-top: -5px;
|
|
171
171
|
}
|
|
172
172
|
.so-select-indicator.so-select-close {
|
|
173
|
-
-webkit-box-sizing: content-box;
|
|
174
|
-
box-sizing: content-box;
|
|
175
|
-
border-left: 1px solid #fff;
|
|
176
|
-
border-right: 1px solid #fff;
|
|
177
173
|
display: none;
|
|
178
174
|
background: var(--select-clear-bg-color, #94a1ae);
|
|
179
175
|
border-radius: 6px;
|
|
@@ -247,6 +243,10 @@
|
|
|
247
243
|
.so-select-result:hover .so-select-close {
|
|
248
244
|
display: block;
|
|
249
245
|
}
|
|
246
|
+
.so-select-focus .so-select-result-clearable .so-select-multi,
|
|
247
|
+
.so-select-result-clearable:hover .so-select-multi {
|
|
248
|
+
visibility: hidden;
|
|
249
|
+
}
|
|
250
250
|
.so-select-focus .so-select-caret {
|
|
251
251
|
-webkit-transform: rotate(180deg);
|
|
252
252
|
-ms-transform: rotate(180deg);
|
|
@@ -512,6 +512,10 @@ span.so-select-option {
|
|
|
512
512
|
.so-select-disabled .so-select-result .so-select-item .so-select-close {
|
|
513
513
|
display: none;
|
|
514
514
|
}
|
|
515
|
+
.so-select-disabled .so-select-result .so-select-multi {
|
|
516
|
+
visibility: visible;
|
|
517
|
+
cursor: not-allowed;
|
|
518
|
+
}
|
|
515
519
|
.so-select-root {
|
|
516
520
|
position: absolute;
|
|
517
521
|
top: 0;
|
package/css/Spin/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ReactNode } from 'react'
|
|
3
|
+
import { StandardProps } from '../@types/common'
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
type SpinName = 'default' |
|
|
5
7
|
'chasing-dots' |
|
|
@@ -19,7 +21,7 @@ declare class Spin extends React.Component<SpinProps, {}> {
|
|
|
19
21
|
render(): JSX.Element;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
export interface SpinProps {
|
|
24
|
+
export interface SpinProps extends StandardProps{
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* color
|
package/css/Table/index.d.ts
CHANGED
|
@@ -532,6 +532,16 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
|
|
|
532
532
|
* default: false
|
|
533
533
|
*/
|
|
534
534
|
hideHeader?: boolean
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* make all columns scalable
|
|
538
|
+
*
|
|
539
|
+
* 使所有列可伸缩
|
|
540
|
+
*
|
|
541
|
+
* default: false
|
|
542
|
+
*/
|
|
543
|
+
columnResizable?: boolean
|
|
544
|
+
|
|
535
545
|
}
|
|
536
546
|
|
|
537
547
|
declare class Table<Value = any, TRD = TableRowData> extends React.Component<TableProps<Value, TRD>, {}> {
|
package/css/Textarea/index.d.ts
CHANGED
|
@@ -2,24 +2,24 @@ import * as React from 'react'
|
|
|
2
2
|
import { StandardProps, RegularAttributes, FormItemStandardProps } from '../@types/common'
|
|
3
3
|
|
|
4
4
|
export interface TextareaProps<Value> extends
|
|
5
|
-
StandardProps,
|
|
5
|
+
StandardProps,
|
|
6
6
|
FormItemStandardProps<Value>
|
|
7
7
|
{
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* show border bottom
|
|
11
|
-
*
|
|
11
|
+
*
|
|
12
12
|
* 仅仅展示下边框
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* default: false
|
|
15
15
|
*/
|
|
16
16
|
underline?: boolean;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Whether the height changes automatically with the content
|
|
20
|
-
*
|
|
20
|
+
*
|
|
21
21
|
* 高度是否随内容自动变化
|
|
22
|
-
*
|
|
22
|
+
*
|
|
23
23
|
* default: false
|
|
24
24
|
*/
|
|
25
25
|
autosize?: boolean;
|
|
@@ -27,76 +27,87 @@ FormItemStandardProps<Value>
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* User input triggers onChange and to check interval, unit: ms.
|
|
30
|
-
*
|
|
30
|
+
*
|
|
31
31
|
* 用户输入触发 onChange 和校验间隔时间,单位 毫秒。
|
|
32
|
-
*
|
|
32
|
+
*
|
|
33
33
|
* default: 400
|
|
34
34
|
*/
|
|
35
35
|
delay?: number;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Infomation
|
|
39
|
-
*
|
|
39
|
+
*
|
|
40
40
|
* 提示信息
|
|
41
|
-
*
|
|
41
|
+
*
|
|
42
42
|
* default: -
|
|
43
43
|
*/
|
|
44
44
|
info?: ((value: string) => string) | number;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* The callback function for enter key
|
|
48
|
-
*
|
|
48
|
+
*
|
|
49
49
|
* 回车键回调函数
|
|
50
|
-
*
|
|
51
|
-
* default:
|
|
50
|
+
*
|
|
51
|
+
* default:
|
|
52
52
|
*/
|
|
53
53
|
onEnterPress?: (value: Value) => void;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* The position where the message pops up
|
|
57
|
-
*
|
|
57
|
+
*
|
|
58
58
|
* 信息弹出位置
|
|
59
|
-
*
|
|
60
|
-
* default:
|
|
59
|
+
*
|
|
60
|
+
* default:
|
|
61
61
|
*/
|
|
62
62
|
popover?: RegularAttributes.Position;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* The minimum row height. Same as native textarea rows property.
|
|
66
|
-
*
|
|
66
|
+
*
|
|
67
67
|
* 最小行高,同原生 textarea rows 属性
|
|
68
|
-
*
|
|
68
|
+
*
|
|
69
69
|
* default: 4
|
|
70
70
|
*/
|
|
71
71
|
rows?: number;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* the maxHeight of the textarea, scroll bars appear after more than
|
|
75
|
-
*
|
|
75
|
+
*
|
|
76
76
|
* 输入框的最大高度, 超过之后会出现滚动条
|
|
77
|
-
*
|
|
77
|
+
*
|
|
78
78
|
* default: -
|
|
79
79
|
*/
|
|
80
80
|
maxHeight?: number | string;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* When trim is true, blank characters are automatically deleted when lose focus。
|
|
84
|
-
*
|
|
84
|
+
*
|
|
85
85
|
* trim 为 true 时,失去焦点时会自动删除空白字符。
|
|
86
|
-
*
|
|
86
|
+
*
|
|
87
87
|
* default: false
|
|
88
88
|
*/
|
|
89
89
|
trim?: boolean;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* support resize
|
|
93
|
-
*
|
|
93
|
+
*
|
|
94
94
|
* 是否可以伸缩高度
|
|
95
|
-
*
|
|
95
|
+
*
|
|
96
96
|
* default: false
|
|
97
97
|
*/
|
|
98
98
|
resize?: boolean;
|
|
99
99
|
|
|
100
|
+
/**
|
|
101
|
+
* disabled
|
|
102
|
+
*
|
|
103
|
+
* 禁用
|
|
104
|
+
*
|
|
105
|
+
* default: false
|
|
106
|
+
*/
|
|
107
|
+
disabled?: boolean;
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
100
111
|
}
|
|
101
112
|
|
|
102
113
|
declare class Textarea<Value = any> extends React.Component<TextareaProps<Value>, {}> {}
|