@navikt/ds-react 0.17.7 → 0.17.10
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/cjs/alert/Alert.js +2 -2
- package/cjs/pagination/Pagination.js +53 -10
- package/cjs/table/ColumnHeader.js +1 -2
- package/esm/alert/Alert.js +2 -2
- package/esm/alert/Alert.js.map +1 -1
- package/esm/pagination/Pagination.d.ts +1 -1
- package/esm/pagination/Pagination.js +30 -10
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/table/ColumnHeader.js +2 -3
- package/esm/table/ColumnHeader.js.map +1 -1
- package/package.json +2 -2
- package/src/alert/Alert.tsx +3 -3
- package/src/pagination/Pagination.tsx +133 -109
- package/src/pagination/pagination.stories.tsx +1 -0
- package/src/table/ColumnHeader.tsx +8 -5
package/cjs/alert/Alert.js
CHANGED
|
@@ -37,9 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
const react_1 = __importStar(require("react"));
|
|
41
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
42
40
|
const ds_icons_1 = require("@navikt/ds-icons");
|
|
41
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const __1 = require("..");
|
|
44
44
|
const Icon = (_a) => {
|
|
45
45
|
var { variant } = _a, props = __rest(_a, ["variant"]);
|
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
2
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
38
|
};
|
|
5
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
40
|
exports.getSteps = void 0;
|
|
7
|
-
const react_1 =
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
8
42
|
const classnames_1 = __importDefault(require("classnames"));
|
|
9
43
|
const ds_icons_1 = require("@navikt/ds-icons");
|
|
10
44
|
const __1 = require("..");
|
|
@@ -30,7 +64,8 @@ const getSteps = ({ page, count, boundaryCount = 1, siblingCount = 1, }) => {
|
|
|
30
64
|
];
|
|
31
65
|
};
|
|
32
66
|
exports.getSteps = getSteps;
|
|
33
|
-
const Pagination = (
|
|
67
|
+
const Pagination = (0, react_1.forwardRef)((_a, ref) => {
|
|
68
|
+
var { page, onPageChange, count, boundaryCount = 1, siblingCount = 1, className, size = "medium", prevNextTexts = false } = _a, rest = __rest(_a, ["page", "onPageChange", "count", "boundaryCount", "siblingCount", "className", "size", "prevNextTexts"]);
|
|
34
69
|
if (page < 1) {
|
|
35
70
|
console.error("page cannot be less than 1");
|
|
36
71
|
return null;
|
|
@@ -47,13 +82,17 @@ const Pagination = ({ page, onPageChange, count, boundaryCount = 1, siblingCount
|
|
|
47
82
|
console.error("siblingCount cannot be less than 0");
|
|
48
83
|
return null;
|
|
49
84
|
}
|
|
50
|
-
return (react_1.default.createElement("nav", { className: (0, classnames_1.default)("navds-pagination", `navds-pagination--${size}`, className) },
|
|
51
|
-
prevNextTexts &&
|
|
85
|
+
return (react_1.default.createElement("nav", Object.assign({ ref: ref }, rest, { className: (0, classnames_1.default)("navds-pagination", `navds-pagination--${size}`, className) }),
|
|
86
|
+
prevNextTexts && (react_1.default.createElement("button", { className: (0, classnames_1.default)("navds-pagination__prev-next", {
|
|
87
|
+
"navds-pagination--invisible": page === 1,
|
|
88
|
+
}), disabled: page === 1, onClick: () => onPageChange(page - 1) },
|
|
52
89
|
react_1.default.createElement(ds_icons_1.Back, { className: "navds-pagination__prev-next-icon", role: "presentation" }),
|
|
53
90
|
react_1.default.createElement(__1.BodyShort, { size: size, className: "navds-pagination__prev-text" }, "Forrige"))),
|
|
54
91
|
react_1.default.createElement("ul", { className: "navds-pagination__list" },
|
|
55
|
-
!prevNextTexts &&
|
|
56
|
-
react_1.default.createElement("button", { className: "navds-pagination__prev-next",
|
|
92
|
+
!prevNextTexts && (react_1.default.createElement("li", null,
|
|
93
|
+
react_1.default.createElement("button", { className: (0, classnames_1.default)("navds-pagination__prev-next", {
|
|
94
|
+
"navds-pagination--invisible": page === 1,
|
|
95
|
+
}), disabled: page === 1, onClick: () => onPageChange(page - 1) },
|
|
57
96
|
react_1.default.createElement(ds_icons_1.Back, { className: "navds-pagination__prev-next-icon", title: "Forrige" })))),
|
|
58
97
|
(0, exports.getSteps)({ page, count, siblingCount, boundaryCount }).map((step, i) => {
|
|
59
98
|
const n = Number(step);
|
|
@@ -61,11 +100,15 @@ const Pagination = ({ page, onPageChange, count, boundaryCount = 1, siblingCount
|
|
|
61
100
|
react_1.default.createElement(__1.BodyShort, { size: size }, "..."))) : (react_1.default.createElement("li", { key: step },
|
|
62
101
|
react_1.default.createElement(__1.BodyShort, { size: size, as: "button", className: "navds-pagination__item", onClick: () => onPageChange(n), "aria-current": page === n ? true : undefined }, n)));
|
|
63
102
|
}),
|
|
64
|
-
!prevNextTexts &&
|
|
65
|
-
react_1.default.createElement("button", { className: "navds-pagination__prev-next",
|
|
103
|
+
!prevNextTexts && (react_1.default.createElement("li", null,
|
|
104
|
+
react_1.default.createElement("button", { className: (0, classnames_1.default)("navds-pagination__prev-next", {
|
|
105
|
+
"navds-pagination--invisible": page === count,
|
|
106
|
+
}), disabled: page === count, onClick: () => onPageChange(page + 1) },
|
|
66
107
|
react_1.default.createElement(ds_icons_1.Next, { className: "navds-pagination__prev-next-icon", title: "Neste" }))))),
|
|
67
|
-
prevNextTexts &&
|
|
108
|
+
prevNextTexts && (react_1.default.createElement("button", { className: (0, classnames_1.default)("navds-pagination__prev-next", {
|
|
109
|
+
"navds-pagination--invisible": page === count,
|
|
110
|
+
}), disabled: page === count, onClick: () => onPageChange(page + 1) },
|
|
68
111
|
react_1.default.createElement(__1.BodyShort, { size: size, className: "navds-pagination__next-text" }, "Neste"),
|
|
69
112
|
react_1.default.createElement(ds_icons_1.Next, { className: "navds-pagination__prev-next-icon", role: "presentation" })))));
|
|
70
|
-
};
|
|
113
|
+
});
|
|
71
114
|
exports.default = Pagination;
|
|
@@ -56,7 +56,6 @@ const ColumnHeader = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
56
56
|
? () => { var _a; return (_a = context === null || context === void 0 ? void 0 : context.onSortChange) === null || _a === void 0 ? void 0 : _a.call(context, sortKey); }
|
|
57
57
|
: undefined },
|
|
58
58
|
children,
|
|
59
|
-
((_d = context === null || context === void 0 ? void 0 : context.sort) === null || _d === void 0 ? void 0 : _d.orderBy) === sortKey
|
|
60
|
-
((_e = context === null || context === void 0 ? void 0 : context.sort) === null || _e === void 0 ? void 0 : _e.direction) === "descending" ? (react_1.default.createElement(ds_icons_1.Down, { "aria-label": "sorter synkende" })) : (react_1.default.createElement(ds_icons_1.Up, { "aria-label": "sorter stigende" })))) : (children)));
|
|
59
|
+
((_d = context === null || context === void 0 ? void 0 : context.sort) === null || _d === void 0 ? void 0 : _d.orderBy) === sortKey ? (((_e = context === null || context === void 0 ? void 0 : context.sort) === null || _e === void 0 ? void 0 : _e.direction) === "descending" ? (react_1.default.createElement(ds_icons_1.Down, { "aria-hidden": true })) : (react_1.default.createElement(ds_icons_1.Up, { "aria-hidden": true }))) : (react_1.default.createElement(ds_icons_1.UpDown, { "aria-hidden": true })))) : (children)));
|
|
61
60
|
});
|
|
62
61
|
exports.default = ColumnHeader;
|
package/esm/alert/Alert.js
CHANGED
|
@@ -9,9 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import
|
|
12
|
+
import { ErrorFilled, InformationFilled, SuccessFilled, WarningFilled, } from "@navikt/ds-icons";
|
|
13
13
|
import cl from "classnames";
|
|
14
|
-
import
|
|
14
|
+
import React, { forwardRef } from "react";
|
|
15
15
|
import { BodyLong } from "..";
|
|
16
16
|
const Icon = (_a) => {
|
|
17
17
|
var { variant } = _a, props = __rest(_a, ["variant"]);
|
package/esm/alert/Alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../src/alert/Alert.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../src/alert/Alert.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AA2B9B,MAAM,IAAI,GAAG,CAAC,EAAqB,EAAE,EAAE;QAAzB,EAAE,OAAO,OAAY,EAAP,KAAK,cAAnB,WAAqB,CAAF;IAC/B,QAAQ,OAAO,EAAE;QACf,KAAK,OAAO;YACV,OAAO,oBAAC,WAAW,kBAAC,KAAK,EAAC,MAAM,IAAK,KAAK,EAAI,CAAC;QACjD,KAAK,SAAS;YACZ,OAAO,oBAAC,aAAa,kBAAC,KAAK,EAAC,UAAU,IAAK,KAAK,EAAI,CAAC;QACvD,KAAK,MAAM;YACT,OAAO,oBAAC,iBAAiB,kBAAC,KAAK,EAAC,aAAa,IAAK,KAAK,EAAI,CAAC;QAC9D,KAAK,SAAS;YACZ,OAAO,oBAAC,aAAa,kBAAC,KAAK,EAAC,SAAS,IAAK,KAAK,EAAI,CAAC;QACtD;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AAMF,MAAM,KAAK,GAAG,UAAU,CACtB,CACE,EAQC,EACD,GAAG,EACH,EAAE;QAVF,EACE,QAAQ,EACR,SAAS,EACT,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,KAAK,OAEf,EADI,IAAI,cAPT,mEAQC,CADQ;IAGN,OAAA,CACH,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,SAAS,EACT,aAAa,EACb,gBAAgB,OAAO,EAAE,EACzB,gBAAgB,IAAI,EAAE,EACtB,EAAE,yBAAyB,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,EAAE,CACxE;QAED,oBAAC,IAAI,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,mBAAmB,GAAG;QACxD,oBAAC,QAAQ,IAAC,EAAE,EAAC,KAAK,EAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,sBAAsB,IAC5D,QAAQ,CACA,CACP,CACP,CAAA;CAAA,CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -39,5 +39,5 @@ export declare const getSteps: ({ page, count, boundaryCount, siblingCount, }: {
|
|
|
39
39
|
boundaryCount?: number | undefined;
|
|
40
40
|
siblingCount?: number | undefined;
|
|
41
41
|
}) => (string | number)[];
|
|
42
|
-
declare const Pagination:
|
|
42
|
+
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
43
43
|
export default Pagination;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
2
13
|
import cl from "classnames";
|
|
3
14
|
import { Back, Next } from "@navikt/ds-icons";
|
|
4
15
|
import { BodyShort } from "..";
|
|
@@ -23,7 +34,8 @@ export const getSteps = ({ page, count, boundaryCount = 1, siblingCount = 1, })
|
|
|
23
34
|
...endPages,
|
|
24
35
|
];
|
|
25
36
|
};
|
|
26
|
-
const Pagination = (
|
|
37
|
+
const Pagination = forwardRef((_a, ref) => {
|
|
38
|
+
var { page, onPageChange, count, boundaryCount = 1, siblingCount = 1, className, size = "medium", prevNextTexts = false } = _a, rest = __rest(_a, ["page", "onPageChange", "count", "boundaryCount", "siblingCount", "className", "size", "prevNextTexts"]);
|
|
27
39
|
if (page < 1) {
|
|
28
40
|
console.error("page cannot be less than 1");
|
|
29
41
|
return null;
|
|
@@ -40,13 +52,17 @@ const Pagination = ({ page, onPageChange, count, boundaryCount = 1, siblingCount
|
|
|
40
52
|
console.error("siblingCount cannot be less than 0");
|
|
41
53
|
return null;
|
|
42
54
|
}
|
|
43
|
-
return (React.createElement("nav", { className: cl("navds-pagination", `navds-pagination--${size}`, className) },
|
|
44
|
-
prevNextTexts &&
|
|
55
|
+
return (React.createElement("nav", Object.assign({ ref: ref }, rest, { className: cl("navds-pagination", `navds-pagination--${size}`, className) }),
|
|
56
|
+
prevNextTexts && (React.createElement("button", { className: cl("navds-pagination__prev-next", {
|
|
57
|
+
"navds-pagination--invisible": page === 1,
|
|
58
|
+
}), disabled: page === 1, onClick: () => onPageChange(page - 1) },
|
|
45
59
|
React.createElement(Back, { className: "navds-pagination__prev-next-icon", role: "presentation" }),
|
|
46
60
|
React.createElement(BodyShort, { size: size, className: "navds-pagination__prev-text" }, "Forrige"))),
|
|
47
61
|
React.createElement("ul", { className: "navds-pagination__list" },
|
|
48
|
-
!prevNextTexts &&
|
|
49
|
-
React.createElement("button", { className: "navds-pagination__prev-next",
|
|
62
|
+
!prevNextTexts && (React.createElement("li", null,
|
|
63
|
+
React.createElement("button", { className: cl("navds-pagination__prev-next", {
|
|
64
|
+
"navds-pagination--invisible": page === 1,
|
|
65
|
+
}), disabled: page === 1, onClick: () => onPageChange(page - 1) },
|
|
50
66
|
React.createElement(Back, { className: "navds-pagination__prev-next-icon", title: "Forrige" })))),
|
|
51
67
|
getSteps({ page, count, siblingCount, boundaryCount }).map((step, i) => {
|
|
52
68
|
const n = Number(step);
|
|
@@ -54,12 +70,16 @@ const Pagination = ({ page, onPageChange, count, boundaryCount = 1, siblingCount
|
|
|
54
70
|
React.createElement(BodyShort, { size: size }, "..."))) : (React.createElement("li", { key: step },
|
|
55
71
|
React.createElement(BodyShort, { size: size, as: "button", className: "navds-pagination__item", onClick: () => onPageChange(n), "aria-current": page === n ? true : undefined }, n)));
|
|
56
72
|
}),
|
|
57
|
-
!prevNextTexts &&
|
|
58
|
-
React.createElement("button", { className: "navds-pagination__prev-next",
|
|
73
|
+
!prevNextTexts && (React.createElement("li", null,
|
|
74
|
+
React.createElement("button", { className: cl("navds-pagination__prev-next", {
|
|
75
|
+
"navds-pagination--invisible": page === count,
|
|
76
|
+
}), disabled: page === count, onClick: () => onPageChange(page + 1) },
|
|
59
77
|
React.createElement(Next, { className: "navds-pagination__prev-next-icon", title: "Neste" }))))),
|
|
60
|
-
prevNextTexts &&
|
|
78
|
+
prevNextTexts && (React.createElement("button", { className: cl("navds-pagination__prev-next", {
|
|
79
|
+
"navds-pagination--invisible": page === count,
|
|
80
|
+
}), disabled: page === count, onClick: () => onPageChange(page + 1) },
|
|
61
81
|
React.createElement(BodyShort, { size: size, className: "navds-pagination__next-text" }, "Neste"),
|
|
62
82
|
React.createElement(Next, { className: "navds-pagination__prev-next-icon", role: "presentation" })))));
|
|
63
|
-
};
|
|
83
|
+
});
|
|
64
84
|
export default Pagination;
|
|
65
85
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KA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,CACF,4BAAI,GAAG,EAAE,IAAI;oBACX,oBAAC,SAAS,IACR,IAAI,EAAE,IAAI,EACV,EAAE,EAAC,QAAQ,EACX,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,kBAChB,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,IAE1C,CAAC,CACQ,CACT,CACN,CAAC;YACJ,CAAC,CACF;YACA,CAAC,aAAa,IAAI,CACjB;gBACE,gCACE,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE;wBAC3C,6BAA6B,EAAE,IAAI,KAAK,KAAK;qBAC9C,CAAC,EACF,QAAQ,EAAE,IAAI,KAAK,KAAK,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC;oBAErC,oBAAC,IAAI,IACH,SAAS,EAAC,kCAAkC,EAC5C,KAAK,EAAC,OAAO,GACb,CACK,CACN,CACN,CACE;QACJ,aAAa,IAAI,CAChB,gCACE,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE;gBAC3C,6BAA6B,EAAE,IAAI,KAAK,KAAK;aAC9C,CAAC,EACF,QAAQ,EAAE,IAAI,KAAK,KAAK,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC;YAErC,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,6BAA6B,YAElD;YACZ,oBAAC,IAAI,IACH,SAAS,EAAC,kCAAkC,EAC5C,IAAI,EAAC,cAAc,GACnB,CACK,CACV,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef, useContext } from "react";
|
|
13
|
-
import { Down, Up } from "@navikt/ds-icons";
|
|
13
|
+
import { Down, Up, UpDown } from "@navikt/ds-icons";
|
|
14
14
|
import { TableContext } from "..";
|
|
15
15
|
import HeaderCell from "./HeaderCell";
|
|
16
16
|
const ColumnHeader = forwardRef((_a, ref) => {
|
|
@@ -28,8 +28,7 @@ const ColumnHeader = forwardRef((_a, ref) => {
|
|
|
28
28
|
? () => { var _a; return (_a = context === null || context === void 0 ? void 0 : context.onSortChange) === null || _a === void 0 ? void 0 : _a.call(context, sortKey); }
|
|
29
29
|
: undefined },
|
|
30
30
|
children,
|
|
31
|
-
((_d = context === null || context === void 0 ? void 0 : context.sort) === null || _d === void 0 ? void 0 : _d.orderBy) === sortKey
|
|
32
|
-
((_e = context === null || context === void 0 ? void 0 : context.sort) === null || _e === void 0 ? void 0 : _e.direction) === "descending" ? (React.createElement(Down, { "aria-label": "sorter synkende" })) : (React.createElement(Up, { "aria-label": "sorter stigende" })))) : (children)));
|
|
31
|
+
((_d = context === null || context === void 0 ? void 0 : context.sort) === null || _d === void 0 ? void 0 : _d.orderBy) === sortKey ? (((_e = context === null || context === void 0 ? void 0 : context.sort) === null || _e === void 0 ? void 0 : _e.direction) === "descending" ? (React.createElement(Down, { "aria-hidden": true })) : (React.createElement(Up, { "aria-hidden": true }))) : (React.createElement(UpDown, { "aria-hidden": true })))) : (children)));
|
|
33
32
|
});
|
|
34
33
|
export default ColumnHeader;
|
|
35
34
|
//# sourceMappingURL=ColumnHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnHeader.js","sourceRoot":"","sources":["../../src/table/ColumnHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ColumnHeader.js","sourceRoot":"","sources":["../../src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ACR,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,OAAO,MAAK,OAAO,CAAC,CAAC,CAAC,CACpC,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,SAAS,MAAK,YAAY,CAAC,CAAC,CAAC,CAC1C,oBAAC,IAAI,0BAAe,CACrB,CAAC,CAAC,CAAC,CACF,oBAAC,EAAE,0BAAe,CACnB,CACF,CAAC,CAAC,CAAC,CACF,oBAAC,MAAM,0BAAe,CACvB,CACM,CACV,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "NAV designsystem react components",
|
|
6
6
|
"author": "NAV Designsystem team",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@types/react": "^17.0.30",
|
|
68
68
|
"react": "^17.0.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "85dd252e433d55be01ed0ad58396a8442af7387d"
|
|
71
71
|
}
|
package/src/alert/Alert.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import cl from "classnames";
|
|
3
1
|
import {
|
|
4
2
|
ErrorFilled,
|
|
5
|
-
WarningFilled,
|
|
6
3
|
InformationFilled,
|
|
7
4
|
SuccessFilled,
|
|
5
|
+
WarningFilled,
|
|
8
6
|
} from "@navikt/ds-icons";
|
|
7
|
+
import cl from "classnames";
|
|
8
|
+
import React, { forwardRef } from "react";
|
|
9
9
|
import { BodyLong } from "..";
|
|
10
10
|
|
|
11
11
|
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import cl from "classnames";
|
|
3
3
|
import { Back, Next } from "@navikt/ds-icons";
|
|
4
4
|
import { BodyShort } from "..";
|
|
@@ -71,117 +71,141 @@ export const getSteps = ({
|
|
|
71
71
|
];
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const Pagination = (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
74
|
+
const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
75
|
+
(
|
|
76
|
+
{
|
|
77
|
+
page,
|
|
78
|
+
onPageChange,
|
|
79
|
+
count,
|
|
80
|
+
boundaryCount = 1,
|
|
81
|
+
siblingCount = 1,
|
|
82
|
+
className,
|
|
83
|
+
size = "medium",
|
|
84
|
+
prevNextTexts = false,
|
|
85
|
+
...rest
|
|
86
|
+
},
|
|
87
|
+
ref
|
|
88
|
+
) => {
|
|
89
|
+
if (page < 1) {
|
|
90
|
+
console.error("page cannot be less than 1");
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
if (count < 1) {
|
|
94
|
+
console.error("count cannot be less than 1");
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
if (boundaryCount < 0) {
|
|
98
|
+
console.error("boundaryCount cannot be less than 0");
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
if (siblingCount < 0) {
|
|
102
|
+
console.error("siblingCount cannot be less than 0");
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
100
105
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
>
|
|
110
|
-
<Back
|
|
111
|
-
className="navds-pagination__prev-next-icon"
|
|
112
|
-
role="presentation"
|
|
113
|
-
/>
|
|
114
|
-
<BodyShort size={size} className="navds-pagination__prev-text">
|
|
115
|
-
Forrige
|
|
116
|
-
</BodyShort>
|
|
117
|
-
</button>
|
|
118
|
-
)}
|
|
119
|
-
<ul className="navds-pagination__list">
|
|
120
|
-
{!prevNextTexts && page !== 1 && (
|
|
121
|
-
<li>
|
|
122
|
-
<button
|
|
123
|
-
className="navds-pagination__prev-next"
|
|
124
|
-
onClick={() => onPageChange(page - 1)}
|
|
125
|
-
>
|
|
126
|
-
<Back
|
|
127
|
-
className="navds-pagination__prev-next-icon"
|
|
128
|
-
title="Forrige"
|
|
129
|
-
/>
|
|
130
|
-
</button>
|
|
131
|
-
</li>
|
|
106
|
+
return (
|
|
107
|
+
<nav
|
|
108
|
+
ref={ref}
|
|
109
|
+
{...rest}
|
|
110
|
+
className={cl(
|
|
111
|
+
"navds-pagination",
|
|
112
|
+
`navds-pagination--${size}`,
|
|
113
|
+
className
|
|
132
114
|
)}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</BodyShort>
|
|
151
|
-
</li>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
115
|
+
>
|
|
116
|
+
{prevNextTexts && (
|
|
117
|
+
<button
|
|
118
|
+
className={cl("navds-pagination__prev-next", {
|
|
119
|
+
"navds-pagination--invisible": page === 1,
|
|
120
|
+
})}
|
|
121
|
+
disabled={page === 1}
|
|
122
|
+
onClick={() => onPageChange(page - 1)}
|
|
123
|
+
>
|
|
124
|
+
<Back
|
|
125
|
+
className="navds-pagination__prev-next-icon"
|
|
126
|
+
role="presentation"
|
|
127
|
+
/>
|
|
128
|
+
<BodyShort size={size} className="navds-pagination__prev-text">
|
|
129
|
+
Forrige
|
|
130
|
+
</BodyShort>
|
|
131
|
+
</button>
|
|
154
132
|
)}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
133
|
+
<ul className="navds-pagination__list">
|
|
134
|
+
{!prevNextTexts && (
|
|
135
|
+
<li>
|
|
136
|
+
<button
|
|
137
|
+
className={cl("navds-pagination__prev-next", {
|
|
138
|
+
"navds-pagination--invisible": page === 1,
|
|
139
|
+
})}
|
|
140
|
+
disabled={page === 1}
|
|
141
|
+
onClick={() => onPageChange(page - 1)}
|
|
142
|
+
>
|
|
143
|
+
<Back
|
|
144
|
+
className="navds-pagination__prev-next-icon"
|
|
145
|
+
title="Forrige"
|
|
146
|
+
/>
|
|
147
|
+
</button>
|
|
148
|
+
</li>
|
|
149
|
+
)}
|
|
150
|
+
{getSteps({ page, count, siblingCount, boundaryCount }).map(
|
|
151
|
+
(step, i) => {
|
|
152
|
+
const n = Number(step);
|
|
153
|
+
return isNaN(n) ? (
|
|
154
|
+
<li className="navds-pagination__ellipsis" key={`${step}${i}`}>
|
|
155
|
+
<BodyShort size={size}>...</BodyShort>
|
|
156
|
+
</li>
|
|
157
|
+
) : (
|
|
158
|
+
<li key={step}>
|
|
159
|
+
<BodyShort
|
|
160
|
+
size={size}
|
|
161
|
+
as="button"
|
|
162
|
+
className="navds-pagination__item"
|
|
163
|
+
onClick={() => onPageChange(n)}
|
|
164
|
+
aria-current={page === n ? true : undefined}
|
|
165
|
+
>
|
|
166
|
+
{n}
|
|
167
|
+
</BodyShort>
|
|
168
|
+
</li>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
)}
|
|
172
|
+
{!prevNextTexts && (
|
|
173
|
+
<li>
|
|
174
|
+
<button
|
|
175
|
+
className={cl("navds-pagination__prev-next", {
|
|
176
|
+
"navds-pagination--invisible": page === count,
|
|
177
|
+
})}
|
|
178
|
+
disabled={page === count}
|
|
179
|
+
onClick={() => onPageChange(page + 1)}
|
|
180
|
+
>
|
|
181
|
+
<Next
|
|
182
|
+
className="navds-pagination__prev-next-icon"
|
|
183
|
+
title="Neste"
|
|
184
|
+
/>
|
|
185
|
+
</button>
|
|
186
|
+
</li>
|
|
187
|
+
)}
|
|
188
|
+
</ul>
|
|
189
|
+
{prevNextTexts && (
|
|
190
|
+
<button
|
|
191
|
+
className={cl("navds-pagination__prev-next", {
|
|
192
|
+
"navds-pagination--invisible": page === count,
|
|
193
|
+
})}
|
|
194
|
+
disabled={page === count}
|
|
195
|
+
onClick={() => onPageChange(page + 1)}
|
|
196
|
+
>
|
|
197
|
+
<BodyShort size={size} className="navds-pagination__next-text">
|
|
198
|
+
Neste
|
|
199
|
+
</BodyShort>
|
|
200
|
+
<Next
|
|
201
|
+
className="navds-pagination__prev-next-icon"
|
|
202
|
+
role="presentation"
|
|
203
|
+
/>
|
|
204
|
+
</button>
|
|
167
205
|
)}
|
|
168
|
-
</
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
onClick={() => onPageChange(page + 1)}
|
|
173
|
-
>
|
|
174
|
-
<BodyShort size={size} className="navds-pagination__next-text">
|
|
175
|
-
Neste
|
|
176
|
-
</BodyShort>
|
|
177
|
-
<Next
|
|
178
|
-
className="navds-pagination__prev-next-icon"
|
|
179
|
-
role="presentation"
|
|
180
|
-
/>
|
|
181
|
-
</button>
|
|
182
|
-
)}
|
|
183
|
-
</nav>
|
|
184
|
-
);
|
|
185
|
-
};
|
|
206
|
+
</nav>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
);
|
|
186
210
|
|
|
187
211
|
export default Pagination;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef, useContext } from "react";
|
|
2
|
-
import { Down, Up } from "@navikt/ds-icons";
|
|
2
|
+
import { Down, Up, UpDown } from "@navikt/ds-icons";
|
|
3
3
|
import { TableContext } from "..";
|
|
4
4
|
import HeaderCell, { HeaderCellProps } from "./HeaderCell";
|
|
5
5
|
|
|
@@ -52,11 +52,14 @@ const ColumnHeader: ColumnHeaderType = forwardRef(
|
|
|
52
52
|
}
|
|
53
53
|
>
|
|
54
54
|
{children}
|
|
55
|
-
{context?.sort?.orderBy === sortKey
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
{context?.sort?.orderBy === sortKey ? (
|
|
56
|
+
context?.sort?.direction === "descending" ? (
|
|
57
|
+
<Down aria-hidden />
|
|
58
|
+
) : (
|
|
59
|
+
<Up aria-hidden />
|
|
60
|
+
)
|
|
58
61
|
) : (
|
|
59
|
-
<
|
|
62
|
+
<UpDown aria-hidden />
|
|
60
63
|
)}
|
|
61
64
|
</button>
|
|
62
65
|
) : (
|