@douyinfe/semi-foundation 2.0.7 → 2.0.9-alpha.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/autoComplete/autoComplete.scss +1 -1
- package/calendar/foundation.ts +3 -1
- package/collapse/foundation.ts +1 -1
- package/datePicker/foundation.ts +1 -1
- package/form/interface.ts +1 -1
- package/form/utils.ts +2 -2
- package/lib/es/autoComplete/autoComplete.css +79 -5
- package/lib/es/autoComplete/autoComplete.scss +1 -1
- package/lib/es/calendar/foundation.d.ts +2 -1
- package/lib/es/collapse/foundation.d.ts +1 -1
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/form/utils.d.ts +2 -2
- package/lib/es/modal/modalFoundation.d.ts +2 -2
- package/lib/es/modal/modalFoundation.js +2 -2
- package/lib/es/pagination/foundation.d.ts +2 -2
- package/lib/es/radio/variables.scss +1 -1
- package/lib/es/scrollList/itemFoundation.d.ts +3 -3
- package/lib/es/select/foundation.d.ts +2 -1
- package/lib/es/select/option.css +1 -1
- package/lib/es/select/option.scss +1 -1
- package/lib/es/select/select.css +74 -0
- package/lib/es/select/select.scss +2 -1
- package/lib/es/slider/foundation.d.ts +2 -2
- package/lib/es/slider/foundation.js +9 -4
- package/lib/es/table/utils.d.ts +2 -1
- package/lib/es/table/utils.js +17 -1
- package/lib/es/tabs/foundation.d.ts +1 -0
- package/lib/es/tabs/foundation.js +12 -2
- package/lib/es/treeSelect/foundation.d.ts +0 -1
- package/lib/es/utils/log.js +3 -1
- package/modal/modalFoundation.ts +3 -4
- package/package.json +3 -3
- package/pagination/foundation.ts +2 -2
- package/radio/variables.scss +1 -1
- package/scrollList/itemFoundation.ts +3 -3
- package/select/foundation.ts +4 -3
- package/select/option.scss +1 -1
- package/select/select.scss +2 -1
- package/slider/foundation.ts +4 -4
- package/table/utils.ts +16 -2
- package/tabs/foundation.ts +9 -2
- package/treeSelect/foundation.ts +1 -1
- package/utils/log.ts +3 -1
package/calendar/foundation.ts
CHANGED
|
@@ -83,11 +83,13 @@ export type MonthData = Record<number, DateObj[]>;
|
|
|
83
83
|
// cacheEventKeys: (cachedKeys: Array<string>) => void;
|
|
84
84
|
// }
|
|
85
85
|
|
|
86
|
+
export type ParsedEventsType = ParsedEvents | ParsedEventsWithArray | MonthlyEvent
|
|
87
|
+
|
|
86
88
|
export interface CalendarAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
87
89
|
updateCurrPos?: (currPos: number) => void;
|
|
88
90
|
updateShowCurrTime?: () => void;
|
|
89
91
|
updateScrollHeight?: (scrollHeight: number) => void;
|
|
90
|
-
setParsedEvents?: (parsedEvents:
|
|
92
|
+
setParsedEvents?: (parsedEvents: ParsedEventsType) => void;
|
|
91
93
|
cacheEventKeys?: (cachedKeys: Array<string>) => void;
|
|
92
94
|
setRangeData?: (data: RangeData) => void;
|
|
93
95
|
getRangeData?: () => RangeData;
|
package/collapse/foundation.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface CollapseState{
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface CollapseAdapter extends DefaultAdapter<CollapseProps, CollapseState>{
|
|
26
|
-
handleChange: (
|
|
26
|
+
handleChange: (activeKey: CollapseProps['activeKey'], e: any) => void;
|
|
27
27
|
// getStates: () => CollapseState;
|
|
28
28
|
// getProps: () => CollapseProps;
|
|
29
29
|
addActiveKey: (newSet: CollapseState['activeSet']) => void;
|
package/datePicker/foundation.ts
CHANGED
|
@@ -282,7 +282,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
282
282
|
if (isValidDate(value)) {
|
|
283
283
|
dateObj = value as Date;
|
|
284
284
|
} else if (isString(value)) {
|
|
285
|
-
dateObj = compatiableParse(value, this.getProp('format'), undefined, dateFnsLocale);
|
|
285
|
+
dateObj = compatiableParse(value as string, this.getProp('format'), undefined, dateFnsLocale);
|
|
286
286
|
} else if (isTimestamp(value)) {
|
|
287
287
|
dateObj = new Date(value);
|
|
288
288
|
} else {
|
package/form/interface.ts
CHANGED
package/form/utils.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
4
|
import AsyncValidator from 'async-validator';
|
|
5
5
|
import { cloneDeep, toPath } from 'lodash-es';
|
|
6
|
-
import { FieldValidateTriggerType, BasicTriggerType, ComponentProps,
|
|
6
|
+
import { FieldValidateTriggerType, BasicTriggerType, ComponentProps, WithFieldOption } from './interface';
|
|
7
7
|
|
|
8
8
|
export function getDisplayName(WrappedComponent: React.ComponentType | any) {
|
|
9
9
|
const originName = WrappedComponent.displayName || WrappedComponent.name;
|
|
@@ -61,7 +61,7 @@ function transformTrigger(trigger: FieldValidateTriggerType): Array<BasicTrigger
|
|
|
61
61
|
return result;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export function mergeOptions(opts:
|
|
64
|
+
export function mergeOptions(opts: WithFieldOption, props: ComponentProps) {
|
|
65
65
|
// Opts: different types of component identification value, value change callback function may be inconsistent, used to adapt 1, input, select 2, radio, checkbox 3, switch
|
|
66
66
|
// valueKey: input, select class component control value props are value, and checkbox, switch is checked
|
|
67
67
|
// eg:checkbox、radio { valueKey: 'checked', onKeyChangeFnName: 'onChange', valuePath: 'target.value' }
|
|
@@ -1,25 +1,99 @@
|
|
|
1
1
|
/* shadow */
|
|
2
2
|
/* sizing */
|
|
3
3
|
/* spacing */
|
|
4
|
-
.semi-
|
|
4
|
+
.semi-select-option {
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 20px;
|
|
7
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
8
|
+
word-break: break-all;
|
|
9
|
+
padding-left: 12px;
|
|
10
|
+
padding-right: 12px;
|
|
11
|
+
padding-top: 8px;
|
|
12
|
+
padding-bottom: 8px;
|
|
13
|
+
color: var(--semi-color-text-0);
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: nowrap;
|
|
17
|
+
align-items: center;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
.semi-select-option-icon {
|
|
22
|
+
width: 12px;
|
|
23
|
+
color: transparent;
|
|
24
|
+
visibility: hidden;
|
|
25
|
+
margin-right: 8px;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-content: center;
|
|
29
|
+
}
|
|
30
|
+
.semi-select-option-text {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
white-space: pre;
|
|
34
|
+
}
|
|
35
|
+
.semi-select-option-keyword {
|
|
36
|
+
color: var(--semi-color-primary);
|
|
37
|
+
background-color: inherit;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
.semi-select-option:active {
|
|
41
|
+
background-color: var(--semi-color-fill-1);
|
|
42
|
+
}
|
|
43
|
+
.semi-select-option-empty {
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
color: var(--semi-color-disabled-text);
|
|
46
|
+
justify-content: center;
|
|
47
|
+
}
|
|
48
|
+
.semi-select-option-empty:hover {
|
|
49
|
+
background-color: inherit;
|
|
50
|
+
}
|
|
51
|
+
.semi-select-option-empty:active {
|
|
52
|
+
background-color: inherit;
|
|
53
|
+
}
|
|
54
|
+
.semi-select-option-disabled {
|
|
55
|
+
color: var(--semi-color-disabled-text);
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
}
|
|
58
|
+
.semi-select-option-disabled:hover {
|
|
59
|
+
background-color: var(--semi-color-fill-0);
|
|
60
|
+
}
|
|
61
|
+
.semi-select-option-selected {
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
}
|
|
64
|
+
.semi-select-option-selected .semi-select-option-icon {
|
|
65
|
+
visibility: visible;
|
|
66
|
+
color: var(--semi-color-text-2);
|
|
67
|
+
}
|
|
68
|
+
.semi-select-option-focused {
|
|
69
|
+
background-color: var(--semi-color-fill-0);
|
|
70
|
+
}
|
|
71
|
+
.semi-select-option:first-of-type {
|
|
72
|
+
margin-top: 4px;
|
|
73
|
+
}
|
|
74
|
+
.semi-select-option:last-of-type {
|
|
75
|
+
margin-bottom: 4px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.semi-select {
|
|
5
79
|
cursor: text;
|
|
6
80
|
display: inline-flex;
|
|
7
81
|
vertical-align: middle;
|
|
8
82
|
box-sizing: border-box;
|
|
9
83
|
}
|
|
10
|
-
.semi-
|
|
84
|
+
.semi-select-option-list {
|
|
11
85
|
overflow-x: hidden;
|
|
12
86
|
overflow-y: auto;
|
|
13
87
|
}
|
|
14
|
-
.semi-
|
|
88
|
+
.semi-select-option-list-chosen .semi-select-option-icon {
|
|
15
89
|
display: flex;
|
|
16
90
|
}
|
|
17
|
-
.semi-
|
|
91
|
+
.semi-select-loading-wrapper {
|
|
18
92
|
padding-top: 8px;
|
|
19
93
|
padding-bottom: 8px;
|
|
20
94
|
cursor: not-allowed;
|
|
21
95
|
}
|
|
22
|
-
.semi-
|
|
96
|
+
.semi-select-loading-wrapper .semi-spin {
|
|
23
97
|
width: 100%;
|
|
24
98
|
}
|
|
25
99
|
|
|
@@ -36,11 +36,12 @@ export interface WeeklyData {
|
|
|
36
36
|
week: DateObj[];
|
|
37
37
|
}
|
|
38
38
|
export declare type MonthData = Record<number, DateObj[]>;
|
|
39
|
+
export declare type ParsedEventsType = ParsedEvents | ParsedEventsWithArray | MonthlyEvent;
|
|
39
40
|
export interface CalendarAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
40
41
|
updateCurrPos?: (currPos: number) => void;
|
|
41
42
|
updateShowCurrTime?: () => void;
|
|
42
43
|
updateScrollHeight?: (scrollHeight: number) => void;
|
|
43
|
-
setParsedEvents?: (parsedEvents:
|
|
44
|
+
setParsedEvents?: (parsedEvents: ParsedEventsType) => void;
|
|
44
45
|
cacheEventKeys?: (cachedKeys: Array<string>) => void;
|
|
45
46
|
setRangeData?: (data: RangeData) => void;
|
|
46
47
|
getRangeData?: () => RangeData;
|
|
@@ -18,7 +18,7 @@ export interface CollapseState {
|
|
|
18
18
|
activeSet: Set<string>;
|
|
19
19
|
}
|
|
20
20
|
export interface CollapseAdapter extends DefaultAdapter<CollapseProps, CollapseState> {
|
|
21
|
-
handleChange: (
|
|
21
|
+
handleChange: (activeKey: CollapseProps['activeKey'], e: any) => void;
|
|
22
22
|
addActiveKey: (newSet: CollapseState['activeSet']) => void;
|
|
23
23
|
}
|
|
24
24
|
export default class CollapseFoundation extends BaseFoundation<CollapseAdapter> {
|
package/lib/es/form/utils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import AsyncValidator from 'async-validator';
|
|
3
|
-
import { ComponentProps,
|
|
3
|
+
import { ComponentProps, WithFieldOption } from './interface';
|
|
4
4
|
export declare function getDisplayName(WrappedComponent: React.ComponentType | any): string;
|
|
5
5
|
export declare function generateValidatesFromRules(field: string, rules?: any[]): AsyncValidator;
|
|
6
6
|
export declare function isRequired(rules?: any[] | Record<string, any>): boolean;
|
|
7
7
|
export declare function isValid(errors: any): boolean;
|
|
8
|
-
export declare function mergeOptions(opts:
|
|
8
|
+
export declare function mergeOptions(opts: WithFieldOption, props: ComponentProps): {
|
|
9
9
|
options: {
|
|
10
10
|
valueKey: string;
|
|
11
11
|
onKeyChangeFnName: string;
|
|
@@ -8,7 +8,7 @@ export interface ModalAdapter extends DefaultAdapter<ModalProps, ModalState> {
|
|
|
8
8
|
notifyCancel: (e: any) => void;
|
|
9
9
|
notifyOk: (e: any) => void;
|
|
10
10
|
notifyClose: () => void;
|
|
11
|
-
toggleHidden: (hidden: boolean) => void;
|
|
11
|
+
toggleHidden: (hidden: boolean, callback?: (hidden: boolean) => void) => void;
|
|
12
12
|
notifyFullScreen: (isFullScreen: boolean) => void;
|
|
13
13
|
getProps: () => ModalProps;
|
|
14
14
|
}
|
|
@@ -64,5 +64,5 @@ export default class ModalFoundation extends BaseFoundation<ModalAdapter> {
|
|
|
64
64
|
beforeShow(): void;
|
|
65
65
|
afterHide(): void;
|
|
66
66
|
afterClose(): void;
|
|
67
|
-
toggleHidden: (hidden: boolean) => void;
|
|
67
|
+
toggleHidden: (hidden: boolean, callback?: (hidden: boolean) => void) => void;
|
|
68
68
|
}
|
|
@@ -4,8 +4,8 @@ export default class ModalFoundation extends BaseFoundation {
|
|
|
4
4
|
constructor(adapter) {
|
|
5
5
|
super(_Object$assign({}, adapter));
|
|
6
6
|
|
|
7
|
-
this.toggleHidden = hidden => {
|
|
8
|
-
this._adapter.toggleHidden(hidden);
|
|
7
|
+
this.toggleHidden = (hidden, callback) => {
|
|
8
|
+
this._adapter.toggleHidden(hidden, callback);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -8,9 +8,9 @@ export interface PaginationAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
8
8
|
setCurrentPage: (pageIndex: number) => void;
|
|
9
9
|
registerKeyDownHandler: (handler: KeyDownHandler) => void;
|
|
10
10
|
unregisterKeyDownHandler: (handler: KeyDownHandler) => void;
|
|
11
|
-
notifyPageChange: (pageIndex: number
|
|
11
|
+
notifyPageChange: (pageIndex: number) => void;
|
|
12
12
|
notifyPageSizeChange: (pageSize: number) => void;
|
|
13
|
-
notifyChange: (pageIndex: number
|
|
13
|
+
notifyChange: (pageIndex: number, pageSize: number) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare type PageRenderText = number | '...';
|
|
16
16
|
export declare type PageList = PageRenderText[];
|
|
@@ -48,7 +48,7 @@ $width-radio_hover-border: $border-thickness-control; // 描边宽度 - 悬浮
|
|
|
48
48
|
$width-radio_disabled-border: $border-thickness-control; // 描边宽度 - 禁用态
|
|
49
49
|
$width-radio_innder-border: $border-thickness-control; // 描边宽度 - 禁用态
|
|
50
50
|
|
|
51
|
-
$height-radio_inner_min:
|
|
51
|
+
$height-radio_inner_min: 20px; // 单选按钮高度
|
|
52
52
|
$width-radio_inner: $width-icon-medium; // 单选按钮宽度
|
|
53
53
|
$spacing-radio_addon-paddingLeft: $spacing-tight; //单选标题到单选按钮左侧边距
|
|
54
54
|
$spacing-radio_addon-marginLeft: $width-radio_inner; //单选标题左侧整体外边距
|
|
@@ -6,15 +6,15 @@ export interface Item {
|
|
|
6
6
|
text?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export interface ScrollItemAdapter<P = Record<string, any>, S = Record<string, any
|
|
9
|
+
export interface ScrollItemAdapter<P = Record<string, any>, S = Record<string, any>, I = Item> extends DefaultAdapter<P, S> {
|
|
10
10
|
setPrependCount: (prependCount: number) => void;
|
|
11
11
|
setAppendCount: (appendCount: number) => void;
|
|
12
12
|
setSelectedNode: (el: HTMLElement) => void;
|
|
13
13
|
isDisabledIndex: (i: number) => boolean;
|
|
14
|
-
notifySelectItem: (data:
|
|
14
|
+
notifySelectItem: (data: I) => void;
|
|
15
15
|
scrollToCenter: (selectedNode: Element, scrollWrapper?: Element, duration?: number) => void;
|
|
16
16
|
}
|
|
17
|
-
export default class ItemFoundation<P = Record<string, any>, S = Record<string, any
|
|
17
|
+
export default class ItemFoundation<P = Record<string, any>, S = Record<string, any>, I = Item> extends BaseFoundation<ScrollItemAdapter<P, S, I>, P, S> {
|
|
18
18
|
_cachedSelectedNode: HTMLElement;
|
|
19
19
|
selectIndex(index: number, listWrapper: HTMLElement): void;
|
|
20
20
|
selectNode(node: HTMLElement, listWrapper: HTMLElement): void;
|
|
@@ -38,7 +38,8 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
38
38
|
updateHovering(isHover: boolean): void;
|
|
39
39
|
updateScrollTop(): void;
|
|
40
40
|
}
|
|
41
|
-
declare type
|
|
41
|
+
declare type LabelValue = string | number;
|
|
42
|
+
declare type PropValue = LabelValue | Record<string, any>;
|
|
42
43
|
export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
43
44
|
constructor(adapter: SelectAdapter);
|
|
44
45
|
_keydownHandler: (...arg: any[]) => void | null;
|
package/lib/es/select/option.css
CHANGED
package/lib/es/select/select.css
CHANGED
|
@@ -1,6 +1,80 @@
|
|
|
1
1
|
/* shadow */
|
|
2
2
|
/* sizing */
|
|
3
3
|
/* spacing */
|
|
4
|
+
.semi-select-option {
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 20px;
|
|
7
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
8
|
+
word-break: break-all;
|
|
9
|
+
padding-left: 12px;
|
|
10
|
+
padding-right: 12px;
|
|
11
|
+
padding-top: 8px;
|
|
12
|
+
padding-bottom: 8px;
|
|
13
|
+
color: var(--semi-color-text-0);
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: nowrap;
|
|
17
|
+
align-items: center;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
.semi-select-option-icon {
|
|
22
|
+
width: 12px;
|
|
23
|
+
color: transparent;
|
|
24
|
+
visibility: hidden;
|
|
25
|
+
margin-right: 8px;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-content: center;
|
|
29
|
+
}
|
|
30
|
+
.semi-select-option-text {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
white-space: pre;
|
|
34
|
+
}
|
|
35
|
+
.semi-select-option-keyword {
|
|
36
|
+
color: var(--semi-color-primary);
|
|
37
|
+
background-color: inherit;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
.semi-select-option:active {
|
|
41
|
+
background-color: var(--semi-color-fill-1);
|
|
42
|
+
}
|
|
43
|
+
.semi-select-option-empty {
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
color: var(--semi-color-disabled-text);
|
|
46
|
+
justify-content: center;
|
|
47
|
+
}
|
|
48
|
+
.semi-select-option-empty:hover {
|
|
49
|
+
background-color: inherit;
|
|
50
|
+
}
|
|
51
|
+
.semi-select-option-empty:active {
|
|
52
|
+
background-color: inherit;
|
|
53
|
+
}
|
|
54
|
+
.semi-select-option-disabled {
|
|
55
|
+
color: var(--semi-color-disabled-text);
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
}
|
|
58
|
+
.semi-select-option-disabled:hover {
|
|
59
|
+
background-color: var(--semi-color-fill-0);
|
|
60
|
+
}
|
|
61
|
+
.semi-select-option-selected {
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
}
|
|
64
|
+
.semi-select-option-selected .semi-select-option-icon {
|
|
65
|
+
visibility: visible;
|
|
66
|
+
color: var(--semi-color-text-2);
|
|
67
|
+
}
|
|
68
|
+
.semi-select-option-focused {
|
|
69
|
+
background-color: var(--semi-color-fill-0);
|
|
70
|
+
}
|
|
71
|
+
.semi-select-option:first-of-type {
|
|
72
|
+
margin-top: 4px;
|
|
73
|
+
}
|
|
74
|
+
.semi-select-option:last-of-type {
|
|
75
|
+
margin-bottom: 4px;
|
|
76
|
+
}
|
|
77
|
+
|
|
4
78
|
.semi-select {
|
|
5
79
|
box-sizing: border-box;
|
|
6
80
|
border-radius: var(--semi-border-radius-small);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//@import '../theme/variables.scss';
|
|
2
2
|
@import './variables.scss';
|
|
3
3
|
@import './mixin.scss';
|
|
4
|
+
@import './option.scss';
|
|
4
5
|
|
|
5
6
|
$module: #{$prefix}-select;
|
|
6
7
|
$single: #{$module}-single;
|
|
@@ -418,4 +419,4 @@ $multiple: #{$module}-multiple;
|
|
|
418
419
|
cursor: not-allowed;
|
|
419
420
|
}
|
|
420
421
|
|
|
421
|
-
@import './rtl.scss';
|
|
422
|
+
@import './rtl.scss';
|
|
@@ -70,7 +70,7 @@ export interface SliderAdapter extends DefaultAdapter<SliderProps, SliderState>
|
|
|
70
70
|
current: HTMLElement;
|
|
71
71
|
};
|
|
72
72
|
onHandleDown: (e: any) => any;
|
|
73
|
-
onHandleMove: (mousePos: number, isMin: boolean, stateChangeCallback?: () => void) => boolean | void;
|
|
73
|
+
onHandleMove: (mousePos: number, isMin: boolean, stateChangeCallback?: () => void, clickTrack?: boolean) => boolean | void;
|
|
74
74
|
setEventDefault: (e: any) => void;
|
|
75
75
|
setStateVal: (state: keyof SliderState, value: any) => void;
|
|
76
76
|
onHandleEnter: (position: SliderState['focusPos']) => void;
|
|
@@ -190,7 +190,7 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
|
|
|
190
190
|
*
|
|
191
191
|
* @memberof SliderFoundation
|
|
192
192
|
*/
|
|
193
|
-
setHandlePos: (position: number, isMin: boolean) => void;
|
|
193
|
+
setHandlePos: (position: number, isMin: boolean, clickTrack?: boolean) => void;
|
|
194
194
|
/**
|
|
195
195
|
* Determine which slider should be moved currently
|
|
196
196
|
*
|
|
@@ -10,14 +10,17 @@ import BaseFoundation from '../base/foundation';
|
|
|
10
10
|
import touchEventPolyfill from '../utils/touchPolyfill';
|
|
11
11
|
export default class SliderFoundation extends BaseFoundation {
|
|
12
12
|
constructor(adapter) {
|
|
13
|
+
var _this;
|
|
14
|
+
|
|
13
15
|
super(_Object$assign(_Object$assign({}, SliderFoundation.defaultAdapter), adapter));
|
|
16
|
+
_this = this;
|
|
17
|
+
|
|
14
18
|
/**
|
|
15
19
|
* Calculate the percentage corresponding to the current value for style calculation
|
|
16
20
|
* @{}
|
|
17
21
|
*
|
|
18
22
|
* @memberof SliderFoundation
|
|
19
23
|
*/
|
|
20
|
-
|
|
21
24
|
this.getMinAndMaxPercent = value => {
|
|
22
25
|
// debugger
|
|
23
26
|
const {
|
|
@@ -610,7 +613,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
610
613
|
const mousePos = this.handleMousePos(e.pageX, e.pageY);
|
|
611
614
|
const position = vertical ? mousePos.y : mousePos.x;
|
|
612
615
|
const isMin = this.checkWhichHandle(position);
|
|
613
|
-
this.setHandlePos(position, isMin);
|
|
616
|
+
this.setHandlePos(position, isMin, true);
|
|
614
617
|
};
|
|
615
618
|
/**
|
|
616
619
|
* Move the slider to the current click position
|
|
@@ -619,8 +622,10 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
619
622
|
*/
|
|
620
623
|
|
|
621
624
|
|
|
622
|
-
this.setHandlePos = (position, isMin)
|
|
623
|
-
|
|
625
|
+
this.setHandlePos = function (position, isMin) {
|
|
626
|
+
let clickTrack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
627
|
+
|
|
628
|
+
_this._adapter.onHandleMove(position, isMin, () => _this._adapter.onHandleUpAfter(), clickTrack);
|
|
624
629
|
};
|
|
625
630
|
/**
|
|
626
631
|
* Determine which slider should be moved currently
|
package/lib/es/table/utils.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare function isInnerColumnKey(key: string | number): boolean;
|
|
|
21
21
|
export declare function isExpandedColumn(column: Record<string, any>): boolean;
|
|
22
22
|
export declare function isScrollbarColumn(column: Record<string, any>): boolean;
|
|
23
23
|
export declare function isSelectionColumn(column: Record<string, any>): boolean;
|
|
24
|
-
export declare function filterColumns(columns: Record<string, any>[], ignoreKeys?:
|
|
24
|
+
export declare function filterColumns(columns: Record<string, any>[], ignoreKeys?: string[]): Record<string, any>[];
|
|
25
25
|
/**
|
|
26
26
|
* get width of scroll bar
|
|
27
27
|
* @param {Array} columns
|
|
@@ -92,3 +92,4 @@ export interface GetAllDisabledRowKeysProps {
|
|
|
92
92
|
childrenRecordName?: string;
|
|
93
93
|
rowKey?: string | number | ((record: Record<string, any>) => string | number);
|
|
94
94
|
}
|
|
95
|
+
export declare function warnIfNoDataIndex(column: Record<string, any>): void;
|
package/lib/es/table/utils.js
CHANGED
|
@@ -13,9 +13,10 @@ import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
13
13
|
/* eslint-disable no-param-reassign */
|
|
14
14
|
|
|
15
15
|
/* eslint-disable eqeqeq */
|
|
16
|
-
import { cloneDeepWith, isEqualWith, get, filter, find, map, clone as lodashClone, each, findIndex, some, includes, toString } from 'lodash-es';
|
|
16
|
+
import { cloneDeepWith, isEqualWith, get, filter, find, map, clone as lodashClone, each, findIndex, some, includes, toString, isFunction } from 'lodash-es';
|
|
17
17
|
import { strings, numbers } from './constants';
|
|
18
18
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
19
|
+
import Logger from '../utils/Logger';
|
|
19
20
|
export function cloneDeep(value, customizer) {
|
|
20
21
|
return cloneDeepWith(value, v => {
|
|
21
22
|
if (typeof v === 'function') {
|
|
@@ -259,6 +260,7 @@ export function flattenColumns(cols) {
|
|
|
259
260
|
if (_Array$isArray(col[childrenColumnName]) && col[childrenColumnName].length) {
|
|
260
261
|
list.push(...flattenColumns(col[childrenColumnName], childrenColumnName));
|
|
261
262
|
} else {
|
|
263
|
+
warnIfNoDataIndex(col);
|
|
262
264
|
list.push(col);
|
|
263
265
|
}
|
|
264
266
|
}
|
|
@@ -482,4 +484,18 @@ export function getAllDisabledRowKeys(_ref) {
|
|
|
482
484
|
}
|
|
483
485
|
|
|
484
486
|
return disabledRowKeys;
|
|
487
|
+
}
|
|
488
|
+
export function warnIfNoDataIndex(column) {
|
|
489
|
+
if (typeof column === 'object' && column !== null) {
|
|
490
|
+
const {
|
|
491
|
+
filters,
|
|
492
|
+
sorter,
|
|
493
|
+
dataIndex
|
|
494
|
+
} = column;
|
|
495
|
+
const logger = new Logger('[@douyinfe/semi-ui Table]');
|
|
496
|
+
|
|
497
|
+
if ((_Array$isArray(filters) || isFunction(sorter)) && isNullOrUndefined(dataIndex)) {
|
|
498
|
+
logger.warn("The column with sorter or filter must pass the 'dataIndex' prop");
|
|
499
|
+
}
|
|
500
|
+
}
|
|
485
501
|
}
|
|
@@ -10,6 +10,7 @@ declare class TabsFoundation<P = Record<string, any>, S = Record<string, any>> e
|
|
|
10
10
|
constructor(adapter: TabsAdapter<P, S>);
|
|
11
11
|
init(): void;
|
|
12
12
|
destroy: (...args: any[]) => void;
|
|
13
|
+
_notifyChange(activeKey: string): void;
|
|
13
14
|
handleTabClick(activeKey: string, event: any): void;
|
|
14
15
|
handleNewActiveKey(activeKey: string): void;
|
|
15
16
|
getDefaultActiveKey(): string;
|
|
@@ -12,13 +12,23 @@ class TabsFoundation extends BaseFoundation {
|
|
|
12
12
|
this._adapter.collectPane();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
_notifyChange(activeKey) {
|
|
16
|
+
const {
|
|
17
|
+
activeKey: stateActiveKey
|
|
18
|
+
} = this.getStates();
|
|
19
|
+
|
|
20
|
+
if (stateActiveKey !== activeKey) {
|
|
21
|
+
this._adapter.notifyChange(activeKey);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
handleTabClick(activeKey, event) {
|
|
16
26
|
const isControledComponent = this._isInProps('activeKey');
|
|
17
27
|
|
|
18
28
|
if (isControledComponent) {
|
|
19
|
-
this.
|
|
29
|
+
this._notifyChange(activeKey);
|
|
20
30
|
} else {
|
|
21
|
-
this.
|
|
31
|
+
this._notifyChange(activeKey);
|
|
22
32
|
|
|
23
33
|
this.handleNewActiveKey(activeKey);
|
|
24
34
|
}
|
|
@@ -63,7 +63,6 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
|
|
|
63
63
|
searchRender?: (inputProps: any) => any;
|
|
64
64
|
renderSelectedItem?: BasicRenderSelectedItem;
|
|
65
65
|
getPopupContainer?: () => HTMLElement;
|
|
66
|
-
triggerRender?: (props: BasicTriggerRenderProps) => any;
|
|
67
66
|
onBlur?: (e: any) => void;
|
|
68
67
|
onChange?: BasicOnChange;
|
|
69
68
|
onFocus?: (e: any) => void;
|
package/lib/es/utils/log.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { get } from 'lodash-es';
|
|
2
|
+
|
|
1
3
|
const log = function (text) {
|
|
2
|
-
if (process
|
|
4
|
+
if (get(process, 'env.NODE_ENV') === 'development') {
|
|
3
5
|
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
4
6
|
rest[_key - 1] = arguments[_key];
|
|
5
7
|
}
|
package/modal/modalFoundation.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { get } from 'lodash-es';
|
|
2
1
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
3
2
|
import { Motion } from '../utils/type';
|
|
4
3
|
|
|
@@ -11,7 +10,7 @@ export interface ModalAdapter extends DefaultAdapter<ModalProps, ModalState> {
|
|
|
11
10
|
notifyCancel: (e: any) => void;
|
|
12
11
|
notifyOk: (e: any) => void;
|
|
13
12
|
notifyClose: () => void;
|
|
14
|
-
toggleHidden: (hidden: boolean) => void;
|
|
13
|
+
toggleHidden: (hidden: boolean, callback?: (hidden: boolean) => void) => void;
|
|
15
14
|
notifyFullScreen: (isFullScreen: boolean) => void;
|
|
16
15
|
getProps: () => ModalProps;
|
|
17
16
|
}
|
|
@@ -95,8 +94,8 @@ export default class ModalFoundation extends BaseFoundation<ModalAdapter> {
|
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
|
|
98
|
-
toggleHidden = (hidden: boolean) => {
|
|
99
|
-
this._adapter.toggleHidden(hidden);
|
|
97
|
+
toggleHidden = (hidden: boolean, callback?: (hidden: boolean) => void) => {
|
|
98
|
+
this._adapter.toggleHidden(hidden, callback);
|
|
100
99
|
};
|
|
101
100
|
|
|
102
101
|
// // eslint-disable-next-line max-len
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
11
|
-
"@douyinfe/semi-animation": "2.0.
|
|
11
|
+
"@douyinfe/semi-animation": "2.0.8",
|
|
12
12
|
"async-validator": "^3.5.0",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
14
14
|
"date-fns": "^2.9.0",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"*.scss",
|
|
25
25
|
"*.css"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "a2979aeef086df38907d49174e6071c20cab6ae9",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
30
30
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
package/pagination/foundation.ts
CHANGED
|
@@ -12,9 +12,9 @@ export interface PaginationAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
12
12
|
setCurrentPage: (pageIndex: number) => void;
|
|
13
13
|
registerKeyDownHandler: (handler: KeyDownHandler) => void;
|
|
14
14
|
unregisterKeyDownHandler: (handler: KeyDownHandler) => void;
|
|
15
|
-
notifyPageChange: (pageIndex: number
|
|
15
|
+
notifyPageChange: (pageIndex: number) => void;
|
|
16
16
|
notifyPageSizeChange: (pageSize: number) => void;
|
|
17
|
-
notifyChange: (pageIndex: number
|
|
17
|
+
notifyChange: (pageIndex: number, pageSize: number) => void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type PageRenderText = number | '...';
|
package/radio/variables.scss
CHANGED
|
@@ -48,7 +48,7 @@ $width-radio_hover-border: $border-thickness-control; // 描边宽度 - 悬浮
|
|
|
48
48
|
$width-radio_disabled-border: $border-thickness-control; // 描边宽度 - 禁用态
|
|
49
49
|
$width-radio_innder-border: $border-thickness-control; // 描边宽度 - 禁用态
|
|
50
50
|
|
|
51
|
-
$height-radio_inner_min:
|
|
51
|
+
$height-radio_inner_min: 20px; // 单选按钮高度
|
|
52
52
|
$width-radio_inner: $width-icon-medium; // 单选按钮宽度
|
|
53
53
|
$spacing-radio_addon-paddingLeft: $spacing-tight; //单选标题到单选按钮左侧边距
|
|
54
54
|
$spacing-radio_addon-marginLeft: $width-radio_inner; //单选标题左侧整体外边距
|
|
@@ -11,16 +11,16 @@ export interface Item {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export interface ScrollItemAdapter<P = Record<string, any>, S = Record<string, any
|
|
14
|
+
export interface ScrollItemAdapter<P = Record<string, any>, S = Record<string, any>, I = Item> extends DefaultAdapter<P, S> {
|
|
15
15
|
setPrependCount: (prependCount: number) => void;
|
|
16
16
|
setAppendCount: (appendCount: number) => void;
|
|
17
17
|
setSelectedNode: (el: HTMLElement) => void;
|
|
18
18
|
isDisabledIndex: (i: number) => boolean;
|
|
19
|
-
notifySelectItem: (data:
|
|
19
|
+
notifySelectItem: (data: I) => void;
|
|
20
20
|
scrollToCenter: (selectedNode: Element, scrollWrapper?: Element, duration?: number) => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export default class ItemFoundation<P = Record<string, any>, S = Record<string, any
|
|
23
|
+
export default class ItemFoundation<P = Record<string, any>, S = Record<string, any>, I = Item> extends BaseFoundation<ScrollItemAdapter<P, S, I>, P, S> {
|
|
24
24
|
_cachedSelectedNode: HTMLElement = null;
|
|
25
25
|
|
|
26
26
|
selectIndex(index: number, listWrapper: HTMLElement) {
|
package/select/foundation.ts
CHANGED
|
@@ -45,8 +45,9 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
45
45
|
updateHovering(isHover: boolean): void;
|
|
46
46
|
updateScrollTop(): void;
|
|
47
47
|
}
|
|
48
|
-
type PropValue = string | number | Record<string, any>;
|
|
49
48
|
|
|
49
|
+
type LabelValue = string | number;
|
|
50
|
+
type PropValue = LabelValue | Record<string, any>;
|
|
50
51
|
export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
51
52
|
|
|
52
53
|
constructor(adapter: SelectAdapter) {
|
|
@@ -258,11 +259,11 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
258
259
|
|
|
259
260
|
// When onChangeWithObject is true
|
|
260
261
|
if (onChangeWithObject && propValueIsArray) {
|
|
261
|
-
selectedValues = propValue.map(
|
|
262
|
+
selectedValues = (propValue as BasicOptionProps[]).map(item => item.value);
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
if (propValueIsArray && selectedValues.length) {
|
|
265
|
-
selectedValues.forEach((selectedValue
|
|
266
|
+
(selectedValues as LabelValue[]).forEach((selectedValue, i: number) => {
|
|
266
267
|
// The current value exists in the current optionList
|
|
267
268
|
const index = originalOptions.findIndex(option => option.value === selectedValue);
|
|
268
269
|
if (index !== -1) {
|
package/select/option.scss
CHANGED
package/select/select.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//@import '../theme/variables.scss';
|
|
2
2
|
@import './variables.scss';
|
|
3
3
|
@import './mixin.scss';
|
|
4
|
+
@import './option.scss';
|
|
4
5
|
|
|
5
6
|
$module: #{$prefix}-select;
|
|
6
7
|
$single: #{$module}-single;
|
|
@@ -418,4 +419,4 @@ $multiple: #{$module}-multiple;
|
|
|
418
419
|
cursor: not-allowed;
|
|
419
420
|
}
|
|
420
421
|
|
|
421
|
-
@import './rtl.scss';
|
|
422
|
+
@import './rtl.scss';
|
package/slider/foundation.ts
CHANGED
|
@@ -79,7 +79,7 @@ export interface SliderAdapter extends DefaultAdapter<SliderProps, SliderState>{
|
|
|
79
79
|
getMinHandleEl: () => { current: HTMLElement };
|
|
80
80
|
getMaxHandleEl: () => { current: HTMLElement };
|
|
81
81
|
onHandleDown: (e: any) => any;
|
|
82
|
-
onHandleMove: (mousePos: number, isMin: boolean, stateChangeCallback?: () => void) => boolean | void;
|
|
82
|
+
onHandleMove: (mousePos: number, isMin: boolean, stateChangeCallback?: () => void, clickTrack?: boolean) => boolean | void;
|
|
83
83
|
setEventDefault: (e: any) => void;
|
|
84
84
|
setStateVal: (state: keyof SliderState, value: any) => void;
|
|
85
85
|
onHandleEnter: (position: SliderState['focusPos']) => void;
|
|
@@ -568,7 +568,7 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
|
|
|
568
568
|
const mousePos = this.handleMousePos(e.pageX, e.pageY);
|
|
569
569
|
const position = vertical ? mousePos.y : mousePos.x;
|
|
570
570
|
const isMin = this.checkWhichHandle(position);
|
|
571
|
-
this.setHandlePos(position, isMin);
|
|
571
|
+
this.setHandlePos(position, isMin, true);
|
|
572
572
|
};
|
|
573
573
|
|
|
574
574
|
/**
|
|
@@ -576,8 +576,8 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
|
|
|
576
576
|
*
|
|
577
577
|
* @memberof SliderFoundation
|
|
578
578
|
*/
|
|
579
|
-
setHandlePos = (position: number, isMin: boolean) => {
|
|
580
|
-
this._adapter.onHandleMove(position, isMin, () => this._adapter.onHandleUpAfter());
|
|
579
|
+
setHandlePos = (position: number, isMin: boolean, clickTrack = false) => {
|
|
580
|
+
this._adapter.onHandleMove(position, isMin, () => this._adapter.onHandleUpAfter(), clickTrack);
|
|
581
581
|
};
|
|
582
582
|
|
|
583
583
|
/**
|
package/table/utils.ts
CHANGED
|
@@ -13,10 +13,13 @@ import {
|
|
|
13
13
|
findIndex,
|
|
14
14
|
some,
|
|
15
15
|
includes,
|
|
16
|
-
toString
|
|
16
|
+
toString,
|
|
17
|
+
isFunction
|
|
17
18
|
} from 'lodash-es';
|
|
18
19
|
import { strings, numbers } from './constants';
|
|
19
20
|
import isNullOrUndefined from '../utils/isNullOrUndefined';
|
|
21
|
+
import Logger from '../utils/Logger';
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
export function cloneDeep(value: any, customizer?: (v: any) => any) {
|
|
22
25
|
return cloneDeepWith(value, v => {
|
|
@@ -163,7 +166,7 @@ export function isSelectionColumn(column: Record<string, any>) {
|
|
|
163
166
|
return get(column, 'key') === strings.DEFAULT_KEY_COLUMN_SELECTION;
|
|
164
167
|
}
|
|
165
168
|
|
|
166
|
-
export function filterColumns(columns: Record<string, any>[], ignoreKeys = [strings.DEFAULT_KEY_COLUMN_SCROLLBAR]) {
|
|
169
|
+
export function filterColumns(columns: Record<string, any>[], ignoreKeys = [strings.DEFAULT_KEY_COLUMN_SCROLLBAR as string]) {
|
|
167
170
|
return filter(columns, col => !ignoreKeys.includes(col.key));
|
|
168
171
|
}
|
|
169
172
|
|
|
@@ -265,6 +268,7 @@ export function flattenColumns(cols: Record<string, any>[], childrenColumnName =
|
|
|
265
268
|
if (Array.isArray(col[childrenColumnName]) && col[childrenColumnName].length) {
|
|
266
269
|
list.push(...flattenColumns(col[childrenColumnName], childrenColumnName));
|
|
267
270
|
} else {
|
|
271
|
+
warnIfNoDataIndex(col);
|
|
268
272
|
list.push(col);
|
|
269
273
|
}
|
|
270
274
|
}
|
|
@@ -470,4 +474,14 @@ export interface GetAllDisabledRowKeysProps {
|
|
|
470
474
|
getCheckboxProps: (record?: Record<string, any>) => any;
|
|
471
475
|
childrenRecordName?: string;
|
|
472
476
|
rowKey?: string | number | ((record: Record<string, any>) => string | number);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export function warnIfNoDataIndex(column: Record<string, any>) {
|
|
480
|
+
if (typeof column === 'object' && column !== null) {
|
|
481
|
+
const { filters, sorter, dataIndex } = column;
|
|
482
|
+
const logger = new Logger('[@douyinfe/semi-ui Table]');
|
|
483
|
+
if ((Array.isArray(filters) || isFunction(sorter)) && isNullOrUndefined(dataIndex) ) {
|
|
484
|
+
logger.warn(`The column with sorter or filter must pass the 'dataIndex' prop`);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
473
487
|
}
|
package/tabs/foundation.ts
CHANGED
|
@@ -20,12 +20,19 @@ class TabsFoundation<P = Record<string, any>, S = Record<string, any>> extends B
|
|
|
20
20
|
|
|
21
21
|
destroy = noop;
|
|
22
22
|
|
|
23
|
+
_notifyChange(activeKey: string): void {
|
|
24
|
+
const { activeKey: stateActiveKey } = this.getStates();
|
|
25
|
+
if (stateActiveKey !== activeKey) {
|
|
26
|
+
this._adapter.notifyChange(activeKey);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
handleTabClick(activeKey: string, event: any): void {
|
|
24
31
|
const isControledComponent = this._isInProps('activeKey');
|
|
25
32
|
if (isControledComponent) {
|
|
26
|
-
this.
|
|
33
|
+
this._notifyChange(activeKey);
|
|
27
34
|
} else {
|
|
28
|
-
this.
|
|
35
|
+
this._notifyChange(activeKey);
|
|
29
36
|
this.handleNewActiveKey(activeKey);
|
|
30
37
|
}
|
|
31
38
|
this._adapter.notifyTabClick(activeKey, event);
|
package/treeSelect/foundation.ts
CHANGED
|
@@ -127,7 +127,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps,
|
|
|
127
127
|
searchRender?: (inputProps: any) => any;
|
|
128
128
|
renderSelectedItem?: BasicRenderSelectedItem;
|
|
129
129
|
getPopupContainer?: () => HTMLElement;
|
|
130
|
-
triggerRender?: (props: BasicTriggerRenderProps) => any;
|
|
130
|
+
// triggerRender?: (props: BasicTriggerRenderProps) => any;
|
|
131
131
|
onBlur?: (e: any) => void;
|
|
132
132
|
onChange?: BasicOnChange;
|
|
133
133
|
onFocus?: (e: any) => void;
|