@douyinfe/semi-foundation 2.31.2 → 2.32.0-beta.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/cascader/foundation.ts +8 -1
- package/datePicker/_utils/getDefaultFormatToken.ts +1 -0
- package/datePicker/_utils/getInsetInputFormatToken.ts +1 -0
- package/datePicker/_utils/getInsetInputValueFromInsetInputStr.ts +1 -0
- package/datePicker/constants.ts +1 -1
- package/datePicker/datePicker.scss +33 -6
- package/datePicker/foundation.ts +132 -74
- package/datePicker/inputFoundation.ts +8 -2
- package/datePicker/variables.scss +6 -4
- package/datePicker/yearAndMonthFoundation.ts +65 -18
- package/lib/cjs/cascader/foundation.d.ts +2 -0
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +2 -1
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +1 -0
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +1 -0
- package/lib/cjs/datePicker/constants.d.ts +1 -1
- package/lib/cjs/datePicker/constants.js +1 -1
- package/lib/cjs/datePicker/datePicker.css +29 -11
- package/lib/cjs/datePicker/datePicker.scss +33 -6
- package/lib/cjs/datePicker/foundation.d.ts +34 -6
- package/lib/cjs/datePicker/foundation.js +145 -69
- package/lib/cjs/datePicker/inputFoundation.d.ts +1 -1
- package/lib/cjs/datePicker/inputFoundation.js +13 -1
- package/lib/cjs/datePicker/variables.scss +6 -4
- package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +66 -13
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +55 -14
- package/lib/cjs/modal/modal.css +1 -0
- package/lib/cjs/modal/modal.scss +1 -0
- package/lib/cjs/modal/variables.scss +1 -0
- package/lib/cjs/sideSheet/sideSheet.css +10 -0
- package/lib/cjs/sideSheet/sideSheet.scss +15 -0
- package/lib/cjs/sideSheet/variables.scss +6 -0
- package/lib/cjs/switch/foundation.js +0 -3
- package/lib/cjs/treeSelect/foundation.d.ts +3 -0
- package/lib/cjs/treeSelect/foundation.js +3 -2
- package/lib/es/cascader/foundation.d.ts +2 -0
- package/lib/es/datePicker/_utils/getDefaultFormatToken.d.ts +1 -0
- package/lib/es/datePicker/_utils/getDefaultFormatToken.js +2 -1
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +1 -0
- package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +1 -0
- package/lib/es/datePicker/constants.d.ts +1 -1
- package/lib/es/datePicker/constants.js +1 -1
- package/lib/es/datePicker/datePicker.css +29 -11
- package/lib/es/datePicker/datePicker.scss +33 -6
- package/lib/es/datePicker/foundation.d.ts +34 -6
- package/lib/es/datePicker/foundation.js +145 -69
- package/lib/es/datePicker/inputFoundation.d.ts +1 -1
- package/lib/es/datePicker/inputFoundation.js +13 -1
- package/lib/es/datePicker/variables.scss +6 -4
- package/lib/es/datePicker/yearAndMonthFoundation.d.ts +66 -13
- package/lib/es/datePicker/yearAndMonthFoundation.js +58 -14
- package/lib/es/modal/modal.css +1 -0
- package/lib/es/modal/modal.scss +1 -0
- package/lib/es/modal/variables.scss +1 -0
- package/lib/es/sideSheet/sideSheet.css +10 -0
- package/lib/es/sideSheet/sideSheet.scss +15 -0
- package/lib/es/sideSheet/variables.scss +6 -0
- package/lib/es/switch/foundation.js +0 -3
- package/lib/es/treeSelect/foundation.d.ts +3 -0
- package/lib/es/treeSelect/foundation.js +3 -2
- package/modal/modal.scss +1 -0
- package/modal/variables.scss +1 -0
- package/package.json +2 -2
- package/sideSheet/sideSheet.scss +15 -0
- package/sideSheet/variables.scss +6 -0
- package/switch/foundation.ts +2 -3
- package/treeSelect/foundation.ts +6 -3
|
@@ -76,12 +76,22 @@
|
|
|
76
76
|
align-items: flex-start;
|
|
77
77
|
padding: 24px;
|
|
78
78
|
padding-bottom: 20px;
|
|
79
|
+
border-bottom: 0px solid var(--semi-color-border);
|
|
79
80
|
}
|
|
80
81
|
.semi-sidesheet-body {
|
|
81
82
|
padding: 0 24px;
|
|
82
83
|
flex: 1;
|
|
83
84
|
overflow: auto;
|
|
84
85
|
}
|
|
86
|
+
.semi-sidesheet-size-small {
|
|
87
|
+
width: 448px;
|
|
88
|
+
}
|
|
89
|
+
.semi-sidesheet-size-medium {
|
|
90
|
+
width: 684px;
|
|
91
|
+
}
|
|
92
|
+
.semi-sidesheet-size-large {
|
|
93
|
+
width: 920px;
|
|
94
|
+
}
|
|
85
95
|
.semi-sidesheet-content {
|
|
86
96
|
height: 100%;
|
|
87
97
|
display: flex;
|
|
@@ -95,6 +95,7 @@ $module: #{$prefix}-sidesheet;
|
|
|
95
95
|
align-items: flex-start;
|
|
96
96
|
padding: $spacing-sideSheet_header-padding;
|
|
97
97
|
padding-bottom: $spacing-sideSheet_header-paddingBottom;
|
|
98
|
+
border-bottom: $width-sideSheet_header-borderBottom solid $color-sideSheet_header-borderBottom;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
&-body {
|
|
@@ -103,6 +104,20 @@ $module: #{$prefix}-sidesheet;
|
|
|
103
104
|
overflow: auto;
|
|
104
105
|
}
|
|
105
106
|
|
|
107
|
+
&-size-small {
|
|
108
|
+
width: $width-sideSheet_size-small;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&-size-medium {
|
|
112
|
+
width: $width-sideSheet_size-medium;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&-size-large {
|
|
116
|
+
width: $width-sideSheet_size-large;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
106
121
|
&-content {
|
|
107
122
|
height: 100%;
|
|
108
123
|
display: flex;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
$color-sideSheet_mask-bg: var(--semi-color-overlay-bg); // 侧边栏打开后蒙层颜色
|
|
3
3
|
$color-sideSheet-bg: var(--semi-color-bg-2); // 侧边栏背景颜色
|
|
4
4
|
$color-sideSheet_main-text: var(--semi-color-text-0); // 侧边栏默认文本颜色
|
|
5
|
+
$color-sideSheet_header-borderBottom: var(--semi-color-border); // 侧边栏 header 底部边框颜色
|
|
5
6
|
|
|
6
7
|
// Spacing
|
|
7
8
|
$spacing-sideSheet-margin: 0; // 侧边栏整体外边距
|
|
@@ -12,6 +13,11 @@ $spacing-sideSheet_body-paddingY: 0; // 侧边栏 body 垂直内边距
|
|
|
12
13
|
$spacing-sideSheet_body-paddingX: $spacing-loose; // 侧边栏 body 水平内边距
|
|
13
14
|
$spacing-sideSheet_footer-padding: $spacing-loose; // 侧边栏 footer 内边距
|
|
14
15
|
|
|
16
|
+
$width-sideSheet_header-borderBottom: 0px; // 侧边栏 header 底部边框宽度
|
|
17
|
+
$width-sideSheet_size-small: 448px; // 小尺寸侧边栏宽度
|
|
18
|
+
$width-sideSheet_size-medium: 684px; // 中尺寸侧边栏宽度
|
|
19
|
+
$width-sideSheet_size-large: 920px; // 大尺寸侧边栏宽度
|
|
20
|
+
|
|
15
21
|
// Font
|
|
16
22
|
$font-sideSheet_title-fontWeight: $font-weight-bold; // 侧边栏标题文本字重
|
|
17
23
|
$font-sideSheet_title-fontSize: $font-size-header-5; // 侧边栏标题文本字号
|
|
@@ -20,6 +20,8 @@ export interface BasicTriggerRenderProps {
|
|
|
20
20
|
placeholder: string;
|
|
21
21
|
value: BasicTreeNodeData[];
|
|
22
22
|
onClear: (e: any) => void;
|
|
23
|
+
onSearch: (inputValue: string) => void;
|
|
24
|
+
onRemove: (value: string) => void;
|
|
23
25
|
}
|
|
24
26
|
export declare type BasicOnChangeWithObject = (node: BasicTreeNodeData[] | BasicTreeNodeData, e: any) => void;
|
|
25
27
|
export declare type BasicOnChangeWithBasic = (value: BasicTreeNodeData['value'], node: BasicTreeNodeData[] | BasicTreeNodeData, e: any) => void;
|
|
@@ -59,6 +61,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
|
|
|
59
61
|
loadedKeys?: string[];
|
|
60
62
|
showRestTagsPopover?: boolean;
|
|
61
63
|
restTagsPopoverProps?: any;
|
|
64
|
+
clickTriggerToHide?: boolean;
|
|
62
65
|
loadData?: (data: BasicTreeNodeData) => Promise<void>;
|
|
63
66
|
onSelect?: (selectedKeys: string, selected: boolean, selectedNode: BasicTreeNodeData) => void;
|
|
64
67
|
searchRender?: (inputProps: any) => any;
|
|
@@ -365,7 +365,8 @@ export default class TreeSelectFoundation extends BaseFoundation {
|
|
|
365
365
|
isFocus
|
|
366
366
|
} = this.getStates();
|
|
367
367
|
const {
|
|
368
|
-
searchPosition
|
|
368
|
+
searchPosition,
|
|
369
|
+
clickTriggerToHide
|
|
369
370
|
} = this.getProps();
|
|
370
371
|
|
|
371
372
|
if (isDisabled) {
|
|
@@ -380,7 +381,7 @@ export default class TreeSelectFoundation extends BaseFoundation {
|
|
|
380
381
|
return;
|
|
381
382
|
}
|
|
382
383
|
|
|
383
|
-
this.close(e);
|
|
384
|
+
clickTriggerToHide && this.close(e);
|
|
384
385
|
} else {
|
|
385
386
|
this.open();
|
|
386
387
|
}
|
package/modal/modal.scss
CHANGED
package/modal/variables.scss
CHANGED
|
@@ -43,6 +43,7 @@ $spacing-modal_footer_button-marginLeft: $spacing-base-tight; // 模态框 foote
|
|
|
43
43
|
$spacing-modal_footer_button-marginRight: 0; // 模态框 footer 按钮右侧外边距
|
|
44
44
|
$spacing-modal_confirm_header-marginBottom: 8px; // 命令式调用模态框 header 底部外边距
|
|
45
45
|
$spacing-modal_confirm_icon_wrapper-marginRight: $spacing-base-tight; // 命令式调用模态框图标右侧外边距
|
|
46
|
+
$spacing-modal_content_fullscreen-top: 0px; // 模态框内容全屏顶部位置
|
|
46
47
|
|
|
47
48
|
// Width/Height
|
|
48
49
|
$width-modal_title: 100%; // 模态框标题宽度
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"*.scss",
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "335f8c47c40373ee1464c841581130e62b62b1d5",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
29
29
|
"@babel/preset-env": "^7.15.8",
|
package/sideSheet/sideSheet.scss
CHANGED
|
@@ -95,6 +95,7 @@ $module: #{$prefix}-sidesheet;
|
|
|
95
95
|
align-items: flex-start;
|
|
96
96
|
padding: $spacing-sideSheet_header-padding;
|
|
97
97
|
padding-bottom: $spacing-sideSheet_header-paddingBottom;
|
|
98
|
+
border-bottom: $width-sideSheet_header-borderBottom solid $color-sideSheet_header-borderBottom;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
&-body {
|
|
@@ -103,6 +104,20 @@ $module: #{$prefix}-sidesheet;
|
|
|
103
104
|
overflow: auto;
|
|
104
105
|
}
|
|
105
106
|
|
|
107
|
+
&-size-small {
|
|
108
|
+
width: $width-sideSheet_size-small;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&-size-medium {
|
|
112
|
+
width: $width-sideSheet_size-medium;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&-size-large {
|
|
116
|
+
width: $width-sideSheet_size-large;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
106
121
|
&-content {
|
|
107
122
|
height: 100%;
|
|
108
123
|
display: flex;
|
package/sideSheet/variables.scss
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
$color-sideSheet_mask-bg: var(--semi-color-overlay-bg); // 侧边栏打开后蒙层颜色
|
|
3
3
|
$color-sideSheet-bg: var(--semi-color-bg-2); // 侧边栏背景颜色
|
|
4
4
|
$color-sideSheet_main-text: var(--semi-color-text-0); // 侧边栏默认文本颜色
|
|
5
|
+
$color-sideSheet_header-borderBottom: var(--semi-color-border); // 侧边栏 header 底部边框颜色
|
|
5
6
|
|
|
6
7
|
// Spacing
|
|
7
8
|
$spacing-sideSheet-margin: 0; // 侧边栏整体外边距
|
|
@@ -12,6 +13,11 @@ $spacing-sideSheet_body-paddingY: 0; // 侧边栏 body 垂直内边距
|
|
|
12
13
|
$spacing-sideSheet_body-paddingX: $spacing-loose; // 侧边栏 body 水平内边距
|
|
13
14
|
$spacing-sideSheet_footer-padding: $spacing-loose; // 侧边栏 footer 内边距
|
|
14
15
|
|
|
16
|
+
$width-sideSheet_header-borderBottom: 0px; // 侧边栏 header 底部边框宽度
|
|
17
|
+
$width-sideSheet_size-small: 448px; // 小尺寸侧边栏宽度
|
|
18
|
+
$width-sideSheet_size-medium: 684px; // 中尺寸侧边栏宽度
|
|
19
|
+
$width-sideSheet_size-large: 920px; // 大尺寸侧边栏宽度
|
|
20
|
+
|
|
15
21
|
// Font
|
|
16
22
|
$font-sideSheet_title-fontWeight: $font-weight-bold; // 侧边栏标题文本字重
|
|
17
23
|
$font-sideSheet_title-fontSize: $font-size-header-5; // 侧边栏标题文本字号
|
package/switch/foundation.ts
CHANGED
|
@@ -15,8 +15,7 @@ export default class SwitchFoundation<P = Record<string, any>, S = Record<string
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
init(): void {
|
|
18
|
-
const {
|
|
19
|
-
this.setChecked(defaultChecked || checked);
|
|
18
|
+
const { disabled } = this.getProps();
|
|
20
19
|
this.setDisabled(disabled);
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -45,7 +44,7 @@ export default class SwitchFoundation<P = Record<string, any>, S = Record<string
|
|
|
45
44
|
if (target.matches(':focus-visible')) {
|
|
46
45
|
this._adapter.setFocusVisible(true);
|
|
47
46
|
}
|
|
48
|
-
} catch (error){
|
|
47
|
+
} catch (error) {
|
|
49
48
|
warning(true, 'Warning: [Semi Switch] The current browser does not support the focus-visible');
|
|
50
49
|
}
|
|
51
50
|
}
|
package/treeSelect/foundation.ts
CHANGED
|
@@ -47,7 +47,9 @@ export interface BasicTriggerRenderProps {
|
|
|
47
47
|
inputValue: string;
|
|
48
48
|
placeholder: string;
|
|
49
49
|
value: BasicTreeNodeData[];
|
|
50
|
-
onClear: (e: any) => void
|
|
50
|
+
onClear: (e: any) => void;
|
|
51
|
+
onSearch: (inputValue: string) => void;
|
|
52
|
+
onRemove: (value: string) => void
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export type BasicOnChangeWithObject = (node: BasicTreeNodeData[] | BasicTreeNodeData, e: any) => void;
|
|
@@ -128,6 +130,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps,
|
|
|
128
130
|
loadedKeys?: string[];
|
|
129
131
|
showRestTagsPopover?: boolean;
|
|
130
132
|
restTagsPopoverProps?: any;
|
|
133
|
+
clickTriggerToHide?: boolean;
|
|
131
134
|
loadData?: (data: BasicTreeNodeData) => Promise<void>;
|
|
132
135
|
onSelect?: (selectedKeys: string, selected: boolean, selectedNode: BasicTreeNodeData) => void;
|
|
133
136
|
searchRender?: (inputProps: any) => any;
|
|
@@ -481,7 +484,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
481
484
|
handleClick(e: any) {
|
|
482
485
|
const isDisabled = this._isDisabled();
|
|
483
486
|
const { isOpen, inputValue, isFocus } = this.getStates();
|
|
484
|
-
const { searchPosition } = this.getProps();
|
|
487
|
+
const { searchPosition, clickTriggerToHide } = this.getProps();
|
|
485
488
|
if (isDisabled) {
|
|
486
489
|
return;
|
|
487
490
|
} else {
|
|
@@ -492,7 +495,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
492
495
|
if (searchPosition === 'trigger' && inputValue) {
|
|
493
496
|
return;
|
|
494
497
|
}
|
|
495
|
-
this.close(e);
|
|
498
|
+
clickTriggerToHide && this.close(e);
|
|
496
499
|
} else {
|
|
497
500
|
this.open();
|
|
498
501
|
}
|