@douyinfe/semi-foundation 2.6.0 → 2.7.1
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/button/button.scss +14 -6
- package/datePicker/_utils/formatter.ts +2 -2
- package/datePicker/_utils/getInsetInputFormatToken.ts +42 -0
- package/datePicker/_utils/getInsetInputValueFromInsetInputStr.ts +60 -0
- package/datePicker/constants.ts +2 -0
- package/datePicker/datePicker.scss +136 -3
- package/datePicker/foundation.ts +92 -15
- package/datePicker/inputFoundation.ts +133 -4
- package/datePicker/monthsGridFoundation.ts +4 -0
- package/datePicker/rtl.scss +8 -0
- package/datePicker/variables.scss +30 -0
- package/lib/cjs/button/button.css +5 -5
- package/lib/cjs/button/button.scss +14 -6
- package/lib/cjs/datePicker/_utils/formatter.d.ts +2 -2
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.d.ts +20 -0
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +61 -0
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.d.ts +31 -0
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +76 -0
- package/lib/cjs/datePicker/constants.d.ts +2 -0
- package/lib/cjs/datePicker/constants.js +4 -3
- package/lib/cjs/datePicker/datePicker.css +104 -2
- package/lib/cjs/datePicker/datePicker.scss +136 -3
- package/lib/cjs/datePicker/foundation.d.ts +30 -7
- package/lib/cjs/datePicker/foundation.js +122 -9
- package/lib/cjs/datePicker/inputFoundation.d.ts +73 -3
- package/lib/cjs/datePicker/inputFoundation.js +196 -3
- package/lib/cjs/datePicker/monthsGridFoundation.d.ts +1 -0
- package/lib/cjs/datePicker/monthsGridFoundation.js +4 -2
- package/lib/cjs/datePicker/rtl.scss +8 -0
- package/lib/cjs/datePicker/variables.scss +30 -0
- package/lib/cjs/tooltip/foundation.js +8 -8
- package/lib/cjs/treeSelect/foundation.d.ts +3 -2
- package/lib/cjs/treeSelect/foundation.js +28 -15
- package/lib/es/button/button.css +5 -5
- package/lib/es/button/button.scss +14 -6
- package/lib/es/datePicker/_utils/formatter.d.ts +2 -2
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.d.ts +20 -0
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +48 -0
- package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.d.ts +31 -0
- package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +66 -0
- package/lib/es/datePicker/constants.d.ts +2 -0
- package/lib/es/datePicker/constants.js +4 -3
- package/lib/es/datePicker/datePicker.css +104 -2
- package/lib/es/datePicker/datePicker.scss +136 -3
- package/lib/es/datePicker/foundation.d.ts +30 -7
- package/lib/es/datePicker/foundation.js +120 -9
- package/lib/es/datePicker/inputFoundation.d.ts +73 -3
- package/lib/es/datePicker/inputFoundation.js +192 -4
- package/lib/es/datePicker/monthsGridFoundation.d.ts +1 -0
- package/lib/es/datePicker/monthsGridFoundation.js +4 -2
- package/lib/es/datePicker/rtl.scss +8 -0
- package/lib/es/datePicker/variables.scss +30 -0
- package/lib/es/tooltip/foundation.js +8 -8
- package/lib/es/treeSelect/foundation.d.ts +3 -2
- package/lib/es/treeSelect/foundation.js +27 -15
- package/package.json +3 -3
- package/tooltip/foundation.ts +8 -8
- package/treeSelect/foundation.ts +26 -19
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
.semi-datepicker {
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
display: inline-block;
|
|
7
|
+
vertical-align: top;
|
|
7
8
|
}
|
|
8
9
|
.semi-datepicker-month-grid {
|
|
9
10
|
user-select: none;
|
|
@@ -29,6 +30,24 @@
|
|
|
29
30
|
.semi-datepicker-month-grid[x-type=date] .semi-datepicker-yam-showing {
|
|
30
31
|
min-height: 325px;
|
|
31
32
|
}
|
|
33
|
+
.semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-left[x-open-type=year],
|
|
34
|
+
.semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-right[x-open-type=year] {
|
|
35
|
+
min-height: 312px;
|
|
36
|
+
}
|
|
37
|
+
.semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-left[x-open-type=time],
|
|
38
|
+
.semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-right[x-open-type=time] {
|
|
39
|
+
min-height: 314px;
|
|
40
|
+
}
|
|
41
|
+
.semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-navigation {
|
|
42
|
+
padding-top: 8px;
|
|
43
|
+
padding-bottom: 8px;
|
|
44
|
+
}
|
|
45
|
+
.semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-tpk {
|
|
46
|
+
min-height: 100%;
|
|
47
|
+
}
|
|
48
|
+
.semi-datepicker-month-grid[x-insetInput=true][x-type=dateTime] .semi-datepicker-yam, .semi-datepicker-month-grid[x-insetInput=true][x-type=dateTimeRange] .semi-datepicker-yam {
|
|
49
|
+
height: 100%;
|
|
50
|
+
}
|
|
32
51
|
.semi-datepicker-month-grid .semi-datepicker-yearmonth-header {
|
|
33
52
|
background: var(--semi-color-bg-3);
|
|
34
53
|
padding: 12px 16px;
|
|
@@ -70,6 +89,7 @@
|
|
|
70
89
|
line-height: 20px;
|
|
71
90
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
72
91
|
min-height: 24px;
|
|
92
|
+
line-height: 24px;
|
|
73
93
|
}
|
|
74
94
|
.semi-datepicker-month-grid[x-panel-yearandmonth-open-type=left] .semi-datepicker-weeks, .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=right] .semi-datepicker-weeks {
|
|
75
95
|
min-height: 216px;
|
|
@@ -370,6 +390,34 @@
|
|
|
370
390
|
.semi-datepicker .semi-datepicker-input-readonly {
|
|
371
391
|
cursor: pointer;
|
|
372
392
|
}
|
|
393
|
+
.semi-datepicker-inset-input-wrapper {
|
|
394
|
+
display: flex;
|
|
395
|
+
flex-wrap: nowrap;
|
|
396
|
+
justify-content: space-between;
|
|
397
|
+
box-sizing: border-box;
|
|
398
|
+
column-gap: 8px;
|
|
399
|
+
padding: 12px 16px;
|
|
400
|
+
padding-bottom: 0;
|
|
401
|
+
width: 284px;
|
|
402
|
+
}
|
|
403
|
+
.semi-datepicker-inset-input-wrapper[x-type=dateRange], .semi-datepicker-inset-input-wrapper[x-type=dateTimeRange] {
|
|
404
|
+
width: 568px;
|
|
405
|
+
}
|
|
406
|
+
.semi-datepicker-inset-input-wrapper[x-type=month] {
|
|
407
|
+
width: 204px;
|
|
408
|
+
}
|
|
409
|
+
.semi-datepicker-inset-input-wrapper .semi-input-wrapper {
|
|
410
|
+
flex: 1;
|
|
411
|
+
flex-shrink: 0;
|
|
412
|
+
}
|
|
413
|
+
.semi-datepicker-inset-input-separator {
|
|
414
|
+
flex-grow: 0;
|
|
415
|
+
flex-shrink: 0;
|
|
416
|
+
height: 32px;
|
|
417
|
+
line-height: 32px;
|
|
418
|
+
padding: 0 4px;
|
|
419
|
+
color: var(--semi-color-text-3);
|
|
420
|
+
}
|
|
373
421
|
.semi-datepicker-range-input {
|
|
374
422
|
display: flex;
|
|
375
423
|
align-items: center;
|
|
@@ -572,6 +620,23 @@
|
|
|
572
620
|
.semi-datepicker-compact .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=left] .semi-datepicker-weeks, .semi-datepicker-compact .semi-datepicker-month-grid[x-panel-yearandmonth-open-type=right] .semi-datepicker-weeks {
|
|
573
621
|
min-height: 168px;
|
|
574
622
|
}
|
|
623
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-left[x-open-type=year],
|
|
624
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-right[x-open-type=year] {
|
|
625
|
+
min-height: 236px;
|
|
626
|
+
}
|
|
627
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-left[x-open-type=time],
|
|
628
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-month-grid-right[x-open-type=time] {
|
|
629
|
+
min-height: 236px;
|
|
630
|
+
}
|
|
631
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-yam-showing {
|
|
632
|
+
min-height: 236px;
|
|
633
|
+
}
|
|
634
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true] .semi-datepicker-tpk {
|
|
635
|
+
min-height: 100%;
|
|
636
|
+
}
|
|
637
|
+
.semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true][x-type=dateTime] .semi-datepicker-yam, .semi-datepicker-compact .semi-datepicker-month-grid[x-insetInput=true][x-type=dateTimeRange] .semi-datepicker-yam {
|
|
638
|
+
height: 100%;
|
|
639
|
+
}
|
|
575
640
|
.semi-datepicker-compact.semi-datepicker-panel-yam .semi-scrolllist {
|
|
576
641
|
font-size: 12px;
|
|
577
642
|
line-height: 16px;
|
|
@@ -687,11 +752,42 @@
|
|
|
687
752
|
padding-right: 8px;
|
|
688
753
|
padding-bottom: 10px;
|
|
689
754
|
}
|
|
755
|
+
.semi-datepicker-compact .semi-datepicker-inset-input-wrapper {
|
|
756
|
+
column-gap: 4px;
|
|
757
|
+
padding: 8px 8px;
|
|
758
|
+
padding-bottom: 0;
|
|
759
|
+
width: 216px;
|
|
760
|
+
}
|
|
761
|
+
.semi-datepicker-compact .semi-datepicker-inset-input-wrapper[x-type=dateRange], .semi-datepicker-compact .semi-datepicker-inset-input-wrapper[x-type=dateTimeRange] {
|
|
762
|
+
width: 432px;
|
|
763
|
+
padding-top: 0;
|
|
764
|
+
}
|
|
765
|
+
.semi-datepicker-compact .semi-datepicker-inset-input-wrapper[x-type=dateRange] .semi-input-wrapper, .semi-datepicker-compact .semi-datepicker-inset-input-wrapper[x-type=dateTimeRange] .semi-input-wrapper {
|
|
766
|
+
margin-top: 8px;
|
|
767
|
+
}
|
|
768
|
+
.semi-datepicker-compact .semi-datepicker-inset-input-wrapper[x-type=month] {
|
|
769
|
+
width: 195px;
|
|
770
|
+
}
|
|
771
|
+
.semi-datepicker-compact .semi-datepicker-inset-input-wrapper .semi-input-wrapper {
|
|
772
|
+
height: 28px;
|
|
773
|
+
box-sizing: border-box;
|
|
774
|
+
}
|
|
775
|
+
.semi-datepicker-compact .semi-datepicker-inset-input-wrapper .semi-input-wrapper .semi-input {
|
|
776
|
+
font-size: 12px;
|
|
777
|
+
line-height: 26px;
|
|
778
|
+
height: 26px;
|
|
779
|
+
vertical-align: top;
|
|
780
|
+
}
|
|
781
|
+
.semi-datepicker-compact .semi-datepicker-inset-input-separator {
|
|
782
|
+
border-left: 1px solid var(--semi-color-border);
|
|
783
|
+
transform: translateX(50%);
|
|
784
|
+
height: auto;
|
|
785
|
+
}
|
|
690
786
|
|
|
691
|
-
.semi-popover-wrapper[x-placement
|
|
787
|
+
.semi-popover-wrapper[x-placement^=top] .semi-datepicker .semi-datepicker-weeks, .semi-popover-wrapper[x-placement=leftTop] .semi-datepicker .semi-datepicker-weeks, .semi-popover-wrapper[x-placement=rightTop] .semi-datepicker .semi-datepicker-weeks, .semi-popover-wrapper[x-placement*=BottomOver] .semi-datepicker .semi-datepicker-weeks {
|
|
692
788
|
min-height: 216px;
|
|
693
789
|
}
|
|
694
|
-
.semi-popover-wrapper[x-placement
|
|
790
|
+
.semi-popover-wrapper[x-placement^=top] .semi-datepicker-compact .semi-datepicker-weeks, .semi-popover-wrapper[x-placement=leftTop] .semi-datepicker-compact .semi-datepicker-weeks, .semi-popover-wrapper[x-placement=rightTop] .semi-datepicker-compact .semi-datepicker-weeks, .semi-popover-wrapper[x-placement*=BottomOver] .semi-datepicker-compact .semi-datepicker-weeks {
|
|
695
791
|
min-height: 168px;
|
|
696
792
|
}
|
|
697
793
|
|
|
@@ -836,4 +932,10 @@
|
|
|
836
932
|
.semi-portal-rtl .semi-datepicker-compact .semi-datepicker-footer {
|
|
837
933
|
padding-left: 8px;
|
|
838
934
|
padding-right: auto;
|
|
935
|
+
}
|
|
936
|
+
.semi-rtl .semi-datepicker-compact .semi-datepicker-inset-input-separator,
|
|
937
|
+
.semi-portal-rtl .semi-datepicker-compact .semi-datepicker-inset-input-separator {
|
|
938
|
+
border-right: 1px solid var(--semi-color-border);
|
|
939
|
+
border-left: 0;
|
|
940
|
+
transform: translateX(-50%);
|
|
839
941
|
}
|
|
@@ -6,6 +6,7 @@ $module: #{$prefix}-datepicker;
|
|
|
6
6
|
.#{$module} {
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
display: inline-block;
|
|
9
|
+
vertical-align: top;
|
|
9
10
|
|
|
10
11
|
// 双月网格
|
|
11
12
|
|
|
@@ -45,6 +46,34 @@ $module: #{$prefix}-datepicker;
|
|
|
45
46
|
min-height: $height-datepicker_dateType_yamShowing_min;
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
&[x-insetInput=true] {
|
|
50
|
+
.#{$module}-month-grid-left,
|
|
51
|
+
.#{$module}-month-grid-right {
|
|
52
|
+
&[x-open-type=year] {
|
|
53
|
+
min-height: $height-datepicker_month_grid_yearType_insetInput;
|
|
54
|
+
}
|
|
55
|
+
&[x-open-type=time] {
|
|
56
|
+
min-height: $height-datepicker_month_grid_timeType_insetInput;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.#{$module}-navigation {
|
|
61
|
+
padding-top: $spacing-datepicker_navigation_insetInput-paddingY;
|
|
62
|
+
padding-bottom: $spacing-datepicker_navigation_insetInput-paddingY;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.#{$module}-tpk {
|
|
66
|
+
min-height: $height-datepicker_timeType_insetInput_tpk;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[x-type=dateTime],
|
|
70
|
+
&[x-type=dateTimeRange] {
|
|
71
|
+
.#{$module}-yam {
|
|
72
|
+
height: $height-datepicker_timeType_insetInput_yam;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
48
77
|
// 年月选择返回主面板
|
|
49
78
|
.#{$module}-yearmonth-header {
|
|
50
79
|
background: $color-datepicker_header-bg-default;
|
|
@@ -92,6 +121,7 @@ $module: #{$prefix}-datepicker;
|
|
|
92
121
|
|
|
93
122
|
@include font-size-regular;
|
|
94
123
|
min-height: $height-datepicker_timepicker_header_min;
|
|
124
|
+
line-height: $height-datepicker_timepicker_header_min;
|
|
95
125
|
}
|
|
96
126
|
}
|
|
97
127
|
|
|
@@ -581,6 +611,41 @@ $module: #{$prefix}-datepicker;
|
|
|
581
611
|
cursor: pointer;
|
|
582
612
|
}
|
|
583
613
|
|
|
614
|
+
&-inset-input {
|
|
615
|
+
&-wrapper {
|
|
616
|
+
display: flex;
|
|
617
|
+
flex-wrap: nowrap;
|
|
618
|
+
justify-content: space-between;
|
|
619
|
+
box-sizing: border-box;
|
|
620
|
+
column-gap: $spacing-datepicker_insetInput_wrapper-margin;
|
|
621
|
+
padding: $spacing-datepicker_insetInput_wrapper-paddingY $spacing-datepicker_insetInput_wrapper-paddingX;
|
|
622
|
+
padding-bottom: $spacing-datepicker_insetInput_wrapper-paddingBottom;
|
|
623
|
+
|
|
624
|
+
width: $width-datepicker_insetInput_date_type_wrapper;
|
|
625
|
+
&[x-type=dateRange],
|
|
626
|
+
&[x-type=dateTimeRange] {
|
|
627
|
+
width: $width-datepicker_insetInput_date_range_type_wrapper;
|
|
628
|
+
}
|
|
629
|
+
&[x-type=month] {
|
|
630
|
+
width: $width-datepicker_insetInput_month_type_wrapper;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.#{$prefix}-input-wrapper {
|
|
634
|
+
flex: 1;
|
|
635
|
+
flex-shrink: 0;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
&-separator {
|
|
640
|
+
flex-grow: 0;
|
|
641
|
+
flex-shrink: 0;
|
|
642
|
+
height: $height-datepicker_insetInput_separator;
|
|
643
|
+
line-height: $height-datepicker_insetInput_separator;
|
|
644
|
+
padding: $spacing-datepicker_insetInput_separator-paddingY $spacing-datepicker_insetInput_separator-paddingX;
|
|
645
|
+
color: $color-datepicker_insetInput_separator;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
|
|
584
649
|
&-range {
|
|
585
650
|
|
|
586
651
|
&-input {
|
|
@@ -862,6 +927,33 @@ $module: #{$prefix}-datepicker;
|
|
|
862
927
|
min-height: 6 * $width-datepicker_day_compact;
|
|
863
928
|
}
|
|
864
929
|
}
|
|
930
|
+
|
|
931
|
+
&[x-insetInput=true] {
|
|
932
|
+
.#{$module}-month-grid-left,
|
|
933
|
+
.#{$module}-month-grid-right {
|
|
934
|
+
&[x-open-type=year] {
|
|
935
|
+
min-height: $height-datepicker_tpk_compact;
|
|
936
|
+
}
|
|
937
|
+
&[x-open-type=time] {
|
|
938
|
+
min-height: $height-datepicker_tpk_compact;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
.#{$module}-yam-showing {
|
|
943
|
+
min-height: $height-datepicker_tpk_compact;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.#{$module}-tpk {
|
|
947
|
+
min-height: $height-datepicker_insetInput_tpk_compact;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
&[x-type=dateTime],
|
|
951
|
+
&[x-type=dateTimeRange] {
|
|
952
|
+
.#{$module}-yam {
|
|
953
|
+
height: $height-datepicker_timeType_insetInput_yam_compact;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
865
957
|
}
|
|
866
958
|
|
|
867
959
|
// 年月选择器
|
|
@@ -1039,6 +1131,46 @@ $module: #{$prefix}-datepicker;
|
|
|
1039
1131
|
padding-right: $spacing-datepicker_footer_compact-paddintRight;
|
|
1040
1132
|
padding-bottom: $spacing-datepicker_footer_compact-paddintBottom;
|
|
1041
1133
|
}
|
|
1134
|
+
|
|
1135
|
+
.#{$module}-inset-input {
|
|
1136
|
+
&-wrapper {
|
|
1137
|
+
column-gap: $spacing-datepicker_insetInput_wrapper_compact-margin;
|
|
1138
|
+
padding: $spacing-datepicker_insetInput_wrapper_compact-paddingY $spacing-datepicker_insetInput_wrapper_compact-paddingX;
|
|
1139
|
+
padding-bottom: $spacing-datepicker_insetInput_wrapper_compact-paddingBottom;
|
|
1140
|
+
|
|
1141
|
+
width: $width-datepicker_insetInput_date_type_wrapper_compact;
|
|
1142
|
+
&[x-type=dateRange],
|
|
1143
|
+
&[x-type=dateTimeRange] {
|
|
1144
|
+
width: $width-datepicker_insetInput_date_range_type_wrapper_compact;
|
|
1145
|
+
padding-top: $spacing-datepicker_insetInput_wrapper_rangeType_compact-paddingTop;
|
|
1146
|
+
|
|
1147
|
+
.#{$prefix}-input-wrapper {
|
|
1148
|
+
margin-top: $spacing-datepicker_insetInput_wrapper_compact-paddingY;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
&[x-type=month] {
|
|
1152
|
+
width: $width-datepicker_insetInput_month_type_wrapper_compact;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
.#{$prefix}-input-wrapper {
|
|
1156
|
+
height: $height-datepicker_insetInput_wrapper_compact;
|
|
1157
|
+
box-sizing: border-box;
|
|
1158
|
+
|
|
1159
|
+
.#{$prefix}-input {
|
|
1160
|
+
font-size: $fontSize-datepicker_insetInput_compact-fontSize;
|
|
1161
|
+
line-height: $height-datepicker_insetInput_compact;
|
|
1162
|
+
height: $height-datepicker_insetInput_compact;
|
|
1163
|
+
vertical-align: top;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
&-separator {
|
|
1169
|
+
border-left: $width-datepicker-border solid $color-datepicker_border-bg-default;
|
|
1170
|
+
transform: translateX(50%);
|
|
1171
|
+
height: auto;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1042
1174
|
}
|
|
1043
1175
|
|
|
1044
1176
|
// 向上弹出时固定高度为6周 #1042
|
|
@@ -1046,8 +1178,10 @@ $module: #{$prefix}-datepicker;
|
|
|
1046
1178
|
|
|
1047
1179
|
&-wrapper {
|
|
1048
1180
|
|
|
1049
|
-
&[x-placement
|
|
1050
|
-
&[x-placement
|
|
1181
|
+
&[x-placement^="top"],
|
|
1182
|
+
&[x-placement="leftTop"],
|
|
1183
|
+
&[x-placement="rightTop"],
|
|
1184
|
+
&[x-placement*="BottomOver"] {
|
|
1051
1185
|
.#{$module} .#{$module}-weeks {
|
|
1052
1186
|
min-height: 6 * $width-datepicker_day;
|
|
1053
1187
|
}
|
|
@@ -1056,7 +1190,6 @@ $module: #{$prefix}-datepicker;
|
|
|
1056
1190
|
min-height: 6 * $width-datepicker_day_compact;
|
|
1057
1191
|
}
|
|
1058
1192
|
}
|
|
1059
|
-
|
|
1060
1193
|
}
|
|
1061
1194
|
}
|
|
1062
1195
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
3
3
|
import { strings } from './constants';
|
|
4
|
-
import { Type, DateInputFoundationProps } from './inputFoundation';
|
|
4
|
+
import { Type, DateInputFoundationProps, InsetInputValue } from './inputFoundation';
|
|
5
5
|
import { MonthsGridFoundationProps } from './monthsGridFoundation';
|
|
6
6
|
import { WeekStartNumber } from './_utils/getMonthTable';
|
|
7
7
|
import { ArrayElement, Motion } from '../utils/type';
|
|
@@ -70,6 +70,7 @@ export interface RenderProps {
|
|
|
70
70
|
renderFullDate?: RenderFullDateType;
|
|
71
71
|
triggerRender?: TriggerRenderType;
|
|
72
72
|
}
|
|
73
|
+
export declare type RangeType = 'rangeStart' | 'rangeEnd' | false;
|
|
73
74
|
export interface EventHandlerProps {
|
|
74
75
|
onCancel?: OnCancelType;
|
|
75
76
|
onChange?: OnChangeType;
|
|
@@ -78,7 +79,7 @@ export interface EventHandlerProps {
|
|
|
78
79
|
onConfirm?: OnConfirmType;
|
|
79
80
|
onBlur?: (e: any) => void;
|
|
80
81
|
onClear?: (e: any) => void;
|
|
81
|
-
onFocus?: (e: any, rangType:
|
|
82
|
+
onFocus?: (e: any, rangType: RangeType) => void;
|
|
82
83
|
onPresetClick?: OnPresetClickType;
|
|
83
84
|
}
|
|
84
85
|
export interface DatePickerFoundationProps extends ElementProps, RenderProps, EventHandlerProps {
|
|
@@ -130,6 +131,7 @@ export interface DatePickerFoundationProps extends ElementProps, RenderProps, Ev
|
|
|
130
131
|
dateFnsLocale?: any;
|
|
131
132
|
localeCode?: string;
|
|
132
133
|
rangeSeparator?: string;
|
|
134
|
+
insetInput?: boolean;
|
|
133
135
|
}
|
|
134
136
|
export interface DatePickerFoundationState {
|
|
135
137
|
panelShow: boolean;
|
|
@@ -139,8 +141,10 @@ export interface DatePickerFoundationState {
|
|
|
139
141
|
cachedSelectedValue: Date[];
|
|
140
142
|
prevTimeZone: string | number;
|
|
141
143
|
motionEnd: boolean;
|
|
142
|
-
rangeInputFocus:
|
|
144
|
+
rangeInputFocus: RangeType;
|
|
143
145
|
autofocus: boolean;
|
|
146
|
+
insetInputValue: InsetInputValue;
|
|
147
|
+
triggerDisabled: boolean;
|
|
144
148
|
}
|
|
145
149
|
export { Type, DateInputFoundationProps };
|
|
146
150
|
export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationProps, DatePickerFoundationState> {
|
|
@@ -165,6 +169,9 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
|
|
|
165
169
|
setRangeInputFocus: (rangeInputFocus: DatePickerFoundationState['rangeInputFocus']) => void;
|
|
166
170
|
couldPanelClosed: () => boolean;
|
|
167
171
|
isEventTarget: (e: any) => boolean;
|
|
172
|
+
updateInsetInputValue: (insetInputValue: InsetInputValue) => void;
|
|
173
|
+
setInsetInputFocus: () => void;
|
|
174
|
+
setTriggerDisabled: (disabled: boolean) => void;
|
|
168
175
|
}
|
|
169
176
|
/**
|
|
170
177
|
* The datePicker foundation.js is responsible for maintaining the date value and the input box value, as well as the callback of both
|
|
@@ -207,6 +214,10 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
207
214
|
* clear input value when selected date is not confirmed
|
|
208
215
|
*/
|
|
209
216
|
needConfirmSideEffectsWhenClosePanel(willUpdateDates: Date[] | null | undefined): void;
|
|
217
|
+
/**
|
|
218
|
+
* clear inset input value when close panel
|
|
219
|
+
*/
|
|
220
|
+
clearInsetInputValue(): void;
|
|
210
221
|
resetCachedSelectedValue(willUpdateDates?: Date[]): void;
|
|
211
222
|
/**
|
|
212
223
|
* timing to call closePanel
|
|
@@ -233,6 +244,17 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
233
244
|
* @param {Event} e
|
|
234
245
|
*/
|
|
235
246
|
handleInputChange(input: string, e: any): void;
|
|
247
|
+
/**
|
|
248
|
+
* inset input 变化时需要更新以下 state 状态
|
|
249
|
+
* - insetInputValue(总是)
|
|
250
|
+
* - inputValue(可以解析为合法日期时)
|
|
251
|
+
* - value(可以解析为合法日期时)
|
|
252
|
+
*/
|
|
253
|
+
handleInsetInputChange(options: {
|
|
254
|
+
insetInputStr: string;
|
|
255
|
+
format: string;
|
|
256
|
+
insetInputValue: InsetInputValue;
|
|
257
|
+
}): void;
|
|
236
258
|
/**
|
|
237
259
|
* Input box blur
|
|
238
260
|
* @param {String} input
|
|
@@ -250,7 +272,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
250
272
|
* @param {String} range 'rangeStart' or 'rangeEnd', use when type is range
|
|
251
273
|
*/
|
|
252
274
|
handleInputFocus(e: any, range: 'rangeStart' | 'rangeEnd'): void;
|
|
253
|
-
handleSetRangeFocus(rangeInputFocus:
|
|
275
|
+
handleSetRangeFocus(rangeInputFocus: RangeType): void;
|
|
254
276
|
handleInputClear(e: any): void;
|
|
255
277
|
/**
|
|
256
278
|
* 范围选择清除按钮回调
|
|
@@ -269,7 +291,7 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
269
291
|
* @param {string} input
|
|
270
292
|
* @returns {Date [] | '}
|
|
271
293
|
*/
|
|
272
|
-
parseInput(input?: string): Date[];
|
|
294
|
+
parseInput(input?: string, format?: string): Date[];
|
|
273
295
|
/**
|
|
274
296
|
* Parses the input when multiple is true, if valid,
|
|
275
297
|
* returns a list of time objects, otherwise returns an array
|
|
@@ -286,14 +308,14 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
286
308
|
* @param {Date[]} dates
|
|
287
309
|
* @returns {string}
|
|
288
310
|
*/
|
|
289
|
-
formatDates(dates?: Date[]): string;
|
|
311
|
+
formatDates(dates?: Date[], customFormat?: string): string;
|
|
290
312
|
/**
|
|
291
313
|
* dates[] => string
|
|
292
314
|
*
|
|
293
315
|
* @param {Date[]} dates
|
|
294
316
|
* @returns {string}
|
|
295
317
|
*/
|
|
296
|
-
formatMultipleDates(dates?: Date[], separator?: string): string;
|
|
318
|
+
formatMultipleDates(dates?: Date[], separator?: string, customFormat?: string): string;
|
|
297
319
|
/**
|
|
298
320
|
* Update date value and the value of the input box
|
|
299
321
|
* 1. Select Update
|
|
@@ -414,4 +436,5 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
414
436
|
* @returns
|
|
415
437
|
*/
|
|
416
438
|
handleTriggerWrapperClick(e: any): void;
|
|
439
|
+
handlePanelVisibleChange(visible: boolean): void;
|
|
417
440
|
}
|