@douyinfe/semi-ui 2.6.0 → 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 (61) hide show
  1. package/button/__test__/button.test.js +7 -0
  2. package/button/buttonGroup.tsx +5 -2
  3. package/cascader/__test__/cascader.test.js +159 -81
  4. package/cascader/_story/cascader.stories.js +36 -23
  5. package/cascader/index.tsx +26 -5
  6. package/datePicker/_story/v2/InsetInput.jsx +104 -0
  7. package/datePicker/_story/v2/InsetInputE2E.jsx +69 -0
  8. package/datePicker/_story/v2/index.js +2 -0
  9. package/datePicker/dateInput.tsx +95 -9
  10. package/datePicker/datePicker.tsx +89 -15
  11. package/datePicker/index.tsx +15 -0
  12. package/datePicker/insetInput.tsx +76 -0
  13. package/datePicker/monthsGrid.tsx +14 -7
  14. package/dist/css/semi.css +104 -2
  15. package/dist/css/semi.min.css +1 -1
  16. package/dist/umd/semi-ui.js +902 -147
  17. package/dist/umd/semi-ui.js.map +1 -1
  18. package/dist/umd/semi-ui.min.js +1 -1
  19. package/dist/umd/semi-ui.min.js.map +1 -1
  20. package/input/_story/input.stories.js +13 -0
  21. package/lib/cjs/button/buttonGroup.d.ts +1 -0
  22. package/lib/cjs/button/buttonGroup.js +6 -2
  23. package/lib/cjs/cascader/index.d.ts +1 -0
  24. package/lib/cjs/cascader/index.js +38 -9
  25. package/lib/cjs/datePicker/dateInput.d.ts +9 -2
  26. package/lib/cjs/datePicker/dateInput.js +92 -9
  27. package/lib/cjs/datePicker/datePicker.d.ts +7 -2
  28. package/lib/cjs/datePicker/datePicker.js +123 -18
  29. package/lib/cjs/datePicker/index.js +24 -2
  30. package/lib/cjs/datePicker/insetInput.d.ts +21 -0
  31. package/lib/cjs/datePicker/insetInput.js +80 -0
  32. package/lib/cjs/datePicker/monthsGrid.js +19 -7
  33. package/lib/cjs/tree/index.js +5 -3
  34. package/lib/cjs/tree/interface.d.ts +1 -0
  35. package/lib/cjs/tree/nodeList.js +2 -1
  36. package/lib/cjs/treeSelect/index.js +7 -3
  37. package/lib/es/button/buttonGroup.d.ts +1 -0
  38. package/lib/es/button/buttonGroup.js +5 -2
  39. package/lib/es/cascader/index.d.ts +1 -0
  40. package/lib/es/cascader/index.js +35 -6
  41. package/lib/es/datePicker/dateInput.d.ts +9 -2
  42. package/lib/es/datePicker/dateInput.js +91 -9
  43. package/lib/es/datePicker/datePicker.d.ts +7 -2
  44. package/lib/es/datePicker/datePicker.js +124 -18
  45. package/lib/es/datePicker/index.js +20 -0
  46. package/lib/es/datePicker/insetInput.d.ts +21 -0
  47. package/lib/es/datePicker/insetInput.js +65 -0
  48. package/lib/es/datePicker/monthsGrid.js +19 -7
  49. package/lib/es/tree/index.js +5 -3
  50. package/lib/es/tree/interface.d.ts +1 -0
  51. package/lib/es/tree/nodeList.js +2 -1
  52. package/lib/es/treeSelect/index.js +7 -3
  53. package/package.json +9 -9
  54. package/tree/__test__/tree.test.js +87 -2
  55. package/tree/_story/tree.stories.js +65 -5
  56. package/tree/index.tsx +4 -2
  57. package/tree/interface.ts +1 -0
  58. package/tree/nodeList.tsx +2 -2
  59. package/treeSelect/__test__/treeSelect.test.js +28 -0
  60. package/treeSelect/_story/treeSelect.stories.js +55 -2
  61. package/treeSelect/index.tsx +11 -3
@@ -24247,25 +24247,25 @@ class foundation_Tooltip extends foundation {
24247
24247
  break;
24248
24248
 
24249
24249
  case 'leftTopOver':
24250
- left = triggerRect.left;
24251
- top = triggerRect.top;
24250
+ left = triggerRect.left - SPACING;
24251
+ top = triggerRect.top - SPACING;
24252
24252
  break;
24253
24253
 
24254
24254
  case 'rightTopOver':
24255
- left = triggerRect.right;
24256
- top = triggerRect.top;
24255
+ left = triggerRect.right + SPACING;
24256
+ top = triggerRect.top - SPACING;
24257
24257
  translateX = -1;
24258
24258
  break;
24259
24259
 
24260
24260
  case 'leftBottomOver':
24261
- left = triggerRect.left;
24262
- top = triggerRect.bottom;
24261
+ left = triggerRect.left - SPACING;
24262
+ top = triggerRect.bottom + SPACING;
24263
24263
  translateY = -1;
24264
24264
  break;
24265
24265
 
24266
24266
  case 'rightBottomOver':
24267
- left = triggerRect.right;
24268
- top = triggerRect.bottom;
24267
+ left = triggerRect.right + SPACING;
24268
+ top = triggerRect.bottom + SPACING;
24269
24269
  translateX = -1;
24270
24270
  translateY = -1;
24271
24271
  break;
@@ -36385,6 +36385,7 @@ var buttonGroup_rest = undefined && undefined.__rest || function (s, e) {
36385
36385
 
36386
36386
 
36387
36387
 
36388
+
36388
36389
  const buttonGroup_prefixCls = button_constants_cssClasses.PREFIX;
36389
36390
  const buttonGroup_btnSizes = button_constants_strings.sizes;
36390
36391
  class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
@@ -36395,11 +36396,13 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
36395
36396
  disabled,
36396
36397
  size,
36397
36398
  type,
36399
+ className,
36398
36400
  'aria-label': ariaLabel
36399
36401
  } = _a,
36400
- rest = buttonGroup_rest(_a, ["children", "disabled", "size", "type", 'aria-label']);
36402
+ rest = buttonGroup_rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
36401
36403
 
36402
36404
  let inner;
36405
+ const cls = classnames_default()("".concat(buttonGroup_prefixCls, "-group"), className);
36403
36406
 
36404
36407
  if (children) {
36405
36408
  var _context;
@@ -36414,7 +36417,7 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
36414
36417
  }
36415
36418
 
36416
36419
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
36417
- className: "".concat(buttonGroup_prefixCls, "-group"),
36420
+ className: cls,
36418
36421
  role: "group",
36419
36422
  "aria-label": ariaLabel
36420
36423
  }, inner);
@@ -47186,6 +47189,36 @@ class cascader_Cascader extends baseComponent_BaseComponent {
47186
47189
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, displayTag, !isEmpty_default()(hiddenTag) && this.renderPlusN(hiddenTag));
47187
47190
  };
47188
47191
 
