@entur/table 4.6.4 → 4.6.5

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.
@@ -18,5 +18,7 @@ export type HeaderCellProps = {
18
18
  sortConfig?: ExternalSortConfig;
19
19
  /** Navnet det skal sorteres på. Benyttes via useSortableTable */
20
20
  name?: string;
21
+ sortedAscendingAriaLabel?: string;
22
+ sortedDescendingAriaLabel?: string;
21
23
  } & React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableCellElement>, HTMLTableCellElement>;
22
- export declare const HeaderCell: React.ForwardRefExoticComponent<Pick<HeaderCellProps, "name" | "sortable" | "sortConfig" | "padding" | "sortableButtonProps" | "key" | keyof React.ThHTMLAttributes<HTMLTableCellElement>> & React.RefAttributes<HTMLTableCellElement>>;
24
+ export declare const HeaderCell: React.ForwardRefExoticComponent<Pick<HeaderCellProps, "name" | "sortable" | "sortConfig" | "padding" | "sortableButtonProps" | "sortedAscendingAriaLabel" | "sortedDescendingAriaLabel" | "key" | keyof React.ThHTMLAttributes<HTMLTableCellElement>> & React.RefAttributes<HTMLTableCellElement>>;
package/dist/styles.css CHANGED
@@ -118,6 +118,75 @@
118
118
  }
119
119
  /* DO NOT CHANGE!*/
120
120
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
121
+ .eds-table__header-cell {
122
+ color: #656782;
123
+ font-size: 0.875rem;
124
+ font-weight: 500;
125
+ text-align: left;
126
+ height: 3rem;
127
+ padding: 0 1.5rem;
128
+ }
129
+ .eds-table--middle .eds-table__header-cell, .eds-table--small .eds-table__header-cell {
130
+ padding: 0 1rem;
131
+ }
132
+ .eds-contrast .eds-table__header-cell {
133
+ color: #aeb7e2;
134
+ border-bottom-color: #393d79;
135
+ }
136
+ .eds-table__header-cell--padding-checkbox {
137
+ width: 3rem;
138
+ padding: 0 0 1rem 1.25rem;
139
+ }
140
+ .eds-table__header-cell--padding-radio {
141
+ width: 3rem;
142
+ padding: 0 0 1rem 1.25rem;
143
+ }
144
+ .eds-table__header-cell--padding-overflow-menu {
145
+ width: 3rem;
146
+ padding: 1rem 0.75rem;
147
+ }
148
+ .eds-table__header-cell--sortable:focus {
149
+ outline: none;
150
+ box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #181c56;
151
+ outline-offset: 0.125rem;
152
+ }
153
+ .eds-table__header-cell-button {
154
+ position: relative;
155
+ text-align: left;
156
+ height: 100%;
157
+ width: 100%;
158
+ padding: 0;
159
+ cursor: pointer;
160
+ -webkit-appearance: none;
161
+ -moz-appearance: none;
162
+ appearance: none;
163
+ border: none;
164
+ background: none;
165
+ color: inherit;
166
+ font-size: inherit;
167
+ font-weight: inherit;
168
+ font-family: inherit;
169
+ }
170
+ .eds-table__header-cell-button-icon {
171
+ position: absolute;
172
+ margin-left: 0.25rem;
173
+ }
174
+ .eds-table__header-cell-button:focus {
175
+ outline: 2px solid #181c56;
176
+ }
177
+ .eds-contrast .eds-table__header-cell-button:focus {
178
+ outline: 2px solid #ffffff;
179
+ }
180
+ .eds-table--sticky-header .eds-table__header-cell {
181
+ background-color: #ffffff;
182
+ position: sticky;
183
+ top: 0;
184
+ }
185
+ .eds-contrast .eds-table--sticky-header .eds-table__header-cell {
186
+ background-color: #181c56;
187
+ }
188
+ /* DO NOT CHANGE!*/
189
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
121
190
  .eds-editable-cell {
122
191
  padding: 0.25rem 0.75rem;
123
192
  }
@@ -235,75 +304,6 @@
235
304
  }
236
305
  /* DO NOT CHANGE!*/
237
306
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
238
- .eds-table__header-cell {
239
- color: #656782;
240
- font-size: 0.875rem;
241
- font-weight: 500;
242
- text-align: left;
243
- height: 3rem;
244
- padding: 0 1.5rem;
245
- }
246
- .eds-table--middle .eds-table__header-cell, .eds-table--small .eds-table__header-cell {
247
- padding: 0 1rem;
248
- }
249
- .eds-contrast .eds-table__header-cell {
250
- color: #aeb7e2;
251
- border-bottom-color: #393d79;
252
- }
253
- .eds-table__header-cell--padding-checkbox {
254
- width: 3rem;
255
- padding: 0 0 1rem 1.25rem;
256
- }
257
- .eds-table__header-cell--padding-radio {
258
- width: 3rem;
259
- padding: 0 0 1rem 1.25rem;
260
- }
261
- .eds-table__header-cell--padding-overflow-menu {
262
- width: 3rem;
263
- padding: 1rem 0.75rem;
264
- }
265
- .eds-table__header-cell--sortable:focus {
266
- outline: none;
267
- box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #181c56;
268
- outline-offset: 0.125rem;
269
- }
270
- .eds-table__header-cell-button {
271
- position: relative;
272
- text-align: left;
273
- height: 100%;
274
- width: 100%;
275
- padding: 0;
276
- cursor: pointer;
277
- -webkit-appearance: none;
278
- -moz-appearance: none;
279
- appearance: none;
280
- border: none;
281
- background: none;
282
- color: inherit;
283
- font-size: inherit;
284
- font-weight: inherit;
285
- font-family: inherit;
286
- }
287
- .eds-table__header-cell-button-icon {
288
- position: absolute;
289
- margin-left: 0.25rem;
290
- }
291
- .eds-table__header-cell-button:focus {
292
- outline: 2px solid #181c56;
293
- }
294
- .eds-contrast .eds-table__header-cell-button:focus {
295
- outline: 2px solid #ffffff;
296
- }
297
- .eds-table--sticky-header .eds-table__header-cell {
298
- background-color: #ffffff;
299
- position: sticky;
300
- top: 0;
301
- }
302
- .eds-contrast .eds-table--sticky-header .eds-table__header-cell {
303
- background-color: #181c56;
304
- }
305
- /* DO NOT CHANGE!*/
306
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
307
307
  .eds-expand-row-button__icon {
308
308
  transition: transform ease-in-out 0.2s;
309
309
  }
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var utils = require('@entur/utils');
6
6
  var React = require('react');
7
7
  var classNames = require('classnames');
8
+ var a11y = require('@entur/a11y');
8
9
  var icons = require('@entur/icons');
9
10
  var get = require('lodash.get');
10
11
  var form = require('@entur/form');
@@ -48,7 +49,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
48
49
  return target;
49
50
  }
50
51
 
51
- var _excluded$8 = ["className", "fixed", "spacing", "sortable", "stickyHeader"];
52
+ var _excluded$8 = ["className", "fixed", "spacing", "sortable", "changeSortDescription", "stickyHeader"];
52
53
  var Table = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
53
54
  var className = _ref.className,
54
55
  _ref$fixed = _ref.fixed,
@@ -57,9 +58,12 @@ var Table = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, re
57
58
  spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
58
59
  _ref$sortable = _ref.sortable,
59
60
  sortable = _ref$sortable === void 0 ? false : _ref$sortable,
61
+ _ref$changeSortDescri = _ref.changeSortDescription,
62
+ changeSortDescription = _ref$changeSortDescri === void 0 ? 'Tabelloverskrifter med knapper kan trykkes på for å endre sortering,' : _ref$changeSortDescri,
60
63
  _ref$stickyHeader = _ref.stickyHeader,
61
64
  stickyHeader = _ref$stickyHeader === void 0 ? false : _ref$stickyHeader,
62
65
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
66
+ var sortableHeaderId = utils.useRandomId('sortable-header');
63
67
  var tableRef = React.useRef(null);
64
68
  React.useEffect(function () {
65
69
  if (stickyHeader) {
@@ -84,8 +88,8 @@ var Table = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, re
84
88
  observerElement.remove();
85
89
  };
86
90
  }
87
- }, []);
88
- return React__default["default"].createElement("table", _extends({
91
+ }, [stickyHeader]);
92
+ return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("table", _extends({
89
93
  className: classNames__default["default"]('eds-table', {
90
94
  'eds-table--fixed': fixed
91
95
  }, {
@@ -97,8 +101,11 @@ var Table = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, re
97
101
  }, {
98
102
  'eds-table--sticky-header': stickyHeader
99
103
  }, className),
100
- ref: utils.mergeRefs(ref, tableRef)
101
- }, rest));
104
+ ref: utils.mergeRefs(ref, tableRef),
105
+ "aria-describedby": sortable ? sortableHeaderId : undefined
106
+ }, rest)), sortable && React__default["default"].createElement(a11y.VisuallyHidden, {
107
+ id: sortableHeaderId
108
+ }, changeSortDescription));
102
109
  });
103
110
 
104
111
  var _excluded$7 = ["className"];
@@ -163,7 +170,7 @@ var DataCell = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
163
170
  }, rest));
164
171
  });
165
172
 
166
- var _excluded$3 = ["className", "children", "name", "sortable", "sortConfig", "padding", "sortableButtonProps"],
173
+ var _excluded$3 = ["className", "children", "name", "sortable", "sortConfig", "padding", "sortableButtonProps", "sortedAscendingAriaLabel", "sortedDescendingAriaLabel"],
167
174
  _excluded2$1 = ["className"];
168
175
  var HeaderCell = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
169
176
  var className = _ref.className,
@@ -175,6 +182,10 @@ var HeaderCell = /*#__PURE__*/React__default["default"].forwardRef(function (_re
175
182
  _ref$padding = _ref.padding,
176
183
  padding = _ref$padding === void 0 ? 'default' : _ref$padding,
177
184
  sortableButtonProps = _ref.sortableButtonProps,
185
+ _ref$sortedAscendingA = _ref.sortedAscendingAriaLabel,
186
+ sortedAscendingAriaLabel = _ref$sortedAscendingA === void 0 ? ', sortert stigende' : _ref$sortedAscendingA,
187
+ _ref$sortedDescending = _ref.sortedDescendingAriaLabel,
188
+ sortedDescendingAriaLabel = _ref$sortedDescending === void 0 ? ', sortert synkende' : _ref$sortedDescending,
178
189
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
179
190
  var _React$useState = React__default["default"].useState(false),
180
191
  isCurrentlySorted = _React$useState[0],
@@ -182,7 +193,7 @@ var HeaderCell = /*#__PURE__*/React__default["default"].forwardRef(function (_re
182
193
  React__default["default"].useEffect(function () {
183
194
  sortConfig && name && setIsCurrentlySorted(sortConfig && name === sortConfig.key);
184
195
  }, [sortConfig, name]);
185
- var ariaSort = isCurrentlySorted ? sortConfig && sortConfig.order : 'none';
196
+ var ariaSort = isCurrentlySorted ? sortConfig && sortConfig.order : undefined;
186
197
  return React__default["default"].createElement("th", _extends({
187
198
  className: classNames__default["default"]('eds-table__header-cell', className, {
188
199
  'eds-table__header-cell--sortable': sortable,
@@ -195,32 +206,58 @@ var HeaderCell = /*#__PURE__*/React__default["default"].forwardRef(function (_re
195
206
  }, rest), sortable && sortConfig && sortableButtonProps ? React__default["default"].createElement(SortableHeaderCellButton, {
196
207
  sortableButtonProps: sortableButtonProps,
197
208
  sortConfig: sortConfig,
198
- isCurrentlySorted: isCurrentlySorted
209
+ isCurrentlySorted: isCurrentlySorted,
210
+ ariaSort: ariaSort,
211
+ sortedAscendingAriaLabel: sortedAscendingAriaLabel,
212
+ sortedDescendingAriaLabel: sortedDescendingAriaLabel
199
213
  }, children) : children);
200
214
  });
201
215
  var SortableHeaderCellButton = function SortableHeaderCellButton(_ref2) {
202
216
  var sortConfig = _ref2.sortConfig,
203
217
  sortableButtonProps = _ref2.sortableButtonProps,
204
218
  isCurrentlySorted = _ref2.isCurrentlySorted,
205
- children = _ref2.children;
219
+ children = _ref2.children,
220
+ ariaSort = _ref2.ariaSort,
221
+ sortedAscendingAriaLabel = _ref2.sortedAscendingAriaLabel,
222
+ sortedDescendingAriaLabel = _ref2.sortedDescendingAriaLabel;
223
+ var _useState = React.useState(''),
224
+ sortedAriaInfo = _useState[0],
225
+ setSortedAriaInfo = _useState[1];
206
226
  var className = sortableButtonProps.className,
207
227
  rest = _objectWithoutPropertiesLoose(sortableButtonProps, _excluded2$1);
228
+ var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
229
+ React.useEffect(function () {
230
+ var DISMISS_SORT_INFO_TIME = 3000;
231
+ if (sortConfig.order == 'ascending') {
232
+ setSortedAriaInfo(sortedAscendingAriaLabel);
233
+ } else if (sortConfig.order == 'descending') {
234
+ setSortedAriaInfo(sortedDescendingAriaLabel);
235
+ }
236
+ var dismissAriaTimer = setTimeout(function () {
237
+ setSortedAriaInfo('');
238
+ if (isFirefox) setSortedAriaInfo(', sort ' + sortConfig.order);
239
+ }, DISMISS_SORT_INFO_TIME);
240
+ return function () {
241
+ return clearTimeout(dismissAriaTimer);
242
+ };
243
+ }, [sortConfig.order]);
208
244
  return React__default["default"].createElement("button", _extends({
209
245
  className: classNames__default["default"]('eds-table__header-cell-button', className),
210
- type: "button"
246
+ type: "button",
247
+ "aria-sort": ariaSort
211
248
  }, rest), children, (!isCurrentlySorted || sortConfig.order === 'none') && React__default["default"].createElement(icons.UnsortedIcon, {
212
- size: "16px",
249
+ size: "1rem",
213
250
  className: "eds-table__header-cell-button-icon",
214
- "aria-label": "usortert kolonne"
251
+ "aria-hidden": "true"
215
252
  }), isCurrentlySorted && sortConfig.order === 'ascending' && React__default["default"].createElement(icons.UpArrowIcon, {
216
- size: "16px",
253
+ size: "1rem",
217
254
  className: "eds-table__header-cell-button-icon",
218
- "aria-label": "stigende sortert kolonne"
255
+ "aria-hidden": "true"
219
256
  }), isCurrentlySorted && sortConfig.order === 'descending' && React__default["default"].createElement(icons.DownArrowIcon, {
220
- size: "16px",
257
+ size: "1rem",
221
258
  className: "eds-table__header-cell-button-icon",
222
- "aria-label": "synkende sortert kolonne"
223
- }));
259
+ "aria-hidden": "true"
260
+ }), React__default["default"].createElement(a11y.VisuallyHidden, null, isCurrentlySorted && sortedAriaInfo));
224
261
  };
225
262
 
226
263
  var _excluded$2 = ["name", "sortable", "buttonProps"],
@@ -286,8 +323,9 @@ function useSortableData(tableData, externalSortConfig) {
286
323
  }, buttonProps)
287
324
  }, props);
288
325
  };
