@douyinfe/semi-foundation 2.84.0-beta.0 → 2.84.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/badge/badge.scss CHANGED
@@ -27,7 +27,7 @@ $module: #{$prefix}-badge;
27
27
  z-index: $z-badge;
28
28
  text-align: center;
29
29
  @include font-size-small;
30
- font-weight: $font-size-regular;
30
+ font-weight: $font-weight-regular;
31
31
  color: $color-badge_default-text-default;
32
32
  }
33
33
 
@@ -27,7 +27,7 @@
27
27
  font-size: 12px;
28
28
  line-height: 16px;
29
29
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
30
- font-weight: 14px;
30
+ font-weight: 400;
31
31
  color: var(--semi-color-bg-2);
32
32
  }
33
33
  .semi-badge-rightTop {
@@ -27,7 +27,7 @@ $module: #{$prefix}-badge;
27
27
  z-index: $z-badge;
28
28
  text-align: center;
29
29
  @include font-size-small;
30
- font-weight: $font-size-regular;
30
+ font-weight: $font-weight-regular;
31
31
  color: $color-badge_default-text-default;
32
32
  }
33
33
 
@@ -107,12 +107,11 @@ class SliderFoundation extends _foundation.default {
107
107
  */
108
108
  this.handleMousePos = (clientX, clientY) => {
109
109
  const parentRect = this._adapter.getParentRect();
110
- const scrollParent = this._adapter.getScrollParentVal();
111
110
  const parentX = parentRect ? parentRect.left : 0;
112
111
  const parentY = parentRect ? parentRect.top : 0;
113
112
  return {
114
- x: clientX - parentX + scrollParent.scrollLeft,
115
- y: clientY - parentY + scrollParent.scrollTop
113
+ x: clientX - parentX,
114
+ y: clientY - parentY
116
115
  };
117
116
  };
118
117
  /**
@@ -119,6 +119,16 @@
119
119
  width: 20px;
120
120
  height: 20px;
121
121
  }
122
+ .semi-tag-solid .semi-tag-close {
123
+ color: var(--semi-color-white);
124
+ opacity: 0.8;
125
+ }
126
+ .semi-tag-solid .semi-tag-close:hover {
127
+ opacity: 1;
128
+ }
129
+ .semi-tag-solid .semi-tag-close:active {
130
+ opacity: 0.9;
131
+ }
122
132
 
123
133
  .semi-tag-group {
124
134
  display: block;
@@ -430,17 +440,6 @@
430
440
  color: var(--semi-color-text-0);
431
441
  }
432
442
 
433
- .semi-tag-solid .semi-tag-close {
434
- color: var(--semi-color-white);
435
- opacity: 0.8;
436
- }
437
- .semi-tag-solid .semi-tag-close:hover {
438
- opacity: 1;
439
- }
440
- .semi-tag-solid .semi-tag-close:active {
441
- opacity: 0.9;
442
- }
443
-
444
443
  .semi-rtl .semi-tag,
445
444
  .semi-portal-rtl .semi-tag {
446
445
  direction: rtl;
@@ -155,6 +155,21 @@ $types: "ghost", "solid", "light";
155
155
  height: $width-tag_avatar_circle_large;
156
156
  }
157
157
  }
158
+
159
+ &-solid {
160
+ .#{$module}-close {
161
+ color: $color-tag_close-icon_deep-default;
162
+ opacity: .8;
163
+
164
+ &:hover {
165
+ opacity: 1.0;
166
+ }
167
+
168
+ &:active {
169
+ opacity: .9;
170
+ }
171
+ }
172
+ }
158
173
  }
159
174
 
160
175
  .#{$module}-group {
@@ -224,19 +239,4 @@ $types: "ghost", "solid", "light";
224
239
  color: $color-tag_avatar-text-default;
225
240
  }
226
241
 
227
- .#{$module}-solid {
228
- .#{$module}-close {
229
- color: $color-tag_close-icon_deep-default;
230
- opacity: .8;
231
-
232
- &:hover {
233
- opacity: 1.0;
234
- }
235
-
236
- &:active {
237
- opacity: .9;
238
- }
239
- }
240
- }
241
-
242
242
  @import './rtl.scss';
@@ -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;
@@ -17,7 +17,7 @@ function plus(num1, num2) {
17
17
  const num1Digits = (num1.toString().split('.')[1] || '').length;
18
18
  const num2Digits = (num2.toString().split('.')[1] || '').length;
19
19
  const baseNum = Math.pow(10, Math.max(num1Digits, num2Digits));
20
- return (num1 * baseNum + num2 * baseNum) / baseNum;
20
+ return Math.round(num1 * baseNum + num2 * baseNum) / baseNum;
21
21
  }
22
22
  function minus(num1, num2) {
23
23
  return plus(num1, -num2);
@@ -27,7 +27,7 @@
27
27
  font-size: 12px;
28
28
  line-height: 16px;
29
29
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
30
- font-weight: 14px;
30
+ font-weight: 400;
31
31
  color: var(--semi-color-bg-2);
32
32
  }
33
33
  .semi-badge-rightTop {
@@ -27,7 +27,7 @@ $module: #{$prefix}-badge;
27
27
  z-index: $z-badge;
28
28
  text-align: center;
29
29
  @include font-size-small;
30
- font-weight: $font-size-regular;
30
+ font-weight: $font-weight-regular;
31
31
  color: $color-badge_default-text-default;
32
32
  }
33
33
 
@@ -100,12 +100,11 @@ export default class SliderFoundation extends BaseFoundation {
100
100
  */
101
101
  this.handleMousePos = (clientX, clientY) => {
102
102
  const parentRect = this._adapter.getParentRect();
103
- const scrollParent = this._adapter.getScrollParentVal();
104
103
  const parentX = parentRect ? parentRect.left : 0;
105
104
  const parentY = parentRect ? parentRect.top : 0;
106
105
  return {
107
- x: clientX - parentX + scrollParent.scrollLeft,
108
- y: clientY - parentY + scrollParent.scrollTop
106
+ x: clientX - parentX,
107
+ y: clientY - parentY
109
108
  };
110
109
  };
111
110
  /**
@@ -119,6 +119,16 @@
119
119
  width: 20px;
120
120
  height: 20px;
121
121
  }
122
+ .semi-tag-solid .semi-tag-close {
123
+ color: var(--semi-color-white);
124
+ opacity: 0.8;
125
+ }
126
+ .semi-tag-solid .semi-tag-close:hover {
127
+ opacity: 1;
128
+ }
129
+ .semi-tag-solid .semi-tag-close:active {
130
+ opacity: 0.9;
131
+ }
122
132
 
123
133
  .semi-tag-group {
124
134
  display: block;
@@ -430,17 +440,6 @@
430
440
  color: var(--semi-color-text-0);
431
441
  }
432
442
 
433
- .semi-tag-solid .semi-tag-close {
434
- color: var(--semi-color-white);
435
- opacity: 0.8;
436
- }
437
- .semi-tag-solid .semi-tag-close:hover {
438
- opacity: 1;
439
- }
440
- .semi-tag-solid .semi-tag-close:active {
441
- opacity: 0.9;
442
- }
443
-
444
443
  .semi-rtl .semi-tag,
445
444
  .semi-portal-rtl .semi-tag {
446
445
  direction: rtl;
@@ -155,6 +155,21 @@ $types: "ghost", "solid", "light";
155
155
  height: $width-tag_avatar_circle_large;
156
156
  }
157
157
  }
158
+
159
+ &-solid {
160
+ .#{$module}-close {
161
+ color: $color-tag_close-icon_deep-default;
162
+ opacity: .8;
163
+
164
+ &:hover {
165
+ opacity: 1.0;
166
+ }
167
+
168
+ &:active {
169
+ opacity: .9;
170
+ }
171
+ }
172
+ }
158
173
  }
159
174
 
160
175
  .#{$module}-group {
@@ -224,19 +239,4 @@ $types: "ghost", "solid", "light";
224
239
  color: $color-tag_avatar-text-default;
225
240
  }
226
241
 
227
- .#{$module}-solid {
228
- .#{$module}-close {
229
- color: $color-tag_close-icon_deep-default;
230
- opacity: .8;
231
-
232
- &:hover {
233
- opacity: 1.0;
234
- }
235
-
236
- &:active {
237
- opacity: .9;
238
- }
239
- }
240
- }
241
-
242
242
  @import './rtl.scss';
@@ -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;
@@ -10,7 +10,7 @@ export function plus(num1, num2) {
10
10
  const num1Digits = (num1.toString().split('.')[1] || '').length;
11
11
  const num2Digits = (num2.toString().split('.')[1] || '').length;
12
12
  const baseNum = Math.pow(10, Math.max(num1Digits, num2Digits));
13
- return (num1 * baseNum + num2 * baseNum) / baseNum;
13
+ return Math.round(num1 * baseNum + num2 * baseNum) / baseNum;
14
14
  }
15
15
  export function minus(num1, num2) {
16
16
  return plus(num1, -num2);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.84.0-beta.0",
3
+ "version": "2.84.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.84.0-beta.0",
11
- "@douyinfe/semi-json-viewer-core": "2.84.0-beta.0",
10
+ "@douyinfe/semi-animation": "2.84.0",
11
+ "@douyinfe/semi-json-viewer-core": "2.84.0",
12
12
  "@mdx-js/mdx": "^3.0.1",
13
13
  "async-validator": "^3.5.0",
14
14
  "classnames": "^2.2.6",
@@ -29,7 +29,7 @@
29
29
  "*.scss",
30
30
  "*.css"
31
31
  ],
32
- "gitHead": "63169b6a72528384edff745523ba997fba344ec3",
32
+ "gitHead": "4d780233a4efb8368b496e058381f8749b93218c",
33
33
  "devDependencies": {
34
34
  "@babel/plugin-transform-runtime": "^7.15.8",
35
35
  "@babel/preset-env": "^7.15.8",
@@ -229,10 +229,9 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
229
229
  */
230
230
  handleMousePos = (clientX: number, clientY: number) => {
231
231
  const parentRect = this._adapter.getParentRect();
232
- const scrollParent = this._adapter.getScrollParentVal();
233
232
  const parentX = parentRect ? parentRect.left : 0;
234
233
  const parentY = parentRect ? parentRect.top : 0;
235
- return { x: clientX - parentX + scrollParent.scrollLeft, y: clientY - parentY + scrollParent.scrollTop };
234
+ return { x: clientX - parentX, y: clientY - parentY };
236
235
  };
237
236
 
238
237
  /**
@@ -383,7 +382,7 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
383
382
  * @memberof SliderFoundation
384
383
  */
385
384
  outPutValue = (inputValue: SliderProps['value']) => {
386
- const checkHowManyDecimals = (num: number)=>{
385
+ const checkHowManyDecimals = (num: number) => {
387
386
  const reg = /^\d+(\.\d+)?$/;
388
387
  if (reg.test(String(num))) {
389
388
  return num.toString().split('.')[1]?.length ?? 0;
@@ -391,10 +390,10 @@ export default class SliderFoundation extends BaseFoundation<SliderAdapter> {
391
390
  return 0;
392
391
  };
393
392
  const step = this._adapter.getProp('step');
394
- const transWay = (()=>{
393
+ const transWay = (() => {
395
394
  const decimals = checkHowManyDecimals(step);
396
395
  const multipler = Math.pow(10, decimals);
397
- return (value: number)=>{
396
+ return (value: number) => {
398
397
  return Math.round(value * multipler) / multipler;
399
398
  };
400
399
  })();
package/tag/tag.scss CHANGED
@@ -155,6 +155,21 @@ $types: "ghost", "solid", "light";
155
155
  height: $width-tag_avatar_circle_large;
156
156
  }
157
157
  }
158
+
159
+ &-solid {
160
+ .#{$module}-close {
161
+ color: $color-tag_close-icon_deep-default;
162
+ opacity: .8;
163
+
164
+ &:hover {
165
+ opacity: 1.0;
166
+ }
167
+
168
+ &:active {
169
+ opacity: .9;
170
+ }
171
+ }
172
+ }
158
173
  }
159
174
 
160
175
  .#{$module}-group {
@@ -224,19 +239,4 @@ $types: "ghost", "solid", "light";
224
239
  color: $color-tag_avatar-text-default;
225
240
  }
226
241
 
227
- .#{$module}-solid {
228
- .#{$module}-close {
229
- color: $color-tag_close-icon_deep-default;
230
- opacity: .8;
231
-
232
- &:hover {
233
- opacity: 1.0;
234
- }
235
-
236
- &:active {
237
- opacity: .9;
238
- }
239
- }
240
- }
241
-
242
242
  @import './rtl.scss';
package/utils/number.ts CHANGED
@@ -10,7 +10,7 @@ export function plus(num1: number, num2: number) {
10
10
  const num1Digits = (num1.toString().split('.')[1] || '').length;
11
11
  const num2Digits = (num2.toString().split('.')[1] || '').length;
12
12
  const baseNum = Math.pow(10, Math.max(num1Digits, num2Digits));
13
- return (num1 * baseNum + num2 * baseNum) / baseNum;
13
+ return (Math.round(num1 * baseNum + num2 * baseNum)) / baseNum;
14
14
  }
15
15
 
16
16
  export function minus(num1: number, num2: number) {