@douyinfe/semi-foundation 2.70.0-beta.0 → 2.70.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/chat/foundation.ts +17 -2
- package/lib/cjs/chat/foundation.d.ts +4 -0
- package/lib/cjs/chat/foundation.js +12 -1
- package/lib/cjs/table/table.css +2 -1
- package/lib/cjs/table/table.scss +2 -1
- package/lib/es/chat/foundation.d.ts +4 -0
- package/lib/es/chat/foundation.js +12 -1
- package/lib/es/table/table.css +2 -1
- package/lib/es/table/table.scss +2 -1
- package/package.json +3 -3
- package/table/table.scss +2 -1
package/chat/foundation.ts
CHANGED
|
@@ -53,7 +53,9 @@ export interface ChatAdapter<P = Record<string, any>, S = Record<string, any>> e
|
|
|
53
53
|
notifyHintClick: (hint: string) => void;
|
|
54
54
|
setUploadAreaVisible: (visible: boolean) => void;
|
|
55
55
|
manualUpload: (e: any) => void;
|
|
56
|
-
getDropAreaElement: () => HTMLDivElement
|
|
56
|
+
getDropAreaElement: () => HTMLDivElement;
|
|
57
|
+
getDragStatus: () => boolean;
|
|
58
|
+
setDragStatus: (status: boolean) => void
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
|
|
@@ -265,7 +267,19 @@ export default class ChatFoundation <P = Record<string, any>, S = Record<string,
|
|
|
265
267
|
}
|
|
266
268
|
|
|
267
269
|
handleDragOver = (e: any) => {
|
|
270
|
+
const dragStatus = this._adapter.getDragStatus();
|
|
271
|
+
if (dragStatus) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
268
274
|
this._adapter.setUploadAreaVisible(true);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
handleDragStart = (e: any) => {
|
|
278
|
+
this._adapter.setDragStatus(true);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
handleDragEnd = (e: any) => {
|
|
282
|
+
this._adapter.setDragStatus(false);
|
|
269
283
|
}
|
|
270
284
|
|
|
271
285
|
handleContainerDragOver = (e: any) => {
|
|
@@ -285,7 +299,8 @@ export default class ChatFoundation <P = Record<string, any>, S = Record<string,
|
|
|
285
299
|
// 鼠标移动至 container 的子元素,则不做任何操作
|
|
286
300
|
// If the mouse moves to the child element of container, no operation will be performed.
|
|
287
301
|
const dropAreaElement = this._adapter.getDropAreaElement();
|
|
288
|
-
|
|
302
|
+
const enterTarget = e.relatedTarget;
|
|
303
|
+
if (dropAreaElement.contains(enterTarget)) {
|
|
289
304
|
return;
|
|
290
305
|
}
|
|
291
306
|
/**
|
|
@@ -46,6 +46,8 @@ export interface ChatAdapter<P = Record<string, any>, S = Record<string, any>> e
|
|
|
46
46
|
setUploadAreaVisible: (visible: boolean) => void;
|
|
47
47
|
manualUpload: (e: any) => void;
|
|
48
48
|
getDropAreaElement: () => HTMLDivElement;
|
|
49
|
+
getDragStatus: () => boolean;
|
|
50
|
+
setDragStatus: (status: boolean) => void;
|
|
49
51
|
}
|
|
50
52
|
export default class ChatFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<ChatAdapter<P, S>, P, S> {
|
|
51
53
|
animation: any;
|
|
@@ -69,6 +71,8 @@ export default class ChatFoundation<P = Record<string, any>, S = Record<string,
|
|
|
69
71
|
dislikeMessage: (message: Message) => void;
|
|
70
72
|
resetMessage: (message: Message) => void;
|
|
71
73
|
handleDragOver: (e: any) => void;
|
|
74
|
+
handleDragStart: (e: any) => void;
|
|
75
|
+
handleDragEnd: (e: any) => void;
|
|
72
76
|
handleContainerDragOver: (e: any) => void;
|
|
73
77
|
handleContainerDrop: (e: any) => void;
|
|
74
78
|
handleContainerDragLeave: (e: any) => void;
|
|
@@ -235,8 +235,18 @@ class ChatFoundation extends _foundation.default {
|
|
|
235
235
|
onMessageReset === null || onMessageReset === void 0 ? void 0 : onMessageReset(message);
|
|
236
236
|
};
|
|
237
237
|
this.handleDragOver = e => {
|
|
238
|
+
const dragStatus = this._adapter.getDragStatus();
|
|
239
|
+
if (dragStatus) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
238
242
|
this._adapter.setUploadAreaVisible(true);
|
|
239
243
|
};
|
|
244
|
+
this.handleDragStart = e => {
|
|
245
|
+
this._adapter.setDragStatus(true);
|
|
246
|
+
};
|
|
247
|
+
this.handleDragEnd = e => {
|
|
248
|
+
this._adapter.setDragStatus(false);
|
|
249
|
+
};
|
|
240
250
|
this.handleContainerDragOver = e => {
|
|
241
251
|
(0, _a11y.handlePrevent)(e);
|
|
242
252
|
};
|
|
@@ -253,7 +263,8 @@ class ChatFoundation extends _foundation.default {
|
|
|
253
263
|
// 鼠标移动至 container 的子元素,则不做任何操作
|
|
254
264
|
// If the mouse moves to the child element of container, no operation will be performed.
|
|
255
265
|
const dropAreaElement = this._adapter.getDropAreaElement();
|
|
256
|
-
|
|
266
|
+
const enterTarget = e.relatedTarget;
|
|
267
|
+
if (dropAreaElement.contains(enterTarget)) {
|
|
257
268
|
return;
|
|
258
269
|
}
|
|
259
270
|
/**
|
package/lib/cjs/table/table.css
CHANGED
|
@@ -140,7 +140,8 @@
|
|
|
140
140
|
cursor: pointer;
|
|
141
141
|
}
|
|
142
142
|
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort:hover {
|
|
143
|
-
background: var(--semi-color-fill-0);
|
|
143
|
+
background-image: linear-gradient(0deg, var(--semi-color-fill-0), var(--semi-color-fill-0));
|
|
144
|
+
background-color: var(--semi-color-bg-0);
|
|
144
145
|
}
|
|
145
146
|
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort:hover.semi-table-cell-fixed-left::before, .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort:hover.semi-table-cell-fixed-right::before {
|
|
146
147
|
background-color: transparent;
|
package/lib/cjs/table/table.scss
CHANGED
|
@@ -145,7 +145,8 @@ $module: #{$prefix}-table;
|
|
|
145
145
|
&.#{$module}-row-head-clickSort {
|
|
146
146
|
cursor: pointer;
|
|
147
147
|
&:hover {
|
|
148
|
-
background: $color-table_th-clickSort-bg-hover;
|
|
148
|
+
background-image: linear-gradient(0deg, $color-table_th-clickSort-bg-hover, $color-table_th-clickSort-bg-hover);
|
|
149
|
+
background-color: $color-table_cell-bg-hover;
|
|
149
150
|
|
|
150
151
|
&.#{$module}-cell-fixed {
|
|
151
152
|
&-left,
|
|
@@ -46,6 +46,8 @@ export interface ChatAdapter<P = Record<string, any>, S = Record<string, any>> e
|
|
|
46
46
|
setUploadAreaVisible: (visible: boolean) => void;
|
|
47
47
|
manualUpload: (e: any) => void;
|
|
48
48
|
getDropAreaElement: () => HTMLDivElement;
|
|
49
|
+
getDragStatus: () => boolean;
|
|
50
|
+
setDragStatus: (status: boolean) => void;
|
|
49
51
|
}
|
|
50
52
|
export default class ChatFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<ChatAdapter<P, S>, P, S> {
|
|
51
53
|
animation: any;
|
|
@@ -69,6 +71,8 @@ export default class ChatFoundation<P = Record<string, any>, S = Record<string,
|
|
|
69
71
|
dislikeMessage: (message: Message) => void;
|
|
70
72
|
resetMessage: (message: Message) => void;
|
|
71
73
|
handleDragOver: (e: any) => void;
|
|
74
|
+
handleDragStart: (e: any) => void;
|
|
75
|
+
handleDragEnd: (e: any) => void;
|
|
72
76
|
handleContainerDragOver: (e: any) => void;
|
|
73
77
|
handleContainerDrop: (e: any) => void;
|
|
74
78
|
handleContainerDragLeave: (e: any) => void;
|
|
@@ -228,8 +228,18 @@ export default class ChatFoundation extends BaseFoundation {
|
|
|
228
228
|
onMessageReset === null || onMessageReset === void 0 ? void 0 : onMessageReset(message);
|
|
229
229
|
};
|
|
230
230
|
this.handleDragOver = e => {
|
|
231
|
+
const dragStatus = this._adapter.getDragStatus();
|
|
232
|
+
if (dragStatus) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
231
235
|
this._adapter.setUploadAreaVisible(true);
|
|
232
236
|
};
|
|
237
|
+
this.handleDragStart = e => {
|
|
238
|
+
this._adapter.setDragStatus(true);
|
|
239
|
+
};
|
|
240
|
+
this.handleDragEnd = e => {
|
|
241
|
+
this._adapter.setDragStatus(false);
|
|
242
|
+
};
|
|
233
243
|
this.handleContainerDragOver = e => {
|
|
234
244
|
handlePrevent(e);
|
|
235
245
|
};
|
|
@@ -246,7 +256,8 @@ export default class ChatFoundation extends BaseFoundation {
|
|
|
246
256
|
// 鼠标移动至 container 的子元素,则不做任何操作
|
|
247
257
|
// If the mouse moves to the child element of container, no operation will be performed.
|
|
248
258
|
const dropAreaElement = this._adapter.getDropAreaElement();
|
|
249
|
-
|
|
259
|
+
const enterTarget = e.relatedTarget;
|
|
260
|
+
if (dropAreaElement.contains(enterTarget)) {
|
|
250
261
|
return;
|
|
251
262
|
}
|
|
252
263
|
/**
|
package/lib/es/table/table.css
CHANGED
|
@@ -140,7 +140,8 @@
|
|
|
140
140
|
cursor: pointer;
|
|
141
141
|
}
|
|
142
142
|
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort:hover {
|
|
143
|
-
background: var(--semi-color-fill-0);
|
|
143
|
+
background-image: linear-gradient(0deg, var(--semi-color-fill-0), var(--semi-color-fill-0));
|
|
144
|
+
background-color: var(--semi-color-bg-0);
|
|
144
145
|
}
|
|
145
146
|
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort:hover.semi-table-cell-fixed-left::before, .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort:hover.semi-table-cell-fixed-right::before {
|
|
146
147
|
background-color: transparent;
|
package/lib/es/table/table.scss
CHANGED
|
@@ -145,7 +145,8 @@ $module: #{$prefix}-table;
|
|
|
145
145
|
&.#{$module}-row-head-clickSort {
|
|
146
146
|
cursor: pointer;
|
|
147
147
|
&:hover {
|
|
148
|
-
background: $color-table_th-clickSort-bg-hover;
|
|
148
|
+
background-image: linear-gradient(0deg, $color-table_th-clickSort-bg-hover, $color-table_th-clickSort-bg-hover);
|
|
149
|
+
background-color: $color-table_cell-bg-hover;
|
|
149
150
|
|
|
150
151
|
&.#{$module}-cell-fixed {
|
|
151
152
|
&-left,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.70.0
|
|
3
|
+
"version": "2.70.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.70.0
|
|
10
|
+
"@douyinfe/semi-animation": "2.70.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": "
|
|
31
|
+
"gitHead": "0c25d2be6eecc7bb66a02630eeceee81834be9db",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
34
34
|
"@babel/preset-env": "^7.15.8",
|
package/table/table.scss
CHANGED
|
@@ -145,7 +145,8 @@ $module: #{$prefix}-table;
|
|
|
145
145
|
&.#{$module}-row-head-clickSort {
|
|
146
146
|
cursor: pointer;
|
|
147
147
|
&:hover {
|
|
148
|
-
background: $color-table_th-clickSort-bg-hover;
|
|
148
|
+
background-image: linear-gradient(0deg, $color-table_th-clickSort-bg-hover, $color-table_th-clickSort-bg-hover);
|
|
149
|
+
background-color: $color-table_cell-bg-hover;
|
|
149
150
|
|
|
150
151
|
&.#{$module}-cell-fixed {
|
|
151
152
|
&-left,
|