289
- var getSortableTableProps = function getSortableTableProps(_ref2) {
290
- var _ref2$sortable = _ref2.sortable,
326
+ var getSortableTableProps = function getSortableTableProps(_temp) {
327
+ var _ref2 = _temp === void 0 ? {} : _temp,
328
+ _ref2$sortable = _ref2.sortable,
291
329
  sortable = _ref2$sortable === void 0 ? true : _ref2$sortable,
292
330
  props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
293
331
  return _extends({
@@ -1 +1 @@
1
- {"version":3,"file":"table.cjs.development.js","sources":["../src/Table.tsx","../src/TableHead.tsx","../src/TableBody.tsx","../src/TableFooter.tsx","../src/TableRow.tsx","../src/DataCell.tsx","../src/HeaderCell.tsx","../src/useSortableTable.ts","../src/EditableCell.tsx","../src/ExpandableRow.tsx","../src/ExpandRowButton.tsx","../src/useTableKeyboardNavigation.ts","../src/index.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs } from '@entur/utils';\n\nexport type TableProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Setter tettheten mellom rader og kolonner. Bruk gjerne middle og small for for sider med høy informasjonstetthet\n * @default \"default\"\n */\n spacing?: 'default' | 'middle' | 'small';\n /** Setter kolonne-layout til å være uavhengig av innhold\n * @default false\n */\n fixed?: boolean;\n /** Om header-raden skal bli værende på skjermen når man skroller tabellen\n * @default false\n */\n stickyHeader?: boolean;\n /** Innholdet i tabellen */\n children: React.ReactNode;\n [key: string]: any;\n};\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (\n {\n className,\n fixed = false,\n spacing = 'default',\n sortable = false,\n stickyHeader = false,\n ...rest\n },\n ref,\n ) => {\n const tableRef = useRef<HTMLTableElement>(null);\n\n useEffect(() => {\n if (stickyHeader) {\n /* We check when an inserted div above the header \n is outside our scrolling container to determine when\n the table header becomes sticky. This is necessary\n to conditionally add our box-shadow when the \n header is overlapping table rows */\n const tableElement = tableRef.current;\n const observerElement = document.createElement('div');\n observerElement.classList.add('sticky-observer');\n\n tableElement?.parentNode?.insertBefore(observerElement, tableElement);\n\n const observer = new IntersectionObserver(\n entries => {\n tableElement?.classList.toggle(\n 'eds-table--sticky-header--active',\n !entries[0].isIntersecting,\n );\n },\n { threshold: [0, 1] },\n );\n\n observer.observe(observerElement);\n\n return () => {\n observer.unobserve(observerElement);\n observerElement.remove();\n };\n }\n }, []);\n\n return (\n <table\n className={classNames(\n 'eds-table',\n { 'eds-table--fixed': fixed },\n { 'eds-table--middle': spacing === 'middle' },\n { 'eds-table--small': spacing === 'small' },\n { 'eds-table--sortable': sortable },\n { 'eds-table--sticky-header': stickyHeader },\n className,\n )}\n ref={mergeRefs(ref, tableRef)}\n {...rest}\n />\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableHeadProps = {\n /** Kolonneoverskrifter */\n children: React.ReactNode;\n /** Esktra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>(({ className, ...props }, ref) => (\n <thead\n className={classNames('eds-table__head', className)}\n ref={ref}\n {...props}\n />\n));\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableBodyProps = {\n /** Tabellrader */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n ref?: React.Ref<HTMLTableSectionElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>(({ className, ...rest }, ref) => (\n <tbody\n className={classNames('eds-table__body', className)}\n ref={ref}\n {...rest}\n />\n));\n","import React from 'react';\n\nexport type TableFooterProps = {\n /** Tabellrader */\n children: React.ReactNode;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(({ ...props }, ref) => <tfoot ref={ref} {...props} />);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableRowProps = {\n /** Tabellceller */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /**Hvis satt, så vil tabellraden endre fargen ved hover\n * @default false\n */\n hover?: boolean;\n /** Om raden er klikkbar, så vil raden endre farge, og musepekeren vil symbolisere interaktivitet\n * @default false\n */\n active?: boolean;\n /**Signalisere om at det er en feil i tabellraden\n * @default false\n */\n error?: boolean;\n ref?: React.Ref<HTMLTableRowElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableRowElement>,\n HTMLTableRowElement\n>;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { className, hover = false, active = false, error = false, ...rest },\n ref: React.Ref<HTMLTableRowElement>,\n ) => (\n <tr\n className={classNames('eds-table__row', className, {\n 'eds-table__row--hover': hover,\n 'eds-table__row--active': active,\n 'eds-table__row--error': error,\n })}\n ref={ref}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type DataCellProps = {\n /** Innholdet i tabellcellen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for DataCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n /** Viser en status-sirkel for DataCell */\n status?: 'positive' | 'negative' | 'neutral';\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status = undefined, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\n [`eds-table__data-cell--status-${status}`]: status,\n 'eds-table__data-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__data-cell--padding-radio': padding === 'radio',\n 'eds-table__data-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { DownArrowIcon, UpArrowIcon, UnsortedIcon } from '@entur/icons';\n\nimport { ExternalSortConfig } from '.';\n\nimport './HeaderCell.scss';\n\nexport type HeaderCellProps = {\n /** Kolonneoverskrift */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for HeaderCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n\n /** Ekstra props som kan sendes til sorteringsknappelementet. Benyttes via useSortableTable */\n sortableButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /** Om komponenten brukes til sortering. Benytt via useSortableTable\n * @default false\n */\n sortable?: boolean;\n /** Konfigurering og rekkefølgen på sortering. Benyttes via useSortableTable */\n sortConfig?: ExternalSortConfig;\n /** Navnet det skal sorteres på. Benyttes via useSortableTable */\n name?: string;\n} & React.DetailedHTMLProps<\n React.ThHTMLAttributes<HTMLTableCellElement>,\n HTMLTableCellElement\n>;\n\nexport const HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n HeaderCellProps\n>(\n (\n {\n className,\n children,\n name,\n sortable = false,\n sortConfig,\n padding = 'default',\n sortableButtonProps,\n ...rest\n },\n ref,\n ) => {\n const [isCurrentlySorted, setIsCurrentlySorted] =\n React.useState<boolean>(false);\n React.useEffect(() => {\n sortConfig &&\n name &&\n setIsCurrentlySorted(sortConfig && name === sortConfig.key);\n }, [sortConfig, name]);\n const ariaSort = isCurrentlySorted\n ? sortConfig && sortConfig.order\n : 'none';\n\n return (\n <th\n className={classNames('eds-table__header-cell', className, {\n 'eds-table__header-cell--sortable': sortable,\n 'eds-table__header-cell--padding-radio': padding === 'radio',\n 'eds-table__header-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__header-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n aria-sort={ariaSort}\n ref={ref}\n {...rest}\n >\n {sortable && sortConfig && sortableButtonProps ? (\n <SortableHeaderCellButton\n sortableButtonProps={sortableButtonProps}\n sortConfig={sortConfig}\n isCurrentlySorted={isCurrentlySorted}\n >\n {children}\n </SortableHeaderCellButton>\n ) : (\n children\n )}\n </th>\n );\n },\n);\n\ntype SortableHeaderCellButtonProps = {\n sortConfig: ExternalSortConfig;\n isCurrentlySorted: boolean;\n sortableButtonProps: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n};\n\nconst SortableHeaderCellButton: React.FC<SortableHeaderCellButtonProps> = ({\n sortConfig,\n sortableButtonProps,\n isCurrentlySorted,\n children,\n}) => {\n const { className, ...rest } = sortableButtonProps;\n return (\n <button\n className={classNames('eds-table__header-cell-button', className)}\n type=\"button\"\n {...rest}\n >\n {children}\n {(!isCurrentlySorted || sortConfig.order === 'none') && (\n <UnsortedIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"usortert kolonne\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"stigende sortert kolonne\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"synkende sortert kolonne\"\n />\n )}\n </button>\n );\n};\n","import { useState, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';\nimport get from 'lodash.get';\n\nexport type ExternalSortConfig = {\n /**\n * @default \"\"\n */\n key: string;\n /** @default \"none\" */\n order: 'ascending' | 'descending' | 'none';\n};\n\nexport function useSortableData<T>(\n tableData: T[],\n externalSortConfig: ExternalSortConfig = { key: '', order: 'none' },\n): {\n sortedData: T[];\n getSortableHeaderProps: (\n args: SortableHeaderProps,\n ) => SortableHeaderReturnProps;\n getSortableTableProps: (args: SortableTableProps) => SortableTableReturnProps;\n} {\n const [sortConfig, setSortConfig] = useState(externalSortConfig);\n\n const onSortRequested = (key: string) => {\n const sortingNewColumn = key !== sortConfig.key;\n if (sortingNewColumn || sortConfig.order === 'none')\n return setSortConfig({ key, order: 'ascending' });\n if (sortConfig.order === 'ascending')\n return setSortConfig({ key, order: 'descending' });\n if (sortConfig.order === 'descending')\n return setSortConfig({ key, order: 'none' });\n };\n\n const tableSortedAscending = [...tableData].sort((a: any, b: any) => {\n const valueOfA = get(a, sortConfig.key, a);\n const valueOfB = get(b, sortConfig.key, b);\n\n const comparableAValue =\n typeof valueOfA === 'string' ? valueOfA.toLowerCase() : valueOfA;\n const comparableBValue =\n typeof valueOfB === 'string' ? valueOfB.toLowerCase() : valueOfB;\n\n if (comparableAValue < comparableBValue) return -1;\n if (comparableAValue > comparableBValue) return 1;\n return 0;\n });\n\n const getSortedData: () => T[] = () => {\n if (sortConfig.order === 'none') {\n return tableData;\n }\n if (sortConfig.order === 'descending') {\n return [...tableSortedAscending].reverse();\n }\n return tableSortedAscending;\n };\n\n const sortedData = getSortedData();\n\n const getSortableHeaderProps = ({\n name,\n sortable = true,\n buttonProps,\n ...props\n }: SortableHeaderProps): SortableHeaderReturnProps => {\n return {\n name,\n sortable,\n sortConfig: sortConfig,\n sortableButtonProps: {\n onClick: () => onSortRequested(name),\n ...buttonProps,\n },\n ...props,\n };\n };\n\n const getSortableTableProps = ({\n sortable = true,\n ...props\n }: SortableTableProps): SortableTableReturnProps => {\n return {\n sortable,\n sortConfig: sortConfig,\n ...props,\n };\n };\n\n return { sortedData, getSortableHeaderProps, getSortableTableProps };\n}\n\nexport type SortableHeaderProps = {\n /** Navnet headeren skal se etter i forhold til sortering av items */\n name: string;\n /** Om headeren skal være sorterbar eller ikke\n * @default true */\n sortable?: boolean;\n /** Props som sendes til knapp-elementet */\n buttonProps?: Omit<\n DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >,\n 'type' | 'onClick'\n >;\n [key: string]: any;\n};\n\nexport type SortableHeaderReturnProps = {\n name: string;\n sortable: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n\nexport type SortableTableProps = {\n /** @default true */\n sortable?: boolean;\n [key: string]: any;\n};\n\nexport type SortableTableReturnProps = {\n /** @default true */\n sortable?: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n","import classNames from 'classnames';\nimport React from 'react';\nimport { DataCell } from './DataCell';\nimport { VariantProvider, VariantType } from '@entur/form';\nimport { Tooltip } from '@entur/tooltip';\nimport './EditableCell.scss';\n\ntype EditableCellProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Inputelementet som skal være i tabellcellen */\n children: React.ReactElement;\n /** Valideringsvariant for EditableCell */\n variant?: VariantType;\n /** Varselmelding, som vil komme som en Tooltip under EditableCell */\n feedback?: string;\n /** Om cellen skal vise omriss til enhver tid\n * @default false\n */\n outlined?: boolean;\n [key: string]: any;\n};\n\nexport const EditableCell: React.FC<EditableCellProps> = ({\n children,\n className,\n feedback,\n variant,\n outlined = false,\n ...rest\n}) => {\n return (\n <VariantProvider variant={variant}>\n <DataCell\n className={classNames(\n 'eds-editable-cell',\n {\n 'eds-editable-cell--outlined': outlined,\n },\n className,\n )}\n {...rest}\n >\n <Tooltip\n disableHoverListener={!feedback}\n disableFocusListener={!feedback}\n placement=\"bottom\"\n content={feedback || undefined}\n variant={feedback ? 'error' : undefined}\n >\n {children}\n </Tooltip>\n </DataCell>\n </VariantProvider>\n );\n};\n","import React from 'react';\nimport { BaseExpand } from '@entur/expand';\n\nexport type ExpandableRowProps = {\n /** Antall kolonner tabellraden er */\n colSpan: number;\n /** Innholdet til ExpandableRow */\n children: React.ReactNode;\n /** Om ExpandableRow er åpen\n * @default false\n */\n open?: boolean;\n};\n\nexport const ExpandableRow: React.FC<ExpandableRowProps> = ({\n open = false,\n children,\n colSpan,\n}) => {\n return (\n <tr>\n <td colSpan={colSpan}>\n <BaseExpand open={open}>{children}</BaseExpand>\n </td>\n </tr>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DownArrowIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport './ExpandRowButton.scss';\n\nexport type ExpandRowButtonProps = {\n open: boolean;\n onClick: (e: React.MouseEvent) => void;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const ExpandRowButton: React.FC<ExpandRowButtonProps> = ({\n open,\n onClick,\n ...rest\n}) => {\n return (\n <IconButton\n className={classNames('eds-expand-row-button', {\n 'eds-expand-row-button--open': open,\n })}\n onClick={onClick}\n aria-label={open ? 'Lukk tabellrad' : 'Utvid tabellrad'}\n {...rest}\n >\n <DownArrowIcon className=\"eds-expand-row-button__icon\" />\n </IconButton>\n );\n};\n","import { useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport { TableBodyProps, TableRowProps } from './index';\n\nfunction onTableKeypress(\n event: KeyboardEvent,\n currentRow: number,\n maxRow: number,\n allowWrap?: boolean,\n) {\n const keyPress = event.key;\n switch (keyPress) {\n case 'ArrowUp':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === 0 ? maxRow - 1 : currentRow - 1;\n } else {\n return currentRow > 0 ? currentRow - 1 : 0;\n }\n case 'ArrowDown':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === maxRow - 1 ? 0 : currentRow + 1;\n } else {\n return currentRow < maxRow - 1 ? currentRow + 1 : currentRow;\n }\n default:\n return currentRow;\n }\n}\n\nexport type useTableKeyboardNavigationProps = (\n /** Antall rader i tabellen */\n numberOfRows: number,\n /** Tillate at man kan navigere sirkulært\n * @default false\n */\n allowWrap?: boolean,\n) => {\n getTableRowNavigationProps: (\n /** Raden i tabellen (0-indeksert) */\n row: number,\n ) => Partial<TableRowProps>;\n getTableBodyNavigationProps: () => Partial<TableBodyProps>;\n};\n\nexport const useTableKeyboardNavigation: useTableKeyboardNavigationProps = (\n numberOfRows = 0,\n allowWrap = true,\n) => {\n const [currentRow, setCurrentRow] = useState(numberOfRows);\n const [maxRow, setMaxRow] = useState(0);\n\n const tableBodyRef = useRef<HTMLTableSectionElement>(null);\n const tableHasFocus = tableBodyRef?.current?.contains(document.activeElement);\n\n useEffect(() => {\n tableBodyRef &&\n tableBodyRef.current &&\n tableHasFocus &&\n tableBodyRef.current.childNodes[\n currentRow\n ].childNodes[0].parentElement?.focus();\n }, [currentRow, tableHasFocus]);\n\n function getTableBodyNavigationProps(...rest: any): Partial<TableBodyProps> {\n return {\n ref: tableBodyRef,\n ...rest,\n };\n }\n\n const tableRowRef = useRef<HTMLTableRowElement>(null);\n function getTableRowNavigationProps(\n row: number,\n ...rest: any\n ): Partial<TableRowProps> {\n if (row >= maxRow) {\n setMaxRow(row + 1);\n }\n const tabIndex = currentRow ? 0 : -1;\n return {\n tabIndex,\n ref: tableRowRef,\n onClick: () => setCurrentRow(row),\n onKeyDown: (e: KeyboardEvent) => {\n const newCell = onTableKeypress(e, currentRow, numberOfRows, allowWrap);\n setCurrentRow(newCell);\n },\n ...rest,\n };\n }\n return { getTableRowNavigationProps, getTableBodyNavigationProps };\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('table');\n\nexport * from './Table';\nexport * from './TableHead';\nexport * from './TableBody';\nexport * from './TableFooter';\nexport * from './TableRow';\nexport * from './DataCell';\nexport * from './HeaderCell';\nexport * from './useSortableTable';\nexport * from './EditableCell';\nexport * from './ExpandableRow';\nexport * from './ExpandRowButton';\nexport * from './useTableKeyboardNavigation';\n"],"names":["Table","React","forwardRef","ref","className","fixed","spacing","sortable","stickyHeader","rest","_excluded","tableRef","useRef","useEffect","tableElement","current","observerElement","document","createElement","classList","add","parentNode","insertBefore","observer","IntersectionObserver","entries","toggle","isIntersecting","threshold","observe","unobserve","remove","classNames","mergeRefs","TableHead","props","TableBody","TableFooter","TableRow","hover","active","error","DataCell","padding","status","undefined","HeaderCell","children","name","sortConfig","sortableButtonProps","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","_excluded2","type","UnsortedIcon","size","UpArrowIcon","DownArrowIcon","useSortableData","tableData","externalSortConfig","setSortConfig","onSortRequested","sortingNewColumn","tableSortedAscending","sort","a","b","valueOfA","get","valueOfB","comparableAValue","toLowerCase","comparableBValue","getSortedData","reverse","sortedData","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","EditableCell","feedback","variant","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","ExpandableRow","open","colSpan","BaseExpand","ExpandRowButton","IconButton","onTableKeypress","event","currentRow","maxRow","allowWrap","keyPress","preventDefault","useTableKeyboardNavigation","numberOfRows","setCurrentRow","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","childNodes","parentElement","focus","getTableBodyNavigationProps","tableRowRef","getTableRowNavigationProps","row","tabIndex","onKeyDown","e","newCell","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,IAAMA,KAAK,gBAAGC,yBAAK,CAACC,UAAU,CACnC,UASEC,IAAAA,EAAAA,GAAG,EACD;EAAA,IARAC,SAAS,QAATA,SAAS;AAAA,IAAA,UAAA,GAAA,IAAA,CACTC,KAAK;AAALA,IAAAA,KAAK,2BAAG,KAAK,GAAA,UAAA;AAAA,IAAA,YAAA,GAAA,IAAA,CACbC,OAAO;AAAPA,IAAAA,OAAO,6BAAG,SAAS,GAAA,YAAA;AAAA,IAAA,aAAA,GAAA,IAAA,CACnBC,QAAQ;AAARA,IAAAA,QAAQ,8BAAG,KAAK,GAAA,aAAA;AAAA,IAAA,iBAAA,GAAA,IAAA,CAChBC,YAAY;AAAZA,IAAAA,YAAY,kCAAG,KAAK,GAAA,iBAAA;IACjBC,IAAI,GAAA,6BAAA,CAAA,IAAA,EAAAC,WAAA,CAAA,CAAA;AAIT,EAAA,IAAMC,QAAQ,GAAGC,YAAM,CAAmB,IAAI,CAAC,CAAA;AAE/CC,EAAAA,eAAS,CAAC,YAAK;AACb,IAAA,IAAIL,YAAY,EAAE;AAAA,MAAA,IAAA,qBAAA,CAAA;AAChB;;;;AAIqC;AACrC,MAAA,IAAMM,YAAY,GAAGH,QAAQ,CAACI,OAAO,CAAA;AACrC,MAAA,IAAMC,eAAe,GAAGC,QAAQ,CAACC,aAAa,CAAC,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AAAA;GAA6B,CAAA;AACpE;;ACzFAQ,4BAAsB,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"table.cjs.development.js","sources":["../src/Table.tsx","../src/TableHead.tsx","../src/TableBody.tsx","../src/TableFooter.tsx","../src/TableRow.tsx","../src/DataCell.tsx","../src/HeaderCell.tsx","../src/useSortableTable.ts","../src/EditableCell.tsx","../src/ExpandableRow.tsx","../src/ExpandRowButton.tsx","../src/useTableKeyboardNavigation.ts","../src/index.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport classNames from 'classnames';\nimport { useRandomId, mergeRefs } from '@entur/utils';\nimport { VisuallyHidden } from '@entur/a11y';\n\nexport type TableProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Setter tettheten mellom rader og kolonner. Bruk gjerne middle og small for for sider med høy informasjonstetthet\n * @default \"default\"\n */\n spacing?: 'default' | 'middle' | 'small';\n /** Setter kolonne-layout til å være uavhengig av innhold\n * @default false\n */\n fixed?: boolean;\n /** Om header-raden skal bli værende på skjermen når man skroller tabellen\n * @default false\n */\n stickyHeader?: boolean;\n /** Innholdet i tabellen */\n children: React.ReactNode;\n [key: string]: any;\n};\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (\n {\n className,\n fixed = false,\n spacing = 'default',\n sortable = false,\n changeSortDescription = 'Tabelloverskrifter med knapper kan trykkes på for å endre sortering,',\n stickyHeader = false,\n ...rest\n },\n ref,\n ) => {\n const sortableHeaderId = useRandomId('sortable-header');\n\n const tableRef = useRef<HTMLTableElement>(null);\n\n useEffect(() => {\n if (stickyHeader) {\n /* We check when an inserted div above the header \n is outside our scrolling container to determine when\n the table header becomes sticky. This is necessary\n to conditionally add our box-shadow when the \n header is overlapping table rows */\n const tableElement = tableRef.current;\n const observerElement = document.createElement('div');\n observerElement.classList.add('sticky-observer');\n\n tableElement?.parentNode?.insertBefore(observerElement, tableElement);\n\n const observer = new IntersectionObserver(\n entries => {\n tableElement?.classList.toggle(\n 'eds-table--sticky-header--active',\n !entries[0].isIntersecting,\n );\n },\n { threshold: [0, 1] },\n );\n\n observer.observe(observerElement);\n\n return () => {\n observer.unobserve(observerElement);\n observerElement.remove();\n };\n }\n }, [stickyHeader]);\n\n return (\n <>\n <table\n className={classNames(\n 'eds-table',\n { 'eds-table--fixed': fixed },\n { 'eds-table--middle': spacing === 'middle' },\n { 'eds-table--small': spacing === 'small' },\n { 'eds-table--sortable': sortable },\n { 'eds-table--sticky-header': stickyHeader },\n className,\n )}\n ref={mergeRefs(ref, tableRef)}\n aria-describedby={sortable ? sortableHeaderId : undefined}\n {...rest}\n />\n {sortable && (\n <VisuallyHidden id={sortableHeaderId}>\n {changeSortDescription}\n </VisuallyHidden>\n )}\n </>\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableHeadProps = {\n /** Kolonneoverskrifter */\n children: React.ReactNode;\n /** Esktra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>(({ className, ...props }, ref) => (\n <thead\n className={classNames('eds-table__head', className)}\n ref={ref}\n {...props}\n />\n));\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableBodyProps = {\n /** Tabellrader */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n ref?: React.Ref<HTMLTableSectionElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>(({ className, ...rest }, ref) => (\n <tbody\n className={classNames('eds-table__body', className)}\n ref={ref}\n {...rest}\n />\n));\n","import React from 'react';\n\nexport type TableFooterProps = {\n /** Tabellrader */\n children: React.ReactNode;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(({ ...props }, ref) => <tfoot ref={ref} {...props} />);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableRowProps = {\n /** Tabellceller */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /**Hvis satt, så vil tabellraden endre fargen ved hover\n * @default false\n */\n hover?: boolean;\n /** Om raden er klikkbar, så vil raden endre farge, og musepekeren vil symbolisere interaktivitet\n * @default false\n */\n active?: boolean;\n /**Signalisere om at det er en feil i tabellraden\n * @default false\n */\n error?: boolean;\n ref?: React.Ref<HTMLTableRowElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableRowElement>,\n HTMLTableRowElement\n>;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { className, hover = false, active = false, error = false, ...rest },\n ref: React.Ref<HTMLTableRowElement>,\n ) => (\n <tr\n className={classNames('eds-table__row', className, {\n 'eds-table__row--hover': hover,\n 'eds-table__row--active': active,\n 'eds-table__row--error': error,\n })}\n ref={ref}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type DataCellProps = {\n /** Innholdet i tabellcellen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for DataCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n /** Viser en status-sirkel for DataCell */\n status?: 'positive' | 'negative' | 'neutral';\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status = undefined, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\n [`eds-table__data-cell--status-${status}`]: status,\n 'eds-table__data-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__data-cell--padding-radio': padding === 'radio',\n 'eds-table__data-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n {...rest}\n />\n ),\n);\n","import React, { useEffect, useState } from 'react';\nimport classNames from 'classnames';\n\nimport { DownArrowIcon, UpArrowIcon, UnsortedIcon } from '@entur/icons';\n\nimport { ExternalSortConfig } from '.';\n\nimport './HeaderCell.scss';\nimport { VisuallyHidden } from '@entur/a11y';\n\nexport type HeaderCellProps = {\n /** Kolonneoverskrift */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for HeaderCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n\n /** Ekstra props som kan sendes til sorteringsknappelementet. Benyttes via useSortableTable */\n sortableButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /** Om komponenten brukes til sortering. Benytt via useSortableTable\n * @default false\n */\n sortable?: boolean;\n /** Konfigurering og rekkefølgen på sortering. Benyttes via useSortableTable */\n sortConfig?: ExternalSortConfig;\n /** Navnet det skal sorteres på. Benyttes via useSortableTable */\n name?: string;\n sortedAscendingAriaLabel?: string;\n sortedDescendingAriaLabel?: string;\n} & React.DetailedHTMLProps<\n React.ThHTMLAttributes<HTMLTableCellElement>,\n HTMLTableCellElement\n>;\n\nexport const HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n HeaderCellProps\n>(\n (\n {\n className,\n children,\n name,\n sortable = false,\n sortConfig,\n padding = 'default',\n sortableButtonProps,\n sortedAscendingAriaLabel = ', sortert stigende',\n sortedDescendingAriaLabel = ', sortert synkende',\n ...rest\n },\n ref,\n ) => {\n const [isCurrentlySorted, setIsCurrentlySorted] =\n React.useState<boolean>(false);\n React.useEffect(() => {\n sortConfig &&\n name &&\n setIsCurrentlySorted(sortConfig && name === sortConfig.key);\n }, [sortConfig, name]);\n const ariaSort = isCurrentlySorted\n ? sortConfig && sortConfig.order\n : undefined;\n\n return (\n <th\n className={classNames('eds-table__header-cell', className, {\n 'eds-table__header-cell--sortable': sortable,\n 'eds-table__header-cell--padding-radio': padding === 'radio',\n 'eds-table__header-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__header-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n aria-sort={ariaSort}\n ref={ref}\n {...rest}\n >\n {sortable && sortConfig && sortableButtonProps ? (\n <SortableHeaderCellButton\n sortableButtonProps={sortableButtonProps}\n sortConfig={sortConfig}\n isCurrentlySorted={isCurrentlySorted}\n ariaSort={ariaSort}\n sortedAscendingAriaLabel={sortedAscendingAriaLabel}\n sortedDescendingAriaLabel={sortedDescendingAriaLabel}\n >\n {children}\n </SortableHeaderCellButton>\n ) : (\n children\n )}\n </th>\n );\n },\n);\n\ntype SortableHeaderCellButtonProps = {\n sortConfig: ExternalSortConfig;\n isCurrentlySorted: boolean;\n sortableButtonProps: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n ariaSort?: 'none' | 'ascending' | 'descending' | 'other' | undefined;\n sortedAscendingAriaLabel?: string;\n sortedDescendingAriaLabel?: string;\n};\n\nconst SortableHeaderCellButton: React.FC<SortableHeaderCellButtonProps> = ({\n sortConfig,\n sortableButtonProps,\n isCurrentlySorted,\n children,\n ariaSort,\n sortedAscendingAriaLabel,\n sortedDescendingAriaLabel,\n}) => {\n const [sortedAriaInfo, setSortedAriaInfo] = useState<string | undefined>('');\n\n const { className, ...rest } = sortableButtonProps;\n\n const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\n useEffect(() => {\n const DISMISS_SORT_INFO_TIME = 3000;\n if (sortConfig.order == 'ascending') {\n setSortedAriaInfo(sortedAscendingAriaLabel);\n } else if (sortConfig.order == 'descending') {\n setSortedAriaInfo(sortedDescendingAriaLabel);\n }\n const dismissAriaTimer = setTimeout(() => {\n setSortedAriaInfo('');\n if (isFirefox) setSortedAriaInfo(', sort ' + sortConfig.order);\n }, DISMISS_SORT_INFO_TIME);\n\n return () => clearTimeout(dismissAriaTimer);\n }, [sortConfig.order]);\n\n return (\n <button\n className={classNames('eds-table__header-cell-button', className)}\n type=\"button\"\n aria-sort={ariaSort}\n {...rest}\n >\n {children}\n {(!isCurrentlySorted || sortConfig.order === 'none') && (\n <UnsortedIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n <VisuallyHidden>{isCurrentlySorted && sortedAriaInfo}</VisuallyHidden>\n </button>\n );\n};\n","import { useState, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';\nimport get from 'lodash.get';\n\nexport type ExternalSortConfig = {\n /**\n * @default \"\"\n */\n key: string;\n /** @default \"none\" */\n order: 'ascending' | 'descending' | 'none';\n};\n\nexport function useSortableData<T>(\n tableData: T[],\n externalSortConfig: ExternalSortConfig = { key: '', order: 'none' },\n): {\n sortedData: T[];\n getSortableHeaderProps: (\n args: SortableHeaderProps,\n ) => SortableHeaderReturnProps;\n getSortableTableProps: (\n args?: SortableTableProps,\n ) => SortableTableReturnProps;\n} {\n const [sortConfig, setSortConfig] = useState(externalSortConfig);\n\n const onSortRequested = (key: string) => {\n const sortingNewColumn = key !== sortConfig.key;\n if (sortingNewColumn || sortConfig.order === 'none')\n return setSortConfig({ key, order: 'ascending' });\n if (sortConfig.order === 'ascending')\n return setSortConfig({ key, order: 'descending' });\n if (sortConfig.order === 'descending')\n return setSortConfig({ key, order: 'none' });\n };\n\n const tableSortedAscending = [...tableData].sort((a: any, b: any) => {\n const valueOfA = get(a, sortConfig.key, a);\n const valueOfB = get(b, sortConfig.key, b);\n\n const comparableAValue =\n typeof valueOfA === 'string' ? valueOfA.toLowerCase() : valueOfA;\n const comparableBValue =\n typeof valueOfB === 'string' ? valueOfB.toLowerCase() : valueOfB;\n\n if (comparableAValue < comparableBValue) return -1;\n if (comparableAValue > comparableBValue) return 1;\n return 0;\n });\n\n const getSortedData: () => T[] = () => {\n if (sortConfig.order === 'none') {\n return tableData;\n }\n if (sortConfig.order === 'descending') {\n return [...tableSortedAscending].reverse();\n }\n return tableSortedAscending;\n };\n\n const sortedData = getSortedData();\n\n const getSortableHeaderProps = ({\n name,\n sortable = true,\n buttonProps,\n ...props\n }: SortableHeaderProps): SortableHeaderReturnProps => {\n return {\n name,\n sortable,\n sortConfig: sortConfig,\n sortableButtonProps: {\n onClick: () => onSortRequested(name),\n ...buttonProps,\n },\n ...props,\n };\n };\n\n const getSortableTableProps = ({\n sortable = true,\n ...props\n }: SortableTableProps = {}): SortableTableReturnProps => {\n return {\n sortable,\n sortConfig: sortConfig,\n ...props,\n };\n };\n\n return { sortedData, getSortableHeaderProps, getSortableTableProps };\n}\n\nexport type SortableHeaderProps = {\n /** Navnet headeren skal se etter i forhold til sortering av items */\n name: string;\n /** Om headeren skal være sorterbar eller ikke\n * @default true */\n sortable?: boolean;\n /** Props som sendes til knapp-elementet */\n buttonProps?: Omit<\n DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >,\n 'type' | 'onClick'\n >;\n [key: string]: any;\n};\n\nexport type SortableHeaderReturnProps = {\n name: string;\n sortable: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n\nexport type SortableTableProps = {\n /** @default true */\n sortable?: boolean;\n [key: string]: any;\n};\n\nexport type SortableTableReturnProps = {\n /** @default true */\n sortable?: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n","import classNames from 'classnames';\nimport React from 'react';\nimport { DataCell } from './DataCell';\nimport { VariantProvider, VariantType } from '@entur/form';\nimport { Tooltip } from '@entur/tooltip';\nimport './EditableCell.scss';\n\ntype EditableCellProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Inputelementet som skal være i tabellcellen */\n children: React.ReactElement;\n /** Valideringsvariant for EditableCell */\n variant?: VariantType;\n /** Varselmelding, som vil komme som en Tooltip under EditableCell */\n feedback?: string;\n /** Om cellen skal vise omriss til enhver tid\n * @default false\n */\n outlined?: boolean;\n [key: string]: any;\n};\n\nexport const EditableCell: React.FC<EditableCellProps> = ({\n children,\n className,\n feedback,\n variant,\n outlined = false,\n ...rest\n}) => {\n return (\n <VariantProvider variant={variant}>\n <DataCell\n className={classNames(\n 'eds-editable-cell',\n {\n 'eds-editable-cell--outlined': outlined,\n },\n className,\n )}\n {...rest}\n >\n <Tooltip\n disableHoverListener={!feedback}\n disableFocusListener={!feedback}\n placement=\"bottom\"\n content={feedback || undefined}\n variant={feedback ? 'error' : undefined}\n >\n {children}\n </Tooltip>\n </DataCell>\n </VariantProvider>\n );\n};\n","import React from 'react';\nimport { BaseExpand } from '@entur/expand';\n\nexport type ExpandableRowProps = {\n /** Antall kolonner tabellraden er */\n colSpan: number;\n /** Innholdet til ExpandableRow */\n children: React.ReactNode;\n /** Om ExpandableRow er åpen\n * @default false\n */\n open?: boolean;\n};\n\nexport const ExpandableRow: React.FC<ExpandableRowProps> = ({\n open = false,\n children,\n colSpan,\n}) => {\n return (\n <tr>\n <td colSpan={colSpan}>\n <BaseExpand open={open}>{children}</BaseExpand>\n </td>\n </tr>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DownArrowIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport './ExpandRowButton.scss';\n\nexport type ExpandRowButtonProps = {\n open: boolean;\n onClick: (e: React.MouseEvent) => void;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const ExpandRowButton: React.FC<ExpandRowButtonProps> = ({\n open,\n onClick,\n ...rest\n}) => {\n return (\n <IconButton\n className={classNames('eds-expand-row-button', {\n 'eds-expand-row-button--open': open,\n })}\n onClick={onClick}\n aria-label={open ? 'Lukk tabellrad' : 'Utvid tabellrad'}\n {...rest}\n >\n <DownArrowIcon className=\"eds-expand-row-button__icon\" />\n </IconButton>\n );\n};\n","import { useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport { TableBodyProps, TableRowProps } from './index';\n\nfunction onTableKeypress(\n event: KeyboardEvent,\n currentRow: number,\n maxRow: number,\n allowWrap?: boolean,\n) {\n const keyPress = event.key;\n switch (keyPress) {\n case 'ArrowUp':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === 0 ? maxRow - 1 : currentRow - 1;\n } else {\n return currentRow > 0 ? currentRow - 1 : 0;\n }\n case 'ArrowDown':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === maxRow - 1 ? 0 : currentRow + 1;\n } else {\n return currentRow < maxRow - 1 ? currentRow + 1 : currentRow;\n }\n default:\n return currentRow;\n }\n}\n\nexport type useTableKeyboardNavigationProps = (\n /** Antall rader i tabellen */\n numberOfRows: number,\n /** Tillate at man kan navigere sirkulært\n * @default false\n */\n allowWrap?: boolean,\n) => {\n getTableRowNavigationProps: (\n /** Raden i tabellen (0-indeksert) */\n row: number,\n ) => Partial<TableRowProps>;\n getTableBodyNavigationProps: () => Partial<TableBodyProps>;\n};\n\nexport const useTableKeyboardNavigation: useTableKeyboardNavigationProps = (\n numberOfRows = 0,\n allowWrap = true,\n) => {\n const [currentRow, setCurrentRow] = useState(numberOfRows);\n const [maxRow, setMaxRow] = useState(0);\n\n const tableBodyRef = useRef<HTMLTableSectionElement>(null);\n const tableHasFocus = tableBodyRef?.current?.contains(document.activeElement);\n\n useEffect(() => {\n tableBodyRef &&\n tableBodyRef.current &&\n tableHasFocus &&\n tableBodyRef.current.childNodes[\n currentRow\n ].childNodes[0].parentElement?.focus();\n }, [currentRow, tableHasFocus]);\n\n function getTableBodyNavigationProps(...rest: any): Partial<TableBodyProps> {\n return {\n ref: tableBodyRef,\n ...rest,\n };\n }\n\n const tableRowRef = useRef<HTMLTableRowElement>(null);\n function getTableRowNavigationProps(\n row: number,\n ...rest: any\n ): Partial<TableRowProps> {\n if (row >= maxRow) {\n setMaxRow(row + 1);\n }\n const tabIndex = currentRow ? 0 : -1;\n return {\n tabIndex,\n ref: tableRowRef,\n onClick: () => setCurrentRow(row),\n onKeyDown: (e: KeyboardEvent) => {\n const newCell = onTableKeypress(e, currentRow, numberOfRows, allowWrap);\n setCurrentRow(newCell);\n },\n ...rest,\n };\n }\n return { getTableRowNavigationProps, getTableBodyNavigationProps };\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('table');\n\nexport * from './Table';\nexport * from './TableHead';\nexport * from './TableBody';\nexport * from './TableFooter';\nexport * from './TableRow';\nexport * from './DataCell';\nexport * from './HeaderCell';\nexport * from './useSortableTable';\nexport * from './EditableCell';\nexport * from './ExpandableRow';\nexport * from './ExpandRowButton';\nexport * from './useTableKeyboardNavigation';\n"],"names":["Table","React","forwardRef","ref","className","fixed","spacing","sortable","changeSortDescription","stickyHeader","rest","_excluded","sortableHeaderId","useRandomId","tableRef","useRef","useEffect","tableElement","current","observerElement","document","createElement","classList","add","parentNode","insertBefore","observer","IntersectionObserver","entries","toggle","isIntersecting","threshold","observe","unobserve","remove","Fragment","classNames","mergeRefs","undefined","VisuallyHidden","id","TableHead","props","TableBody","TableFooter","TableRow","hover","active","error","DataCell","padding","status","HeaderCell","children","name","sortConfig","sortableButtonProps","sortedAscendingAriaLabel","sortedDescendingAriaLabel","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","sortedAriaInfo","setSortedAriaInfo","_excluded2","isFirefox","navigator","userAgent","toLowerCase","indexOf","DISMISS_SORT_INFO_TIME","dismissAriaTimer","setTimeout","clearTimeout","type","UnsortedIcon","size","UpArrowIcon","DownArrowIcon","useSortableData","tableData","externalSortConfig","setSortConfig","onSortRequested","sortingNewColumn","tableSortedAscending","sort","a","b","valueOfA","get","valueOfB","comparableAValue","comparableBValue","getSortedData","reverse","sortedData","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","EditableCell","feedback","variant","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","ExpandableRow","open","colSpan","BaseExpand","ExpandRowButton","IconButton","onTableKeypress","event","currentRow","maxRow","allowWrap","keyPress","preventDefault","useTableKeyboardNavigation","numberOfRows","setCurrentRow","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","childNodes","parentElement","focus","getTableBodyNavigationProps","tableRowRef","getTableRowNavigationProps","row","tabIndex","onKeyDown","e","newCell","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAMA,KAAK,gBAAGC,yBAAK,CAACC,UAAU,CACnC,UAUEC,IAAAA,EAAAA,GAAG,EACD;EAAA,IATAC,SAAS,QAATA,SAAS;AAAA,IAAA,UAAA,GAAA,IAAA,CACTC,KAAK;AAALA,IAAAA,KAAK,2BAAG,KAAK,GAAA,UAAA;AAAA,IAAA,YAAA,GAAA,IAAA,CACbC,OAAO;AAAPA,IAAAA,OAAO,6BAAG,SAAS,GAAA,YAAA;AAAA,IAAA,aAAA,GAAA,IAAA,CACnBC,QAAQ;AAARA,IAAAA,QAAQ,8BAAG,KAAK,GAAA,aAAA;AAAA,IAAA,qBAAA,GAAA,IAAA,CAChBC,qBAAqB;AAArBA,IAAAA,qBAAqB,sCAAG,sEAAsE,GAAA,qBAAA;AAAA,IAAA,iBAAA,GAAA,IAAA,CAC9FC,YAAY;AAAZA,IAAAA,YAAY,kCAAG,KAAK,GAAA,iBAAA;IACjBC,IAAI,GAAA,6BAAA,CAAA,IAAA,EAAAC,WAAA,CAAA,CAAA;AAIT,EAAA,IAAMC,gBAAgB,GAAGC,iBAAW,CAAC,iBAAiB,CAAC,CAAA;AAEv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UAAU,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AAAC,IAAA,KAAA,IAAA,KAAA,GAAA,SAAA,CAAA,MAAA,EALlCjH,IAAS,GAAA,IAAA,KAAA,CAAA,KAAA,GAAA,CAAA,GAAA,KAAA,GAAA,CAAA,GAAA,CAAA,CAAA,EAAA,KAAA,GAAA,CAAA,EAAA,KAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA;MAATA,IAAS,CAAA,KAAA,GAAA,CAAA,CAAA,GAAA,SAAA,CAAA,KAAA,CAAA,CAAA;AAAA,KAAA;AAMZ,IAAA,OAAA,QAAA,CAAA;AACEqI,MAAAA,QAAQ,EAARA,QAAQ;AACR5I,MAAAA,GAAG,EAAEyI,WAAW;AAChBrC,MAAAA,OAAO,EAAE,SAAA,OAAA,GAAA;QAAA,OAAM2B,aAAa,CAACY,GAAG,CAAC,CAAA;AAAA,OAAA;MACjCE,SAAS,EAAE,SAACC,SAAAA,CAAAA,CAAgB,EAAI;QAC9B,IAAMC,OAAO,GAAGzB,eAAe,CAACwB,CAAC,EAAEtB,UAAU,EAAEM,YAAY,EAAEJ,SAAS,CAAC,CAAA;QACvEK,aAAa,CAACgB,OAAO,CAAC,CAAA;AACxB,OAAA;AAAC,KAAA,EACExI,IAAI,CAAA,CAAA;AAEX,GAAA;EACA,OAAO;AAAEmI,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAAEF,IAAAA,2BAA2B,EAA3BA,2BAAAA;GAA6B,CAAA;AACpE;;ACzFAQ,4BAAsB,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),t=require("react"),r=require("classnames"),a=require("@entur/icons"),n=require("lodash.get"),o=require("@entur/form"),l=require("@entur/tooltip"),d=require("@entur/expand"),s=require("@entur/button");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t),i=u(r),f=u(n);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},b.apply(this,arguments)}function v(e,t){if(null==e)return{};var r,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)t.indexOf(r=o[a])>=0||(n[r]=e[r]);return n}var m=["className","fixed","spacing","sortable","stickyHeader"],p=c.default.forwardRef((function(r,a){var n=r.className,o=r.fixed,l=void 0!==o&&o,d=r.spacing,s=void 0===d?"default":d,u=r.sortable,f=void 0!==u&&u,p=r.stickyHeader,g=void 0!==p&&p,_=v(r,m),w=t.useRef(null);return t.useEffect((function(){if(g){var e,t=w.current,r=document.createElement("div");r.classList.add("sticky-observer"),null==t||null==(e=t.parentNode)||e.insertBefore(r,t);var a=new IntersectionObserver((function(e){null==t||t.classList.toggle("eds-table--sticky-header--active",!e[0].isIntersecting)}),{threshold:[0,1]});return a.observe(r),function(){a.unobserve(r),r.remove()}}}),[]),c.default.createElement("table",b({className:i.default("eds-table",{"eds-table--fixed":l},{"eds-table--middle":"middle"===s},{"eds-table--small":"small"===s},{"eds-table--sortable":f},{"eds-table--sticky-header":g},n),ref:e.mergeRefs(a,w)},_))})),g=["className"],_=c.default.forwardRef((function(e,t){var r=e.className,a=v(e,g);return c.default.createElement("thead",b({className:i.default("eds-table__head",r),ref:t},a))})),w=["className"],h=c.default.forwardRef((function(e,t){var r=e.className,a=v(e,w);return c.default.createElement("tbody",b({className:i.default("eds-table__body",r),ref:t},a))})),y=c.default.forwardRef((function(e,t){var r=b({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return c.default.createElement("tfoot",b({ref:t},r))})),N=["className","hover","active","error"],k=c.default.forwardRef((function(e,t){var r=e.className,a=e.hover,n=void 0!==a&&a,o=e.active,l=void 0!==o&&o,d=e.error,s=void 0!==d&&d,u=v(e,N);return c.default.createElement("tr",b({className:i.default("eds-table__row",r,{"eds-table__row--hover":n,"eds-table__row--active":l,"eds-table__row--error":s}),ref:t},u))})),x=["className","padding","status"],E=c.default.forwardRef((function(e,t){var r,a=e.className,n=e.padding,o=void 0===n?"default":n,l=e.status,d=void 0===l?void 0:l,s=v(e,x);return c.default.createElement("td",b({ref:t,className:i.default("eds-table__data-cell",a,(r={},r["eds-table__data-cell--status-"+d]=d,r["eds-table__data-cell--padding-checkbox"]="checkbox"===o,r["eds-table__data-cell--padding-radio"]="radio"===o,r["eds-table__data-cell--padding-overflow-menu"]="overflow-menu"===o,r))},s))})),C=["className","children","name","sortable","sortConfig","padding","sortableButtonProps"],R=["className"],P=c.default.forwardRef((function(e,t){var r=e.className,a=e.children,n=e.name,o=e.sortable,l=void 0!==o&&o,d=e.sortConfig,s=e.padding,u=void 0===s?"default":s,f=e.sortableButtonProps,m=v(e,C),p=c.default.useState(!1),g=p[0],_=p[1];c.default.useEffect((function(){d&&n&&_(d&&n===d.key)}),[d,n]);var w=g?d&&d.order:"none";return c.default.createElement("th",b({className:i.default("eds-table__header-cell",r,{"eds-table__header-cell--sortable":l,"eds-table__header-cell--padding-radio":"radio"===u,"eds-table__header-cell--padding-checkbox":"checkbox"===u,"eds-table__header-cell--padding-overflow-menu":"overflow-menu"===u}),"aria-sort":w,ref:t},m),l&&d&&f?c.default.createElement(S,{sortableButtonProps:f,sortConfig:d,isCurrentlySorted:g},a):a)})),S=function(e){var t=e.sortConfig,r=e.sortableButtonProps,n=e.isCurrentlySorted,o=e.children,l=r.className,d=v(r,R);return c.default.createElement("button",b({className:i.default("eds-table__header-cell-button",l),type:"button"},d),o,(!n||"none"===t.order)&&c.default.createElement(a.UnsortedIcon,{size:"16px",className:"eds-table__header-cell-button-icon","aria-label":"usortert kolonne"}),n&&"ascending"===t.order&&c.default.createElement(a.UpArrowIcon,{size:"16px",className:"eds-table__header-cell-button-icon","aria-label":"stigende sortert kolonne"}),n&&"descending"===t.order&&c.default.createElement(a.DownArrowIcon,{size:"16px",className:"eds-table__header-cell-button-icon","aria-label":"synkende sortert kolonne"}))},B=["name","sortable","buttonProps"],T=["sortable"],q=["children","className","feedback","variant","outlined"],D=["open","onClick"];function A(e,t,r,a){switch(e.key){case"ArrowUp":return e.preventDefault(),a?0===t?r-1:t-1:t>0?t-1:0;case"ArrowDown":return e.preventDefault(),a?t===r-1?0:t+1:t<r-1?t+1:t;default:return t}}e.warnAboutMissingStyles("table"),exports.DataCell=E,exports.EditableCell=function(e){var t=e.children,r=e.className,a=e.feedback,n=e.variant,d=e.outlined,s=void 0!==d&&d,u=v(e,q);return c.default.createElement(o.VariantProvider,{variant:n},c.default.createElement(E,b({className:i.default("eds-editable-cell",{"eds-editable-cell--outlined":s},r)},u),c.default.createElement(l.Tooltip,{disableHoverListener:!a,disableFocusListener:!a,placement:"bottom",content:a||void 0,variant:a?"error":void 0},t)))},exports.ExpandRowButton=function(e){var t=e.open,r=e.onClick,n=v(e,D);return c.default.createElement(s.IconButton,b({className:i.default("eds-expand-row-button",{"eds-expand-row-button--open":t}),onClick:r,"aria-label":t?"Lukk tabellrad":"Utvid tabellrad"},n),c.default.createElement(a.DownArrowIcon,{className:"eds-expand-row-button__icon"}))},exports.ExpandableRow=function(e){var t=e.open;return c.default.createElement("tr",null,c.default.createElement("td",{colSpan:e.colSpan},c.default.createElement(d.BaseExpand,{open:void 0!==t&&t},e.children)))},exports.HeaderCell=P,exports.Table=p,exports.TableBody=h,exports.TableFooter=y,exports.TableHead=_,exports.TableRow=k,exports.useSortableData=function(e,r){void 0===r&&(r={key:"",order:"none"});var a=t.useState(r),n=a[0],o=a[1],l=[].concat(e).sort((function(e,t){var r=f.default(e,n.key,e),a=f.default(t,n.key,t),o="string"==typeof r?r.toLowerCase():r,l="string"==typeof a?a.toLowerCase():a;return o<l?-1:o>l?1:0}));return{sortedData:"none"===n.order?e:"descending"===n.order?[].concat(l).reverse():l,getSortableHeaderProps:function(e){var t=e.name,r=e.sortable,a=void 0===r||r,l=e.buttonProps,d=v(e,B);return b({name:t,sortable:a,sortConfig:n,sortableButtonProps:b({onClick:function(){return(e=t)!==n.key||"none"===n.order?o({key:e,order:"ascending"}):"ascending"===n.order?o({key:e,order:"descending"}):"descending"===n.order?o({key:e,order:"none"}):void 0;var e}},l)},d)},getSortableTableProps:function(e){var t=e.sortable,r=void 0===t||t,a=v(e,T);return b({sortable:r,sortConfig:n},a)}}},exports.useTableKeyboardNavigation=function(e,r){var a;void 0===e&&(e=0),void 0===r&&(r=!0);var n=t.useState(e),o=n[0],l=n[1],d=t.useState(0),s=d[0],u=d[1],c=t.useRef(null),i=null==c||null==(a=c.current)?void 0:a.contains(document.activeElement);t.useEffect((function(){var e;c&&c.current&&i&&(null==(e=c.current.childNodes[o].childNodes[0].parentElement)||e.focus())}),[o,i]);var f=t.useRef(null);return{getTableRowNavigationProps:function(t){t>=s&&u(t+1);for(var a=o?0:-1,n=arguments.length,d=new Array(n>1?n-1:0),c=1;c<n;c++)d[c-1]=arguments[c];return b({tabIndex:a,ref:f,onClick:function(){return l(t)},onKeyDown:function(t){var a=A(t,o,e,r);l(a)}},d)},getTableBodyNavigationProps:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return b({ref:c},t)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),t=require("react"),r=require("classnames"),a=require("@entur/a11y"),n=require("@entur/icons"),o=require("lodash.get"),l=require("@entur/form"),d=require("@entur/tooltip"),s=require("@entur/expand"),i=require("@entur/button");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t),f=u(r),b=u(o);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},v.apply(this,arguments)}function m(e,t){if(null==e)return{};var r,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)t.indexOf(r=o[a])>=0||(n[r]=e[r]);return n}var p=["className","fixed","spacing","sortable","changeSortDescription","stickyHeader"],g=c.default.forwardRef((function(r,n){var o=r.className,l=r.fixed,d=void 0!==l&&l,s=r.spacing,i=void 0===s?"default":s,u=r.sortable,b=void 0!==u&&u,g=r.changeSortDescription,h=void 0===g?"Tabelloverskrifter med knapper kan trykkes på for å endre sortering,":g,_=r.stickyHeader,w=void 0!==_&&_,y=m(r,p),E=e.useRandomId("sortable-header"),N=t.useRef(null);return t.useEffect((function(){if(w){var e,t=N.current,r=document.createElement("div");r.classList.add("sticky-observer"),null==t||null==(e=t.parentNode)||e.insertBefore(r,t);var a=new IntersectionObserver((function(e){null==t||t.classList.toggle("eds-table--sticky-header--active",!e[0].isIntersecting)}),{threshold:[0,1]});return a.observe(r),function(){a.unobserve(r),r.remove()}}}),[w]),c.default.createElement(c.default.Fragment,null,c.default.createElement("table",v({className:f.default("eds-table",{"eds-table--fixed":d},{"eds-table--middle":"middle"===i},{"eds-table--small":"small"===i},{"eds-table--sortable":b},{"eds-table--sticky-header":w},o),ref:e.mergeRefs(n,N),"aria-describedby":b?E:void 0},y)),b&&c.default.createElement(a.VisuallyHidden,{id:E},h))})),h=["className"],_=c.default.forwardRef((function(e,t){var r=e.className,a=m(e,h);return c.default.createElement("thead",v({className:f.default("eds-table__head",r),ref:t},a))})),w=["className"],y=c.default.forwardRef((function(e,t){var r=e.className,a=m(e,w);return c.default.createElement("tbody",v({className:f.default("eds-table__body",r),ref:t},a))})),E=c.default.forwardRef((function(e,t){var r=v({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return c.default.createElement("tfoot",v({ref:t},r))})),N=["className","hover","active","error"],k=c.default.forwardRef((function(e,t){var r=e.className,a=e.hover,n=void 0!==a&&a,o=e.active,l=void 0!==o&&o,d=e.error,s=void 0!==d&&d,i=m(e,N);return c.default.createElement("tr",v({className:f.default("eds-table__row",r,{"eds-table__row--hover":n,"eds-table__row--active":l,"eds-table__row--error":s}),ref:t},i))})),x=["className","padding","status"],A=c.default.forwardRef((function(e,t){var r,a=e.className,n=e.padding,o=void 0===n?"default":n,l=e.status,d=void 0===l?void 0:l,s=m(e,x);return c.default.createElement("td",v({ref:t,className:f.default("eds-table__data-cell",a,(r={},r["eds-table__data-cell--status-"+d]=d,r["eds-table__data-cell--padding-checkbox"]="checkbox"===o,r["eds-table__data-cell--padding-radio"]="radio"===o,r["eds-table__data-cell--padding-overflow-menu"]="overflow-menu"===o,r))},s))})),C=["className","children","name","sortable","sortConfig","padding","sortableButtonProps","sortedAscendingAriaLabel","sortedDescendingAriaLabel"],S=["className"],L=c.default.forwardRef((function(e,t){var r=e.className,a=e.children,n=e.name,o=e.sortable,l=void 0!==o&&o,d=e.sortConfig,s=e.padding,i=void 0===s?"default":s,u=e.sortableButtonProps,b=e.sortedAscendingAriaLabel,p=void 0===b?", sortert stigende":b,g=e.sortedDescendingAriaLabel,h=void 0===g?", sortert synkende":g,_=m(e,C),w=c.default.useState(!1),y=w[0],E=w[1];c.default.useEffect((function(){d&&n&&E(d&&n===d.key)}),[d,n]);var N=y?d&&d.order:void 0;return c.default.createElement("th",v({className:f.default("eds-table__header-cell",r,{"eds-table__header-cell--sortable":l,"eds-table__header-cell--padding-radio":"radio"===i,"eds-table__header-cell--padding-checkbox":"checkbox"===i,"eds-table__header-cell--padding-overflow-menu":"overflow-menu"===i}),"aria-sort":N,ref:t},_),l&&d&&u?c.default.createElement(R,{sortableButtonProps:u,sortConfig:d,isCurrentlySorted:y,ariaSort:N,sortedAscendingAriaLabel:p,sortedDescendingAriaLabel:h},a):a)})),R=function(e){var r=e.sortConfig,o=e.sortableButtonProps,l=e.isCurrentlySorted,d=e.children,s=e.ariaSort,i=e.sortedAscendingAriaLabel,u=e.sortedDescendingAriaLabel,b=t.useState(""),p=b[0],g=b[1],h=o.className,_=m(o,S),w=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;return t.useEffect((function(){"ascending"==r.order?g(i):"descending"==r.order&&g(u);var e=setTimeout((function(){g(""),w&&g(", sort "+r.order)}),3e3);return function(){return clearTimeout(e)}}),[r.order]),c.default.createElement("button",v({className:f.default("eds-table__header-cell-button",h),type:"button","aria-sort":s},_),d,(!l||"none"===r.order)&&c.default.createElement(n.UnsortedIcon,{size:"1rem",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),l&&"ascending"===r.order&&c.default.createElement(n.UpArrowIcon,{size:"1rem",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),l&&"descending"===r.order&&c.default.createElement(n.DownArrowIcon,{size:"1rem",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),c.default.createElement(a.VisuallyHidden,null,l&&p))},D=["name","sortable","buttonProps"],P=["sortable"],T=["children","className","feedback","variant","outlined"],B=["open","onClick"];function q(e,t,r,a){switch(e.key){case"ArrowUp":return e.preventDefault(),a?0===t?r-1:t-1:t>0?t-1:0;case"ArrowDown":return e.preventDefault(),a?t===r-1?0:t+1:t<r-1?t+1:t;default:return t}}e.warnAboutMissingStyles("table"),exports.DataCell=A,exports.EditableCell=function(e){var t=e.children,r=e.className,a=e.feedback,n=e.variant,o=e.outlined,s=void 0!==o&&o,i=m(e,T);return c.default.createElement(l.VariantProvider,{variant:n},c.default.createElement(A,v({className:f.default("eds-editable-cell",{"eds-editable-cell--outlined":s},r)},i),c.default.createElement(d.Tooltip,{disableHoverListener:!a,disableFocusListener:!a,placement:"bottom",content:a||void 0,variant:a?"error":void 0},t)))},exports.ExpandRowButton=function(e){var t=e.open,r=e.onClick,a=m(e,B);return c.default.createElement(i.IconButton,v({className:f.default("eds-expand-row-button",{"eds-expand-row-button--open":t}),onClick:r,"aria-label":t?"Lukk tabellrad":"Utvid tabellrad"},a),c.default.createElement(n.DownArrowIcon,{className:"eds-expand-row-button__icon"}))},exports.ExpandableRow=function(e){var t=e.open;return c.default.createElement("tr",null,c.default.createElement("td",{colSpan:e.colSpan},c.default.createElement(s.BaseExpand,{open:void 0!==t&&t},e.children)))},exports.HeaderCell=L,exports.Table=g,exports.TableBody=y,exports.TableFooter=E,exports.TableHead=_,exports.TableRow=k,exports.useSortableData=function(e,r){void 0===r&&(r={key:"",order:"none"});var a=t.useState(r),n=a[0],o=a[1],l=[].concat(e).sort((function(e,t){var r=b.default(e,n.key,e),a=b.default(t,n.key,t),o="string"==typeof r?r.toLowerCase():r,l="string"==typeof a?a.toLowerCase():a;return o<l?-1:o>l?1:0}));return{sortedData:"none"===n.order?e:"descending"===n.order?[].concat(l).reverse():l,getSortableHeaderProps:function(e){var t=e.name,r=e.sortable,a=void 0===r||r,l=e.buttonProps,d=m(e,D);return v({name:t,sortable:a,sortConfig:n,sortableButtonProps:v({onClick:function(){return(e=t)!==n.key||"none"===n.order?o({key:e,order:"ascending"}):"ascending"===n.order?o({key:e,order:"descending"}):"descending"===n.order?o({key:e,order:"none"}):void 0;var e}},l)},d)},getSortableTableProps:function(e){var t=void 0===e?{}:e,r=t.sortable,a=void 0===r||r,o=m(t,P);return v({sortable:a,sortConfig:n},o)}}},exports.useTableKeyboardNavigation=function(e,r){var a;void 0===e&&(e=0),void 0===r&&(r=!0);var n=t.useState(e),o=n[0],l=n[1],d=t.useState(0),s=d[0],i=d[1],u=t.useRef(null),c=null==u||null==(a=u.current)?void 0:a.contains(document.activeElement);t.useEffect((function(){var e;u&&u.current&&c&&(null==(e=u.current.childNodes[o].childNodes[0].parentElement)||e.focus())}),[o,c]);var f=t.useRef(null);return{getTableRowNavigationProps:function(t){t>=s&&i(t+1);for(var a=o?0:-1,n=arguments.length,d=new Array(n>1?n-1:0),u=1;u<n;u++)d[u-1]=arguments[u];return v({tabIndex:a,ref:f,onClick:function(){return l(t)},onKeyDown:function(t){var a=q(t,o,e,r);l(a)}},d)},getTableBodyNavigationProps:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return v({ref:u},t)}}};
2
2
  //# sourceMappingURL=table.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.cjs.production.min.js","sources":["../src/Table.tsx","../src/TableHead.tsx","../src/TableBody.tsx","../src/TableFooter.tsx","../src/TableRow.tsx","../src/DataCell.tsx","../src/HeaderCell.tsx","../src/useTableKeyboardNavigation.ts","../src/index.tsx","../src/EditableCell.tsx","../src/ExpandRowButton.tsx","../src/ExpandableRow.tsx","../src/useSortableTable.ts"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs } from '@entur/utils';\n\nexport type TableProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Setter tettheten mellom rader og kolonner. Bruk gjerne middle og small for for sider med høy informasjonstetthet\n * @default \"default\"\n */\n spacing?: 'default' | 'middle' | 'small';\n /** Setter kolonne-layout til å være uavhengig av innhold\n * @default false\n */\n fixed?: boolean;\n /** Om header-raden skal bli værende på skjermen når man skroller tabellen\n * @default false\n */\n stickyHeader?: boolean;\n /** Innholdet i tabellen */\n children: React.ReactNode;\n [key: string]: any;\n};\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (\n {\n className,\n fixed = false,\n spacing = 'default',\n sortable = false,\n stickyHeader = false,\n ...rest\n },\n ref,\n ) => {\n const tableRef = useRef<HTMLTableElement>(null);\n\n useEffect(() => {\n if (stickyHeader) {\n /* We check when an inserted div above the header \n is outside our scrolling container to determine when\n the table header becomes sticky. This is necessary\n to conditionally add our box-shadow when the \n header is overlapping table rows */\n const tableElement = tableRef.current;\n const observerElement = document.createElement('div');\n observerElement.classList.add('sticky-observer');\n\n tableElement?.parentNode?.insertBefore(observerElement, tableElement);\n\n const observer = new IntersectionObserver(\n entries => {\n tableElement?.classList.toggle(\n 'eds-table--sticky-header--active',\n !entries[0].isIntersecting,\n );\n },\n { threshold: [0, 1] },\n );\n\n observer.observe(observerElement);\n\n return () => {\n observer.unobserve(observerElement);\n observerElement.remove();\n };\n }\n }, []);\n\n return (\n <table\n className={classNames(\n 'eds-table',\n { 'eds-table--fixed': fixed },\n { 'eds-table--middle': spacing === 'middle' },\n { 'eds-table--small': spacing === 'small' },\n { 'eds-table--sortable': sortable },\n { 'eds-table--sticky-header': stickyHeader },\n className,\n )}\n ref={mergeRefs(ref, tableRef)}\n {...rest}\n />\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableHeadProps = {\n /** Kolonneoverskrifter */\n children: React.ReactNode;\n /** Esktra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>(({ className, ...props }, ref) => (\n <thead\n className={classNames('eds-table__head', className)}\n ref={ref}\n {...props}\n />\n));\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableBodyProps = {\n /** Tabellrader */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n ref?: React.Ref<HTMLTableSectionElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>(({ className, ...rest }, ref) => (\n <tbody\n className={classNames('eds-table__body', className)}\n ref={ref}\n {...rest}\n />\n));\n","import React from 'react';\n\nexport type TableFooterProps = {\n /** Tabellrader */\n children: React.ReactNode;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(({ ...props }, ref) => <tfoot ref={ref} {...props} />);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableRowProps = {\n /** Tabellceller */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /**Hvis satt, så vil tabellraden endre fargen ved hover\n * @default false\n */\n hover?: boolean;\n /** Om raden er klikkbar, så vil raden endre farge, og musepekeren vil symbolisere interaktivitet\n * @default false\n */\n active?: boolean;\n /**Signalisere om at det er en feil i tabellraden\n * @default false\n */\n error?: boolean;\n ref?: React.Ref<HTMLTableRowElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableRowElement>,\n HTMLTableRowElement\n>;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { className, hover = false, active = false, error = false, ...rest },\n ref: React.Ref<HTMLTableRowElement>,\n ) => (\n <tr\n className={classNames('eds-table__row', className, {\n 'eds-table__row--hover': hover,\n 'eds-table__row--active': active,\n 'eds-table__row--error': error,\n })}\n ref={ref}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type DataCellProps = {\n /** Innholdet i tabellcellen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for DataCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n /** Viser en status-sirkel for DataCell */\n status?: 'positive' | 'negative' | 'neutral';\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status = undefined, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\n [`eds-table__data-cell--status-${status}`]: status,\n 'eds-table__data-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__data-cell--padding-radio': padding === 'radio',\n 'eds-table__data-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { DownArrowIcon, UpArrowIcon, UnsortedIcon } from '@entur/icons';\n\nimport { ExternalSortConfig } from '.';\n\nimport './HeaderCell.scss';\n\nexport type HeaderCellProps = {\n /** Kolonneoverskrift */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for HeaderCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n\n /** Ekstra props som kan sendes til sorteringsknappelementet. Benyttes via useSortableTable */\n sortableButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /** Om komponenten brukes til sortering. Benytt via useSortableTable\n * @default false\n */\n sortable?: boolean;\n /** Konfigurering og rekkefølgen på sortering. Benyttes via useSortableTable */\n sortConfig?: ExternalSortConfig;\n /** Navnet det skal sorteres på. Benyttes via useSortableTable */\n name?: string;\n} & React.DetailedHTMLProps<\n React.ThHTMLAttributes<HTMLTableCellElement>,\n HTMLTableCellElement\n>;\n\nexport const HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n HeaderCellProps\n>(\n (\n {\n className,\n children,\n name,\n sortable = false,\n sortConfig,\n padding = 'default',\n sortableButtonProps,\n ...rest\n },\n ref,\n ) => {\n const [isCurrentlySorted, setIsCurrentlySorted] =\n React.useState<boolean>(false);\n React.useEffect(() => {\n sortConfig &&\n name &&\n setIsCurrentlySorted(sortConfig && name === sortConfig.key);\n }, [sortConfig, name]);\n const ariaSort = isCurrentlySorted\n ? sortConfig && sortConfig.order\n : 'none';\n\n return (\n <th\n className={classNames('eds-table__header-cell', className, {\n 'eds-table__header-cell--sortable': sortable,\n 'eds-table__header-cell--padding-radio': padding === 'radio',\n 'eds-table__header-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__header-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n aria-sort={ariaSort}\n ref={ref}\n {...rest}\n >\n {sortable && sortConfig && sortableButtonProps ? (\n <SortableHeaderCellButton\n sortableButtonProps={sortableButtonProps}\n sortConfig={sortConfig}\n isCurrentlySorted={isCurrentlySorted}\n >\n {children}\n </SortableHeaderCellButton>\n ) : (\n children\n )}\n </th>\n );\n },\n);\n\ntype SortableHeaderCellButtonProps = {\n sortConfig: ExternalSortConfig;\n isCurrentlySorted: boolean;\n sortableButtonProps: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n};\n\nconst SortableHeaderCellButton: React.FC<SortableHeaderCellButtonProps> = ({\n sortConfig,\n sortableButtonProps,\n isCurrentlySorted,\n children,\n}) => {\n const { className, ...rest } = sortableButtonProps;\n return (\n <button\n className={classNames('eds-table__header-cell-button', className)}\n type=\"button\"\n {...rest}\n >\n {children}\n {(!isCurrentlySorted || sortConfig.order === 'none') && (\n <UnsortedIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"usortert kolonne\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"stigende sortert kolonne\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"synkende sortert kolonne\"\n />\n )}\n </button>\n );\n};\n","import { useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport { TableBodyProps, TableRowProps } from './index';\n\nfunction onTableKeypress(\n event: KeyboardEvent,\n currentRow: number,\n maxRow: number,\n allowWrap?: boolean,\n) {\n const keyPress = event.key;\n switch (keyPress) {\n case 'ArrowUp':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === 0 ? maxRow - 1 : currentRow - 1;\n } else {\n return currentRow > 0 ? currentRow - 1 : 0;\n }\n case 'ArrowDown':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === maxRow - 1 ? 0 : currentRow + 1;\n } else {\n return currentRow < maxRow - 1 ? currentRow + 1 : currentRow;\n }\n default:\n return currentRow;\n }\n}\n\nexport type useTableKeyboardNavigationProps = (\n /** Antall rader i tabellen */\n numberOfRows: number,\n /** Tillate at man kan navigere sirkulært\n * @default false\n */\n allowWrap?: boolean,\n) => {\n getTableRowNavigationProps: (\n /** Raden i tabellen (0-indeksert) */\n row: number,\n ) => Partial<TableRowProps>;\n getTableBodyNavigationProps: () => Partial<TableBodyProps>;\n};\n\nexport const useTableKeyboardNavigation: useTableKeyboardNavigationProps = (\n numberOfRows = 0,\n allowWrap = true,\n) => {\n const [currentRow, setCurrentRow] = useState(numberOfRows);\n const [maxRow, setMaxRow] = useState(0);\n\n const tableBodyRef = useRef<HTMLTableSectionElement>(null);\n const tableHasFocus = tableBodyRef?.current?.contains(document.activeElement);\n\n useEffect(() => {\n tableBodyRef &&\n tableBodyRef.current &&\n tableHasFocus &&\n tableBodyRef.current.childNodes[\n currentRow\n ].childNodes[0].parentElement?.focus();\n }, [currentRow, tableHasFocus]);\n\n function getTableBodyNavigationProps(...rest: any): Partial<TableBodyProps> {\n return {\n ref: tableBodyRef,\n ...rest,\n };\n }\n\n const tableRowRef = useRef<HTMLTableRowElement>(null);\n function getTableRowNavigationProps(\n row: number,\n ...rest: any\n ): Partial<TableRowProps> {\n if (row >= maxRow) {\n setMaxRow(row + 1);\n }\n const tabIndex = currentRow ? 0 : -1;\n return {\n tabIndex,\n ref: tableRowRef,\n onClick: () => setCurrentRow(row),\n onKeyDown: (e: KeyboardEvent) => {\n const newCell = onTableKeypress(e, currentRow, numberOfRows, allowWrap);\n setCurrentRow(newCell);\n },\n ...rest,\n };\n }\n return { getTableRowNavigationProps, getTableBodyNavigationProps };\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('table');\n\nexport * from './Table';\nexport * from './TableHead';\nexport * from './TableBody';\nexport * from './TableFooter';\nexport * from './TableRow';\nexport * from './DataCell';\nexport * from './HeaderCell';\nexport * from './useSortableTable';\nexport * from './EditableCell';\nexport * from './ExpandableRow';\nexport * from './ExpandRowButton';\nexport * from './useTableKeyboardNavigation';\n","import classNames from 'classnames';\nimport React from 'react';\nimport { DataCell } from './DataCell';\nimport { VariantProvider, VariantType } from '@entur/form';\nimport { Tooltip } from '@entur/tooltip';\nimport './EditableCell.scss';\n\ntype EditableCellProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Inputelementet som skal være i tabellcellen */\n children: React.ReactElement;\n /** Valideringsvariant for EditableCell */\n variant?: VariantType;\n /** Varselmelding, som vil komme som en Tooltip under EditableCell */\n feedback?: string;\n /** Om cellen skal vise omriss til enhver tid\n * @default false\n */\n outlined?: boolean;\n [key: string]: any;\n};\n\nexport const EditableCell: React.FC<EditableCellProps> = ({\n children,\n className,\n feedback,\n variant,\n outlined = false,\n ...rest\n}) => {\n return (\n <VariantProvider variant={variant}>\n <DataCell\n className={classNames(\n 'eds-editable-cell',\n {\n 'eds-editable-cell--outlined': outlined,\n },\n className,\n )}\n {...rest}\n >\n <Tooltip\n disableHoverListener={!feedback}\n disableFocusListener={!feedback}\n placement=\"bottom\"\n content={feedback || undefined}\n variant={feedback ? 'error' : undefined}\n >\n {children}\n </Tooltip>\n </DataCell>\n </VariantProvider>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DownArrowIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport './ExpandRowButton.scss';\n\nexport type ExpandRowButtonProps = {\n open: boolean;\n onClick: (e: React.MouseEvent) => void;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const ExpandRowButton: React.FC<ExpandRowButtonProps> = ({\n open,\n onClick,\n ...rest\n}) => {\n return (\n <IconButton\n className={classNames('eds-expand-row-button', {\n 'eds-expand-row-button--open': open,\n })}\n onClick={onClick}\n aria-label={open ? 'Lukk tabellrad' : 'Utvid tabellrad'}\n {...rest}\n >\n <DownArrowIcon className=\"eds-expand-row-button__icon\" />\n </IconButton>\n );\n};\n","import React from 'react';\nimport { BaseExpand } from '@entur/expand';\n\nexport type ExpandableRowProps = {\n /** Antall kolonner tabellraden er */\n colSpan: number;\n /** Innholdet til ExpandableRow */\n children: React.ReactNode;\n /** Om ExpandableRow er åpen\n * @default false\n */\n open?: boolean;\n};\n\nexport const ExpandableRow: React.FC<ExpandableRowProps> = ({\n open = false,\n children,\n colSpan,\n}) => {\n return (\n <tr>\n <td colSpan={colSpan}>\n <BaseExpand open={open}>{children}</BaseExpand>\n </td>\n </tr>\n );\n};\n","import { useState, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';\nimport get from 'lodash.get';\n\nexport type ExternalSortConfig = {\n /**\n * @default \"\"\n */\n key: string;\n /** @default \"none\" */\n order: 'ascending' | 'descending' | 'none';\n};\n\nexport function useSortableData<T>(\n tableData: T[],\n externalSortConfig: ExternalSortConfig = { key: '', order: 'none' },\n): {\n sortedData: T[];\n getSortableHeaderProps: (\n args: SortableHeaderProps,\n ) => SortableHeaderReturnProps;\n getSortableTableProps: (args: SortableTableProps) => SortableTableReturnProps;\n} {\n const [sortConfig, setSortConfig] = useState(externalSortConfig);\n\n const onSortRequested = (key: string) => {\n const sortingNewColumn = key !== sortConfig.key;\n if (sortingNewColumn || sortConfig.order === 'none')\n return setSortConfig({ key, order: 'ascending' });\n if (sortConfig.order === 'ascending')\n return setSortConfig({ key, order: 'descending' });\n if (sortConfig.order === 'descending')\n return setSortConfig({ key, order: 'none' });\n };\n\n const tableSortedAscending = [...tableData].sort((a: any, b: any) => {\n const valueOfA = get(a, sortConfig.key, a);\n const valueOfB = get(b, sortConfig.key, b);\n\n const comparableAValue =\n typeof valueOfA === 'string' ? valueOfA.toLowerCase() : valueOfA;\n const comparableBValue =\n typeof valueOfB === 'string' ? valueOfB.toLowerCase() : valueOfB;\n\n if (comparableAValue < comparableBValue) return -1;\n if (comparableAValue > comparableBValue) return 1;\n return 0;\n });\n\n const getSortedData: () => T[] = () => {\n if (sortConfig.order === 'none') {\n return tableData;\n }\n if (sortConfig.order === 'descending') {\n return [...tableSortedAscending].reverse();\n }\n return tableSortedAscending;\n };\n\n const sortedData = getSortedData();\n\n const getSortableHeaderProps = ({\n name,\n sortable = true,\n buttonProps,\n ...props\n }: SortableHeaderProps): SortableHeaderReturnProps => {\n return {\n name,\n sortable,\n sortConfig: sortConfig,\n sortableButtonProps: {\n onClick: () => onSortRequested(name),\n ...buttonProps,\n },\n ...props,\n };\n };\n\n const getSortableTableProps = ({\n sortable = true,\n ...props\n }: SortableTableProps): SortableTableReturnProps => {\n return {\n sortable,\n sortConfig: sortConfig,\n ...props,\n };\n };\n\n return { sortedData, getSortableHeaderProps, getSortableTableProps };\n}\n\nexport type SortableHeaderProps = {\n /** Navnet headeren skal se etter i forhold til sortering av items */\n name: string;\n /** Om headeren skal være sorterbar eller ikke\n * @default true */\n sortable?: boolean;\n /** Props som sendes til knapp-elementet */\n buttonProps?: Omit<\n DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >,\n 'type' | 'onClick'\n >;\n [key: string]: any;\n};\n\nexport type SortableHeaderReturnProps = {\n name: string;\n sortable: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n\nexport type SortableTableProps = {\n /** @default true */\n sortable?: boolean;\n [key: string]: any;\n};\n\nexport type SortableTableReturnProps = {\n /** @default true */\n sortable?: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n"],"names":["Table","React","forwardRef","ref","className","_ref$fixed","_ref","fixed","_ref$spacing","spacing","_ref$sortable","sortable","_ref$stickyHeader","stickyHeader","rest","_objectWithoutPropertiesLoose","_excluded","tableRef","useRef","useEffect","_tableElement$parentN","tableElement","current","observerElement","document","createElement","classList","add","parentNode","insertBefore","observer","IntersectionObserver","entries","toggle","isIntersecting","threshold","observe","unobserve","remove","_extends","classNames","mergeRefs","TableHead","props","TableBody","TableFooter","_objectDestructuringEmpty","TableRow","_ref$hover","hover","_ref$active","active","_ref$error","error","DataCell","_classNames","_ref$padding","padding","_ref$status","status","undefined","HeaderCell","children","name","sortConfig","sortableButtonProps","_React$useState","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","_ref2","_excluded2","type","UnsortedIcon","size","UpArrowIcon","DownArrowIcon","onTableKeypress","event","currentRow","maxRow","allowWrap","preventDefault","warnAboutMissingStyles","feedback","variant","_ref$outlined","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","open","onClick","IconButton","_ref$open","colSpan","BaseExpand","tableData","externalSortConfig","_useState","setSortConfig","tableSortedAscending","concat","sort","a","b","valueOfA","get","valueOfB","comparableAValue","toLowerCase","comparableBValue","sortedData","reverse","getSortableHeaderProps","buttonProps","getSortableTableProps","_ref2$sortable","numberOfRows","_tableBodyRef$current","setCurrentRow","_useState2","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","_tableBodyRef$current2","childNodes","parentElement","focus","tableRowRef","getTableRowNavigationProps","row","tabIndex","_len2","arguments","length","Array","_key2","onKeyDown","e","newCell","getTableBodyNavigationProps","_len","_key"],"mappings":"mzBAuBaA,EAAQC,EAAAA,QAAMC,YACzB,SASEC,EAAAA,GACE,IARAC,IAAAA,UAASC,EAAAC,EACTC,MAAAA,cAAaF,EAAAG,EAAAF,EACbG,QAAAA,aAAU,UAASD,EAAAE,EAAAJ,EACnBK,SAAAA,cAAgBD,EAAAE,EAAAN,EAChBO,aAAAA,cAAoBD,EACjBE,EAAIC,EAAAT,EAAAU,GAIHC,EAAWC,SAAyB,MAkC1C,OAhCAC,EAAAA,WAAU,WACR,GAAIN,EAAc,CAAA,IAAAO,EAMVC,EAAeJ,EAASK,QACxBC,EAAkBC,SAASC,cAAc,OAC/CF,EAAgBG,UAAUC,IAAI,mBAElB,MAAZN,GAAwB,OAAZD,EAAZC,EAAcO,aAAdR,EAA0BS,aAAaN,EAAiBF,GAExD,IAAMS,EAAW,IAAIC,sBACnB,SAAAC,SACEX,GAAAA,EAAcK,UAAUO,OACtB,oCACCD,EAAQ,GAAGE,kBAGhB,CAAEC,UAAW,CAAC,EAAG,KAKnB,OAFAL,EAASM,QAAQb,GAEV,WACLO,EAASO,UAAUd,GACnBA,EAAgBe,aAGnB,IAGDrC,UACEwB,cAAA,QAAAc,EAAA,CAAAnC,UAAWoC,EAAU,QACnB,YACA,CAAE,mBAAoBjC,GACtB,CAAE,oBAAiC,WAAZE,GACvB,CAA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,QAAS,WAAA,OAAM4B,EAAca,IAC7BO,UAAW,SAACC,GACV,IAAMC,EAAUpE,EAAgBmE,EAAGjE,EAAY0C,EAAcxC,GAC7D0C,EAAcsB,KAEbvI,IAG8BwI,4BA3BrC,WAAiD,IAAA,IAAAC,EAAAR,UAAAC,OAATlI,EAAS,IAAAmI,MAAAM,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAAT1I,EAAS0I,GAAAT,UAAAS,GAC/C,OAAAjH,EAAA,CACEpC,IAAK+H,GACFpH"}
1
+ {"version":3,"file":"table.cjs.production.min.js","sources":["../src/Table.tsx","../src/TableHead.tsx","../src/TableBody.tsx","../src/TableFooter.tsx","../src/TableRow.tsx","../src/DataCell.tsx","../src/HeaderCell.tsx","../src/useTableKeyboardNavigation.ts","../src/index.tsx","../src/EditableCell.tsx","../src/ExpandRowButton.tsx","../src/ExpandableRow.tsx","../src/useSortableTable.ts"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport classNames from 'classnames';\nimport { useRandomId, mergeRefs } from '@entur/utils';\nimport { VisuallyHidden } from '@entur/a11y';\n\nexport type TableProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Setter tettheten mellom rader og kolonner. Bruk gjerne middle og small for for sider med høy informasjonstetthet\n * @default \"default\"\n */\n spacing?: 'default' | 'middle' | 'small';\n /** Setter kolonne-layout til å være uavhengig av innhold\n * @default false\n */\n fixed?: boolean;\n /** Om header-raden skal bli værende på skjermen når man skroller tabellen\n * @default false\n */\n stickyHeader?: boolean;\n /** Innholdet i tabellen */\n children: React.ReactNode;\n [key: string]: any;\n};\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (\n {\n className,\n fixed = false,\n spacing = 'default',\n sortable = false,\n changeSortDescription = 'Tabelloverskrifter med knapper kan trykkes på for å endre sortering,',\n stickyHeader = false,\n ...rest\n },\n ref,\n ) => {\n const sortableHeaderId = useRandomId('sortable-header');\n\n const tableRef = useRef<HTMLTableElement>(null);\n\n useEffect(() => {\n if (stickyHeader) {\n /* We check when an inserted div above the header \n is outside our scrolling container to determine when\n the table header becomes sticky. This is necessary\n to conditionally add our box-shadow when the \n header is overlapping table rows */\n const tableElement = tableRef.current;\n const observerElement = document.createElement('div');\n observerElement.classList.add('sticky-observer');\n\n tableElement?.parentNode?.insertBefore(observerElement, tableElement);\n\n const observer = new IntersectionObserver(\n entries => {\n tableElement?.classList.toggle(\n 'eds-table--sticky-header--active',\n !entries[0].isIntersecting,\n );\n },\n { threshold: [0, 1] },\n );\n\n observer.observe(observerElement);\n\n return () => {\n observer.unobserve(observerElement);\n observerElement.remove();\n };\n }\n }, [stickyHeader]);\n\n return (\n <>\n <table\n className={classNames(\n 'eds-table',\n { 'eds-table--fixed': fixed },\n { 'eds-table--middle': spacing === 'middle' },\n { 'eds-table--small': spacing === 'small' },\n { 'eds-table--sortable': sortable },\n { 'eds-table--sticky-header': stickyHeader },\n className,\n )}\n ref={mergeRefs(ref, tableRef)}\n aria-describedby={sortable ? sortableHeaderId : undefined}\n {...rest}\n />\n {sortable && (\n <VisuallyHidden id={sortableHeaderId}>\n {changeSortDescription}\n </VisuallyHidden>\n )}\n </>\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableHeadProps = {\n /** Kolonneoverskrifter */\n children: React.ReactNode;\n /** Esktra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>(({ className, ...props }, ref) => (\n <thead\n className={classNames('eds-table__head', className)}\n ref={ref}\n {...props}\n />\n));\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableBodyProps = {\n /** Tabellrader */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n ref?: React.Ref<HTMLTableSectionElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>(({ className, ...rest }, ref) => (\n <tbody\n className={classNames('eds-table__body', className)}\n ref={ref}\n {...rest}\n />\n));\n","import React from 'react';\n\nexport type TableFooterProps = {\n /** Tabellrader */\n children: React.ReactNode;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(({ ...props }, ref) => <tfoot ref={ref} {...props} />);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableRowProps = {\n /** Tabellceller */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /**Hvis satt, så vil tabellraden endre fargen ved hover\n * @default false\n */\n hover?: boolean;\n /** Om raden er klikkbar, så vil raden endre farge, og musepekeren vil symbolisere interaktivitet\n * @default false\n */\n active?: boolean;\n /**Signalisere om at det er en feil i tabellraden\n * @default false\n */\n error?: boolean;\n ref?: React.Ref<HTMLTableRowElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableRowElement>,\n HTMLTableRowElement\n>;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { className, hover = false, active = false, error = false, ...rest },\n ref: React.Ref<HTMLTableRowElement>,\n ) => (\n <tr\n className={classNames('eds-table__row', className, {\n 'eds-table__row--hover': hover,\n 'eds-table__row--active': active,\n 'eds-table__row--error': error,\n })}\n ref={ref}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type DataCellProps = {\n /** Innholdet i tabellcellen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for DataCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n /** Viser en status-sirkel for DataCell */\n status?: 'positive' | 'negative' | 'neutral';\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status = undefined, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\n [`eds-table__data-cell--status-${status}`]: status,\n 'eds-table__data-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__data-cell--padding-radio': padding === 'radio',\n 'eds-table__data-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n {...rest}\n />\n ),\n);\n","import React, { useEffect, useState } from 'react';\nimport classNames from 'classnames';\n\nimport { DownArrowIcon, UpArrowIcon, UnsortedIcon } from '@entur/icons';\n\nimport { ExternalSortConfig } from '.';\n\nimport './HeaderCell.scss';\nimport { VisuallyHidden } from '@entur/a11y';\n\nexport type HeaderCellProps = {\n /** Kolonneoverskrift */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for HeaderCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n\n /** Ekstra props som kan sendes til sorteringsknappelementet. Benyttes via useSortableTable */\n sortableButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /** Om komponenten brukes til sortering. Benytt via useSortableTable\n * @default false\n */\n sortable?: boolean;\n /** Konfigurering og rekkefølgen på sortering. Benyttes via useSortableTable */\n sortConfig?: ExternalSortConfig;\n /** Navnet det skal sorteres på. Benyttes via useSortableTable */\n name?: string;\n sortedAscendingAriaLabel?: string;\n sortedDescendingAriaLabel?: string;\n} & React.DetailedHTMLProps<\n React.ThHTMLAttributes<HTMLTableCellElement>,\n HTMLTableCellElement\n>;\n\nexport const HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n HeaderCellProps\n>(\n (\n {\n className,\n children,\n name,\n sortable = false,\n sortConfig,\n padding = 'default',\n sortableButtonProps,\n sortedAscendingAriaLabel = ', sortert stigende',\n sortedDescendingAriaLabel = ', sortert synkende',\n ...rest\n },\n ref,\n ) => {\n const [isCurrentlySorted, setIsCurrentlySorted] =\n React.useState<boolean>(false);\n React.useEffect(() => {\n sortConfig &&\n name &&\n setIsCurrentlySorted(sortConfig && name === sortConfig.key);\n }, [sortConfig, name]);\n const ariaSort = isCurrentlySorted\n ? sortConfig && sortConfig.order\n : undefined;\n\n return (\n <th\n className={classNames('eds-table__header-cell', className, {\n 'eds-table__header-cell--sortable': sortable,\n 'eds-table__header-cell--padding-radio': padding === 'radio',\n 'eds-table__header-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__header-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n aria-sort={ariaSort}\n ref={ref}\n {...rest}\n >\n {sortable && sortConfig && sortableButtonProps ? (\n <SortableHeaderCellButton\n sortableButtonProps={sortableButtonProps}\n sortConfig={sortConfig}\n isCurrentlySorted={isCurrentlySorted}\n ariaSort={ariaSort}\n sortedAscendingAriaLabel={sortedAscendingAriaLabel}\n sortedDescendingAriaLabel={sortedDescendingAriaLabel}\n >\n {children}\n </SortableHeaderCellButton>\n ) : (\n children\n )}\n </th>\n );\n },\n);\n\ntype SortableHeaderCellButtonProps = {\n sortConfig: ExternalSortConfig;\n isCurrentlySorted: boolean;\n sortableButtonProps: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n ariaSort?: 'none' | 'ascending' | 'descending' | 'other' | undefined;\n sortedAscendingAriaLabel?: string;\n sortedDescendingAriaLabel?: string;\n};\n\nconst SortableHeaderCellButton: React.FC<SortableHeaderCellButtonProps> = ({\n sortConfig,\n sortableButtonProps,\n isCurrentlySorted,\n children,\n ariaSort,\n sortedAscendingAriaLabel,\n sortedDescendingAriaLabel,\n}) => {\n const [sortedAriaInfo, setSortedAriaInfo] = useState<string | undefined>('');\n\n const { className, ...rest } = sortableButtonProps;\n\n const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\n useEffect(() => {\n const DISMISS_SORT_INFO_TIME = 3000;\n if (sortConfig.order == 'ascending') {\n setSortedAriaInfo(sortedAscendingAriaLabel);\n } else if (sortConfig.order == 'descending') {\n setSortedAriaInfo(sortedDescendingAriaLabel);\n }\n const dismissAriaTimer = setTimeout(() => {\n setSortedAriaInfo('');\n if (isFirefox) setSortedAriaInfo(', sort ' + sortConfig.order);\n }, DISMISS_SORT_INFO_TIME);\n\n return () => clearTimeout(dismissAriaTimer);\n }, [sortConfig.order]);\n\n return (\n <button\n className={classNames('eds-table__header-cell-button', className)}\n type=\"button\"\n aria-sort={ariaSort}\n {...rest}\n >\n {children}\n {(!isCurrentlySorted || sortConfig.order === 'none') && (\n <UnsortedIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n <VisuallyHidden>{isCurrentlySorted && sortedAriaInfo}</VisuallyHidden>\n </button>\n );\n};\n","import { useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport { TableBodyProps, TableRowProps } from './index';\n\nfunction onTableKeypress(\n event: KeyboardEvent,\n currentRow: number,\n maxRow: number,\n allowWrap?: boolean,\n) {\n const keyPress = event.key;\n switch (keyPress) {\n case 'ArrowUp':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === 0 ? maxRow - 1 : currentRow - 1;\n } else {\n return currentRow > 0 ? currentRow - 1 : 0;\n }\n case 'ArrowDown':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === maxRow - 1 ? 0 : currentRow + 1;\n } else {\n return currentRow < maxRow - 1 ? currentRow + 1 : currentRow;\n }\n default:\n return currentRow;\n }\n}\n\nexport type useTableKeyboardNavigationProps = (\n /** Antall rader i tabellen */\n numberOfRows: number,\n /** Tillate at man kan navigere sirkulært\n * @default false\n */\n allowWrap?: boolean,\n) => {\n getTableRowNavigationProps: (\n /** Raden i tabellen (0-indeksert) */\n row: number,\n ) => Partial<TableRowProps>;\n getTableBodyNavigationProps: () => Partial<TableBodyProps>;\n};\n\nexport const useTableKeyboardNavigation: useTableKeyboardNavigationProps = (\n numberOfRows = 0,\n allowWrap = true,\n) => {\n const [currentRow, setCurrentRow] = useState(numberOfRows);\n const [maxRow, setMaxRow] = useState(0);\n\n const tableBodyRef = useRef<HTMLTableSectionElement>(null);\n const tableHasFocus = tableBodyRef?.current?.contains(document.activeElement);\n\n useEffect(() => {\n tableBodyRef &&\n tableBodyRef.current &&\n tableHasFocus &&\n tableBodyRef.current.childNodes[\n currentRow\n ].childNodes[0].parentElement?.focus();\n }, [currentRow, tableHasFocus]);\n\n function getTableBodyNavigationProps(...rest: any): Partial<TableBodyProps> {\n return {\n ref: tableBodyRef,\n ...rest,\n };\n }\n\n const tableRowRef = useRef<HTMLTableRowElement>(null);\n function getTableRowNavigationProps(\n row: number,\n ...rest: any\n ): Partial<TableRowProps> {\n if (row >= maxRow) {\n setMaxRow(row + 1);\n }\n const tabIndex = currentRow ? 0 : -1;\n return {\n tabIndex,\n ref: tableRowRef,\n onClick: () => setCurrentRow(row),\n onKeyDown: (e: KeyboardEvent) => {\n const newCell = onTableKeypress(e, currentRow, numberOfRows, allowWrap);\n setCurrentRow(newCell);\n },\n ...rest,\n };\n }\n return { getTableRowNavigationProps, getTableBodyNavigationProps };\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('table');\n\nexport * from './Table';\nexport * from './TableHead';\nexport * from './TableBody';\nexport * from './TableFooter';\nexport * from './TableRow';\nexport * from './DataCell';\nexport * from './HeaderCell';\nexport * from './useSortableTable';\nexport * from './EditableCell';\nexport * from './ExpandableRow';\nexport * from './ExpandRowButton';\nexport * from './useTableKeyboardNavigation';\n","import classNames from 'classnames';\nimport React from 'react';\nimport { DataCell } from './DataCell';\nimport { VariantProvider, VariantType } from '@entur/form';\nimport { Tooltip } from '@entur/tooltip';\nimport './EditableCell.scss';\n\ntype EditableCellProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Inputelementet som skal være i tabellcellen */\n children: React.ReactElement;\n /** Valideringsvariant for EditableCell */\n variant?: VariantType;\n /** Varselmelding, som vil komme som en Tooltip under EditableCell */\n feedback?: string;\n /** Om cellen skal vise omriss til enhver tid\n * @default false\n */\n outlined?: boolean;\n [key: string]: any;\n};\n\nexport const EditableCell: React.FC<EditableCellProps> = ({\n children,\n className,\n feedback,\n variant,\n outlined = false,\n ...rest\n}) => {\n return (\n <VariantProvider variant={variant}>\n <DataCell\n className={classNames(\n 'eds-editable-cell',\n {\n 'eds-editable-cell--outlined': outlined,\n },\n className,\n )}\n {...rest}\n >\n <Tooltip\n disableHoverListener={!feedback}\n disableFocusListener={!feedback}\n placement=\"bottom\"\n content={feedback || undefined}\n variant={feedback ? 'error' : undefined}\n >\n {children}\n </Tooltip>\n </DataCell>\n </VariantProvider>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DownArrowIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport './ExpandRowButton.scss';\n\nexport type ExpandRowButtonProps = {\n open: boolean;\n onClick: (e: React.MouseEvent) => void;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const ExpandRowButton: React.FC<ExpandRowButtonProps> = ({\n open,\n onClick,\n ...rest\n}) => {\n return (\n <IconButton\n className={classNames('eds-expand-row-button', {\n 'eds-expand-row-button--open': open,\n })}\n onClick={onClick}\n aria-label={open ? 'Lukk tabellrad' : 'Utvid tabellrad'}\n {...rest}\n >\n <DownArrowIcon className=\"eds-expand-row-button__icon\" />\n </IconButton>\n );\n};\n","import React from 'react';\nimport { BaseExpand } from '@entur/expand';\n\nexport type ExpandableRowProps = {\n /** Antall kolonner tabellraden er */\n colSpan: number;\n /** Innholdet til ExpandableRow */\n children: React.ReactNode;\n /** Om ExpandableRow er åpen\n * @default false\n */\n open?: boolean;\n};\n\nexport const ExpandableRow: React.FC<ExpandableRowProps> = ({\n open = false,\n children,\n colSpan,\n}) => {\n return (\n <tr>\n <td colSpan={colSpan}>\n <BaseExpand open={open}>{children}</BaseExpand>\n </td>\n </tr>\n );\n};\n","import { useState, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';\nimport get from 'lodash.get';\n\nexport type ExternalSortConfig = {\n /**\n * @default \"\"\n */\n key: string;\n /** @default \"none\" */\n order: 'ascending' | 'descending' | 'none';\n};\n\nexport function useSortableData<T>(\n tableData: T[],\n externalSortConfig: ExternalSortConfig = { key: '', order: 'none' },\n): {\n sortedData: T[];\n getSortableHeaderProps: (\n args: SortableHeaderProps,\n ) => SortableHeaderReturnProps;\n getSortableTableProps: (\n args?: SortableTableProps,\n ) => SortableTableReturnProps;\n} {\n const [sortConfig, setSortConfig] = useState(externalSortConfig);\n\n const onSortRequested = (key: string) => {\n const sortingNewColumn = key !== sortConfig.key;\n if (sortingNewColumn || sortConfig.order === 'none')\n return setSortConfig({ key, order: 'ascending' });\n if (sortConfig.order === 'ascending')\n return setSortConfig({ key, order: 'descending' });\n if (sortConfig.order === 'descending')\n return setSortConfig({ key, order: 'none' });\n };\n\n const tableSortedAscending = [...tableData].sort((a: any, b: any) => {\n const valueOfA = get(a, sortConfig.key, a);\n const valueOfB = get(b, sortConfig.key, b);\n\n const comparableAValue =\n typeof valueOfA === 'string' ? valueOfA.toLowerCase() : valueOfA;\n const comparableBValue =\n typeof valueOfB === 'string' ? valueOfB.toLowerCase() : valueOfB;\n\n if (comparableAValue < comparableBValue) return -1;\n if (comparableAValue > comparableBValue) return 1;\n return 0;\n });\n\n const getSortedData: () => T[] = () => {\n if (sortConfig.order === 'none') {\n return tableData;\n }\n if (sortConfig.order === 'descending') {\n return [...tableSortedAscending].reverse();\n }\n return tableSortedAscending;\n };\n\n const sortedData = getSortedData();\n\n const getSortableHeaderProps = ({\n name,\n sortable = true,\n buttonProps,\n ...props\n }: SortableHeaderProps): SortableHeaderReturnProps => {\n return {\n name,\n sortable,\n sortConfig: sortConfig,\n sortableButtonProps: {\n onClick: () => onSortRequested(name),\n ...buttonProps,\n },\n ...props,\n };\n };\n\n const getSortableTableProps = ({\n sortable = true,\n ...props\n }: SortableTableProps = {}): SortableTableReturnProps => {\n return {\n sortable,\n sortConfig: sortConfig,\n ...props,\n };\n };\n\n return { sortedData, getSortableHeaderProps, getSortableTableProps };\n}\n\nexport type SortableHeaderProps = {\n /** Navnet headeren skal se etter i forhold til sortering av items */\n name: string;\n /** Om headeren skal være sorterbar eller ikke\n * @default true */\n sortable?: boolean;\n /** Props som sendes til knapp-elementet */\n buttonProps?: Omit<\n DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >,\n 'type' | 'onClick'\n >;\n [key: string]: any;\n};\n\nexport type SortableHeaderReturnProps = {\n name: string;\n sortable: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n\nexport type SortableTableProps = {\n /** @default true */\n sortable?: boolean;\n [key: string]: any;\n};\n\nexport type SortableTableReturnProps = {\n /** @default true */\n sortable?: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n"],"names":["Table","React","forwardRef","ref","className","_ref$fixed","_ref","fixed","_ref$spacing","spacing","_ref$sortable","sortable","_ref$changeSortDescri","changeSortDescription","_ref$stickyHeader","stickyHeader","rest","_objectWithoutPropertiesLoose","_excluded","sortableHeaderId","useRandomId","tableRef","useRef","useEffect","_tableElement$parentN","tableElement","current","observerElement","document","createElement","classList","add","parentNode","insertBefore","observer","IntersectionObserver","entries","toggle","isIntersecting","threshold","observe","unobserve","remove","Fragment","_extends","classNames","mergeRefs","undefined","VisuallyHidden","id","TableHead","props","TableBody","TableFooter","_objectDestructuringEmpty","TableRow","_ref$hover","hover","_ref$active","active","_ref$error","error","DataCell","_classNames","_ref$padding","padding","_ref$status","status","HeaderCell","children","name","sortConfig","sortableButtonProps","_ref$sortedAscendingA","sortedAscendingAriaLabel","_ref$sortedDescending","sortedDescendingAriaLabel","_React$useState","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","_ref2","sortedAriaInfo","_useState","setSortedAriaInfo","_excluded2","isFirefox","navigator","userAgent","toLowerCase","indexOf","dismissAriaTimer","setTimeout","clearTimeout","type","UnsortedIcon","size","UpArrowIcon","DownArrowIcon","onTableKeypress","event","currentRow","maxRow","allowWrap","preventDefault","warnAboutMissingStyles","feedback","variant","_ref$outlined","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","open","onClick","IconButton","_ref$open","colSpan","BaseExpand","tableData","externalSortConfig","setSortConfig","tableSortedAscending","concat","sort","a","b","valueOfA","get","valueOfB","comparableAValue","comparableBValue","sortedData","reverse","getSortableHeaderProps","buttonProps","getSortableTableProps","_temp","_ref2$sortable","numberOfRows","_tableBodyRef$current","setCurrentRow","_useState2","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","_tableBodyRef$current2","childNodes","parentElement","focus","tableRowRef","getTableRowNavigationProps","row","tabIndex","_len2","arguments","length","Array","_key2","onKeyDown","e","newCell","getTableBodyNavigationProps","_len","_key"],"mappings":"o2BAwBaA,EAAQC,EAAAA,QAAMC,YACzB,SAUEC,EAAAA,GACE,IATAC,IAAAA,UAASC,EAAAC,EACTC,MAAAA,cAAaF,EAAAG,EAAAF,EACbG,QAAAA,aAAU,UAASD,EAAAE,EAAAJ,EACnBK,SAAAA,cAAgBD,EAAAE,EAAAN,EAChBO,sBAAAA,aAAwB,uEAAsED,EAAAE,EAAAR,EAC9FS,aAAAA,cAAoBD,EACjBE,EAAIC,EAAAX,EAAAY,GAIHC,EAAmBC,cAAY,mBAE/BC,E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AAH,EAAA,EAAAA,EAAA,EAAA,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAATvJ,EAASuJ,EAAA,GAAAH,UAAAG,GAMZ,OAAA3H,EAAA,CACEsH,SAAAA,EACA/J,IAAK4J,EACLtC,QAAS,WAAA,OAAM2B,EAAca,IAC7BO,UAAW,SAACC,GACV,IAAMC,EAAUnE,EAAgBkE,EAAGhE,EAAYyC,EAAcvC,GAC7DyC,EAAcsB,KAEb1J,IAG8B2J,4BA3BrC,WAAiD,IAAA,IAAAC,EAAAR,UAAAC,OAATrJ,EAAS,IAAAsJ,MAAAM,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAAT7J,EAAS6J,GAAAT,UAAAS,GAC/C,OAAAjI,EAAA,CACEzC,IAAKoJ,GACFvI"}
package/dist/table.esm.js CHANGED
@@ -1,6 +1,7 @@
1
- import { mergeRefs, warnAboutMissingStyles } from '@entur/utils';
1
+ import { useRandomId, mergeRefs, warnAboutMissingStyles } from '@entur/utils';
2
2
  import React, { useRef, useEffect, useState } from 'react';
3
3
  import classNames from 'classnames';
4
+ import { VisuallyHidden } from '@entur/a11y';
4
5
  import { UnsortedIcon, UpArrowIcon, DownArrowIcon } from '@entur/icons';
5
6
  import get from 'lodash.get';
6
7
  import { VariantProvider } from '@entur/form';
@@ -38,7 +39,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
38
39
  return target;
39
40
  }
40
41
 
41
- var _excluded$8 = ["className", "fixed", "spacing", "sortable", "stickyHeader"];
42
+ var _excluded$8 = ["className", "fixed", "spacing", "sortable", "changeSortDescription", "stickyHeader"];
42
43
  var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
43
44
  var className = _ref.className,
44
45
  _ref$fixed = _ref.fixed,
@@ -47,9 +48,12 @@ var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
47
48
  spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
48
49
  _ref$sortable = _ref.sortable,
49
50
  sortable = _ref$sortable === void 0 ? false : _ref$sortable,
51
+ _ref$changeSortDescri = _ref.changeSortDescription,
52
+ changeSortDescription = _ref$changeSortDescri === void 0 ? 'Tabelloverskrifter med knapper kan trykkes på for å endre sortering,' : _ref$changeSortDescri,
50
53
  _ref$stickyHeader = _ref.stickyHeader,
51
54
  stickyHeader = _ref$stickyHeader === void 0 ? false : _ref$stickyHeader,
52
55
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
56
+ var sortableHeaderId = useRandomId('sortable-header');
53
57
  var tableRef = useRef(null);
54
58
  useEffect(function () {
55
59
  if (stickyHeader) {
@@ -74,8 +78,8 @@ var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
74
78
  observerElement.remove();
75
79
  };
76
80
  }
77
- }, []);
78
- return React.createElement("table", _extends({
81
+ }, [stickyHeader]);
82
+ return React.createElement(React.Fragment, null, React.createElement("table", _extends({
79
83
  className: classNames('eds-table', {
80
84
  'eds-table--fixed': fixed
81
85
  }, {
@@ -87,8 +91,11 @@ var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
87
91
  }, {
88
92
  'eds-table--sticky-header': stickyHeader
89
93
  }, className),
90
- ref: mergeRefs(ref, tableRef)
91
- }, rest));
94
+ ref: mergeRefs(ref, tableRef),
95
+ "aria-describedby": sortable ? sortableHeaderId : undefined
96
+ }, rest)), sortable && React.createElement(VisuallyHidden, {
97
+ id: sortableHeaderId
98
+ }, changeSortDescription));
92
99
  });
