@douyinfe/semi-foundation 2.5.1 → 2.7.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 (82) hide show
  1. package/button/button.scss +11 -0
  2. package/button/variables.scss +4 -0
  3. package/cascader/foundation.ts +19 -0
  4. package/datePicker/_utils/formatter.ts +2 -2
  5. package/datePicker/_utils/getInsetInputFormatToken.ts +42 -0
  6. package/datePicker/_utils/getInsetInputValueFromInsetInputStr.ts +60 -0
  7. package/datePicker/constants.ts +2 -0
  8. package/datePicker/datePicker.scss +136 -3
  9. package/datePicker/foundation.ts +96 -19
  10. package/datePicker/inputFoundation.ts +133 -5
  11. package/datePicker/monthFoundation.ts +1 -0
  12. package/datePicker/monthsGridFoundation.ts +4 -0
  13. package/datePicker/rtl.scss +8 -0
  14. package/datePicker/variables.scss +30 -0
  15. package/lib/cjs/button/button.css +9 -0
  16. package/lib/cjs/button/button.scss +11 -0
  17. package/lib/cjs/button/variables.scss +4 -0
  18. package/lib/cjs/cascader/foundation.d.ts +19 -0
  19. package/lib/cjs/cascader/foundation.js +22 -0
  20. package/lib/cjs/datePicker/_utils/formatter.d.ts +2 -2
  21. package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.d.ts +20 -0
  22. package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +61 -0
  23. package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.d.ts +31 -0
  24. package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +76 -0
  25. package/lib/cjs/datePicker/constants.d.ts +2 -0
  26. package/lib/cjs/datePicker/constants.js +4 -3
  27. package/lib/cjs/datePicker/datePicker.css +104 -2
  28. package/lib/cjs/datePicker/datePicker.scss +136 -3
  29. package/lib/cjs/datePicker/foundation.d.ts +34 -11
  30. package/lib/cjs/datePicker/foundation.js +122 -9
  31. package/lib/cjs/datePicker/inputFoundation.d.ts +73 -4
  32. package/lib/cjs/datePicker/inputFoundation.js +196 -3
  33. package/lib/cjs/datePicker/monthFoundation.d.ts +1 -0
  34. package/lib/cjs/datePicker/monthsGridFoundation.d.ts +1 -0
  35. package/lib/cjs/datePicker/monthsGridFoundation.js +4 -2
  36. package/lib/cjs/datePicker/rtl.scss +8 -0
  37. package/lib/cjs/datePicker/variables.scss +30 -0
  38. package/lib/cjs/table/table.css +1 -1
  39. package/lib/cjs/table/table.scss +1 -1
  40. package/lib/cjs/table/variables.scss +1 -0
  41. package/lib/cjs/tag/tag.css +1 -0
  42. package/lib/cjs/tag/tag.scss +1 -0
  43. package/lib/cjs/tooltip/foundation.js +8 -8
  44. package/lib/cjs/treeSelect/foundation.d.ts +3 -2
  45. package/lib/cjs/treeSelect/foundation.js +28 -15
  46. package/lib/es/button/button.css +9 -0
  47. package/lib/es/button/button.scss +11 -0
  48. package/lib/es/button/variables.scss +4 -0
  49. package/lib/es/cascader/foundation.d.ts +19 -0
  50. package/lib/es/cascader/foundation.js +22 -1
  51. package/lib/es/datePicker/_utils/formatter.d.ts +2 -2
  52. package/lib/es/datePicker/_utils/getInsetInputFormatToken.d.ts +20 -0
  53. package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +48 -0
  54. package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.d.ts +31 -0
  55. package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +66 -0
  56. package/lib/es/datePicker/constants.d.ts +2 -0
  57. package/lib/es/datePicker/constants.js +4 -3
  58. package/lib/es/datePicker/datePicker.css +104 -2
  59. package/lib/es/datePicker/datePicker.scss +136 -3
  60. package/lib/es/datePicker/foundation.d.ts +34 -11
  61. package/lib/es/datePicker/foundation.js +120 -9
  62. package/lib/es/datePicker/inputFoundation.d.ts +73 -4
  63. package/lib/es/datePicker/inputFoundation.js +192 -4
  64. package/lib/es/datePicker/monthFoundation.d.ts +1 -0
  65. package/lib/es/datePicker/monthsGridFoundation.d.ts +1 -0
  66. package/lib/es/datePicker/monthsGridFoundation.js +4 -2
  67. package/lib/es/datePicker/rtl.scss +8 -0
  68. package/lib/es/datePicker/variables.scss +30 -0
  69. package/lib/es/table/table.css +1 -1
  70. package/lib/es/table/table.scss +1 -1
  71. package/lib/es/table/variables.scss +1 -0
  72. package/lib/es/tag/tag.css +1 -0
  73. package/lib/es/tag/tag.scss +1 -0
  74. package/lib/es/tooltip/foundation.js +8 -8
  75. package/lib/es/treeSelect/foundation.d.ts +3 -2
  76. package/lib/es/treeSelect/foundation.js +27 -15
  77. package/package.json +3 -3
  78. package/table/table.scss +1 -1
  79. package/table/variables.scss +1 -0
  80. package/tag/tag.scss +1 -0
  81. package/tooltip/foundation.ts +8 -8
  82. package/treeSelect/foundation.ts +26 -19
