@patternfly/react-core 4.158.1 → 4.159.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/esm/components/DragDrop/Draggable.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/Draggable.js +13 -7
- package/dist/esm/components/DragDrop/Draggable.js.map +1 -1
- package/dist/esm/components/DragDrop/Droppable.d.ts.map +1 -1
- package/dist/esm/components/DragDrop/Droppable.js +3 -1
- package/dist/esm/components/DragDrop/Droppable.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +3 -0
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +2 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/SelectMenu.d.ts +3 -0
- package/dist/esm/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/esm/components/Select/SelectMenu.js +4 -3
- package/dist/esm/components/Select/SelectMenu.js.map +1 -1
- package/dist/esm/components/Select/selectConstants.d.ts +4 -0
- package/dist/esm/components/Select/selectConstants.d.ts.map +1 -1
- package/dist/esm/components/Select/selectConstants.js +5 -0
- package/dist/esm/components/Select/selectConstants.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.d.ts +20 -0
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +44 -14
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.js +1 -1
- package/dist/js/components/DragDrop/Draggable.d.ts.map +1 -1
- package/dist/js/components/DragDrop/Draggable.js +13 -7
- package/dist/js/components/DragDrop/Draggable.js.map +1 -1
- package/dist/js/components/DragDrop/Droppable.d.ts.map +1 -1
- package/dist/js/components/DragDrop/Droppable.js +3 -1
- package/dist/js/components/DragDrop/Droppable.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +3 -0
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +1 -0
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Select/SelectMenu.d.ts +3 -0
- package/dist/js/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/js/components/Select/SelectMenu.js +3 -2
- package/dist/js/components/Select/SelectMenu.js.map +1 -1
- package/dist/js/components/Select/selectConstants.d.ts +4 -0
- package/dist/js/components/Select/selectConstants.d.ts.map +1 -1
- package/dist/js/components/Select/selectConstants.js +6 -1
- package/dist/js/components/Select/selectConstants.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +20 -0
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +44 -14
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.js +1 -1
- package/dist/umd/react-core.css +13638 -13562
- package/dist/umd/react-core.js +104 -49
- package/dist/umd/react-core.min.css +10666 -10590
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +6 -6
- package/src/components/DragDrop/Draggable.tsx +20 -11
- package/src/components/DragDrop/Droppable.tsx +3 -1
- package/src/components/Drawer/examples/Drawer.md +0 -78
- package/src/components/Page/examples/Page.md +289 -103
- package/src/components/Select/Select.tsx +4 -1
- package/src/components/Select/SelectMenu.tsx +10 -2
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectMenu.test.tsx.snap +1 -0
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +57 -0
- package/src/components/Select/selectConstants.tsx +5 -0
- package/src/components/Sidebar/examples/Sidebar.md +6 -3
- package/src/components/Tabs/Tabs.tsx +97 -13
- package/src/components/Tabs/__tests__/Generated/__snapshots__/Tabs.test.tsx.snap +4 -4
- package/src/components/Tabs/__tests__/Tabs.test.tsx +50 -0
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +276 -30
- package/src/components/Tabs/examples/Tabs.md +96 -0
- package/src/components/Wizard/WizardNavItem.tsx +1 -1
- package/src/demos/CardDemos.md +443 -0
- package/src/demos/ComposableMenu.md +125 -17
- package/src/demos/Page/Page.md +322 -12
package/dist/umd/react-core.js
CHANGED
|
@@ -5799,6 +5799,7 @@
|
|
|
5799
5799
|
"expanded": "pf-m-expanded",
|
|
5800
5800
|
"plain": "pf-m-plain",
|
|
5801
5801
|
"typeahead": "pf-m-typeahead",
|
|
5802
|
+
"placeholder": "pf-m-placeholder",
|
|
5802
5803
|
"top": "pf-m-top",
|
|
5803
5804
|
"alignRight": "pf-m-align-right",
|
|
5804
5805
|
"favorite": "pf-m-favorite",
|
|
@@ -5946,6 +5947,10 @@
|
|
|
5946
5947
|
SelectVariant["typeahead"] = "typeahead";
|
|
5947
5948
|
SelectVariant["typeaheadMulti"] = "typeaheadmulti";
|
|
5948
5949
|
})(exports.SelectVariant || (exports.SelectVariant = {}));
|
|
5950
|
+
(function (SelectPosition) {
|
|
5951
|
+
SelectPosition["right"] = "right";
|
|
5952
|
+
SelectPosition["left"] = "left";
|
|
5953
|
+
})(exports.SelectPosition || (exports.SelectPosition = {}));
|
|
5949
5954
|
(function (SelectDirection) {
|
|
5950
5955
|
SelectDirection["up"] = "up";
|
|
5951
5956
|
SelectDirection["down"] = "down";
|
|
@@ -6217,10 +6222,10 @@
|
|
|
6217
6222
|
}
|
|
6218
6223
|
renderSelectMenu({ variant, inputIdPrefix }) {
|
|
6219
6224
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
6220
|
-
const _a = this.props, { children, isCustomContent, className, isExpanded, openedOnEnter, selected, checked, isGrouped, sendRef, keyHandler, maxHeight, noResultsFoundText, createText, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, hasInlineFilter, innerRef, footer, footerRef, isLastOptionBeforeFooter } = _a, props = __rest(_a, ["children", "isCustomContent", "className", "isExpanded", "openedOnEnter", "selected", "checked", "isGrouped", "sendRef", "keyHandler", "maxHeight", "noResultsFoundText", "createText", 'aria-label', 'aria-labelledby', "hasInlineFilter", "innerRef", "footer", "footerRef", "isLastOptionBeforeFooter"]);
|
|
6225
|
+
const _a = this.props, { children, isCustomContent, className, isExpanded, openedOnEnter, selected, checked, isGrouped, position, sendRef, keyHandler, maxHeight, noResultsFoundText, createText, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, hasInlineFilter, innerRef, footer, footerRef, isLastOptionBeforeFooter } = _a, props = __rest(_a, ["children", "isCustomContent", "className", "isExpanded", "openedOnEnter", "selected", "checked", "isGrouped", "position", "sendRef", "keyHandler", "maxHeight", "noResultsFoundText", "createText", 'aria-label', 'aria-labelledby', "hasInlineFilter", "innerRef", "footer", "footerRef", "isLastOptionBeforeFooter"]);
|
|
6221
6226
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
6222
6227
|
let Component = 'div';
|
|
6223
|
-
const variantProps = Object.assign({ ref: innerRef, className: css(!footer ? styles$j.selectMenu : 'pf-c-select__menu-list', className) }, (maxHeight && { style: { maxHeight, overflow: 'auto' } }));
|
|
6228
|
+
const variantProps = Object.assign({ ref: innerRef, className: css(!footer ? styles$j.selectMenu : 'pf-c-select__menu-list', position === exports.SelectPosition.right && styles$j.modifiers.alignRight, className) }, (maxHeight && { style: { maxHeight, overflow: 'auto' } }));
|
|
6224
6229
|
const extendedChildren = () => variant === exports.SelectVariant.checkbox
|
|
6225
6230
|
? this.extendCheckboxChildren(children)
|
|
6226
6231
|
: this.extendChildren(inputIdPrefix);
|
|
@@ -6262,6 +6267,7 @@
|
|
|
6262
6267
|
openedOnEnter: false,
|
|
6263
6268
|
selected: '',
|
|
6264
6269
|
maxHeight: '',
|
|
6270
|
+
position: exports.SelectPosition.left,
|
|
6265
6271
|
sendRef: () => { },
|
|
6266
6272
|
keyHandler: () => { },
|
|
6267
6273
|
isCustomContent: false,
|
|
@@ -7262,6 +7268,7 @@
|
|
|
7262
7268
|
Select.defaultProps = {
|
|
7263
7269
|
children: [],
|
|
7264
7270
|
className: '',
|
|
7271
|
+
position: exports.SelectPosition.left,
|
|
7265
7272
|
direction: exports.SelectDirection.down,
|
|
7266
7273
|
toggleId: null,
|
|
7267
7274
|
isOpen: false,
|
|
@@ -13280,6 +13287,7 @@
|
|
|
13280
13287
|
"labelIcon": "pf-c-label__icon",
|
|
13281
13288
|
"labelText": "pf-c-label__text",
|
|
13282
13289
|
"modifiers": {
|
|
13290
|
+
"compact": "pf-m-compact",
|
|
13283
13291
|
"blue": "pf-m-blue",
|
|
13284
13292
|
"green": "pf-m-green",
|
|
13285
13293
|
"orange": "pf-m-orange",
|
|
@@ -17364,20 +17372,23 @@
|
|
|
17364
17372
|
this.tabList = React.createRef();
|
|
17365
17373
|
this.handleScrollButtons = () => {
|
|
17366
17374
|
const container = this.tabList.current;
|
|
17375
|
+
let disableLeftScrollButton = true;
|
|
17376
|
+
let disableRightScrollButton = true;
|
|
17377
|
+
let showScrollButtons = false;
|
|
17367
17378
|
if (container && !this.props.isVertical) {
|
|
17368
17379
|
// get first element and check if it is in view
|
|
17369
17380
|
const overflowOnLeft = !isElementInView(container, container.firstChild, false);
|
|
17370
17381
|
// get last element and check if it is in view
|
|
17371
17382
|
const overflowOnRight = !isElementInView(container, container.lastChild, false);
|
|
17372
|
-
|
|
17373
|
-
|
|
17374
|
-
|
|
17375
|
-
this.setState({
|
|
17376
|
-
showScrollButtons,
|
|
17377
|
-
disableLeftScrollButton,
|
|
17378
|
-
disableRightScrollButton
|
|
17379
|
-
});
|
|
17383
|
+
showScrollButtons = overflowOnLeft || overflowOnRight;
|
|
17384
|
+
disableLeftScrollButton = !overflowOnLeft;
|
|
17385
|
+
disableRightScrollButton = !overflowOnRight;
|
|
17380
17386
|
}
|
|
17387
|
+
this.setState({
|
|
17388
|
+
showScrollButtons,
|
|
17389
|
+
disableLeftScrollButton,
|
|
17390
|
+
disableRightScrollButton
|
|
17391
|
+
});
|
|
17381
17392
|
};
|
|
17382
17393
|
this.scrollLeft = () => {
|
|
17383
17394
|
// find first Element that is fully in view on the left, then scroll to the element before it
|
|
@@ -17418,12 +17429,19 @@
|
|
|
17418
17429
|
};
|
|
17419
17430
|
this.state = {
|
|
17420
17431
|
showScrollButtons: false,
|
|
17421
|
-
disableLeftScrollButton:
|
|
17422
|
-
disableRightScrollButton:
|
|
17432
|
+
disableLeftScrollButton: true,
|
|
17433
|
+
disableRightScrollButton: true,
|
|
17423
17434
|
shownKeys: this.props.defaultActiveKey !== undefined ? [this.props.defaultActiveKey] : [this.props.activeKey],
|
|
17424
17435
|
uncontrolledActiveKey: this.props.defaultActiveKey,
|
|
17436
|
+
uncontrolledIsExpandedLocal: this.props.defaultIsExpanded,
|
|
17425
17437
|
ouiaStateId: getDefaultOUIAId(Tabs.displayName)
|
|
17426
17438
|
};
|
|
17439
|
+
if (this.props.isVertical && this.props.expandable !== undefined) {
|
|
17440
|
+
if (!this.props.toggleAriaLabel && !this.props.toggleText) {
|
|
17441
|
+
// eslint-disable-next-line no-console
|
|
17442
|
+
console.error('Tabs:', 'toggleAriaLabel or the toggleText prop is required to make the toggle button accessible');
|
|
17443
|
+
}
|
|
17444
|
+
}
|
|
17427
17445
|
}
|
|
17428
17446
|
handleTabClick(event, eventKey, tabContentRef) {
|
|
17429
17447
|
// When tab is an achor tag with href, cancel navigation event
|
|
@@ -17482,14 +17500,24 @@
|
|
|
17482
17500
|
}
|
|
17483
17501
|
}
|
|
17484
17502
|
render() {
|
|
17485
|
-
const _a = this.props, { className, children, activeKey, defaultActiveKey, id, isFilled, isSecondary, isVertical, isBox, leftScrollAriaLabel, rightScrollAriaLabel, 'aria-label': ariaLabel, component, ouiaId, ouiaSafe, mountOnEnter, unmountOnExit, usePageInsets, inset, variant } = _a, props = __rest(_a, ["className", "children", "activeKey", "defaultActiveKey", "id", "isFilled", "isSecondary", "isVertical", "isBox", "leftScrollAriaLabel", "rightScrollAriaLabel", 'aria-label', "component", "ouiaId", "ouiaSafe", "mountOnEnter", "unmountOnExit", "usePageInsets", "inset", "variant"]);
|
|
17486
|
-
const { showScrollButtons, disableLeftScrollButton, disableRightScrollButton, shownKeys, uncontrolledActiveKey } = this.state;
|
|
17503
|
+
const _a = this.props, { className, children, activeKey, defaultActiveKey, id, isFilled, isSecondary, isVertical, isBox, leftScrollAriaLabel, rightScrollAriaLabel, 'aria-label': ariaLabel, component, ouiaId, ouiaSafe, mountOnEnter, unmountOnExit, usePageInsets, inset, variant, expandable, isExpanded, defaultIsExpanded, toggleText, toggleAriaLabel, onToggle } = _a, props = __rest(_a, ["className", "children", "activeKey", "defaultActiveKey", "id", "isFilled", "isSecondary", "isVertical", "isBox", "leftScrollAriaLabel", "rightScrollAriaLabel", 'aria-label', "component", "ouiaId", "ouiaSafe", "mountOnEnter", "unmountOnExit", "usePageInsets", "inset", "variant", "expandable", "isExpanded", "defaultIsExpanded", "toggleText", "toggleAriaLabel", "onToggle"]);
|
|
17504
|
+
const { showScrollButtons, disableLeftScrollButton, disableRightScrollButton, shownKeys, uncontrolledActiveKey, uncontrolledIsExpandedLocal } = this.state;
|
|
17487
17505
|
const filteredChildren = React.Children.toArray(children)
|
|
17488
17506
|
.filter(Boolean)
|
|
17489
17507
|
.filter(child => !child.props.isHidden);
|
|
17490
17508
|
const uniqueId = id || getUniqueId();
|
|
17491
17509
|
const Component = component === exports.TabsComponent.nav ? 'nav' : 'div';
|
|
17492
17510
|
const localActiveKey = defaultActiveKey !== undefined ? uncontrolledActiveKey : activeKey;
|
|
17511
|
+
const isExpandedLocal = defaultIsExpanded !== undefined ? uncontrolledIsExpandedLocal : isExpanded;
|
|
17512
|
+
/* Uncontrolled expandable tabs */
|
|
17513
|
+
const toggleTabs = (newValue) => {
|
|
17514
|
+
if (isExpanded === undefined) {
|
|
17515
|
+
this.setState({ uncontrolledIsExpandedLocal: newValue });
|
|
17516
|
+
}
|
|
17517
|
+
else {
|
|
17518
|
+
onToggle(newValue);
|
|
17519
|
+
}
|
|
17520
|
+
};
|
|
17493
17521
|
return (React.createElement(TabsContextProvider, { value: {
|
|
17494
17522
|
variant,
|
|
17495
17523
|
mountOnEnter,
|
|
@@ -17498,7 +17526,13 @@
|
|
|
17498
17526
|
uniqueId,
|
|
17499
17527
|
handleTabClick: (...args) => this.handleTabClick(...args)
|
|
17500
17528
|
} },
|
|
17501
|
-
React.createElement(Component, Object.assign({ "aria-label": ariaLabel, className: css(styles$10.tabs, isFilled && styles$10.modifiers.fill, isSecondary && styles$10.modifiers.secondary, isVertical && styles$10.modifiers.vertical, isBox && styles$10.modifiers.box, showScrollButtons && !isVertical && styles$10.modifiers.scrollable, usePageInsets && styles$10.modifiers.pageInsets, formatBreakpointMods(inset, styles$10), variantStyle$3[variant], className) }, getOUIAProps(Tabs.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), { id: id && id }, props),
|
|
17529
|
+
React.createElement(Component, Object.assign({ "aria-label": ariaLabel, className: css(styles$10.tabs, isFilled && styles$10.modifiers.fill, isSecondary && styles$10.modifiers.secondary, isVertical && styles$10.modifiers.vertical, isVertical && expandable && formatBreakpointMods(expandable, styles$10), isVertical && expandable && isExpandedLocal && styles$10.modifiers.expanded, isBox && styles$10.modifiers.box, showScrollButtons && !isVertical && styles$10.modifiers.scrollable, usePageInsets && styles$10.modifiers.pageInsets, formatBreakpointMods(inset, styles$10), variantStyle$3[variant], className) }, getOUIAProps(Tabs.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), { id: id && id }, props),
|
|
17530
|
+
expandable && isVertical && (React.createElement(GenerateId, null, randomId => (React.createElement("div", { className: css(styles$10.tabsToggle) },
|
|
17531
|
+
React.createElement("div", { className: css(styles$10.tabsToggleButton) },
|
|
17532
|
+
React.createElement(Button, { onClick: () => toggleTabs(!isExpandedLocal), variant: "plain", "aria-label": toggleAriaLabel, "aria-expanded": isExpandedLocal, id: `${randomId}-button`, "aria-labelledby": `${randomId}-text ${randomId}-button` },
|
|
17533
|
+
React.createElement("span", { className: css(styles$10.tabsToggleIcon) },
|
|
17534
|
+
React.createElement(AngleRightIcon, { "arian-hidden": "true" })),
|
|
17535
|
+
toggleText && (React.createElement("span", { className: css('pf-c-tabs__toggle-text'), id: `${randomId}-text` }, toggleText)))))))),
|
|
17502
17536
|
React.createElement("button", { className: css(styles$10.tabsScrollButton, isSecondary && buttonStyles.modifiers.secondary), "aria-label": leftScrollAriaLabel, onClick: this.scrollLeft, disabled: disableLeftScrollButton, "aria-hidden": disableLeftScrollButton },
|
|
17503
17537
|
React.createElement(AngleLeftIcon, null)),
|
|
17504
17538
|
React.createElement("ul", { className: css(styles$10.tabsList), ref: this.tabList, onScroll: this.handleScrollButtons }, filteredChildren),
|
|
@@ -17525,7 +17559,9 @@
|
|
|
17525
17559
|
mountOnEnter: false,
|
|
17526
17560
|
unmountOnExit: false,
|
|
17527
17561
|
ouiaSafe: true,
|
|
17528
|
-
variant: 'default'
|
|
17562
|
+
variant: 'default',
|
|
17563
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17564
|
+
onToggle: (isExpanded) => undefined
|
|
17529
17565
|
};
|
|
17530
17566
|
|
|
17531
17567
|
const TabTitleText = (_a) => {
|
|
@@ -18950,7 +18986,7 @@
|
|
|
18950
18986
|
href
|
|
18951
18987
|
};
|
|
18952
18988
|
return (React.createElement("li", { className: css(styles$17.wizardNavItem, isExpandable && styles$17.modifiers.expandable, isExpandable && isExpanded && styles$17.modifiers.expanded) },
|
|
18953
|
-
React.createElement(NavItemComponent, Object.assign({}, rest, (navItemComponent === 'a' ? Object.assign({}, linkProps) : Object.assign({}, btnProps)), { onClick: () => (isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(step)), className: css(styles$17.wizardNavLink, isCurrent && styles$17.modifiers.current, isDisabled && styles$17.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? '
|
|
18989
|
+
React.createElement(NavItemComponent, Object.assign({}, rest, (navItemComponent === 'a' ? Object.assign({}, linkProps) : Object.assign({}, btnProps)), { onClick: () => (isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(step)), className: css(styles$17.wizardNavLink, isCurrent && styles$17.modifiers.current, isDisabled && styles$17.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? 'step' : false }, (isExpandable && { 'aria-expanded': isExpanded })), isExpandable ? (React.createElement(React.Fragment, null,
|
|
18954
18990
|
React.createElement("span", { className: css(styles$17.wizardNavLinkText) }, content),
|
|
18955
18991
|
React.createElement("span", { className: css(styles$17.wizardNavLinkToggle) },
|
|
18956
18992
|
React.createElement("span", { className: css(styles$17.wizardNavLinkToggleIcon) },
|
|
@@ -19250,6 +19286,21 @@
|
|
|
19250
19286
|
const DragDrop = ({ children, onDrag = () => true, onDragMove = () => { }, onDrop = () => false }) => (React.createElement(DragDropContext.Provider, { value: { onDrag, onDragMove, onDrop } }, children));
|
|
19251
19287
|
DragDrop.displayName = 'DragDrop';
|
|
19252
19288
|
|
|
19289
|
+
var dragDrop = createCommonjsModule(function (module, exports) {
|
|
19290
|
+
exports.__esModule = true;
|
|
19291
|
+
|
|
19292
|
+
exports.default = {
|
|
19293
|
+
"draggable": "pf-c-draggable",
|
|
19294
|
+
"droppable": "pf-c-droppable",
|
|
19295
|
+
"modifiers": {
|
|
19296
|
+
"dragging": "pf-m-dragging",
|
|
19297
|
+
"dragOutside": "pf-m-drag-outside"
|
|
19298
|
+
}
|
|
19299
|
+
};
|
|
19300
|
+
});
|
|
19301
|
+
|
|
19302
|
+
var styles$18 = unwrapExports(dragDrop);
|
|
19303
|
+
|
|
19253
19304
|
const DroppableContext = React.createContext({
|
|
19254
19305
|
zone: 'defaultDroppableZone',
|
|
19255
19306
|
droppableId: 'defaultDroppableId'
|
|
@@ -19290,7 +19341,8 @@
|
|
|
19290
19341
|
// Reset per-element state
|
|
19291
19342
|
function resetDroppableItem(droppableItem) {
|
|
19292
19343
|
removeBlankDiv(droppableItem.node);
|
|
19293
|
-
droppableItem.node.
|
|
19344
|
+
droppableItem.node.classList.remove(styles$18.modifiers.dragging);
|
|
19345
|
+
droppableItem.node.classList.remove(styles$18.modifiers.dragOutside);
|
|
19294
19346
|
droppableItem.draggableNodes.forEach((n, i) => {
|
|
19295
19347
|
n.style.transform = '';
|
|
19296
19348
|
n.style.transition = '';
|
|
@@ -19306,6 +19358,7 @@
|
|
|
19306
19358
|
let [style, setStyle] = React.useState(styleProp);
|
|
19307
19359
|
/* eslint-enable prefer-const */
|
|
19308
19360
|
const [isDragging, setIsDragging] = React.useState(false);
|
|
19361
|
+
const [isValidDrag, setIsValidDrag] = React.useState(true);
|
|
19309
19362
|
const { zone, droppableId } = React.useContext(DroppableContext);
|
|
19310
19363
|
const { onDrag, onDragMove, onDrop } = React.useContext(DragDropContext);
|
|
19311
19364
|
// Some state is better just to leave as vars passed around between various callbacks
|
|
@@ -19364,7 +19417,7 @@
|
|
|
19364
19417
|
const { node, rect, isDraggingHost, draggableNodes, draggableNodesRects } = droppableItem;
|
|
19365
19418
|
if (overlaps(ev, rect)) {
|
|
19366
19419
|
// Add valid dropzone style
|
|
19367
|
-
node.
|
|
19420
|
+
node.classList.remove(styles$18.modifiers.dragOutside);
|
|
19368
19421
|
hoveringDroppable = node;
|
|
19369
19422
|
// Check if we need to add a blank div row
|
|
19370
19423
|
if (node.getAttribute('blankDiv') !== 'true' && !isDraggingHost) {
|
|
@@ -19400,11 +19453,13 @@
|
|
|
19400
19453
|
}
|
|
19401
19454
|
else {
|
|
19402
19455
|
resetDroppableItem(droppableItem);
|
|
19403
|
-
node.
|
|
19456
|
+
node.classList.add(styles$18.modifiers.dragging);
|
|
19457
|
+
node.classList.add(styles$18.modifiers.dragOutside);
|
|
19404
19458
|
}
|
|
19405
19459
|
});
|
|
19406
19460
|
// Move hovering draggable and style it based on cursor position
|
|
19407
|
-
setStyle(Object.assign(Object.assign({}, style), {
|
|
19461
|
+
setStyle(Object.assign(Object.assign({}, style), { transform: `translate(${ev.pageX - startX}px, ${ev.pageY - startY}px)` }));
|
|
19462
|
+
setIsValidDrag(Boolean(hoveringDroppable));
|
|
19408
19463
|
// Iterate through sibling draggable nodes to reposition them and store correct hoveringIndex for onDrop
|
|
19409
19464
|
hoveringIndex = null;
|
|
19410
19465
|
if (hoveringDroppable) {
|
|
@@ -19447,6 +19502,7 @@
|
|
|
19447
19502
|
const rect = dragging.getBoundingClientRect();
|
|
19448
19503
|
const droppableNodes = Array.from(document.querySelectorAll(`[data-pf-droppable="${zone}"]`));
|
|
19449
19504
|
const droppableItems = droppableNodes.reduce((acc, cur) => {
|
|
19505
|
+
cur.classList.add(styles$18.modifiers.dragging);
|
|
19450
19506
|
const draggableNodes = Array.from(cur.querySelectorAll(`[data-pf-draggable-zone="${zone}"]`));
|
|
19451
19507
|
const isDraggingHost = cur.contains(dragging);
|
|
19452
19508
|
if (isDraggingHost) {
|
|
@@ -19468,7 +19524,7 @@
|
|
|
19468
19524
|
return;
|
|
19469
19525
|
}
|
|
19470
19526
|
// Set initial style so future style mods take effect
|
|
19471
|
-
style = Object.assign(Object.assign({}, style), {
|
|
19527
|
+
style = Object.assign(Object.assign({}, style), { top: rect.y, left: rect.x, width: rect.width, height: rect.height, '--pf-c-draggable--m-dragging--BackgroundColor': getInheritedBackgroundColor(dragging), position: 'fixed', zIndex: 5000 });
|
|
19472
19528
|
setStyle(style);
|
|
19473
19529
|
// Store event details
|
|
19474
19530
|
startX = ev.pageX;
|
|
@@ -19482,8 +19538,7 @@
|
|
|
19482
19538
|
// Comment out this line to debug while dragging by right clicking
|
|
19483
19539
|
// document.addEventListener('contextmenu', mouseUpListener);
|
|
19484
19540
|
};
|
|
19485
|
-
const childProps = Object.assign({ 'data-pf-draggable-zone': isDragging ? null : zone, draggable: true, className,
|
|
19486
|
-
onDragStart,
|
|
19541
|
+
const childProps = Object.assign({ 'data-pf-draggable-zone': isDragging ? null : zone, draggable: true, className: css(styles$18.draggable, isDragging && styles$18.modifiers.dragging, !isValidDrag && styles$18.modifiers.dragOutside, className), onDragStart,
|
|
19487
19542
|
onTransitionEnd,
|
|
19488
19543
|
style }, props);
|
|
19489
19544
|
return (React.createElement(React.Fragment, null,
|
|
@@ -19494,7 +19549,7 @@
|
|
|
19494
19549
|
|
|
19495
19550
|
const Droppable = (_a) => {
|
|
19496
19551
|
var { className, children, zone = 'defaultZone', droppableId = 'defaultId', hasNoWrapper = false } = _a, props = __rest(_a, ["className", "children", "zone", "droppableId", "hasNoWrapper"]);
|
|
19497
|
-
const childProps = Object.assign({ 'data-pf-droppable': zone, 'data-pf-droppableid': droppableId, className }, props);
|
|
19552
|
+
const childProps = Object.assign({ 'data-pf-droppable': zone, 'data-pf-droppableid': droppableId, className: css(styles$18.droppable, className) }, props);
|
|
19498
19553
|
return (React.createElement(DroppableContext.Provider, { value: { zone, droppableId } }, hasNoWrapper ? (React.cloneElement(children, childProps)) : (React.createElement("div", Object.assign({}, childProps), children))));
|
|
19499
19554
|
};
|
|
19500
19555
|
Droppable.displayName = 'Droppable';
|
|
@@ -19876,7 +19931,7 @@
|
|
|
19876
19931
|
};
|
|
19877
19932
|
});
|
|
19878
19933
|
|
|
19879
|
-
var styles$
|
|
19934
|
+
var styles$19 = unwrapExports(flex);
|
|
19880
19935
|
|
|
19881
19936
|
const l_flex_item_Order = {
|
|
19882
19937
|
"name": "--pf-l-flex--item--Order",
|
|
@@ -19887,14 +19942,14 @@
|
|
|
19887
19942
|
const Flex = (_a) => {
|
|
19888
19943
|
var { children = null, className = '', component = 'div', spacer, spaceItems, grow, shrink, flex, direction, alignItems, alignContent, alignSelf, align, justifyContent, display, fullWidth, flexWrap, order, style } = _a, props = __rest(_a, ["children", "className", "component", "spacer", "spaceItems", "grow", "shrink", "flex", "direction", "alignItems", "alignContent", "alignSelf", "align", "justifyContent", "display", "fullWidth", "flexWrap", "order", "style"]);
|
|
19889
19944
|
const Component = component;
|
|
19890
|
-
return (React.createElement(Component, Object.assign({ className: css(styles$
|
|
19945
|
+
return (React.createElement(Component, Object.assign({ className: css(styles$19.flex, formatBreakpointMods(spacer, styles$19), formatBreakpointMods(spaceItems, styles$19), formatBreakpointMods(grow, styles$19), formatBreakpointMods(shrink, styles$19), formatBreakpointMods(flex, styles$19), formatBreakpointMods(direction, styles$19), formatBreakpointMods(alignItems, styles$19), formatBreakpointMods(alignContent, styles$19), formatBreakpointMods(alignSelf, styles$19), formatBreakpointMods(align, styles$19), formatBreakpointMods(justifyContent, styles$19), formatBreakpointMods(display, styles$19), formatBreakpointMods(fullWidth, styles$19), formatBreakpointMods(flexWrap, styles$19), className), style: style || order ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order, l_flex_item_Order.name)) : undefined }, props), children));
|
|
19891
19946
|
};
|
|
19892
19947
|
Flex.displayName = 'Flex';
|
|
19893
19948
|
|
|
19894
19949
|
const FlexItem = (_a) => {
|
|
19895
19950
|
var { children = null, className = '', component = 'div', spacer, grow, shrink, flex, alignSelf, align, fullWidth, order, style } = _a, props = __rest(_a, ["children", "className", "component", "spacer", "grow", "shrink", "flex", "alignSelf", "align", "fullWidth", "order", "style"]);
|
|
19896
19951
|
const Component = component;
|
|
19897
|
-
return (React.createElement(Component, Object.assign({}, props, { className: css(formatBreakpointMods(spacer, styles$
|
|
19952
|
+
return (React.createElement(Component, Object.assign({}, props, { className: css(formatBreakpointMods(spacer, styles$19), formatBreakpointMods(grow, styles$19), formatBreakpointMods(shrink, styles$19), formatBreakpointMods(flex, styles$19), formatBreakpointMods(alignSelf, styles$19), formatBreakpointMods(align, styles$19), formatBreakpointMods(fullWidth, styles$19), className), style: style || order ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order, l_flex_item_Order.name)) : undefined }), children));
|
|
19898
19953
|
};
|
|
19899
19954
|
FlexItem.displayName = 'FlexItem';
|
|
19900
19955
|
|
|
@@ -19909,7 +19964,7 @@
|
|
|
19909
19964
|
};
|
|
19910
19965
|
});
|
|
19911
19966
|
|
|
19912
|
-
var styles$
|
|
19967
|
+
var styles$1a = unwrapExports(gallery);
|
|
19913
19968
|
|
|
19914
19969
|
const Gallery = (_a) => {
|
|
19915
19970
|
var { children = null, className = '', component = 'div', hasGutter = false, minWidths, maxWidths } = _a, props = __rest(_a, ["children", "className", "component", "hasGutter", "minWidths", "maxWidths"]);
|
|
@@ -19923,7 +19978,7 @@
|
|
|
19923
19978
|
Object.entries(maxWidths || {}).map(([breakpoint, value]) => (maxWidthStyles[`--pf-l-gallery--GridTemplateColumns--max${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`] = value));
|
|
19924
19979
|
}
|
|
19925
19980
|
const widthStyles = Object.assign(Object.assign({}, minWidthStyles), maxWidthStyles);
|
|
19926
|
-
return (React.createElement(Component, Object.assign({ className: css(styles$
|
|
19981
|
+
return (React.createElement(Component, Object.assign({ className: css(styles$1a.gallery, hasGutter && styles$1a.modifiers.gutter, className) }, props, ((minWidths || maxWidths) && { style: Object.assign(Object.assign({}, widthStyles), props.style) })), children));
|
|
19927
19982
|
};
|
|
19928
19983
|
Gallery.displayName = 'Gallery';
|
|
19929
19984
|
|
|
@@ -20234,7 +20289,7 @@
|
|
|
20234
20289
|
};
|
|
20235
20290
|
});
|
|
20236
20291
|
|
|
20237
|
-
var styles$
|
|
20292
|
+
var styles$1b = unwrapExports(grid);
|
|
20238
20293
|
|
|
20239
20294
|
(function (BaseSizes) {
|
|
20240
20295
|
BaseSizes["xs"] = "xs";
|
|
@@ -20262,27 +20317,27 @@
|
|
|
20262
20317
|
|
|
20263
20318
|
const Grid = (_a) => {
|
|
20264
20319
|
var { children = null, className = '', component = 'div', hasGutter, span = null, order, style } = _a, props = __rest(_a, ["children", "className", "component", "hasGutter", "span", "order", "style"]);
|
|
20265
|
-
const classes = [styles$
|
|
20320
|
+
const classes = [styles$1b.grid, span && styles$1b.modifiers[`all_${span}Col`]];
|
|
20266
20321
|
const Component = component;
|
|
20267
20322
|
Object.entries(exports.DeviceSizes).forEach(([propKey, gridSpanModifier]) => {
|
|
20268
20323
|
const key = propKey;
|
|
20269
20324
|
const propValue = props[key];
|
|
20270
20325
|
if (propValue) {
|
|
20271
|
-
classes.push(styles$
|
|
20326
|
+
classes.push(styles$1b.modifiers[`all_${propValue}ColOn${gridSpanModifier}`]);
|
|
20272
20327
|
}
|
|
20273
20328
|
delete props[key];
|
|
20274
20329
|
});
|
|
20275
|
-
return (React.createElement(Component, Object.assign({ className: css(...classes, hasGutter && styles$
|
|
20330
|
+
return (React.createElement(Component, Object.assign({ className: css(...classes, hasGutter && styles$1b.modifiers.gutter, className), style: style || order ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order, l_grid_item_Order.name)) : undefined }, props), children));
|
|
20276
20331
|
};
|
|
20277
20332
|
Grid.displayName = 'Grid';
|
|
20278
20333
|
|
|
20279
20334
|
const GridItem = (_a) => {
|
|
20280
20335
|
var { children = null, className = '', component = 'div', span = null, rowSpan = null, offset = null, order, style } = _a, props = __rest(_a, ["children", "className", "component", "span", "rowSpan", "offset", "order", "style"]);
|
|
20281
20336
|
const classes = [
|
|
20282
|
-
styles$
|
|
20283
|
-
span && styles$
|
|
20284
|
-
rowSpan && styles$
|
|
20285
|
-
offset && styles$
|
|
20337
|
+
styles$1b.gridItem,
|
|
20338
|
+
span && styles$1b.modifiers[`${span}Col`],
|
|
20339
|
+
rowSpan && styles$1b.modifiers[`${rowSpan}Row`],
|
|
20340
|
+
offset && styles$1b.modifiers[`offset_${offset}Col`]
|
|
20286
20341
|
];
|
|
20287
20342
|
const Component = component;
|
|
20288
20343
|
Object.entries(exports.DeviceSizes).forEach(([propKey, classModifier]) => {
|
|
@@ -20293,13 +20348,13 @@
|
|
|
20293
20348
|
const rowSpanValue = props[rowSpanKey];
|
|
20294
20349
|
const offsetValue = props[offsetKey];
|
|
20295
20350
|
if (spanValue) {
|
|
20296
|
-
classes.push(styles$
|
|
20351
|
+
classes.push(styles$1b.modifiers[`${spanValue}ColOn${classModifier}`]);
|
|
20297
20352
|
}
|
|
20298
20353
|
if (rowSpanValue) {
|
|
20299
|
-
classes.push(styles$
|
|
20354
|
+
classes.push(styles$1b.modifiers[`${rowSpanValue}RowOn${classModifier}`]);
|
|
20300
20355
|
}
|
|
20301
20356
|
if (offsetValue) {
|
|
20302
|
-
classes.push(styles$
|
|
20357
|
+
classes.push(styles$1b.modifiers[`offset_${offsetValue}ColOn${classModifier}`]);
|
|
20303
20358
|
}
|
|
20304
20359
|
delete props[key];
|
|
20305
20360
|
delete props[rowSpanKey];
|
|
@@ -20320,11 +20375,11 @@
|
|
|
20320
20375
|
};
|
|
20321
20376
|
});
|
|
20322
20377
|
|
|
20323
|
-
var styles$
|
|
20378
|
+
var styles$1c = unwrapExports(level);
|
|
20324
20379
|
|
|
20325
20380
|
const Level = (_a) => {
|
|
20326
20381
|
var { hasGutter, className = '', children = null } = _a, props = __rest(_a, ["hasGutter", "className", "children"]);
|
|
20327
|
-
return (React.createElement("div", Object.assign({}, props, { className: css(styles$
|
|
20382
|
+
return (React.createElement("div", Object.assign({}, props, { className: css(styles$1c.level, hasGutter && styles$1c.modifiers.gutter, className) }), children));
|
|
20328
20383
|
};
|
|
20329
20384
|
Level.displayName = 'Level';
|
|
20330
20385
|
|
|
@@ -20348,18 +20403,18 @@
|
|
|
20348
20403
|
};
|
|
20349
20404
|
});
|
|
20350
20405
|
|
|
20351
|
-
var styles$
|
|
20406
|
+
var styles$1d = unwrapExports(split);
|
|
20352
20407
|
|
|
20353
20408
|
const Split = (_a) => {
|
|
20354
20409
|
var { hasGutter = false, isWrappable = false, className = '', children = null, component = 'div' } = _a, props = __rest(_a, ["hasGutter", "isWrappable", "className", "children", "component"]);
|
|
20355
20410
|
const Component = component;
|
|
20356
|
-
return (React.createElement(Component, Object.assign({}, props, { className: css(styles$
|
|
20411
|
+
return (React.createElement(Component, Object.assign({}, props, { className: css(styles$1d.split, hasGutter && styles$1d.modifiers.gutter, isWrappable && styles$1d.modifiers.wrap, className) }), children));
|
|
20357
20412
|
};
|
|
20358
20413
|
Split.displayName = 'Split';
|
|
20359
20414
|
|
|
20360
20415
|
const SplitItem = (_a) => {
|
|
20361
20416
|
var { isFilled = false, className = '', children = null } = _a, props = __rest(_a, ["isFilled", "className", "children"]);
|
|
20362
|
-
return (React.createElement("div", Object.assign({}, props, { className: css(styles$
|
|
20417
|
+
return (React.createElement("div", Object.assign({}, props, { className: css(styles$1d.splitItem, isFilled && styles$1d.modifiers.fill, className) }), children));
|
|
20363
20418
|
};
|
|
20364
20419
|
SplitItem.displayName = 'SplitItem';
|
|
20365
20420
|
|
|
@@ -20376,18 +20431,18 @@
|
|
|
20376
20431
|
};
|
|
20377
20432
|
});
|
|
20378
20433
|
|
|
20379
|
-
var styles$
|
|
20434
|
+
var styles$1e = unwrapExports(stack);
|
|
20380
20435
|
|
|
20381
20436
|
const Stack = (_a) => {
|
|
20382
20437
|
var { hasGutter = false, className = '', children = null, component = 'div' } = _a, props = __rest(_a, ["hasGutter", "className", "children", "component"]);
|
|
20383
20438
|
const Component = component;
|
|
20384
|
-
return (React.createElement(Component, Object.assign({}, props, { className: css(styles$
|
|
20439
|
+
return (React.createElement(Component, Object.assign({}, props, { className: css(styles$1e.stack, hasGutter && styles$1e.modifiers.gutter, className) }), children));
|
|
20385
20440
|
};
|
|
20386
20441
|
Stack.displayName = 'Stack';
|
|
20387
20442
|
|
|
20388
20443
|
const StackItem = (_a) => {
|
|
20389
20444
|
var { isFilled = false, className = '', children = null } = _a, props = __rest(_a, ["isFilled", "className", "children"]);
|
|
20390
|
-
return (React.createElement("div", Object.assign({}, props, { className: css(styles$
|
|
20445
|
+
return (React.createElement("div", Object.assign({}, props, { className: css(styles$1e.stackItem, isFilled && styles$1e.modifiers.fill, className) }), children));
|
|
20391
20446
|
};
|
|
20392
20447
|
StackItem.displayName = 'StackItem';
|
|
20393
20448
|
|