@douyinfe/semi-foundation 2.62.0 → 2.63.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.
Files changed (50) hide show
  1. package/chat/chat.scss +598 -0
  2. package/chat/chatBoxActionFoundation.ts +64 -0
  3. package/chat/constants.ts +68 -0
  4. package/chat/foundation.ts +306 -0
  5. package/chat/inputboxFoundation.ts +98 -0
  6. package/chat/rtl.scss +22 -0
  7. package/chat/variables.scss +125 -0
  8. package/input/textareaFoundation.ts +5 -0
  9. package/lib/cjs/chat/chat.css +484 -0
  10. package/lib/cjs/chat/chat.scss +598 -0
  11. package/lib/cjs/chat/chatBoxActionFoundation.d.ts +24 -0
  12. package/lib/cjs/chat/chatBoxActionFoundation.js +49 -0
  13. package/lib/cjs/chat/constants.d.ts +41 -0
  14. package/lib/cjs/chat/constants.js +56 -0
  15. package/lib/cjs/chat/foundation.d.ts +76 -0
  16. package/lib/cjs/chat/foundation.js +275 -0
  17. package/lib/cjs/chat/inputboxFoundation.d.ts +20 -0
  18. package/lib/cjs/chat/inputboxFoundation.js +118 -0
  19. package/lib/cjs/chat/rtl.scss +22 -0
  20. package/lib/cjs/chat/variables.scss +125 -0
  21. package/lib/cjs/input/textareaFoundation.js +7 -0
  22. package/lib/cjs/treeSelect/foundation.d.ts +3 -3
  23. package/lib/cjs/treeSelect/foundation.js +2 -6
  24. package/lib/cjs/upload/foundation.d.ts +1 -0
  25. package/lib/cjs/upload/foundation.js +3 -1
  26. package/lib/cjs/upload/upload.css +4 -0
  27. package/lib/cjs/upload/upload.scss +9 -0
  28. package/lib/es/chat/chat.css +484 -0
  29. package/lib/es/chat/chat.scss +598 -0
  30. package/lib/es/chat/chatBoxActionFoundation.d.ts +24 -0
  31. package/lib/es/chat/chatBoxActionFoundation.js +41 -0
  32. package/lib/es/chat/constants.d.ts +41 -0
  33. package/lib/es/chat/constants.js +51 -0
  34. package/lib/es/chat/foundation.d.ts +76 -0
  35. package/lib/es/chat/foundation.js +267 -0
  36. package/lib/es/chat/inputboxFoundation.d.ts +20 -0
  37. package/lib/es/chat/inputboxFoundation.js +110 -0
  38. package/lib/es/chat/rtl.scss +22 -0
  39. package/lib/es/chat/variables.scss +125 -0
  40. package/lib/es/input/textareaFoundation.js +7 -0
  41. package/lib/es/treeSelect/foundation.d.ts +3 -3
  42. package/lib/es/treeSelect/foundation.js +2 -6
  43. package/lib/es/upload/foundation.d.ts +1 -0
  44. package/lib/es/upload/foundation.js +3 -1
  45. package/lib/es/upload/upload.css +4 -0
  46. package/lib/es/upload/upload.scss +9 -0
  47. package/package.json +3 -3
  48. package/treeSelect/foundation.ts +3 -9
  49. package/upload/foundation.ts +4 -2
  50. package/upload/upload.scss +9 -0
@@ -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
  }
@@ -40,6 +40,7 @@ export interface AfterUploadResult {
40
40
  status?: string;
41
41
  validateMessage?: unknown;
42
42
  name?: string;
43
+ url?: string;
43
44
  }
44
45
  export interface UploadAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
45
46
  notifyFileSelect: (files: Array<CustomFile>) => void;
@@ -688,7 +688,8 @@ class UploadFoundation extends BaseFoundation {
688
688
  autoRemove,
689
689
  status,
690
690
  validateMessage,
691
- name
691
+ name,
692
+ url
692
693
  } = this._adapter.notifyAfterUpload({
693
694
  response: body,
694
695
  file: newFileList[index],
@@ -697,6 +698,7 @@ class UploadFoundation extends BaseFoundation {
697
698
  status ? newFileList[index].status = status : null;
698
699
  validateMessage ? newFileList[index].validateMessage = validateMessage : null;
699
700
  name ? newFileList[index].name = name : null;
701
+ url ? newFileList[index].url = url : null;
700
702
  autoRemove ? newFileList.splice(index, 1) : null;
701
703
  }
702
704
  this._adapter.notifySuccess(body, fileInstance, newFileList);
@@ -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",
3
+ "version": "2.63.0-beta.0",
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",
10
+ "@douyinfe/semi-animation": "2.63.0-beta.0",
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": "e64eec886e0046db6787303086f1ddd067196aa9",
31
+ "gitHead": "3e13ef6fd2fcc25aa56d863828a4833feaceea3c",
32
32
  "devDependencies": {
33
33
  "@babel/plugin-transform-runtime": "^7.15.8",
34
34
  "@babel/preset-env": "^7.15.8",
@@ -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
  }
@@ -60,7 +60,8 @@ export interface AfterUploadResult {
60
60
  autoRemove?: boolean;
61
61
  status?: string;
62
62
  validateMessage?: unknown;
63
- name?: string
63
+ name?: string;
64
+ url?: string
64
65
  }
65
66
 
66
67
  export interface UploadAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
@@ -646,7 +647,7 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
646
647
  e ? (newFileList[index].event = e) : null;
647
648
 
648
649
  if (afterUpload && typeof afterUpload === 'function') {
649
- const { autoRemove, status, validateMessage, name } =
650
+ const { autoRemove, status, validateMessage, name, url } =
650
651
  this._adapter.notifyAfterUpload({
651
652
  response: body,
652
653
  file: newFileList[index],
@@ -655,6 +656,7 @@ class UploadFoundation<P = Record<string, any>, S = Record<string, any>> extends
655
656
  status ? (newFileList[index].status = status) : null;
656
657
  validateMessage ? (newFileList[index].validateMessage = validateMessage) : null;
657
658
  name ? (newFileList[index].name = name) : null;
659
+ url ? (newFileList[index].url = url) : null;
658
660
  autoRemove ? newFileList.splice(index, 1) : null;
659
661
  }
660
662
  this._adapter.notifySuccess(body, fileInstance, newFileList);
@@ -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;