@douyinfe/semi-ui 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.
- package/button/__test__/button.test.js +7 -0
- package/button/buttonGroup.tsx +5 -2
- package/calendar/monthCalendar.tsx +14 -13
- package/cascader/__test__/cascader.test.js +159 -81
- package/cascader/_story/cascader.stories.js +36 -23
- package/cascader/index.tsx +47 -8
- package/cascader/item.tsx +25 -5
- package/datePicker/_story/v2/InsetInput.jsx +104 -0
- package/datePicker/_story/v2/InsetInputE2E.jsx +69 -0
- package/datePicker/_story/v2/index.js +2 -0
- package/datePicker/dateInput.tsx +102 -13
- package/datePicker/datePicker.tsx +95 -16
- package/datePicker/index.tsx +15 -0
- package/datePicker/insetInput.tsx +76 -0
- package/datePicker/month.tsx +14 -7
- package/datePicker/monthsGrid.tsx +31 -12
- package/datePicker/navigation.tsx +8 -4
- package/datePicker/quickControl.tsx +1 -0
- package/datePicker/yearAndMonth.tsx +1 -1
- package/dist/css/semi.css +120 -8
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +1100 -193
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/form/hoc/withField.tsx +1 -1
- package/input/_story/input.stories.js +13 -0
- package/lib/cjs/_base/base.css +5 -5
- package/lib/cjs/button/buttonGroup.d.ts +1 -0
- package/lib/cjs/button/buttonGroup.js +6 -2
- package/lib/cjs/calendar/monthCalendar.js +21 -5
- package/lib/cjs/cascader/index.d.ts +10 -2
- package/lib/cjs/cascader/index.js +52 -10
- package/lib/cjs/cascader/item.d.ts +6 -2
- package/lib/cjs/cascader/item.js +33 -4
- package/lib/cjs/datePicker/dateInput.d.ts +9 -4
- package/lib/cjs/datePicker/dateInput.js +107 -13
- package/lib/cjs/datePicker/datePicker.d.ts +7 -2
- package/lib/cjs/datePicker/datePicker.js +138 -30
- package/lib/cjs/datePicker/index.js +24 -2
- package/lib/cjs/datePicker/insetInput.d.ts +21 -0
- package/lib/cjs/datePicker/insetInput.js +80 -0
- package/lib/cjs/datePicker/month.d.ts +1 -0
- package/lib/cjs/datePicker/month.js +18 -2
- package/lib/cjs/datePicker/monthsGrid.js +35 -11
- package/lib/cjs/datePicker/navigation.js +8 -0
- package/lib/cjs/datePicker/quickControl.js +1 -0
- package/lib/cjs/datePicker/yearAndMonth.js +1 -0
- package/lib/cjs/form/hoc/withField.js +1 -1
- package/lib/cjs/navigation/Item.d.ts +2 -2
- package/lib/cjs/navigation/Item.js +8 -6
- package/lib/cjs/navigation/SubNav.js +2 -2
- package/lib/cjs/scrollList/scrollItem.d.ts +2 -1
- package/lib/cjs/scrollList/scrollItem.js +13 -3
- package/lib/cjs/table/Body/index.d.ts +2 -0
- package/lib/cjs/table/Body/index.js +13 -4
- package/lib/cjs/tree/index.js +5 -3
- package/lib/cjs/tree/interface.d.ts +1 -0
- package/lib/cjs/tree/nodeList.js +2 -1
- package/lib/cjs/treeSelect/index.js +7 -3
- package/lib/es/_base/base.css +5 -5
- package/lib/es/button/buttonGroup.d.ts +1 -0
- package/lib/es/button/buttonGroup.js +5 -2
- package/lib/es/calendar/monthCalendar.js +22 -5
- package/lib/es/cascader/index.d.ts +10 -2
- package/lib/es/cascader/index.js +49 -7
- package/lib/es/cascader/item.d.ts +6 -2
- package/lib/es/cascader/item.js +31 -4
- package/lib/es/datePicker/dateInput.d.ts +9 -4
- package/lib/es/datePicker/dateInput.js +106 -13
- package/lib/es/datePicker/datePicker.d.ts +7 -2
- package/lib/es/datePicker/datePicker.js +139 -30
- package/lib/es/datePicker/index.js +20 -0
- package/lib/es/datePicker/insetInput.d.ts +21 -0
- package/lib/es/datePicker/insetInput.js +65 -0
- package/lib/es/datePicker/month.d.ts +1 -0
- package/lib/es/datePicker/month.js +18 -2
- package/lib/es/datePicker/monthsGrid.js +35 -11
- package/lib/es/datePicker/navigation.js +8 -0
- package/lib/es/datePicker/quickControl.js +2 -0
- package/lib/es/datePicker/yearAndMonth.js +1 -0
- package/lib/es/form/hoc/withField.js +1 -1
- package/lib/es/navigation/Item.d.ts +2 -2
- package/lib/es/navigation/Item.js +8 -6
- package/lib/es/navigation/SubNav.js +2 -2
- package/lib/es/scrollList/scrollItem.d.ts +2 -1
- package/lib/es/scrollList/scrollItem.js +13 -3
- package/lib/es/table/Body/index.d.ts +2 -0
- package/lib/es/table/Body/index.js +13 -4
- package/lib/es/tree/index.js +5 -3
- package/lib/es/tree/interface.d.ts +1 -0
- package/lib/es/tree/nodeList.js +2 -1
- package/lib/es/treeSelect/index.js +7 -3
- package/navigation/Item.tsx +15 -12
- package/navigation/SubNav.tsx +4 -4
- package/package.json +9 -9
- package/scrollList/_story/ScrollList/index.js +3 -0
- package/scrollList/_story/WheelList/index.js +3 -0
- package/scrollList/scrollItem.tsx +30 -9
- package/table/Body/index.tsx +15 -4
- package/table/__test__/table.test.js +18 -0
- package/table/_story/v2/FixedExpandedRow/index.jsx +95 -0
- package/table/_story/v2/index.js +2 -1
- package/tree/__test__/tree.test.js +87 -2
- package/tree/_story/tree.stories.js +65 -5
- package/tree/index.tsx +4 -2
- package/tree/interface.ts +1 -0
- package/tree/nodeList.tsx +2 -2
- package/treeSelect/__test__/treeSelect.test.js +28 -0
- package/treeSelect/_story/treeSelect.stories.js +55 -2
- package/treeSelect/index.tsx +11 -3
package/dist/umd/semi-ui.js
CHANGED
|
@@ -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:
|
|
36420
|
+
className: cls,
|
|
36418
36421
|
role: "group",
|
|
36419
36422
|
"aria-label": ariaLabel
|
|
36420
36423
|
}, inner);
|
|
@@ -41521,6 +41524,8 @@ weekCalendar_WeekCalendar.contextType = locale_context;
|
|
|
41521
41524
|
|
|
41522
41525
|
|
|
41523
41526
|
|
|
41527
|
+
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
41528
|
+
|
|
41524
41529
|
|
|
41525
41530
|
|
|
41526
41531
|
|
|
@@ -41576,11 +41581,13 @@ class monthCalendar_monthCalendar extends baseComponent_BaseComponent {
|
|
|
41576
41581
|
} = this.props;
|
|
41577
41582
|
this.monthlyData = this.foundation.getMonthlyData(displayValue, dateFnsLocale);
|
|
41578
41583
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41579
|
-
className: "".concat(monthCalendar_prefixCls, "-header")
|
|
41584
|
+
className: "".concat(monthCalendar_prefixCls, "-header"),
|
|
41585
|
+
role: "presentation"
|
|
41580
41586
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41581
|
-
role: "
|
|
41587
|
+
role: "presentation",
|
|
41582
41588
|
className: "".concat(monthCalendar_prefixCls, "-grid")
|
|
41583
41589
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
|
|
41590
|
+
role: "row",
|
|
41584
41591
|
className: "".concat(monthCalendar_prefixCls, "-grid-row")
|
|
41585
41592
|
}, map_default()(_context = this.monthlyData[0]).call(_context, day => {
|
|
41586
41593
|
const {
|
|
@@ -41590,6 +41597,8 @@ class monthCalendar_monthCalendar extends baseComponent_BaseComponent {
|
|
|
41590
41597
|
["".concat(calendar_constants_cssClasses.PREFIX, "-weekend")]: markWeekend && day.isWeekend
|
|
41591
41598
|
});
|
|
41592
41599
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
|
|
41600
|
+
role: "columnheader",
|
|
41601
|
+
"aria-label": weekday,
|
|
41593
41602
|
key: "".concat(weekday, "-monthheader"),
|
|
41594
41603
|
className: listCls
|
|
41595
41604
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null, weekday));
|
|
@@ -41672,7 +41681,10 @@ class monthCalendar_monthCalendar extends baseComponent_BaseComponent {
|
|
|
41672
41681
|
const pos = showCard && showCard[key] ? showCard[key][1] : 'leftTopOver';
|
|
41673
41682
|
const text = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
41674
41683
|
componentName: "Calendar"
|
|
41675
|
-
}, locale =>
|
|
41684
|
+
}, locale =>
|
|
41685
|
+
/*#__PURE__*/
|
|
41686
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
41687
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41676
41688
|
className: "".concat(cardCls, "-wrapper"),
|
|
41677
41689
|
style: {
|
|
41678
41690
|
bottom: 0
|
|
@@ -41740,11 +41752,12 @@ class monthCalendar_monthCalendar extends baseComponent_BaseComponent {
|
|
|
41740
41752
|
day
|
|
41741
41753
|
} = events;
|
|
41742
41754
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41743
|
-
role: "
|
|
41755
|
+
role: "presentation",
|
|
41744
41756
|
className: "".concat(monthCalendar_prefixCls, "-weekrow"),
|
|
41745
41757
|
ref: _this.cellDom,
|
|
41746
41758
|
key: "".concat(index, "-weekrow")
|
|
41747
41759
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
|
|
41760
|
+
role: "row",
|
|
41748
41761
|
className: "".concat(monthCalendar_prefixCls, "-skeleton")
|
|
41749
41762
|
}, map_default()(weekDay).call(weekDay, each => {
|
|
41750
41763
|
const {
|
|
@@ -41763,6 +41776,9 @@ class monthCalendar_monthCalendar extends baseComponent_BaseComponent {
|
|
|
41763
41776
|
});
|
|
41764
41777
|
const shouldRenderCollapsed = Boolean(day && day[ind] && day[ind].length > itemLimit);
|
|
41765
41778
|
const inner = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
|
|
41779
|
+
role: "gridcell",
|
|
41780
|
+
"aria-label": date.toLocaleDateString(),
|
|
41781
|
+
"aria-current": isToday ? "date" : false,
|
|
41766
41782
|
key: "".concat(date, "-weeksk"),
|
|
41767
41783
|
className: listCls,
|
|
41768
41784
|
onClick: e => _this.handleClick(e, [date])
|
|
@@ -41785,9 +41801,10 @@ class monthCalendar_monthCalendar extends baseComponent_BaseComponent {
|
|
|
41785
41801
|
parsedEvents
|
|
41786
41802
|
} = this.state;
|
|
41787
41803
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41788
|
-
role: "
|
|
41804
|
+
role: "presentation",
|
|
41789
41805
|
className: "".concat(monthCalendar_prefixCls, "-week")
|
|
41790
41806
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
|
|
41807
|
+
role: "presentation",
|
|
41791
41808
|
className: "".concat(monthCalendar_prefixCls, "-grid-col")
|
|
41792
41809
|
}, map_default()(_context3 = keys_default()(this.monthlyData)).call(_context3, weekInd => this.renderWeekRow(weekInd, this.monthlyData[weekInd], parsedEvents[weekInd]))));
|
|
41793
41810
|
};
|
|
@@ -41918,12 +41935,15 @@ class monthCalendar_monthCalendar extends baseComponent_BaseComponent {
|
|
|
41918
41935
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
41919
41936
|
componentName: "Calendar"
|
|
41920
41937
|
}, (locale, localeCode, dateFnsLocale) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41938
|
+
role: "grid",
|
|
41921
41939
|
className: monthCls,
|
|
41922
41940
|
key: this.state.itemLimit,
|
|
41923
41941
|
style: monthStyle
|
|
41924
41942
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41943
|
+
role: "presentation",
|
|
41925
41944
|
className: "".concat(monthCalendar_prefixCls, "-sticky-top")
|
|
41926
41945
|
}, header, this.renderHeader(dateFnsLocale)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41946
|
+
role: "presentation",
|
|
41927
41947
|
className: "".concat(monthCalendar_prefixCls, "-grid-wrapper")
|
|
41928
41948
|
}, this.renderMonthGrid())));
|
|
41929
41949
|
}
|
|
@@ -43916,6 +43936,7 @@ function calcMergeType(autoMergeValue, leafOnly) {
|
|
|
43916
43936
|
|
|
43917
43937
|
|
|
43918
43938
|
|
|
43939
|
+
|
|
43919
43940
|
|
|
43920
43941
|
|
|
43921
43942
|
// eslint-disable-next-line max-len
|
|
@@ -44425,6 +44446,16 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44425
44446
|
this.close(e);
|
|
44426
44447
|
}
|
|
44427
44448
|
}
|
|
44449
|
+
/**
|
|
44450
|
+
* A11y: simulate selection click
|
|
44451
|
+
*/
|
|
44452
|
+
|
|
44453
|
+
|
|
44454
|
+
handleSelectionEnterPress(keyboardEvent) {
|
|
44455
|
+
if (utils_isEnterPress(keyboardEvent)) {
|
|
44456
|
+
this.handleClick(keyboardEvent);
|
|
44457
|
+
}
|
|
44458
|
+
}
|
|
44428
44459
|
|
|
44429
44460
|
toggleHoverState(bool) {
|
|
44430
44461
|
this._adapter.toggleHovering(bool);
|
|
@@ -44856,6 +44887,16 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44856
44887
|
|
|
44857
44888
|
this._adapter.rePositionDropdown();
|
|
44858
44889
|
}
|
|
44890
|
+
/**
|
|
44891
|
+
* A11y: simulate clear button click
|
|
44892
|
+
*/
|
|
44893
|
+
|
|
44894
|
+
|
|
44895
|
+
handleClearEnterPress(keyboardEvent) {
|
|
44896
|
+
if (utils_isEnterPress(keyboardEvent)) {
|
|
44897
|
+
this.handleClear();
|
|
44898
|
+
}
|
|
44899
|
+
}
|
|
44859
44900
|
|
|
44860
44901
|
getRenderData() {
|
|
44861
44902
|
var _context9, _context10;
|
|
@@ -45690,6 +45731,8 @@ checkbox_CheckboxWithGroup.Group = checkboxGroup;
|
|
|
45690
45731
|
|
|
45691
45732
|
|
|
45692
45733
|
|
|
45734
|
+
|
|
45735
|
+
|
|
45693
45736
|
const item_prefixcls = cascader_constants_cssClasses.PREFIX_OPTION;
|
|
45694
45737
|
class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
|
|
45695
45738
|
constructor() {
|
|
@@ -45706,6 +45749,16 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
45706
45749
|
|
|
45707
45750
|
onItemClick(e, item);
|
|
45708
45751
|
};
|
|
45752
|
+
/**
|
|
45753
|
+
* A11y: simulate item click
|
|
45754
|
+
*/
|
|
45755
|
+
|
|
45756
|
+
|
|
45757
|
+
this.handleItemEnterPress = (keyboardEvent, item) => {
|
|
45758
|
+
if (utils_isEnterPress(keyboardEvent)) {
|
|
45759
|
+
this.onClick(keyboardEvent, item);
|
|
45760
|
+
}
|
|
45761
|
+
};
|
|
45709
45762
|
|
|
45710
45763
|
this.onHover = (e, item) => {
|
|
45711
45764
|
const {
|
|
@@ -45785,6 +45838,7 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
45785
45838
|
|
|
45786
45839
|
case 'empty':
|
|
45787
45840
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
45841
|
+
"aria-hidden": true,
|
|
45788
45842
|
className: concat_default()(_context3 = "".concat(item_prefixcls, "-icon ")).call(_context3, item_prefixcls, "-icon-empty")
|
|
45789
45843
|
});
|
|
45790
45844
|
|
|
@@ -45848,11 +45902,13 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
45848
45902
|
["".concat(item_prefixcls, "-disabled")]: disabled
|
|
45849
45903
|
});
|
|
45850
45904
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
|
|
45905
|
+
role: 'menuitem',
|
|
45851
45906
|
className: className,
|
|
45852
45907
|
key: key,
|
|
45853
45908
|
onClick: e => {
|
|
45854
45909
|
this.onClick(e, item);
|
|
45855
|
-
}
|
|
45910
|
+
},
|
|
45911
|
+
onKeyPress: e => this.handleItemEnterPress(e, item)
|
|
45856
45912
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
45857
45913
|
className: "".concat(item_prefixcls, "-label")
|
|
45858
45914
|
}, !multiple && this.renderIcon('empty'), multiple && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(checkbox_0, {
|
|
@@ -45877,13 +45933,15 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
45877
45933
|
let showChildItem;
|
|
45878
45934
|
const ind = content.length;
|
|
45879
45935
|
content.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
|
|
45936
|
+
role: 'menu',
|
|
45880
45937
|
className: "".concat(item_prefixcls, "-list"),
|
|
45881
45938
|
key: renderData[0].key,
|
|
45882
45939
|
onScroll: e => this.props.onListScroll(e, ind)
|
|
45883
45940
|
}, map_default()(renderData).call(renderData, item => {
|
|
45884
45941
|
const {
|
|
45885
45942
|
data,
|
|
45886
|
-
key
|
|
45943
|
+
key,
|
|
45944
|
+
parentKey
|
|
45887
45945
|
} = item;
|
|
45888
45946
|
const {
|
|
45889
45947
|
children,
|
|
@@ -45908,16 +45966,26 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
45908
45966
|
["".concat(item_prefixcls, "-select")]: selected && !multiple,
|
|
45909
45967
|
["".concat(item_prefixcls, "-disabled")]: disabled
|
|
45910
45968
|
});
|
|
45911
|
-
|
|
45969
|
+
const otherAriaProps = parentKey ? {
|
|
45970
|
+
['aria-owns']: "cascaderItem-".concat(parentKey)
|
|
45971
|
+
} : {};
|
|
45972
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", assign_default()({
|
|
45973
|
+
role: 'menuitem',
|
|
45974
|
+
id: "cascaderItem-".concat(key),
|
|
45975
|
+
"aria-expanded": active,
|
|
45976
|
+
"aria-haspopup": Boolean(showExpand),
|
|
45977
|
+
"aria-disabled": disabled
|
|
45978
|
+
}, otherAriaProps, {
|
|
45912
45979
|
className: className,
|
|
45913
45980
|
key: key,
|
|
45914
45981
|
onClick: e => {
|
|
45915
45982
|
this.onClick(e, item);
|
|
45916
45983
|
},
|
|
45984
|
+
onKeyPress: e => this.handleItemEnterPress(e, item),
|
|
45917
45985
|
onMouseEnter: e => {
|
|
45918
45986
|
this.onHover(e, item);
|
|
45919
45987
|
}
|
|
45920
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
45988
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
45921
45989
|
className: "".concat(item_prefixcls, "-label")
|
|
45922
45990
|
}, selected && !multiple && this.renderIcon('tick'), !selected && !multiple && this.renderIcon('empty'), multiple && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(checkbox_0, {
|
|
45923
45991
|
onChange: e => this.onCheckboxChange(e, item),
|
|
@@ -47121,6 +47189,36 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47121
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));
|
|
47122
47190
|
};
|
|
47123
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
|
+
|
|
47124
47222
|
this.renderSelectContent = () => {
|
|
47125
47223
|
const {
|
|
47126
47224
|
placeholder,
|
|
@@ -47128,7 +47226,6 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47128
47226
|
multiple
|
|
47129
47227
|
} = this.props;
|
|
47130
47228
|
const {
|
|
47131
|
-
selectedKeys,
|
|
47132
47229
|
checkedKeys
|
|
47133
47230
|
} = this.state;
|
|
47134
47231
|
const searchable = Boolean(filterTreeNode);
|
|
@@ -47143,9 +47240,9 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47143
47240
|
|
|
47144
47241
|
return this.renderMultipleTags();
|
|
47145
47242
|
} else {
|
|
47146
|
-
const displayText =
|
|
47243
|
+
const displayText = this.renderDisplayText();
|
|
47147
47244
|
const spanCls = classnames_default()({
|
|
47148
|
-
["".concat(cascader_prefixcls, "-selection-placeholder")]: !displayText
|
|
47245
|
+
["".concat(cascader_prefixcls, "-selection-placeholder")]: !displayText
|
|
47149
47246
|
});
|
|
47150
47247
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
47151
47248
|
className: spanCls
|
|
@@ -47241,6 +47338,15 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47241
47338
|
e && e.stopPropagation();
|
|
47242
47339
|
this.foundation.handleClear();
|
|
47243
47340
|
};
|
|
47341
|
+
/**
|
|
47342
|
+
* A11y: simulate clear button click
|
|
47343
|
+
*/
|
|
47344
|
+
|
|
47345
|
+
|
|
47346
|
+
this.handleClearEnterPress = e => {
|
|
47347
|
+
e && e.stopPropagation();
|
|
47348
|
+
this.foundation.handleClearEnterPress();
|
|
47349
|
+
};
|
|
47244
47350
|
|
|
47245
47351
|
this.showClearBtn = () => {
|
|
47246
47352
|
const {
|
|
@@ -47267,6 +47373,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47267
47373
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
47268
47374
|
className: clearCls,
|
|
47269
47375
|
onClick: this.handleClear,
|
|
47376
|
+
onKeyPress: this.handleClearEnterPress,
|
|
47270
47377
|
role: 'button',
|
|
47271
47378
|
tabIndex: 0
|
|
47272
47379
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClear, null));
|
|
@@ -47356,6 +47463,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47356
47463
|
style: style,
|
|
47357
47464
|
ref: this.triggerRef,
|
|
47358
47465
|
onClick: e => this.foundation.handleClick(e),
|
|
47466
|
+
onKeyPress: e => this.foundation.handleSelectionEnterPress(e),
|
|
47359
47467
|
"aria-invalid": this.props['aria-invalid'],
|
|
47360
47468
|
"aria-errormessage": this.props['aria-errormessage'],
|
|
47361
47469
|
"aria-label": this.props['aria-label'],
|
|
@@ -47679,7 +47787,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47679
47787
|
}
|
|
47680
47788
|
|
|
47681
47789
|
renderTagInput() {
|
|
47682
|
-
var
|
|
47790
|
+
var _context4;
|
|
47683
47791
|
|
|
47684
47792
|
const {
|
|
47685
47793
|
size,
|
|
@@ -47699,7 +47807,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47699
47807
|
const tagValue = [];
|
|
47700
47808
|
const realKeys = this.mergeType === cascader_constants_strings.NONE_MERGE_TYPE ? checkedKeys : resolvedCheckedKeys;
|
|
47701
47809
|
|
|
47702
|
-
for_each_default()(
|
|
47810
|
+
for_each_default()(_context4 = [...realKeys]).call(_context4, checkedKey => {
|
|
47703
47811
|
if (!isEmpty_default()(keyEntities[checkedKey])) {
|
|
47704
47812
|
tagValue.push(keyEntities[checkedKey].valuePath);
|
|
47705
47813
|
}
|
|
@@ -47798,6 +47906,7 @@ cascader_Cascader.propTypes = {
|
|
|
47798
47906
|
'aria-errormessage': prop_types_default.a.string,
|
|
47799
47907
|
'aria-describedby': prop_types_default.a.string,
|
|
47800
47908
|
'aria-required': prop_types_default.a.bool,
|
|
47909
|
+
'aria-label': prop_types_default.a.string,
|
|
47801
47910
|
arrowIcon: prop_types_default.a.node,
|
|
47802
47911
|
changeOnSelect: prop_types_default.a.bool,
|
|
47803
47912
|
defaultValue: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.array]),
|
|
@@ -47892,7 +48001,8 @@ cascader_Cascader.defaultProps = {
|
|
|
47892
48001
|
onClear: noop_default.a,
|
|
47893
48002
|
onDropdownVisibleChange: noop_default.a,
|
|
47894
48003
|
onListScroll: noop_default.a,
|
|
47895
|
-
enableLeafClick: false
|
|
48004
|
+
enableLeafClick: false,
|
|
48005
|
+
'aria-label': 'Cascader'
|
|
47896
48006
|
};
|
|
47897
48007
|
/* harmony default export */ var cascader_0 = (cascader_Cascader);
|
|
47898
48008
|
// CONCATENATED MODULE: ../semi-foundation/collapse/constants.ts
|
|
@@ -48631,6 +48741,70 @@ function forwardStatics(obj, srcObj) {
|
|
|
48631
48741
|
|
|
48632
48742
|
return obj;
|
|
48633
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
|
+
|
|
48634
48808
|
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isDate.js
|
|
48635
48809
|
var lodash_isDate = __webpack_require__("+f76");
|
|
48636
48810
|
var isDate_default = /*#__PURE__*/__webpack_require__.n(lodash_isDate);
|
|
@@ -52666,69 +52840,6 @@ function compatiableParse(value, formatToken, baseDate, locale) {
|
|
|
52666
52840
|
|
|
52667
52841
|
return result;
|
|
52668
52842
|
}
|
|
52669
|
-
// CONCATENATED MODULE: ../semi-foundation/datePicker/constants.ts
|
|
52670
|
-
|
|
52671
|
-
|
|
52672
|
-
|
|
52673
|
-
const dayItemClasses = {
|
|
52674
|
-
DAY_TODAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-today"),
|
|
52675
|
-
DAY_IN_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inrange"),
|
|
52676
|
-
DAY_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inhover"),
|
|
52677
|
-
DAY_SELECTED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected"),
|
|
52678
|
-
DAY_SELECTED_START: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-start"),
|
|
52679
|
-
DAY_SELECTED_END: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-end"),
|
|
52680
|
-
DAY_DISABLED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-disabled"),
|
|
52681
|
-
DAY_HOVER_DAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday"),
|
|
52682
|
-
DAY_HOVER_DAY_OFFSET: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-offset"),
|
|
52683
|
-
DAY_IN_OFFSET_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-inoffsetrange"),
|
|
52684
|
-
DAY_SELECTED_RANGE_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selectedrange-hover"),
|
|
52685
|
-
DAY_OFFSET_RANGE_START: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-offsetrange-start"),
|
|
52686
|
-
DAY_OFFSET_RANGE_END: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-offsetrange-end"),
|
|
52687
|
-
DAY_SELECTED_START_AFTER_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-start-afterhover"),
|
|
52688
|
-
DAY_SELECTED_END_BEFORE_HOVER: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-selected-end-beforehover"),
|
|
52689
|
-
DAY_HOVER_DAY_BEFORE_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-beforerange"),
|
|
52690
|
-
DAY_HOVER_DAY_AFTER_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-afterrange"),
|
|
52691
|
-
DAY_HOVER_DAY_IN_RANGE: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-inrange"),
|
|
52692
|
-
DAY_HOVER_DAY_AROUND_SINGLE_SELECTED: "".concat(BASE_CLASS_PREFIX, "-datepicker-day-hoverday-around-singleselected")
|
|
52693
|
-
};
|
|
52694
|
-
|
|
52695
|
-
const datePicker_constants_cssClasses = assign_default()({
|
|
52696
|
-
PREFIX: "".concat(BASE_CLASS_PREFIX, "-datepicker"),
|
|
52697
|
-
NAVIGATION: "".concat(BASE_CLASS_PREFIX, "-datepicker-navigation"),
|
|
52698
|
-
PANEL_YAM: "".concat(BASE_CLASS_PREFIX, "-datepicker-panel-yam"),
|
|
52699
|
-
MONTH: "".concat(BASE_CLASS_PREFIX, "-datepicker-month"),
|
|
52700
|
-
WEEKDAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-weekday"),
|
|
52701
|
-
WEEKS: "".concat(BASE_CLASS_PREFIX, "-datepicker-weeks"),
|
|
52702
|
-
WEEK: "".concat(BASE_CLASS_PREFIX, "-datepicker-week"),
|
|
52703
|
-
DAY: "".concat(BASE_CLASS_PREFIX, "-datepicker-day")
|
|
52704
|
-
}, dayItemClasses);
|
|
52705
|
-
|
|
52706
|
-
const constants_formatToken = {
|
|
52707
|
-
FORMAT_FULL_DATE: 'yyyy-MM-dd',
|
|
52708
|
-
FORMAT_TIME_PICKER: 'HH:mm:ss',
|
|
52709
|
-
FORMAT_DATE_TIME: 'yyyy-MM-dd HH:mm:ss',
|
|
52710
|
-
FORMAT_YEAR_MONTH: 'yyyy-MM'
|
|
52711
|
-
};
|
|
52712
|
-
|
|
52713
|
-
const datePicker_constants_strings = assign_default()({
|
|
52714
|
-
DEFAULT_SEPARATOR_MULTIPLE: ',',
|
|
52715
|
-
DEFAULT_SEPARATOR_RANGE: ' ~ ',
|
|
52716
|
-
SIZE_SET: ['small', 'default', 'large'],
|
|
52717
|
-
TYPE_SET: ['date', 'dateRange', 'year', 'month', 'dateTime', 'dateTimeRange'],
|
|
52718
|
-
DENSITY_SET: ['default', 'compact'],
|
|
52719
|
-
PANEL_TYPE_LEFT: 'left',
|
|
52720
|
-
PANEL_TYPE_RIGHT: 'right',
|
|
52721
|
-
STATUS: VALIDATE_STATUS,
|
|
52722
|
-
POSITION_SET: popover_constants_strings.POSITION_SET
|
|
52723
|
-
}, constants_formatToken);
|
|
52724
|
-
|
|
52725
|
-
const datePicker_constants_numbers = {
|
|
52726
|
-
WEEK_START_ON: 0,
|
|
52727
|
-
WEEK_HEIGHT: 36,
|
|
52728
|
-
SPACING: constants_numbers.SPACING // Floating distance trigger interval
|
|
52729
|
-
|
|
52730
|
-
};
|
|
52731
|
-
|
|
52732
52843
|
// CONCATENATED MODULE: ../semi-foundation/datePicker/_utils/getDefaultFormatToken.ts
|
|
52733
52844
|
|
|
52734
52845
|
const defaultFormatTokens = {
|
|
@@ -52745,6 +52856,122 @@ function getDefaultFormatTokenByType(type) {
|
|
|
52745
52856
|
return type && defaultFormatTokens[type];
|
|
52746
52857
|
}
|
|
52747
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
|
+
}
|
|
52748
52975
|
// CONCATENATED MODULE: ../semi-foundation/datePicker/foundation.ts
|
|
52749
52976
|
|
|
52750
52977
|
|
|
@@ -52779,6 +53006,8 @@ function getDefaultFormatTokenByType(type) {
|
|
|
52779
53006
|
|
|
52780
53007
|
|
|
52781
53008
|
|
|
53009
|
+
|
|
53010
|
+
|
|
52782
53011
|
/**
|
|
52783
53012
|
* The datePicker foundation.js is responsible for maintaining the date value and the input box value, as well as the callback of both
|
|
52784
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
|
|
@@ -53010,6 +53239,20 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53010
53239
|
this.resetCachedSelectedValue(willUpdateDates);
|
|
53011
53240
|
}
|
|
53012
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
|
+
}
|
|
53013
53256
|
|
|
53014
53257
|
resetCachedSelectedValue(willUpdateDates) {
|
|
53015
53258
|
const {
|
|
@@ -53057,6 +53300,7 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53057
53300
|
|
|
53058
53301
|
this.rangeTypeSideEffectsWhenClosePanel(inputValue, willUpdateDates);
|
|
53059
53302
|
this.needConfirmSideEffectsWhenClosePanel(willUpdateDates);
|
|
53303
|
+
this.clearInsetInputValue();
|
|
53060
53304
|
|
|
53061
53305
|
this._adapter.notifyOpenChange(false);
|
|
53062
53306
|
|
|
@@ -53102,6 +53346,52 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53102
53346
|
this._adapter.updateInputValue(input);
|
|
53103
53347
|
}
|
|
53104
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
|
+
}
|
|
53105
53395
|
/**
|
|
53106
53396
|
* Input box blur
|
|
53107
53397
|
* @param {String} input
|
|
@@ -53232,6 +53522,7 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53232
53522
|
|
|
53233
53523
|
parseInput() {
|
|
53234
53524
|
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
53525
|
+
let format = arguments.length > 1 ? arguments[1] : undefined;
|
|
53235
53526
|
let result = []; // console.log(input);
|
|
53236
53527
|
|
|
53237
53528
|
const {
|
|
@@ -53241,7 +53532,7 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53241
53532
|
|
|
53242
53533
|
if (input && input.length) {
|
|
53243
53534
|
const type = this.getProp('type');
|
|
53244
|
-
const formatToken = this.getProp('format') || getDefaultFormatTokenByType(type);
|
|
53535
|
+
const formatToken = format || this.getProp('format') || getDefaultFormatTokenByType(type);
|
|
53245
53536
|
let parsedResult, formatedInput;
|
|
53246
53537
|
const nowDate = new Date();
|
|
53247
53538
|
|
|
@@ -53335,12 +53626,13 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53335
53626
|
|
|
53336
53627
|
formatDates() {
|
|
53337
53628
|
let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
53629
|
+
let customFormat = arguments.length > 1 ? arguments[1] : undefined;
|
|
53338
53630
|
let str = '';
|
|
53339
53631
|
const rangeSeparator = this.getProp('rangeSeparator');
|
|
53340
53632
|
|
|
53341
53633
|
if (is_array_default()(dates) && dates.length) {
|
|
53342
53634
|
const type = this.getProp('type');
|
|
53343
|
-
const formatToken = this.getProp('format') || getDefaultFormatTokenByType(type);
|
|
53635
|
+
const formatToken = customFormat || this.getProp('format') || getDefaultFormatTokenByType(type);
|
|
53344
53636
|
|
|
53345
53637
|
switch (type) {
|
|
53346
53638
|
case 'date':
|
|
@@ -53390,6 +53682,7 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53390
53682
|
formatMultipleDates() {
|
|
53391
53683
|
let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
53392
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;
|
|
53393
53686
|
const strs = [];
|
|
53394
53687
|
|
|
53395
53688
|
if (is_array_default()(dates) && dates.length) {
|
|
@@ -53399,14 +53692,14 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53399
53692
|
case 'date':
|
|
53400
53693
|
case 'dateTime':
|
|
53401
53694
|
case 'month':
|
|
53402
|
-
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)));
|
|
53403
53696
|
|
|
53404
53697
|
break;
|
|
53405
53698
|
|
|
53406
53699
|
case 'dateRange':
|
|
53407
53700
|
case 'dateTimeRange':
|
|
53408
53701
|
for (let i = 0; i < dates.length; i += 2) {
|
|
53409
|
-
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));
|
|
53410
53703
|
}
|
|
53411
53704
|
|
|
53412
53705
|
break;
|
|
@@ -53456,7 +53749,13 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53456
53749
|
|
|
53457
53750
|
|
|
53458
53751
|
handleSelectedChange(value, options) {
|
|
53459
|
-
const
|
|
53752
|
+
const {
|
|
53753
|
+
type,
|
|
53754
|
+
format,
|
|
53755
|
+
rangeSeparator,
|
|
53756
|
+
insetInput
|
|
53757
|
+
} = this._adapter.getProps();
|
|
53758
|
+
|
|
53460
53759
|
const {
|
|
53461
53760
|
value: stateValue
|
|
53462
53761
|
} = this.getStates();
|
|
@@ -53483,10 +53782,24 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53483
53782
|
|
|
53484
53783
|
const changedDates = this._getChangedDates(dates);
|
|
53485
53784
|
|
|
53486
|
-
let inputValue;
|
|
53785
|
+
let inputValue, insetInputValue;
|
|
53487
53786
|
|
|
53488
53787
|
if (!this._someDateDisabled(changedDates)) {
|
|
53489
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
|
+
|
|
53490
53803
|
const isRangeTypeAndInputIncomplete = this._isRangeType() && !this._isRangeValueComplete(dates);
|
|
53491
53804
|
/**
|
|
53492
53805
|
* If the input is incomplete when under control, the notifyChange is not triggered because
|
|
@@ -53501,15 +53814,23 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53501
53814
|
// do not change value when selected value is incomplete
|
|
53502
53815
|
this._adapter.updateInputValue(inputValue);
|
|
53503
53816
|
|
|
53817
|
+
this._adapter.updateInsetInputValue(insetInputValue);
|
|
53818
|
+
|
|
53504
53819
|
return;
|
|
53505
53820
|
} else {
|
|
53506
|
-
(!controlled || fromPreset)
|
|
53821
|
+
if (!controlled || fromPreset) {
|
|
53822
|
+
this._updateValueAndInput(dates, true, inputValue);
|
|
53823
|
+
|
|
53824
|
+
this._adapter.updateInsetInputValue(insetInputValue);
|
|
53825
|
+
}
|
|
53507
53826
|
}
|
|
53508
53827
|
}
|
|
53509
53828
|
|
|
53510
53829
|
if (!controlled && this._adapter.needConfirm()) {
|
|
53511
53830
|
// select date only change inputValue when needConfirm is true
|
|
53512
|
-
this._adapter.updateInputValue(inputValue);
|
|
53831
|
+
this._adapter.updateInputValue(inputValue);
|
|
53832
|
+
|
|
53833
|
+
this._adapter.updateInsetInputValue(insetInputValue); // if inputValue is not complete, don't notifyChange
|
|
53513
53834
|
|
|
53514
53835
|
|
|
53515
53836
|
if (isRangeTypeAndInputIncomplete) {
|
|
@@ -53553,7 +53874,7 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53553
53874
|
const {
|
|
53554
53875
|
cachedSelectedValue,
|
|
53555
53876
|
value
|
|
53556
|
-
} = this.getStates();
|
|
53877
|
+
} = this._adapter.getStates();
|
|
53557
53878
|
|
|
53558
53879
|
const isRangeValueComplete = this._isRangeValueComplete(cachedSelectedValue);
|
|
53559
53880
|
|
|
@@ -53924,6 +54245,23 @@ class foundation_DatePickerFoundation extends foundation {
|
|
|
53924
54245
|
}
|
|
53925
54246
|
}
|
|
53926
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
|
+
|
|
53927
54265
|
}
|
|
53928
54266
|
// CONCATENATED MODULE: ../semi-foundation/datePicker/_utils/formatter.ts
|
|
53929
54267
|
|
|
@@ -53986,7 +54324,11 @@ function formatDateValues(values, formatToken) {
|
|
|
53986
54324
|
// CONCATENATED MODULE: ../semi-foundation/datePicker/inputFoundation.ts
|
|
53987
54325
|
|
|
53988
54326
|
|
|
53989
|
-
|
|
54327
|
+
|
|
54328
|
+
|
|
54329
|
+
|
|
54330
|
+
|
|
54331
|
+
|
|
53990
54332
|
|
|
53991
54333
|
|
|
53992
54334
|
|
|
@@ -54048,7 +54390,7 @@ class inputFoundation_InputFoundation extends foundation {
|
|
|
54048
54390
|
this._adapter.notifyRangeInputFocus(e, rangeType);
|
|
54049
54391
|
}
|
|
54050
54392
|
|
|
54051
|
-
formatShowText(value) {
|
|
54393
|
+
formatShowText(value, customFormat) {
|
|
54052
54394
|
const {
|
|
54053
54395
|
type,
|
|
54054
54396
|
dateFnsLocale,
|
|
@@ -54056,7 +54398,7 @@ class inputFoundation_InputFoundation extends foundation {
|
|
|
54056
54398
|
rangeSeparator
|
|
54057
54399
|
} = this._adapter.getProps();
|
|
54058
54400
|
|
|
54059
|
-
const formatToken = format || getDefaultFormatTokenByType(type);
|
|
54401
|
+
const formatToken = customFormat || format || getDefaultFormatTokenByType(type);
|
|
54060
54402
|
let text = '';
|
|
54061
54403
|
|
|
54062
54404
|
switch (type) {
|
|
@@ -54093,6 +54435,256 @@ class inputFoundation_InputFoundation extends foundation {
|
|
|
54093
54435
|
return text;
|
|
54094
54436
|
}
|
|
54095
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
|
+
});
|
|
54096
54688
|
}
|
|
54097
54689
|
// CONCATENATED MODULE: ./datePicker/dateInput.tsx
|
|
54098
54690
|
|
|
@@ -54112,6 +54704,10 @@ var dateInput_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
54112
54704
|
}
|
|
54113
54705
|
return t;
|
|
54114
54706
|
};
|
|
54707
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
54708
|
+
|
|
54709
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
54710
|
+
|
|
54115
54711
|
/* eslint-disable max-lines-per-function */
|
|
54116
54712
|
|
|
54117
54713
|
/* eslint-disable no-unused-vars */
|
|
@@ -54126,6 +54722,7 @@ var dateInput_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
54126
54722
|
|
|
54127
54723
|
|
|
54128
54724
|
|
|
54725
|
+
|
|
54129
54726
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
54130
54727
|
|
|
54131
54728
|
class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
@@ -54164,6 +54761,10 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54164
54761
|
this.handleRangeInputFocus(e, 'rangeStart');
|
|
54165
54762
|
};
|
|
54166
54763
|
|
|
54764
|
+
this.handleInsetInputChange = options => {
|
|
54765
|
+
this.foundation.handleInsetInputChange(options);
|
|
54766
|
+
};
|
|
54767
|
+
|
|
54167
54768
|
this.getRangeInputValue = (rangeStart, rangeEnd) => {
|
|
54168
54769
|
var _context, _context2;
|
|
54169
54770
|
|
|
@@ -54212,7 +54813,8 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54212
54813
|
},
|
|
54213
54814
|
notifyTabPress: function () {
|
|
54214
54815
|
return _this.props.onRangeEndTabPress(...arguments);
|
|
54215
|
-
}
|
|
54816
|
+
},
|
|
54817
|
+
notifyInsetInputChange: options => this.props.onInsetInputChange(options)
|
|
54216
54818
|
});
|
|
54217
54819
|
}
|
|
54218
54820
|
|
|
@@ -54267,9 +54869,14 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54267
54869
|
} = this.props;
|
|
54268
54870
|
const allowClear = (rangeStart || rangeEnd) && showClear;
|
|
54269
54871
|
return allowClear && !disabled ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
54872
|
+
role: "button",
|
|
54873
|
+
tabIndex: 0,
|
|
54874
|
+
"aria-label": "Clear range input value",
|
|
54270
54875
|
className: "".concat(prefixCls, "-range-input-clearbtn"),
|
|
54271
54876
|
onMouseDown: e => !disabled && this.handleRangeInputClear(e)
|
|
54272
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClear,
|
|
54877
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClear, {
|
|
54878
|
+
"aria-hidden": true
|
|
54879
|
+
})) : null;
|
|
54273
54880
|
}
|
|
54274
54881
|
|
|
54275
54882
|
renderRangeSuffix(suffix) {
|
|
@@ -54312,11 +54919,11 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54312
54919
|
const rangePlaceholder = is_array_default()(placeholder) ? placeholder : [placeholder, placeholder];
|
|
54313
54920
|
const [rangeStartPlaceholder, rangeEndPlaceholder] = rangePlaceholder;
|
|
54314
54921
|
const inputLeftWrapperCls = classnames_default()("".concat(prefixCls, "-range-input-wrapper-start"), "".concat(prefixCls, "-range-input-wrapper"), {
|
|
54315
|
-
["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeStart',
|
|
54922
|
+
["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeStart' && !disabled,
|
|
54316
54923
|
["".concat(prefixCls, "-range-input-wrapper-start-with-prefix")]: this.props.prefix || this.props.insetLabel
|
|
54317
54924
|
});
|
|
54318
54925
|
const inputRightWrapperCls = classnames_default()("".concat(prefixCls, "-range-input-wrapper-end"), "".concat(prefixCls, "-range-input-wrapper"), {
|
|
54319
|
-
["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeEnd'
|
|
54926
|
+
["".concat(prefixCls, "-range-input-wrapper-active")]: rangeInputFocus === 'rangeEnd' && !disabled
|
|
54320
54927
|
});
|
|
54321
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", {
|
|
54322
54929
|
onClick: e => !disabled && this.handleRangeInputFocus(e, 'rangeStart'),
|
|
@@ -54355,7 +54962,70 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54355
54962
|
})), this.renderRangeClearBtn(rangeStart, rangeEnd), this.renderRangeSuffix(suffix));
|
|
54356
54963
|
}
|
|
54357
54964
|
|
|
54358
|
-
|
|
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() {
|
|
54359
55029
|
const _a = this.props,
|
|
54360
55030
|
{
|
|
54361
55031
|
placeholder,
|
|
@@ -54370,6 +55040,8 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54370
55040
|
validateStatus,
|
|
54371
55041
|
block,
|
|
54372
55042
|
prefixCls,
|
|
55043
|
+
multiple,
|
|
55044
|
+
// Whether to allow multiple values for email and file types
|
|
54373
55045
|
dateFnsLocale,
|
|
54374
55046
|
// No need to pass to input
|
|
54375
55047
|
onBlur,
|
|
@@ -54385,12 +55057,18 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54385
55057
|
onRangeBlur,
|
|
54386
55058
|
onRangeEndTabPress,
|
|
54387
55059
|
rangeInputFocus,
|
|
54388
|
-
rangeSeparator
|
|
55060
|
+
rangeSeparator,
|
|
55061
|
+
insetInput,
|
|
55062
|
+
insetInputValue
|
|
54389
55063
|
} = _a,
|
|
54390
|
-
rest = dateInput_rest(_a, ["placeholder", "type", "value", "inputValue", "inputStyle", "disabled", "showClear", "inputReadOnly", "insetLabel", "validateStatus", "block", "prefixCls", "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"]);
|
|
54391
55065
|
|
|
54392
|
-
const dateIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCalendar,
|
|
54393
|
-
|
|
55066
|
+
const dateIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCalendar, {
|
|
55067
|
+
"aria-hidden": true
|
|
55068
|
+
});
|
|
55069
|
+
const dateTimeIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCalendarClock, {
|
|
55070
|
+
"aria-hidden": true
|
|
55071
|
+
});
|
|
54394
55072
|
const suffix = includes_default()(type).call(type, 'Time') ? dateTimeIcon : dateIcon;
|
|
54395
55073
|
let text = '';
|
|
54396
55074
|
|
|
@@ -54434,6 +55112,13 @@ class dateInput_DateInput extends baseComponent_BaseComponent {
|
|
|
54434
55112
|
}));
|
|
54435
55113
|
}
|
|
54436
55114
|
|
|
55115
|
+
render() {
|
|
55116
|
+
const {
|
|
55117
|
+
insetInput
|
|
55118
|
+
} = this.props;
|
|
55119
|
+
return insetInput ? this.renderInputInset() : this.renderTriggerInput();
|
|
55120
|
+
}
|
|
55121
|
+
|
|
54437
55122
|
}
|
|
54438
55123
|
dateInput_DateInput.propTypes = {
|
|
54439
55124
|
onClick: prop_types_default.a.func,
|
|
@@ -54445,7 +55130,6 @@ dateInput_DateInput.propTypes = {
|
|
|
54445
55130
|
value: prop_types_default.a.array,
|
|
54446
55131
|
disabled: prop_types_default.a.bool,
|
|
54447
55132
|
type: prop_types_default.a.oneOf(datePicker_constants_strings.TYPE_SET),
|
|
54448
|
-
multiple: prop_types_default.a.bool,
|
|
54449
55133
|
showClear: prop_types_default.a.bool,
|
|
54450
55134
|
format: prop_types_default.a.string,
|
|
54451
55135
|
inputStyle: prop_types_default.a.object,
|
|
@@ -54459,7 +55143,9 @@ dateInput_DateInput.propTypes = {
|
|
|
54459
55143
|
rangeInputFocus: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.bool]),
|
|
54460
55144
|
rangeInputStartRef: prop_types_default.a.object,
|
|
54461
55145
|
rangeInputEndRef: prop_types_default.a.object,
|
|
54462
|
-
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
|
|
54463
55149
|
};
|
|
54464
55150
|
dateInput_DateInput.defaultProps = {
|
|
54465
55151
|
showClear: true,
|
|
@@ -54469,7 +55155,6 @@ dateInput_DateInput.defaultProps = {
|
|
|
54469
55155
|
onBlur: function_noop,
|
|
54470
55156
|
onClear: function_noop,
|
|
54471
55157
|
onFocus: function_noop,
|
|
54472
|
-
multiple: false,
|
|
54473
55158
|
type: 'date',
|
|
54474
55159
|
inputStyle: {},
|
|
54475
55160
|
inputReadOnly: false,
|
|
@@ -55148,7 +55833,8 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
55148
55833
|
let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
55149
55834
|
const monthLeft = this.getState('monthLeft');
|
|
55150
55835
|
|
|
55151
|
-
const newMonthLeft = assign_default()({}, monthLeft);
|
|
55836
|
+
const newMonthLeft = assign_default()({}, monthLeft); // REMOVE:
|
|
55837
|
+
|
|
55152
55838
|
|
|
55153
55839
|
this._adapter.updateMonthOnLeft(newMonthLeft);
|
|
55154
55840
|
|
|
@@ -55165,6 +55851,7 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
55165
55851
|
if (refreshPicker) {
|
|
55166
55852
|
this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
55167
55853
|
} else {
|
|
55854
|
+
// FIXME:
|
|
55168
55855
|
this.handleShowDateAndTime(datePicker_constants_strings.PANEL_TYPE_LEFT, newMonthLeft.pickerDate);
|
|
55169
55856
|
}
|
|
55170
55857
|
|
|
@@ -55566,7 +56253,7 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
55566
56253
|
selected: selectedSet,
|
|
55567
56254
|
rangeStart,
|
|
55568
56255
|
rangeEnd
|
|
55569
|
-
} = this.getStates();
|
|
56256
|
+
} = this.getStates(); // FIXME:
|
|
55570
56257
|
|
|
55571
56258
|
const includeRange = includes_default()(_context3 = ['dateRange', 'dateTimeRange']).call(_context3, type);
|
|
55572
56259
|
|
|
@@ -56124,7 +56811,9 @@ class navigation_Navigation extends external_root_React_commonjs2_react_commonjs
|
|
|
56124
56811
|
ref: ref
|
|
56125
56812
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
56126
56813
|
key: "double-chevron-left",
|
|
56814
|
+
"aria-label": "Previous year",
|
|
56127
56815
|
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconDoubleChevronLeft, {
|
|
56816
|
+
"aria-hidden": true,
|
|
56128
56817
|
size: iconBtnSize
|
|
56129
56818
|
}),
|
|
56130
56819
|
size: buttonSize,
|
|
@@ -56134,7 +56823,9 @@ class navigation_Navigation extends external_root_React_commonjs2_react_commonjs
|
|
|
56134
56823
|
style: leftButtonStyle
|
|
56135
56824
|
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
56136
56825
|
key: "chevron-left",
|
|
56826
|
+
"aria-label": "Previous month",
|
|
56137
56827
|
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconChevronLeft, {
|
|
56828
|
+
"aria-hidden": true,
|
|
56138
56829
|
size: iconBtnSize
|
|
56139
56830
|
}),
|
|
56140
56831
|
size: buttonSize,
|
|
@@ -56150,7 +56841,9 @@ class navigation_Navigation extends external_root_React_commonjs2_react_commonjs
|
|
|
56150
56841
|
size: buttonSize
|
|
56151
56842
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null, monthText))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
56152
56843
|
key: "chevron-right",
|
|
56844
|
+
"aria-label": "Next month",
|
|
56153
56845
|
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconChevronRight, {
|
|
56846
|
+
"aria-hidden": true,
|
|
56154
56847
|
size: iconBtnSize
|
|
56155
56848
|
}),
|
|
56156
56849
|
size: buttonSize,
|
|
@@ -56160,7 +56853,9 @@ class navigation_Navigation extends external_root_React_commonjs2_react_commonjs
|
|
|
56160
56853
|
style: rightButtonStyle
|
|
56161
56854
|
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
56162
56855
|
key: "double-chevron-right",
|
|
56856
|
+
"aria-label": "Next year",
|
|
56163
56857
|
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconDoubleChevronRight, {
|
|
56858
|
+
"aria-hidden": true,
|
|
56164
56859
|
size: iconBtnSize
|
|
56165
56860
|
}),
|
|
56166
56861
|
size: buttonSize,
|
|
@@ -56430,6 +57125,8 @@ function isBetween(day, _ref) {
|
|
|
56430
57125
|
|
|
56431
57126
|
|
|
56432
57127
|
|
|
57128
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */
|
|
57129
|
+
|
|
56433
57130
|
/* eslint-disable max-len */
|
|
56434
57131
|
|
|
56435
57132
|
|
|
@@ -56752,8 +57449,10 @@ class month_Month extends baseComponent_BaseComponent {
|
|
|
56752
57449
|
const weekdaysText = map_default()(weekdays).call(weekdays, key => locale.weeks[key]);
|
|
56753
57450
|
|
|
56754
57451
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
57452
|
+
role: "row",
|
|
56755
57453
|
className: weekdayCls
|
|
56756
57454
|
}, map_default()(weekdaysText).call(weekdaysText, (E, i) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
57455
|
+
role: "columnheader",
|
|
56757
57456
|
key: E + i,
|
|
56758
57457
|
className: weekdayItemCls
|
|
56759
57458
|
}, E)));
|
|
@@ -56788,6 +57487,7 @@ class month_Month extends baseComponent_BaseComponent {
|
|
|
56788
57487
|
renderWeek(week, weekIndex) {
|
|
56789
57488
|
const weekCls = datePicker_constants_cssClasses.WEEK;
|
|
56790
57489
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
57490
|
+
role: "row",
|
|
56791
57491
|
className: weekCls,
|
|
56792
57492
|
key: weekIndex
|
|
56793
57493
|
}, map_default()(week).call(week, (day, dayIndex) => this.renderDay(day, dayIndex)));
|
|
@@ -56808,6 +57508,8 @@ class month_Month extends baseComponent_BaseComponent {
|
|
|
56808
57508
|
|
|
56809
57509
|
if (!fullDate) {
|
|
56810
57510
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
57511
|
+
role: "gridcell",
|
|
57512
|
+
tabIndex: -1,
|
|
56811
57513
|
key: dayNumber + dayIndex,
|
|
56812
57514
|
className: datePicker_constants_cssClasses.DAY
|
|
56813
57515
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null));
|
|
@@ -56845,6 +57547,11 @@ class month_Month extends baseComponent_BaseComponent {
|
|
|
56845
57547
|
const customRender = isFunction_default()(renderFullDate);
|
|
56846
57548
|
|
|
56847
57549
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
57550
|
+
role: "gridcell",
|
|
57551
|
+
tabIndex: dayStatus.isDisabled ? -1 : 0,
|
|
57552
|
+
"aria-disabled": dayStatus.isDisabled,
|
|
57553
|
+
"aria-selected": dayStatus.isSelected,
|
|
57554
|
+
"aria-label": fullDate,
|
|
56848
57555
|
className: !customRender ? dayCls : datePicker_constants_cssClasses.DAY,
|
|
56849
57556
|
title: fullDate,
|
|
56850
57557
|
key: dayNumber + dayIndex,
|
|
@@ -56858,13 +57565,16 @@ class month_Month extends baseComponent_BaseComponent {
|
|
|
56858
57565
|
|
|
56859
57566
|
render() {
|
|
56860
57567
|
const {
|
|
56861
|
-
forwardRef
|
|
57568
|
+
forwardRef,
|
|
57569
|
+
multiple
|
|
56862
57570
|
} = this.props;
|
|
56863
57571
|
const weekday = this.renderDayOfWeek();
|
|
56864
57572
|
const weeks = this.renderWeeks();
|
|
56865
57573
|
const monthCls = classnames_default()(datePicker_constants_cssClasses.MONTH);
|
|
56866
57574
|
const ref = forwardRef || this.monthRef;
|
|
56867
57575
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
57576
|
+
role: "grid",
|
|
57577
|
+
"aria-multiselectable": multiple,
|
|
56868
57578
|
ref: ref,
|
|
56869
57579
|
className: monthCls
|
|
56870
57580
|
}, weekday, weeks);
|
|
@@ -56890,7 +57600,8 @@ month_Month.propTypes = {
|
|
|
56890
57600
|
startDateOffset: prop_types_default.a.func,
|
|
56891
57601
|
endDateOffset: prop_types_default.a.func,
|
|
56892
57602
|
rangeInputFocus: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.bool]),
|
|
56893
|
-
focusRecordsRef: prop_types_default.a.object
|
|
57603
|
+
focusRecordsRef: prop_types_default.a.object,
|
|
57604
|
+
multiple: prop_types_default.a.bool
|
|
56894
57605
|
};
|
|
56895
57606
|
month_Month.defaultProps = {
|
|
56896
57607
|
month: new Date(),
|
|
@@ -57577,13 +58288,14 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
|
|
|
57577
58288
|
transform: itemTrans
|
|
57578
58289
|
} = item;
|
|
57579
58290
|
const transform = typeof itemTrans === 'function' ? itemTrans : commonTrans;
|
|
58291
|
+
const selected = selectedIndex === index;
|
|
57580
58292
|
const cls = classnames_default()({
|
|
57581
|
-
["".concat(scrollList_constants_cssClasses.PREFIX, "-item-sel")]:
|
|
58293
|
+
["".concat(scrollList_constants_cssClasses.PREFIX, "-item-sel")]: selected && mode !== wheelMode,
|
|
57582
58294
|
["".concat(scrollList_constants_cssClasses.PREFIX, "-item-disabled")]: Boolean(item.disabled)
|
|
57583
58295
|
});
|
|
57584
58296
|
let text = '';
|
|
57585
58297
|
|
|
57586
|
-
if (
|
|
58298
|
+
if (selected) {
|
|
57587
58299
|
if (typeof transform === 'function') {
|
|
57588
58300
|
text = transform(item.value, item.text);
|
|
57589
58301
|
} else {
|
|
@@ -57607,7 +58319,10 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
|
|
|
57607
58319
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", assign_default()({
|
|
57608
58320
|
key: prefixKey + index
|
|
57609
58321
|
}, events, {
|
|
57610
|
-
className: cls
|
|
58322
|
+
className: cls,
|
|
58323
|
+
role: "option",
|
|
58324
|
+
"aria-selected": selected,
|
|
58325
|
+
"aria-disabled": item.disabled
|
|
57611
58326
|
}), text)
|
|
57612
58327
|
);
|
|
57613
58328
|
});
|
|
@@ -57626,6 +58341,9 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
|
|
|
57626
58341
|
className: wrapperCls,
|
|
57627
58342
|
ref: this._cacheWrapperNode
|
|
57628
58343
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
|
|
58344
|
+
role: "listbox",
|
|
58345
|
+
"aria-multiselectable": false,
|
|
58346
|
+
"aria-label": this.props['aria-label'],
|
|
57629
58347
|
ref: this._cacheListNode
|
|
57630
58348
|
}, inner));
|
|
57631
58349
|
};
|
|
@@ -57683,6 +58401,9 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
|
|
|
57683
58401
|
ref: this._cacheWrapperNode,
|
|
57684
58402
|
onScroll: this.scrollToSelectItem
|
|
57685
58403
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
|
|
58404
|
+
role: "listbox",
|
|
58405
|
+
"aria-label": this.props['aria-label'],
|
|
58406
|
+
"aria-multiselectable": false,
|
|
57686
58407
|
ref: this._cacheListNode,
|
|
57687
58408
|
onClick: this.clickToSelectItem
|
|
57688
58409
|
}, prependList, inner, appendList)));
|
|
@@ -58705,6 +59426,7 @@ class yearAndMonth_YearAndMonth extends baseComponent_BaseComponent {
|
|
|
58705
59426
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
58706
59427
|
noHorizontalPadding: false,
|
|
58707
59428
|
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconChevronLeft, {
|
|
59429
|
+
"aria-hidden": true,
|
|
58708
59430
|
size: iconSize
|
|
58709
59431
|
}),
|
|
58710
59432
|
size: buttonSize,
|
|
@@ -58744,6 +59466,10 @@ yearAndMonth_YearAndMonth.defaultProps = {
|
|
|
58744
59466
|
|
|
58745
59467
|
|
|
58746
59468
|
|
|
59469
|
+
/* eslint-disable jsx-a11y/interactive-supports-focus,jsx-a11y/click-events-have-key-events */
|
|
59470
|
+
|
|
59471
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
59472
|
+
|
|
58747
59473
|
/* eslint-disable react/no-did-update-set-state */
|
|
58748
59474
|
|
|
58749
59475
|
/* eslint-disable max-len */
|
|
@@ -59019,6 +59745,9 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59019
59745
|
monthRight,
|
|
59020
59746
|
currentPanelHeight
|
|
59021
59747
|
} = this.state;
|
|
59748
|
+
const {
|
|
59749
|
+
insetInput
|
|
59750
|
+
} = this.props;
|
|
59022
59751
|
const panelDetail = panelType === datePicker_constants_strings.PANEL_TYPE_RIGHT ? monthRight : monthLeft;
|
|
59023
59752
|
const {
|
|
59024
59753
|
isTimePickerOpen,
|
|
@@ -59041,7 +59770,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59041
59770
|
style.minWidth = wrap.getBoundingClientRect().width;
|
|
59042
59771
|
}
|
|
59043
59772
|
|
|
59044
|
-
if (this.leftIsYearOrTime() && this.rightIsYearOrTime()) {
|
|
59773
|
+
if (this.leftIsYearOrTime() && this.rightIsYearOrTime() && !insetInput) {
|
|
59045
59774
|
/**
|
|
59046
59775
|
* left和right同时为tpk时,panel会有一个minHeight
|
|
59047
59776
|
* 如果缓存的currentPanelHeight为0,则需要计算滚动列表的高度
|
|
@@ -59051,7 +59780,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59051
59780
|
* When left and right are tpk at the same time, the panel will have a minHeight
|
|
59052
59781
|
* If the cached currentPanelHeight is 0, you need to calculate the height of the scrolling list
|
|
59053
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)
|
|
59054
|
-
* See packages/semi-foundation/scrollList/
|
|
59783
|
+
* See packages/semi-foundation/scrollList/itemFoundation.js initWheelList function
|
|
59055
59784
|
*/
|
|
59056
59785
|
style.minHeight = currentPanelHeight ? currentPanelHeight : this.calcScrollListHeight();
|
|
59057
59786
|
}
|
|
@@ -59059,10 +59788,14 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59059
59788
|
monthCls = classnames_default()(monthCls, "".concat(monthsGrid_prefixCls, "-yam-showing"));
|
|
59060
59789
|
}
|
|
59061
59790
|
|
|
59791
|
+
const _isDatePanelOpen = !(isYearPickerOpen || isTimePickerOpen);
|
|
59792
|
+
|
|
59793
|
+
const xOpenType = _isDatePanelOpen ? 'date' : isYearPickerOpen ? 'year' : 'time';
|
|
59062
59794
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
59063
59795
|
className: monthCls,
|
|
59064
59796
|
key: panelType,
|
|
59065
|
-
style: style
|
|
59797
|
+
style: style,
|
|
59798
|
+
"x-open-type": xOpenType
|
|
59066
59799
|
}, yearAndMonthLayer, timePickerLayer, this.foundation.isRangeType() ? panelContent : isYearPickerOpen || isTimePickerOpen ? null : panelContent, this.renderSwitch(panelType));
|
|
59067
59800
|
}
|
|
59068
59801
|
|
|
@@ -59099,7 +59832,8 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59099
59832
|
endDateOffset,
|
|
59100
59833
|
density,
|
|
59101
59834
|
rangeInputFocus,
|
|
59102
|
-
syncSwitchMonth
|
|
59835
|
+
syncSwitchMonth,
|
|
59836
|
+
multiple
|
|
59103
59837
|
} = this.props;
|
|
59104
59838
|
let monthText = ''; // i18n monthText
|
|
59105
59839
|
|
|
@@ -59165,7 +59899,8 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59165
59899
|
onWeeksRowNumChange: weeksRowNum => this.handleWeeksRowNumChange(weeksRowNum, panelType),
|
|
59166
59900
|
startDateOffset: startDateOffset,
|
|
59167
59901
|
endDateOffset: endDateOffset,
|
|
59168
|
-
focusRecordsRef: this.props.focusRecordsRef
|
|
59902
|
+
focusRecordsRef: this.props.focusRecordsRef,
|
|
59903
|
+
multiple: multiple
|
|
59169
59904
|
}));
|
|
59170
59905
|
}
|
|
59171
59906
|
|
|
@@ -59271,10 +60006,11 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59271
60006
|
locale,
|
|
59272
60007
|
disabledTimePicker,
|
|
59273
60008
|
density,
|
|
59274
|
-
dateFnsLocale
|
|
59275
|
-
|
|
60009
|
+
dateFnsLocale,
|
|
60010
|
+
insetInput
|
|
60011
|
+
} = this.props; // Type: date, dateRange, year, month, inset input no rendering required
|
|
59276
60012
|
|
|
59277
|
-
if (!includes_default()(type).call(type, 'Time')) {
|
|
60013
|
+
if (!includes_default()(type).call(type, 'Time') || insetInput) {
|
|
59278
60014
|
return null;
|
|
59279
60015
|
} // switch year/month & time
|
|
59280
60016
|
|
|
@@ -59321,14 +60057,22 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59321
60057
|
className: switchCls,
|
|
59322
60058
|
ref: current => this.adapter.setCache("switch-".concat(panelType), current)
|
|
59323
60059
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
60060
|
+
role: "button",
|
|
60061
|
+
"aria-label": "Switch to date panel",
|
|
59324
60062
|
className: dateCls,
|
|
59325
60063
|
onClick: e => this.foundation.showDatePanel(panelType)
|
|
59326
|
-
}, showSwithIcon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCalendar,
|
|
60064
|
+
}, showSwithIcon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCalendar, {
|
|
60065
|
+
"aria-hidden": true
|
|
60066
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
59327
60067
|
className: textCls
|
|
59328
60068
|
}, dateText || monthText)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
60069
|
+
role: "button",
|
|
60070
|
+
"aria-label": "Switch to time panel",
|
|
59329
60071
|
className: timeCls,
|
|
59330
60072
|
onClick: e => this.foundation.showTimePicker(panelType, true)
|
|
59331
|
-
}, showSwithIcon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClock,
|
|
60073
|
+
}, showSwithIcon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClock, {
|
|
60074
|
+
"aria-hidden": true
|
|
60075
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
59332
60076
|
className: textCls
|
|
59333
60077
|
}, timeText)));
|
|
59334
60078
|
}
|
|
@@ -59339,7 +60083,8 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59339
60083
|
monthRight
|
|
59340
60084
|
} = this.state;
|
|
59341
60085
|
const {
|
|
59342
|
-
type
|
|
60086
|
+
type,
|
|
60087
|
+
insetInput
|
|
59343
60088
|
} = this.props;
|
|
59344
60089
|
const monthGridCls = classnames_default()({
|
|
59345
60090
|
["".concat(monthsGrid_prefixCls, "-month-grid")]: true
|
|
@@ -59361,6 +60106,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
59361
60106
|
className: monthGridCls,
|
|
59362
60107
|
"x-type": type,
|
|
59363
60108
|
"x-panel-yearandmonth-open-type": yearOpenType,
|
|
60109
|
+
"x-insetInput": insetInput ? "true" : "false",
|
|
59364
60110
|
ref: current => this.cacheRefCurrent('monthGrid', current)
|
|
59365
60111
|
}, content);
|
|
59366
60112
|
}
|
|
@@ -59417,6 +60163,8 @@ monthsGrid_MonthsGrid.defaultProps = {
|
|
|
59417
60163
|
|
|
59418
60164
|
|
|
59419
60165
|
|
|
60166
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events */
|
|
60167
|
+
|
|
59420
60168
|
|
|
59421
60169
|
|
|
59422
60170
|
|
|
@@ -59510,8 +60258,15 @@ var datePicker = __webpack_require__("IJ0B");
|
|
|
59510
60258
|
|
|
59511
60259
|
|
|
59512
60260
|
|
|
60261
|
+
|
|
60262
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/interactive-supports-focus */
|
|
60263
|
+
|
|
59513
60264
|
/* eslint-disable max-len */
|
|
59514
60265
|
|
|
60266
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
60267
|
+
|
|
60268
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
60269
|
+
|
|
59515
60270
|
|
|
59516
60271
|
|
|
59517
60272
|
|
|
@@ -59564,6 +60319,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59564
60319
|
return _this.foundation.handleInputChange(...arguments);
|
|
59565
60320
|
};
|
|
59566
60321
|
|
|
60322
|
+
this.handleInsetInputChange = options => this.foundation.handleInsetInputChange(options);
|
|
60323
|
+
|
|
59567
60324
|
this.handleInputComplete = v => this.foundation.handleInputComplete(v);
|
|
59568
60325
|
|
|
59569
60326
|
this.handleInputBlur = e => this.foundation.handleInputBlur(get_default()(e, 'nativeEvent.target.value'), e);
|
|
@@ -59592,6 +60349,30 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59592
60349
|
}
|
|
59593
60350
|
};
|
|
59594
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
|
+
|
|
59595
60376
|
this.handleConfirm = e => this.foundation.handleConfirm();
|
|
59596
60377
|
|
|
59597
60378
|
this.handleCancel = e => this.foundation.handleCancel();
|
|
@@ -59615,19 +60396,43 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59615
60396
|
dropdownStyle,
|
|
59616
60397
|
density,
|
|
59617
60398
|
topSlot,
|
|
59618
|
-
bottomSlot
|
|
60399
|
+
bottomSlot,
|
|
60400
|
+
insetInput,
|
|
60401
|
+
type,
|
|
60402
|
+
format,
|
|
60403
|
+
rangeSeparator
|
|
59619
60404
|
} = this.props;
|
|
60405
|
+
const {
|
|
60406
|
+
insetInputValue,
|
|
60407
|
+
value
|
|
60408
|
+
} = this.state;
|
|
59620
60409
|
const wrapCls = classnames_default()(datePicker_constants_cssClasses.PREFIX, {
|
|
59621
60410
|
[datePicker_constants_cssClasses.PANEL_YAM]: this.adapter.typeIsYearOrMonth(),
|
|
59622
60411
|
["".concat(datePicker_constants_cssClasses.PREFIX, "-compact")]: density === 'compact'
|
|
59623
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
|
+
};
|
|
59624
60427
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
59625
60428
|
ref: this.panelRef,
|
|
59626
60429
|
className: wrapCls,
|
|
59627
60430
|
style: dropdownStyle
|
|
59628
60431
|
}, topSlot && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
59629
60432
|
className: "".concat(datePicker_constants_cssClasses.PREFIX, "-topSlot")
|
|
59630
|
-
}, topSlot),
|
|
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", {
|
|
59631
60436
|
className: "".concat(datePicker_constants_cssClasses.PREFIX, "-bottomSlot")
|
|
59632
60437
|
}, bottomSlot), this.renderFooter(locale, localeCode));
|
|
59633
60438
|
};
|
|
@@ -59691,7 +60496,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59691
60496
|
position: position,
|
|
59692
60497
|
visible: panelShow,
|
|
59693
60498
|
stopPropagation: stopPropagation,
|
|
59694
|
-
spacing: spacing
|
|
60499
|
+
spacing: spacing,
|
|
60500
|
+
onVisibleChange: this.handlePanelVisibleChange
|
|
59695
60501
|
}, children);
|
|
59696
60502
|
};
|
|
59697
60503
|
|
|
@@ -59704,7 +60510,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59704
60510
|
prevTimeZone: null,
|
|
59705
60511
|
motionEnd: false,
|
|
59706
60512
|
rangeInputFocus: undefined,
|
|
59707
|
-
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
|
|
59708
60516
|
};
|
|
59709
60517
|
this.adapter.setCache('cachedSelectedValue', null);
|
|
59710
60518
|
this.triggerElRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
@@ -59807,6 +60615,17 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59807
60615
|
inputValue
|
|
59808
60616
|
});
|
|
59809
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
|
+
},
|
|
59810
60629
|
needConfirm: () => {
|
|
59811
60630
|
var _context;
|
|
59812
60631
|
|
|
@@ -59881,7 +60700,38 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59881
60700
|
}
|
|
59882
60701
|
},
|
|
59883
60702
|
couldPanelClosed: () => this.focusRecordsRef.current.rangeStart && this.focusRecordsRef.current.rangeEnd,
|
|
59884
|
-
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
|
+
}
|
|
59885
60735
|
});
|
|
59886
60736
|
}
|
|
59887
60737
|
|
|
@@ -59939,7 +60789,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59939
60789
|
syncSwitchMonth,
|
|
59940
60790
|
onPanelChange,
|
|
59941
60791
|
timeZone,
|
|
59942
|
-
triggerRender
|
|
60792
|
+
triggerRender,
|
|
60793
|
+
insetInput
|
|
59943
60794
|
} = this.props;
|
|
59944
60795
|
const {
|
|
59945
60796
|
value,
|
|
@@ -59987,7 +60838,8 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59987
60838
|
onPanelChange: onPanelChange,
|
|
59988
60839
|
timeZone: timeZone,
|
|
59989
60840
|
focusRecordsRef: this.focusRecordsRef,
|
|
59990
|
-
triggerRender: triggerRender
|
|
60841
|
+
triggerRender: triggerRender,
|
|
60842
|
+
insetInput: insetInput
|
|
59991
60843
|
});
|
|
59992
60844
|
}
|
|
59993
60845
|
|
|
@@ -60023,20 +60875,23 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
60023
60875
|
triggerRender,
|
|
60024
60876
|
size,
|
|
60025
60877
|
inputReadOnly,
|
|
60026
|
-
rangeSeparator
|
|
60878
|
+
rangeSeparator,
|
|
60879
|
+
insetInput
|
|
60027
60880
|
} = this.props;
|
|
60028
60881
|
const {
|
|
60029
60882
|
value,
|
|
60030
60883
|
inputValue,
|
|
60031
|
-
rangeInputFocus
|
|
60884
|
+
rangeInputFocus,
|
|
60885
|
+
triggerDisabled
|
|
60032
60886
|
} = this.state; // This class is not needed when triggerRender is function
|
|
60033
60887
|
|
|
60034
60888
|
const isRangeType = this.isRangeType(type, triggerRender);
|
|
60889
|
+
const inputDisabled = disabled || insetInput && triggerDisabled;
|
|
60035
60890
|
const inputCls = classnames_default()("".concat(datePicker_constants_cssClasses.PREFIX, "-input"), {
|
|
60036
60891
|
["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input")]: isRangeType,
|
|
60037
60892
|
[concat_default()(_context3 = "".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-")).call(_context3, size)]: isRangeType && size,
|
|
60038
|
-
["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-active")]: isRangeType && rangeInputFocus && !
|
|
60039
|
-
["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-disabled")]: isRangeType &&
|
|
60893
|
+
["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-active")]: isRangeType && rangeInputFocus && !inputDisabled,
|
|
60894
|
+
["".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-disabled")]: isRangeType && inputDisabled,
|
|
60040
60895
|
[concat_default()(_context4 = "".concat(datePicker_constants_cssClasses.PREFIX, "-range-input-")).call(_context4, validateStatus)]: isRangeType && validateStatus
|
|
60041
60896
|
});
|
|
60042
60897
|
const phText = placeholder || locale.placeholder[type]; // i18n
|
|
@@ -60044,9 +60899,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
60044
60899
|
|
|
60045
60900
|
const props = assign_default()(assign_default()({}, extraProps), {
|
|
60046
60901
|
placeholder: phText,
|
|
60047
|
-
disabled,
|
|
60902
|
+
disabled: inputDisabled,
|
|
60048
60903
|
inputValue,
|
|
60049
|
-
value,
|
|
60904
|
+
value: value,
|
|
60050
60905
|
onChange: this.handleInputChange,
|
|
60051
60906
|
onEnterPress: this.handleInputComplete,
|
|
60052
60907
|
// TODO: remove in next major version
|
|
@@ -60059,7 +60914,7 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
60059
60914
|
format,
|
|
60060
60915
|
multiple,
|
|
60061
60916
|
validateStatus,
|
|
60062
|
-
inputReadOnly,
|
|
60917
|
+
inputReadOnly: inputReadOnly || insetInput,
|
|
60063
60918
|
// onClick: this.handleOpenPanel,
|
|
60064
60919
|
onBlur: this.handleInputBlur,
|
|
60065
60920
|
onFocus: this.handleInputFocus,
|
|
@@ -60068,27 +60923,28 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
60068
60923
|
size,
|
|
60069
60924
|
autofocus: this.state.autofocus,
|
|
60070
60925
|
dateFnsLocale,
|
|
60071
|
-
rangeInputStartRef: this.rangeInputStartRef,
|
|
60072
|
-
rangeInputEndRef: this.rangeInputEndRef,
|
|
60073
60926
|
rangeInputFocus,
|
|
60074
60927
|
rangeSeparator,
|
|
60075
60928
|
onRangeBlur: this.handleRangeInputBlur,
|
|
60076
60929
|
onRangeClear: this.handleRangeInputClear,
|
|
60077
|
-
onRangeEndTabPress: this.handleRangeEndTabPress
|
|
60930
|
+
onRangeEndTabPress: this.handleRangeEndTabPress,
|
|
60931
|
+
rangeInputStartRef: insetInput ? null : this.rangeInputStartRef,
|
|
60932
|
+
rangeInputEndRef: insetInput ? null : this.rangeInputEndRef
|
|
60078
60933
|
});
|
|
60079
60934
|
|
|
60080
|
-
return (
|
|
60081
|
-
|
|
60082
|
-
// eslint-disable-next-line jsx-a11y/
|
|
60083
|
-
|
|
60084
|
-
|
|
60085
|
-
|
|
60086
|
-
|
|
60087
|
-
|
|
60088
|
-
|
|
60089
|
-
|
|
60090
|
-
|
|
60091
|
-
|
|
60935
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
60936
|
+
// tooltip will mount a11y props to children
|
|
60937
|
+
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
60938
|
+
role: "combobox",
|
|
60939
|
+
"aria-label": is_array_default()(value) && value.length ? "Change date" : "Choose date",
|
|
60940
|
+
"aria-disabled": disabled,
|
|
60941
|
+
onClick: this.handleTriggerWrapperClick,
|
|
60942
|
+
className: inputCls
|
|
60943
|
+
}, typeof triggerRender === 'function' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(trigger_0, assign_default()({}, props, {
|
|
60944
|
+
triggerRender: triggerRender,
|
|
60945
|
+
componentName: "DatePicker",
|
|
60946
|
+
componentProps: assign_default()({}, this.props)
|
|
60947
|
+
})) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(dateInput_DateInput, assign_default()({}, props)));
|
|
60092
60948
|
}
|
|
60093
60949
|
|
|
60094
60950
|
render() {
|
|
@@ -60221,7 +61077,8 @@ datePicker_DatePicker.defaultProps = {
|
|
|
60221
61077
|
spacing: datePicker_constants_numbers.SPACING,
|
|
60222
61078
|
autoSwitchDate: true,
|
|
60223
61079
|
syncSwitchMonth: false,
|
|
60224
|
-
rangeSeparator: datePicker_constants_strings.DEFAULT_SEPARATOR_RANGE
|
|
61080
|
+
rangeSeparator: datePicker_constants_strings.DEFAULT_SEPARATOR_RANGE,
|
|
61081
|
+
insetInput: false
|
|
60225
61082
|
};
|
|
60226
61083
|
// CONCATENATED MODULE: ./datePicker/index.tsx
|
|
60227
61084
|
|
|
@@ -60237,6 +61094,8 @@ datePicker_DatePicker.defaultProps = {
|
|
|
60237
61094
|
|
|
60238
61095
|
|
|
60239
61096
|
|
|
61097
|
+
|
|
61098
|
+
|
|
60240
61099
|
/* harmony default export */ var datePicker_0 = (forwardStatics( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.forwardRef((props, ref) => {
|
|
60241
61100
|
const propsObj = assign_default()({}, props);
|
|
60242
61101
|
|
|
@@ -60261,6 +61120,24 @@ datePicker_DatePicker.defaultProps = {
|
|
|
60261
61120
|
propsObj.rangeSeparator = " ".concat(trim_default()(rangeSeparator).call(rangeSeparator), " ");
|
|
60262
61121
|
}
|
|
60263
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
|
+
|
|
60264
61141
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(configProvider_context.Consumer, null, _ref => {
|
|
60265
61142
|
let {
|
|
60266
61143
|
timeZone
|
|
@@ -66248,6 +67125,7 @@ class Item_NavItem extends baseComponent_BaseComponent {
|
|
|
66248
67125
|
var _context3;
|
|
66249
67126
|
|
|
66250
67127
|
let isToggleIcon = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
67128
|
+
let key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
66251
67129
|
|
|
66252
67130
|
if (this.props.isSubNav) {
|
|
66253
67131
|
return null;
|
|
@@ -66268,7 +67146,8 @@ class Item_NavItem extends baseComponent_BaseComponent {
|
|
|
66268
67146
|
["".concat(Item_clsPrefix, "-icon-info")]: !isToggleIcon
|
|
66269
67147
|
});
|
|
66270
67148
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
|
|
66271
|
-
className: className
|
|
67149
|
+
className: className,
|
|
67150
|
+
key: key
|
|
66272
67151
|
}, Object(_utils["d" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
|
|
66273
67152
|
size: icon.props.size || iconSize
|
|
66274
67153
|
}) : icon);
|
|
@@ -66308,12 +67187,12 @@ class Item_NavItem extends baseComponent_BaseComponent {
|
|
|
66308
67187
|
|
|
66309
67188
|
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
|
|
66310
67189
|
const iconAmount = icon && !indent ? level : level - 1;
|
|
66311
|
-
placeholderIcons = times_default()(iconAmount,
|
|
67190
|
+
placeholderIcons = times_default()(iconAmount, index => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false, index));
|
|
66312
67191
|
}
|
|
66313
67192
|
|
|
66314
|
-
itemChildren = /*#__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, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true), icon || indent || isInSubNav ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT) : null, !isNullOrUndefined(text) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
67193
|
+
itemChildren = /*#__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, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true, 'key-toggle-pos-right'), icon || indent || isInSubNav ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT, false, 'key-position-left') : null, !isNullOrUndefined(text) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
66315
67194
|
className: "".concat(navigation_constants_cssClasses.PREFIX, "-item-text")
|
|
66316
|
-
}, text) : '', this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_RIGHT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true));
|
|
67195
|
+
}, text) : '', this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_RIGHT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true, 'key-toggle-pos-right'));
|
|
66317
67196
|
}
|
|
66318
67197
|
|
|
66319
67198
|
if (typeof link === 'string') {
|
|
@@ -66754,7 +67633,7 @@ class SubNav_SubNav extends baseComponent_BaseComponent {
|
|
|
66754
67633
|
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
|
|
66755
67634
|
/* Different icons' amount means different indents.*/
|
|
66756
67635
|
const iconAmount = icon && !indent ? level : level - 1;
|
|
66757
|
-
placeholderIcons = times_default()(iconAmount, index => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false,
|
|
67636
|
+
placeholderIcons = times_default()(iconAmount, index => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false, false, index));
|
|
66758
67637
|
}
|
|
66759
67638
|
|
|
66760
67639
|
const titleDiv = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
@@ -66766,7 +67645,7 @@ class SubNav_SubNav extends baseComponent_BaseComponent {
|
|
|
66766
67645
|
onKeyPress: this.handleKeyPress
|
|
66767
67646
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
66768
67647
|
className: "".concat(prefixCls, "-item-inner")
|
|
66769
|
-
}, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIconType, navigation_constants_strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-left'), icon || indent || isInSubNav && mode !== navigation_constants_strings.MODE_HORIZONTAL ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT,
|
|
67648
|
+
}, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIconType, navigation_constants_strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-left'), icon || indent || isInSubNav && mode !== navigation_constants_strings.MODE_HORIZONTAL ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT, false, false, 'key-inSubNav-position-left') : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
66770
67649
|
className: "".concat(prefixCls, "-item-text")
|
|
66771
67650
|
}, text), this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_RIGHT && this.renderIcon(toggleIconType, navigation_constants_strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-right')));
|
|
66772
67651
|
return titleDiv;
|
|
@@ -84826,8 +85705,13 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
84826
85705
|
const {
|
|
84827
85706
|
flattenedColumns,
|
|
84828
85707
|
getCellWidths
|
|
84829
|
-
} = _this.context;
|
|
84830
|
-
|
|
85708
|
+
} = _this.context; // we use memoized cellWidths to avoid re-render expanded row (fix #686)
|
|
85709
|
+
|
|
85710
|
+
if (flattenedColumns !== _this.flattenedColumns) {
|
|
85711
|
+
_this.flattenedColumns = flattenedColumns;
|
|
85712
|
+
_this.cellWidths = getCellWidths(flattenedColumns);
|
|
85713
|
+
}
|
|
85714
|
+
|
|
84831
85715
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ExpandedRow_TableExpandedRow, {
|
|
84832
85716
|
style: style,
|
|
84833
85717
|
components: components,
|
|
@@ -84839,7 +85723,7 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
84839
85723
|
index: index,
|
|
84840
85724
|
virtualized: virtualized,
|
|
84841
85725
|
key: genExpandedRowKey(key),
|
|
84842
|
-
cellWidths: cellWidths
|
|
85726
|
+
cellWidths: _this.cellWidths
|
|
84843
85727
|
});
|
|
84844
85728
|
};
|
|
84845
85729
|
/**
|
|
@@ -85017,7 +85901,9 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
85017
85901
|
};
|
|
85018
85902
|
this.listRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
85019
85903
|
const {
|
|
85020
|
-
getVirtualizedListRef
|
|
85904
|
+
getVirtualizedListRef,
|
|
85905
|
+
flattenedColumns,
|
|
85906
|
+
getCellWidths
|
|
85021
85907
|
} = context;
|
|
85022
85908
|
|
|
85023
85909
|
if (getVirtualizedListRef) {
|
|
@@ -85029,6 +85915,8 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
85029
85915
|
}
|
|
85030
85916
|
|
|
85031
85917
|
this.foundation = new bodyFoundation_TableBodyFoundation(this.adapter);
|
|
85918
|
+
this.flattenedColumns = flattenedColumns;
|
|
85919
|
+
this.cellWidths = getCellWidths(flattenedColumns);
|
|
85032
85920
|
this.observer = null;
|
|
85033
85921
|
}
|
|
85034
85922
|
|
|
@@ -92219,12 +93107,13 @@ class nodeList_NodeList extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
92219
93107
|
const {
|
|
92220
93108
|
flattenNodes,
|
|
92221
93109
|
motionType,
|
|
93110
|
+
searchTargetIsDeep,
|
|
92222
93111
|
renderTreeNode
|
|
92223
93112
|
} = this.props;
|
|
92224
93113
|
const {
|
|
92225
93114
|
transitionNodes
|
|
92226
93115
|
} = this.state;
|
|
92227
|
-
const mapData = transitionNodes.length ? transitionNodes : flattenNodes;
|
|
93116
|
+
const mapData = transitionNodes.length && !searchTargetIsDeep ? transitionNodes : flattenNodes;
|
|
92228
93117
|
|
|
92229
93118
|
const options = map_default()(mapData).call(mapData, treeNode => {
|
|
92230
93119
|
const isMotionNode = is_array_default()(treeNode);
|
|
@@ -92474,7 +93363,8 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92474
93363
|
const isSeaching = Boolean(props.filterTreeNode && prevState.inputValue && prevState.inputValue.length);
|
|
92475
93364
|
const newState = {
|
|
92476
93365
|
prevProps: props
|
|
92477
|
-
};
|
|
93366
|
+
};
|
|
93367
|
+
const isExpandControlled = ('expandedKeys' in props); // Accept a props field as a parameter to determine whether to update the field
|
|
92478
93368
|
|
|
92479
93369
|
const needUpdate = name => {
|
|
92480
93370
|
const firstInProps = !prevProps && name in props;
|
|
@@ -92518,7 +93408,8 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92518
93408
|
}
|
|
92519
93409
|
}
|
|
92520
93410
|
|
|
92521
|
-
const
|
|
93411
|
+
const dataUpdated = needUpdate('treeDataSimpleJson') || needUpdate('treeData');
|
|
93412
|
+
const expandAllWhenDataChange = dataUpdated && props.expandAll;
|
|
92522
93413
|
|
|
92523
93414
|
if (!isSeaching) {
|
|
92524
93415
|
// Update expandedKeys
|
|
@@ -92544,7 +93435,7 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92544
93435
|
newState.expandedKeys = calcExpandedKeys(props.defaultExpandedKeys, keyEntities);
|
|
92545
93436
|
} else if (!prevProps && props.defaultValue) {
|
|
92546
93437
|
newState.expandedKeys = calcExpandedKeysForValues(props.defaultValue, keyEntities, props.multiple, valueEntities);
|
|
92547
|
-
} else if (!prevProps && props.value) {
|
|
93438
|
+
} else if ((!prevProps || !isExpandControlled && dataUpdated) && props.value) {
|
|
92548
93439
|
newState.expandedKeys = calcExpandedKeysForValues(props.value, keyEntities, props.multiple, valueEntities);
|
|
92549
93440
|
}
|
|
92550
93441
|
|
|
@@ -93046,6 +93937,7 @@ const treeSelect_constants_numbers = {};
|
|
|
93046
93937
|
|
|
93047
93938
|
|
|
93048
93939
|
|
|
93940
|
+
|
|
93049
93941
|
|
|
93050
93942
|
|
|
93051
93943
|
// eslint-disable-next-line max-len
|
|
@@ -93188,7 +94080,7 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93188
94080
|
const isSearching = Boolean(inputValue);
|
|
93189
94081
|
const treeNodeProps = {
|
|
93190
94082
|
eventKey: key,
|
|
93191
|
-
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
94083
|
+
expanded: isSearching && !this._isExpandControlled() ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
93192
94084
|
selected: includes_default()(selectedKeys).call(selectedKeys, key),
|
|
93193
94085
|
checked: realChecked,
|
|
93194
94086
|
halfChecked: realHalfChecked,
|
|
@@ -93475,20 +94367,25 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93475
94367
|
|
|
93476
94368
|
clearInput() {
|
|
93477
94369
|
const {
|
|
94370
|
+
flattenNodes,
|
|
93478
94371
|
expandedKeys,
|
|
93479
94372
|
selectedKeys,
|
|
93480
94373
|
keyEntities,
|
|
93481
94374
|
treeData
|
|
93482
94375
|
} = this.getStates();
|
|
94376
|
+
const newExpandedKeys = new set_default.a(expandedKeys);
|
|
94377
|
+
|
|
94378
|
+
const isExpandControlled = this._isExpandControlled();
|
|
94379
|
+
|
|
93483
94380
|
const expandedOptsKeys = findAncestorKeys(selectedKeys, keyEntities);
|
|
93484
94381
|
|
|
93485
|
-
for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item =>
|
|
94382
|
+
for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item => newExpandedKeys.add(item));
|
|
93486
94383
|
|
|
93487
|
-
const
|
|
94384
|
+
const newFlattenNodes = flattenTreeData(treeData, newExpandedKeys);
|
|
93488
94385
|
|
|
93489
94386
|
this._adapter.updateState({
|
|
93490
|
-
expandedKeys,
|
|
93491
|
-
flattenNodes,
|
|
94387
|
+
expandedKeys: isExpandControlled ? expandedKeys : newExpandedKeys,
|
|
94388
|
+
flattenNodes: isExpandControlled ? flattenNodes : newFlattenNodes,
|
|
93492
94389
|
inputValue: '',
|
|
93493
94390
|
motionKeys: new set_default.a([]),
|
|
93494
94391
|
filteredKeys: new set_default.a([]),
|
|
@@ -93502,6 +94399,7 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93502
94399
|
this._adapter.updateInputValue(sugInput);
|
|
93503
94400
|
|
|
93504
94401
|
const {
|
|
94402
|
+
flattenNodes,
|
|
93505
94403
|
expandedKeys,
|
|
93506
94404
|
selectedKeys,
|
|
93507
94405
|
keyEntities,
|
|
@@ -93512,17 +94410,18 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93512
94410
|
filterTreeNode,
|
|
93513
94411
|
treeNodeFilterProp
|
|
93514
94412
|
} = this.getProps();
|
|
94413
|
+
const newExpandedKeys = new set_default.a(expandedKeys);
|
|
93515
94414
|
let filteredOptsKeys = [];
|
|
93516
94415
|
let expandedOptsKeys = [];
|
|
93517
|
-
let
|
|
94416
|
+
let newFlattenNodes = [];
|
|
93518
94417
|
let filteredShownKeys = new set_default.a([]);
|
|
93519
94418
|
|
|
93520
94419
|
if (!sugInput) {
|
|
93521
94420
|
expandedOptsKeys = findAncestorKeys(selectedKeys, keyEntities);
|
|
93522
94421
|
|
|
93523
|
-
for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item =>
|
|
94422
|
+
for_each_default()(expandedOptsKeys).call(expandedOptsKeys, item => newExpandedKeys.add(item));
|
|
93524
94423
|
|
|
93525
|
-
|
|
94424
|
+
newFlattenNodes = flattenTreeData(treeData, newExpandedKeys);
|
|
93526
94425
|
} else {
|
|
93527
94426
|
var _context3, _context4;
|
|
93528
94427
|
|
|
@@ -93535,17 +94434,19 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93535
94434
|
expandedOptsKeys = findAncestorKeys(filteredOptsKeys, keyEntities, false);
|
|
93536
94435
|
const shownChildKeys = findDescendantKeys(filteredOptsKeys, keyEntities, true);
|
|
93537
94436
|
filteredShownKeys = new set_default.a([...shownChildKeys, ...expandedOptsKeys]);
|
|
93538
|
-
|
|
94437
|
+
newFlattenNodes = flattenTreeData(treeData, new set_default.a(expandedOptsKeys), showFilteredOnly && filteredShownKeys);
|
|
93539
94438
|
}
|
|
93540
94439
|
|
|
93541
|
-
|
|
94440
|
+
const newFilteredExpandedKeys = new set_default.a(expandedOptsKeys);
|
|
94441
|
+
|
|
94442
|
+
this._adapter.notifySearch(sugInput, from_default()(newFilteredExpandedKeys));
|
|
93542
94443
|
|
|
93543
94444
|
this._adapter.updateState({
|
|
93544
|
-
expandedKeys,
|
|
93545
|
-
flattenNodes,
|
|
94445
|
+
expandedKeys: this._isExpandControlled() ? expandedKeys : newExpandedKeys,
|
|
94446
|
+
flattenNodes: this._isExpandControlled() ? flattenNodes : newFlattenNodes,
|
|
93546
94447
|
motionKeys: new set_default.a([]),
|
|
93547
94448
|
filteredKeys: new set_default.a(filteredOptsKeys),
|
|
93548
|
-
filteredExpandedKeys:
|
|
94449
|
+
filteredExpandedKeys: newFilteredExpandedKeys,
|
|
93549
94450
|
filteredShownKeys
|
|
93550
94451
|
});
|
|
93551
94452
|
}
|
|
@@ -93789,7 +94690,9 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93789
94690
|
return;
|
|
93790
94691
|
}
|
|
93791
94692
|
|
|
93792
|
-
|
|
94693
|
+
const isExpandControlled = this._isExpandControlled();
|
|
94694
|
+
|
|
94695
|
+
if (isSearching && !isExpandControlled) {
|
|
93793
94696
|
this.handleNodeExpandInSearch(e, treeNode);
|
|
93794
94697
|
return;
|
|
93795
94698
|
}
|
|
@@ -93817,7 +94720,7 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93817
94720
|
|
|
93818
94721
|
this._adapter.cacheFlattenNodes(motionType === 'hide' && this._isAnimated());
|
|
93819
94722
|
|
|
93820
|
-
if (!
|
|
94723
|
+
if (!isExpandControlled) {
|
|
93821
94724
|
const flattenNodes = flattenTreeData(treeData, expandedKeys);
|
|
93822
94725
|
const motionKeys = this._isAnimated() ? getMotionKeys(eventKey, expandedKeys, keyEntities) : [];
|
|
93823
94726
|
const newState = {
|
|
@@ -94629,7 +95532,8 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94629
95532
|
const {
|
|
94630
95533
|
flattenNodes,
|
|
94631
95534
|
motionKeys,
|
|
94632
|
-
motionType
|
|
95535
|
+
motionType,
|
|
95536
|
+
filteredKeys
|
|
94633
95537
|
} = this.state;
|
|
94634
95538
|
const {
|
|
94635
95539
|
direction
|
|
@@ -94638,6 +95542,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94638
95542
|
virtualize,
|
|
94639
95543
|
motionExpand
|
|
94640
95544
|
} = this.props;
|
|
95545
|
+
const isExpandControlled = ('expandedKeys' in this.props);
|
|
94641
95546
|
|
|
94642
95547
|
if (!virtualize || isEmpty_default()(virtualize)) {
|
|
94643
95548
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(nodeList_NodeList, {
|
|
@@ -94645,6 +95550,8 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94645
95550
|
flattenList: this._flattenNodes,
|
|
94646
95551
|
motionKeys: motionExpand ? motionKeys : new set_default.a([]),
|
|
94647
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),
|
|
94648
95555
|
onMotionEnd: this.onMotionEnd,
|
|
94649
95556
|
renderTreeNode: this.renderTreeNode
|
|
94650
95557
|
});
|
|
@@ -94964,8 +95871,8 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94964
95871
|
notifySelect: (selectKey, bool, node) => {
|
|
94965
95872
|
this.props.onSelect && this.props.onSelect(selectKey, bool, node);
|
|
94966
95873
|
},
|
|
94967
|
-
notifySearch: input => {
|
|
94968
|
-
this.props.onSearch && this.props.onSearch(input);
|
|
95874
|
+
notifySearch: (input, filteredExpandedKeys) => {
|
|
95875
|
+
this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys);
|
|
94969
95876
|
},
|
|
94970
95877
|
cacheFlattenNodes: bool => {
|
|
94971
95878
|
this._flattenNodes = bool ? treeUtil_cloneDeep(this.state.flattenNodes) : null;
|
|
@@ -102585,7 +103492,7 @@ function withField(Component, opts) {
|
|
|
102585
103492
|
text: label || field,
|
|
102586
103493
|
id: labelId,
|
|
102587
103494
|
required: required,
|
|
102588
|
-
name: name || field,
|
|
103495
|
+
name: a11yId || name || field,
|
|
102589
103496
|
width: mergeLabelWidth,
|
|
102590
103497
|
align: mergeLabelAlign
|
|
102591
103498
|
}, needSpread));
|