@porsche-design-system/components-react 3.1.0-rc.2 → 3.2.0-rc.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.
Files changed (25) hide show
  1. package/CHANGELOG.md +45 -6
  2. package/esm/lib/components/carousel.wrapper.js +3 -3
  3. package/esm/lib/components/pagination.wrapper.js +3 -3
  4. package/lib/components/carousel.wrapper.d.ts +8 -0
  5. package/lib/components/carousel.wrapper.js +3 -3
  6. package/lib/components/pagination.wrapper.d.ts +10 -2
  7. package/lib/components/pagination.wrapper.js +3 -3
  8. package/lib/types.d.ts +199 -199
  9. package/package.json +2 -2
  10. package/ssr/components/dist/styles/esm/styles-entry.js +79 -37
  11. package/ssr/components/dist/utils/esm/utils-entry.js +55 -89
  12. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.js +4 -4
  13. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/pagination.wrapper.js +4 -4
  14. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +5 -4
  15. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.js +7 -6
  16. package/ssr/esm/components/dist/styles/esm/styles-entry.js +79 -37
  17. package/ssr/esm/components/dist/utils/esm/utils-entry.js +55 -89
  18. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.js +4 -4
  19. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/pagination.wrapper.js +4 -4
  20. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +5 -4
  21. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.js +8 -7
  22. package/ssr/lib/components/carousel.wrapper.d.ts +8 -0
  23. package/ssr/lib/components/pagination.wrapper.d.ts +10 -2
  24. package/ssr/lib/dsr-components/pagination.d.ts +0 -1
  25. package/ssr/lib/types.d.ts +199 -199
@@ -156,14 +156,17 @@ const hasVisibleIcon = (iconName, iconSource) => {
156
156
  };
157
157
 
158
158
  const childrenMutationMap = new Map();
159
- const getObservedNode = (mutatedNode) => childrenMutationMap.has(mutatedNode) ? mutatedNode : getObservedNode(mutatedNode.parentNode);
160
159
  hasWindow &&
161
160
  new MutationObserver((mutations) => {
162
- mutations
163
- // remove duplicates so we execute callback only once per node
164
- .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
165
- .map((mutation) => getObservedNode(mutation.target)) // recursively find root node that is initially observed
166
- .forEach((node) => childrenMutationMap.get(node)());
161
+ // there may be race conditions in jsdom-polyfill tests where the map is already empty when a mutation happens
162
+ if (childrenMutationMap.size) {
163
+ const mapKeys = Array.from(childrenMutationMap.keys());
164
+ mutations
165
+ // remove duplicates so we execute callback only once per node
166
+ .filter((mutation, idx, arr) => arr.findIndex((m) => m.target === mutation.target) === idx)
167
+ // find node in map that contains the mutated element to find and invoke its callback
168
+ .forEach((mutation) => { var _a; return (_a = childrenMutationMap.get(mapKeys.find((node) => node.contains(mutation.target)))) === null || _a === void 0 ? void 0 : _a(); });
169
+ }
167
170
  });
168
171
 
