@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
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { getEmptyImage } from 'react-dnd-html5-backend';
|
|
4
|
-
import '../../hooks/index.js';
|
|
5
|
-
import useLatest from '../../hooks/useLatest/useLatest.js';
|
|
2
|
+
import { useDraggable, useDroppable } from '@dnd-kit/core';
|
|
6
3
|
|
|
7
4
|
const useDragAndDrop = _ref => {
|
|
8
5
|
let {
|
|
@@ -12,143 +9,37 @@ const useDragAndDrop = _ref => {
|
|
|
12
9
|
columnIndex,
|
|
13
10
|
columnHeaderRef,
|
|
14
11
|
isPinned,
|
|
15
|
-
setPinnedColumns,
|
|
16
|
-
setColumnOrder,
|
|
17
|
-
setDragSource,
|
|
18
12
|
setDropTarget,
|
|
19
|
-
dropTargetSide,
|
|
20
13
|
setDropTargetSide
|
|
21
14
|
} = _ref;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setDropTarget('');
|
|
35
|
-
setDropTargetSide(undefined);
|
|
36
|
-
},
|
|
37
|
-
canDrag: () => isEnabled,
|
|
38
|
-
options: {
|
|
39
|
-
dropEffect: 'move'
|
|
15
|
+
const {
|
|
16
|
+
setNodeRef: dragRef,
|
|
17
|
+
listeners
|
|
18
|
+
} = useDraggable({
|
|
19
|
+
id,
|
|
20
|
+
disabled: !isEnabled,
|
|
21
|
+
data: {
|
|
22
|
+
type: tableId,
|
|
23
|
+
isPinned,
|
|
24
|
+
columnIndex,
|
|
25
|
+
id,
|
|
26
|
+
columnHeaderRef
|
|
40
27
|
}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _monitor$getClientOff, _columnHeaderRef$curr;
|
|
57
|
-
const {
|
|
58
|
-
id: dragSourceId,
|
|
59
|
-
columnIndex: dragSourceColumnIndex,
|
|
60
|
-
isPinned: dragSourceIsPinned
|
|
61
|
-
} = item;
|
|
62
|
-
setDropTarget(id);
|
|
63
|
-
if (id === dragSourceId) {
|
|
64
|
-
setDropTargetSide(undefined);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Calculate which column line is closest
|
|
69
|
-
const dropX = (_monitor$getClientOff = monitor.getClientOffset()) === null || _monitor$getClientOff === void 0 ? void 0 : _monitor$getClientOff.x;
|
|
70
|
-
const {
|
|
71
|
-
x,
|
|
72
|
-
width
|
|
73
|
-
} = (_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.getBoundingClientRect();
|
|
74
|
-
const diffLeft = Math.abs(dropX - x) || 0;
|
|
75
|
-
const diffRight = Math.abs(dropX - (x + width)) || 0;
|
|
76
|
-
if (diffLeft < diffRight) {
|
|
77
|
-
// hover over left side
|
|
78
|
-
if (columnIndex - dragSourceColumnIndex === 1 && isPinned === dragSourceIsPinned) {
|
|
79
|
-
setDropTargetSide(undefined);
|
|
80
|
-
} else {
|
|
81
|
-
setDropTargetSide('left');
|
|
82
|
-
}
|
|
83
|
-
} else if (diffLeft >= diffRight) {
|
|
84
|
-
// hover over right side
|
|
85
|
-
if (dragSourceColumnIndex - columnIndex === 1 && isPinned === dragSourceIsPinned) {
|
|
86
|
-
setDropTargetSide(undefined);
|
|
87
|
-
} else {
|
|
88
|
-
setDropTargetSide('right');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
drop: item => {
|
|
93
|
-
const {
|
|
94
|
-
id: dragSourceId,
|
|
95
|
-
columnIndex: dragSourceColumnIndex,
|
|
96
|
-
isPinned: dragSourceIsPinned
|
|
97
|
-
} = item;
|
|
98
|
-
if (id === dragSourceId || dropTargetSideRef.current === undefined) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (isPinned && !dragSourceIsPinned) {
|
|
102
|
-
// Dragging from an unpinned column onto a pinned column
|
|
103
|
-
setPinnedColumns(pinnedColumns => {
|
|
104
|
-
const newPinnedColumns = [...pinnedColumns];
|
|
105
|
-
const newIndex = dropTargetSideRef.current === 'right' ? columnIndex + 1 : columnIndex;
|
|
106
|
-
newPinnedColumns.splice(newIndex, 0, dragSourceId);
|
|
107
|
-
return newPinnedColumns;
|
|
108
|
-
});
|
|
109
|
-
} else if (!isPinned && dragSourceIsPinned) {
|
|
110
|
-
// Dragging from a pinned column onto an upinned column
|
|
111
|
-
setPinnedColumns(pinnedColumns => {
|
|
112
|
-
const newPinnedColumns = [...pinnedColumns];
|
|
113
|
-
newPinnedColumns.splice(dragSourceColumnIndex, 1);
|
|
114
|
-
return newPinnedColumns;
|
|
115
|
-
});
|
|
116
|
-
setColumnOrder(currentColumnOrder => {
|
|
117
|
-
const newColumnOrder = [...currentColumnOrder];
|
|
118
|
-
const dragSourceColumnOrderIndex = newColumnOrder.indexOf(dragSourceId);
|
|
119
|
-
newColumnOrder.splice(dragSourceColumnOrderIndex, 1);
|
|
120
|
-
const columnOrderIndex = newColumnOrder.indexOf(id);
|
|
121
|
-
const newIndex = dropTargetSideRef.current === 'right' ? columnOrderIndex + 1 : columnOrderIndex;
|
|
122
|
-
newColumnOrder.splice(newIndex, 0, dragSourceId);
|
|
123
|
-
return newColumnOrder;
|
|
124
|
-
});
|
|
125
|
-
} else if (isPinned) {
|
|
126
|
-
// Dragging from a pinned column onto a pinned column
|
|
127
|
-
setPinnedColumns(pinnedColumns => {
|
|
128
|
-
const newPinnedColumns = [...pinnedColumns];
|
|
129
|
-
newPinnedColumns.splice(dragSourceColumnIndex, 1);
|
|
130
|
-
const newIndex = dropTargetSideRef.current === 'right' ? columnIndex + 1 : columnIndex;
|
|
131
|
-
newPinnedColumns.splice(newIndex, 0, dragSourceId);
|
|
132
|
-
return newPinnedColumns;
|
|
133
|
-
});
|
|
134
|
-
} else {
|
|
135
|
-
// Dragging from an upinned column onto an upinned column
|
|
136
|
-
setColumnOrder(currentColumnOrder => {
|
|
137
|
-
const newColumnOrder = [...currentColumnOrder];
|
|
138
|
-
const dropIndex = newColumnOrder.indexOf(dragSourceId);
|
|
139
|
-
newColumnOrder.splice(dropIndex, 1);
|
|
140
|
-
const columnOrderIndex = newColumnOrder.indexOf(id);
|
|
141
|
-
const newIndex = dropTargetSideRef.current === 'right' ? columnOrderIndex + 1 : columnOrderIndex;
|
|
142
|
-
newColumnOrder.splice(newIndex, 0, dragSourceId);
|
|
143
|
-
return newColumnOrder;
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
canDrop: () => isEnabled,
|
|
148
|
-
collect: monitor => ({
|
|
149
|
-
isOver: monitor.isOver()
|
|
150
|
-
})
|
|
151
|
-
}), [id, tableId, isPinned, columnIndex, isEnabled, setDropTarget, dropTargetSideRef, setDropTargetSide]);
|
|
28
|
+
});
|
|
29
|
+
const {
|
|
30
|
+
isOver,
|
|
31
|
+
setNodeRef: dropRef
|
|
32
|
+
} = useDroppable({
|
|
33
|
+
id,
|
|
34
|
+
disabled: !isEnabled,
|
|
35
|
+
data: {
|
|
36
|
+
type: tableId,
|
|
37
|
+
isPinned,
|
|
38
|
+
columnIndex,
|
|
39
|
+
id,
|
|
40
|
+
columnHeaderRef
|
|
41
|
+
}
|
|
42
|
+
});
|
|
152
43
|
|
|
153
44
|
// Clear dropTarget when header is no longer being hovered
|
|
154
45
|
useEffect(() => {
|
|
@@ -164,7 +55,8 @@ const useDragAndDrop = _ref => {
|
|
|
164
55
|
}, [id, isOver, setDropTarget, setDropTargetSide]);
|
|
165
56
|
return {
|
|
166
57
|
dragRef,
|
|
167
|
-
dropRef
|
|
58
|
+
dropRef,
|
|
59
|
+
listeners
|
|
168
60
|
};
|
|
169
61
|
};
|
|
170
62
|
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useSensors, useSensor, MouseSensor, pointerWithin, getClientRect, MeasuringStrategy, MeasuringFrequency } from '@dnd-kit/core';
|
|
3
|
+
import { restrictToWindowEdges } from '@dnd-kit/modifiers';
|
|
4
|
+
import '../../hooks/index.js';
|
|
5
|
+
import useLatest from '../../hooks/useLatest/useLatest.js';
|
|
6
|
+
|
|
7
|
+
const useDragAndDropConfig = (setDragSource, setDropTarget, setDropTargetSide, setPinnedColumns, setColumnOrder, setIsDragging, dropTargetSide) => {
|
|
8
|
+
const dropTargetSideRef = useLatest(dropTargetSide);
|
|
9
|
+
const [initSourcePos, setInitSourcePos] = useState(0);
|
|
10
|
+
const dragAndDropMonitorConfig = {
|
|
11
|
+
onDragStart: event => {
|
|
12
|
+
var _event$active$data$cu, _event$active;
|
|
13
|
+
setDragSource((_event$active$data$cu = event.active.data.current) === null || _event$active$data$cu === void 0 ? void 0 : _event$active$data$cu.id);
|
|
14
|
+
setIsDragging(true);
|
|
15
|
+
const {
|
|
16
|
+
x
|
|
17
|
+
} = ((_event$active = event.active) === null || _event$active === void 0 || (_event$active = _event$active.data.current) === null || _event$active === void 0 || (_event$active = _event$active.columnHeaderRef) === null || _event$active === void 0 || (_event$active = _event$active.current) === null || _event$active === void 0 ? void 0 : _event$active.getBoundingClientRect()) || {
|
|
18
|
+
x: 0
|
|
19
|
+
};
|
|
20
|
+
setInitSourcePos(x);
|
|
21
|
+
},
|
|
22
|
+
onDragCancel: () => {
|
|
23
|
+
setDragSource('');
|
|
24
|
+
setDropTarget('');
|
|
25
|
+
setDropTargetSide(undefined);
|
|
26
|
+
setIsDragging(false);
|
|
27
|
+
},
|
|
28
|
+
onDragEnd: event => {
|
|
29
|
+
setDragSource('');
|
|
30
|
+
setDropTarget('');
|
|
31
|
+
setDropTargetSide(undefined);
|
|
32
|
+
setIsDragging(false);
|
|
33
|
+
const {
|
|
34
|
+
active,
|
|
35
|
+
over
|
|
36
|
+
} = event;
|
|
37
|
+
if (!over) return;
|
|
38
|
+
const {
|
|
39
|
+
id: dragSourceId,
|
|
40
|
+
columnIndex: dragSourceColumnIndex,
|
|
41
|
+
isPinned: dragSourceIsPinned
|
|
42
|
+
} = active.data.current;
|
|
43
|
+
const {
|
|
44
|
+
id,
|
|
45
|
+
columnIndex,
|
|
46
|
+
isPinned
|
|
47
|
+
} = over.data.current;
|
|
48
|
+
if (id === dragSourceId || dropTargetSideRef.current === undefined) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (isPinned && !dragSourceIsPinned) {
|
|
52
|
+
// Dragging from an unpinned column onto a pinned column
|
|
53
|
+
setPinnedColumns(pinnedColumns => {
|
|
54
|
+
const newPinnedColumns = [...pinnedColumns];
|
|
55
|
+
const newIndex = dropTargetSideRef.current === 'right' ? columnIndex + 1 : columnIndex;
|
|
56
|
+
newPinnedColumns.splice(newIndex, 0, dragSourceId);
|
|
57
|
+
return newPinnedColumns;
|
|
58
|
+
});
|
|
59
|
+
} else if (!isPinned && dragSourceIsPinned) {
|
|
60
|
+
// Dragging from a pinned column onto an upinned column
|
|
61
|
+
setPinnedColumns(pinnedColumns => {
|
|
62
|
+
const newPinnedColumns = [...pinnedColumns];
|
|
63
|
+
newPinnedColumns.splice(dragSourceColumnIndex, 1);
|
|
64
|
+
return newPinnedColumns;
|
|
65
|
+
});
|
|
66
|
+
setColumnOrder(currentColumnOrder => {
|
|
67
|
+
const newColumnOrder = [...currentColumnOrder];
|
|
68
|
+
const dragSourceColumnOrderIndex = newColumnOrder.indexOf(dragSourceId);
|
|
69
|
+
newColumnOrder.splice(dragSourceColumnOrderIndex, 1);
|
|
70
|
+
const columnOrderIndex = newColumnOrder.indexOf(id);
|
|
71
|
+
const newIndex = dropTargetSideRef.current === 'right' ? columnOrderIndex + 1 : columnOrderIndex;
|
|
72
|
+
newColumnOrder.splice(newIndex, 0, dragSourceId);
|
|
73
|
+
return newColumnOrder;
|
|
74
|
+
});
|
|
75
|
+
} else if (isPinned) {
|
|
76
|
+
// Dragging from a pinned column onto a pinned column
|
|
77
|
+
setPinnedColumns(pinnedColumns => {
|
|
78
|
+
const newPinnedColumns = [...pinnedColumns];
|
|
79
|
+
newPinnedColumns.splice(dragSourceColumnIndex, 1);
|
|
80
|
+
const newIndex = dropTargetSideRef.current === 'right' ? columnIndex + 1 : columnIndex;
|
|
81
|
+
newPinnedColumns.splice(newIndex, 0, dragSourceId);
|
|
82
|
+
return newPinnedColumns;
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
// Dragging from an upinned column onto an upinned column
|
|
86
|
+
setColumnOrder(currentColumnOrder => {
|
|
87
|
+
const newColumnOrder = [...currentColumnOrder];
|
|
88
|
+
const dropIndex = newColumnOrder.indexOf(dragSourceId);
|
|
89
|
+
newColumnOrder.splice(dropIndex, 1);
|
|
90
|
+
const columnOrderIndex = newColumnOrder.indexOf(id);
|
|
91
|
+
const newIndex = dropTargetSideRef.current === 'right' ? columnOrderIndex + 1 : columnOrderIndex;
|
|
92
|
+
newColumnOrder.splice(newIndex, 0, dragSourceId);
|
|
93
|
+
return newColumnOrder;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
onDragMove: event => {
|
|
98
|
+
var _columnHeaderRef$curr, _DragSourceRef$curren;
|
|
99
|
+
const {
|
|
100
|
+
active,
|
|
101
|
+
over,
|
|
102
|
+
activatorEvent,
|
|
103
|
+
delta
|
|
104
|
+
} = event;
|
|
105
|
+
if (!over) return;
|
|
106
|
+
const {
|
|
107
|
+
id: dragSourceId,
|
|
108
|
+
columnIndex: dragSourceColumnIndex,
|
|
109
|
+
isPinned: dragSourceIsPinned,
|
|
110
|
+
columnHeaderRef: DragSourceRef
|
|
111
|
+
} = active.data.current;
|
|
112
|
+
const {
|
|
113
|
+
id,
|
|
114
|
+
columnIndex,
|
|
115
|
+
isPinned,
|
|
116
|
+
columnHeaderRef
|
|
117
|
+
} = over.data.current;
|
|
118
|
+
setDropTarget(id);
|
|
119
|
+
if (id === dragSourceId) {
|
|
120
|
+
setDropTargetSide(undefined);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Calculate which column line is closest
|
|
125
|
+
const {
|
|
126
|
+
x: targetX,
|
|
127
|
+
width: targetWidth
|
|
128
|
+
} = (columnHeaderRef === null || columnHeaderRef === void 0 || (_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.getBoundingClientRect()) || {
|
|
129
|
+
x: 0,
|
|
130
|
+
width: 0
|
|
131
|
+
};
|
|
132
|
+
const {
|
|
133
|
+
x: sourceX
|
|
134
|
+
} = (DragSourceRef === null || DragSourceRef === void 0 || (_DragSourceRef$curren = DragSourceRef.current) === null || _DragSourceRef$curren === void 0 ? void 0 : _DragSourceRef$curren.getBoundingClientRect()) || {
|
|
135
|
+
x: 0
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Getting scroll position based on initial and current position
|
|
139
|
+
const scrollOffset = sourceX - initSourcePos;
|
|
140
|
+
const {
|
|
141
|
+
clientX: startPosition
|
|
142
|
+
} = activatorEvent;
|
|
143
|
+
const dropX = startPosition + delta.x;
|
|
144
|
+
const diffLeft = Math.abs(dropX - targetX + scrollOffset) || 0;
|
|
145
|
+
const diffRight = Math.abs(dropX - (targetX + targetWidth) + scrollOffset) || 0;
|
|
146
|
+
if (diffLeft < diffRight) {
|
|
147
|
+
// hover over left side
|
|
148
|
+
if (columnIndex - dragSourceColumnIndex === 1 && isPinned === dragSourceIsPinned) {
|
|
149
|
+
setDropTargetSide(undefined);
|
|
150
|
+
} else {
|
|
151
|
+
setDropTargetSide('left');
|
|
152
|
+
}
|
|
153
|
+
} else if (diffLeft >= diffRight) {
|
|
154
|
+
// hover over right side
|
|
155
|
+
if (dragSourceColumnIndex - columnIndex === 1 && isPinned === dragSourceIsPinned) {
|
|
156
|
+
setDropTargetSide(undefined);
|
|
157
|
+
} else {
|
|
158
|
+
setDropTargetSide('right');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const sensors = useSensors(useSensor(MouseSensor, {
|
|
164
|
+
activationConstraint: {
|
|
165
|
+
distance: 1
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
return {
|
|
169
|
+
...dragAndDropMonitorConfig,
|
|
170
|
+
sensors,
|
|
171
|
+
collisionDetection: pointerWithin,
|
|
172
|
+
modifiers: [restrictToWindowEdges],
|
|
173
|
+
measuring: {
|
|
174
|
+
droppable: {
|
|
175
|
+
measure: element => getClientRect(element, {
|
|
176
|
+
ignoreTransform: false
|
|
177
|
+
}),
|
|
178
|
+
strategy: MeasuringStrategy.WhileDragging,
|
|
179
|
+
frequency: MeasuringFrequency.Optimized
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
accessibility: {
|
|
183
|
+
screenReaderInstructions: {
|
|
184
|
+
draggable: 'draggable'
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
autoscroll: false
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export { useDragAndDropConfig as default };
|
|
@@ -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 = {"collapsibleSearchInput":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._f62SN{display:inline-block;width:36px;transition:width .25s ease-out}._yE1sX{width:100%}._tGbIu>input{padding-right:0!important}._q0wsE>svg{fill:#515559}";
|
|
4
|
+
var styles = {"collapsibleSearchInput":"_f62SN","searchInput":"_yE1sX","searchInputCollapsed":"_tGbIu","iconButton":"_q0wsE"};
|
|
5
|
+
var stylesheet="._f62SN{display:inline-block;width:36px;transition:width .25s ease-out}._yE1sX{width:100%}._tGbIu>input{padding-right:0!important}._q0wsE>svg{fill:#515559}";
|
|
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 };
|
|
@@ -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 = {"loadingSpinner":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._7owOs :after{background-color:#515559!important}._Hy24t>input:focus{box-shadow:none!important;border:1px solid #898989!important}._azZky{max-width:500px;padding:4px 0;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._azZky ._qWwqG ._E-H1m{display:flex;align-items:center;min-height:40px;padding:10px 12px;color:#32363a;font-size:12px;line-height:16px;font-weight:700;word-break:break-word}._azZky ._qWwqG:first-child ._GlXby{display:none}._azZky ._kJkDh{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._azZky ._kJkDh:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._azZky ._kJkDh:hover._XV1sf{background-color:#e4effa}._azZky ._kJkDh._XV1sf{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._azZky ._kJkDh:active:not(._XV1sf){background-color:#e8e9e9}";
|
|
4
|
+
var styles = {"loadingSpinner":"_7owOs","ignoreFocusStyle":"_Hy24t","flyout":"_azZky","group":"_qWwqG","header":"_E-H1m","divider":"_GlXby","option":"_kJkDh","selected":"_XV1sf"};
|
|
5
|
+
var stylesheet="._7owOs :after{background-color:#515559!important}._Hy24t>input:focus{box-shadow:none!important;border:1px solid #898989!important}._azZky{max-width:500px;padding:4px 0;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._azZky ._qWwqG ._E-H1m{display:flex;align-items:center;min-height:40px;padding:10px 12px;color:#32363a;font-size:12px;line-height:16px;font-weight:700;word-break:break-word}._azZky ._qWwqG:first-child ._GlXby{display:none}._azZky ._kJkDh{display:flex;align-items:center;min-height:40px;padding:10px 12px;font-size:14px;color:#32363a;word-break:break-word;outline:none;cursor:pointer}._azZky ._kJkDh:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._azZky ._kJkDh:hover._XV1sf{background-color:#e4effa}._azZky ._kJkDh._XV1sf{background-color:#ebf3fb;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._azZky ._kJkDh:active:not(._XV1sf){background-color:#e8e9e9}";
|
|
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 };
|
|
@@ -95,7 +95,7 @@ const Drawer = _ref => {
|
|
|
95
95
|
const containerNode = (_containerRef$current = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _containerRef$current !== void 0 ? _containerRef$current : document.body;
|
|
96
96
|
|
|
97
97
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
98
|
-
return domReady ? /*#__PURE__*/createPortal(
|
|
98
|
+
return domReady ? /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement("aside", {
|
|
99
99
|
id: drawerId,
|
|
100
100
|
className: classNames(styles.drawer, {
|
|
101
101
|
[styles.hidden]: isHidden,
|
|
@@ -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 = {"drawer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._4WDwr{position:absolute;top:0;height:100%;overflow:auto;color:#32363a;background-color:#fff;border-right:1px solid #eee;z-index:1000;padding:12px 20px 20px;transition:left .5s}._9mqZN{visibility:hidden}._tPDby{position:fixed}._qOD4V{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._PjcqS{padding-top:8px}._mAQkJ{margin-left:12px}";
|
|
4
|
+
var styles = {"drawer":"_4WDwr","hidden":"_9mqZN","anchoredToBody":"_tPDby","header":"_qOD4V","title":"_PjcqS","closeButton":"_mAQkJ"};
|
|
5
|
+
var stylesheet="._4WDwr{position:absolute;top:0;height:100%;overflow:auto;color:#32363a;background-color:#fff;border-right:1px solid #eee;z-index:1000;padding:12px 20px 20px;transition:left .5s}._9mqZN{visibility:hidden}._tPDby{position:fixed}._qOD4V{display:flex;justify-content:space-between;align-items:start;line-height:20px;font-size:16px;padding-bottom:12px}._PjcqS{padding-top:8px}._mAQkJ{margin-left:12px}";
|
|
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 };
|
|
@@ -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 = {"button":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._R1-wZ{display:flex;justify-content:space-between;align-items:center;max-width:100%;min-width:76px;height:36px;padding:0 6px 0 12px;outline:none;font-size:14px;background-color:#fff;border:1px solid #898989;border-radius:20px;cursor:pointer}._R1-wZ:hover:not(._mMaM3){background-color:rgba(50,54,58,.08)}._R1-wZ:hover:not(._mMaM3)._gqXkM{border-color:#085caf;background-color:rgba(11,110,208,.04)}._R1-wZ:hover:not(._mMaM3)._gqXkM ._I2M7U{color:#32363a}._R1-wZ:hover:not(._mMaM3)._gqXkM ._nTneZ{fill:#32363a}._R1-wZ:hover:not(._mMaM3)._gqXkM ._bdxHJ{fill:#085caf}._R1-wZ:hover:not(._mMaM3)._gqXkM ._kYQjY{background-color:rgba(11,110,208,.11)}._R1-wZ:hover:not(._mMaM3)._gqXkM ._kYQjY ._m3IZg{color:#085caf}._R1-wZ:active:not(._mMaM3){background-color:#e8e9e9}._R1-wZ:active:not(._mMaM3)._gqXkM{background-color:rgba(11,110,208,.11);border-color:#0854a1}._R1-wZ:active:not(._mMaM3)._gqXkM ._bdxHJ{fill:#0854a1}._R1-wZ:active:not(._mMaM3)._gqXkM ._kYQjY{background-color:rgba(11,110,208,.11)}._R1-wZ:active:not(._mMaM3)._gqXkM ._kYQjY ._m3IZg{color:#0854a1}._R1-wZ._mMaM3{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._R1-wZ._gqXkM{border-color:#0b6ed0}._nTneZ{fill:#515559;margin-right:4px}._I2M7U{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._I2M7U+._kYQjY{margin-left:6px}._I2M7U._mMaM3{color:#74777a}._kYQjY{display:flex;justify-content:center;align-items:center;max-width:350px;flex:1;min-width:0;height:24px;margin-right:3px;padding:0 10px;background-color:#ebf3fb;border-radius:20px}._m3IZg{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._bdxHJ{fill:#515559}._bdxHJ._mMaM3,._bdxHJ._mMaM3._gqXkM{fill:rgba(116,119,122,.4)}._bdxHJ._gqXkM{fill:#0b6ed0}._bdxHJ._DX0ZU{transform:rotate(-180deg)}._R1-wZ.focus-visible,._R1-wZ:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"button":"_R1-wZ","disabled":"_mMaM3","selected":"_gqXkM","label":"_I2M7U","lockIcon":"_nTneZ","chevronIcon":"_bdxHJ","selectedFiltersContainer":"_kYQjY","selectedFilters":"_m3IZg","open":"_DX0ZU"};
|
|
5
|
+
var stylesheet="._R1-wZ{display:flex;justify-content:space-between;align-items:center;max-width:100%;min-width:76px;height:36px;padding:0 6px 0 12px;outline:none;font-size:14px;background-color:#fff;border:1px solid #898989;border-radius:20px;cursor:pointer}._R1-wZ:hover:not(._mMaM3){background-color:rgba(50,54,58,.08)}._R1-wZ:hover:not(._mMaM3)._gqXkM{border-color:#085caf;background-color:rgba(11,110,208,.04)}._R1-wZ:hover:not(._mMaM3)._gqXkM ._I2M7U{color:#32363a}._R1-wZ:hover:not(._mMaM3)._gqXkM ._nTneZ{fill:#32363a}._R1-wZ:hover:not(._mMaM3)._gqXkM ._bdxHJ{fill:#085caf}._R1-wZ:hover:not(._mMaM3)._gqXkM ._kYQjY{background-color:rgba(11,110,208,.11)}._R1-wZ:hover:not(._mMaM3)._gqXkM ._kYQjY ._m3IZg{color:#085caf}._R1-wZ:active:not(._mMaM3){background-color:#e8e9e9}._R1-wZ:active:not(._mMaM3)._gqXkM{background-color:rgba(11,110,208,.11);border-color:#0854a1}._R1-wZ:active:not(._mMaM3)._gqXkM ._bdxHJ{fill:#0854a1}._R1-wZ:active:not(._mMaM3)._gqXkM ._kYQjY{background-color:rgba(11,110,208,.11)}._R1-wZ:active:not(._mMaM3)._gqXkM ._kYQjY ._m3IZg{color:#0854a1}._R1-wZ._mMaM3{background-color:#fafafa;border-color:#e5e5e5;cursor:not-allowed}._R1-wZ._gqXkM{border-color:#0b6ed0}._nTneZ{fill:#515559;margin-right:4px}._I2M7U{max-width:180px;margin-right:3px;color:#515559;fill:#515559;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._I2M7U+._kYQjY{margin-left:6px}._I2M7U._mMaM3{color:#74777a}._kYQjY{display:flex;justify-content:center;align-items:center;max-width:350px;flex:1;min-width:0;height:24px;margin-right:3px;padding:0 10px;background-color:#ebf3fb;border-radius:20px}._m3IZg{color:#0b6ed0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._bdxHJ{fill:#515559}._bdxHJ._mMaM3,._bdxHJ._mMaM3._gqXkM{fill:rgba(116,119,122,.4)}._bdxHJ._gqXkM{fill:#0b6ed0}._bdxHJ._DX0ZU{transform:rotate(-180deg)}._R1-wZ.focus-visible,._R1-wZ:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
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 };
|
|
@@ -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 = {"input":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._YuwKo{margin:6px 0}._vMtds{line-height:20px;color:#515559;display:flex;margin-bottom:4px}._p26zG{display:inline-block}._p26zG:has([aria-expanded=true]) ._vMtds,._p26zG[focus-within] ._vMtds{color:#0b6ed0}._p26zG:focus-within ._vMtds,._p26zG:has([aria-expanded=true]) ._vMtds{color:#0b6ed0}._p26zG:has(input:disabled) ._vMtds{color:rgba(50,54,58,.4)}._p26zG:not(:has(input:disabled)) ._vMtds{cursor:pointer}._kaPF1{margin-top:4px}._kaPF1:first-of-type{margin-top:6px}";
|
|
4
|
+
var styles = {"input":"_YuwKo","label":"_vMtds","formFieldWrapper":"_p26zG","caption":"_kaPF1"};
|
|
5
|
+
var stylesheet="._YuwKo{margin:6px 0}._vMtds{line-height:20px;color:#515559;display:flex;margin-bottom:4px}._p26zG{display:inline-block}._p26zG:has([aria-expanded=true]) ._vMtds,._p26zG[focus-within] ._vMtds{color:#0b6ed0}._p26zG:focus-within ._vMtds,._p26zG:has([aria-expanded=true]) ._vMtds{color:#0b6ed0}._p26zG:has(input:disabled) ._vMtds{color:rgba(50,54,58,.4)}._p26zG:not(:has(input:disabled)) ._vMtds{cursor:pointer}._kaPF1{margin-top:4px}._kaPF1:first-of-type{margin-top:6px}";
|
|
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 };
|
|
@@ -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 inputClasses = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._LMewa{position:relative;display:inline-block;height:36px;width:100%}._pIrit{width:100%;height:100%;padding:8px 12px;color:#32363a;caret-color:#32363a;font-size:14px;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._pIrit:hover{cursor:pointer;background-color:#f5f5f5}._pIrit:focus{background-color:#fafafa;cursor:text;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;outline:none;border-color:transparent}._pIrit:disabled,._pIrit[aria-disabled=true]{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._pIrit:disabled::-moz-placeholder,._pIrit[aria-disabled=true]::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._pIrit:disabled::placeholder,._pIrit[aria-disabled=true]::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._pIrit:invalid,._pIrit[aria-invalid=true]{border-color:#b00}._pIrit:invalid:focus,._pIrit[aria-invalid=true]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._pIrit[type=number]{-moz-appearance:textfield}._pIrit[type=number]::-webkit-inner-spin-button,._pIrit[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._pIrit::-moz-placeholder{color:#515559;opacity:1}._pIrit::placeholder{color:#515559;opacity:1}._NQ3w4{pointer-events:none;color:#515559;fill:#515559}._HB07K{display:flex;flex-direction:column;align-items:center;position:absolute;top:50%;transform:translateY(-50%)}._iQZ2r{color:#515559;font-size:16px}._X7SLx{left:0;margin-left:6px}._q9235,._X7SLx{pointer-events:none;color:#515559;fill:#515559;display:flex;flex-direction:column;align-items:center;position:absolute;top:50%;transform:translateY(-50%)}._q9235{right:0;margin-right:6px}";
|
|
4
|
+
var inputClasses = {"container":"_LMewa","input":"_pIrit","addOn":"_NQ3w4","addOnVerticalCenter":"_HB07K","addOnTextNode":"_iQZ2r","leftAddOn":"_X7SLx","rightAddOn":"_q9235"};
|
|
5
|
+
var stylesheet="._LMewa{position:relative;display:inline-block;height:36px;width:100%}._pIrit{width:100%;height:100%;padding:8px 12px;color:#32363a;caret-color:#32363a;font-size:14px;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._pIrit:hover{cursor:pointer;background-color:#f5f5f5}._pIrit:focus{background-color:#fafafa;cursor:text;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;outline:none;border-color:transparent}._pIrit:disabled,._pIrit[aria-disabled=true]{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._pIrit:disabled::-moz-placeholder,._pIrit[aria-disabled=true]::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._pIrit:disabled::placeholder,._pIrit[aria-disabled=true]::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._pIrit:invalid,._pIrit[aria-invalid=true]{border-color:#b00}._pIrit:invalid:focus,._pIrit[aria-invalid=true]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._pIrit[type=number]{-moz-appearance:textfield}._pIrit[type=number]::-webkit-inner-spin-button,._pIrit[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._pIrit::-moz-placeholder{color:#515559;opacity:1}._pIrit::placeholder{color:#515559;opacity:1}._NQ3w4{pointer-events:none;color:#515559;fill:#515559}._HB07K{display:flex;flex-direction:column;align-items:center;position:absolute;top:50%;transform:translateY(-50%)}._iQZ2r{color:#515559;font-size:16px}._X7SLx{left:0;margin-left:6px}._q9235,._X7SLx{pointer-events:none;color:#515559;fill:#515559;display:flex;flex-direction:column;align-items:center;position:absolute;top:50%;transform:translateY(-50%)}._q9235{right:0;margin-right:6px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { inputClasses as default, stylesheet };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { useMemo,
|
|
1
|
+
import React__default, { useMemo, useState, useCallback, useRef, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import '../../../hooks/index.js';
|
|
4
4
|
import '../../../utils/index.js';
|
|
@@ -16,7 +16,6 @@ import useEventListener from '../../../hooks/useEventListener/useEventListener.j
|
|
|
16
16
|
// creates a searchBarConfig, which maps to an instance of `MenuSearch`
|
|
17
17
|
// returns values that are necessary for use within pane
|
|
18
18
|
function usePaneSearch(_ref) {
|
|
19
|
-
var _searchRef$current$qu, _searchRef$current;
|
|
20
19
|
let {
|
|
21
20
|
isSearchable,
|
|
22
21
|
externalSearchValue,
|
|
@@ -52,8 +51,13 @@ function usePaneSearch(_ref) {
|
|
|
52
51
|
return searchMatcher === null || searchMatcher === void 0 || (_searchMatcher$toLowe = searchMatcher.toLowerCase) === null || _searchMatcher$toLowe === void 0 ? void 0 : _searchMatcher$toLowe.call(searchMatcher).includes(internalSearchValue.toLowerCase());
|
|
53
52
|
}), [internalSearchValue, children, isSearchFilteringDisabled]);
|
|
54
53
|
const focusVirtualBoundary = useFocusVirtualBoundary(items, backButtonRef);
|
|
55
|
-
const
|
|
56
|
-
const
|
|
54
|
+
const [searchInput, setSearchInput] = useState(null);
|
|
55
|
+
const [searchElement, setSearchElement] = useState(null);
|
|
56
|
+
const searchRef = useCallback(node => {
|
|
57
|
+
var _node$querySelector;
|
|
58
|
+
setSearchElement(node);
|
|
59
|
+
setSearchInput((_node$querySelector = node === null || node === void 0 ? void 0 : node.querySelector('input')) !== null && _node$querySelector !== void 0 ? _node$querySelector : null);
|
|
60
|
+
}, []);
|
|
57
61
|
const getFirstVisibleItem = () => {
|
|
58
62
|
var _backButtonRef$curren, _items$find;
|
|
59
63
|
return (_backButtonRef$curren = backButtonRef === null || backButtonRef === void 0 ? void 0 : backButtonRef.current) !== null && _backButtonRef$curren !== void 0 ? _backButtonRef$curren : (_items$find = items.find(item => item.element.current)) === null || _items$find === void 0 ? void 0 : _items$find.element.current;
|
|
@@ -111,8 +115,8 @@ function usePaneSearch(_ref) {
|
|
|
111
115
|
setSearchBarConfigs
|
|
112
116
|
} = useMenuContext();
|
|
113
117
|
const onInteractOutside = useCallback(e => searchBarConfigs.some(config => {
|
|
114
|
-
var _config$
|
|
115
|
-
return (_config$
|
|
118
|
+
var _config$searchElement;
|
|
119
|
+
return (_config$searchElement = config.searchElement) === null || _config$searchElement === void 0 ? void 0 : _config$searchElement.contains(e.target);
|
|
116
120
|
}) && e.preventDefault(), [searchBarConfigs]);
|
|
117
121
|
useEffect(() => {
|
|
118
122
|
if (!isSearchable) {
|
|
@@ -128,6 +132,7 @@ function usePaneSearch(_ref) {
|
|
|
128
132
|
dataTestId: menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_SEARCH : DATA_TESTID_SUFFIXES$1.MENU_SEARCH),
|
|
129
133
|
setSearchValue,
|
|
130
134
|
ref: searchRef,
|
|
135
|
+
searchElement,
|
|
131
136
|
id,
|
|
132
137
|
searchPlaceholder
|
|
133
138
|
};
|
|
@@ -139,7 +144,7 @@ function usePaneSearch(_ref) {
|
|
|
139
144
|
}
|
|
140
145
|
return configsClone;
|
|
141
146
|
});
|
|
142
|
-
}, [isSearchable, searchPlaceholder, setSearchBarConfigs, internalSearchValue, animatedLeft, animatedRight, menuParentDataTestId, setSearchValue, searchRef, id, withinSelect]);
|
|
147
|
+
}, [isSearchable, searchPlaceholder, setSearchBarConfigs, internalSearchValue, animatedLeft, animatedRight, menuParentDataTestId, setSearchValue, searchRef, searchElement, id, withinSelect]);
|
|
143
148
|
useEffect(() => () => setSearchBarConfigs(configs => {
|
|
144
149
|
const configIndex = configs.findIndex(config => config.id === id);
|
|
145
150
|
if (configIndex === -1) {
|
package/dist/next/Menu/Menu2.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 = {"buttonContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._GRPXB{position:relative;display:inline-flex;height:36px;min-width:60px;cursor:pointer}._GRPXB>._QX753{cursor:unset;width:100%;height:100%;padding:0 28px 0 12px;border-radius:4px;white-space:nowrap;line-height:20px;font-size:14px;text-align:left;outline:none;border:none;box-shadow:inset 0 0 0 1px #898989;color:#515559;background-color:#fafafa;overflow:hidden;text-overflow:ellipsis}._GRPXB>._QX753:hover:not([aria-disabled=true]){background-color:#f5f5f5}._GRPXB>._QX753.focus-visible,._GRPXB>._QX753:focus-visible{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._GRPXB>._QX753+._XnIaX{fill:#515559;position:absolute;pointer-events:none;right:4px;top:50%;transform:translateY(-50%)}._GRPXB>._QX753[data-state=open]+._XnIaX{transform:rotate(-180deg) translateY(50%)}._GRPXB>._QX753[aria-disabled=true]{color:#74777a;cursor:not-allowed}._GRPXB>._QX753[aria-disabled=true]+._XnIaX{fill:#515559;opacity:.4}._uY2OG>[data-radix-popper-content-wrapper]{overflow:hidden;min-width:auto!important;background-color:#fff;max-width:350px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);border-radius:4px;z-index:var(--mask-z-index)!important;width:var(--mask-width);height:var(--mask-height);transition:height .35s,width .35s}._uY2OG>[data-radix-popper-content-wrapper] [data-radix-popper-content-wrapper]{transform:translateZ(0)!important}._PJEXu{margin:0;padding-bottom:var(--flyout-bottom-padding);background:#fff;transition:margin-left .35s,opacity .35s,height .35s,width .35s;opacity:1;max-width:350px;width:-webkit-max-content;width:-moz-max-content;width:max-content;min-width:200px;max-height:var(--flyout-max-height)}._PJEXu ._AgIvq{height:100%;overflow-y:scroll}._PJEXu._ck-V-{margin-left:30px;opacity:0}._PJEXu._jDbBx{margin-left:-30px}._y1CwJ{position:relative;padding:10px 12px;display:flex;flex-direction:row;min-height:40px;align-items:center;cursor:pointer;outline:none;word-break:break-word;font-size:14px;color:#32363a;width:100%}._y1CwJ._iFuZj{cursor:unset}._y1CwJ ._3YXFe{fill:#32363a;margin-right:4px}._y1CwJ:focus,._y1CwJ:hover:not(._y1CwJ._iFuZj){background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._y1CwJ[aria-disabled=true]{cursor:not-allowed;opacity:.65}._y1CwJ._fxOjz{padding-right:32px}._y1CwJ._fxOjz ._XnIaX{position:absolute;height:100%;right:3px;fill:#515559}._y1CwJ._z80Dd{pointer-events:none}._wd4Ds{position:-webkit-sticky;position:sticky;top:0;background-color:#fff;border-bottom:1px solid #e8e8e8}._wd4Ds._80klI{padding-top:52px}._1Lioa{pointer-events:none;position:fixed;left:0;top:0;transition:width .35s;min-width:200px;width:var(--mask-width);max-width:350px}._8VVoV{position:absolute;padding:8px;border-radius:4px 4px 0 0;pointer-events:auto;opacity:1;width:100%;transition:opacity .35s,margin-left .35s}._8VVoV._jDbBx{opacity:0}._8VVoV._jDbBx>._LXgbA{margin-left:-30px}._8VVoV._ck-V-{opacity:0}._8VVoV._ck-V->._LXgbA{margin-left:30px}._8VVoV>._LXgbA{transition:margin-left .35s;width:100%}._8VVoV._z80Dd{pointer-events:none}body.keyboard-user ._y1CwJ:hover:not(:focus){background-color:#fff;box-shadow:none}";
|
|
4
|
+
var styles = {"buttonContainer":"_GRPXB","button":"_QX753","rightIcon":"_XnIaX","maskContainer":"_uY2OG","flyout":"_PJEXu","scrollContainer":"_AgIvq","animatedRight":"_ck-V-","animatedLeft":"_jDbBx","menuItem":"_y1CwJ","noItems":"_iFuZj","backIcon":"_3YXFe","subMenu":"_fxOjz","unresponsive":"_z80Dd","stickyBox":"_wd4Ds","isSearchable":"_80klI","searchBoxesContainer":"_1Lioa","searchBox":"_8VVoV","searchInput":"_LXgbA"};
|
|
5
|
+
var stylesheet="._GRPXB{position:relative;display:inline-flex;height:36px;min-width:60px;cursor:pointer}._GRPXB>._QX753{cursor:unset;width:100%;height:100%;padding:0 28px 0 12px;border-radius:4px;white-space:nowrap;line-height:20px;font-size:14px;text-align:left;outline:none;border:none;box-shadow:inset 0 0 0 1px #898989;color:#515559;background-color:#fafafa;overflow:hidden;text-overflow:ellipsis}._GRPXB>._QX753:hover:not([aria-disabled=true]){background-color:#f5f5f5}._GRPXB>._QX753.focus-visible,._GRPXB>._QX753:focus-visible{background-color:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._GRPXB>._QX753+._XnIaX{fill:#515559;position:absolute;pointer-events:none;right:4px;top:50%;transform:translateY(-50%)}._GRPXB>._QX753[data-state=open]+._XnIaX{transform:rotate(-180deg) translateY(50%)}._GRPXB>._QX753[aria-disabled=true]{color:#74777a;cursor:not-allowed}._GRPXB>._QX753[aria-disabled=true]+._XnIaX{fill:#515559;opacity:.4}._uY2OG>[data-radix-popper-content-wrapper]{overflow:hidden;min-width:auto!important;background-color:#fff;max-width:350px;box-shadow:0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);border-radius:4px;z-index:var(--mask-z-index)!important;width:var(--mask-width);height:var(--mask-height);transition:height .35s,width .35s}._uY2OG>[data-radix-popper-content-wrapper] [data-radix-popper-content-wrapper]{transform:translateZ(0)!important}._PJEXu{margin:0;padding-bottom:var(--flyout-bottom-padding);background:#fff;transition:margin-left .35s,opacity .35s,height .35s,width .35s;opacity:1;max-width:350px;width:-webkit-max-content;width:-moz-max-content;width:max-content;min-width:200px;max-height:var(--flyout-max-height)}._PJEXu ._AgIvq{height:100%;overflow-y:scroll}._PJEXu._ck-V-{margin-left:30px;opacity:0}._PJEXu._jDbBx{margin-left:-30px}._y1CwJ{position:relative;padding:10px 12px;display:flex;flex-direction:row;min-height:40px;align-items:center;cursor:pointer;outline:none;word-break:break-word;font-size:14px;color:#32363a;width:100%}._y1CwJ._iFuZj{cursor:unset}._y1CwJ ._3YXFe{fill:#32363a;margin-right:4px}._y1CwJ:focus,._y1CwJ:hover:not(._y1CwJ._iFuZj){background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._y1CwJ[aria-disabled=true]{cursor:not-allowed;opacity:.65}._y1CwJ._fxOjz{padding-right:32px}._y1CwJ._fxOjz ._XnIaX{position:absolute;height:100%;right:3px;fill:#515559}._y1CwJ._z80Dd{pointer-events:none}._wd4Ds{position:-webkit-sticky;position:sticky;top:0;background-color:#fff;border-bottom:1px solid #e8e8e8}._wd4Ds._80klI{padding-top:52px}._1Lioa{pointer-events:none;position:fixed;left:0;top:0;transition:width .35s;min-width:200px;width:var(--mask-width);max-width:350px}._8VVoV{position:absolute;padding:8px;border-radius:4px 4px 0 0;pointer-events:auto;opacity:1;width:100%;transition:opacity .35s,margin-left .35s}._8VVoV._jDbBx{opacity:0}._8VVoV._jDbBx>._LXgbA{margin-left:-30px}._8VVoV._ck-V-{opacity:0}._8VVoV._ck-V->._LXgbA{margin-left:30px}._8VVoV>._LXgbA{transition:margin-left .35s;width:100%}._8VVoV._z80Dd{pointer-events:none}body.keyboard-user ._y1CwJ:hover:not(:focus){background-color:#fff;box-shadow:none}";
|
|
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 };
|