@patternfly/react-core 4.202.6 → 4.202.9
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/CHANGELOG.md +30 -0
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +2 -7
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +21 -14
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/esm/components/Select/SelectMenu.js +10 -1
- package/dist/esm/components/Select/SelectMenu.js.map +1 -1
- package/dist/esm/components/Select/SelectOption.js +1 -1
- package/dist/esm/components/Select/SelectOption.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +2 -7
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +21 -14
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/js/components/Select/SelectMenu.js +10 -1
- package/dist/js/components/Select/SelectMenu.js.map +1 -1
- package/dist/js/components/Select/SelectOption.js +1 -1
- package/dist/js/components/Select/SelectOption.js.map +1 -1
- package/dist/umd/react-core.css +77 -77
- package/dist/umd/react-core.js +34 -23
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/CalendarMonth/CalendarMonth.tsx +2 -7
- package/src/components/Select/Select.tsx +23 -17
- package/src/components/Select/SelectMenu.tsx +9 -1
- package/src/components/Select/SelectOption.tsx +1 -1
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +4 -4
package/dist/umd/react-core.css
CHANGED
|
@@ -17051,6 +17051,83 @@ label.pf-c-radio, .pf-c-radio__label,
|
|
|
17051
17051
|
box-shadow: var(--pf-c-select__menu-footer--BoxShadow);
|
|
17052
17052
|
}
|
|
17053
17053
|
|
|
17054
|
+
.pf-c-simple-list {
|
|
17055
|
+
--pf-c-simple-list__item-link--PaddingTop: var(--pf-global--spacer--xs);
|
|
17056
|
+
--pf-c-simple-list__item-link--PaddingRight: var(--pf-global--spacer--md);
|
|
17057
|
+
--pf-c-simple-list__item-link--PaddingBottom: var(--pf-global--spacer--xs);
|
|
17058
|
+
--pf-c-simple-list__item-link--PaddingLeft: var(--pf-global--spacer--md);
|
|
17059
|
+
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-global--BackgroundColor--100);
|
|
17060
|
+
--pf-c-simple-list__item-link--Color: var(--pf-global--Color--100);
|
|
17061
|
+
--pf-c-simple-list__item-link--FontSize: var(--pf-global--FontSize--sm);
|
|
17062
|
+
--pf-c-simple-list__item-link--FontWeight: var(--pf-global--FontWeight--normal);
|
|
17063
|
+
--pf-c-simple-list__item-link--m-current--Color: var(--pf-global--link--Color);
|
|
17064
|
+
--pf-c-simple-list__item-link--m-current--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
17065
|
+
--pf-c-simple-list__item-link--m-current--FontWeight: var(--pf-global--FontWeight--normal);
|
|
17066
|
+
--pf-c-simple-list__item-link--hover--Color: var(--pf-global--Color--100);
|
|
17067
|
+
--pf-c-simple-list__item-link--hover--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
17068
|
+
--pf-c-simple-list__item-link--focus--Color: var(--pf-global--Color--100);
|
|
17069
|
+
--pf-c-simple-list__item-link--focus--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
17070
|
+
--pf-c-simple-list__item-link--focus--FontWeight: var(--pf-global--FontWeight--normal);
|
|
17071
|
+
--pf-c-simple-list__item-link--active--Color: var(--pf-global--Color--100);
|
|
17072
|
+
--pf-c-simple-list__item-link--active--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
17073
|
+
--pf-c-simple-list__item-link--active--FontWeight: var(--pf-global--FontWeight--normal);
|
|
17074
|
+
--pf-c-simple-list__title--PaddingTop: var(--pf-global--spacer--sm);
|
|
17075
|
+
--pf-c-simple-list__title--PaddingRight: var(--pf-global--spacer--md);
|
|
17076
|
+
--pf-c-simple-list__title--PaddingBottom: var(--pf-global--spacer--sm);
|
|
17077
|
+
--pf-c-simple-list__title--PaddingLeft: var(--pf-global--spacer--md);
|
|
17078
|
+
--pf-c-simple-list__title--FontSize: var(--pf-global--FontSize--sm);
|
|
17079
|
+
--pf-c-simple-list__title--Color: var(--pf-global--Color--dark-200);
|
|
17080
|
+
--pf-c-simple-list__title--FontWeight: var(--pf-global--FontWeight--semi-bold);
|
|
17081
|
+
--pf-c-simple-list__section--section--MarginTop: var(--pf-global--spacer--sm);
|
|
17082
|
+
}
|
|
17083
|
+
|
|
17084
|
+
.pf-c-simple-list__item-link {
|
|
17085
|
+
display: block;
|
|
17086
|
+
width: 100%;
|
|
17087
|
+
padding: var(--pf-c-simple-list__item-link--PaddingTop) var(--pf-c-simple-list__item-link--PaddingRight) var(--pf-c-simple-list__item-link--PaddingBottom) var(--pf-c-simple-list__item-link--PaddingLeft);
|
|
17088
|
+
font-size: var(--pf-c-simple-list__item-link--FontSize);
|
|
17089
|
+
font-weight: var(--pf-c-simple-list__item-link--FontWeight);
|
|
17090
|
+
color: var(--pf-c-simple-list__item-link--Color);
|
|
17091
|
+
text-align: left;
|
|
17092
|
+
background-color: var(--pf-c-simple-list__item-link--BackgroundColor);
|
|
17093
|
+
border: none;
|
|
17094
|
+
}
|
|
17095
|
+
|
|
17096
|
+
.pf-c-simple-list__item-link:hover {
|
|
17097
|
+
text-decoration: none;
|
|
17098
|
+
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--hover--BackgroundColor);
|
|
17099
|
+
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--hover--Color);
|
|
17100
|
+
}
|
|
17101
|
+
|
|
17102
|
+
.pf-c-simple-list__item-link:focus {
|
|
17103
|
+
--pf-c-simple-list__item-link--FontWeight: var(--pf-c-simple-list__item-link--focus--FontWeight);
|
|
17104
|
+
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--focus--BackgroundColor);
|
|
17105
|
+
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--focus--Color);
|
|
17106
|
+
}
|
|
17107
|
+
|
|
17108
|
+
.pf-c-simple-list__item-link:active {
|
|
17109
|
+
--pf-c-simple-list__item-link--FontWeight: var(--pf-c-simple-list__item-link--active--FontWeight);
|
|
17110
|
+
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--active--BackgroundColor);
|
|
17111
|
+
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--active--Color);
|
|
17112
|
+
}
|
|
17113
|
+
|
|
17114
|
+
.pf-c-simple-list__item-link.pf-m-current {
|
|
17115
|
+
--pf-c-simple-list__item-link--FontWeight: var(--pf-c-simple-list__item-link--m-current--FontWeight);
|
|
17116
|
+
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--m-current--BackgroundColor);
|
|
17117
|
+
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--m-current--Color);
|
|
17118
|
+
}
|
|
17119
|
+
|
|
17120
|
+
.pf-c-simple-list__title {
|
|
17121
|
+
padding: var(--pf-c-simple-list__title--PaddingTop) var(--pf-c-simple-list__title--PaddingRight) var(--pf-c-simple-list__title--PaddingBottom) var(--pf-c-simple-list__title--PaddingLeft);
|
|
17122
|
+
font-size: var(--pf-c-simple-list__title--FontSize);
|
|
17123
|
+
font-weight: var(--pf-c-simple-list__title--FontWeight);
|
|
17124
|
+
color: var(--pf-c-simple-list__title--Color);
|
|
17125
|
+
}
|
|
17126
|
+
|
|
17127
|
+
.pf-c-simple-list__section + .pf-c-simple-list__section {
|
|
17128
|
+
margin-top: var(--pf-c-simple-list__section--section--MarginTop);
|
|
17129
|
+
}
|
|
17130
|
+
|
|
17054
17131
|
.pf-c-skeleton {
|
|
17055
17132
|
--pf-c-skeleton--BackgroundColor: var(--pf-global--palette--black-150);
|
|
17056
17133
|
--pf-c-skeleton--Width: auto;
|
|
@@ -25612,83 +25689,6 @@ svg.pf-c-spinner.pf-m-xl {
|
|
|
25612
25689
|
margin-bottom: var(--pf-l-stack--m-gutter--MarginBottom);
|
|
25613
25690
|
}
|
|
25614
25691
|
|
|
25615
|
-
.pf-c-simple-list {
|
|
25616
|
-
--pf-c-simple-list__item-link--PaddingTop: var(--pf-global--spacer--xs);
|
|
25617
|
-
--pf-c-simple-list__item-link--PaddingRight: var(--pf-global--spacer--md);
|
|
25618
|
-
--pf-c-simple-list__item-link--PaddingBottom: var(--pf-global--spacer--xs);
|
|
25619
|
-
--pf-c-simple-list__item-link--PaddingLeft: var(--pf-global--spacer--md);
|
|
25620
|
-
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-global--BackgroundColor--100);
|
|
25621
|
-
--pf-c-simple-list__item-link--Color: var(--pf-global--Color--100);
|
|
25622
|
-
--pf-c-simple-list__item-link--FontSize: var(--pf-global--FontSize--sm);
|
|
25623
|
-
--pf-c-simple-list__item-link--FontWeight: var(--pf-global--FontWeight--normal);
|
|
25624
|
-
--pf-c-simple-list__item-link--m-current--Color: var(--pf-global--link--Color);
|
|
25625
|
-
--pf-c-simple-list__item-link--m-current--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
25626
|
-
--pf-c-simple-list__item-link--m-current--FontWeight: var(--pf-global--FontWeight--normal);
|
|
25627
|
-
--pf-c-simple-list__item-link--hover--Color: var(--pf-global--Color--100);
|
|
25628
|
-
--pf-c-simple-list__item-link--hover--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
25629
|
-
--pf-c-simple-list__item-link--focus--Color: var(--pf-global--Color--100);
|
|
25630
|
-
--pf-c-simple-list__item-link--focus--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
25631
|
-
--pf-c-simple-list__item-link--focus--FontWeight: var(--pf-global--FontWeight--normal);
|
|
25632
|
-
--pf-c-simple-list__item-link--active--Color: var(--pf-global--Color--100);
|
|
25633
|
-
--pf-c-simple-list__item-link--active--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
25634
|
-
--pf-c-simple-list__item-link--active--FontWeight: var(--pf-global--FontWeight--normal);
|
|
25635
|
-
--pf-c-simple-list__title--PaddingTop: var(--pf-global--spacer--sm);
|
|
25636
|
-
--pf-c-simple-list__title--PaddingRight: var(--pf-global--spacer--md);
|
|
25637
|
-
--pf-c-simple-list__title--PaddingBottom: var(--pf-global--spacer--sm);
|
|
25638
|
-
--pf-c-simple-list__title--PaddingLeft: var(--pf-global--spacer--md);
|
|
25639
|
-
--pf-c-simple-list__title--FontSize: var(--pf-global--FontSize--sm);
|
|
25640
|
-
--pf-c-simple-list__title--Color: var(--pf-global--Color--dark-200);
|
|
25641
|
-
--pf-c-simple-list__title--FontWeight: var(--pf-global--FontWeight--semi-bold);
|
|
25642
|
-
--pf-c-simple-list__section--section--MarginTop: var(--pf-global--spacer--sm);
|
|
25643
|
-
}
|
|
25644
|
-
|
|
25645
|
-
.pf-c-simple-list__item-link {
|
|
25646
|
-
display: block;
|
|
25647
|
-
width: 100%;
|
|
25648
|
-
padding: var(--pf-c-simple-list__item-link--PaddingTop) var(--pf-c-simple-list__item-link--PaddingRight) var(--pf-c-simple-list__item-link--PaddingBottom) var(--pf-c-simple-list__item-link--PaddingLeft);
|
|
25649
|
-
font-size: var(--pf-c-simple-list__item-link--FontSize);
|
|
25650
|
-
font-weight: var(--pf-c-simple-list__item-link--FontWeight);
|
|
25651
|
-
color: var(--pf-c-simple-list__item-link--Color);
|
|
25652
|
-
text-align: left;
|
|
25653
|
-
background-color: var(--pf-c-simple-list__item-link--BackgroundColor);
|
|
25654
|
-
border: none;
|
|
25655
|
-
}
|
|
25656
|
-
|
|
25657
|
-
.pf-c-simple-list__item-link:hover {
|
|
25658
|
-
text-decoration: none;
|
|
25659
|
-
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--hover--BackgroundColor);
|
|
25660
|
-
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--hover--Color);
|
|
25661
|
-
}
|
|
25662
|
-
|
|
25663
|
-
.pf-c-simple-list__item-link:focus {
|
|
25664
|
-
--pf-c-simple-list__item-link--FontWeight: var(--pf-c-simple-list__item-link--focus--FontWeight);
|
|
25665
|
-
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--focus--BackgroundColor);
|
|
25666
|
-
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--focus--Color);
|
|
25667
|
-
}
|
|
25668
|
-
|
|
25669
|
-
.pf-c-simple-list__item-link:active {
|
|
25670
|
-
--pf-c-simple-list__item-link--FontWeight: var(--pf-c-simple-list__item-link--active--FontWeight);
|
|
25671
|
-
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--active--BackgroundColor);
|
|
25672
|
-
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--active--Color);
|
|
25673
|
-
}
|
|
25674
|
-
|
|
25675
|
-
.pf-c-simple-list__item-link.pf-m-current {
|
|
25676
|
-
--pf-c-simple-list__item-link--FontWeight: var(--pf-c-simple-list__item-link--m-current--FontWeight);
|
|
25677
|
-
--pf-c-simple-list__item-link--BackgroundColor: var(--pf-c-simple-list__item-link--m-current--BackgroundColor);
|
|
25678
|
-
--pf-c-simple-list__item-link--Color: var(--pf-c-simple-list__item-link--m-current--Color);
|
|
25679
|
-
}
|
|
25680
|
-
|
|
25681
|
-
.pf-c-simple-list__title {
|
|
25682
|
-
padding: var(--pf-c-simple-list__title--PaddingTop) var(--pf-c-simple-list__title--PaddingRight) var(--pf-c-simple-list__title--PaddingBottom) var(--pf-c-simple-list__title--PaddingLeft);
|
|
25683
|
-
font-size: var(--pf-c-simple-list__title--FontSize);
|
|
25684
|
-
font-weight: var(--pf-c-simple-list__title--FontWeight);
|
|
25685
|
-
color: var(--pf-c-simple-list__title--Color);
|
|
25686
|
-
}
|
|
25687
|
-
|
|
25688
|
-
.pf-c-simple-list__section + .pf-c-simple-list__section {
|
|
25689
|
-
margin-top: var(--pf-c-simple-list__section--section--MarginTop);
|
|
25690
|
-
}
|
|
25691
|
-
|
|
25692
25692
|
.pf-c-alert-group {
|
|
25693
25693
|
--pf-c-alert-group__item--MarginTop: var(--pf-global--spacer--sm);
|
|
25694
25694
|
--pf-c-alert-group--m-toast--Top: var(--pf-global--spacer--2xl);
|
package/dist/umd/react-core.js
CHANGED
|
@@ -6202,7 +6202,7 @@
|
|
|
6202
6202
|
}, ref: this.ref, type: "button" }), children || value.toString())));
|
|
6203
6203
|
}
|
|
6204
6204
|
else if (variant !== exports.SelectVariant.checkbox) {
|
|
6205
|
-
return (React__namespace.createElement("li", { id: generatedId, role: "presentation", className: css(isLoading && _default$13.selectListItem, !
|
|
6205
|
+
return (React__namespace.createElement("li", { id: generatedId, role: "presentation", className: css(isLoading && _default$13.selectListItem, !isLoading && _default$13.selectMenuWrapper, isFavorite && _default$13.modifiers.favorite, isFocused && _default$13.modifiers.focus, isLoading && _default$13.modifiers.loading), ref: this.liRef },
|
|
6206
6206
|
isLoading && children,
|
|
6207
6207
|
isLoad && !isGrouped && (React__namespace.createElement("button", Object.assign({}, props, { className: css(_default$13.selectMenuItem, _default$13.modifiers.load, className), onClick: (event) => {
|
|
6208
6208
|
onViewMoreClick(event);
|
|
@@ -6359,9 +6359,18 @@
|
|
|
6359
6359
|
let index = hasInlineFilter ? 1 : 0;
|
|
6360
6360
|
if (isGrouped) {
|
|
6361
6361
|
return React__namespace.Children.map(children, (group) => {
|
|
6362
|
-
if (group.type ===
|
|
6362
|
+
if (group.type === Divider) {
|
|
6363
6363
|
return group;
|
|
6364
6364
|
}
|
|
6365
|
+
else if (group.type === SelectOption) {
|
|
6366
|
+
return React__namespace.cloneElement(group, {
|
|
6367
|
+
isChecked: this.checkForValue(group.props.value, checked),
|
|
6368
|
+
sendRef,
|
|
6369
|
+
keyHandler,
|
|
6370
|
+
index: index++,
|
|
6371
|
+
isLastOptionBeforeFooter
|
|
6372
|
+
});
|
|
6373
|
+
}
|
|
6365
6374
|
return React__namespace.cloneElement(group, {
|
|
6366
6375
|
titleId: group.props.label && group.props.label.replace(/\W/g, '-'),
|
|
6367
6376
|
children: group.props.children ? (React__namespace.createElement("fieldset", { "aria-labelledby": group.props.label && group.props.label.replace(/\W/g, '-'), className: css(_default$13.selectMenuFieldset) }, React__namespace.Children.map(group.props.children, (option) => option.type === Divider
|
|
@@ -6829,7 +6838,9 @@
|
|
|
6829
6838
|
this.state.viewMoreNextIndex !== -1 &&
|
|
6830
6839
|
this.refCollection.length > this.state.viewMoreNextIndex &&
|
|
6831
6840
|
this.props.loadingVariant !== 'spinner' &&
|
|
6832
|
-
this.refCollection[this.state.viewMoreNextIndex][0]
|
|
6841
|
+
this.refCollection[this.state.viewMoreNextIndex][0] &&
|
|
6842
|
+
this.props.variant !== 'typeahead' && // do not hard focus newly added items for typeahead variants
|
|
6843
|
+
this.props.variant !== 'typeaheadmulti') {
|
|
6833
6844
|
this.refCollection[this.state.viewMoreNextIndex][0].focus();
|
|
6834
6845
|
}
|
|
6835
6846
|
const hasUpdatedChildren = prevProps.children.length !== this.props.children.length ||
|
|
@@ -7031,6 +7042,7 @@
|
|
|
7031
7042
|
this.moveFocus = (nextIndex, updateCurrentIndex = true) => {
|
|
7032
7043
|
const { isCreatable, createText } = this.props;
|
|
7033
7044
|
const hasDescriptionElm = Boolean(this.refCollection[nextIndex][0] && this.refCollection[nextIndex][0].classList.contains('pf-m-description'));
|
|
7045
|
+
const isLoad = Boolean(this.refCollection[nextIndex][0] && this.refCollection[nextIndex][0].classList.contains('pf-m-load'));
|
|
7034
7046
|
const optionTextElm = hasDescriptionElm
|
|
7035
7047
|
? this.refCollection[nextIndex][0].firstElementChild
|
|
7036
7048
|
: this.refCollection[nextIndex][0];
|
|
@@ -7038,7 +7050,8 @@
|
|
|
7038
7050
|
if (isCreatable && optionTextElm.innerText.includes(createText)) {
|
|
7039
7051
|
typeaheadInputValue = this.state.creatableValue;
|
|
7040
7052
|
}
|
|
7041
|
-
else if (optionTextElm) {
|
|
7053
|
+
else if (optionTextElm && !isLoad) {
|
|
7054
|
+
// !isLoad prevents the view more button text from appearing the typeahead input
|
|
7042
7055
|
typeaheadInputValue = optionTextElm.innerText;
|
|
7043
7056
|
}
|
|
7044
7057
|
this.setState(prevState => ({
|
|
@@ -7084,15 +7097,17 @@
|
|
|
7084
7097
|
if (typeaheadCurrIndex !== -1 && // do not allow selection without moving to an initial option
|
|
7085
7098
|
(typeaheadActiveChild || (this.refCollection[0] && this.refCollection[0][0]))) {
|
|
7086
7099
|
if (typeaheadActiveChild) {
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7100
|
+
if (!typeaheadActiveChild.classList.contains('pf-m-load')) {
|
|
7101
|
+
const hasDescriptionElm = typeaheadActiveChild.childElementCount > 1;
|
|
7102
|
+
const typeaheadActiveChildText = hasDescriptionElm
|
|
7103
|
+
? typeaheadActiveChild.firstChild.innerText
|
|
7104
|
+
: typeaheadActiveChild.innerText;
|
|
7105
|
+
this.setState({
|
|
7106
|
+
typeaheadInputValue: typeaheadActiveChildText
|
|
7107
|
+
});
|
|
7108
|
+
}
|
|
7094
7109
|
}
|
|
7095
|
-
else {
|
|
7110
|
+
else if (this.refCollection[0] && this.refCollection[0][0]) {
|
|
7096
7111
|
this.setState({
|
|
7097
7112
|
typeaheadInputValue: this.refCollection[0][0].innerText
|
|
7098
7113
|
});
|
|
@@ -7371,15 +7386,16 @@
|
|
|
7371
7386
|
}
|
|
7372
7387
|
});
|
|
7373
7388
|
}
|
|
7374
|
-
return typeaheadChildren.map((child) => {
|
|
7389
|
+
return typeaheadChildren.map((child, index) => {
|
|
7375
7390
|
const childElement = child;
|
|
7376
7391
|
return childElement.type.displayName === 'Divider'
|
|
7377
7392
|
? child
|
|
7378
7393
|
: React__namespace.cloneElement(child, {
|
|
7379
|
-
isFocused: typeaheadActiveChild
|
|
7380
|
-
|
|
7394
|
+
isFocused: typeaheadActiveChild
|
|
7395
|
+
? typeaheadActiveChild.innerText === child.props.value.toString() ||
|
|
7381
7396
|
(this.props.isCreatable &&
|
|
7382
|
-
typeaheadActiveChild.innerText === `{createText} "${child.props.value}"`)
|
|
7397
|
+
typeaheadActiveChild.innerText === `{createText} "${child.props.value}"`)
|
|
7398
|
+
: index === typeaheadCurrIndex // fallback for view more + typeahead use cases, when the new expanded list is loaded and refCollection hasn't be updated yet
|
|
7383
7399
|
});
|
|
7384
7400
|
});
|
|
7385
7401
|
}
|
|
@@ -7763,7 +7779,6 @@
|
|
|
7763
7779
|
onChange = () => { }, validators = [() => true], className, onSelectToggle = () => { }, rangeStart, prevMonthAriaLabel = 'Previous month', nextMonthAriaLabel = 'Next month', yearInputAriaLabel = 'Select year', cellAriaLabel } = _a, props = __rest$1(_a, ["date", "locale", "monthFormat", "weekdayFormat", "longWeekdayFormat", "dayFormat", "weekStart", "onChange", "validators", "className", "onSelectToggle", "rangeStart", "prevMonthAriaLabel", "nextMonthAriaLabel", "yearInputAriaLabel", "cellAriaLabel"]);
|
|
7764
7780
|
const longMonths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(monthNum => new Date(1990, monthNum)).map(monthFormat);
|
|
7765
7781
|
const [isSelectOpen, setIsSelectOpen] = React__default["default"].useState(false);
|
|
7766
|
-
const [selectedDate, setSelectedDate] = React__default["default"].useState(new Date(dateProp));
|
|
7767
7782
|
// eslint-disable-next-line prefer-const
|
|
7768
7783
|
let [focusedDate, setFocusedDate] = React__default["default"].useState(new Date(dateProp));
|
|
7769
7784
|
if (!isValidDate(focusedDate)) {
|
|
@@ -7893,7 +7908,7 @@
|
|
|
7893
7908
|
React__default["default"].createElement("tbody", { onKeyDown: onKeyDown }, calendar.map((week, index) => (React__default["default"].createElement("tr", { key: index, className: _default$_.calendarMonthDatesRow }, week.map(({ date, isValid }, index) => {
|
|
7894
7909
|
const dayFormatted = dayFormat(date);
|
|
7895
7910
|
const isToday = isSameDate(date, today);
|
|
7896
|
-
const isSelected = isValidDate(
|
|
7911
|
+
const isSelected = isValidDate(dateProp) && isSameDate(date, dateProp);
|
|
7897
7912
|
const isFocused = isSameDate(date, focusedDate);
|
|
7898
7913
|
const isAdjacentMonth = date.getMonth() !== focusedDate.getMonth();
|
|
7899
7914
|
let isInRange = false;
|
|
@@ -7909,11 +7924,7 @@
|
|
|
7909
7924
|
// Core would likely need new styles
|
|
7910
7925
|
}
|
|
7911
7926
|
return (React__default["default"].createElement("td", { key: index, className: css(_default$_.calendarMonthDatesCell, isAdjacentMonth && _default$_.modifiers.adjacentMonth, isToday && _default$_.modifiers.current, (isSelected || isRangeStart) && _default$_.modifiers.selected, !isValid && _default$_.modifiers.disabled, (isInRange || isRangeStart || isRangeEnd) && _default$_.modifiers.inRange, isRangeStart && _default$_.modifiers.startRange, isRangeEnd && _default$_.modifiers.endRange) },
|
|
7912
|
-
React__default["default"].createElement("button", Object.assign({ className: css(_default$_.calendarMonthDate, isRangeEnd && _default$_.modifiers.hover, !isValid && _default$_.modifiers.disabled), type: "button", onClick: () => {
|
|
7913
|
-
setSelectedDate(date);
|
|
7914
|
-
setFocusedDate(date);
|
|
7915
|
-
onChange(date);
|
|
7916
|
-
}, onMouseOver: () => setHoveredDate(date), tabIndex: isFocused ? 0 : -1, disabled: !isValid, "aria-label": cellAriaLabel ? cellAriaLabel(date) : `${dayFormatted} ${monthFormatted} ${yearFormatted}` }, (isFocused && { ref: focusRef })), dayFormatted)));
|
|
7927
|
+
React__default["default"].createElement("button", Object.assign({ className: css(_default$_.calendarMonthDate, isRangeEnd && _default$_.modifiers.hover, !isValid && _default$_.modifiers.disabled), type: "button", onClick: () => onChange(date), onMouseOver: () => setHoveredDate(date), tabIndex: isFocused ? 0 : -1, disabled: !isValid, "aria-label": cellAriaLabel ? cellAriaLabel(date) : `${dayFormatted} ${monthFormatted} ${yearFormatted}` }, (isFocused && { ref: focusRef })), dayFormatted)));
|
|
7917
7928
|
}))))))));
|
|
7918
7929
|
};
|
|
7919
7930
|
|