169
172
  const isTouchDevice = () => {
@@ -2757,7 +2760,7 @@ function convertCase(style) {
2757
2760
  */
2758
2761
 
2759
2762
 
2760
- function camelCase$1() {
2763
+ function camelCase() {
2761
2764
  function onProcessStyle(style) {
2762
2765
  if (Array.isArray(style)) {
2763
2766
  // Handle rules like @font-face, which can have multiple styles in an array
@@ -3627,7 +3630,7 @@ createJss({
3627
3630
  plugins: [
3628
3631
  jssGlobal(),
3629
3632
  jssNested(),
3630
- camelCase$1(),
3633
+ camelCase(),
3631
3634
  jssPluginSortMediaQueries({ combineMediaQueries: true }),
3632
3635
  ],
3633
3636
  });
@@ -3681,7 +3684,11 @@ const getButtonAriaAttributes = (isDisabled, isLoading, aria) => {
3681
3684
  };
3682
3685
  getMediaQueryMin('s');
3683
3686
  getMediaQueryMin('xxl');
3684
- typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert');
3687
+ // Infinite bullets will be shown if the total number of bullets is greater than this value
3688
+ const INFINITE_BULLET_THRESHOLD = 5;
3689
+ const isInfinitePagination = (amountOfPages) => {
3690
+ return amountOfPages > INFINITE_BULLET_THRESHOLD;
3691
+ };
3685
3692
 
3686
3693
  const CDN_BASE_URL$3 = (typeof window !== 'undefined' && window.PORSCHE_DESIGN_SYSTEM_CDN === 'cn' ? 'https://cdn.ui.porsche.cn' : 'https://cdn.ui.porsche.com') + '/porsche-design-system/crest';
3687
3694
  const CRESTS_MANIFEST = { "porscheCrest": { "1x": { "png": "porsche-crest.min.d76137cf8cf94822b7aedb534ba88418@1x.png", "webp": "porsche-crest.min.0d0cc89ae5ee57c4c15bd0dbbcbfe5d0@1x.webp" }, "2x": { "png": "porsche-crest.min.8a292fbd35a5155789ddd011585e05c4@2x.png", "webp": "porsche-crest.min.2245c45e99be5a46b4b56e73c43d5c63@2x.webp" }, "3x": { "png": "porsche-crest.min.18d6f02003b0829bac939fade88fd4e6@3x.png", "webp": "porsche-crest.min.19b429278b158b5cb5aa6ce80751e3fe@3x.webp" } } };
@@ -3810,38 +3817,21 @@ const getSvgUrl = (model) => {
3810
3817
  return `${cdnBaseUrl}/${MODEL_SIGNATURES_MANIFEST[model]}`;
3811
3818
  };
3812
3819
  const modelSignatureHeight = 36;
3813
- // TODO: create enum
3814
- const itemTypes = {
3815
- PAGE: 'PAGE',
3816
- ELLIPSIS: 'ELLIPSIS',
3817
- PREVIOUS_PAGE_LINK: 'PREVIOUS_PAGE_LINK',
3818
- NEXT_PAGE_LINK: 'NEXT_PAGE_LINK',
3819
- };
3820
- // TODO: unused?
3821
- const itemKeys = {
3822
- FIRST_ELLIPSIS: -1,
3823
- SECOND_ELLIPSIS: -2,
3824
- PREVIOUS_PAGE_LINK: -4,
3825
- NEXT_PAGE_LINK: -5,
3826
- };
3827
- // TODO: merge factories
3828
- const createFirstEllipsis = (pageNumber) => ({
3829
- type: itemTypes.ELLIPSIS,
3830
- key: itemKeys.FIRST_ELLIPSIS,
3831
- value: pageNumber,
3832
- isActive: false,
3833
- });
3834
- const createSecondEllipsis = (pageNumber) => ({
3835
- type: itemTypes.ELLIPSIS,
3836
- key: itemKeys.SECOND_ELLIPSIS,
3837
- value: pageNumber,
3820
+ var ItemType;
3821
+ (function (ItemType) {
3822
+ ItemType[ItemType["PAGE"] = 0] = "PAGE";
3823
+ ItemType[ItemType["ELLIPSIS"] = 1] = "ELLIPSIS";
3824
+ ItemType[ItemType["PREVIOUS"] = 2] = "PREVIOUS";
3825
+ ItemType[ItemType["NEXT"] = 3] = "NEXT";
3826
+ })(ItemType || (ItemType = {}));
3827
+ const ellipsisItem = {
3828
+ type: ItemType.ELLIPSIS,
3838
3829
  isActive: false,
3839
- });
3830
+ };
3840
3831
  const createPreviousPageLink = (options) => {
3841
3832
  const { activePage } = options;
3842
3833
  return {
3843
- type: itemTypes.PREVIOUS_PAGE_LINK,
3844
- key: itemKeys.PREVIOUS_PAGE_LINK,
3834
+ type: ItemType.PREVIOUS,
3845
3835
  value: Math.max(1, activePage - 1),
3846
3836
  isActive: activePage > 1,
3847
3837
  };
@@ -3849,78 +3839,58 @@ const createPreviousPageLink = (options) => {
3849
3839
  const createNextPageLink = (options) => {
3850
3840
  const { activePage, pageTotal } = options;
3851
3841
  return {
3852
- type: itemTypes.NEXT_PAGE_LINK,
3853
- key: itemKeys.NEXT_PAGE_LINK,
3842
+ type: ItemType.NEXT,
3854
3843
  value: Math.min(pageTotal, activePage + 1),
3855
3844
  isActive: activePage < pageTotal,
3856
3845
  };
3857
3846
  };
3858
3847
  const createPageFunctionFactory = (options) => {
3859
- const { activePage } = options;
3860
3848
  return (pageNumber) => ({
3861
- type: itemTypes.PAGE,
3862
- key: pageNumber,
3849
+ type: ItemType.PAGE,
3863
3850
  value: pageNumber,
3864
- isActive: pageNumber === activePage,
3851
+ isActive: pageNumber === options.activePage,
3865
3852
  });
3866
3853
  };
3867
3854
  const createRange = (start, end) => Array.from(Array(end - start + 1)).map((_, i) => i + start);
3868
3855
  const createPaginationModel = (options) => {
3869
- // exception tests
3870
- if (options == null) {
3871
- throw new Error('createPaginationModel(): options object should be a passed');
3872
- }
3873
- const { pageTotal, activePage, pageRange } = options;
3856
+ const { pageTotal, activePage, pageRange, showLastPage } = options;
3874
3857
  const boundaryPagesRange = 1;
3875
3858
  const ellipsisSize = 1;
3876
- const paginationModel = [];
3859
+ const paginationModel = [createPreviousPageLink(options)];
3877
3860
  const createPage = createPageFunctionFactory(options);
3878
- paginationModel.push(createPreviousPageLink(options));
3879
3861
  // Simplify generation of pages if number of available items is equal or greater than total pages to show
3880
3862
  if (1 + 2 * ellipsisSize + 2 * pageRange + 2 * boundaryPagesRange >= pageTotal) {
3881
3863
  const allPages = createRange(1, pageTotal).map(createPage);
3882
3864
  paginationModel.push(...allPages);
3883
3865
  }
3884
3866
  else {
3885
- // Calculate group of first pages
3886
- const firstPagesStart = 1;
3887
- const firstPagesEnd = boundaryPagesRange;
3888
- const firstPages = createRange(firstPagesStart, firstPagesEnd).map(createPage);
3889
- // Calculate group of last pages
3890
- const lastPagesStart = pageTotal + 1 - boundaryPagesRange;
3891
- const lastPagesEnd = pageTotal;
3892
- const lastPages = createRange(lastPagesStart, lastPagesEnd).map(createPage);
3893
- // Calculate group of main pages
3894
- const mainPagesStart = Math.min(Math.max(activePage - pageRange, firstPagesEnd + ellipsisSize + 1), lastPagesStart - ellipsisSize - 2 * pageRange - 1);
3895
- const mainPagesEnd = mainPagesStart + 2 * pageRange;
3896
- const mainPages = createRange(mainPagesStart, mainPagesEnd).map(createPage);
3897
- // Add group of first pages
3898
- paginationModel.push(...firstPages);
3899
- // Calculate and add ellipsis before group of main pages
3900
- const firstEllipsisPageNumber = mainPagesStart - 1;
3901
- const showPageInsteadOfFirstEllipsis = firstEllipsisPageNumber === firstPagesEnd + 1;
3902
- const createFirstEllipsisOrPage = showPageInsteadOfFirstEllipsis ? createPage : createFirstEllipsis;
3903
- const firstEllipsis = createFirstEllipsisOrPage(firstEllipsisPageNumber);
3904
- paginationModel.push(firstEllipsis);
3905
- // Add group of main pages
3906
- paginationModel.push(...mainPages);
3907
- // Calculate and add ellipsis after group of main pages
3908
- const secondEllipsisPageNumber = mainPagesEnd + 1;
3909
- const showPageInsteadOfSecondEllipsis = secondEllipsisPageNumber === lastPagesStart - 1;
3910
- const createSecondEllipsisOrPage = showPageInsteadOfSecondEllipsis ? createPage : createSecondEllipsis;
3911
- const secondEllipsis = createSecondEllipsisOrPage(secondEllipsisPageNumber);
3912
- paginationModel.push(secondEllipsis);
3913
- // Add group of last pages
3914
- paginationModel.push(...lastPages);
3867
+ // Add first page
3868
+ paginationModel.push(createPage(1));
3869
+ // Calculate group of middle pages
3870
+ const middlePagesStart = Math.min(Math.max(activePage - pageRange, 2 + ellipsisSize), pageTotal - ellipsisSize - 2 * pageRange - (showLastPage ? 1 : 0));
3871
+ const middlePagesEnd = middlePagesStart + 2 * pageRange;
3872
+ const middlePages = createRange(middlePagesStart, middlePagesEnd).map(createPage);
3873
+ // Calculate and add ellipsis before group of middle pages
3874
+ const firstEllipsisPageNumber = middlePagesStart - 1;
3875
+ const showPageInsteadOfFirstEllipsis = firstEllipsisPageNumber === 2;
3876
+ const firstEllipsisOrPage = showPageInsteadOfFirstEllipsis ? createPage(firstEllipsisPageNumber) : ellipsisItem;
3877
+ paginationModel.push(firstEllipsisOrPage);
3878
+ // Add group of middle pages
3879
+ paginationModel.push(...middlePages);
3880
+ // Calculate and add ellipsis after group of middle pages
3881
+ const lastEllipsisPageNumber = middlePagesEnd + 1;
3882
+ const showPageInsteadOfLastEllipsis = lastEllipsisPageNumber === pageTotal - (showLastPage ? 1 : 0);
3883
+ const lastEllipsisOrPage = showPageInsteadOfLastEllipsis ? createPage(lastEllipsisPageNumber) : ellipsisItem;
3884
+ paginationModel.push(lastEllipsisOrPage);
3885
+ // Add last page
3886
+ if (showLastPage) {
3887
+ paginationModel.push(createPage(pageTotal));
3888
+ }
3915
3889
  }
3916
3890
  paginationModel.push(createNextPageLink(options));
3917
3891
  return paginationModel;
3918
3892
  };
3919
3893
  const getCurrentActivePage = (activePage, totalPages) => {
3920
- // exception tests
3921
- if (activePage === undefined || totalPages === undefined) {
3922
- throw new Error('getCurrentActivePage(): activePage and totalPages props must be provided');
3923
- }
3924
3894
  // Obviously we can't be on a negative or 0 page.
3925
3895
  if (activePage < 1) {
3926
3896
  activePage = 1;
@@ -3932,10 +3902,6 @@ const getCurrentActivePage = (activePage, totalPages) => {
3932
3902
  return activePage;
3933
3903
  };
3934
3904
  const getTotalPages = (totalItemsCount, itemsPerPage) => {
3935
- // exception test
3936
- if (totalItemsCount === undefined || itemsPerPage === undefined) {
3937
- throw new Error('getTotalPages(): totalItemsCount and itemsPerPage props must be provided');
3938
- }
3939
3905
  if (totalItemsCount < 1) {
3940
3906
  totalItemsCount = 1;
3941
3907
  }
@@ -4086,4 +4052,4 @@ const getTextTagType = (host, tag) => {
4086
4052
  }
4087
4053
  };
4088
4054
 
4089
- export { DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, TEXT_TAGS, _hasShowPickerSupport, attributeMutationMap, buildCrestSrcSet, buildIconUrl, buildSrcSet, cdnBaseUrl, childrenMutationMap, createPaginationModel, createRange, crestCdnBaseUrl, crestInnerManifest, crestSize, displaySizeToTagMap, getButtonAriaAttributes, getButtonAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getClosestHTMLElement, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFilterInputAriaAttributes, getHTMLElement, getHeadingTagType, getHeadlineTagType, getHighlightedOptionMapIndex, getIconColor, getInlineNotificationIconName, getInnerManifest, getLinkButtonThemeForIcon, getRole, getSelectWrapperDropdownButtonAriaAttributes, getSelectedOptionMap, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTextTagType, getThemeForIcon, getTotalPages, hasDocument, hasLocateAction, hasSpecificSlottedTag, hasVisibleIcon, hasWindow, isCustomDropdown, isDisabledOrLoading, isHighContrastMode, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isThemeDark, isTouchDevice, isType, isUrl, isWithinForm, itemTypes, modelSignatureHeight, parseAndGetAriaAttributes, parseJSONAttribute, resizeMap, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, tempDiv, tempIcon, tempLabel };
4055
+ export { DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, ItemType, TEXT_TAGS, _hasShowPickerSupport, attributeMutationMap, buildCrestSrcSet, buildIconUrl, buildSrcSet, cdnBaseUrl, childrenMutationMap, createPaginationModel, createRange, crestCdnBaseUrl, crestInnerManifest, crestSize, displaySizeToTagMap, getButtonAriaAttributes, getButtonAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getClosestHTMLElement, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFilterInputAriaAttributes, getHTMLElement, getHeadingTagType, getHeadlineTagType, getHighlightedOptionMapIndex, getIconColor, getInlineNotificationIconName, getInnerManifest, getLinkButtonThemeForIcon, getRole, getSelectWrapperDropdownButtonAriaAttributes, getSelectedOptionMap, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTextTagType, getThemeForIcon, getTotalPages, hasDocument, hasLocateAction, hasSpecificSlottedTag, hasVisibleIcon, hasWindow, isCustomDropdown, isDisabledOrLoading, isHighContrastMode, isInfinitePagination, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isThemeDark, isTouchDevice, isType, isUrl, isWithinForm, modelSignatureHeight, parseAndGetAriaAttributes, parseJSONAttribute, resizeMap, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, tempDiv, tempIcon, tempLabel };
@@ -4,15 +4,15 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
4
4
  import { syncRef } from '../../utils.js';
5
5
  import { DSRCarousel } from '../dsr-components/carousel.js';
6
6
 
7
- const PCarousel = forwardRef(({ activeSlideIndex = 0, alignHeader = 'left', description, disablePagination, heading, intl, onCarouselChange, onUpdate, pagination = true, rewind = true, slidesPerPage = 1, theme = 'light', width = 'basic', wrapContent, className, children, ...rest }, ref) => {
7
+ const PCarousel = forwardRef(({ activeSlideIndex = 0, alignHeader = 'left', description, disablePagination, heading, intl, onCarouselChange, onUpdate, pagination = true, rewind = true, skipLinkTarget, slidesPerPage = 1, theme = 'light', width = 'basic', wrapContent, className, children, ...rest }, ref) => {
8
8
  const elementRef = useRef();
9
9
  useEventCallback(elementRef, 'carouselChange', onCarouselChange);
10
10
  useEventCallback(elementRef, 'update', onUpdate);
11
11
  const WebComponentTag = usePrefix('p-carousel');
12
- const propsToSync = [activeSlideIndex, alignHeader, description, disablePagination, heading, intl, pagination, rewind, slidesPerPage, theme, width, wrapContent];
12
+ const propsToSync = [activeSlideIndex, alignHeader, description, disablePagination, heading, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme, width, wrapContent];
13
13
  useBrowserLayoutEffect(() => {
14
14
  const { current } = elementRef;
15
- ['activeSlideIndex', 'alignHeader', 'description', 'disablePagination', 'heading', 'intl', 'pagination', 'rewind', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
15
+ ['activeSlideIndex', 'alignHeader', 'description', 'disablePagination', 'heading', 'intl', 'pagination', 'rewind', 'skipLinkTarget', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
16
  }, propsToSync);
17
17
  // @ts-ignore
18
18
  if (!process.browser) {
@@ -23,7 +23,7 @@ const PCarousel = forwardRef(({ activeSlideIndex = 0, alignHeader = 'left', desc
23
23
  // @ts-ignore
24
24
  ...(!process.browser
25
25
  ? {
26
- children: (jsx(DSRCarousel, { ...{ activeSlideIndex, alignHeader, description, disablePagination, heading, intl, pagination, rewind, slidesPerPage, theme, width, wrapContent, children } })),
26
+ children: (jsx(DSRCarousel, { ...{ activeSlideIndex, alignHeader, description, disablePagination, heading, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme, width, wrapContent, children } })),
27
27
  }
28
28
  : {
29
29
  children,
@@ -4,15 +4,15 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
4
4
  import { syncRef } from '../../utils.js';
5
5
  import { DSRPagination } from '../dsr-components/pagination.js';
6
6
 
7
- const PPagination = forwardRef(({ activePage = 1, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl = { root: 'Pagination', prev: 'Previous page', next: 'Next page', page: 'Page', }, itemsPerPage = 1, maxNumberOfPageLinks = { base: 5, xs: 7, }, onPageChange, onUpdate, theme = 'light', totalItemsCount = 1, className, ...rest }, ref) => {
7
+ const PPagination = forwardRef(({ activePage = 1, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl = { root: 'Pagination', prev: 'Previous page', next: 'Next page', page: 'Page', }, itemsPerPage = 1, maxNumberOfPageLinks = { base: 5, xs: 7, }, onPageChange, onUpdate, showLastPage = true, theme = 'light', totalItemsCount = 1, className, ...rest }, ref) => {
8
8
  const elementRef = useRef();
9
9
  useEventCallback(elementRef, 'pageChange', onPageChange);
10
10
  useEventCallback(elementRef, 'update', onUpdate);
11
11
  const WebComponentTag = usePrefix('p-pagination');
12
- const propsToSync = [activePage, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl, itemsPerPage, maxNumberOfPageLinks, theme, totalItemsCount];
12
+ const propsToSync = [activePage, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl, itemsPerPage, maxNumberOfPageLinks, showLastPage, theme, totalItemsCount];
13
13
  useBrowserLayoutEffect(() => {
14
14
  const { current } = elementRef;
15
- ['activePage', 'allyLabel', 'allyLabelNext', 'allyLabelPage', 'allyLabelPrev', 'intl', 'itemsPerPage', 'maxNumberOfPageLinks', 'theme', 'totalItemsCount'].forEach((propName, i) => (current[propName] = propsToSync[i]));
15
+ ['activePage', 'allyLabel', 'allyLabelNext', 'allyLabelPage', 'allyLabelPrev', 'intl', 'itemsPerPage', 'maxNumberOfPageLinks', 'showLastPage', 'theme', 'totalItemsCount'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
16
  }, propsToSync);
17
17
  // @ts-ignore
18
18
  if (!process.browser) {
@@ -23,7 +23,7 @@ const PPagination = forwardRef(({ activePage = 1, allyLabel, allyLabelNext, ally
23
23
  // @ts-ignore
24
24
  ...(!process.browser
25
25
  ? {
26
- children: (jsx(DSRPagination, { ...{ activePage, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl, itemsPerPage, maxNumberOfPageLinks, theme, totalItemsCount } })),
26
+ children: (jsx(DSRPagination, { ...{ activePage, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl, itemsPerPage, maxNumberOfPageLinks, showLastPage, theme, totalItemsCount } })),
27
27
  }
28
28
  : {
29
29
  suppressHydrationWarning: true,
@@ -23,7 +23,7 @@ import '../components/headline.wrapper.js';
23
23
  import '../components/icon.wrapper.js';
24
24
  import '../components/inline-notification.wrapper.js';
25
25
  import '../components/link.wrapper.js';
26
- import '../components/link-pure.wrapper.js';
26
+ import { PLinkPure } from '../components/link-pure.wrapper.js';
27
27
  import '../components/link-social.wrapper.js';
28
28
  import '../components/link-tile.wrapper.js';
29
29
  import '../components/link-tile-model-signature.wrapper.js';
@@ -65,6 +65,7 @@ import { Component } from 'react';
65
65
  import { minifyCss } from '../../minifyCss.js';
66
66
  import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
67
67
  import { getCarouselCss as getComponentCss$T } from '../../../../../../components/dist/styles/esm/styles-entry.js';
68
+ import { isInfinitePagination } from '../../../../../../components/dist/utils/esm/utils-entry.js';
68
69
 
69
70
  class DSRCarousel extends Component {
70
71
  constructor() {
@@ -87,9 +88,9 @@ class DSRCarousel extends Component {
87
88
  ? typeof this.props.disablePagination === 'object'
88
89
  ? Object.fromEntries(Object.entries(this.props.disablePagination).map(([key, value]) => [key, !value]))
89
90
  : !this.props.disablePagination
90
- : this.props.pagination, this.props.alignHeader, this.props.theme)));
91
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "header", children: [this.props.heading ? jsx("h2", { children: this.props.heading }) : jsx("slot", { name: "heading" }), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) &&
92
- ((this.props.description && jsx("p", { children: this.props.description })) || jsx("slot", { name: "description" })), jsxs("div", { className: "nav", children: [jsx(PButtonPure, { ...btnProps, icon: "arrow-left" }), jsx(PButtonPure, { ...btnProps, icon: "arrow-right" })] })] }), jsx("div", { id: "splide", className: "splide", "aria-label": this.props.heading || ((_a = namedSlotChildren.find(({ props: { slot } }) => slot === 'heading')) === null || _a === void 0 ? void 0 : _a.props.children), children: jsx("div", { className: "splide__track", children: jsx("div", { className: "splide__list", children: otherChildren.map((_, i) => (jsx("div", { className: "splide__slide", children: jsx("slot", { name: `slide-${i}` }) }, i))) }) }) }), (this.props.disablePagination ? this.props.disablePagination !== true : this.props.pagination) && (jsx("div", { className: "pagination" }))] })] }), this.props.children] }));
91
+ : this.props.pagination, isInfinitePagination(this.props.amountOfPages), this.props.alignHeader, this.props.theme)));
92
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("div", { className: "header", children: [this.props.heading ? jsx("h2", { id: "heading", children: this.props.heading }) : jsx("slot", { name: "heading" }), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) &&
93
+ ((this.props.description && jsx("p", { children: this.props.description })) || jsx("slot", { name: "description" })), jsxs("div", { className: "nav", children: [this.props.skipLinkTarget && (jsx(PLinkPure, { href: this.props.skipLinkTarget, theme: this.props.theme, icon: "arrow-last", className: "btn skip-link", alignLabel: "left", hideLabel: true, "aria-describedby": this.props.heading ? 'heading' : null, children: "Skip carousel entries" })), jsx(PButtonPure, { ...btnProps, icon: "arrow-left" }), jsx(PButtonPure, { ...btnProps, icon: "arrow-right" })] })] }), jsx("div", { id: "splide", className: "splide", "aria-label": this.props.heading || ((_a = namedSlotChildren.find(({ props: { slot } }) => slot === 'heading')) === null || _a === void 0 ? void 0 : _a.props.children), children: jsx("div", { className: "splide__track", children: jsx("div", { className: "splide__list", children: otherChildren.map((_, i) => (jsx("div", { className: "splide__slide", tabIndex: 0, children: jsx("slot", { name: `slide-${i}` }) }, i))) }) }) }), (this.props.disablePagination ? this.props.disablePagination !== true : this.props.pagination) && (jsx("div", { className: "pagination-container", children: jsx("div", { className: "pagination" }) }))] })] }), this.props.children] }));
93
94
  }
94
95
  }
95
96
 
@@ -64,7 +64,7 @@ import { Component } from 'react';
64
64
  import { minifyCss } from '../../minifyCss.js';
65
65
  import { stripFocusAndHoverStyles } from '../../stripFocusAndHoverStyles.js';
66
66
  import { getPaginationCss as getComponentCss$v } from '../../../../../../components/dist/styles/esm/styles-entry.js';
67
- import { getTotalPages, createPaginationModel, getCurrentActivePage, itemTypes } from '../../../../../../components/dist/utils/esm/utils-entry.js';
67
+ import { getTotalPages, createPaginationModel, getCurrentActivePage, ItemType } from '../../../../../../components/dist/utils/esm/utils-entry.js';
68
68
 
69
69
  class DSRPagination extends Component {
70
70
  constructor() {
@@ -77,6 +77,7 @@ class DSRPagination extends Component {
77
77
  activePage: getCurrentActivePage(this.props.activePage, pageTotal),
78
78
  pageTotal,
79
79
  pageRange: this.props.breakpointMaxNumberOfPageLinks === 7 ? 1 : 0,
80
+ showLastPage: this.props.showLastPage,
80
81
  });
81
82
  const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$v(this.props.maxNumberOfPageLinks, this.props.theme)));
82
83
  return (jsx(Fragment, { children: jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("nav", { role: "navigation", "aria-label": this.props.allyLabel || this.props.intl.root, children: jsx("ul", { children: paginationModel.map((pageModel) => {
@@ -91,14 +92,14 @@ class DSRPagination extends Component {
91
92
  'aria-hidden': 'true',
92
93
  };
93
94
  switch (type) {
94
- case itemTypes.PREVIOUS_PAGE_LINK:
95
- return (jsx("li", { children: jsx("span", { ...spanProps, "aria-disabled": isActive ? null : 'true', "aria-label": this.props.allyLabelPrev || this.props.intl.prev, children: jsx(PIcon, { name: "arrow-left", ...iconProps }) }) }, "prev"));
96
- case itemTypes.ELLIPSIS:
95
+ case ItemType.PREVIOUS:
96
+ return (jsx("li", { children: jsx("span", { ...spanProps, "aria-label": this.props.allyLabelPrev || this.props.intl.prev, "aria-disabled": isActive ? null : 'true', children: jsx(PIcon, { name: "arrow-left", ...iconProps }) }) }, "prev"));
97
+ case ItemType.ELLIPSIS:
97
98
  return (jsx("li", { children: jsx("span", { className: "ellipsis" }) }, "ellipsis"));
98
- case itemTypes.PAGE:
99
+ case ItemType.PAGE:
99
100
  return (jsx("li", { children: jsx("span", { ...spanProps, tabIndex: 0, "aria-label": `${this.props.allyLabelPage || this.props.intl.page} ${value}`, "aria-current": isActive ? 'page' : null, children: value }) }, value));
100
- case itemTypes.NEXT_PAGE_LINK:
101
- return (jsx("li", { children: jsx("span", { ...spanProps, "aria-disabled": isActive ? null : 'true', "aria-label": this.props.allyLabelNext || this.props.intl.next, children: jsx(PIcon, { name: "arrow-right", ...iconProps }) }) }, "next"));
101
+ case ItemType.NEXT:
102
+ return (jsx("li", { children: jsx("span", { ...spanProps, "aria-label": this.props.allyLabelNext || this.props.intl.next, "aria-disabled": isActive ? null : 'true', children: jsx(PIcon, { name: "arrow-right", ...iconProps }) }) }, "next"));
102
103
  }
103
104
  }) }) })] }) }));