93
100
 
94
101
  var _excluded$7 = ["className"];
@@ -153,7 +160,7 @@ var DataCell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
153
160
  }, rest));
154
161
  });
155
162
 
156
- var _excluded$3 = ["className", "children", "name", "sortable", "sortConfig", "padding", "sortableButtonProps"],
163
+ var _excluded$3 = ["className", "children", "name", "sortable", "sortConfig", "padding", "sortableButtonProps", "sortedAscendingAriaLabel", "sortedDescendingAriaLabel"],
157
164
  _excluded2$1 = ["className"];
158
165
  var HeaderCell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
159
166
  var className = _ref.className,
@@ -165,6 +172,10 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
165
172
  _ref$padding = _ref.padding,
166
173
  padding = _ref$padding === void 0 ? 'default' : _ref$padding,
167
174
  sortableButtonProps = _ref.sortableButtonProps,
175
+ _ref$sortedAscendingA = _ref.sortedAscendingAriaLabel,
176
+ sortedAscendingAriaLabel = _ref$sortedAscendingA === void 0 ? ', sortert stigende' : _ref$sortedAscendingA,
177
+ _ref$sortedDescending = _ref.sortedDescendingAriaLabel,
178
+ sortedDescendingAriaLabel = _ref$sortedDescending === void 0 ? ', sortert synkende' : _ref$sortedDescending,
168
179
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
169
180
  var _React$useState = React.useState(false),
