@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
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
color: var(--semi-color-text-0);
|
|
14
14
|
font-size: 13px;
|
|
15
15
|
text-shadow: none;
|
|
16
|
-
font-family: "SFMono-Regular", Consolas, "Liberation Mono",
|
|
16
|
+
font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
|
|
17
17
|
direction: ltr;
|
|
18
18
|
text-align: left;
|
|
19
19
|
white-space: pre;
|
|
@@ -16,7 +16,7 @@ $module: #{$prefix}-codeHighlight;
|
|
|
16
16
|
font-size: 13px;
|
|
17
17
|
text-shadow: none;
|
|
18
18
|
// font-family: 'Inconsolata', Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
|
|
19
|
-
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono',
|
|
19
|
+
font-family: ui-monospace, 'SFMono-Regular', 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'DejaVu Sans Mono', 'Courier New', monospace;
|
|
20
20
|
direction: ltr;
|
|
21
21
|
text-align: left;
|
|
22
22
|
white-space: pre;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
font-weight: 600;
|
|
18
18
|
font-size: 14px;
|
|
19
19
|
line-height: 20px;
|
|
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
|
}
|
|
22
22
|
.semi-collapse-header-right {
|
|
23
23
|
display: flex;
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
color: var(--semi-color-text-1);
|
|
62
62
|
font-size: 14px;
|
|
63
63
|
line-height: 20px;
|
|
64
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
64
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
65
65
|
}
|
|
66
66
|
.semi-collapse-content p {
|
|
67
67
|
margin: 0;
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
padding: 0;
|
|
111
111
|
font-size: 14px;
|
|
112
112
|
line-height: 20px;
|
|
113
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
113
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
114
114
|
min-height: 24px;
|
|
115
115
|
line-height: 24px;
|
|
116
116
|
}
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
.semi-datepicker-navigation-month {
|
|
200
200
|
font-size: 16px;
|
|
201
201
|
line-height: 22px;
|
|
202
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
202
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
203
203
|
flex-grow: 1;
|
|
204
204
|
text-align: center;
|
|
205
205
|
font-weight: 600;
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
.semi-datepicker-weekday {
|
|
218
218
|
font-size: 12px;
|
|
219
219
|
line-height: 16px;
|
|
220
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
220
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
221
221
|
font-weight: 600;
|
|
222
222
|
color: var(--semi-color-text-2);
|
|
223
223
|
border-bottom: 1px solid var(--semi-color-border);
|
|
@@ -737,7 +737,7 @@
|
|
|
737
737
|
font-weight: 600;
|
|
738
738
|
font-size: 14px;
|
|
739
739
|
line-height: 20px;
|
|
740
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
740
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
741
741
|
white-space: nowrap;
|
|
742
742
|
color: var(--semi-color-text-2);
|
|
743
743
|
}
|
|
@@ -763,12 +763,40 @@
|
|
|
763
763
|
.semi-datepicker-compact {
|
|
764
764
|
font-size: 12px;
|
|
765
765
|
line-height: 16px;
|
|
766
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
766
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
767
767
|
line-height: 20px;
|
|
768
|
+
display: inline-block;
|
|
769
|
+
max-width: calc(100vw - 32px);
|
|
770
|
+
}
|
|
771
|
+
.semi-datepicker-compact:not(.semi-datepicker-compact-insetInput) {
|
|
772
|
+
width: max-content;
|
|
773
|
+
}
|
|
774
|
+
.semi-datepicker-compact .semi-datepicker-container {
|
|
775
|
+
width: max-content;
|
|
776
|
+
}
|
|
777
|
+
.semi-datepicker-compact .semi-datepicker-month-grid {
|
|
778
|
+
width: max-content;
|
|
779
|
+
}
|
|
780
|
+
.semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-month-grid-left,
|
|
781
|
+
.semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-month-grid-right {
|
|
782
|
+
min-width: 216px;
|
|
783
|
+
max-width: calc(100vw - 32px);
|
|
784
|
+
}
|
|
785
|
+
.semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-month {
|
|
786
|
+
margin-left: auto;
|
|
787
|
+
margin-right: auto;
|
|
768
788
|
}
|
|
769
789
|
.semi-datepicker-compact .semi-datepicker-month-grid[x-type=dateTime] .semi-datepicker-yam, .semi-datepicker-compact .semi-datepicker-month-grid[x-type=dateTimeRange] .semi-datepicker-yam {
|
|
770
790
|
height: calc(100% - 32px);
|
|
771
791
|
}
|
|
792
|
+
.semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-yam {
|
|
793
|
+
position: relative;
|
|
794
|
+
width: 100%;
|
|
795
|
+
max-width: 100%;
|
|
796
|
+
max-height: 256px;
|
|
797
|
+
overflow-x: auto;
|
|
798
|
+
overflow-y: hidden;
|
|
799
|
+
}
|
|
772
800
|
.semi-datepicker-compact .semi-datepicker-month-grid[x-type=dateRange] .semi-datepicker-month-grid-left, .semi-datepicker-compact .semi-datepicker-month-grid[x-type=dateTimeRange] .semi-datepicker-month-grid-left {
|
|
773
801
|
border-right: 1px solid var(--semi-color-border);
|
|
774
802
|
}
|
|
@@ -786,6 +814,16 @@
|
|
|
786
814
|
box-sizing: border-box;
|
|
787
815
|
height: 48px;
|
|
788
816
|
padding: 12px;
|
|
817
|
+
width: 100%;
|
|
818
|
+
max-width: 100%;
|
|
819
|
+
}
|
|
820
|
+
.semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-yearmonth-header button,
|
|
821
|
+
.semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-yearmonth-header .semi-button {
|
|
822
|
+
width: 100%;
|
|
823
|
+
max-width: 100%;
|
|
824
|
+
overflow: hidden;
|
|
825
|
+
text-overflow: ellipsis;
|
|
826
|
+
white-space: nowrap;
|
|
789
827
|
}
|
|
790
828
|
.semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-yearmonth-body {
|
|
791
829
|
display: flex;
|
|
@@ -796,7 +834,7 @@
|
|
|
796
834
|
.semi-datepicker-compact .semi-datepicker-month-grid .semi-scrolllist {
|
|
797
835
|
font-size: 12px;
|
|
798
836
|
line-height: 16px;
|
|
799
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
837
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
800
838
|
line-height: 20px;
|
|
801
839
|
}
|
|
802
840
|
.semi-datepicker-compact .semi-datepicker-month-grid .semi-scrolllist-header {
|
|
@@ -840,16 +878,19 @@
|
|
|
840
878
|
.semi-datepicker-compact.semi-datepicker-panel-yam .semi-scrolllist {
|
|
841
879
|
font-size: 12px;
|
|
842
880
|
line-height: 16px;
|
|
843
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
881
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
844
882
|
line-height: 20px;
|
|
845
883
|
}
|
|
846
884
|
.semi-datepicker-compact .semi-datepicker-tpk {
|
|
847
885
|
height: calc(100% - 32px);
|
|
848
886
|
}
|
|
849
887
|
.semi-datepicker-compact .semi-datepicker-navigation {
|
|
888
|
+
box-sizing: border-box;
|
|
850
889
|
height: 24px;
|
|
851
890
|
padding: 12px;
|
|
852
891
|
padding-bottom: 0;
|
|
892
|
+
width: 100%;
|
|
893
|
+
max-width: 100%;
|
|
853
894
|
}
|
|
854
895
|
.semi-datepicker-compact .semi-datepicker-navigation-left, .semi-datepicker-compact .semi-datepicker-navigation-right {
|
|
855
896
|
width: 24px;
|
|
@@ -859,11 +900,22 @@
|
|
|
859
900
|
min-width: 24px;
|
|
860
901
|
min-height: 24px;
|
|
861
902
|
}
|
|
903
|
+
.semi-datepicker-compact .semi-datepicker-navigation-month {
|
|
904
|
+
min-width: 0;
|
|
905
|
+
overflow: hidden;
|
|
906
|
+
}
|
|
862
907
|
.semi-datepicker-compact .semi-datepicker-navigation-month .semi-button {
|
|
863
908
|
font-size: 12px;
|
|
864
909
|
line-height: 16px;
|
|
865
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
910
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
866
911
|
line-height: 20px;
|
|
912
|
+
max-width: 100%;
|
|
913
|
+
}
|
|
914
|
+
.semi-datepicker-compact .semi-datepicker-navigation-month .semi-button > span {
|
|
915
|
+
display: block;
|
|
916
|
+
overflow: hidden;
|
|
917
|
+
text-overflow: ellipsis;
|
|
918
|
+
white-space: nowrap;
|
|
867
919
|
}
|
|
868
920
|
.semi-datepicker-compact .semi-datepicker-month {
|
|
869
921
|
width: 216px;
|
|
@@ -1008,7 +1060,9 @@
|
|
|
1008
1060
|
color: var(--semi-color-primary);
|
|
1009
1061
|
}
|
|
1010
1062
|
.semi-datepicker-compact .semi-datepicker-quick-control-month {
|
|
1011
|
-
|
|
1063
|
+
min-width: 216px;
|
|
1064
|
+
width: max-content;
|
|
1065
|
+
max-width: calc(100vw - 32px);
|
|
1012
1066
|
}
|
|
1013
1067
|
.semi-datepicker-compact .semi-datepicker-quick-control-month[x-insetinput=true] .semi-datepicker-quick-control-right-content-wrapper,
|
|
1014
1068
|
.semi-datepicker-compact .semi-datepicker-quick-control-month[x-insetinput=true] .semi-datepicker-quick-control-left-content-wrapper {
|
|
@@ -1019,7 +1073,9 @@
|
|
|
1019
1073
|
max-height: 218px;
|
|
1020
1074
|
}
|
|
1021
1075
|
.semi-datepicker-compact .semi-datepicker-quick-control-date {
|
|
1022
|
-
|
|
1076
|
+
min-width: 216px;
|
|
1077
|
+
width: max-content;
|
|
1078
|
+
max-width: calc(100vw - 32px);
|
|
1023
1079
|
}
|
|
1024
1080
|
.semi-datepicker-compact .semi-datepicker-quick-control-date[x-insetinput=true] .semi-datepicker-quick-control-right-content-wrapper,
|
|
1025
1081
|
.semi-datepicker-compact .semi-datepicker-quick-control-date[x-insetinput=true] .semi-datepicker-quick-control-left-content-wrapper {
|
|
@@ -1030,7 +1086,9 @@
|
|
|
1030
1086
|
max-height: 208px;
|
|
1031
1087
|
}
|
|
1032
1088
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateTime {
|
|
1033
|
-
|
|
1089
|
+
min-width: 216px;
|
|
1090
|
+
width: max-content;
|
|
1091
|
+
max-width: calc(100vw - 32px);
|
|
1034
1092
|
}
|
|
1035
1093
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateTime[x-insetinput=true] .semi-datepicker-quick-control-right-content-wrapper,
|
|
1036
1094
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateTime[x-insetinput=true] .semi-datepicker-quick-control-left-content-wrapper {
|
|
@@ -1041,7 +1099,9 @@
|
|
|
1041
1099
|
max-height: 240px;
|
|
1042
1100
|
}
|
|
1043
1101
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateRange {
|
|
1044
|
-
|
|
1102
|
+
min-width: min(432px, calc(100vw - 32px));
|
|
1103
|
+
width: max-content;
|
|
1104
|
+
max-width: calc(100vw - 32px);
|
|
1045
1105
|
}
|
|
1046
1106
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateRange[x-insetinput=true] .semi-datepicker-quick-control-right-content-wrapper,
|
|
1047
1107
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateRange[x-insetinput=true] .semi-datepicker-quick-control-left-content-wrapper {
|
|
@@ -1052,7 +1112,9 @@
|
|
|
1052
1112
|
max-height: 208px;
|
|
1053
1113
|
}
|
|
1054
1114
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateTimeRange {
|
|
1055
|
-
|
|
1115
|
+
min-width: min(432px, calc(100vw - 32px));
|
|
1116
|
+
width: max-content;
|
|
1117
|
+
max-width: calc(100vw - 32px);
|
|
1056
1118
|
}
|
|
1057
1119
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateTimeRange[x-insetinput=true] .semi-datepicker-quick-control-right-content-wrapper,
|
|
1058
1120
|
.semi-datepicker-compact .semi-datepicker-quick-control-dateTimeRange[x-insetinput=true] .semi-datepicker-quick-control-left-content-wrapper {
|
|
@@ -1129,7 +1129,44 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1129
1129
|
@include font-size-small;
|
|
1130
1130
|
line-height: $lineHeight-datepicker_compact;
|
|
1131
1131
|
|
|
1132
|
+
// Max width constraint for compact panels
|
|
1133
|
+
$compact-max-width: calc(100vw - 32px);
|
|
1134
|
+
|
|
1135
|
+
// Make the compact panel shrink-to-fit its contents.
|
|
1136
|
+
// This ensures the popover background/container expands together with
|
|
1137
|
+
// long locale texts instead of letting inner buttons visually overflow.
|
|
1138
|
+
display: inline-block;
|
|
1139
|
+
max-width: $compact-max-width;
|
|
1140
|
+
|
|
1141
|
+
// Ensure the popover expands to fit this compact datepicker
|
|
1142
|
+
&:not(&-insetInput) {
|
|
1143
|
+
width: max-content;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
.#{$module}-container {
|
|
1147
|
+
// Keep flex layout but allow the container to size by content.
|
|
1148
|
+
width: max-content;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1132
1151
|
.#{$module}-month-grid {
|
|
1152
|
+
// Let the month grid contribute its intrinsic width to the popover.
|
|
1153
|
+
width: max-content;
|
|
1154
|
+
|
|
1155
|
+
.#{$module}-month-grid-left,
|
|
1156
|
+
.#{$module}-month-grid-right {
|
|
1157
|
+
min-width: $width-datepicker_month_compact;
|
|
1158
|
+
// Keep the current compact width as the baseline,
|
|
1159
|
+
// but allow the panel to grow to fit long locale texts.
|
|
1160
|
+
// When reaching viewport limit, month title will ellipsis.
|
|
1161
|
+
max-width: $compact-max-width;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// Keep calendar body centered when panel grows
|
|
1165
|
+
// without breaking navigation layout in range mode.
|
|
1166
|
+
.#{$module}-month {
|
|
1167
|
+
margin-left: auto;
|
|
1168
|
+
margin-right: auto;
|
|
1169
|
+
}
|
|
1133
1170
|
|
|
1134
1171
|
&[x-type="dateTime"],
|
|
1135
1172
|
&[x-type="dateTimeRange"] {
|
|
@@ -1139,6 +1176,18 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1139
1176
|
}
|
|
1140
1177
|
}
|
|
1141
1178
|
|
|
1179
|
+
// Allow yam (year-month scrolllist) panel to expand with content in compact mode
|
|
1180
|
+
.#{$module}-yam {
|
|
1181
|
+
// Use relative positioning so parent can expand to fit content width
|
|
1182
|
+
// Height is constrained to prevent scrolllist from expanding too much
|
|
1183
|
+
position: relative;
|
|
1184
|
+
width: 100%;
|
|
1185
|
+
max-width: 100%;
|
|
1186
|
+
max-height: $height-datepicker_yam_panel_compact;
|
|
1187
|
+
overflow-x: auto;
|
|
1188
|
+
overflow-y: hidden;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1142
1191
|
&[x-type="dateRange"],
|
|
1143
1192
|
&[x-type="dateTimeRange"] {
|
|
1144
1193
|
.#{$module}-month-grid-left {
|
|
@@ -1169,6 +1218,18 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1169
1218
|
box-sizing: border-box;
|
|
1170
1219
|
height: $height-datepicker_yam_panel_header_compact;
|
|
1171
1220
|
padding: $spacing-datepicker_yam_panel_header_compact-padding;
|
|
1221
|
+
width: 100%;
|
|
1222
|
+
max-width: 100%;
|
|
1223
|
+
|
|
1224
|
+
// Constrain the back button to prevent overflow
|
|
1225
|
+
button,
|
|
1226
|
+
.#{$prefix}-button {
|
|
1227
|
+
width: 100%;
|
|
1228
|
+
max-width: 100%;
|
|
1229
|
+
overflow: hidden;
|
|
1230
|
+
text-overflow: ellipsis;
|
|
1231
|
+
white-space: nowrap;
|
|
1232
|
+
}
|
|
1172
1233
|
}
|
|
1173
1234
|
|
|
1174
1235
|
.#{$module}-yearmonth-body {
|
|
@@ -1265,9 +1326,14 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1265
1326
|
}
|
|
1266
1327
|
|
|
1267
1328
|
.#{$module}-navigation {
|
|
1329
|
+
box-sizing: border-box;
|
|
1268
1330
|
height: $width-datepicker_nav_compact;
|
|
1269
1331
|
padding: $spacing-datepicker_nav_compact-padding;
|
|
1270
1332
|
padding-bottom: 0;
|
|
1333
|
+
// In compact mode, keep navigation constrained within each panel
|
|
1334
|
+
// (especially important for dateRange two-column layout).
|
|
1335
|
+
width: 100%;
|
|
1336
|
+
max-width: 100%;
|
|
1271
1337
|
|
|
1272
1338
|
&-left,
|
|
1273
1339
|
&-right {
|
|
@@ -1281,10 +1347,21 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1281
1347
|
}
|
|
1282
1348
|
|
|
1283
1349
|
&-month {
|
|
1350
|
+
min-width: 0;
|
|
1351
|
+
overflow: hidden;
|
|
1352
|
+
|
|
1284
1353
|
.#{$prefix}-button {
|
|
1285
1354
|
// 覆盖样式,否则会从button继承
|
|
1286
1355
|
@include font-size-small;
|
|
1287
1356
|
line-height: $lineHeight-datepicker_compact;
|
|
1357
|
+
max-width: 100%;
|
|
1358
|
+
|
|
1359
|
+
> span {
|
|
1360
|
+
display: block;
|
|
1361
|
+
overflow: hidden;
|
|
1362
|
+
text-overflow: ellipsis;
|
|
1363
|
+
white-space: nowrap;
|
|
1364
|
+
}
|
|
1288
1365
|
}
|
|
1289
1366
|
}
|
|
1290
1367
|
}
|
|
@@ -1498,7 +1575,10 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1498
1575
|
}
|
|
1499
1576
|
|
|
1500
1577
|
&-month {
|
|
1501
|
-
|
|
1578
|
+
// Keep compact baseline width, but allow growing to fit long locale texts.
|
|
1579
|
+
min-width: $width-datepicker_panel_compact;
|
|
1580
|
+
width: max-content;
|
|
1581
|
+
max-width: $compact-max-width;
|
|
1502
1582
|
|
|
1503
1583
|
&[x-insetinput=true] {
|
|
1504
1584
|
.#{$module}-quick-control-right-content-wrapper,
|
|
@@ -1514,7 +1594,10 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1514
1594
|
}
|
|
1515
1595
|
|
|
1516
1596
|
&-date {
|
|
1517
|
-
|
|
1597
|
+
// Keep compact baseline width, but allow growing to fit long locale texts.
|
|
1598
|
+
min-width: $width-datepicker_panel_compact;
|
|
1599
|
+
width: max-content;
|
|
1600
|
+
max-width: $compact-max-width;
|
|
1518
1601
|
|
|
1519
1602
|
&[x-insetinput=true] {
|
|
1520
1603
|
.#{$module}-quick-control-right-content-wrapper,
|
|
@@ -1530,7 +1613,10 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1530
1613
|
}
|
|
1531
1614
|
|
|
1532
1615
|
&-dateTime {
|
|
1533
|
-
|
|
1616
|
+
// Keep compact baseline width, but allow growing to fit long locale texts.
|
|
1617
|
+
min-width: $width-datepicker_panel_compact;
|
|
1618
|
+
width: max-content;
|
|
1619
|
+
max-width: $compact-max-width;
|
|
1534
1620
|
|
|
1535
1621
|
&[x-insetinput=true] {
|
|
1536
1622
|
.#{$module}-quick-control-right-content-wrapper,
|
|
@@ -1546,7 +1632,12 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1546
1632
|
}
|
|
1547
1633
|
|
|
1548
1634
|
&-dateRange {
|
|
1549
|
-
|
|
1635
|
+
// Keep compact baseline width, but allow growing to fit long locale texts.
|
|
1636
|
+
// Avoid min-width > max-width on small viewports (which would force overflow).
|
|
1637
|
+
// Keep the 2-panel baseline when possible, but cap it to the compact viewport limit.
|
|
1638
|
+
min-width: min(#{$width-datepicker_panel_compact * 2}, #{$compact-max-width});
|
|
1639
|
+
width: max-content;
|
|
1640
|
+
max-width: $compact-max-width;
|
|
1550
1641
|
|
|
1551
1642
|
&[x-insetinput=true] {
|
|
1552
1643
|
.#{$module}-quick-control-right-content-wrapper,
|
|
@@ -1562,7 +1653,11 @@ $module-list: #{$prefix}-scrolllist;
|
|
|
1562
1653
|
}
|
|
1563
1654
|
|
|
1564
1655
|
&-dateTimeRange {
|
|
1565
|
-
|
|
1656
|
+
// Keep compact baseline width, but allow growing to fit long locale texts.
|
|
1657
|
+
// Avoid min-width > max-width on small viewports (which would force overflow).
|
|
1658
|
+
min-width: min(#{$width-datepicker_panel_compact * 2}, #{$compact-max-width});
|
|
1659
|
+
width: max-content;
|
|
1660
|
+
max-width: $compact-max-width;
|
|
1566
1661
|
|
|
1567
1662
|
&[x-insetinput=true] {
|
|
1568
1663
|
.#{$module}-quick-control-right-content-wrapper,
|
|
@@ -138,6 +138,11 @@ export interface DatePickerFoundationProps extends ElementProps, RenderProps, Ev
|
|
|
138
138
|
dateFnsLocale?: any;
|
|
139
139
|
localeCode?: string;
|
|
140
140
|
rangeSeparator?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Only for UI render. Keep `semi-foundation` framework-agnostic (no React types).
|
|
143
|
+
* `semi-ui` layer should declare this as `React.ReactNode`.
|
|
144
|
+
*/
|
|
145
|
+
rangeSeparatorNode?: any;
|
|
141
146
|
insetInput?: DateInputFoundationProps['insetInput'];
|
|
142
147
|
preventScroll?: boolean;
|
|
143
148
|
}
|
|
@@ -53,6 +53,8 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
53
53
|
this._isRangeValueComplete = value => {
|
|
54
54
|
let result = false;
|
|
55
55
|
if (Array.isArray(value)) {
|
|
56
|
+
// Note: empty array should be treated as "complete" (not partially selected)
|
|
57
|
+
// to keep behaviors such as clear/confirm/change consistent.
|
|
56
58
|
result = !value.some(date => (0, _isNullOrUndefined.default)(date));
|
|
57
59
|
}
|
|
58
60
|
return result;
|
|
@@ -40,6 +40,11 @@ export interface DateInputFoundationProps extends DateInputElementProps, DateInp
|
|
|
40
40
|
validateStatus?: ValidateStatus;
|
|
41
41
|
prefixCls?: string;
|
|
42
42
|
rangeSeparator?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Only for UI render. Keep `semi-foundation` framework-agnostic (no React types).
|
|
45
|
+
* `semi-ui` layer should declare this as `React.ReactNode`.
|
|
46
|
+
*/
|
|
47
|
+
rangeSeparatorNode?: any;
|
|
43
48
|
panelType?: PanelType;
|
|
44
49
|
insetInput?: boolean | InsetInputProps;
|
|
45
50
|
insetInputValue?: InsetInputValue;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
font-weight: normal;
|
|
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
|
min-height: 14px;
|
|
30
30
|
white-space: nowrap;
|
|
31
31
|
color: var(--semi-color-text-2);
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
font-weight: normal;
|
|
35
35
|
font-size: 14px;
|
|
36
36
|
line-height: 20px;
|
|
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
|
color: var(--semi-color-text-0);
|
|
39
39
|
}
|
|
40
40
|
.semi-descriptions-center .semi-descriptions-item-th {
|
|
@@ -84,14 +84,14 @@
|
|
|
84
84
|
.semi-descriptions-double-small .semi-descriptions-key {
|
|
85
85
|
font-size: 12px;
|
|
86
86
|
line-height: 16px;
|
|
87
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
87
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
88
88
|
padding-bottom: 0;
|
|
89
89
|
font-size: 12px;
|
|
90
90
|
}
|
|
91
91
|
.semi-descriptions-double-small .semi-descriptions-value {
|
|
92
92
|
font-size: 16px;
|
|
93
93
|
line-height: 22px;
|
|
94
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
94
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
95
95
|
font-size: 16px;
|
|
96
96
|
}
|
|
97
97
|
.semi-descriptions-double-medium .semi-descriptions-item {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
.semi-descriptions-double-medium .semi-descriptions-value {
|
|
105
105
|
font-size: 20px;
|
|
106
106
|
line-height: 28px;
|
|
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
|
font-size: 20px;
|
|
109
109
|
}
|
|
110
110
|
.semi-descriptions-double-large .semi-descriptions-item {
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
.semi-descriptions-double-large .semi-descriptions-value {
|
|
118
118
|
font-size: 28px;
|
|
119
119
|
line-height: 40px;
|
|
120
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
120
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
121
121
|
font-size: 28px;
|
|
122
122
|
}
|
|
123
123
|
.semi-descriptions-horizontal table {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
.semi-dropdown {
|
|
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
|
}
|
|
9
9
|
.semi-dropdown-wrapper {
|
|
10
10
|
overflow-y: auto;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
padding-right: 16px;
|
|
36
36
|
font-size: 12px;
|
|
37
37
|
line-height: 16px;
|
|
38
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
38
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
39
39
|
cursor: default;
|
|
40
40
|
}
|
|
41
41
|
.semi-dropdown-title-withTick {
|
package/lib/cjs/form/form.css
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
vertical-align: middle;
|
|
55
55
|
font-size: 14px;
|
|
56
56
|
line-height: 20px;
|
|
57
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
57
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
58
58
|
flex-shrink: 0;
|
|
59
59
|
}
|
|
60
60
|
.semi-form-field-label-disabled {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
.semi-form-field-error-message, .semi-form-field-help-text {
|
|
90
90
|
font-size: 14px;
|
|
91
91
|
line-height: 20px;
|
|
92
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
92
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
93
93
|
display: flex;
|
|
94
94
|
align-items: center;
|
|
95
95
|
margin-top: 4px;
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
color: var(--semi-color-tertiary);
|
|
177
177
|
font-size: 14px;
|
|
178
178
|
line-height: 20px;
|
|
179
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
179
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.semi-form-vertical .semi-form-field-group {
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
margin-block-end: 0;
|
|
211
211
|
font-size: 18px;
|
|
212
212
|
line-height: 24px;
|
|
213
|
-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "
|
|
213
|
+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
214
214
|
font-weight: 600;
|
|
215
215
|
width: 100%;
|
|
216
216
|
padding-bottom: 8px;
|
|
@@ -23,7 +23,7 @@ export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
|
|
|
23
23
|
updateArrayField(arrayField: string, updateValue: any): void;
|
|
24
24
|
validate(fieldPaths?: Array<string> | ValidateOptions): Promise<unknown>;
|
|
25
25
|
_formValidate(silent?: boolean): Promise<unknown>;
|
|
26
|
-
_fieldsValidate(fieldPaths
|
|
26
|
+
_fieldsValidate(fieldPaths?: Array<string>, silent?: boolean): Promise<unknown>;
|
|
27
27
|
submit(e?: any): void;
|
|
28
28
|
/**
|
|
29
29
|
* Case A:
|
|
@@ -79,14 +79,60 @@ class FormFoundation extends _foundation.default {
|
|
|
79
79
|
const registered = this.registered[field];
|
|
80
80
|
this.registered[field] = true;
|
|
81
81
|
this.fields.set(field, fieldStuff);
|
|
82
|
-
if (fieldStuff.keepState) {
|
|
83
|
-
//
|
|
82
|
+
if (fieldStuff.keepState && registered) {
|
|
83
|
+
// When keepState is true and the field was previously registered (remounting),
|
|
84
|
+
// restore the saved state from formState instead of using the initial value
|
|
85
|
+
const hasSavedValue = ObjectUtil.has(this.data.values, field);
|
|
86
|
+
const savedValue = ObjectUtil.get(this.data.values, field);
|
|
87
|
+
const hasSavedError = ObjectUtil.has(this.data.errors, field);
|
|
88
|
+
const savedError = ObjectUtil.get(this.data.errors, field);
|
|
89
|
+
const hasSavedTouched = ObjectUtil.has(this.data.touched, field);
|
|
90
|
+
const savedTouched = ObjectUtil.get(this.data.touched, field);
|
|
91
|
+
const allowEmpty = fieldStuff.allowEmpty || false;
|
|
92
|
+
const opts = {
|
|
93
|
+
notNotify: true,
|
|
94
|
+
notUpdate: false,
|
|
95
|
+
// updateStateValue reads `fieldAllowEmpty` (field-level override)
|
|
96
|
+
fieldAllowEmpty: allowEmpty
|
|
97
|
+
};
|
|
98
|
+
// Restore value from formState if it exists
|
|
99
|
+
if (hasSavedValue) {
|
|
100
|
+
// Keep formState as source of truth; still trigger a forceUpdate so that
|
|
101
|
+
// consumers of formState can get the latest snapshot when field remounts.
|
|
102
|
+
this.updateStateValue(field, savedValue, opts);
|
|
103
|
+
// Sync the restored value back to the field component's local state.
|
|
104
|
+
// Avoid a second forceUpdate/notify from FieldApi.
|
|
105
|
+
fieldStuff.fieldApi.setValue(savedValue, Object.assign(Object.assign({}, opts), {
|
|
106
|
+
notUpdate: true
|
|
107
|
+
}));
|
|
108
|
+
} else {
|
|
109
|
+
// No saved value, use initial value
|
|
110
|
+
let fieldValue = fieldState.value;
|
|
111
|
+
if (!allowEmpty && fieldValue === '') {
|
|
112
|
+
fieldValue = undefined;
|
|
113
|
+
}
|
|
114
|
+
this.updateStateValue(field, fieldValue, opts);
|
|
115
|
+
}
|
|
116
|
+
// Restore error from formState if it exists
|
|
117
|
+
if (hasSavedError) {
|
|
118
|
+
this.updateStateError(field, savedError, opts);
|
|
119
|
+
fieldStuff.fieldApi.setError(savedError, Object.assign(Object.assign({}, opts), {
|
|
120
|
+
notUpdate: true
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
// Restore touched from formState if it exists
|
|
124
|
+
if (hasSavedTouched) {
|
|
125
|
+
this.updateStateTouched(field, savedTouched, opts);
|
|
126
|
+
fieldStuff.fieldApi.setTouched(savedTouched, Object.assign(Object.assign({}, opts), {
|
|
127
|
+
notUpdate: true
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
84
130
|
} else {
|
|
85
131
|
const allowEmpty = fieldStuff.allowEmpty || false;
|
|
86
132
|
const opts = {
|
|
87
133
|
notNotify: true,
|
|
88
134
|
notUpdate: false,
|
|
89
|
-
allowEmpty
|
|
135
|
+
fieldAllowEmpty: allowEmpty
|
|
90
136
|
};
|
|
91
137
|
let fieldValue = fieldState.value;
|
|
92
138
|
// When allowEmpty is false, 'is equivalent to undefined, and the key of the field does not need to be reflected on values
|
|
@@ -135,9 +181,9 @@ class FormFoundation extends _foundation.default {
|
|
|
135
181
|
this.registeredArrayField.set(arrayField, mergeVal);
|
|
136
182
|
}
|
|
137
183
|
validate(fieldPaths) {
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
184
|
+
const props = this.getProps();
|
|
185
|
+
// `validator` is the recommended name; `validateFields` is kept as a deprecated alias.
|
|
186
|
+
const validateFields = props.validator || props.validateFields;
|
|
141
187
|
// Parse options
|
|
142
188
|
let fields;
|
|
143
189
|
let silent = false;
|
|
@@ -162,9 +208,9 @@ class FormFoundation extends _foundation.default {
|
|
|
162
208
|
const {
|
|
163
209
|
values
|
|
164
210
|
} = this.data;
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
211
|
+
const props = this.getProps();
|
|
212
|
+
// `validator` is the recommended name; `validateFields` is kept as a deprecated alias.
|
|
213
|
+
const validateFields = props.validator || props.validateFields;
|
|
168
214
|
return new Promise((resolve, reject) => {
|
|
169
215
|
let maybePromisedErrors;
|
|
170
216
|
try {
|