@douyinfe/semi-foundation 2.64.0 → 2.65.0-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.
- package/button/button.scss +5 -0
- package/button/iconButton.scss +5 -1
- package/cascader/foundation.ts +2 -0
- package/chat/chat.scss +1 -1
- package/datePicker/datePicker.scss +12 -0
- package/datePicker/monthsGridFoundation.ts +3 -4
- package/input/foundation.ts +3 -14
- package/input/textareaFoundation.ts +2 -14
- package/input/util/truncateValue.ts +25 -0
- package/lib/cjs/button/button.css +4 -0
- package/lib/cjs/button/button.scss +5 -0
- package/lib/cjs/button/iconButton.css +4 -0
- package/lib/cjs/button/iconButton.scss +5 -1
- package/lib/cjs/cascader/foundation.js +2 -0
- package/lib/cjs/chat/chat.css +1 -1
- package/lib/cjs/chat/chat.scss +1 -1
- package/lib/cjs/datePicker/datePicker.css +9 -0
- package/lib/cjs/datePicker/datePicker.scss +12 -0
- package/lib/cjs/datePicker/monthsGridFoundation.js +2 -3
- package/lib/cjs/input/foundation.d.ts +1 -1
- package/lib/cjs/input/foundation.js +7 -14
- package/lib/cjs/input/textareaFoundation.js +6 -14
- package/lib/cjs/input/util/truncateValue.d.ts +5 -0
- package/lib/cjs/input/util/truncateValue.js +31 -0
- package/lib/cjs/markdownRender/foundation.d.ts +3 -0
- package/lib/cjs/markdownRender/foundation.js +6 -2
- package/lib/cjs/overflowList/foundation.js +4 -3
- package/lib/cjs/slider/foundation.js +6 -1
- package/lib/cjs/table/animation.scss +2 -0
- package/lib/cjs/table/table.css +10 -0
- package/lib/cjs/table/table.scss +17 -0
- package/lib/cjs/table/variables.scss +1 -0
- package/lib/cjs/tabs/constants.d.ts +1 -0
- package/lib/cjs/tabs/constants.js +2 -1
- package/lib/cjs/tabs/tabs.css +29 -0
- package/lib/cjs/tabs/tabs.scss +42 -0
- package/lib/cjs/tabs/variables.scss +12 -0
- package/lib/es/button/button.css +4 -0
- package/lib/es/button/button.scss +5 -0
- package/lib/es/button/iconButton.css +4 -0
- package/lib/es/button/iconButton.scss +5 -1
- package/lib/es/cascader/foundation.js +2 -0
- package/lib/es/chat/chat.css +1 -1
- package/lib/es/chat/chat.scss +1 -1
- package/lib/es/datePicker/datePicker.css +9 -0
- package/lib/es/datePicker/datePicker.scss +12 -0
- package/lib/es/datePicker/monthsGridFoundation.js +2 -3
- package/lib/es/input/foundation.d.ts +1 -1
- package/lib/es/input/foundation.js +7 -14
- package/lib/es/input/textareaFoundation.js +6 -14
- package/lib/es/input/util/truncateValue.d.ts +5 -0
- package/lib/es/input/util/truncateValue.js +24 -0
- package/lib/es/markdownRender/foundation.d.ts +3 -0
- package/lib/es/markdownRender/foundation.js +6 -2
- package/lib/es/overflowList/foundation.js +4 -3
- package/lib/es/slider/foundation.js +6 -1
- package/lib/es/table/animation.scss +2 -0
- package/lib/es/table/table.css +10 -0
- package/lib/es/table/table.scss +17 -0
- package/lib/es/table/variables.scss +1 -0
- package/lib/es/tabs/constants.d.ts +1 -0
- package/lib/es/tabs/constants.js +2 -1
- package/lib/es/tabs/tabs.css +29 -0
- package/lib/es/tabs/tabs.scss +42 -0
- package/lib/es/tabs/variables.scss +12 -0
- package/markdownRender/foundation.ts +9 -3
- package/overflowList/foundation.ts +6 -4
- package/package.json +3 -3
- package/slider/foundation.ts +6 -1
- package/table/animation.scss +2 -0
- package/table/table.scss +17 -0
- package/table/variables.scss +1 -0
- package/tabs/constants.ts +2 -1
- package/tabs/tabs.scss +42 -0
- package/tabs/variables.scss +12 -0
package/button/button.scss
CHANGED
package/button/iconButton.scss
CHANGED
|
@@ -60,12 +60,16 @@ $module: #{$prefix}-button;
|
|
|
60
60
|
|
|
61
61
|
&-left {
|
|
62
62
|
margin-right: $spacing-button_iconOnly_content-marginRight;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
&-right {
|
|
66
68
|
margin-left: $spacing-button_iconOnly_content-marginLeft;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
|
|
71
|
-
@import "./rtl.scss";
|
|
75
|
+
@import "./rtl.scss";
|
package/cascader/foundation.ts
CHANGED
|
@@ -926,6 +926,7 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
|
|
|
926
926
|
filteredKeys: new Set(filteredKeys),
|
|
927
927
|
});
|
|
928
928
|
this._adapter.notifyOnSearch(sugInput);
|
|
929
|
+
this._adapter.rePositionDropdown();
|
|
929
930
|
}
|
|
930
931
|
|
|
931
932
|
handleClear() {
|
|
@@ -1039,6 +1040,7 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
|
|
|
1039
1040
|
}
|
|
1040
1041
|
const removedItem = keyEntities[key] ?? {};
|
|
1041
1042
|
!removedItem?.data?.disable && this._handleMultipleSelect(removedItem);
|
|
1043
|
+
this._adapter.rePositionDropdown();
|
|
1042
1044
|
}
|
|
1043
1045
|
|
|
1044
1046
|
handleTagRemoveInTrigger = (pos: string) => {
|
package/chat/chat.scss
CHANGED
|
@@ -119,7 +119,7 @@ $module: #{$prefix}-chat;
|
|
|
119
119
|
display: flex;
|
|
120
120
|
flex-direction: row;
|
|
121
121
|
margin-top: $spacing-chat_chatBox-marginY;
|
|
122
|
-
margin-
|
|
122
|
+
margin-bottom: $spacing-chat_chatBox-marginY;
|
|
123
123
|
column-gap: $spacing-chat_chatBox-columnGap;
|
|
124
124
|
|
|
125
125
|
&:hover {
|
|
@@ -8,6 +8,10 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
display: inline-block;
|
|
10
10
|
|
|
11
|
+
&-container {
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
.#{$module-list}-body {
|
|
12
16
|
.#{$module-list}-item {
|
|
13
17
|
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
@@ -820,6 +824,14 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
820
824
|
&-topSlot {
|
|
821
825
|
border-bottom: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
822
826
|
}
|
|
827
|
+
|
|
828
|
+
&-leftSlot {
|
|
829
|
+
border-right: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
&-rightSlot {
|
|
833
|
+
border-left: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
834
|
+
}
|
|
823
835
|
|
|
824
836
|
&-bottomSlot {
|
|
825
837
|
border-top: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
@@ -613,11 +613,11 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
613
613
|
const multiple = this._isMultiple();
|
|
614
614
|
const { selected } = this.getStates();
|
|
615
615
|
const monthDetail = this._getPanelDetail(panelType);
|
|
616
|
-
const newSelected = new Set(multiple ? [...selected] : []);
|
|
616
|
+
const newSelected = new Set<string>(multiple ? [...selected] : []);
|
|
617
617
|
|
|
618
618
|
const { fullDate } = day;
|
|
619
619
|
const time = monthDetail.pickerDate;
|
|
620
|
-
const dateStr =
|
|
620
|
+
const dateStr = fullDate;
|
|
621
621
|
|
|
622
622
|
if (!multiple) {
|
|
623
623
|
newSelected.add(dateStr);
|
|
@@ -631,9 +631,8 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
|
|
634
|
-
const dateFormat = this.getValidDateFormat();
|
|
635
634
|
// When passed to the upper layer, it is converted into a Date object to ensure that the input parameter format of initFormDefaultValue is consistent
|
|
636
|
-
const newSelectedDates = [...newSelected].map(_dateStr => compatibleParse(_dateStr,
|
|
635
|
+
const newSelectedDates = [...newSelected].map(_dateStr => type === 'dateTime' ? this._mergeDateAndTime(_dateStr, time) : compatibleParse(_dateStr, strings.FORMAT_FULL_DATE, undefined, dateFnsLocale));
|
|
637
636
|
|
|
638
637
|
this.handleShowDateAndTime(panelType, time);
|
|
639
638
|
|
package/input/foundation.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { strings } from './constants';
|
|
|
3
3
|
import { noop, set, isNumber, isString, isFunction } from 'lodash';
|
|
4
4
|
|
|
5
5
|
import { ENTER_KEY } from './../utils/keyCode';
|
|
6
|
+
import truncateValue from './util/truncateValue';
|
|
6
7
|
|
|
7
8
|
export interface InputDefaultAdapter {
|
|
8
9
|
notifyChange: noopFunction;
|
|
@@ -112,6 +113,7 @@ class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
112
113
|
return value;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
116
|
+
return value;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
/**
|
|
@@ -122,20 +124,7 @@ class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
122
124
|
*/
|
|
123
125
|
handleTruncateValue(value: any, maxLength: number) {
|
|
124
126
|
const { getValueLength } = this._adapter.getProps();
|
|
125
|
-
|
|
126
|
-
let truncatedValue = '';
|
|
127
|
-
for (let i = 1, len = value.length; i <= len; i++) {
|
|
128
|
-
const currentValue = value.slice(0, i);
|
|
129
|
-
if (getValueLength(currentValue) > maxLength) {
|
|
130
|
-
return truncatedValue;
|
|
131
|
-
} else {
|
|
132
|
-
truncatedValue = currentValue;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return truncatedValue;
|
|
136
|
-
} else {
|
|
137
|
-
return value.slice(0, maxLength);
|
|
138
|
-
}
|
|
127
|
+
return truncateValue({ value, maxLength, getValueLength });
|
|
139
128
|
}
|
|
140
129
|
|
|
141
130
|
handleClear(e: any) {
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from 'lodash';
|
|
8
8
|
import calculateNodeHeight from './util/calculateNodeHeight';
|
|
9
9
|
import getSizingData from './util/getSizingData';
|
|
10
|
+
import truncateValue from './util/truncateValue';
|
|
10
11
|
|
|
11
12
|
export interface TextAreaDefaultAdapter {
|
|
12
13
|
notifyChange: noopFunction;
|
|
@@ -124,20 +125,7 @@ export default class TextAreaFoundation extends BaseFoundation<TextAreaAdapter>
|
|
|
124
125
|
*/
|
|
125
126
|
handleTruncateValue(value: string, maxLength: number) {
|
|
126
127
|
const { getValueLength } = this._adapter.getProps();
|
|
127
|
-
|
|
128
|
-
let truncatedValue = '';
|
|
129
|
-
for (let i = 1, len = value.length; i <= len; i++) {
|
|
130
|
-
const currentValue = value.slice(0, i);
|
|
131
|
-
if (getValueLength(currentValue) > maxLength) {
|
|
132
|
-
return truncatedValue;
|
|
133
|
-
} else {
|
|
134
|
-
truncatedValue = currentValue;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return truncatedValue;
|
|
138
|
-
} else {
|
|
139
|
-
return value.slice(0, maxLength);
|
|
140
|
-
}
|
|
128
|
+
return truncateValue({ value, maxLength, getValueLength });
|
|
141
129
|
}
|
|
142
130
|
|
|
143
131
|
handleFocus(e: any) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isFunction } from 'lodash';
|
|
2
|
+
|
|
3
|
+
export default function truncateValue(options: {
|
|
4
|
+
value: string;
|
|
5
|
+
maxLength: number;
|
|
6
|
+
getValueLength?: (value: string) => number
|
|
7
|
+
}): string {
|
|
8
|
+
const { value, maxLength, getValueLength } = options;
|
|
9
|
+
if (isFunction(getValueLength)) {
|
|
10
|
+
let left = 0;
|
|
11
|
+
let right = value.length;
|
|
12
|
+
while (left < right) {
|
|
13
|
+
const mid = left + Math.floor((right - left) / 2);
|
|
14
|
+
const currentValue = value.slice(0, mid + 1);
|
|
15
|
+
if (getValueLength(currentValue) > maxLength) {
|
|
16
|
+
right = mid;
|
|
17
|
+
} else {
|
|
18
|
+
left = mid + 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return value.slice(0, left);
|
|
22
|
+
} else {
|
|
23
|
+
return value.slice(0, maxLength);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
.semi-button.semi-button-primary:focus-visible, .semi-button.semi-button-secondary:focus-visible, .semi-button.semi-button-tertiary:focus-visible, .semi-button.semi-button-warning:focus-visible, .semi-button.semi-button-danger:focus-visible {
|
|
47
47
|
outline: 2px solid var(--semi-color-primary-light-active);
|
|
48
48
|
}
|
|
49
|
+
.semi-button-content {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
49
53
|
.semi-button-danger {
|
|
50
54
|
background-color: var(--semi-color-danger);
|
|
51
55
|
color: rgba(var(--semi-white), 1);
|
|
@@ -60,12 +60,16 @@ $module: #{$prefix}-button;
|
|
|
60
60
|
|
|
61
61
|
&-left {
|
|
62
62
|
margin-right: $spacing-button_iconOnly_content-marginRight;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
&-right {
|
|
66
68
|
margin-left: $spacing-button_iconOnly_content-marginLeft;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
|
|
71
|
-
@import "./rtl.scss";
|
|
75
|
+
@import "./rtl.scss";
|
|
@@ -49,6 +49,7 @@ class CascaderFoundation extends _foundation.default {
|
|
|
49
49
|
}
|
|
50
50
|
const removedItem = (_a = keyEntities[key]) !== null && _a !== void 0 ? _a : {};
|
|
51
51
|
!((_b = removedItem === null || removedItem === void 0 ? void 0 : removedItem.data) === null || _b === void 0 ? void 0 : _b.disable) && this._handleMultipleSelect(removedItem);
|
|
52
|
+
this._adapter.rePositionDropdown();
|
|
52
53
|
};
|
|
53
54
|
this.handleTagRemoveInTrigger = pos => {
|
|
54
55
|
const {
|
|
@@ -758,6 +759,7 @@ class CascaderFoundation extends _foundation.default {
|
|
|
758
759
|
filteredKeys: new Set(filteredKeys)
|
|
759
760
|
});
|
|
760
761
|
this._adapter.notifyOnSearch(sugInput);
|
|
762
|
+
this._adapter.rePositionDropdown();
|
|
761
763
|
}
|
|
762
764
|
handleClear() {
|
|
763
765
|
const {
|
package/lib/cjs/chat/chat.css
CHANGED
package/lib/cjs/chat/chat.scss
CHANGED
|
@@ -119,7 +119,7 @@ $module: #{$prefix}-chat;
|
|
|
119
119
|
display: flex;
|
|
120
120
|
flex-direction: row;
|
|
121
121
|
margin-top: $spacing-chat_chatBox-marginY;
|
|
122
|
-
margin-
|
|
122
|
+
margin-bottom: $spacing-chat_chatBox-marginY;
|
|
123
123
|
column-gap: $spacing-chat_chatBox-columnGap;
|
|
124
124
|
|
|
125
125
|
&:hover {
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
display: inline-block;
|
|
7
7
|
}
|
|
8
|
+
.semi-datepicker-container {
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
8
11
|
.semi-datepicker .semi-scrolllist-body .semi-scrolllist-item {
|
|
9
12
|
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
10
13
|
scrollbar-width: none; /* Firefox */
|
|
@@ -531,6 +534,12 @@
|
|
|
531
534
|
.semi-datepicker-topSlot {
|
|
532
535
|
border-bottom: 1px solid var(--semi-color-border);
|
|
533
536
|
}
|
|
537
|
+
.semi-datepicker-leftSlot {
|
|
538
|
+
border-right: 1px solid var(--semi-color-border);
|
|
539
|
+
}
|
|
540
|
+
.semi-datepicker-rightSlot {
|
|
541
|
+
border-left: 1px solid var(--semi-color-border);
|
|
542
|
+
}
|
|
534
543
|
.semi-datepicker-bottomSlot {
|
|
535
544
|
border-top: 1px solid var(--semi-color-border);
|
|
536
545
|
}
|
|
@@ -8,6 +8,10 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
display: inline-block;
|
|
10
10
|
|
|
11
|
+
&-container {
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
.#{$module-list}-body {
|
|
12
16
|
.#{$module-list}-item {
|
|
13
17
|
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
@@ -820,6 +824,14 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
820
824
|
&-topSlot {
|
|
821
825
|
border-bottom: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
822
826
|
}
|
|
827
|
+
|
|
828
|
+
&-leftSlot {
|
|
829
|
+
border-right: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
&-rightSlot {
|
|
833
|
+
border-left: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
834
|
+
}
|
|
823
835
|
|
|
824
836
|
&-bottomSlot {
|
|
825
837
|
border-top: $width-datepicker_slot-border solid $color-datepicker_border-bg-default;
|
|
@@ -544,7 +544,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
544
544
|
fullDate
|
|
545
545
|
} = day;
|
|
546
546
|
const time = monthDetail.pickerDate;
|
|
547
|
-
const dateStr =
|
|
547
|
+
const dateStr = fullDate;
|
|
548
548
|
if (!multiple) {
|
|
549
549
|
newSelected.add(dateStr);
|
|
550
550
|
} else {
|
|
@@ -556,9 +556,8 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
556
556
|
newSelected.add(dateStr);
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
const dateFormat = this.getValidDateFormat();
|
|
560
559
|
// When passed to the upper layer, it is converted into a Date object to ensure that the input parameter format of initFormDefaultValue is consistent
|
|
561
|
-
const newSelectedDates = [...newSelected].map(_dateStr => (0, _parser.compatibleParse)(_dateStr,
|
|
560
|
+
const newSelectedDates = [...newSelected].map(_dateStr => type === 'dateTime' ? this._mergeDateAndTime(_dateStr, time) : (0, _parser.compatibleParse)(_dateStr, _constants.strings.FORMAT_FULL_DATE, undefined, dateFnsLocale));
|
|
562
561
|
this.handleShowDateAndTime(panelType, time);
|
|
563
562
|
if (!isControlledComponent) {
|
|
564
563
|
// Uncontrolled components, update internal values when operating, and notify external
|
|
@@ -47,7 +47,7 @@ declare class InputFoundation extends BaseFoundation<InputAdapter> {
|
|
|
47
47
|
* @param {Number} maxLength
|
|
48
48
|
* @returns {String}
|
|
49
49
|
*/
|
|
50
|
-
handleTruncateValue(value: any, maxLength: number):
|
|
50
|
+
handleTruncateValue(value: any, maxLength: number): string;
|
|
51
51
|
handleClear(e: any): void;
|
|
52
52
|
/**
|
|
53
53
|
* trigger when click input wrapper
|
|
@@ -12,6 +12,7 @@ var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
|
12
12
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
13
13
|
var _constants = require("./constants");
|
|
14
14
|
var _keyCode = require("./../utils/keyCode");
|
|
15
|
+
var _truncateValue = _interopRequireDefault(require("./util/truncateValue"));
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
class InputFoundation extends _foundation.default {
|
|
17
18
|
static get inputDefaultAdapter() {
|
|
@@ -103,6 +104,7 @@ class InputFoundation extends _foundation.default {
|
|
|
103
104
|
return value;
|
|
104
105
|
}
|
|
105
106
|
}
|
|
107
|
+
return value;
|
|
106
108
|
}
|
|
107
109
|
/**
|
|
108
110
|
* Truncate input values based on maximum length
|
|
@@ -114,20 +116,11 @@ class InputFoundation extends _foundation.default {
|
|
|
114
116
|
const {
|
|
115
117
|
getValueLength
|
|
116
118
|
} = this._adapter.getProps();
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return truncatedValue;
|
|
123
|
-
} else {
|
|
124
|
-
truncatedValue = currentValue;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return truncatedValue;
|
|
128
|
-
} else {
|
|
129
|
-
return value.slice(0, maxLength);
|
|
130
|
-
}
|
|
119
|
+
return (0, _truncateValue.default)({
|
|
120
|
+
value,
|
|
121
|
+
maxLength,
|
|
122
|
+
getValueLength
|
|
123
|
+
});
|
|
131
124
|
}
|
|
132
125
|
handleClear(e) {
|
|
133
126
|
let eventObj = e;
|
|
@@ -11,6 +11,7 @@ var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
|
11
11
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
12
12
|
var _calculateNodeHeight = _interopRequireDefault(require("./util/calculateNodeHeight"));
|
|
13
13
|
var _getSizingData = _interopRequireDefault(require("./util/getSizingData"));
|
|
14
|
+
var _truncateValue = _interopRequireDefault(require("./util/truncateValue"));
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
class TextAreaFoundation extends _foundation.default {
|
|
16
17
|
static get textAreaDefaultAdapter() {
|
|
@@ -135,20 +136,11 @@ class TextAreaFoundation extends _foundation.default {
|
|
|
135
136
|
const {
|
|
136
137
|
getValueLength
|
|
137
138
|
} = this._adapter.getProps();
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return truncatedValue;
|
|
144
|
-
} else {
|
|
145
|
-
truncatedValue = currentValue;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return truncatedValue;
|
|
149
|
-
} else {
|
|
150
|
-
return value.slice(0, maxLength);
|
|
151
|
-
}
|
|
139
|
+
return (0, _truncateValue.default)({
|
|
140
|
+
value,
|
|
141
|
+
maxLength,
|
|
142
|
+
getValueLength
|
|
143
|
+
});
|
|
152
144
|
}
|
|
153
145
|
handleFocus(e) {
|
|
154
146
|
const {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = truncateValue;
|
|
7
|
+
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function truncateValue(options) {
|
|
10
|
+
const {
|
|
11
|
+
value,
|
|
12
|
+
maxLength,
|
|
13
|
+
getValueLength
|
|
14
|
+
} = options;
|
|
15
|
+
if ((0, _isFunction2.default)(getValueLength)) {
|
|
16
|
+
let left = 0;
|
|
17
|
+
let right = value.length;
|
|
18
|
+
while (left < right) {
|
|
19
|
+
const mid = left + Math.floor((right - left) / 2);
|
|
20
|
+
const currentValue = value.slice(0, mid + 1);
|
|
21
|
+
if (getValueLength(currentValue) > maxLength) {
|
|
22
|
+
right = mid;
|
|
23
|
+
} else {
|
|
24
|
+
left = mid + 1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return value.slice(0, left);
|
|
28
|
+
} else {
|
|
29
|
+
return value.slice(0, maxLength);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
2
2
|
import { MDXProps } from 'mdx/types';
|
|
3
|
+
import { type PluggableList } from "@mdx-js/mdx/lib/core";
|
|
3
4
|
export interface MarkdownRenderAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
4
5
|
getRuntime: () => any;
|
|
5
6
|
}
|
|
@@ -7,6 +8,8 @@ export interface MarkdownRenderBaseProps {
|
|
|
7
8
|
raw: string;
|
|
8
9
|
components: MDXProps['components'];
|
|
9
10
|
format: "md" | "mdx";
|
|
11
|
+
remarkPlugins?: PluggableList;
|
|
12
|
+
rehypePlugins?: PluggableList;
|
|
10
13
|
}
|
|
11
14
|
export interface MarkdownRenderBaseState {
|
|
12
15
|
MDXContentComponent: any;
|
|
@@ -39,13 +39,17 @@ class MarkdownRenderFoundation extends _foundation.default {
|
|
|
39
39
|
constructor() {
|
|
40
40
|
super(...arguments);
|
|
41
41
|
this.getOptions = () => {
|
|
42
|
+
var _a, _b, _c, _d;
|
|
42
43
|
return {
|
|
43
44
|
evaluateOptions: {
|
|
44
|
-
remarkPlugins: [_remarkGfm.default],
|
|
45
|
+
remarkPlugins: [_remarkGfm.default, ...((_a = this.getProp("remarkPlugins")) !== null && _a !== void 0 ? _a : [])],
|
|
46
|
+
rehypePlugins: (_b = this.getProp("rehypePlugins")) !== null && _b !== void 0 ? _b : [],
|
|
45
47
|
format: this.getProp("format")
|
|
46
48
|
},
|
|
47
49
|
compileOptions: {
|
|
48
|
-
format: this.getProp("format")
|
|
50
|
+
format: this.getProp("format"),
|
|
51
|
+
remarkPlugins: [_remarkGfm.default, ...((_c = this.getProp("remarkPlugins")) !== null && _c !== void 0 ? _c : [])],
|
|
52
|
+
rehypePlugins: (_d = this.getProp("rehypePlugins")) !== null && _d !== void 0 ? _d : []
|
|
49
53
|
},
|
|
50
54
|
runOptions: {}
|
|
51
55
|
};
|
|
@@ -39,7 +39,8 @@ class OverflowListFoundation extends _foundation.default {
|
|
|
39
39
|
if (!this.isScrollMode()) {
|
|
40
40
|
return overflow;
|
|
41
41
|
}
|
|
42
|
-
const
|
|
42
|
+
const cloneItems = (0, _fastCopy.default)(items);
|
|
43
|
+
const visibleStateArr = cloneItems.map(_ref => {
|
|
43
44
|
let {
|
|
44
45
|
key
|
|
45
46
|
} = _ref;
|
|
@@ -48,8 +49,8 @@ class OverflowListFoundation extends _foundation.default {
|
|
|
48
49
|
const visibleStart = visibleStateArr.indexOf(true);
|
|
49
50
|
const visibleEnd = visibleStateArr.lastIndexOf(true);
|
|
50
51
|
const overflowList = [];
|
|
51
|
-
overflowList[0] = visibleStart >= 0 ?
|
|
52
|
-
overflowList[1] = visibleEnd >= 0 ?
|
|
52
|
+
overflowList[0] = visibleStart >= 0 ? cloneItems.slice(0, visibleStart) : [];
|
|
53
|
+
overflowList[1] = visibleEnd >= 0 ? cloneItems.slice(visibleEnd + 1, cloneItems.length) : cloneItems;
|
|
53
54
|
return overflowList;
|
|
54
55
|
}
|
|
55
56
|
handleIntersect(entries) {
|
|
@@ -309,7 +309,12 @@ class SliderFoundation extends _foundation.default {
|
|
|
309
309
|
};
|
|
310
310
|
})();
|
|
311
311
|
if (Array.isArray(inputValue)) {
|
|
312
|
-
|
|
312
|
+
const min = transWay(inputValue[0]);
|
|
313
|
+
const max = transWay(inputValue[1]);
|
|
314
|
+
if (min > max) {
|
|
315
|
+
return this.getState("focusPos") === "min" ? [max, max] : [min, min];
|
|
316
|
+
}
|
|
317
|
+
return [min, max];
|
|
313
318
|
} else {
|
|
314
319
|
return transWay(inputValue);
|
|
315
320
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
$transition_duration-table_body-bg: var(--semi-transition_duration-none); // 表格-背景颜色-动画持续时间
|
|
2
2
|
$transition_function-table_body-bg: var(--semi-transition_function-easeOut); // 表格-背景颜色-过渡曲线
|
|
3
3
|
$transition_delay-table_body-bg: 0ms; // 表格-背景颜色-延迟时间
|
|
4
|
+
$transition_duration-table_row-head-bg: 0.1s; // 表格-行头-背景颜色-动画持续时间
|
|
5
|
+
$transition_function-table_row-head-bg: linear; // 表格-行头-背景颜色-过渡曲线
|
package/lib/cjs/table/table.css
CHANGED
|
@@ -134,6 +134,16 @@
|
|
|
134
134
|
vertical-align: middle;
|
|
135
135
|
overflow-wrap: break-word;
|
|
136
136
|
position: relative;
|
|
137
|
+
transition: background-color 0.1s linear;
|
|
138
|
+
}
|
|
139
|
+
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort {
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
}
|
|
142
|
+
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-row-head-clickSort:hover {
|
|
143
|
+
background: var(--semi-color-fill-0);
|
|
144
|
+
}
|
|
145
|
+
.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
|
+
background-color: transparent;
|
|
137
147
|
}
|
|
138
148
|
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left, .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right {
|
|
139
149
|
z-index: 101;
|
package/lib/cjs/table/table.scss
CHANGED
|
@@ -140,6 +140,23 @@ $module: #{$prefix}-table;
|
|
|
140
140
|
// word-break: break-all;
|
|
141
141
|
// word-wrap: break-word;
|
|
142
142
|
position: relative;
|
|
143
|
+
transition: background-color $transition_duration-table_row-head-bg $transition_function-table_row-head-bg;
|
|
144
|
+
|
|
145
|
+
&.#{$module}-row-head-clickSort {
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
&:hover {
|
|
148
|
+
background: $color-table_th-clickSort-bg-hover;
|
|
149
|
+
|
|
150
|
+
&.#{$module}-cell-fixed {
|
|
151
|
+
&-left,
|
|
152
|
+
&-right {
|
|
153
|
+
&::before {
|
|
154
|
+
background-color: transparent;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
143
160
|
|
|
144
161
|
&.#{$module}-cell-fixed {
|
|
145
162
|
&-left,
|
|
@@ -57,6 +57,7 @@ $color-table_shadow-border-default: var(--semi-color-border); // 表格拟阴影
|
|
|
57
57
|
$color-table_th-bg-default: var(--semi-color-bg-1); // 表头背景色
|
|
58
58
|
$color-table_th-border-default: var(--semi-color-border); // 表头底部分割线颜色
|
|
59
59
|
$color-table_th-text-default: var(--semi-color-text-2); // 表头文字颜色
|
|
60
|
+
$color-table_th-clickSort-bg-hover: var(--semi-color-fill-0); //点击表头触发排序背景色 - 悬浮
|
|
60
61
|
|
|
61
62
|
$color-table_pl-bg-default: transparent;
|
|
62
63
|
$color-table_body-bg-default: var(--semi-color-bg-1); // 表格背景颜色 - 默认
|
|
@@ -11,6 +11,7 @@ const cssClasses = exports.cssClasses = {
|
|
|
11
11
|
TABS_BAR_LINE: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-line`,
|
|
12
12
|
TABS_BAR_CARD: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-card`,
|
|
13
13
|
TABS_BAR_BUTTON: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-button`,
|
|
14
|
+
TABS_BAR_SLASH: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-slash`,
|
|
14
15
|
TABS_BAR_EXTRA: `${_constants.BASE_CLASS_PREFIX}-tabs-bar-extra`,
|
|
15
16
|
TABS_TAB: `${_constants.BASE_CLASS_PREFIX}-tabs-tab`,
|
|
16
17
|
TABS_TAB_ACTIVE: `${_constants.BASE_CLASS_PREFIX}-tabs-tab-active`,
|
|
@@ -32,7 +33,7 @@ const numbers = exports.numbers = {
|
|
|
32
33
|
DEFAULT_ACTIVE_KEY: 1
|
|
33
34
|
};
|
|
34
35
|
const strings = exports.strings = {
|
|
35
|
-
TYPE_MAP: ['line', 'card', 'button'],
|
|
36
|
+
TYPE_MAP: ['line', 'card', 'button', 'slash'],
|
|
36
37
|
SIZE: ['small', 'medium', 'large'],
|
|
37
38
|
POSITION_MAP: ['top', 'left']
|
|
38
39
|
};
|