@douyinfe/semi-foundation 2.96.1 → 2.98.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/cascader/foundation.ts +74 -19
- package/codeHighlight/codeHighlight.scss +1 -1
- package/datePicker/datePicker.scss +100 -5
- package/datePicker/foundation.ts +7 -0
- package/datePicker/inputFoundation.ts +5 -0
- package/form/foundation.ts +55 -7
- package/form/utils.ts +7 -2
- package/image/previewImageFoundation.ts +34 -3
- package/image/previewInnerFoundation.ts +15 -4
- package/input/textarea.scss +35 -0
- package/inputNumber/foundation.ts +119 -3
- package/jsonViewer/jsonViewer.scss +2 -2
- package/lib/cjs/aiChatInput/aiChatInput.css +7 -7
- package/lib/cjs/anchor/anchor.css +3 -3
- package/lib/cjs/autoComplete/autoComplete.css +1 -1
- package/lib/cjs/avatar/avatar.css +5 -5
- package/lib/cjs/badge/badge.css +1 -1
- package/lib/cjs/breadcrumb/breadcrumb.css +2 -2
- package/lib/cjs/calendar/calendar.css +9 -9
- package/lib/cjs/cascader/cascader.css +6 -6
- package/lib/cjs/cascader/foundation.d.ts +12 -0
- package/lib/cjs/cascader/foundation.js +68 -23
- package/lib/cjs/checkbox/checkbox.css +2 -2
- package/lib/cjs/codeHighlight/codeHighlight.css +1 -1
- package/lib/cjs/codeHighlight/codeHighlight.scss +1 -1
- package/lib/cjs/collapse/collapse.css +2 -2
- package/lib/cjs/datePicker/datePicker.css +75 -13
- package/lib/cjs/datePicker/datePicker.scss +100 -5
- package/lib/cjs/datePicker/foundation.d.ts +5 -0
- package/lib/cjs/datePicker/foundation.js +2 -0
- package/lib/cjs/datePicker/inputFoundation.d.ts +5 -0
- package/lib/cjs/descriptions/descriptions.css +6 -6
- package/lib/cjs/dropdown/dropdown.css +2 -2
- package/lib/cjs/form/form.css +4 -4
- package/lib/cjs/form/foundation.d.ts +1 -1
- package/lib/cjs/form/foundation.js +55 -9
- package/lib/cjs/form/utils.js +5 -2
- package/lib/cjs/hotKeys/hotKeys.css +2 -2
- package/lib/cjs/image/image.css +2 -2
- package/lib/cjs/image/previewImageFoundation.d.ts +4 -0
- package/lib/cjs/image/previewImageFoundation.js +33 -2
- package/lib/cjs/image/previewInnerFoundation.d.ts +1 -0
- package/lib/cjs/image/previewInnerFoundation.js +17 -4
- package/lib/cjs/input/input.css +8 -8
- package/lib/cjs/input/textarea.css +19 -2
- package/lib/cjs/input/textarea.scss +35 -0
- package/lib/cjs/inputNumber/foundation.d.ts +15 -0
- package/lib/cjs/inputNumber/foundation.js +113 -3
- package/lib/cjs/jsonViewer/jsonViewer.css +2 -2
- package/lib/cjs/jsonViewer/jsonViewer.scss +2 -2
- package/lib/cjs/list/list.css +1 -1
- package/lib/cjs/modal/modal.css +1 -1
- package/lib/cjs/navigation/navigation.css +4 -3
- package/lib/cjs/navigation/navigation.scss +1 -0
- package/lib/cjs/navigation/variables.scss +1 -1
- package/lib/cjs/notification/notification.css +4 -4
- package/lib/cjs/overflowList/foundation.d.ts +1 -0
- package/lib/cjs/overflowList/foundation.js +51 -1
- package/lib/cjs/pagination/pagination.css +5 -5
- package/lib/cjs/popconfirm/popconfirm.css +1 -1
- package/lib/cjs/popover/popover.css +1 -1
- package/lib/cjs/radio/radio.css +2 -2
- package/lib/cjs/scrollList/itemFoundation.js +12 -0
- package/lib/cjs/scrollList/scrollList.css +2 -2
- package/lib/cjs/select/foundation.d.ts +1 -1
- package/lib/cjs/select/foundation.js +28 -2
- package/lib/cjs/select/select.css +6 -6
- package/lib/cjs/sideSheet/sideSheet.css +2 -2
- package/lib/cjs/sidebar/sidebar.css +11 -11
- package/lib/cjs/slider/foundation.js +46 -12
- package/lib/cjs/slider/rtl.scss +62 -0
- package/lib/cjs/slider/slider.css +45 -0
- package/lib/cjs/slider/slider.scss +2 -0
- package/lib/cjs/steps/steps.css +11 -11
- package/lib/cjs/switch/switch.css +1 -0
- package/lib/cjs/switch/switch.scss +1 -0
- package/lib/cjs/switch/variables.scss +2 -1
- package/lib/cjs/table/foundation.d.ts +36 -0
- package/lib/cjs/table/foundation.js +164 -29
- package/lib/cjs/table/table.css +10 -2
- package/lib/cjs/table/table.scss +17 -0
- package/lib/cjs/tabs/tabs.css +2 -2
- package/lib/cjs/tag/tag.css +28 -2
- package/lib/cjs/tag/tag.scss +33 -0
- package/lib/cjs/tagInput/tagInput.css +19 -2
- package/lib/cjs/tagInput/tagInput.scss +18 -0
- package/lib/cjs/timePicker/constants.d.ts +1 -0
- package/lib/cjs/timePicker/foundation.d.ts +7 -1
- package/lib/cjs/timePicker/foundation.js +62 -11
- package/lib/cjs/timePicker/timePicker.css +1 -1
- package/lib/cjs/timeline/timeline.css +2 -2
- package/lib/cjs/toast/toast.css +1 -1
- package/lib/cjs/tooltip/foundation.js +8 -5
- package/lib/cjs/tooltip/tooltip.css +1 -1
- package/lib/cjs/transfer/constants.d.ts +3 -1
- package/lib/cjs/transfer/constants.js +3 -1
- package/lib/cjs/transfer/foundation.d.ts +3 -0
- package/lib/cjs/transfer/foundation.js +4 -0
- package/lib/cjs/transfer/transfer.css +14 -5
- package/lib/cjs/transfer/transfer.scss +10 -0
- package/lib/cjs/tree/foundation.d.ts +3 -0
- package/lib/cjs/tree/foundation.js +31 -4
- package/lib/cjs/tree/tree.css +1 -1
- package/lib/cjs/treeSelect/foundation.d.ts +1 -0
- package/lib/cjs/treeSelect/foundation.js +8 -1
- package/lib/cjs/treeSelect/treeSelect.css +36 -4
- package/lib/cjs/treeSelect/treeSelect.scss +49 -1
- package/lib/cjs/typography/typography.css +8 -8
- package/lib/cjs/upload/upload.css +8 -8
- package/lib/cjs/utils/Store.d.ts +1 -1
- package/lib/cjs/utils/Store.js +1 -0
- package/lib/es/aiChatInput/aiChatInput.css +7 -7
- package/lib/es/anchor/anchor.css +3 -3
- package/lib/es/autoComplete/autoComplete.css +1 -1
- package/lib/es/avatar/avatar.css +5 -5
- package/lib/es/badge/badge.css +1 -1
- package/lib/es/breadcrumb/breadcrumb.css +2 -2
- package/lib/es/calendar/calendar.css +9 -9
- package/lib/es/cascader/cascader.css +6 -6
- package/lib/es/cascader/foundation.d.ts +12 -0
- package/lib/es/cascader/foundation.js +68 -23
- package/lib/es/checkbox/checkbox.css +2 -2
- package/lib/es/codeHighlight/codeHighlight.css +1 -1
- package/lib/es/codeHighlight/codeHighlight.scss +1 -1
- package/lib/es/collapse/collapse.css +2 -2
- package/lib/es/datePicker/datePicker.css +75 -13
- package/lib/es/datePicker/datePicker.scss +100 -5
- package/lib/es/datePicker/foundation.d.ts +5 -0
- package/lib/es/datePicker/foundation.js +2 -0
- package/lib/es/datePicker/inputFoundation.d.ts +5 -0
- package/lib/es/descriptions/descriptions.css +6 -6
- package/lib/es/dropdown/dropdown.css +2 -2
- package/lib/es/form/form.css +4 -4
- package/lib/es/form/foundation.d.ts +1 -1
- package/lib/es/form/foundation.js +55 -9
- package/lib/es/form/utils.js +5 -2
- package/lib/es/hotKeys/hotKeys.css +2 -2
- package/lib/es/image/image.css +2 -2
- package/lib/es/image/previewImageFoundation.d.ts +4 -0
- package/lib/es/image/previewImageFoundation.js +33 -2
- package/lib/es/image/previewInnerFoundation.d.ts +1 -0
- package/lib/es/image/previewInnerFoundation.js +17 -4
- package/lib/es/input/input.css +8 -8
- package/lib/es/input/textarea.css +19 -2
- package/lib/es/input/textarea.scss +35 -0
- package/lib/es/inputNumber/foundation.d.ts +15 -0
- package/lib/es/inputNumber/foundation.js +113 -3
- package/lib/es/jsonViewer/jsonViewer.css +2 -2
- package/lib/es/jsonViewer/jsonViewer.scss +2 -2
- package/lib/es/list/list.css +1 -1
- package/lib/es/modal/modal.css +1 -1
- package/lib/es/navigation/navigation.css +4 -3
- package/lib/es/navigation/navigation.scss +1 -0
- package/lib/es/navigation/variables.scss +1 -1
- package/lib/es/notification/notification.css +4 -4
- package/lib/es/overflowList/foundation.d.ts +1 -0
- package/lib/es/overflowList/foundation.js +51 -1
- package/lib/es/pagination/pagination.css +5 -5
- package/lib/es/popconfirm/popconfirm.css +1 -1
- package/lib/es/popover/popover.css +1 -1
- package/lib/es/radio/radio.css +2 -2
- package/lib/es/scrollList/itemFoundation.js +12 -0
- package/lib/es/scrollList/scrollList.css +2 -2
- package/lib/es/select/foundation.d.ts +1 -1
- package/lib/es/select/foundation.js +28 -2
- package/lib/es/select/select.css +6 -6
- package/lib/es/sideSheet/sideSheet.css +2 -2
- package/lib/es/sidebar/sidebar.css +11 -11
- package/lib/es/slider/foundation.js +46 -12
- package/lib/es/slider/rtl.scss +62 -0
- package/lib/es/slider/slider.css +45 -0
- package/lib/es/slider/slider.scss +2 -0
- package/lib/es/steps/steps.css +11 -11
- package/lib/es/switch/switch.css +1 -0
- package/lib/es/switch/switch.scss +1 -0
- package/lib/es/switch/variables.scss +2 -1
- package/lib/es/table/foundation.d.ts +36 -0
- package/lib/es/table/foundation.js +164 -29
- package/lib/es/table/table.css +10 -2
- package/lib/es/table/table.scss +17 -0
- package/lib/es/tabs/tabs.css +2 -2
- package/lib/es/tag/tag.css +28 -2
- package/lib/es/tag/tag.scss +33 -0
- package/lib/es/tagInput/tagInput.css +19 -2
- package/lib/es/tagInput/tagInput.scss +18 -0
- package/lib/es/timePicker/constants.d.ts +1 -0
- package/lib/es/timePicker/foundation.d.ts +7 -1
- package/lib/es/timePicker/foundation.js +62 -11
- package/lib/es/timePicker/timePicker.css +1 -1
- package/lib/es/timeline/timeline.css +2 -2
- package/lib/es/toast/toast.css +1 -1
- package/lib/es/tooltip/foundation.js +8 -5
- package/lib/es/tooltip/tooltip.css +1 -1
- package/lib/es/transfer/constants.d.ts +3 -1
- package/lib/es/transfer/constants.js +3 -1
- package/lib/es/transfer/foundation.d.ts +3 -0
- package/lib/es/transfer/foundation.js +4 -0
- package/lib/es/transfer/transfer.css +14 -5
- package/lib/es/transfer/transfer.scss +10 -0
- package/lib/es/tree/foundation.d.ts +3 -0
- package/lib/es/tree/foundation.js +31 -4
- package/lib/es/tree/tree.css +1 -1
- package/lib/es/treeSelect/foundation.d.ts +1 -0
- package/lib/es/treeSelect/foundation.js +8 -1
- package/lib/es/treeSelect/treeSelect.css +36 -4
- package/lib/es/treeSelect/treeSelect.scss +49 -1
- package/lib/es/typography/typography.css +8 -8
- package/lib/es/upload/upload.css +8 -8
- package/lib/es/utils/Store.d.ts +1 -1
- package/lib/es/utils/Store.js +1 -0
- package/navigation/navigation.scss +1 -0
- package/navigation/variables.scss +1 -1
- package/overflowList/foundation.ts +48 -2
- package/package.json +19 -4
- package/scrollList/itemFoundation.ts +12 -0
- package/select/foundation.ts +27 -2
- package/slider/foundation.ts +55 -15
- package/slider/rtl.scss +62 -0
- package/slider/slider.scss +2 -0
- package/switch/switch.scss +1 -0
- package/switch/variables.scss +2 -1
- package/table/foundation.ts +199 -30
- package/table/table.scss +17 -0
- package/tag/tag.scss +33 -0
- package/tagInput/tagInput.scss +18 -0
- package/timePicker/constants.ts +2 -0
- package/timePicker/foundation.ts +62 -10
- package/tooltip/foundation.ts +8 -5
- package/transfer/constants.ts +3 -1
- package/transfer/foundation.ts +8 -1
- package/transfer/transfer.scss +10 -0
- package/tree/foundation.ts +34 -5
- package/treeSelect/foundation.ts +10 -1
- package/treeSelect/treeSelect.scss +49 -1
- package/utils/Store.ts +2 -1
|
@@ -164,8 +164,18 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
164
164
|
const value = this.getState('value');
|
|
165
165
|
|
|
166
166
|
if (value !== '') {
|
|
167
|
-
//
|
|
168
|
-
|
|
167
|
+
// When scientific notation is enabled, convert to full number on focus
|
|
168
|
+
if (this._isScientificNotation() && !this._isCurrency()) {
|
|
169
|
+
const strVal = toString(value);
|
|
170
|
+
const isScientificStr = /e/i.test(strVal) && /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)[eE][+-]?\d+$/.test(strVal.trim());
|
|
171
|
+
if (isScientificStr) {
|
|
172
|
+
const parsedNum = this.doParse(strVal, false, false, false);
|
|
173
|
+
if (this.isValidNumber(parsedNum)) {
|
|
174
|
+
const fullNumberStr = this.doFormat(parsedNum, true, false);
|
|
175
|
+
this._adapter.setValue(fullNumberStr);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
169
179
|
}
|
|
170
180
|
this._adapter.recordCursorPosition();
|
|
171
181
|
this._adapter.setFocusing(true, null);
|
|
@@ -284,6 +294,36 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
284
294
|
numHasChanged = true;
|
|
285
295
|
}
|
|
286
296
|
|
|
297
|
+
// Fix issue #38: When input contains non-numeric characters (e.g., "1000CNY"),
|
|
298
|
+
// doParse returns NaN, but we should still apply max/min limit if a number
|
|
299
|
+
// can be extracted from the input or if currentNumber is out of range.
|
|
300
|
+
if (!this.isValidNumber(parsedNum)) {
|
|
301
|
+
// Try to extract a number from the input using parseFloat
|
|
302
|
+
// (parseFloat can extract numbers from strings like "1000CNY" -> 1000)
|
|
303
|
+
const extractedNum = parseFloat(currentValue);
|
|
304
|
+
if (!isNaN(extractedNum)) {
|
|
305
|
+
const limitedNum = this.fetchMinOrMax(extractedNum);
|
|
306
|
+
if (limitedNum !== currentNumber) {
|
|
307
|
+
willSetNum = limitedNum;
|
|
308
|
+
if (!this.isControlled()) {
|
|
309
|
+
currentNumber = willSetNum;
|
|
310
|
+
}
|
|
311
|
+
numHasChanged = true;
|
|
312
|
+
}
|
|
313
|
+
} else if (typeof currentNumber === 'number' && !isNaN(currentNumber)) {
|
|
314
|
+
// If we can't extract a number but currentNumber exists and is out of range,
|
|
315
|
+
// apply the max/min limit to currentNumber
|
|
316
|
+
const limitedNum = this.fetchMinOrMax(currentNumber);
|
|
317
|
+
if (limitedNum !== currentNumber) {
|
|
318
|
+
willSetNum = limitedNum;
|
|
319
|
+
if (!this.isControlled()) {
|
|
320
|
+
currentNumber = willSetNum;
|
|
321
|
+
}
|
|
322
|
+
numHasChanged = true;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
287
327
|
const currentFormattedNum = this.doFormat(currentNumber, true, true);
|
|
288
328
|
|
|
289
329
|
if (currentFormattedNum !== currentValue) {
|
|
@@ -475,7 +515,11 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
475
515
|
|
|
476
516
|
// console.log('scale: ', scale, 'curNum: ', curNum);
|
|
477
517
|
|
|
478
|
-
|
|
518
|
+
// NOTE:
|
|
519
|
+
// In non-currency mode, `needAdjustCurrency=true` is used by blur/init formatting paths.
|
|
520
|
+
// Step operations often happen while focused, and should keep full-number display.
|
|
521
|
+
// Currency mode still needs `needAdjustCurrency=true` to format currency strings.
|
|
522
|
+
return this.doFormat(curNum, true, this._isCurrency());
|
|
479
523
|
}
|
|
480
524
|
|
|
481
525
|
minus(step?: number, event?: any): string {
|
|
@@ -526,6 +570,54 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
526
570
|
return showCurrencySymbol ? formatted : formatted.replace(this._currencySymbol, '').trim();
|
|
527
571
|
}
|
|
528
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Check if scientific notation is enabled
|
|
575
|
+
*/
|
|
576
|
+
_isScientificNotation() {
|
|
577
|
+
const { scientificNotation } = this.getProps();
|
|
578
|
+
return scientificNotation === true || (typeof scientificNotation === 'object' && scientificNotation !== null);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Get scientific notation threshold
|
|
583
|
+
* @returns {number} threshold for digit count
|
|
584
|
+
*/
|
|
585
|
+
_getScientificNotationThreshold() {
|
|
586
|
+
const { scientificNotation } = this.getProps();
|
|
587
|
+
if (typeof scientificNotation === 'object' && scientificNotation !== null) {
|
|
588
|
+
const t = (scientificNotation as any).threshold;
|
|
589
|
+
return typeof t === 'number' && Number.isFinite(t) && t >= 1 ? t : 15;
|
|
590
|
+
}
|
|
591
|
+
return 15; // Default threshold: 15 digits
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Convert number to scientific notation if exceeds threshold
|
|
596
|
+
* @param {number} num
|
|
597
|
+
* @returns {string}
|
|
598
|
+
*/
|
|
599
|
+
_toScientificNotation(num: number): string {
|
|
600
|
+
const threshold = this._getScientificNotationThreshold();
|
|
601
|
+
const absNum = Math.abs(num);
|
|
602
|
+
const numStr = String(absNum);
|
|
603
|
+
|
|
604
|
+
// Count significant digits (excluding decimal point, sign, exponent symbol and leading zeros)
|
|
605
|
+
// If JS already stringifies it with exponent (contains e/E), it is eligible for scientific notation display.
|
|
606
|
+
const hasExp = /e/i.test(numStr);
|
|
607
|
+
const significantDigits = numStr.replace(/[.\-+eE]/g, '').replace(/^0+/, '');
|
|
608
|
+
|
|
609
|
+
// Check if number exceeds threshold
|
|
610
|
+
if ((hasExp || significantDigits.length >= threshold) && absNum !== 0) {
|
|
611
|
+
// Prefer preserving coefficient digits up to threshold (total significant digits = fractionDigits + 1)
|
|
612
|
+
const fractionDigits = Math.max(0, Math.min(100, Math.floor(threshold) - 1));
|
|
613
|
+
const exp = num.toExponential(fractionDigits);
|
|
614
|
+
// Remove trailing zeros in the coefficient
|
|
615
|
+
return exp.replace(/(\.\d*?)0+e/, '$1e').replace(/\.e/, 'e');
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
return String(num);
|
|
619
|
+
}
|
|
620
|
+
|
|
529
621
|
/**
|
|
530
622
|
* format number to string
|
|
531
623
|
* @param {string|number} value
|
|
@@ -547,6 +639,16 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
547
639
|
} else {
|
|
548
640
|
str = toString(value);
|
|
549
641
|
}
|
|
642
|
+
|
|
643
|
+
// Apply scientific notation for long numbers in blur state
|
|
644
|
+
// needAdjustCurrency indicates blur state (when true, we're formatting for display after blur)
|
|
645
|
+
if (this._isScientificNotation() && needAdjustCurrency && !this._isCurrency()) {
|
|
646
|
+
const numValue = typeof value === 'number' ? value : parseFloat(str);
|
|
647
|
+
if (!isNaN(numValue) && isFinite(numValue)) {
|
|
648
|
+
str = this._toScientificNotation(numValue);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
550
652
|
if (typeof formatter === 'function') {
|
|
551
653
|
str = formatter(str);
|
|
552
654
|
}
|
|
@@ -616,6 +718,20 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
616
718
|
value = typeof parsedValue === 'number' ? toString(parsedValue) : parsedValue as string;
|
|
617
719
|
}
|
|
618
720
|
|
|
721
|
+
// Support scientific notation parsing (e.g., "1.23e+15", "1.23E-10", ".5e3", "1.e3")
|
|
722
|
+
if (typeof value === 'string' && /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)[eE][+-]?\d+$/.test(value.trim())) {
|
|
723
|
+
const scientificNum = parseFloat(value.trim());
|
|
724
|
+
if (!isNaN(scientificNum)) {
|
|
725
|
+
if (needAdjustMaxMin) {
|
|
726
|
+
return this.fetchMinOrMax(scientificNum);
|
|
727
|
+
}
|
|
728
|
+
if (needAdjustPrec) {
|
|
729
|
+
return toNumber(this._adjustPrec(scientificNum));
|
|
730
|
+
}
|
|
731
|
+
return scientificNum;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
|
|
619
735
|
if (needCheckPrec && typeof value === 'string') {
|
|
620
736
|
const zeroIsValid =
|
|
621
737
|
value.indexOf('.') === -1 ||
|
|
@@ -64,7 +64,7 @@ $module: #{$prefix}-json-viewer;
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&-view-line {
|
|
67
|
-
font-family:
|
|
67
|
+
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, 'Fira Code', Consolas, 'Liberation Mono', 'DejaVu Sans Mono', 'Courier New', monospace;
|
|
68
68
|
font-weight: normal;
|
|
69
69
|
font-size: 12px;
|
|
70
70
|
font-feature-settings: 'liga' 0, 'calt' 0;
|
|
@@ -76,7 +76,7 @@ $module: #{$prefix}-json-viewer;
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
&-line-number {
|
|
79
|
-
font-family:
|
|
79
|
+
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, 'Fira Code', Consolas, 'Liberation Mono', 'DejaVu Sans Mono', 'Courier New', monospace;
|
|
80
80
|
font-weight: normal;
|
|
81
81
|
font-size: 12px;
|
|
82
82
|
font-feature-settings: 'liga' 0, 'calt' 0;
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
color: var(--semi-color-text-0);
|
|
37
37
|
font-size: 14px;
|
|
38
38
|
line-height: 20px;
|
|
39
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
39
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
40
40
|
}
|
|
41
41
|
.semi-aiChatInput-suggestion-item-active {
|
|
42
42
|
background-color: var(--semi-color-fill-0);
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
margin-bottom: 8px;
|
|
82
82
|
font-size: 12px;
|
|
83
83
|
line-height: 16px;
|
|
84
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
84
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
85
85
|
color: var(--semi-color-text-2);
|
|
86
86
|
column-gap: 4px;
|
|
87
87
|
row-gap: 4px;
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
padding: 8px 16px 0px;
|
|
244
244
|
font-size: 12px;
|
|
245
245
|
line-height: 16px;
|
|
246
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
246
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
247
247
|
height: 16px;
|
|
248
248
|
align-items: center;
|
|
249
249
|
display: flex;
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
height: fit-content;
|
|
260
260
|
font-size: 12px;
|
|
261
261
|
line-height: 16px;
|
|
262
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
262
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
263
263
|
}
|
|
264
264
|
.semi-aiChatInput-attachment {
|
|
265
265
|
position: relative;
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
color: var(--semi-color-text-0);
|
|
305
305
|
font-size: 12px;
|
|
306
306
|
line-height: 16px;
|
|
307
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
307
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
308
308
|
font-weight: 600;
|
|
309
309
|
}
|
|
310
310
|
.semi-aiChatInput-attachment-content-size {
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
color: var(--semi-color-text-2);
|
|
316
316
|
font-size: 12px;
|
|
317
317
|
line-height: 16px;
|
|
318
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
318
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
319
319
|
text-transform: uppercase;
|
|
320
320
|
}
|
|
321
321
|
.semi-aiChatInput-attachment-delete {
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
.semi-aiChatInput-editor-content .tiptap .select-slot {
|
|
468
468
|
font-size: 14px;
|
|
469
469
|
line-height: 20px;
|
|
470
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
470
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
471
471
|
height: 24px;
|
|
472
472
|
padding: 2px 4px;
|
|
473
473
|
border-radius: 4px;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
.semi-anchor {
|
|
5
5
|
font-size: 14px;
|
|
6
6
|
line-height: 20px;
|
|
7
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
7
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
8
8
|
overflow-y: auto;
|
|
9
9
|
overflow-x: hidden;
|
|
10
10
|
position: relative;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
.semi-anchor-size-small {
|
|
13
13
|
font-size: 12px;
|
|
14
14
|
line-height: 16px;
|
|
15
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
15
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
16
16
|
}
|
|
17
17
|
.semi-anchor-slide {
|
|
18
18
|
position: absolute;
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
.semi-anchor-link-tooltip-small {
|
|
96
96
|
font-size: 12px;
|
|
97
97
|
line-height: 16px;
|
|
98
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
98
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
99
99
|
}
|
|
100
100
|
.semi-anchor-link-tooltip:hover {
|
|
101
101
|
color: var(--semi-color-tertiary-hover) !important;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
.semi-autocomplete-option {
|
|
5
5
|
font-size: 14px;
|
|
6
6
|
line-height: 20px;
|
|
7
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
7
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
8
8
|
word-break: break-all;
|
|
9
9
|
padding-left: 12px;
|
|
10
10
|
padding-right: 12px;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
align-items: center;
|
|
26
26
|
font-size: 14px;
|
|
27
27
|
line-height: 20px;
|
|
28
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
28
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
29
29
|
font-weight: 600;
|
|
30
30
|
}
|
|
31
31
|
.semi-avatar-content {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
.semi-avatar-small .semi-avatar-label {
|
|
66
66
|
font-size: 12px;
|
|
67
67
|
line-height: 16px;
|
|
68
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
68
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
69
69
|
}
|
|
70
70
|
.semi-avatar-default {
|
|
71
71
|
width: 40px;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.semi-avatar-default .semi-avatar-label {
|
|
76
76
|
font-size: 18px;
|
|
77
77
|
line-height: 24px;
|
|
78
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
78
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
79
79
|
}
|
|
80
80
|
.semi-avatar-medium {
|
|
81
81
|
width: 48px;
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
.semi-avatar-medium .semi-avatar-label {
|
|
86
86
|
font-size: 20px;
|
|
87
87
|
line-height: 28px;
|
|
88
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
88
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
89
89
|
}
|
|
90
90
|
.semi-avatar-large {
|
|
91
91
|
width: 72px;
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
.semi-avatar-large .semi-avatar-label {
|
|
96
96
|
font-size: 32px;
|
|
97
97
|
line-height: 44px;
|
|
98
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
98
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
99
99
|
}
|
|
100
100
|
.semi-avatar-extra-large {
|
|
101
101
|
width: 128px;
|
package/lib/cjs/badge/badge.css
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
text-align: center;
|
|
27
27
|
font-size: 12px;
|
|
28
28
|
line-height: 16px;
|
|
29
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
29
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
30
30
|
font-weight: 400;
|
|
31
31
|
color: var(--semi-color-bg-2);
|
|
32
32
|
}
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
.semi-breadcrumb-wrapper-loose {
|
|
12
12
|
font-size: 14px;
|
|
13
13
|
line-height: 20px;
|
|
14
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
14
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
15
15
|
font-size: 14px;
|
|
16
16
|
}
|
|
17
17
|
.semi-breadcrumb-wrapper-compact {
|
|
18
18
|
font-size: 12px;
|
|
19
19
|
line-height: 16px;
|
|
20
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
20
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
21
21
|
font-size: 12px;
|
|
22
22
|
}
|
|
23
23
|
.semi-breadcrumb-item-wrap {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
.semi-calendar-week .semi-calendar-tag {
|
|
73
73
|
font-size: 14px;
|
|
74
74
|
line-height: 20px;
|
|
75
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
75
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
76
76
|
min-width: 70px;
|
|
77
77
|
color: var(--semi-color-text-2);
|
|
78
78
|
}
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
.semi-calendar-week .semi-calendar-time-item span {
|
|
189
189
|
font-size: 14px;
|
|
190
190
|
line-height: 20px;
|
|
191
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
191
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
192
192
|
display: block;
|
|
193
193
|
position: relative;
|
|
194
194
|
top: -10px;
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
align-items: flex-start;
|
|
240
240
|
font-size: 14px;
|
|
241
241
|
line-height: 20px;
|
|
242
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
242
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
243
243
|
color: var(--semi-color-text-2);
|
|
244
244
|
}
|
|
245
245
|
.semi-calendar-week-header {
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
.semi-calendar-week .semi-calendar-all-day .semi-calendar-event-items .semi-calendar-event-allday > * {
|
|
302
302
|
font-size: 14px;
|
|
303
303
|
line-height: 20px;
|
|
304
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
304
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
305
305
|
}
|
|
306
306
|
.semi-calendar-week .semi-calendar-week-tag {
|
|
307
307
|
text-align: right;
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
overflow: hidden;
|
|
319
319
|
font-size: 14px;
|
|
320
320
|
line-height: 20px;
|
|
321
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
321
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
322
322
|
}
|
|
323
323
|
.semi-calendar-month-grid-wrapper {
|
|
324
324
|
height: calc(100% - 27px);
|
|
@@ -372,7 +372,7 @@
|
|
|
372
372
|
.semi-calendar-month-skeleton li span {
|
|
373
373
|
font-size: 14px;
|
|
374
374
|
line-height: 20px;
|
|
375
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
375
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
376
376
|
}
|
|
377
377
|
.semi-calendar-month-skeleton li:last-child {
|
|
378
378
|
border-right: none;
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
.semi-calendar-month-skeleton .semi-calendar-month-event-card-wrapper {
|
|
384
384
|
font-size: 14px;
|
|
385
385
|
line-height: 20px;
|
|
386
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
386
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
387
387
|
display: block;
|
|
388
388
|
position: absolute;
|
|
389
389
|
right: 8px;
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
.semi-calendar-month-weekrow .semi-calendar-event-items .semi-calendar-event-month > * {
|
|
421
421
|
font-size: 14px;
|
|
422
422
|
line-height: 20px;
|
|
423
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
423
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
424
424
|
}
|
|
425
425
|
.semi-calendar-month-date {
|
|
426
426
|
position: absolute;
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
.semi-calendar-month-event-card-header-info-date {
|
|
461
461
|
font-size: 20px;
|
|
462
462
|
line-height: 28px;
|
|
463
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
463
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
464
464
|
margin-top: 4px;
|
|
465
465
|
}
|
|
466
466
|
.semi-calendar-month-event-card-body {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
.semi-cascader-large .semi-cascader-selection {
|
|
49
49
|
font-size: 16px;
|
|
50
50
|
line-height: 22px;
|
|
51
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
51
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
52
52
|
}
|
|
53
53
|
.semi-cascader-large .semi-cascader-selection {
|
|
54
54
|
padding-left: 12px;
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
.semi-cascader-selection {
|
|
105
105
|
font-size: 14px;
|
|
106
106
|
line-height: 20px;
|
|
107
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
107
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
108
108
|
height: 100%;
|
|
109
109
|
display: inline-flex;
|
|
110
110
|
align-items: center;
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
font-weight: 600;
|
|
219
219
|
font-size: 14px;
|
|
220
220
|
line-height: 20px;
|
|
221
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
221
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
222
222
|
color: var(--semi-color-text-2);
|
|
223
223
|
}
|
|
224
224
|
.semi-cascader-prefix-icon, .semi-cascader-suffix-icon {
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
font-weight: 600;
|
|
232
232
|
font-size: 14px;
|
|
233
233
|
line-height: 20px;
|
|
234
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
234
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
235
235
|
color: var(--semi-color-text-2);
|
|
236
236
|
flex-shrink: 0;
|
|
237
237
|
white-space: nowrap;
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
.semi-cascader-popover .semi-cascader-option-lists .semi-cascader-option-empty {
|
|
276
276
|
font-size: 14px;
|
|
277
277
|
line-height: 20px;
|
|
278
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
278
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
279
279
|
border-radius: var(--semi-border-radius-medium);
|
|
280
280
|
color: var(--semi-color-disabled-text);
|
|
281
281
|
margin: 0;
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
transition: background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);
|
|
370
370
|
font-size: 14px;
|
|
371
371
|
line-height: 20px;
|
|
372
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
372
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
373
373
|
min-width: min-content;
|
|
374
374
|
word-break: break-all;
|
|
375
375
|
color: var(--semi-color-text-0);
|
|
@@ -114,6 +114,7 @@ export interface BasicCascaderProps {
|
|
|
114
114
|
preventScroll?: boolean;
|
|
115
115
|
virtualizeInSearch?: Virtualize;
|
|
116
116
|
checkRelation?: string;
|
|
117
|
+
remote?: boolean;
|
|
117
118
|
onClear?: () => void;
|
|
118
119
|
triggerRender?: (props: BasicTriggerRenderProps) => any;
|
|
119
120
|
onListScroll?: (e: any, panel: BasicScrollPanelProps) => void;
|
|
@@ -204,6 +205,17 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
|
|
|
204
205
|
getItemPropPath(selectedKey: string, prop: string | any[], keyEntities?: BasicEntities): any[];
|
|
205
206
|
_getCacheValue(keyEntities: BasicEntities): any;
|
|
206
207
|
collectOptions(init?: boolean): void;
|
|
208
|
+
/**
|
|
209
|
+
* Calculate filtered keys based on current props.
|
|
210
|
+
* - In remote mode: do not do local match, treat current treeData nodes as results
|
|
211
|
+
* - In local mode: perform matching by filterTreeNode
|
|
212
|
+
*/
|
|
213
|
+
_calcFilteredKeys(sugInput: string, keyEntities?: BasicEntities): string[];
|
|
214
|
+
/**
|
|
215
|
+
* Sync filteredKeys with latest options/keyEntities WITHOUT triggering onSearch.
|
|
216
|
+
* Used when treeData changes asynchronously in searching state.
|
|
217
|
+
*/
|
|
218
|
+
recalculateFilteredKeys(input?: string, nextKeyEntities?: BasicEntities): void;
|
|
207
219
|
handleValueChange(value: BasicValue): void;
|
|
208
220
|
/**
|
|
209
221
|
* When single selection, the clear objects of
|
|
@@ -218,6 +218,72 @@ class CascaderFoundation extends _foundation.default {
|
|
|
218
218
|
keyEntities
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
+
// If options(treeData) updates during searching (e.g. remote search async update),
|
|
222
|
+
// we need to sync filteredKeys with the latest keyEntities; otherwise the UI may
|
|
223
|
+
// render empty list ("暂无数据") because filteredKeys are based on stale entities.
|
|
224
|
+
// NOTE: updateSelectedKey/updateStates are async in React, so we pass keyEntities
|
|
225
|
+
// explicitly to avoid reading stale state.
|
|
226
|
+
this.recalculateFilteredKeys(undefined, keyEntities);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Calculate filtered keys based on current props.
|
|
230
|
+
* - In remote mode: do not do local match, treat current treeData nodes as results
|
|
231
|
+
* - In local mode: perform matching by filterTreeNode
|
|
232
|
+
*/
|
|
233
|
+
_calcFilteredKeys(sugInput, keyEntities) {
|
|
234
|
+
if (!sugInput) {
|
|
235
|
+
return [];
|
|
236
|
+
}
|
|
237
|
+
const {
|
|
238
|
+
treeNodeFilterProp,
|
|
239
|
+
filterTreeNode,
|
|
240
|
+
filterLeafOnly,
|
|
241
|
+
remote
|
|
242
|
+
} = this.getProps();
|
|
243
|
+
const entities = Object.values(keyEntities !== null && keyEntities !== void 0 ? keyEntities : this.getState('keyEntities'));
|
|
244
|
+
if (remote) {
|
|
245
|
+
return entities.filter(item => !item._notExist).filter(item => filterTreeNode && !filterLeafOnly || this._isLeaf(item.data)).map(item => item.key);
|
|
246
|
+
}
|
|
247
|
+
return entities.filter(item => {
|
|
248
|
+
const {
|
|
249
|
+
key,
|
|
250
|
+
_notExist,
|
|
251
|
+
data
|
|
252
|
+
} = item;
|
|
253
|
+
if (_notExist) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
const filteredPath = this.getItemPropPath(key, treeNodeFilterProp, keyEntities);
|
|
257
|
+
return (0, _util.filter)(sugInput, data, filterTreeNode, filteredPath);
|
|
258
|
+
}).filter(item => filterTreeNode && !filterLeafOnly || this._isLeaf(item.data)).map(item => item.key);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Sync filteredKeys with latest options/keyEntities WITHOUT triggering onSearch.
|
|
262
|
+
* Used when treeData changes asynchronously in searching state.
|
|
263
|
+
*/
|
|
264
|
+
recalculateFilteredKeys(input, nextKeyEntities) {
|
|
265
|
+
const isFilterable = this._isFilterable();
|
|
266
|
+
if (!isFilterable) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
// When input is not explicitly provided, only recalculate in searching state.
|
|
270
|
+
// Otherwise, treeData updates may incorrectly force component into searching mode
|
|
271
|
+
// because inputValue can be the selected label text in normal (non-searching) state.
|
|
272
|
+
const currentIsSearching = this.getState('isSearching');
|
|
273
|
+
if ((0, _isUndefined2.default)(input) && !currentIsSearching) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const sugInput = (0, _isUndefined2.default)(input) ? this.getState('inputValue') : input;
|
|
277
|
+
const filteredKeys = this._calcFilteredKeys(sugInput, nextKeyEntities);
|
|
278
|
+
const updateStates = {
|
|
279
|
+
isSearching: Boolean(sugInput),
|
|
280
|
+
filteredKeys: new Set(filteredKeys)
|
|
281
|
+
};
|
|
282
|
+
if (nextKeyEntities) {
|
|
283
|
+
updateStates.keyEntities = nextKeyEntities;
|
|
284
|
+
}
|
|
285
|
+
this._adapter.updateStates(updateStates);
|
|
286
|
+
this._adapter.rePositionDropdown();
|
|
221
287
|
}
|
|
222
288
|
// call when props.value change
|
|
223
289
|
handleValueChange(value) {
|
|
@@ -804,29 +870,7 @@ class CascaderFoundation extends _foundation.default {
|
|
|
804
870
|
}
|
|
805
871
|
handleInputChange(sugInput) {
|
|
806
872
|
this._adapter.updateInputValue(sugInput);
|
|
807
|
-
const
|
|
808
|
-
keyEntities
|
|
809
|
-
} = this.getStates();
|
|
810
|
-
const {
|
|
811
|
-
treeNodeFilterProp,
|
|
812
|
-
filterTreeNode,
|
|
813
|
-
filterLeafOnly
|
|
814
|
-
} = this.getProps();
|
|
815
|
-
let filteredKeys = [];
|
|
816
|
-
if (sugInput) {
|
|
817
|
-
filteredKeys = Object.values(keyEntities).filter(item => {
|
|
818
|
-
const {
|
|
819
|
-
key,
|
|
820
|
-
_notExist,
|
|
821
|
-
data
|
|
822
|
-
} = item;
|
|
823
|
-
if (_notExist) {
|
|
824
|
-
return false;
|
|
825
|
-
}
|
|
826
|
-
const filteredPath = this.getItemPropPath(key, treeNodeFilterProp);
|
|
827
|
-
return (0, _util.filter)(sugInput, data, filterTreeNode, filteredPath);
|
|
828
|
-
}).filter(item => filterTreeNode && !filterLeafOnly || this._isLeaf(item)).map(item => item.key);
|
|
829
|
-
}
|
|
873
|
+
const filteredKeys = this._calcFilteredKeys(sugInput);
|
|
830
874
|
this._adapter.updateStates({
|
|
831
875
|
isSearching: Boolean(sugInput),
|
|
832
876
|
filteredKeys: new Set(filteredKeys)
|
|
@@ -897,6 +941,7 @@ class CascaderFoundation extends _foundation.default {
|
|
|
897
941
|
} = this.getStates();
|
|
898
942
|
const isFilterable = this._isFilterable();
|
|
899
943
|
if (isSearching && isFilterable) {
|
|
944
|
+
// Both local & remote search mode should render flattened search list
|
|
900
945
|
return this.getFilteredData();
|
|
901
946
|
}
|
|
902
947
|
return Object.values(keyEntities).filter(item => item.parentKey === null && !item._notExist)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
align-items: flex-start;
|
|
9
9
|
font-size: 14px;
|
|
10
10
|
line-height: 20px;
|
|
11
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
11
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
12
12
|
cursor: pointer;
|
|
13
13
|
transition: background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none), border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);
|
|
14
14
|
transform: scale(var(--semi-transform_scale-none));
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
.semi-checkboxGroup {
|
|
270
270
|
font-size: 14px;
|
|
271
271
|
line-height: 20px;
|
|
272
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
272
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
273
273
|
line-height: 14px;
|
|
274
274
|
}
|
|
275
275
|
.semi-checkboxGroup .semi-checkbox.semi-checkbox-vertical {
|