@douyinfe/semi-foundation 2.88.1 → 2.88.2-alpha.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.
@@ -9,7 +9,8 @@ const strings = {
9
9
  TOPS_SLOT_POSITION_DEFAULT: "top",
10
10
  ZERO_WIDTH_CHAR: '\uFEFF',
11
11
  PIC_PREFIX: 'image/',
12
- PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']
12
+ PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'],
13
+ DELETABLE: 'skipCustomTransactionPlugin'
13
14
  };
14
15
 
15
16
  const numbers = {
@@ -145,7 +145,7 @@ export function getCustomSlotAttribute() {
145
145
 
146
146
  export function findSkillSlotInString(content: string) {
147
147
  const reg = /<skill-slot\s+([^>]*)><\/skill-slot>/i;
148
- const attrReg = /([\w-]+)=["']?([^"'\s>]+)["']?/g;
148
+ const attrReg = /([\w-]+)=["']([^"']*)["']/g;
149
149
  const match = reg.exec(content);
150
150
  if (match) {
151
151
  const attrsStr = match[1];
@@ -175,8 +175,8 @@ function omitUndefinedFromObj(obj: { [key: string]: any }) {
175
175
 
176
176
  export function getSkillSlotString(skill: BaseSkill) {
177
177
  let skillParams = '';
178
- skill.label && (skillParams += ` data-label=${skill.label}`);
179
- skill.value && (skillParams += ` data-value=${skill.value}`);
178
+ skill.label && (skillParams += ` data-label="${skill.label}"`);
179
+ skill.value && (skillParams += ` data-value="${skill.value}"`);
180
180
  (typeof skill.hasTemplate === 'boolean') && (skillParams += ` data-template=${skill.hasTemplate}`);
181
- return `<skill-slot ${skillParams}"></skill-slot>`;
181
+ return `<skill-slot ${skillParams}></skill-slot>`;
182
182
  }
package/image/image.scss CHANGED
@@ -19,6 +19,13 @@ $module: #{$prefix}-image;
19
19
  max-width: none;
20
20
  }
21
21
 
22
+ &-tooltip-children-wrapper {
23
+ display: inline-flex;
24
+ width: fit-content;
25
+ height: fit-content;
26
+ vertical-align: middle;
27
+ }
28
+
22
29
  &-img {
23
30
  vertical-align: top;
24
31
  border-radius: inherit;
@@ -6,6 +6,7 @@ declare const strings: {
6
6
  ZERO_WIDTH_CHAR: string;
7
7
  PIC_PREFIX: string;
8
8
  PIC_SUFFIX_ARRAY: string[];
9
+ DELETABLE: string;
9
10
  };
10
11
  declare const numbers: {
11
12
  SCROLL_AMOUNT: number;
@@ -12,7 +12,8 @@ const strings = exports.strings = {
12
12
  TOPS_SLOT_POSITION_DEFAULT: "top",
13
13
  ZERO_WIDTH_CHAR: '\uFEFF',
14
14
  PIC_PREFIX: 'image/',
15
- PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']
15
+ PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'],
16
+ DELETABLE: 'skipCustomTransactionPlugin'
16
17
  };
17
18
  const numbers = exports.numbers = {
18
19
  SCROLL_AMOUNT: 300,
@@ -177,7 +177,7 @@ function getCustomSlotAttribute() {
177
177
  }
178
178
  function findSkillSlotInString(content) {
179
179
  const reg = /<skill-slot\s+([^>]*)><\/skill-slot>/i;
180
- const attrReg = /([\w-]+)=["']?([^"'\s>]+)["']?/g;
180
+ const attrReg = /([\w-]+)=["']([^"']*)["']/g;
181
181
  const match = reg.exec(content);
182
182
  if (match) {
183
183
  const attrsStr = match[1];
@@ -205,8 +205,8 @@ function omitUndefinedFromObj(obj) {
205
205
  }
206
206
  function getSkillSlotString(skill) {
207
207
  let skillParams = '';
208
- skill.label && (skillParams += ` data-label=${skill.label}`);
209
- skill.value && (skillParams += ` data-value=${skill.value}`);
208
+ skill.label && (skillParams += ` data-label="${skill.label}"`);
209
+ skill.value && (skillParams += ` data-value="${skill.value}"`);
210
210
  typeof skill.hasTemplate === 'boolean' && (skillParams += ` data-template=${skill.hasTemplate}`);
211
- return `<skill-slot ${skillParams}"></skill-slot>`;
211
+ return `<skill-slot ${skillParams}></skill-slot>`;
212
212
  }
@@ -253,6 +253,6 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
253
253
  * - When yam open type is 'left' or 'right', weeks minHeight should be set
254
254
  * If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
255
255
  */
256
- getYAMOpenType(): "none" | "left" | "right" | "both";
256
+ getYAMOpenType(): "left" | "right" | "none" | "both";
257
257
  }
258
258
  export {};
@@ -15,6 +15,12 @@
15
15
  */
16
16
  max-width: none;
17
17
  }
18
+ .semi-image-tooltip-children-wrapper {
19
+ display: inline-flex;
20
+ width: fit-content;
21
+ height: fit-content;
22
+ vertical-align: middle;
23
+ }
18
24
  .semi-image-img {
19
25
  vertical-align: top;
20
26
  border-radius: inherit;
@@ -19,6 +19,13 @@ $module: #{$prefix}-image;
19
19
  max-width: none;
20
20
  }
21
21
 
22
+ &-tooltip-children-wrapper {
23
+ display: inline-flex;
24
+ width: fit-content;
25
+ height: fit-content;
26
+ vertical-align: middle;
27
+ }
28
+
22
29
  &-img {
23
30
  vertical-align: top;
24
31
  border-radius: inherit;
@@ -49,6 +49,11 @@
49
49
  transition: opacity 0.2s cubic-bezier(0.5, -0.1, 1, 0.4);
50
50
  opacity: 0;
51
51
  }
52
+ .semi-navigation-collapsed-wrapper {
53
+ display: flex;
54
+ width: fit-content;
55
+ height: fit-content;
56
+ }
52
57
  .semi-navigation-sub-wrap .semi-navigation-sub-title, .semi-navigation-item {
53
58
  cursor: pointer;
54
59
  display: flex;
@@ -65,6 +65,12 @@ $module: #{$prefix}-navigation;
65
65
  transition: $motion-navigation_collapsed_opacity;
66
66
  opacity: 0;
67
67
  }
68
+
69
+ &-wrapper {
70
+ display: flex;
71
+ width: fit-content;
72
+ height: fit-content;
73
+ }
68
74
  }
69
75
 
70
76
  // 对于普通item和二级sub-title,都是font-weight normal
@@ -174,10 +174,11 @@ class RatingFoundation extends _foundation.default {
174
174
  const {
175
175
  count,
176
176
  allowHalf,
177
- preventScroll
177
+ preventScroll,
178
+ tooltips
178
179
  } = this.getProps();
179
180
  const index = Math.ceil(value) - 1;
180
- const starElement = [...event.currentTarget.childNodes].map(item => item.childNodes[0].childNodes);
181
+ const starElement = [...event.currentTarget.childNodes].map(item => tooltips ? item.childNodes[0].childNodes[0].childNodes : item.childNodes[0].childNodes);
181
182
  if (index < 0) {
182
183
  starElement[count][0].focus({
183
184
  preventScroll
@@ -51,6 +51,11 @@
51
51
  height: 24px;
52
52
  font-size: 24px;
53
53
  }
54
+ .semi-rating-star-outer {
55
+ display: inline-flex;
56
+ width: fit-content;
57
+ height: fit-content;
58
+ }
54
59
  .semi-rating-star-wrapper {
55
60
  position: relative;
56
61
  overflow: hidden;
@@ -68,6 +68,12 @@ $module: #{$prefix}-rating;
68
68
  font-size: $font-rating_item_default-fontSize;
69
69
  }
70
70
 
71
+ &-outer {
72
+ display: inline-flex;
73
+ width: fit-content;
74
+ height: fit-content;
75
+ }
76
+
71
77
  &-wrapper {
72
78
  position: relative;
73
79
  overflow: hidden;
@@ -5,6 +5,12 @@
5
5
  display: flex;
6
6
  flex-wrap: wrap;
7
7
  }
8
+ .semi-upload-tooltip-children-wrapper {
9
+ display: inline-flex;
10
+ width: fit-content;
11
+ height: fit-content;
12
+ vertical-align: middle;
13
+ }
8
14
  .semi-upload-disabled {
9
15
  cursor: not-allowed;
10
16
  }
@@ -6,6 +6,13 @@ $module: #{$prefix}-upload;
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
8
 
9
+ &-tooltip-children-wrapper {
10
+ display: inline-flex;
11
+ width: fit-content;
12
+ height: fit-content;
13
+ vertical-align: middle;
14
+ }
15
+
9
16
  &-disabled {
10
17
  cursor: not-allowed;
11
18
 
@@ -6,6 +6,7 @@ declare const strings: {
6
6
  ZERO_WIDTH_CHAR: string;
7
7
  PIC_PREFIX: string;
8
8
  PIC_SUFFIX_ARRAY: string[];
9
+ DELETABLE: string;
9
10
  };
10
11
  declare const numbers: {
11
12
  SCROLL_AMOUNT: number;
@@ -6,7 +6,8 @@ const strings = {
6
6
  TOPS_SLOT_POSITION_DEFAULT: "top",
7
7
  ZERO_WIDTH_CHAR: '\uFEFF',
8
8
  PIC_PREFIX: 'image/',
9
- PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']
9
+ PIC_SUFFIX_ARRAY: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'],
10
+ DELETABLE: 'skipCustomTransactionPlugin'
10
11
  };
11
12
  const numbers = {
12
13
  SCROLL_AMOUNT: 300,
@@ -160,7 +160,7 @@ export function getCustomSlotAttribute() {
160
160
  }
161
161
  export function findSkillSlotInString(content) {
162
162
  const reg = /<skill-slot\s+([^>]*)><\/skill-slot>/i;
163
- const attrReg = /([\w-]+)=["']?([^"'\s>]+)["']?/g;
163
+ const attrReg = /([\w-]+)=["']([^"']*)["']/g;
164
164
  const match = reg.exec(content);
165
165
  if (match) {
166
166
  const attrsStr = match[1];
@@ -188,8 +188,8 @@ function omitUndefinedFromObj(obj) {
188
188
  }
189
189
  export function getSkillSlotString(skill) {
190
190
  let skillParams = '';
191
- skill.label && (skillParams += ` data-label=${skill.label}`);
192
- skill.value && (skillParams += ` data-value=${skill.value}`);
191
+ skill.label && (skillParams += ` data-label="${skill.label}"`);
192
+ skill.value && (skillParams += ` data-value="${skill.value}"`);
193
193
  typeof skill.hasTemplate === 'boolean' && (skillParams += ` data-template=${skill.hasTemplate}`);
194
- return `<skill-slot ${skillParams}"></skill-slot>`;
194
+ return `<skill-slot ${skillParams}></skill-slot>`;
195
195
  }
@@ -253,6 +253,6 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
253
253
  * - When yam open type is 'left' or 'right', weeks minHeight should be set
254
254
  * If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
255
255
  */
256
- getYAMOpenType(): "none" | "left" | "right" | "both";
256
+ getYAMOpenType(): "left" | "right" | "none" | "both";
257
257
  }
258
258
  export {};
@@ -15,6 +15,12 @@
15
15
  */
16
16
  max-width: none;
17
17
  }
18
+ .semi-image-tooltip-children-wrapper {
19
+ display: inline-flex;
20
+ width: fit-content;
21
+ height: fit-content;
22
+ vertical-align: middle;
23
+ }
18
24
  .semi-image-img {
19
25
  vertical-align: top;
20
26
  border-radius: inherit;
@@ -19,6 +19,13 @@ $module: #{$prefix}-image;
19
19
  max-width: none;
20
20
  }
21
21
 
22
+ &-tooltip-children-wrapper {
23
+ display: inline-flex;
24
+ width: fit-content;
25
+ height: fit-content;
26
+ vertical-align: middle;
27
+ }
28
+
22
29
  &-img {
23
30
  vertical-align: top;
24
31
  border-radius: inherit;
@@ -49,6 +49,11 @@
49
49
  transition: opacity 0.2s cubic-bezier(0.5, -0.1, 1, 0.4);
50
50
  opacity: 0;
51
51
  }
52
+ .semi-navigation-collapsed-wrapper {
53
+ display: flex;
54
+ width: fit-content;
55
+ height: fit-content;
56
+ }
52
57
  .semi-navigation-sub-wrap .semi-navigation-sub-title, .semi-navigation-item {
53
58
  cursor: pointer;
54
59
  display: flex;
@@ -65,6 +65,12 @@ $module: #{$prefix}-navigation;
65
65
  transition: $motion-navigation_collapsed_opacity;
66
66
  opacity: 0;
67
67
  }
68
+
69
+ &-wrapper {
70
+ display: flex;
71
+ width: fit-content;
72
+ height: fit-content;
73
+ }
68
74
  }
69
75
 
70
76
  // 对于普通item和二级sub-title,都是font-weight normal
@@ -167,10 +167,11 @@ export default class RatingFoundation extends BaseFoundation {
167
167
  const {
168
168
  count,
169
169
  allowHalf,
170
- preventScroll
170
+ preventScroll,
171
+ tooltips
171
172
  } = this.getProps();
172
173
  const index = Math.ceil(value) - 1;
173
- const starElement = [...event.currentTarget.childNodes].map(item => item.childNodes[0].childNodes);
174
+ const starElement = [...event.currentTarget.childNodes].map(item => tooltips ? item.childNodes[0].childNodes[0].childNodes : item.childNodes[0].childNodes);
174
175
  if (index < 0) {
175
176
  starElement[count][0].focus({
176
177
  preventScroll
@@ -51,6 +51,11 @@
51
51
  height: 24px;
52
52
  font-size: 24px;
53
53
  }
54
+ .semi-rating-star-outer {
55
+ display: inline-flex;
56
+ width: fit-content;
57
+ height: fit-content;
58
+ }
54
59
  .semi-rating-star-wrapper {
55
60
  position: relative;
56
61
  overflow: hidden;
@@ -68,6 +68,12 @@ $module: #{$prefix}-rating;
68
68
  font-size: $font-rating_item_default-fontSize;
69
69
  }
70
70
 
71
+ &-outer {
72
+ display: inline-flex;
73
+ width: fit-content;
74
+ height: fit-content;
75
+ }
76
+
71
77
  &-wrapper {
72
78
  position: relative;
73
79
  overflow: hidden;
@@ -5,6 +5,12 @@
5
5
  display: flex;
6
6
  flex-wrap: wrap;
7
7
  }
8
+ .semi-upload-tooltip-children-wrapper {
9
+ display: inline-flex;
10
+ width: fit-content;
11
+ height: fit-content;
12
+ vertical-align: middle;
13
+ }
8
14
  .semi-upload-disabled {
9
15
  cursor: not-allowed;
10
16
  }
@@ -6,6 +6,13 @@ $module: #{$prefix}-upload;
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
8
 
9
+ &-tooltip-children-wrapper {
10
+ display: inline-flex;
11
+ width: fit-content;
12
+ height: fit-content;
13
+ vertical-align: middle;
14
+ }
15
+
9
16
  &-disabled {
10
17
  cursor: not-allowed;
11
18
 
@@ -65,6 +65,12 @@ $module: #{$prefix}-navigation;
65
65
  transition: $motion-navigation_collapsed_opacity;
66
66
  opacity: 0;
67
67
  }
68
+
69
+ &-wrapper {
70
+ display: flex;
71
+ width: fit-content;
72
+ height: fit-content;
73
+ }
68
74
  }
69
75
 
70
76
  // 对于普通item和二级sub-title,都是font-weight normal
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.88.1",
3
+ "version": "2.88.2-alpha.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.88.1",
11
- "@douyinfe/semi-json-viewer-core": "2.88.1",
10
+ "@douyinfe/semi-animation": "2.88.2-alpha.0",
11
+ "@douyinfe/semi-json-viewer-core": "2.88.2-alpha.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": "e08d049ae7cbf936679b53146fd9041577c9422b",
32
+ "gitHead": "e5068303441ac4ad0711cd48420a5b1434eca45a",
33
33
  "devDependencies": {
34
34
  "@babel/plugin-transform-runtime": "^7.15.8",
35
35
  "@babel/preset-env": "^7.15.8",
@@ -146,9 +146,11 @@ export default class RatingFoundation<P = Record<string, any>, S = Record<string
146
146
  }
147
147
 
148
148
  changeFocusStar(value: number, event: any) {
149
- const { count, allowHalf, preventScroll } = this.getProps();
149
+ const { count, allowHalf, preventScroll, tooltips } = this.getProps();
150
150
  const index = Math.ceil(value) - 1;
151
- const starElement = [...event.currentTarget.childNodes].map(item => item.childNodes[0].childNodes);
151
+ const starElement = [...event.currentTarget.childNodes].map(item =>
152
+ tooltips ? item.childNodes[0].childNodes[0].childNodes : item.childNodes[0].childNodes
153
+ );
152
154
  if (index < 0) {
153
155
  starElement[count][0].focus({ preventScroll });
154
156
  } else {
@@ -68,6 +68,12 @@ $module: #{$prefix}-rating;
68
68
  font-size: $font-rating_item_default-fontSize;
69
69
  }
70
70
 
71
+ &-outer {
72
+ display: inline-flex;
73
+ width: fit-content;
74
+ height: fit-content;
75
+ }
76
+
71
77
  &-wrapper {
72
78
  position: relative;
73
79
  overflow: hidden;
@@ -6,6 +6,13 @@ $module: #{$prefix}-upload;
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
8
 
9
+ &-tooltip-children-wrapper {
10
+ display: inline-flex;
11
+ width: fit-content;
12
+ height: fit-content;
13
+ vertical-align: middle;
14
+ }
15
+
9
16
  &-disabled {
10
17
  cursor: not-allowed;
11
18