@qualtrics/ui-react 2.50.0 → 2.51.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/CHANGELOG.md +15 -0
- package/dist/__shared/cjs/{index-e9e9ae0e.js → index-674107cf.js} +3 -3
- package/dist/__shared/cjs/{index-19ecf96e.js → index-6c8bf8c5.js} +253 -281
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionPanel.js +3 -24
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +9 -13
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/Palette.js +33 -39
- package/dist/components/Combobox/Combobox.js +1 -1
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane.js +5 -6
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +9 -9
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +3 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +7 -2
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/TabContextProvider.js +0 -2
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +31 -41
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +1 -1
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +1 -1
- package/dist/components/deprecated_Tabs/Tabs.js +2 -2
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/index.d.ts +0 -2
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +18 -4
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +9 -7
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +6 -1
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +15 -6
- package/dist/next/AdvancedTable/AdvancedTableDnDContext.js +32 -0
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +9 -11
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +19 -2
- package/dist/next/AdvancedTable/AdvancedTableRow.js +6 -1
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +12 -3
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +30 -138
- package/dist/next/AdvancedTable/useDragAndDropConfig.js +191 -0
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer.js +1 -1
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Hooks/usePaneSearch.js +12 -7
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +1 -0
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +14 -12
- package/dist/next/index.js +316 -162
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +5 -3
- package/dist/utils/Text/Text.js +1 -1
- package/dist/utils/Translation/containsComponentOrElement.js +6 -3
- package/dist/utils/Translation/useTranslation.js +5 -1
- package/icons/package.json +9 -9
- package/next/package.json +10 -10
- package/package.json +40 -40
package/dist/icons/Icon.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"icon":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._P-hpG{flex-shrink:0}";
|
|
4
|
+
var styles = {"icon":"_P-hpG"};
|
|
5
|
+
var stylesheet="._P-hpG{flex-shrink:0}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
package/dist/icons/index.d.ts
CHANGED
package/dist/icons/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var icons_index = require('../__shared/cjs/index-
|
|
5
|
+
var icons_index = require('../__shared/cjs/index-674107cf.js');
|
|
6
6
|
require('@babel/runtime-corejs3/helpers/extends');
|
|
7
7
|
require('react');
|
|
8
8
|
require('classnames');
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
1
|
import { ButtonHTMLAttributes } from 'react';
|
|
4
2
|
import type { ChangeEvent } from 'react';
|
|
5
3
|
import type { ClipboardEvent as ClipboardEvent_2 } from 'react';
|
|
@@ -2322,7 +2320,7 @@ declare interface NamedIconsProps extends React_2.SVGProps<SVGSVGElement> {
|
|
|
2322
2320
|
[prop: string]: any;
|
|
2323
2321
|
}
|
|
2324
2322
|
|
|
2325
|
-
declare type NavLink =
|
|
2323
|
+
declare type NavLink = RenderFunctionNavLinkV5 | RenderFunctionNavLinkV6;
|
|
2326
2324
|
|
|
2327
2325
|
declare interface NavLinkV5Props extends BaseNavLinkProps {
|
|
2328
2326
|
className: (isActive: boolean) => string;
|
|
@@ -2796,7 +2794,13 @@ export declare interface RangeSliderProps extends Omit<React_2.AllHTMLAttributes
|
|
|
2796
2794
|
[prop: string]: any;
|
|
2797
2795
|
}
|
|
2798
2796
|
|
|
2799
|
-
declare type
|
|
2797
|
+
declare type RenderFunctionNavLinkV5 = (props: RenderFunctionPropsTypeV5) => ReactElement<any, any> | null;
|
|
2798
|
+
|
|
2799
|
+
declare type RenderFunctionNavLinkV6 = (props: RenderFunctionPropsTypeV6) => ReactElement<any, any> | null;
|
|
2800
|
+
|
|
2801
|
+
declare type RenderFunctionPropsTypeV5 = NavLinkV5Props & RefAttributes<HTMLAnchorElement>;
|
|
2802
|
+
|
|
2803
|
+
declare type RenderFunctionPropsTypeV6 = NavLinkV6Props & RefAttributes<HTMLAnchorElement>;
|
|
2800
2804
|
|
|
2801
2805
|
export declare const SearchInput: React_2.ForwardRefExoticComponent<SearchInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
2802
2806
|
|
|
@@ -2827,6 +2831,14 @@ export declare interface SearchInputProps {
|
|
|
2827
2831
|
* Forwarded to the [`Input`](/components/input) component.
|
|
2828
2832
|
*/
|
|
2829
2833
|
'aria-labelledby'?: string;
|
|
2834
|
+
/**
|
|
2835
|
+
* Forwarded to the [`Input`](/components/input) component.
|
|
2836
|
+
*/
|
|
2837
|
+
'aria-controls'?: string;
|
|
2838
|
+
/**
|
|
2839
|
+
* Forwarded to the [`Input`](/components/input) component.
|
|
2840
|
+
*/
|
|
2841
|
+
'aria-expanded'?: boolean;
|
|
2830
2842
|
/**
|
|
2831
2843
|
* Forwarded to the [`Input`](/components/input) component.
|
|
2832
2844
|
*/
|
|
@@ -2845,6 +2857,8 @@ export declare interface SearchInputProps {
|
|
|
2845
2857
|
style?: React_2.CSSProperties;
|
|
2846
2858
|
/** An id for the `input` element. */
|
|
2847
2859
|
id?: string;
|
|
2860
|
+
/** Forwarded to the [`Input`](/components/input) component. */
|
|
2861
|
+
role?: string;
|
|
2848
2862
|
}
|
|
2849
2863
|
|
|
2850
2864
|
export declare const SelectMenu: React_2.ForwardRefExoticComponent<SelectMenuProps & React_2.RefAttributes<HTMLElement>>;
|
package/dist/index.es.js
CHANGED
|
@@ -102,6 +102,6 @@ export { default as deprecated_ToolbarPanel } from './components/deprecated_Tool
|
|
|
102
102
|
|
|
103
103
|
/* eslint-disable camelcase */
|
|
104
104
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
105
|
-
const version = '2.
|
|
105
|
+
const version = '2.51.0';
|
|
106
106
|
|
|
107
107
|
export { version };
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./__shared/cjs/index-
|
|
5
|
+
var index = require('./__shared/cjs/index-6c8bf8c5.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
-
require('./__shared/cjs/index-
|
|
8
|
+
require('./__shared/cjs/index-674107cf.js');
|
|
9
9
|
require('@babel/runtime-corejs3/helpers/extends');
|
|
10
10
|
require('react-popper');
|
|
11
11
|
require('@popperjs/core');
|
|
@@ -21,7 +21,7 @@ require('throttle-debounce');
|
|
|
21
21
|
|
|
22
22
|
/* eslint-disable camelcase */
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
24
|
-
const version = '2.
|
|
24
|
+
const version = '2.51.0';
|
|
25
25
|
|
|
26
26
|
exports.Accordion = index.Accordion;
|
|
27
27
|
exports.AccordionHeader = index.AccordionHeader;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
2
|
import React__default, { useMemo, useState, useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { DndProvider } from 'react-dnd';
|
|
5
|
-
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
6
4
|
import useResizeObserver from '@react-hook/resize-observer';
|
|
7
5
|
import '../../utils/index.js';
|
|
8
6
|
import '../../hooks/index.js';
|
|
@@ -19,6 +17,7 @@ import '../../components/IconButton/index.js';
|
|
|
19
17
|
import '../../components/Dropdown/index.js';
|
|
20
18
|
import AdvancedTablePagination from './AdvancedTablePagination.js';
|
|
21
19
|
import AdvancedTableRowExpandButton from './AdvancedTableRowExpandButton.js';
|
|
20
|
+
import { AdvancedTableDnDContextProvider } from './AdvancedTableDnDContext.js';
|
|
22
21
|
import useId from '../../hooks/useId/useId.js';
|
|
23
22
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
24
23
|
import Dropdown from '../../components/Dropdown/Dropdown.js';
|
|
@@ -32,7 +31,6 @@ import concatIds from '../../utils/concatIds/concatIds.js';
|
|
|
32
31
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
33
32
|
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
34
33
|
import useEventCallback from '../../hooks/useEventCallback/useEventCallback.js';
|
|
35
|
-
import canUseDOM from '../../utils/canUseDOM/canUseDOM.js';
|
|
36
34
|
import useLatest from '../../hooks/useLatest/useLatest.js';
|
|
37
35
|
import wrapAround from '../../utils/wrapAround/wrapAround.js';
|
|
38
36
|
|
|
@@ -551,7 +549,7 @@ const AdvancedTable = _ref => {
|
|
|
551
549
|
onClick: e => {
|
|
552
550
|
e.stopPropagation(); // prevent onRowSelect
|
|
553
551
|
e.preventDefault();
|
|
554
|
-
updateExpandedRowIds(rowIndex, !isExpanded);
|
|
552
|
+
updateExpandedRowIds(rowIndex + (currentPage - 1) * (rowsPerPage || 0), !isExpanded);
|
|
555
553
|
}
|
|
556
554
|
});
|
|
557
555
|
const getExpandableRowsSpacer = function (width, inHeader) {
|
|
@@ -611,9 +609,13 @@ const AdvancedTable = _ref => {
|
|
|
611
609
|
} = _ref7;
|
|
612
610
|
return ((_columnWidths$id2 = columnWidths[id]) !== null && _columnWidths$id2 !== void 0 ? _columnWidths$id2 : width) !== undefined;
|
|
613
611
|
});
|
|
614
|
-
return /*#__PURE__*/React__default.createElement(
|
|
615
|
-
|
|
616
|
-
|
|
612
|
+
return /*#__PURE__*/React__default.createElement(AdvancedTableDnDContextProvider, {
|
|
613
|
+
setDropTargetSide: setDropTargetSide,
|
|
614
|
+
setColumnOrder: setColumnOrder,
|
|
615
|
+
setDragSource: setDragSource,
|
|
616
|
+
setDropTarget: setDropTarget,
|
|
617
|
+
setPinnedColumns: setPinnedColumns,
|
|
618
|
+
dropTargetSide: dropTargetSide
|
|
617
619
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
618
620
|
className: styles.advancedTable,
|
|
619
621
|
ref: tableRef
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"advancedTable":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._fyDh2{overflow:auto;position:relative;max-width:100%;max-height:100%}._6wL0I,._fyDh2{background-color:#fff}._6wL0I{height:70px;z-index:100;display:flex;align-items:flex-end;justify-content:center;position:-webkit-sticky;position:sticky;left:0}._1u1Wa{margin-bottom:4px}._I2A5i{position:-webkit-sticky;position:sticky;top:0;z-index:100}._cfA3Z{display:flex}._cfA3Z:focus{outline:none}._cfA3Z.focus-visible ._Akyti:after,._cfA3Z:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._cfA3Z.focus-visible ._Akyti:last-of-type:after,._cfA3Z:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._cfA3Z.focus-visible ._Akyti:first-of-type:after,._cfA3Z:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._cfA3Z.focus-visible ._Akyti._xG5Tg:after,._cfA3Z:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:1px}._0sJPi{padding-right:3px}._3CUs2{max-width:100%;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._7Hf4E{display:flex}._7Hf4E._l0UtA ._Akyti,._7Hf4E._l0UtA ._Zd1-m{cursor:pointer}._7Hf4E._gGnpW ._Akyti,._7Hf4E._gGnpW ._Zd1-m{background-color:rgba(11,110,208,.08);font-weight:500;box-shadow:inset 0 -1px 0 0 #0b6ed0}._7Hf4E._gGnpW ._Akyti._xG5Tg,._7Hf4E._gGnpW ._Zd1-m._xG5Tg{background-color:#fff;box-shadow:inset 0 -2px 0 0 #0b6ed0}._7Hf4E._gGnpW ._Akyti._xG5Tg ._gvKwy,._7Hf4E._gGnpW ._Akyti._xG5Tg ._iT5q0,._7Hf4E._gGnpW ._Akyti._xG5Tg ._Zd1-m,._7Hf4E._gGnpW ._Zd1-m._xG5Tg ._gvKwy,._7Hf4E._gGnpW ._Zd1-m._xG5Tg ._iT5q0,._7Hf4E._gGnpW ._Zd1-m._xG5Tg ._Zd1-m{background-color:rgba(11,110,208,.08)}._7Hf4E._l0UtA:hover:not(._gGnpW) ._Akyti,._7Hf4E._l0UtA:hover:not(._gGnpW) ._Zd1-m{background-color:#f9f9f9}._7Hf4E._l0UtA:active:not(._gGnpW):not(._7Hf4E._l0UtA:active:not(._gGnpW):has(._iT5q0:active)) ._Akyti,._7Hf4E._l0UtA:active:not(._gGnpW):not(._7Hf4E._l0UtA:active:not(._gGnpW):has(._iT5q0:active)) ._Zd1-m{background-color:#f3f3f3}._7Hf4E:focus{outline:none}._7Hf4E.focus-visible ._Akyti:after,._7Hf4E:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._7Hf4E.focus-visible ._Akyti:last-of-type:after,._7Hf4E:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._7Hf4E.focus-visible ._Akyti:first-of-type:after,._7Hf4E:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._7Hf4E.focus-visible ._Akyti._xG5Tg:after,._7Hf4E:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:0}._7Hf4E:last-of-type:focus{outline:none}._7Hf4E:last-of-type.focus-visible ._Akyti:after,._7Hf4E:last-of-type:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:-2px;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._7Hf4E:last-of-type.focus-visible ._Akyti:last-of-type:after,._7Hf4E:last-of-type:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._7Hf4E:last-of-type.focus-visible ._Akyti:first-of-type:after,._7Hf4E:last-of-type:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._7Hf4E:last-of-type.focus-visible ._Akyti._xG5Tg:after,._7Hf4E:last-of-type:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:1px}._7Hf4E:last-of-type ._gvKwy:focus{outline:none}._7Hf4E:last-of-type ._gvKwy._Uu0GO.focus-visible:after,._7Hf4E:last-of-type ._gvKwy._Uu0GO:focus-visible:after,._7Hf4E:last-of-type ._gvKwy.focus-visible:after,._7Hf4E:last-of-type ._gvKwy:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._7Hf4E:first-of-type:focus{outline:none}._7Hf4E:first-of-type.focus-visible ._Akyti:after,._7Hf4E:first-of-type:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._7Hf4E:first-of-type.focus-visible ._Akyti:last-of-type:after,._7Hf4E:first-of-type:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._7Hf4E:first-of-type.focus-visible ._Akyti:first-of-type:after,._7Hf4E:first-of-type:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._7Hf4E:first-of-type.focus-visible ._Akyti._xG5Tg:after,._7Hf4E:first-of-type:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:0}._7Hf4E:first-of-type ._gvKwy:focus{outline:none}._7Hf4E:first-of-type ._gvKwy._Uu0GO.focus-visible:after,._7Hf4E:first-of-type ._gvKwy._Uu0GO:focus-visible:after,._7Hf4E:first-of-type ._gvKwy.focus-visible:after,._7Hf4E:first-of-type ._gvKwy:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._Hhfia{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #d9d9d9;flex-shrink:0;font-size:12px;line-height:16px;font-weight:700;color:#6a6d70;background-color:#fff;position:relative}._Hhfia._-Xr-a{flex-grow:1}._Hhfia._SHtqe{cursor:pointer}._Hhfia._SHtqe:hover:not(._3h2pA){background-color:#f9f9f9;border-bottom-color:#6a6d70}._Hhfia._SHtqe:active:not(._3h2pA){background-color:#f3f3f3}._Hhfia._qW63x:not(._3h2pA){color:#32363a;fill:#32363a;border-bottom-color:#8a8f94}._Hhfia._3h2pA{cursor:move!important;background-color:#efefef;border-bottom-color:#ccc;border-top-left-radius:4px;border-top-right-radius:4px}._Hhfia ._BVEsg{background-color:#d9d9d9;position:absolute;width:1px;top:0;pointer-events:none}._Hhfia ._BVEsg._pt2hI{left:-1px}._Hhfia ._BVEsg._4unNb{right:0}._Hhfia ._HKjN8{background-color:#0a6ed1;position:absolute;width:3px;top:4px;bottom:4px;border-radius:4px;pointer-events:none}._Hhfia ._HKjN8._pt2hI{left:-2px}._Hhfia ._HKjN8._4unNb{right:-1px}._Hhfia:first-of-type ._pt2hI._BVEsg{left:0;width:2px;border-left:1px solid #fff}._Hhfia:first-of-type ._pt2hI._HKjN8{left:0}._Hhfia:last-of-type ._4unNb._BVEsg{right:0;width:2px;border-right:1px solid #fff}._Hhfia:last-of-type ._4unNb._HKjN8{right:0}._Hhfia ._q7QAb{position:absolute;width:6px;right:-3px;top:0;cursor:ew-resize;z-index:50}._Hhfia ._q7QAb ._p5lU9{position:absolute;width:2px;right:2px;top:0;bottom:0}._Hhfia ._q7QAb ._p5lU9._Lpib3{background-color:#0a6ed1}._Hhfia ._q7QAb:hover ._p5lU9:not(._Lpib3){background-color:#d9d9d9}._Hhfia ._WG7Ak{display:flex;flex-grow:1;align-items:center;min-width:0;padding:14px 46px 13px 12px}._Hhfia ._WG7Ak._41DVc{flex-direction:row-reverse;justify-content:flex-start}._Hhfia ._WG7Ak._41DVc ._CY8oB{margin:1px 7px 1px 1px}._Hhfia ._WG7Ak ._W0S6e{text-overflow:ellipsis;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;pointer-events:none;overflow-wrap:break-word;display:-webkit-box;-webkit-box-orient:vertical}._Hhfia ._WG7Ak ._CY8oB{margin:1px 1px 1px 7px;flex-shrink:0}._Hhfia ._JEiim{position:absolute;right:4px;top:calc(50% - 18px);flex-shrink:0}._Hhfia ._KrbvX{pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}._Hhfia:focus{outline:none}._Hhfia._Uu0GO.focus-visible:after,._Hhfia._Uu0GO:focus-visible:after,._Hhfia.focus-visible:after,._Hhfia:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._8zMRP{margin-right:6px}._xG5Tg{display:flex;border-right:3px solid #e5e5e5;position:-webkit-sticky;position:sticky;left:0;background-color:#fff;z-index:20}._xG5Tg[focus-within]{z-index:30}._xG5Tg:focus-within{z-index:30}._gvKwy{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #eee;flex-shrink:0;font-size:14px;line-height:20px;overflow-wrap:break-word;color:#32363a;position:relative}._gvKwy ._T8XX6{width:100%;padding:12px 12px 11px;overflow:hidden}._gvKwy._3h2pA{background-color:#efefef;border-bottom-color:#dfdfe1}._gvKwy._-Xr-a{flex-grow:1}._gvKwy:focus{outline:none}._gvKwy._Uu0GO.focus-visible:after,._gvKwy._Uu0GO:focus-visible:after,._gvKwy.focus-visible:after,._gvKwy:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-2px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._Zd1-m{display:flex!important;min-height:44px!important;align-items:center;justify-content:right;border-bottom:1px solid #eee;flex-shrink:0;position:relative}._Zd1-m._vgCdN{border-bottom-color:#d9d9d9;background-color:#fff}._iT5q0{display:flex;align-items:center;justify-content:center;min-height:44px;width:40px;border-bottom:1px solid #eee;padding:12px 12px 11px;flex-shrink:0;cursor:pointer}._iT5q0._vgCdN{border-bottom-color:#d9d9d9;padding:14px 12px 13px}._iT5q0:focus input~span,._iT5q0:hover input~span{border-color:#0b6ed0}._Liuyw{justify-content:flex-start}._5u0Uo{justify-content:center;text-align:center}._41DVc{justify-content:flex-end;text-align:right}._tP1KG{display:none}._dP1Os{opacity:0;height:0;width:0;overflow:hidden}._dP1Os,._M76J5{position:absolute}._M76J5{background-color:rgba(11,110,208,.08);border-radius:4px;z-index:1000}._-8H9W,._M76J5{cursor:move;pointer-events:none}._sQHHz{max-width:250px;min-width:150px!important}";
|
|
4
|
+
var styles = {"advancedTable":"_fyDh2","advancedTablePaginationContainer":"_6wL0I","advancedTablePagination":"_1u1Wa","advancedTableColumnHeadersRowGroup":"_I2A5i","advancedTableColumnHeaders":"_cfA3Z","advancedTableRowChild":"_Akyti","pinnedContainer":"_xG5Tg","advancedTableRowGroup":"_0sJPi","advancedTableRowRestrictedWidth":"_3CUs2","advancedTableRow":"_7Hf4E","hasRowAction":"_l0UtA","advancedTableExpandRowSpacer":"_Zd1-m","isSelected":"_gGnpW","advancedTableCheckbox":"_iT5q0","advancedTableCell":"_gvKwy","showFocusRing":"_Uu0GO","advancedTableColumnHeader":"_Hhfia","fillRemainingSpace":"_-Xr-a","isSortable":"_SHtqe","isDragging":"_3h2pA","isSorted":"_qW63x","dropTargetLine":"_BVEsg","dropTargetLeft":"_pt2hI","dropTargetRight":"_4unNb","dropTargetMarker":"_HKjN8","resizeHandle":"_q7QAb","resizeLine":"_p5lU9","isResizing":"_Lpib3","advancedTableColumnHeaderLabel":"_WG7Ak","rightAligned":"_41DVc","sortIcon":"_CY8oB","advancedTableColumnHeaderLabelText":"_W0S6e","advancedTableColumnHeaderMenu":"_JEiim","advancedTableColumnHeaderMenuHiddenAnchor":"_KrbvX","advancedTableColumnHeaderMenuItemIcon":"_8zMRP","advancedTableCellContainer":"_T8XX6","header":"_vgCdN","leftAligned":"_Liuyw","centerAligned":"_5u0Uo","hiddenDescription":"_tP1KG","hiddenLiveRegion":"_dP1Os","dragPreview":"_M76J5","isColumnDragging":"_-8H9W","rowActionMenuPane":"_sQHHz"};
|
|
5
|
+
var stylesheet="._fyDh2{overflow:auto;position:relative;max-width:100%;max-height:100%}._6wL0I,._fyDh2{background-color:#fff}._6wL0I{height:70px;z-index:100;display:flex;align-items:flex-end;justify-content:center;position:-webkit-sticky;position:sticky;left:0}._1u1Wa{margin-bottom:4px}._I2A5i{position:-webkit-sticky;position:sticky;top:0;z-index:100}._cfA3Z{display:flex}._cfA3Z:focus{outline:none}._cfA3Z.focus-visible ._Akyti:after,._cfA3Z:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._cfA3Z.focus-visible ._Akyti:last-of-type:after,._cfA3Z:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._cfA3Z.focus-visible ._Akyti:first-of-type:after,._cfA3Z:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._cfA3Z.focus-visible ._Akyti._xG5Tg:after,._cfA3Z:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:1px}._0sJPi{padding-right:3px}._3CUs2{max-width:100%;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._7Hf4E{display:flex}._7Hf4E._l0UtA ._Akyti,._7Hf4E._l0UtA ._Zd1-m{cursor:pointer}._7Hf4E._gGnpW ._Akyti,._7Hf4E._gGnpW ._Zd1-m{background-color:rgba(11,110,208,.08);font-weight:500;box-shadow:inset 0 -1px 0 0 #0b6ed0}._7Hf4E._gGnpW ._Akyti._xG5Tg,._7Hf4E._gGnpW ._Zd1-m._xG5Tg{background-color:#fff;box-shadow:inset 0 -2px 0 0 #0b6ed0}._7Hf4E._gGnpW ._Akyti._xG5Tg ._gvKwy,._7Hf4E._gGnpW ._Akyti._xG5Tg ._iT5q0,._7Hf4E._gGnpW ._Akyti._xG5Tg ._Zd1-m,._7Hf4E._gGnpW ._Zd1-m._xG5Tg ._gvKwy,._7Hf4E._gGnpW ._Zd1-m._xG5Tg ._iT5q0,._7Hf4E._gGnpW ._Zd1-m._xG5Tg ._Zd1-m{background-color:rgba(11,110,208,.08)}._7Hf4E._l0UtA:hover:not(._gGnpW) ._Akyti,._7Hf4E._l0UtA:hover:not(._gGnpW) ._Zd1-m{background-color:#f9f9f9}._7Hf4E._l0UtA:active:not(._gGnpW):not(._7Hf4E._l0UtA:active:not(._gGnpW):has(._iT5q0:active)) ._Akyti,._7Hf4E._l0UtA:active:not(._gGnpW):not(._7Hf4E._l0UtA:active:not(._gGnpW):has(._iT5q0:active)) ._Zd1-m{background-color:#f3f3f3}._7Hf4E:focus{outline:none}._7Hf4E.focus-visible ._Akyti:after,._7Hf4E:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._7Hf4E.focus-visible ._Akyti:last-of-type:after,._7Hf4E:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._7Hf4E.focus-visible ._Akyti:first-of-type:after,._7Hf4E:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._7Hf4E.focus-visible ._Akyti._xG5Tg:after,._7Hf4E:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:0}._7Hf4E:last-of-type:focus{outline:none}._7Hf4E:last-of-type.focus-visible ._Akyti:after,._7Hf4E:last-of-type:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:-2px;bottom:0;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._7Hf4E:last-of-type.focus-visible ._Akyti:last-of-type:after,._7Hf4E:last-of-type:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._7Hf4E:last-of-type.focus-visible ._Akyti:first-of-type:after,._7Hf4E:last-of-type:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._7Hf4E:last-of-type.focus-visible ._Akyti._xG5Tg:after,._7Hf4E:last-of-type:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:1px}._7Hf4E:last-of-type ._gvKwy:focus{outline:none}._7Hf4E:last-of-type ._gvKwy._Uu0GO.focus-visible:after,._7Hf4E:last-of-type ._gvKwy._Uu0GO:focus-visible:after,._7Hf4E:last-of-type ._gvKwy.focus-visible:after,._7Hf4E:last-of-type ._gvKwy:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._7Hf4E:first-of-type:focus{outline:none}._7Hf4E:first-of-type.focus-visible ._Akyti:after,._7Hf4E:first-of-type:focus-visible ._Akyti:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-bottom:2px solid #0a3f88;border-top:2px solid #0a3f88;z-index:50}._7Hf4E:first-of-type.focus-visible ._Akyti:last-of-type:after,._7Hf4E:first-of-type:focus-visible ._Akyti:last-of-type:after{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:2px solid #0a3f88}._7Hf4E:first-of-type.focus-visible ._Akyti:first-of-type:after,._7Hf4E:first-of-type:focus-visible ._Akyti:first-of-type:after{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left:2px solid #0a3f88}._7Hf4E:first-of-type.focus-visible ._Akyti._xG5Tg:after,._7Hf4E:first-of-type:focus-visible ._Akyti._xG5Tg:after{right:-3px;bottom:0}._7Hf4E:first-of-type ._gvKwy:focus{outline:none}._7Hf4E:first-of-type ._gvKwy._Uu0GO.focus-visible:after,._7Hf4E:first-of-type ._gvKwy._Uu0GO:focus-visible:after,._7Hf4E:first-of-type ._gvKwy.focus-visible:after,._7Hf4E:first-of-type ._gvKwy:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._Hhfia{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #d9d9d9;flex-shrink:0;font-size:12px;line-height:16px;font-weight:700;color:#6a6d70;background-color:#fff;position:relative}._Hhfia._-Xr-a{flex-grow:1}._Hhfia._SHtqe{cursor:pointer}._Hhfia._SHtqe:hover:not(._3h2pA){background-color:#f9f9f9;border-bottom-color:#6a6d70}._Hhfia._SHtqe:active:not(._3h2pA){background-color:#f3f3f3}._Hhfia._qW63x:not(._3h2pA){color:#32363a;fill:#32363a;border-bottom-color:#8a8f94}._Hhfia._3h2pA{cursor:move!important;background-color:#efefef;border-bottom-color:#ccc;border-top-left-radius:4px;border-top-right-radius:4px}._Hhfia ._BVEsg{background-color:#d9d9d9;position:absolute;width:1px;top:0;pointer-events:none}._Hhfia ._BVEsg._pt2hI{left:-1px}._Hhfia ._BVEsg._4unNb{right:0}._Hhfia ._HKjN8{background-color:#0a6ed1;position:absolute;width:3px;top:4px;bottom:4px;border-radius:4px;pointer-events:none}._Hhfia ._HKjN8._pt2hI{left:-2px}._Hhfia ._HKjN8._4unNb{right:-1px}._Hhfia:first-of-type ._pt2hI._BVEsg{left:0;width:2px;border-left:1px solid #fff}._Hhfia:first-of-type ._pt2hI._HKjN8{left:0}._Hhfia:last-of-type ._4unNb._BVEsg{right:0;width:2px;border-right:1px solid #fff}._Hhfia:last-of-type ._4unNb._HKjN8{right:0}._Hhfia ._q7QAb{position:absolute;width:6px;right:-3px;top:0;cursor:ew-resize;z-index:50}._Hhfia ._q7QAb ._p5lU9{position:absolute;width:2px;right:2px;top:0;bottom:0}._Hhfia ._q7QAb ._p5lU9._Lpib3{background-color:#0a6ed1}._Hhfia ._q7QAb:hover ._p5lU9:not(._Lpib3){background-color:#d9d9d9}._Hhfia ._WG7Ak{display:flex;flex-grow:1;align-items:center;min-width:0;padding:14px 46px 13px 12px}._Hhfia ._WG7Ak._41DVc{flex-direction:row-reverse;justify-content:flex-start}._Hhfia ._WG7Ak._41DVc ._CY8oB{margin:1px 7px 1px 1px}._Hhfia ._WG7Ak ._W0S6e{text-overflow:ellipsis;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;pointer-events:none;overflow-wrap:break-word;display:-webkit-box;-webkit-box-orient:vertical}._Hhfia ._WG7Ak ._CY8oB{margin:1px 1px 1px 7px;flex-shrink:0}._Hhfia ._JEiim{position:absolute;right:4px;top:calc(50% - 18px);flex-shrink:0}._Hhfia ._KrbvX{pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}._Hhfia:focus{outline:none}._Hhfia._Uu0GO.focus-visible:after,._Hhfia._Uu0GO:focus-visible:after,._Hhfia.focus-visible:after,._Hhfia:focus-visible:after{content:\"\";display:block;position:absolute;top:0;bottom:-1px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._8zMRP{margin-right:6px}._xG5Tg{display:flex;border-right:3px solid #e5e5e5;position:-webkit-sticky;position:sticky;left:0;background-color:#fff;z-index:20}._xG5Tg[focus-within]{z-index:30}._xG5Tg:focus-within{z-index:30}._gvKwy{display:flex;align-items:center;min-height:44px;width:200px;min-width:80px;border-bottom:1px solid #eee;flex-shrink:0;font-size:14px;line-height:20px;overflow-wrap:break-word;color:#32363a;position:relative}._gvKwy ._T8XX6{width:100%;padding:12px 12px 11px;overflow:hidden}._gvKwy._3h2pA{background-color:#efefef;border-bottom-color:#dfdfe1}._gvKwy._-Xr-a{flex-grow:1}._gvKwy:focus{outline:none}._gvKwy._Uu0GO.focus-visible:after,._gvKwy._Uu0GO:focus-visible:after,._gvKwy.focus-visible:after,._gvKwy:focus-visible:after{content:\"\";display:block;position:absolute;top:-2px;bottom:-2px;left:0;right:0;border-radius:2px;border:2px solid #0a3f88;z-index:10}._Zd1-m{display:flex!important;min-height:44px!important;align-items:center;justify-content:right;border-bottom:1px solid #eee;flex-shrink:0;position:relative}._Zd1-m._vgCdN{border-bottom-color:#d9d9d9;background-color:#fff}._iT5q0{display:flex;align-items:center;justify-content:center;min-height:44px;width:40px;border-bottom:1px solid #eee;padding:12px 12px 11px;flex-shrink:0;cursor:pointer}._iT5q0._vgCdN{border-bottom-color:#d9d9d9;padding:14px 12px 13px}._iT5q0:focus input~span,._iT5q0:hover input~span{border-color:#0b6ed0}._Liuyw{justify-content:flex-start}._5u0Uo{justify-content:center;text-align:center}._41DVc{justify-content:flex-end;text-align:right}._tP1KG{display:none}._dP1Os{opacity:0;height:0;width:0;overflow:hidden}._dP1Os,._M76J5{position:absolute}._M76J5{background-color:rgba(11,110,208,.08);border-radius:4px;z-index:1000}._-8H9W,._M76J5{cursor:move;pointer-events:none}._sQHHz{max-width:250px;min-width:150px!important}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -4,6 +4,7 @@ import styles from './AdvancedTable2.js';
|
|
|
4
4
|
import Check from '../../components/Checkbox/Check.js';
|
|
5
5
|
import '../../utils/index.js';
|
|
6
6
|
import '../../hooks/index.js';
|
|
7
|
+
import { useAdvancedTableDnDContext } from './AdvancedTableDnDContext.js';
|
|
7
8
|
import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
8
9
|
import useScreenReaderAnnouncement from '../../hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js';
|
|
9
10
|
|
|
@@ -21,6 +22,9 @@ const AdvancedTableCheckbox = _ref => {
|
|
|
21
22
|
const {
|
|
22
23
|
translate
|
|
23
24
|
} = useTranslation();
|
|
25
|
+
const {
|
|
26
|
+
isDragging
|
|
27
|
+
} = useAdvancedTableDnDContext();
|
|
24
28
|
const label = useMemo(() => {
|
|
25
29
|
const labels = {
|
|
26
30
|
true: translate('checked'),
|
|
@@ -39,7 +43,8 @@ const AdvancedTableCheckbox = _ref => {
|
|
|
39
43
|
"data-testid": dataTestId,
|
|
40
44
|
onClick: onClick,
|
|
41
45
|
className: classNames(styles.advancedTableCheckbox, className, {
|
|
42
|
-
[styles.header]: variant === 'header'
|
|
46
|
+
[styles.header]: variant === 'header',
|
|
47
|
+
[styles.isColumnDragging]: isDragging
|
|
43
48
|
}),
|
|
44
49
|
role: "presentation"
|
|
45
50
|
}, /*#__PURE__*/React__default.createElement(Check, {
|
|
@@ -10,6 +10,7 @@ import '../../icons/index.es.js';
|
|
|
10
10
|
import '../../utils/index.js';
|
|
11
11
|
import '../../hooks/index.js';
|
|
12
12
|
import useComputedWidth from './useComputedWidth.js';
|
|
13
|
+
import { useAdvancedTableDnDContext } from './AdvancedTableDnDContext.js';
|
|
13
14
|
import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
14
15
|
import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
15
16
|
import Tooltip from '../../components/Tooltip/Tooltip.js';
|
|
@@ -56,6 +57,9 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
56
57
|
const [ellipsisShown, setEllipsisShown] = useState();
|
|
57
58
|
const columnHeaderRef = useRef(null);
|
|
58
59
|
const labelContainerRef = useRef(null);
|
|
60
|
+
const {
|
|
61
|
+
isDragging: isUserDragging
|
|
62
|
+
} = useAdvancedTableDnDContext();
|
|
59
63
|
const isSortable = Boolean(sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length);
|
|
60
64
|
const isSorted = isSortable && selectedSortOption.columnId === id && selectedSortOption.index >= 0 && selectedSortOption.index < (sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length) && (selectedSortOption.direction === 'ascending' || selectedSortOption.direction === 'descending');
|
|
61
65
|
const selectedSortIndex = isSorted ? selectedSortOption.index : -1;
|
|
@@ -94,7 +98,8 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
94
98
|
const hasDraggableColumns = !disableUserPinnableColumns && !disableUserReorderableColumns && !isRowActionMenuColumn;
|
|
95
99
|
const {
|
|
96
100
|
dragRef,
|
|
97
|
-
dropRef
|
|
101
|
+
dropRef,
|
|
102
|
+
listeners
|
|
98
103
|
} = useDragAndDrop({
|
|
99
104
|
isEnabled: hasDraggableColumns,
|
|
100
105
|
id,
|
|
@@ -247,7 +252,7 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
247
252
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
248
253
|
content: label,
|
|
249
254
|
disabled: !ellipsisShown
|
|
250
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
255
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
251
256
|
role: "columnheader",
|
|
252
257
|
"data-testid": dataTestId,
|
|
253
258
|
"aria-rowindex": 1,
|
|
@@ -271,13 +276,15 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
271
276
|
[styles.isSorted]: isSorted,
|
|
272
277
|
[styles.showFocusRing]: isHiddenMenuOpen,
|
|
273
278
|
[styles.isDragging]: isDragging,
|
|
274
|
-
[styles.fillRemainingSpace]: width === undefined
|
|
279
|
+
[styles.fillRemainingSpace]: width === undefined,
|
|
280
|
+
[styles.isColumnDragging]: isUserDragging
|
|
275
281
|
}),
|
|
276
282
|
style: {
|
|
277
283
|
width: computedWidth
|
|
278
284
|
},
|
|
279
|
-
ref: mergeRefs(columnHeaderRef, dragRef, dropRef, ref)
|
|
280
|
-
|
|
285
|
+
ref: mergeRefs(columnHeaderRef, dragRef, dropRef, ref),
|
|
286
|
+
draggable: hasDraggableColumns
|
|
287
|
+
}, listeners), /*#__PURE__*/React__default.createElement("div", {
|
|
281
288
|
role: isSortable ? 'button' : undefined,
|
|
282
289
|
className: classNames(styles.advancedTableColumnHeaderLabel, {
|
|
283
290
|
[styles.leftAligned]: alignment === 'left',
|
|
@@ -298,7 +305,9 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
298
305
|
anchor: /*#__PURE__*/React__default.createElement(IconButton, {
|
|
299
306
|
tabIndex: -1,
|
|
300
307
|
"aria-hidden": "true",
|
|
301
|
-
className: styles.advancedTableColumnHeaderMenu
|
|
308
|
+
className: classNames(styles.advancedTableColumnHeaderMenu, {
|
|
309
|
+
[styles.isColumnDragging]: isUserDragging
|
|
310
|
+
})
|
|
302
311
|
}, /*#__PURE__*/React__default.createElement(ChevronDownIcon, null))
|
|
303
312
|
})), /*#__PURE__*/React__default.createElement(AdvancedTableColumnHeaderMenu, _extends({}, commonMenuProps, {
|
|
304
313
|
isOpen: isHiddenMenuOpen,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React__default, { createContext, useState, useMemo, useContext } from 'react';
|
|
2
|
+
import { DndContext } from '@dnd-kit/core';
|
|
3
|
+
import useDragAndDropConfig from './useDragAndDropConfig.js';
|
|
4
|
+
|
|
5
|
+
const defaultAdvancedTableDnDContext = {
|
|
6
|
+
isDragging: false,
|
|
7
|
+
setIsDragging: () => {}
|
|
8
|
+
};
|
|
9
|
+
const AdvancedTableDnDContext = /*#__PURE__*/createContext(defaultAdvancedTableDnDContext);
|
|
10
|
+
const AdvancedTableDnDContextProvider = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
children,
|
|
13
|
+
setColumnOrder,
|
|
14
|
+
setDropTargetSide,
|
|
15
|
+
setPinnedColumns,
|
|
16
|
+
setDropTarget,
|
|
17
|
+
setDragSource,
|
|
18
|
+
dropTargetSide
|
|
19
|
+
} = _ref;
|
|
20
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
21
|
+
const context = useMemo(() => ({
|
|
22
|
+
isDragging,
|
|
23
|
+
setIsDragging
|
|
24
|
+
}), [isDragging]);
|
|
25
|
+
const dndConfig = useDragAndDropConfig(setDragSource, setDropTarget, setDropTargetSide, setPinnedColumns, setColumnOrder, setIsDragging, dropTargetSide);
|
|
26
|
+
return /*#__PURE__*/React__default.createElement(AdvancedTableDnDContext.Provider, {
|
|
27
|
+
value: context
|
|
28
|
+
}, /*#__PURE__*/React__default.createElement(DndContext, dndConfig, children));
|
|
29
|
+
};
|
|
30
|
+
const useAdvancedTableDnDContext = () => useContext(AdvancedTableDnDContext);
|
|
31
|
+
|
|
32
|
+
export { AdvancedTableDnDContextProvider, useAdvancedTableDnDContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useDndContext } from '@dnd-kit/core';
|
|
3
3
|
import '../../utils/index.js';
|
|
4
4
|
import styles from './AdvancedTable2.js';
|
|
5
5
|
import Portal from '../../utils/Portal/Portal.js';
|
|
@@ -11,16 +11,14 @@ const AdvancedTableDragPreview = _ref => {
|
|
|
11
11
|
columnHeaderRefs
|
|
12
12
|
} = _ref;
|
|
13
13
|
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const top = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.y) || 0;
|
|
23
|
-
const left = (currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.x) || 0;
|
|
14
|
+
active
|
|
15
|
+
} = useDndContext();
|
|
16
|
+
const item = active === null || active === void 0 ? void 0 : active.data.current;
|
|
17
|
+
const position = active === null || active === void 0 ? void 0 : active.rect.current.translated;
|
|
18
|
+
const width = (columnHeaderRefs === null || columnHeaderRefs === void 0 || (_columnHeaderRefs$ite = columnHeaderRefs[item === null || item === void 0 ? void 0 : item.columnIndex]) === null || _columnHeaderRefs$ite === void 0 || (_columnHeaderRefs$ite = _columnHeaderRefs$ite.getBoundingClientRect()) === null || _columnHeaderRefs$ite === void 0 ? void 0 : _columnHeaderRefs$ite.width) || 0;
|
|
19
|
+
const height = ((_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 || (_tableRef$current = _tableRef$current.getBoundingClientRect()) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.height) || 0;
|
|
20
|
+
const top = ((position === null || position === void 0 ? void 0 : position.top) || 0) + window.scrollY;
|
|
21
|
+
const left = ((position === null || position === void 0 ? void 0 : position.left) || 0) + window.scrollX;
|
|
24
22
|
return /*#__PURE__*/React__default.createElement(Portal, null, /*#__PURE__*/React__default.createElement("div", {
|
|
25
23
|
className: styles.dragPreview,
|
|
26
24
|
style: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
1
|
+
import React__default, { useCallback, useMemo } from 'react';
|
|
2
2
|
import styles from './AdvancedTable2.js';
|
|
3
3
|
import '../../components/Pagination/index.js';
|
|
4
4
|
import Pagination from '../../components/Pagination/Pagination.js';
|
|
@@ -21,12 +21,29 @@ const AdvancedTablePagination = _ref => {
|
|
|
21
21
|
setCurrentPage(page);
|
|
22
22
|
onPageChange === null || onPageChange === void 0 || onPageChange(page);
|
|
23
23
|
};
|
|
24
|
+
const getExpandedChildren = useCallback(() => {
|
|
25
|
+
let count = 0;
|
|
26
|
+
const stack = [...rows];
|
|
27
|
+
while (stack.length > 0) {
|
|
28
|
+
const row = stack.pop();
|
|
29
|
+
if (!row) {
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
if (row.isExpanded) {
|
|
33
|
+
var _row$childRows;
|
|
34
|
+
count += ((_row$childRows = row.childRows) === null || _row$childRows === void 0 ? void 0 : _row$childRows.length) || 0;
|
|
35
|
+
stack.push(...(row.childRows || []));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return count;
|
|
39
|
+
}, [rows]);
|
|
40
|
+
const visibleRows = useMemo(() => rows.length + getExpandedChildren(), [getExpandedChildren, rows]);
|
|
24
41
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
25
42
|
className: styles.advancedTablePaginationContainer
|
|
26
43
|
}, /*#__PURE__*/React__default.createElement(Pagination, {
|
|
27
44
|
className: styles.advancedTablePagination,
|
|
28
45
|
"aria-label": ariaLabel,
|
|
29
|
-
numPages: Math.max(Math.ceil(
|
|
46
|
+
numPages: Math.max(Math.ceil(visibleRows / rowsPerPage), 1),
|
|
30
47
|
currentPage: currentPage,
|
|
31
48
|
onPageChange: handlePageChange,
|
|
32
49
|
"data-testid": dataTestId
|
|
@@ -2,6 +2,7 @@ import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
|
2
2
|
import React__default, { forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import styles from './AdvancedTable2.js';
|
|
5
|
+
import { useAdvancedTableDnDContext } from './AdvancedTableDnDContext.js';
|
|
5
6
|
|
|
6
7
|
const AdvancedTableRow = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
7
8
|
let {
|
|
@@ -17,6 +18,9 @@ const AdvancedTableRow = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
17
18
|
children,
|
|
18
19
|
...rest
|
|
19
20
|
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
isDragging
|
|
23
|
+
} = useAdvancedTableDnDContext();
|
|
20
24
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
21
25
|
role: "row",
|
|
22
26
|
"data-testid": dataTestId,
|
|
@@ -28,7 +32,8 @@ const AdvancedTableRow = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
28
32
|
className: classNames(styles.advancedTableRow, {
|
|
29
33
|
[styles.hasRowAction]: hasOnRowSelect,
|
|
30
34
|
[styles.isSelected]: hasOnRowSelect && isSelected,
|
|
31
|
-
[styles.advancedTableRowRestrictedWidth]: restrictedWidth
|
|
35
|
+
[styles.advancedTableRowRestrictedWidth]: restrictedWidth,
|
|
36
|
+
[styles.isColumnDragging]: isDragging
|
|
32
37
|
}),
|
|
33
38
|
ref: isFocusable ? ref : undefined
|
|
34
39
|
}), children);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
1
|
+
import React__default, { useMemo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
2
3
|
import '../../utils/index.js';
|
|
3
4
|
import '../../icons/index.es.js';
|
|
4
5
|
import '../../components/index.js';
|
|
6
|
+
import { useAdvancedTableDnDContext } from './AdvancedTableDnDContext.js';
|
|
5
7
|
import iconButtonStyles from '../../components/IconButton/IconButton2.js';
|
|
6
8
|
import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
7
9
|
import Tooltip from '../../components/Tooltip/Tooltip.js';
|
|
@@ -18,17 +20,24 @@ const AdvancedTableRowExpandButton = _ref => {
|
|
|
18
20
|
const {
|
|
19
21
|
translate
|
|
20
22
|
} = useTranslation();
|
|
23
|
+
const {
|
|
24
|
+
isDragging
|
|
25
|
+
} = useAdvancedTableDnDContext();
|
|
21
26
|
const state = isRowExpanded ? 'expanded' : 'collapsed';
|
|
22
27
|
const labels = {
|
|
23
28
|
expanded: translate('advancedTable.collapseRow'),
|
|
24
29
|
collapsed: translate('advancedTable.expandRow')
|
|
25
30
|
};
|
|
31
|
+
const buttonClasses = useMemo(() => classNames(iconButtonStyles.button, {
|
|
32
|
+
[iconButtonStyles.disabled]: isDragging
|
|
33
|
+
}), [isDragging]);
|
|
26
34
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
27
35
|
onClick: onClick
|
|
28
36
|
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
29
|
-
content: labels[state]
|
|
37
|
+
content: labels[state],
|
|
38
|
+
disabled: isDragging
|
|
30
39
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
31
|
-
className:
|
|
40
|
+
className: buttonClasses,
|
|
32
41
|
"data-testid": dataTestId,
|
|
33
42
|
role: "presentation"
|
|
34
43
|
}, state === 'expanded' ? /*#__PURE__*/React__default.createElement(CaretDownIcon, {
|