47192
+ this.renderDisplayText = () => {
47193
+ const {
47194
+ displayProp,
47195
+ separator,
47196
+ displayRender
47197
+ } = this.props;
47198
+ const {
47199
+ selectedKeys
47200
+ } = this.state;
47201
+ let displayText = '';
47202
+
47203
+ if (selectedKeys.size) {
47204
+ const displayPath = this.foundation.getItemPropPath([...selectedKeys][0], displayProp);
47205
+
47206
+ if (displayRender && typeof displayRender === 'function') {
47207
+ displayText = displayRender(displayPath);
47208
+ } else {
47209
+ displayText = map_default()(displayPath).call(displayPath, (path, index) => {
47210
+ var _context3;
47211
+
47212
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_["Fragment"], {
47213
+ key: concat_default()(_context3 = "".concat(path, "-")).call(_context3, index)
47214
+ }, index < displayPath.length - 1 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, path, separator) : path);
47215
+ });
47216
+ }
47217
+ }
47218
+
47219
+ return displayText;
47220
+ };
47221
+
47189
47222
  this.renderSelectContent = () => {
47190
47223
  const {
47191
47224
  placeholder,
@@ -47193,7 +47226,6 @@ class cascader_Cascader extends baseComponent_BaseComponent {
47193
47226
  multiple
47194
47227
  } = this.props;
47195
47228
  const {
47196
- selectedKeys,
47197
47229
  checkedKeys
47198
47230
  } = this.state;
47199
47231
  const searchable = Boolean(filterTreeNode);
@@ -47208,9 +47240,9 @@ class cascader_Cascader extends baseComponent_BaseComponent {
47208
47240
 
47209
47241
  return this.renderMultipleTags();
47210
47242
  } else {
47211
- const displayText = selectedKeys.size ? this.foundation.renderDisplayText([...selectedKeys][0]) : '';
47243
+ const displayText = this.renderDisplayText();
47212
47244
  const spanCls = classnames_default()({
47213
- ["".concat(cascader_prefixcls, "-selection-placeholder")]: !displayText || !displayText.length
47245
+ ["".concat(cascader_prefixcls, "-selection-placeholder")]: !displayText
47214
47246
  });
47215
47247
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
47216
47248
  className: spanCls
@@ -47755,7 +47787,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
47755
47787
  }
47756
47788
 
47757
47789
  renderTagInput() {
47758
- var _context3;
47790
+ var _context4;
47759
47791
 
47760
47792
  const {
47761
47793
  size,
@@ -47775,7 +47807,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
47775
47807
  const tagValue = [];
47776
47808
  const realKeys = this.mergeType === cascader_constants_strings.NONE_MERGE_TYPE ? checkedKeys : resolvedCheckedKeys;
47777
47809
 
47778
- for_each_default()(_context3 = [...realKeys]).call(_context3, checkedKey => {
47810
+ for_each_default()(_context4 = [...realKeys]).call(_context4, checkedKey => {
47779
47811
  if (!isEmpty_default()(keyEntities[checkedKey])) {
47780
47812
  tagValue.push(keyEntities[checkedKey].valuePath);
47781
47813
  }
@@ -48709,6 +48741,70 @@ function forwardStatics(obj, srcObj) {
48709
48741
 
48710
48742
  return obj;
48711
48743
  }
48744
+ // CONCATENATED MODULE: ../semi-foundation/datePicker/constants.ts
48745
+
48746
+
48747
+
48748
+ const dayItemClasses = {
48749
+ DAY_TODAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-today"),
48750
+ DAY_IN_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inrange"),
48751
+ DAY_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inhover"),
48752
+ DAY_SELECTED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected"),
48753
+ DAY_SELECTED_START: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-start"),
48754
+ DAY_SELECTED_END: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-end"),
48755
+ DAY_DISABLED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-disabled"),
48756
+ DAY_HOVER_DAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday"),
48757
+ DAY_HOVER_DAY_OFFSET: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-offset"),
48758
+ DAY_IN_OFFSET_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inoffsetrange"),
48759
+ DAY_SELECTED_RANGE_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selectedrange-hover"),
48760
+ DAY_OFFSET_RANGE_START: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-offsetrange-start"),
48761
+ DAY_OFFSET_RANGE_END: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-offsetrange-end"),
48762
+ DAY_SELECTED_START_AFTER_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-start-afterhover"),
48763
+ DAY_SELECTED_END_BEFORE_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-end-beforehover"),
48764
+ DAY_HOVER_DAY_BEFORE_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-beforerange"),
48765
+ DAY_HOVER_DAY_AFTER_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-afterrange"),
48766
+ DAY_HOVER_DAY_IN_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-inrange"),
48767
+ DAY_HOVER_DAY_AROUND_SINGLE_SELECTED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-around-singleselected")
48768
+ };
48769
+
48770
+ const datePicker_constants_cssClasses = assign_default()({
48771
+ PREFIX: "".concat(BASE_CLASS_PREFIX, "-datepicker"),
48772
+ NAVIGATION: "".concat(BASE_CLASS_PREFIX, "-datepicker-navigation"),
48773
+ PANEL_YAM: "".concat(BASE_CLASS_PREFIX, "-datepicker-panel-yam"),
48774
+ MONTH: "".concat(BASE_CLASS_PREFIX, "-datepicker-month"),
48775
+ WEEKDAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-weekday"),
48776
+ WEEKS: "".concat(BASE_CLASS_PREFIX, "-datepicker-weeks"),
48777
+ WEEK: "".concat(BASE_CLASS_PREFIX, "-datepicker-week"),
48778
+ DAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day")
48779
+ }, dayItemClasses);
48780
+
48781
+ const constants_formatToken = {
48782
+ FORMAT_FULL_DATE: 'yyyy-MM-dd',
48783
+ FORMAT_TIME_PICKER: 'HH:mm:ss',
48784
+ FORMAT_DATE_TIME: 'yyyy-MM-dd HH:mm:ss',
48785
+ FORMAT_YEAR_MONTH: 'yyyy-MM'
48786
+ };
48787
+
48788
+ const datePicker_constants_strings = assign_default()({
48789
+ DEFAULT_SEPARATOR_MULTIPLE: ',',
48790
+ DEFAULT_SEPARATOR_RANGE: ' ~ ',
48791
+ SIZE_SET: ['small', 'default', 'large'],
48792
+ TYPE_SET: ['date', 'dateRange', 'year', 'month', 'dateTime', 'dateTimeRange'],
48793
+ DENSITY_SET: ['default', 'compact'],
48794
+ PANEL_TYPE_LEFT: 'left',
48795
+ PANEL_TYPE_RIGHT: 'right',
48796
+ STATUS: VALIDATE_STATUS,
48797
+ POSITION_SET: popover_constants_strings.POSITION_SET,
48798
+ POSITION_INLINE_INPUT: 'leftTopOver'
48799
+ }, constants_formatToken);
48800
+
48801
+ const datePicker_constants_numbers = {
48802
+ WEEK_START_ON: 0,
48803
+ WEEK_HEIGHT: 36,
48804
+ SPACING: constants_numbers.SPACING,
48805
+ SPACING_INSET_INPUT: 1
48806
+ };
48807
+
48712
48808
  // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isDate.js
48713
48809
  var lodash_isDate = __webpack_require__("+f76");
48714
48810
  var isDate_default = /*#__PURE__*/__webpack_require__.n(lodash_isDate);
@@ -52744,69 +52840,6 @@ function compatiableParse(value, formatToken, baseDate, locale) {
52744
52840
 
52745
52841
  return result;
52746
52842
  }
52747
- // CONCATENATED MODULE: ../semi-foundation/datePicker/constants.ts
52748
-
52749
-
52750
-
52751
- const dayItemClasses = {
52752
- DAY_TODAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-today"),
52753
- DAY_IN_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inrange"),
52754
- DAY_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inhover"),
52755
- DAY_SELECTED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected"),
52756
- DAY_SELECTED_START: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-start"),
52757
- DAY_SELECTED_END: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-end"),
52758
- DAY_DISABLED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-disabled"),
52759
- DAY_HOVER_DAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday"),
52760
- DAY_HOVER_DAY_OFFSET: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-offset"),
52761
- DAY_IN_OFFSET_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inoffsetrange"),
52762
- DAY_SELECTED_RANGE_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selectedrange-hover"),
52763
- DAY_OFFSET_RANGE_START: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-offsetrange-start"),
52764
- DAY_OFFSET_RANGE_END: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-offsetrange-end"),
52765
- DAY_SELECTED_START_AFTER_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-start-afterhover"),
52766
- DAY_SELECTED_END_BEFORE_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-end-beforehover"),
52767
- DAY_HOVER_DAY_BEFORE_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-beforerange"),
52768
- DAY_HOVER_DAY_AFTER_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-afterrange"),
52769
- DAY_HOVER_DAY_IN_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-inrange"),
52770
- DAY_HOVER_DAY_AROUND_SINGLE_SELECTED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-around-singleselected")
52771
- };
52772
-
52773
- const datePicker_constants_cssClasses = assign_default()({
52774
- PREFIX: "".concat(BASE_CLASS_PREFIX, "-datepicker"),
52775
- NAVIGATION: "".concat(BASE_CLASS_PREFIX, "-datepicker-navigation"),
52776
- PANEL_YAM: "".concat(BASE_CLASS_PREFIX, "-datepicker-panel-yam"),
52777
- MONTH: "".concat(BASE_CLASS_PREFIX, "-datepicker-month"),
52778
- WEEKDAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-weekday"),
52779
- WEEKS: "".concat(BASE_CLASS_PREFIX, "-datepicker-weeks"),
52780
- WEEK: "".concat(BASE_CLASS_PREFIX, "-datepicker-week"),
52781
- DAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day")
52782
- }, dayItemClasses);
52783
-
52784
- const constants_formatToken = {
52785
- FORMAT_FULL_DATE: 'yyyy-MM-dd',
52786
- FORMAT_TIME_PICKER: 'HH:mm:ss',
52787
- FORMAT_DATE_TIME: 'yyyy-MM-dd HH:mm:ss',
52788
- FORMAT_YEAR_MONTH: 'yyyy-MM'
52789
- };
52790
-
52791
- const datePicker_constants_strings = assign_default()({
52792
- DEFAULT_SEPARATOR_MULTIPLE: ',',
52793
- DEFAULT_SEPARATOR_RANGE: ' ~ ',
52794
- SIZE_SET: ['small', 'default', 'large'],
52795
- TYPE_SET: ['date', 'dateRange', 'year', 'month', 'dateTime', 'dateTimeRange'],
52796
- DENSITY_SET: ['default', 'compact'],
52797
- PANEL_TYPE_LEFT: 'left',
52798
- PANEL_TYPE_RIGHT: 'right',
52799
- STATUS: VALIDATE_STATUS,
52800
- POSITION_SET: popover_constants_strings.POSITION_SET
52801
- }, constants_formatToken);
52802
-
52803
- const datePicker_constants_numbers = {
52804
- WEEK_START_ON: 0,
52805
- WEEK_HEIGHT: 36,
52806
- SPACING: constants_numbers.SPACING // Floating distance trigger interval
52807
-
52808
- };
52809
-
52810
52843
  // CONCATENATED MODULE: ../semi-foundation/datePicker/_utils/getDefaultFormatToken.ts
52811
52844
 
52812
52845
  const defaultFormatTokens = {
@@ -52823,6 +52856,122 @@ function getDefaultFormatTokenByType(type) {
52823
52856
  return type && defaultFormatTokens[type];
52824
52857
  }
52825
52858
  /* harmony default export */ var _utils_getDefaultFormatToken = (getDefaultFormatToken);
52859
+ // CONCATENATED MODULE: ../semi-foundation/datePicker/_utils/getInsetInputFormatToken.ts
52860
+
52861
+
52862
+ /**
52863
+ * 获取 insetInput 输入框的 placeholder
52864
+ * Get the placeholder of the insetInput input
52865
+ *
52866
+ * If type is time related, we only recognize the format like `dateFormat timeFormat`
52867
+ * - 'yyyy-MM-dd HH:mm:ss' // ok
52868
+ * - 'yyyy-MM-dd HH:mm:ss' // bad format
52869
+ *
52870
+ * @example
52871
+ * 'yyyy-MM-dd' => 'yyyy-MM-dd'
52872
+ * 'yyyy-MM' => 'yyyy-MM'
52873
+ * 'yyyy-MM-dd HH:mm:ss' => 'yyyy-MM-dd HH:mm:ss'
52874
+ * 'yyyy-MM-dd HH:mm' => 'yyyy-MM-dd HH:mm'
52875
+ * 'Pp' => 'yyyy-MM-dd'
52876
+ */
52877
+
52878
+ function getInsetInputFormatToken(options) {
52879
+ var _context;
52880
+
52881
+ const {
52882
+ format,
52883
+ type
52884
+ } = options;
52885
+ const dateReg = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4})/i;
52886
+ 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;
52887
+ const defaultToken = getDefaultFormatTokenByType(type);
52888
+ let insetInputFormat;
52889
+
52890
+ switch (type) {
52891
+ case 'dateTime':
52892
+ case 'dateTimeRange':
52893
+ const dateTimeResult = dateTimeReg.exec(format);
52894
+ insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ? concat_default()(_context = "".concat(dateTimeResult[1], " ")).call(_context, dateTimeResult[2]) : defaultToken;
52895
+ break;
52896
+
52897
+ case 'date':
52898
+ case 'month':
52899
+ case 'dateRange':
52900
+ default:
52901
+ const dateResult = dateReg.exec(format);
52902
+ insetInputFormat = dateResult && dateResult[1] || defaultToken;
52903
+ break;
52904
+ }
52905
+
52906
+ return insetInputFormat;
52907
+ }
52908
+ // CONCATENATED MODULE: ../semi-foundation/datePicker/_utils/getInsetInputValueFromInsetInputStr.ts
52909
+ /**
52910
+ * 从 insetInputStr 字符串解析出 insetInputValue 对象
52911
+ * Parse the insetInputValue object from the insetInputStr string
52912
+ *
52913
+ * @example
52914
+ * ```
52915
+ * '2022-02-01' => { monthLeft: { dateInput: '2022-02-01' } }
52916
+ * '2022-02-01 00:00:00' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00' } }
52917
+ * '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' } }
52918
+ *
52919
+ * '2022-0' => { monthLeft: { dateInput: '2022-0' } }
52920
+ * '2022-02-01 00:00:' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:' } }
52921
+ * '2022-02-01 00:00:00 ~ ' => { monthLeft: { dateInput: '2022-02-01', timeInput: '00:00:00'}, monthRight: { dateInput: '', timeInput: '' } }
52922
+ * ' ~ 2022-02-15 00:00:00' => { monthLeft: { dateInput: '', timeInput: '' }, monthRight: { dateInput: '2022-02-15', timeInput: '00:00:00' } }
52923
+ * ```
52924
+ */
52925
+ function getInsetInputValueFromInsetInputStr(options) {
52926
+ const timeSeparator = ' ';
52927
+ const {
52928
+ inputValue = '',
52929
+ rangeSeparator,
52930
+ type
52931
+ } = options;
52932
+ let leftDateInput, leftTimeInput, rightDateInput, rightTimeInput;
52933
+ const insetInputValue = {
52934
+ monthLeft: {
52935
+ dateInput: '',
52936
+ timeInput: ''
52937
+ },
52938
+ monthRight: {
52939
+ dateInput: '',
52940
+ timeInput: ''
52941
+ }
52942
+ };
52943
+
52944
+ switch (type) {
52945
+ case 'date':
52946
+ case 'month':
52947
+ insetInputValue.monthLeft.dateInput = inputValue;
52948
+ break;
52949
+
52950
+ case 'dateRange':
52951
+ [leftDateInput = '', rightDateInput = ''] = inputValue.split(rangeSeparator);
52952
+ insetInputValue.monthLeft.dateInput = leftDateInput;
52953
+ insetInputValue.monthRight.dateInput = rightDateInput;
52954
+ break;
52955
+
52956
+ case 'dateTime':
52957
+ [leftDateInput = '', leftTimeInput = ''] = inputValue.split(timeSeparator);
52958
+ insetInputValue.monthLeft.dateInput = leftDateInput;
52959
+ insetInputValue.monthLeft.timeInput = leftTimeInput;
52960
+ break;
52961
+
52962
+ case 'dateTimeRange':
52963
+ const [leftInput = '', rightInput = ''] = inputValue.split(rangeSeparator);
52964
+ [leftDateInput = '', leftTimeInput = ''] = leftInput.split(timeSeparator);
52965
+ [rightDateInput = '', rightTimeInput = ''] = rightInput.split(timeSeparator);
52966
+ insetInputValue.monthLeft.dateInput = leftDateInput;
52967
+ insetInputValue.monthLeft.timeInput = leftTimeInput;
52968
+ insetInputValue.monthRight.dateInput = rightDateInput;
52969
+ insetInputValue.monthRight.timeInput = rightTimeInput;
52970
+ break;
52971
+ }
52972
+
52973
+ return insetInputValue;
52974
+ }
52826
52975
  // CONCATENATED MODULE: ../semi-foundation/datePicker/foundation.ts
52827
52976
 
52828
52977
 
@@ -52857,6 +53006,8 @@ function getDefaultFormatTokenByType(type) {
52857
53006
 
52858
53007
 
52859
53008
 
53009
+
53010
+
52860
53011
  /**
52861
53012
  * The datePicker foundation.js is responsible for maintaining the date value and the input box value, as well as the callback of both
52862
53013
  * task 1. Accept the selected date change, update the date value, and update the input box value according to the date = > Notify the change
@@ -53088,6 +53239,20 @@ class foundation_DatePickerFoundation extends foundation {
53088
53239
  this.resetCachedSelectedValue(willUpdateDates);
53089
53240
  }
53090
53241
  }
53242
+ /**
53243
+ * clear inset input value when close panel
53244
+ */
53245
+
53246
+
53247
+ clearInsetInputValue() {
53248
+ const {
53249
+ insetInput
53250
+ } = this._adapter.getProps();
53251
+
53252
+ if (insetInput) {
53253
+ this._adapter.updateInsetInputValue(null);
53254
+ }
53255
+ }
53091
53256
 
53092
53257
  resetCachedSelectedValue(willUpdateDates) {
53093
53258
  const {
@@ -53135,6 +53300,7 @@ class foundation_DatePickerFoundation extends foundation {
53135
53300
 
53136
53301
  this.rangeTypeSideEffectsWhenClosePanel(inputValue, willUpdateDates);
53137
53302
  this.needConfirmSideEffectsWhenClosePanel(willUpdateDates);
53303
+ this.clearInsetInputValue();
53138
53304
 
53139
53305
  this._adapter.notifyOpenChange(false);
53140
53306
 
@@ -53180,6 +53346,52 @@ class foundation_DatePickerFoundation extends foundation {
53180
53346
  this._adapter.updateInputValue(input);
53181
53347
  }
53182
53348
  }
53349
+ /**
53350
+ * inset input 变化时需要更新以下 state 状态
53351
+ * - insetInputValue(总是)
53352
+ * - inputValue(可以解析为合法日期时)
53353
+ * - value(可以解析为合法日期时)
53354
+ */
53355
+
53356
+
53357
+ handleInsetInputChange(options) {
53358
+ const {
53359
+ insetInputStr,
53360
+ format,
53361
+ insetInputValue
53362
+ } = options;
53363
+
53364
+ const _isMultiple = this._isMultiple();
53365
+
53366
+ const result = _isMultiple ? this.parseMultipleInput(insetInputStr, format) : this.parseInput(insetInputStr, format);
53367
+ const {
53368
+ value: stateValue
53369
+ } = this.getStates();
53370
+
53371
+ if (result && result.length) {
53372
+ const changedDates = this._getChangedDates(result);
53373
+
53374
+ if (!this._someDateDisabled(changedDates)) {
53375
+ if (this._adapter.needConfirm()) {
53376
+ this._adapter.updateCachedSelectedValue(result);
53377
+ }
53378
+
53379
+ if (!isEqual_default()(result, stateValue)) {
53380
+ if (!this._isControlledComponent()) {
53381
+ this._adapter.updateValue(result);
53382
+ }
53383
+
53384
+ this._notifyChange(result);
53385
+ }
53386
+
53387
+ const triggerInput = _isMultiple ? this.formatMultipleDates(result) : this.formatDates(result);
53388
+
53389
+ this._adapter.updateInputValue(triggerInput);
53390
+ }
53391
+ }
53392
+
53393
+ this._adapter.updateInsetInputValue(insetInputValue);
53394
+ }
53183
53395
  /**
53184
53396
  * Input box blur
53185
53397
  * @param {String} input
@@ -53310,6 +53522,7 @@ class foundation_DatePickerFoundation extends foundation {
53310
53522
 
53311
53523
  parseInput() {
53312
53524
  let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
53525
+ let format = arguments.length > 1 ? arguments[1] : undefined;
53313
53526
  let result = []; // console.log(input);
53314
53527
 
53315
53528
  const {
@@ -53319,7 +53532,7 @@ class foundation_DatePickerFoundation extends foundation {
53319
53532
 
53320
53533
  if (input && input.length) {
53321
53534
  const type = this.getProp('type');
53322
- const formatToken = this.getProp('format') || getDefaultFormatTokenByType(type);
53535
+ const formatToken = format || this.getProp('format') || getDefaultFormatTokenByType(type);
53323
53536
  let parsedResult, formatedInput;
53324
53537
  const nowDate = new Date();
53325
53538
 
@@ -53413,12 +53626,13 @@ class foundation_DatePickerFoundation extends foundation {
53413
53626
 
53414
53627
  formatDates() {
53415
53628
  let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
53629
+ let customFormat = arguments.length > 1 ? arguments[1] : undefined;
53416
53630
  let str = '';
53417
53631
  const rangeSeparator = this.getProp('rangeSeparator');
53418
53632
 
53419
53633
  if (is_array_default()(dates) && dates.length) {
53420
53634
  const type = this.getProp('type');
53421
- const formatToken = this.getProp('format') || getDefaultFormatTokenByType(type);
53635
+ const formatToken = customFormat || this.getProp('format') || getDefaultFormatTokenByType(type);
53422
53636
 
53423
53637
  switch (type) {
53424
53638
  case 'date':
@@ -53468,6 +53682,7 @@ class foundation_DatePickerFoundation extends foundation {
53468
53682
  formatMultipleDates() {
53469
53683
  let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
53470
53684
  let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datePicker_constants_strings.DEFAULT_SEPARATOR_MULTIPLE;
53685
+ let customFormat = arguments.length > 2 ? arguments[2] : undefined;
53471
53686
  const strs = [];
53472
53687
 
53473
53688
  if (is_array_default()(dates) && dates.length) {
@@ -53477,14 +53692,14 @@ class foundation_DatePickerFoundation extends foundation {
53477
53692
  case 'date':
53478
53693
  case 'dateTime':
53479
53694
  case 'month':
53480
- for_each_default()(dates).call(dates, date => strs.push(this.formatDates([date])));
53695
+ for_each_default()(dates).call(dates, date => strs.push(this.formatDates([date], customFormat)));
53481
53696
 
53482
53697
  break;
53483
53698
 
53484
53699
  case 'dateRange':
53485
53700
  case 'dateTimeRange':
53486
53701
  for (let i = 0; i < dates.length; i += 2) {
53487
- strs.push(this.formatDates(slice_default()(dates).call(dates, i, i + 2)));
53702
+ strs.push(this.formatDates(slice_default()(dates).call(dates, i, i + 2), customFormat));
53488
53703
  }
53489
53704
 
53490
53705
  break;
@@ -53534,7 +53749,13 @@ class foundation_DatePickerFoundation extends foundation {
53534
53749
 
53535
53750
 
53536
53751
  handleSelectedChange(value, options) {
53537
- const type = this.getProp('type');
53752
+ const {
53753
+ type,
53754
+ format,
53755
+ rangeSeparator,
53756
+ insetInput
53757
+ } = this._adapter.getProps();
53758
+
53538
53759
  const {
53539
53760
  value: stateValue
53540
53761
  } = this.getStates();
@@ -53561,10 +53782,24 @@ class foundation_DatePickerFoundation extends foundation {
53561
53782
 
53562
53783
  const changedDates = this._getChangedDates(dates);
53563
53784
 
53564
- let inputValue;
53785
+ let inputValue, insetInputValue;
53565
53786
 
53566
53787
  if (!this._someDateDisabled(changedDates)) {
53567
53788
  inputValue = this._isMultiple() ? this.formatMultipleDates(dates) : this.formatDates(dates);
53789
+
53790
+ if (insetInput) {
53791
+ const insetInputFormatToken = getInsetInputFormatToken({
53792
+ format,
53793
+ type
53794
+ });
53795
+ const insetInputStr = this._isMultiple() ? this.formatMultipleDates(dates, undefined, insetInputFormatToken) : this.formatDates(dates, insetInputFormatToken);
53796
+ insetInputValue = getInsetInputValueFromInsetInputStr({
53797
+ inputValue: insetInputStr,
53798
+ type,
53799
+ rangeSeparator
53800
+ });
53801
+ }
53802
+
53568
53803
  const isRangeTypeAndInputIncomplete = this._isRangeType() && !this._isRangeValueComplete(dates);
53569
53804
  /**
53570
53805
  * If the input is incomplete when under control, the notifyChange is not triggered because
@@ -53579,15 +53814,23 @@ class foundation_DatePickerFoundation extends foundation {
53579
53814
  // do not change value when selected value is incomplete
53580
53815
  this._adapter.updateInputValue(inputValue);
53581
53816
 
53817
+ this._adapter.updateInsetInputValue(insetInputValue);
53818
+
53582
53819
  return;
53583
53820
  } else {
53584
- (!controlled || fromPreset) && this._updateValueAndInput(dates, true, inputValue);
53821
+ if (!controlled || fromPreset) {
53822
+ this._updateValueAndInput(dates, true, inputValue);
53823
+
53824
+ this._adapter.updateInsetInputValue(insetInputValue);
53825
+ }
53585
53826
  }
53586
53827
  }
53587
53828
 
53588
53829
  if (!controlled && this._adapter.needConfirm()) {
53589
53830
  // select date only change inputValue when needConfirm is true
53590
- this._adapter.updateInputValue(inputValue); // if inputValue is not complete, don't notifyChange
53831
+ this._adapter.updateInputValue(inputValue);
53832
+
53833
+ this._adapter.updateInsetInputValue(insetInputValue); // if inputValue is not complete, don't notifyChange
53591
53834
 
53592
53835
 
53593
53836
  if (isRangeTypeAndInputIncomplete) {
@@ -53631,7 +53874,7 @@ class foundation_DatePickerFoundation extends foundation {
53631
53874
  const {
53632
53875
  cachedSelectedValue,
53633
53876
  value
53634
- } = this.getStates();
53877
+ } = this._adapter.getStates();
53635
53878
 
53636
53879
  const isRangeValueComplete = this._isRangeValueComplete(cachedSelectedValue);
53637
53880
 
@@ -54002,6 +54245,23 @@ class foundation_DatePickerFoundation extends foundation {
54002
54245
  }
54003
54246
  }
54004
54247
 
54248
+ handlePanelVisibleChange(visible) {
54249
+ if (visible) {
54250
+ this._adapter.setInsetInputFocus();
54251
+ /**
54252
+ * After the panel is closed, the trigger input is disabled
54253
+ * 面板关闭后,trigger input 禁用
54254
+ */
54255
+
54256
+
54257
+ set_timeout_default()(() => {
54258
+ this._adapter.setTriggerDisabled(true);
54259
+ }, 0);
54260
+ } else {
54261
+ this._adapter.setTriggerDisabled(false);
54262
+ }
54263
+ }
54264
+
54005
54265
  }
54006
54266
  // CONCATENATED MODULE: ../semi-foundation/datePicker/_utils/formatter.ts
54007
54267
 
@@ -54064,7 +54324,11 @@ function formatDateValues(values, formatToken) {
54064
54324
  // CONCATENATED MODULE: ../semi-foundation/datePicker/inputFoundation.ts
54065
54325
 
54066
54326
 
54067
- /* eslint-disable max-len */
54327
+
54328
+
54329
+
54330
+
54331
+
54068
54332
 
54069
54333
 
54070
54334
 
@@ -54126,7 +54390,7 @@ class inputFoundation_InputFoundation extends foundation {
54126
54390
  this._adapter.notifyRangeInputFocus(e, rangeType);
54127
54391
  }
54128
54392
 
54129
- formatShowText(value) {
54393
+ formatShowText(value, customFormat) {
54130
54394
  const {
54131
54395
  type,
54132
54396
  dateFnsLocale,
@@ -54134,7 +54398,7 @@ class inputFoundation_InputFoundation extends foundation {
54134
54398
  rangeSeparator
54135
54399
  } = this._adapter.getProps();
54136
54400
 
54137
- const formatToken = format || getDefaultFormatTokenByType(type);
54401
+ const formatToken = customFormat || format || getDefaultFormatTokenByType(type);
54138
54402
  let text = '';
54139
54403
 
54140
54404
  switch (type) {
@@ -54171,6 +54435,256 @@ class inputFoundation_InputFoundation extends foundation {
54171
54435
  return text;
54172
54436
  }
54173
54437
 
54438
+ handleInsetInputChange(options) {
54439
+ const {
54440
+ value,
54441
+ valuePath,
54442
+ insetInputValue
54443
+ } = options;
54444
+
54445
+ const {
54446
+ format,
54447
+ type
54448
+ } = this._adapter.getProps();
54449
+
54450
+ const insetFormatToken = getInsetInputFormatToken({
54451
+ type,
54452
+ format
54453
+ });
54454
+
54455
+ const newInsetInputValue = lodash_set_default()(cloneDeep_default()(insetInputValue), valuePath, value);
54456
+
54457
+ const newInputValue = this.concatInsetInputValue({
54458
+ insetInputValue: newInsetInputValue
54459
+ });
54460
+
54461
+ this._adapter.notifyInsetInputChange({
54462
+ insetInputValue: newInsetInputValue,
54463
+ format: insetFormatToken,
54464
+ insetInputStr: newInputValue
54465
+ });
54466
+ }
54467
+ /**
54468
+ * 只有传入的 format 符合 formatReg 时,才会使用用户传入的 format
54469
+ * 否则会使用默认的 format 作为 placeholder
54470
+ *
54471
+ * The format passed in by the user will be used only if the incoming format conforms to formatReg
54472
+ * Otherwise the default format will be used as placeholder
54473
+ */
54474
+
54475
+
54476
+ getInsetInputPlaceholder() {
54477
+ const {
54478
+ type,
54479
+ format
54480
+ } = this._adapter.getProps();
54481
+
54482
+ const insetInputFormat = getInsetInputFormatToken({
54483
+ type,
54484
+ format
54485
+ });
54486
+ let datePlaceholder, timePlaceholder;
54487
+
54488
+ switch (type) {
54489
+ case 'date':
54490
+ case 'month':
54491
+ case 'dateRange':
54492
+ datePlaceholder = insetInputFormat;
54493
+ break;
54494
+
54495
+ case 'dateTime':
54496
+ case 'dateTimeRange':
54497
+ [datePlaceholder, timePlaceholder] = insetInputFormat.split(' ');
54498
+ break;
54499
+ }
54500
+
54501
+ return {
54502
+ datePlaceholder,
54503
+ timePlaceholder
54504
+ };
54505
+ }
54506
+ /**
54507
+ * 从当前日期值或 inputValue 中解析出 insetInputValue
54508
+ *
54509
+ * Parse out insetInputValue from current date value or inputValue
54510
+ */
54511
+
54512
+
54513
+ getInsetInputValue(_ref) {
54514
+ let {
54515
+ value,
54516
+ insetInputValue
54517
+ } = _ref;
54518
+
54519
+ const {
54520
+ type,
54521
+ rangeSeparator,
54522
+ format
54523
+ } = this._adapter.getProps();
54524
+
54525
+ let inputValueStr = '';
54526
+
54527
+ if (isObject_default()(insetInputValue)) {
54528
+ inputValueStr = this.concatInsetInputValue({
54529
+ insetInputValue
54530
+ });
54531
+ } else {
54532
+ const insetInputFormat = getInsetInputFormatToken({
54533
+ format,
54534
+ type
54535
+ });
54536
+ inputValueStr = this.formatShowText(value, insetInputFormat);
54537
+ }
54538
+
54539
+ const newInsetInputValue = getInsetInputValueFromInsetInputStr({
54540
+ inputValue: inputValueStr,
54541
+ type,
54542
+ rangeSeparator
54543
+ });
54544
+ return newInsetInputValue;
54545
+ }
54546
+
54547
+ concatInsetDateAndTime(_ref2) {
54548
+ var _context;
54549
+
54550
+ let {
54551
+ date,
54552
+ time
54553
+ } = _ref2;
54554
+ return concat_default()(_context = "".concat(date, " ")).call(_context, time);
54555
+ }
54556
+
54557
+ concatInsetDateRange(_ref3) {
54558
+ var _context2, _context3;
54559
+
54560
+ let {
54561
+ rangeStart,
54562
+ rangeEnd
54563
+ } = _ref3;
54564
+
54565
+ const {
54566
+ rangeSeparator
54567
+ } = this._adapter.getProps();
54568
+
54569
+ return concat_default()(_context2 = concat_default()(_context3 = "".concat(rangeStart)).call(_context3, rangeSeparator)).call(_context2, rangeEnd);
54570
+ }
54571
+
54572
+ concatInsetInputValue(_ref4) {
54573
+ let {
54574
+ insetInputValue
54575
+ } = _ref4;
54576
+
54577
+ const {
54578
+ type
54579
+ } = this._adapter.getProps();
54580
+
54581
+ let inputValue = '';
54582
+
54583
+ switch (type) {
54584
+ case 'date':
54585
+ case 'month':
54586
+ inputValue = insetInputValue.monthLeft.dateInput;
54587
+ break;
54588
+
54589
+ case 'dateRange':
54590
+ inputValue = this.concatInsetDateRange({
54591
+ rangeStart: insetInputValue.monthLeft.dateInput,
54592
+ rangeEnd: insetInputValue.monthRight.dateInput
54593
+ });
54594
+ break;
54595
+
54596
+ case 'dateTime':
54597
+ inputValue = this.concatInsetDateAndTime({
54598
+ date: insetInputValue.monthLeft.dateInput,
54599
+ time: insetInputValue.monthLeft.timeInput
54600
+ });
54601
+ break;
54602
+
54603
+ case 'dateTimeRange':
54604
+ const rangeStart = this.concatInsetDateAndTime({
54605
+ date: insetInputValue.monthLeft.dateInput,
54606
+ time: insetInputValue.monthLeft.timeInput
54607
+ });
54608
+ const rangeEnd = this.concatInsetDateAndTime({
54609
+ date: insetInputValue.monthRight.dateInput,
54610
+ time: insetInputValue.monthRight.timeInput
54611
+ });
54612
+ inputValue = this.concatInsetDateRange({
54613
+ rangeStart,
54614
+ rangeEnd
54615
+ });
54616
+ break;
54617
+ }
54618
+
54619
+ return inputValue;
54620
+ }
54621
+
54622
+ }
54623
+ // CONCATENATED MODULE: ./datePicker/insetInput.tsx
54624
+
54625
+
54626
+
54627
+
54628
+ function InsetDateInput(props) {
54629
+ const {
54630
+ insetInputValue,
54631
+ valuePath,
54632
+ onFocus,
54633
+ onChange,
54634
+ placeholder,
54635
+ forwardRef
54636
+ } = props;
54637
+
54638
+ const value = get_default()(insetInputValue, valuePath);
54639
+
54640
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(input_0, {
54641
+ value: value,
54642
+ onChange: (value, event) => {
54643
+ onChange({
54644
+ value,
54645
+ event,
54646
+ insetInputValue,
54647
+ valuePath
54648
+ });
54649
+ },
54650
+ onFocus: onFocus,
54651
+ placeholder: placeholder,
54652
+ ref: forwardRef
54653
+ });
54654
+ }
54655
+ function InsetTimeInput(props) {
54656
+ const {
54657
+ insetInputValue,
54658
+ valuePath,
54659
+ type,
54660
+ onFocus,
54661
+ onChange,
54662
+ placeholder,
54663
+ disabled
54664
+ } = props;
54665
+
54666
+ const _isTimeType = includes_default()(type).call(type, 'Time');
54667
+
54668
+ if (!_isTimeType) {
54669
+ return null;
54670
+ }
54671
+
54672
+ const value = get_default()(insetInputValue, valuePath);
54673
+
54674
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(input_0, {
54675
+ value: value,
54676
+ onChange: (value, event) => {
54677
+ onChange({
54678
+ value,
54679
+ event,
54680
+ insetInputValue,
54681
+ valuePath
54682
+ });
54683
+ },
54684
+ onFocus: onFocus,
54685
+ placeholder: placeholder,
54686
+ disabled: disabled
54687
+ });
54174
54688
  }
54175
54689
  // CONCATENATED MODULE: ./datePicker/dateInput.tsx
54176
54690
 
@@ -54190,7 +54704,9 @@ var dateInput_rest = undefined && undefined.__rest || function (s, e) {
54190
54704
  }
54191
54705
  return t;
54192
54706
  };
54193
- /* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/interactive-supports-focus */
54707
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
54708
+
54709
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
54194
54710
 
54195
54711
  /* eslint-disable max-lines-per-function */
54196
54712
 
@@ -54206,6 +54722,7 @@ var dateInput_rest = undefined && undefined.__rest || function (s, e) {
54206
54722
 
54207
54723
 
54208
54724
 
54725
+
54209
54726
  // eslint-disable-next-line @typescript-eslint/ban-types
54210
54727
 
54211
54728
  class dateInput_DateInput extends baseComponent_BaseComponent {
@@ -54244,6 +54761,10 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
54244
54761
  this.handleRangeInputFocus(e, 'rangeStart');
54245
54762
  };
54246
54763
 
54764
+ this.handleInsetInputChange = options => {
54765
+ this.foundation.handleInsetInputChange(options);
54766
+ };
54767
+
54247
54768
  this.getRangeInputValue = (rangeStart, rangeEnd) => {
54248
54769
  var _context, _context2;
54249
54770
 
@@ -54292,7 +54813,8 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
54292
54813
  },
54293
54814
  notifyTabPress: function () {
54294
54815
  return _this.props.onRangeEndTabPress(...arguments);
54295
- }
54816
+ },
54817
+ notifyInsetInputChange: options => this.props.onInsetInputChange(options)
54296
54818
  });
54297
54819
  }
54298
54820
 
@@ -54397,11 +54919,11 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
54397
54919
  const rangePlaceholder = is_array_default()(placeholder) ? placeholder : [placeholder, placeholder];
54398
54920
  const [rangeStartPlaceholder, rangeEndPlaceholder] = rangePlaceholder;
54399
54921
  const inputLeftWrapperCls = classnames_default()("".concat(prefixCls, "-range-input-wrapper-start"), "".concat(prefixCls, "-range-input-wrapper"), {
54400
- ["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeStart',
54922
+ ["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeStart' && !disabled,
54401
54923
  ["".concat(prefixCls, "-range-input-wrapper-start-with-prefix")]: this.props.prefix || this.props.insetLabel
54402
54924
  });
54403
54925
  const inputRightWrapperCls = classnames_default()("".concat(prefixCls, "-range-input-wrapper-end"), "".concat(prefixCls, "-range-input-wrapper"), {
54404
- ["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeEnd'
54926
+ ["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeEnd' && !disabled
54405
54927
  });
54406
54928
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, this.renderRangePrefix(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
54407
54929
  onClick: e => !disabled && this.handleRangeInputFocus(e, 'rangeStart'),
@@ -54440,7 +54962,70 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
54440
54962
  })), this.renderRangeClearBtn(rangeStart, rangeEnd), this.renderRangeSuffix(suffix));
54441
54963
  }
54442
54964
 
54443
- render() {
54965
+ renderInputInset() {
54966
+ const {
54967
+ type,
54968
+ handleInsetDateFocus,
54969
+ handleInsetTimeFocus,
54970
+ value,
54971
+ insetInputValue,
54972
+ prefixCls,
54973
+ rangeInputStartRef,
54974
+ rangeInputEndRef,
54975
+ density
54976
+ } = this.props;
54977
+
54978
+ const _isRangeType = includes_default()(type).call(type, 'Range');
54979
+
54980
+ const newInsetInputValue = this.foundation.getInsetInputValue({
54981
+ value,
54982
+ insetInputValue
54983
+ });
54984
+ const {
54985
+ datePlaceholder,
54986
+ timePlaceholder
54987
+ } = this.foundation.getInsetInputPlaceholder();
54988
+ const insetInputWrapperCls = "".concat(prefixCls, "-inset-input-wrapper");
54989
+ const separatorCls = "".concat(prefixCls, "-inset-input-separator");
54990
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
54991
+ className: insetInputWrapperCls,
54992
+ "x-type": type
54993
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(InsetDateInput, {
54994
+ forwardRef: rangeInputStartRef,
54995
+ insetInputValue: newInsetInputValue,
54996
+ placeholder: datePlaceholder,
54997
+ valuePath: 'monthLeft.dateInput',
54998
+ onChange: this.handleInsetInputChange,
54999
+ onFocus: e => handleInsetDateFocus(e, 'rangeStart')
55000
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(InsetTimeInput, {
55001
+ disabled: !newInsetInputValue.monthLeft.dateInput,
55002
+ insetInputValue: newInsetInputValue,
55003
+ placeholder: timePlaceholder,
55004
+ type: type,
55005
+ valuePath: 'monthLeft.timeInput',
55006
+ onChange: this.handleInsetInputChange,
55007
+ onFocus: handleInsetTimeFocus
55008
+ }), _isRangeType && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
55009
+ className: separatorCls
55010
+ }, density === 'compact' ? null : '-'), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(InsetDateInput, {
55011
+ forwardRef: rangeInputEndRef,
55012
+ insetInputValue: newInsetInputValue,
55013
+ placeholder: datePlaceholder,
55014
+ valuePath: 'monthRight.dateInput',
55015
+ onChange: this.handleInsetInputChange,
55016
+ onFocus: e => handleInsetDateFocus(e, 'rangeEnd')
55017
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(InsetTimeInput, {
55018
+ disabled: !newInsetInputValue.monthRight.dateInput,
55019
+ insetInputValue: newInsetInputValue,
55020
+ placeholder: timePlaceholder,
55021
+ type: type,
55022
+ valuePath: 'monthRight.timeInput',
55023
+ onChange: this.handleInsetInputChange,
55024
+ onFocus: handleInsetTimeFocus
55025
+ })));
55026
+ }
55027
+
55028
+ renderTriggerInput() {
54444
55029
  const _a = this.props,
54445
55030
  {
54446
55031
  placeholder,
@@ -54472,9 +55057,11 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
54472
55057
  onRangeBlur,
54473
55058
  onRangeEndTabPress,
54474
55059
  rangeInputFocus,
54475
- rangeSeparator
55060
+ rangeSeparator,
55061
+ insetInput,
55062
+ insetInputValue
54476
55063
  } = _a,
54477
- rest = dateInput_rest(_a, ["placeholder", "type", "value", "inputValue", "inputStyle", "disabled", "showClear", "inputReadOnly", "insetLabel", "validateStatus", "block", "prefixCls", "multiple", "dateFnsLocale", "onBlur", "onClear", "onFocus", "prefix", "autofocus", "size", "rangeInputStartRef", "rangeInputEndRef", "onRangeClear", "onRangeBlur", "onRangeEndTabPress", "rangeInputFocus", "rangeSeparator"]);
55064
+ rest = dateInput_rest(_a, ["placeholder", "type", "value", "inputValue", "inputStyle", "disabled", "showClear", "inputReadOnly", "insetLabel", "validateStatus", "block", "prefixCls", "multiple", "dateFnsLocale", "onBlur", "onClear", "onFocus", "prefix", "autofocus", "size", "rangeInputStartRef", "rangeInputEndRef", "onRangeClear", "onRangeBlur", "onRangeEndTabPress", "rangeInputFocus", "rangeSeparator", "insetInput", "insetInputValue"]);
54478
55065
 
54479
55066
  const dateIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCalendar, {
54480
55067
  "aria-hidden": true
@@ -54525,6 +55112,13 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
54525
55112
  }));
54526
55113
  }
54527
55114
 
55115
+ render() {
55116
+ const {
55117
+ insetInput
55118
+ } = this.props;
55119
+ return insetInput ? this.renderInputInset() : this.renderTriggerInput();
55120
+ }
55121
+
54528
55122
  }
54529
55123
  dateInput_DateInput.propTypes = {
54530
55124
  onClick: prop_types_default.a.func,
@@ -54549,7 +55143,9 @@ dateInput_DateInput.propTypes = {
54549
55143
  rangeInputFocus: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.bool]),
54550
55144
  rangeInputStartRef: prop_types_default.a.object,
54551
55145
  rangeInputEndRef: prop_types_default.a.object,
54552
- rangeSeparator: prop_types_default.a.string
55146
+ rangeSeparator: prop_types_default.a.string,
55147
+ insetInput: prop_types_default.a.bool,
55148
+ insetInputValue: prop_types_default.a.object
54553
55149
  };
54554
55150
  dateInput_DateInput.defaultProps = {
54555
55151
  showClear: true,
@@ -55237,7 +55833,8 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
55237
55833
  let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
55238
55834
  const monthLeft = this.getState('monthLeft');
55239
55835
 
55240
- const newMonthLeft = assign_default()({}, monthLeft);
55836
+ const newMonthLeft = assign_default()({}, monthLeft); // REMOVE:
55837
+
55241
55838
 
55242
55839
  this._adapter.updateMonthOnLeft(newMonthLeft);
55243
55840
 
@@ -55254,6 +55851,7 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
55254
55851
  if (refreshPicker) {
55255
55852
  this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
55256
55853
  } else {
55854
+ // FIXME:
55257
55855
  this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, newMonthLeft.pickerDate);
55258
55856
  }
55259
55857
 
@@ -55655,7 +56253,7 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
55655
56253
  selected: selectedSet,
55656
56254
  rangeStart,
55657
56255
  rangeEnd
55658
- } = this.getStates();
56256
+ } = this.getStates(); // FIXME:
55659
56257
 
55660
56258
  const includeRange = includes_default()(_context3 = ['dateRange', 'dateTimeRange']).call(_context3, type);
55661
56259
 
@@ -58870,6 +59468,8 @@ yearAndMonth_YearAndMonth.defaultProps = {
58870
59468
 
58871
59469
  /* eslint-disable jsx-a11y/interactive-supports-focus,jsx-a11y/click-events-have-key-events */
58872
59470
 
59471
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
59472
+
58873
59473
  /* eslint-disable react/no-did-update-set-state */
58874
59474
 
58875
59475
  /* eslint-disable max-len */
@@ -59145,6 +59745,9 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59145
59745
  monthRight,
59146
59746
  currentPanelHeight
59147
59747
  } = this.state;
59748
+ const {
59749
+ insetInput
59750
+ } = this.props;
59148
59751
  const panelDetail = panelType === datePicker_constants_strings.PANEL_TYPE_RIGHT ? monthRight : monthLeft;
59149
59752
  const {
59150
59753
  isTimePickerOpen,
@@ -59167,7 +59770,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59167
59770
  style.minWidth = wrap.getBoundingClientRect().width;
59168
59771
  }
59169
59772
 
59170
- if (this.leftIsYearOrTime() && this.rightIsYearOrTime()) {
59773
+ if (this.leftIsYearOrTime() && this.rightIsYearOrTime() && !insetInput) {
59171
59774
  /**
59172
59775
  * left和right同时为tpk时,panel会有一个minHeight
59173
59776
  * 如果缓存的currentPanelHeight为0,则需要计算滚动列表的高度
@@ -59177,7 +59780,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59177
59780
  * When left and right are tpk at the same time, the panel will have a minHeight
59178
59781
  * If the cached currentPanelHeight is 0, you need to calculate the height of the scrolling list
59179
59782
  * If there is a cached value, use currentPanelHeight (if this height is less than the actual value, it will affect the number of cycles in the ScrollList to render the list)
59180
- * See packages/semi-foundation/scrollList/itemF oundation.js initWheelList function
59783
+ * See packages/semi-foundation/scrollList/itemFoundation.js initWheelList function
59181
59784
  */
59182
59785
  style.minHeight = currentPanelHeight ? currentPanelHeight : this.calcScrollListHeight();
59183
59786
  }
@@ -59185,10 +59788,14 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59185
59788
  monthCls = classnames_default()(monthCls, "".concat(monthsGrid_prefixCls, "-yam-showing"));
59186
59789
  }
59187
59790
 
59791
+ const _isDatePanelOpen = !(isYearPickerOpen || isTimePickerOpen);
59792
+
59793
+ const xOpenType = _isDatePanelOpen ? 'date' : isYearPickerOpen ? 'year' : 'time';
59188
59794
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
59189
59795
  className: monthCls,
59190
59796
  key: panelType,
59191
- style: style
59797
+ style: style,
59798
+ "x-open-type": xOpenType
59192
59799
  }, yearAndMonthLayer, timePickerLayer, this.foundation.isRangeType() ? panelContent : isYearPickerOpen || isTimePickerOpen ? null : panelContent, this.renderSwitch(panelType));
