@douyinfe/semi-foundation 2.31.2 → 2.32.0-beta.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.
Files changed (67) hide show
  1. package/cascader/foundation.ts +8 -1
  2. package/datePicker/_utils/getDefaultFormatToken.ts +1 -0
  3. package/datePicker/_utils/getInsetInputFormatToken.ts +1 -0
  4. package/datePicker/_utils/getInsetInputValueFromInsetInputStr.ts +1 -0
  5. package/datePicker/constants.ts +1 -1
  6. package/datePicker/datePicker.scss +33 -6
  7. package/datePicker/foundation.ts +132 -74
  8. package/datePicker/inputFoundation.ts +8 -2
  9. package/datePicker/variables.scss +6 -4
  10. package/datePicker/yearAndMonthFoundation.ts +65 -18
  11. package/lib/cjs/cascader/foundation.d.ts +2 -0
  12. package/lib/cjs/datePicker/_utils/getDefaultFormatToken.d.ts +1 -0
  13. package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +2 -1
  14. package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +1 -0
  15. package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +1 -0
  16. package/lib/cjs/datePicker/constants.d.ts +1 -1
  17. package/lib/cjs/datePicker/constants.js +1 -1
  18. package/lib/cjs/datePicker/datePicker.css +29 -11
  19. package/lib/cjs/datePicker/datePicker.scss +33 -6
  20. package/lib/cjs/datePicker/foundation.d.ts +34 -6
  21. package/lib/cjs/datePicker/foundation.js +145 -69
  22. package/lib/cjs/datePicker/inputFoundation.d.ts +1 -1
  23. package/lib/cjs/datePicker/inputFoundation.js +13 -1
  24. package/lib/cjs/datePicker/variables.scss +6 -4
  25. package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +66 -13
  26. package/lib/cjs/datePicker/yearAndMonthFoundation.js +55 -14
  27. package/lib/cjs/modal/modal.css +1 -0
  28. package/lib/cjs/modal/modal.scss +1 -0
  29. package/lib/cjs/modal/variables.scss +1 -0
  30. package/lib/cjs/sideSheet/sideSheet.css +10 -0
  31. package/lib/cjs/sideSheet/sideSheet.scss +15 -0
  32. package/lib/cjs/sideSheet/variables.scss +6 -0
  33. package/lib/cjs/switch/foundation.js +0 -3
  34. package/lib/cjs/treeSelect/foundation.d.ts +3 -0
  35. package/lib/cjs/treeSelect/foundation.js +3 -2
  36. package/lib/es/cascader/foundation.d.ts +2 -0
  37. package/lib/es/datePicker/_utils/getDefaultFormatToken.d.ts +1 -0
  38. package/lib/es/datePicker/_utils/getDefaultFormatToken.js +2 -1
  39. package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +1 -0
  40. package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +1 -0
  41. package/lib/es/datePicker/constants.d.ts +1 -1
  42. package/lib/es/datePicker/constants.js +1 -1
  43. package/lib/es/datePicker/datePicker.css +29 -11
  44. package/lib/es/datePicker/datePicker.scss +33 -6
  45. package/lib/es/datePicker/foundation.d.ts +34 -6
  46. package/lib/es/datePicker/foundation.js +145 -69
  47. package/lib/es/datePicker/inputFoundation.d.ts +1 -1
  48. package/lib/es/datePicker/inputFoundation.js +13 -1
  49. package/lib/es/datePicker/variables.scss +6 -4
  50. package/lib/es/datePicker/yearAndMonthFoundation.d.ts +66 -13
  51. package/lib/es/datePicker/yearAndMonthFoundation.js +58 -14
  52. package/lib/es/modal/modal.css +1 -0
  53. package/lib/es/modal/modal.scss +1 -0
  54. package/lib/es/modal/variables.scss +1 -0
  55. package/lib/es/sideSheet/sideSheet.css +10 -0
  56. package/lib/es/sideSheet/sideSheet.scss +15 -0
  57. package/lib/es/sideSheet/variables.scss +6 -0
  58. package/lib/es/switch/foundation.js +0 -3
  59. package/lib/es/treeSelect/foundation.d.ts +3 -0
  60. package/lib/es/treeSelect/foundation.js +3 -2
  61. package/modal/modal.scss +1 -0
  62. package/modal/variables.scss +1 -0
  63. package/package.json +2 -2
  64. package/sideSheet/sideSheet.scss +15 -0
  65. package/sideSheet/variables.scss +6 -0
  66. package/switch/foundation.ts +2 -3
  67. package/treeSelect/foundation.ts +6 -3
