@redhat-cloud-services/frontend-components 3.9.1 → 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/PrimaryToolbar/PrimaryToolbar.d.ts +3 -2
- 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/PrimaryToolbar/PrimaryToolbar.js +1 -1
- package/esm/TagModal/TableWithFilter.js +3 -30
- package/esm/TagModal/TagModal.js +13 -43
- 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/ErrorBoundary/ErrorBoundary.js.map +0 -1
- package/ErrorBoundary/ErrorStack.js.map +0 -1
- package/ErrorBoundary/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/ErrorBoundary/ErrorBoundary.js.map +0 -1
- package/esm/ErrorBoundary/ErrorStack.js.map +0 -1
- package/esm/ErrorBoundary/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")
|
|
@@ -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,9 +16,9 @@ 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
24
|
sortByConfig?: SortByProps;
|
|
@@ -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")
|
|
@@ -43,7 +43,7 @@ function isPrimaryToolbarExpandAllObject(node) {
|
|
|
43
43
|
return !React.isValidElement(node);
|
|
44
44
|
}
|
|
45
45
|
var PrimaryToolbar = function (_a) {
|
|
46
|
-
var id = _a.id, className = _a.className,
|
|
46
|
+
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"]);
|
|
47
47
|
var overflowActions = __spreadArray([], (sortByConfig
|
|
48
48
|
? [
|
|
49
49
|
{
|
|
@@ -20,7 +20,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
20
20
|
};
|
|
21
21
|
import React, { Fragment } from 'react';
|
|
22
22
|
import { Pagination, Bullseye, EmptyState, EmptyStateVariant, Title, EmptyStateBody } from '@patternfly/react-core';
|
|
23
|
-
import { PropTypes } from 'prop-types';
|
|
24
23
|
import { Table, TableHeader, TableBody } from '@patternfly/react-table';
|
|
25
24
|
import { EmptyTable } from '../EmptyTable';
|
|
26
25
|
import { TableToolbar } from '../TableToolbar';
|
|
@@ -28,11 +27,11 @@ import { PrimaryToolbar } from '../PrimaryToolbar';
|
|
|
28
27
|
import { Skeleton } from '../Skeleton';
|
|
29
28
|
import { SkeletonTable } from '../SkeletonTable';
|
|
30
29
|
var TableWithFilter = function (_a) {
|
|
31
|
-
var
|
|
30
|
+
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;
|
|
32
31
|
var onRowSelect = function (_a) {
|
|
33
32
|
var isSelected = _a.isSelected, rowId = _a.rowId;
|
|
34
33
|
var currRow = rows === null || rows === void 0 ? void 0 : rows[rowId];
|
|
35
|
-
if (currRow) {
|
|
34
|
+
if (currRow && onSelect) {
|
|
36
35
|
onSelect(isSelected ? __spreadArray(__spreadArray([], selected, true), [currRow], false) : selected.filter(function (_a) {
|
|
37
36
|
var id = _a.id;
|
|
38
37
|
return id !== currRow.id;
|
|
@@ -63,7 +62,7 @@ var TableWithFilter = function (_a) {
|
|
|
63
62
|
__assign({}, (loaded && (rows === null || rows === void 0 ? void 0 : rows.length) > 0
|
|
64
63
|
? {
|
|
65
64
|
title: "Select page (".concat(rows.length, ")"),
|
|
66
|
-
onClick: function () { return onSelect(unique(__spreadArray(__spreadArray([], rows, true), selected, true))); },
|
|
65
|
+
onClick: function () { return onSelect(unique === null || unique === void 0 ? void 0 : unique(__spreadArray(__spreadArray([], rows, true), selected, true))); },
|
|
67
66
|
}
|
|
68
67
|
: {})),
|
|
69
68
|
] }, (bulkSelect || {})),
|
|
@@ -107,31 +106,5 @@ var TableWithFilter = function (_a) {
|
|
|
107
106
|
onUpdateData && pagination && loaded && (React.createElement(TableToolbar, { isFooter: true, className: "ins-c-inventory__table--toolbar" },
|
|
108
107
|
React.createElement(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 })); } })))));
|
|
109
108
|
};
|
|
110
|
-
TableWithFilter.propTypes = {
|
|
111
|
-
entityName: PropTypes.string,
|
|
112
|
-
loaded: PropTypes.bool,
|
|
113
|
-
systemName: PropTypes.string,
|
|
114
|
-
rows: PropTypes.array,
|
|
115
|
-
selected: PropTypes.array,
|
|
116
|
-
columns: PropTypes.array,
|
|
117
|
-
filters: PropTypes.array,
|
|
118
|
-
pagination: PropTypes.shape({
|
|
119
|
-
count: PropTypes.number,
|
|
120
|
-
page: PropTypes.number,
|
|
121
|
-
perPage: PropTypes.number,
|
|
122
|
-
}),
|
|
123
|
-
primaryToolbarProps: PropTypes.object,
|
|
124
|
-
tableProps: PropTypes.object,
|
|
125
|
-
children: PropTypes.node,
|
|
126
|
-
title: PropTypes.node,
|
|
127
|
-
calculateChecked: PropTypes.func,
|
|
128
|
-
unique: PropTypes.func,
|
|
129
|
-
onSelect: PropTypes.func,
|
|
130
|
-
onUpdateData: PropTypes.func,
|
|
131
|
-
bulkSelect: PropTypes.any,
|
|
132
|
-
};
|
|
133
|
-
TableWithFilter.defaultProps = {
|
|
134
|
-
entityName: 'tags',
|
|
135
|
-
};
|
|
136
109
|
export default TableWithFilter;
|
|
137
110
|
//# sourceMappingURL=TableWithFilter.js.map
|
package/esm/TagModal/TagModal.js
CHANGED
|
@@ -35,9 +35,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
35
|
}
|
|
36
36
|
return t;
|
|
37
37
|
};
|
|
38
|
-
var _a, _b;
|
|
39
38
|
import React, { Component } from 'react';
|
|
40
|
-
import PropTypes from 'prop-types';
|
|
41
39
|
import '../TagModal/tagModal.css';
|
|
42
40
|
import { Modal, Button, Tabs, Tab, TabTitleText } from '@patternfly/react-core';
|
|
43
41
|
import classNames from 'classnames';
|
|
@@ -73,18 +71,22 @@ var TagModal = (function (_super) {
|
|
|
73
71
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
74
72
|
_this.state = {
|
|
75
73
|
selectedTab: 0,
|
|
74
|
+
activeTabKey: undefined,
|
|
76
75
|
};
|
|
77
76
|
_this.handleTabClick = function (_event, tabIndex) {
|
|
78
77
|
_this.setState({ activeTabKey: tabIndex });
|
|
79
78
|
};
|
|
80
|
-
_this.renderTable = function (rows, columns, pagination, loaded, filters, selected, onSelect, onUpdateData, bulkSelect) {
|
|
79
|
+
_this.renderTable = function (rows, columns, pagination, loaded, filters, selected, onSelect, onUpdateData, bulkSelect) {
|
|
80
|
+
if (onUpdateData === void 0) { onUpdateData = function () { return undefined; }; }
|
|
81
|
+
return (React.createElement(TableWithFilter, __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));
|
|
82
|
+
};
|
|
81
83
|
return _this;
|
|
82
84
|
}
|
|
83
85
|
TagModal.prototype.render = function () {
|
|
84
86
|
var _this = this;
|
|
85
|
-
var _a = this.props, className = _a.className, title = _a.title, systemName = _a.systemName,
|
|
87
|
+
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"]);
|
|
86
88
|
var isTabbed = Array.isArray(tabNames);
|
|
87
|
-
return (React.createElement(Modal, __assign({}, props, { className: classNames('ins-c-tag-modal', className), isOpen: isOpen, title: title || "Tags for ".concat(systemName), onClose: function (
|
|
89
|
+
return (React.createElement(Modal, __assign({}, props, { className: classNames('ins-c-tag-modal', className), isOpen: isOpen, title: title || "Tags for ".concat(systemName), onClose: function () { return toggleModal(undefined, false); }, variant: "medium" }, (onApply && {
|
|
88
90
|
actions: [
|
|
89
91
|
React.createElement(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) {
|
|
90
92
|
onApply();
|
|
@@ -94,46 +96,14 @@ var TagModal = (function (_super) {
|
|
|
94
96
|
isTabbed ? 'selected' : 'tags'),
|
|
95
97
|
React.createElement(Button, { key: "cancel", variant: "link", onClick: function (e) { return toggleModal(e, false); } }, "Cancel"),
|
|
96
98
|
],
|
|
97
|
-
})), isTabbed ? (React.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleTabClick }, tabNames.map(function (item, key) {
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
})), isTabbed ? (React.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleTabClick }, tabNames.map(function (item, key) {
|
|
100
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
101
|
+
return (React.createElement(Tab, { key: key, eventKey: key, title: React.createElement(TabTitleText, null,
|
|
102
|
+
"All ",
|
|
103
|
+
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])));
|
|
104
|
+
}))) : (this.renderTable(rows, columns, pagination, loaded, filters, selected, onSelect, onUpdateData, bulkSelect))));
|
|
100
105
|
};
|
|
101
106
|
return TagModal;
|
|
102
107
|
}(Component));
|
|
103
|
-
TagModal.propTypes = {
|
|
104
|
-
tabNames: PropTypes.arrayOf(PropTypes.string),
|
|
105
|
-
loaded: PropTypes.oneOfType([PropTypes.bool, PropTypes.arrayOf(PropTypes.bool)]),
|
|
106
|
-
title: PropTypes.string,
|
|
107
|
-
systemName: PropTypes.string,
|
|
108
|
-
isOpen: PropTypes.bool,
|
|
109
|
-
toggleModal: PropTypes.func,
|
|
110
|
-
rows: PropTypes.array,
|
|
111
|
-
columns: PropTypes.array,
|
|
112
|
-
className: PropTypes.string,
|
|
113
|
-
tableProps: PropTypes.shape((_a = {},
|
|
114
|
-
_a[PropTypes.string] = PropTypes.any,
|
|
115
|
-
_a)),
|
|
116
|
-
onSelect: PropTypes.oneOfType([PropTypes.func, PropTypes.arrayOf(PropTypes.func)]),
|
|
117
|
-
onUpdateData: PropTypes.oneOfType([PropTypes.func, PropTypes.arrayOf(PropTypes.func)]),
|
|
118
|
-
bulkSelect: PropTypes.oneOfType([PropTypes.any, PropTypes.arrayOf(PropTypes.any)]),
|
|
119
|
-
pagination: PropTypes.oneOfType([TableWithFilter.propTypes.pagination, PropTypes.arrayOf(TableWithFilter.propTypes.pagination)]),
|
|
120
|
-
primaryToolbarProps: PropTypes.shape((_b = {},
|
|
121
|
-
_b[PropTypes.string] = PropTypes.any,
|
|
122
|
-
_b)),
|
|
123
|
-
selected: PropTypes.array,
|
|
124
|
-
children: PropTypes.node,
|
|
125
|
-
filters: PropTypes.any,
|
|
126
|
-
onApply: PropTypes.func,
|
|
127
|
-
};
|
|
128
|
-
TagModal.defaultProps = {
|
|
129
|
-
loaded: false,
|
|
130
|
-
isOpen: false,
|
|
131
|
-
toggleModal: function () { return undefined; },
|
|
132
|
-
columns: [{ title: 'Name' }, { title: 'Tag source' }],
|
|
133
|
-
onUpdateData: function () { return undefined; },
|
|
134
|
-
rows: [],
|
|
135
|
-
tableProps: {},
|
|
136
|
-
pagination: { count: 10 },
|
|
137
|
-
};
|
|
138
108
|
export default TagModal;
|
|
139
109
|
//# sourceMappingURL=TagModal.js.map
|
package/package.json
CHANGED
package/Ansible/Ansible.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Ansible.js","sourceRoot":"","sources":["../src/Ansible/Ansible.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAE1B,0DAAoC;AAEpC,0BAAwB;AAgBxB,IAAM,OAAO,GAA0C,UAAC,EAAoC;;IAAlC,IAAA,WAAW,iBAAA,EAAE,SAAS,eAAA,EAAK,KAAK,cAAlC,4BAAoC,CAAF;IACxF,IAAM,gBAAgB,GAAG,IAAA,oBAAU,EACjC,SAAS,EACT,SAAS,YACP,GAAC,cAAc,IAAG,CAAC,WAAW,IAAI,WAAW,KAAK,CAAC,iBACnD,GAAC,gBAAgB,IAAG,WAAW,IAAI,WAAW,KAAK,CAAC,MACvD,CAAC;IAEF,IAAI,gBAAgB,CAAC;IACrB,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,WAAW,EAAE;QACf,gBAAgB,GAAG,CACjB,8BAAC,eAAK,CAAC,QAAQ;YACb,wCACE,CAAC,EAAC,QAAQ,EACV,CAAC,EAAC,OAAO,EACT,SAAS,EAAC,2DAA2D,EACrE,SAAS,EAAC,KAAK,EACf,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,OAAO,GACd;YAEF,wCACE,CAAC,EAAC,QAAQ,EACV,CAAC,EAAC,KAAK,EACP,SAAS,EAAC,4DAA4D,EACtE,SAAS,EAAC,KAAK,EACf,KAAK,EAAC,QAAQ,EACd,MAAM,EAAC,OAAO,GACd;YAEF,wCACE,CAAC,EAAC,MAAM,EACR,CAAC,EAAC,QAAQ,EACV,SAAS,EAAC,4DAA4D,EACtE,SAAS,EAAC,KAAK,EACf,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,OAAO,GACd,CACa,CAClB,CAAC;QACF,UAAU;YACR,GAAC,UAAU,IAAG,UAAU;YACxB,GAAC,YAAY,IAAG,+BAA+B;eAChD,CAAC;KACH;SAAM;QACL,UAAU,aAAK,GAAC,YAAY,IAAG,qBAAqB,KAAE,CAAC;KACxD;IAED,OAAO,CACL,8CAAG,SAAS,EAAE,gBAAgB,IAAM,UAAU,EAAM,KAAK,mBAAc,wBAAwB;QAC7F,uCACE,OAAO,EAAC,KAAK,EACb,EAAE,EAAC,SAAS,EACZ,CAAC,EAAC,KAAK,EACP,CAAC,EAAC,KAAK,EACP,OAAO,EAAC,iBAAiB,EACzB,KAAK,EAAE,EAAE,gBAAgB,EAAE,qBAAqB,EAAyB;YAEzE,wCACE,SAAS,EAAC,KAAK,EACf,CAAC,EAAC,ggBAG+H,GACjI;YACD,gBAAgB,CACb,CACJ,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
package/Ansible/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/Ansible/index.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAoC;AAA3B,mHAAA,OAAO,OAAA;AAChB,qCAA+C;AAAtC,mHAAA,OAAO,OAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/AsyncComponent/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,mDAAyD;AACzD,qDAA2D;AAC3D,0DAAoC;AAuBpC,IAAM,kBAAkB,GAAqD,UAAC,EAa7E;IAZC,IAAA,OAAO,aAAA,EACP,KAAK,WAAA,EACL,MAAM,YAAA,EACN,gBAIC,EAJD,QAAQ,mBAAG,CACT,8BAAC,qBAAQ;QACP,8BAAC,oBAAO,IAAC,IAAI,EAAC,IAAI,GAAG,CACZ,CACZ,KAAA,EACD,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,iBAA0B,EAAf,GAAG,mBAAG,SAAS,KAAA,EACvB,KAAK,cAZoE,gFAa7E,CADS;IAER,OAAO,CACL,8BAAC,GAAG,IAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,OAAO,CAAC;QAC5C,8BAAC,8BAAiB,aAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,OAAO,EACvB,cAAc,EAAE,QAAQ,EACxB,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,QAAQ,IACd,KAAK,EACT,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAQF,IAAM,aAAa,GAAG,eAAK,CAAC,UAAU,CAAmC,UAAC,KAAK,EAAE,GAAG,IAAK,OAAA,8BAAC,kBAAkB,aAAC,QAAQ,EAAE,GAAG,IAAM,KAAK,EAAI,EAAhD,CAAgD,CAAC,CAAC;AAE3I,kBAAe,aAAa,CAAC"}
|