59193
59800
  }
59194
59801
 
@@ -59399,10 +60006,11 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59399
60006
  locale,
59400
60007
  disabledTimePicker,
59401
60008
  density,
59402
- dateFnsLocale
59403
- } = this.props; // Type: date, dateRange, year, month, no rendering required
60009
+ dateFnsLocale,
60010
+ insetInput
60011
+ } = this.props; // Type: date, dateRange, year, month, inset input no rendering required
59404
60012
 
59405
- if (!includes_default()(type).call(type, 'Time')) {
60013
+ if (!includes_default()(type).call(type, 'Time') || insetInput) {
59406
60014
  return null;
59407
60015
  } // switch year/month & time
59408
60016
 
@@ -59475,7 +60083,8 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59475
60083
  monthRight
59476
60084
  } = this.state;
59477
60085
  const {
59478
- type
60086
+ type,
60087
+ insetInput
59479
60088
  } = this.props;
59480
60089
  const monthGridCls = classnames_default()({
59481
60090
  ["".concat(monthsGrid_prefixCls, "-month-grid")]: true
@@ -59497,6 +60106,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59497
60106
  className: monthGridCls,
59498
60107
  "x-type": type,
59499
60108
  "x-panel-yearandmonth-open-type": yearOpenType,
60109
+ "x-insetInput": insetInput ? "true" : "false",
59500
60110
  ref: current => this.cacheRefCurrent('monthGrid', current)
59501
60111
  }, content);
