@entur/table 4.6.16 → 4.6.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataCell.d.ts +12 -12
- package/dist/EditableCell.d.ts +20 -20
- package/dist/ExpandRowButton.d.ts +7 -7
- package/dist/ExpandableRow.d.ts +12 -12
- package/dist/HeaderCell.d.ts +24 -24
- package/dist/Table.d.ts +21 -21
- package/dist/TableBody.d.ts +9 -9
- package/dist/TableFooter.d.ts +6 -6
- package/dist/TableHead.d.ts +8 -8
- package/dist/TableRow.d.ts +21 -21
- package/dist/index.d.ts +13 -13
- package/dist/styles.css +126 -126
- package/dist/table.cjs.development.js +45 -51
- package/dist/table.cjs.development.js.map +1 -1
- package/dist/table.cjs.production.min.js +1 -1
- package/dist/table.cjs.production.min.js.map +1 -1
- package/dist/table.esm.js +4 -4
- package/dist/useSortableTable.d.ts +41 -41
- package/dist/useTableKeyboardNavigation.d.ts +14 -14
- package/package.json +9 -9
|
@@ -13,12 +13,6 @@ var tooltip = require('@entur/tooltip');
|
|
|
13
13
|
var expand = require('@entur/expand');
|
|
14
14
|
var button = require('@entur/button');
|
|
15
15
|
|
|
16
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
-
|
|
18
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
20
|
-
var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
|
|
21
|
-
|
|
22
16
|
function _extends() {
|
|
23
17
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
24
18
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -50,7 +44,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
50
44
|
}
|
|
51
45
|
|
|
52
46
|
var _excluded$8 = ["className", "fixed", "spacing", "sortable", "changeSortDescription", "stickyHeader"];
|
|
53
|
-
var Table = /*#__PURE__*/
|
|
47
|
+
var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
54
48
|
var className = _ref.className,
|
|
55
49
|
_ref$fixed = _ref.fixed,
|
|
56
50
|
fixed = _ref$fixed === void 0 ? false : _ref$fixed,
|
|
@@ -68,10 +62,10 @@ var Table = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, re
|
|
|
68
62
|
React.useEffect(function () {
|
|
69
63
|
if (stickyHeader) {
|
|
70
64
|
var _tableElement$parentN;
|
|
71
|
-
/* We check when an inserted div above the header
|
|
72
|
-
is outside our scrolling container to determine when
|
|
73
|
-
the table header becomes sticky. This is necessary
|
|
74
|
-
to conditionally add our box-shadow when the
|
|
65
|
+
/* We check when an inserted div above the header
|
|
66
|
+
is outside our scrolling container to determine when
|
|
67
|
+
the table header becomes sticky. This is necessary
|
|
68
|
+
to conditionally add our box-shadow when the
|
|
75
69
|
header is overlapping table rows */
|
|
76
70
|
var tableElement = tableRef.current;
|
|
77
71
|
var observerElement = document.createElement('div');
|
|
@@ -89,8 +83,8 @@ var Table = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, re
|
|
|
89
83
|
};
|
|
90
84
|
}
|
|
91
85
|
}, [stickyHeader]);
|
|
92
|
-
return
|
|
93
|
-
className:
|
|
86
|
+
return React.createElement(React.Fragment, null, React.createElement("table", _extends({
|
|
87
|
+
className: classNames('eds-table', {
|
|
94
88
|
'eds-table--fixed': fixed
|
|
95
89
|
}, {
|
|
96
90
|
'eds-table--middle': spacing === 'middle'
|
|
@@ -103,40 +97,40 @@ var Table = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, re
|
|
|
103
97
|
}, className),
|
|
104
98
|
ref: utils.mergeRefs(ref, tableRef),
|
|
105
99
|
"aria-describedby": sortable ? sortableHeaderId : undefined
|
|
106
|
-
}, rest)), sortable &&
|
|
100
|
+
}, rest)), sortable && React.createElement(a11y.VisuallyHidden, {
|
|
107
101
|
id: sortableHeaderId
|
|
108
102
|
}, changeSortDescription));
|
|
109
103
|
});
|
|
110
104
|
|
|
111
105
|
var _excluded$7 = ["className"];
|
|
112
|
-
var TableHead = /*#__PURE__*/
|
|
106
|
+
var TableHead = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
113
107
|
var className = _ref.className,
|
|
114
108
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
115
|
-
return
|
|
116
|
-
className:
|
|
109
|
+
return React.createElement("thead", _extends({
|
|
110
|
+
className: classNames('eds-table__head', className),
|
|
117
111
|
ref: ref
|
|
118
112
|
}, props));
|
|
119
113
|
});
|
|
120
114
|
|
|
121
115
|
var _excluded$6 = ["className"];
|
|
122
|
-
var TableBody = /*#__PURE__*/
|
|
116
|
+
var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
123
117
|
var className = _ref.className,
|
|
124
118
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
125
|
-
return
|
|
126
|
-
className:
|
|
119
|
+
return React.createElement("tbody", _extends({
|
|
120
|
+
className: classNames('eds-table__body', className),
|
|
127
121
|
ref: ref
|
|
128
122
|
}, rest));
|
|
129
123
|
});
|
|
130
124
|
|
|
131
|
-
var TableFooter = /*#__PURE__*/
|
|
125
|
+
var TableFooter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
132
126
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
133
|
-
return
|
|
127
|
+
return React.createElement("tfoot", _extends({
|
|
134
128
|
ref: ref
|
|
135
129
|
}, props));
|
|
136
130
|
});
|
|
137
131
|
|
|
138
132
|
var _excluded$5 = ["className", "hover", "active", "error"];
|
|
139
|
-
var TableRow = /*#__PURE__*/
|
|
133
|
+
var TableRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
140
134
|
var className = _ref.className,
|
|
141
135
|
_ref$hover = _ref.hover,
|
|
142
136
|
hover = _ref$hover === void 0 ? false : _ref$hover,
|
|
@@ -145,8 +139,8 @@ var TableRow = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
|
145
139
|
_ref$error = _ref.error,
|
|
146
140
|
error = _ref$error === void 0 ? false : _ref$error,
|
|
147
141
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
148
|
-
return
|
|
149
|
-
className:
|
|
142
|
+
return React.createElement("tr", _extends({
|
|
143
|
+
className: classNames('eds-table__row', className, {
|
|
150
144
|
'eds-table__row--hover': hover,
|
|
151
145
|
'eds-table__row--active': active,
|
|
152
146
|
'eds-table__row--error': error
|
|
@@ -156,7 +150,7 @@ var TableRow = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
|
156
150
|
});
|
|
157
151
|
|
|
158
152
|
var _excluded$4 = ["className", "padding", "status"];
|
|
159
|
-
var DataCell = /*#__PURE__*/
|
|
153
|
+
var DataCell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
160
154
|
var _classNames;
|
|
161
155
|
var className = _ref.className,
|
|
162
156
|
_ref$padding = _ref.padding,
|
|
@@ -164,15 +158,15 @@ var DataCell = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
|
164
158
|
_ref$status = _ref.status,
|
|
165
159
|
status = _ref$status === void 0 ? undefined : _ref$status,
|
|
166
160
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
167
|
-
return
|
|
161
|
+
return React.createElement("td", _extends({
|
|
168
162
|
ref: ref,
|
|
169
|
-
className:
|
|
163
|
+
className: classNames('eds-table__data-cell', className, (_classNames = {}, _classNames["eds-table__data-cell--status-" + status] = status, _classNames['eds-table__data-cell--padding-checkbox'] = padding === 'checkbox', _classNames['eds-table__data-cell--padding-radio'] = padding === 'radio', _classNames['eds-table__data-cell--padding-overflow-menu'] = padding === 'overflow-menu', _classNames))
|
|
170
164
|
}, rest));
|
|
171
165
|
});
|
|
172
166
|
|
|
173
167
|
var _excluded$3 = ["className", "children", "name", "sortable", "sortConfig", "padding", "sortableButtonProps", "sortedAscendingAriaLabel", "sortedDescendingAriaLabel"],
|
|
174
168
|
_excluded2$1 = ["className"];
|
|
175
|
-
var HeaderCell = /*#__PURE__*/
|
|
169
|
+
var HeaderCell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
176
170
|
var className = _ref.className,
|
|
177
171
|
children = _ref.children,
|
|
178
172
|
name = _ref.name,
|
|
@@ -187,15 +181,15 @@ var HeaderCell = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
|
187
181
|
_ref$sortedDescending = _ref.sortedDescendingAriaLabel,
|
|
188
182
|
sortedDescendingAriaLabel = _ref$sortedDescending === void 0 ? ', sortert synkende' : _ref$sortedDescending,
|
|
189
183
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
190
|
-
var _React$useState =
|
|
184
|
+
var _React$useState = React.useState(false),
|
|
191
185
|
isCurrentlySorted = _React$useState[0],
|
|
192
186
|
setIsCurrentlySorted = _React$useState[1];
|
|
193
|
-
|
|
187
|
+
React.useEffect(function () {
|
|
194
188
|
sortConfig && name && setIsCurrentlySorted(sortConfig && name === sortConfig.key);
|
|
195
189
|
}, [sortConfig, name]);
|
|
196
190
|
var ariaSort = isCurrentlySorted ? sortConfig && sortConfig.order : undefined;
|
|
197
|
-
return
|
|
198
|
-
className:
|
|
191
|
+
return React.createElement("th", _extends({
|
|
192
|
+
className: classNames('eds-table__header-cell', className, {
|
|
199
193
|
'eds-table__header-cell--sortable': sortable,
|
|
200
194
|
'eds-table__header-cell--padding-radio': padding === 'radio',
|
|
201
195
|
'eds-table__header-cell--padding-checkbox': padding === 'checkbox',
|
|
@@ -203,7 +197,7 @@ var HeaderCell = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
|
203
197
|
}),
|
|
204
198
|
"aria-sort": ariaSort,
|
|
205
199
|
ref: ref
|
|
206
|
-
}, rest), sortable && sortConfig && sortableButtonProps ?
|
|
200
|
+
}, rest), sortable && sortConfig && sortableButtonProps ? React.createElement(SortableHeaderCellButton, {
|
|
207
201
|
sortableButtonProps: sortableButtonProps,
|
|
208
202
|
sortConfig: sortConfig,
|
|
209
203
|
isCurrentlySorted: isCurrentlySorted,
|
|
@@ -241,23 +235,23 @@ var SortableHeaderCellButton = function SortableHeaderCellButton(_ref2) {
|
|
|
241
235
|
return clearTimeout(dismissAriaTimer);
|
|
242
236
|
};
|
|
243
237
|
}, [sortConfig.order]);
|
|
244
|
-
return
|
|
245
|
-
className:
|
|
238
|
+
return React.createElement("button", _extends({
|
|
239
|
+
className: classNames('eds-table__header-cell-button', className),
|
|
246
240
|
type: "button",
|
|
247
241
|
"aria-sort": ariaSort
|
|
248
|
-
}, rest), children, (!isCurrentlySorted || sortConfig.order === 'none') &&
|
|
242
|
+
}, rest), children, (!isCurrentlySorted || sortConfig.order === 'none') && React.createElement(icons.UnsortedIcon, {
|
|
249
243
|
size: "1rem",
|
|
250
244
|
className: "eds-table__header-cell-button-icon",
|
|
251
245
|
"aria-hidden": "true"
|
|
252
|
-
}), isCurrentlySorted && sortConfig.order === 'ascending' &&
|
|
246
|
+
}), isCurrentlySorted && sortConfig.order === 'ascending' && React.createElement(icons.UpArrowIcon, {
|
|
253
247
|
size: "1rem",
|
|
254
248
|
className: "eds-table__header-cell-button-icon",
|
|
255
249
|
"aria-hidden": "true"
|
|
256
|
-
}), isCurrentlySorted && sortConfig.order === 'descending' &&
|
|
250
|
+
}), isCurrentlySorted && sortConfig.order === 'descending' && React.createElement(icons.DownArrowIcon, {
|
|
257
251
|
size: "1rem",
|
|
258
252
|
className: "eds-table__header-cell-button-icon",
|
|
259
253
|
"aria-hidden": "true"
|
|
260
|
-
}),
|
|
254
|
+
}), React.createElement(a11y.VisuallyHidden, null, isCurrentlySorted && sortedAriaInfo));
|
|
261
255
|
};
|
|
262
256
|
|
|
263
257
|
var _excluded$2 = ["name", "sortable", "buttonProps"],
|
|
@@ -288,8 +282,8 @@ function useSortableData(tableData, externalSortConfig) {
|
|
|
288
282
|
});
|
|
289
283
|
};
|
|
290
284
|
var tableSortedAscending = [].concat(tableData).sort(function (a, b) {
|
|
291
|
-
var valueOfA =
|
|
292
|
-
var valueOfB =
|
|
285
|
+
var valueOfA = get(a, sortConfig.key, a);
|
|
286
|
+
var valueOfB = get(b, sortConfig.key, b);
|
|
293
287
|
var comparableAValue = typeof valueOfA === 'string' ? valueOfA.toLowerCase() : valueOfA;
|
|
294
288
|
var comparableBValue = typeof valueOfB === 'string' ? valueOfB.toLowerCase() : valueOfB;
|
|
295
289
|
if (comparableAValue < comparableBValue) return -1;
|
|
@@ -349,13 +343,13 @@ var EditableCell = function EditableCell(_ref) {
|
|
|
349
343
|
_ref$outlined = _ref.outlined,
|
|
350
344
|
outlined = _ref$outlined === void 0 ? false : _ref$outlined,
|
|
351
345
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
352
|
-
return
|
|
346
|
+
return React.createElement(form.VariantProvider, {
|
|
353
347
|
variant: variant
|
|
354
|
-
},
|
|
355
|
-
className:
|
|
348
|
+
}, React.createElement(DataCell, _extends({
|
|
349
|
+
className: classNames('eds-editable-cell', {
|
|
356
350
|
'eds-editable-cell--outlined': outlined
|
|
357
351
|
}, className)
|
|
358
|
-
}, rest),
|
|
352
|
+
}, rest), React.createElement(tooltip.Tooltip, {
|
|
359
353
|
disableHoverListener: !feedback,
|
|
360
354
|
disableFocusListener: !feedback,
|
|
361
355
|
placement: "bottom",
|
|
@@ -369,9 +363,9 @@ var ExpandableRow = function ExpandableRow(_ref) {
|
|
|
369
363
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
370
364
|
children = _ref.children,
|
|
371
365
|
colSpan = _ref.colSpan;
|
|
372
|
-
return
|
|
366
|
+
return React.createElement("tr", null, React.createElement("td", {
|
|
373
367
|
colSpan: colSpan
|
|
374
|
-
},
|
|
368
|
+
}, React.createElement(expand.BaseExpand, {
|
|
375
369
|
open: open
|
|
376
370
|
}, children)));
|
|
377
371
|
};
|
|
@@ -381,13 +375,13 @@ var ExpandRowButton = function ExpandRowButton(_ref) {
|
|
|
381
375
|
var open = _ref.open,
|
|
382
376
|
onClick = _ref.onClick,
|
|
383
377
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
384
|
-
return
|
|
385
|
-
className:
|
|
378
|
+
return React.createElement(button.IconButton, _extends({
|
|
379
|
+
className: classNames('eds-expand-row-button', {
|
|
386
380
|
'eds-expand-row-button--open': open
|
|
387
381
|
}),
|
|
388
382
|
onClick: onClick,
|
|
389
383
|
"aria-label": open ? 'Lukk tabellrad' : 'Utvid tabellrad'
|
|
390
|
-
}, rest),
|
|
384
|
+
}, rest), React.createElement(icons.DownArrowIcon, {
|
|
391
385
|
"aria-hidden": true,
|
|
392
386
|
className: "eds-expand-row-button__icon"
|
|
393
387
|
}));
|
|
@@ -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 { 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 aria-hidden 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,SAA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AAA;AAEX,GAAA;EACA,OAAO;AAAEmI,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAAEF,IAAAA,2BAA2B,EAA3BA,2BAAAA;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 aria-hidden 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,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,CA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AAC,CAAC,CAAA;AACnB,KAAA;AACD,IAAA,IAAMC,QAAQ,GAAGpB,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"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),r=require("react"),t=require("classnames"),a=require("@entur/a11y"),n=require("@entur/icons"),o=require("lodash.get"),s=require("@entur/form"),l=require("@entur/tooltip"),d=require("@entur/expand"),i=require("@entur/button");function c(){return c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},c.apply(this,arguments)}function u(e,r){if(null==e)return{};var t,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r.indexOf(t=o[a])>=0||(n[t]=e[t]);return n}var b=["className","fixed","spacing","sortable","changeSortDescription","stickyHeader"],f=r.forwardRef((function(n,o){var s=n.className,l=n.fixed,d=void 0!==l&&l,i=n.spacing,f=void 0===i?"default":i,v=n.sortable,m=void 0!==v&&v,p=n.changeSortDescription,g=void 0===p?"Tabelloverskrifter med knapper kan trykkes på for å endre sortering,":p,h=n.stickyHeader,_=void 0!==h&&h,w=u(n,b),y=e.useRandomId("sortable-header"),E=r.useRef(null);return r.useEffect((function(){if(_){var e,r=E.current,t=document.createElement("div");t.classList.add("sticky-observer"),null==r||null==(e=r.parentNode)||e.insertBefore(t,r);var a=new IntersectionObserver((function(e){null==r||r.classList.toggle("eds-table--sticky-header--active",!e[0].isIntersecting)}),{threshold:[0,1]});return a.observe(t),function(){a.unobserve(t),t.remove()}}}),[_]),r.createElement(r.Fragment,null,r.createElement("table",c({className:t("eds-table",{"eds-table--fixed":d},{"eds-table--middle":"middle"===f},{"eds-table--small":"small"===f},{"eds-table--sortable":m},{"eds-table--sticky-header":_},s),ref:e.mergeRefs(o,E),"aria-describedby":m?y:void 0},w)),m&&r.createElement(a.VisuallyHidden,{id:y},g))})),v=["className"],m=r.forwardRef((function(e,a){var n=e.className,o=u(e,v);return r.createElement("thead",c({className:t("eds-table__head",n),ref:a},o))})),p=["className"],g=r.forwardRef((function(e,a){var n=e.className,o=u(e,p);return r.createElement("tbody",c({className:t("eds-table__body",n),ref:a},o))})),h=r.forwardRef((function(e,t){var a=c({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return r.createElement("tfoot",c({ref:t},a))})),_=["className","hover","active","error"],w=r.forwardRef((function(e,a){var n=e.className,o=e.hover,s=void 0!==o&&o,l=e.active,d=void 0!==l&&l,i=e.error,b=void 0!==i&&i,f=u(e,_);return r.createElement("tr",c({className:t("eds-table__row",n,{"eds-table__row--hover":s,"eds-table__row--active":d,"eds-table__row--error":b}),ref:a},f))})),y=["className","padding","status"],E=r.forwardRef((function(e,a){var n,o=e.className,s=e.padding,l=void 0===s?"default":s,d=e.status,i=void 0===d?void 0:d,b=u(e,y);return r.createElement("td",c({ref:a,className:t("eds-table__data-cell",o,(n={},n["eds-table__data-cell--status-"+i]=i,n["eds-table__data-cell--padding-checkbox"]="checkbox"===l,n["eds-table__data-cell--padding-radio"]="radio"===l,n["eds-table__data-cell--padding-overflow-menu"]="overflow-menu"===l,n))},b))})),N=["className","children","name","sortable","sortConfig","padding","sortableButtonProps","sortedAscendingAriaLabel","sortedDescendingAriaLabel"],k=["className"],x=r.forwardRef((function(e,a){var n=e.className,o=e.children,s=e.name,l=e.sortable,d=void 0!==l&&l,i=e.sortConfig,b=e.padding,f=void 0===b?"default":b,v=e.sortableButtonProps,m=e.sortedAscendingAriaLabel,p=void 0===m?", sortert stigende":m,g=e.sortedDescendingAriaLabel,h=void 0===g?", sortert synkende":g,_=u(e,N),w=r.useState(!1),y=w[0],E=w[1];r.useEffect((function(){i&&s&&E(i&&s===i.key)}),[i,s]);var k=y?i&&i.order:void 0;return r.createElement("th",c({className:t("eds-table__header-cell",n,{"eds-table__header-cell--sortable":d,"eds-table__header-cell--padding-radio":"radio"===f,"eds-table__header-cell--padding-checkbox":"checkbox"===f,"eds-table__header-cell--padding-overflow-menu":"overflow-menu"===f}),"aria-sort":k,ref:a},_),d&&i&&v?r.createElement(A,{sortableButtonProps:v,sortConfig:i,isCurrentlySorted:y,ariaSort:k,sortedAscendingAriaLabel:p,sortedDescendingAriaLabel:h},o):o)})),A=function(e){var o=e.sortConfig,s=e.sortableButtonProps,l=e.isCurrentlySorted,d=e.children,i=e.ariaSort,b=e.sortedAscendingAriaLabel,f=e.sortedDescendingAriaLabel,v=r.useState(""),m=v[0],p=v[1],g=s.className,h=u(s,k),_=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;return r.useEffect((function(){"ascending"==o.order?p(b):"descending"==o.order&&p(f);var e=setTimeout((function(){p(""),_&&p(", sort "+o.order)}),3e3);return function(){return clearTimeout(e)}}),[o.order]),r.createElement("button",c({className:t("eds-table__header-cell-button",g),type:"button","aria-sort":i},h),d,(!l||"none"===o.order)&&r.createElement(n.UnsortedIcon,{size:"1rem",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),l&&"ascending"===o.order&&r.createElement(n.UpArrowIcon,{size:"1rem",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),l&&"descending"===o.order&&r.createElement(n.DownArrowIcon,{size:"1rem",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),r.createElement(a.VisuallyHidden,null,l&&m))},C=["name","sortable","buttonProps"],S=["sortable"],L=["children","className","feedback","variant","outlined"],R=["open","onClick"];e.warnAboutMissingStyles("table"),exports.DataCell=E,exports.EditableCell=function(e){var a=e.children,n=e.className,o=e.feedback,d=e.variant,i=e.outlined,b=void 0!==i&&i,f=u(e,L);return r.createElement(s.VariantProvider,{variant:d},r.createElement(E,c({className:t("eds-editable-cell",{"eds-editable-cell--outlined":b},n)},f),r.createElement(l.Tooltip,{disableHoverListener:!o,disableFocusListener:!o,placement:"bottom",content:o||void 0,variant:o?"error":void 0},a)))},exports.ExpandRowButton=function(e){var a=e.open,o=e.onClick,s=u(e,R);return r.createElement(i.IconButton,c({className:t("eds-expand-row-button",{"eds-expand-row-button--open":a}),onClick:o,"aria-label":a?"Lukk tabellrad":"Utvid tabellrad"},s),r.createElement(n.DownArrowIcon,{"aria-hidden":!0,className:"eds-expand-row-button__icon"}))},exports.ExpandableRow=function(e){var t=e.open;return r.createElement("tr",null,r.createElement("td",{colSpan:e.colSpan},r.createElement(d.BaseExpand,{open:void 0!==t&&t},e.children)))},exports.HeaderCell=x,exports.Table=f,exports.TableBody=g,exports.TableFooter=h,exports.TableHead=m,exports.TableRow=w,exports.useSortableData=function(e,t){void 0===t&&(t={key:"",order:"none"});var a=r.useState(t),n=a[0],s=a[1],l=[].concat(e).sort((function(e,r){var t=o(e,n.key,e),a=o(r,n.key,r),s="string"==typeof t?t.toLowerCase():t,l="string"==typeof a?a.toLowerCase():a;return s<l?-1:s>l?1:0}));return{sortedData:"none"===n.order?e:"descending"===n.order?[].concat(l).reverse():l,getSortableHeaderProps:function(e){var r=e.name,t=e.sortable,a=void 0===t||t,o=e.buttonProps,l=u(e,C);return c({name:r,sortable:a,sortConfig:n,sortableButtonProps:c({onClick:function(){return(e=r)!==n.key||"none"===n.order?s({key:e,order:"ascending"}):"ascending"===n.order?s({key:e,order:"descending"}):"descending"===n.order?s({key:e,order:"none"}):void 0;var e}},o)},l)},getSortableTableProps:function(e){var r=void 0===e?{}:e,t=r.sortable,a=void 0===t||t,o=u(r,S);return c({sortable:a,sortConfig:n},o)}}},exports.useTableKeyboardNavigation=function(e,t){var a;void 0===e&&(e=0),void 0===t&&(t=!0);var n=r.useState(e),o=n[0],s=n[1],l=r.useState(0),d=l[0],i=l[1],u=r.useRef(null),b=null==u||null==(a=u.current)?void 0:a.contains(document.activeElement);r.useEffect((function(){var e;u&&u.current&&b&&(null==(e=u.current.childNodes[o].childNodes[0].parentElement)||e.focus())}),[o,b]);var f=r.useRef(null);return{getTableRowNavigationProps:function(r){r>=d&&i(r+1);for(var a=o?0:-1,n=arguments.length,l=new Array(n>1?n-1:0),u=1;u<n;u++)l[u-1]=arguments[u];return c({tabIndex:a,ref:f,onClick:function(){return s(r)},onKeyDown:function(r){var a=function(e,r,t,a){switch(e.key){case"ArrowUp":return e.preventDefault(),a?0===r?t-1:r-1:r>0?r-1:0;case"ArrowDown":return e.preventDefault(),a?r===t-1?0:r+1:r<t-1?r+1:r;default:return r}}(r,o,e,t);s(a)}},l)},getTableBodyNavigationProps:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return c({ref:u},r)}}};
|
|
2
2
|
//# sourceMappingURL=table.cjs.production.min.js.map
|