@patternfly/react-core 4.172.0 → 4.174.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/CHANGELOG.md +38 -0
- package/dist/esm/components/ContextSelector/ContextSelectorItem.d.ts +3 -1
- package/dist/esm/components/ContextSelector/ContextSelectorItem.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelectorItem.js +7 -4
- package/dist/esm/components/ContextSelector/ContextSelectorItem.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +3 -1
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/Pagination/Navigation.d.ts +2 -0
- package/dist/esm/components/Pagination/Navigation.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Navigation.js +4 -4
- package/dist/esm/components/Pagination/Navigation.js.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.js +3 -3
- package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +27 -18
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js +3 -14
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelectorItem.d.ts +3 -1
- package/dist/js/components/ContextSelector/ContextSelectorItem.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelectorItem.js +7 -4
- package/dist/js/components/ContextSelector/ContextSelectorItem.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.js +3 -1
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/Pagination/Navigation.d.ts +2 -0
- package/dist/js/components/Pagination/Navigation.d.ts.map +1 -1
- package/dist/js/components/Pagination/Navigation.js +4 -4
- package/dist/js/components/Pagination/Navigation.js.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.js +3 -3
- package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +30 -21
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js +3 -14
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/umd/react-core.css +440 -90
- package/dist/umd/react-core.js +57 -51
- package/dist/umd/react-core.min.css +509 -159
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/ContextSelector/ContextSelectorItem.tsx +18 -7
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +5 -0
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelectorMenuList.test.tsx.snap +10 -0
- package/src/components/ContextSelector/examples/ContextSelector.md +80 -15
- package/src/components/Menu/MenuItem.tsx +3 -1
- package/src/components/Pagination/Navigation.tsx +11 -4
- package/src/components/Pagination/OptionsToggle.tsx +3 -3
- package/src/components/Pagination/Pagination.tsx +40 -23
- package/src/components/Pagination/PaginationOptionsMenu.tsx +4 -15
- package/src/components/Pagination/__tests__/Generated/__snapshots__/Navigation.test.tsx.snap +0 -7
- package/src/components/Pagination/__tests__/Generated/__snapshots__/OptionsToggle.test.tsx.snap +1 -1
- package/src/components/Pagination/__tests__/Generated/__snapshots__/Pagination.test.tsx.snap +3 -8
- package/src/components/Pagination/__tests__/Pagination.test.tsx +24 -0
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +187 -157
- package/src/components/Pagination/examples/Pagination.md +35 -0
- package/src/components/TextInputGroup/examples/TextInputGroup.md +4 -4
- package/src/demos/ComposableMenu.md +27 -6
- package/src/demos/DateTimePicker.md +103 -0
- package/src/demos/TextInputGroupDemo.md +278 -0
package/dist/umd/react-core.js
CHANGED
|
@@ -4477,13 +4477,14 @@
|
|
|
4477
4477
|
"menu": "pf-c-menu",
|
|
4478
4478
|
"modifiers": {
|
|
4479
4479
|
"fullHeight": "pf-m-full-height",
|
|
4480
|
+
"expanded": "pf-m-expanded",
|
|
4480
4481
|
"action": "pf-m-action",
|
|
4481
4482
|
"disabled": "pf-m-disabled",
|
|
4482
4483
|
"plain": "pf-m-plain",
|
|
4483
4484
|
"splitButton": "pf-m-split-button",
|
|
4484
|
-
"active": "pf-m-active",
|
|
4485
|
-
"expanded": "pf-m-expanded",
|
|
4486
4485
|
"primary": "pf-m-primary",
|
|
4486
|
+
"active": "pf-m-active",
|
|
4487
|
+
"secondary": "pf-m-secondary",
|
|
4487
4488
|
"top": "pf-m-top",
|
|
4488
4489
|
"alignRight": "pf-m-align-right",
|
|
4489
4490
|
"alignLeft": "pf-m-align-left",
|
|
@@ -8308,14 +8309,16 @@
|
|
|
8308
8309
|
}
|
|
8309
8310
|
render() {
|
|
8310
8311
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8311
|
-
const _a = this.props, { className, children, onClick, isDisabled, index, sendRef } = _a, props = __rest$1(_a, ["className", "children", "onClick", "isDisabled", "index", "sendRef"]);
|
|
8312
|
+
const _a = this.props, { className, children, onClick, isDisabled, index, sendRef, href } = _a, props = __rest$1(_a, ["className", "children", "onClick", "isDisabled", "index", "sendRef", "href"]);
|
|
8313
|
+
const Component = href ? 'a' : 'button';
|
|
8314
|
+
const isDisabledLink = href && isDisabled;
|
|
8312
8315
|
return (React__namespace.createElement(ContextSelectorContext.Consumer, null, ({ onSelect }) => (React__namespace.createElement("li", { role: "none" },
|
|
8313
|
-
React__namespace.createElement(
|
|
8316
|
+
React__namespace.createElement(Component, Object.assign({ className: css(_default$V.contextSelectorMenuListItem, isDisabledLink && _default$V.modifiers.disabled, className), ref: this.ref, onClick: event => {
|
|
8314
8317
|
if (!isDisabled) {
|
|
8315
8318
|
onClick(event);
|
|
8316
8319
|
onSelect(event, children);
|
|
8317
8320
|
}
|
|
8318
|
-
}, disabled: isDisabled }, props), children)))));
|
|
8321
|
+
}, disabled: isDisabled && !href, href: href }, (isDisabledLink && { 'aria-disabled': true, tabIndex: -1 }), props), children)))));
|
|
8319
8322
|
}
|
|
8320
8323
|
}
|
|
8321
8324
|
ContextSelectorItem.displayName = 'ContextSelectorItem';
|
|
@@ -8325,7 +8328,8 @@
|
|
|
8325
8328
|
isDisabled: false,
|
|
8326
8329
|
onClick: () => undefined,
|
|
8327
8330
|
index: undefined,
|
|
8328
|
-
sendRef: () => { }
|
|
8331
|
+
sendRef: () => { },
|
|
8332
|
+
href: null
|
|
8329
8333
|
};
|
|
8330
8334
|
|
|
8331
8335
|
const ContextSelectorFooter = (_a) => {
|
|
@@ -14103,6 +14107,7 @@
|
|
|
14103
14107
|
"static": "pf-m-static",
|
|
14104
14108
|
"plain": "pf-m-plain",
|
|
14105
14109
|
"scrollable": "pf-m-scrollable",
|
|
14110
|
+
"nav": "pf-m-nav",
|
|
14106
14111
|
"disabled": "pf-m-disabled",
|
|
14107
14112
|
"load": "pf-m-load",
|
|
14108
14113
|
"loading": "pf-m-loading",
|
|
@@ -14466,7 +14471,9 @@
|
|
|
14466
14471
|
if (Component === 'a') {
|
|
14467
14472
|
additionalProps = {
|
|
14468
14473
|
href: to,
|
|
14469
|
-
'aria-disabled': isDisabled ? true : null
|
|
14474
|
+
'aria-disabled': isDisabled ? true : null,
|
|
14475
|
+
// prevent invalid 'disabled' attribute on <a> tags
|
|
14476
|
+
disabled: null
|
|
14470
14477
|
};
|
|
14471
14478
|
}
|
|
14472
14479
|
else if (Component === 'button') {
|
|
@@ -14578,9 +14585,10 @@
|
|
|
14578
14585
|
"menuToggleToggleIcon": "pf-c-menu-toggle__toggle-icon",
|
|
14579
14586
|
"modifiers": {
|
|
14580
14587
|
"primary": "pf-m-primary",
|
|
14588
|
+
"secondary": "pf-m-secondary",
|
|
14589
|
+
"expanded": "pf-m-expanded",
|
|
14581
14590
|
"plain": "pf-m-plain",
|
|
14582
14591
|
"text": "pf-m-text",
|
|
14583
|
-
"expanded": "pf-m-expanded",
|
|
14584
14592
|
"fullHeight": "pf-m-full-height"
|
|
14585
14593
|
}
|
|
14586
14594
|
};
|
|
@@ -14882,9 +14890,14 @@
|
|
|
14882
14890
|
var _default$v = {
|
|
14883
14891
|
"divider": "pf-c-divider",
|
|
14884
14892
|
"menu": "pf-c-menu",
|
|
14893
|
+
"menuContent": "pf-c-menu__content",
|
|
14885
14894
|
"menuItem": "pf-c-menu__item",
|
|
14886
14895
|
"menuListItem": "pf-c-menu__list-item",
|
|
14887
14896
|
"modifiers": {
|
|
14897
|
+
"flyout": "pf-m-flyout",
|
|
14898
|
+
"top": "pf-m-top",
|
|
14899
|
+
"left": "pf-m-left",
|
|
14900
|
+
"current": "pf-m-current",
|
|
14888
14901
|
"horizontal": "pf-m-horizontal",
|
|
14889
14902
|
"tertiary": "pf-m-tertiary",
|
|
14890
14903
|
"horizontalSubnav": "pf-m-horizontal-subnav",
|
|
@@ -14893,11 +14906,8 @@
|
|
|
14893
14906
|
"overflowHidden": "pf-m-overflow-hidden",
|
|
14894
14907
|
"expandable": "pf-m-expandable",
|
|
14895
14908
|
"expanded": "pf-m-expanded",
|
|
14896
|
-
"flyout": "pf-m-flyout",
|
|
14897
|
-
"top": "pf-m-top",
|
|
14898
|
-
"left": "pf-m-left",
|
|
14899
14909
|
"drilldown": "pf-m-drilldown",
|
|
14900
|
-
"
|
|
14910
|
+
"hover": "pf-m-hover",
|
|
14901
14911
|
"start": "pf-m-start"
|
|
14902
14912
|
},
|
|
14903
14913
|
"nav": "pf-c-nav",
|
|
@@ -16220,7 +16230,7 @@
|
|
|
16220
16230
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16221
16231
|
perPage,
|
|
16222
16232
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16223
|
-
onSetPage, isDisabled, lastPage, firstPage, pagesTitle, toLastPage, toNextPage, toFirstPage, toPreviousPage, currPage, paginationTitle, ofWord, onNextClick, onPreviousClick, onFirstClick, onLastClick, onPageInput, className, isCompact } = _a, props = __rest$1(_a, ["page", "perPage", "onSetPage", "isDisabled", "lastPage", "firstPage", "pagesTitle", "toLastPage", "toNextPage", "toFirstPage", "toPreviousPage", "currPage", "paginationTitle", "ofWord", "onNextClick", "onPreviousClick", "onFirstClick", "onLastClick", "onPageInput", "className", "isCompact"]);
|
|
16233
|
+
onSetPage, isDisabled, itemCount, lastPage, firstPage, pagesTitle, toLastPage, toNextPage, toFirstPage, toPreviousPage, currPage, paginationTitle, ofWord, onNextClick, onPreviousClick, onFirstClick, onLastClick, onPageInput, className, isCompact } = _a, props = __rest$1(_a, ["page", "perPage", "onSetPage", "isDisabled", "itemCount", "lastPage", "firstPage", "pagesTitle", "toLastPage", "toNextPage", "toFirstPage", "toPreviousPage", "currPage", "paginationTitle", "ofWord", "onNextClick", "onPreviousClick", "onFirstClick", "onLastClick", "onPageInput", "className", "isCompact"]);
|
|
16224
16234
|
const { userInputPage } = this.state;
|
|
16225
16235
|
return (React__namespace.createElement("nav", Object.assign({ className: css(_default$p.paginationNav, className), "aria-label": paginationTitle }, props),
|
|
16226
16236
|
!isCompact && (React__namespace.createElement("div", { className: css(_default$p.paginationNavControl, _default$p.modifiers.first) },
|
|
@@ -16239,11 +16249,11 @@
|
|
|
16239
16249
|
}, "aria-label": toPreviousPage },
|
|
16240
16250
|
React__namespace.createElement(AngleLeftIcon$1, null))),
|
|
16241
16251
|
!isCompact && (React__namespace.createElement("div", { className: _default$p.paginationNavPageSelect },
|
|
16242
|
-
React__namespace.createElement("input", { className: css(_default$p.formControl), "aria-label": currPage, type: "number", disabled: isDisabled || (page === firstPage && page === lastPage) || page === 0, min: lastPage <= 0 && firstPage <= 0 ? 0 : 1, max: lastPage, value: userInputPage, onKeyDown: event => this.onKeyDown(event, page, lastPage, onPageInput), onChange: event => this.onChange(event, lastPage) }),
|
|
16243
|
-
React__namespace.createElement("span", { "aria-hidden": "true" },
|
|
16252
|
+
React__namespace.createElement("input", { className: css(_default$p.formControl), "aria-label": currPage, type: "number", disabled: isDisabled || (itemCount && page === firstPage && page === lastPage && itemCount >= 0) || page === 0, min: lastPage <= 0 && firstPage <= 0 ? 0 : 1, max: lastPage, value: userInputPage, onKeyDown: event => this.onKeyDown(event, page, lastPage, onPageInput), onChange: event => this.onChange(event, lastPage) }),
|
|
16253
|
+
(itemCount || itemCount === 0) && (React__namespace.createElement("span", { "aria-hidden": "true" },
|
|
16244
16254
|
ofWord,
|
|
16245
16255
|
" ",
|
|
16246
|
-
pagesTitle ? pluralize(lastPage, pagesTitle) : lastPage))),
|
|
16256
|
+
pagesTitle ? pluralize(lastPage, pagesTitle) : lastPage)))),
|
|
16247
16257
|
React__namespace.createElement("div", { className: _default$p.paginationNavControl },
|
|
16248
16258
|
React__namespace.createElement(Button, { variant: exports.ButtonVariant.plain, isDisabled: isDisabled || page === lastPage, "aria-label": toNextPage, "data-action": "next", onClick: event => {
|
|
16249
16259
|
const newPage = page + 1 <= lastPage ? page + 1 : lastPage;
|
|
@@ -16286,11 +16296,11 @@
|
|
|
16286
16296
|
let toggleId = 0;
|
|
16287
16297
|
const OptionsToggle = ({ itemsTitle = 'items', optionsToggle = 'Items per page',
|
|
16288
16298
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16289
|
-
itemsPerPageTitle = 'Items per page', ofWord = 'of', firstIndex = 0, lastIndex = 0, itemCount
|
|
16299
|
+
itemsPerPageTitle = 'Items per page', ofWord = 'of', firstIndex = 0, lastIndex = 0, itemCount, widgetId = '', showToggle = true,
|
|
16290
16300
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16291
|
-
onToggle = (_isOpen) => undefined, isOpen = false, isDisabled = false, parentRef = null, toggleTemplate: ToggleTemplate
|
|
16301
|
+
onToggle = (_isOpen) => undefined, isOpen = false, isDisabled = false, parentRef = null, toggleTemplate: ToggleTemplate, onEnter = null }) => (React__namespace.createElement("div", { className: css(_default$r.optionsMenuToggle, isDisabled && _default$r.modifiers.disabled, _default$r.modifiers.plain, _default$r.modifiers.text) }, showToggle && (React__namespace.createElement(React__namespace.Fragment, null,
|
|
16292
16302
|
React__namespace.createElement("span", { className: css(_default$r.optionsMenuToggleText) }, typeof ToggleTemplate === 'string' ? (fillTemplate(ToggleTemplate, { firstIndex, lastIndex, ofWord, itemCount, itemsTitle })) : (React__namespace.createElement(ToggleTemplate, { firstIndex: firstIndex, lastIndex: lastIndex, ofWord: ofWord, itemCount: itemCount, itemsTitle: itemsTitle }))),
|
|
16293
|
-
React__namespace.createElement(DropdownToggle, { onEnter: onEnter, "aria-label": optionsToggle, onToggle: onToggle, isDisabled: isDisabled || itemCount <= 0, isOpen: isOpen, id: `${widgetId}-toggle-${toggleId++}`, className: _default$r.optionsMenuToggleButton, parentRef: parentRef })))));
|
|
16303
|
+
React__namespace.createElement(DropdownToggle, { onEnter: onEnter, "aria-label": optionsToggle, onToggle: onToggle, isDisabled: isDisabled || (itemCount && itemCount <= 0), isOpen: isOpen, id: `${widgetId}-toggle-${toggleId++}`, className: _default$r.optionsMenuToggleButton, parentRef: parentRef })))));
|
|
16294
16304
|
OptionsToggle.displayName = 'OptionsToggle';
|
|
16295
16305
|
|
|
16296
16306
|
class PaginationOptionsMenu extends React__namespace.Component {
|
|
@@ -16349,19 +16359,7 @@
|
|
|
16349
16359
|
baseComponent: 'div',
|
|
16350
16360
|
ouiaComponentType: PaginationOptionsMenu.displayName
|
|
16351
16361
|
} },
|
|
16352
|
-
React__namespace.createElement(DropdownWithContext, { direction: dropDirection, isOpen: isOpen, toggle: React__namespace.createElement(OptionsToggle, { optionsToggle: optionsToggle, itemsPerPageTitle: itemsPerPageTitle, showToggle: perPageOptions && perPageOptions.length > 0, onToggle: this.onToggle, isOpen: isOpen, widgetId: widgetId, firstIndex: firstIndex, lastIndex: lastIndex, itemCount: itemCount, itemsTitle: itemsTitle, ofWord: ofWord, toggleTemplate: toggleTemplate
|
|
16353
|
-
? toggleTemplate
|
|
16354
|
-
: ({ firstIndex, lastIndex, itemCount, ofWord, itemsTitle }) => (React__namespace.createElement(React__namespace.Fragment, null,
|
|
16355
|
-
React__namespace.createElement("b", null,
|
|
16356
|
-
firstIndex,
|
|
16357
|
-
" - ",
|
|
16358
|
-
lastIndex),
|
|
16359
|
-
' ',
|
|
16360
|
-
ofWord,
|
|
16361
|
-
" ",
|
|
16362
|
-
React__namespace.createElement("b", null, itemCount),
|
|
16363
|
-
" ",
|
|
16364
|
-
itemsTitle)), parentRef: this.parentRef.current, isDisabled: isDisabled }), dropdownItems: this.renderItems(), isPlain: true })));
|
|
16362
|
+
React__namespace.createElement(DropdownWithContext, { direction: dropDirection, isOpen: isOpen, toggle: React__namespace.createElement(OptionsToggle, { optionsToggle: optionsToggle, itemsPerPageTitle: itemsPerPageTitle, showToggle: perPageOptions && perPageOptions.length > 0, onToggle: this.onToggle, isOpen: isOpen, widgetId: widgetId, firstIndex: firstIndex, lastIndex: lastIndex, itemCount: itemCount, itemsTitle: itemsTitle, ofWord: ofWord, toggleTemplate: toggleTemplate, parentRef: this.parentRef.current, isDisabled: isDisabled }), dropdownItems: this.renderItems(), isPlain: true })));
|
|
16365
16363
|
}
|
|
16366
16364
|
}
|
|
16367
16365
|
PaginationOptionsMenu.displayName = 'PaginationOptionsMenu';
|
|
@@ -16379,8 +16377,8 @@
|
|
|
16379
16377
|
firstIndex: 0,
|
|
16380
16378
|
lastIndex: 0,
|
|
16381
16379
|
defaultToFullPage: false,
|
|
16382
|
-
itemCount: 0,
|
|
16383
16380
|
itemsTitle: 'items',
|
|
16381
|
+
toggleTemplate: ToggleTemplate,
|
|
16384
16382
|
onPerPageSelect: () => null
|
|
16385
16383
|
};
|
|
16386
16384
|
|
|
@@ -16436,8 +16434,9 @@
|
|
|
16436
16434
|
};
|
|
16437
16435
|
}
|
|
16438
16436
|
getLastPage() {
|
|
16439
|
-
const { itemCount, perPage } = this.props;
|
|
16440
|
-
|
|
16437
|
+
const { itemCount, perPage, page } = this.props;
|
|
16438
|
+
// when itemCount is not known let's set lastPage as page+1 as we don't know the total count
|
|
16439
|
+
return itemCount || itemCount === 0 ? Math.ceil(itemCount / perPage) || 0 : page + 1;
|
|
16441
16440
|
}
|
|
16442
16441
|
componentDidMount() {
|
|
16443
16442
|
const node = this.paginationRef.current;
|
|
@@ -16456,26 +16455,34 @@
|
|
|
16456
16455
|
if (!page && offset) {
|
|
16457
16456
|
page = Math.ceil(offset / perPage);
|
|
16458
16457
|
}
|
|
16459
|
-
|
|
16460
|
-
|
|
16461
|
-
page = firstPage;
|
|
16462
|
-
}
|
|
16463
|
-
else if (page > lastPage) {
|
|
16464
|
-
page = lastPage;
|
|
16458
|
+
if (page === 0 && !itemCount) {
|
|
16459
|
+
page = 1;
|
|
16465
16460
|
}
|
|
16466
|
-
const
|
|
16467
|
-
let
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16461
|
+
const lastPage = this.getLastPage();
|
|
16462
|
+
let firstIndex = (page - 1) * perPage + 1;
|
|
16463
|
+
let lastIndex = page * perPage;
|
|
16464
|
+
if (itemCount || itemCount === 0) {
|
|
16465
|
+
firstIndex = itemCount <= 0 ? 0 : (page - 1) * perPage + 1;
|
|
16466
|
+
if (page < firstPage && itemCount > 0) {
|
|
16467
|
+
page = firstPage;
|
|
16468
|
+
}
|
|
16469
|
+
else if (page > lastPage) {
|
|
16470
|
+
page = lastPage;
|
|
16471
|
+
}
|
|
16472
|
+
if (itemCount >= 0) {
|
|
16473
|
+
lastIndex = page === lastPage || itemCount === 0 ? itemCount : page * perPage;
|
|
16474
|
+
}
|
|
16473
16475
|
}
|
|
16476
|
+
const toggleTemplateProps = { firstIndex, lastIndex, itemCount, itemsTitle: titles.items, ofWord: titles.ofWord };
|
|
16474
16477
|
return (React__namespace.createElement("div", Object.assign({ ref: this.paginationRef, className: css(_default$p.pagination, variant === exports.PaginationVariant.bottom && _default$p.modifiers.bottom, isCompact && _default$p.modifiers.compact, isStatic && _default$p.modifiers.static, isSticky && _default$p.modifiers.sticky, className), id: `${widgetId}-${paginationId++}` }, getOUIAProps(Pagination.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe), props),
|
|
16475
16478
|
variant === exports.PaginationVariant.top && (React__namespace.createElement("div", { className: css(_default$p.paginationTotalItems) },
|
|
16476
|
-
|
|
16479
|
+
toggleTemplate && typeof toggleTemplate === 'string' && fillTemplate(toggleTemplate, toggleTemplateProps),
|
|
16480
|
+
toggleTemplate &&
|
|
16481
|
+
typeof toggleTemplate !== 'string' &&
|
|
16482
|
+
toggleTemplate(toggleTemplateProps),
|
|
16483
|
+
!toggleTemplate && (React__namespace.createElement(ToggleTemplate, { firstIndex: firstIndex, lastIndex: lastIndex, itemCount: itemCount, itemsTitle: titles.items, ofWord: titles.ofWord })))),
|
|
16477
16484
|
React__namespace.createElement(PaginationOptionsMenu, { itemsPerPageTitle: titles.itemsPerPage, perPageSuffix: titles.perPageSuffix, itemsTitle: isCompact ? '' : titles.items, optionsToggle: titles.optionsToggle, perPageOptions: perPageOptions, firstIndex: itemsStart !== null ? itemsStart : firstIndex, lastIndex: itemsEnd !== null ? itemsEnd : lastIndex, ofWord: titles.ofWord, defaultToFullPage: defaultToFullPage, itemCount: itemCount, page: page, perPage: perPage, lastPage: lastPage, onPerPageSelect: onPerPageSelect, dropDirection: dropDirection, widgetId: widgetId, toggleTemplate: toggleTemplate, isDisabled: isDisabled }),
|
|
16478
|
-
React__namespace.createElement(Navigation, { pagesTitle: titles.page, toLastPage: titles.toLastPage, toPreviousPage: titles.toPreviousPage, toNextPage: titles.toNextPage, toFirstPage: titles.toFirstPage, currPage: titles.currPage, paginationTitle: titles.paginationTitle, ofWord: titles.ofWord, page: itemCount <= 0 ? 0 : page, perPage: perPage, firstPage: itemsStart !== null ? itemsStart : 1, lastPage: lastPage, onSetPage: onSetPage, onFirstClick: onFirstClick, onPreviousClick: onPreviousClick, onNextClick: onNextClick, onLastClick: onLastClick, onPageInput: onPageInput, isDisabled: isDisabled, isCompact: isCompact }),
|
|
16485
|
+
React__namespace.createElement(Navigation, { pagesTitle: titles.page, toLastPage: titles.toLastPage, toPreviousPage: titles.toPreviousPage, toNextPage: titles.toNextPage, toFirstPage: titles.toFirstPage, currPage: titles.currPage, paginationTitle: titles.paginationTitle, ofWord: titles.ofWord, page: itemCount && itemCount <= 0 ? 0 : page, perPage: perPage, itemCount: itemCount, firstPage: itemsStart !== null ? itemsStart : 1, lastPage: lastPage, onSetPage: onSetPage, onFirstClick: onFirstClick, onPreviousClick: onPreviousClick, onNextClick: onNextClick, onLastClick: onLastClick, onPageInput: onPageInput, isDisabled: isDisabled, isCompact: isCompact }),
|
|
16479
16486
|
children));
|
|
16480
16487
|
}
|
|
16481
16488
|
}
|
|
@@ -16510,7 +16517,6 @@
|
|
|
16510
16517
|
itemsEnd: null,
|
|
16511
16518
|
perPageOptions: defaultPerPageOptions,
|
|
16512
16519
|
widgetId: 'pagination-options-menu',
|
|
16513
|
-
toggleTemplate: ToggleTemplate,
|
|
16514
16520
|
onSetPage: () => undefined,
|
|
16515
16521
|
onPerPageSelect: () => undefined,
|
|
16516
16522
|
onFirstClick: () => undefined,
|