@douyinfe/semi-foundation 2.96.0 → 2.97.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/datePicker/datePicker.scss +100 -5
- package/form/foundation.ts +7 -3
- 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/lib/cjs/cascader/foundation.d.ts +12 -0
- package/lib/cjs/cascader/foundation.js +68 -23
- package/lib/cjs/datePicker/datePicker.css +67 -5
- package/lib/cjs/datePicker/datePicker.scss +100 -5
- package/lib/cjs/form/foundation.d.ts +1 -1
- package/lib/cjs/form/foundation.js +6 -6
- package/lib/cjs/form/utils.js +5 -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/textarea.css +17 -0
- package/lib/cjs/input/textarea.scss +35 -0
- package/lib/cjs/navigation/navigation.css +2 -1
- package/lib/cjs/navigation/navigation.scss +1 -0
- package/lib/cjs/navigation/variables.scss +1 -1
- package/lib/cjs/overflowList/foundation.d.ts +1 -0
- package/lib/cjs/overflowList/foundation.js +51 -1
- package/lib/cjs/select/foundation.d.ts +1 -1
- package/lib/cjs/select/foundation.js +28 -2
- 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.js +2 -1
- package/lib/cjs/tag/tag.css +26 -0
- package/lib/cjs/tag/tag.scss +33 -0
- package/lib/cjs/tagInput/tagInput.css +17 -0
- 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/es/cascader/foundation.d.ts +12 -0
- package/lib/es/cascader/foundation.js +68 -23
- package/lib/es/datePicker/datePicker.css +67 -5
- package/lib/es/datePicker/datePicker.scss +100 -5
- package/lib/es/form/foundation.d.ts +1 -1
- package/lib/es/form/foundation.js +6 -6
- package/lib/es/form/utils.js +5 -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/textarea.css +17 -0
- package/lib/es/input/textarea.scss +35 -0
- package/lib/es/navigation/navigation.css +2 -1
- package/lib/es/navigation/navigation.scss +1 -0
- package/lib/es/navigation/variables.scss +1 -1
- package/lib/es/overflowList/foundation.d.ts +1 -0
- package/lib/es/overflowList/foundation.js +51 -1
- package/lib/es/select/foundation.d.ts +1 -1
- package/lib/es/select/foundation.js +28 -2
- 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.js +2 -1
- package/lib/es/tag/tag.css +26 -0
- package/lib/es/tag/tag.scss +33 -0
- package/lib/es/tagInput/tagInput.css +17 -0
- 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/navigation/navigation.scss +1 -0
- package/navigation/variables.scss +1 -1
- package/overflowList/foundation.ts +48 -2
- package/package.json +4 -4
- package/select/foundation.ts +27 -2
- package/switch/switch.scss +1 -0
- package/switch/variables.scss +2 -1
- package/table/foundation.ts +2 -1
- package/tag/tag.scss +33 -0
- package/tagInput/tagInput.scss +18 -0
- package/timePicker/constants.ts +2 -0
- package/timePicker/foundation.ts +62 -10
|
@@ -765,10 +765,38 @@
|
|
|
765
765
|
line-height: 16px;
|
|
766
766
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "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;
|
|
@@ -847,9 +885,12 @@
|
|
|
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
910
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "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,
|
|
@@ -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:
|
|
@@ -126,9 +126,9 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
126
126
|
this.registeredArrayField.set(arrayField, mergeVal);
|
|
127
127
|
}
|
|
128
128
|
validate(fieldPaths) {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
const props = this.getProps();
|
|
130
|
+
// `validator` is the recommended name; `validateFields` is kept as a deprecated alias.
|
|
131
|
+
const validateFields = props.validator || props.validateFields;
|
|
132
132
|
// Parse options
|
|
133
133
|
let fields;
|
|
134
134
|
let silent = false;
|
|
@@ -153,9 +153,9 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
153
153
|
const {
|
|
154
154
|
values
|
|
155
155
|
} = this.data;
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
const props = this.getProps();
|
|
157
|
+
// `validator` is the recommended name; `validateFields` is kept as a deprecated alias.
|
|
158
|
+
const validateFields = props.validator || props.validateFields;
|
|
159
159
|
return new Promise((resolve, reject) => {
|
|
160
160
|
let maybePromisedErrors;
|
|
161
161
|
try {
|
package/lib/es/form/utils.js
CHANGED
|
@@ -128,6 +128,7 @@ export function mergeProps(props) {
|
|
|
128
128
|
wrapperCol,
|
|
129
129
|
initValue,
|
|
130
130
|
validate,
|
|
131
|
+
validator,
|
|
131
132
|
/**
|
|
132
133
|
* error、warning、default、success
|
|
133
134
|
*/
|
|
@@ -159,7 +160,7 @@ export function mergeProps(props) {
|
|
|
159
160
|
pure,
|
|
160
161
|
id
|
|
161
162
|
} = _a,
|
|
162
|
-
rest = __rest(_a, ["field", "label", "labelPosition", "labelWidth", "labelAlign", "labelCol", "wrapperCol", "initValue", "validate", "validateStatus", "trigger", "allowEmptyString", "allowEmpty", "emptyValue", "rules", "onChange", "keepState", "transform", "name", "fieldClassName", "fieldStyle", "noLabel", "noErrorMessage", "isInInputGroup", "stopValidateWithError", "convert", "showValidateIcon", "helpText", "extraText", "extraTextPosition", "pure", "id"]);
|
|
163
|
+
rest = __rest(_a, ["field", "label", "labelPosition", "labelWidth", "labelAlign", "labelCol", "wrapperCol", "initValue", "validate", "validator", "validateStatus", "trigger", "allowEmptyString", "allowEmpty", "emptyValue", "rules", "onChange", "keepState", "transform", "name", "fieldClassName", "fieldStyle", "noLabel", "noErrorMessage", "isInInputGroup", "stopValidateWithError", "convert", "showValidateIcon", "helpText", "extraText", "extraTextPosition", "pure", "id"]);
|
|
163
164
|
// Form中的任何类型组件,初始值都统一通过initValue字段来传入,同时将可能会导致组件行为错误的props抽取出来,防止透传到组件中
|
|
164
165
|
// For any type of field component in Form, the initial value is uniformly passed in through the initValue field.
|
|
165
166
|
// At the same time, the props that may cause component behavior errors are extracted to prevent transparent transmission to the component.
|
|
@@ -171,6 +172,8 @@ export function mergeProps(props) {
|
|
|
171
172
|
}
|
|
172
173
|
const required = isRequired(rules);
|
|
173
174
|
emptyValue = typeof emptyValue !== 'undefined' ? emptyValue : '';
|
|
175
|
+
// `validator` is the recommended name; `validate` is kept as a deprecated alias.
|
|
176
|
+
const finalValidate = validator || validate;
|
|
174
177
|
return {
|
|
175
178
|
field,
|
|
176
179
|
label,
|
|
@@ -183,7 +186,7 @@ export function mergeProps(props) {
|
|
|
183
186
|
noErrorMessage,
|
|
184
187
|
isInInputGroup,
|
|
185
188
|
initValue,
|
|
186
|
-
validate,
|
|
189
|
+
validate: finalValidate,
|
|
187
190
|
validateStatus,
|
|
188
191
|
trigger,
|
|
189
192
|
allowEmptyString,
|
|
@@ -41,6 +41,10 @@ export default class PreviewImageFoundation<P = Record<string, any>, S = Record<
|
|
|
41
41
|
originImageHeight: any;
|
|
42
42
|
containerWidth: number;
|
|
43
43
|
containerHeight: number;
|
|
44
|
+
private _initialZoomApplied;
|
|
45
|
+
private _initialZoomAppliedSrc;
|
|
46
|
+
private _syncInitialZoomFlagWithSrc;
|
|
47
|
+
private _clampZoom;
|
|
44
48
|
init(): void;
|
|
45
49
|
_isImageVertical: () => boolean;
|
|
46
50
|
_getContainerBoundingRectSize: () => void;
|
|
@@ -12,6 +12,28 @@ export default class PreviewImageFoundation extends BaseFoundation {
|
|
|
12
12
|
this.originImageHeight = null;
|
|
13
13
|
this.containerWidth = 0;
|
|
14
14
|
this.containerHeight = 0;
|
|
15
|
+
// initialZoom should only be applied once per image src (first initialization)
|
|
16
|
+
this._initialZoomApplied = false;
|
|
17
|
+
this._initialZoomAppliedSrc = undefined;
|
|
18
|
+
this._syncInitialZoomFlagWithSrc = () => {
|
|
19
|
+
const src = this.getProp("src");
|
|
20
|
+
if (src !== this._initialZoomAppliedSrc) {
|
|
21
|
+
this._initialZoomAppliedSrc = src;
|
|
22
|
+
this._initialZoomApplied = false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this._clampZoom = zoom => {
|
|
26
|
+
const {
|
|
27
|
+
maxZoom,
|
|
28
|
+
minZoom
|
|
29
|
+
} = this.getProps();
|
|
30
|
+
const max = typeof maxZoom === 'number' ? maxZoom : 5;
|
|
31
|
+
const min = typeof minZoom === 'number' ? minZoom : 0.1;
|
|
32
|
+
if (typeof zoom !== 'number' || !Number.isFinite(zoom)) {
|
|
33
|
+
return min;
|
|
34
|
+
}
|
|
35
|
+
return Math.min(max, Math.max(min, zoom));
|
|
36
|
+
};
|
|
15
37
|
this._isImageVertical = () => this.getProp("rotation") % 180 !== 0;
|
|
16
38
|
this._getContainerBoundingRectSize = () => {
|
|
17
39
|
const containerDOM = this._adapter.getContainer();
|
|
@@ -39,13 +61,20 @@ export default class PreviewImageFoundation extends BaseFoundation {
|
|
|
39
61
|
};
|
|
40
62
|
this._getInitialZoom = () => {
|
|
41
63
|
const {
|
|
42
|
-
ratio
|
|
64
|
+
ratio,
|
|
65
|
+
initialZoom
|
|
43
66
|
} = this.getProps();
|
|
44
67
|
let _zoom = 1;
|
|
68
|
+
// initialZoom is only used for the first initialization of each src
|
|
69
|
+
this._syncInitialZoomFlagWithSrc();
|
|
70
|
+
if (!this._initialZoomApplied && typeof initialZoom === 'number' && Number.isFinite(initialZoom) && initialZoom > 0) {
|
|
71
|
+
this._initialZoomApplied = true;
|
|
72
|
+
return this._clampZoom(initialZoom);
|
|
73
|
+
}
|
|
45
74
|
if (ratio === 'adaptation') {
|
|
46
75
|
_zoom = this._getAdaptationZoom();
|
|
47
76
|
}
|
|
48
|
-
return _zoom;
|
|
77
|
+
return this._clampZoom(_zoom);
|
|
49
78
|
};
|
|
50
79
|
this.setLoading = loading => {
|
|
51
80
|
this._adapter.setLoading(loading);
|
|
@@ -62,6 +91,8 @@ export default class PreviewImageFoundation extends BaseFoundation {
|
|
|
62
91
|
} = e.target;
|
|
63
92
|
this.originImageHeight = h;
|
|
64
93
|
this.originImageWidth = w;
|
|
94
|
+
// New image is loaded; allow initialZoom to be applied once for this src
|
|
95
|
+
this._syncInitialZoomFlagWithSrc();
|
|
65
96
|
this.setState({
|
|
66
97
|
loading: false
|
|
67
98
|
});
|
|
@@ -197,11 +197,12 @@ export default class PreviewInnerFoundation extends BaseFoundation {
|
|
|
197
197
|
const {
|
|
198
198
|
zoom
|
|
199
199
|
} = _this.getStates();
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
_this._adapter.
|
|
200
|
+
const nextZoom = _this._clampZoom(newZoom);
|
|
201
|
+
if (zoom !== nextZoom) {
|
|
202
|
+
notify && _this._adapter.notifyZoom(nextZoom, nextZoom > zoom);
|
|
203
|
+
_this._adapter.changeImageZoom(nextZoom, e);
|
|
203
204
|
_this.setState({
|
|
204
|
-
zoom:
|
|
205
|
+
zoom: nextZoom
|
|
205
206
|
});
|
|
206
207
|
}
|
|
207
208
|
};
|
|
@@ -320,6 +321,18 @@ export default class PreviewInnerFoundation extends BaseFoundation {
|
|
|
320
321
|
this.preloadSingleImage();
|
|
321
322
|
}
|
|
322
323
|
};
|
|
324
|
+
this._clampZoom = zoom => {
|
|
325
|
+
const {
|
|
326
|
+
maxZoom,
|
|
327
|
+
minZoom
|
|
328
|
+
} = this.getProps();
|
|
329
|
+
const max = typeof maxZoom === 'number' ? maxZoom : 5;
|
|
330
|
+
const min = typeof minZoom === 'number' ? minZoom : 0.1;
|
|
331
|
+
if (typeof zoom !== 'number' || !Number.isFinite(zoom)) {
|
|
332
|
+
return min;
|
|
333
|
+
}
|
|
334
|
+
return Math.min(max, Math.max(min, zoom));
|
|
335
|
+
};
|
|
323
336
|
}
|
|
324
337
|
beforeShow() {
|
|
325
338
|
this._adapter.registerKeyDownListener();
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
background-color: var(--semi-color-fill-0);
|
|
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
|
}
|
|
15
|
+
.semi-input-textarea-wrapper-resizeX {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
}
|
|
15
20
|
.semi-input-textarea-wrapper:hover {
|
|
16
21
|
background-color: var(--semi-color-fill-1);
|
|
17
22
|
}
|
|
@@ -32,6 +37,9 @@
|
|
|
32
37
|
color: var(--semi-color-text-2);
|
|
33
38
|
right: 4px;
|
|
34
39
|
height: 32px;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
35
43
|
}
|
|
36
44
|
.semi-input-textarea-wrapper .semi-input-clearbtn > svg {
|
|
37
45
|
pointer-events: none;
|
|
@@ -134,6 +142,7 @@
|
|
|
134
142
|
}
|
|
135
143
|
.semi-input-textarea-autosize {
|
|
136
144
|
overflow: hidden;
|
|
145
|
+
resize: none;
|
|
137
146
|
}
|
|
138
147
|
.semi-input-textarea-counter {
|
|
139
148
|
font-size: 12px;
|
|
@@ -176,6 +185,14 @@
|
|
|
176
185
|
padding: 0;
|
|
177
186
|
align-items: flex-start;
|
|
178
187
|
}
|
|
188
|
+
.semi-input-textarea-wrapper-withLineNumber.semi-input-textarea-wrapper-resizeX {
|
|
189
|
+
display: inline-flex;
|
|
190
|
+
width: fit-content;
|
|
191
|
+
max-width: 100%;
|
|
192
|
+
}
|
|
193
|
+
.semi-input-textarea-wrapper-withLineNumber.semi-input-textarea-wrapper-resizeX .semi-input-textarea-content {
|
|
194
|
+
flex: 0 0 auto;
|
|
195
|
+
}
|
|
179
196
|
.semi-input-textarea-wrapper-withLineNumber .semi-input-textarea-lineNumber {
|
|
180
197
|
flex-shrink: 0;
|
|
181
198
|
padding: 5px 12px;
|
|
@@ -16,6 +16,21 @@ $module: #{$prefix}-input;
|
|
|
16
16
|
transition: background-color $transition_duration-input-bg $transition_function-input-bg $transition_delay-input-bg,
|
|
17
17
|
border $transition_duration-input-border $transition_function-input-border $transition_delay-input-border;
|
|
18
18
|
|
|
19
|
+
// When native resize changes textarea width, wrapper (border/clear/counter) should follow.
|
|
20
|
+
// Default wrapper is `width: 100%`, so it won't grow with textarea. Enable shrink-to-fit.
|
|
21
|
+
&-resizeX {
|
|
22
|
+
// Keep original textarea wrapper formatting (stacking counter, etc.),
|
|
23
|
+
// only shrink-to-fit width so border follows horizontal resize.
|
|
24
|
+
// Using inline-flex here may change internal layout and cause clear/counter misalignment.
|
|
25
|
+
display: inline-block;
|
|
26
|
+
width: fit-content;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-resizeY {
|
|
31
|
+
// Keep default width behavior; vertical resize doesn't require wrapper width change.
|
|
32
|
+
}
|
|
33
|
+
|
|
19
34
|
&:hover {
|
|
20
35
|
background-color: $color-input_default-bg-hover;
|
|
21
36
|
}
|
|
@@ -40,6 +55,10 @@ $module: #{$prefix}-input;
|
|
|
40
55
|
color: $color-textarea-icon-default;
|
|
41
56
|
right: $spacing-textarea-icon-right;
|
|
42
57
|
height: $height-textarea-default;
|
|
58
|
+
// Center the icon within the clearbtn area
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
43
62
|
|
|
44
63
|
& > svg {
|
|
45
64
|
pointer-events: none;
|
|
@@ -130,6 +149,7 @@ $module: #{$prefix}-input;
|
|
|
130
149
|
|
|
131
150
|
.#{$module}-textarea {
|
|
132
151
|
position: relative;
|
|
152
|
+
// resize is now controlled by resize prop, default to none for backward compatibility
|
|
133
153
|
resize: none;
|
|
134
154
|
// min-height: $height-input_default;
|
|
135
155
|
padding: $spacing-textarea-paddingY $spacing-textarea-paddingX;
|
|
@@ -177,6 +197,8 @@ $module: #{$prefix}-input;
|
|
|
177
197
|
|
|
178
198
|
&-autosize {
|
|
179
199
|
overflow: hidden;
|
|
200
|
+
// When autosize is enabled, force resize to none to avoid conflicts
|
|
201
|
+
resize: none;
|
|
180
202
|
}
|
|
181
203
|
|
|
182
204
|
&-counter {
|
|
@@ -235,6 +257,19 @@ $module: #{$prefix}-input;
|
|
|
235
257
|
padding: 0;
|
|
236
258
|
align-items: flex-start;
|
|
237
259
|
|
|
260
|
+
&.#{$module}-textarea-wrapper-resizeX {
|
|
261
|
+
// Keep line number + textarea layout, but let width shrink-to-fit
|
|
262
|
+
display: inline-flex;
|
|
263
|
+
width: fit-content;
|
|
264
|
+
max-width: 100%;
|
|
265
|
+
|
|
266
|
+
.#{$module}-textarea-content {
|
|
267
|
+
flex: 0 0 auto;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Do not force a minimum width here; allow the control to fit narrow containers.
|
|
271
|
+
}
|
|
272
|
+
|
|
238
273
|
.#{$module}-textarea-lineNumber {
|
|
239
274
|
flex-shrink: 0;
|
|
240
275
|
padding: $spacing-textarea-paddingY $spacing-textarea-paddingX;
|
|
@@ -544,7 +544,7 @@
|
|
|
544
544
|
transition: padding-left 100ms ease-out, width 200ms cubic-bezier(0.62, 0.05, 0.36, 0.95);
|
|
545
545
|
}
|
|
546
546
|
.semi-navigation-vertical .semi-navigation-footer {
|
|
547
|
-
color: var(--semi-color-text-
|
|
547
|
+
color: var(--semi-color-text-1);
|
|
548
548
|
padding-left: 8px;
|
|
549
549
|
padding-right: 8px;
|
|
550
550
|
}
|
|
@@ -556,6 +556,7 @@
|
|
|
556
556
|
.semi-navigation-vertical .semi-navigation-footer .semi-navigation-collapse-btn > .semi-button {
|
|
557
557
|
padding-left: 8px;
|
|
558
558
|
padding-right: 8px;
|
|
559
|
+
color: var(--semi-color-text-1);
|
|
559
560
|
}
|
|
560
561
|
.semi-navigation-vertical .semi-navigation-footer-collapsed {
|
|
561
562
|
justify-content: center;
|
|
@@ -569,6 +569,7 @@ $module: #{$prefix}-navigation;
|
|
|
569
569
|
& > .#{$prefix}-button {
|
|
570
570
|
padding-left: $spacing-navigation_footer_collapse_btn_inner-paddingX;
|
|
571
571
|
padding-right: $spacing-navigation_footer_collapse_btn_inner-paddingX;
|
|
572
|
+
color: $color-navigation_footer_icon-default;
|
|
572
573
|
}
|
|
573
574
|
}
|
|
574
575
|
|
|
@@ -65,7 +65,7 @@ $spacing-navigation_sub_item_left_toggle_marginRight:$spacing-tight; // 顶部
|
|
|
65
65
|
$color-navigation-bg-default: var(--semi-color-nav-bg); // 导航栏背景色
|
|
66
66
|
$color-navigation_border-default: var(--semi-color-border); // 导航栏分割线色
|
|
67
67
|
$color-navigation_header-text-default: var(--semi-color-text-0); // 导航栏 header 文字颜色
|
|
68
|
-
$color-navigation_footer_icon-default: var(--semi-color-text-
|
|
68
|
+
$color-navigation_footer_icon-default: var(--semi-color-text-1); // 导航栏 footer 图标颜色
|
|
69
69
|
$color-navigation_itemL1-bg-default: transparent; // 导航栏一级菜单项背景色
|
|
70
70
|
$color-navigation_itemL1-text-default: var(--semi-color-text-0); // 导航栏一级菜单项文字颜色
|
|
71
71
|
$color-navigation_itemL1_icon-default: var(--semi-color-text-2); // 导航栏一级菜单项图标颜色
|
|
@@ -10,6 +10,7 @@ declare class OverflowListFoundation extends BaseFoundation<OverflowListAdapter>
|
|
|
10
10
|
previousY: any;
|
|
11
11
|
isScrollMode: () => boolean;
|
|
12
12
|
getOverflowItem(): Array<Array<Record<string, any>>>;
|
|
13
|
+
private _syncScrollOverflowCache;
|
|
13
14
|
handleIntersect(entries: Array<IntersectionObserverEntry>): void;
|
|
14
15
|
getReversedItems: () => any;
|
|
15
16
|
handleCollapseOverflow(): void;
|