@douyinfe/semi-foundation 2.89.0 → 2.90.0-beta.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/aiChatDialogue/foundation.ts +3 -0
- package/chat/foundation.ts +4 -0
- package/chat/inputboxFoundation.ts +6 -1
- package/lib/cjs/aiChatDialogue/foundation.d.ts +3 -0
- package/lib/cjs/aiChatDialogue/foundation.js +3 -0
- package/lib/cjs/chat/foundation.d.ts +3 -0
- package/lib/cjs/chat/foundation.js +5 -0
- package/lib/cjs/chat/inputboxFoundation.js +7 -1
- package/lib/cjs/table/table.css +13 -8
- package/lib/cjs/table/table.scss +36 -18
- package/lib/cjs/tagInput/foundation.d.ts +1 -0
- package/lib/cjs/tagInput/foundation.js +13 -4
- package/lib/es/aiChatDialogue/foundation.d.ts +3 -0
- package/lib/es/aiChatDialogue/foundation.js +3 -0
- package/lib/es/chat/foundation.d.ts +3 -0
- package/lib/es/chat/foundation.js +4 -0
- package/lib/es/chat/inputboxFoundation.js +7 -1
- package/lib/es/table/table.css +13 -8
- package/lib/es/table/table.scss +36 -18
- package/lib/es/tagInput/foundation.d.ts +1 -0
- package/lib/es/tagInput/foundation.js +13 -4
- package/package.json +4 -4
- package/table/table.scss +36 -18
- package/tagInput/foundation.ts +12 -4
|
@@ -3,6 +3,9 @@ import BaseFoundation, { DefaultAdapter } from "../base/foundation";
|
|
|
3
3
|
import { getUuidv4 } from "../utils/uuid";
|
|
4
4
|
import { strings } from "./constants";
|
|
5
5
|
import { Animation } from '@douyinfe/semi-animation';
|
|
6
|
+
import 'prismjs';
|
|
7
|
+
import "prismjs/components/prism-jsx.js";
|
|
8
|
+
import "prismjs/components/prism-tsx.js";
|
|
6
9
|
|
|
7
10
|
export interface DialogueAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
8
11
|
getContainerRef: () => HTMLDivElement;
|
package/chat/foundation.ts
CHANGED
|
@@ -4,6 +4,10 @@ import { Animation } from '@douyinfe/semi-animation';
|
|
|
4
4
|
import { debounce } from "lodash";
|
|
5
5
|
import { getUuidv4 } from "../utils/uuid";
|
|
6
6
|
import { handlePrevent } from "../utils/a11y";
|
|
7
|
+
// code's default height type is html/js/css, add jsx & tsx;
|
|
8
|
+
import 'prismjs';
|
|
9
|
+
import "prismjs/components/prism-jsx.js";
|
|
10
|
+
import "prismjs/components/prism-tsx.js";
|
|
7
11
|
|
|
8
12
|
const { PIC_PREFIX, PIC_SUFFIX_ARRAY, ROLE,
|
|
9
13
|
SCROLL_ANIMATION_TIME, SHOW_SCROLL_GAP
|
|
@@ -60,7 +60,12 @@ export default class InputBoxFoundation <P = Record<string, any>, S = Record<str
|
|
|
60
60
|
|
|
61
61
|
getDisableSend = () => {
|
|
62
62
|
const { content, attachment } = this.getStates();
|
|
63
|
-
const { disableSend: disableSendInProps } = this.getProps();
|
|
63
|
+
const { disableSend: disableSendInProps, canSend } = this.getProps();
|
|
64
|
+
// 如果用户设置了 canSend API,则使用 canSend 值
|
|
65
|
+
// If the user has configured the canSend API, then the canSend value will be used.
|
|
66
|
+
if (typeof canSend === 'boolean') {
|
|
67
|
+
return !canSend;
|
|
68
|
+
}
|
|
64
69
|
/** 不能发送的条件:(满足任1)
|
|
65
70
|
* 1. props 中禁止发送;2. 没有文本输入,且没有上传文件; 3.上传文件中有状态不为 success 的
|
|
66
71
|
* Conditions under which content cannot be sent: (any one of the following conditions must be met)
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation";
|
|
3
|
+
import 'prismjs';
|
|
4
|
+
import "prismjs/components/prism-jsx.js";
|
|
5
|
+
import "prismjs/components/prism-tsx.js";
|
|
3
6
|
export interface DialogueAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
4
7
|
getContainerRef: () => HTMLDivElement;
|
|
5
8
|
setWheelScroll: (flag: boolean) => void;
|
|
@@ -9,6 +9,9 @@ var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
|
9
9
|
var _uuid = require("../utils/uuid");
|
|
10
10
|
var _constants = require("./constants");
|
|
11
11
|
var _semiAnimation = require("@douyinfe/semi-animation");
|
|
12
|
+
require("prismjs");
|
|
13
|
+
require("prismjs/components/prism-jsx.js");
|
|
14
|
+
require("prismjs/components/prism-tsx.js");
|
|
12
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
16
|
class DialogueFoundation extends _foundation.default {
|
|
14
17
|
constructor(adapter) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation";
|
|
3
|
+
import 'prismjs';
|
|
4
|
+
import "prismjs/components/prism-jsx.js";
|
|
5
|
+
import "prismjs/components/prism-tsx.js";
|
|
3
6
|
export interface Content {
|
|
4
7
|
type: 'text' | 'image_url' | 'file_url';
|
|
5
8
|
text?: string;
|
|
@@ -10,7 +10,12 @@ var _constants = require("./constants");
|
|
|
10
10
|
var _semiAnimation = require("@douyinfe/semi-animation");
|
|
11
11
|
var _uuid = require("../utils/uuid");
|
|
12
12
|
var _a11y = require("../utils/a11y");
|
|
13
|
+
require("prismjs");
|
|
14
|
+
require("prismjs/components/prism-jsx.js");
|
|
15
|
+
require("prismjs/components/prism-tsx.js");
|
|
13
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
// code's default height type is html/js/css, add jsx & tsx;
|
|
18
|
+
|
|
14
19
|
const {
|
|
15
20
|
PIC_PREFIX,
|
|
16
21
|
PIC_SUFFIX_ARRAY,
|
|
@@ -75,8 +75,14 @@ class InputBoxFoundation extends _foundation.default {
|
|
|
75
75
|
attachment
|
|
76
76
|
} = this.getStates();
|
|
77
77
|
const {
|
|
78
|
-
disableSend: disableSendInProps
|
|
78
|
+
disableSend: disableSendInProps,
|
|
79
|
+
canSend
|
|
79
80
|
} = this.getProps();
|
|
81
|
+
// 如果用户设置了 canSend API,则使用 canSend 值
|
|
82
|
+
// If the user has configured the canSend API, then the canSend value will be used.
|
|
83
|
+
if (typeof canSend === 'boolean') {
|
|
84
|
+
return !canSend;
|
|
85
|
+
}
|
|
80
86
|
/** 不能发送的条件:(满足任1)
|
|
81
87
|
* 1. props 中禁止发送;2. 没有文本输入,且没有上传文件; 3.上传文件中有状态不为 success 的
|
|
82
88
|
* Conditions under which content cannot be sent: (any one of the following conditions must be met)
|
package/lib/cjs/table/table.css
CHANGED
|
@@ -388,36 +388,41 @@
|
|
|
388
388
|
.semi-table .semi-table-column-filter.on {
|
|
389
389
|
color: var(--semi-color-primary);
|
|
390
390
|
}
|
|
391
|
-
.semi-table-bordered .semi-table-title {
|
|
391
|
+
.semi-table-bordered > .semi-table-title {
|
|
392
392
|
padding-left: 16px;
|
|
393
393
|
padding-right: 16px;
|
|
394
394
|
border-top: 1px solid var(--semi-color-border);
|
|
395
395
|
border-right: 1px solid var(--semi-color-border);
|
|
396
396
|
border-left: 1px solid var(--semi-color-border);
|
|
397
397
|
}
|
|
398
|
-
.semi-table-bordered .semi-table-container {
|
|
398
|
+
.semi-table-bordered > .semi-table-container {
|
|
399
399
|
border: 1px solid var(--semi-color-border);
|
|
400
400
|
border-right: 0;
|
|
401
401
|
border-bottom: 0;
|
|
402
402
|
}
|
|
403
|
-
.semi-table-bordered .semi-table-header::-webkit-scrollbar {
|
|
403
|
+
:where(.semi-table-bordered) > .semi-table-container > .semi-table-header::-webkit-scrollbar {
|
|
404
404
|
border-right: 1px solid var(--semi-color-border);
|
|
405
405
|
}
|
|
406
|
-
.semi-table-bordered .semi-table-footer {
|
|
406
|
+
:where(.semi-table-bordered) > .semi-table-container > .semi-table-footer {
|
|
407
407
|
border-left: 1px solid var(--semi-color-border);
|
|
408
408
|
border-right: 1px solid var(--semi-color-border);
|
|
409
409
|
border-bottom: 1px solid var(--semi-color-border);
|
|
410
410
|
}
|
|
411
|
-
.semi-table-bordered .semi-table-
|
|
411
|
+
:where(.semi-table-bordered > .semi-table-container) > .semi-table-body > .semi-table-placeholder {
|
|
412
|
+
border-right: 1px solid var(--semi-color-border);
|
|
413
|
+
}
|
|
414
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-body) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head .react-resizable-handle {
|
|
412
415
|
background-color: transparent;
|
|
413
416
|
}
|
|
414
|
-
.semi-table-bordered .semi-table-thead > .semi-table-row > .semi-table-row-head,
|
|
415
|
-
.semi-table-bordered .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
|
|
417
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-body) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head, :where(.semi-table-bordered > .semi-table-container > .semi-table-body) > .semi-table > .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
|
|
416
418
|
border-right: 1px solid var(--semi-color-border);
|
|
417
419
|
}
|
|
418
|
-
.semi-table-bordered .semi-table-
|
|
420
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-header) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head {
|
|
419
421
|
border-right: 1px solid var(--semi-color-border);
|
|
420
422
|
}
|
|
423
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-header) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head .react-resizable-handle {
|
|
424
|
+
background-color: transparent;
|
|
425
|
+
}
|
|
421
426
|
.semi-table-placeholder {
|
|
422
427
|
position: sticky;
|
|
423
428
|
left: 0px;
|
package/lib/cjs/table/table.scss
CHANGED
|
@@ -508,7 +508,7 @@ $module: #{$prefix}-table;
|
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
&-bordered {
|
|
511
|
-
.#{$module}-title {
|
|
511
|
+
& > .#{$module}-title {
|
|
512
512
|
padding-left: $spacing-table_bordered_titler-paddingLeft;
|
|
513
513
|
padding-right: $spacing-table_bordered_titler-paddingRight;
|
|
514
514
|
border-top: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
@@ -516,37 +516,55 @@ $module: #{$prefix}-table;
|
|
|
516
516
|
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
.#{$module}-container {
|
|
519
|
+
& > .#{$module}-container {
|
|
520
520
|
border: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
521
521
|
border-right: 0;
|
|
522
522
|
border-bottom: 0;
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
525
|
+
:where(&) {
|
|
526
|
+
& > .#{$module}-container {
|
|
527
|
+
& > .#{$module}-header {
|
|
528
|
+
&::-webkit-scrollbar {
|
|
529
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
& > .#{$module}-footer {
|
|
534
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
535
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
536
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
537
|
+
}
|
|
528
538
|
}
|
|
529
539
|
}
|
|
530
540
|
|
|
531
|
-
.#{$module}-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
541
|
+
:where(& > .#{$module}-container) {
|
|
542
|
+
& > .#{$module}-body > .#{$module}-placeholder {
|
|
543
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
544
|
+
}
|
|
535
545
|
}
|
|
536
546
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
547
|
+
:where(& > .#{$module}-container > .#{$module}-body) {
|
|
548
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
549
|
+
.react-resizable-handle {
|
|
550
|
+
background-color: transparent;
|
|
551
|
+
}
|
|
540
552
|
}
|
|
541
|
-
}
|
|
542
553
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
554
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
555
|
+
& > .#{$module} > .#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
556
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
557
|
+
}
|
|
546
558
|
}
|
|
547
559
|
|
|
548
|
-
.#{$module}-
|
|
549
|
-
|
|
560
|
+
:where(& > .#{$module}-container > .#{$module}-header) {
|
|
561
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
562
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
563
|
+
|
|
564
|
+
.react-resizable-handle {
|
|
565
|
+
background-color: transparent;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
550
568
|
}
|
|
551
569
|
}
|
|
552
570
|
|
|
@@ -33,6 +33,7 @@ declare class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
33
33
|
*/
|
|
34
34
|
handleInputChange: (e: TagInputChangeEvent) => void;
|
|
35
35
|
handleInputCompositionStart: (e: any) => void;
|
|
36
|
+
_splitArray: (originString: string, separators: string | string[] | null) => any;
|
|
36
37
|
handleInputCompositionEnd: (e: any) => void;
|
|
37
38
|
/**
|
|
38
39
|
* check whether the input change is legal
|
|
@@ -49,6 +49,15 @@ class TagInputFoundation extends _foundation.default {
|
|
|
49
49
|
}
|
|
50
50
|
this._adapter.setEntering(true);
|
|
51
51
|
};
|
|
52
|
+
this._splitArray = (originString, separators) => {
|
|
53
|
+
const {
|
|
54
|
+
split
|
|
55
|
+
} = this.getProps();
|
|
56
|
+
if ((0, _isFunction2.default)(split)) {
|
|
57
|
+
return split(originString, separators);
|
|
58
|
+
}
|
|
59
|
+
return (0, _getSplitedArray.default)(originString, separators);
|
|
60
|
+
};
|
|
52
61
|
this.handleInputCompositionEnd = e => {
|
|
53
62
|
const {
|
|
54
63
|
value
|
|
@@ -63,7 +72,7 @@ class TagInputFoundation extends _foundation.default {
|
|
|
63
72
|
}
|
|
64
73
|
this._adapter.setEntering(false);
|
|
65
74
|
let allowChange = true;
|
|
66
|
-
const inputArr =
|
|
75
|
+
const inputArr = this._splitArray(value, separator);
|
|
67
76
|
let index = 0;
|
|
68
77
|
for (; index < inputArr.length; index++) {
|
|
69
78
|
if (inputArr[index].length > maxLength) {
|
|
@@ -100,8 +109,8 @@ class TagInputFoundation extends _foundation.default {
|
|
|
100
109
|
} = this._adapter.getStates();
|
|
101
110
|
let allowChange = true;
|
|
102
111
|
if ((0, _isNumber2.default)(maxLength)) {
|
|
103
|
-
const valueArr =
|
|
104
|
-
const inputArr =
|
|
112
|
+
const valueArr = this._splitArray(value, separator);
|
|
113
|
+
const inputArr = this._splitArray(inputValue, separator);
|
|
105
114
|
const maxLen = Math.max(valueArr.length, inputArr.length);
|
|
106
115
|
for (let i = 0; i < maxLen; i++) {
|
|
107
116
|
// When the input length is increasing
|
|
@@ -154,7 +163,7 @@ class TagInputFoundation extends _foundation.default {
|
|
|
154
163
|
inputValue,
|
|
155
164
|
tagsArray
|
|
156
165
|
} = this._adapter.getStates();
|
|
157
|
-
let addTags =
|
|
166
|
+
let addTags = this._splitArray(inputValue, separator);
|
|
158
167
|
addTags = addTags.filter((item, idx) => {
|
|
159
168
|
// If allowDuplicates is false, then filter duplicates
|
|
160
169
|
if (!allowDuplicates) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation";
|
|
3
|
+
import 'prismjs';
|
|
4
|
+
import "prismjs/components/prism-jsx.js";
|
|
5
|
+
import "prismjs/components/prism-tsx.js";
|
|
3
6
|
export interface DialogueAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
4
7
|
getContainerRef: () => HTMLDivElement;
|
|
5
8
|
setWheelScroll: (flag: boolean) => void;
|
|
@@ -3,6 +3,9 @@ import BaseFoundation from "../base/foundation";
|
|
|
3
3
|
import { getUuidv4 } from "../utils/uuid";
|
|
4
4
|
import { strings } from "./constants";
|
|
5
5
|
import { Animation } from '@douyinfe/semi-animation';
|
|
6
|
+
import 'prismjs';
|
|
7
|
+
import "prismjs/components/prism-jsx.js";
|
|
8
|
+
import "prismjs/components/prism-tsx.js";
|
|
6
9
|
export default class DialogueFoundation extends BaseFoundation {
|
|
7
10
|
constructor(adapter) {
|
|
8
11
|
super(Object.assign({}, adapter));
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation";
|
|
3
|
+
import 'prismjs';
|
|
4
|
+
import "prismjs/components/prism-jsx.js";
|
|
5
|
+
import "prismjs/components/prism-tsx.js";
|
|
3
6
|
export interface Content {
|
|
4
7
|
type: 'text' | 'image_url' | 'file_url';
|
|
5
8
|
text?: string;
|
|
@@ -4,6 +4,10 @@ import { strings } from "./constants";
|
|
|
4
4
|
import { Animation } from '@douyinfe/semi-animation';
|
|
5
5
|
import { getUuidv4 } from "../utils/uuid";
|
|
6
6
|
import { handlePrevent } from "../utils/a11y";
|
|
7
|
+
// code's default height type is html/js/css, add jsx & tsx;
|
|
8
|
+
import 'prismjs';
|
|
9
|
+
import "prismjs/components/prism-jsx.js";
|
|
10
|
+
import "prismjs/components/prism-tsx.js";
|
|
7
11
|
const {
|
|
8
12
|
PIC_PREFIX,
|
|
9
13
|
PIC_SUFFIX_ARRAY,
|
|
@@ -68,8 +68,14 @@ export default class InputBoxFoundation extends BaseFoundation {
|
|
|
68
68
|
attachment
|
|
69
69
|
} = this.getStates();
|
|
70
70
|
const {
|
|
71
|
-
disableSend: disableSendInProps
|
|
71
|
+
disableSend: disableSendInProps,
|
|
72
|
+
canSend
|
|
72
73
|
} = this.getProps();
|
|
74
|
+
// 如果用户设置了 canSend API,则使用 canSend 值
|
|
75
|
+
// If the user has configured the canSend API, then the canSend value will be used.
|
|
76
|
+
if (typeof canSend === 'boolean') {
|
|
77
|
+
return !canSend;
|
|
78
|
+
}
|
|
73
79
|
/** 不能发送的条件:(满足任1)
|
|
74
80
|
* 1. props 中禁止发送;2. 没有文本输入,且没有上传文件; 3.上传文件中有状态不为 success 的
|
|
75
81
|
* Conditions under which content cannot be sent: (any one of the following conditions must be met)
|
package/lib/es/table/table.css
CHANGED
|
@@ -388,36 +388,41 @@
|
|
|
388
388
|
.semi-table .semi-table-column-filter.on {
|
|
389
389
|
color: var(--semi-color-primary);
|
|
390
390
|
}
|
|
391
|
-
.semi-table-bordered .semi-table-title {
|
|
391
|
+
.semi-table-bordered > .semi-table-title {
|
|
392
392
|
padding-left: 16px;
|
|
393
393
|
padding-right: 16px;
|
|
394
394
|
border-top: 1px solid var(--semi-color-border);
|
|
395
395
|
border-right: 1px solid var(--semi-color-border);
|
|
396
396
|
border-left: 1px solid var(--semi-color-border);
|
|
397
397
|
}
|
|
398
|
-
.semi-table-bordered .semi-table-container {
|
|
398
|
+
.semi-table-bordered > .semi-table-container {
|
|
399
399
|
border: 1px solid var(--semi-color-border);
|
|
400
400
|
border-right: 0;
|
|
401
401
|
border-bottom: 0;
|
|
402
402
|
}
|
|
403
|
-
.semi-table-bordered .semi-table-header::-webkit-scrollbar {
|
|
403
|
+
:where(.semi-table-bordered) > .semi-table-container > .semi-table-header::-webkit-scrollbar {
|
|
404
404
|
border-right: 1px solid var(--semi-color-border);
|
|
405
405
|
}
|
|
406
|
-
.semi-table-bordered .semi-table-footer {
|
|
406
|
+
:where(.semi-table-bordered) > .semi-table-container > .semi-table-footer {
|
|
407
407
|
border-left: 1px solid var(--semi-color-border);
|
|
408
408
|
border-right: 1px solid var(--semi-color-border);
|
|
409
409
|
border-bottom: 1px solid var(--semi-color-border);
|
|
410
410
|
}
|
|
411
|
-
.semi-table-bordered .semi-table-
|
|
411
|
+
:where(.semi-table-bordered > .semi-table-container) > .semi-table-body > .semi-table-placeholder {
|
|
412
|
+
border-right: 1px solid var(--semi-color-border);
|
|
413
|
+
}
|
|
414
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-body) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head .react-resizable-handle {
|
|
412
415
|
background-color: transparent;
|
|
413
416
|
}
|
|
414
|
-
.semi-table-bordered .semi-table-thead > .semi-table-row > .semi-table-row-head,
|
|
415
|
-
.semi-table-bordered .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
|
|
417
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-body) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head, :where(.semi-table-bordered > .semi-table-container > .semi-table-body) > .semi-table > .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
|
|
416
418
|
border-right: 1px solid var(--semi-color-border);
|
|
417
419
|
}
|
|
418
|
-
.semi-table-bordered .semi-table-
|
|
420
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-header) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head {
|
|
419
421
|
border-right: 1px solid var(--semi-color-border);
|
|
420
422
|
}
|
|
423
|
+
:where(.semi-table-bordered > .semi-table-container > .semi-table-header) > .semi-table > .semi-table-thead > .semi-table-row > .semi-table-row-head .react-resizable-handle {
|
|
424
|
+
background-color: transparent;
|
|
425
|
+
}
|
|
421
426
|
.semi-table-placeholder {
|
|
422
427
|
position: sticky;
|
|
423
428
|
left: 0px;
|
package/lib/es/table/table.scss
CHANGED
|
@@ -508,7 +508,7 @@ $module: #{$prefix}-table;
|
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
&-bordered {
|
|
511
|
-
.#{$module}-title {
|
|
511
|
+
& > .#{$module}-title {
|
|
512
512
|
padding-left: $spacing-table_bordered_titler-paddingLeft;
|
|
513
513
|
padding-right: $spacing-table_bordered_titler-paddingRight;
|
|
514
514
|
border-top: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
@@ -516,37 +516,55 @@ $module: #{$prefix}-table;
|
|
|
516
516
|
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
.#{$module}-container {
|
|
519
|
+
& > .#{$module}-container {
|
|
520
520
|
border: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
521
521
|
border-right: 0;
|
|
522
522
|
border-bottom: 0;
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
525
|
+
:where(&) {
|
|
526
|
+
& > .#{$module}-container {
|
|
527
|
+
& > .#{$module}-header {
|
|
528
|
+
&::-webkit-scrollbar {
|
|
529
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
& > .#{$module}-footer {
|
|
534
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
535
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
536
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
537
|
+
}
|
|
528
538
|
}
|
|
529
539
|
}
|
|
530
540
|
|
|
531
|
-
.#{$module}-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
541
|
+
:where(& > .#{$module}-container) {
|
|
542
|
+
& > .#{$module}-body > .#{$module}-placeholder {
|
|
543
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
544
|
+
}
|
|
535
545
|
}
|
|
536
546
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
547
|
+
:where(& > .#{$module}-container > .#{$module}-body) {
|
|
548
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
549
|
+
.react-resizable-handle {
|
|
550
|
+
background-color: transparent;
|
|
551
|
+
}
|
|
540
552
|
}
|
|
541
|
-
}
|
|
542
553
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
554
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
555
|
+
& > .#{$module} > .#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
556
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
557
|
+
}
|
|
546
558
|
}
|
|
547
559
|
|
|
548
|
-
.#{$module}-
|
|
549
|
-
|
|
560
|
+
:where(& > .#{$module}-container > .#{$module}-header) {
|
|
561
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
562
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
563
|
+
|
|
564
|
+
.react-resizable-handle {
|
|
565
|
+
background-color: transparent;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
550
568
|
}
|
|
551
569
|
}
|
|
552
570
|
|
|
@@ -33,6 +33,7 @@ declare class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
33
33
|
*/
|
|
34
34
|
handleInputChange: (e: TagInputChangeEvent) => void;
|
|
35
35
|
handleInputCompositionStart: (e: any) => void;
|
|
36
|
+
_splitArray: (originString: string, separators: string | string[] | null) => any;
|
|
36
37
|
handleInputCompositionEnd: (e: any) => void;
|
|
37
38
|
/**
|
|
38
39
|
* check whether the input change is legal
|
|
@@ -42,6 +42,15 @@ class TagInputFoundation extends BaseFoundation {
|
|
|
42
42
|
}
|
|
43
43
|
this._adapter.setEntering(true);
|
|
44
44
|
};
|
|
45
|
+
this._splitArray = (originString, separators) => {
|
|
46
|
+
const {
|
|
47
|
+
split
|
|
48
|
+
} = this.getProps();
|
|
49
|
+
if (_isFunction(split)) {
|
|
50
|
+
return split(originString, separators);
|
|
51
|
+
}
|
|
52
|
+
return getSplitedArray(originString, separators);
|
|
53
|
+
};
|
|
45
54
|
this.handleInputCompositionEnd = e => {
|
|
46
55
|
const {
|
|
47
56
|
value
|
|
@@ -56,7 +65,7 @@ class TagInputFoundation extends BaseFoundation {
|
|
|
56
65
|
}
|
|
57
66
|
this._adapter.setEntering(false);
|
|
58
67
|
let allowChange = true;
|
|
59
|
-
const inputArr =
|
|
68
|
+
const inputArr = this._splitArray(value, separator);
|
|
60
69
|
let index = 0;
|
|
61
70
|
for (; index < inputArr.length; index++) {
|
|
62
71
|
if (inputArr[index].length > maxLength) {
|
|
@@ -93,8 +102,8 @@ class TagInputFoundation extends BaseFoundation {
|
|
|
93
102
|
} = this._adapter.getStates();
|
|
94
103
|
let allowChange = true;
|
|
95
104
|
if (_isNumber(maxLength)) {
|
|
96
|
-
const valueArr =
|
|
97
|
-
const inputArr =
|
|
105
|
+
const valueArr = this._splitArray(value, separator);
|
|
106
|
+
const inputArr = this._splitArray(inputValue, separator);
|
|
98
107
|
const maxLen = Math.max(valueArr.length, inputArr.length);
|
|
99
108
|
for (let i = 0; i < maxLen; i++) {
|
|
100
109
|
// When the input length is increasing
|
|
@@ -147,7 +156,7 @@ class TagInputFoundation extends BaseFoundation {
|
|
|
147
156
|
inputValue,
|
|
148
157
|
tagsArray
|
|
149
158
|
} = this._adapter.getStates();
|
|
150
|
-
let addTags =
|
|
159
|
+
let addTags = this._splitArray(inputValue, separator);
|
|
151
160
|
addTags = addTags.filter((item, idx) => {
|
|
152
161
|
// If allowDuplicates is false, then filter duplicates
|
|
153
162
|
if (!allowDuplicates) {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.90.0-beta.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.
|
|
11
|
-
"@douyinfe/semi-json-viewer-core": "2.
|
|
10
|
+
"@douyinfe/semi-animation": "2.90.0-beta.0",
|
|
11
|
+
"@douyinfe/semi-json-viewer-core": "2.90.0-beta.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": "
|
|
32
|
+
"gitHead": "aa25e1ef1574f7588459cdaadf25a523d6d2f6c5",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
35
35
|
"@babel/preset-env": "^7.15.8",
|
package/table/table.scss
CHANGED
|
@@ -508,7 +508,7 @@ $module: #{$prefix}-table;
|
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
&-bordered {
|
|
511
|
-
.#{$module}-title {
|
|
511
|
+
& > .#{$module}-title {
|
|
512
512
|
padding-left: $spacing-table_bordered_titler-paddingLeft;
|
|
513
513
|
padding-right: $spacing-table_bordered_titler-paddingRight;
|
|
514
514
|
border-top: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
@@ -516,37 +516,55 @@ $module: #{$prefix}-table;
|
|
|
516
516
|
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
.#{$module}-container {
|
|
519
|
+
& > .#{$module}-container {
|
|
520
520
|
border: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
521
521
|
border-right: 0;
|
|
522
522
|
border-bottom: 0;
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
525
|
+
:where(&) {
|
|
526
|
+
& > .#{$module}-container {
|
|
527
|
+
& > .#{$module}-header {
|
|
528
|
+
&::-webkit-scrollbar {
|
|
529
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
& > .#{$module}-footer {
|
|
534
|
+
border-left: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
535
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
536
|
+
border-bottom: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
537
|
+
}
|
|
528
538
|
}
|
|
529
539
|
}
|
|
530
540
|
|
|
531
|
-
.#{$module}-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
541
|
+
:where(& > .#{$module}-container) {
|
|
542
|
+
& > .#{$module}-body > .#{$module}-placeholder {
|
|
543
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
544
|
+
}
|
|
535
545
|
}
|
|
536
546
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
547
|
+
:where(& > .#{$module}-container > .#{$module}-body) {
|
|
548
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
549
|
+
.react-resizable-handle {
|
|
550
|
+
background-color: transparent;
|
|
551
|
+
}
|
|
540
552
|
}
|
|
541
|
-
}
|
|
542
553
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
554
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
555
|
+
& > .#{$module} > .#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
556
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
557
|
+
}
|
|
546
558
|
}
|
|
547
559
|
|
|
548
|
-
.#{$module}-
|
|
549
|
-
|
|
560
|
+
:where(& > .#{$module}-container > .#{$module}-header) {
|
|
561
|
+
& > .#{$module} > .#{$module}-thead > .#{$module}-row > .#{$module}-row-head {
|
|
562
|
+
border-right: $width-table_base_border $border-table_base-borderStyle $color-table-border-default;
|
|
563
|
+
|
|
564
|
+
.react-resizable-handle {
|
|
565
|
+
background-color: transparent;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
550
568
|
}
|
|
551
569
|
}
|
|
552
570
|
|
package/tagInput/foundation.ts
CHANGED
|
@@ -73,6 +73,14 @@ class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
73
73
|
this._adapter.setEntering(true);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
_splitArray = (originString: string, separators: string | string[] | null) => {
|
|
77
|
+
const { split } = this.getProps();
|
|
78
|
+
if (isFunction(split)) {
|
|
79
|
+
return split(originString, separators);
|
|
80
|
+
}
|
|
81
|
+
return getSplitedArray(originString, separators);
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
handleInputCompositionEnd = (e: any) => {
|
|
77
85
|
const { value } = e.target;
|
|
78
86
|
const {
|
|
@@ -85,7 +93,7 @@ class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
85
93
|
}
|
|
86
94
|
this._adapter.setEntering(false);
|
|
87
95
|
let allowChange = true;
|
|
88
|
-
const inputArr =
|
|
96
|
+
const inputArr = this._splitArray(value, separator);
|
|
89
97
|
let index = 0;
|
|
90
98
|
for (; index < inputArr.length; index++) {
|
|
91
99
|
if (inputArr[index].length > maxLength) {
|
|
@@ -121,8 +129,8 @@ class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
121
129
|
const { inputValue } = this._adapter.getStates();
|
|
122
130
|
let allowChange = true;
|
|
123
131
|
if (isNumber(maxLength)) {
|
|
124
|
-
const valueArr =
|
|
125
|
-
const inputArr =
|
|
132
|
+
const valueArr = this._splitArray(value, separator);
|
|
133
|
+
const inputArr = this._splitArray(inputValue, separator);
|
|
126
134
|
const maxLen = Math.max(valueArr.length, inputArr.length);
|
|
127
135
|
for (let i = 0; i < maxLen; i++) {
|
|
128
136
|
// When the input length is increasing
|
|
@@ -174,7 +182,7 @@ class TagInputFoundation extends BaseFoundation<TagInputAdapter> {
|
|
|
174
182
|
inputValue,
|
|
175
183
|
tagsArray
|
|
176
184
|
} = this._adapter.getStates();
|
|
177
|
-
let addTags =
|
|
185
|
+
let addTags = this._splitArray(inputValue, separator);
|
|
178
186
|
|
|
179
187
|
addTags = addTags.filter((item, idx) => {
|
|
180
188
|
// If allowDuplicates is false, then filter duplicates
|