@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.
Files changed (75) hide show
  1. package/button/button.scss +5 -0
  2. package/button/iconButton.scss +5 -1
  3. package/cascader/foundation.ts +2 -0
  4. package/chat/chat.scss +1 -1
  5. package/datePicker/datePicker.scss +12 -0
  6. package/datePicker/monthsGridFoundation.ts +3 -4
  7. package/input/foundation.ts +3 -14
  8. package/input/textareaFoundation.ts +2 -14
  9. package/input/util/truncateValue.ts +25 -0
  10. package/lib/cjs/button/button.css +4 -0
  11. package/lib/cjs/button/button.scss +5 -0
  12. package/lib/cjs/button/iconButton.css +4 -0
  13. package/lib/cjs/button/iconButton.scss +5 -1
  14. package/lib/cjs/cascader/foundation.js +2 -0
  15. package/lib/cjs/chat/chat.css +1 -1
  16. package/lib/cjs/chat/chat.scss +1 -1
  17. package/lib/cjs/datePicker/datePicker.css +9 -0
  18. package/lib/cjs/datePicker/datePicker.scss +12 -0
  19. package/lib/cjs/datePicker/monthsGridFoundation.js +2 -3
  20. package/lib/cjs/input/foundation.d.ts +1 -1
  21. package/lib/cjs/input/foundation.js +7 -14
  22. package/lib/cjs/input/textareaFoundation.js +6 -14
  23. package/lib/cjs/input/util/truncateValue.d.ts +5 -0
  24. package/lib/cjs/input/util/truncateValue.js +31 -0
  25. package/lib/cjs/markdownRender/foundation.d.ts +3 -0
  26. package/lib/cjs/markdownRender/foundation.js +6 -2
  27. package/lib/cjs/overflowList/foundation.js +4 -3
  28. package/lib/cjs/slider/foundation.js +6 -1
  29. package/lib/cjs/table/animation.scss +2 -0
  30. package/lib/cjs/table/table.css +10 -0
  31. package/lib/cjs/table/table.scss +17 -0
  32. package/lib/cjs/table/variables.scss +1 -0
  33. package/lib/cjs/tabs/constants.d.ts +1 -0
  34. package/lib/cjs/tabs/constants.js +2 -1
  35. package/lib/cjs/tabs/tabs.css +29 -0
  36. package/lib/cjs/tabs/tabs.scss +42 -0
  37. package/lib/cjs/tabs/variables.scss +12 -0
  38. package/lib/es/button/button.css +4 -0
  39. package/lib/es/button/button.scss +5 -0
  40. package/lib/es/button/iconButton.css +4 -0
  41. package/lib/es/button/iconButton.scss +5 -1
  42. package/lib/es/cascader/foundation.js +2 -0
  43. package/lib/es/chat/chat.css +1 -1
  44. package/lib/es/chat/chat.scss +1 -1
  45. package/lib/es/datePicker/datePicker.css +9 -0
  46. package/lib/es/datePicker/datePicker.scss +12 -0
  47. package/lib/es/datePicker/monthsGridFoundation.js +2 -3
  48. package/lib/es/input/foundation.d.ts +1 -1
  49. package/lib/es/input/foundation.js +7 -14
  50. package/lib/es/input/textareaFoundation.js +6 -14
  51. package/lib/es/input/util/truncateValue.d.ts +5 -0
  52. package/lib/es/input/util/truncateValue.js +24 -0
  53. package/lib/es/markdownRender/foundation.d.ts +3 -0
  54. package/lib/es/markdownRender/foundation.js +6 -2
  55. package/lib/es/overflowList/foundation.js +4 -3
  56. package/lib/es/slider/foundation.js +6 -1
  57. package/lib/es/table/animation.scss +2 -0
  58. package/lib/es/table/table.css +10 -0
  59. package/lib/es/table/table.scss +17 -0
  60. package/lib/es/table/variables.scss +1 -0
  61. package/lib/es/tabs/constants.d.ts +1 -0
  62. package/lib/es/tabs/constants.js +2 -1
  63. package/lib/es/tabs/tabs.css +29 -0
  64. package/lib/es/tabs/tabs.scss +42 -0
  65. package/lib/es/tabs/variables.scss +12 -0
  66. package/markdownRender/foundation.ts +9 -3
  67. package/overflowList/foundation.ts +6 -4
  68. package/package.json +3 -3
  69. package/slider/foundation.ts +6 -1
  70. package/table/animation.scss +2 -0
  71. package/table/table.scss +17 -0
  72. package/table/variables.scss +1 -0
  73. package/tabs/constants.ts +2 -1
  74. package/tabs/tabs.scss +42 -0
  75. package/tabs/variables.scss +12 -0
