@navikt/ds-react 0.17.7 → 0.17.8
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.
|
@@ -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;
|
|
@@ -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/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,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,E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C,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.8",
|
|
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": "a3b28bb9ad1ca3a3a188d643ee26918d36805bf2"
|
|
71
71
|
}
|
|
@@ -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
|
) : (
|