@@ -76,12 +76,22 @@
76
76
  align-items: flex-start;
77
77
  padding: 24px;
78
78
  padding-bottom: 20px;
79
+ border-bottom: 0px solid var(--semi-color-border);
79
80
  }
80
81
  .semi-sidesheet-body {
81
82
  padding: 0 24px;
82
83
  flex: 1;
83
84
  overflow: auto;
84
85
  }
86
+ .semi-sidesheet-size-small {
87
+ width: 448px;
88
+ }
89
+ .semi-sidesheet-size-medium {
90
+ width: 684px;
91
+ }
92
+ .semi-sidesheet-size-large {
93
+ width: 920px;
94
+ }
85
95
  .semi-sidesheet-content {
86
96
  height: 100%;
87
97
  display: flex;
@@ -95,6 +95,7 @@ $module: #{$prefix}-sidesheet;
95
95
  align-items: flex-start;
96
96
  padding: $spacing-sideSheet_header-padding;
97
97
  padding-bottom: $spacing-sideSheet_header-paddingBottom;
98
+ border-bottom: $width-sideSheet_header-borderBottom solid $color-sideSheet_header-borderBottom;
98
99
  }
99
100
 
100
101
  &-body {
@@ -103,6 +104,20 @@ $module: #{$prefix}-sidesheet;
103
104
  overflow: auto;
104
105
  }
105
106
 