@@ -36,6 +36,11 @@ $module: #{$prefix}-button;
36
36
  }
37
37
  }
38
38
 
39
+ &-content{
40
+ display: flex;
41
+ align-items: center;
42
+ }
43
+
39
44
  &-danger {
40
45
  background-color: $color-button_danger-bg-default;
41
46
  color: $color-button_danger-text-default;
@@ -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";
@@ -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-Bottom: $spacing-chat_chatBox-marginY;
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 = type === 'dateTime' ? this._mergeDateAndTime(fullDate, time) : fullDate;
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, dateFormat, undefined, dateFnsLocale));
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
 
@@ -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
- if (isFunction(getValueLength)) {
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
- if (isFunction(getValueLength)) {
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);
@@ -36,6 +36,11 @@ $module: #{$prefix}-button;
36
36
  }
37
37
  }
38
38
 
39
+ &-content{
40
+ display: flex;
41
+ align-items: center;
42
+ }
43
+
39
44
  &-danger {
40
45
  background-color: $color-button_danger-bg-default;
41
46
  color: $color-button_danger-text-default;
@@ -42,9 +42,13 @@
42
42
  }
43
43
  .semi-button-content-left {
44
44
  margin-right: 8px;
45
+ display: flex;
46
+ align-items: center;
45
47
  }
46
48
  .semi-button-content-right {
47
49
  margin-left: 8px;
50
+ display: flex;
51
+ align-items: center;
48
52
  }
49
53
 
50
54
  .semi-rtl .semi-button,
@@ -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 {
@@ -93,7 +93,7 @@
93
93
  display: flex;
94
94
  flex-direction: row;
95
95
  margin-top: 8px;
96
- margin-Bottom: 8px;
96
+ margin-bottom: 8px;
97
97
  column-gap: 12px;
98
98
  }
99
99
  .semi-chat-chatBox:hover .semi-chat-chatBox-action:not(.semi-chat-chatBox-action-hidden) {
@@ -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-Bottom: $spacing-chat_chatBox-marginY;
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 = type === 'dateTime' ? this._mergeDateAndTime(fullDate, time) : fullDate;
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, dateFormat, undefined, dateFnsLocale));
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): any;
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
- if ((0, _isFunction2.default)(getValueLength)) {
118
- let truncatedValue = '';
119
- for (let i = 1, len = value.length; i <= len; i++) {
120
- const currentValue = value.slice(0, i);
121
- if (getValueLength(currentValue) > maxLength) {
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
- if ((0, _isFunction2.default)(getValueLength)) {
139
- let truncatedValue = '';
140
- for (let i = 1, len = value.length; i <= len; i++) {
141
- const currentValue = value.slice(0, i);
142
- if (getValueLength(currentValue) > maxLength) {
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,5 @@
1
+ export default function truncateValue(options: {
2
+ value: string;
3
+ maxLength: number;
4
+ getValueLength?: (value: string) => number;
5
+ }): string;
@@ -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 visibleStateArr = items.map(_ref => {
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 ? items.slice(0, visibleStart) : [];
52
- overflowList[1] = visibleEnd >= 0 ? items.slice(visibleEnd + 1, items.length) : items;
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
- return [transWay(inputValue[0]), transWay(inputValue[1])];
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; // 表格-行头-背景颜色-过渡曲线
@@ -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;
@@ -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); // 表格背景颜色 - 默认
@@ -4,6 +4,7 @@ declare const cssClasses: {
4
4
  TABS_BAR_LINE: string;
5
5
  TABS_BAR_CARD: string;
6
6
  TABS_BAR_BUTTON: string;
7
+ TABS_BAR_SLASH: string;
7
8
  TABS_BAR_EXTRA: string;
8
9
  TABS_TAB: string;
9
10
  TABS_TAB_ACTIVE: string;
@@ -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
  };