shineout 2.0.0-rc.2 → 2.0.0-rc.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/css/Carousel/Props.d.ts +1 -1
- package/css/Cascader/Cascader.d.ts +3 -3
- package/css/Cascader/Cascader.js +0 -1
- package/css/Cascader/List.d.ts +2 -1
- package/css/Cascader/List.js +11 -1
- package/css/Cascader/Node.d.ts +2 -2
- package/css/Cascader/Props.d.ts +3 -2
- package/css/Cascader/Result.js +52 -38
- package/css/DatePicker/Props.d.ts +1 -1
- package/css/Datum/Tree.d.ts +2 -2
- package/css/Modal/Modal.js +0 -2
- package/css/Modal/events.js +9 -6
- package/css/index.js +1 -1
- package/dist/shineout.js +1792 -1358
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/esm/Carousel/Props.d.ts +1 -1
- package/esm/Cascader/Cascader.d.ts +3 -3
- package/esm/Cascader/Cascader.js +0 -1
- package/esm/Cascader/List.d.ts +2 -1
- package/esm/Cascader/List.js +11 -1
- package/esm/Cascader/Node.d.ts +2 -2
- package/esm/Cascader/Props.d.ts +3 -2
- package/esm/Cascader/Result.js +52 -38
- package/esm/DatePicker/Props.d.ts +1 -1
- package/esm/Datum/Tree.d.ts +2 -2
- package/esm/Modal/Modal.js +0 -2
- package/esm/Modal/events.js +9 -6
- package/esm/index.js +1 -1
- package/lib/Carousel/Props.d.ts +1 -1
- package/lib/Cascader/Cascader.d.ts +3 -3
- package/lib/Cascader/Cascader.js +0 -1
- package/lib/Cascader/List.d.ts +2 -1
- package/lib/Cascader/List.js +11 -1
- package/lib/Cascader/Node.d.ts +2 -2
- package/lib/Cascader/Props.d.ts +3 -2
- package/lib/Cascader/Result.js +52 -38
- package/lib/DatePicker/Props.d.ts +1 -1
- package/lib/Datum/Tree.d.ts +2 -2
- package/lib/Modal/Modal.js +0 -2
- package/lib/Modal/events.js +9 -6
- package/lib/index.js +1 -1
- package/package.json +5 -1
package/css/Carousel/Props.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface CarouselProps extends StandardProps {
|
|
|
25
25
|
*
|
|
26
26
|
* default: 'circle'
|
|
27
27
|
*/
|
|
28
|
-
indicatorType?: ((current: number, moveTo: (index: number) => void) => ReactNode) |
|
|
28
|
+
indicatorType?: ((current: number, moveTo: (index: number) => void) => ReactNode) | 'circle' | 'number' | 'line';
|
|
29
29
|
/**
|
|
30
30
|
* the interval of animation, When it is not 0, play automatically
|
|
31
31
|
*
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import { PureComponent } from '../component';
|
|
3
3
|
import DatumTree from '../Datum/Tree';
|
|
4
4
|
import Input from './Input';
|
|
5
|
-
import { OriginCascaderProps } from './Props';
|
|
5
|
+
import { CascaderBaseValue, OriginCascaderProps } from './Props';
|
|
6
6
|
interface State {
|
|
7
7
|
focus: boolean;
|
|
8
8
|
path: string[];
|
|
9
9
|
position: 'drop-down' | 'drop-up';
|
|
10
10
|
}
|
|
11
|
-
declare class Cascader<DataItem, Value extends
|
|
11
|
+
declare class Cascader<DataItem, Value extends CascaderBaseValue> extends PureComponent<OriginCascaderProps<DataItem, Value>, State> {
|
|
12
12
|
static defaultProps: {
|
|
13
13
|
data: never[];
|
|
14
14
|
height: number;
|
|
15
15
|
clearable: boolean;
|
|
16
16
|
showArrow: boolean;
|
|
17
17
|
expandTrigger: string;
|
|
18
|
-
childrenKey:
|
|
18
|
+
childrenKey: string;
|
|
19
19
|
};
|
|
20
20
|
datum: DatumTree<DataItem>;
|
|
21
21
|
selectId: string;
|
package/css/Cascader/Cascader.js
CHANGED
|
@@ -131,7 +131,6 @@ function (_PureComponent) {
|
|
|
131
131
|
if ((0, _is.isFunc)(props.getComponentRef)) {
|
|
132
132
|
props.getComponentRef((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
133
133
|
} else {
|
|
134
|
-
;
|
|
135
134
|
props.getComponentRef.current = (0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this));
|
|
136
135
|
}
|
|
137
136
|
}
|
package/css/Cascader/List.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import { CascaderListProps } from './Props';
|
|
3
|
+
import { KeygenResult } from '../@types/common';
|
|
3
4
|
declare class List<U, T extends any[]> extends Component<CascaderListProps<U, T>> {
|
|
4
5
|
static defaultProps: {
|
|
5
6
|
id: string;
|
|
@@ -7,7 +8,7 @@ declare class List<U, T extends any[]> extends Component<CascaderListProps<U, T>
|
|
|
7
8
|
text: {};
|
|
8
9
|
};
|
|
9
10
|
constructor(props: CascaderListProps<U, T>);
|
|
10
|
-
getKey(data: U, index: number):
|
|
11
|
+
getKey(data: U, index: number): KeygenResult;
|
|
11
12
|
getText(key: string): any;
|
|
12
13
|
render(): JSX.Element;
|
|
13
14
|
}
|
package/css/Cascader/List.js
CHANGED
|
@@ -54,7 +54,17 @@ function (_Component) {
|
|
|
54
54
|
keygen = _this$props.keygen,
|
|
55
55
|
parentId = _this$props.parentId;
|
|
56
56
|
if (typeof keygen === 'function') return keygen(data, parentId);
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
if (keygen && typeof keygen === 'string') {
|
|
59
|
+
var key = data[keygen];
|
|
60
|
+
|
|
61
|
+
if (typeof key === 'string' || typeof key === 'number') {
|
|
62
|
+
return key;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
console.error('key must be number or string but get', key);
|
|
66
|
+
}
|
|
67
|
+
|
|
58
68
|
return parentId + (parentId ? ',' : '') + index;
|
|
59
69
|
};
|
|
60
70
|
|
package/css/Cascader/Node.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { NodeProps } from './Props';
|
|
2
|
+
import { CascaderBaseValue, NodeProps } from './Props';
|
|
3
3
|
import { PureComponent } from '../component';
|
|
4
4
|
interface NodeState {
|
|
5
5
|
loading: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare class Node<U, T extends
|
|
7
|
+
declare class Node<U, T extends CascaderBaseValue> extends PureComponent<NodeProps<U, T>, NodeState> {
|
|
8
8
|
handleUpdate: Function;
|
|
9
9
|
constructor(props: NodeProps<U, T>);
|
|
10
10
|
componentWillUnmount(): void;
|
package/css/Cascader/Props.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare type GetFilterProps<Props, DataItem> = Omit<Props, 'filterText' |
|
|
|
26
26
|
};
|
|
27
27
|
/** ------ Cascader ------ * */
|
|
28
28
|
export interface OriginCascaderProps<DataItem, Value extends CascaderBaseValue> extends Pick<AbsoluteProps, 'absolute' | 'zIndex'>, Pick<InputTitleProps, 'innerTitle'>, Pick<TreeDatumOptions<DataItem>, 'mode'>, Pick<StandardProps, 'style'> {
|
|
29
|
+
renderUnmatched?: (data: any) => ReactNode;
|
|
29
30
|
inputFocus: boolean;
|
|
30
31
|
/**
|
|
31
32
|
* Set visible of cascader popup
|
|
@@ -212,8 +213,8 @@ export interface OriginCascaderProps<DataItem, Value extends CascaderBaseValue>
|
|
|
212
213
|
* default: -
|
|
213
214
|
*
|
|
214
215
|
*/
|
|
215
|
-
getComponentRef?: (comp: componentRef) => void | {
|
|
216
|
-
current
|
|
216
|
+
getComponentRef?: ((comp: componentRef) => void) | {
|
|
217
|
+
current: componentRef | undefined;
|
|
217
218
|
};
|
|
218
219
|
/**
|
|
219
220
|
* When it is a string, return d[string]. When it is a function, return the result of the function.
|
package/css/Cascader/Result.js
CHANGED
|
@@ -252,8 +252,22 @@ function (_PureComponent) {
|
|
|
252
252
|
raw = _ref3.raw,
|
|
253
253
|
className = _ref3.className,
|
|
254
254
|
options = (0, _objectWithoutPropertiesLoose2.default)(_ref3, ["index", "render", "data", "raw", "className"]);
|
|
255
|
-
var
|
|
256
|
-
|
|
255
|
+
var _this$props3 = this.props,
|
|
256
|
+
singleRemove = _this$props3.singleRemove,
|
|
257
|
+
datum = _this$props3.datum,
|
|
258
|
+
renderUnmatched = _this$props3.renderUnmatched;
|
|
259
|
+
var res;
|
|
260
|
+
|
|
261
|
+
if (datum.isUnMatch(data)) {
|
|
262
|
+
if (renderUnmatched) {
|
|
263
|
+
res = renderUnmatched(data.value);
|
|
264
|
+
} else {
|
|
265
|
+
res = typeof data.value === 'string' ? data.value : null;
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
res = data && render(data, raw);
|
|
269
|
+
}
|
|
270
|
+
|
|
257
271
|
if (!res) return null;
|
|
258
272
|
var more = this.getCompressedBound();
|
|
259
273
|
return _react.default.createElement(Item, (0, _extends2.default)({
|
|
@@ -270,10 +284,10 @@ function (_PureComponent) {
|
|
|
270
284
|
};
|
|
271
285
|
|
|
272
286
|
_proto.renderMore = function renderMore(list) {
|
|
273
|
-
var _this$
|
|
274
|
-
selectId = _this$
|
|
275
|
-
size = _this$
|
|
276
|
-
compressed = _this$
|
|
287
|
+
var _this$props4 = this.props,
|
|
288
|
+
selectId = _this$props4.selectId,
|
|
289
|
+
size = _this$props4.size,
|
|
290
|
+
compressed = _this$props4.compressed;
|
|
277
291
|
var more = this.getCompressedBound();
|
|
278
292
|
return [_react.default.createElement(_More.default, {
|
|
279
293
|
key: "more",
|
|
@@ -288,12 +302,12 @@ function (_PureComponent) {
|
|
|
288
302
|
};
|
|
289
303
|
|
|
290
304
|
_proto.renderInput = function renderInput() {
|
|
291
|
-
var _this$
|
|
292
|
-
onFilter = _this$
|
|
293
|
-
focus = _this$
|
|
294
|
-
trim = _this$
|
|
295
|
-
bindInput = _this$
|
|
296
|
-
filterText = _this$
|
|
305
|
+
var _this$props5 = this.props,
|
|
306
|
+
onFilter = _this$props5.onFilter,
|
|
307
|
+
focus = _this$props5.focus,
|
|
308
|
+
trim = _this$props5.trim,
|
|
309
|
+
bindInput = _this$props5.bindInput,
|
|
310
|
+
filterText = _this$props5.filterText;
|
|
297
311
|
return _react.default.createElement(_Input.default, {
|
|
298
312
|
filterText: filterText,
|
|
299
313
|
ref: bindInput,
|
|
@@ -305,10 +319,10 @@ function (_PureComponent) {
|
|
|
305
319
|
};
|
|
306
320
|
|
|
307
321
|
_proto.renderPlaceholder = function renderPlaceholder() {
|
|
308
|
-
var _this$
|
|
309
|
-
focus = _this$
|
|
310
|
-
onFilter = _this$
|
|
311
|
-
innerTitle = _this$
|
|
322
|
+
var _this$props6 = this.props,
|
|
323
|
+
focus = _this$props6.focus,
|
|
324
|
+
onFilter = _this$props6.onFilter,
|
|
325
|
+
innerTitle = _this$props6.innerTitle;
|
|
312
326
|
|
|
313
327
|
if (focus && onFilter) {
|
|
314
328
|
return this.renderInput();
|
|
@@ -321,10 +335,10 @@ function (_PureComponent) {
|
|
|
321
335
|
};
|
|
322
336
|
|
|
323
337
|
_proto.renderIndicator = function renderIndicator() {
|
|
324
|
-
var _this$
|
|
325
|
-
multiple = _this$
|
|
326
|
-
showArrow = _this$
|
|
327
|
-
compressed = _this$
|
|
338
|
+
var _this$props7 = this.props,
|
|
339
|
+
multiple = _this$props7.multiple,
|
|
340
|
+
showArrow = _this$props7.showArrow,
|
|
341
|
+
compressed = _this$props7.compressed;
|
|
328
342
|
if (!showArrow || multiple && !compressed) return null;
|
|
329
343
|
var showCaret = !multiple; // eslint-disable-next-line
|
|
330
344
|
|
|
@@ -336,15 +350,15 @@ function (_PureComponent) {
|
|
|
336
350
|
};
|
|
337
351
|
|
|
338
352
|
_proto.renderResult = function renderResult() {
|
|
339
|
-
var _this$
|
|
340
|
-
datum = _this$
|
|
341
|
-
_this$
|
|
342
|
-
value = _this$
|
|
343
|
-
renderItem = _this$
|
|
344
|
-
renderResult = _this$
|
|
345
|
-
compressed = _this$
|
|
346
|
-
focus = _this$
|
|
347
|
-
onFilter = _this$
|
|
353
|
+
var _this$props8 = this.props,
|
|
354
|
+
datum = _this$props8.datum,
|
|
355
|
+
_this$props8$value = _this$props8.value,
|
|
356
|
+
value = _this$props8$value === void 0 ? [] : _this$props8$value,
|
|
357
|
+
renderItem = _this$props8.renderItem,
|
|
358
|
+
renderResult = _this$props8.renderResult,
|
|
359
|
+
compressed = _this$props8.compressed,
|
|
360
|
+
focus = _this$props8.focus,
|
|
361
|
+
onFilter = _this$props8.onFilter;
|
|
348
362
|
var nodes = value.map(function (v) {
|
|
349
363
|
return datum.getDataById(v);
|
|
350
364
|
});
|
|
@@ -374,15 +388,15 @@ function (_PureComponent) {
|
|
|
374
388
|
};
|
|
375
389
|
|
|
376
390
|
_proto.render = function render() {
|
|
377
|
-
var _this$
|
|
378
|
-
style = _this$
|
|
379
|
-
_this$
|
|
380
|
-
value = _this$
|
|
381
|
-
compressed = _this$
|
|
382
|
-
multiple = _this$
|
|
383
|
-
innerTitle = _this$
|
|
384
|
-
onFilter = _this$
|
|
385
|
-
focus = _this$
|
|
391
|
+
var _this$props9 = this.props,
|
|
392
|
+
style = _this$props9.style,
|
|
393
|
+
_this$props9$value = _this$props9.value,
|
|
394
|
+
value = _this$props9$value === void 0 ? [] : _this$props9$value,
|
|
395
|
+
compressed = _this$props9.compressed,
|
|
396
|
+
multiple = _this$props9.multiple,
|
|
397
|
+
innerTitle = _this$props9.innerTitle,
|
|
398
|
+
onFilter = _this$props9.onFilter,
|
|
399
|
+
focus = _this$props9.focus;
|
|
386
400
|
var empty = value.length === 0;
|
|
387
401
|
var result = empty ? this.renderPlaceholder() : this.renderResult();
|
|
388
402
|
var clearEl = this.renderClear();
|
|
@@ -64,7 +64,7 @@ export interface BaseProps<T = DatePickerValue> extends StandardProps, Pick<Abso
|
|
|
64
64
|
*
|
|
65
65
|
* default: false
|
|
66
66
|
*/
|
|
67
|
-
disabled?: ((date: Date, type?: DisabledType,
|
|
67
|
+
disabled?: ((date: Date, type?: DisabledType, value0?: Date, value1?: Date) => boolean) | boolean;
|
|
68
68
|
/**
|
|
69
69
|
* default values for different types: 'date': 'yyyy-MM-dd'. 'time': 'HH:mm:ss'. 'week': 'RRRR II'. 'month': 'yyyy-MM'. 'week': 'RRRR II'. 'quarter': 'yyyy-[Q]Q'. 'year': 'yyyy'. 'datetime': 'yyyy-MM-dd HH:mm:ss'
|
|
70
70
|
*
|
package/css/Datum/Tree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeygenResult, ObjectType, KeygenType } from '../@types/common';
|
|
1
|
+
import { KeygenResult, ObjectType, KeygenType, UnMatchedValue } from '../@types/common';
|
|
2
2
|
export declare const CheckedMode: {
|
|
3
3
|
Full: number;
|
|
4
4
|
Half: number;
|
|
@@ -54,7 +54,7 @@ export default class<Item> {
|
|
|
54
54
|
bind(id: number | string, update: Function): void;
|
|
55
55
|
unbind(id: KeygenResult): void;
|
|
56
56
|
setUnmatedValue(): void;
|
|
57
|
-
isUnMatch(data: ObjectType | null):
|
|
57
|
+
isUnMatch(data: ObjectType | null): data is UnMatchedValue;
|
|
58
58
|
setValue(value?: Value): void;
|
|
59
59
|
getValue(): Value;
|
|
60
60
|
setValueMap(id: KeygenResult, checked: CheckedStatus): void;
|
package/css/Modal/Modal.js
CHANGED
|
@@ -51,8 +51,6 @@ function (_Component) {
|
|
|
51
51
|
var _proto = Modal.prototype;
|
|
52
52
|
|
|
53
53
|
_proto.componentDidMount = function componentDidMount() {
|
|
54
|
-
console.log(this.props.visible);
|
|
55
|
-
|
|
56
54
|
if (this.props.visible && !this.props.usePortal) {
|
|
57
55
|
(0, _events.open)(this.getOption(), false);
|
|
58
56
|
}
|
package/css/Modal/events.js
CHANGED
|
@@ -287,9 +287,13 @@ exports.method = method;
|
|
|
287
287
|
|
|
288
288
|
var closeAll = function closeAll() {
|
|
289
289
|
Object.keys(containers).filter(function (id) {
|
|
290
|
-
return containers[id].visible;
|
|
290
|
+
return containers[id].props.from === 'method' && containers[id].visible;
|
|
291
291
|
}).forEach(function (id) {
|
|
292
|
-
|
|
292
|
+
var _containers$id$props = containers[id].props,
|
|
293
|
+
onClose = _containers$id$props.onClose,
|
|
294
|
+
usePortal = _containers$id$props.usePortal;
|
|
295
|
+
if (onClose) onClose();
|
|
296
|
+
if (!usePortal) close(containers[id].props);
|
|
293
297
|
});
|
|
294
298
|
};
|
|
295
299
|
|
|
@@ -302,11 +306,10 @@ exports.closeAll = closeAll;
|
|
|
302
306
|
return containers[id].visible && containers[id].props.esc;
|
|
303
307
|
});
|
|
304
308
|
if (!opened) return;
|
|
305
|
-
var props = containers[opened].props;
|
|
306
|
-
|
|
309
|
+
var props = containers[opened].props;
|
|
307
310
|
var onClose = props.onClose,
|
|
308
|
-
|
|
311
|
+
usePortal = props.usePortal;
|
|
309
312
|
if (onClose) onClose();
|
|
310
|
-
if (!
|
|
313
|
+
if (!usePortal) close(props);
|
|
311
314
|
});
|
|
312
315
|
});
|