170
181
  isCurrentlySorted = _React$useState[0],
@@ -172,7 +183,7 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
172
183
  React.useEffect(function () {
173
184
  sortConfig && name && setIsCurrentlySorted(sortConfig && name === sortConfig.key);
174
185
  }, [sortConfig, name]);
175
- var ariaSort = isCurrentlySorted ? sortConfig && sortConfig.order : 'none';
186
+ var ariaSort = isCurrentlySorted ? sortConfig && sortConfig.order : undefined;
176
187
  return React.createElement("th", _extends({
177
188
  className: classNames('eds-table__header-cell', className, {
178
189
  'eds-table__header-cell--sortable': sortable,
@@ -185,32 +196,58 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
185
196
  }, rest), sortable && sortConfig && sortableButtonProps ? React.createElement(SortableHeaderCellButton, {
186
197
  sortableButtonProps: sortableButtonProps,
187
198
  sortConfig: sortConfig,
188
- isCurrentlySorted: isCurrentlySorted
199
+ isCurrentlySorted: isCurrentlySorted,
200
+ ariaSort: ariaSort,
201
+ sortedAscendingAriaLabel: sortedAscendingAriaLabel,
202
+ sortedDescendingAriaLabel: sortedDescendingAriaLabel
189
203
  }, children) : children);
190
204
  });