59502
60112
  }
@@ -59648,10 +60258,15 @@ var datePicker = __webpack_require__("IJ0B");
59648
60258
 
59649
60259
 
59650
60260
 
60261
+
59651
60262
  /* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/interactive-supports-focus */
59652
60263
 
59653
60264
  /* eslint-disable max-len */
59654
60265
 
60266
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
60267
+
60268
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
60269
+
59655
60270
 
59656
60271
 
59657
60272
 
@@ -59704,6 +60319,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
59704
60319
  return _this.foundation.handleInputChange(...arguments);
59705
60320
  };
59706
60321
 
60322
+ this.handleInsetInputChange = options => this.foundation.handleInsetInputChange(options);
60323
+
59707
60324
  this.handleInputComplete = v => this.foundation.handleInputComplete(v);
59708
60325
 
59709
60326
  this.handleInputBlur = e => this.foundation.handleInputBlur(get_default()(e, 'nativeEvent.target.value'), e);
@@ -59732,6 +60349,30 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
59732
60349
  }
59733
60350
  };
59734
60351
 
60352
+ this.handleInsetDateFocus = (e, rangeType) => {
60353
+ const monthGridFoundation = get_default()(this, 'monthGrid.current.foundation');
60354
+
60355
+ if (monthGridFoundation) {
60356
+ monthGridFoundation.showDatePanel(datePicker_constants_strings.PANEL_TYPE_LEFT);
60357
+ monthGridFoundation.showDatePanel(datePicker_constants_strings.PANEL_TYPE_RIGHT);
60358
+ }
60359
+
60360
+ this.handleInputFocus(e, rangeType);
60361
+ };
60362
+
60363
+ this.handleInsetTimeFocus = () => {
60364
+ const monthGridFoundation = get_default()(this, 'monthGrid.current.foundation');
60365
+
60366
+ if (monthGridFoundation) {
60367
+ monthGridFoundation.showTimePicker(datePicker_constants_strings.PANEL_TYPE_LEFT);
60368
+ monthGridFoundation.showTimePicker(datePicker_constants_strings.PANEL_TYPE_RIGHT);
60369
+ }
60370
+ };
60371
+
60372
+ this.handlePanelVisibleChange = visible => {
60373
+ this.foundation.handlePanelVisibleChange(visible);
60374
+ };
60375
+
59735
60376
  this.handleConfirm = e => this.foundation.handleConfirm();
