@patternfly/react-core 4.222.3 → 4.222.4
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 +8 -0
- package/dist/esm/components/AboutModal/AboutModal.d.ts +1 -1
- package/dist/esm/components/AboutModal/AboutModal.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +6 -5
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +2 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/js/components/AboutModal/AboutModal.d.ts +1 -1
- package/dist/js/components/AboutModal/AboutModal.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +6 -5
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Modal/Modal.d.ts +1 -1
- package/dist/js/components/Modal/Modal.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +2 -1
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/umd/react-core.css +63 -63
- package/dist/umd/react-core.js +8 -6
- package/package.json +5 -5
- package/src/components/AboutModal/AboutModal.tsx +1 -1
- package/src/components/DualListSelector/DualListSelector.tsx +57 -37
- package/src/components/DualListSelector/DualListSelectorPane.tsx +10 -8
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/MenuToggle/MenuToggle.tsx +1 -1
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Select/Select.tsx +6 -3
- package/src/components/Toolbar/ToolbarToggleGroup.tsx +4 -1
- package/src/demos/Wizard/WizardDemo.md +66 -121
package/dist/umd/react-core.css
CHANGED
|
@@ -23040,6 +23040,69 @@ svg.pf-c-spinner.pf-m-xl {
|
|
|
23040
23040
|
color: var(--pf-global--Color--100);
|
|
23041
23041
|
}
|
|
23042
23042
|
|
|
23043
|
+
.pf-c-draggable {
|
|
23044
|
+
--pf-c-draggable--Cursor: auto;
|
|
23045
|
+
--pf-c-draggable--m-dragging--Cursor: grabbing;
|
|
23046
|
+
--pf-c-draggable--m-dragging--BoxShadow: var(--pf-global--BoxShadow--md);
|
|
23047
|
+
--pf-c-draggable--m-dragging--after--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
23048
|
+
--pf-c-draggable--m-dragging--after--BorderColor: var(--pf-global--active-color--100);
|
|
23049
|
+
--pf-c-draggable--m-drag-outside--Cursor: not-allowed;
|
|
23050
|
+
--pf-c-draggable--m-drag-outside--after--BorderColor: var(--pf-global--danger-color--100);
|
|
23051
|
+
cursor: var(--pf-c-draggable--Cursor);
|
|
23052
|
+
}
|
|
23053
|
+
|
|
23054
|
+
.pf-c-draggable.pf-m-dragging {
|
|
23055
|
+
--pf-c-draggable--Cursor: var(--pf-c-draggable--m-dragging--Cursor);
|
|
23056
|
+
position: relative;
|
|
23057
|
+
background-color: var(--pf-c-draggable--m-dragging--BackgroundColor);
|
|
23058
|
+
box-shadow: var(--pf-c-draggable--m-dragging--BoxShadow);
|
|
23059
|
+
}
|
|
23060
|
+
|
|
23061
|
+
.pf-c-draggable.pf-m-dragging::after {
|
|
23062
|
+
position: absolute;
|
|
23063
|
+
top: 0;
|
|
23064
|
+
right: 0;
|
|
23065
|
+
bottom: 0;
|
|
23066
|
+
left: 0;
|
|
23067
|
+
content: "";
|
|
23068
|
+
border: var(--pf-c-draggable--m-dragging--after--BorderWidth) solid var(--pf-c-draggable--m-dragging--after--BorderColor);
|
|
23069
|
+
}
|
|
23070
|
+
|
|
23071
|
+
.pf-c-draggable.pf-m-drag-outside {
|
|
23072
|
+
--pf-c-draggable--m-dragging--Cursor: var(--pf-c-draggable--m-drag-outside--Cursor);
|
|
23073
|
+
--pf-c-draggable--m-dragging--after--BorderColor: var(--pf-c-draggable--m-drag-outside--after--BorderColor);
|
|
23074
|
+
}
|
|
23075
|
+
|
|
23076
|
+
.pf-c-droppable {
|
|
23077
|
+
--pf-c-droppable--m-dragging--after--BackgroundColor: rgba(255, 255, 255, 0.6);
|
|
23078
|
+
--pf-c-droppable--m-dragging--after--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
23079
|
+
--pf-c-droppable--m-dragging--after--BorderColor: var(--pf-global--active-color--100);
|
|
23080
|
+
--pf-c-droppable--m-drag-outside--after--BorderColor: var(--pf-global--danger-color--100);
|
|
23081
|
+
}
|
|
23082
|
+
|
|
23083
|
+
.pf-c-droppable.pf-m-dragging {
|
|
23084
|
+
position: relative;
|
|
23085
|
+
}
|
|
23086
|
+
|
|
23087
|
+
.pf-c-droppable.pf-m-dragging::after {
|
|
23088
|
+
position: absolute;
|
|
23089
|
+
top: 0;
|
|
23090
|
+
right: 0;
|
|
23091
|
+
bottom: 0;
|
|
23092
|
+
left: 0;
|
|
23093
|
+
pointer-events: none;
|
|
23094
|
+
content: "";
|
|
23095
|
+
}
|
|
23096
|
+
|
|
23097
|
+
.pf-c-droppable::after {
|
|
23098
|
+
background-color: var(--pf-c-droppable--m-dragging--after--BackgroundColor);
|
|
23099
|
+
border: var(--pf-c-droppable--m-dragging--after--BorderWidth) solid var(--pf-c-droppable--m-dragging--after--BorderColor);
|
|
23100
|
+
}
|
|
23101
|
+
|
|
23102
|
+
.pf-c-droppable.pf-m-drag-outside {
|
|
23103
|
+
--pf-c-droppable--m-dragging--after--BorderColor: var(--pf-c-droppable--m-drag-outside--after--BorderColor);
|
|
23104
|
+
}
|
|
23105
|
+
|
|
23043
23106
|
.pf-c-text-input-group {
|
|
23044
23107
|
--pf-c-text-input-group--BackgroundColor: var(--pf-global--BackgroundColor--100);
|
|
23045
23108
|
--pf-c-text-input-group__text--before--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
@@ -26688,69 +26751,6 @@ svg.pf-c-spinner.pf-m-xl {
|
|
|
26688
26751
|
grid-gap: var(--pf-l-grid--m-gutter--GridGap);
|
|
26689
26752
|
}
|
|
26690
26753
|
|
|
26691
|
-
.pf-c-draggable {
|
|
26692
|
-
--pf-c-draggable--Cursor: auto;
|
|
26693
|
-
--pf-c-draggable--m-dragging--Cursor: grabbing;
|
|
26694
|
-
--pf-c-draggable--m-dragging--BoxShadow: var(--pf-global--BoxShadow--md);
|
|
26695
|
-
--pf-c-draggable--m-dragging--after--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
26696
|
-
--pf-c-draggable--m-dragging--after--BorderColor: var(--pf-global--active-color--100);
|
|
26697
|
-
--pf-c-draggable--m-drag-outside--Cursor: not-allowed;
|
|
26698
|
-
--pf-c-draggable--m-drag-outside--after--BorderColor: var(--pf-global--danger-color--100);
|
|
26699
|
-
cursor: var(--pf-c-draggable--Cursor);
|
|
26700
|
-
}
|
|
26701
|
-
|
|
26702
|
-
.pf-c-draggable.pf-m-dragging {
|
|
26703
|
-
--pf-c-draggable--Cursor: var(--pf-c-draggable--m-dragging--Cursor);
|
|
26704
|
-
position: relative;
|
|
26705
|
-
background-color: var(--pf-c-draggable--m-dragging--BackgroundColor);
|
|
26706
|
-
box-shadow: var(--pf-c-draggable--m-dragging--BoxShadow);
|
|
26707
|
-
}
|
|
26708
|
-
|
|
26709
|
-
.pf-c-draggable.pf-m-dragging::after {
|
|
26710
|
-
position: absolute;
|
|
26711
|
-
top: 0;
|
|
26712
|
-
right: 0;
|
|
26713
|
-
bottom: 0;
|
|
26714
|
-
left: 0;
|
|
26715
|
-
content: "";
|
|
26716
|
-
border: var(--pf-c-draggable--m-dragging--after--BorderWidth) solid var(--pf-c-draggable--m-dragging--after--BorderColor);
|
|
26717
|
-
}
|
|
26718
|
-
|
|
26719
|
-
.pf-c-draggable.pf-m-drag-outside {
|
|
26720
|
-
--pf-c-draggable--m-dragging--Cursor: var(--pf-c-draggable--m-drag-outside--Cursor);
|
|
26721
|
-
--pf-c-draggable--m-dragging--after--BorderColor: var(--pf-c-draggable--m-drag-outside--after--BorderColor);
|
|
26722
|
-
}
|
|
26723
|
-
|
|
26724
|
-
.pf-c-droppable {
|
|
26725
|
-
--pf-c-droppable--m-dragging--after--BackgroundColor: rgba(255, 255, 255, 0.6);
|
|
26726
|
-
--pf-c-droppable--m-dragging--after--BorderWidth: var(--pf-global--BorderWidth--sm);
|
|
26727
|
-
--pf-c-droppable--m-dragging--after--BorderColor: var(--pf-global--active-color--100);
|
|
26728
|
-
--pf-c-droppable--m-drag-outside--after--BorderColor: var(--pf-global--danger-color--100);
|
|
26729
|
-
}
|
|
26730
|
-
|
|
26731
|
-
.pf-c-droppable.pf-m-dragging {
|
|
26732
|
-
position: relative;
|
|
26733
|
-
}
|
|
26734
|
-
|
|
26735
|
-
.pf-c-droppable.pf-m-dragging::after {
|
|
26736
|
-
position: absolute;
|
|
26737
|
-
top: 0;
|
|
26738
|
-
right: 0;
|
|
26739
|
-
bottom: 0;
|
|
26740
|
-
left: 0;
|
|
26741
|
-
pointer-events: none;
|
|
26742
|
-
content: "";
|
|
26743
|
-
}
|
|
26744
|
-
|
|
26745
|
-
.pf-c-droppable::after {
|
|
26746
|
-
background-color: var(--pf-c-droppable--m-dragging--after--BackgroundColor);
|
|
26747
|
-
border: var(--pf-c-droppable--m-dragging--after--BorderWidth) solid var(--pf-c-droppable--m-dragging--after--BorderColor);
|
|
26748
|
-
}
|
|
26749
|
-
|
|
26750
|
-
.pf-c-droppable.pf-m-drag-outside {
|
|
26751
|
-
--pf-c-droppable--m-dragging--after--BorderColor: var(--pf-c-droppable--m-drag-outside--after--BorderColor);
|
|
26752
|
-
}
|
|
26753
|
-
|
|
26754
26754
|
.pf-l-level {
|
|
26755
26755
|
--pf-l-level--m-gutter--MarginRight: var(--pf-global--gutter);
|
|
26756
26756
|
display: flex;
|
package/dist/umd/react-core.js
CHANGED
|
@@ -7632,7 +7632,8 @@
|
|
|
7632
7632
|
typeaheadFilteredChildren =
|
|
7633
7633
|
typeaheadInputValue.toString() !== ''
|
|
7634
7634
|
? React__namespace.Children.map(children, group => {
|
|
7635
|
-
if (React__namespace.isValidElement(group) &&
|
|
7635
|
+
if (React__namespace.isValidElement(group) &&
|
|
7636
|
+
group.type === SelectGroup) {
|
|
7636
7637
|
const filteredGroupChildren = React__namespace.Children.toArray(group.props.children).filter(childFilter);
|
|
7637
7638
|
if (filteredGroupChildren.length > 0) {
|
|
7638
7639
|
return React__namespace.cloneElement(group, {
|
|
@@ -11654,18 +11655,19 @@
|
|
|
11654
11655
|
const { availableOptions, chosenOptions, chosenOptionsSelected, availableOptionsSelected, chosenTreeOptionsChecked, availableTreeOptionsChecked } = this.state;
|
|
11655
11656
|
const availableOptionsStatusToDisplay = availableOptionsStatus ||
|
|
11656
11657
|
(isTree
|
|
11657
|
-
? `${filterFolders(availableOptions, availableTreeOptionsChecked)
|
|
11658
|
+
? `${filterFolders(availableOptions, availableTreeOptionsChecked)
|
|
11659
|
+
.length} of ${flattenTree(availableOptions).length} items selected`
|
|
11658
11660
|
: `${availableOptionsSelected.length} of ${availableOptions.length} items selected`);
|
|
11659
11661
|
const chosenOptionsStatusToDisplay = chosenOptionsStatus ||
|
|
11660
11662
|
(isTree
|
|
11661
11663
|
? `${filterFolders(chosenOptions, chosenTreeOptionsChecked).length} of ${flattenTree(chosenOptions).length} items selected`
|
|
11662
11664
|
: `${chosenOptionsSelected.length} of ${chosenOptions.length} items selected`);
|
|
11663
|
-
const available = isTree
|
|
11665
|
+
const available = (isTree
|
|
11664
11666
|
? availableOptions.map(item => this.mapChecked(item, false))
|
|
11665
|
-
: availableOptions;
|
|
11666
|
-
const chosen = isTree
|
|
11667
|
+
: availableOptions);
|
|
11668
|
+
const chosen = (isTree
|
|
11667
11669
|
? chosenOptions.map(item => this.mapChecked(item, true))
|
|
11668
|
-
: chosenOptions;
|
|
11670
|
+
: chosenOptions);
|
|
11669
11671
|
return (React__namespace.createElement(DualListSelectorContext.Provider, { value: { isTree } },
|
|
11670
11672
|
React__namespace.createElement("div", Object.assign({ className: css(styles$L.dualListSelector, className), id: id }, props), children === '' ? (React__namespace.createElement(React__namespace.Fragment, null,
|
|
11671
11673
|
React__namespace.createElement(DualListSelectorPane, { isSearchable: isSearchable, onFilterUpdate: this.onFilterUpdate, searchInputAriaLabel: availableOptionsSearchAriaLabel, filterOption: filterOption, onSearchInputChanged: onAvailableOptionsSearchInputChanged, status: availableOptionsStatusToDisplay, title: availableOptionsTitle, options: available, selectedOptions: isTree ? availableTreeOptionsChecked : availableOptionsSelected, onOptionSelect: this.onOptionSelect, onOptionCheck: (e, isChecked, itemData) => this.onTreeOptionCheck(e, isChecked, itemData, false), actions: availableOptionsActions, id: `${id}-available-pane`, isDisabled: isDisabled }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.222.
|
|
3
|
+
"version": "4.222.4",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.73.
|
|
38
|
-
"@patternfly/react-styles": "^4.72.
|
|
39
|
-
"@patternfly/react-tokens": "^4.74.
|
|
37
|
+
"@patternfly/react-icons": "^4.73.4",
|
|
38
|
+
"@patternfly/react-styles": "^4.72.4",
|
|
39
|
+
"@patternfly/react-tokens": "^4.74.4",
|
|
40
40
|
"focus-trap": "6.9.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "308f2c66a19104f4a1b0f56da3b4df95d7a2d919"
|
|
64
64
|
}
|
|
@@ -134,10 +134,10 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
134
134
|
private removeAllButtonRef = React.createRef<HTMLButtonElement>();
|
|
135
135
|
static defaultProps: PickOptional<DualListSelectorProps> = {
|
|
136
136
|
children: '',
|
|
137
|
-
availableOptions: []
|
|
137
|
+
availableOptions: [],
|
|
138
138
|
availableOptionsTitle: 'Available options',
|
|
139
139
|
availableOptionsSearchAriaLabel: 'Available search input',
|
|
140
|
-
chosenOptions: []
|
|
140
|
+
chosenOptions: [],
|
|
141
141
|
chosenOptionsTitle: 'Chosen options',
|
|
142
142
|
chosenOptionsSearchAriaLabel: 'Chosen search input',
|
|
143
143
|
id: getUniqueId('dual-list-selector'),
|
|
@@ -177,11 +177,11 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
177
177
|
constructor(props: DualListSelectorProps) {
|
|
178
178
|
super(props);
|
|
179
179
|
this.state = {
|
|
180
|
-
availableOptions: [...this.props.availableOptions],
|
|
180
|
+
availableOptions: [...this.props.availableOptions] as React.ReactNode[],
|
|
181
181
|
availableOptionsSelected: [],
|
|
182
182
|
availableFilteredOptions: null,
|
|
183
183
|
availableTreeFilteredOptions: null,
|
|
184
|
-
chosenOptions: [...this.props.chosenOptions],
|
|
184
|
+
chosenOptions: [...this.props.chosenOptions] as React.ReactNode[],
|
|
185
185
|
chosenOptionsSelected: [],
|
|
186
186
|
chosenFilteredOptions: null,
|
|
187
187
|
chosenTreeFilteredOptions: null,
|
|
@@ -208,8 +208,8 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
208
208
|
JSON.stringify(this.state.chosenOptions, this.replacer)
|
|
209
209
|
) {
|
|
210
210
|
this.setState({
|
|
211
|
-
availableOptions: [...this.props.availableOptions],
|
|
212
|
-
chosenOptions: [...this.props.chosenOptions]
|
|
211
|
+
availableOptions: [...this.props.availableOptions] as React.ReactNode[],
|
|
212
|
+
chosenOptions: [...this.props.chosenOptions] as React.ReactNode[]
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -226,7 +226,9 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
226
226
|
}
|
|
227
227
|
if (isTree) {
|
|
228
228
|
this.setState({
|
|
229
|
-
availableTreeFilteredOptions: flattenTreeWithFolders(
|
|
229
|
+
availableTreeFilteredOptions: flattenTreeWithFolders(
|
|
230
|
+
(newFilteredOptions as unknown) as DualListSelectorTreeItemData[]
|
|
231
|
+
)
|
|
230
232
|
});
|
|
231
233
|
} else {
|
|
232
234
|
this.setState({
|
|
@@ -243,7 +245,9 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
243
245
|
}
|
|
244
246
|
if (isTree) {
|
|
245
247
|
this.setState({
|
|
246
|
-
chosenTreeFilteredOptions: flattenTreeWithFolders(
|
|
248
|
+
chosenTreeFilteredOptions: flattenTreeWithFolders(
|
|
249
|
+
(newFilteredOptions as unknown) as DualListSelectorTreeItemData[]
|
|
250
|
+
)
|
|
247
251
|
});
|
|
248
252
|
} else {
|
|
249
253
|
this.setState({
|
|
@@ -283,16 +287,20 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
283
287
|
this.setState(prevState => {
|
|
284
288
|
const movedOptions =
|
|
285
289
|
prevState.availableTreeFilteredOptions ||
|
|
286
|
-
flattenTreeWithFolders(prevState.availableOptions as DualListSelectorTreeItemData[]);
|
|
290
|
+
flattenTreeWithFolders((prevState.availableOptions as unknown) as DualListSelectorTreeItemData[]);
|
|
287
291
|
const newAvailable = prevState.availableOptions
|
|
288
292
|
.map(opt => Object.assign({}, opt))
|
|
289
|
-
.filter(item =>
|
|
293
|
+
.filter(item =>
|
|
294
|
+
filterRestTreeItems((item as unknown) as DualListSelectorTreeItemData, movedOptions)
|
|
295
|
+
) as React.ReactNode[];
|
|
290
296
|
|
|
291
|
-
const currChosen = flattenTree(prevState.chosenOptions as DualListSelectorTreeItemData[]);
|
|
297
|
+
const currChosen = flattenTree((prevState.chosenOptions as unknown) as DualListSelectorTreeItemData[]);
|
|
292
298
|
const nextChosenOptions = currChosen.concat(movedOptions);
|
|
293
299
|
const newChosen = this.createMergedCopy()
|
|
294
300
|
.map(opt => Object.assign({}, opt))
|
|
295
|
-
.filter(item =>
|
|
301
|
+
.filter(item =>
|
|
302
|
+
filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextChosenOptions)
|
|
303
|
+
) as React.ReactNode[];
|
|
296
304
|
|
|
297
305
|
this.props.addAll && this.props.addAll(newAvailable, newChosen);
|
|
298
306
|
this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
|
|
@@ -339,15 +347,17 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
339
347
|
const newAvailable = prevState.availableOptions
|
|
340
348
|
.map(opt => Object.assign({}, opt))
|
|
341
349
|
.filter(item =>
|
|
342
|
-
filterRestTreeItems(item as DualListSelectorTreeItemData, prevState.availableTreeOptionsChecked)
|
|
350
|
+
filterRestTreeItems((item as unknown) as DualListSelectorTreeItemData, prevState.availableTreeOptionsChecked)
|
|
343
351
|
);
|
|
344
352
|
|
|
345
353
|
// Get next chosen options from current + new nodes and remap from base
|
|
346
|
-
const currChosen = flattenTree(prevState.chosenOptions as DualListSelectorTreeItemData[]);
|
|
354
|
+
const currChosen = flattenTree((prevState.chosenOptions as unknown) as DualListSelectorTreeItemData[]);
|
|
347
355
|
const nextChosenOptions = currChosen.concat(prevState.availableTreeOptionsChecked);
|
|
348
356
|
const newChosen = this.createMergedCopy()
|
|
349
357
|
.map(opt => Object.assign({}, opt))
|
|
350
|
-
.filter(item =>
|
|
358
|
+
.filter(item =>
|
|
359
|
+
filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextChosenOptions)
|
|
360
|
+
) as React.ReactNode[];
|
|
351
361
|
|
|
352
362
|
this.props.addSelected && this.props.addSelected(newAvailable, newChosen);
|
|
353
363
|
this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
|
|
@@ -391,16 +401,18 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
391
401
|
this.setState(prevState => {
|
|
392
402
|
const movedOptions =
|
|
393
403
|
prevState.chosenTreeFilteredOptions ||
|
|
394
|
-
flattenTreeWithFolders(prevState.chosenOptions as DualListSelectorTreeItemData[]);
|
|
404
|
+
flattenTreeWithFolders((prevState.chosenOptions as unknown) as DualListSelectorTreeItemData[]);
|
|
395
405
|
|
|
396
406
|
const newChosen = prevState.chosenOptions
|
|
397
407
|
.map(opt => Object.assign({}, opt))
|
|
398
|
-
.filter(item => filterRestTreeItems(item as DualListSelectorTreeItemData, movedOptions));
|
|
399
|
-
const currAvailable = flattenTree(prevState.availableOptions as DualListSelectorTreeItemData[]);
|
|
408
|
+
.filter(item => filterRestTreeItems((item as unknown) as DualListSelectorTreeItemData, movedOptions));
|
|
409
|
+
const currAvailable = flattenTree((prevState.availableOptions as unknown) as DualListSelectorTreeItemData[]);
|
|
400
410
|
const nextAvailableOptions = currAvailable.concat(movedOptions);
|
|
401
411
|
const newAvailable = this.createMergedCopy()
|
|
402
412
|
.map(opt => Object.assign({}, opt))
|
|
403
|
-
.filter(item =>
|
|
413
|
+
.filter(item =>
|
|
414
|
+
filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextAvailableOptions)
|
|
415
|
+
) as React.ReactNode[];
|
|
404
416
|
|
|
405
417
|
this.props.removeAll && this.props.removeAll(newAvailable, newChosen);
|
|
406
418
|
this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
|
|
@@ -444,14 +456,18 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
444
456
|
// Remove selected chosen nodes from current chosen nodes
|
|
445
457
|
const newChosen = prevState.chosenOptions
|
|
446
458
|
.map(opt => Object.assign({}, opt))
|
|
447
|
-
.filter(item =>
|
|
459
|
+
.filter(item =>
|
|
460
|
+
filterRestTreeItems((item as unknown) as DualListSelectorTreeItemData, prevState.chosenTreeOptionsChecked)
|
|
461
|
+
);
|
|
448
462
|
|
|
449
463
|
// Get next chosen options from current and remap from base
|
|
450
|
-
const currAvailable = flattenTree(prevState.availableOptions as DualListSelectorTreeItemData[]);
|
|
464
|
+
const currAvailable = flattenTree((prevState.availableOptions as unknown) as DualListSelectorTreeItemData[]);
|
|
451
465
|
const nextAvailableOptions = currAvailable.concat(prevState.chosenTreeOptionsChecked);
|
|
452
466
|
const newAvailable = this.createMergedCopy()
|
|
453
467
|
.map(opt => Object.assign({}, opt))
|
|
454
|
-
.filter(item =>
|
|
468
|
+
.filter(item =>
|
|
469
|
+
filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextAvailableOptions)
|
|
470
|
+
) as React.ReactNode[];
|
|
455
471
|
|
|
456
472
|
this.props.removeSelected && this.props.removeSelected(newAvailable, newChosen);
|
|
457
473
|
this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
|
|
@@ -542,7 +558,7 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
542
558
|
panelOptions = chosenOptions
|
|
543
559
|
.map(opt => Object.assign({}, opt))
|
|
544
560
|
.filter(item =>
|
|
545
|
-
filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, chosenTreeFilteredOptions)
|
|
561
|
+
filterTreeItemsWithoutFolders((item as unknown) as DualListSelectorTreeItemData, chosenTreeFilteredOptions)
|
|
546
562
|
);
|
|
547
563
|
} else {
|
|
548
564
|
panelOptions = chosenOptions;
|
|
@@ -552,7 +568,10 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
552
568
|
panelOptions = availableOptions
|
|
553
569
|
.map(opt => Object.assign({}, opt))
|
|
554
570
|
.filter(item =>
|
|
555
|
-
filterTreeItemsWithoutFolders(
|
|
571
|
+
filterTreeItemsWithoutFolders(
|
|
572
|
+
(item as unknown) as DualListSelectorTreeItemData,
|
|
573
|
+
availableTreeFilteredOptions
|
|
574
|
+
)
|
|
556
575
|
);
|
|
557
576
|
} else {
|
|
558
577
|
panelOptions = availableOptions;
|
|
@@ -560,8 +579,8 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
560
579
|
}
|
|
561
580
|
const checkedOptionTree = panelOptions
|
|
562
581
|
.map(opt => Object.assign({}, opt))
|
|
563
|
-
.filter(item => filterTreeItems(item as DualListSelectorTreeItemData, [itemData.id]));
|
|
564
|
-
const flatTree = flattenTreeWithFolders(checkedOptionTree as DualListSelectorTreeItemData[]);
|
|
582
|
+
.filter(item => filterTreeItems((item as unknown) as DualListSelectorTreeItemData, [itemData.id]));
|
|
583
|
+
const flatTree = flattenTreeWithFolders((checkedOptionTree as unknown) as DualListSelectorTreeItemData[]);
|
|
565
584
|
|
|
566
585
|
const prevChecked = isChosen ? this.state.chosenTreeOptionsChecked : this.state.availableTreeOptionsChecked;
|
|
567
586
|
let updatedChecked = [] as string[];
|
|
@@ -638,23 +657,24 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
|
|
|
638
657
|
availableOptionsStatus ||
|
|
639
658
|
(isTree
|
|
640
659
|
? `${
|
|
641
|
-
filterFolders(availableOptions as DualListSelectorTreeItemData[], availableTreeOptionsChecked)
|
|
642
|
-
|
|
660
|
+
filterFolders((availableOptions as unknown) as DualListSelectorTreeItemData[], availableTreeOptionsChecked)
|
|
661
|
+
.length
|
|
662
|
+
} of ${flattenTree((availableOptions as unknown) as DualListSelectorTreeItemData[]).length} items selected`
|
|
643
663
|
: `${availableOptionsSelected.length} of ${availableOptions.length} items selected`);
|
|
644
664
|
const chosenOptionsStatusToDisplay =
|
|
645
665
|
chosenOptionsStatus ||
|
|
646
666
|
(isTree
|
|
647
|
-
? `${
|
|
648
|
-
|
|
649
|
-
} items selected`
|
|
667
|
+
? `${
|
|
668
|
+
filterFolders((chosenOptions as unknown) as DualListSelectorTreeItemData[], chosenTreeOptionsChecked).length
|
|
669
|
+
} of ${flattenTree((chosenOptions as unknown) as DualListSelectorTreeItemData[]).length} items selected`
|
|
650
670
|
: `${chosenOptionsSelected.length} of ${chosenOptions.length} items selected`);
|
|
651
671
|
|
|
652
|
-
const available = isTree
|
|
653
|
-
? availableOptions.map(item => this.mapChecked(item as DualListSelectorTreeItemData, false))
|
|
654
|
-
: availableOptions;
|
|
655
|
-
const chosen = isTree
|
|
656
|
-
? chosenOptions.map(item => this.mapChecked(item as DualListSelectorTreeItemData, true))
|
|
657
|
-
: chosenOptions;
|
|
672
|
+
const available = (isTree
|
|
673
|
+
? availableOptions.map(item => this.mapChecked((item as unknown) as DualListSelectorTreeItemData, false))
|
|
674
|
+
: availableOptions) as React.ReactNode[];
|
|
675
|
+
const chosen = (isTree
|
|
676
|
+
? chosenOptions.map(item => this.mapChecked((item as unknown) as DualListSelectorTreeItemData, true))
|
|
677
|
+
: chosenOptions) as React.ReactNode[];
|
|
658
678
|
|
|
659
679
|
return (
|
|
660
680
|
<DualListSelectorContext.Provider value={{ isTree }}>
|
|
@@ -70,7 +70,7 @@ export const DualListSelectorPane: React.FunctionComponent<DualListSelectorPaneP
|
|
|
70
70
|
onOptionSelect,
|
|
71
71
|
onOptionCheck,
|
|
72
72
|
title = '',
|
|
73
|
-
options = []
|
|
73
|
+
options = [],
|
|
74
74
|
selectedOptions = [],
|
|
75
75
|
isSearchable = false,
|
|
76
76
|
searchInputAriaLabel = '',
|
|
@@ -87,11 +87,11 @@ export const DualListSelectorPane: React.FunctionComponent<DualListSelectorPaneP
|
|
|
87
87
|
// only called when search input is dynamically built
|
|
88
88
|
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
89
89
|
const newValue = e.target.value;
|
|
90
|
-
let filtered;
|
|
90
|
+
let filtered: React.ReactNode[];
|
|
91
91
|
if (isTree) {
|
|
92
|
-
filtered =
|
|
92
|
+
filtered = options
|
|
93
93
|
.map(opt => Object.assign({}, opt))
|
|
94
|
-
.filter(item => filterInput(item as DualListSelectorTreeItemData, newValue));
|
|
94
|
+
.filter(item => filterInput((item as unknown) as DualListSelectorTreeItemData, newValue));
|
|
95
95
|
} else {
|
|
96
96
|
filtered = options.filter(option => {
|
|
97
97
|
if (displayOption(option)) {
|
|
@@ -110,7 +110,7 @@ export const DualListSelectorPane: React.FunctionComponent<DualListSelectorPaneP
|
|
|
110
110
|
// only called when options are passed via options prop and isTree === true
|
|
111
111
|
const filterInput = (item: DualListSelectorTreeItemData, input: string): boolean => {
|
|
112
112
|
if (filterOption) {
|
|
113
|
-
return filterOption(item, input);
|
|
113
|
+
return filterOption((item as unknown) as React.ReactNode, input);
|
|
114
114
|
} else {
|
|
115
115
|
if (item.text.toLowerCase().includes(input.toLowerCase()) || input === '') {
|
|
116
116
|
return true;
|
|
@@ -200,10 +200,12 @@ export const DualListSelectorPane: React.FunctionComponent<DualListSelectorPaneP
|
|
|
200
200
|
<DualListSelectorTree
|
|
201
201
|
data={
|
|
202
202
|
isSearchable
|
|
203
|
-
? (options
|
|
203
|
+
? ((options
|
|
204
204
|
.map(opt => Object.assign({}, opt))
|
|
205
|
-
.filter(item =>
|
|
206
|
-
|
|
205
|
+
.filter(item =>
|
|
206
|
+
filterInput((item as unknown) as DualListSelectorTreeItemData, input)
|
|
207
|
+
) as unknown) as DualListSelectorTreeItemData[])
|
|
208
|
+
: ((options as unknown) as DualListSelectorTreeItemData[])
|
|
207
209
|
}
|
|
208
210
|
onOptionCheck={onOptionCheck}
|
|
209
211
|
id={`${id}-tree`}
|
|
@@ -224,7 +224,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
224
224
|
onDrillIn(
|
|
225
225
|
menuId,
|
|
226
226
|
typeof drilldownMenu === 'function'
|
|
227
|
-
? drilldownMenu().props.id
|
|
227
|
+
? (drilldownMenu() as any).props.id
|
|
228
228
|
: (drilldownMenu as React.ReactElement).props.id,
|
|
229
229
|
itemId
|
|
230
230
|
);
|
|
@@ -61,7 +61,7 @@ export class MenuToggleBase extends React.Component<MenuToggleProps> {
|
|
|
61
61
|
<React.Fragment>
|
|
62
62
|
{icon && <span className={css(styles.menuToggleIcon)}>{icon}</span>}
|
|
63
63
|
<span className="pf-c-menu-toggle__text">{children}</span>
|
|
64
|
-
{badge && <span className={css(styles.menuToggleCount)}>{badge}</span>}
|
|
64
|
+
{badge && <span className={css(styles.menuToggleCount)}>{badge as React.ReactNode}</span>}
|
|
65
65
|
<span className={css(styles.menuToggleControls)}>
|
|
66
66
|
<span className={css(styles.menuToggleToggleIcon)}>
|
|
67
67
|
<CaretDownIcon aria-hidden />
|
|
@@ -447,7 +447,10 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
447
447
|
typeaheadFilteredChildren =
|
|
448
448
|
typeaheadInputValue.toString() !== ''
|
|
449
449
|
? React.Children.map(children, group => {
|
|
450
|
-
if (
|
|
450
|
+
if (
|
|
451
|
+
React.isValidElement<React.ComponentProps<typeof SelectGroup>>(group) &&
|
|
452
|
+
group.type === SelectGroup
|
|
453
|
+
) {
|
|
451
454
|
const filteredGroupChildren = (React.Children.toArray(group.props.children) as React.ReactElement<
|
|
452
455
|
SelectGroupProps
|
|
453
456
|
>[]).filter(childFilter);
|
|
@@ -635,8 +638,8 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
|
|
|
635
638
|
optionContainerRef: React.ReactNode,
|
|
636
639
|
index: number
|
|
637
640
|
) => {
|
|
638
|
-
this.refCollection[index] = [optionRef as HTMLElement, favoriteRef as HTMLElement];
|
|
639
|
-
this.optionContainerRefCollection[index] = optionContainerRef as HTMLElement;
|
|
641
|
+
this.refCollection[index] = [(optionRef as unknown) as HTMLElement, (favoriteRef as unknown) as HTMLElement];
|
|
642
|
+
this.optionContainerRefCollection[index] = (optionContainerRef as unknown) as HTMLElement;
|
|
640
643
|
};
|
|
641
644
|
|
|
642
645
|
handleMenuKeys = (index: number, innerIndex: number, position: string) => {
|
|
@@ -144,7 +144,10 @@ export class ToolbarToggleGroup extends React.Component<ToolbarToggleGroupProps>
|
|
|
144
144
|
</Button>
|
|
145
145
|
</div>
|
|
146
146
|
{isExpanded
|
|
147
|
-
? ReactDOM.createPortal(
|
|
147
|
+
? (ReactDOM.createPortal(
|
|
148
|
+
children,
|
|
149
|
+
expandableContentRef.current.firstElementChild
|
|
150
|
+
) as React.ReactElement)
|
|
148
151
|
: children}
|
|
149
152
|
</div>
|
|
150
153
|
);
|