@@ -193,6 +193,10 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
193
193
  handleShowNextByHover(item: BasicEntity): void;
194
194
  onItemCheckboxClick(item: BasicEntity | BasicData): void;
195
195
  handleClick(e: any): void;
196
+ /**
197
+ * A11y: simulate selection click
198
+ */
199
+ handleSelectionEnterPress(keyboardEvent: any): void;
196
200
  toggleHoverState(bool: boolean): void;
197
201
  _defaultRenderText(path: any[], displayRender?: BasicCascaderProps['displayRender']): any;
198
202
  renderDisplayText(targetKey: string, keyEntities?: BasicEntities): any;
@@ -201,6 +205,17 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
201
205
  handleSingleSelect(e: any, item: BasicEntity | BasicData): void;
202
206
  _handleMultipleSelect(item: BasicEntity | BasicData): void;
203
207
  calcNonDisabedCheckedKeys(eventKey: string, targetStatus: boolean): {
208
+ /**
209
+ * The typical scenario is: suppose we select the 0-0 node, at this time
210
+ * selectedKeys=Set('0-0'), the input box will display a 0-0 label. When
211
+ * treeData is updated, assuming 0-0 does not exist in treeData at this
212
+ * time, then selectedKeys=Set('not-exist-0-0'), at this time the input
213
+ * box displays 0-0, which means not-exist -After the content. When treeData
214
+ * is updated again, assuming that 0-0 exists in treeData at this time,
215
+ * then selectedKeys=Set('0-0'), and the input box displays a label of
216
+ * 0-0 at this time. The operation done here is for the 0-0 label to be
217
+ * displayed normally after the second update in the example.
218
+ */
204
219
  checkedKeys: Set<string>;
205
220
  halfCheckedKeys: Set<any>;
206
221
  };
@@ -217,6 +232,10 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
217
232
  };
218
233
  handleInputChange(sugInput: string): void;
219
234
  handleClear(): void;
235
+ /**
236
+ * A11y: simulate clear button click
237
+ */
238
+ handleClearEnterPress(keyboardEvent: any): void;
220
239
  getRenderData(): BasicEntity[] | BasicData[];
221
240
  getFilteredData(): BasicData[];
222
241
  handleListScroll(e: any, ind: number): void;
@@ -23,7 +23,8 @@ import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
23
23
  import BaseFoundation from '../base/foundation';
24
24
  import { filter, findAncestorKeys, calcCheckedKeysForUnchecked, calcCheckedKeysForChecked, calcCheckedKeys, findDescendantKeys, normalizeKeyList } from '../tree/treeUtil';
25
25
  import { convertDataToEntities, findKeysForValues, normalizedArr, isValid, calcMergeType } from './util';
