@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
|
@@ -16,6 +16,7 @@ import BaseFoundation from '../base/foundation';
|
|
|
16
16
|
import { strings, numbers } from './constants';
|
|
17
17
|
import { mergeQueries, flattenColumns, filterColumns } from './utils';
|
|
18
18
|
import { pullAll, withOrderSort } from '../utils/array';
|
|
19
|
+
import { convertDataToEntities, calcCheckedKeysForChecked, calcCheckedKeysForUnchecked } from '../tree/treeUtil';
|
|
19
20
|
class TableFoundation extends BaseFoundation {
|
|
20
21
|
/**
|
|
21
22
|
* update columns in place, and use default values as initial values if the sorting and filtering columns have no values
|
|
@@ -587,29 +588,115 @@ class TableFoundation extends BaseFoundation {
|
|
|
587
588
|
dataSource = dataSource == null ? this.getProp('dataSource') : dataSource;
|
|
588
589
|
return !(Array.isArray(dataSource) && dataSource.length > 0);
|
|
589
590
|
}
|
|
591
|
+
/**
|
|
592
|
+
* Build tree data entities for checkRelation
|
|
593
|
+
* @param dataSource
|
|
594
|
+
* @returns keyEntities map
|
|
595
|
+
*/
|
|
596
|
+
buildKeyEntities(dataSource) {
|
|
597
|
+
dataSource = dataSource == null ? this._getDataSource() : dataSource;
|
|
598
|
+
const childrenRecordName = this.getProp('childrenRecordName');
|
|
599
|
+
const rowKey = this.getProp('rowKey');
|
|
600
|
+
// Convert table data to tree data format
|
|
601
|
+
const convertToTreeData = data => {
|
|
602
|
+
return data.map(record => {
|
|
603
|
+
const key = typeof rowKey === 'function' ? rowKey(record) : _get(record, rowKey);
|
|
604
|
+
const children = _get(record, childrenRecordName);
|
|
605
|
+
const node = Object.assign({
|
|
606
|
+
key
|
|
607
|
+
}, record);
|
|
608
|
+
if (Array.isArray(children) && children.length) {
|
|
609
|
+
node.children = convertToTreeData(children);
|
|
610
|
+
}
|
|
611
|
+
return node;
|
|
612
|
+
});
|
|
613
|
+
};
|
|
614
|
+
const treeData = convertToTreeData(dataSource);
|
|
615
|
+
const {
|
|
616
|
+
keyEntities
|
|
617
|
+
} = convertDataToEntities(treeData, {
|
|
618
|
+
key: 'key',
|
|
619
|
+
children: 'children'
|
|
620
|
+
});
|
|
621
|
+
return keyEntities;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Calculate checked keys when checkRelation is 'related'
|
|
625
|
+
* @param realKey
|
|
626
|
+
* @param selected
|
|
627
|
+
* @param checkedKeys
|
|
628
|
+
* @param halfCheckedKeys
|
|
629
|
+
*/
|
|
630
|
+
calcCheckedKeysForSelect(realKey, selected, checkedKeys, halfCheckedKeys) {
|
|
631
|
+
const keyEntities = this._adapter.getKeyEntities();
|
|
632
|
+
const keyStr = String(realKey);
|
|
633
|
+
// If keyEntities doesn't contain this key, handle it as a simple add/remove
|
|
634
|
+
if (!keyEntities || !keyEntities[keyStr]) {
|
|
635
|
+
if (selected) {
|
|
636
|
+
checkedKeys.add(keyStr);
|
|
637
|
+
} else {
|
|
638
|
+
checkedKeys.delete(keyStr);
|
|
639
|
+
}
|
|
640
|
+
return {
|
|
641
|
+
checkedKeys,
|
|
642
|
+
halfCheckedKeys
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
if (selected) {
|
|
646
|
+
return calcCheckedKeysForChecked(keyStr, keyEntities, checkedKeys, halfCheckedKeys);
|
|
647
|
+
} else {
|
|
648
|
+
return calcCheckedKeysForUnchecked(keyStr, keyEntities, checkedKeys, halfCheckedKeys);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
590
651
|
handleSelectRow(realKey, selected, e) {
|
|
591
652
|
this.stopPropagation(e);
|
|
592
653
|
if (typeof selected === 'boolean' && realKey != null) {
|
|
654
|
+
const checkRelation = this._adapter.getCheckRelation();
|
|
593
655
|
const selectedRowKeys = this._getSelectedRowKeys();
|
|
656
|
+
const halfCheckedRowKeys = [...(this._adapter.getHalfCheckedRowKeys() || [])];
|
|
594
657
|
let foundIdx = -1;
|
|
595
658
|
const selectedRow = this.getSelectedRows(null, [realKey])[0];
|
|
596
659
|
let selectedRows;
|
|
597
|
-
if (
|
|
598
|
-
|
|
599
|
-
|
|
660
|
+
if (checkRelation === 'related') {
|
|
661
|
+
// When checkRelation is 'related', use tree selection logic
|
|
662
|
+
const keyEntities = this._adapter.getKeyEntities();
|
|
663
|
+
// Convert keys to strings for tree utility functions
|
|
664
|
+
const checkedKeysSet = new Set(selectedRowKeys.map(key => String(key)));
|
|
665
|
+
const halfCheckedKeysSet = new Set(halfCheckedRowKeys.map(key => String(key)));
|
|
666
|
+
const {
|
|
667
|
+
checkedKeys,
|
|
668
|
+
halfCheckedKeys
|
|
669
|
+
} = this.calcCheckedKeysForSelect(String(realKey), selected, checkedKeysSet, halfCheckedKeysSet);
|
|
670
|
+
const newSelectedRowKeys = [...checkedKeys];
|
|
671
|
+
const newHalfCheckedRowKeys = [...halfCheckedKeys];
|
|
672
|
+
selectedRows = this.getSelectedRows(null, newSelectedRowKeys);
|
|
673
|
+
// Always update halfCheckedRowKeys state for checkRelation='related' mode
|
|
674
|
+
// This is needed for rendering the half-checked state in the UI
|
|
675
|
+
this._adapter.setHalfCheckedRowKeys(newHalfCheckedRowKeys);
|
|
600
676
|
if (!this._selectionIsControlled()) {
|
|
601
|
-
this._adapter.setSelectedRowKeys(
|
|
677
|
+
this._adapter.setSelectedRowKeys(newSelectedRowKeys);
|
|
602
678
|
}
|
|
603
679
|
this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
604
|
-
this._adapter.notifySelectionChange(
|
|
605
|
-
} else
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
this.
|
|
680
|
+
this._adapter.notifySelectionChange(newSelectedRowKeys, selectedRows);
|
|
681
|
+
} else {
|
|
682
|
+
// Original logic for unRelated mode
|
|
683
|
+
if ((foundIdx = selectedRowKeys.indexOf(realKey)) > -1 && selected === false) {
|
|
684
|
+
selectedRowKeys.splice(foundIdx, 1);
|
|
685
|
+
selectedRows = this.getSelectedRows(null, selectedRowKeys);
|
|
686
|
+
if (!this._selectionIsControlled()) {
|
|
687
|
+
this._adapter.setSelectedRowKeys(selectedRowKeys);
|
|
688
|
+
}
|
|
689
|
+
this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
690
|
+
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
691
|
+
} else if (selectedRowKeys.indexOf(realKey) === -1 && selected === true) {
|
|
692
|
+
selectedRowKeys.push(realKey);
|
|
693
|
+
selectedRows = this.getSelectedRows(null, selectedRowKeys);
|
|
694
|
+
if (!this._selectionIsControlled()) {
|
|
695
|
+
this._adapter.setSelectedRowKeys(selectedRowKeys);
|
|
696
|
+
}
|
|
697
|
+
this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
698
|
+
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
610
699
|
}
|
|
611
|
-
this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
612
|
-
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
613
700
|
}
|
|
614
701
|
}
|
|
615
702
|
}
|
|
@@ -621,6 +708,7 @@ class TableFoundation extends BaseFoundation {
|
|
|
621
708
|
handleSelectAllRow(selected, e) {
|
|
622
709
|
this.stopPropagation(e);
|
|
623
710
|
if (typeof selected === 'boolean') {
|
|
711
|
+
const checkRelation = this._adapter.getCheckRelation();
|
|
624
712
|
const curSelectedRowKeys = this._getSelectedRowKeys();
|
|
625
713
|
let selectedRowKeys = [...curSelectedRowKeys];
|
|
626
714
|
const selectedRowKeysSet = this._getSelectedRowKeysSet();
|
|
@@ -628,26 +716,72 @@ class TableFoundation extends BaseFoundation {
|
|
|
628
716
|
const disabledRowKeys = this._adapter.getAllDisabledRowKeys();
|
|
629
717
|
const disabledRowKeysSet = this._adapter.getAllDisabledRowKeysSet();
|
|
630
718
|
let changedRowKeys;
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
719
|
+
if (checkRelation === 'related') {
|
|
720
|
+
// When checkRelation is 'related', use tree selection logic
|
|
721
|
+
const keyEntities = this._adapter.getKeyEntities();
|
|
722
|
+
const halfCheckedRowKeys = [...(this._adapter.getHalfCheckedRowKeys() || [])];
|
|
723
|
+
// Convert keys to strings for tree utility functions
|
|
724
|
+
let checkedKeysSet = new Set(selectedRowKeys.map(key => String(key)));
|
|
725
|
+
let halfCheckedKeysSet = new Set(halfCheckedRowKeys.map(key => String(key)));
|
|
726
|
+
if (selected) {
|
|
727
|
+
// Select all: add all non-disabled keys
|
|
728
|
+
const keysToAdd = allRowKeys.filter(key => !disabledRowKeysSet.has(key));
|
|
729
|
+
for (const key of keysToAdd) {
|
|
730
|
+
const keyStr = String(key);
|
|
731
|
+
if (!checkedKeysSet.has(keyStr) && keyEntities && keyEntities[keyStr]) {
|
|
732
|
+
const result = calcCheckedKeysForChecked(keyStr, keyEntities, checkedKeysSet, halfCheckedKeysSet);
|
|
733
|
+
checkedKeysSet = result.checkedKeys;
|
|
734
|
+
halfCheckedKeysSet = result.halfCheckedKeys;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
changedRowKeys = keysToAdd;
|
|
738
|
+
} else {
|
|
739
|
+
// Deselect all: remove all keys
|
|
740
|
+
const keysToRemove = [...checkedKeysSet];
|
|
741
|
+
for (const key of keysToRemove) {
|
|
742
|
+
if (keyEntities && keyEntities[key]) {
|
|
743
|
+
const result = calcCheckedKeysForUnchecked(key, keyEntities, checkedKeysSet, halfCheckedKeysSet);
|
|
744
|
+
checkedKeysSet = result.checkedKeys;
|
|
745
|
+
halfCheckedKeysSet = result.halfCheckedKeys;
|
|
746
|
+
}
|
|
636
747
|
}
|
|
748
|
+
changedRowKeys = [...curSelectedRowKeys];
|
|
749
|
+
}
|
|
750
|
+
selectedRowKeys = [...checkedKeysSet];
|
|
751
|
+
const newHalfCheckedRowKeys = [...halfCheckedKeysSet];
|
|
752
|
+
const changedRows = this.getSelectedRows(null, changedRowKeys || []);
|
|
753
|
+
const selectedRows = this.getSelectedRows(null, selectedRowKeys || []);
|
|
754
|
+
// Always update halfCheckedRowKeys state for checkRelation='related' mode
|
|
755
|
+
// This is needed for rendering the half-checked state in the UI
|
|
756
|
+
this._adapter.setHalfCheckedRowKeys(newHalfCheckedRowKeys);
|
|
757
|
+
if (!this._selectionIsControlled()) {
|
|
758
|
+
this._adapter.setSelectedRowKeys(selectedRowKeys);
|
|
637
759
|
}
|
|
638
|
-
|
|
639
|
-
|
|
760
|
+
this._adapter.notifySelectAll(selected, selectedRows, changedRows, e);
|
|
761
|
+
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
640
762
|
} else {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
763
|
+
// Original logic for unRelated mode
|
|
764
|
+
// Select all, if not disabled && not in selectedRowKeys
|
|
765
|
+
if (selected) {
|
|
766
|
+
for (const key of allRowKeys) {
|
|
767
|
+
if (!disabledRowKeysSet.has(key) && !selectedRowKeysSet.has(key)) {
|
|
768
|
+
selectedRowKeys.push(key);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
allRowKeys = pullAll(allRowKeys, [...disabledRowKeys, ...curSelectedRowKeys]);
|
|
772
|
+
changedRowKeys = [...allRowKeys];
|
|
773
|
+
} else {
|
|
774
|
+
selectedRowKeys = pullAll(selectedRowKeys, allRowKeys);
|
|
775
|
+
changedRowKeys = [...curSelectedRowKeys];
|
|
776
|
+
}
|
|
777
|
+
const changedRows = this.getSelectedRows(null, changedRowKeys || []);
|
|
778
|
+
const selectedRows = this.getSelectedRows(null, selectedRowKeys || []);
|
|
779
|
+
if (!this._selectionIsControlled()) {
|
|
780
|
+
this._adapter.setSelectedRowKeys(selectedRowKeys);
|
|
781
|
+
}
|
|
782
|
+
this._adapter.notifySelectAll(selected, selectedRows, changedRows, e);
|
|
783
|
+
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
648
784
|
}
|
|
649
|
-
this._adapter.notifySelectAll(selected, selectedRows, changedRows, e);
|
|
650
|
-
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
651
785
|
}
|
|
652
786
|
}
|
|
653
787
|
/**
|
|
@@ -881,7 +1015,8 @@ class TableFoundation extends BaseFoundation {
|
|
|
881
1015
|
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
882
1016
|
let check = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
883
1017
|
var _a, _b, _c, _d;
|
|
884
|
-
|
|
1018
|
+
/* Do not call stopPropagation here, otherwise the click event registered via onHeaderCell
|
|
1019
|
+
will be blocked when the click hot area is the whole title (#1861). */
|
|
885
1020
|
/* if mouse down to the resizable handle, do not trigger the sorting,fix #2802
|
|
886
1021
|
The target of the click event may be different from the target of the mousedown,
|
|
887
1022
|
e.g: Press the mouse, move to another node and then release it,
|
package/lib/es/table/table.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
.semi-table-pagination-info {
|
|
23
23
|
font-size: 14px;
|
|
24
24
|
line-height: 20px;
|
|
25
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
25
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
26
26
|
font-weight: 400;
|
|
27
27
|
}
|
|
28
28
|
.semi-table-pagination-outer {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
padding: 0;
|
|
49
49
|
font-size: 14px;
|
|
50
50
|
line-height: 20px;
|
|
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
|
color: var(--semi-color-text-0);
|
|
53
53
|
width: 100%;
|
|
54
54
|
}
|
|
@@ -222,6 +222,14 @@
|
|
|
222
222
|
display: table-row;
|
|
223
223
|
background-color: var(--semi-color-bg-1);
|
|
224
224
|
}
|
|
225
|
+
.semi-table-tbody > .semi-table-row.semi-table-row-hovered > .semi-table-row-cell {
|
|
226
|
+
background-image: linear-gradient(0deg, var(--semi-color-fill-0), var(--semi-color-fill-0));
|
|
227
|
+
background-color: var(--semi-color-bg-0);
|
|
228
|
+
}
|
|
229
|
+
.semi-table-tbody > .semi-table-row.semi-table-row-hovered > .semi-table-row-cell.semi-table-cell-fixed-left, .semi-table-tbody > .semi-table-row.semi-table-row-hovered > .semi-table-row-cell.semi-table-cell-fixed-right {
|
|
230
|
+
background-image: linear-gradient(0deg, var(--semi-color-fill-0), var(--semi-color-fill-0));
|
|
231
|
+
background-color: var(--semi-color-bg-1);
|
|
232
|
+
}
|
|
225
233
|
.semi-table-tbody > .semi-table-row:hover > .semi-table-row-cell {
|
|
226
234
|
background-image: linear-gradient(0deg, var(--semi-color-fill-0), var(--semi-color-fill-0));
|
|
227
235
|
background-color: var(--semi-color-bg-0);
|
package/lib/es/table/table.scss
CHANGED
|
@@ -259,6 +259,23 @@ $module: #{$prefix}-table;
|
|
|
259
259
|
display: table-row;
|
|
260
260
|
background-color: $color-table_body-bg-default;
|
|
261
261
|
|
|
262
|
+
// Programmatic hover state (e.g. rowSpanHover feature)
|
|
263
|
+
// Keep visual effect consistent with native :hover
|
|
264
|
+
&.#{$module}-row-hovered {
|
|
265
|
+
& > .#{$module}-row-cell {
|
|
266
|
+
background-image: linear-gradient(0deg, $color-table_body-bg-hover, $color-table_body-bg-hover);
|
|
267
|
+
background-color: $color-table_cell-bg-hover;
|
|
268
|
+
|
|
269
|
+
&.#{$module}-cell-fixed {
|
|
270
|
+
&-left,
|
|
271
|
+
&-right {
|
|
272
|
+
background-image: linear-gradient(0deg, $color-table_body-bg-hover, $color-table_body-bg-hover);
|
|
273
|
+
background-color: $color-table_body-bg-default;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
262
279
|
&:hover {
|
|
263
280
|
& > .#{$module}-row-cell {
|
|
264
281
|
// $color-table_body-bg-hover has transparency,will reveal the background color $color-table_body-bg-default\
|
package/lib/es/tabs/tabs.css
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
.semi-tabs-bar .semi-tabs-tab {
|
|
52
52
|
font-size: 14px;
|
|
53
53
|
line-height: 20px;
|
|
54
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
54
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
box-sizing: border-box;
|
|
57
57
|
position: relative;
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
.semi-tabs-tab-single.semi-tabs-tab {
|
|
113
113
|
font-size: 14px;
|
|
114
114
|
line-height: 20px;
|
|
115
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
115
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
116
116
|
cursor: pointer;
|
|
117
117
|
box-sizing: border-box;
|
|
118
118
|
position: relative;
|
package/lib/es/tag/tag.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
.semi-tag-default, .semi-tag-small {
|
|
19
19
|
font-size: 12px;
|
|
20
20
|
line-height: 16px;
|
|
21
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
21
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
22
22
|
height: 20px;
|
|
23
23
|
padding: 2px 8px;
|
|
24
24
|
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
.semi-tag-large {
|
|
35
35
|
font-size: 12px;
|
|
36
36
|
line-height: 16px;
|
|
37
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
37
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
38
38
|
padding: 4px 8px;
|
|
39
39
|
height: 24px;
|
|
40
40
|
}
|
|
@@ -505,6 +505,32 @@
|
|
|
505
505
|
color: var(--semi-color-text-0);
|
|
506
506
|
}
|
|
507
507
|
|
|
508
|
+
.semi-tag-split {
|
|
509
|
+
display: inline-flex;
|
|
510
|
+
align-items: center;
|
|
511
|
+
}
|
|
512
|
+
.semi-tag-split .semi-tag {
|
|
513
|
+
border-radius: 0;
|
|
514
|
+
margin-right: 1px;
|
|
515
|
+
}
|
|
516
|
+
.semi-tag-split .semi-tag-first {
|
|
517
|
+
border-top-left-radius: var(--semi-border-radius-small);
|
|
518
|
+
border-bottom-left-radius: var(--semi-border-radius-small);
|
|
519
|
+
}
|
|
520
|
+
.semi-tag-split .semi-tag-last {
|
|
521
|
+
border-top-right-radius: var(--semi-border-radius-small);
|
|
522
|
+
border-bottom-right-radius: var(--semi-border-radius-small);
|
|
523
|
+
margin-right: unset;
|
|
524
|
+
}
|
|
525
|
+
.semi-tag-split .semi-tag-circle.semi-tag-first {
|
|
526
|
+
border-top-left-radius: var(--semi-border-radius-full);
|
|
527
|
+
border-bottom-left-radius: var(--semi-border-radius-full);
|
|
528
|
+
}
|
|
529
|
+
.semi-tag-split .semi-tag-circle.semi-tag-last {
|
|
530
|
+
border-top-right-radius: var(--semi-border-radius-full);
|
|
531
|
+
border-bottom-right-radius: var(--semi-border-radius-full);
|
|
532
|
+
}
|
|
533
|
+
|
|
508
534
|
.semi-rtl .semi-tag,
|
|
509
535
|
.semi-portal-rtl .semi-tag {
|
|
510
536
|
direction: rtl;
|
package/lib/es/tag/tag.scss
CHANGED
|
@@ -329,4 +329,37 @@ $types: "ghost", "solid", "light";
|
|
|
329
329
|
color: $color-tag_avatar-text-default;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
.#{$module}-split {
|
|
333
|
+
display: inline-flex;
|
|
334
|
+
align-items: center;
|
|
335
|
+
|
|
336
|
+
.#{$module} {
|
|
337
|
+
border-radius: 0;
|
|
338
|
+
margin-right: 1px;
|
|
339
|
+
|
|
340
|
+
&-first {
|
|
341
|
+
border-top-left-radius: $radius-tag;
|
|
342
|
+
border-bottom-left-radius: $radius-tag;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
&-last {
|
|
346
|
+
border-top-right-radius: $radius-tag;
|
|
347
|
+
border-bottom-right-radius: $radius-tag;
|
|
348
|
+
margin-right: unset;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
&-circle {
|
|
352
|
+
&.#{$module}-first {
|
|
353
|
+
border-top-left-radius: $radius-tag_circle;
|
|
354
|
+
border-bottom-left-radius: $radius-tag_circle;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
&.#{$module}-last {
|
|
358
|
+
border-top-right-radius: $radius-tag_circle;
|
|
359
|
+
border-bottom-right-radius: $radius-tag_circle;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
332
365
|
@import './rtl.scss';
|
|
@@ -112,6 +112,8 @@
|
|
|
112
112
|
padding-left: 4px;
|
|
113
113
|
padding-right: 4px;
|
|
114
114
|
overflow: hidden;
|
|
115
|
+
position: relative;
|
|
116
|
+
/* hidden mirror used to measure input text width */
|
|
115
117
|
}
|
|
116
118
|
.semi-tagInput-wrapper-tag {
|
|
117
119
|
margin-right: 4px;
|
|
@@ -154,6 +156,8 @@
|
|
|
154
156
|
.semi-tagInput-wrapper .semi-tagInput-wrapper-input {
|
|
155
157
|
flex-grow: 1;
|
|
156
158
|
width: min-content;
|
|
159
|
+
min-width: 2px;
|
|
160
|
+
max-width: 100%;
|
|
157
161
|
border: none;
|
|
158
162
|
outline: none;
|
|
159
163
|
background-color: transparent;
|
|
@@ -195,6 +199,19 @@
|
|
|
195
199
|
height: 24px;
|
|
196
200
|
line-height: 24px;
|
|
197
201
|
}
|
|
202
|
+
.semi-tagInput-wrapper-inputMirror {
|
|
203
|
+
position: absolute;
|
|
204
|
+
top: 0;
|
|
205
|
+
left: 0;
|
|
206
|
+
visibility: hidden;
|
|
207
|
+
pointer-events: none;
|
|
208
|
+
height: 0;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
white-space: pre;
|
|
211
|
+
font-size: 14px;
|
|
212
|
+
font-weight: 400;
|
|
213
|
+
font-family: inherit;
|
|
214
|
+
}
|
|
198
215
|
.semi-tagInput-clearBtn {
|
|
199
216
|
display: flex;
|
|
200
217
|
justify-content: center;
|
|
@@ -215,7 +232,7 @@
|
|
|
215
232
|
font-weight: 600;
|
|
216
233
|
font-size: 14px;
|
|
217
234
|
line-height: 20px;
|
|
218
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
235
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
219
236
|
color: var(--semi-color-text-2);
|
|
220
237
|
flex-shrink: 0;
|
|
221
238
|
white-space: nowrap;
|
|
@@ -231,7 +248,7 @@
|
|
|
231
248
|
white-space: nowrap;
|
|
232
249
|
font-size: 14px;
|
|
233
250
|
line-height: 20px;
|
|
234
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
251
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
235
252
|
}
|
|
236
253
|
.semi-tagInput-prefix-icon, .semi-tagInput-suffix-icon {
|
|
237
254
|
color: var(--semi-color-text-2);
|
|
@@ -137,6 +137,7 @@ $module: #{$prefix}-tagInput;
|
|
|
137
137
|
padding-left: $spacing-extra-tight;
|
|
138
138
|
padding-right: $spacing-extra-tight;
|
|
139
139
|
overflow: hidden;
|
|
140
|
+
position: relative;
|
|
140
141
|
|
|
141
142
|
&-tag {
|
|
142
143
|
margin-right: $spacing-extra-tight;
|
|
@@ -190,6 +191,8 @@ $module: #{$prefix}-tagInput;
|
|
|
190
191
|
& &-input {
|
|
191
192
|
flex-grow: 1;
|
|
192
193
|
width: min-content;
|
|
194
|
+
min-width: 2px;
|
|
195
|
+
max-width: 100%;
|
|
193
196
|
// min-width: 38px;
|
|
194
197
|
border: none;
|
|
195
198
|
outline: none;
|
|
@@ -240,6 +243,21 @@ $module: #{$prefix}-tagInput;
|
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
}
|
|
246
|
+
|
|
247
|
+
/* hidden mirror used to measure input text width */
|
|
248
|
+
&-inputMirror {
|
|
249
|
+
position: absolute;
|
|
250
|
+
top: 0;
|
|
251
|
+
left: 0;
|
|
252
|
+
visibility: hidden;
|
|
253
|
+
pointer-events: none;
|
|
254
|
+
height: 0;
|
|
255
|
+
overflow: hidden;
|
|
256
|
+
white-space: pre;
|
|
257
|
+
font-size: $font-size-regular;
|
|
258
|
+
font-weight: $font-weight-regular;
|
|
259
|
+
font-family: inherit;
|
|
260
|
+
}
|
|
243
261
|
}
|
|
244
262
|
|
|
245
263
|
&-clearBtn {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PanelType } from './constants';
|
|
1
2
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
2
3
|
export type Position = 'top' | 'topLeft' | 'topRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'leftTopOver' | 'rightTopOver';
|
|
3
4
|
export interface TimePickerAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
@@ -16,11 +17,16 @@ declare class TimePickerFoundation<P = Record<string, any>, S = Record<string, a
|
|
|
16
17
|
constructor(adapter: TimePickerAdapter<P, S>);
|
|
17
18
|
init(): void;
|
|
18
19
|
getPosition(): Position;
|
|
20
|
+
getDisabledTimeFns(panelType: PanelType, dates: Date[]): {
|
|
21
|
+
disabledHours: any;
|
|
22
|
+
disabledMinutes: any;
|
|
23
|
+
disabledSeconds: any;
|
|
24
|
+
};
|
|
19
25
|
isDisabledHMS({ hours, minutes, seconds }: {
|
|
20
26
|
hours: number;
|
|
21
27
|
minutes: number;
|
|
22
28
|
seconds: number;
|
|
23
|
-
}): boolean;
|
|
29
|
+
}, panelType?: PanelType, dates?: Date[]): boolean;
|
|
24
30
|
isValidTimeZone(timeZone: string | number): boolean;
|
|
25
31
|
getDefaultFormatIfNeed(): string;
|
|
26
32
|
/**
|
|
@@ -26,17 +26,44 @@ class TimePickerFoundation extends BaseFoundation {
|
|
|
26
26
|
const rtlDirection = direction === 'rtl' ? 'bottomRight' : '';
|
|
27
27
|
return position || rtlDirection || strings.DEFAULT_POSITION[type];
|
|
28
28
|
}
|
|
29
|
+
getDisabledTimeFns(panelType, dates) {
|
|
30
|
+
const {
|
|
31
|
+
disabledHours,
|
|
32
|
+
disabledMinutes,
|
|
33
|
+
disabledSeconds,
|
|
34
|
+
disabledTime
|
|
35
|
+
} = this.getProps();
|
|
36
|
+
// disabledTime is range-only: only invoke it when the picker is
|
|
37
|
+
// actually a range picker. In single mode panelType has no meaning, so
|
|
38
|
+
// we fall back to the top-level disabledHours / disabledMinutes /
|
|
39
|
+
// disabledSeconds without invoking disabledTime.
|
|
40
|
+
if (typeof disabledTime === 'function' && this._adapter.isRangePicker()) {
|
|
41
|
+
const disabledObj = disabledTime(dates, panelType) || {};
|
|
42
|
+
return {
|
|
43
|
+
disabledHours: disabledObj.disabledHours || disabledHours,
|
|
44
|
+
disabledMinutes: disabledObj.disabledMinutes || disabledMinutes,
|
|
45
|
+
disabledSeconds: disabledObj.disabledSeconds || disabledSeconds
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
disabledHours,
|
|
50
|
+
disabledMinutes,
|
|
51
|
+
disabledSeconds
|
|
52
|
+
};
|
|
53
|
+
}
|
|
29
54
|
isDisabledHMS(_ref) {
|
|
30
55
|
let {
|
|
31
56
|
hours,
|
|
32
57
|
minutes,
|
|
33
58
|
seconds
|
|
34
59
|
} = _ref;
|
|
60
|
+
let panelType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left';
|
|
61
|
+
let dates = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
35
62
|
const {
|
|
36
63
|
disabledHours,
|
|
37
64
|
disabledMinutes,
|
|
38
65
|
disabledSeconds
|
|
39
|
-
} = this.
|
|
66
|
+
} = this.getDisabledTimeFns(panelType, dates);
|
|
40
67
|
const hDis = !isNullOrUndefined(hours) && hourIsDisabled(disabledHours, hours);
|
|
41
68
|
const mDis = !isNullOrUndefined(hours) && !isNullOrUndefined(minutes) && minuteIsDisabled(disabledMinutes, hours, minutes);
|
|
42
69
|
const sDis = !isNullOrUndefined(hours) && !isNullOrUndefined(minutes) && !isNullOrUndefined(seconds) && secondIsDisabled(disabledSeconds, hours, minutes, seconds);
|
|
@@ -158,11 +185,23 @@ class TimePickerFoundation extends BaseFoundation {
|
|
|
158
185
|
if (this.isValidTimeZone(timeZone)) {
|
|
159
186
|
dates = dates.map(date => utcToZonedTime(this.isValidTimeZone(__prevTimeZone) ? zonedTimeToUtc(date, __prevTimeZone) : date, timeZone));
|
|
160
187
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
188
|
+
if (this._adapter.isRangePicker()) {
|
|
189
|
+
invalid = dates.some((d, idx) => {
|
|
190
|
+
const panelType = idx === 1 ? 'right' : 'left';
|
|
191
|
+
return this.isDisabledHMS({
|
|
192
|
+
hours: d.getHours(),
|
|
193
|
+
minutes: d.getMinutes(),
|
|
194
|
+
seconds: d.getSeconds()
|
|
195
|
+
}, panelType, dates);
|
|
196
|
+
});
|
|
197
|
+
} else {
|
|
198
|
+
const d = dates[0];
|
|
199
|
+
invalid = d ? this.isDisabledHMS({
|
|
200
|
+
hours: d.getHours(),
|
|
201
|
+
minutes: d.getMinutes(),
|
|
202
|
+
seconds: d.getSeconds()
|
|
203
|
+
}, 'left', dates) : false;
|
|
204
|
+
}
|
|
166
205
|
}
|
|
167
206
|
const inputValue = this.formatValue(dates);
|
|
168
207
|
this.setState({
|
|
@@ -258,11 +297,23 @@ class TimePickerFoundation extends BaseFoundation {
|
|
|
258
297
|
let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
259
298
|
let invalid = dates.some(d => isNaN(Number(d)));
|
|
260
299
|
if (!invalid) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
300
|
+
if (this._adapter.isRangePicker()) {
|
|
301
|
+
invalid = dates.some((d, idx) => {
|
|
302
|
+
const panelType = idx === 1 ? 'right' : 'left';
|
|
303
|
+
return this.isDisabledHMS({
|
|
304
|
+
hours: d.getHours(),
|
|
305
|
+
minutes: d.getMinutes(),
|
|
306
|
+
seconds: d.getSeconds()
|
|
307
|
+
}, panelType, dates);
|
|
308
|
+
});
|
|
309
|
+
} else {
|
|
310
|
+
const d = dates[0];
|
|
311
|
+
invalid = d ? this.isDisabledHMS({
|
|
312
|
+
hours: d.getHours(),
|
|
313
|
+
minutes: d.getMinutes(),
|
|
314
|
+
seconds: d.getSeconds()
|
|
315
|
+
}, 'left', dates) : false;
|
|
316
|
+
}
|
|
266
317
|
}
|
|
267
318
|
return invalid;
|
|
268
319
|
}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
.semi-timepicker .semi-timepicker-input {
|
|
80
80
|
font-size: 14px;
|
|
81
81
|
line-height: 20px;
|
|
82
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
82
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
83
83
|
border-radius: var(--semi-border-radius-small);
|
|
84
84
|
align-items: center;
|
|
85
85
|
}
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
.semi-timeline-item-content {
|
|
78
78
|
font-size: 14px;
|
|
79
79
|
line-height: 20px;
|
|
80
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
80
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
81
81
|
position: relative;
|
|
82
82
|
margin: 0 0 0 25px;
|
|
83
83
|
word-break: break-word;
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
.semi-timeline-item-content-extra, .semi-timeline-item-content-time {
|
|
87
87
|
font-size: 12px;
|
|
88
88
|
line-height: 16px;
|
|
89
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
89
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
90
90
|
color: var(--semi-color-text-2);
|
|
91
91
|
margin-top: 4px;
|
|
92
92
|
}
|