@douyinfe/semi-foundation 2.20.4 → 2.20.5-alpha.2

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.
@@ -249,6 +249,6 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
249
249
  * - When yam open type is 'left' or 'right', weeks minHeight should be set
250
250
  * If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
251
251
  */
252
- getYAMOpenType(): "left" | "right" | "none" | "both";
252
+ getYAMOpenType(): "left" | "right" | "both" | "none";
253
253
  }
254
254
  export {};
@@ -74,6 +74,6 @@ export declare function getValueOrKey(data: any): any;
74
74
  export declare function normalizeValue(value: any, withObject: boolean): any;
75
75
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
76
76
  export declare function calcDisabledKeys(keyEntities: KeyEntities): Set<string>;
77
- export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
77
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
78
78
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
79
79
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("auto" | "custom")[];
21
+ UPLOAD_TRIGGER: ("custom" | "auto")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -14,7 +14,7 @@ function getUuid(prefix) {
14
14
 
15
15
  function getUuidv4() {
16
16
  try {
17
- return String(1e7 + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (Number(c) ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> Number(c) / 4).toString(16));
17
+ return crypto.randomUUID();
18
18
  } catch (err) {
19
19
  return getUuid('semi');
20
20
  }
@@ -249,6 +249,6 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
249
249
  * - When yam open type is 'left' or 'right', weeks minHeight should be set
250
250
  * If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
251
251
  */
252
- getYAMOpenType(): "left" | "right" | "none" | "both";
252
+ getYAMOpenType(): "left" | "right" | "both" | "none";
253
253
  }
254
254
  export {};
@@ -74,6 +74,6 @@ export declare function getValueOrKey(data: any): any;
74
74
  export declare function normalizeValue(value: any, withObject: boolean): any;
75
75
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
76
76
  export declare function calcDisabledKeys(keyEntities: KeyEntities): Set<string>;
77
- export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
77
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
78
78
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
79
79
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("auto" | "custom")[];
21
+ UPLOAD_TRIGGER: ("custom" | "auto")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -4,7 +4,7 @@ export default function getUuid(prefix) {
4
4
 
5
5
  function getUuidv4() {
6
6
  try {
7
- return String(1e7 + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (Number(c) ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> Number(c) / 4).toString(16));
7
+ return crypto.randomUUID();
8
8
  } catch (err) {
9
9
  return getUuid('semi');
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.20.4",
3
+ "version": "2.20.5-alpha.2",
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": "40e37ceae0e1a93741bb2434448e4f7421986492",
26
+ "gitHead": "4c4b25fd1c11f392a1c323fb6a11a50a744b24ad",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
package/utils/uuid.ts CHANGED
@@ -5,9 +5,7 @@ export default function getUuid(prefix: string) {
5
5
  // https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
6
6
  function getUuidv4() {
7
7
  try {
8
- return String(1e7 + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
9
- (Number(c) ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (Number(c) / 4)))).toString(16)
10
- );
8
+ return crypto.randomUUID();
11
9
  } catch (err) {
12
10
  return getUuid('semi');
13
11
  }