@douyinfe/semi-foundation 2.62.0-beta.0 → 2.62.1

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.
@@ -7,7 +7,7 @@ export interface CarouselAdapter<P = Record<string, any>, S = Record<string, any
7
7
  setNewActiveIndex: (activeIndex: number) => void;
8
8
  setPreActiveIndex: (activeIndex: number) => void;
9
9
  setIsReverse: (isReverse: boolean) => void;
10
- setIsInit: (isInit: boolean) => void;
10
+ setIsInit: (isInit: boolean) => void
11
11
  }
12
12
 
13
13
  class CarouselFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<CarouselAdapter<P, S>, P, S> {
@@ -124,9 +124,11 @@ class CarouselFoundation<P = Record<string, any>, S = Record<string, any>> exten
124
124
 
125
125
  handleAutoPlay(): void {
126
126
  const { autoPlay } = this.getProps();
127
+ const { children } = this.getStates();
127
128
  const autoPlayType = typeof autoPlay;
128
129
  // when user manually call the play function, force play
129
- if ((autoPlayType === 'boolean' && autoPlay) || isObject(autoPlay) || this._forcePlay) {
130
+ // only when carousel children length > 1 to start play
131
+ if (children.length > 1 && ((autoPlay === true) || isObject(autoPlay) || this._forcePlay)) {
130
132
  this.play(this.getSwitchingTime());
131
133
  }
132
134
  }
@@ -123,9 +123,13 @@ class CarouselFoundation extends _foundation.default {
123
123
  const {
124
124
  autoPlay
125
125
  } = this.getProps();
126
+ const {
127
+ children
128
+ } = this.getStates();
126
129
  const autoPlayType = typeof autoPlay;
127
130
  // when user manually call the play function, force play
128
- if (autoPlayType === 'boolean' && autoPlay || (0, _isObject2.default)(autoPlay) || this._forcePlay) {
131
+ // only when carousel children length > 1 to start play
132
+ if (children.length > 1 && (autoPlay === true || (0, _isObject2.default)(autoPlay) || this._forcePlay)) {
129
133
  this.play(this.getSwitchingTime());
130
134
  }
131
135
  }
@@ -34,7 +34,7 @@ export interface SliderProps {
34
34
  handleDot?: {
35
35
  size?: string;
36
36
  color?: string;
37
- } & ({
37
+ } | ({
38
38
  size?: string;
39
39
  color?: string;
40
40
  }[]);
@@ -441,7 +441,6 @@
441
441
  text-align: center;
442
442
  background: transparent;
443
443
  border-bottom: 1px solid var(--semi-color-border);
444
- border-radius: 0 0 4px 4px;
445
444
  }
446
445
  .semi-table-fixed {
447
446
  table-layout: fixed;
@@ -541,7 +541,6 @@ $module: #{$prefix}-table;
541
541
  text-align: center;
542
542
  background: $color-table_pl-bg-default;
543
543
  border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
544
- border-radius: 0 0 #{$radius-table_base} #{$radius-table_base};
545
544
  }
546
545
 
547
546
  &-fixed {
@@ -32,7 +32,7 @@ $spacing-table_panel_operation-paddingY: $spacing-tight;
32
32
  $width-table_base_border: 1px; // 表格单元格分割线宽度
33
33
  $width-table_header_border: 2px; // 表格表头分割线宽度
34
34
  $width-table_resizer_border: 2px; // 表格拉伸列标示线宽度
35
- $radius-table_base: 4px;
35
+ // $radius-table_base: 4px;
36
36
  $width-table_column_selection: 48px; // 表格默认列宽
37
37
  $width-table_column_sorter-icon: 16px; // 表格排序按钮宽度
38
38
  $height-table_column_sorter-icon: 16px; // 表格排序按钮高度
@@ -107,8 +107,6 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
107
107
  updateInputFocus: (bool: boolean) => void;
108
108
  updateLoadKeys: (data: BasicTreeNodeData, resolve: (value?: any) => void) => void;
109
109
  updateIsFocus: (bool: boolean) => void;
110
- setClearInputFlag: (flag: boolean) => void;
111
- getClearInputFlag: () => boolean;
112
110
  }
113
111
  export default class TreeSelectFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TreeSelectAdapter<P, S>, P, S> {
114
112
  constructor(adapter: TreeSelectAdapter<P, S>);
@@ -164,7 +162,9 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
164
162
  handleSingleSelect(e: any, treeNode: BasicTreeNodeProps): void;
165
163
  calcCheckedKeys(eventKey: BasicTreeNodeProps['eventKey'], targetStatus: boolean): {
166
164
  checkedKeys: Set<string>;
167
- halfCheckedKeys: Set<string>;
165
+ halfCheckedKeys: Set<string>; /**
166
+ * A11y: simulate selection click
167
+ */
168
168
  };
169
169
  handleMultipleSelect(e: any, treeNode: BasicTreeNodeProps): void;
170
170
  calcNonDisabledCheckedKeys(eventKey: string, targetStatus: boolean): {
@@ -794,8 +794,7 @@ class TreeSelectFoundation extends _foundation.default {
794
794
  * When the search box is on the trigger, the focus event processing method
795
795
  */
796
796
  handleInputTriggerFocus() {
797
- const inputValue = this.getState('inputValue');
798
- inputValue && this.clearInput();
797
+ this.clearInput();
799
798
  this._adapter.updateState({
800
799
  inputTriggerFocus: true
801
800
  });
@@ -809,11 +808,9 @@ class TreeSelectFoundation extends _foundation.default {
809
808
  searchAutoFocus,
810
809
  searchPosition
811
810
  } = this.getProps();
812
- const inputValue = this.getState('inputValue');
813
811
  // 将 inputValue 清空,如果有选中值的话,选中项能够快速回显
814
812
  // Clear the inputValue. If there is a selected value, the selected item can be quickly echoed.
815
813
  if (isVisible === false && filterTreeNode) {
816
- inputValue && this._adapter.setClearInputFlag(true);
817
814
  this.clearInputValue();
818
815
  }
819
816
  if (filterTreeNode && searchPosition === _constants.strings.SEARCH_POSITION_DROPDOWN && isVisible && searchAutoFocus) {
@@ -830,8 +827,7 @@ class TreeSelectFoundation extends _foundation.default {
830
827
  const {
831
828
  filterTreeNode
832
829
  } = this.getProps();
833
- const shouldClear = this._adapter.getClearInputFlag();
834
- filterTreeNode && shouldClear && this.clearInput();
830
+ filterTreeNode && this.clearInput();
835
831
  }
836
832
  }
837
833
  exports.default = TreeSelectFoundation;
@@ -291,6 +291,10 @@
291
291
  object-fit: cover;
292
292
  border-radius: var(--semi-border-radius-small);
293
293
  }
294
+ .semi-upload-picture-file-card-custom-thumbnail .semi-image img {
295
+ width: inherit;
296
+ height: inherit;
297
+ }
294
298
  .semi-upload-picture-file-card-close {
295
299
  visibility: hidden;
296
300
  display: inline-flex;
@@ -358,6 +358,15 @@ $module: #{$prefix}-upload;
358
358
  border-radius: $radius-upload_picture_file_card_img;
359
359
  }
360
360
 
361
+ &-custom-thumbnail {
362
+ .#{$prefix}-image {
363
+ img {
364
+ width: inherit;
365
+ height: inherit;
366
+ }
367
+ }
368
+ }
369
+
361
370
  &-close {
362
371
  visibility: hidden;
363
372
  display: inline-flex;
@@ -116,9 +116,13 @@ class CarouselFoundation extends BaseFoundation {
116
116
  const {
117
117
  autoPlay
118
118
  } = this.getProps();
119
+ const {
120
+ children
121
+ } = this.getStates();
119
122
  const autoPlayType = typeof autoPlay;
120
123
  // when user manually call the play function, force play
121
- if (autoPlayType === 'boolean' && autoPlay || _isObject(autoPlay) || this._forcePlay) {
124
+ // only when carousel children length > 1 to start play
125
+ if (children.length > 1 && (autoPlay === true || _isObject(autoPlay) || this._forcePlay)) {
122
126
  this.play(this.getSwitchingTime());
123
127
  }
124
128
  }
@@ -34,7 +34,7 @@ export interface SliderProps {
34
34
  handleDot?: {
35
35
  size?: string;
36
36
  color?: string;
37
- } & ({
37
+ } | ({
38
38
  size?: string;
39
39
  color?: string;
40
40
  }[]);
@@ -441,7 +441,6 @@
441
441
  text-align: center;
442
442
  background: transparent;
443
443
  border-bottom: 1px solid var(--semi-color-border);
444
- border-radius: 0 0 4px 4px;
445
444
  }
446
445
  .semi-table-fixed {
447
446
  table-layout: fixed;
@@ -541,7 +541,6 @@ $module: #{$prefix}-table;
541
541
  text-align: center;
542
542
  background: $color-table_pl-bg-default;
543
543
  border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
544
- border-radius: 0 0 #{$radius-table_base} #{$radius-table_base};
545
544
  }
546
545
 
547
546
  &-fixed {
@@ -32,7 +32,7 @@ $spacing-table_panel_operation-paddingY: $spacing-tight;
32
32
  $width-table_base_border: 1px; // 表格单元格分割线宽度
33
33
  $width-table_header_border: 2px; // 表格表头分割线宽度
34
34
  $width-table_resizer_border: 2px; // 表格拉伸列标示线宽度
35
- $radius-table_base: 4px;
35
+ // $radius-table_base: 4px;
36
36
  $width-table_column_selection: 48px; // 表格默认列宽
37
37
  $width-table_column_sorter-icon: 16px; // 表格排序按钮宽度
38
38
  $height-table_column_sorter-icon: 16px; // 表格排序按钮高度
@@ -107,8 +107,6 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
107
107
  updateInputFocus: (bool: boolean) => void;
108
108
  updateLoadKeys: (data: BasicTreeNodeData, resolve: (value?: any) => void) => void;
109
109
  updateIsFocus: (bool: boolean) => void;
110
- setClearInputFlag: (flag: boolean) => void;
111
- getClearInputFlag: () => boolean;
112
110
  }
113
111
  export default class TreeSelectFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TreeSelectAdapter<P, S>, P, S> {
114
112
  constructor(adapter: TreeSelectAdapter<P, S>);
@@ -164,7 +162,9 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
164
162
  handleSingleSelect(e: any, treeNode: BasicTreeNodeProps): void;
165
163
  calcCheckedKeys(eventKey: BasicTreeNodeProps['eventKey'], targetStatus: boolean): {
166
164
  checkedKeys: Set<string>;
167
- halfCheckedKeys: Set<string>;
165
+ halfCheckedKeys: Set<string>; /**
166
+ * A11y: simulate selection click
167
+ */
168
168
  };
169
169
  handleMultipleSelect(e: any, treeNode: BasicTreeNodeProps): void;
170
170
  calcNonDisabledCheckedKeys(eventKey: string, targetStatus: boolean): {
@@ -787,8 +787,7 @@ export default class TreeSelectFoundation extends BaseFoundation {
787
787
  * When the search box is on the trigger, the focus event processing method
788
788
  */
789
789
  handleInputTriggerFocus() {
790
- const inputValue = this.getState('inputValue');
791
- inputValue && this.clearInput();
790
+ this.clearInput();
792
791
  this._adapter.updateState({
793
792
  inputTriggerFocus: true
794
793
  });
@@ -802,11 +801,9 @@ export default class TreeSelectFoundation extends BaseFoundation {
802
801
  searchAutoFocus,
803
802
  searchPosition
804
803
  } = this.getProps();
805
- const inputValue = this.getState('inputValue');
806
804
  // 将 inputValue 清空,如果有选中值的话,选中项能够快速回显
807
805
  // Clear the inputValue. If there is a selected value, the selected item can be quickly echoed.
808
806
  if (isVisible === false && filterTreeNode) {
809
- inputValue && this._adapter.setClearInputFlag(true);
810
807
  this.clearInputValue();
811
808
  }
812
809
  if (filterTreeNode && searchPosition === strings.SEARCH_POSITION_DROPDOWN && isVisible && searchAutoFocus) {
@@ -823,7 +820,6 @@ export default class TreeSelectFoundation extends BaseFoundation {
823
820
  const {
824
821
  filterTreeNode
825
822
  } = this.getProps();
826
- const shouldClear = this._adapter.getClearInputFlag();
827
- filterTreeNode && shouldClear && this.clearInput();
823
+ filterTreeNode && this.clearInput();
828
824
  }
829
825
  }
@@ -291,6 +291,10 @@
291
291
  object-fit: cover;
292
292
  border-radius: var(--semi-border-radius-small);
293
293
  }
294
+ .semi-upload-picture-file-card-custom-thumbnail .semi-image img {
295
+ width: inherit;
296
+ height: inherit;
297
+ }
294
298
  .semi-upload-picture-file-card-close {
295
299
  visibility: hidden;
296
300
  display: inline-flex;
@@ -358,6 +358,15 @@ $module: #{$prefix}-upload;
358
358
  border-radius: $radius-upload_picture_file_card_img;
359
359
  }
360
360
 
361
+ &-custom-thumbnail {
362
+ .#{$prefix}-image {
363
+ img {
364
+ width: inherit;
365
+ height: inherit;
366
+ }
367
+ }
368
+ }
369
+
361
370
  &-close {
362
371
  visibility: hidden;
363
372
  display: inline-flex;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.62.0-beta.0",
3
+ "version": "2.62.1",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.62.0-beta.0",
10
+ "@douyinfe/semi-animation": "2.62.1",
11
11
  "@mdx-js/mdx": "^3.0.1",
12
12
  "async-validator": "^3.5.0",
13
13
  "classnames": "^2.2.6",
@@ -28,7 +28,7 @@
28
28
  "*.scss",
29
29
  "*.css"
30
30
  ],
31
- "gitHead": "aa6b83e5efc6705625be251749aa45a182c5eac3",
31
+ "gitHead": "99b473508df61ea87098d68db7d0d8a07c8c42b8",
32
32
  "devDependencies": {
33
33
  "@babel/plugin-transform-runtime": "^7.15.8",
34
34
  "@babel/preset-env": "^7.15.8",
@@ -40,7 +40,7 @@ export interface SliderProps{
40
40
  handleDot?: {
41
41
  size?: string;
42
42
  color?: string
43
- } & ({
43
+ } | ({
44
44
  size?: string;
45
45
  color?: string
46
46
  }[])
package/table/table.scss CHANGED
@@ -541,7 +541,6 @@ $module: #{$prefix}-table;
541
541
  text-align: center;
542
542
  background: $color-table_pl-bg-default;
543
543
  border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
544
- border-radius: 0 0 #{$radius-table_base} #{$radius-table_base};
545
544
  }
546
545
 
547
546
  &-fixed {
@@ -32,7 +32,7 @@ $spacing-table_panel_operation-paddingY: $spacing-tight;
32
32
  $width-table_base_border: 1px; // 表格单元格分割线宽度
33
33
  $width-table_header_border: 2px; // 表格表头分割线宽度
34
34
  $width-table_resizer_border: 2px; // 表格拉伸列标示线宽度
35
- $radius-table_base: 4px;
35
+ // $radius-table_base: 4px;
36
36
  $width-table_column_selection: 48px; // 表格默认列宽
37
37
  $width-table_column_sorter-icon: 16px; // 表格排序按钮宽度
38
38
  $height-table_column_sorter-icon: 16px; // 表格排序按钮高度
@@ -200,9 +200,7 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
200
200
  notifyLoad: (newLoadedKeys: Set<string>, data: BasicTreeNodeData) => void;
201
201
  updateInputFocus: (bool: boolean) => void;
202
202
  updateLoadKeys: (data: BasicTreeNodeData, resolve: (value?: any) => void) => void;
203
- updateIsFocus: (bool: boolean) => void;
204
- setClearInputFlag: (flag: boolean) => void;
205
- getClearInputFlag: () => boolean
203
+ updateIsFocus: (bool: boolean) => void
206
204
  }
207
205
 
208
206
  export default class TreeSelectFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TreeSelectAdapter<P, S>, P, S> {
@@ -895,8 +893,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
895
893
  * When the search box is on the trigger, the focus event processing method
896
894
  */
897
895
  handleInputTriggerFocus() {
898
- const inputValue = this.getState('inputValue');
899
- inputValue && this.clearInput();
896
+ this.clearInput();
900
897
  this._adapter.updateState({
901
898
  inputTriggerFocus: true
902
899
  });
@@ -908,11 +905,9 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
908
905
 
909
906
  handlePopoverVisibleChange(isVisible: boolean) {
910
907
  const { filterTreeNode, searchAutoFocus, searchPosition } = this.getProps();
911
- const inputValue = this.getState('inputValue');
912
908
  // 将 inputValue 清空,如果有选中值的话,选中项能够快速回显
913
909
  // Clear the inputValue. If there is a selected value, the selected item can be quickly echoed.
914
910
  if (isVisible === false && filterTreeNode) {
915
- inputValue && this._adapter.setClearInputFlag(true);
916
911
  this.clearInputValue();
917
912
  }
918
913
  if (filterTreeNode && searchPosition === strings.SEARCH_POSITION_DROPDOWN && isVisible && searchAutoFocus) {
@@ -928,7 +923,6 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
928
923
  // After the pop-up layer is completely closed, recalculate the expandedKey and flattenNode in the state through clearInput.
929
924
  // Prevent the pop-up layer from flickering visually due to changes in the number of options in the pop-up panel when the pop-up layer is not collapsed.
930
925
  const { filterTreeNode } = this.getProps();
931
- const shouldClear = this._adapter.getClearInputFlag();
932
- filterTreeNode && shouldClear && this.clearInput();
926
+ filterTreeNode && this.clearInput();
933
927
  }
934
928
  }
@@ -358,6 +358,15 @@ $module: #{$prefix}-upload;
358
358
  border-radius: $radius-upload_picture_file_card_img;
359
359
  }
360
360
 
361
+ &-custom-thumbnail {
362
+ .#{$prefix}-image {
363
+ img {
364
+ width: inherit;
365
+ height: inherit;
366
+ }
367
+ }
368
+ }
369
+
361
370
  &-close {
362
371
  visibility: hidden;
363
372
  display: inline-flex;