107
+ &-size-small {
108
+ width: $width-sideSheet_size-small;
109
+ }
110
+
111
+ &-size-medium {
112
+ width: $width-sideSheet_size-medium;
113
+ }
114
+
115
+ &-size-large {
116
+ width: $width-sideSheet_size-large;
117
+ }
118
+
119
+
120
+
106
121
  &-content {
107
122
  height: 100%;
108
123
  display: flex;
@@ -2,6 +2,7 @@
2
2
  $color-sideSheet_mask-bg: var(--semi-color-overlay-bg); // 侧边栏打开后蒙层颜色
3
3
  $color-sideSheet-bg: var(--semi-color-bg-2); // 侧边栏背景颜色
4
4
  $color-sideSheet_main-text: var(--semi-color-text-0); // 侧边栏默认文本颜色
5
+ $color-sideSheet_header-borderBottom: var(--semi-color-border); // 侧边栏 header 底部边框颜色
5
6
 
6
7
  // Spacing
7
8
  $spacing-sideSheet-margin: 0; // 侧边栏整体外边距
@@ -12,6 +13,11 @@ $spacing-sideSheet_body-paddingY: 0; // 侧边栏 body 垂直内边距
12
13
  $spacing-sideSheet_body-paddingX: $spacing-loose; // 侧边栏 body 水平内边距
13
14
  $spacing-sideSheet_footer-padding: $spacing-loose; // 侧边栏 footer 内边距
14
15
 
16
+ $width-sideSheet_header-borderBottom: 0px; // 侧边栏 header 底部边框宽度
17
+ $width-sideSheet_size-small: 448px; // 小尺寸侧边栏宽度
18
+ $width-sideSheet_size-medium: 684px; // 中尺寸侧边栏宽度
19
+ $width-sideSheet_size-large: 920px; // 大尺寸侧边栏宽度
20
+
15
21
  // Font
16
22
  $font-sideSheet_title-fontWeight: $font-weight-bold; // 侧边栏标题文本字重
17
23
  $font-sideSheet_title-fontSize: $font-size-header-5; // 侧边栏标题文本字号
@@ -36,11 +36,8 @@ class SwitchFoundation extends _foundation.default {
36
36
 
37
37
  init() {
38
38
  const {
39
- defaultChecked,
40
- checked,
41
39
  disabled
42
40
  } = this.getProps();
43
- this.setChecked(defaultChecked || checked);
44
41
  this.setDisabled(disabled);
45
42
  }
46
43
 
@@ -20,6 +20,8 @@ export interface BasicTriggerRenderProps {
20
20
  placeholder: string;
21
21
  value: BasicTreeNodeData[];
22
22
  onClear: (e: any) => void;
23
+ onSearch: (inputValue: string) => void;
24
+ onRemove: (value: string) => void;
23
25
  }
24
26
  export declare type BasicOnChangeWithObject = (node: BasicTreeNodeData[] | BasicTreeNodeData, e: any) => void;
25
27
  export declare type BasicOnChangeWithBasic = (value: BasicTreeNodeData['value'], node: BasicTreeNodeData[] | BasicTreeNodeData, e: any) => void;
@@ -59,6 +61,7 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
59
61
  loadedKeys?: string[];
60
62
  showRestTagsPopover?: boolean;
61
63
  restTagsPopoverProps?: any;
64
+ clickTriggerToHide?: boolean;
62
65
  loadData?: (data: BasicTreeNodeData) => Promise<void>;
63
66
  onSelect?: (selectedKeys: string, selected: boolean, selectedNode: BasicTreeNodeData) => void;
64
67
  searchRender?: (inputProps: any) => any;
@@ -386,7 +386,8 @@ class TreeSelectFoundation extends _foundation.default {
386
386
  isFocus
387
387
  } = this.getStates();
388
388
  const {
389
- searchPosition
389
+ searchPosition,
390
+ clickTriggerToHide
390
391
  } = this.getProps();
391
392
 
392
393
  if (isDisabled) {
@@ -401,7 +402,7 @@ class TreeSelectFoundation extends _foundation.default {
401
402
  return;
402
403
  }
403
404
 
404
- this.close(e);
405
+ clickTriggerToHide && this.close(e);
405
406
  } else {
406
407
  this.open();
407
408
  }
@@ -47,8 +47,10 @@ export interface BasicTriggerRenderProps {
47
47
  * should call this function when the value of the Input component
48
48
  * customized by triggerRender is updated to synchronize the state
49
49
  * with Cascader. */
50
+ onSearch: (inputValue: string) => void;
50
51
  onChange: (inputValue: string) => void;
51
52
  onClear: (e: any) => void;
53
+ onRemove: (key: string) => void;
52
54
  }
53
55
  export interface BasicScrollPanelProps {
54
56
  panelIndex: number;
@@ -4,6 +4,7 @@ declare const getDefaultFormatToken: (type: string) => {
4
4
  readonly dateRange: "yyyy-MM-dd";
5
5
  readonly dateTimeRange: "yyyy-MM-dd HH:mm:ss";
6
6
  readonly month: "yyyy-MM";
7
+ readonly monthRange: "yyyy-MM";
7
8
  };
8
9
  export declare function getDefaultFormatTokenByType(type: string): any;
9
10
  export default getDefaultFormatToken;
@@ -4,7 +4,8 @@ const defaultFormatTokens = {
4
4
  dateTime: strings.FORMAT_DATE_TIME,
5
5
  dateRange: strings.FORMAT_FULL_DATE,
6
6
  dateTimeRange: strings.FORMAT_DATE_TIME,
7
- month: strings.FORMAT_YEAR_MONTH
7
+ month: strings.FORMAT_YEAR_MONTH,
8
+ monthRange: strings.FORMAT_YEAR_MONTH
8
9
  };
9
10
 
10
11
  const getDefaultFormatToken = type => defaultFormatTokens;
@@ -34,6 +34,7 @@ export default function getInsetInputFormatToken(options) {
34
34
 
35
35
  case 'date':
36
36
  case 'month':
37
+ case 'monthRange':
37
38
  case 'dateRange':
38
39
  default:
39
40
  const dateResult = dateReg.exec(format);
@@ -36,6 +36,7 @@ export default function getInsetInputValueFromInsetInputStr(options) {
36
36
  switch (type) {
37
37
  case 'date':
38
38
  case 'month':
39
+ case 'monthRange':
39
40
  insetInputValue.monthLeft.dateInput = inputValue;
40
41
  break;
41
42
 
@@ -35,7 +35,7 @@ declare const strings: {
35
35
  readonly DEFAULT_SEPARATOR_MULTIPLE: ",";
36
36
  readonly DEFAULT_SEPARATOR_RANGE: " ~ ";
37
37
  readonly SIZE_SET: readonly ["small", "default", "large"];
38
- readonly TYPE_SET: readonly ["date", "dateRange", "year", "month", "dateTime", "dateTimeRange"];
38
+ readonly TYPE_SET: readonly ["date", "dateRange", "year", "month", "monthRange", "dateTime", "dateTimeRange"];
39
39
  readonly PRESET_POSITION_SET: readonly ["left", "right", "top", "bottom"];
40
40
  readonly DENSITY_SET: readonly ["default", "compact"];
41
41
  readonly PANEL_TYPE_LEFT: "left";
@@ -41,7 +41,7 @@ const strings = Object.assign({
41
41
  DEFAULT_SEPARATOR_MULTIPLE: ',',
42
42
  DEFAULT_SEPARATOR_RANGE: ' ~ ',
43
43
  SIZE_SET: ['small', 'default', 'large'],
44
- TYPE_SET: ['date', 'dateRange', 'year', 'month', 'dateTime', 'dateTimeRange'],
44
+ TYPE_SET: ['date', 'dateRange', 'year', 'month', 'monthRange', 'dateTime', 'dateTimeRange'],
45
45
  PRESET_POSITION_SET: ['left', 'right', 'top', 'bottom'],
46
46
  DENSITY_SET: ['default', 'compact'],
47
47
  PANEL_TYPE_LEFT: 'left',
@@ -118,6 +118,15 @@
118
118
  .semi-datepicker-panel-yam {
119
119
  max-width: 484px;
120
120
  }
121
+ .semi-datepicker-panel-yam[x-type=monthRange] {
122
+ max-width: 584px;
123
+ }
124
+ .semi-datepicker-panel-yam .semi-datepicker-yearmonth-body {
125
+ display: flex;
126
+ }
127
+ .semi-datepicker-panel-yam .semi-datepicker-yearmonth-body .semi-scrolllist:nth-child(2) {
128
+ border-left: 1px solid var(--semi-color-border);
129
+ }
121
130
  .semi-datepicker-panel-yam .semi-scrolllist {
122
131
  box-shadow: none;
123
132
  height: 266px;
@@ -132,10 +141,7 @@
132
141
  padding: 0;
133
142
  overflow: hidden;
134
143
  }
135
- .semi-datepicker-panel-yam .semi-scrolllist-body .semi-scrolllist-item-wheel {
136
- border: none;
137
- }
138
- .semi-datepicker-panel-yam .semi-scrolllist-body .semi-scrolllist-item {
144
+ .semi-datepicker-panel-yam .semi-scrolllist-body .semi-scrolllist-item-wheel:not(#neverExistElement) {
139
145
  border: none;
140
146
  }
141
147
  .semi-datepicker-footer {
@@ -456,16 +462,16 @@
456
462
  .semi-datepicker-quick-control-top-month-content, .semi-datepicker-quick-control-bottom-month-content {
457
463
  box-sizing: border-box;
458
464
  display: grid;
459
- grid-template-columns: repeat(2, minmax(65.5px, 73px));
465
+ grid-template-columns: repeat(2, minmax(51px, 58.5px));
460
466
  grid-gap: 8px;
461
467
  align-content: flex-start;
462
468
  padding: 8px 20px;
463
469
  }
464
470
  .semi-datepicker-quick-control-top-month-content-item, .semi-datepicker-quick-control-bottom-month-content-item {
465
- max-width: 73px;
471
+ max-width: 58.5px;
466
472
  }
467
473
  .semi-datepicker-quick-control-top-month-content-item-ellipsis, .semi-datepicker-quick-control-bottom-month-content-item-ellipsis {
468
- max-width: 57px;
474
+ max-width: 42.5px;
469
475
  color: var(--semi-color-primary);
470
476
  }
471
477
  .semi-datepicker-quick-control-month {
@@ -555,7 +561,10 @@
555
561
  width: 568px;
556
562
  }
557
563
  .semi-datepicker-inset-input-wrapper[x-type=month] {
558
- width: 204px;
564
+ width: 165px;
565
+ }
566
+ .semi-datepicker-inset-input-wrapper[x-type=monthRange] {
567
+ width: 331px;
559
568
  }
560
569
  .semi-datepicker-inset-input-wrapper .semi-input-wrapper {
561
570
  flex: 1;
@@ -585,6 +594,9 @@
585
594
  .semi-datepicker-range-input:active {
586
595
  border-color: transparent;
587
596
  }
597
+ .semi-datepicker-range-input .semi-datepicker-monthRange-input {
598
+ background-color: transparent;
599
+ }
588
600
  .semi-datepicker-range-input-wrapper {
589
601
  box-sizing: border-box;
590
602
  background-color: transparent;
@@ -754,6 +766,12 @@
754
766
  height: 48px;
755
767
  padding: 12px;
756
768
  }
769
+ .semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-yearmonth-body {
770
+ display: flex;
771
+ }
772
+ .semi-datepicker-compact .semi-datepicker-month-grid .semi-datepicker-yearmonth-body .semi-scrolllist:nth-child(2) {
773
+ border: 1px solid var(--semi-color-border);
774
+ }
757
775
  .semi-datepicker-compact .semi-datepicker-month-grid .semi-scrolllist {
758
776
  font-size: 12px;
759
777
  line-height: 16px;
@@ -955,16 +973,16 @@
955
973
  }
956
974
  .semi-datepicker-compact .semi-datepicker-quick-control-top-month-content, .semi-datepicker-compact .semi-datepicker-quick-control-bottom-month-content {
957
975
  display: grid;
958
- grid-template-columns: repeat(2, minmax(75.5px, 83px));
976
+ grid-template-columns: repeat(2, minmax(61px, 68.5px));
959
977
  grid-gap: 8px;
960
978
  align-content: flex-start;
961
979
  padding: 8px 10px;
962
980
  }
963
981
  .semi-datepicker-compact .semi-datepicker-quick-control-top-month-content-item, .semi-datepicker-compact .semi-datepicker-quick-control-bottom-month-content-item {
964
- max-width: 83px;
982
+ max-width: 68.5px;
965
983
  }
966
984
  .semi-datepicker-compact .semi-datepicker-quick-control-top-month-content-item-ellipsis, .semi-datepicker-compact .semi-datepicker-quick-control-bottom-month-content-item-ellipsis {
967
- max-width: 67px;
985
+ max-width: 52.5px;
968
986
  font-size: 12px;
969
987
  color: var(--semi-color-primary);
970
988
  }
@@ -169,11 +169,23 @@ $module-list: #{$prefix}-scrolllist;
169
169
  }
170
170
 
171
171
  // 年月选择器
172
-
173
172
  &-panel-yam {
174
173
  // add left or right preset panel to panel yam, max-width will be bigger
175
174
  max-width: $width-datepicker_monthPanel_max + $width-datepicker_presetPanel_left_and_right;
176
175
 
176
+ &[x-type="monthRange"] {
177
+ max-width: $width-datepicker_monthRangePanel_max + $width-datepicker_presetPanel_left_and_right;
178
+ }
179
+
180
+ .#{$module}-yearmonth-body {
181
+ display: flex;
182
+
183
+ .#{$prefix}-scrolllist:nth-child(2) {
184
+ border-left: 1px solid var(--semi-color-border);
185
+
186
+ }
187
+ }
188
+
177
189
  .#{$prefix}-scrolllist {
178
190
  box-shadow: none;
179
191
  height: $height-datepicker_panel_yam_scrolllist;
@@ -196,13 +208,14 @@ $module-list: #{$prefix}-scrolllist;
196
208
  padding: 0;
197
209
  overflow: hidden;
198
210
 
199
- .#{$prefix}-scrolllist-item-wheel {
211
+ .#{$prefix}-scrolllist-item-wheel:not(#neverExistElement) {
212
+ // equal to #{$prefix}-scrolllist-item-wheel, add [:not] selector only to increase selector priority
200
213
  border: none;
201
214
  }
202
215
 
203
- .#{$prefix}-scrolllist-item {
204
- border: none;
205
- }
216
+ // .#{$prefix}-scrolllist-item {
217
+ // border: none;
218
+ // }
206
219
  }
207
220
  }
208
221
  }
@@ -832,6 +845,9 @@ $module-list: #{$prefix}-scrolllist;
832
845
  &[x-type=month] {
833
846
  width: $width-datepicker_insetInput_month_type_wrapper;
834
847
  }
848
+ &[x-type=monthRange] {
849
+ width: $width-datepicker_insetInput_month_range_type_wrapper;
850
+ }
835
851
 
836
852
  .#{$prefix}-input-wrapper {
837
853
  flex: 1;
@@ -869,7 +885,9 @@ $module-list: #{$prefix}-scrolllist;
869
885
  border-color: $color-datepicker_range_trigger-border-active ;
870
886
  }
871
887
 
872
-
888
+ .#{$module}-monthRange-input {
889
+ background-color: transparent;
890
+ }
873
891
 
874
892
  &-wrapper {
875
893
  box-sizing: border-box;
@@ -1108,6 +1126,15 @@ $module-list: #{$prefix}-scrolllist;
1108
1126
  padding: $spacing-datepicker_yam_panel_header_compact-padding;
1109
1127
  }
1110
1128
 
1129
+ .#{$module}-yearmonth-body {
1130
+ display: flex;
1131
+
1132
+ .#{$prefix}-scrolllist:nth-child(2){
1133
+ border: 1px solid var(--semi-color-border);
1134
+
1135
+ }
1136
+ }
1137
+
1111
1138
  .#{$prefix}-scrolllist {
1112
1139
  @include font-size-small;
1113
1140
  line-height: $lineHeight-datepicker_compact;
@@ -85,6 +85,7 @@ export interface EventHandlerProps {
85
85
  onClear?: (e: any) => void;
86
86
  onFocus?: (e: any, rangType: RangeType) => void;
87
87
  onPresetClick?: OnPresetClickType;
88
+ onClickOutSide?: () => void;
88
89
  }
89
90
  export interface DatePickerFoundationProps extends ElementProps, RenderProps, EventHandlerProps {
90
91
  autoAdjustOverflow?: boolean;
@@ -155,7 +156,7 @@ export interface DatePickerFoundationState {
155
156
  }
156
157
  export { Type, DateInputFoundationProps };
157
158
  export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationProps, DatePickerFoundationState> {
158
- togglePanel: (panelShow: boolean) => void;
159
+ togglePanel: (panelShow: boolean, cb?: () => void) => void;
159
160
  registerClickOutSide: () => void;
160
161
  unregisterClickOutSide: () => void;
161
162
  notifyBlur: DatePickerFoundationProps['onBlur'];
@@ -178,6 +179,9 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
178
179
  updateInsetInputValue: (insetInputValue: InsetInputValue) => void;
179
180
  setInsetInputFocus: () => void;
180
181
  setTriggerDisabled: (disabled: boolean) => void;
182
+ setInputFocus: () => void;
183
+ setInputBlur: () => void;
184
+ setRangeInputBlur: () => void;
181
185
  }
182
186
  /**
183
187
  * The datePicker foundation.js is responsible for maintaining the date value and the input box value, as well as the callback of both
@@ -185,6 +189,7 @@ export interface DatePickerAdapter extends DefaultAdapter<DatePickerFoundationPr
185
189
  * task 2. When the input box changes, update the date value = > Notify the change
186
190
  */
187
191
  export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapter> {
192
+ clickConfirmButton: boolean;
188
193
  constructor(adapter: DatePickerAdapter);
189
194
  init(): void;
190
195
  isValidTimeZone(timeZone?: string | number): boolean;
@@ -215,17 +220,17 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
215
220
  initPanelOpenStatus(defaultOpen?: boolean): void;
216
221
  openPanel(): void;
217
222
  /**
223
+ * @deprecated
218
224
  * do these side effects when type is dateRange or dateTimeRange
219
225
  * 1. trigger input blur, if input value is invalid, set input value and state value to previous status
220
226
  * 2. set cachedSelectedValue using given dates(in needConfirm mode)
221
227
  * - directly closePanel without click confirm will set cachedSelectedValue to state value
222
228
  * - select one date(which means that the selection value is incomplete) and click confirm also set cachedSelectedValue to state value
223
229
  */
224
- rangeTypeSideEffectsWhenClosePanel(inputValue: string, willUpdateDates: Date[]): void;
225
230
  /**
231
+ * @deprecated
226
232
  * clear input value when selected date is not confirmed
227
233
  */
228
- needConfirmSideEffectsWhenClosePanel(willUpdateDates: Date[] | null | undefined): void;
229
234
  /**
230
235
  * clear inset input value when close panel
231
236
  */
@@ -247,6 +252,23 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
247
252
  * @param {Date[]} dates
248
253
  */
249
254
  closePanel(e?: any, inputValue?: string, dates?: Date[]): void;
255
+ open(): void;
256
+ close(): void;
257
+ focus(focusType?: Exclude<RangeType, false>): void;
258
+ blur(): void;
259
+ /**
260
+ * reset cachedSelectedValue, inputValue when close panel
261
+ */
262
+ resetInnerSelectedStates(willUpdateDates?: Date[]): void;
263
+ resetFocus(e?: any): void;
264
+ /**
265
+ * cachedSelectedValue can be `(Date|null)[]` or `null`
266
+ */
267
+ isCachedSelectedValueValid(dates: Date[]): boolean;
268
+ /**
269
+ * 将输入框内容置空
270
+ */
271
+ clearInputValue(): void;
250
272
  /**
251
273
  * clear range input focus when open is controlled
252
274
  * fixed github 1375
@@ -381,12 +403,18 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
381
403
  needCheckFocusRecord?: boolean;
382
404
  }): void;
383
405
  /**
384
- * when changing the year and month through the panel when the type is year or month
406
+ * when changing the year and month through the panel when the type is year or month or monthRange
385
407
  * @param {*} item
386
408
  */
387
409
  handleYMSelectedChange(item?: {
388
- currentMonth?: number;
389
- currentYear?: number;
410
+ currentMonth?: {
411
+ left: number;
412
+ right: number;
413
+ };
414
+ currentYear?: {
415
+ left: number;
416
+ right: number;
417
+ };
390
418
  }): void;
391
419
  handleConfirm(): void;
392
420
  handleCancel(): void;