@entur/table 4.8.25 → 4.8.26-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This package contains the different Table components.
4
4
 
5
- > 💡 Looking for the [documentation](https://design.entur.no/komponenter/layout-and-surfaces/tables)?
5
+ > 💡 Looking for the [documentation](https://design.entur.no/komponenter/layout-og-flater/table)?
6
6
 
7
7
  ## Installation
8
8
 
@@ -14,4 +14,4 @@ yarn add @entur/table
14
14
 
15
15
  ## Usage
16
16
 
17
- Please refer to the [documentation](https://design.entur.no/komponenter/layout-and-surfaces/tables) for usage information.
17
+ Please refer to the [documentation](https://design.entur.no/komponenter/layout-og-flater/table) for usage information.
@@ -15,33 +15,25 @@ var expand = require('@entur/expand');
15
15
  var button = require('@entur/button');
16
16
 
17
17
  function _extends() {
18
- _extends = Object.assign ? Object.assign.bind() : function (target) {
19
- for (var i = 1; i < arguments.length; i++) {
20
- var source = arguments[i];
21
- for (var key in source) {
22
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23
- target[key] = source[key];
24
- }
25
- }
18
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
19
+ for (var e = 1; e < arguments.length; e++) {
20
+ var t = arguments[e];
21
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
26
22
  }
27
- return target;
28
- };
29
- return _extends.apply(this, arguments);
23
+ return n;
24
+ }, _extends.apply(null, arguments);
30
25
  }
31
- function _objectDestructuringEmpty(obj) {
32
- if (obj == null) throw new TypeError("Cannot destructure " + obj);
26
+ function _objectDestructuringEmpty(t) {
27
+ if (null == t) throw new TypeError("Cannot destructure " + t);
33
28
  }
34
- function _objectWithoutPropertiesLoose(source, excluded) {
35
- if (source == null) return {};
36
- var target = {};
37
- var sourceKeys = Object.keys(source);
38
- var key, i;
39
- for (i = 0; i < sourceKeys.length; i++) {
40
- key = sourceKeys[i];
41
- if (excluded.indexOf(key) >= 0) continue;
42
- target[key] = source[key];
29
+ function _objectWithoutPropertiesLoose(r, e) {
30
+ if (null == r) return {};
31
+ var t = {};
32
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
33
+ if (e.includes(n)) continue;
34
+ t[n] = r[n];
43
35
  }
44
- return target;
36
+ return t;
45
37
  }
46
38
 
47
39
  var _excluded$8 = ["className", "fixed", "spacing", "sortable", "changeSortDescription", "stickyHeader"];
@@ -71,9 +63,9 @@ var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
71
63
  var tableElement = tableRef.current;
72
64
  var observerElement = document.createElement('div');
73
65
  observerElement.classList.add('sticky-observer');
74
- tableElement == null ? void 0 : (_tableElement$parentN = tableElement.parentNode) == null ? void 0 : _tableElement$parentN.insertBefore(observerElement, tableElement);
66
+ tableElement == null || (_tableElement$parentN = tableElement.parentNode) == null || _tableElement$parentN.insertBefore(observerElement, tableElement);
75
67
  var observer = new IntersectionObserver(function (entries) {
76
- tableElement == null ? void 0 : tableElement.classList.toggle('eds-table--sticky-header--active', !entries[0].isIntersecting);
68
+ tableElement == null || tableElement.classList.toggle('eds-table--sticky-header--active', !entries[0].isIntersecting);
77
69
  }, {
78
70
  threshold: [0, 1]
79
71
  });
@@ -460,7 +452,7 @@ var useTableKeyboardNavigation = function useTableKeyboardNavigation(numberOfRow
460
452
  maxRow = _useState2[0],
461
453
  setMaxRow = _useState2[1];
462
454
  var tableBodyRef = React.useRef(null);
463
- var tableHasFocus = tableBodyRef == null ? void 0 : (_tableBodyRef$current = tableBodyRef.current) == null ? void 0 : _tableBodyRef$current.contains(document.activeElement);
455
+ var tableHasFocus = tableBodyRef == null || (_tableBodyRef$current = tableBodyRef.current) == null ? void 0 : _tableBodyRef$current.contains(document.activeElement);
464
456
  React.useEffect(function () {
465
457
  var _tableBodyRef$current2;
466
458
  tableBodyRef && tableBodyRef.current && tableHasFocus && ((_tableBodyRef$current2 = tableBodyRef.current.childNodes[currentRow].childNodes[0].parentElement) == null ? void 0 : _tableBodyRef$current2.focus());
@@ -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\nimport { BulletBadge } from '@entur/layout';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst danger = 'danger';\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 /** @deprecated bruk variant */\n status?: 'positive' | 'negative' | 'neutral';\n /** Hvilken type status man vil vise */\n variant?: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nfunction mapStatusToVariant(\n status: 'positive' | 'negative' | 'neutral',\n): DataCellProps['variant'] {\n switch (status) {\n case 'positive':\n return 'success';\n case 'negative':\n return 'negative';\n case 'neutral':\n return 'neutral';\n default:\n return 'neutral';\n }\n}\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status, variant, children, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => {\n // If variant is undefined and status is defined, map status to variant\n if (!variant && status) {\n variant = mapStatusToVariant(status);\n }\n return (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\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 {variant ? (\n <BulletBadge variant={variant}>{children}</BulletBadge>\n ) : (\n children\n )}\n </td>\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=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1em\"\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 {\n ButtonHTMLAttributes,\n DetailedHTMLProps,\n useMemo,\n useState,\n} 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 = useMemo(\n () =>\n [...tableData].sort((a: any, b: any) => {\n const valueOfA: string = get(a, sortConfig.key, a)?.toString() ?? '';\n const valueOfB: string = get(b, sortConfig.key, b)?.toString() ?? '';\n\n const stringComparator = new Intl.Collator(['no', 'en'], {\n numeric: true,\n sensitivity: 'base',\n });\n\n return stringComparator.compare(valueOfA, valueOfB);\n }),\n [tableData, sortConfig.key],\n );\n\n const sortedData = useMemo(() => {\n switch (sortConfig.order) {\n case 'ascending': {\n return tableSortedAscending;\n }\n case 'descending': {\n return [...tableSortedAscending].reverse();\n }\n case 'none': {\n return tableData;\n }\n default: {\n return tableData;\n }\n }\n }, [sortConfig.order, tableData, tableSortedAscending]);\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';\n\nimport { VariantProvider } from '@entur/form';\nimport { VariantType } from '@entur/utils';\nimport { Tooltip } from '@entur/tooltip';\n\nimport './EditableCell.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\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 | typeof error | typeof info;\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 ? 'negative' : 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 type=\"button\"\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","mapStatusToVariant","status","DataCell","padding","variant","children","BulletBadge","HeaderCell","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","useMemo","sort","a","b","valueOfA","get","toString","valueOfB","stringComparator","Intl","Collator","numeric","sensitivity","compare","sortedData","reverse","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","EditableCell","feedback","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,I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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\nimport { BulletBadge } from '@entur/layout';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst danger = 'danger';\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 /** @deprecated bruk variant */\n status?: 'positive' | 'negative' | 'neutral';\n /** Hvilken type status man vil vise */\n variant?: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nfunction mapStatusToVariant(\n status: 'positive' | 'negative' | 'neutral',\n): DataCellProps['variant'] {\n switch (status) {\n case 'positive':\n return 'success';\n case 'negative':\n return 'negative';\n case 'neutral':\n return 'neutral';\n default:\n return 'neutral';\n }\n}\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status, variant, children, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => {\n // If variant is undefined and status is defined, map status to variant\n if (!variant && status) {\n variant = mapStatusToVariant(status);\n }\n return (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\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 {variant ? (\n <BulletBadge variant={variant}>{children}</BulletBadge>\n ) : (\n children\n )}\n </td>\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=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1em\"\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 {\n ButtonHTMLAttributes,\n DetailedHTMLProps,\n useMemo,\n useState,\n} 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 = useMemo(\n () =>\n [...tableData].sort((a: any, b: any) => {\n const valueOfA: string = get(a, sortConfig.key, a)?.toString() ?? '';\n const valueOfB: string = get(b, sortConfig.key, b)?.toString() ?? '';\n\n const stringComparator = new Intl.Collator(['no', 'en'], {\n numeric: true,\n sensitivity: 'base',\n });\n\n return stringComparator.compare(valueOfA, valueOfB);\n }),\n [tableData, sortConfig.key],\n );\n\n const sortedData = useMemo(() => {\n switch (sortConfig.order) {\n case 'ascending': {\n return tableSortedAscending;\n }\n case 'descending': {\n return [...tableSortedAscending].reverse();\n }\n case 'none': {\n return tableData;\n }\n default: {\n return tableData;\n }\n }\n }, [sortConfig.order, tableData, tableSortedAscending]);\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';\n\nimport { VariantProvider } from '@entur/form';\nimport { VariantType } from '@entur/utils';\nimport { Tooltip } from '@entur/tooltip';\n\nimport './EditableCell.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\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 | typeof error | typeof info;\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 ? 'negative' : 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 type=\"button\"\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","ref","className","_ref$fixed","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","mapStatusToVariant","status","DataCell","_ref$padding","padding","variant","children","BulletBadge","HeaderCell","name","sortConfig","sortableButtonProps","_ref$sortedAscendingA","sortedAscendingAriaLabel","_ref$sortedDescending","sortedDescendingAriaLabel","_React$useState","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","_ref2","_useState","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","useMemo","concat","sort","a","b","_get$toString","_get","_get$toString2","_get2","valueOfA","get","toString","valueOfB","stringComparator","Intl","Collator","numeric","sensitivity","compare","sortedData","reverse","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","_temp","_ref2$sortable","EditableCell","feedback","_ref$outlined","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","ExpandableRow","_ref$open","open","colSpan","BaseExpand","ExpandRowButton","IconButton","onTableKeypress","event","currentRow","maxRow","allowWrap","keyPress","preventDefault","useTableKeyboardNavigation","numberOfRows","_tableBodyRef$current","setCurrentRow","_useState2","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","_tableBodyRef$current2","childNodes","parentElement","focus","getTableBodyNavigationProps","_len","arguments","length","Array","_key","tableRowRef","getTableRowNavigationProps","row","tabIndex","_len2","_key2","onKeyDown","e","newCell","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAMA,KAAK,gBAAGC,KAAK,CAACC,UAAU,CACnC,UAAAC,IAAA,EAUEC,GAAG,EACD;AAAA,EAAA,IATAC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,UAAA,GAAAH,IAAA,CACTI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,UAAA;IAAAE,YAAA,GAAAL,IAAA,CACbM,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,SAAS,GAAAA,YAAA;IAAAE,aAAA,GAAAP,IAAA,CACnBQ,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;IAAAE,qBAAA,GAAAT,IAAA,CAChBU,qBAAqB;AAArBA,IAAAA,qBAAqB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,sEAAsE,GAAAA,qBAAA;IAAAE,iBAAA,GAAAX,IAAA,CAC9FY,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,iBAAA;AACjBE,IAAAA,IAAI,GAAAC,6BAAA,CAAAd,IAAA,EAAAe,WAAA,CAAA,CAAA;AAIT,EAAA,IAAMC,gBAAgB,GAAGC,iBAAW,CAAC,iBAAiB,CAAC,CAAA;AAEvD,EAAA,IAAMC,QAAQ,GAAGC,YAAM,CAAmB,IAAI,CAAC,CAAA;AAE/CC,EAAAA,eAAS,CAAC,YAAK;AACb,IAAA,IAAIR,YAAY,EAAE;AAAA,MAAA,IAAAS,qBAAA,CAAA;AAChB;;;;AAIqC;AACrC,MAAA,IAAMC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AC,CAAA;AACxB,OAAA;AAAC,KAAA,EACE/K,IAAI,CAAA,CAAA;AAEX,GAAA;EACA,OAAO;AAAEwK,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAAEP,IAAAA,2BAA2B,EAA3BA,2BAAAA;GAA6B,CAAA;AACpE;;ACzFAe,4BAAsB,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
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/layout"),o=require("@entur/icons"),s=require("lodash.get"),l=require("@entur/form"),i=require("@entur/tooltip"),d=require("@entur/expand"),c=require("@entur/button");function u(){return u=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},u.apply(this,arguments)}function b(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 f=["className","fixed","spacing","sortable","changeSortDescription","stickyHeader"],v=r.forwardRef((function(n,o){var s=n.className,l=n.fixed,i=void 0!==l&&l,d=n.spacing,c=void 0===d?"default":d,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,w=void 0!==h&&h,y=b(n,f),_=e.useRandomId("sortable-header"),E=r.useRef(null);return r.useEffect((function(){if(w){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()}}}),[w]),r.createElement(r.Fragment,null,r.createElement("table",u({className:t("eds-table",{"eds-table--fixed":i},{"eds-table--middle":"middle"===c},{"eds-table--small":"small"===c},{"eds-table--sortable":m},{"eds-table--sticky-header":w},s),ref:e.mergeRefs(o,E),"aria-describedby":m?_:void 0},y)),m&&r.createElement(a.VisuallyHidden,{id:_},g))})),m=["className"],p=r.forwardRef((function(e,a){var n=e.className,o=b(e,m);return r.createElement("thead",u({className:t("eds-table__head",n),ref:a},o))})),g=["className"],h=r.forwardRef((function(e,a){var n=e.className,o=b(e,g);return r.createElement("tbody",u({className:t("eds-table__body",n),ref:a},o))})),w=r.forwardRef((function(e,t){var a=u({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return r.createElement("tfoot",u({ref:t},a))})),y=["className","hover","active","error"],_=r.forwardRef((function(e,a){var n=e.className,o=e.hover,s=void 0!==o&&o,l=e.active,i=void 0!==l&&l,d=e.error,c=void 0!==d&&d,f=b(e,y);return r.createElement("tr",u({className:t("eds-table__row",n,{"eds-table__row--hover":s,"eds-table__row--active":i,"eds-table__row--error":c}),ref:a},f))})),E=["className","padding","status","variant","children"],k=r.forwardRef((function(e,a){var o=e.className,s=e.padding,l=void 0===s?"default":s,i=e.status,d=e.variant,c=e.children,f=b(e,E);return!d&&i&&(d=function(e){switch(e){case"positive":return"success";case"negative":return"negative";default:return"neutral"}}(i)),r.createElement("td",u({ref:a,className:t("eds-table__data-cell",o,{"eds-table__data-cell--padding-checkbox":"checkbox"===l,"eds-table__data-cell--padding-radio":"radio"===l,"eds-table__data-cell--padding-overflow-menu":"overflow-menu"===l})},f),d?r.createElement(n.BulletBadge,{variant:d},c):c)})),N=["className","children","name","sortable","sortConfig","padding","sortableButtonProps","sortedAscendingAriaLabel","sortedDescendingAriaLabel"],x=["className"],A=r.forwardRef((function(e,a){var n=e.className,o=e.children,s=e.name,l=e.sortable,i=void 0!==l&&l,d=e.sortConfig,c=e.padding,f=void 0===c?"default":c,v=e.sortableButtonProps,m=e.sortedAscendingAriaLabel,p=void 0===m?", sortert stigende":m,g=e.sortedDescendingAriaLabel,h=void 0===g?", sortert synkende":g,w=b(e,N),y=r.useState(!1),_=y[0],E=y[1];r.useEffect((function(){d&&s&&E(d&&s===d.key)}),[d,s]);var k=_?d&&d.order:void 0;return r.createElement("th",u({className:t("eds-table__header-cell",n,{"eds-table__header-cell--sortable":i,"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},w),i&&d&&v?r.createElement(C,{sortableButtonProps:v,sortConfig:d,isCurrentlySorted:_,ariaSort:k,sortedAscendingAriaLabel:p,sortedDescendingAriaLabel:h},o):o)})),C=function(e){var n=e.sortConfig,s=e.sortableButtonProps,l=e.isCurrentlySorted,i=e.children,d=e.ariaSort,c=e.sortedAscendingAriaLabel,f=e.sortedDescendingAriaLabel,v=r.useState(""),m=v[0],p=v[1],g=s.className,h=b(s,x),w=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;return r.useEffect((function(){"ascending"==n.order?p(c):"descending"==n.order&&p(f);var e=setTimeout((function(){p(""),w&&p(", sort "+n.order)}),3e3);return function(){return clearTimeout(e)}}),[n.order]),r.createElement("button",u({className:t("eds-table__header-cell-button",g),type:"button","aria-sort":d},h),i,(!l||"none"===n.order)&&r.createElement(o.UnsortedIcon,{size:"1em",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),l&&"ascending"===n.order&&r.createElement(o.UpArrowIcon,{size:"1em",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),l&&"descending"===n.order&&r.createElement(o.DownArrowIcon,{size:"1em",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),r.createElement(a.VisuallyHidden,null,l&&m))},S=["name","sortable","buttonProps"],R=["sortable"],D=["children","className","feedback","variant","outlined"],L=["open","onClick"];e.warnAboutMissingStyles("table"),exports.DataCell=k,exports.EditableCell=function(e){var a=e.children,n=e.className,o=e.feedback,s=e.variant,d=e.outlined,c=void 0!==d&&d,f=b(e,D);return r.createElement(l.VariantProvider,{variant:s},r.createElement(k,u({className:t("eds-editable-cell",{"eds-editable-cell--outlined":c},n)},f),r.createElement(i.Tooltip,{disableHoverListener:!o,disableFocusListener:!o,placement:"bottom",content:o||void 0,variant:o?"negative":void 0},a)))},exports.ExpandRowButton=function(e){var a=e.open,n=e.onClick,s=b(e,L);return r.createElement(c.IconButton,u({className:t("eds-expand-row-button",{"eds-expand-row-button--open":a}),onClick:n,"aria-label":a?"Lukk tabellrad":"Utvid tabellrad",type:"button"},s),r.createElement(o.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=A,exports.Table=v,exports.TableBody=h,exports.TableFooter=w,exports.TableHead=p,exports.TableRow=_,exports.useSortableData=function(e,t){void 0===t&&(t={key:"",order:"none"});var a=r.useState(t),n=a[0],o=a[1],l=r.useMemo((function(){return[].concat(e).sort((function(e,r){var t,a,o,l,i=null!=(t=null==(a=s(e,n.key,e))?void 0:a.toString())?t:"",d=null!=(o=null==(l=s(r,n.key,r))?void 0:l.toString())?o:"";return new Intl.Collator(["no","en"],{numeric:!0,sensitivity:"base"}).compare(i,d)}))}),[e,n.key]);return{sortedData:r.useMemo((function(){switch(n.order){case"ascending":return l;case"descending":return[].concat(l).reverse();default:return e}}),[n.order,e,l]),getSortableHeaderProps:function(e){var r=e.name,t=e.sortable,a=void 0===t||t,s=e.buttonProps,l=b(e,S);return u({name:r,sortable:a,sortConfig:n,sortableButtonProps:u({onClick:function(){return(e=r)!==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}},s)},l)},getSortableTableProps:function(e){var r=void 0===e?{}:e,t=r.sortable,a=void 0===t||t,o=b(r,R);return u({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),i=l[0],d=l[1],c=r.useRef(null),b=null==c||null==(a=c.current)?void 0:a.contains(document.activeElement);r.useEffect((function(){var e;c&&c.current&&b&&(null==(e=c.current.childNodes[o].childNodes[0].parentElement)||e.focus())}),[o,b]);var f=r.useRef(null);return{getTableRowNavigationProps:function(r){r>=i&&d(r+1);for(var a=o?0:-1,n=arguments.length,l=new Array(n>1?n-1:0),c=1;c<n;c++)l[c-1]=arguments[c];return u({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 u({ref:c},r)}}};
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/layout"),o=require("@entur/icons"),l=require("lodash.get"),s=require("@entur/form"),i=require("@entur/tooltip"),d=require("@entur/expand"),c=require("@entur/button");function u(){return u=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},u.apply(null,arguments)}function f(e,r){if(null==e)return{};var t={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(r.includes(a))continue;t[a]=e[a]}return t}var b=["className","fixed","spacing","sortable","changeSortDescription","stickyHeader"],v=r.forwardRef((function(n,o){var l=n.className,s=n.fixed,i=void 0!==s&&s,d=n.spacing,c=void 0===d?"default":d,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,w=void 0!==h&&h,_=f(n,b),y=e.useRandomId("sortable-header"),E=r.useRef(null);return r.useEffect((function(){if(w){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()}}}),[w]),r.createElement(r.Fragment,null,r.createElement("table",u({className:t("eds-table",{"eds-table--fixed":i},{"eds-table--middle":"middle"===c},{"eds-table--small":"small"===c},{"eds-table--sortable":m},{"eds-table--sticky-header":w},l),ref:e.mergeRefs(o,E),"aria-describedby":m?y:void 0},_)),m&&r.createElement(a.VisuallyHidden,{id:y},g))})),m=["className"],p=r.forwardRef((function(e,a){var n=e.className,o=f(e,m);return r.createElement("thead",u({className:t("eds-table__head",n),ref:a},o))})),g=["className"],h=r.forwardRef((function(e,a){var n=e.className,o=f(e,g);return r.createElement("tbody",u({className:t("eds-table__body",n),ref:a},o))})),w=r.forwardRef((function(e,t){var a=u({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return r.createElement("tfoot",u({ref:t},a))})),_=["className","hover","active","error"],y=r.forwardRef((function(e,a){var n=e.className,o=e.hover,l=void 0!==o&&o,s=e.active,i=void 0!==s&&s,d=e.error,c=void 0!==d&&d,b=f(e,_);return r.createElement("tr",u({className:t("eds-table__row",n,{"eds-table__row--hover":l,"eds-table__row--active":i,"eds-table__row--error":c}),ref:a},b))})),E=["className","padding","status","variant","children"],N=r.forwardRef((function(e,a){var o=e.className,l=e.padding,s=void 0===l?"default":l,i=e.status,d=e.variant,c=e.children,b=f(e,E);return!d&&i&&(d=function(e){switch(e){case"positive":return"success";case"negative":return"negative";default:return"neutral"}}(i)),r.createElement("td",u({ref:a,className:t("eds-table__data-cell",o,{"eds-table__data-cell--padding-checkbox":"checkbox"===s,"eds-table__data-cell--padding-radio":"radio"===s,"eds-table__data-cell--padding-overflow-menu":"overflow-menu"===s})},b),d?r.createElement(n.BulletBadge,{variant:d},c):c)})),k=["className","children","name","sortable","sortConfig","padding","sortableButtonProps","sortedAscendingAriaLabel","sortedDescendingAriaLabel"],x=["className"],A=r.forwardRef((function(e,a){var n=e.className,o=e.children,l=e.name,s=e.sortable,i=void 0!==s&&s,d=e.sortConfig,c=e.padding,b=void 0===c?"default":c,v=e.sortableButtonProps,m=e.sortedAscendingAriaLabel,p=void 0===m?", sortert stigende":m,g=e.sortedDescendingAriaLabel,h=void 0===g?", sortert synkende":g,w=f(e,k),_=r.useState(!1),y=_[0],E=_[1];r.useEffect((function(){d&&l&&E(d&&l===d.key)}),[d,l]);var N=y?d&&d.order:void 0;return r.createElement("th",u({className:t("eds-table__header-cell",n,{"eds-table__header-cell--sortable":i,"eds-table__header-cell--padding-radio":"radio"===b,"eds-table__header-cell--padding-checkbox":"checkbox"===b,"eds-table__header-cell--padding-overflow-menu":"overflow-menu"===b}),"aria-sort":N,ref:a},w),i&&d&&v?r.createElement(C,{sortableButtonProps:v,sortConfig:d,isCurrentlySorted:y,ariaSort:N,sortedAscendingAriaLabel:p,sortedDescendingAriaLabel:h},o):o)})),C=function(e){var n=e.sortConfig,l=e.sortableButtonProps,s=e.isCurrentlySorted,i=e.children,d=e.ariaSort,c=e.sortedAscendingAriaLabel,b=e.sortedDescendingAriaLabel,v=r.useState(""),m=v[0],p=v[1],g=l.className,h=f(l,x),w=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;return r.useEffect((function(){"ascending"==n.order?p(c):"descending"==n.order&&p(b);var e=setTimeout((function(){p(""),w&&p(", sort "+n.order)}),3e3);return function(){return clearTimeout(e)}}),[n.order]),r.createElement("button",u({className:t("eds-table__header-cell-button",g),type:"button","aria-sort":d},h),i,(!s||"none"===n.order)&&r.createElement(o.UnsortedIcon,{size:"1em",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),s&&"ascending"===n.order&&r.createElement(o.UpArrowIcon,{size:"1em",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),s&&"descending"===n.order&&r.createElement(o.DownArrowIcon,{size:"1em",className:"eds-table__header-cell-button-icon","aria-hidden":"true"}),r.createElement(a.VisuallyHidden,null,s&&m))},S=["name","sortable","buttonProps"],R=["sortable"],D=["children","className","feedback","variant","outlined"],P=["open","onClick"];e.warnAboutMissingStyles("table"),exports.DataCell=N,exports.EditableCell=function(e){var a=e.children,n=e.className,o=e.feedback,l=e.variant,d=e.outlined,c=void 0!==d&&d,b=f(e,D);return r.createElement(s.VariantProvider,{variant:l},r.createElement(N,u({className:t("eds-editable-cell",{"eds-editable-cell--outlined":c},n)},b),r.createElement(i.Tooltip,{disableHoverListener:!o,disableFocusListener:!o,placement:"bottom",content:o||void 0,variant:o?"negative":void 0},a)))},exports.ExpandRowButton=function(e){var a=e.open,n=e.onClick,l=f(e,P);return r.createElement(c.IconButton,u({className:t("eds-expand-row-button",{"eds-expand-row-button--open":a}),onClick:n,"aria-label":a?"Lukk tabellrad":"Utvid tabellrad",type:"button"},l),r.createElement(o.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=A,exports.Table=v,exports.TableBody=h,exports.TableFooter=w,exports.TableHead=p,exports.TableRow=y,exports.useSortableData=function(e,t){void 0===t&&(t={key:"",order:"none"});var a=r.useState(t),n=a[0],o=a[1],s=r.useMemo((function(){return[].concat(e).sort((function(e,r){var t,a,o,s,i=null!=(t=null==(a=l(e,n.key,e))?void 0:a.toString())?t:"",d=null!=(o=null==(s=l(r,n.key,r))?void 0:s.toString())?o:"";return new Intl.Collator(["no","en"],{numeric:!0,sensitivity:"base"}).compare(i,d)}))}),[e,n.key]);return{sortedData:r.useMemo((function(){switch(n.order){case"ascending":return s;case"descending":return[].concat(s).reverse();default:return e}}),[n.order,e,s]),getSortableHeaderProps:function(e){var r=e.name,t=e.sortable,a=void 0===t||t,l=e.buttonProps,s=f(e,S);return u({name:r,sortable:a,sortConfig:n,sortableButtonProps:u({onClick:function(){return(e=r)!==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)},s)},getSortableTableProps:function(e){var r=void 0===e?{}:e,t=r.sortable,a=void 0===t||t,o=f(r,R);return u({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],l=n[1],s=r.useState(0),i=s[0],d=s[1],c=r.useRef(null),f=null==c||null==(a=c.current)?void 0:a.contains(document.activeElement);r.useEffect((function(){var e;c&&c.current&&f&&(null==(e=c.current.childNodes[o].childNodes[0].parentElement)||e.focus())}),[o,f]);var b=r.useRef(null);return{getTableRowNavigationProps:function(r){r>=i&&d(r+1);for(var a=o?0:-1,n=arguments.length,s=new Array(n>1?n-1:0),c=1;c<n;c++)s[c-1]=arguments[c];return u({tabIndex:a,ref:b,onClick:function(){return l(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);l(a)}},s)},getTableBodyNavigationProps:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return u({ref:c},r)}}};
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/index.tsx","../src/EditableCell.tsx","../src/ExpandRowButton.tsx","../src/ExpandableRow.tsx","../src/useSortableTable.ts","../src/useTableKeyboardNavigation.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\nimport { BulletBadge } from '@entur/layout';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst danger = 'danger';\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 /** @deprecated bruk variant */\n status?: 'positive' | 'negative' | 'neutral';\n /** Hvilken type status man vil vise */\n variant?: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nfunction mapStatusToVariant(\n status: 'positive' | 'negative' | 'neutral',\n): DataCellProps['variant'] {\n switch (status) {\n case 'positive':\n return 'success';\n case 'negative':\n return 'negative';\n case 'neutral':\n return 'neutral';\n default:\n return 'neutral';\n }\n}\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status, variant, children, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => {\n // If variant is undefined and status is defined, map status to variant\n if (!variant && status) {\n variant = mapStatusToVariant(status);\n }\n return (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\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 {variant ? (\n <BulletBadge variant={variant}>{children}</BulletBadge>\n ) : (\n children\n )}\n </td>\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=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1em\"\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 { 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';\n\nimport { VariantProvider } from '@entur/form';\nimport { VariantType } from '@entur/utils';\nimport { Tooltip } from '@entur/tooltip';\n\nimport './EditableCell.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\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 | typeof error | typeof info;\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 ? 'negative' : 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 type=\"button\"\n {...rest}\n >\n <DownArrowIcon aria-hidden 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 {\n ButtonHTMLAttributes,\n DetailedHTMLProps,\n useMemo,\n useState,\n} 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 = useMemo(\n () =>\n [...tableData].sort((a: any, b: any) => {\n const valueOfA: string = get(a, sortConfig.key, a)?.toString() ?? '';\n const valueOfB: string = get(b, sortConfig.key, b)?.toString() ?? '';\n\n const stringComparator = new Intl.Collator(['no', 'en'], {\n numeric: true,\n sensitivity: 'base',\n });\n\n return stringComparator.compare(valueOfA, valueOfB);\n }),\n [tableData, sortConfig.key],\n );\n\n const sortedData = useMemo(() => {\n switch (sortConfig.order) {\n case 'ascending': {\n return tableSortedAscending;\n }\n case 'descending': {\n return [...tableSortedAscending].reverse();\n }\n case 'none': {\n return tableData;\n }\n default: {\n return tableData;\n }\n }\n }, [sortConfig.order, tableData, tableSortedAscending]);\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 { 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"],"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","_ref$padding","padding","status","variant","children","mapStatusToVariant","BulletBadge","HeaderCell","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","warnAboutMissingStyles","feedback","_ref$outlined","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","open","onClick","IconButton","_ref$open","colSpan","BaseExpand","tableData","externalSortConfig","setSortConfig","tableSortedAscending","useMemo","concat","sort","a","b","_get$toString","_get","_get$toString2","_get2","valueOfA","get","toString","valueOfB","Intl","Collator","numeric","sensitivity","compare","sortedData","reverse","getSortableHeaderProps","buttonProps","getSortableTableProps","_temp","_ref2$sortable","numberOfRows","allowWrap","_tableBodyRef$current","currentRow","setCurrentRow","maxRow","_useState2","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","_tableBodyRef$current2","childNodes","parentElement","focus","tableRowRef","getTableRowNavigationProps","row","tabIndex","_len2","arguments","length","Array","_key2","onKeyDown","e","newCell","event","preventDefault","onTableKeypress","getTableBodyNavigationProps","_len","_key"],"mappings":"8xBAwBaA,EAAQC,EAAMC,YACzB,SAUEC,EAAAA,GACE,IATAC,IAAAA,UAASC,EAAAC,EACTC,MAAAA,cAAaF,EAAAG,EAAAF,EACbG,QAAAA,aAAU,UAASD,EAAAE,EAA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EAAc/I,SAA4B,MAoBhD,MAAO,CAAEgJ,2BAnBT,SACEC,GAGIA,GAAOb,GACTE,EAAUW,EAAM,GAEmB,IAArC,IAAMC,EAAWhB,EAAa,GAAK,EAAEiB,EAAAC,UAAAC,OALlC3J,EAAS,IAAA4J,MAAAH,EAAA,EAAAA,EAAA,EAAA,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAT7J,EAAS6J,EAAA,GAAAH,UAAAG,GAMZ,OAAAjI,EAAA,CACE4H,SAAAA,EACArK,IAAKkK,EACLlD,QAAS,WAAA,OAAMsC,EAAcc,EAAI,EACjCO,UAAW,SAACC,GACV,IAAMC,EAlFd,SACEC,EACAzB,EACAE,EACAJ,GAGA,OADiB2B,EAAM/F,KAErB,IAAK,UAEH,OADA+F,EAAMC,iBACF5B,EACoB,IAAfE,EAAmBE,EAAS,EAAIF,EAAa,EAE7CA,EAAa,EAAIA,EAAa,EAAI,EAE7C,IAAK,YAEH,OADAyB,EAAMC,iBACF5B,EACKE,IAAeE,EAAS,EAAI,EAAIF,EAAa,EAE7CA,EAAaE,EAAS,EAAIF,EAAa,EAAIA,EAEtD,QACE,OAAOA,EAEb,CAyDwB2B,CAAgBJ,EAAGvB,EAAYH,EAAcC,GAC7DG,EAAcuB,EAChB,GACGhK,EAEP,EACqCoK,4BA3BrC,WAAiD,IAAA,IAAAC,EAAAX,UAAAC,OAAT3J,EAAS,IAAA4J,MAAAS,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAATtK,EAASsK,GAAAZ,UAAAY,GAC/C,OAAA1I,EAAA,CACEzC,IAAK0J,GACF7I,EAEP,EAuBF"}
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/index.tsx","../src/EditableCell.tsx","../src/ExpandRowButton.tsx","../src/ExpandableRow.tsx","../src/useSortableTable.ts","../src/useTableKeyboardNavigation.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\nimport { BulletBadge } from '@entur/layout';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst danger = 'danger';\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 /** @deprecated bruk variant */\n status?: 'positive' | 'negative' | 'neutral';\n /** Hvilken type status man vil vise */\n variant?: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nfunction mapStatusToVariant(\n status: 'positive' | 'negative' | 'neutral',\n): DataCellProps['variant'] {\n switch (status) {\n case 'positive':\n return 'success';\n case 'negative':\n return 'negative';\n case 'neutral':\n return 'neutral';\n default:\n return 'neutral';\n }\n}\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status, variant, children, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => {\n // If variant is undefined and status is defined, map status to variant\n if (!variant && status) {\n variant = mapStatusToVariant(status);\n }\n return (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\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 {variant ? (\n <BulletBadge variant={variant}>{children}</BulletBadge>\n ) : (\n children\n )}\n </td>\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=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1em\"\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 { 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';\n\nimport { VariantProvider } from '@entur/form';\nimport { VariantType } from '@entur/utils';\nimport { Tooltip } from '@entur/tooltip';\n\nimport './EditableCell.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\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 | typeof error | typeof info;\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 ? 'negative' : 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 type=\"button\"\n {...rest}\n >\n <DownArrowIcon aria-hidden 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 {\n ButtonHTMLAttributes,\n DetailedHTMLProps,\n useMemo,\n useState,\n} 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 = useMemo(\n () =>\n [...tableData].sort((a: any, b: any) => {\n const valueOfA: string = get(a, sortConfig.key, a)?.toString() ?? '';\n const valueOfB: string = get(b, sortConfig.key, b)?.toString() ?? '';\n\n const stringComparator = new Intl.Collator(['no', 'en'], {\n numeric: true,\n sensitivity: 'base',\n });\n\n return stringComparator.compare(valueOfA, valueOfB);\n }),\n [tableData, sortConfig.key],\n );\n\n const sortedData = useMemo(() => {\n switch (sortConfig.order) {\n case 'ascending': {\n return tableSortedAscending;\n }\n case 'descending': {\n return [...tableSortedAscending].reverse();\n }\n case 'none': {\n return tableData;\n }\n default: {\n return tableData;\n }\n }\n }, [sortConfig.order, tableData, tableSortedAscending]);\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 { 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"],"names":["Table","React","forwardRef","_ref","ref","className","_ref$fixed","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","_ref$padding","padding","status","variant","children","mapStatusToVariant","BulletBadge","HeaderCell","name","sortConfig","sortableButtonProps","_ref$sortedAscendingA","sortedAscendingAriaLabel","_ref$sortedDescending","sortedDescendingAriaLabel","_React$useState","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","_ref2","_useState","sortedAriaInfo","setSortedAriaInfo","_excluded2","isFirefox","navigator","userAgent","toLowerCase","indexOf","dismissAriaTimer","setTimeout","clearTimeout","type","UnsortedIcon","size","UpArrowIcon","DownArrowIcon","warnAboutMissingStyles","feedback","_ref$outlined","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","open","onClick","IconButton","_ref$open","colSpan","BaseExpand","tableData","externalSortConfig","setSortConfig","tableSortedAscending","useMemo","concat","sort","a","b","_get$toString","_get","_get$toString2","_get2","valueOfA","get","toString","valueOfB","Intl","Collator","numeric","sensitivity","compare","sortedData","reverse","getSortableHeaderProps","buttonProps","getSortableTableProps","_temp","_ref2$sortable","numberOfRows","allowWrap","_tableBodyRef$current","currentRow","setCurrentRow","_useState2","maxRow","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","_tableBodyRef$current2","childNodes","parentElement","focus","tableRowRef","getTableRowNavigationProps","row","tabIndex","_len2","arguments","length","Array","_key2","onKeyDown","e","newCell","event","preventDefault","onTableKeypress","getTableBodyNavigationProps","_len","_key"],"mappings":"uxBAwBaA,EAAQC,EAAMC,YACzB,SAAAC,EAUEC,GACE,IATAC,EAASF,EAATE,UAASC,EAAAH,EACTI,MAAAA,OAAQ,IAAHD,GAAQA,EAAAE,EAAAL,EACbM,QAAAA,OAAU,IAAHD,EAAG,UAASA,EAAAE,EAAAP,EACnBQ,SAAAA,OAAW,IA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C7DG,EAAcuB,EAChB,GACGhK,EAEP,EACqCoK,4BA3BrC,WAAiD,IAAA,IAAAC,EAAAX,UAAAC,OAAT3J,EAAS4J,IAAAA,MAAAS,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAATtK,EAASsK,GAAAZ,UAAAY,GAC/C,OAAA1I,EAAA,CACExC,IAAKyJ,GACF7I,EAEP,EAuBF"}
package/dist/table.esm.js CHANGED
@@ -11,33 +11,25 @@ import { BaseExpand } from '@entur/expand';
11
11
  import { IconButton } from '@entur/button';
12
12
 
13
13
  function _extends() {
14
- _extends = Object.assign ? Object.assign.bind() : function (target) {
15
- for (var i = 1; i < arguments.length; i++) {
16
- var source = arguments[i];
17
- for (var key in source) {
18
- if (Object.prototype.hasOwnProperty.call(source, key)) {
19
- target[key] = source[key];
20
- }
21
- }
14
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
15
+ for (var e = 1; e < arguments.length; e++) {
16
+ var t = arguments[e];
17
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
22
18
  }
23
- return target;
24
- };
25
- return _extends.apply(this, arguments);
19
+ return n;
20
+ }, _extends.apply(null, arguments);
26
21
  }
27
- function _objectDestructuringEmpty(obj) {
28
- if (obj == null) throw new TypeError("Cannot destructure " + obj);
22
+ function _objectDestructuringEmpty(t) {
23
+ if (null == t) throw new TypeError("Cannot destructure " + t);
29
24
  }
30
- function _objectWithoutPropertiesLoose(source, excluded) {
31
- if (source == null) return {};
32
- var target = {};
33
- var sourceKeys = Object.keys(source);
34
- var key, i;
35
- for (i = 0; i < sourceKeys.length; i++) {
36
- key = sourceKeys[i];
37
- if (excluded.indexOf(key) >= 0) continue;
38
- target[key] = source[key];
25
+ function _objectWithoutPropertiesLoose(r, e) {
26
+ if (null == r) return {};
27
+ var t = {};
28
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
29
+ if (e.includes(n)) continue;
30
+ t[n] = r[n];
39
31
  }
40
- return target;
32
+ return t;
41
33
  }
42
34
 
43
35
  var _excluded$8 = ["className", "fixed", "spacing", "sortable", "changeSortDescription", "stickyHeader"];
@@ -67,9 +59,9 @@ var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
67
59
  var tableElement = tableRef.current;
68
60
  var observerElement = document.createElement('div');
69
61
  observerElement.classList.add('sticky-observer');
70
- tableElement == null ? void 0 : (_tableElement$parentN = tableElement.parentNode) == null ? void 0 : _tableElement$parentN.insertBefore(observerElement, tableElement);
62
+ tableElement == null || (_tableElement$parentN = tableElement.parentNode) == null || _tableElement$parentN.insertBefore(observerElement, tableElement);
71
63
  var observer = new IntersectionObserver(function (entries) {
72
- tableElement == null ? void 0 : tableElement.classList.toggle('eds-table--sticky-header--active', !entries[0].isIntersecting);
64
+ tableElement == null || tableElement.classList.toggle('eds-table--sticky-header--active', !entries[0].isIntersecting);
73
65
  }, {
74
66
  threshold: [0, 1]
75
67
  });
@@ -456,7 +448,7 @@ var useTableKeyboardNavigation = function useTableKeyboardNavigation(numberOfRow
456
448
  maxRow = _useState2[0],
457
449
  setMaxRow = _useState2[1];
458
450
  var tableBodyRef = useRef(null);
459
- var tableHasFocus = tableBodyRef == null ? void 0 : (_tableBodyRef$current = tableBodyRef.current) == null ? void 0 : _tableBodyRef$current.contains(document.activeElement);
451
+ var tableHasFocus = tableBodyRef == null || (_tableBodyRef$current = tableBodyRef.current) == null ? void 0 : _tableBodyRef$current.contains(document.activeElement);
460
452
  useEffect(function () {
461
453
  var _tableBodyRef$current2;
462
454
  tableBodyRef && tableBodyRef.current && tableHasFocus && ((_tableBodyRef$current2 = tableBodyRef.current.childNodes[currentRow].childNodes[0].parentElement) == null ? void 0 : _tableBodyRef$current2.focus());
@@ -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 { 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\nimport { BulletBadge } from '@entur/layout';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst danger = 'danger';\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 /** @deprecated bruk variant */\n status?: 'positive' | 'negative' | 'neutral';\n /** Hvilken type status man vil vise */\n variant?: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nfunction mapStatusToVariant(\n status: 'positive' | 'negative' | 'neutral',\n): DataCellProps['variant'] {\n switch (status) {\n case 'positive':\n return 'success';\n case 'negative':\n return 'negative';\n case 'neutral':\n return 'neutral';\n default:\n return 'neutral';\n }\n}\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status, variant, children, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => {\n // If variant is undefined and status is defined, map status to variant\n if (!variant && status) {\n variant = mapStatusToVariant(status);\n }\n return (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\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 {variant ? (\n <BulletBadge variant={variant}>{children}</BulletBadge>\n ) : (\n children\n )}\n </td>\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=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1em\"\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 {\n ButtonHTMLAttributes,\n DetailedHTMLProps,\n useMemo,\n useState,\n} 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 = useMemo(\n () =>\n [...tableData].sort((a: any, b: any) => {\n const valueOfA: string = get(a, sortConfig.key, a)?.toString() ?? '';\n const valueOfB: string = get(b, sortConfig.key, b)?.toString() ?? '';\n\n const stringComparator = new Intl.Collator(['no', 'en'], {\n numeric: true,\n sensitivity: 'base',\n });\n\n return stringComparator.compare(valueOfA, valueOfB);\n }),\n [tableData, sortConfig.key],\n );\n\n const sortedData = useMemo(() => {\n switch (sortConfig.order) {\n case 'ascending': {\n return tableSortedAscending;\n }\n case 'descending': {\n return [...tableSortedAscending].reverse();\n }\n case 'none': {\n return tableData;\n }\n default: {\n return tableData;\n }\n }\n }, [sortConfig.order, tableData, tableSortedAscending]);\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';\n\nimport { VariantProvider } from '@entur/form';\nimport { VariantType } from '@entur/utils';\nimport { Tooltip } from '@entur/tooltip';\n\nimport './EditableCell.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\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 | typeof error | typeof info;\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 ? 'negative' : 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 type=\"button\"\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","mapStatusToVariant","status","DataCell","padding","variant","children","BulletBadge","HeaderCell","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","useMemo","sort","a","b","valueOfA","get","toString","valueOfB","stringComparator","Intl","Collator","numeric","sensitivity","compare","sortedData","reverse","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","EditableCell","feedback","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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AGpB,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AAAC,IAAA,KAAA,IAAA,KAAA,GAAA,SAAA,CAAA,MAAA,EALlCxH,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;AACE4I,MAAAA,QAAQ,EAARA,QAAQ;AACRnJ,MAAAA,GAAG,EAAEgJ,WAAW;AAChBpC,MAAAA,OAAO,EAAE,SAAA,OAAA,GAAA;QAAA,OAAM0B,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,EACE/I,IAAI,CAAA,CAAA;AAEX,GAAA;EACA,OAAO;AAAE0I,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\nimport { BulletBadge } from '@entur/layout';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst danger = 'danger';\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 /** @deprecated bruk variant */\n status?: 'positive' | 'negative' | 'neutral';\n /** Hvilken type status man vil vise */\n variant?: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;\n} & React.DetailedHTMLProps<\n React.TdHTMLAttributes<HTMLTableDataCellElement>,\n HTMLTableDataCellElement\n>;\n\nfunction mapStatusToVariant(\n status: 'positive' | 'negative' | 'neutral',\n): DataCellProps['variant'] {\n switch (status) {\n case 'positive':\n return 'success';\n case 'negative':\n return 'negative';\n case 'neutral':\n return 'neutral';\n default:\n return 'neutral';\n }\n}\n\nexport const DataCell = React.forwardRef<\n HTMLTableDataCellElement,\n DataCellProps\n>(\n (\n { className, padding = 'default', status, variant, children, ...rest },\n ref: React.Ref<HTMLTableDataCellElement>,\n ) => {\n // If variant is undefined and status is defined, map status to variant\n if (!variant && status) {\n variant = mapStatusToVariant(status);\n }\n return (\n <td\n ref={ref}\n className={classNames('eds-table__data-cell', className, {\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 {variant ? (\n <BulletBadge variant={variant}>{children}</BulletBadge>\n ) : (\n children\n )}\n </td>\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=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'ascending' && (\n <UpArrowIcon\n size=\"1em\"\n className=\"eds-table__header-cell-button-icon\"\n aria-hidden=\"true\"\n />\n )}\n {isCurrentlySorted && sortConfig.order === 'descending' && (\n <DownArrowIcon\n size=\"1em\"\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 {\n ButtonHTMLAttributes,\n DetailedHTMLProps,\n useMemo,\n useState,\n} 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 = useMemo(\n () =>\n [...tableData].sort((a: any, b: any) => {\n const valueOfA: string = get(a, sortConfig.key, a)?.toString() ?? '';\n const valueOfB: string = get(b, sortConfig.key, b)?.toString() ?? '';\n\n const stringComparator = new Intl.Collator(['no', 'en'], {\n numeric: true,\n sensitivity: 'base',\n });\n\n return stringComparator.compare(valueOfA, valueOfB);\n }),\n [tableData, sortConfig.key],\n );\n\n const sortedData = useMemo(() => {\n switch (sortConfig.order) {\n case 'ascending': {\n return tableSortedAscending;\n }\n case 'descending': {\n return [...tableSortedAscending].reverse();\n }\n case 'none': {\n return tableData;\n }\n default: {\n return tableData;\n }\n }\n }, [sortConfig.order, tableData, tableSortedAscending]);\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';\n\nimport { VariantProvider } from '@entur/form';\nimport { VariantType } from '@entur/utils';\nimport { Tooltip } from '@entur/tooltip';\n\nimport './EditableCell.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\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 | typeof error | typeof info;\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 ? 'negative' : 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 type=\"button\"\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","ref","className","_ref$fixed","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","mapStatusToVariant","status","DataCell","_ref$padding","padding","variant","children","BulletBadge","HeaderCell","name","sortConfig","sortableButtonProps","_ref$sortedAscendingA","sortedAscendingAriaLabel","_ref$sortedDescending","sortedDescendingAriaLabel","_React$useState","useState","isCurrentlySorted","setIsCurrentlySorted","key","ariaSort","order","SortableHeaderCellButton","_ref2","_useState","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","useMemo","concat","sort","a","b","_get$toString","_get","_get$toString2","_get2","valueOfA","get","toString","valueOfB","stringComparator","Intl","Collator","numeric","sensitivity","compare","sortedData","reverse","getSortableHeaderProps","buttonProps","onClick","getSortableTableProps","_temp","_ref2$sortable","EditableCell","feedback","_ref$outlined","outlined","VariantProvider","Tooltip","disableHoverListener","disableFocusListener","placement","content","ExpandableRow","_ref$open","open","colSpan","BaseExpand","ExpandRowButton","IconButton","onTableKeypress","event","currentRow","maxRow","allowWrap","keyPress","preventDefault","useTableKeyboardNavigation","numberOfRows","_tableBodyRef$current","setCurrentRow","_useState2","setMaxRow","tableBodyRef","tableHasFocus","contains","activeElement","_tableBodyRef$current2","childNodes","parentElement","focus","getTableBodyNavigationProps","_len","arguments","length","Array","_key","tableRowRef","getTableRowNavigationProps","row","tabIndex","_len2","_key2","onKeyDown","e","newCell","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAMA,KAAK,gBAAGC,KAAK,CAACC,UAAU,CACnC,UAAAC,IAAA,EAUEC,GAAG,EACD;AAAA,EAAA,IATA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": "@entur/table",
3
- "version": "4.8.25",
3
+ "version": "4.8.26-beta.0",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/table.esm.js",
@@ -27,18 +27,21 @@
27
27
  "react-dom": ">=16.8.0"
28
28
  },
29
29
  "dependencies": {
30
- "@entur/a11y": "^0.2.93",
31
- "@entur/button": "^3.2.36",
32
- "@entur/expand": "^3.5.25",
33
- "@entur/form": "^8.1.8",
34
- "@entur/icons": "^7.5.0",
35
- "@entur/layout": "^2.3.20",
36
- "@entur/tokens": "^3.17.3",
37
- "@entur/tooltip": "^5.1.4",
38
- "@entur/utils": "^0.12.1",
30
+ "@entur/a11y": "^0.2.94-beta.0",
31
+ "@entur/button": "^3.2.37-beta.0",
32
+ "@entur/expand": "^3.5.26-beta.0",
33
+ "@entur/form": "^8.1.9-beta.0",
34
+ "@entur/icons": "^7.5.1-beta.0",
35
+ "@entur/layout": "^2.3.21-beta.0",
36
+ "@entur/tokens": "^3.17.4-beta.0",
37
+ "@entur/tooltip": "^5.1.5-beta.0",
38
+ "@entur/utils": "^0.12.2-beta.0",
39
39
  "@types/lodash.get": "^4.4.6",
40
40
  "classnames": "^2.3.1",
41
41
  "lodash.get": "^4.4.2"
42
42
  },
43
- "gitHead": "5c9836f2bcab799e31cc52b6fe72c6e198947a71"
43
+ "devDependencies": {
44
+ "dts-cli": "2.0.5"
45
+ },
46
+ "gitHead": "b213fa4fd10a1a07abada3fa987b7ee2ed110ac2"
44
47
  }