59736
60377
 
59737
60378
  this.handleCancel = e => this.foundation.handleCancel();
@@ -59755,19 +60396,43 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
59755
60396
  dropdownStyle,
59756
60397
  density,
59757
60398
  topSlot,
59758
- bottomSlot
60399
+ bottomSlot,
60400
+ insetInput,
60401
+ type,
60402
+ format,
60403
+ rangeSeparator
59759
60404
  } = this.props;
60405
+ const {
60406
+ insetInputValue,
60407
+ value
60408
+ } = this.state;
59760
60409
  const wrapCls = classnames_default()(datePicker_constants_cssClasses.PREFIX, {
59761
60410
  [datePicker_constants_cssClasses.PANEL_YAM]: this.adapter.typeIsYearOrMonth(),
59762
60411
  ["".concat(datePicker_constants_cssClasses.PREFIX, "-compact")]: density === 'compact'
59763
60412
  }, dropdownClassName);
60413
+ const insetInputProps = {
60414
+ dateFnsLocale,
60415
+ format,
60416
+ insetInputValue,
60417
+ rangeSeparator,
60418
+ type,
60419
+ value: value,
60420
+ handleInsetDateFocus: this.handleInsetDateFocus,
60421
+ handleInsetTimeFocus: this.handleInsetTimeFocus,
60422
+ onInsetInputChange: this.handleInsetInputChange,
60423
+ rangeInputStartRef: this.rangeInputStartRef,
60424
+ rangeInputEndRef: this.rangeInputEndRef,
60425
+ density
60426
+ };
59764
60427
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
59765
60428
  ref: this.panelRef,
