@norges-domstoler/dds-components 0.0.10 → 0.0.11
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/components/Pagination/Pagination.d.ts +2 -0
- package/dist/index.es.js +13 -4
- package/dist/index.js +13 -4
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare type PaginationProps = {
|
|
|
8
8
|
withCounter?: boolean;
|
|
9
9
|
withSelect?: boolean;
|
|
10
10
|
selectOptions?: SelectOption[];
|
|
11
|
+
onSelectOptionChange?: (option: SelectOption | null) => void;
|
|
11
12
|
smallScreen?: boolean;
|
|
12
13
|
onChange?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, page: number) => void;
|
|
13
14
|
} & Omit<HTMLAttributes<HTMLElement>, 'onChange'>;
|
|
@@ -19,6 +20,7 @@ export declare const Pagination: import("react").ForwardRefExoticComponent<{
|
|
|
19
20
|
withCounter?: boolean | undefined;
|
|
20
21
|
withSelect?: boolean | undefined;
|
|
21
22
|
selectOptions?: SelectOption[] | undefined;
|
|
23
|
+
onSelectOptionChange?: ((option: SelectOption | null) => void) | undefined;
|
|
22
24
|
smallScreen?: boolean | undefined;
|
|
23
25
|
onChange?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>, page: number) => void) | undefined;
|
|
24
26
|
} & Omit<HTMLAttributes<HTMLElement>, "onChange"> & import("react").RefAttributes<HTMLElement>>;
|
package/dist/index.es.js
CHANGED
|
@@ -30178,7 +30178,8 @@ var Pagination = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
30178
30178
|
}] : _e,
|
|
30179
30179
|
smallScreen = _a.smallScreen,
|
|
30180
30180
|
onChange = _a.onChange,
|
|
30181
|
-
|
|
30181
|
+
onSelectOptionChange = _a.onSelectOptionChange,
|
|
30182
|
+
rest = __rest(_a, ["itemsAmount", "defaultItemsPerPage", "defaultActivePage", "withPagination", "withCounter", "withSelect", "selectOptions", "smallScreen", "onChange", "onSelectOptionChange"]);
|
|
30182
30183
|
|
|
30183
30184
|
var _f = useState(defaultActivePage),
|
|
30184
30185
|
activePage = _f[0],
|
|
@@ -30201,6 +30202,10 @@ var Pagination = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
30201
30202
|
|
|
30202
30203
|
var handleSelectChange = function handleSelectChange(option) {
|
|
30203
30204
|
setItemsPerPage(option === null || option === void 0 ? void 0 : option.value);
|
|
30205
|
+
|
|
30206
|
+
if (onSelectOptionChange) {
|
|
30207
|
+
onSelectOptionChange(option);
|
|
30208
|
+
}
|
|
30204
30209
|
};
|
|
30205
30210
|
|
|
30206
30211
|
var listItems = items.length > 0 ? items.map(function (item, i) {
|
|
@@ -30880,7 +30885,7 @@ var cardAccordionBodyTokens = {
|
|
|
30880
30885
|
base: base
|
|
30881
30886
|
};
|
|
30882
30887
|
|
|
30883
|
-
var expandingAnimation = Ae(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"], ["\n transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"])));
|
|
30888
|
+
var expandingAnimation = Ae(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transition: visibility 0.3s, max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"], ["\n transition: visibility 0.3s, max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"])));
|
|
30884
30889
|
var Body = styled.div.withConfig({
|
|
30885
30890
|
displayName: "CardAccordionBody__Body",
|
|
30886
30891
|
componentId: "sc-igsnpx-0"
|
|
@@ -30891,7 +30896,10 @@ var Body = styled.div.withConfig({
|
|
|
30891
30896
|
var BodyWrapper = styled.div.withConfig({
|
|
30892
30897
|
displayName: "CardAccordionBody__BodyWrapper",
|
|
30893
30898
|
componentId: "sc-igsnpx-1"
|
|
30894
|
-
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n overflow: hidden;\n max-height: ", "px;\n"], ["\n ", "\n overflow: hidden;\n max-height: ", "px;\n"])), expandingAnimation, function (_a) {
|
|
30899
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n overflow: hidden;\n visibility: ", ";\n max-height: ", "px;\n"], ["\n ", "\n overflow: hidden;\n visibility: ", ";\n max-height: ", "px;\n"])), expandingAnimation, function (_a) {
|
|
30900
|
+
var isExpanded = _a.isExpanded;
|
|
30901
|
+
return isExpanded ? 'visible' : 'hidden';
|
|
30902
|
+
}, function (_a) {
|
|
30895
30903
|
var maxHeight = _a.maxHeight;
|
|
30896
30904
|
return maxHeight ? maxHeight : 0;
|
|
30897
30905
|
});
|
|
@@ -30923,7 +30931,8 @@ var CardAccordionBody = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
30923
30931
|
|
|
30924
30932
|
var bodyWrapperProps = {
|
|
30925
30933
|
ref: bodyRef,
|
|
30926
|
-
maxHeight: maxHeight
|
|
30934
|
+
maxHeight: maxHeight,
|
|
30935
|
+
isExpanded: isExpanded
|
|
30927
30936
|
};
|
|
30928
30937
|
return jsxRuntime.jsx(Body, __assign({
|
|
30929
30938
|
"aria-labelledby": headerId,
|
package/dist/index.js
CHANGED
|
@@ -30206,7 +30206,8 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
30206
30206
|
}] : _e,
|
|
30207
30207
|
smallScreen = _a.smallScreen,
|
|
30208
30208
|
onChange = _a.onChange,
|
|
30209
|
-
|
|
30209
|
+
onSelectOptionChange = _a.onSelectOptionChange,
|
|
30210
|
+
rest = __rest(_a, ["itemsAmount", "defaultItemsPerPage", "defaultActivePage", "withPagination", "withCounter", "withSelect", "selectOptions", "smallScreen", "onChange", "onSelectOptionChange"]);
|
|
30210
30211
|
|
|
30211
30212
|
var _f = React.useState(defaultActivePage),
|
|
30212
30213
|
activePage = _f[0],
|
|
@@ -30229,6 +30230,10 @@ var Pagination = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
30229
30230
|
|
|
30230
30231
|
var handleSelectChange = function handleSelectChange(option) {
|
|
30231
30232
|
setItemsPerPage(option === null || option === void 0 ? void 0 : option.value);
|
|
30233
|
+
|
|
30234
|
+
if (onSelectOptionChange) {
|
|
30235
|
+
onSelectOptionChange(option);
|
|
30236
|
+
}
|
|
30232
30237
|
};
|
|
30233
30238
|
|
|
30234
30239
|
var listItems = items.length > 0 ? items.map(function (item, i) {
|
|
@@ -30908,7 +30913,7 @@ var cardAccordionBodyTokens = {
|
|
|
30908
30913
|
base: base
|
|
30909
30914
|
};
|
|
30910
30915
|
|
|
30911
|
-
var expandingAnimation = Ae(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"], ["\n transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"])));
|
|
30916
|
+
var expandingAnimation = Ae(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transition: visibility 0.3s, max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"], ["\n transition: visibility 0.3s, max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n"])));
|
|
30912
30917
|
var Body = styled.div.withConfig({
|
|
30913
30918
|
displayName: "CardAccordionBody__Body",
|
|
30914
30919
|
componentId: "sc-igsnpx-0"
|
|
@@ -30919,7 +30924,10 @@ var Body = styled.div.withConfig({
|
|
|
30919
30924
|
var BodyWrapper = styled.div.withConfig({
|
|
30920
30925
|
displayName: "CardAccordionBody__BodyWrapper",
|
|
30921
30926
|
componentId: "sc-igsnpx-1"
|
|
30922
|
-
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n overflow: hidden;\n max-height: ", "px;\n"], ["\n ", "\n overflow: hidden;\n max-height: ", "px;\n"])), expandingAnimation, function (_a) {
|
|
30927
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n overflow: hidden;\n visibility: ", ";\n max-height: ", "px;\n"], ["\n ", "\n overflow: hidden;\n visibility: ", ";\n max-height: ", "px;\n"])), expandingAnimation, function (_a) {
|
|
30928
|
+
var isExpanded = _a.isExpanded;
|
|
30929
|
+
return isExpanded ? 'visible' : 'hidden';
|
|
30930
|
+
}, function (_a) {
|
|
30923
30931
|
var maxHeight = _a.maxHeight;
|
|
30924
30932
|
return maxHeight ? maxHeight : 0;
|
|
30925
30933
|
});
|
|
@@ -30951,7 +30959,8 @@ var CardAccordionBody = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
30951
30959
|
|
|
30952
30960
|
var bodyWrapperProps = {
|
|
30953
30961
|
ref: bodyRef,
|
|
30954
|
-
maxHeight: maxHeight
|
|
30962
|
+
maxHeight: maxHeight,
|
|
30963
|
+
isExpanded: isExpanded
|
|
30955
30964
|
};
|
|
30956
30965
|
return jsxRuntime.jsx(Body, __assign({
|
|
30957
30966
|
"aria-labelledby": headerId,
|