104
105
  }
@@ -41,6 +41,10 @@ export type PCarouselProps = Omit<HTMLAttributes<{}>, 'color'> & {
41
41
  * Whether the slides should rewind from last to first slide and vice versa.
42
42
  */
43
43
  rewind?: boolean;
44
+ /**
45
+ * Defines target of skip link (to skip carousel entries).
46
+ */
47
+ skipLinkTarget?: string;
44
48
  /**
45
49
  * Sets the amount of slides visible at the same time. Can be set to `auto` if you want to define different widths per slide via CSS.
46
50
  */
@@ -100,6 +104,10 @@ export declare const PCarousel: import("react").ForwardRefExoticComponent<Omit<H
100
104
  * Whether the slides should rewind from last to first slide and vice versa.
101
105
  */
102
106
  rewind?: boolean;
107
+ /**
108
+ * Defines target of skip link (to skip carousel entries).
109
+ */
110
+ skipLinkTarget?: string;
103
111
  /**
104
112
  * Sets the amount of slides visible at the same time. Can be set to `auto` if you want to define different widths per slide via CSS.
105
113
  */
@@ -30,7 +30,7 @@ export type PPaginationProps = Omit<HTMLAttributes<{}>, 'color'> & {
30
30
  */
31
31
  itemsPerPage?: number;
32
32
  /**
33
- * The maximum number of page links rendered
33
+ * The maximum number of page links rendered.
34
34
  */
35
35
  maxNumberOfPageLinks?: BreakpointCustomizable<PaginationMaxNumberOfPageLinks>;
36
36
  /**
@@ -41,6 +41,10 @@ export type PPaginationProps = Omit<HTMLAttributes<{}>, 'color'> & {
41
41
  * Emitted when the page changes.
42
42
  */
43
43
  onUpdate?: (event: CustomEvent<PaginationUpdateEvent>) => void;
44
+ /**
45
+ * Show or hide the button to jump to the last page.
46
+ */
47
+ showLastPage?: boolean;
44
48
  /**
45
49
  * Adapts the color when used on dark background.
46
50
  */
@@ -80,7 +84,7 @@ export declare const PPagination: import("react").ForwardRefExoticComponent<Omit
80
84
  */
81
85
  itemsPerPage?: number;
82
86
  /**
83
- * The maximum number of page links rendered
87
+ * The maximum number of page links rendered.
84
88
  */
85
89
  maxNumberOfPageLinks?: BreakpointCustomizable<PaginationMaxNumberOfPageLinks>;
86
90
  /**
@@ -91,6 +95,10 @@ export declare const PPagination: import("react").ForwardRefExoticComponent<Omit
91
95
  * Emitted when the page changes.
92
96
  */
93
97
  onUpdate?: (event: CustomEvent<PaginationUpdateEvent>) => void;
98
+ /**
99
+ * Show or hide the button to jump to the last page.
100
+ */
101
+ showLastPage?: boolean;
94
102
  /**
95
103
  * Adapts the color when used on dark background.
96
104
  */
@@ -3,6 +3,5 @@ export declare class DSRPagination extends Component<any> {
3
3
  host: HTMLElement;
4
4
  private breakpointMaxNumberOfPageLinks;
5
5
  private navigationElement;
6
- private unlistenResize;
7
6
  render(): JSX.Element;
8
7
  }