59766
60429
  className: wrapCls,
59767
60430
  style: dropdownStyle
59768
60431
  }, topSlot && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
59769
60432
  className: "".concat(datePicker_constants_cssClasses.PREFIX, "-topSlot")
59770
- }, topSlot), this.adapter.typeIsYearOrMonth() ? this.renderYearMonthPanel(locale, localeCode) : this.renderMonthGrid(locale, localeCode, dateFnsLocale), this.renderQuickControls(), bottomSlot && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
60433
+ }, topSlot), insetInput && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(dateInput_DateInput, assign_default()({}, insetInputProps, {
60434
+ insetInput: true
60435
+ })), this.adapter.typeIsYearOrMonth() ? this.renderYearMonthPanel(locale, localeCode) : this.renderMonthGrid(locale, localeCode, dateFnsLocale), this.renderQuickControls(), bottomSlot && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
59771
60436
  className: "".concat(datePicker_constants_cssClasses.PREFIX, "-bottomSlot")
59772
60437
  }, bottomSlot), this.renderFooter(locale, localeCode));
59773
60438
  };
@@ -59831,7 +60496,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
59831
60496
  position: position,
59832
60497
  visible: panelShow,
59833
60498
  stopPropagation: stopPropagation,
59834
- spacing: spacing
60499
+ spacing: spacing,
60500
+ onVisibleChange: this.handlePanelVisibleChange
59835
60501
  }, children);
