@norges-domstoler/dds-components 0.0.0-dev-20251001064734 → 0.0.0-dev-20251002084555
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/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -3456,6 +3456,8 @@ type PaginationProps = BaseComponentProps<HTMLElement, {
|
|
|
3456
3456
|
* @default 1
|
|
3457
3457
|
*/
|
|
3458
3458
|
defaultActivePage?: number;
|
|
3459
|
+
/**Den aktive siden. Brukes til kontrollert tilstand - når denne er satt styrer du siden utenfra. */
|
|
3460
|
+
activePage?: number;
|
|
3459
3461
|
/**Spesifiserer om selve pagineringen skal vises.
|
|
3460
3462
|
* @default true
|
|
3461
3463
|
*/
|
|
@@ -3483,7 +3485,7 @@ type PaginationProps = BaseComponentProps<HTMLElement, {
|
|
|
3483
3485
|
smallScreenBreakpoint?: Breakpoint;
|
|
3484
3486
|
}, Omit<HTMLAttributes<HTMLElement>, 'onChange'>>;
|
|
3485
3487
|
declare const Pagination: {
|
|
3486
|
-
({ itemsAmount, defaultItemsPerPage, defaultActivePage, withPagination, withCounter, withSelect, selectOptions, smallScreenBreakpoint, onChange, onSelectOptionChange, id, className, htmlProps, ref, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element | null;
|
|
3488
|
+
({ itemsAmount, defaultItemsPerPage, defaultActivePage, activePage: activePageProp, withPagination, withCounter, withSelect, selectOptions, smallScreenBreakpoint, onChange, onSelectOptionChange, id, className, htmlProps, ref, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element | null;
|
|
3487
3489
|
displayName: string;
|
|
3488
3490
|
};
|
|
3489
3491
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3456,6 +3456,8 @@ type PaginationProps = BaseComponentProps<HTMLElement, {
|
|
|
3456
3456
|
* @default 1
|
|
3457
3457
|
*/
|
|
3458
3458
|
defaultActivePage?: number;
|
|
3459
|
+
/**Den aktive siden. Brukes til kontrollert tilstand - når denne er satt styrer du siden utenfra. */
|
|
3460
|
+
activePage?: number;
|
|
3459
3461
|
/**Spesifiserer om selve pagineringen skal vises.
|
|
3460
3462
|
* @default true
|
|
3461
3463
|
*/
|
|
@@ -3483,7 +3485,7 @@ type PaginationProps = BaseComponentProps<HTMLElement, {
|
|
|
3483
3485
|
smallScreenBreakpoint?: Breakpoint;
|
|
3484
3486
|
}, Omit<HTMLAttributes<HTMLElement>, 'onChange'>>;
|
|
3485
3487
|
declare const Pagination: {
|
|
3486
|
-
({ itemsAmount, defaultItemsPerPage, defaultActivePage, withPagination, withCounter, withSelect, selectOptions, smallScreenBreakpoint, onChange, onSelectOptionChange, id, className, htmlProps, ref, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element | null;
|
|
3488
|
+
({ itemsAmount, defaultItemsPerPage, defaultActivePage, activePage: activePageProp, withPagination, withCounter, withSelect, selectOptions, smallScreenBreakpoint, onChange, onSelectOptionChange, id, className, htmlProps, ref, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element | null;
|
|
3487
3489
|
displayName: string;
|
|
3488
3490
|
};
|
|
3489
3491
|
|
package/dist/index.js
CHANGED
|
@@ -10671,6 +10671,7 @@ var Pagination = ({
|
|
|
10671
10671
|
itemsAmount,
|
|
10672
10672
|
defaultItemsPerPage = 10,
|
|
10673
10673
|
defaultActivePage = 1,
|
|
10674
|
+
activePage: activePageProp,
|
|
10674
10675
|
withPagination = true,
|
|
10675
10676
|
withCounter,
|
|
10676
10677
|
withSelect,
|
|
@@ -10695,7 +10696,10 @@ var Pagination = ({
|
|
|
10695
10696
|
`[Pagination] defaultItemsPerPage prop value (${defaultItemsPerPage}) is not included in customOptions prop. Please add it to ensure it appears in the dropdown.`
|
|
10696
10697
|
);
|
|
10697
10698
|
}
|
|
10698
|
-
const [activePage, setActivePage] = (
|
|
10699
|
+
const [activePage, setActivePage] = useControllableState({
|
|
10700
|
+
value: activePageProp,
|
|
10701
|
+
defaultValue: defaultActivePage
|
|
10702
|
+
});
|
|
10699
10703
|
const [itemsPerPage, setItemsPerPage] = (0, import_react73.useState)(defaultItemsPerPage);
|
|
10700
10704
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10701
10705
|
const items = PaginationGenerator(pagesLength, activePage);
|