widenarrow-ui 1.0.49 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Pagination/Pagination.types.d.ts +2 -4
- package/lib/index.d.ts +3 -8
- package/lib/index.esm.js +7 -5
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +7 -5
- package/lib/index.js.map +1 -1
- package/lib/types/common.types.d.ts +1 -4
- package/package.json +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +2 -2
- package/src/components/Pagination/Pagination.tsx +4 -4
- package/src/components/Pagination/Pagination.types.ts +2 -2
- package/src/components/Typography/Typography.tsx +4 -0
- package/src/types/common.types.ts +1 -4
|
@@ -6,7 +6,7 @@ export interface PaginationProps {
|
|
|
6
6
|
slim?: boolean;
|
|
7
7
|
withPageSizeChange?: boolean;
|
|
8
8
|
withTablePagination?: boolean;
|
|
9
|
-
withFastForwardButtons
|
|
9
|
+
withFastForwardButtons?: boolean;
|
|
10
10
|
pageSizeOptions?: Array<number>;
|
|
11
11
|
buttonType?: HierarchyTypes.PRIMARY | HierarchyTypes.SECONDARY;
|
|
12
12
|
className?: string;
|
|
@@ -14,9 +14,7 @@ export interface PaginationProps {
|
|
|
14
14
|
previousPageTitle?: string;
|
|
15
15
|
firstPageTitle?: string;
|
|
16
16
|
lastPageTitle?: string;
|
|
17
|
-
|
|
18
|
-
pageSize: number;
|
|
19
|
-
}) => string;
|
|
17
|
+
pageSizeTitle?: string;
|
|
20
18
|
tableIntervalTitleCallback?: (args: {
|
|
21
19
|
start: number;
|
|
22
20
|
end: number;
|
package/lib/index.d.ts
CHANGED
|
@@ -497,15 +497,12 @@ declare const FacetButton: FC<FacetButtonProps>;
|
|
|
497
497
|
interface SearchResultInterface {
|
|
498
498
|
currentPage: number;
|
|
499
499
|
numberOfPages: number;
|
|
500
|
+
pages: number;
|
|
500
501
|
pageSize: number;
|
|
501
502
|
numberOfHits: number;
|
|
502
503
|
sortOrder: number;
|
|
503
504
|
fetching?: boolean;
|
|
504
|
-
pages: number;
|
|
505
|
-
fetched?: boolean;
|
|
506
505
|
searchTerm?: string;
|
|
507
|
-
ids?: Array<number>;
|
|
508
|
-
pending?: boolean;
|
|
509
506
|
}
|
|
510
507
|
|
|
511
508
|
interface PaginationProps {
|
|
@@ -514,7 +511,7 @@ interface PaginationProps {
|
|
|
514
511
|
slim?: boolean;
|
|
515
512
|
withPageSizeChange?: boolean;
|
|
516
513
|
withTablePagination?: boolean;
|
|
517
|
-
withFastForwardButtons
|
|
514
|
+
withFastForwardButtons?: boolean;
|
|
518
515
|
pageSizeOptions?: Array<number>;
|
|
519
516
|
buttonType?: HierarchyTypes$1.PRIMARY | HierarchyTypes$1.SECONDARY;
|
|
520
517
|
className?: string;
|
|
@@ -522,9 +519,7 @@ interface PaginationProps {
|
|
|
522
519
|
previousPageTitle?: string;
|
|
523
520
|
firstPageTitle?: string;
|
|
524
521
|
lastPageTitle?: string;
|
|
525
|
-
|
|
526
|
-
pageSize: number;
|
|
527
|
-
}) => string;
|
|
522
|
+
pageSizeTitle?: string;
|
|
528
523
|
tableIntervalTitleCallback?: (args: {
|
|
529
524
|
start: number;
|
|
530
525
|
end: number;
|
package/lib/index.esm.js
CHANGED
|
@@ -2001,15 +2001,17 @@ var s$n = classNames.bind(styles$n);
|
|
|
2001
2001
|
*/
|
|
2002
2002
|
var mergeClassNames = function (_a) {
|
|
2003
2003
|
var _b;
|
|
2004
|
-
var mainClassName = _a.mainClassName, withEllipsis = _a.withEllipsis, className = _a.className, textAlign = _a.textAlign, marginX = _a.marginX, marginTop = _a.marginTop, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, marginRight = _a.marginRight, paddingX = _a.paddingX, paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom, withNoWordBreak = _a.withNoWordBreak, withWordBreak = _a.withWordBreak, withAnimation = _a.withAnimation, withBorderBottom = _a.withBorderBottom, color = _a.color, disabled = _a.disabled, fontWeight = _a.fontWeight, fontSize = _a.fontSize, fontStyle = _a.fontStyle, meta = _a.meta, error = _a.error;
|
|
2004
|
+
var mainClassName = _a.mainClassName, withEllipsis = _a.withEllipsis, className = _a.className, textAlign = _a.textAlign, margin = _a.margin, marginX = _a.marginX, marginTop = _a.marginTop, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, marginRight = _a.marginRight, padding = _a.padding, paddingX = _a.paddingX, paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom, withNoWordBreak = _a.withNoWordBreak, withWordBreak = _a.withWordBreak, withAnimation = _a.withAnimation, withBorderBottom = _a.withBorderBottom, color = _a.color, disabled = _a.disabled, fontWeight = _a.fontWeight, fontSize = _a.fontSize, fontStyle = _a.fontStyle, meta = _a.meta, error = _a.error;
|
|
2005
2005
|
return s$n((_b = {},
|
|
2006
2006
|
_b[mainClassName] = mainClassName,
|
|
2007
2007
|
_b[className] = className,
|
|
2008
|
+
_b["margin_".concat(margin)] = is(String, margin),
|
|
2008
2009
|
_b["marginX_".concat(marginX)] = is(String, marginX),
|
|
2009
2010
|
_b["marginTop_".concat(marginTop)] = is(String, marginTop),
|
|
2010
2011
|
_b["marginBottom_".concat(marginBottom)] = is(String, marginBottom),
|
|
2011
2012
|
_b["marginRight_".concat(marginRight)] = is(String, marginRight),
|
|
2012
2013
|
_b["marginLeft_".concat(marginLeft)] = is(String, marginLeft),
|
|
2014
|
+
_b["padding_".concat(padding)] = is(String, padding),
|
|
2013
2015
|
_b["paddingX_".concat(paddingX)] = is(String, paddingX),
|
|
2014
2016
|
_b["paddingTop_".concat(paddingTop)] = is(String, paddingTop),
|
|
2015
2017
|
_b["paddingBottom_".concat(paddingBottom)] = is(String, paddingBottom),
|
|
@@ -2608,7 +2610,7 @@ var styles$b = {"body":"Pagination-module_WRLv5h","container":"Pagination-module
|
|
|
2608
2610
|
var s$b = classNames.bind(styles$b);
|
|
2609
2611
|
var Pagination = function (_a) {
|
|
2610
2612
|
var _b;
|
|
2611
|
-
var className = _a.className, pagination = _a.pagination, slim = _a.slim, onChange = _a.onChange, _c = _a.buttonType, buttonType = _c === void 0 ? HierarchyTypes.SECONDARY : _c, _d = _a.pageSizeOptions, pageSizeOptions = _d === void 0 ? [10, 20, 30, 40, 50, 80, 100] : _d, firstPageTitle = _a.firstPageTitle, previousPageTitle = _a.previousPageTitle, nextPageTitle = _a.nextPageTitle, lastPageTitle = _a.lastPageTitle,
|
|
2613
|
+
var className = _a.className, pagination = _a.pagination, slim = _a.slim, onChange = _a.onChange, _c = _a.buttonType, buttonType = _c === void 0 ? HierarchyTypes.SECONDARY : _c, _d = _a.pageSizeOptions, pageSizeOptions = _d === void 0 ? [10, 20, 30, 40, 50, 80, 100] : _d, firstPageTitle = _a.firstPageTitle, previousPageTitle = _a.previousPageTitle, nextPageTitle = _a.nextPageTitle, lastPageTitle = _a.lastPageTitle, pageSizeTitle = _a.pageSizeTitle, tableIntervalTitleCallback = _a.tableIntervalTitleCallback, withTablePagination = _a.withTablePagination, withFastForwardButtons = _a.withFastForwardButtons, withPageSizeChange = _a.withPageSizeChange;
|
|
2612
2614
|
if (!pagination) {
|
|
2613
2615
|
return null;
|
|
2614
2616
|
}
|
|
@@ -2644,7 +2646,7 @@ var Pagination = function (_a) {
|
|
|
2644
2646
|
onChange(__assign(__assign({}, pagination), { currentPage: pagination.currentPage + 1 }));
|
|
2645
2647
|
}, disabled: isLastPage, children: jsx(Icon, { icon: IconTypes.CHEVRON_RIGHT }) }) }));
|
|
2646
2648
|
var lastPageButton = withFastForwardButtons ? (jsx("li", { children: jsx("button", { title: lastPageTitle || 'Last page', className: buttonClassName(isLastPage ? 'button_disabled' : undefined), onClick: function () {
|
|
2647
|
-
onChange(__assign(__assign({}, pagination), { currentPage:
|
|
2649
|
+
onChange(__assign(__assign({}, pagination), { currentPage: numberOfPages }));
|
|
2648
2650
|
}, disabled: isLastPage, children: jsx(Icon, { icon: IconTypes.ARROW_LAST_PAGE }) }) })) : null;
|
|
2649
2651
|
/*
|
|
2650
2652
|
paginationMarkup
|
|
@@ -2663,10 +2665,10 @@ var Pagination = function (_a) {
|
|
|
2663
2665
|
}, children: pageObject.page }) }, "".concat(pageObject.type, "-").concat(index)));
|
|
2664
2666
|
}), nextPageButton, lastPageButton] }));
|
|
2665
2667
|
};
|
|
2666
|
-
var sizeTitle =
|
|
2668
|
+
var sizeTitle = pageSizeTitle ? pageSizeTitle : "Page size: ".concat(pagination.pageSize);
|
|
2667
2669
|
var pageSizeMarkup = function () {
|
|
2668
2670
|
return withPageSizeChange ? (jsxs(Fragment, { children: [jsx(Separator, { marginX: '15' }), jsx(DropDown, { buttonComponent: jsx(InlineButton, { type: buttonType, text: sizeTitle }), title: sizeTitle, children: pageSizeOptions
|
|
2669
|
-
.filter(
|
|
2671
|
+
// .filter((pageSize) => pageSize < pagination.numberOfHits)
|
|
2670
2672
|
.map(function (pageSize) { return (jsx(DropDownItem, { text: pageSize.toString(), onClickCallback: function () { return onChange(__assign(__assign({}, pagination), { pageSize: pageSize })); }, active: pagination.pageSize === pageSize, closeDropDownOnClick: true, withEllipsis: true })); }) })] })) : null;
|
|
2671
2673
|
};
|
|
2672
2674
|
return (jsxs(Box, { alignItems: 'center', children: [paginationMarkup(), pageSizeMarkup()] }));
|