shineout 2.0.0-rc.3 → 2.0.0-rc.4
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/@types/common.d.ts +1 -0
- package/css/AnimationList/AbsoluteList.d.ts +3 -2
- package/css/AnimationList/Props.d.ts +3 -4
- package/css/Cascader/Cascader.d.ts +2 -1
- package/css/Select/BoxOption.js +2 -4
- package/css/Select/Option.js +1 -2
- package/css/Select/OptionList.d.ts +1 -1
- package/css/Select/OptionList.js +1 -1
- package/css/Select/OptionTree.d.ts +1 -1
- package/css/Select/OptionTree.js +1 -1
- package/css/Select/Props.d.ts +29 -37
- package/css/Select/Select.d.ts +3 -4
- package/css/Select/Select.js +72 -23
- package/css/TreeSelect/TreeSelect.d.ts +2 -2
- package/css/index.js +1 -1
- package/dist/shineout.js +4819 -4631
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/esm/@types/common.d.ts +1 -0
- package/esm/AnimationList/AbsoluteList.d.ts +3 -2
- package/esm/AnimationList/Props.d.ts +3 -4
- package/esm/Cascader/Cascader.d.ts +2 -1
- package/esm/Select/BoxOption.js +2 -4
- package/esm/Select/Option.js +1 -2
- package/esm/Select/OptionList.d.ts +1 -1
- package/esm/Select/OptionList.js +1 -1
- package/esm/Select/OptionTree.d.ts +1 -1
- package/esm/Select/OptionTree.js +1 -1
- package/esm/Select/Props.d.ts +29 -37
- package/esm/Select/Select.d.ts +3 -4
- package/esm/Select/Select.js +72 -24
- package/esm/TreeSelect/TreeSelect.d.ts +2 -2
- package/esm/index.js +1 -1
- package/lib/@types/common.d.ts +1 -0
- package/lib/AnimationList/AbsoluteList.d.ts +3 -2
- package/lib/AnimationList/Props.d.ts +3 -4
- package/lib/Cascader/Cascader.d.ts +2 -1
- package/lib/Select/BoxOption.js +2 -4
- package/lib/Select/Option.js +1 -2
- package/lib/Select/OptionList.d.ts +1 -1
- package/lib/Select/OptionList.js +1 -1
- package/lib/Select/OptionTree.d.ts +1 -1
- package/lib/Select/OptionTree.js +1 -1
- package/lib/Select/Props.d.ts +29 -37
- package/lib/Select/Select.d.ts +3 -4
- package/lib/Select/Select.js +72 -23
- package/lib/TreeSelect/TreeSelect.d.ts +2 -2
- package/lib/index.js +1 -1
- package/package.json +2 -2
package/css/@types/common.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare namespace RegularAttributes {
|
|
|
29
29
|
type Size = 'small' | 'default' | 'large';
|
|
30
30
|
type Type = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
31
31
|
type Align = 'left' | 'center' | 'right';
|
|
32
|
+
type ListPosition = 'drop-down' | 'drop-up';
|
|
32
33
|
}
|
|
33
34
|
export declare type ObjectType<V = any> = {
|
|
34
35
|
[name: string]: V;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { AbsoluteProps } from './Props';
|
|
3
|
+
export default function <U extends {}>(List: ComponentType<U>): React.ComponentType<import("../Scroll/Props").GetScrollContextConsumerValue<{ [P in Exclude<keyof U, "getRef"> | Exclude<Exclude<"fixed", keyof U>, "getRef"> | Exclude<Exclude<"absolute", keyof U>, "getRef"> | Exclude<Exclude<"position", keyof U>, "getRef"> | Exclude<Exclude<"zIndex", keyof U>, "getRef"> | Exclude<Exclude<"value", keyof U>, "getRef"> | Exclude<Exclude<"style", keyof U>, "getRef"> | Exclude<Exclude<"focus", keyof U>, "getRef"> | Exclude<Exclude<"scrollLeft", keyof U>, "getRef"> | Exclude<Exclude<"scrollTop", keyof U>, "getRef"> | Exclude<Exclude<"parentElement", keyof U>, "getRef"> | Exclude<Exclude<"scrollElement", keyof U>, "getRef"> | Exclude<Exclude<"rootClass", keyof U>, "getRef"> | Exclude<Exclude<"autoClass", keyof U>, "getRef"> | Exclude<Exclude<"getResetPosition", keyof U>, "getRef"> | Exclude<Exclude<"autoAdapt", keyof U>, "getRef">]: import("../@types/common").ForceAdd<U, AbsoluteProps>[P]; }>>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GetScrollContextConsumerValue } from '../Scroll/Props';
|
|
3
3
|
import { GetZIndexConsumerProps } from '../Modal/Props';
|
|
4
|
-
import { ForceAdd, KeygenType, StandardProps } from '../@types/common';
|
|
5
|
-
declare type ListPosition = 'drop-down' | 'drop-up';
|
|
4
|
+
import { ForceAdd, KeygenType, RegularAttributes, StandardProps } from '../@types/common';
|
|
6
5
|
declare type PickerPosition = 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
|
|
7
6
|
declare type DropdownPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
8
7
|
export declare type ListDurationType = 'fast' | 'slow' | number;
|
|
@@ -11,7 +10,7 @@ export interface AbsoluteProps {
|
|
|
11
10
|
focus?: boolean;
|
|
12
11
|
fixed?: boolean | 'min';
|
|
13
12
|
parentElement?: HTMLElement;
|
|
14
|
-
position?: ListPosition | PickerPosition | DropdownPosition;
|
|
13
|
+
position?: RegularAttributes.ListPosition | PickerPosition | DropdownPosition;
|
|
15
14
|
/**
|
|
16
15
|
* When it is true, the pop-up layer of option append into document.body.
|
|
17
16
|
*
|
|
@@ -33,7 +32,7 @@ export interface AbsoluteProps {
|
|
|
33
32
|
*/
|
|
34
33
|
zIndex?: number;
|
|
35
34
|
style?: React.CSSProperties;
|
|
36
|
-
autoClass?:
|
|
35
|
+
autoClass?: string;
|
|
37
36
|
value?: any;
|
|
38
37
|
getResetPosition?: (resetFunc: () => void) => void;
|
|
39
38
|
autoAdapt?: boolean;
|
|
@@ -3,10 +3,11 @@ import { PureComponent } from '../component';
|
|
|
3
3
|
import DatumTree from '../Datum/Tree';
|
|
4
4
|
import Input from './Input';
|
|
5
5
|
import { CascaderBaseValue, OriginCascaderProps } from './Props';
|
|
6
|
+
import { RegularAttributes } from '../@types/common';
|
|
6
7
|
interface State {
|
|
7
8
|
focus: boolean;
|
|
8
9
|
path: string[];
|
|
9
|
-
position:
|
|
10
|
+
position: RegularAttributes.ListPosition;
|
|
10
11
|
}
|
|
11
12
|
declare class Cascader<DataItem, Value extends CascaderBaseValue> extends PureComponent<OriginCascaderProps<DataItem, Value>, State> {
|
|
12
13
|
static defaultProps: {
|
package/css/Select/BoxOption.js
CHANGED
|
@@ -46,11 +46,10 @@ function (_PureComponent) {
|
|
|
46
46
|
data = _this$props.data,
|
|
47
47
|
onClick = _this$props.onClick,
|
|
48
48
|
isActive = _this$props.isActive,
|
|
49
|
-
index = _this$props.index,
|
|
50
49
|
disabled = _this$props.disabled;
|
|
51
50
|
if (this.locked || disabled) return;
|
|
52
51
|
this.locked = true;
|
|
53
|
-
onClick(!isActive, data
|
|
52
|
+
onClick(!isActive, data);
|
|
54
53
|
setTimeout(function () {
|
|
55
54
|
_this2.locked = false;
|
|
56
55
|
}, 200);
|
|
@@ -59,7 +58,6 @@ function (_PureComponent) {
|
|
|
59
58
|
_proto.render = function render() {
|
|
60
59
|
var _this$props2 = this.props,
|
|
61
60
|
data = _this$props2.data,
|
|
62
|
-
index = _this$props2.index,
|
|
63
61
|
isActive = _this$props2.isActive,
|
|
64
62
|
renderItem = _this$props2.renderItem,
|
|
65
63
|
columns = _this$props2.columns,
|
|
@@ -68,7 +66,7 @@ function (_PureComponent) {
|
|
|
68
66
|
var className = (0, _styles.selectClass)((0, _classname.getDirectionClass)('option'));
|
|
69
67
|
var width = columns < 0 ? undefined : 1 / columns * 100 + "%";
|
|
70
68
|
var Input = multiple ? _Checkbox.default : _Radio.default;
|
|
71
|
-
var result = renderItem(data
|
|
69
|
+
var result = renderItem(data);
|
|
72
70
|
var title = typeof result === 'string' ? result : undefined;
|
|
73
71
|
return _react.default.createElement(Input, {
|
|
74
72
|
disabled: disabled,
|
package/css/Select/Option.js
CHANGED
|
@@ -56,12 +56,11 @@ function (_React$Component) {
|
|
|
56
56
|
data = _this$props.data,
|
|
57
57
|
onClick = _this$props.onClick,
|
|
58
58
|
isActive = _this$props.isActive,
|
|
59
|
-
index = _this$props.index,
|
|
60
59
|
disabled = _this$props.disabled,
|
|
61
60
|
groupKey = _this$props.groupKey;
|
|
62
61
|
if (this.locked || disabled || data && data[groupKey]) return;
|
|
63
62
|
this.locked = true;
|
|
64
|
-
onClick(!isActive, data
|
|
63
|
+
onClick(!isActive, data);
|
|
65
64
|
setTimeout(function () {
|
|
66
65
|
_this2.locked = false;
|
|
67
66
|
}, 200);
|
|
@@ -10,7 +10,7 @@ declare class OptionList<Item, Value> extends Component<OptionListProps<Item, Va
|
|
|
10
10
|
lastScrollTop: number;
|
|
11
11
|
constructor(props: OptionListProps<Item, Value>);
|
|
12
12
|
componentDidUpdate(prevProps: OptionListProps<Item, Value>): void;
|
|
13
|
-
getText(key:
|
|
13
|
+
getText(key: 'noData'): any;
|
|
14
14
|
hoverMove(step: number): void;
|
|
15
15
|
handleScroll(_x: number, y: number, _max: number, _bar: HTMLElement, _v: number, h: number, _pixelX?: number, pixelY?: number): void;
|
|
16
16
|
handleHover(index: number, force: boolean): void;
|
package/css/Select/OptionList.js
CHANGED
|
@@ -92,7 +92,7 @@ function (_Component) {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
_proto.getText = function getText(key) {
|
|
95
|
-
return this.props.text[key] || (0, _locale.getLocale)(key);
|
|
95
|
+
return this.props.text && this.props.text[key] || (0, _locale.getLocale)(key);
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
_proto.hoverMove = function hoverMove(step) {
|
|
@@ -2,7 +2,7 @@ import { Component } from 'react';
|
|
|
2
2
|
import { OptionTreeProps } from './Props';
|
|
3
3
|
declare class OptionList<Item, Value> extends Component<OptionTreeProps<Item, Value>> {
|
|
4
4
|
constructor(props: OptionTreeProps<Item, Value>);
|
|
5
|
-
getText(key:
|
|
5
|
+
getText(key: 'noData'): any;
|
|
6
6
|
handleClick(data: Item, _: any, p: {
|
|
7
7
|
path: string;
|
|
8
8
|
}): void;
|
package/css/Select/OptionTree.js
CHANGED
|
@@ -48,7 +48,7 @@ function (_Component) {
|
|
|
48
48
|
var _proto = OptionList.prototype;
|
|
49
49
|
|
|
50
50
|
_proto.getText = function getText(key) {
|
|
51
|
-
return this.props.text[key] || (0, _locale.getLocale)(key);
|
|
51
|
+
return this.props.text && this.props.text[key] || (0, _locale.getLocale)(key);
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
_proto.handleClick = function handleClick(data, _, p) {
|
package/css/Select/Props.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StandardProps, RegularAttributes, KeygenType, ValueItem, ResultItem, LiteralUnion } from '../@types/common';
|
|
2
|
+
import { StandardProps, RegularAttributes, KeygenType, ValueItem, ResultItem, LiteralUnion, ValueArr } from '../@types/common';
|
|
3
3
|
import List from '../Datum/List';
|
|
4
4
|
import { GetTableConsumerProps } from '../Table/Props';
|
|
5
5
|
import { GetInputableProps, InputableProps } from '../Form/Props';
|
|
6
6
|
import { GetInputBorderProps } from '../hoc/Props';
|
|
7
7
|
import { GetDatumListProps } from '../Datum/Props';
|
|
8
|
-
import { AbsoluteProps } from '../AnimationList/Props';
|
|
8
|
+
import { AbsoluteProps, GetAbsoluteProps } from '../AnimationList/Props';
|
|
9
|
+
import { TreeProps } from '../Tree/Props';
|
|
9
10
|
declare type ReactNode = React.ReactNode;
|
|
10
11
|
declare type ReactElement = React.ReactElement;
|
|
11
|
-
|
|
12
|
-
export interface BaseSelectProps<Item, Value> extends StandardProps, Pick<AbsoluteProps, 'absolute' | 'zIndex'>, Pick<InputableProps<Value>, 'formDatum'> {
|
|
12
|
+
declare type ExpandTreeKeys = 'onExpand' | 'expanded' | 'defaultExpanded' | 'defaultExpandAll' | 'expandIcons' | 'loader' | 'childrenKey';
|
|
13
|
+
export interface BaseSelectProps<Item, Value> extends StandardProps, Pick<AbsoluteProps, 'absolute' | 'zIndex'>, Pick<InputableProps<Value>, 'formDatum'>, Pick<TreeProps<Item, ValueArr<Value>>, ExpandTreeKeys> {
|
|
13
14
|
/**
|
|
14
15
|
* If clearable is true, show clear value icon
|
|
15
16
|
*
|
|
@@ -96,7 +97,7 @@ export interface BaseSelectProps<Item, Value> extends StandardProps, Pick<Absolu
|
|
|
96
97
|
*
|
|
97
98
|
* default: auto
|
|
98
99
|
*/
|
|
99
|
-
position?:
|
|
100
|
+
position?: RegularAttributes.ListPosition;
|
|
100
101
|
/**
|
|
101
102
|
* When it is a string, return d[string]. When it is a function, return the result of the function.
|
|
102
103
|
*
|
|
@@ -339,15 +340,6 @@ export interface BaseSelectProps<Item, Value> extends StandardProps, Pick<Absolu
|
|
|
339
340
|
* default: false
|
|
340
341
|
*/
|
|
341
342
|
defaultExpandAll?: boolean;
|
|
342
|
-
/**
|
|
343
|
-
* treeData,the key of the children data name
|
|
344
|
-
*
|
|
345
|
-
* 树形数据下,指定子数据的属性名
|
|
346
|
-
*
|
|
347
|
-
* default: 'children'
|
|
348
|
-
*/
|
|
349
|
-
childrenKey?: string;
|
|
350
|
-
loader?: (key: ValueItem<Value>, data: Item) => void;
|
|
351
343
|
/**
|
|
352
344
|
* custom empty copy
|
|
353
345
|
*
|
|
@@ -400,31 +392,30 @@ export interface BaseSelectProps<Item, Value> extends StandardProps, Pick<Absolu
|
|
|
400
392
|
groupKey: string;
|
|
401
393
|
innerData: Item;
|
|
402
394
|
inputable?: boolean;
|
|
403
|
-
text?:
|
|
395
|
+
text?: {
|
|
396
|
+
noData?: string;
|
|
397
|
+
};
|
|
404
398
|
expanded?: string[];
|
|
405
399
|
}
|
|
406
400
|
/** ---------- optionList ---------- */
|
|
407
401
|
export declare type Control = 'mouse' | 'keyboard';
|
|
408
|
-
export interface OptionListProps<Item, Value> extends
|
|
402
|
+
export interface OptionListProps<Item, Value> extends Pick<BaseSelectProps<Item, Value>, 'hideCreateOption' | 'loading' | 'keygen' | 'multiple' | 'renderOptionList' | 'data' | 'datum' | 'text' | 'groupKey' | 'emptyText'>, Pick<Required<BaseSelectProps<Item, Value>>, 'itemsInView' | 'lineHeight' | 'height'> {
|
|
409
403
|
control: Control;
|
|
410
|
-
data: Item[];
|
|
411
|
-
datum: List<Item, Value>;
|
|
412
404
|
focus?: boolean;
|
|
413
|
-
height: number;
|
|
414
|
-
itemsInView: number;
|
|
415
|
-
lineHeight: number;
|
|
416
405
|
onControlChange: (control: Control) => void;
|
|
417
|
-
onChange: (isActive: boolean, data: Item
|
|
406
|
+
onChange: (isActive: boolean, data: Item) => void;
|
|
418
407
|
renderItem: ((data: Item, index?: number) => ReactNode);
|
|
419
408
|
renderPending?: boolean;
|
|
420
409
|
selectId: string;
|
|
421
410
|
bindOptionFunc: (name: string, fn: Function) => void;
|
|
422
411
|
autoClass: string;
|
|
423
|
-
text: Object;
|
|
424
|
-
groupKey: keyof Item & string;
|
|
425
412
|
getRef: (el: HTMLElement) => void;
|
|
426
413
|
customHeader?: ReactNode;
|
|
427
414
|
filterText?: string;
|
|
415
|
+
style: React.CSSProperties;
|
|
416
|
+
}
|
|
417
|
+
export declare class WrappedOptionListComp<Item, Value> extends React.Component<GetAbsoluteProps<OptionListProps<Item, Value>>, any> {
|
|
418
|
+
render: () => JSX.Element;
|
|
428
419
|
}
|
|
429
420
|
/** ---------- option ---------- */
|
|
430
421
|
export interface OptionProps<Item> {
|
|
@@ -441,22 +432,21 @@ export interface OptionProps<Item> {
|
|
|
441
432
|
filterText?: string;
|
|
442
433
|
}
|
|
443
434
|
/** ---------- optionTree ---------- */
|
|
444
|
-
export interface OptionTreeProps<Item, Value> extends BaseSelectProps<Item, Value> {
|
|
435
|
+
export interface OptionTreeProps<Item, Value> extends Pick<BaseSelectProps<Item, Value>, ExpandTreeKeys | 'loading' | 'treeData' | 'loader' | 'emptyText' | 'height' | 'renderOptionList' | 'text'> {
|
|
445
436
|
onChange: (_: any, data: Item, fromInput?: boolean) => void;
|
|
446
|
-
defaultExpanded?: string[];
|
|
447
|
-
expanded?: string[];
|
|
448
437
|
renderPending?: boolean;
|
|
449
438
|
treeData: Item[];
|
|
450
439
|
datum: List<Item, Value>;
|
|
451
440
|
focus?: boolean;
|
|
452
|
-
onExpand?: () => void;
|
|
453
441
|
keygen: KeygenType<Item>;
|
|
454
442
|
renderItem: ((data: Item, index?: number) => ReactNode);
|
|
455
443
|
selectId: string;
|
|
456
|
-
text: Object;
|
|
457
444
|
getRef?: () => void;
|
|
458
445
|
customHeader?: React.ReactNode;
|
|
459
|
-
|
|
446
|
+
style?: React.CSSProperties;
|
|
447
|
+
}
|
|
448
|
+
export declare class WrappedOptionTreeComp<Item, Value> extends React.Component<GetAbsoluteProps<OptionTreeProps<Item, Value>>, any> {
|
|
449
|
+
render: () => JSX.Element;
|
|
460
450
|
}
|
|
461
451
|
export interface UnMatchedValue<Value> {
|
|
462
452
|
IS_NOT_MATCHED_VALUE: boolean;
|
|
@@ -508,29 +498,31 @@ export interface InputProps {
|
|
|
508
498
|
bindFocusInputFunc: (fn: (flag?: boolean) => void) => void;
|
|
509
499
|
}
|
|
510
500
|
/** ---------- boxList ---------- */
|
|
511
|
-
export interface BoxListProps<Item, Value> extends
|
|
512
|
-
data: Item[];
|
|
501
|
+
export interface BoxListProps<Item, Value> extends Pick<BaseSelectProps<Item, Value>, 'datum' | 'keygen' | 'renderResult' | 'multiple' | 'lineHeight' | 'columnWidth' | 'data' | 'loading' | 'renderOptionList' | 'emptyText' | 'itemsInView' | 'height' | 'columnsTitle'> {
|
|
513
502
|
columns: number;
|
|
514
|
-
onChange: (isActive: boolean, data: Item
|
|
503
|
+
onChange: (isActive: boolean, data: Item) => void;
|
|
515
504
|
bindOptionFunc: (name: string, fn: Function) => void;
|
|
516
505
|
text: any;
|
|
517
506
|
selectId: string;
|
|
518
507
|
focus: boolean;
|
|
519
508
|
renderPending?: boolean;
|
|
520
|
-
renderItem: (data: Item, index
|
|
509
|
+
renderItem: (data: Item, index?: number) => React.ReactNode;
|
|
521
510
|
getRef?: (el: HTMLDivElement) => void;
|
|
522
511
|
customHeader: React.ReactNode;
|
|
512
|
+
style: React.CSSProperties;
|
|
513
|
+
}
|
|
514
|
+
export declare class WrappedBoxListComp<Item, Value> extends React.Component<GetAbsoluteProps<BoxListProps<Item, Value>>, any> {
|
|
515
|
+
render: () => JSX.Element;
|
|
523
516
|
}
|
|
524
517
|
/** ---------- boxOption ---------- */
|
|
525
518
|
export interface BoxOptionProps<Item> {
|
|
526
519
|
columns: number;
|
|
527
520
|
data: Item;
|
|
528
521
|
disabled: boolean;
|
|
529
|
-
index?: number;
|
|
530
522
|
isActive: boolean;
|
|
531
523
|
multiple?: boolean;
|
|
532
|
-
onClick: (isActive: boolean, data: Item
|
|
533
|
-
renderItem: (data: Item
|
|
524
|
+
onClick: (isActive: boolean, data: Item) => void;
|
|
525
|
+
renderItem: (data: Item) => ReactNode;
|
|
534
526
|
}
|
|
535
527
|
/** ---------- filter ---------- */
|
|
536
528
|
export interface FilterProps<Item, Value> {
|
package/css/Select/Select.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PureComponent } from '../component';
|
|
4
|
-
import { ResultItem } from '../@types/common';
|
|
5
|
-
import { BaseSelectProps, Control
|
|
4
|
+
import { RegularAttributes, ResultItem } from '../@types/common';
|
|
5
|
+
import { BaseSelectProps, Control } from './Props';
|
|
6
6
|
interface SelectState {
|
|
7
7
|
control: Control;
|
|
8
8
|
focus: boolean;
|
|
9
|
-
position:
|
|
9
|
+
position: RegularAttributes.ListPosition;
|
|
10
10
|
}
|
|
11
11
|
declare class Select<Item, Value> extends PureComponent<BaseSelectProps<Item, Value>, SelectState> {
|
|
12
12
|
static defaultProps: {
|
|
@@ -41,7 +41,6 @@ declare class Select<Item, Value> extends PureComponent<BaseSelectProps<Item, Va
|
|
|
41
41
|
blured: boolean;
|
|
42
42
|
inputBlurTimer: NodeJS.Timer | null;
|
|
43
43
|
lastChangeIsOptionClick: boolean;
|
|
44
|
-
handleBlur: (e?: any) => void;
|
|
45
44
|
handleRemove: (data: ResultItem<Item>, fromInput?: boolean) => void;
|
|
46
45
|
inputLocked: boolean;
|
|
47
46
|
keyLocked: boolean;
|
package/css/Select/Select.js
CHANGED
|
@@ -91,7 +91,6 @@ function (_PureComponent) {
|
|
|
91
91
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "blured", void 0);
|
|
92
92
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "inputBlurTimer", void 0);
|
|
93
93
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "lastChangeIsOptionClick", void 0);
|
|
94
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "handleBlur", void 0);
|
|
95
94
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "handleRemove", void 0);
|
|
96
95
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "inputLocked", void 0);
|
|
97
96
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "keyLocked", void 0);
|
|
@@ -115,7 +114,6 @@ function (_PureComponent) {
|
|
|
115
114
|
_this.shouldFocus = _this.shouldFocus.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
116
115
|
_this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
117
116
|
_this.handleFocus = _this.handleFocus.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
118
|
-
_this.handleBlur = _this.handleState.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), false);
|
|
119
117
|
_this.handleClear = _this.handleClear.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
120
118
|
_this.handleChange = _this.handleChange.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
121
119
|
_this.handleRemove = _this.handleChange.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), false);
|
|
@@ -300,6 +298,7 @@ function (_PureComponent) {
|
|
|
300
298
|
_proto.handleChange = function handleChange(_isActive, data, fromInput) {
|
|
301
299
|
var _this2 = this;
|
|
302
300
|
|
|
301
|
+
console.log('fromInput', fromInput);
|
|
303
302
|
var _this$props4 = this.props,
|
|
304
303
|
datum = _this$props4.datum,
|
|
305
304
|
multiple = _this$props4.multiple,
|
|
@@ -594,20 +593,36 @@ function (_PureComponent) {
|
|
|
594
593
|
};
|
|
595
594
|
|
|
596
595
|
_proto.renderTree = function renderTree() {
|
|
597
|
-
var _this5 = this;
|
|
598
|
-
|
|
599
596
|
var _this$state = this.state,
|
|
600
597
|
focus = _this$state.focus,
|
|
601
598
|
position = _this$state.position;
|
|
602
599
|
var optionWidth = this.props.optionWidth;
|
|
603
|
-
var props = {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
600
|
+
var props = {
|
|
601
|
+
treeData: this.props.treeData,
|
|
602
|
+
expanded: this.props.expanded,
|
|
603
|
+
onExpand: this.props.onExpand,
|
|
604
|
+
loader: this.props.loader,
|
|
605
|
+
defaultExpanded: this.props.defaultExpanded,
|
|
606
|
+
defaultExpandAll: this.props.defaultExpandAll,
|
|
607
|
+
datum: this.props.datum,
|
|
608
|
+
keygen: this.props.keygen,
|
|
609
|
+
multiple: this.props.multiple,
|
|
610
|
+
text: this.props.text,
|
|
611
|
+
height: this.props.height,
|
|
612
|
+
loading: this.props.loading,
|
|
613
|
+
onFilter: this.props.onFilter,
|
|
614
|
+
filterText: this.props.filterText,
|
|
615
|
+
absolute: this.props.absolute,
|
|
616
|
+
zIndex: this.props.zIndex,
|
|
617
|
+
childrenKey: this.props.childrenKey,
|
|
618
|
+
expandIcons: this.props.expandIcons,
|
|
619
|
+
emptyText: this.props.emptyText,
|
|
620
|
+
renderOptionList: this.props.renderOptionList,
|
|
621
|
+
renderItem: this.renderItem
|
|
609
622
|
};
|
|
610
|
-
|
|
623
|
+
var style = optionWidth ? {
|
|
624
|
+
width: optionWidth
|
|
625
|
+
} : {};
|
|
611
626
|
return _react.default.createElement(WrappedOptionTree, (0, _extends2.default)({
|
|
612
627
|
onChange: this.handleChange,
|
|
613
628
|
parentElement: this.element,
|
|
@@ -624,8 +639,6 @@ function (_PureComponent) {
|
|
|
624
639
|
};
|
|
625
640
|
|
|
626
641
|
_proto.renderList = function renderList() {
|
|
627
|
-
var _this6 = this;
|
|
628
|
-
|
|
629
642
|
var _this$state2 = this.state,
|
|
630
643
|
focus = _this$state2.focus,
|
|
631
644
|
control = _this$state2.control,
|
|
@@ -634,16 +647,53 @@ function (_PureComponent) {
|
|
|
634
647
|
autoAdapt = _this$props11.autoAdapt,
|
|
635
648
|
value = _this$props11.value,
|
|
636
649
|
optionWidth = _this$props11.optionWidth;
|
|
637
|
-
var props = {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
650
|
+
var props = {
|
|
651
|
+
data: this.props.data,
|
|
652
|
+
datum: this.props.datum,
|
|
653
|
+
keygen: this.props.keygen,
|
|
654
|
+
multiple: this.props.multiple,
|
|
655
|
+
columns: this.props.columns,
|
|
656
|
+
columnWidth: this.props.columnWidth,
|
|
657
|
+
columnsTitle: this.props.columnsTitle,
|
|
658
|
+
text: this.props.text,
|
|
659
|
+
itemsInView: this.props.itemsInView || DefaultValue.itemsInView,
|
|
660
|
+
absolute: this.props.absolute,
|
|
661
|
+
lineHeight: this.props.lineHeight || DefaultValue.lineHeight,
|
|
662
|
+
height: this.props.height || DefaultValue.height,
|
|
663
|
+
loading: this.props.loading,
|
|
664
|
+
onFilter: this.props.onFilter,
|
|
665
|
+
filterText: this.props.filterText,
|
|
666
|
+
zIndex: this.props.zIndex,
|
|
667
|
+
groupKey: this.props.groupKey,
|
|
668
|
+
hideCreateOption: this.props.hideCreateOption,
|
|
669
|
+
emptyText: this.props.emptyText,
|
|
670
|
+
renderOptionList: this.props.renderOptionList
|
|
645
671
|
};
|
|
646
|
-
|
|
672
|
+
var style = optionWidth ? {
|
|
673
|
+
width: optionWidth
|
|
674
|
+
} : {};
|
|
675
|
+
|
|
676
|
+
if (typeof props.columns === 'number' && props.columns >= 1 || props.columns === -1) {
|
|
677
|
+
return _react.default.createElement(WrappedBoxList, (0, _extends2.default)({}, props, {
|
|
678
|
+
columns: props.columns,
|
|
679
|
+
style: style,
|
|
680
|
+
rootClass: (0, _styles.selectClass)(position, (0, _config.isRTL)() && 'rtl'),
|
|
681
|
+
autoClass: (0, _styles.selectClass)(autoAdapt && 'auto-adapt'),
|
|
682
|
+
bindOptionFunc: this.bindOptionFunc,
|
|
683
|
+
renderPending: this.renderPending,
|
|
684
|
+
focus: focus,
|
|
685
|
+
selectId: this.selectId,
|
|
686
|
+
onChange: this.handleChange,
|
|
687
|
+
renderItem: this.renderItem,
|
|
688
|
+
parentElement: this.element,
|
|
689
|
+
position: position,
|
|
690
|
+
fixed: autoAdapt ? 'min' : true,
|
|
691
|
+
value: value,
|
|
692
|
+
customHeader: this.renderCustomHeader()
|
|
693
|
+
}));
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
return _react.default.createElement(WrappedOptionList, (0, _extends2.default)({}, props, {
|
|
647
697
|
style: style,
|
|
648
698
|
rootClass: (0, _styles.selectClass)(position, (0, _config.isRTL)() && 'rtl'),
|
|
649
699
|
autoClass: (0, _styles.selectClass)(autoAdapt && 'auto-adapt'),
|
|
@@ -657,7 +707,6 @@ function (_PureComponent) {
|
|
|
657
707
|
renderItem: this.renderItem,
|
|
658
708
|
parentElement: this.element,
|
|
659
709
|
position: position,
|
|
660
|
-
onBlur: this.handleBlur,
|
|
661
710
|
fixed: autoAdapt ? 'min' : true,
|
|
662
711
|
value: value,
|
|
663
712
|
customHeader: this.renderCustomHeader()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PureComponent } from '../component';
|
|
3
|
-
import { ResultItem, KeygenResult } from '../@types/common';
|
|
3
|
+
import { ResultItem, KeygenResult, RegularAttributes } from '../@types/common';
|
|
4
4
|
import { TreeSelectValueType, OriginTreeSelectProps } from './Props';
|
|
5
5
|
interface TreeSelectState {
|
|
6
6
|
focus: boolean;
|
|
7
|
-
position:
|
|
7
|
+
position: RegularAttributes.ListPosition;
|
|
8
8
|
}
|
|
9
9
|
export default class TreeSelect<Item, Value extends TreeSelectValueType> extends PureComponent<OriginTreeSelectProps<Item, Value>, TreeSelectState> {
|
|
10
10
|
static defaultProps: {
|