26
- import { strings } from './constants'; // eslint-disable-next-line max-len
26
+ import { strings } from './constants';
27
+ import isEnterPress from '../utils/isEnterPress'; // eslint-disable-next-line max-len
27
28
 
28
29
  export default class CascaderFoundation extends BaseFoundation {
29
30
  constructor(adapter) {
@@ -530,6 +531,16 @@ export default class CascaderFoundation extends BaseFoundation {
530
531
  this.close(e);
531
532
  }
532
533
  }
534
+ /**
535
+ * A11y: simulate selection click
536
+ */
537
+
538
+
539
+ handleSelectionEnterPress(keyboardEvent) {
540
+ if (isEnterPress(keyboardEvent)) {
541
+ this.handleClick(keyboardEvent);
542
+ }
543
+ }
533
544
 
534
545
  toggleHoverState(bool) {
535
546
  this._adapter.toggleHovering(bool);
@@ -961,6 +972,16 @@ export default class CascaderFoundation extends BaseFoundation {
961
972
 
962
973
  this._adapter.rePositionDropdown();
963
974
  }
975
+ /**
976
+ * A11y: simulate clear button click
977
+ */
978
+
979
+
980
+ handleClearEnterPress(keyboardEvent) {
981
+ if (isEnterPress(keyboardEvent)) {
982
+ this.handleClear();
983
+ }
984
+ }
964
985
 
965
986
  getRenderData() {
966
987
  var _context9, _context10;
@@ -8,7 +8,7 @@ import { BaseValueType } from '../foundation';
8
8
  * @returns {string}
9
9
  */
10
10
  export declare function formatDateValues(values: BaseValueType[], formatToken: string, { groupInnerSeparator, groupSize, groupSeparator, }: {
11
- groupInnerSeparator?: " ~ ";
11
+ groupInnerSeparator?: string;
12
12
  groupSize?: number;
13
- groupSeparator?: ",";
13
+ groupSeparator?: string;
14
14
  }, locale: any): string;
@@ -0,0 +1,20 @@
1
+ import { strings } from '../constants';
2
+ /**
3
+ * 获取 insetInput 输入框的 placeholder
4
+ * Get the placeholder of the insetInput input
5
+ *
6
+ * If type is time related, we only recognize the format like `dateFormat timeFormat`
7
+ * - 'yyyy-MM-dd HH:mm:ss' // ok
8
+ * - 'yyyy-MM-dd HH:mm:ss' // bad format
9
+ *
10
+ * @example
11
+ * 'yyyy-MM-dd' => 'yyyy-MM-dd'
12
+ * 'yyyy-MM' => 'yyyy-MM'
13
+ * 'yyyy-MM-dd HH:mm:ss' => 'yyyy-MM-dd HH:mm:ss'
14
+ * 'yyyy-MM-dd HH:mm' => 'yyyy-MM-dd HH:mm'
15
+ * 'Pp' => 'yyyy-MM-dd'
16
+ */
17
+ export default function getInsetInputFormatToken(options: {
18
+ format: string;
19
+ type: typeof strings.TYPE_SET[number];
20
+ }): string;
@@ -0,0 +1,48 @@
1
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
2
+ import { getDefaultFormatTokenByType } from './getDefaultFormatToken';
3
+ /**
4
+ * 获取 insetInput 输入框的 placeholder
5
+ * Get the placeholder of the insetInput input
6
+ *
7
+ * If type is time related, we only recognize the format like `dateFormat timeFormat`
8
+ * - 'yyyy-MM-dd HH:mm:ss' // ok
9
+ * - 'yyyy-MM-dd HH:mm:ss' // bad format
10
+ *
11
+ * @example
12
+ * 'yyyy-MM-dd' => 'yyyy-MM-dd'
13
+ * 'yyyy-MM' => 'yyyy-MM'
14
+ * 'yyyy-MM-dd HH:mm:ss' => 'yyyy-MM-dd HH:mm:ss'
15
+ * 'yyyy-MM-dd HH:mm' => 'yyyy-MM-dd HH:mm'
16
+ * 'Pp' => 'yyyy-MM-dd'
17
+ */
18
+
19
+ export default function getInsetInputFormatToken(options) {
20
+ var _context;
21
+
22
+ const {
23
+ format,
24
+ type
25
+ } = options;
26
+ const dateReg = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4})/i;
27
+ const dateTimeReg = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4}) (H{0,2}[^a-z\s]*m{0,2}[^a-z\s]*s{0,2})/i;
28
+ const defaultToken = getDefaultFormatTokenByType(type);
29
+ let insetInputFormat;
30
+
31
+ switch (type) {
32
+ case 'dateTime':
33
+ case 'dateTimeRange':
34
+ const dateTimeResult = dateTimeReg.exec(format);
35
+ insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ? _concatInstanceProperty(_context = "".concat(dateTimeResult[1], " ")).call(_context, dateTimeResult[2]) : defaultToken;
36
+ break;
37
+
38
+ case 'date':
39
+ case 'month':
40
+ case 'dateRange':
41
+ default:
42
+ const dateResult = dateReg.exec(format);
43
+ insetInputFormat = dateResult && dateResult[1] || defaultToken;
44
+ break;
45
+ }
46
+
47
+ return insetInputFormat;
48
+ }
@@ -0,0 +1,31 @@
1
+ import { strings } from '../constants';
2
+ /**
3
+ * 从 insetInputStr 字符串解析出 insetInputValue 对象
4
+ * Parse the insetInputValue object from the insetInputStr string
5
+ *
6
+ * @example
7
+ * ```
8
+ * '2022-02-01' => { monthLeft: { dateInput: '2022-02-01' } }
9
+ * '2022-02-01 00:00:00' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00' } }
10
+ * '2022-02-01 00:00:00 ~ 2022-02-15 00:00:00' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00'}, monthRight: { dateInput: '2022-02-15', timeInput: '00:00:00' } }
11
+ *
12
+ * '2022-0' => { monthLeft: { dateInput: '2022-0' } }
13
+ * '2022-02-01 00:00:' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:' } }
14
+ * '2022-02-01 00:00:00 ~ ' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00'}, monthRight: { dateInput: '', timeInput: '' } }
15
+ * ' ~ 2022-02-15 00:00:00' => { monthLeft: { dateInput: '', timeInput: '' }, monthRight: { dateInput: '2022-02-15', timeInput: '00:00:00' } }
16
+ * ```
17
+ */
18
+ export default function getInsetInputValueFromInsetInputStr(options: {
19
+ inputValue: string;
20
+ rangeSeparator: string;
21
+ type: typeof strings.TYPE_SET[number];
22
+ }): {
23
+ monthLeft: {
24
+ dateInput: string;
25
+ timeInput: string;
26
+ };
27
+ monthRight: {
28
+ dateInput: string;
29
+ timeInput: string;
30
+ };
31
+ };
@@ -0,0 +1,66 @@
1
+ /**
2
+ * 从 insetInputStr 字符串解析出 insetInputValue 对象
3
+ * Parse the insetInputValue object from the insetInputStr string
4
+ *
5
+ * @example
6
+ * ```
7
+ * '2022-02-01' => { monthLeft: { dateInput: '2022-02-01' } }
8
+ * '2022-02-01 00:00:00' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00' } }
9
+ * '2022-02-01 00:00:00 ~ 2022-02-15 00:00:00' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00'}, monthRight: { dateInput: '2022-02-15', timeInput: '00:00:00' } }
10
+ *
11
+ * '2022-0' => { monthLeft: { dateInput: '2022-0' } }
12
+ * '2022-02-01 00:00:' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:' } }
13
+ * '2022-02-01 00:00:00 ~ ' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00'}, monthRight: { dateInput: '', timeInput: '' } }
14
+ * ' ~ 2022-02-15 00:00:00' => { monthLeft: { dateInput: '', timeInput: '' }, monthRight: { dateInput: '2022-02-15', timeInput: '00:00:00' } }
15
+ * ```
16
+ */
17
+ export default function getInsetInputValueFromInsetInputStr(options) {
18
+ const timeSeparator = ' ';
19
+ const {
20
+ inputValue = '',
21
+ rangeSeparator,
22
+ type
23
+ } = options;
24
+ let leftDateInput, leftTimeInput, rightDateInput, rightTimeInput;
25
+ const insetInputValue = {
26
+ monthLeft: {
27
+ dateInput: '',
28
+ timeInput: ''
29
+ },
30
+ monthRight: {
31
+ dateInput: '',
32
+ timeInput: ''
33
+ }
34
+ };
35
+
36
+ switch (type) {
37
+ case 'date':
38
+ case 'month':
39
+ insetInputValue.monthLeft.dateInput = inputValue;
40
+ break;
41
+
42
+ case 'dateRange':
43
+ [leftDateInput = '', rightDateInput = ''] = inputValue.split(rangeSeparator);
44
+ insetInputValue.monthLeft.dateInput = leftDateInput;
45
+ insetInputValue.monthRight.dateInput = rightDateInput;
46
+ break;
47
+
48
+ case 'dateTime':
49
+ [leftDateInput = '', leftTimeInput = ''] = inputValue.split(timeSeparator);
50
+ insetInputValue.monthLeft.dateInput = leftDateInput;
51
+ insetInputValue.monthLeft.timeInput = leftTimeInput;
52
+ break;
53
+
54
+ case 'dateTimeRange':
55
+ const [leftInput = '', rightInput = ''] = inputValue.split(rangeSeparator);
56
+ [leftDateInput = '', leftTimeInput = ''] = leftInput.split(timeSeparator);
57
+ [rightDateInput = '', rightTimeInput = ''] = rightInput.split(timeSeparator);
58
+ insetInputValue.monthLeft.dateInput = leftDateInput;
59
+ insetInputValue.monthLeft.timeInput = leftTimeInput;
60
+ insetInputValue.monthRight.dateInput = rightDateInput;
61
+ insetInputValue.monthRight.timeInput = rightTimeInput;
62
+ break;
63
+ }
64
+
65
+ return insetInputValue;
66
+ }
@@ -41,10 +41,12 @@ declare const strings: {
41
41
  readonly PANEL_TYPE_RIGHT: "right";
42
42
  readonly STATUS: readonly ["default", "error", "warning", "success"];
43
43
  readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
44
+ readonly POSITION_INLINE_INPUT: "leftTopOver";
44
45
  };
