@sb1/ffe-tables-react 10.0.1 → 10.1.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/README.md CHANGED
@@ -12,11 +12,6 @@ npm install --save @sb1/ffe-tables-react
12
12
 
13
13
  Full documentation on table usage is available at https://design.sparebank1.no/komponenter/tabeller/.
14
14
 
15
- ## TypeScript definition files
16
-
17
- This component supports TypeScript - please update `index.d.ts` if you change any
18
- of the external methods or properties in this component.
19
-
20
15
  ## Development
21
16
 
22
17
  To start a local development server, run the following from the designsystem root folder:
@@ -28,8 +28,8 @@ import { txt } from './texts';
28
28
  import { v4 as uuid } from 'uuid';
29
29
  import { CellContent } from './CellContent';
30
30
  export var TableRowExpandable = React.forwardRef(function (_a, ref) {
31
- var className = _a.className, expandContent = _a.expandContent, children = _a.children, _b = _a.locale, locale = _b === void 0 ? 'nb' : _b, onClick = _a.onClick, rest = __rest(_a, ["className", "expandContent", "children", "locale", "onClick"]);
32
- var _c = useState(false), isOpen = _c[0], setIsOpen = _c[1];
31
+ var className = _a.className, expandContent = _a.expandContent, children = _a.children, _b = _a.locale, locale = _b === void 0 ? 'nb' : _b, onClick = _a.onClick, isDefaultOpen = _a.isDefaultOpen, rest = __rest(_a, ["className", "expandContent", "children", "locale", "onClick", "isDefaultOpen"]);
32
+ var _c = useState(!!isDefaultOpen), isOpen = _c[0], setIsOpen = _c[1];
33
33
  var expandoRowId = useRef("check-".concat(uuid())).current;
34
34
  var _d = useState(false), isAnimating = _d[0], setIsAnimating = _d[1];
35
35
  var expandButtonRef = useRef(null);
@@ -57,8 +57,8 @@ var texts_1 = require("./texts");
57
57
  var uuid_1 = require("uuid");
58
58
  var CellContent_1 = require("./CellContent");
59
59
  exports.TableRowExpandable = react_1.default.forwardRef(function (_a, ref) {
60
- var className = _a.className, expandContent = _a.expandContent, children = _a.children, _b = _a.locale, locale = _b === void 0 ? 'nb' : _b, onClick = _a.onClick, rest = __rest(_a, ["className", "expandContent", "children", "locale", "onClick"]);
61
- var _c = (0, react_1.useState)(false), isOpen = _c[0], setIsOpen = _c[1];
60
+ var className = _a.className, expandContent = _a.expandContent, children = _a.children, _b = _a.locale, locale = _b === void 0 ? 'nb' : _b, onClick = _a.onClick, isDefaultOpen = _a.isDefaultOpen, rest = __rest(_a, ["className", "expandContent", "children", "locale", "onClick", "isDefaultOpen"]);
61
+ var _c = (0, react_1.useState)(!!isDefaultOpen), isOpen = _c[0], setIsOpen = _c[1];
62
62
  var expandoRowId = (0, react_1.useRef)("check-".concat((0, uuid_1.v4)())).current;
63
63
  var _d = (0, react_1.useState)(false), isAnimating = _d[0], setIsAnimating = _d[1];
64
64
  var expandButtonRef = (0, react_1.useRef)(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-tables-react",
3
- "version": "10.0.1",
3
+ "version": "10.1.0",
4
4
  "description": "React implementation of ffe-tables",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -26,9 +26,9 @@
26
26
  "test:watch": "ffe-buildtool jest --watch"
27
27
  },
28
28
  "dependencies": {
29
- "@sb1/ffe-collapse-react": "^4.0.9",
29
+ "@sb1/ffe-collapse-react": "^5.0.2",
30
30
  "@sb1/ffe-icons-react": "^11.0.1",
31
- "@sb1/ffe-tables": "^15.0.0",
31
+ "@sb1/ffe-tables": "^15.0.1",
32
32
  "classnames": "^2.3.1"
33
33
  },
34
34
  "devDependencies": {
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "92933c40501d4208f1820cc0a6972ce46c0f14b3"
45
+ "gitHead": "31966b9e0771d0231eb6bad35bc79560371fb847"
46
46
  }
@@ -2,5 +2,6 @@ import React from 'react';
2
2
  export interface TableRowExpandableProps extends React.ComponentPropsWithoutRef<'tr'> {
3
3
  expandContent: React.ReactNode;
4
4
  locale?: 'nb' | 'nn' | 'en';
5
+ isDefaultOpen?: boolean;
5
6
  }
6
7
  export declare const TableRowExpandable: React.ForwardRefExoticComponent<TableRowExpandableProps & React.RefAttributes<HTMLTableRowElement>>;