@rh-support/components 2.5.24 → 2.5.26
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/lib/esm/ConfirmationModal/ConfirmationDialog.d.ts.map +1 -1
- package/lib/esm/ConfirmationModal/ConfirmationDialog.js +5 -5
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.js +2 -16
- package/lib/esm/FeedbackForm/FeedbackForm.js +8 -8
- package/lib/esm/InlineEdit/NewInlineEdit.js +1 -1
- package/lib/esm/InlineEdit/inlineEdit.css +0 -1
- package/lib/esm/InlineEdit/newInlineEdit.css +26 -3
- package/lib/esm/LanguageSelector/languageSelector.css +1 -1
- package/lib/esm/LoadingDots/LoadingDots.js +1 -1
- package/lib/esm/LoginModal/LoginModal.d.ts.map +1 -1
- package/lib/esm/LoginModal/LoginModal.js +7 -5
- package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/lib/esm/MarkdownEditor/MarkdownEditor.js +53 -57
- package/lib/esm/MarkdownEditor/markdownEditor.css +5 -5
- package/lib/esm/PaginationCompact/PaginationCompact.d.ts.map +1 -1
- package/lib/esm/PaginationCompact/PaginationCompact.js +6 -8
- package/lib/esm/PaginationCompact/paginationCompact.css +1 -1
- package/lib/esm/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/lib/esm/PhoneInput/PhoneInput.js +50 -32
- package/lib/esm/PhoneInput/PhoneInput.scss +1 -1
- package/lib/esm/SingleSelectDropdown/SingleSelectDropdown.d.ts +6 -2
- package/lib/esm/SingleSelectDropdown/SingleSelectDropdown.d.ts.map +1 -1
- package/lib/esm/SingleSelectDropdown/SingleSelectDropdown.js +33 -14
- package/lib/esm/SubscriptionAbuse/SubscriptionAbuseModal.js +6 -6
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.d.ts.map +1 -1
- package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.js +13 -15
- package/lib/esm/Table/PFTable.d.ts +15 -9
- package/lib/esm/Table/PFTable.d.ts.map +1 -1
- package/lib/esm/Table/PFTable.js +131 -120
- package/lib/esm/TagsSelector/TagsSelector.d.ts.map +1 -1
- package/lib/esm/TagsSelector/TagsSelector.js +6 -8
- package/lib/esm/TagsSelector/tagSelector.css +2 -2
- package/lib/esm/TermsAndConditions/AcceptTermsModal.d.ts.map +1 -1
- package/lib/esm/TermsAndConditions/AcceptTermsModal.js +30 -24
- package/lib/esm/ToastNotification/toastNotification.css +1 -1
- package/lib/esm/TopContentSearch/TopContentSearch.js +1 -1
- package/lib/esm/TypeaheadDropdown/TypeaheadDropdown.d.ts.map +1 -1
- package/lib/esm/TypeaheadDropdown/TypeaheadDropdown.js +2 -3
- package/lib/esm/ValueChangedIcon/ValueChangedIcon.js +1 -1
- package/lib/esm/helperFunctions/errorMessage.js +2 -2
- package/lib/esm/helperFunctions/errorMessage.scss +1 -1
- package/package.json +12 -12
package/lib/esm/Table/PFTable.js
CHANGED
|
@@ -9,58 +9,46 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { Bullseye, EmptyState,
|
|
12
|
+
import { Bullseye, EmptyState, EmptyStateVariant, Spinner } from '@patternfly/react-core';
|
|
13
13
|
import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
14
|
-
import {
|
|
15
|
-
import { Table, TableBody, TableHeader } from '@patternfly/react-table/deprecated';
|
|
14
|
+
import { ActionsColumn, SortByDirection, Table, TableVariant, Tbody, Td, Th, Thead, Tr, } from '@patternfly/react-table';
|
|
16
15
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
17
16
|
import { useTableContext } from './TableProvider';
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
];
|
|
32
|
-
const loadingRowDefault = [
|
|
33
|
-
{
|
|
34
|
-
heightAuto: true,
|
|
35
|
-
cells: [
|
|
36
|
-
{
|
|
37
|
-
props: { colSpan: 9 },
|
|
38
|
-
title: (React.createElement(Bullseye, { style: { minHeight: '350px' } },
|
|
39
|
-
React.createElement(EmptyState, { variant: EmptyStateVariant.sm },
|
|
40
|
-
React.createElement(Spinner, { size: "xl" })))),
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
];
|
|
17
|
+
const emptyStateRowDefault = {
|
|
18
|
+
heightAuto: true,
|
|
19
|
+
colSpan: 8,
|
|
20
|
+
content: (React.createElement(Bullseye, null,
|
|
21
|
+
React.createElement(EmptyState, { headingLevel: "h2", icon: SearchIcon, titleText: "No results found", variant: EmptyStateVariant.sm }))),
|
|
22
|
+
};
|
|
23
|
+
const loadingRowDefault = {
|
|
24
|
+
heightAuto: true,
|
|
25
|
+
colSpan: 9,
|
|
26
|
+
content: (React.createElement(Bullseye, { style: { minHeight: '350px' } },
|
|
27
|
+
React.createElement(EmptyState, { variant: EmptyStateVariant.sm },
|
|
28
|
+
React.createElement(Spinner, { size: "xl" })))),
|
|
29
|
+
};
|
|
45
30
|
const defaultSortMethod = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
46
31
|
export const defaultTableSortMethod = defaultSortMethod;
|
|
47
32
|
function PFTable(props) {
|
|
48
|
-
const { className, pagination, onRowClick, onSortChange, onSelect, emptyStateRow = emptyStateRowDefault, loadingRow = loadingRowDefault, isLoading, keepPageNumberOnDataChange, sortInfo } = props, restProps = __rest(props, ["className", "pagination", "onRowClick", "onSortChange", "onSelect", "emptyStateRow", "loadingRow", "isLoading", "keepPageNumberOnDataChange", "sortInfo"]);
|
|
33
|
+
const { className, pagination, onRowClick, onSortChange, onSelect, emptyStateRow = emptyStateRowDefault, loadingRow = loadingRowDefault, isLoading, keepPageNumberOnDataChange, sortInfo, actionResolver, actions, areActionsDisabled, variant = TableVariant.compact } = props, restProps = __rest(props, ["className", "pagination", "onRowClick", "onSortChange", "onSelect", "emptyStateRow", "loadingRow", "isLoading", "keepPageNumberOnDataChange", "sortInfo", "actionResolver", "actions", "areActionsDisabled", "variant"]);
|
|
49
34
|
const { columns, data, currentPage, perPage, setSelectedPage } = useTableContext();
|
|
50
35
|
const [sortBy, setSortBy] = useState();
|
|
51
|
-
const [
|
|
52
|
-
const [
|
|
36
|
+
const [processedData, setProcessedData] = useState([]);
|
|
37
|
+
const [selectedRows, setSelectedRows] = useState(new Set());
|
|
38
|
+
const [allRowsSelected, setAllRowsSelected] = useState(false);
|
|
53
39
|
const isSelectColumnVisible = onSelect && (data || []).length > 0;
|
|
54
|
-
const onSort = (event,
|
|
40
|
+
const onSort = (event, columnIndex, sortByDirection) => {
|
|
55
41
|
// if onselect option is passed we need to decrease index by 1 to account for the checkbox column
|
|
56
|
-
const actualIndex = isSelectColumnVisible ?
|
|
57
|
-
if (sortBy && sortBy.index ===
|
|
42
|
+
const actualIndex = isSelectColumnVisible ? columnIndex - 1 : columnIndex;
|
|
43
|
+
if (sortBy && sortBy.index === columnIndex && sortBy.direction === sortByDirection)
|
|
58
44
|
return;
|
|
59
45
|
setSortBy({
|
|
60
|
-
index,
|
|
61
|
-
direction,
|
|
46
|
+
index: columnIndex,
|
|
47
|
+
direction: sortByDirection,
|
|
62
48
|
});
|
|
63
|
-
onSortChange
|
|
49
|
+
onSortChange
|
|
50
|
+
? onSortChange(columns[actualIndex], sortByDirection)
|
|
51
|
+
: setSortedRows(actualIndex, sortByDirection);
|
|
64
52
|
};
|
|
65
53
|
useEffect(() => {
|
|
66
54
|
if (!sortInfo)
|
|
@@ -72,7 +60,7 @@ function PFTable(props) {
|
|
|
72
60
|
return;
|
|
73
61
|
setSortBy({
|
|
74
62
|
index: actualIndex,
|
|
75
|
-
direction,
|
|
63
|
+
direction: direction,
|
|
76
64
|
});
|
|
77
65
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
66
|
}, [sortInfo]);
|
|
@@ -80,100 +68,123 @@ function PFTable(props) {
|
|
|
80
68
|
if (onSortChange)
|
|
81
69
|
return;
|
|
82
70
|
const sortMethod = columns[index].sortMethod || defaultSortMethod;
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
[pfRows, columns]);
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
const mappedPFColumns = columns.map((item) => {
|
|
91
|
-
const { title, sortable: isSortable, show, cellWidth: width } = item;
|
|
92
|
-
// tslint:disable-next-line:no-object-literal-type-assertion
|
|
93
|
-
const mappedColumn = {};
|
|
94
|
-
mappedColumn['title'] = title || '';
|
|
95
|
-
if (isSortable) {
|
|
96
|
-
mappedColumn['transforms'] = [];
|
|
97
|
-
mappedColumn['transforms'].push(sortable);
|
|
98
|
-
}
|
|
99
|
-
if (width) {
|
|
100
|
-
mappedColumn['transforms'] = mappedColumn['transforms'] || [];
|
|
101
|
-
mappedColumn['transforms'].push(cellWidth(width));
|
|
102
|
-
}
|
|
103
|
-
if (show !== undefined && !show) {
|
|
104
|
-
mappedColumn['columnTransforms'] = [classNames(Visibility.hidden)];
|
|
105
|
-
}
|
|
106
|
-
return mappedColumn;
|
|
71
|
+
const dataToSort = rows || processedData;
|
|
72
|
+
const sortedRows = [...dataToSort].sort((a, b) => {
|
|
73
|
+
const aValue = columns[index].accessor ? columns[index].accessor(a) : a;
|
|
74
|
+
const bValue = columns[index].accessor ? columns[index].accessor(b) : b;
|
|
75
|
+
return sortMethod(aValue, bValue, direction);
|
|
107
76
|
});
|
|
108
|
-
|
|
109
|
-
|
|
77
|
+
const sortedData = direction === SortByDirection.asc ? sortedRows : sortedRows.reverse();
|
|
78
|
+
setProcessedData(sortedData);
|
|
79
|
+
}, [processedData, columns, onSortChange]);
|
|
110
80
|
useEffect(() => {
|
|
111
|
-
|
|
112
|
-
const a = [];
|
|
113
|
-
columns.forEach((item) => {
|
|
114
|
-
const { accessor, cell, rowProps = noop } = item;
|
|
115
|
-
if (cell) {
|
|
116
|
-
a.push({ title: cell(row, index), props: Object.assign({}, rowProps(row)) });
|
|
117
|
-
}
|
|
118
|
-
else if (accessor) {
|
|
119
|
-
const rowData = accessor(row);
|
|
120
|
-
a.push(rowData);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
return { cells: a };
|
|
124
|
-
});
|
|
125
|
-
setPFRows(rows);
|
|
81
|
+
setProcessedData([...data]);
|
|
126
82
|
pagination && !keepPageNumberOnDataChange && setSelectedPage(1);
|
|
127
83
|
if (sortBy && sortBy.direction && sortBy.index !== undefined && (data || []).length > 0) {
|
|
128
84
|
const actualIndex = isSelectColumnVisible ? sortBy.index - 1 : sortBy.index;
|
|
129
|
-
setSortedRows(actualIndex, sortBy.direction,
|
|
85
|
+
setSortedRows(actualIndex, sortBy.direction, data);
|
|
130
86
|
}
|
|
131
87
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
132
88
|
}, [data]);
|
|
133
|
-
const getVisibleRows = () => pagination ?
|
|
134
|
-
const onRowSelect = (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
89
|
+
const getVisibleRows = () => pagination ? processedData.slice((currentPage - 1) * perPage, currentPage * perPage) : processedData;
|
|
90
|
+
const onRowSelect = (event, isSelected, rowIndex) => {
|
|
91
|
+
if (rowIndex === -1) {
|
|
92
|
+
// Select all rows
|
|
93
|
+
setAllRowsSelected(isSelected);
|
|
94
|
+
if (isSelected) {
|
|
95
|
+
setSelectedRows(new Set(processedData.map((_, index) => index)));
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
setSelectedRows(new Set());
|
|
99
|
+
}
|
|
143
100
|
}
|
|
144
101
|
else {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (!isLoading && emptyStateRow && (data || []).length < 1) {
|
|
155
|
-
return emptyStateRow;
|
|
156
|
-
}
|
|
157
|
-
else if (isLoading && loadingRow) {
|
|
158
|
-
return loadingRow;
|
|
102
|
+
const newSelectedRows = new Set(selectedRows);
|
|
103
|
+
if (isSelected) {
|
|
104
|
+
newSelectedRows.add(rowIndex);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
newSelectedRows.delete(rowIndex);
|
|
108
|
+
}
|
|
109
|
+
setSelectedRows(newSelectedRows);
|
|
110
|
+
setAllRowsSelected(newSelectedRows.size === processedData.length);
|
|
159
111
|
}
|
|
160
|
-
|
|
161
|
-
|
|
112
|
+
if (onSelect) {
|
|
113
|
+
const rowData = rowIndex === -1 ? null : processedData[rowIndex];
|
|
114
|
+
onSelect(event, isSelected, rowIndex, rowData, null);
|
|
162
115
|
}
|
|
163
116
|
};
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
117
|
+
const renderTableHeader = () => {
|
|
118
|
+
const visibleColumns = columns.filter((column) => column.show !== false);
|
|
119
|
+
return (React.createElement(Thead, null,
|
|
120
|
+
React.createElement(Tr, null,
|
|
121
|
+
isSelectColumnVisible && (React.createElement(Th, { select: {
|
|
122
|
+
onSelect: (event, isSelected) => onRowSelect(event, isSelected, -1),
|
|
123
|
+
isSelected: allRowsSelected,
|
|
124
|
+
} })),
|
|
125
|
+
visibleColumns.map((column, columnIndex) => {
|
|
126
|
+
const actualIndex = isSelectColumnVisible ? columnIndex + 1 : columnIndex;
|
|
127
|
+
const sortParams = column.sortable && sortBy
|
|
128
|
+
? {
|
|
129
|
+
sortBy,
|
|
130
|
+
onSort,
|
|
131
|
+
columnIndex: actualIndex,
|
|
132
|
+
}
|
|
133
|
+
: undefined;
|
|
134
|
+
return (React.createElement(Th, { key: column.id, sort: sortParams, width: column.cellWidth, style: column.show === false ? { display: 'none' } : undefined }, column.title));
|
|
135
|
+
}),
|
|
136
|
+
(actionResolver || actions) && React.createElement(Th, null))));
|
|
137
|
+
};
|
|
138
|
+
const renderTableBody = () => {
|
|
139
|
+
const visibleRows = getVisibleRows();
|
|
140
|
+
const visibleColumns = columns.filter((column) => column.show !== false);
|
|
141
|
+
// Handle empty state
|
|
142
|
+
if (!isLoading && (data || []).length < 1) {
|
|
143
|
+
return (React.createElement(Tbody, null,
|
|
144
|
+
React.createElement(Tr, null,
|
|
145
|
+
React.createElement(Td, { colSpan: emptyStateRow.colSpan }, emptyStateRow.content))));
|
|
146
|
+
}
|
|
147
|
+
// Handle loading state
|
|
148
|
+
if (isLoading) {
|
|
149
|
+
return (React.createElement(Tbody, null,
|
|
150
|
+
React.createElement(Tr, null,
|
|
151
|
+
React.createElement(Td, { colSpan: loadingRow.colSpan }, loadingRow.content))));
|
|
172
152
|
}
|
|
153
|
+
return (React.createElement(Tbody, null, visibleRows.map((row, rowIndex) => {
|
|
154
|
+
var _a;
|
|
155
|
+
const globalRowIndex = pagination ? (currentPage - 1) * perPage + rowIndex : rowIndex;
|
|
156
|
+
const rowProps = ((_a = visibleColumns[0]) === null || _a === void 0 ? void 0 : _a.rowProps) ? visibleColumns[0].rowProps(row) : {};
|
|
157
|
+
const isRowSelected = selectedRows.has(globalRowIndex);
|
|
158
|
+
return (React.createElement(Tr, Object.assign({ key: globalRowIndex }, rowProps, { isRowSelected: isRowSelected, onRowClick: onRowClick ? (event) => onRowClick(event, row, rowProps) : undefined }),
|
|
159
|
+
isSelectColumnVisible && (React.createElement(Td, { select: {
|
|
160
|
+
onSelect: (event, isSelected) => onRowSelect(event, isSelected, globalRowIndex),
|
|
161
|
+
isSelected: isRowSelected,
|
|
162
|
+
rowIndex: globalRowIndex,
|
|
163
|
+
} })),
|
|
164
|
+
visibleColumns.map((column, columnIndex) => {
|
|
165
|
+
let cellContent;
|
|
166
|
+
if (column.cell) {
|
|
167
|
+
cellContent = column.cell(row, globalRowIndex);
|
|
168
|
+
}
|
|
169
|
+
else if (column.accessor) {
|
|
170
|
+
cellContent = column.accessor(row);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
cellContent = '';
|
|
174
|
+
}
|
|
175
|
+
return (React.createElement(Td, { key: `${globalRowIndex}-${columnIndex}`, dataLabel: typeof column.title === 'string' ? column.title : column.id, style: column.show === false ? { display: 'none' } : undefined }, cellContent));
|
|
176
|
+
}),
|
|
177
|
+
(actionResolver || actions) && (React.createElement(Td, { isActionCell: true },
|
|
178
|
+
actionResolver && (React.createElement(ActionsColumn, { items: actionResolver(row, { rowIndex: globalRowIndex }), isDisabled: areActionsDisabled
|
|
179
|
+
? areActionsDisabled(row, { rowIndex: globalRowIndex })
|
|
180
|
+
: false })),
|
|
181
|
+
actions && (React.createElement(ActionsColumn, { items: actions, isDisabled: areActionsDisabled
|
|
182
|
+
? areActionsDisabled(row, { rowIndex: globalRowIndex })
|
|
183
|
+
: false }))))));
|
|
184
|
+
})));
|
|
173
185
|
};
|
|
174
|
-
return (React.createElement(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
React.createElement(TableBody, { onRowClick: onRowClick ? onRowClick : noop }))));
|
|
186
|
+
return (React.createElement(Table, Object.assign({}, restProps, { variant: variant, className: className || '' }),
|
|
187
|
+
renderTableHeader(),
|
|
188
|
+
renderTableBody()));
|
|
178
189
|
}
|
|
179
190
|
export { PFTable };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsSelector.d.ts","sourceRoot":"","sources":["../../../src/TagsSelector/TagsSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAmB3B,OAAO,KAAuC,MAAM,OAAO,CAAC;AAK5D,UAAU,MAAM;IACZ,UAAU,EAAE,GAAG,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,EACzB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,EAAE,EACF,SAAS,EACT,YAAiB,EACjB,QAAgB,GACnB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"TagsSelector.d.ts","sourceRoot":"","sources":["../../../src/TagsSelector/TagsSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAmB3B,OAAO,KAAuC,MAAM,OAAO,CAAC;AAK5D,UAAU,MAAM;IACZ,UAAU,EAAE,GAAG,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,EACzB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,EAAE,EACF,SAAS,EACT,YAAiB,EACjB,QAAgB,GACnB,EAAE,MAAM,qBAkKR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './tagSelector.css';
|
|
2
|
-
import { Button,
|
|
2
|
+
import { Button, Flex, FlexItem, Label, LabelGroup, MenuToggle, Select, SelectList, SelectOption, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
3
3
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
4
4
|
import { isEmpty } from 'lodash';
|
|
5
5
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
@@ -55,20 +55,18 @@ export function TagsSelector({ tagOptions, onChange, placeholder, id, typeahead,
|
|
|
55
55
|
onChange && onChange(selected);
|
|
56
56
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
57
|
}, [selected]);
|
|
58
|
-
const selectedChipGroup = (React.createElement(
|
|
58
|
+
const selectedChipGroup = (React.createElement(LabelGroup, { numLabels: 2 }, selected.map((label) => (React.createElement(Label, { variant: "outline", key: label.id, onClose: (e) => {
|
|
59
59
|
e.stopPropagation();
|
|
60
60
|
onSelect(label);
|
|
61
61
|
} }, label.tagName)))));
|
|
62
|
-
const toggle = (toggleRef) => (React.createElement(MenuToggle, Object.assign({ ref: toggleRef, onClick: onToggleClick, className: `pf-
|
|
62
|
+
const toggle = (toggleRef) => (React.createElement(MenuToggle, Object.assign({ ref: toggleRef, onClick: onToggleClick, className: `pf-v6-u-flex-grow-1 tags-selector-menu-toggle ${isEmpty(tagOptions) || disabled ? 'menu-is-disabld' : ''}`, isExpanded: isOpen, onKeyDown: onInputKeyDown, isDisabled: isEmpty(tagOptions) || disabled }, (typeahead && { variant: 'typeahead' }), { id: id, isFullWidth: true }), typeahead ? (React.createElement(TextInputGroup, { isPlain: true },
|
|
63
63
|
React.createElement(TextInputGroupMain, { id: "tags-selector-search-input", value: query, onClick: onToggleClick, onChange: (e, v) => setQuery(v), onKeyDown: onInputKeyDown, innerRef: textInputRef, isExpanded: isOpen, placeholder: placeholder || t('Search for a tag') }, selectedChipGroup),
|
|
64
|
-
React.createElement(TextInputGroupUtilities, null, selected.length > 0 && (React.createElement(Button, { variant: "plain", onClick: handleClear, "aria-label": "clear-all-tags" },
|
|
65
|
-
React.createElement(TimesIcon, { "aria-hidden": true })))))) : (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' }, alignItems: { default: 'alignItemsCenter' } },
|
|
64
|
+
React.createElement(TextInputGroupUtilities, null, selected.length > 0 && (React.createElement(Button, { icon: React.createElement(TimesIcon, { "aria-hidden": true }), variant: "plain", onClick: handleClear, "aria-label": "clear-all-tags" }))))) : (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' }, alignItems: { default: 'alignItemsCenter' } },
|
|
66
65
|
React.createElement(FlexItem, null,
|
|
67
66
|
selectedChipGroup,
|
|
68
|
-
React.createElement("span", { className: `${!isEmpty(selected) && 'pf-
|
|
67
|
+
React.createElement("span", { className: `${!isEmpty(selected) && 'pf-v6-u-ml-md'}` }, placeholder || React.createElement(Trans, null, "Select a tag"))),
|
|
69
68
|
!isEmpty(selected) && (React.createElement(FlexItem, null,
|
|
70
|
-
React.createElement(Button, { variant: "plain", onClick: handleClear, "aria-label": "clear-all-tags" }
|
|
71
|
-
React.createElement(TimesIcon, { "aria-hidden": true }))))))));
|
|
69
|
+
React.createElement(Button, { icon: React.createElement(TimesIcon, { "aria-hidden": true }), variant: "plain", onClick: handleClear, "aria-label": "clear-all-tags" })))))));
|
|
72
70
|
return (React.createElement(Select, { isOpen: isOpen, selected: selected, toggle: toggle, onSelect: (_, selection) => onSelect(selection), isScrollable: true, onOpenChange: () => setIsOpen(false), popperProps: { direction: 'down', enableFlip: false }, id: "tag-selector" },
|
|
73
71
|
React.createElement(SelectList, { isAriaMultiselectable: true }, selectOptions.map((tag, index) => (React.createElement(SelectOption, { key: tag.id, value: tag, isFocused: index === focusedItemIndex, isSelected: selected.some((t) => t.id === tag.id) }, tag.tagName))))));
|
|
74
72
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
z-index: 89;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.tags-selector-menu-toggle .pf-
|
|
5
|
+
.tags-selector-menu-toggle .pf-v6-c-menu-toggle__text {
|
|
6
6
|
width: 100%;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.tags-selector-menu-toggle .pf-
|
|
9
|
+
.tags-selector-menu-toggle .pf-v6-c-menu-toggle__controls {
|
|
10
10
|
padding-left: 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptTermsModal.d.ts","sourceRoot":"","sources":["../../../src/TermsAndConditions/AcceptTermsModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcceptTermsModal.d.ts","sourceRoot":"","sources":["../../../src/TermsAndConditions/AcceptTermsModal.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAiBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAuI7C"}
|
|
@@ -8,12 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
11
|
-
import { Button, ButtonVariant, Checkbox, Flex, FlexItem, Modal, ModalVariant } from '@patternfly/react-core';
|
|
12
|
-
import { Select, SelectOption } from '@patternfly/react-core/deprecated';
|
|
11
|
+
import { Button, ButtonVariant, Checkbox, Flex, FlexItem, Modal, ModalFooter, ModalVariant, } from '@patternfly/react-core';
|
|
13
12
|
import React, { useEffect, useState } from 'react';
|
|
14
13
|
import { Trans, useTranslation } from 'react-i18next';
|
|
15
14
|
import { useFetch } from '../hooks';
|
|
16
15
|
import { LoadingIndicator } from '../LoadingIndicator';
|
|
16
|
+
import { SingleSelectDropdown } from '../SingleSelectDropdown';
|
|
17
17
|
const getLocaleNameFromLocalCode = (localeCode) => {
|
|
18
18
|
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
19
19
|
try {
|
|
@@ -33,7 +33,6 @@ export function AcceptTermsModal(props) {
|
|
|
33
33
|
const { request, isFetching } = useFetch(publicApi.terms.getRequiredTerms);
|
|
34
34
|
const [termsAcked, setTermsAcked] = useState(false);
|
|
35
35
|
const [allTranslations, setAllTranslations] = useState({});
|
|
36
|
-
const [isLangSelectorDropdownOpen, setisLangSelectorDropdownOpen] = useState(false);
|
|
37
36
|
const [selectedTranslation, setSelectedTranslation] = useState(null);
|
|
38
37
|
const { t } = useTranslation();
|
|
39
38
|
useEffect(() => {
|
|
@@ -60,9 +59,8 @@ export function AcceptTermsModal(props) {
|
|
|
60
59
|
fetchTerms();
|
|
61
60
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
61
|
}, []);
|
|
63
|
-
const onLangChange = (
|
|
64
|
-
setSelectedTranslation(allTranslations[
|
|
65
|
-
setisLangSelectorDropdownOpen(false);
|
|
62
|
+
const onLangChange = (selectedOption) => {
|
|
63
|
+
setSelectedTranslation(allTranslations[selectedOption.value]);
|
|
66
64
|
};
|
|
67
65
|
const handleModalToggle = () => {
|
|
68
66
|
!props.isDisabled && props.onModalClose();
|
|
@@ -70,25 +68,33 @@ export function AcceptTermsModal(props) {
|
|
|
70
68
|
const onSubmitClick = () => {
|
|
71
69
|
props.onConfirm(selectedTranslation.termsPdfId);
|
|
72
70
|
};
|
|
73
|
-
const
|
|
74
|
-
|
|
71
|
+
const getSelectedDropdownOption = {
|
|
72
|
+
label: getLocaleNameFromLocalCode(selectedTranslation === null || selectedTranslation === void 0 ? void 0 : selectedTranslation.localeCode),
|
|
73
|
+
value: selectedTranslation === null || selectedTranslation === void 0 ? void 0 : selectedTranslation.localeCode,
|
|
74
|
+
};
|
|
75
|
+
const getDropdownOptions = () => Object.keys(allTranslations).map((localeCode) => ({
|
|
76
|
+
label: getLocaleNameFromLocalCode(localeCode),
|
|
77
|
+
value: localeCode,
|
|
78
|
+
}));
|
|
79
|
+
return (React.createElement(Modal, { variant: ModalVariant.medium, className: "pf-v6-u-font-size-sm", title: isFetching || !selectedTranslation ? 'Remote Access Rider' : selectedTranslation.translatedTermsName, isOpen: props.isModalOpen, onClose: handleModalToggle },
|
|
80
|
+
isFetching || !selectedTranslation ? (React.createElement("div", { style: { height: '100px' } },
|
|
81
|
+
React.createElement(LoadingIndicator, null))) : (React.createElement(React.Fragment, null,
|
|
82
|
+
React.createElement("p", { className: "pf-v6-u-mb-md" }, selectedTranslation.translatedDescription),
|
|
83
|
+
React.createElement("strong", null,
|
|
84
|
+
React.createElement(Trans, null, "Download the agreement")),
|
|
85
|
+
React.createElement("p", { className: "pf-v6-u-mb-md pf-v6-u-mt-sm" }, selectedTranslation.translatedInstructions),
|
|
86
|
+
React.createElement(Flex, null,
|
|
87
|
+
React.createElement(FlexItem, null,
|
|
88
|
+
React.createElement(SingleSelectDropdown, { ariaLabel: t('Select language'), id: "terms-language-selector", className: "pf-v6-u-mb-md", selected: getSelectedDropdownOption, options: getDropdownOptions(), onSelect: onLangChange, isDisabled: props.isSubmitting, placeholder: t('Select an option that best fits') })),
|
|
89
|
+
React.createElement(FlexItem, null,
|
|
90
|
+
React.createElement("a", { href: selectedTranslation.pdfDownloadUrl, "data-tracking-id": `${props.eventCode}-terms-download`, target: "_blank", rel: "noopener noreferrer" },
|
|
91
|
+
React.createElement(Trans, null, "Download")))),
|
|
92
|
+
React.createElement(Checkbox, { label: t('I have read and agree to the terms'), isChecked: termsAcked, onChange: (_event, checked) => {
|
|
93
|
+
setTermsAcked(checked);
|
|
94
|
+
}, "aria-label": t('I have read and agree to the terms'), id: "agree-terms", name: "agree-terms" }))),
|
|
95
|
+
React.createElement(ModalFooter, null,
|
|
75
96
|
React.createElement(Button, { key: "confirm", variant: ButtonVariant.primary, isDisabled: !termsAcked || props.isSubmitting || props.isDisabled, isLoading: props.isDisabled || props.isSubmitting, "data-tracking-id": `${props.dataTrackingId || props.eventCode}-terms-accept`, onClick: onSubmitClick },
|
|
76
97
|
React.createElement(Trans, null, "Submit")),
|
|
77
98
|
React.createElement(Button, { key: "cancel", isDisabled: props.isSubmitting || props.isDisabled, "data-tracking-id": `${props.dataTrackingId || props.eventCode}-terms-cancel`, variant: ButtonVariant.link, onClick: props.onModalClose },
|
|
78
|
-
React.createElement(Trans, null, "Cancel"))
|
|
79
|
-
] }, isFetching || !selectedTranslation ? (React.createElement("div", { style: { height: '100px' } },
|
|
80
|
-
React.createElement(LoadingIndicator, null))) : (React.createElement(React.Fragment, null,
|
|
81
|
-
React.createElement("p", { className: "pf-v5-u-mb-md" }, selectedTranslation.translatedDescription),
|
|
82
|
-
React.createElement("strong", null,
|
|
83
|
-
React.createElement(Trans, null, "Download the agreement")),
|
|
84
|
-
React.createElement("p", { className: "pf-v5-u-mb-md pf-v5-u-mt-sm" }, selectedTranslation.translatedInstructions),
|
|
85
|
-
React.createElement(Flex, null,
|
|
86
|
-
React.createElement(FlexItem, null,
|
|
87
|
-
React.createElement(Select, { "aria-label": t('Select language'), id: "terms-language-selector", className: "pf-v5-u-mb-md", selections: selectedTranslation.localeCode, onSelect: onLangChange, isOpen: isLangSelectorDropdownOpen, isDisabled: props.isSubmitting, menuAppendTo: document.body, placeholderText: t('Select an option that best fits'), onToggle: (_event, toggle) => onDropdownToggle(toggle) }, Object.keys(allTranslations).map((option, index) => (React.createElement(SelectOption, { key: index, value: option }, getLocaleNameFromLocalCode(option)))))),
|
|
88
|
-
React.createElement(FlexItem, null,
|
|
89
|
-
React.createElement("a", { href: selectedTranslation.pdfDownloadUrl, "data-tracking-id": `${props.eventCode}-terms-download`, target: "_blank", rel: "noopener noreferrer" },
|
|
90
|
-
React.createElement(Trans, null, "Download")))),
|
|
91
|
-
React.createElement(Checkbox, { label: t('I have read and agree to the terms'), isChecked: termsAcked, onChange: (_event, checked) => {
|
|
92
|
-
setTermsAcked(checked);
|
|
93
|
-
}, "aria-label": t('I have read and agree to the terms'), id: "agree-terms", name: "agree-terms" })))));
|
|
99
|
+
React.createElement(Trans, null, "Cancel")))));
|
|
94
100
|
}
|
|
@@ -104,5 +104,5 @@ export function TopContentSearch({ topContentData = [], topContentResultsWrapper
|
|
|
104
104
|
return (React.createElement("div", { className: className, ref: searchWrapperRef },
|
|
105
105
|
React.createElement("label", { htmlFor: "top-content-search-input" },
|
|
106
106
|
React.createElement(Trans, null, "Filter results:")),
|
|
107
|
-
React.createElement(SearchInput, { id: "top-content-search-input", className: "top-content-search-input pf-
|
|
107
|
+
React.createElement(SearchInput, { id: "top-content-search-input", className: "top-content-search-input pf-v6-u-flex-grow-1", "aria-label": t('search top content'), placeholder: t('Enter relevant keywords'), value: searchText, "data-tracking-id": dataTrackingId, onChange: (e, val) => onSearchInputChange(val), onClear: onSearchInputClear, isDisabled: isDisabled })));
|
|
108
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeaheadDropdown.d.ts","sourceRoot":"","sources":["../../../src/TypeaheadDropdown/TypeaheadDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIH,UAAU,EAWb,MAAM,wBAAwB,CAAC;AAOhC,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IACrC,OAAO,EAAE,+BAA+B,EAAE,CAAC;IAC3C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAE5B,QAAQ,EAAE,CAAC,OAAO,EAAE,wBAAwB,EAAE,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC3D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,+BAA+B,EAAE,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACnF,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAChD;AAED,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACvC;AAED,MAAM,MAAM,+BAA+B,GAAG,wBAAwB,GAAG,uBAAuB,CAAC;AACjG,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AA2BvD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"TypeaheadDropdown.d.ts","sourceRoot":"","sources":["../../../src/TypeaheadDropdown/TypeaheadDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIH,UAAU,EAWb,MAAM,wBAAwB,CAAC;AAOhC,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IACrC,OAAO,EAAE,+BAA+B,EAAE,CAAC;IAC3C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAE5B,QAAQ,EAAE,CAAC,OAAO,EAAE,wBAAwB,EAAE,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC3D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,+BAA+B,EAAE,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACnF,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAChD;AAED,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACvC;AAED,MAAM,MAAM,+BAA+B,GAAG,wBAAwB,GAAG,uBAAuB,CAAC;AACjG,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AA2BvD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,qBA6V/D"}
|
|
@@ -161,8 +161,7 @@ export function TypeaheadDropdown(props) {
|
|
|
161
161
|
!!onChipRemoved && onChipRemoved(option);
|
|
162
162
|
} }, option.label)))))),
|
|
163
163
|
React.createElement(TextInputGroupUtilities, null,
|
|
164
|
-
query && hasClearButton && !isDisabled && (React.createElement(Button, { "aria-label": "Clear input value", variant: "plain", onClick: handleClearQuery, isDisabled: isDisabled },
|
|
165
|
-
React.createElement(TimesCircleIcon, null))),
|
|
164
|
+
query && hasClearButton && !isDisabled && (React.createElement(Button, { icon: React.createElement(TimesCircleIcon, null), "aria-label": "Clear input value", variant: "plain", onClick: handleClearQuery, isDisabled: isDisabled })),
|
|
166
165
|
isLoading && React.createElement(Spinner, { size: "sm" })))));
|
|
167
166
|
};
|
|
168
167
|
/**
|
|
@@ -209,7 +208,7 @@ export function TypeaheadDropdown(props) {
|
|
|
209
208
|
// look the same and be able to function with keyboard accessibility,
|
|
210
209
|
// the selection option text needs to be wrapped in a span with the pf link color class.
|
|
211
210
|
return (React.createElement(SelectOption, { key: option.value, value: option.value, isFocused: focusedItemIndex === index, isSelected: false, onClick: onHandleLoadMore },
|
|
212
|
-
React.createElement("span", { className: "pf-
|
|
211
|
+
React.createElement("span", { className: "pf-v6-u-link-color" }, "View more")));
|
|
213
212
|
}
|
|
214
213
|
else if (option.value === ADD_NEW_OPTION_VALUE) {
|
|
215
214
|
return (React.createElement(SelectOption, { key: option.value, value: option.value, isFocused: false, isSelected: false }, !!getCreateNewText ? getCreateNewText(query) : `${option.label}: ${query}`));
|
|
@@ -46,5 +46,5 @@ export function ValueChangedIcon(props) {
|
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
return (React.createElement(Tooltip, { content: tooltipContent, position: props.tooltipPosition || TooltipPosition.top },
|
|
49
|
-
React.createElement(LightbulbIcon,
|
|
49
|
+
React.createElement(LightbulbIcon, { className: "cursor-pointer pf-v6-u-text-color-status-custom" })));
|
|
50
50
|
}
|
|
@@ -6,12 +6,12 @@ import React from 'react';
|
|
|
6
6
|
import { SupportFeedbackForm } from '../SupportFeedbackForm';
|
|
7
7
|
const defaultTitle = "Sorry, we're experiencing an error";
|
|
8
8
|
const errorMessageButtonLabel = 'contact us';
|
|
9
|
-
const defaultErrorMessage = (React.createElement("p", { className: "pf-
|
|
9
|
+
const defaultErrorMessage = (React.createElement("p", { className: "pf-v6-u-mb-0" },
|
|
10
10
|
"Try refreshing the page. Please ",
|
|
11
11
|
React.createElement(SupportFeedbackForm, { isInline: true, buttonLabel: errorMessageButtonLabel }),
|
|
12
12
|
" if the problem persists.",
|
|
13
13
|
React.createElement("br", null),
|
|
14
|
-
React.createElement(Button, { variant: "link", component: "a", href: "https://status.redhat.com/", "data-tracking-id": "redirect-status-portal-button", target: "_blank", icon: React.createElement(ExternalLinkAltIcon, { className: "status-portal-button-icon" }), iconPosition: "right", className: "pf-
|
|
14
|
+
React.createElement(Button, { variant: "link", component: "a", href: "https://status.redhat.com/", "data-tracking-id": "redirect-status-portal-button", target: "_blank", icon: React.createElement(ExternalLinkAltIcon, { className: "status-portal-button-icon" }), iconPosition: "right", className: "pf-v6-u-pl-0", isInline: true, "aria-label": "View status page" }, "View status page"),
|
|
15
15
|
' '));
|
|
16
16
|
const defaultErrorObj = {
|
|
17
17
|
500: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/components",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.26",
|
|
4
4
|
"description": "Contains all reusabel components for support app",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@cee-eng/hydrajs": "4.18.57",
|
|
48
48
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
49
|
-
"@patternfly/patternfly": "
|
|
50
|
-
"@patternfly/react-core": "
|
|
51
|
-
"@patternfly/react-table": "
|
|
49
|
+
"@patternfly/patternfly": "6.2.1",
|
|
50
|
+
"@patternfly/react-core": "6.2.1",
|
|
51
|
+
"@patternfly/react-table": "6.2.1",
|
|
52
52
|
"dompurify": "^2.2.6",
|
|
53
53
|
"js-worker-search": "^1.4.1",
|
|
54
54
|
"lazysizes": "^5.3.2",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@cee-eng/hydrajs": "4.18.57",
|
|
64
64
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
65
|
-
"@patternfly/patternfly": "
|
|
66
|
-
"@patternfly/react-core": "
|
|
67
|
-
"@patternfly/react-icons": "
|
|
68
|
-
"@patternfly/react-table": "
|
|
69
|
-
"@patternfly/react-tokens": "
|
|
65
|
+
"@patternfly/patternfly": "6.2.1",
|
|
66
|
+
"@patternfly/react-core": "6.2.1",
|
|
67
|
+
"@patternfly/react-icons": "6.2.1",
|
|
68
|
+
"@patternfly/react-table": "6.2.1",
|
|
69
|
+
"@patternfly/react-tokens": "6.2.1",
|
|
70
70
|
"@rh-support/types": "2.0.5",
|
|
71
|
-
"@rh-support/user-permissions": "2.5.
|
|
72
|
-
"@rh-support/utils": "2.5.
|
|
71
|
+
"@rh-support/user-permissions": "2.5.18",
|
|
72
|
+
"@rh-support/utils": "2.5.17",
|
|
73
73
|
"dompurify": "^2.2.6",
|
|
74
74
|
"js-worker-search": "^1.4.1",
|
|
75
75
|
"lazysizes": "^5.3.2",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"defaults and supports es6-module",
|
|
107
107
|
"maintained node versions"
|
|
108
108
|
],
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "4e42960cc47766cce9312ba7e236d2ede9facd33"
|
|
110
110
|
}
|