45
46
  declare const numbers: {
46
47
  readonly WEEK_START_ON: 0;
47
48
  readonly WEEK_HEIGHT: 36;
48
49
  readonly SPACING: number;
50
+ readonly SPACING_INSET_INPUT: 1;
49
51
  };
50
52
  export { cssClasses, strings, numbers };
@@ -50,13 +50,14 @@ const strings = _Object$assign({
50
50
  PANEL_TYPE_LEFT: 'left',
51
51
  PANEL_TYPE_RIGHT: 'right',
52
52
  STATUS: VALIDATE_STATUS,
53
- POSITION_SET: POPOVER_STRINGS.POSITION_SET
53
+ POSITION_SET: POPOVER_STRINGS.POSITION_SET,
54
+ POSITION_INLINE_INPUT: 'leftTopOver'
54
55
  }, formatToken);
55
56
 
56
57
  const numbers = {
57
58
  WEEK_START_ON: 0,
58
59
  WEEK_HEIGHT: 36,
59
- SPACING: popoverNumber.SPACING // Floating distance trigger interval
60
-
60
+ SPACING: popoverNumber.SPACING,
61
+ SPACING_INSET_INPUT: 1
61
62
  };
62
63
  export { cssClasses, strings, numbers };
@@ -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*=top] .semi-datepicker .semi-datepicker-weeks, .semi-popover-wrapper[x-placement*=Top] .semi-datepicker .semi-datepicker-weeks {
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*=top] .semi-datepicker-compact .semi-datepicker-weeks, .semi-popover-wrapper[x-placement*=Top] .semi-datepicker-compact .semi-datepicker-weeks {
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*="top"],
1050
- &[x-placement*="Top"] {
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