59836
60502
  };
59837
60503
 
@@ -59844,7 +60510,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
59844
60510
  prevTimeZone: null,
59845
60511
  motionEnd: false,
59846
60512
  rangeInputFocus: undefined,
59847
- autofocus: props.autoFocus || this.isRangeType(props.type, props.triggerRender) && (props.open || props.defaultOpen)
60513
+ autofocus: props.autoFocus || this.isRangeType(props.type, props.triggerRender) && (props.open || props.defaultOpen),
60514
+ insetInputValue: null,
60515
+ triggerDisabled: undefined
59848
60516
  };
59849
60517
  this.adapter.setCache('cachedSelectedValue', null);
59850
60518
  this.triggerElRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
@@ -59947,6 +60615,17 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
59947
60615
  inputValue
59948
60616
  });
59949
60617
  },
60618
+ updateInsetInputValue: insetInputValue => {
60619
+ const {
60620
+ insetInput
60621
+ } = this.props;
60622
+
60623
+ if (insetInput && !isEqual_default()(insetInputValue, this.state.insetInputValue)) {
60624
+ this.setState({
60625
+ insetInputValue
60626
+ });
60627
+ }
60628
+ },
59950
60629
  needConfirm: () => {
59951
60630
  var _context;
59952
60631
 
@@ -60021,7 +60700,38 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
60021
60700
  }
60022
60701
  },
60023
60702
  couldPanelClosed: () => this.focusRecordsRef.current.rangeStart && this.focusRecordsRef.current.rangeEnd,
60024
- isEventTarget: e => e && e.target === e.currentTarget
60703
+ isEventTarget: e => e && e.target === e.currentTarget,
60704
+ setInsetInputFocus: () => {
60705
+ const {
60706
+ rangeInputFocus
60707
+ } = this.state;
60708
+
60709
+ switch (rangeInputFocus) {
60710
+ case 'rangeEnd':
60711
+ if (document.activeElement !== this.rangeInputEndRef.current) {
60712
+ const inputEndNode = get_default()(this, 'rangeInputEndRef.current');
60713
+
60714
+ inputEndNode && inputEndNode.focus();
60715
+ }
60716
+
60717
+ break;
60718
+
60719
+ case 'rangeStart':
60720
+ default:
60721
+ if (document.activeElement !== this.rangeInputStartRef.current) {
60722
+ const inputStartNode = get_default()(this, 'rangeInputStartRef.current');
60723
+
60724
+ inputStartNode && inputStartNode.focus();
60725
+ }
60726
+
60727
+ break;
60728
+ }
60729
+ },
60730
+ setTriggerDisabled: disabled => {
60731
+ this.setState({
60732
+ triggerDisabled: disabled
60733
+ });
60734
+ }
60025
60735
  });
60026
60736
  }
60027
60737
 
@@ -60079,7 +60789,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
60079
60789
  syncSwitchMonth,
60080
60790
  onPanelChange,
60081
60791
  timeZone,
60082
- triggerRender
60792
+ triggerRender,
60793
+ insetInput
60083
60794
  } = this.props;
60084
60795
  const {
60085
60796
  value,
@@ -60127,7 +60838,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
60127
60838
  onPanelChange: onPanelChange,
60128
60839
  timeZone: timeZone,
60129
60840
  focusRecordsRef: this.focusRecordsRef,
60130
- triggerRender: triggerRender
60841
+ triggerRender: triggerRender,
60842
+ insetInput: insetInput
60131
60843
  });
60132
60844
  }
60133
60845
 
@@ -60163,20 +60875,23 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
60163
60875
  triggerRender,
60164
60876
  size,
60165
60877
  inputReadOnly,
60166
- rangeSeparator
60878
+ rangeSeparator,
60879
+ insetInput
60167
60880
  } = this.props;
60168
60881
  const {
60169
60882
  value,
60170
60883
  inputValue,
60171
- rangeInputFocus
60884
+ rangeInputFocus,
60885
+ triggerDisabled
60172
60886
  } = this.state; // This class is not needed when triggerRender is function
60173
60887
 
60174
60888
  const isRangeType = this.isRangeType(type, triggerRender);
60889
+ const inputDisabled = disabled || insetInput && triggerDisabled;
60175
60890
  const inputCls = classnames_default()("".concat(datePicker_constants_cssClasses.PREFIX, "-input"), {
60176
60891
  ["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input")]: isRangeType,
60177
60892
  [concat_default()(_context3 = "".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-")).call(_context3, size)]: isRangeType && size,
60178
- ["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-active")]: isRangeType && rangeInputFocus && !disabled,
60179
- ["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-disabled")]: isRangeType && disabled,
60893
+ ["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-active")]: isRangeType && rangeInputFocus && !inputDisabled,
60894
+ ["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-disabled")]: isRangeType && inputDisabled,
60180
60895
  [concat_default()(_context4 = "".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-")).call(_context4, validateStatus)]: isRangeType && validateStatus
60181
60896
  });
60182
60897
  const phText = placeholder || locale.placeholder[type]; // i18n
@@ -60184,9 +60899,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
60184
60899
 
60185
60900
  const props = assign_default()(assign_default()({}, extraProps), {
60186
60901
  placeholder: phText,
60187
- disabled,
60902
+ disabled: inputDisabled,
60188
60903
  inputValue,
60189
- value,
60904
+ value: value,
60190
60905
  onChange: this.handleInputChange,
60191
60906
  onEnterPress: this.handleInputComplete,
60192
60907
  // TODO: remove in next major version
@@ -60199,7 +60914,7 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
60199
60914
  format,
60200
60915
  multiple,
60201
60916
  validateStatus,
60202
- inputReadOnly,
60917
+ inputReadOnly: inputReadOnly || insetInput,
60203
60918
  // onClick: this.handleOpenPanel,
60204
60919
  onBlur: this.handleInputBlur,
60205
60920
  onFocus: this.handleInputFocus,
@@ -60208,13 +60923,13 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
60208
60923
  size,
60209
60924
  autofocus: this.state.autofocus,
60210
60925
  dateFnsLocale,
60211
- rangeInputStartRef: this.rangeInputStartRef,
60212
- rangeInputEndRef: this.rangeInputEndRef,
60213
60926
  rangeInputFocus,
60214
60927
  rangeSeparator,
60215
60928
  onRangeBlur: this.handleRangeInputBlur,
60216
60929
  onRangeClear: this.handleRangeInputClear,
60217
- onRangeEndTabPress: this.handleRangeEndTabPress
60930
+ onRangeEndTabPress: this.handleRangeEndTabPress,
60931
+ rangeInputStartRef: insetInput ? null : this.rangeInputStartRef,
60932
+ rangeInputEndRef: insetInput ? null : this.rangeInputEndRef
60218
60933
  });
60219
60934
 
60220
60935
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
@@ -60362,7 +61077,8 @@ datePicker_DatePicker.defaultProps = {
60362
61077
  spacing: datePicker_constants_numbers.SPACING,
60363
61078
  autoSwitchDate: true,
60364
61079
  syncSwitchMonth: false,
60365
- rangeSeparator: datePicker_constants_strings.DEFAULT_SEPARATOR_RANGE
61080
+ rangeSeparator: datePicker_constants_strings.DEFAULT_SEPARATOR_RANGE,
61081
+ insetInput: false
60366
61082
  };
60367
61083
  // CONCATENATED MODULE: ./datePicker/index.tsx
60368
61084
 