191
205
  var SortableHeaderCellButton = function SortableHeaderCellButton(_ref2) {
192
206
  var sortConfig = _ref2.sortConfig,
193
207
  sortableButtonProps = _ref2.sortableButtonProps,
194
208
  isCurrentlySorted = _ref2.isCurrentlySorted,
195
- children = _ref2.children;
209
+ children = _ref2.children,
210
+ ariaSort = _ref2.ariaSort,
211
+ sortedAscendingAriaLabel = _ref2.sortedAscendingAriaLabel,
212
+ sortedDescendingAriaLabel = _ref2.sortedDescendingAriaLabel;
213
+ var _useState = useState(''),
214
+ sortedAriaInfo = _useState[0],
215
+ setSortedAriaInfo = _useState[1];
196
216
  var className = sortableButtonProps.className,
197
217
  rest = _objectWithoutPropertiesLoose(sortableButtonProps, _excluded2$1);
218
+ var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
219
+ useEffect(function () {
220
+ var DISMISS_SORT_INFO_TIME = 3000;
221
+ if (sortConfig.order == 'ascending') {
222
+ setSortedAriaInfo(sortedAscendingAriaLabel);
223
+ } else if (sortConfig.order == 'descending') {
224
+ setSortedAriaInfo(sortedDescendingAriaLabel);
225
+ }
226
+ var dismissAriaTimer = setTimeout(function () {
227
+ setSortedAriaInfo('');
228
+ if (isFirefox) setSortedAriaInfo(', sort ' + sortConfig.order);
229
+ }, DISMISS_SORT_INFO_TIME);
230
+ return function () {
231
+ return clearTimeout(dismissAriaTimer);
232
+ };
233
+ }, [sortConfig.order]);
198
234
  return React.createElement("button", _extends({
199
235
  className: classNames('eds-table__header-cell-button', className),
200
- type: "button"
236
+ type: "button",
237
+ "aria-sort": ariaSort
201
238
  }, rest), children, (!isCurrentlySorted || sortConfig.order === 'none') && React.createElement(UnsortedIcon, {
202
- size: "16px",
239
+ size: "1rem",
203
240
  className: "eds-table__header-cell-button-icon",
204
- "aria-label": "usortert kolonne"
241
+ "aria-hidden": "true"
205
242
  }), isCurrentlySorted && sortConfig.order === 'ascending' && React.createElement(UpArrowIcon, {
206
- size: "16px",
243
+ size: "1rem",
207
244
  className: "eds-table__header-cell-button-icon",
208
- "aria-label": "stigende sortert kolonne"
245
+ "aria-hidden": "true"
209
246
  }), isCurrentlySorted && sortConfig.order === 'descending' && React.createElement(DownArrowIcon, {
210
- size: "16px",
247
+ size: "1rem",
211
248
  className: "eds-table__header-cell-button-icon",
212
- "aria-label": "synkende sortert kolonne"
213
- }));
249
+ "aria-hidden": "true"
250
+ }), React.createElement(VisuallyHidden, null, isCurrentlySorted && sortedAriaInfo));
214
251
  };
