@redhat-cloud-services/frontend-components 3.8.12 → 3.9.2
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.d.ts +1 -1
- package/ConditionalFilter/ConditionalFilter.d.ts +4 -4
- package/DownloadButton/DownloadButton.d.ts +2 -2
- package/DownloadButton/DownloadButton.js +1 -1
- package/ErrorBoundary/ErrorBoundary.css +13 -0
- package/ErrorBoundary/ErrorBoundary.d.ts +17 -0
- package/ErrorBoundary/ErrorBoundary.js +81 -0
- package/ErrorBoundary/ErrorBoundary.scss +11 -0
- package/ErrorBoundary/ErrorStack.d.ts +6 -0
- package/ErrorBoundary/ErrorStack.js +38 -0
- package/ErrorBoundary/index.d.ts +2 -0
- package/ErrorBoundary/index.js +11 -0
- package/ErrorBoundary/package.json +1 -0
- package/PrimaryToolbar/PrimaryToolbar.d.ts +6 -5
- package/PrimaryToolbar/PrimaryToolbar.js +1 -1
- package/TagModal/TableWithFilter.d.ts +29 -44
- package/TagModal/TableWithFilter.js +3 -30
- package/TagModal/TagModal.d.ts +32 -52
- package/TagModal/TagModal.js +13 -43
- package/TagModal/index.d.ts +3 -2
- package/esm/DownloadButton/DownloadButton.js +1 -1
- package/esm/ErrorBoundary/ErrorBoundary.css +13 -0
- package/esm/ErrorBoundary/ErrorBoundary.js +57 -0
- package/esm/ErrorBoundary/ErrorBoundary.scss +11 -0
- package/esm/ErrorBoundary/ErrorStack.js +17 -0
- package/esm/ErrorBoundary/index.js +3 -0
- package/esm/PrimaryToolbar/PrimaryToolbar.js +1 -1
- package/esm/TagModal/TableWithFilter.js +3 -30
- package/esm/TagModal/TagModal.js +13 -43
- package/esm/index.css +14 -0
- package/esm/index.js +1 -0
- package/esm/index.scss +1 -0
- package/index.css +14 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.scss +1 -0
- package/package.json +1 -1
- package/Ansible/Ansible.js.map +0 -1
- package/Ansible/index.js.map +0 -1
- package/AsyncComponent/index.js.map +0 -1
- package/Battery/Battery.js.map +0 -1
- package/Battery/CriticalBattery.js.map +0 -1
- package/Battery/HighBattery.js.map +0 -1
- package/Battery/LowBattery.js.map +0 -1
- package/Battery/MediumBattery.js.map +0 -1
- package/Battery/NullBattery.js.map +0 -1
- package/Battery/index.js.map +0 -1
- package/Breadcrumbs/Breadcrumbs.js.map +0 -1
- package/Breadcrumbs/ConnectedBreadcrumbs.js.map +0 -1
- package/Breadcrumbs/index.js.map +0 -1
- package/BulkSelect/BulkSelect.js.map +0 -1
- package/BulkSelect/index.js.map +0 -1
- package/ConditionalFilter/CheckboxFilter.js.map +0 -1
- package/ConditionalFilter/ConditionalFilter.js.map +0 -1
- package/ConditionalFilter/GroupFilter.js.map +0 -1
- package/ConditionalFilter/RadioFilter.js.map +0 -1
- package/ConditionalFilter/TextFilter.js.map +0 -1
- package/ConditionalFilter/conditionalFilterConstants.js.map +0 -1
- package/ConditionalFilter/groupFilterConstants.js.map +0 -1
- package/ConditionalFilter/groupType.js.map +0 -1
- package/ConditionalFilter/index.js.map +0 -1
- package/CullingInfo/CullingInformation.js.map +0 -1
- package/CullingInfo/index.js.map +0 -1
- package/CullingInfo/utils.js.map +0 -1
- package/Dark/Dark.js.map +0 -1
- package/Dark/DarkContext.js.map +0 -1
- package/Dark/index.js.map +0 -1
- package/DateFormat/DateFormat.js.map +0 -1
- package/DateFormat/helper.js.map +0 -1
- package/DateFormat/index.js.map +0 -1
- package/DownloadButton/DownloadButton.js.map +0 -1
- package/DownloadButton/index.js.map +0 -1
- package/EmptyTable/EmptyTable.js.map +0 -1
- package/EmptyTable/index.js.map +0 -1
- package/ErrorState/DefaultErrorMessage.js.map +0 -1
- package/ErrorState/ErrorState.js.map +0 -1
- package/ErrorState/index.js.map +0 -1
- package/FilterChips/FilterChips.js.map +0 -1
- package/FilterChips/index.js.map +0 -1
- package/FilterHooks/constants.js.map +0 -1
- package/FilterHooks/index.js.map +0 -1
- package/FilterHooks/tagFilterHook.js.map +0 -1
- package/Filters/FilterDropdown.js.map +0 -1
- package/Filters/FilterInput.js.map +0 -1
- package/Filters/index.js.map +0 -1
- package/Input/Input.js.map +0 -1
- package/Input/LabeledInput.js.map +0 -1
- package/Input/index.js.map +0 -1
- package/InsightsLabel/InsightsLabel.js.map +0 -1
- package/InsightsLabel/index.js.map +0 -1
- package/InvalidObject/InvalidObject.js.map +0 -1
- package/InvalidObject/icon-404.js.map +0 -1
- package/InvalidObject/index.js.map +0 -1
- package/Inventory/AppInfo.js.map +0 -1
- package/Inventory/DetailWrapper.js.map +0 -1
- package/Inventory/InventoryDetail.js.map +0 -1
- package/Inventory/InventoryDetailHead.js.map +0 -1
- package/Inventory/InventoryLoadError.js.map +0 -1
- package/Inventory/InventoryTable.js.map +0 -1
- package/Inventory/TagWithDialog.js.map +0 -1
- package/Inventory/index.js.map +0 -1
- package/LongTextTooltip/LongTextTooltip.js.map +0 -1
- package/LongTextTooltip/index.js.map +0 -1
- package/Main/Main.js.map +0 -1
- package/Main/index.js.map +0 -1
- package/Maintenance/Maintenance.js.map +0 -1
- package/Maintenance/index.js.map +0 -1
- package/NotAuthorized/NotAuthorized.js.map +0 -1
- package/NotAuthorized/index.js.map +0 -1
- package/NotConnected/NotConnected.js.map +0 -1
- package/NotConnected/index.js.map +0 -1
- package/Ouia/Ouia.js.map +0 -1
- package/Ouia/WithOuia.js.map +0 -1
- package/Ouia/index.js.map +0 -1
- package/Ouia/useOuia.js.map +0 -1
- package/PageHeader/PageHeader.js.map +0 -1
- package/PageHeader/PageHeaderTitle.js.map +0 -1
- package/PageHeader/index.js.map +0 -1
- package/Pagination/Pagination.js.map +0 -1
- package/Pagination/PaginationMenu.js.map +0 -1
- package/Pagination/PaginationNav.js.map +0 -1
- package/Pagination/PaginationNext.js.map +0 -1
- package/Pagination/index.js.map +0 -1
- package/PrimaryToolbar/Actions.js.map +0 -1
- package/PrimaryToolbar/PrimaryToolbar.js.map +0 -1
- package/PrimaryToolbar/SortBy.js.map +0 -1
- package/PrimaryToolbar/index.js.map +0 -1
- package/Reboot/Reboot.js.map +0 -1
- package/Reboot/index.js.map +0 -1
- package/Section/Section.js.map +0 -1
- package/Section/index.js.map +0 -1
- package/Shield/Shield.js.map +0 -1
- package/Shield/consts.js.map +0 -1
- package/Shield/index.js.map +0 -1
- package/SimpleTableFilter/SimpleTableFilter.js.map +0 -1
- package/SimpleTableFilter/index.js.map +0 -1
- package/Skeleton/Skeleton.js.map +0 -1
- package/Skeleton/index.js.map +0 -1
- package/SkeletonTable/SkeletonTable.js.map +0 -1
- package/SkeletonTable/index.js.map +0 -1
- package/Spinner/Spinner.js.map +0 -1
- package/Spinner/index.js.map +0 -1
- package/TabLayout/TabLayout.js.map +0 -1
- package/TabLayout/index.js.map +0 -1
- package/TableToolbar/TableToolbar.js.map +0 -1
- package/TableToolbar/index.js.map +0 -1
- package/TagCount/TagCount.js.map +0 -1
- package/TagCount/index.js.map +0 -1
- package/TagModal/TableWithFilter.js.map +0 -1
- package/TagModal/TagModal.js.map +0 -1
- package/TagModal/index.js.map +0 -1
- package/TreeTable/decorator.js.map +0 -1
- package/TreeTable/helpers.js.map +0 -1
- package/TreeTable/index.js.map +0 -1
- package/TreeTable/rowWrapper.js.map +0 -1
- package/Truncate/Truncate.js.map +0 -1
- package/Truncate/index.js.map +0 -1
- package/Unavailable/Unavailable.js.map +0 -1
- package/Unavailable/index.js.map +0 -1
- package/esm/Ansible/Ansible.js.map +0 -1
- package/esm/Ansible/index.js.map +0 -1
- package/esm/AsyncComponent/index.js.map +0 -1
- package/esm/Battery/Battery.js.map +0 -1
- package/esm/Battery/CriticalBattery.js.map +0 -1
- package/esm/Battery/HighBattery.js.map +0 -1
- package/esm/Battery/LowBattery.js.map +0 -1
- package/esm/Battery/MediumBattery.js.map +0 -1
- package/esm/Battery/NullBattery.js.map +0 -1
- package/esm/Battery/index.js.map +0 -1
- package/esm/Breadcrumbs/Breadcrumbs.js.map +0 -1
- package/esm/Breadcrumbs/ConnectedBreadcrumbs.js.map +0 -1
- package/esm/Breadcrumbs/index.js.map +0 -1
- package/esm/BulkSelect/BulkSelect.js.map +0 -1
- package/esm/BulkSelect/index.js.map +0 -1
- package/esm/ConditionalFilter/CheckboxFilter.js.map +0 -1
- package/esm/ConditionalFilter/ConditionalFilter.js.map +0 -1
- package/esm/ConditionalFilter/GroupFilter.js.map +0 -1
- package/esm/ConditionalFilter/RadioFilter.js.map +0 -1
- package/esm/ConditionalFilter/TextFilter.js.map +0 -1
- package/esm/ConditionalFilter/conditionalFilterConstants.js.map +0 -1
- package/esm/ConditionalFilter/groupFilterConstants.js.map +0 -1
- package/esm/ConditionalFilter/groupType.js.map +0 -1
- package/esm/ConditionalFilter/index.js.map +0 -1
- package/esm/CullingInfo/CullingInformation.js.map +0 -1
- package/esm/CullingInfo/index.js.map +0 -1
- package/esm/CullingInfo/utils.js.map +0 -1
- package/esm/Dark/Dark.js.map +0 -1
- package/esm/Dark/DarkContext.js.map +0 -1
- package/esm/Dark/index.js.map +0 -1
- package/esm/DateFormat/DateFormat.js.map +0 -1
- package/esm/DateFormat/helper.js.map +0 -1
- package/esm/DateFormat/index.js.map +0 -1
- package/esm/DownloadButton/DownloadButton.js.map +0 -1
- package/esm/DownloadButton/index.js.map +0 -1
- package/esm/EmptyTable/EmptyTable.js.map +0 -1
- package/esm/EmptyTable/index.js.map +0 -1
- package/esm/ErrorState/DefaultErrorMessage.js.map +0 -1
- package/esm/ErrorState/ErrorState.js.map +0 -1
- package/esm/ErrorState/index.js.map +0 -1
- package/esm/FilterChips/FilterChips.js.map +0 -1
- package/esm/FilterChips/index.js.map +0 -1
- package/esm/FilterHooks/constants.js.map +0 -1
- package/esm/FilterHooks/index.js.map +0 -1
- package/esm/FilterHooks/tagFilterHook.js.map +0 -1
- package/esm/Filters/FilterDropdown.js.map +0 -1
- package/esm/Filters/FilterInput.js.map +0 -1
- package/esm/Filters/index.js.map +0 -1
- package/esm/Input/Input.js.map +0 -1
- package/esm/Input/LabeledInput.js.map +0 -1
- package/esm/Input/index.js.map +0 -1
- package/esm/InsightsLabel/InsightsLabel.js.map +0 -1
- package/esm/InsightsLabel/index.js.map +0 -1
- package/esm/InvalidObject/InvalidObject.js.map +0 -1
- package/esm/InvalidObject/icon-404.js.map +0 -1
- package/esm/InvalidObject/index.js.map +0 -1
- package/esm/Inventory/AppInfo.js.map +0 -1
- package/esm/Inventory/DetailWrapper.js.map +0 -1
- package/esm/Inventory/InventoryDetail.js.map +0 -1
- package/esm/Inventory/InventoryDetailHead.js.map +0 -1
- package/esm/Inventory/InventoryLoadError.js.map +0 -1
- package/esm/Inventory/InventoryTable.js.map +0 -1
- package/esm/Inventory/TagWithDialog.js.map +0 -1
- package/esm/Inventory/index.js.map +0 -1
- package/esm/LongTextTooltip/LongTextTooltip.js.map +0 -1
- package/esm/LongTextTooltip/index.js.map +0 -1
- package/esm/Main/Main.js.map +0 -1
- package/esm/Main/index.js.map +0 -1
- package/esm/Maintenance/Maintenance.js.map +0 -1
- package/esm/Maintenance/index.js.map +0 -1
- package/esm/NotAuthorized/NotAuthorized.js.map +0 -1
- package/esm/NotAuthorized/index.js.map +0 -1
- package/esm/NotConnected/NotConnected.js.map +0 -1
- package/esm/NotConnected/index.js.map +0 -1
- package/esm/Ouia/Ouia.js.map +0 -1
- package/esm/Ouia/WithOuia.js.map +0 -1
- package/esm/Ouia/index.js.map +0 -1
- package/esm/Ouia/useOuia.js.map +0 -1
- package/esm/PageHeader/PageHeader.js.map +0 -1
- package/esm/PageHeader/PageHeaderTitle.js.map +0 -1
- package/esm/PageHeader/index.js.map +0 -1
- package/esm/Pagination/Pagination.js.map +0 -1
- package/esm/Pagination/PaginationMenu.js.map +0 -1
- package/esm/Pagination/PaginationNav.js.map +0 -1
- package/esm/Pagination/PaginationNext.js.map +0 -1
- package/esm/Pagination/index.js.map +0 -1
- package/esm/PrimaryToolbar/Actions.js.map +0 -1
- package/esm/PrimaryToolbar/PrimaryToolbar.js.map +0 -1
- package/esm/PrimaryToolbar/SortBy.js.map +0 -1
- package/esm/PrimaryToolbar/index.js.map +0 -1
- package/esm/Reboot/Reboot.js.map +0 -1
- package/esm/Reboot/index.js.map +0 -1
- package/esm/Section/Section.js.map +0 -1
- package/esm/Section/index.js.map +0 -1
- package/esm/Shield/Shield.js.map +0 -1
- package/esm/Shield/consts.js.map +0 -1
- package/esm/Shield/index.js.map +0 -1
- package/esm/SimpleTableFilter/SimpleTableFilter.js.map +0 -1
- package/esm/SimpleTableFilter/index.js.map +0 -1
- package/esm/Skeleton/Skeleton.js.map +0 -1
- package/esm/Skeleton/index.js.map +0 -1
- package/esm/SkeletonTable/SkeletonTable.js.map +0 -1
- package/esm/SkeletonTable/index.js.map +0 -1
- package/esm/Spinner/Spinner.js.map +0 -1
- package/esm/Spinner/index.js.map +0 -1
- package/esm/TabLayout/TabLayout.js.map +0 -1
- package/esm/TabLayout/index.js.map +0 -1
- package/esm/TableToolbar/TableToolbar.js.map +0 -1
- package/esm/TableToolbar/index.js.map +0 -1
- package/esm/TagCount/TagCount.js.map +0 -1
- package/esm/TagCount/index.js.map +0 -1
- package/esm/TagModal/TableWithFilter.js.map +0 -1
- package/esm/TagModal/TagModal.js.map +0 -1
- package/esm/TagModal/index.js.map +0 -1
- package/esm/TreeTable/decorator.js.map +0 -1
- package/esm/TreeTable/helpers.js.map +0 -1
- package/esm/TreeTable/index.js.map +0 -1
- package/esm/TreeTable/rowWrapper.js.map +0 -1
- package/esm/Truncate/Truncate.js.map +0 -1
- package/esm/Truncate/index.js.map +0 -1
- package/esm/Unavailable/Unavailable.js.map +0 -1
- package/esm/Unavailable/index.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/useChrome/index.js.map +0 -1
- package/esm/useChrome/useChrome.js.map +0 -1
- package/esm/usePendoFeedback/index.js.map +0 -1
- package/esm/usePendoFeedback/usePendoFeedback.js.map +0 -1
- package/esm/useScreenSize/breakpoints.js.map +0 -1
- package/esm/useScreenSize/getVariant.js.map +0 -1
- package/esm/useScreenSize/index.js.map +0 -1
- package/esm/useScreenSize/isSmallScreen.js.map +0 -1
- package/esm/useScreenSize/useScreenSize.js.map +0 -1
- package/index.js.map +0 -1
- package/useChrome/index.js.map +0 -1
- package/useChrome/useChrome.js.map +0 -1
- package/usePendoFeedback/index.js.map +0 -1
- package/usePendoFeedback/usePendoFeedback.js.map +0 -1
- package/useScreenSize/breakpoints.js.map +0 -1
- package/useScreenSize/getVariant.js.map +0 -1
- package/useScreenSize/index.js.map +0 -1
- package/useScreenSize/isSmallScreen.js.map +0 -1
- package/useScreenSize/useScreenSize.js.map +0 -1
|
@@ -11,7 +11,7 @@ export interface BulkSelectProps {
|
|
|
11
11
|
count?: number;
|
|
12
12
|
className?: string;
|
|
13
13
|
items?: BulkSelectItem[];
|
|
14
|
-
checked?: boolean;
|
|
14
|
+
checked?: boolean | null;
|
|
15
15
|
id?: string;
|
|
16
16
|
onSelect?: DropdownToggleCheckboxProps['onChange'];
|
|
17
17
|
toggleProps?: DropdownToggleProps;
|
|
@@ -23,11 +23,11 @@ export interface ConditionalFilterItem {
|
|
|
23
23
|
placeholder?: string;
|
|
24
24
|
}
|
|
25
25
|
export interface ConditionalFilterProps extends TextInputProps {
|
|
26
|
-
hideLabel
|
|
26
|
+
hideLabel?: boolean;
|
|
27
27
|
items: ConditionalFilterItem[];
|
|
28
|
-
id
|
|
29
|
-
isDisabled
|
|
30
|
-
useMobileLayout
|
|
28
|
+
id?: string;
|
|
29
|
+
isDisabled?: boolean;
|
|
30
|
+
useMobileLayout?: boolean;
|
|
31
31
|
}
|
|
32
32
|
declare const ConditionalFilter: React.FunctionComponent<ConditionalFilterProps>;
|
|
33
33
|
export default ConditionalFilter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DropdownProps } from '@patternfly/react-core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export interface DownloadButtonProps extends Omit<DropdownProps, 'onSelect'> {
|
|
4
|
-
extraItems?:
|
|
3
|
+
export interface DownloadButtonProps extends Omit<DropdownProps, 'onSelect' | 'toggle' | 'dropdownItems'> {
|
|
4
|
+
extraItems?: React.ReactElement[];
|
|
5
5
|
tooltipText?: React.ReactNode;
|
|
6
6
|
onSelect?: (event: MouseEvent | React.MouseEvent<any, MouseEvent> | React.KeyboardEvent<Element>, format: 'csv' | 'json') => void;
|
|
7
7
|
isDisabled?: boolean;
|
|
@@ -61,7 +61,7 @@ var DownloadButton = function (_a) {
|
|
|
61
61
|
var conditionallyTooltip = function (children) {
|
|
62
62
|
return react_1.default.createElement(react_1.default.Fragment, null, tooltipText ? react_1.default.createElement(react_core_1.Tooltip, { content: tooltipText }, children) : children);
|
|
63
63
|
};
|
|
64
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, conditionallyTooltip(react_1.default.createElement(react_core_1.Dropdown, __assign({}, props, {
|
|
64
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, conditionallyTooltip(react_1.default.createElement(react_core_1.Dropdown, __assign({ isPlain: true }, props, { onSelect: internalOnSelect, toggle: react_1.default.createElement(react_core_1.DropdownToggle, { "aria-label": "Export", toggleIndicator: null, onToggle: onToggle, isDisabled: isDisabled, ouiaId: "Export" },
|
|
65
65
|
react_1.default.createElement(react_icons_1.ExportIcon, { size: "sm" })), isOpen: isOpen, ouiaId: "Export", dropdownItems: __spreadArray([
|
|
66
66
|
react_1.default.createElement(react_core_1.DropdownItem, { key: "download-csv", ouiaId: "DownloadCSV", component: "button", onClick: function (event) { return onSelect(event, 'csv'); }, isDisabled: isDisabled }, "Export to CSV"),
|
|
67
67
|
react_1.default.createElement(react_core_1.DropdownItem, { key: "download-json", ouiaId: "DownloadJSON", component: "button", onClick: function (event) { return onSelect(event, 'json'); }, isDisabled: isDisabled }, "Export to JSON")
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--ins-color--orange: #ec7a08;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ins-error-boundary-stack {
|
|
6
|
+
font-family: "monospace";
|
|
7
|
+
font-size: var(--pf-global--icon--FontSize--md);
|
|
8
|
+
text-align: left;
|
|
9
|
+
background-color: white;
|
|
10
|
+
border-style: solid;
|
|
11
|
+
border-color: var(--pf-global--BackgroundColor--dark-300);
|
|
12
|
+
padding: var(--pf-global--spacer--sm);
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ErrorPageProps {
|
|
3
|
+
headerTitle: string;
|
|
4
|
+
errorTitle?: string;
|
|
5
|
+
errorDescription?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ErrorPageState {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error?: Error;
|
|
10
|
+
historyState: History['state'];
|
|
11
|
+
}
|
|
12
|
+
declare class ErrorBoundaryPage extends React.Component<ErrorPageProps, ErrorPageState> {
|
|
13
|
+
constructor(props: Readonly<ErrorPageProps>);
|
|
14
|
+
static getDerivedStateFromError(error: Error): ErrorPageState;
|
|
15
|
+
render(): React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export default ErrorBoundaryPage;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
var React = __importStar(require("react"));
|
|
41
|
+
var PageHeader_1 = __importStar(require("../PageHeader"));
|
|
42
|
+
var ErrorState_1 = __importDefault(require("../ErrorState"));
|
|
43
|
+
var react_core_1 = require("@patternfly/react-core");
|
|
44
|
+
var ErrorStack_1 = __importDefault(require("./ErrorStack"));
|
|
45
|
+
var Section_1 = __importDefault(require("../Section"));
|
|
46
|
+
var ErrorBoundaryPage = (function (_super) {
|
|
47
|
+
__extends(ErrorBoundaryPage, _super);
|
|
48
|
+
function ErrorBoundaryPage(props) {
|
|
49
|
+
var _this = _super.call(this, props) || this;
|
|
50
|
+
_this.state = {
|
|
51
|
+
hasError: false,
|
|
52
|
+
historyState: history.state,
|
|
53
|
+
};
|
|
54
|
+
return _this;
|
|
55
|
+
}
|
|
56
|
+
ErrorBoundaryPage.getDerivedStateFromError = function (error) {
|
|
57
|
+
return { hasError: true, error: error, historyState: history.state };
|
|
58
|
+
};
|
|
59
|
+
ErrorBoundaryPage.prototype.render = function () {
|
|
60
|
+
if (this.state.historyState !== history.state) {
|
|
61
|
+
this.setState({
|
|
62
|
+
hasError: false,
|
|
63
|
+
historyState: history.state,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (this.state.hasError) {
|
|
67
|
+
return (React.createElement("div", null,
|
|
68
|
+
React.createElement(PageHeader_1.default, null,
|
|
69
|
+
React.createElement(PageHeader_1.PageHeaderTitle, { title: this.props.headerTitle })),
|
|
70
|
+
React.createElement(Section_1.default, null,
|
|
71
|
+
React.createElement(ErrorState_1.default, { errorTitle: this.props.errorTitle, errorDescription: React.createElement(React.Fragment, null,
|
|
72
|
+
React.createElement("span", null, this.props.errorDescription),
|
|
73
|
+
this.state.error && (React.createElement(react_core_1.ExpandableSection, { toggleText: "Show details" },
|
|
74
|
+
React.createElement(ErrorStack_1.default, { error: this.state.error })))) }))));
|
|
75
|
+
}
|
|
76
|
+
return this.props.children;
|
|
77
|
+
};
|
|
78
|
+
return ErrorBoundaryPage;
|
|
79
|
+
}(React.Component));
|
|
80
|
+
exports.default = ErrorBoundaryPage;
|
|
81
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import '~@redhat-cloud-services/frontend-components-utilities/styles/_all.scss';
|
|
2
|
+
|
|
3
|
+
.ins-error-boundary-stack {
|
|
4
|
+
font-family: 'monospace';
|
|
5
|
+
font-size: var(--pf-global--icon--FontSize--md);
|
|
6
|
+
text-align: left;
|
|
7
|
+
background-color: white;
|
|
8
|
+
border-style: solid;
|
|
9
|
+
border-color: var(--pf-global--BackgroundColor--dark-300);
|
|
10
|
+
padding: var(--pf-global--spacer--sm);
|
|
11
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
var React = __importStar(require("react"));
|
|
23
|
+
var react_core_1 = require("@patternfly/react-core");
|
|
24
|
+
var errorStackClass = 'ins-error-boundary-stack';
|
|
25
|
+
var ErrorStack = function (_a) {
|
|
26
|
+
var error = _a.error;
|
|
27
|
+
if (error.stack) {
|
|
28
|
+
return (React.createElement(react_core_1.Text, { className: errorStackClass }, error.stack.split('\n').map(function (line) { return (React.createElement("div", { key: line }, line)); })));
|
|
29
|
+
}
|
|
30
|
+
if (error.name && error.message) {
|
|
31
|
+
return (React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement(react_core_1.Text, { component: "h6" }, error.name),
|
|
33
|
+
React.createElement(react_core_1.Text, { className: errorStackClass, component: "blockquote" }, error.message)));
|
|
34
|
+
}
|
|
35
|
+
return (React.createElement(react_core_1.Text, { className: errorStackClass, component: "blockquote" }, error.toString()));
|
|
36
|
+
};
|
|
37
|
+
exports.default = ErrorStack;
|
|
38
|
+
//# sourceMappingURL=ErrorStack.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ErrorBoundary = exports.default = void 0;
|
|
7
|
+
var ErrorBoundary_1 = require("./ErrorBoundary");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ErrorBoundary_1).default; } });
|
|
9
|
+
var ErrorBoundary_2 = require("./ErrorBoundary");
|
|
10
|
+
Object.defineProperty(exports, "ErrorBoundary", { enumerable: true, get: function () { return __importDefault(ErrorBoundary_2).default; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"main":"index.js","module":"../esm/ErrorBoundary/index.js","typings":"index.d.ts"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { PaginationProps, ButtonProps } from '@patternfly/react-core';
|
|
3
3
|
import { ActionsProps } from './Actions';
|
|
4
4
|
import { BulkSelectProps } from '../BulkSelect';
|
|
5
|
+
import { ConditionalFilterProps } from '../ConditionalFilter';
|
|
5
6
|
import { DownloadButtonProps } from '../DownloadButton';
|
|
6
7
|
import { FilterChipsProps } from '../FilterChips';
|
|
7
8
|
import { SortByProps } from './SortBy';
|
|
@@ -15,17 +16,17 @@ export declare type PrimaryToolbarExpandAllObject = {
|
|
|
15
16
|
export interface PrimaryToolbarProps {
|
|
16
17
|
id?: string | number;
|
|
17
18
|
className?: string;
|
|
18
|
-
toggleIsExpanded?: () =>
|
|
19
|
+
toggleIsExpanded?: () => void;
|
|
19
20
|
bulkSelect?: BulkSelectProps;
|
|
20
|
-
filterConfig?:
|
|
21
|
+
filterConfig?: ConditionalFilterProps;
|
|
21
22
|
dedicatedAction?: React.ReactNode;
|
|
22
23
|
pagination?: Omit<PaginationProps, 'ref'>;
|
|
23
|
-
sortByConfig
|
|
24
|
-
exportConfig
|
|
24
|
+
sortByConfig?: SortByProps;
|
|
25
|
+
exportConfig?: DownloadButtonProps;
|
|
25
26
|
activeFiltersConfig?: FilterChipsProps;
|
|
26
27
|
actionsConfig?: ActionsProps;
|
|
27
28
|
expandAll?: React.ReactNode | PrimaryToolbarExpandAllObject;
|
|
28
|
-
useMobileLayout
|
|
29
|
+
useMobileLayout?: boolean;
|
|
29
30
|
}
|
|
30
31
|
declare const PrimaryToolbar: React.FunctionComponent<PrimaryToolbarProps>;
|
|
31
32
|
export default PrimaryToolbar;
|
|
@@ -48,7 +48,7 @@ function isPrimaryToolbarExpandAllObject(node) {
|
|
|
48
48
|
return !react_1.default.isValidElement(node);
|
|
49
49
|
}
|
|
50
50
|
var PrimaryToolbar = function (_a) {
|
|
51
|
-
var id = _a.id, className = _a.className,
|
|
51
|
+
var id = _a.id, className = _a.className, _b = _a.toggleIsExpanded, toggleIsExpanded = _b === void 0 ? function () { return undefined; } : _b, bulkSelect = _a.bulkSelect, filterConfig = _a.filterConfig, dedicatedAction = _a.dedicatedAction, actionsConfig = _a.actionsConfig, sortByConfig = _a.sortByConfig, pagination = _a.pagination, activeFiltersConfig = _a.activeFiltersConfig, children = _a.children, exportConfig = _a.exportConfig, expandAll = _a.expandAll, useMobileLayout = _a.useMobileLayout, props = __rest(_a, ["id", "className", "toggleIsExpanded", "bulkSelect", "filterConfig", "dedicatedAction", "actionsConfig", "sortByConfig", "pagination", "activeFiltersConfig", "children", "exportConfig", "expandAll", "useMobileLayout"]);
|
|
52
52
|
var overflowActions = __spreadArray([], (sortByConfig
|
|
53
53
|
? [
|
|
54
54
|
{
|
|
@@ -1,45 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const columns: any;
|
|
29
|
-
const filters: any;
|
|
30
|
-
const pagination: any;
|
|
31
|
-
const primaryToolbarProps: any;
|
|
32
|
-
const tableProps: any;
|
|
33
|
-
const children: any;
|
|
34
|
-
const title: any;
|
|
35
|
-
const calculateChecked: any;
|
|
36
|
-
const unique: any;
|
|
37
|
-
const onSelect: any;
|
|
38
|
-
const onUpdateData: any;
|
|
39
|
-
const bulkSelect: any;
|
|
40
|
-
}
|
|
41
|
-
namespace defaultProps {
|
|
42
|
-
const entityName_1: string;
|
|
43
|
-
export { entityName_1 as entityName };
|
|
44
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICell, IRow, TableProps } from '@patternfly/react-table';
|
|
3
|
+
import { PrimaryToolbarProps } from '../PrimaryToolbar';
|
|
4
|
+
import { BulkSelectProps } from '../BulkSelect';
|
|
5
|
+
import { ConditionalFilterItem } from '../ConditionalFilter';
|
|
6
|
+
export declare type TableWithFilterPagination = {
|
|
7
|
+
count: number;
|
|
8
|
+
page: number;
|
|
9
|
+
perPage: number;
|
|
10
|
+
};
|
|
11
|
+
export interface TableWithFilterProps {
|
|
12
|
+
rows?: IRow[];
|
|
13
|
+
onSelect?: (selected?: IRow[]) => void;
|
|
14
|
+
selected?: IRow[];
|
|
15
|
+
onUpdateData: (pagination: TableWithFilterPagination) => number | undefined;
|
|
16
|
+
pagination: TableWithFilterPagination;
|
|
17
|
+
loaded?: boolean;
|
|
18
|
+
calculateChecked?: (rows: IRow[], selected: IRow[]) => boolean | null;
|
|
19
|
+
unique?: (rows: IRow[]) => IRow[];
|
|
20
|
+
filters?: ConditionalFilterItem[];
|
|
21
|
+
primaryToolbarProps: PrimaryToolbarProps;
|
|
22
|
+
title?: string;
|
|
23
|
+
systemName?: string;
|
|
24
|
+
columns?: (string | ICell)[];
|
|
25
|
+
tableProps?: TableProps;
|
|
26
|
+
entityName?: string;
|
|
27
|
+
bulkSelect?: BulkSelectProps;
|
|
45
28
|
}
|
|
29
|
+
declare const TableWithFilter: React.FC<TableWithFilterProps>;
|
|
30
|
+
export default TableWithFilter;
|
|
@@ -41,7 +41,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
var react_1 = __importStar(require("react"));
|
|
43
43
|
var react_core_1 = require("@patternfly/react-core");
|
|
44
|
-
var prop_types_1 = require("prop-types");
|
|
45
44
|
var react_table_1 = require("@patternfly/react-table");
|
|
46
45
|
var EmptyTable_1 = require("../EmptyTable");
|
|
47
46
|
var TableToolbar_1 = require("../TableToolbar");
|
|
@@ -49,11 +48,11 @@ var PrimaryToolbar_1 = require("../PrimaryToolbar");
|
|
|
49
48
|
var Skeleton_1 = require("../Skeleton");
|
|
50
49
|
var SkeletonTable_1 = require("../SkeletonTable");
|
|
51
50
|
var TableWithFilter = function (_a) {
|
|
52
|
-
var
|
|
51
|
+
var _b = _a.rows, rows = _b === void 0 ? [] : _b, onSelect = _a.onSelect, _c = _a.selected, selected = _c === void 0 ? [] : _c, onUpdateData = _a.onUpdateData, pagination = _a.pagination, loaded = _a.loaded, calculateChecked = _a.calculateChecked, unique = _a.unique, filters = _a.filters, primaryToolbarProps = _a.primaryToolbarProps, children = _a.children, title = _a.title, systemName = _a.systemName, _d = _a.columns, columns = _d === void 0 ? [] : _d, tableProps = _a.tableProps, _f = _a.entityName, entityName = _f === void 0 ? 'tags' : _f, bulkSelect = _a.bulkSelect;
|
|
53
52
|
var onRowSelect = function (_a) {
|
|
54
53
|
var isSelected = _a.isSelected, rowId = _a.rowId;
|
|
55
54
|
var currRow = rows === null || rows === void 0 ? void 0 : rows[rowId];
|
|
56
|
-
if (currRow) {
|
|
55
|
+
if (currRow && onSelect) {
|
|
57
56
|
onSelect(isSelected ? __spreadArray(__spreadArray([], selected, true), [currRow], false) : selected.filter(function (_a) {
|
|
58
57
|
var id = _a.id;
|
|
59
58
|
return id !== currRow.id;
|
|
@@ -84,7 +83,7 @@ var TableWithFilter = function (_a) {
|
|
|
84
83
|
__assign({}, (loaded && (rows === null || rows === void 0 ? void 0 : rows.length) > 0
|
|
85
84
|
? {
|
|
86
85
|
title: "Select page (".concat(rows.length, ")"),
|
|
87
|
-
onClick: function () { return onSelect(unique(__spreadArray(__spreadArray([], rows, true), selected, true))); },
|
|
86
|
+
onClick: function () { return onSelect(unique === null || unique === void 0 ? void 0 : unique(__spreadArray(__spreadArray([], rows, true), selected, true))); },
|
|
88
87
|
}
|
|
89
88
|
: {})),
|
|
90
89
|
] }, (bulkSelect || {})),
|
|
@@ -128,31 +127,5 @@ var TableWithFilter = function (_a) {
|
|
|
128
127
|
onUpdateData && pagination && loaded && (react_1.default.createElement(TableToolbar_1.TableToolbar, { isFooter: true, className: "ins-c-inventory__table--toolbar" },
|
|
129
128
|
react_1.default.createElement(react_core_1.Pagination, { itemCount: pagination === null || pagination === void 0 ? void 0 : pagination.count, perPage: pagination === null || pagination === void 0 ? void 0 : pagination.perPage, page: (pagination === null || pagination === void 0 ? void 0 : pagination.page) || 0, variant: "bottom", onSetPage: function (_event, page) { return onUpdateData(__assign(__assign({}, pagination), { page: page })); }, onPerPageSelect: function (_event, perPage) { return onUpdateData(__assign(__assign({}, pagination), { page: 1, perPage: perPage })); } })))));
|
|
130
129
|
};
|
|
131
|
-
TableWithFilter.propTypes = {
|
|
132
|
-
entityName: prop_types_1.PropTypes.string,
|
|
133
|
-
loaded: prop_types_1.PropTypes.bool,
|
|
134
|
-
systemName: prop_types_1.PropTypes.string,
|
|
135
|
-
rows: prop_types_1.PropTypes.array,
|
|
136
|
-
selected: prop_types_1.PropTypes.array,
|
|
137
|
-
columns: prop_types_1.PropTypes.array,
|
|
138
|
-
filters: prop_types_1.PropTypes.array,
|
|
139
|
-
pagination: prop_types_1.PropTypes.shape({
|
|
140
|
-
count: prop_types_1.PropTypes.number,
|
|
141
|
-
page: prop_types_1.PropTypes.number,
|
|
142
|
-
perPage: prop_types_1.PropTypes.number,
|
|
143
|
-
}),
|
|
144
|
-
primaryToolbarProps: prop_types_1.PropTypes.object,
|
|
145
|
-
tableProps: prop_types_1.PropTypes.object,
|
|
146
|
-
children: prop_types_1.PropTypes.node,
|
|
147
|
-
title: prop_types_1.PropTypes.node,
|
|
148
|
-
calculateChecked: prop_types_1.PropTypes.func,
|
|
149
|
-
unique: prop_types_1.PropTypes.func,
|
|
150
|
-
onSelect: prop_types_1.PropTypes.func,
|
|
151
|
-
onUpdateData: prop_types_1.PropTypes.func,
|
|
152
|
-
bulkSelect: prop_types_1.PropTypes.any,
|
|
153
|
-
};
|
|
154
|
-
TableWithFilter.defaultProps = {
|
|
155
|
-
entityName: 'tags',
|
|
156
|
-
};
|
|
157
130
|
exports.default = TableWithFilter;
|
|
158
131
|
//# sourceMappingURL=TableWithFilter.js.map
|
package/TagModal/TagModal.d.ts
CHANGED
|
@@ -1,54 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import './tagModal.scss';
|
|
3
|
+
import { TableWithFilterPagination, TableWithFilterProps } from './TableWithFilter';
|
|
4
|
+
import { ICell, IRow } from '@patternfly/react-table';
|
|
5
|
+
import { ConditionalFilterItem } from '../ConditionalFilter';
|
|
6
|
+
import { BulkSelectProps } from '../BulkSelect';
|
|
7
|
+
export interface TagModalProps extends Omit<TableWithFilterProps, 'columns' | 'pagination' | 'loaded' | 'filters' | 'onUpdateData' | 'bulkSelect'> {
|
|
8
|
+
title: string;
|
|
9
|
+
systemName?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
toggleModal: (e?: React.MouseEventHandler<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>, open?: boolean) => void;
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
tabNames?: string[];
|
|
14
|
+
onApply?: (...args: unknown[]) => void;
|
|
15
|
+
rows: IRow[] | IRow[][];
|
|
16
|
+
columns: (string | ICell)[] | (string | ICell)[][];
|
|
17
|
+
pagination: TableWithFilterPagination | TableWithFilterPagination[];
|
|
18
|
+
loaded: boolean | boolean[];
|
|
19
|
+
filters?: ConditionalFilterItem[][] | ConditionalFilterItem[];
|
|
20
|
+
selected?: IRow[] | IRow[][];
|
|
21
|
+
onSelect?: (selected?: IRow[]) => void | ((selected?: IRow[]) => void)[];
|
|
22
|
+
onUpdateData?: (pagination: TableWithFilterPagination) => number | undefined | ((pagination: TableWithFilterPagination) => number | undefined)[];
|
|
23
|
+
bulkSelect?: BulkSelectProps | BulkSelectProps[];
|
|
7
24
|
}
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const rows: PropTypes.Requireable<any[]>;
|
|
17
|
-
const columns: PropTypes.Requireable<any[]>;
|
|
18
|
-
const className: PropTypes.Requireable<string>;
|
|
19
|
-
const tableProps: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
20
|
-
const onSelect: PropTypes.Requireable<((...args: any[]) => any) | (((...args: any[]) => any) | null | undefined)[]>;
|
|
21
|
-
const onUpdateData: PropTypes.Requireable<((...args: any[]) => any) | (((...args: any[]) => any) | null | undefined)[]>;
|
|
22
|
-
const bulkSelect: PropTypes.Requireable<any>;
|
|
23
|
-
const pagination: PropTypes.Requireable<any>;
|
|
24
|
-
const primaryToolbarProps: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
25
|
-
const selected: PropTypes.Requireable<any[]>;
|
|
26
|
-
const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
|
-
const filters: PropTypes.Requireable<any>;
|
|
28
|
-
const onApply: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
-
}
|
|
30
|
-
namespace defaultProps {
|
|
31
|
-
const loaded_1: boolean;
|
|
32
|
-
export { loaded_1 as loaded };
|
|
33
|
-
const isOpen_1: boolean;
|
|
34
|
-
export { isOpen_1 as isOpen };
|
|
35
|
-
export function toggleModal_1(): undefined;
|
|
36
|
-
export { toggleModal_1 as toggleModal };
|
|
37
|
-
const columns_1: {
|
|
38
|
-
title: string;
|
|
39
|
-
}[];
|
|
40
|
-
export { columns_1 as columns };
|
|
41
|
-
export function onUpdateData_1(): undefined;
|
|
42
|
-
export { onUpdateData_1 as onUpdateData };
|
|
43
|
-
const rows_1: never[];
|
|
44
|
-
export { rows_1 as rows };
|
|
45
|
-
const tableProps_1: {};
|
|
46
|
-
export { tableProps_1 as tableProps };
|
|
47
|
-
export namespace pagination_1 {
|
|
48
|
-
const count: number;
|
|
49
|
-
}
|
|
50
|
-
export { pagination_1 as pagination };
|
|
51
|
-
}
|
|
25
|
+
declare class TagModal extends Component<TagModalProps> {
|
|
26
|
+
state: {
|
|
27
|
+
selectedTab: number;
|
|
28
|
+
activeTabKey: undefined;
|
|
29
|
+
};
|
|
30
|
+
handleTabClick: (_event: React.MouseEvent<HTMLElement, MouseEvent>, tabIndex: string | number) => void;
|
|
31
|
+
renderTable: (rows: IRow[], columns: (string | ICell)[], pagination: TableWithFilterPagination, loaded: boolean, filters: ConditionalFilterItem[], selected: IRow[], onSelect?: ((selected?: IRow[] | undefined) => void) | undefined, onUpdateData?: (pagination: TableWithFilterPagination) => number | undefined, bulkSelect?: BulkSelectProps | undefined) => JSX.Element;
|
|
32
|
+
render(): JSX.Element;
|
|
52
33
|
}
|
|
53
|
-
|
|
54
|
-
import PropTypes from "prop-types";
|
|
34
|
+
export default TagModal;
|
package/TagModal/TagModal.js
CHANGED
|
@@ -58,10 +58,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
58
58
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
60
|
};
|
|
61
|
-
var _a, _b;
|
|
62
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
62
|
var react_1 = __importStar(require("react"));
|
|
64
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
65
63
|
require("./tagModal.css");
|
|
66
64
|
var react_core_1 = require("@patternfly/react-core");
|
|
67
65
|
var classnames_1 = __importDefault(require("classnames"));
|
|
@@ -97,18 +95,22 @@ var TagModal = (function (_super) {
|
|
|
97
95
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
98
96
|
_this.state = {
|
|
99
97
|
selectedTab: 0,
|
|
98
|
+
activeTabKey: undefined,
|
|
100
99
|
};
|
|
101
100
|
_this.handleTabClick = function (_event, tabIndex) {
|
|
102
101
|
_this.setState({ activeTabKey: tabIndex });
|
|
103
102
|
};
|
|
104
|
-
_this.renderTable = function (rows, columns, pagination, loaded, filters, selected, onSelect, onUpdateData, bulkSelect) {
|
|
103
|
+
_this.renderTable = function (rows, columns, pagination, loaded, filters, selected, onSelect, onUpdateData, bulkSelect) {
|
|
104
|
+
if (onUpdateData === void 0) { onUpdateData = function () { return undefined; }; }
|
|
105
|
+
return (react_1.default.createElement(TableWithFilter_1.default, __assign({}, _this.props, { rows: rows, pagination: pagination, loaded: loaded, calculateChecked: calculateChecked, unique: unique, filters: filters, title: _this.props.title, systemName: _this.props.systemName, columns: columns, onSelect: onSelect, onUpdateData: onUpdateData, selected: selected, bulkSelect: bulkSelect }), _this.props.children));
|
|
106
|
+
};
|
|
105
107
|
return _this;
|
|
106
108
|
}
|
|
107
109
|
TagModal.prototype.render = function () {
|
|
108
110
|
var _this = this;
|
|
109
|
-
var _a = this.props, className = _a.className, title = _a.title, systemName = _a.systemName,
|
|
111
|
+
var _a = this.props, className = _a.className, title = _a.title, systemName = _a.systemName, _b = _a.toggleModal, toggleModal = _b === void 0 ? function () { return undefined; } : _b, _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, _d = _a.rows, rows = _d === void 0 ? [] : _d, _e = _a.columns, columns = _e === void 0 ? [{ title: 'Name' }, { title: 'Tag source' }] : _e, children = _a.children, _f = _a.pagination, pagination = _f === void 0 ? { count: 10 } : _f, _g = _a.loaded, loaded = _g === void 0 ? false : _g, filters = _a.filters, onApply = _a.onApply, tabNames = _a.tabNames, onSelect = _a.onSelect, _h = _a.onUpdateData, onUpdateData = _h === void 0 ? function () { return undefined; } : _h, selected = _a.selected, _j = _a.tableProps, tableProps = _j === void 0 ? {} : _j, bulkSelect = _a.bulkSelect, props = __rest(_a, ["className", "title", "systemName", "toggleModal", "isOpen", "rows", "columns", "children", "pagination", "loaded", "filters", "onApply", "tabNames", "onSelect", "onUpdateData", "selected", "tableProps", "bulkSelect"]);
|
|
110
112
|
var isTabbed = Array.isArray(tabNames);
|
|
111
|
-
return (react_1.default.createElement(react_core_1.Modal, __assign({}, props, { className: (0, classnames_1.default)('ins-c-tag-modal', className), isOpen: isOpen, title: title || "Tags for ".concat(systemName), onClose: function (
|
|
113
|
+
return (react_1.default.createElement(react_core_1.Modal, __assign({}, props, { className: (0, classnames_1.default)('ins-c-tag-modal', className), isOpen: isOpen, title: title || "Tags for ".concat(systemName), onClose: function () { return toggleModal(undefined, false); }, variant: "medium" }, (onApply && {
|
|
112
114
|
actions: [
|
|
113
115
|
react_1.default.createElement(react_core_1.Button, { key: "confirm", variant: "primary", isDisabled: isTabbed ? Object.values(selected || {}).every(function (values) { return !values || (values === null || values === void 0 ? void 0 : values.length) === 0; }) : !selected || (selected === null || selected === void 0 ? void 0 : selected.length) === 0, onClick: function (e) {
|
|
114
116
|
onApply();
|
|
@@ -118,46 +120,14 @@ var TagModal = (function (_super) {
|
|
|
118
120
|
isTabbed ? 'selected' : 'tags'),
|
|
119
121
|
react_1.default.createElement(react_core_1.Button, { key: "cancel", variant: "link", onClick: function (e) { return toggleModal(e, false); } }, "Cancel"),
|
|
120
122
|
],
|
|
121
|
-
})), isTabbed ? (react_1.default.createElement(react_core_1.Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleTabClick }, tabNames.map(function (item, key) {
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
})), isTabbed ? (react_1.default.createElement(react_core_1.Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleTabClick }, tabNames.map(function (item, key) {
|
|
124
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
125
|
+
return (react_1.default.createElement(react_core_1.Tab, { key: key, eventKey: key, title: react_1.default.createElement(react_core_1.TabTitleText, null,
|
|
126
|
+
"All ",
|
|
127
|
+
item) }, _this.renderTable(rows === null || rows === void 0 ? void 0 : rows[key], columns === null || columns === void 0 ? void 0 : columns[key], (_a = pagination) === null || _a === void 0 ? void 0 : _a[key], (_b = loaded) === null || _b === void 0 ? void 0 : _b[key], (_c = filters) === null || _c === void 0 ? void 0 : _c[key], (_d = selected) === null || _d === void 0 ? void 0 : _d[key], (_e = onSelect) === null || _e === void 0 ? void 0 : _e[key], (_f = onUpdateData) === null || _f === void 0 ? void 0 : _f[key], (_g = bulkSelect) === null || _g === void 0 ? void 0 : _g[key])));
|
|
128
|
+
}))) : (this.renderTable(rows, columns, pagination, loaded, filters, selected, onSelect, onUpdateData, bulkSelect))));
|
|
124
129
|
};
|
|
125
130
|
return TagModal;
|
|
126
131
|
}(react_1.Component));
|
|
127
|
-
TagModal.propTypes = {
|
|
128
|
-
tabNames: prop_types_1.default.arrayOf(prop_types_1.default.string),
|
|
129
|
-
loaded: prop_types_1.default.oneOfType([prop_types_1.default.bool, prop_types_1.default.arrayOf(prop_types_1.default.bool)]),
|
|
130
|
-
title: prop_types_1.default.string,
|
|
131
|
-
systemName: prop_types_1.default.string,
|
|
132
|
-
isOpen: prop_types_1.default.bool,
|
|
133
|
-
toggleModal: prop_types_1.default.func,
|
|
134
|
-
rows: prop_types_1.default.array,
|
|
135
|
-
columns: prop_types_1.default.array,
|
|
136
|
-
className: prop_types_1.default.string,
|
|
137
|
-
tableProps: prop_types_1.default.shape((_a = {},
|
|
138
|
-
_a[prop_types_1.default.string] = prop_types_1.default.any,
|
|
139
|
-
_a)),
|
|
140
|
-
onSelect: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.arrayOf(prop_types_1.default.func)]),
|
|
141
|
-
onUpdateData: prop_types_1.default.oneOfType([prop_types_1.default.func, prop_types_1.default.arrayOf(prop_types_1.default.func)]),
|
|
142
|
-
bulkSelect: prop_types_1.default.oneOfType([prop_types_1.default.any, prop_types_1.default.arrayOf(prop_types_1.default.any)]),
|
|
143
|
-
pagination: prop_types_1.default.oneOfType([TableWithFilter_1.default.propTypes.pagination, prop_types_1.default.arrayOf(TableWithFilter_1.default.propTypes.pagination)]),
|
|
144
|
-
primaryToolbarProps: prop_types_1.default.shape((_b = {},
|
|
145
|
-
_b[prop_types_1.default.string] = prop_types_1.default.any,
|
|
146
|
-
_b)),
|
|
147
|
-
selected: prop_types_1.default.array,
|
|
148
|
-
children: prop_types_1.default.node,
|
|
149
|
-
filters: prop_types_1.default.any,
|
|
150
|
-
onApply: prop_types_1.default.func,
|
|
151
|
-
};
|
|
152
|
-
TagModal.defaultProps = {
|
|
153
|
-
loaded: false,
|
|
154
|
-
isOpen: false,
|
|
155
|
-
toggleModal: function () { return undefined; },
|
|
156
|
-
columns: [{ title: 'Name' }, { title: 'Tag source' }],
|
|
157
|
-
onUpdateData: function () { return undefined; },
|
|
158
|
-
rows: [],
|
|
159
|
-
tableProps: {},
|
|
160
|
-
pagination: { count: 10 },
|
|
161
|
-
};
|
|
162
132
|
exports.default = TagModal;
|
|
163
133
|
//# sourceMappingURL=TagModal.js.map
|
package/TagModal/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default
|
|
2
|
-
export { default
|
|
1
|
+
export { default } from './TagModal';
|
|
2
|
+
export { default as TagModal } from './TagModal';
|
|
3
|
+
export { default as TableWithFilter } from './TableWithFilter';
|
|
@@ -40,7 +40,7 @@ var DownloadButton = function (_a) {
|
|
|
40
40
|
var conditionallyTooltip = function (children) {
|
|
41
41
|
return React.createElement(React.Fragment, null, tooltipText ? React.createElement(Tooltip, { content: tooltipText }, children) : children);
|
|
42
42
|
};
|
|
43
|
-
return (React.createElement(React.Fragment, null, conditionallyTooltip(React.createElement(Dropdown, __assign({}, props, {
|
|
43
|
+
return (React.createElement(React.Fragment, null, conditionallyTooltip(React.createElement(Dropdown, __assign({ isPlain: true }, props, { onSelect: internalOnSelect, toggle: React.createElement(DropdownToggle, { "aria-label": "Export", toggleIndicator: null, onToggle: onToggle, isDisabled: isDisabled, ouiaId: "Export" },
|
|
44
44
|
React.createElement(ExportIcon, { size: "sm" })), isOpen: isOpen, ouiaId: "Export", dropdownItems: __spreadArray([
|
|
45
45
|
React.createElement(DropdownItem, { key: "download-csv", ouiaId: "DownloadCSV", component: "button", onClick: function (event) { return onSelect(event, 'csv'); }, isDisabled: isDisabled }, "Export to CSV"),
|
|
46
46
|
React.createElement(DropdownItem, { key: "download-json", ouiaId: "DownloadJSON", component: "button", onClick: function (event) { return onSelect(event, 'json'); }, isDisabled: isDisabled }, "Export to JSON")
|