@douyinfe/semi-foundation 2.56.4-alpha.5 → 2.57.0
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/banner/banner.scss +0 -1
- package/form/foundation.ts +1 -0
- package/input/foundation.ts +0 -14
- package/input/textareaFoundation.ts +0 -16
- package/lib/cjs/banner/banner.css +0 -1
- package/lib/cjs/banner/banner.scss +0 -1
- package/lib/cjs/form/foundation.d.ts +1 -0
- package/lib/cjs/form/foundation.js +1 -0
- package/lib/cjs/input/foundation.d.ts +0 -2
- package/lib/cjs/input/foundation.js +0 -16
- package/lib/cjs/input/textareaFoundation.d.ts +0 -2
- package/lib/cjs/input/textareaFoundation.js +0 -14
- package/lib/cjs/modal/modalFoundation.d.ts +1 -0
- package/lib/cjs/overflowList/constants.d.ts +1 -1
- package/lib/cjs/select/foundation.d.ts +5 -1
- package/lib/cjs/select/foundation.js +48 -15
- package/lib/cjs/tooltip/foundation.d.ts +1 -0
- package/lib/cjs/tooltip/foundation.js +8 -0
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/treeSelect/foundation.d.ts +2 -2
- package/lib/cjs/treeSelect/foundation.js +6 -3
- package/lib/es/banner/banner.css +0 -1
- package/lib/es/banner/banner.scss +0 -1
- package/lib/es/form/foundation.d.ts +1 -0
- package/lib/es/form/foundation.js +1 -0
- package/lib/es/input/foundation.d.ts +0 -2
- package/lib/es/input/foundation.js +0 -16
- package/lib/es/input/textareaFoundation.d.ts +0 -2
- package/lib/es/input/textareaFoundation.js +0 -14
- package/lib/es/modal/modalFoundation.d.ts +1 -0
- package/lib/es/overflowList/constants.d.ts +1 -1
- package/lib/es/select/foundation.d.ts +5 -1
- package/lib/es/select/foundation.js +48 -15
- package/lib/es/tooltip/foundation.d.ts +1 -0
- package/lib/es/tooltip/foundation.js +8 -0
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/treeSelect/foundation.d.ts +2 -2
- package/lib/es/treeSelect/foundation.js +6 -3
- package/modal/modalFoundation.ts +1 -0
- package/package.json +3 -6
- package/select/foundation.ts +31 -16
- package/tooltip/foundation.ts +9 -0
- package/treeSelect/foundation.ts +8 -6
- package/lib/cjs/markdownRender/constants.d.ts +0 -5
- package/lib/cjs/markdownRender/constants.js +0 -13
- package/lib/cjs/markdownRender/foundation.d.ts +0 -20
- package/lib/cjs/markdownRender/foundation.js +0 -65
- package/lib/cjs/markdownRender/markdownRender.css +0 -26
- package/lib/cjs/markdownRender/markdownRender.scss +0 -38
- package/lib/cjs/markdownRender/variables.scss +0 -15
- package/lib/es/markdownRender/constants.d.ts +0 -5
- package/lib/es/markdownRender/constants.js +0 -6
- package/lib/es/markdownRender/foundation.d.ts +0 -20
- package/lib/es/markdownRender/foundation.js +0 -57
- package/lib/es/markdownRender/markdownRender.css +0 -26
- package/lib/es/markdownRender/markdownRender.scss +0 -38
- package/lib/es/markdownRender/variables.scss +0 -15
- package/markdownRender/constants.ts +0 -11
- package/markdownRender/foundation.ts +0 -69
- package/markdownRender/markdownRender.scss +0 -38
- package/markdownRender/variables.scss +0 -15
package/banner/banner.scss
CHANGED
package/form/foundation.ts
CHANGED
|
@@ -613,6 +613,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
613
613
|
getValue: (field?: string) => this.getValue(field, { needClone: true }),
|
|
614
614
|
getValues: () => this.getValue(undefined, { needClone: true }),
|
|
615
615
|
getFormState: () => this.getFormState(true),
|
|
616
|
+
getFormProps: (props?: Array<string>) => this.getFormProps(props),
|
|
616
617
|
getInitValue: (field: string) => this.getInitValue(field),
|
|
617
618
|
getInitValues: () => this.getInitValues(),
|
|
618
619
|
getTouched: (field?: string) => this.getTouched(field),
|
package/input/foundation.ts
CHANGED
|
@@ -40,10 +40,6 @@ class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
40
40
|
super({ ...InputFoundation.inputDefaultAdapter, ...adapter });
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
init() {
|
|
44
|
-
this._setInitValue();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
43
|
destroy() {
|
|
48
44
|
if (this._timer) {
|
|
49
45
|
clearTimeout(this._timer);
|
|
@@ -53,16 +49,6 @@ class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
53
49
|
|
|
54
50
|
setDisable() {}
|
|
55
51
|
|
|
56
|
-
_setInitValue() {
|
|
57
|
-
const { defaultValue, value } = this.getProps();
|
|
58
|
-
let v = defaultValue;
|
|
59
|
-
if (this._isControlledComponent()) {
|
|
60
|
-
v = value;
|
|
61
|
-
}
|
|
62
|
-
this._adapter.setValue(v);
|
|
63
|
-
// this.checkAllowClear(v);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
52
|
setValue(value: any) {
|
|
67
53
|
this._adapter.setValue(value);
|
|
68
54
|
}
|
|
@@ -48,24 +48,8 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
init() {
|
|
52
|
-
this.setInitValue();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
51
|
destroy() { }
|
|
56
52
|
|
|
57
|
-
setInitValue() {
|
|
58
|
-
const {
|
|
59
|
-
defaultValue,
|
|
60
|
-
value
|
|
61
|
-
} = this.getProps();
|
|
62
|
-
let v = defaultValue;
|
|
63
|
-
if (this._isControlledComponent()) {
|
|
64
|
-
v = value;
|
|
65
|
-
}
|
|
66
|
-
this._adapter.setValue(v);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
53
|
handleValueChange(v: string) {
|
|
70
54
|
this._adapter.setValue(v);
|
|
71
55
|
}
|
|
@@ -76,6 +76,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
76
76
|
getValue: (field?: string) => any;
|
|
77
77
|
getValues: () => any;
|
|
78
78
|
getFormState: () => FormState<any>;
|
|
79
|
+
getFormProps: (props?: Array<string>) => ComponentProps;
|
|
79
80
|
getInitValue: (field: string) => any;
|
|
80
81
|
getInitValues: () => any;
|
|
81
82
|
getTouched: (field?: string) => boolean | Record<string, any>;
|
|
@@ -599,6 +599,7 @@ class FormFoundation extends _foundation.default {
|
|
|
599
599
|
needClone: true
|
|
600
600
|
}),
|
|
601
601
|
getFormState: () => this.getFormState(true),
|
|
602
|
+
getFormProps: props => this.getFormProps(props),
|
|
602
603
|
getInitValue: field => this.getInitValue(field),
|
|
603
604
|
getInitValues: () => this.getInitValues(),
|
|
604
605
|
getTouched: field => this.getTouched(field),
|
|
@@ -25,10 +25,8 @@ declare class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
25
25
|
};
|
|
26
26
|
_timer: number | null;
|
|
27
27
|
constructor(adapter: InputAdapter);
|
|
28
|
-
init(): void;
|
|
29
28
|
destroy(): void;
|
|
30
29
|
setDisable(): void;
|
|
31
|
-
_setInitValue(): void;
|
|
32
30
|
setValue(value: any): void;
|
|
33
31
|
handleChange(value: any, e: any): void;
|
|
34
32
|
/**
|
|
@@ -25,9 +25,6 @@ class InputFoundation extends _foundation.default {
|
|
|
25
25
|
constructor(adapter) {
|
|
26
26
|
super(Object.assign(Object.assign({}, InputFoundation.inputDefaultAdapter), adapter));
|
|
27
27
|
}
|
|
28
|
-
init() {
|
|
29
|
-
this._setInitValue();
|
|
30
|
-
}
|
|
31
28
|
destroy() {
|
|
32
29
|
if (this._timer) {
|
|
33
30
|
clearTimeout(this._timer);
|
|
@@ -35,19 +32,6 @@ class InputFoundation extends _foundation.default {
|
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
34
|
setDisable() {}
|
|
38
|
-
_setInitValue() {
|
|
39
|
-
const {
|
|
40
|
-
defaultValue,
|
|
41
|
-
value
|
|
42
|
-
} = this.getProps();
|
|
43
|
-
let v = defaultValue;
|
|
44
|
-
if (this._isControlledComponent()) {
|
|
45
|
-
v = value;
|
|
46
|
-
}
|
|
47
|
-
this._adapter.setValue(v);
|
|
48
|
-
// this.checkAllowClear(v);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
35
|
setValue(value) {
|
|
52
36
|
this._adapter.setValue(value);
|
|
53
37
|
}
|
|
@@ -28,9 +28,7 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
28
28
|
notifyEnterPress: (...args: any[]) => void;
|
|
29
29
|
};
|
|
30
30
|
constructor(adapter: TextAreaAdapter);
|
|
31
|
-
init(): void;
|
|
32
31
|
destroy(): void;
|
|
33
|
-
setInitValue(): void;
|
|
34
32
|
handleValueChange(v: string): void;
|
|
35
33
|
handleChange(value: string, e: any): void;
|
|
36
34
|
/**
|
|
@@ -50,21 +50,7 @@ class TextAreaFoundation extends _foundation.default {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
init() {
|
|
54
|
-
this.setInitValue();
|
|
55
|
-
}
|
|
56
53
|
destroy() {}
|
|
57
|
-
setInitValue() {
|
|
58
|
-
const {
|
|
59
|
-
defaultValue,
|
|
60
|
-
value
|
|
61
|
-
} = this.getProps();
|
|
62
|
-
let v = defaultValue;
|
|
63
|
-
if (this._isControlledComponent()) {
|
|
64
|
-
v = value;
|
|
65
|
-
}
|
|
66
|
-
this._adapter.setValue(v);
|
|
67
|
-
}
|
|
68
54
|
handleValueChange(v) {
|
|
69
55
|
this._adapter.setValue(v);
|
|
70
56
|
}
|
|
@@ -71,7 +71,11 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
71
71
|
handleClick(e: any): void;
|
|
72
72
|
open(acInput?: string, originalOptions?: BasicOptionProps[]): void;
|
|
73
73
|
toggle2SearchInput(isShow: boolean): void;
|
|
74
|
-
close(
|
|
74
|
+
close(closeConfig?: {
|
|
75
|
+
event?: any;
|
|
76
|
+
closeCb?: () => void;
|
|
77
|
+
notToggleInput?: boolean;
|
|
78
|
+
}): void;
|
|
75
79
|
onSelect(option: BasicOptionProps, optionIndex: number, event: MouseEvent | KeyboardEvent): void;
|
|
76
80
|
_handleSingleSelect({ value, label, ...rest }: BasicOptionProps, event: any): void;
|
|
77
81
|
_handleMultipleSelect({ value, label, ...rest }: BasicOptionProps, event: MouseEvent | KeyboardEvent): void;
|
|
@@ -323,7 +323,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
323
323
|
this.open();
|
|
324
324
|
this._notifyFocus(e);
|
|
325
325
|
} else if (isOpen && clickToHide) {
|
|
326
|
-
this.close(
|
|
326
|
+
this.close({
|
|
327
|
+
event: e
|
|
328
|
+
});
|
|
327
329
|
} else if (isOpen && !clickToHide) {
|
|
328
330
|
this.focusInput();
|
|
329
331
|
}
|
|
@@ -348,7 +350,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
348
350
|
this._adapter.notifyDropdownVisibleChange(true);
|
|
349
351
|
this.bindKeyBoardEvent();
|
|
350
352
|
this._adapter.registerClickOutsideHandler(e => {
|
|
351
|
-
this.close(
|
|
353
|
+
this.close({
|
|
354
|
+
event: e
|
|
355
|
+
});
|
|
352
356
|
this._notifyBlur(e);
|
|
353
357
|
this._adapter.updateFocusState(false);
|
|
354
358
|
});
|
|
@@ -361,8 +365,13 @@ class SelectFoundation extends _foundation.default {
|
|
|
361
365
|
this._adapter.toggleInputShow(isShow, () => undefined);
|
|
362
366
|
}
|
|
363
367
|
}
|
|
364
|
-
close(
|
|
368
|
+
close(closeConfig) {
|
|
365
369
|
// to support A11y, closing the panel trigger does not necessarily lose focus
|
|
370
|
+
const {
|
|
371
|
+
event,
|
|
372
|
+
closeCb,
|
|
373
|
+
notToggleInput
|
|
374
|
+
} = closeConfig || {};
|
|
366
375
|
this._adapter.closeMenu();
|
|
367
376
|
this._adapter.notifyDropdownVisibleChange(false);
|
|
368
377
|
this._adapter.setIsFocusInContainer(false);
|
|
@@ -371,12 +380,13 @@ class SelectFoundation extends _foundation.default {
|
|
|
371
380
|
// this._adapter.updateFocusState(false);
|
|
372
381
|
this._adapter.unregisterClickOutsideHandler();
|
|
373
382
|
const isFilterable = this._isFilterable();
|
|
374
|
-
|
|
383
|
+
// notToggleInput will only be true when in controlled mode - handleSingeleSelect process
|
|
384
|
+
if (isFilterable && !notToggleInput) {
|
|
375
385
|
this.toggle2SearchInput(false);
|
|
376
386
|
}
|
|
377
387
|
this._adapter.once('popoverClose', () => {
|
|
378
388
|
if (isFilterable) {
|
|
379
|
-
this.clearInput(
|
|
389
|
+
this.clearInput(event);
|
|
380
390
|
}
|
|
381
391
|
if (closeCb) {
|
|
382
392
|
closeCb();
|
|
@@ -419,17 +429,30 @@ class SelectFoundation extends _foundation.default {
|
|
|
419
429
|
// If it is a controlled component, directly notify
|
|
420
430
|
// Make sure that the operations of updating updateOptions are done after the animation ends
|
|
421
431
|
// otherwise the content will be updated when the popup layer is not collapsed, and it looks like it will flash once when it is closed
|
|
432
|
+
const isFilterable = this._isFilterable();
|
|
422
433
|
if (this._isControlledComponent()) {
|
|
423
|
-
this.close(
|
|
424
|
-
|
|
434
|
+
this.close({
|
|
435
|
+
event: event,
|
|
436
|
+
notToggleInput: true,
|
|
437
|
+
closeCb: () => {
|
|
438
|
+
// trigger props.onChange -> update props.value -> updateSelection
|
|
439
|
+
this._notifyChange(selections);
|
|
440
|
+
// make sure toggleSearchInput update after updateSelection in controlled mode, otherwise text in inactive DOM will update quicker than selection, looks like flash text
|
|
441
|
+
if (isFilterable) {
|
|
442
|
+
this.toggle2SearchInput(false);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
425
445
|
});
|
|
426
446
|
} else {
|
|
427
447
|
this._adapter.updateSelection(selections);
|
|
428
448
|
// notify user
|
|
429
449
|
this._notifyChange(selections);
|
|
430
|
-
this.close(
|
|
431
|
-
|
|
432
|
-
|
|
450
|
+
this.close({
|
|
451
|
+
event: event,
|
|
452
|
+
closeCb: () => {
|
|
453
|
+
// Update the selected item in the drop-down box
|
|
454
|
+
this.updateOptionsActiveStatus(selections);
|
|
455
|
+
}
|
|
433
456
|
});
|
|
434
457
|
}
|
|
435
458
|
}
|
|
@@ -729,7 +752,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
729
752
|
this._handleEnterKeyDown(event);
|
|
730
753
|
break;
|
|
731
754
|
case _keyCode.default.ESC:
|
|
732
|
-
isOpen && this.close(
|
|
755
|
+
isOpen && this.close({
|
|
756
|
+
event: event
|
|
757
|
+
});
|
|
733
758
|
filter && !multiple && this._focusTrigger();
|
|
734
759
|
break;
|
|
735
760
|
case _keyCode.default.TAB:
|
|
@@ -823,7 +848,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
823
848
|
}
|
|
824
849
|
} else {
|
|
825
850
|
// there are no focusable elements inside the container, tab to next element and trigger blur
|
|
826
|
-
this.close(
|
|
851
|
+
this.close({
|
|
852
|
+
event: event
|
|
853
|
+
});
|
|
827
854
|
this._notifyBlur(event);
|
|
828
855
|
}
|
|
829
856
|
} else {
|
|
@@ -842,7 +869,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
842
869
|
} else if (activeElement === focusableElements[focusableElements.length - 1]) {
|
|
843
870
|
// focus in the last element in container, focus back to trigger and close panel
|
|
844
871
|
this._focusTrigger();
|
|
845
|
-
this.close(
|
|
872
|
+
this.close({
|
|
873
|
+
event
|
|
874
|
+
});
|
|
846
875
|
(0, _a11y.handlePrevent)(event);
|
|
847
876
|
}
|
|
848
877
|
}
|
|
@@ -851,7 +880,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
851
880
|
const isFocusInContainer = this._adapter.getIsFocusInContainer();
|
|
852
881
|
if (!isFocusInContainer) {
|
|
853
882
|
// focus in trigger, close the panel, shift tab to previe element and trigger blur
|
|
854
|
-
this.close(
|
|
883
|
+
this.close({
|
|
884
|
+
event
|
|
885
|
+
});
|
|
855
886
|
this._notifyBlur(event);
|
|
856
887
|
} else if (activeElement === focusableElements[0]) {
|
|
857
888
|
// focus in the first element in container, focus back to trigger
|
|
@@ -886,7 +917,9 @@ class SelectFoundation extends _foundation.default {
|
|
|
886
917
|
this.onSelect(selectedOption, focusIndex, event);
|
|
887
918
|
}
|
|
888
919
|
} else {
|
|
889
|
-
this.close(
|
|
920
|
+
this.close({
|
|
921
|
+
event
|
|
922
|
+
});
|
|
890
923
|
}
|
|
891
924
|
}
|
|
892
925
|
}
|
|
@@ -73,6 +73,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
73
73
|
_expandPos(position: string, concatPos: string): string;
|
|
74
74
|
_reducePos(position?: string): string;
|
|
75
75
|
clearDelayTimer(): void;
|
|
76
|
+
updateStateIfCursorOnTrigger: (trigger: HTMLElement) => void;
|
|
76
77
|
_generateEvent(types: ArrayElement<typeof strings.TRIGGER_SET>): {
|
|
77
78
|
triggerEventSet: {
|
|
78
79
|
[x: string]: (event: any) => void;
|
|
@@ -34,6 +34,14 @@ class Tooltip extends _foundation.default {
|
|
|
34
34
|
this.setDisplayNone = (displayNone, cb) => {
|
|
35
35
|
this._adapter.setDisplayNone(displayNone, cb);
|
|
36
36
|
};
|
|
37
|
+
this.updateStateIfCursorOnTrigger = trigger => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
if ((_a = trigger === null || trigger === void 0 ? void 0 : trigger.matches) === null || _a === void 0 ? void 0 : _a.call(trigger, ":hover")) {
|
|
40
|
+
const eventNames = this._adapter.getEventName();
|
|
41
|
+
const triggerEventSet = this.getState("triggerEventSet");
|
|
42
|
+
(_b = triggerEventSet[eventNames.mouseEnter]) === null || _b === void 0 ? void 0 : _b.call(triggerEventSet);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
37
45
|
this.onResize = () => {
|
|
38
46
|
// this.log('resize');
|
|
39
47
|
// rePosition when window resize
|
|
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
83
83
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
84
84
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
85
85
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
86
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
86
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
|
|
87
87
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
88
88
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -69,7 +69,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
|
|
|
69
69
|
renderSelectedItem?: BasicRenderSelectedItem;
|
|
70
70
|
getPopupContainer?: () => HTMLElement;
|
|
71
71
|
onBlur?: (e: any) => void;
|
|
72
|
-
onSearch?: (sunInput: string, filteredExpandedKeys: string[]) => void;
|
|
72
|
+
onSearch?: (sunInput: string, filteredExpandedKeys: string[], filteredNodes: BasicTreeNodeData[]) => void;
|
|
73
73
|
onChange?: BasicOnChange;
|
|
74
74
|
onFocus?: (e: any) => void;
|
|
75
75
|
onVisibleChange?: (isVisible: boolean) => void;
|
|
@@ -90,7 +90,7 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
90
90
|
rePositionDropdown: () => void;
|
|
91
91
|
updateState: (states: Partial<BasicTreeSelectInnerData>) => void;
|
|
92
92
|
notifySelect: (selectedKey: string, selected: boolean, selectedNode: BasicTreeNodeData) => void;
|
|
93
|
-
notifySearch: (input: string, filteredExpandedKeys: string[]) => void;
|
|
93
|
+
notifySearch: (input: string, filteredExpandedKeys: string[], filteredNodes: BasicTreeNodeData[]) => void;
|
|
94
94
|
cacheFlattenNodes: (bool: boolean) => void;
|
|
95
95
|
openMenu: () => void;
|
|
96
96
|
closeMenu: (cb?: () => void) => void;
|
|
@@ -475,6 +475,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
475
475
|
} = this.getProps();
|
|
476
476
|
const realFilterProp = treeNodeFilterProp !== 'label' ? treeNodeFilterProp : (0, _get2.default)(keyMaps, 'label', 'label');
|
|
477
477
|
const newExpandedKeys = new Set(expandedKeys);
|
|
478
|
+
let filteredNodes = [];
|
|
478
479
|
let filteredOptsKeys = [];
|
|
479
480
|
let expandedOptsKeys = [];
|
|
480
481
|
let newFlattenNodes = [];
|
|
@@ -484,19 +485,21 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
484
485
|
expandedOptsKeys.forEach(item => newExpandedKeys.add(item));
|
|
485
486
|
newFlattenNodes = (0, _treeUtil.flattenTreeData)(treeData, newExpandedKeys, keyMaps);
|
|
486
487
|
} else {
|
|
487
|
-
|
|
488
|
+
const filteredOpts = Object.values(keyEntities).filter(item => {
|
|
488
489
|
const {
|
|
489
490
|
data
|
|
490
491
|
} = item;
|
|
491
492
|
return (0, _treeUtil.filter)(sugInput, data, filterTreeNode, realFilterProp);
|
|
492
|
-
})
|
|
493
|
+
});
|
|
494
|
+
filteredNodes = filteredOpts.map(item => item.data);
|
|
495
|
+
filteredOptsKeys = filteredOpts.map(item => item.key);
|
|
493
496
|
expandedOptsKeys = (0, _treeUtil.findAncestorKeys)(filteredOptsKeys, keyEntities, false);
|
|
494
497
|
const shownChildKeys = (0, _treeUtil.findDescendantKeys)(filteredOptsKeys, keyEntities, true);
|
|
495
498
|
filteredShownKeys = new Set([...shownChildKeys, ...expandedOptsKeys]);
|
|
496
499
|
newFlattenNodes = (0, _treeUtil.flattenTreeData)(treeData, new Set(expandedOptsKeys), keyMaps, showFilteredOnly && filteredShownKeys);
|
|
497
500
|
}
|
|
498
501
|
const newFilteredExpandedKeys = new Set(expandedOptsKeys);
|
|
499
|
-
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys));
|
|
502
|
+
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys), filteredNodes);
|
|
500
503
|
this._adapter.updateState({
|
|
501
504
|
expandedKeys: newExpandedKeys,
|
|
502
505
|
flattenNodes: newFlattenNodes,
|
package/lib/es/banner/banner.css
CHANGED
|
@@ -76,6 +76,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
76
76
|
getValue: (field?: string) => any;
|
|
77
77
|
getValues: () => any;
|
|
78
78
|
getFormState: () => FormState<any>;
|
|
79
|
+
getFormProps: (props?: Array<string>) => ComponentProps;
|
|
79
80
|
getInitValue: (field: string) => any;
|
|
80
81
|
getInitValues: () => any;
|
|
81
82
|
getTouched: (field?: string) => boolean | Record<string, any>;
|
|
@@ -590,6 +590,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
590
590
|
needClone: true
|
|
591
591
|
}),
|
|
592
592
|
getFormState: () => this.getFormState(true),
|
|
593
|
+
getFormProps: props => this.getFormProps(props),
|
|
593
594
|
getInitValue: field => this.getInitValue(field),
|
|
594
595
|
getInitValues: () => this.getInitValues(),
|
|
595
596
|
getTouched: field => this.getTouched(field),
|
|
@@ -25,10 +25,8 @@ declare class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
25
25
|
};
|
|
26
26
|
_timer: number | null;
|
|
27
27
|
constructor(adapter: InputAdapter);
|
|
28
|
-
init(): void;
|
|
29
28
|
destroy(): void;
|
|
30
29
|
setDisable(): void;
|
|
31
|
-
_setInitValue(): void;
|
|
32
30
|
setValue(value: any): void;
|
|
33
31
|
handleChange(value: any, e: any): void;
|
|
34
32
|
/**
|
|
@@ -18,9 +18,6 @@ class InputFoundation extends BaseFoundation {
|
|
|
18
18
|
constructor(adapter) {
|
|
19
19
|
super(Object.assign(Object.assign({}, InputFoundation.inputDefaultAdapter), adapter));
|
|
20
20
|
}
|
|
21
|
-
init() {
|
|
22
|
-
this._setInitValue();
|
|
23
|
-
}
|
|
24
21
|
destroy() {
|
|
25
22
|
if (this._timer) {
|
|
26
23
|
clearTimeout(this._timer);
|
|
@@ -28,19 +25,6 @@ class InputFoundation extends BaseFoundation {
|
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
27
|
setDisable() {}
|
|
31
|
-
_setInitValue() {
|
|
32
|
-
const {
|
|
33
|
-
defaultValue,
|
|
34
|
-
value
|
|
35
|
-
} = this.getProps();
|
|
36
|
-
let v = defaultValue;
|
|
37
|
-
if (this._isControlledComponent()) {
|
|
38
|
-
v = value;
|
|
39
|
-
}
|
|
40
|
-
this._adapter.setValue(v);
|
|
41
|
-
// this.checkAllowClear(v);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
28
|
setValue(value) {
|
|
45
29
|
this._adapter.setValue(value);
|
|
46
30
|
}
|
|
@@ -28,9 +28,7 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
28
28
|
notifyEnterPress: (...args: any[]) => void;
|
|
29
29
|
};
|
|
30
30
|
constructor(adapter: TextAreaAdapter);
|
|
31
|
-
init(): void;
|
|
32
31
|
destroy(): void;
|
|
33
|
-
setInitValue(): void;
|
|
34
32
|
handleValueChange(v: string): void;
|
|
35
33
|
handleChange(value: string, e: any): void;
|
|
36
34
|
/**
|
|
@@ -43,21 +43,7 @@ export default class TextAreaFoundation extends BaseFoundation {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
init() {
|
|
47
|
-
this.setInitValue();
|
|
48
|
-
}
|
|
49
46
|
destroy() {}
|
|
50
|
-
setInitValue() {
|
|
51
|
-
const {
|
|
52
|
-
defaultValue,
|
|
53
|
-
value
|
|
54
|
-
} = this.getProps();
|
|
55
|
-
let v = defaultValue;
|
|
56
|
-
if (this._isControlledComponent()) {
|
|
57
|
-
v = value;
|
|
58
|
-
}
|
|
59
|
-
this._adapter.setValue(v);
|
|
60
|
-
}
|
|
61
47
|
handleValueChange(v) {
|
|
62
48
|
this._adapter.setValue(v);
|
|
63
49
|
}
|
|
@@ -71,7 +71,11 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
71
71
|
handleClick(e: any): void;
|
|
72
72
|
open(acInput?: string, originalOptions?: BasicOptionProps[]): void;
|
|
73
73
|
toggle2SearchInput(isShow: boolean): void;
|
|
74
|
-
close(
|
|
74
|
+
close(closeConfig?: {
|
|
75
|
+
event?: any;
|
|
76
|
+
closeCb?: () => void;
|
|
77
|
+
notToggleInput?: boolean;
|
|
78
|
+
}): void;
|
|
75
79
|
onSelect(option: BasicOptionProps, optionIndex: number, event: MouseEvent | KeyboardEvent): void;
|
|
76
80
|
_handleSingleSelect({ value, label, ...rest }: BasicOptionProps, event: any): void;
|
|
77
81
|
_handleMultipleSelect({ value, label, ...rest }: BasicOptionProps, event: MouseEvent | KeyboardEvent): void;
|