215
252
 
216
253
  var _excluded$2 = ["name", "sortable", "buttonProps"],
@@ -276,8 +313,9 @@ function useSortableData(tableData, externalSortConfig) {
276
313
  }, buttonProps)
277
314
  }, props);
278
315
  };
279
- var getSortableTableProps = function getSortableTableProps(_ref2) {
280
- var _ref2$sortable = _ref2.sortable,
316
+ var getSortableTableProps = function getSortableTableProps(_temp) {
317
+ var _ref2 = _temp === void 0 ? {} : _temp,
318
+ _ref2$sortable = _ref2.sortable,
281
319
  sortable = _ref2$sortable === void 0 ? true : _ref2$sortable,
282
320
  props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
283
321
  return _extends({
@@ -1 +1 @@
1
- {"version":3,"file":"table.esm.js","sources":["../src/Table.tsx","../src/TableHead.tsx","../src/TableBody.tsx","../src/TableFooter.tsx","../src/TableRow.tsx","../src/DataCell.tsx","../src/HeaderCell.tsx","../src/useSortableTable.ts","../src/EditableCell.tsx","../src/ExpandableRow.tsx","../src/ExpandRowButton.tsx","../src/useTableKeyboardNavigation.ts","../src/index.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs } from '@entur/utils';\n\nexport type TableProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Setter tettheten mellom rader og kolonner. Bruk gjerne middle og small for for sider med høy informasjonstetthet\n * @default \"default\"\n */\n spacing?: 'default' | 'middle' | 'small';\n /** Setter kolonne-layout til å være uavhengig av innhold\n * @default false\n */\n fixed?: boolean;\n /** Om header-raden skal bli værende på skjermen når man skroller tabellen\n * @default false\n */\n stickyHeader?: boolean;\n /** Innholdet i tabellen */\n children: React.ReactNode;\n [key: string]: any;\n};\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (\n {\n className,\n fixed = false,\n spacing = 'default',\n sortable = false,\n stickyHeader = false,\n ...rest\n },\n ref,\n ) => {\n const tableRef = useRef<HTMLTableElement>(null);\n\n useEffect(() => {\n if (stickyHeader) {\n /* We check when an inserted div above the header \n is outside our scrolling container to determine when\n the table header becomes sticky. This is necessary\n to conditionally add our box-shadow when the \n header is overlapping table rows */\n const tableElement = tableRef.current;\n const observerElement = document.createElement('div');\n observerElement.classList.add('sticky-observer');\n\n tableElement?.parentNode?.insertBefore(observerElement, tableElement);\n\n const observer = new IntersectionObserver(\n entries => {\n tableElement?.classList.toggle(\n 'eds-table--sticky-header--active',\n !entries[0].isIntersecting,\n );\n },\n { threshold: [0, 1] },\n );\n\n observer.observe(observerElement);\n\n return () => {\n observer.unobserve(observerElement);\n observerElement.remove();\n };\n }\n }, []);\n\n return (\n <table\n className={classNames(\n 'eds-table',\n { 'eds-table--fixed': fixed },\n { 'eds-table--middle': spacing === 'middle' },\n { 'eds-table--small': spacing === 'small' },\n { 'eds-table--sortable': sortable },\n { 'eds-table--sticky-header': stickyHeader },\n className,\n )}\n ref={mergeRefs(ref, tableRef)}\n {...rest}\n />\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableHeadProps = {\n /** Kolonneoverskrifter */\n children: React.ReactNode;\n /** Esktra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>(({ className, ...props }, ref) => (\n <thead\n className={classNames('eds-table__head', className)}\n ref={ref}\n {...props}\n />\n));\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableBodyProps = {\n /** Tabellrader */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n ref?: React.Ref<HTMLTableSectionElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>(({ className, ...rest }, ref) => (\n <tbody\n className={classNames('eds-table__body', className)}\n ref={ref}\n {...rest}\n />\n));\n","import React from 'react';\n\nexport type TableFooterProps = {\n /** Tabellrader */\n children: React.ReactNode;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(({ ...props }, ref) => <tfoot ref={ref} {...props} />);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableRowProps = {\n /** Tabellceller */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /**Hvis satt, så vil tabellraden endre fargen ved hover\n * @default false\n */\n hover?: boolean;\n /** Om raden er klikkbar, så vil raden endre farge, og musepekeren vil symbolisere interaktivitet\n * @default false\n */\n active?: boolean;\n /**Signalisere om at det er en feil i tabellraden\n * @default false\n */\n error?: boolean;\n ref?: React.Ref<HTMLTableRowElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableRowElement>,\n HTMLTableRowElement\n>;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { className, hover = false, active = false, error = false, ...rest },\n ref: React.Ref<HTMLTableRowElement>,\n ) => (\n <tr\n className={classNames('eds-table__row', className, {\n 'eds-table__row--hover': hover,\n 'eds-table__row--active': active,\n 'eds-table__row--error': error,\n })}\n ref={ref}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type DataCellProps = {\n /** Innholdet i tabellcellen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for DataCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n /** Viser en status-sirkel for DataCell */\n status?: 'positive' | 'negative' | 'neutral';\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status = undefined, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\n [`eds-table__data-cell--status-${status}`]: status,\n 'eds-table__data-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__data-cell--padding-radio': padding === 'radio',\n 'eds-table__data-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { DownArrowIcon, UpArrowIcon, UnsortedIcon } from '@entur/icons';\n\nimport { ExternalSortConfig } from '.';\n\nimport './HeaderCell.scss';\n\nexport type HeaderCellProps = {\n /** Kolonneoverskrift */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for HeaderCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n\n /** Ekstra props som kan sendes til sorteringsknappelementet. Benyttes via useSortableTable */\n sortableButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /** Om komponenten brukes til sortering. Benytt via useSortableTable\n * @default false\n */\n sortable?: boolean;\n /** Konfigurering og rekkefølgen på sortering. Benyttes via useSortableTable */\n sortConfig?: ExternalSortConfig;\n /** Navnet det skal sorteres på. Benyttes via useSortableTable */\n name?: string;\n} & React.DetailedHTMLProps<\n React.ThHTMLAttributes<HTMLTableCellElement>,\n HTMLTableCellElement\n>;\n\nexport const HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n HeaderCellProps\n>(\n (\n {\n className,\n children,\n name,\n sortable = false,\n sortConfig,\n padding = 'default',\n sortableButtonProps,\n ...rest\n },\n ref,\n ) => {\n const [isCurrentlySorted, setIsCurrentlySorted] =\n React.useState<boolean>(false);\n React.useEffect(() => {\n sortConfig &&\n name &&\n setIsCurrentlySorted(sortConfig && name === sortConfig.key);\n }, [sortConfig, name]);\n const ariaSort = isCurrentlySorted\n ? sortConfig && sortConfig.order\n : 'none';\n\n return (\n <th\n className={classNames('eds-table__header-cell', className, {\n 'eds-table__header-cell--sortable': sortable,\n 'eds-table__header-cell--padding-radio': padding === 'radio',\n 'eds-table__header-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__header-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n aria-sort={ariaSort}\n ref={ref}\n {...rest}\n >\n {sortable && sortConfig && sortableButtonProps ? (\n <SortableHeaderCellButton\n sortableButtonProps={sortableButtonProps}\n sortConfig={sortConfig}\n isCurrentlySorted={isCurrentlySorted}\n >\n {children}\n </SortableHeaderCellButton>\n ) : (\n children\n )}\n </th>\n );\n },\n);\n\ntype SortableHeaderCellButtonProps = {\n sortConfig: ExternalSortConfig;\n isCurrentlySorted: boolean;\n sortableButtonProps: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n};\n\nconst SortableHeaderCellButton: React.FC<SortableHeaderCellButtonProps> = ({\n sortConfig,\n sortableButtonProps,\n isCurrentlySorted,\n children,\n}) => {\n const { className, ...rest } = sortableButtonProps;\n return (\n <button\n className={classNames('eds-table__header-cell-button', className)}\n type=\"button\"\n {...rest}\n >\n {children}\n {(!isCurrentlySorted || sortConfig.order === 'none') && (\n <UnsortedIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"usortert kolonne\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"stigende sortert kolonne\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"16px\"\n className=\"eds-table__header-cell-button-icon\"\n aria-label=\"synkende sortert kolonne\"\n />\n )}\n </button>\n );\n};\n","import { useState, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';\nimport get from 'lodash.get';\n\nexport type ExternalSortConfig = {\n /**\n * @default \"\"\n */\n key: string;\n /** @default \"none\" */\n order: 'ascending' | 'descending' | 'none';\n};\n\nexport function useSortableData<T>(\n tableData: T[],\n externalSortConfig: ExternalSortConfig = { key: '', order: 'none' },\n): {\n sortedData: T[];\n getSortableHeaderProps: (\n args: SortableHeaderProps,\n ) => SortableHeaderReturnProps;\n getSortableTableProps: (args: SortableTableProps) => SortableTableReturnProps;\n} {\n const [sortConfig, setSortConfig] = useState(externalSortConfig);\n\n const onSortRequested = (key: string) => {\n const sortingNewColumn = key !== sortConfig.key;\n if (sortingNewColumn || sortConfig.order === 'none')\n return setSortConfig({ key, order: 'ascending' });\n if (sortConfig.order === 'ascending')\n return setSortConfig({ key, order: 'descending' });\n if (sortConfig.order === 'descending')\n return setSortConfig({ key, order: 'none' });\n };\n\n const tableSortedAscending = [...tableData].sort((a: any, b: any) => {\n const valueOfA = get(a, sortConfig.key, a);\n const valueOfB = get(b, sortConfig.key, b);\n\n const comparableAValue =\n typeof valueOfA === 'string' ? valueOfA.toLowerCase() : valueOfA;\n const comparableBValue =\n typeof valueOfB === 'string' ? valueOfB.toLowerCase() : valueOfB;\n\n if (comparableAValue < comparableBValue) return -1;\n if (comparableAValue > comparableBValue) return 1;\n return 0;\n });\n\n const getSortedData: () => T[] = () => {\n if (sortConfig.order === 'none') {\n return tableData;\n }\n if (sortConfig.order === 'descending') {\n return [...tableSortedAscending].reverse();\n }\n return tableSortedAscending;\n };\n\n const sortedData = getSortedData();\n\n const getSortableHeaderProps = ({\n name,\n sortable = true,\n buttonProps,\n ...props\n }: SortableHeaderProps): SortableHeaderReturnProps => {\n return {\n name,\n sortable,\n sortConfig: sortConfig,\n sortableButtonProps: {\n onClick: () => onSortRequested(name),\n ...buttonProps,\n },\n ...props,\n };\n };\n\n const getSortableTableProps = ({\n sortable = true,\n ...props\n }: SortableTableProps): SortableTableReturnProps => {\n return {\n sortable,\n sortConfig: sortConfig,\n ...props,\n };\n };\n\n return { sortedData, getSortableHeaderProps, getSortableTableProps };\n}\n\nexport type SortableHeaderProps = {\n /** Navnet headeren skal se etter i forhold til sortering av items */\n name: string;\n /** Om headeren skal være sorterbar eller ikke\n * @default true */\n sortable?: boolean;\n /** Props som sendes til knapp-elementet */\n buttonProps?: Omit<\n DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >,\n 'type' | 'onClick'\n >;\n [key: string]: any;\n};\n\nexport type SortableHeaderReturnProps = {\n name: string;\n sortable: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n\nexport type SortableTableProps = {\n /** @default true */\n sortable?: boolean;\n [key: string]: any;\n};\n\nexport type SortableTableReturnProps = {\n /** @default true */\n sortable?: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n","import classNames from 'classnames';\nimport React from 'react';\nimport { DataCell } from './DataCell';\nimport { VariantProvider, VariantType } from '@entur/form';\nimport { Tooltip } from '@entur/tooltip';\nimport './EditableCell.scss';\n\ntype EditableCellProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Inputelementet som skal være i tabellcellen */\n children: React.ReactElement;\n /** Valideringsvariant for EditableCell */\n variant?: VariantType;\n /** Varselmelding, som vil komme som en Tooltip under EditableCell */\n feedback?: string;\n /** Om cellen skal vise omriss til enhver tid\n * @default false\n */\n outlined?: boolean;\n [key: string]: any;\n};\n\nexport const EditableCell: React.FC<EditableCellProps> = ({\n children,\n className,\n feedback,\n variant,\n outlined = false,\n ...rest\n}) => {\n return (\n <VariantProvider variant={variant}>\n <DataCell\n className={classNames(\n 'eds-editable-cell',\n {\n 'eds-editable-cell--outlined': outlined,\n },\n className,\n )}\n {...rest}\n >\n <Tooltip\n disableHoverListener={!feedback}\n disableFocusListener={!feedback}\n placement=\"bottom\"\n content={feedback || undefined}\n variant={feedback ? 'error' : undefined}\n >\n {children}\n </Tooltip>\n </DataCell>\n </VariantProvider>\n );\n};\n","import React from 'react';\nimport { BaseExpand } from '@entur/expand';\n\nexport type ExpandableRowProps = {\n /** Antall kolonner tabellraden er */\n colSpan: number;\n /** Innholdet til ExpandableRow */\n children: React.ReactNode;\n /** Om ExpandableRow er åpen\n * @default false\n */\n open?: boolean;\n};\n\nexport const ExpandableRow: React.FC<ExpandableRowProps> = ({\n open = false,\n children,\n colSpan,\n}) => {\n return (\n <tr>\n <td colSpan={colSpan}>\n <BaseExpand open={open}>{children}</BaseExpand>\n </td>\n </tr>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DownArrowIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport './ExpandRowButton.scss';\n\nexport type ExpandRowButtonProps = {\n open: boolean;\n onClick: (e: React.MouseEvent) => void;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const ExpandRowButton: React.FC<ExpandRowButtonProps> = ({\n open,\n onClick,\n ...rest\n}) => {\n return (\n <IconButton\n className={classNames('eds-expand-row-button', {\n 'eds-expand-row-button--open': open,\n })}\n onClick={onClick}\n aria-label={open ? 'Lukk tabellrad' : 'Utvid tabellrad'}\n {...rest}\n >\n <DownArrowIcon className=\"eds-expand-row-button__icon\" />\n </IconButton>\n );\n};\n","import { useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport { TableBodyProps, TableRowProps } from './index';\n\nfunction onTableKeypress(\n event: KeyboardEvent,\n currentRow: number,\n maxRow: number,\n allowWrap?: boolean,\n) {\n const keyPress = event.key;\n switch (keyPress) {\n case 'ArrowUp':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === 0 ? maxRow - 1 : currentRow - 1;\n } else {\n return currentRow > 0 ? currentRow - 1 : 0;\n }\n case 'ArrowDown':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === maxRow - 1 ? 0 : currentRow + 1;\n } else {\n return currentRow < maxRow - 1 ? currentRow + 1 : currentRow;\n }\n default:\n return currentRow;\n }\n}\n\nexport type useTableKeyboardNavigationProps = (\n /** Antall rader i tabellen */\n numberOfRows: number,\n /** Tillate at man kan navigere sirkulært\n * @default false\n */\n allowWrap?: boolean,\n) => {\n getTableRowNavigationProps: (\n /** Raden i tabellen (0-indeksert) */\n row: number,\n ) => Partial<TableRowProps>;\n getTableBodyNavigationProps: () => Partial<TableBodyProps>;\n};\n\nexport const useTableKeyboardNavigation: useTableKeyboardNavigationProps = (\n numberOfRows = 0,\n allowWrap = true,\n) => {\n const [currentRow, setCurrentRow] = useState(numberOfRows);\n const [maxRow, setMaxRow] = useState(0);\n\n const tableBodyRef = useRef<HTMLTableSectionElement>(null);\n const tableHasFocus = tableBodyRef?.current?.contains(document.activeElement);\n\n useEffect(() => {\n tableBodyRef &&\n tableBodyRef.current &&\n tableHasFocus &&\n tableBodyRef.current.childNodes[\n currentRow\n ].childNodes[0].parentElement?.focus();\n }, [currentRow, tableHasFocus]);\n\n function getTableBodyNavigationProps(...rest: any): Partial<TableBodyProps> {\n return {\n ref: tableBodyRef,\n ...rest,\n };\n }\n\n const tableRowRef = useRef<HTMLTableRowElement>(null);\n function getTableRowNavigationProps(\n row: number,\n ...rest: any\n ): Partial<TableRowProps> {\n if (row >= maxRow) {\n setMaxRow(row + 1);\n }\n const tabIndex = currentRow ? 0 : -1;\n return {\n tabIndex,\n ref: tableRowRef,\n onClick: () => setCurrentRow(row),\n onKeyDown: (e: KeyboardEvent) => {\n const newCell = onTableKeypress(e, currentRow, numberOfRows, allowWrap);\n setCurrentRow(newCell);\n },\n ...rest,\n };\n }\n return { getTableRowNavigationProps, getTableBodyNavigationProps };\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('table');\n\nexport * from './Table';\nexport * from './TableHead';\nexport * from './TableBody';\nexport * from './TableFooter';\nexport * from './TableRow';\nexport * from './DataCell';\nexport * from './HeaderCell';\nexport * from './useSortableTable';\nexport * from './EditableCell';\nexport * from './ExpandableRow';\nexport * from './ExpandRowButton';\nexport * from './useTableKeyboardNavigation';\n"],"names":["Table","React","forwardRef","ref","className","fixed","spacing","sortable","stickyHeader","rest","_excluded","tableRef","useRef","useEffect","tableElement","current","observerElement","document","createElement","classList","add","parentNode","insertBefore","observer","IntersectionObserver","entries","toggle","isIntersecting","threshold","observe","unobserve","remove","classNames","mergeRefs","TableHead","props","TableBody","TableFooter","TableRow","hover","active","error","DataCell","padding","status","undefined","HeaderCell","children","name","sortConfig","sortableButtonProps","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","_excluded2","type","UnsortedIcon","size","UpArrowIcon","DownArrowIcon","useSortableData","tableData","externalSortConfig","setSortConfig","onSortRequested","sortingNewColumn","tableSortedAscending","sort","a","b","valueOfA","get","valueOfB","comparableAValue","toLowerCase","comparableBValue","getSortedData","reverse","sortedData","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","EditableCell","feedback","variant","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","ExpandableRow","open","colSpan","BaseExpand","ExpandRowButton","IconButton","onTableKeypress","event","currentRow","maxRow","allowWrap","keyPress","preventDefault","useTableKeyboardNavigation","numberOfRows","setCurrentRow","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","childNodes","parentElement","focus","getTableBodyNavigationProps","tableRowRef","getTableRowNavigationProps","row","tabIndex","onKeyDown","e","newCell","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,IAAMA,KAAK,gBAAGC,KAAK,CAACC,UAAU,CACnC,UASEC,IAAAA,EAAAA,GAAG,EACD;EAAA,IARAC,SAAS,QAATA,SAAS;AAAA,IAAA,UAAA,GAAA,IAAA,CACTC,KAAK;AAALA,IAAAA,KAAK,2BAAG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A,GAAA,SAAA,CAAA,KAAA,CAAA,CAAA;AAAA,KAAA;AAMZ,IAAA,OAAA,QAAA,CAAA;AACEoH,MAAAA,QAAQ,EAARA,QAAQ;AACR1H,MAAAA,GAAG,EAAEuH,WAAW;AAChBrC,MAAAA,OAAO,EAAE,SAAA,OAAA,GAAA;QAAA,OAAM2B,aAAa,CAACY,GAAG,CAAC,CAAA;AAAA,OAAA;MACjCE,SAAS,EAAE,SAACC,SAAAA,CAAAA,CAAgB,EAAI;QAC9B,IAAMC,OAAO,GAAGzB,eAAe,CAACwB,CAAC,EAAEtB,UAAU,EAAEM,YAAY,EAAEJ,SAAS,CAAC,CAAA;QACvEK,aAAa,CAACgB,OAAO,CAAC,CAAA;AACxB,OAAA;AAAC,KAAA,EACEvH,IAAI,CAAA,CAAA;AAEX,GAAA;EACA,OAAO;AAAEkH,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAAEF,IAAAA,2BAA2B,EAA3BA,2BAAAA;GAA6B,CAAA;AACpE;;ACzFAQ,sBAAsB,CAAC,OAAO,CAAC;;;;"}
1
+ {"version":3,"file":"table.esm.js","sources":["../src/Table.tsx","../src/TableHead.tsx","../src/TableBody.tsx","../src/TableFooter.tsx","../src/TableRow.tsx","../src/DataCell.tsx","../src/HeaderCell.tsx","../src/useSortableTable.ts","../src/EditableCell.tsx","../src/ExpandableRow.tsx","../src/ExpandRowButton.tsx","../src/useTableKeyboardNavigation.ts","../src/index.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport classNames from 'classnames';\nimport { useRandomId, mergeRefs } from '@entur/utils';\nimport { VisuallyHidden } from '@entur/a11y';\n\nexport type TableProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Setter tettheten mellom rader og kolonner. Bruk gjerne middle og small for for sider med høy informasjonstetthet\n * @default \"default\"\n */\n spacing?: 'default' | 'middle' | 'small';\n /** Setter kolonne-layout til å være uavhengig av innhold\n * @default false\n */\n fixed?: boolean;\n /** Om header-raden skal bli værende på skjermen når man skroller tabellen\n * @default false\n */\n stickyHeader?: boolean;\n /** Innholdet i tabellen */\n children: React.ReactNode;\n [key: string]: any;\n};\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n (\n {\n className,\n fixed = false,\n spacing = 'default',\n sortable = false,\n changeSortDescription = 'Tabelloverskrifter med knapper kan trykkes på for å endre sortering,',\n stickyHeader = false,\n ...rest\n },\n ref,\n ) => {\n const sortableHeaderId = useRandomId('sortable-header');\n\n const tableRef = useRef<HTMLTableElement>(null);\n\n useEffect(() => {\n if (stickyHeader) {\n /* We check when an inserted div above the header \n is outside our scrolling container to determine when\n the table header becomes sticky. This is necessary\n to conditionally add our box-shadow when the \n header is overlapping table rows */\n const tableElement = tableRef.current;\n const observerElement = document.createElement('div');\n observerElement.classList.add('sticky-observer');\n\n tableElement?.parentNode?.insertBefore(observerElement, tableElement);\n\n const observer = new IntersectionObserver(\n entries => {\n tableElement?.classList.toggle(\n 'eds-table--sticky-header--active',\n !entries[0].isIntersecting,\n );\n },\n { threshold: [0, 1] },\n );\n\n observer.observe(observerElement);\n\n return () => {\n observer.unobserve(observerElement);\n observerElement.remove();\n };\n }\n }, [stickyHeader]);\n\n return (\n <>\n <table\n className={classNames(\n 'eds-table',\n { 'eds-table--fixed': fixed },\n { 'eds-table--middle': spacing === 'middle' },\n { 'eds-table--small': spacing === 'small' },\n { 'eds-table--sortable': sortable },\n { 'eds-table--sticky-header': stickyHeader },\n className,\n )}\n ref={mergeRefs(ref, tableRef)}\n aria-describedby={sortable ? sortableHeaderId : undefined}\n {...rest}\n />\n {sortable && (\n <VisuallyHidden id={sortableHeaderId}>\n {changeSortDescription}\n </VisuallyHidden>\n )}\n </>\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableHeadProps = {\n /** Kolonneoverskrifter */\n children: React.ReactNode;\n /** Esktra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableHead = React.forwardRef<\n HTMLTableSectionElement,\n TableHeadProps\n>(({ className, ...props }, ref) => (\n <thead\n className={classNames('eds-table__head', className)}\n ref={ref}\n {...props}\n />\n));\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableBodyProps = {\n /** Tabellrader */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n ref?: React.Ref<HTMLTableSectionElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableBody = React.forwardRef<\n HTMLTableSectionElement,\n TableBodyProps\n>(({ className, ...rest }, ref) => (\n <tbody\n className={classNames('eds-table__body', className)}\n ref={ref}\n {...rest}\n />\n));\n","import React from 'react';\n\nexport type TableFooterProps = {\n /** Tabellrader */\n children: React.ReactNode;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableSectionElement>,\n HTMLTableSectionElement\n>;\n\nexport const TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n TableFooterProps\n>(({ ...props }, ref) => <tfoot ref={ref} {...props} />);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type TableRowProps = {\n /** Tabellceller */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /**Hvis satt, så vil tabellraden endre fargen ved hover\n * @default false\n */\n hover?: boolean;\n /** Om raden er klikkbar, så vil raden endre farge, og musepekeren vil symbolisere interaktivitet\n * @default false\n */\n active?: boolean;\n /**Signalisere om at det er en feil i tabellraden\n * @default false\n */\n error?: boolean;\n ref?: React.Ref<HTMLTableRowElement>;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLTableRowElement>,\n HTMLTableRowElement\n>;\n\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { className, hover = false, active = false, error = false, ...rest },\n ref: React.Ref<HTMLTableRowElement>,\n ) => (\n <tr\n className={classNames('eds-table__row', className, {\n 'eds-table__row--hover': hover,\n 'eds-table__row--active': active,\n 'eds-table__row--error': error,\n })}\n ref={ref}\n {...rest}\n />\n ),\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nexport type DataCellProps = {\n /** Innholdet i tabellcellen */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for DataCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n /** Viser en status-sirkel for DataCell */\n status?: 'positive' | 'negative' | 'neutral';\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status = undefined, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\n [`eds-table__data-cell--status-${status}`]: status,\n 'eds-table__data-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__data-cell--padding-radio': padding === 'radio',\n 'eds-table__data-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n {...rest}\n />\n ),\n);\n","import React, { useEffect, useState } from 'react';\nimport classNames from 'classnames';\n\nimport { DownArrowIcon, UpArrowIcon, UnsortedIcon } from '@entur/icons';\n\nimport { ExternalSortConfig } from '.';\n\nimport './HeaderCell.scss';\nimport { VisuallyHidden } from '@entur/a11y';\n\nexport type HeaderCellProps = {\n /** Kolonneoverskrift */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Størrelse som settes for HeaderCell for ulikt innhold av komponenter */\n padding?: 'default' | 'checkbox' | 'radio' | 'overflow-menu';\n\n /** Ekstra props som kan sendes til sorteringsknappelementet. Benyttes via useSortableTable */\n sortableButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n\n /** Om komponenten brukes til sortering. Benytt via useSortableTable\n * @default false\n */\n sortable?: boolean;\n /** Konfigurering og rekkefølgen på sortering. Benyttes via useSortableTable */\n sortConfig?: ExternalSortConfig;\n /** Navnet det skal sorteres på. Benyttes via useSortableTable */\n name?: string;\n sortedAscendingAriaLabel?: string;\n sortedDescendingAriaLabel?: string;\n} & React.DetailedHTMLProps<\n React.ThHTMLAttributes<HTMLTableCellElement>,\n HTMLTableCellElement\n>;\n\nexport const HeaderCell = React.forwardRef<\n HTMLTableCellElement,\n HeaderCellProps\n>(\n (\n {\n className,\n children,\n name,\n sortable = false,\n sortConfig,\n padding = 'default',\n sortableButtonProps,\n sortedAscendingAriaLabel = ', sortert stigende',\n sortedDescendingAriaLabel = ', sortert synkende',\n ...rest\n },\n ref,\n ) => {\n const [isCurrentlySorted, setIsCurrentlySorted] =\n React.useState<boolean>(false);\n React.useEffect(() => {\n sortConfig &&\n name &&\n setIsCurrentlySorted(sortConfig && name === sortConfig.key);\n }, [sortConfig, name]);\n const ariaSort = isCurrentlySorted\n ? sortConfig && sortConfig.order\n : undefined;\n\n return (\n <th\n className={classNames('eds-table__header-cell', className, {\n 'eds-table__header-cell--sortable': sortable,\n 'eds-table__header-cell--padding-radio': padding === 'radio',\n 'eds-table__header-cell--padding-checkbox': padding === 'checkbox',\n 'eds-table__header-cell--padding-overflow-menu':\n padding === 'overflow-menu',\n })}\n aria-sort={ariaSort}\n ref={ref}\n {...rest}\n >\n {sortable && sortConfig && sortableButtonProps ? (\n <SortableHeaderCellButton\n sortableButtonProps={sortableButtonProps}\n sortConfig={sortConfig}\n isCurrentlySorted={isCurrentlySorted}\n ariaSort={ariaSort}\n sortedAscendingAriaLabel={sortedAscendingAriaLabel}\n sortedDescendingAriaLabel={sortedDescendingAriaLabel}\n >\n {children}\n </SortableHeaderCellButton>\n ) : (\n children\n )}\n </th>\n );\n },\n);\n\ntype SortableHeaderCellButtonProps = {\n sortConfig: ExternalSortConfig;\n isCurrentlySorted: boolean;\n sortableButtonProps: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >;\n ariaSort?: 'none' | 'ascending' | 'descending' | 'other' | undefined;\n sortedAscendingAriaLabel?: string;\n sortedDescendingAriaLabel?: string;\n};\n\nconst SortableHeaderCellButton: React.FC<SortableHeaderCellButtonProps> = ({\n sortConfig,\n sortableButtonProps,\n isCurrentlySorted,\n children,\n ariaSort,\n sortedAscendingAriaLabel,\n sortedDescendingAriaLabel,\n}) => {\n const [sortedAriaInfo, setSortedAriaInfo] = useState<string | undefined>('');\n\n const { className, ...rest } = sortableButtonProps;\n\n const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\n useEffect(() => {\n const DISMISS_SORT_INFO_TIME = 3000;\n if (sortConfig.order == 'ascending') {\n setSortedAriaInfo(sortedAscendingAriaLabel);\n } else if (sortConfig.order == 'descending') {\n setSortedAriaInfo(sortedDescendingAriaLabel);\n }\n const dismissAriaTimer = setTimeout(() => {\n setSortedAriaInfo('');\n if (isFirefox) setSortedAriaInfo(', sort ' + sortConfig.order);\n }, DISMISS_SORT_INFO_TIME);\n\n return () => clearTimeout(dismissAriaTimer);\n }, [sortConfig.order]);\n\n return (\n <button\n className={classNames('eds-table__header-cell-button', className)}\n type=\"button\"\n aria-sort={ariaSort}\n {...rest}\n >\n {children}\n {(!isCurrentlySorted || sortConfig.order === 'none') && (\n <UnsortedIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1rem\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n <VisuallyHidden>{isCurrentlySorted && sortedAriaInfo}</VisuallyHidden>\n </button>\n );\n};\n","import { useState, DetailedHTMLProps, ButtonHTMLAttributes } from 'react';\nimport get from 'lodash.get';\n\nexport type ExternalSortConfig = {\n /**\n * @default \"\"\n */\n key: string;\n /** @default \"none\" */\n order: 'ascending' | 'descending' | 'none';\n};\n\nexport function useSortableData<T>(\n tableData: T[],\n externalSortConfig: ExternalSortConfig = { key: '', order: 'none' },\n): {\n sortedData: T[];\n getSortableHeaderProps: (\n args: SortableHeaderProps,\n ) => SortableHeaderReturnProps;\n getSortableTableProps: (\n args?: SortableTableProps,\n ) => SortableTableReturnProps;\n} {\n const [sortConfig, setSortConfig] = useState(externalSortConfig);\n\n const onSortRequested = (key: string) => {\n const sortingNewColumn = key !== sortConfig.key;\n if (sortingNewColumn || sortConfig.order === 'none')\n return setSortConfig({ key, order: 'ascending' });\n if (sortConfig.order === 'ascending')\n return setSortConfig({ key, order: 'descending' });\n if (sortConfig.order === 'descending')\n return setSortConfig({ key, order: 'none' });\n };\n\n const tableSortedAscending = [...tableData].sort((a: any, b: any) => {\n const valueOfA = get(a, sortConfig.key, a);\n const valueOfB = get(b, sortConfig.key, b);\n\n const comparableAValue =\n typeof valueOfA === 'string' ? valueOfA.toLowerCase() : valueOfA;\n const comparableBValue =\n typeof valueOfB === 'string' ? valueOfB.toLowerCase() : valueOfB;\n\n if (comparableAValue < comparableBValue) return -1;\n if (comparableAValue > comparableBValue) return 1;\n return 0;\n });\n\n const getSortedData: () => T[] = () => {\n if (sortConfig.order === 'none') {\n return tableData;\n }\n if (sortConfig.order === 'descending') {\n return [...tableSortedAscending].reverse();\n }\n return tableSortedAscending;\n };\n\n const sortedData = getSortedData();\n\n const getSortableHeaderProps = ({\n name,\n sortable = true,\n buttonProps,\n ...props\n }: SortableHeaderProps): SortableHeaderReturnProps => {\n return {\n name,\n sortable,\n sortConfig: sortConfig,\n sortableButtonProps: {\n onClick: () => onSortRequested(name),\n ...buttonProps,\n },\n ...props,\n };\n };\n\n const getSortableTableProps = ({\n sortable = true,\n ...props\n }: SortableTableProps = {}): SortableTableReturnProps => {\n return {\n sortable,\n sortConfig: sortConfig,\n ...props,\n };\n };\n\n return { sortedData, getSortableHeaderProps, getSortableTableProps };\n}\n\nexport type SortableHeaderProps = {\n /** Navnet headeren skal se etter i forhold til sortering av items */\n name: string;\n /** Om headeren skal være sorterbar eller ikke\n * @default true */\n sortable?: boolean;\n /** Props som sendes til knapp-elementet */\n buttonProps?: Omit<\n DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >,\n 'type' | 'onClick'\n >;\n [key: string]: any;\n};\n\nexport type SortableHeaderReturnProps = {\n name: string;\n sortable: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n\nexport type SortableTableProps = {\n /** @default true */\n sortable?: boolean;\n [key: string]: any;\n};\n\nexport type SortableTableReturnProps = {\n /** @default true */\n sortable?: boolean;\n sortConfig: ExternalSortConfig;\n [key: string]: any;\n};\n","import classNames from 'classnames';\nimport React from 'react';\nimport { DataCell } from './DataCell';\nimport { VariantProvider, VariantType } from '@entur/form';\nimport { Tooltip } from '@entur/tooltip';\nimport './EditableCell.scss';\n\ntype EditableCellProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Inputelementet som skal være i tabellcellen */\n children: React.ReactElement;\n /** Valideringsvariant for EditableCell */\n variant?: VariantType;\n /** Varselmelding, som vil komme som en Tooltip under EditableCell */\n feedback?: string;\n /** Om cellen skal vise omriss til enhver tid\n * @default false\n */\n outlined?: boolean;\n [key: string]: any;\n};\n\nexport const EditableCell: React.FC<EditableCellProps> = ({\n children,\n className,\n feedback,\n variant,\n outlined = false,\n ...rest\n}) => {\n return (\n <VariantProvider variant={variant}>\n <DataCell\n className={classNames(\n 'eds-editable-cell',\n {\n 'eds-editable-cell--outlined': outlined,\n },\n className,\n )}\n {...rest}\n >\n <Tooltip\n disableHoverListener={!feedback}\n disableFocusListener={!feedback}\n placement=\"bottom\"\n content={feedback || undefined}\n variant={feedback ? 'error' : undefined}\n >\n {children}\n </Tooltip>\n </DataCell>\n </VariantProvider>\n );\n};\n","import React from 'react';\nimport { BaseExpand } from '@entur/expand';\n\nexport type ExpandableRowProps = {\n /** Antall kolonner tabellraden er */\n colSpan: number;\n /** Innholdet til ExpandableRow */\n children: React.ReactNode;\n /** Om ExpandableRow er åpen\n * @default false\n */\n open?: boolean;\n};\n\nexport const ExpandableRow: React.FC<ExpandableRowProps> = ({\n open = false,\n children,\n colSpan,\n}) => {\n return (\n <tr>\n <td colSpan={colSpan}>\n <BaseExpand open={open}>{children}</BaseExpand>\n </td>\n </tr>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { DownArrowIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport './ExpandRowButton.scss';\n\nexport type ExpandRowButtonProps = {\n open: boolean;\n onClick: (e: React.MouseEvent) => void;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const ExpandRowButton: React.FC<ExpandRowButtonProps> = ({\n open,\n onClick,\n ...rest\n}) => {\n return (\n <IconButton\n className={classNames('eds-expand-row-button', {\n 'eds-expand-row-button--open': open,\n })}\n onClick={onClick}\n aria-label={open ? 'Lukk tabellrad' : 'Utvid tabellrad'}\n {...rest}\n >\n <DownArrowIcon className=\"eds-expand-row-button__icon\" />\n </IconButton>\n );\n};\n","import { useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport { TableBodyProps, TableRowProps } from './index';\n\nfunction onTableKeypress(\n event: KeyboardEvent,\n currentRow: number,\n maxRow: number,\n allowWrap?: boolean,\n) {\n const keyPress = event.key;\n switch (keyPress) {\n case 'ArrowUp':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === 0 ? maxRow - 1 : currentRow - 1;\n } else {\n return currentRow > 0 ? currentRow - 1 : 0;\n }\n case 'ArrowDown':\n event.preventDefault();\n if (allowWrap) {\n return currentRow === maxRow - 1 ? 0 : currentRow + 1;\n } else {\n return currentRow < maxRow - 1 ? currentRow + 1 : currentRow;\n }\n default:\n return currentRow;\n }\n}\n\nexport type useTableKeyboardNavigationProps = (\n /** Antall rader i tabellen */\n numberOfRows: number,\n /** Tillate at man kan navigere sirkulært\n * @default false\n */\n allowWrap?: boolean,\n) => {\n getTableRowNavigationProps: (\n /** Raden i tabellen (0-indeksert) */\n row: number,\n ) => Partial<TableRowProps>;\n getTableBodyNavigationProps: () => Partial<TableBodyProps>;\n};\n\nexport const useTableKeyboardNavigation: useTableKeyboardNavigationProps = (\n numberOfRows = 0,\n allowWrap = true,\n) => {\n const [currentRow, setCurrentRow] = useState(numberOfRows);\n const [maxRow, setMaxRow] = useState(0);\n\n const tableBodyRef = useRef<HTMLTableSectionElement>(null);\n const tableHasFocus = tableBodyRef?.current?.contains(document.activeElement);\n\n useEffect(() => {\n tableBodyRef &&\n tableBodyRef.current &&\n tableHasFocus &&\n tableBodyRef.current.childNodes[\n currentRow\n ].childNodes[0].parentElement?.focus();\n }, [currentRow, tableHasFocus]);\n\n function getTableBodyNavigationProps(...rest: any): Partial<TableBodyProps> {\n return {\n ref: tableBodyRef,\n ...rest,\n };\n }\n\n const tableRowRef = useRef<HTMLTableRowElement>(null);\n function getTableRowNavigationProps(\n row: number,\n ...rest: any\n ): Partial<TableRowProps> {\n if (row >= maxRow) {\n setMaxRow(row + 1);\n }\n const tabIndex = currentRow ? 0 : -1;\n return {\n tabIndex,\n ref: tableRowRef,\n onClick: () => setCurrentRow(row),\n onKeyDown: (e: KeyboardEvent) => {\n const newCell = onTableKeypress(e, currentRow, numberOfRows, allowWrap);\n setCurrentRow(newCell);\n },\n ...rest,\n };\n }\n return { getTableRowNavigationProps, getTableBodyNavigationProps };\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('table');\n\nexport * from './Table';\nexport * from './TableHead';\nexport * from './TableBody';\nexport * from './TableFooter';\nexport * from './TableRow';\nexport * from './DataCell';\nexport * from './HeaderCell';\nexport * from './useSortableTable';\nexport * from './EditableCell';\nexport * from './ExpandableRow';\nexport * from './ExpandRowButton';\nexport * from './useTableKeyboardNavigation';\n"],"names":["Table","React","forwardRef","ref","className","fixed","spacing","sortable","changeSortDescription","stickyHeader","rest","_excluded","sortableHeaderId","useRandomId","tableRef","useRef","useEffect","tableElement","current","observerElement","document","createElement","classList","add","parentNode","insertBefore","observer","IntersectionObserver","entries","toggle","isIntersecting","threshold","observe","unobserve","remove","Fragment","classNames","mergeRefs","undefined","VisuallyHidden","id","TableHead","props","TableBody","TableFooter","TableRow","hover","active","error","DataCell","padding","status","HeaderCell","children","name","sortConfig","sortableButtonProps","sortedAscendingAriaLabel","sortedDescendingAriaLabel","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","sortedAriaInfo","setSortedAriaInfo","_excluded2","isFirefox","navigator","userAgent","toLowerCase","indexOf","DISMISS_SORT_INFO_TIME","dismissAriaTimer","setTimeout","clearTimeout","type","UnsortedIcon","size","UpArrowIcon","DownArrowIcon","useSortableData","tableData","externalSortConfig","setSortConfig","onSortRequested","sortingNewColumn","tableSortedAscending","sort","a","b","valueOfA","get","valueOfB","comparableAValue","comparableBValue","getSortedData","reverse","sortedData","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","EditableCell","feedback","variant","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","ExpandableRow","open","colSpan","BaseExpand","ExpandRowButton","IconButton","onTableKeypress","event","currentRow","maxRow","allowWrap","keyPress","preventDefault","useTableKeyboardNavigation","numberOfRows","setCurrentRow","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","childNodes","parentElement","focus","getTableBodyNavigationProps","tableRowRef","getTableRowNavigationProps","row","tabIndex","onKeyDown","e","newCell","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAMA,KAAK,gBAAGC,KAAK,CAACC,UAAU,CACnC,UAUEC,IAAAA,EAAAA,GAAG,EACD;EAAA,IATAC,SAAS,QAATA,SAAS;AAAA,IAAA,UAAA,GAAA,IAAA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a,CAACgB,OAAO,CAAC,CAAA;AACxB,OAAA;AAAC,KAAA,EACExI,IAAI,CAAA,CAAA;AAEX,GAAA;EACA,OAAO;AAAEmI,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAAEF,IAAAA,2BAA2B,EAA3BA,2BAAAA;GAA6B,CAAA;AACpE;;ACzFAQ,sBAAsB,CAAC,OAAO,CAAC;;;;"}
@@ -10,7 +10,7 @@ export type ExternalSortConfig = {
10
10
  export declare function useSortableData<T>(tableData: T[], externalSortConfig?: ExternalSortConfig): {
11
11
  sortedData: T[];
12
12
  getSortableHeaderProps: (args: SortableHeaderProps) => SortableHeaderReturnProps;
13
- getSortableTableProps: (args: SortableTableProps) => SortableTableReturnProps;
13
+ getSortableTableProps: (args?: SortableTableProps) => SortableTableReturnProps;
14
14
  };
15
15
  export type SortableHeaderProps = {
16
16
  /** Navnet headeren skal se etter i forhold til sortering av items */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/table",
3
- "version": "4.6.4",
3
+ "version": "4.6.5",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/table.esm.js",
@@ -27,16 +27,17 @@
27
27
  "react-dom": ">=16.8.0"
28
28
  },
29
29
  "dependencies": {
30
- "@entur/button": "^3.0.4",
31
- "@entur/expand": "^3.3.43",
32
- "@entur/form": "^7.0.4",
30
+ "@entur/a11y": "0.2.51",
31
+ "@entur/button": "^3.0.5",
32
+ "@entur/expand": "^3.3.44",
33
+ "@entur/form": "^7.0.5",
33
34
  "@entur/icons": "^6.2.0",
34
35
  "@entur/tokens": "^3.8.1",
35
- "@entur/tooltip": "^2.6.14",
36
- "@entur/utils": "^0.8.0",
36
+ "@entur/tooltip": "^2.6.15",
37
+ "@entur/utils": "^0.9.0",
37
38
  "@types/lodash.get": "^4.4.6",
38
39
  "classnames": "^2.3.1",
39
40
  "lodash.get": "^4.4.2"
40
41
  },
41
- "gitHead": "c80112ae71ce3654107c8983a1a9fd91204aa667"
42
+ "gitHead": "cd5c398453c486f6f160905247b94c6da2622d7c"
42
43
  }