@@ -60378,6 +61094,8 @@ datePicker_DatePicker.defaultProps = {
60378
61094
 
60379
61095
 
60380
61096
 
61097
+
61098
+
60381
61099
  /* harmony default export */ var datePicker_0 = (forwardStatics( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.forwardRef((props, ref) => {
60382
61100
  const propsObj = assign_default()({}, props);
60383
61101
 
@@ -60402,6 +61120,24 @@ datePicker_DatePicker.defaultProps = {
60402
61120
  propsObj.rangeSeparator = " ".concat(trim_default()(rangeSeparator).call(rangeSeparator), " ");
60403
61121
  }
60404
61122
 
61123
+ if (propsObj.insetInput) {
61124
+ var _context;
61125
+
61126
+ if (!propsObj.position) {
61127
+ propsObj.position = datePicker_constants_strings.POSITION_INLINE_INPUT;
61128
+ }
61129
+ /**
61130
+ * When insetInput is `true` and `position` includes `over`, use 1px `spacing` to solve the problem of border-radius leakage in the upper left corner
61131
+ *
61132
+ * @see https://user-images.githubusercontent.com/26477537/158817185-126a5f33-41f7-414a-8e36-8d1be2dda5cd.png
61133
+ */
61134
+
61135
+
61136
+ if (includes_default()(_context = propsObj.position).call(_context, 'Over') && !propsObj.spacing) {
61137
+ propsObj.spacing = datePicker_constants_numbers.SPACING_INSET_INPUT;
61138
+ }
61139
+ }
61140
+
60405
61141
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(configProvider_context.Consumer, null, _ref => {
60406
61142
  let {
60407
61143
  timeZone
@@ -92371,12 +93107,13 @@ class nodeList_NodeList extends external_root_React_commonjs2_react_commonjs_rea
92371
93107
  const {
92372
93108
  flattenNodes,
92373
93109
  motionType,
93110
+ searchTargetIsDeep,
92374
93111
  renderTreeNode
92375
93112
  } = this.props;
92376
93113
  const {
92377
93114
  transitionNodes
92378
93115
  } = this.state;
92379
- const mapData = transitionNodes.length ? transitionNodes : flattenNodes;
93116
+ const mapData = transitionNodes.length && !searchTargetIsDeep ? transitionNodes : flattenNodes;
92380
93117
 
92381
93118
  const options = map_default()(mapData).call(mapData, treeNode => {
92382
93119
  const isMotionNode = is_array_default()(treeNode);
@@ -92626,7 +93363,8 @@ class tree_Tree extends baseComponent_BaseComponent {
92626
93363
  const isSeaching = Boolean(props.filterTreeNode && prevState.inputValue && prevState.inputValue.length);
92627
93364
  const newState = {
92628
93365
  prevProps: props
92629
- }; // Accept a props field as a parameter to determine whether to update the field
93366
+ };
93367
+ const isExpandControlled = ('expandedKeys' in props); // Accept a props field as a parameter to determine whether to update the field
92630
93368
 
92631
93369
  const needUpdate = name => {
92632
93370
  const firstInProps = !prevProps && name in props;
@@ -92670,7 +93408,8 @@ class tree_Tree extends baseComponent_BaseComponent {
92670
93408
  }
92671
93409
  }
92672
93410
 
92673
- const expandAllWhenDataChange = (needUpdate('treeDataSimpleJson') || needUpdate('treeData')) && props.expandAll;
93411
+ const dataUpdated = needUpdate('treeDataSimpleJson') || needUpdate('treeData');
93412
+ const expandAllWhenDataChange = dataUpdated && props.expandAll;
92674
93413
 
92675
93414
  if (!isSeaching) {
92676
93415
  // Update expandedKeys
@@ -92696,7 +93435,7 @@ class tree_Tree extends baseComponent_BaseComponent {
92696
93435
  newState.expandedKeys = calcExpandedKeys(props.defaultExpandedKeys, keyEntities);
92697
93436
  } else if (!prevProps && props.defaultValue) {
92698
93437
  newState.expandedKeys = calcExpandedKeysForValues(props.defaultValue, keyEntities, props.multiple, valueEntities);
92699
- } else if (!prevProps && props.value) {
93438
+ } else if ((!prevProps || !isExpandControlled && dataUpdated) && props.value) {
92700
93439
  newState.expandedKeys = calcExpandedKeysForValues(props.value, keyEntities, props.multiple, valueEntities);
92701
93440
  }
92702
93441
 
@@ -93198,6 +93937,7 @@ const treeSelect_constants_numbers = {};
93198
93937
 
93199
93938
 
93200
93939
 
93940
+
93201
93941
 
93202
93942
 
93203
93943
  // eslint-disable-next-line max-len
@@ -93340,7 +94080,7 @@ class foundation_TreeSelectFoundation extends foundation {
93340
94080
  const isSearching = Boolean(inputValue);
93341
94081
  const treeNodeProps = {
93342
94082
  eventKey: key,
93343
- expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
94083
+ expanded: isSearching && !this._isExpandControlled() ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
93344
94084
  selected: includes_default()(selectedKeys).call(selectedKeys, key),
93345
94085
  checked: realChecked,
93346
94086
  halfChecked: realHalfChecked,
@@ -93627,20 +94367,25 @@ class foundation_TreeSelectFoundation extends foundation {
93627
94367
 
93628
94368
  clearInput() {
93629
94369
  const {
94370
+ flattenNodes,
93630
94371
  expandedKeys,
93631
94372
  selectedKeys,
93632
94373
  keyEntities,
93633
94374
  treeData
93634
94375
  } = this.getStates();
94376
+ const newExpandedKeys = new set_default.a(expandedKeys);
94377
+
94378
+ const isExpandControlled = this._isExpandControlled();
94379
+
93635
94380
  const expandedOptsKeys = findAncestorKeys(selectedKeys, keyEntities);
93636
94381
 
93637
- for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item => expandedKeys.add(item));
94382
+ for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item => newExpandedKeys.add(item));
93638
94383
 
93639
- const flattenNodes = flattenTreeData(treeData, expandedKeys);
94384
+ const newFlattenNodes = flattenTreeData(treeData, newExpandedKeys);
93640
94385
 
93641
94386
  this._adapter.updateState({
93642
- expandedKeys,
93643
- flattenNodes,
94387
+ expandedKeys: isExpandControlled ? expandedKeys : newExpandedKeys,
94388
+ flattenNodes: isExpandControlled ? flattenNodes : newFlattenNodes,
93644
94389
  inputValue: '',
93645
94390
  motionKeys: new set_default.a([]),
93646
94391
  filteredKeys: new set_default.a([]),
@@ -93654,6 +94399,7 @@ class foundation_TreeSelectFoundation extends foundation {
93654
94399
  this._adapter.updateInputValue(sugInput);
93655
94400
 
93656
94401
  const {
94402
+ flattenNodes,
93657
94403
  expandedKeys,
93658
94404
  selectedKeys,
93659
94405
  keyEntities,
@@ -93664,17 +94410,18 @@ class foundation_TreeSelectFoundation extends foundation {
93664
94410
  filterTreeNode,
93665
94411
  treeNodeFilterProp
93666
94412
  } = this.getProps();
94413
+ const newExpandedKeys = new set_default.a(expandedKeys);
93667
94414
  let filteredOptsKeys = [];
93668
94415
  let expandedOptsKeys = [];
93669
- let flattenNodes = [];
94416
+ let newFlattenNodes = [];
93670
94417
  let filteredShownKeys = new set_default.a([]);
93671
94418
 
93672
94419
  if (!sugInput) {
93673
94420
  expandedOptsKeys = findAncestorKeys(selectedKeys, keyEntities);
93674
94421
 
93675
- for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item => expandedKeys.add(item));
94422
+ for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item => newExpandedKeys.add(item));
93676
94423
 
93677
- flattenNodes = flattenTreeData(treeData, expandedKeys);
94424
+ newFlattenNodes = flattenTreeData(treeData, newExpandedKeys);
93678
94425
  } else {
93679
94426
  var _context3, _context4;
93680
94427
 
@@ -93687,17 +94434,19 @@ class foundation_TreeSelectFoundation extends foundation {
93687
94434
  expandedOptsKeys = findAncestorKeys(filteredOptsKeys, keyEntities, false);
93688
94435
  const shownChildKeys = findDescendantKeys(filteredOptsKeys, keyEntities, true);
93689
94436
  filteredShownKeys = new set_default.a([...shownChildKeys, ...expandedOptsKeys]);
93690
- flattenNodes = flattenTreeData(treeData, new set_default.a(expandedOptsKeys), showFilteredOnly && filteredShownKeys);
94437
+ newFlattenNodes = flattenTreeData(treeData, new set_default.a(expandedOptsKeys), showFilteredOnly && filteredShownKeys);
93691
94438
  }
93692
94439
 
93693
- this._adapter.notifySearch(sugInput);
94440
+ const newFilteredExpandedKeys = new set_default.a(expandedOptsKeys);
94441
+
94442
+ this._adapter.notifySearch(sugInput, from_default()(newFilteredExpandedKeys));
93694
94443
 
93695
94444
  this._adapter.updateState({
93696
- expandedKeys,
93697
- flattenNodes,
94445
+ expandedKeys: this._isExpandControlled() ? expandedKeys : newExpandedKeys,
94446
+ flattenNodes: this._isExpandControlled() ? flattenNodes : newFlattenNodes,
93698
94447
  motionKeys: new set_default.a([]),
93699
94448
  filteredKeys: new set_default.a(filteredOptsKeys),
93700
- filteredExpandedKeys: new set_default.a(expandedOptsKeys),
94449
+ filteredExpandedKeys: newFilteredExpandedKeys,
93701
94450
  filteredShownKeys
93702
94451
  });
93703
94452
  }
@@ -93941,7 +94690,9 @@ class foundation_TreeSelectFoundation extends foundation {
93941
94690
  return;
93942
94691
  }
93943
94692
 
93944
- if (isSearching) {
94693
+ const isExpandControlled = this._isExpandControlled();
94694
+
94695
+ if (isSearching && !isExpandControlled) {
93945
94696
  this.handleNodeExpandInSearch(e, treeNode);
93946
94697
  return;
93947
94698
  }
@@ -93969,7 +94720,7 @@ class foundation_TreeSelectFoundation extends foundation {
93969
94720
 
93970
94721
  this._adapter.cacheFlattenNodes(motionType === 'hide' && this._isAnimated());
93971
94722
 
93972
- if (!this._isExpandControlled()) {
94723
+ if (!isExpandControlled) {
93973
94724
  const flattenNodes = flattenTreeData(treeData, expandedKeys);
93974
94725
  const motionKeys = this._isAnimated() ? getMotionKeys(eventKey, expandedKeys, keyEntities) : [];
93975
94726
  const newState = {
@@ -94781,7 +95532,8 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
94781
95532
  const {
94782
95533
  flattenNodes,
94783
95534
  motionKeys,
94784
- motionType
95535
+ motionType,
95536
+ filteredKeys
94785
95537
  } = this.state;
94786
95538
  const {
94787
95539
  direction
@@ -94790,6 +95542,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
94790
95542
  virtualize,
94791
95543
  motionExpand
94792
95544
  } = this.props;
95545
+ const isExpandControlled = ('expandedKeys' in this.props);
94793
95546
 
94794
95547
  if (!virtualize || isEmpty_default()(virtualize)) {
94795
95548
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(nodeList_NodeList, {
@@ -94797,6 +95550,8 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
94797
95550
  flattenList: this._flattenNodes,
94798
95551
  motionKeys: motionExpand ? motionKeys : new set_default.a([]),
94799
95552
  motionType: motionType,
95553
+ // When motionKeys is empty, but filteredKeys is not empty (that is, the search hits), this situation should be distinguished from ordinary motionKeys
95554
+ searchTargetIsDeep: isExpandControlled && motionExpand && isEmpty_default()(motionKeys) && !isEmpty_default()(filteredKeys),
94800
95555
  onMotionEnd: this.onMotionEnd,
94801
95556
  renderTreeNode: this.renderTreeNode
94802
95557
  });
@@ -95116,8 +95871,8 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
95116
95871
  notifySelect: (selectKey, bool, node) => {
95117
95872
  this.props.onSelect && this.props.onSelect(selectKey, bool, node);
95118
95873
  },
95119
- notifySearch: input => {
95120
- this.props.onSearch && this.props.onSearch(input);
95874
+ notifySearch: (input, filteredExpandedKeys) => {
95875
+ this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys);
95121
95876
  },
95122
95877
  cacheFlattenNodes: bool => {
95123
95878
  this._flattenNodes = bool ? treeUtil_cloneDeep(this.state.flattenNodes) : null;