@redhat-cloud-services/frontend-components 3.4.1 → 3.4.5
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/BulkSelect/BulkSelect.js +3 -3
- package/ConditionalFilter/CheckboxFilter.js +2 -1
- package/ConditionalFilter/ConditionalFilter.js +9 -3
- package/ConditionalFilter/GroupFilter.js +20 -11
- package/ConditionalFilter/RadioFilter.js +2 -1
- package/ConditionalFilter/TextFilter.js +2 -1
- package/ConditionalFilter/conditional-filter.css +5 -1
- package/ConditionalFilter/conditional-filter.scss +5 -1
- package/DownloadButton/DownloadButton.js +4 -3
- package/FilterChips/FilterChips.js +1 -0
- package/PrimaryToolbar/Actions.js +4 -1
- package/PrimaryToolbar/PrimaryToolbar.js +9 -4
- package/esm/BulkSelect/BulkSelect.js +3 -3
- package/esm/ConditionalFilter/CheckboxFilter.js +2 -1
- package/esm/ConditionalFilter/ConditionalFilter.js +9 -3
- package/esm/ConditionalFilter/GroupFilter.js +20 -11
- package/esm/ConditionalFilter/RadioFilter.js +2 -1
- package/esm/ConditionalFilter/TextFilter.js +2 -1
- package/esm/DownloadButton/DownloadButton.js +4 -3
- package/esm/FilterChips/FilterChips.js +1 -0
- package/esm/PrimaryToolbar/Actions.js +4 -1
- package/esm/PrimaryToolbar/PrimaryToolbar.js +9 -4
- package/index.css +5 -1
- package/package.json +1 -1
package/BulkSelect/BulkSelect.js
CHANGED
|
@@ -124,7 +124,7 @@ visible unless you update it.');
|
|
|
124
124
|
ouiaSafe: ouiaSafe,
|
|
125
125
|
toggle: /*#__PURE__*/_react["default"].createElement(_DropdownToggle.DropdownToggle, (0, _extends2["default"])({}, toggleProps, {
|
|
126
126
|
isDisabled: isDisabled,
|
|
127
|
-
ouiaId:
|
|
127
|
+
ouiaId: ouiaFinalId,
|
|
128
128
|
splitButtonItems: [/*#__PURE__*/_react["default"].createElement(_react.Fragment, {
|
|
129
129
|
key: "split-checkbox"
|
|
130
130
|
}, hasError ? /*#__PURE__*/_react["default"].createElement(_DropdownToggleCheckbox.DropdownToggleCheckbox, {
|
|
@@ -132,13 +132,13 @@ visible unless you update it.');
|
|
|
132
132
|
"aria-label": "Select all",
|
|
133
133
|
onChange: onSelect,
|
|
134
134
|
checked: checked,
|
|
135
|
-
ouiaId:
|
|
135
|
+
ouiaId: ouiaFinalId
|
|
136
136
|
}) : /*#__PURE__*/_react["default"].createElement(_DropdownToggleCheckbox.DropdownToggleCheckbox, {
|
|
137
137
|
id: id ? "".concat(id, "-toggle-checkbox") : 'toggle-checkbox',
|
|
138
138
|
"aria-label": "Select all",
|
|
139
139
|
onChange: onSelect,
|
|
140
140
|
isChecked: checked,
|
|
141
|
-
ouiaId:
|
|
141
|
+
ouiaId: ouiaFinalId
|
|
142
142
|
}, count ? "".concat(count, " selected") : ''))],
|
|
143
143
|
onToggle: this.onToggle
|
|
144
144
|
})),
|
|
@@ -144,7 +144,8 @@ var CheckboxFilter = /*#__PURE__*/function (_Component) {
|
|
|
144
144
|
onSelect: this.onSelect,
|
|
145
145
|
selections: this.calculateSelected(),
|
|
146
146
|
isOpen: isExpanded,
|
|
147
|
-
placeholderText: placeholder
|
|
147
|
+
placeholderText: placeholder,
|
|
148
|
+
ouiaId: placeholder
|
|
148
149
|
}, items.map(function (_ref2, key) {
|
|
149
150
|
var value = _ref2.value,
|
|
150
151
|
_onClick = _ref2.onClick,
|
|
@@ -148,7 +148,8 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
148
148
|
placeholder = _this$props.placeholder,
|
|
149
149
|
hideLabel = _this$props.hideLabel,
|
|
150
150
|
isDisabled = _this$props.isDisabled,
|
|
151
|
-
|
|
151
|
+
containerRef = _this$props.containerRef,
|
|
152
|
+
props = (0, _objectWithoutProperties2["default"])(_this$props, ["items", "value", "onChange", "placeholder", "hideLabel", "isDisabled", "containerRef"]);
|
|
152
153
|
var _this$state = this.state,
|
|
153
154
|
isOpen = _this$state.isOpen,
|
|
154
155
|
stateValue = _this$state.stateValue,
|
|
@@ -197,10 +198,12 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
197
198
|
return _this3.dropdownToggle(false);
|
|
198
199
|
},
|
|
199
200
|
isOpen: isOpen,
|
|
201
|
+
ouiaId: "ConditionalFilter",
|
|
200
202
|
toggle: /*#__PURE__*/_react["default"].createElement(_DropdownToggle.DropdownToggle, {
|
|
201
203
|
onToggle: this.dropdownToggle,
|
|
202
204
|
isDisabled: isDisabled,
|
|
203
|
-
className: hideLabel ? 'ins-c-conditional-filter__no-label' : ''
|
|
205
|
+
className: hideLabel ? 'ins-c-conditional-filter__no-label' : '',
|
|
206
|
+
ouiaId: "ConditionalFilter"
|
|
204
207
|
}, /*#__PURE__*/_react["default"].createElement(_filterIcon["default"], {
|
|
205
208
|
size: "sm"
|
|
206
209
|
}), !hideLabel && /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -210,6 +213,7 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
210
213
|
return /*#__PURE__*/_react["default"].createElement(_DropdownItem.DropdownItem, {
|
|
211
214
|
key: item.id ? "".concat(item.id, "-dropdown") : key,
|
|
212
215
|
component: "button",
|
|
216
|
+
ouiaId: item.label,
|
|
213
217
|
onClick: function onClick(e) {
|
|
214
218
|
return onChangeCallback(e, item.value || key, item);
|
|
215
219
|
},
|
|
@@ -221,7 +225,9 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
221
225
|
}, /*#__PURE__*/_react["default"].createElement(ActiveComponent, (0, _extends2["default"])({}, activeItem.type !== _conditionalFilterConstants.conditionalFilterType.custom && {
|
|
222
226
|
placeholder: placeholder || activeItem.placeholder || "Filter by ".concat(activeItem.label),
|
|
223
227
|
id: activeItem.filterValues && activeItem.filterValues.id || currentValue
|
|
224
|
-
}, activeItem.filterValues
|
|
228
|
+
}, activeItem.filterValues, {
|
|
229
|
+
containerRef: containerRef
|
|
230
|
+
}))))));
|
|
225
231
|
}
|
|
226
232
|
}]);
|
|
227
233
|
return ConditionalFilter;
|
|
@@ -64,7 +64,8 @@ var Group = function Group(_ref) {
|
|
|
64
64
|
groups = _ref$groups === void 0 ? [] : _ref$groups,
|
|
65
65
|
onChange = _ref.onChange,
|
|
66
66
|
selected = _ref.selected,
|
|
67
|
-
isFilterable = _ref.isFilterable
|
|
67
|
+
isFilterable = _ref.isFilterable,
|
|
68
|
+
containerRef = _ref.containerRef;
|
|
68
69
|
|
|
69
70
|
var _useState = (0, _react.useState)({}),
|
|
70
71
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -123,10 +124,7 @@ var Group = function Group(_ref) {
|
|
|
123
124
|
ev.stopPropagation(); // Stop handleClickOutside from handling
|
|
124
125
|
|
|
125
126
|
ev.persist();
|
|
126
|
-
|
|
127
|
-
if (!(isOpen && toggleRef.current.contains(ev.target))) {
|
|
128
|
-
setIsOpen(!isOpen);
|
|
129
|
-
}
|
|
127
|
+
setIsOpen(!isOpen);
|
|
130
128
|
};
|
|
131
129
|
|
|
132
130
|
var groupMenuItems = (0, _groupFilterConstants.getGroupMenuItems)(groups, onChange, calculateSelection(selected));
|
|
@@ -138,7 +136,11 @@ var Group = function Group(_ref) {
|
|
|
138
136
|
return /*#__PURE__*/_react["default"].createElement(_MenuItem.MenuItem, {
|
|
139
137
|
itemId: key,
|
|
140
138
|
key: "".concat(item.value, "-").concat(key, "-item"),
|
|
141
|
-
className: item === null || item === void 0 ? void 0 : item.className
|
|
139
|
+
className: item === null || item === void 0 ? void 0 : item.className,
|
|
140
|
+
onClick: item.onClick && (type || item.type) === _groupType["default"].checkbox ? function (e) {
|
|
141
|
+
item.onClick();
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
} : undefined
|
|
142
144
|
}, (type || item.type) === _groupType["default"].checkbox ? /*#__PURE__*/_react["default"].createElement(_Checkbox.Checkbox, (0, _extends2["default"])({}, item, {
|
|
143
145
|
label: item === null || item === void 0 ? void 0 : item.label,
|
|
144
146
|
isChecked: (item === null || item === void 0 ? void 0 : item.isChecked) || (0, _groupFilterConstants.isChecked)(groupKey, (item === null || item === void 0 ? void 0 : item.value) || key, item === null || item === void 0 ? void 0 : item.id, item === null || item === void 0 ? void 0 : item.tagValue, stateSelected, selected) || false,
|
|
@@ -147,12 +149,18 @@ var Group = function Group(_ref) {
|
|
|
147
149
|
|
|
148
150
|
item === null || item === void 0 ? void 0 : (_item$onChange = item.onChange) === null || _item$onChange === void 0 ? void 0 : _item$onChange.call(item, value, event);
|
|
149
151
|
},
|
|
152
|
+
onClick: item.onClick ? function (e) {
|
|
153
|
+
item.onClick();
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
} : undefined,
|
|
150
156
|
name: (item === null || item === void 0 ? void 0 : item.name) || (item === null || item === void 0 ? void 0 : item.value) || "".concat(groupKey, "-").concat(key),
|
|
151
157
|
id: (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.value) || "".concat(groupKey, "-").concat(key)
|
|
152
158
|
})) : (type || item.type) === _groupType["default"].radio ? /*#__PURE__*/_react["default"].createElement(_Radio.Radio, (0, _extends2["default"])({}, item, {
|
|
153
159
|
isChecked: (item === null || item === void 0 ? void 0 : item.isChecked) || (0, _groupFilterConstants.isChecked)((groups === null || groups === void 0 ? void 0 : groups.value) || groupKey, (item === null || item === void 0 ? void 0 : item.value) || key, item === null || item === void 0 ? void 0 : item.id, item === null || item === void 0 ? void 0 : item.tagValue, stateSelected, selected) || false,
|
|
154
160
|
onChange: function onChange(value, event) {
|
|
155
|
-
|
|
161
|
+
var _item$onChange2;
|
|
162
|
+
|
|
163
|
+
item === null || item === void 0 ? void 0 : (_item$onChange2 = item.onChange) === null || _item$onChange2 === void 0 ? void 0 : _item$onChange2.call(item, value, event);
|
|
156
164
|
},
|
|
157
165
|
value: (item === null || item === void 0 ? void 0 : item.value) || key,
|
|
158
166
|
name: (item === null || item === void 0 ? void 0 : item.name) || (item === null || item === void 0 ? void 0 : item.value) || "".concat(groupKey, "-").concat(key),
|
|
@@ -167,6 +175,7 @@ var Group = function Group(_ref) {
|
|
|
167
175
|
};
|
|
168
176
|
|
|
169
177
|
return /*#__PURE__*/_react["default"].createElement(_Popper.Popper, {
|
|
178
|
+
appendTo: containerRef,
|
|
170
179
|
trigger: /*#__PURE__*/_react["default"].createElement(_MenuToggle.MenuToggle, {
|
|
171
180
|
ref: toggleRef,
|
|
172
181
|
onClick: onToggleClick,
|
|
@@ -185,7 +194,7 @@ var Group = function Group(_ref) {
|
|
|
185
194
|
}) : placeholder),
|
|
186
195
|
popper: /*#__PURE__*/_react["default"].createElement(_Menu.Menu, {
|
|
187
196
|
ref: menuRef,
|
|
188
|
-
className: (0, _classnames["default"])(className, {
|
|
197
|
+
className: (0, _classnames["default"])('ins-c-menu__scrollable', className, {
|
|
189
198
|
'pf-m-expanded': isOpen
|
|
190
199
|
})
|
|
191
200
|
}, /*#__PURE__*/_react["default"].createElement(_MenuContent.MenuContent, null, /*#__PURE__*/_react["default"].createElement(_MenuList.MenuList, null, menuItems.length > 0 && /*#__PURE__*/_react["default"].createElement(_MenuGroup.MenuGroup, null, renderItems(items)), groupMenuItems.map(function (group, groupKey) {
|
|
@@ -198,8 +207,7 @@ var Group = function Group(_ref) {
|
|
|
198
207
|
className: "ins-c-menu__show--more"
|
|
199
208
|
}, showMoreOptions, {
|
|
200
209
|
onClick: function onClick(e) {
|
|
201
|
-
|
|
202
|
-
onShowMore(e);
|
|
210
|
+
return onShowMore(e);
|
|
203
211
|
}
|
|
204
212
|
}), showMoreTitle) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
205
213
|
hidden: true,
|
|
@@ -235,7 +243,8 @@ Group.propTypes = {
|
|
|
235
243
|
}))
|
|
236
244
|
})),
|
|
237
245
|
onChange: _propTypes["default"].func.isRequired,
|
|
238
|
-
selectedTags: _propTypes["default"].shape({})
|
|
246
|
+
selectedTags: _propTypes["default"].shape({}),
|
|
247
|
+
containerRef: _propTypes["default"].element
|
|
239
248
|
};
|
|
240
249
|
var _default = Group;
|
|
241
250
|
exports["default"] = _default;
|
|
@@ -113,7 +113,8 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
|
113
113
|
onToggle: this.onToggle,
|
|
114
114
|
onSelect: this.onSelect,
|
|
115
115
|
isOpen: isExpanded,
|
|
116
|
-
placeholderText: placeholder
|
|
116
|
+
placeholderText: placeholder,
|
|
117
|
+
ouiaId: placeholder
|
|
117
118
|
}, items.map(function (_ref, key) {
|
|
118
119
|
var value = _ref.value,
|
|
119
120
|
isChecked = _ref.isChecked,
|
|
@@ -98,7 +98,8 @@ var Text = /*#__PURE__*/function (_Component) {
|
|
|
98
98
|
onKeyDown: function onKeyDown(e) {
|
|
99
99
|
return e.key === 'Enter' && onSubmit(e, value || stateValue);
|
|
100
100
|
},
|
|
101
|
-
"data-ouia-component-type": "PF4/TextInput"
|
|
101
|
+
"data-ouia-component-type": "PF4/TextInput",
|
|
102
|
+
ouiaId: "ConditionalFilter"
|
|
102
103
|
})), /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
103
104
|
size: "sm",
|
|
104
105
|
className: "ins-c-search-icon"
|
|
@@ -61,7 +61,11 @@
|
|
|
61
61
|
border: none;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
.pf-c-menu
|
|
64
|
+
.pf-c-menu.ins-c-menu__scrollable {
|
|
65
|
+
max-height: 416px;
|
|
66
|
+
overflow-y: auto;
|
|
67
|
+
}
|
|
68
|
+
.pf-c-menu .ins-c-menu__show--more {
|
|
65
69
|
background: none;
|
|
66
70
|
}
|
|
67
71
|
.pf-c-menu .ins-c-menu__show--more .pf-c-menu__item-text {
|
|
@@ -70,8 +70,12 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.pf-c-menu {
|
|
73
|
+
&.ins-c-menu__scrollable {
|
|
74
|
+
max-height: 416px;
|
|
75
|
+
overflow-y: auto;
|
|
76
|
+
}
|
|
73
77
|
.ins-c-menu__show--more {
|
|
74
|
-
|
|
78
|
+
background: none;
|
|
75
79
|
.pf-c-menu__item-text{ color: var(--pf-global--active-color--100); }
|
|
76
80
|
}
|
|
77
81
|
}
|
|
@@ -105,14 +105,15 @@ var DownloadButton = /*#__PURE__*/function (_Component) {
|
|
|
105
105
|
toggleIndicator: null,
|
|
106
106
|
onToggle: this.onToggle,
|
|
107
107
|
isDisabled: isDisabled,
|
|
108
|
-
ouiaId: "
|
|
108
|
+
ouiaId: "Export"
|
|
109
109
|
}, /*#__PURE__*/_react["default"].createElement(_exportIcon["default"], {
|
|
110
110
|
size: "sm"
|
|
111
111
|
})),
|
|
112
112
|
isOpen: isOpen,
|
|
113
|
+
ouiaId: "Export",
|
|
113
114
|
dropdownItems: [/*#__PURE__*/_react["default"].createElement(_DropdownItem.DropdownItem, {
|
|
114
115
|
key: "download-csv",
|
|
115
|
-
ouiaId: "
|
|
116
|
+
ouiaId: "DownloadCSV",
|
|
116
117
|
component: "button",
|
|
117
118
|
onClick: function onClick(event) {
|
|
118
119
|
return onSelect(event, 'csv');
|
|
@@ -120,7 +121,7 @@ var DownloadButton = /*#__PURE__*/function (_Component) {
|
|
|
120
121
|
isDisabled: isDisabled
|
|
121
122
|
}, "Export to CSV"), /*#__PURE__*/_react["default"].createElement(_DropdownItem.DropdownItem, {
|
|
122
123
|
key: "download-json",
|
|
123
|
-
ouiaId: "
|
|
124
|
+
ouiaId: "DownloadJSON",
|
|
124
125
|
component: "button",
|
|
125
126
|
onClick: function onClick(event) {
|
|
126
127
|
return onSelect(event, 'json');
|
|
@@ -87,6 +87,7 @@ var FilterChips = function FilterChips(_ref) {
|
|
|
87
87
|
}, chip.count)));
|
|
88
88
|
}), (showDeleteButton === true || showDeleteButton === undefined && filters.length > 0) && /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
89
89
|
variant: "link",
|
|
90
|
+
ouiaId: "ClearFilters",
|
|
90
91
|
onClick: function onClick(event) {
|
|
91
92
|
return onDelete(event, filters, true);
|
|
92
93
|
}
|
|
@@ -130,7 +130,9 @@ var Actions = /*#__PURE__*/function (_Component) {
|
|
|
130
130
|
|
|
131
131
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, firstAction && /*#__PURE__*/_react["default"].createElement(_ToolbarItem.ToolbarItem, {
|
|
132
132
|
className: "ins-c-primary-toolbar__first-action pf-m-spacer-sm"
|
|
133
|
-
}, firstAction.label ? /*#__PURE__*/_react["default"].createElement(_Button.Button, (0, _extends2["default"])({
|
|
133
|
+
}, firstAction.label ? /*#__PURE__*/_react["default"].createElement(_Button.Button, (0, _extends2["default"])({
|
|
134
|
+
ouiaId: "".concat(firstAction.label)
|
|
135
|
+
}, firstAction.props, {
|
|
134
136
|
onClick: firstAction.onClick || firstAction.props && firstAction.props.onClick || undefined
|
|
135
137
|
}), firstAction.label) : firstAction), exportConfig && (exportConfig.extraItems || exportConfig.onSelect) && /*#__PURE__*/_react["default"].createElement(_ToolbarItem.ToolbarItem, {
|
|
136
138
|
className: "pf-m-spacer-sm"
|
|
@@ -144,6 +146,7 @@ var Actions = /*#__PURE__*/function (_Component) {
|
|
|
144
146
|
|
|
145
147
|
_this2.toggleOpen(false);
|
|
146
148
|
},
|
|
149
|
+
ouiaId: "Actions",
|
|
147
150
|
toggle: /*#__PURE__*/_react["default"].createElement(_KebabToggle.KebabToggle, (0, _extends2["default"])({}, kebabToggleProps, {
|
|
148
151
|
onToggle: function onToggle(isOpen) {
|
|
149
152
|
return _this2.toggleOpen(isOpen);
|
|
@@ -120,7 +120,8 @@ var PrimaryToolbar = /*#__PURE__*/function (_Component) {
|
|
|
120
120
|
return /*#__PURE__*/_react["default"].createElement(_Toolbar.Toolbar, (0, _extends2["default"])({}, props, {
|
|
121
121
|
className: "".concat(className || '', " ins-c-primary-toolbar"),
|
|
122
122
|
toggleIsExpanded: toggleIsExpanded,
|
|
123
|
-
id: id || 'ins-primary-data-toolbar'
|
|
123
|
+
id: id || 'ins-primary-data-toolbar',
|
|
124
|
+
ouiaId: "PrimaryToolbar"
|
|
124
125
|
}), /*#__PURE__*/_react["default"].createElement(_ToolbarContent.ToolbarContent, null, (expandAll || bulkSelect || filterConfig || dedicatedAction) && /*#__PURE__*/_react["default"].createElement(_ToolbarGroup.ToolbarGroup, {
|
|
125
126
|
className: "ins-c-primary-toolbar__group-filter pf-m-spacer-md pf-m-space-items-lg",
|
|
126
127
|
variant: "filter-group"
|
|
@@ -129,8 +130,11 @@ var PrimaryToolbar = /*#__PURE__*/function (_Component) {
|
|
|
129
130
|
"aria-label": "".concat(expandAll.isAllExpanded ? 'Collapse' : 'Expand', " all"),
|
|
130
131
|
onClick: function onClick(e) {
|
|
131
132
|
return expandAll.onClick(e, !expandAll.isAllExpanded);
|
|
132
|
-
}
|
|
133
|
-
|
|
133
|
+
},
|
|
134
|
+
ouiaId: "ExpandCollapseAll"
|
|
135
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolbarExpandIconWrapper.ToolbarExpandIconWrapper, null, expandAll.isAllExpanded ? /*#__PURE__*/_react["default"].createElement(_angleDownIcon["default"], null) : /*#__PURE__*/_react["default"].createElement(_angleRightIcon["default"], null)))), bulkSelect && /*#__PURE__*/_react["default"].createElement(_ToolbarItem.ToolbarItem, null, /*#__PURE__*/_react["default"].isValidElement(bulkSelect) ? bulkSelect : /*#__PURE__*/_react["default"].createElement(_BulkSelect.BulkSelect, (0, _extends2["default"])({
|
|
136
|
+
ouiaId: "BulkSelect"
|
|
137
|
+
}, bulkSelect))), filterConfig && /*#__PURE__*/_react["default"].createElement(_ToolbarItem.ToolbarItem, {
|
|
134
138
|
className: "ins-c-primary-toolbar__filter"
|
|
135
139
|
}, /*#__PURE__*/_react["default"].isValidElement(filterConfig) ? filterConfig : /*#__PURE__*/_react["default"].createElement(_ConditionalFilter.ConditionalFilter, (0, _extends2["default"])({
|
|
136
140
|
useMobileLayout: useMobileLayout
|
|
@@ -142,7 +146,8 @@ var PrimaryToolbar = /*#__PURE__*/function (_Component) {
|
|
|
142
146
|
}, /*#__PURE__*/_react["default"].isValidElement(sortByConfig) ? sortByConfig : /*#__PURE__*/_react["default"].createElement(_SortBy["default"], sortByConfig)), children, pagination && /*#__PURE__*/_react["default"].createElement(_ToolbarItem.ToolbarItem, {
|
|
143
147
|
className: "ins-c-primary-toolbar__pagination"
|
|
144
148
|
}, /*#__PURE__*/_react["default"].isValidElement(pagination) ? pagination : /*#__PURE__*/_react["default"].createElement(_Pagination.Pagination, (0, _extends2["default"])({
|
|
145
|
-
isCompact: true
|
|
149
|
+
isCompact: true,
|
|
150
|
+
ouiaId: "CompactPagination"
|
|
146
151
|
}, pagination)))), activeFiltersConfig && /*#__PURE__*/_react["default"].isValidElement(activeFiltersConfig) ? /*#__PURE__*/_react["default"].createElement(_ToolbarContent.ToolbarContent, null, /*#__PURE__*/_react["default"].createElement(_ToolbarItem.ToolbarItem, null, activeFiltersConfig)) : activeFiltersConfig !== undefined && (activeFiltersConfig.filters.length > 0 || activeFiltersConfig.showDeleteButton === true) && /*#__PURE__*/_react["default"].createElement(_ToolbarContent.ToolbarContent, null, /*#__PURE__*/_react["default"].createElement(_ToolbarItem.ToolbarItem, null, /*#__PURE__*/_react["default"].createElement(_FilterChips.FilterChips, activeFiltersConfig))));
|
|
147
152
|
}
|
|
148
153
|
}]);
|
|
@@ -97,7 +97,7 @@ visible unless you update it.');
|
|
|
97
97
|
ouiaSafe: ouiaSafe,
|
|
98
98
|
toggle: /*#__PURE__*/React.createElement(DropdownToggle, _extends({}, toggleProps, {
|
|
99
99
|
isDisabled: isDisabled,
|
|
100
|
-
ouiaId:
|
|
100
|
+
ouiaId: ouiaFinalId,
|
|
101
101
|
splitButtonItems: [/*#__PURE__*/React.createElement(Fragment, {
|
|
102
102
|
key: "split-checkbox"
|
|
103
103
|
}, hasError ? /*#__PURE__*/React.createElement(DropdownToggleCheckbox, {
|
|
@@ -105,13 +105,13 @@ visible unless you update it.');
|
|
|
105
105
|
"aria-label": "Select all",
|
|
106
106
|
onChange: onSelect,
|
|
107
107
|
checked: checked,
|
|
108
|
-
ouiaId:
|
|
108
|
+
ouiaId: ouiaFinalId
|
|
109
109
|
}) : /*#__PURE__*/React.createElement(DropdownToggleCheckbox, {
|
|
110
110
|
id: id ? "".concat(id, "-toggle-checkbox") : 'toggle-checkbox',
|
|
111
111
|
"aria-label": "Select all",
|
|
112
112
|
onChange: onSelect,
|
|
113
113
|
isChecked: checked,
|
|
114
|
-
ouiaId:
|
|
114
|
+
ouiaId: ouiaFinalId
|
|
115
115
|
}, count ? "".concat(count, " selected") : ''))],
|
|
116
116
|
onToggle: this.onToggle
|
|
117
117
|
})),
|
|
@@ -119,7 +119,8 @@ var CheckboxFilter = /*#__PURE__*/function (_Component) {
|
|
|
119
119
|
onSelect: this.onSelect,
|
|
120
120
|
selections: this.calculateSelected(),
|
|
121
121
|
isOpen: isExpanded,
|
|
122
|
-
placeholderText: placeholder
|
|
122
|
+
placeholderText: placeholder,
|
|
123
|
+
ouiaId: placeholder
|
|
123
124
|
}, items.map(function (_ref2, key) {
|
|
124
125
|
var value = _ref2.value,
|
|
125
126
|
_onClick = _ref2.onClick,
|
|
@@ -116,7 +116,8 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
116
116
|
placeholder = _this$props.placeholder,
|
|
117
117
|
hideLabel = _this$props.hideLabel,
|
|
118
118
|
isDisabled = _this$props.isDisabled,
|
|
119
|
-
|
|
119
|
+
containerRef = _this$props.containerRef,
|
|
120
|
+
props = _objectWithoutProperties(_this$props, ["items", "value", "onChange", "placeholder", "hideLabel", "isDisabled", "containerRef"]);
|
|
120
121
|
|
|
121
122
|
var _this$state = this.state,
|
|
122
123
|
isOpen = _this$state.isOpen,
|
|
@@ -166,10 +167,12 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
166
167
|
return _this3.dropdownToggle(false);
|
|
167
168
|
},
|
|
168
169
|
isOpen: isOpen,
|
|
170
|
+
ouiaId: "ConditionalFilter",
|
|
169
171
|
toggle: /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
170
172
|
onToggle: this.dropdownToggle,
|
|
171
173
|
isDisabled: isDisabled,
|
|
172
|
-
className: hideLabel ? 'ins-c-conditional-filter__no-label' : ''
|
|
174
|
+
className: hideLabel ? 'ins-c-conditional-filter__no-label' : '',
|
|
175
|
+
ouiaId: "ConditionalFilter"
|
|
173
176
|
}, /*#__PURE__*/React.createElement(FilterIcon, {
|
|
174
177
|
size: "sm"
|
|
175
178
|
}), !hideLabel && /*#__PURE__*/React.createElement("span", {
|
|
@@ -179,6 +182,7 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
179
182
|
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
180
183
|
key: item.id ? "".concat(item.id, "-dropdown") : key,
|
|
181
184
|
component: "button",
|
|
185
|
+
ouiaId: item.label,
|
|
182
186
|
onClick: function onClick(e) {
|
|
183
187
|
return onChangeCallback(e, item.value || key, item);
|
|
184
188
|
},
|
|
@@ -190,7 +194,9 @@ var ConditionalFilter = /*#__PURE__*/function (_Component) {
|
|
|
190
194
|
}, /*#__PURE__*/React.createElement(ActiveComponent, _extends({}, activeItem.type !== conditionalFilterType.custom && {
|
|
191
195
|
placeholder: placeholder || activeItem.placeholder || "Filter by ".concat(activeItem.label),
|
|
192
196
|
id: activeItem.filterValues && activeItem.filterValues.id || currentValue
|
|
193
|
-
}, activeItem.filterValues
|
|
197
|
+
}, activeItem.filterValues, {
|
|
198
|
+
containerRef: containerRef
|
|
199
|
+
}))))));
|
|
194
200
|
}
|
|
195
201
|
}]);
|
|
196
202
|
|
|
@@ -31,7 +31,8 @@ var Group = function Group(_ref) {
|
|
|
31
31
|
groups = _ref$groups === void 0 ? [] : _ref$groups,
|
|
32
32
|
onChange = _ref.onChange,
|
|
33
33
|
selected = _ref.selected,
|
|
34
|
-
isFilterable = _ref.isFilterable
|
|
34
|
+
isFilterable = _ref.isFilterable,
|
|
35
|
+
containerRef = _ref.containerRef;
|
|
35
36
|
|
|
36
37
|
var _useState = useState({}),
|
|
37
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -90,10 +91,7 @@ var Group = function Group(_ref) {
|
|
|
90
91
|
ev.stopPropagation(); // Stop handleClickOutside from handling
|
|
91
92
|
|
|
92
93
|
ev.persist();
|
|
93
|
-
|
|
94
|
-
if (!(isOpen && toggleRef.current.contains(ev.target))) {
|
|
95
|
-
setIsOpen(!isOpen);
|
|
96
|
-
}
|
|
94
|
+
setIsOpen(!isOpen);
|
|
97
95
|
};
|
|
98
96
|
|
|
99
97
|
var groupMenuItems = getGroupMenuItems(groups, onChange, calculateSelection(selected));
|
|
@@ -105,7 +103,11 @@ var Group = function Group(_ref) {
|
|
|
105
103
|
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
106
104
|
itemId: key,
|
|
107
105
|
key: "".concat(item.value, "-").concat(key, "-item"),
|
|
108
|
-
className: item === null || item === void 0 ? void 0 : item.className
|
|
106
|
+
className: item === null || item === void 0 ? void 0 : item.className,
|
|
107
|
+
onClick: item.onClick && (type || item.type) === groupType.checkbox ? function (e) {
|
|
108
|
+
item.onClick();
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
} : undefined
|
|
109
111
|
}, (type || item.type) === groupType.checkbox ? /*#__PURE__*/React.createElement(Checkbox, _extends({}, item, {
|
|
110
112
|
label: item === null || item === void 0 ? void 0 : item.label,
|
|
111
113
|
isChecked: (item === null || item === void 0 ? void 0 : item.isChecked) || isChecked(groupKey, (item === null || item === void 0 ? void 0 : item.value) || key, item === null || item === void 0 ? void 0 : item.id, item === null || item === void 0 ? void 0 : item.tagValue, stateSelected, selected) || false,
|
|
@@ -114,12 +116,18 @@ var Group = function Group(_ref) {
|
|
|
114
116
|
|
|
115
117
|
item === null || item === void 0 ? void 0 : (_item$onChange = item.onChange) === null || _item$onChange === void 0 ? void 0 : _item$onChange.call(item, value, event);
|
|
116
118
|
},
|
|
119
|
+
onClick: item.onClick ? function (e) {
|
|
120
|
+
item.onClick();
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
} : undefined,
|
|
117
123
|
name: (item === null || item === void 0 ? void 0 : item.name) || (item === null || item === void 0 ? void 0 : item.value) || "".concat(groupKey, "-").concat(key),
|
|
118
124
|
id: (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.value) || "".concat(groupKey, "-").concat(key)
|
|
119
125
|
})) : (type || item.type) === groupType.radio ? /*#__PURE__*/React.createElement(Radio, _extends({}, item, {
|
|
120
126
|
isChecked: (item === null || item === void 0 ? void 0 : item.isChecked) || isChecked((groups === null || groups === void 0 ? void 0 : groups.value) || groupKey, (item === null || item === void 0 ? void 0 : item.value) || key, item === null || item === void 0 ? void 0 : item.id, item === null || item === void 0 ? void 0 : item.tagValue, stateSelected, selected) || false,
|
|
121
127
|
onChange: function onChange(value, event) {
|
|
122
|
-
|
|
128
|
+
var _item$onChange2;
|
|
129
|
+
|
|
130
|
+
item === null || item === void 0 ? void 0 : (_item$onChange2 = item.onChange) === null || _item$onChange2 === void 0 ? void 0 : _item$onChange2.call(item, value, event);
|
|
123
131
|
},
|
|
124
132
|
value: (item === null || item === void 0 ? void 0 : item.value) || key,
|
|
125
133
|
name: (item === null || item === void 0 ? void 0 : item.name) || (item === null || item === void 0 ? void 0 : item.value) || "".concat(groupKey, "-").concat(key),
|
|
@@ -134,6 +142,7 @@ var Group = function Group(_ref) {
|
|
|
134
142
|
};
|
|
135
143
|
|
|
136
144
|
return /*#__PURE__*/React.createElement(Popper, {
|
|
145
|
+
appendTo: containerRef,
|
|
137
146
|
trigger: /*#__PURE__*/React.createElement(MenuToggle, {
|
|
138
147
|
ref: toggleRef,
|
|
139
148
|
onClick: onToggleClick,
|
|
@@ -152,7 +161,7 @@ var Group = function Group(_ref) {
|
|
|
152
161
|
}) : placeholder),
|
|
153
162
|
popper: /*#__PURE__*/React.createElement(Menu, {
|
|
154
163
|
ref: menuRef,
|
|
155
|
-
className: classNames(className, {
|
|
164
|
+
className: classNames('ins-c-menu__scrollable', className, {
|
|
156
165
|
'pf-m-expanded': isOpen
|
|
157
166
|
})
|
|
158
167
|
}, /*#__PURE__*/React.createElement(MenuContent, null, /*#__PURE__*/React.createElement(MenuList, null, menuItems.length > 0 && /*#__PURE__*/React.createElement(MenuGroup, null, renderItems(items)), groupMenuItems.map(function (group, groupKey) {
|
|
@@ -165,8 +174,7 @@ var Group = function Group(_ref) {
|
|
|
165
174
|
className: "ins-c-menu__show--more"
|
|
166
175
|
}, showMoreOptions, {
|
|
167
176
|
onClick: function onClick(e) {
|
|
168
|
-
|
|
169
|
-
onShowMore(e);
|
|
177
|
+
return onShowMore(e);
|
|
170
178
|
}
|
|
171
179
|
}), showMoreTitle) : /*#__PURE__*/React.createElement("span", {
|
|
172
180
|
hidden: true,
|
|
@@ -202,6 +210,7 @@ Group.propTypes = {
|
|
|
202
210
|
}))
|
|
203
211
|
})),
|
|
204
212
|
onChange: PropTypes.func.isRequired,
|
|
205
|
-
selectedTags: PropTypes.shape({})
|
|
213
|
+
selectedTags: PropTypes.shape({}),
|
|
214
|
+
containerRef: PropTypes.element
|
|
206
215
|
};
|
|
207
216
|
export default Group;
|
|
@@ -89,7 +89,8 @@ var Radio = /*#__PURE__*/function (_Component) {
|
|
|
89
89
|
onToggle: this.onToggle,
|
|
90
90
|
onSelect: this.onSelect,
|
|
91
91
|
isOpen: isExpanded,
|
|
92
|
-
placeholderText: placeholder
|
|
92
|
+
placeholderText: placeholder,
|
|
93
|
+
ouiaId: placeholder
|
|
93
94
|
}, items.map(function (_ref, key) {
|
|
94
95
|
var value = _ref.value,
|
|
95
96
|
isChecked = _ref.isChecked,
|
|
@@ -75,7 +75,8 @@ var Text = /*#__PURE__*/function (_Component) {
|
|
|
75
75
|
onKeyDown: function onKeyDown(e) {
|
|
76
76
|
return e.key === 'Enter' && onSubmit(e, value || stateValue);
|
|
77
77
|
},
|
|
78
|
-
"data-ouia-component-type": "PF4/TextInput"
|
|
78
|
+
"data-ouia-component-type": "PF4/TextInput",
|
|
79
|
+
ouiaId: "ConditionalFilter"
|
|
79
80
|
})), /*#__PURE__*/React.createElement(Icon, {
|
|
80
81
|
size: "sm",
|
|
81
82
|
className: "ins-c-search-icon"
|
|
@@ -82,14 +82,15 @@ var DownloadButton = /*#__PURE__*/function (_Component) {
|
|
|
82
82
|
toggleIndicator: null,
|
|
83
83
|
onToggle: this.onToggle,
|
|
84
84
|
isDisabled: isDisabled,
|
|
85
|
-
ouiaId: "
|
|
85
|
+
ouiaId: "Export"
|
|
86
86
|
}, /*#__PURE__*/React.createElement(ExportIcon, {
|
|
87
87
|
size: "sm"
|
|
88
88
|
})),
|
|
89
89
|
isOpen: isOpen,
|
|
90
|
+
ouiaId: "Export",
|
|
90
91
|
dropdownItems: [/*#__PURE__*/React.createElement(DropdownItem, {
|
|
91
92
|
key: "download-csv",
|
|
92
|
-
ouiaId: "
|
|
93
|
+
ouiaId: "DownloadCSV",
|
|
93
94
|
component: "button",
|
|
94
95
|
onClick: function onClick(event) {
|
|
95
96
|
return onSelect(event, 'csv');
|
|
@@ -97,7 +98,7 @@ var DownloadButton = /*#__PURE__*/function (_Component) {
|
|
|
97
98
|
isDisabled: isDisabled
|
|
98
99
|
}, "Export to CSV"), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
99
100
|
key: "download-json",
|
|
100
|
-
ouiaId: "
|
|
101
|
+
ouiaId: "DownloadJSON",
|
|
101
102
|
component: "button",
|
|
102
103
|
onClick: function onClick(event) {
|
|
103
104
|
return onSelect(event, 'json');
|
|
@@ -70,6 +70,7 @@ var FilterChips = function FilterChips(_ref) {
|
|
|
70
70
|
}, chip.count)));
|
|
71
71
|
}), (showDeleteButton === true || showDeleteButton === undefined && filters.length > 0) && /*#__PURE__*/React.createElement(Button, {
|
|
72
72
|
variant: "link",
|
|
73
|
+
ouiaId: "ClearFilters",
|
|
73
74
|
onClick: function onClick(event) {
|
|
74
75
|
return onDelete(event, filters, true);
|
|
75
76
|
}
|
|
@@ -95,7 +95,9 @@ var Actions = /*#__PURE__*/function (_Component) {
|
|
|
95
95
|
|
|
96
96
|
return /*#__PURE__*/React.createElement(Fragment, null, firstAction && /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
97
97
|
className: "ins-c-primary-toolbar__first-action pf-m-spacer-sm"
|
|
98
|
-
}, firstAction.label ? /*#__PURE__*/React.createElement(Button, _extends({
|
|
98
|
+
}, firstAction.label ? /*#__PURE__*/React.createElement(Button, _extends({
|
|
99
|
+
ouiaId: "".concat(firstAction.label)
|
|
100
|
+
}, firstAction.props, {
|
|
99
101
|
onClick: firstAction.onClick || firstAction.props && firstAction.props.onClick || undefined
|
|
100
102
|
}), firstAction.label) : firstAction), exportConfig && (exportConfig.extraItems || exportConfig.onSelect) && /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
101
103
|
className: "pf-m-spacer-sm"
|
|
@@ -109,6 +111,7 @@ var Actions = /*#__PURE__*/function (_Component) {
|
|
|
109
111
|
|
|
110
112
|
_this2.toggleOpen(false);
|
|
111
113
|
},
|
|
114
|
+
ouiaId: "Actions",
|
|
112
115
|
toggle: /*#__PURE__*/React.createElement(KebabToggle, _extends({}, kebabToggleProps, {
|
|
113
116
|
onToggle: function onToggle(isOpen) {
|
|
114
117
|
return _this2.toggleOpen(isOpen);
|
|
@@ -83,7 +83,8 @@ var PrimaryToolbar = /*#__PURE__*/function (_Component) {
|
|
|
83
83
|
return /*#__PURE__*/React.createElement(Toolbar, _extends({}, props, {
|
|
84
84
|
className: "".concat(className || '', " ins-c-primary-toolbar"),
|
|
85
85
|
toggleIsExpanded: toggleIsExpanded,
|
|
86
|
-
id: id || 'ins-primary-data-toolbar'
|
|
86
|
+
id: id || 'ins-primary-data-toolbar',
|
|
87
|
+
ouiaId: "PrimaryToolbar"
|
|
87
88
|
}), /*#__PURE__*/React.createElement(ToolbarContent, null, (expandAll || bulkSelect || filterConfig || dedicatedAction) && /*#__PURE__*/React.createElement(ToolbarGroup, {
|
|
88
89
|
className: "ins-c-primary-toolbar__group-filter pf-m-spacer-md pf-m-space-items-lg",
|
|
89
90
|
variant: "filter-group"
|
|
@@ -92,8 +93,11 @@ var PrimaryToolbar = /*#__PURE__*/function (_Component) {
|
|
|
92
93
|
"aria-label": "".concat(expandAll.isAllExpanded ? 'Collapse' : 'Expand', " all"),
|
|
93
94
|
onClick: function onClick(e) {
|
|
94
95
|
return expandAll.onClick(e, !expandAll.isAllExpanded);
|
|
95
|
-
}
|
|
96
|
-
|
|
96
|
+
},
|
|
97
|
+
ouiaId: "ExpandCollapseAll"
|
|
98
|
+
}, /*#__PURE__*/React.createElement(ToolbarExpandIconWrapper, null, expandAll.isAllExpanded ? /*#__PURE__*/React.createElement(AngleDownIcon, null) : /*#__PURE__*/React.createElement(AngleRightIcon, null)))), bulkSelect && /*#__PURE__*/React.createElement(ToolbarItem, null, /*#__PURE__*/React.isValidElement(bulkSelect) ? bulkSelect : /*#__PURE__*/React.createElement(BulkSelect, _extends({
|
|
99
|
+
ouiaId: "BulkSelect"
|
|
100
|
+
}, bulkSelect))), filterConfig && /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
97
101
|
className: "ins-c-primary-toolbar__filter"
|
|
98
102
|
}, /*#__PURE__*/React.isValidElement(filterConfig) ? filterConfig : /*#__PURE__*/React.createElement(ConditionalFilter, _extends({
|
|
99
103
|
useMobileLayout: useMobileLayout
|
|
@@ -105,7 +109,8 @@ var PrimaryToolbar = /*#__PURE__*/function (_Component) {
|
|
|
105
109
|
}, /*#__PURE__*/React.isValidElement(sortByConfig) ? sortByConfig : /*#__PURE__*/React.createElement(SortBy, sortByConfig)), children, pagination && /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
106
110
|
className: "ins-c-primary-toolbar__pagination"
|
|
107
111
|
}, /*#__PURE__*/React.isValidElement(pagination) ? pagination : /*#__PURE__*/React.createElement(Pagination, _extends({
|
|
108
|
-
isCompact: true
|
|
112
|
+
isCompact: true,
|
|
113
|
+
ouiaId: "CompactPagination"
|
|
109
114
|
}, pagination)))), activeFiltersConfig && /*#__PURE__*/React.isValidElement(activeFiltersConfig) ? /*#__PURE__*/React.createElement(ToolbarContent, null, /*#__PURE__*/React.createElement(ToolbarItem, null, activeFiltersConfig)) : activeFiltersConfig !== undefined && (activeFiltersConfig.filters.length > 0 || activeFiltersConfig.showDeleteButton === true) && /*#__PURE__*/React.createElement(ToolbarContent, null, /*#__PURE__*/React.createElement(ToolbarItem, null, /*#__PURE__*/React.createElement(FilterChips, activeFiltersConfig))));
|
|
110
115
|
}
|
|
111
116
|
}]);
|
package/index.css
CHANGED
|
@@ -132,7 +132,11 @@ i.ins-battery svg {
|
|
|
132
132
|
border: none;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
.pf-c-menu
|
|
135
|
+
.pf-c-menu.ins-c-menu__scrollable {
|
|
136
|
+
max-height: 416px;
|
|
137
|
+
overflow-y: auto;
|
|
138
|
+
}
|
|
139
|
+
.pf-c-menu .ins-c-menu__show--more {
|
|
136
140
|
background: none;
|
|
137
141
|
}
|
|
138
142
|
.pf-c-menu .ins-c-menu__show--more .pf-c-menu__item-text {
|