@douyinfe/semi-foundation 2.65.2-alpha.0 → 2.65.2-alpha.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.
@@ -2,7 +2,7 @@ declare const cssClasses: {
2
2
  PREFIX: string;
3
3
  };
4
4
  declare const strings: {
5
- BOUNDARY_SET: ("start" | "end")[];
5
+ BOUNDARY_SET: ("end" | "start")[];
6
6
  POSITION_SET: string[];
7
7
  MODE_SET: string[];
8
8
  MODE_MAP: {
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _get2 = _interopRequireDefault(require("lodash/get"));
8
+ var _fastCopy = _interopRequireDefault(require("fast-copy"));
8
9
  var _foundation = _interopRequireDefault(require("../base/foundation"));
9
10
  var _constants = require("./constants");
10
- var _fastCopy = _interopRequireDefault(require("fast-copy"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const Boundary = _constants.strings.BOUNDARY_MAP;
13
13
  const OverflowDirection = _constants.strings.OVERFLOW_DIR;
@@ -39,8 +39,7 @@ class OverflowListFoundation extends _foundation.default {
39
39
  if (!this.isScrollMode()) {
40
40
  return overflow;
41
41
  }
42
- const cloneItems = (0, _fastCopy.default)(items);
43
- const visibleStateArr = cloneItems.map(_ref => {
42
+ const visibleStateArr = items.map(_ref => {
44
43
  let {
45
44
  key
46
45
  } = _ref;
@@ -49,8 +48,8 @@ class OverflowListFoundation extends _foundation.default {
49
48
  const visibleStart = visibleStateArr.indexOf(true);
50
49
  const visibleEnd = visibleStateArr.lastIndexOf(true);
51
50
  const overflowList = [];
52
- overflowList[0] = visibleStart >= 0 ? cloneItems.slice(0, visibleStart) : [];
53
- overflowList[1] = visibleEnd >= 0 ? cloneItems.slice(visibleEnd + 1, cloneItems.length) : cloneItems;
51
+ overflowList[0] = visibleStart >= 0 ? items.slice(0, visibleStart) : [];
52
+ overflowList[1] = visibleEnd >= 0 ? items.slice(visibleEnd + 1, items.length) : items.slice();
54
53
  return overflowList;
55
54
  }
56
55
  handleIntersect(entries) {
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
83
83
  export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
84
84
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
85
85
  export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
86
- export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
86
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
87
87
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
88
88
  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: ("custom" | "auto")[];
21
+ UPLOAD_TRIGGER: ("auto" | "custom")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -2,7 +2,7 @@ declare const cssClasses: {
2
2
  PREFIX: string;
3
3
  };
4
4
  declare const strings: {
5
- BOUNDARY_SET: ("start" | "end")[];
5
+ BOUNDARY_SET: ("end" | "start")[];
6
6
  POSITION_SET: string[];
7
7
  MODE_SET: string[];
8
8
  MODE_MAP: {
@@ -1,7 +1,7 @@
1
1
  import _get from "lodash/get";
2
+ import copy from 'fast-copy';
2
3
  import BaseFoundation from '../base/foundation';
3
4
  import { strings } from './constants';
4
- import copy from 'fast-copy';
5
5
  const Boundary = strings.BOUNDARY_MAP;
6
6
  const OverflowDirection = strings.OVERFLOW_DIR;
7
7
  class OverflowListFoundation extends BaseFoundation {
@@ -32,8 +32,7 @@ class OverflowListFoundation extends BaseFoundation {
32
32
  if (!this.isScrollMode()) {
33
33
  return overflow;
34
34
  }
35
- const cloneItems = copy(items);
36
- const visibleStateArr = cloneItems.map(_ref => {
35
+ const visibleStateArr = items.map(_ref => {
37
36
  let {
38
37
  key
39
38
  } = _ref;
@@ -42,8 +41,8 @@ class OverflowListFoundation extends BaseFoundation {
42
41
  const visibleStart = visibleStateArr.indexOf(true);
43
42
  const visibleEnd = visibleStateArr.lastIndexOf(true);
44
43
  const overflowList = [];
45
- overflowList[0] = visibleStart >= 0 ? cloneItems.slice(0, visibleStart) : [];
46
- overflowList[1] = visibleEnd >= 0 ? cloneItems.slice(visibleEnd + 1, cloneItems.length) : cloneItems;
44
+ overflowList[0] = visibleStart >= 0 ? items.slice(0, visibleStart) : [];
45
+ overflowList[1] = visibleEnd >= 0 ? items.slice(visibleEnd + 1, items.length) : items.slice();
47
46
  return overflowList;
48
47
  }
49
48
  handleIntersect(entries) {
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
83
83
  export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
84
84
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
85
85
  export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
86
- export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
86
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
87
87
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
88
88
  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: ("custom" | "auto")[];
21
+ UPLOAD_TRIGGER: ("auto" | "custom")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -1,7 +1,7 @@
1
+ import copy from 'fast-copy';
1
2
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
3
  import { strings } from './constants';
3
4
  import { get, cloneDeep } from 'lodash';
4
- import copy from 'fast-copy';
5
5
 
6
6
  const Boundary = strings.BOUNDARY_MAP;
7
7
  const OverflowDirection = strings.OVERFLOW_DIR;
@@ -33,15 +33,13 @@ class OverflowListFoundation extends BaseFoundation<OverflowListAdapter> {
33
33
  return overflow;
34
34
  }
35
35
 
36
- const cloneItems = copy(items);
37
-
38
- const visibleStateArr = cloneItems.map(({ key }: { key: string }) => Boolean(visibleState.get(key)));
36
+ const visibleStateArr = items.map(({ key }: { key: string }) => Boolean(visibleState.get(key)));
39
37
  const visibleStart = visibleStateArr.indexOf(true);
40
38
  const visibleEnd = visibleStateArr.lastIndexOf(true);
41
39
 
42
40
  const overflowList = [];
43
- overflowList[0] = visibleStart >= 0 ? cloneItems.slice(0, visibleStart) : [];
44
- overflowList[1] = visibleEnd >= 0 ? cloneItems.slice(visibleEnd + 1, cloneItems.length) : cloneItems;
41
+ overflowList[0] = visibleStart >= 0 ? items.slice(0, visibleStart) : [];
42
+ overflowList[1] = visibleEnd >= 0 ? items.slice(visibleEnd + 1, items.length) : items.slice();
45
43
  return overflowList;
46
44
  }
47
45
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.65.2-alpha.0",
3
+ "version": "2.65.2-alpha.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.65.2-alpha.0",
10
+ "@douyinfe/semi-animation": "2.65.2-alpha.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": "f48ef2a94cb23cd5a940baba774d7a01ce7b23cb",
31
+ "gitHead": "083b1f5da4743d7beb9565811c56eca5edabdbb4",
32
32
  "devDependencies": {
33
33
  "@babel/plugin-transform-runtime": "^7.15.8",
34
34
  "@babel/preset-env": "^7.15.8",