@norges-domstoler/dds-components 21.14.0 → 21.15.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/dist/index.d.mts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -9889,7 +9889,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
|
|
|
9889
9889
|
cursor: "pointer",
|
|
9890
9890
|
display: "flex",
|
|
9891
9891
|
alignItems: "center",
|
|
9892
|
-
gap: "var(--dds-spacing-x0-
|
|
9892
|
+
gap: "var(--dds-spacing-x0-25)",
|
|
9893
9893
|
padding: "var(--dds-spacing-x0-75)",
|
|
9894
9894
|
backgroundColor: "var(--dds-color-surface-default)",
|
|
9895
9895
|
...typography.option[size2],
|
|
@@ -9957,10 +9957,9 @@ var getIndicatorIconSize = (componentSize) => {
|
|
|
9957
9957
|
}
|
|
9958
9958
|
};
|
|
9959
9959
|
var DDSOption = ({
|
|
9960
|
-
componentSize,
|
|
9961
9960
|
...props
|
|
9962
9961
|
}) => /* @__PURE__ */ jsxs66(Option, { ...props, children: [
|
|
9963
|
-
props.isSelected && /* @__PURE__ */ jsx284(Icon, { icon: CheckIcon, iconSize:
|
|
9962
|
+
props.isSelected && /* @__PURE__ */ jsx284(Icon, { icon: CheckIcon, iconSize: "small" }),
|
|
9964
9963
|
props.children
|
|
9965
9964
|
] });
|
|
9966
9965
|
var CustomOption = (props) => /* @__PURE__ */ jsx284(Option, { ...props, children: React.createElement(props.customElement, props) });
|
|
@@ -10151,7 +10150,7 @@ function Select({
|
|
|
10151
10150
|
if (customOptionElement) {
|
|
10152
10151
|
return /* @__PURE__ */ jsx285(CustomOption, { ...props, customElement: customOptionElement });
|
|
10153
10152
|
} else {
|
|
10154
|
-
return /* @__PURE__ */ jsx285(DDSOption, { ...props
|
|
10153
|
+
return /* @__PURE__ */ jsx285(DDSOption, { ...props });
|
|
10155
10154
|
}
|
|
10156
10155
|
},
|
|
10157
10156
|
[customOptionElement, componentSize]
|
|
@@ -10386,6 +10385,7 @@ var Pagination = ({
|
|
|
10386
10385
|
itemsAmount,
|
|
10387
10386
|
defaultItemsPerPage = 10,
|
|
10388
10387
|
defaultActivePage = 1,
|
|
10388
|
+
activePage: activePageProp,
|
|
10389
10389
|
withPagination = true,
|
|
10390
10390
|
withCounter,
|
|
10391
10391
|
withSelect,
|
|
@@ -10405,7 +10405,15 @@ var Pagination = ({
|
|
|
10405
10405
|
...rest
|
|
10406
10406
|
}) => {
|
|
10407
10407
|
const { t } = useTranslation();
|
|
10408
|
-
|
|
10408
|
+
if (withSelect && !selectOptions.some((o) => o.value === defaultItemsPerPage)) {
|
|
10409
|
+
console.warn(
|
|
10410
|
+
`[Pagination] defaultItemsPerPage prop value (${defaultItemsPerPage}) is not included in customOptions prop. Please add it to ensure it appears in the dropdown.`
|
|
10411
|
+
);
|
|
10412
|
+
}
|
|
10413
|
+
const [activePage, setActivePage] = useControllableState({
|
|
10414
|
+
value: activePageProp,
|
|
10415
|
+
defaultValue: defaultActivePage
|
|
10416
|
+
});
|
|
10409
10417
|
const [itemsPerPage, setItemsPerPage] = useState22(defaultItemsPerPage);
|
|
10410
10418
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10411
10419
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
@@ -10623,7 +10631,7 @@ var Pagination = ({
|
|
|
10623
10631
|
{
|
|
10624
10632
|
options: selectOptions,
|
|
10625
10633
|
isSearchable: false,
|
|
10626
|
-
width: "
|
|
10634
|
+
width: "90px",
|
|
10627
10635
|
defaultValue: {
|
|
10628
10636
|
label: itemsPerPage.toString(),
|
|
10629
10637
|
value: itemsPerPage
|