@qualtrics/ui-react 2.49.1-alpha.0 → 2.50.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 +16 -0
- package/dist/__shared/cjs/{index-65fe6015.js → index-19ecf96e.js} +224 -215
- package/dist/__shared/cjs/{index-43c0270d.js → index-e9e9ae0e.js} +20 -4
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +13 -9
- 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 +39 -33
- package/dist/components/Combobox/Combobox.js +1 -1
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane.js +6 -5
- 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 +6 -4
- package/dist/components/Dropdown/DropdownSearch.js +2 -6
- 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/Icon/IconTypes.js +4 -0
- 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 +6 -5
- 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/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 +2 -0
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +2 -2
- 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/components/AsynchronousJobsIcon.js +6 -0
- package/dist/icons/components/CircleEmptyIcon.js +6 -0
- package/dist/icons/components/InformationIcon.js +1 -1
- package/dist/icons/components/MobileAppInterceptIcon.js +6 -0
- package/dist/icons/components/MobileAppSessionReplayIcon.js +6 -0
- package/dist/icons/index.d.ts +10 -0
- package/dist/icons/index.es.js +4 -0
- package/dist/icons/index.js +5 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +6 -8
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +1 -6
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +6 -15
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +11 -9
- package/dist/next/AdvancedTable/AdvancedTableRow.js +1 -6
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +3 -12
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +138 -30
- 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 +7 -12
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +0 -1
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +2 -1
- 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 +12 -14
- package/dist/next/index.js +162 -298
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Text/Text.js +1 -1
- package/dist/utils/Translation/containsComponentOrElement.js +3 -6
- package/dist/utils/Translation/useTranslation.js +1 -5
- package/icons/package.json +10 -10
- package/next/package.json +11 -11
- package/package.json +41 -41
- package/dist/next/AdvancedTable/AdvancedTableDnDContext.js +0 -32
- package/dist/next/AdvancedTable/useDragAndDropConfig.js +0 -191
|
@@ -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 = {"flyout":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._gP-6A{background-color:#fff;border-radius:4px;border:4px solid transparent;border-right:none;border-left:none;box-shadow:0 0 0 1px #eee,0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;max-width:500px;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._z-3Qr{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;cursor:pointer;font-size:14px;color:#32363a;word-break:break-word;outline:none}._z-3Qr._-udPN._z-3Qr:hover,._z-3Qr._jlNbT{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._z-3Qr._G-8d9{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._z-3Qr._G-8d9._-udPN._z-3Qr._G-8d9:hover,._z-3Qr._G-8d9._jlNbT{background-color:#e4effa}._z-3Qr:active:not(._G-8d9):not([aria-disabled=true]){background-color:#e8e9e9}._YR0uV ._4vrvd{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;font-size:12px;color:#32363a;font-weight:700;word-break:break-word}._YR0uV ._lOEPP{display:none}._YR0uV:not(:first-child) ._lOEPP{display:block;margin:3.5px 0}._Wm7-G{width:100%;height:40px}";
|
|
4
|
+
var styles = {"flyout":"_gP-6A","flyoutOption":"_z-3Qr","highlighted":"_jlNbT","hoverHighlight":"_-udPN","selected":"_G-8d9","flyoutHeader":"_YR0uV","headerContent":"_4vrvd","headerDivider":"_lOEPP","flyoutSpinner":"_Wm7-G"};
|
|
5
|
+
var stylesheet="._gP-6A{background-color:#fff;border-radius:4px;border:4px solid transparent;border-right:none;border-left:none;box-shadow:0 0 0 1px #eee,0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;max-width:500px;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._z-3Qr{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;cursor:pointer;font-size:14px;color:#32363a;word-break:break-word;outline:none}._z-3Qr._-udPN._z-3Qr:hover,._z-3Qr._jlNbT{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._z-3Qr._G-8d9{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._z-3Qr._G-8d9._-udPN._z-3Qr._G-8d9:hover,._z-3Qr._G-8d9._jlNbT{background-color:#e4effa}._z-3Qr:active:not(._G-8d9):not([aria-disabled=true]){background-color:#e8e9e9}._YR0uV ._4vrvd{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;font-size:12px;color:#32363a;font-weight:700;word-break:break-word}._YR0uV ._lOEPP{display:none}._YR0uV:not(:first-child) ._lOEPP{display:block;margin:3.5px 0}._Wm7-G{width:100%;height:40px}";
|
|
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/utils/Text/Text.js
CHANGED
|
@@ -26,7 +26,7 @@ const Text = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
26
26
|
lightTheme: lightTheme,
|
|
27
27
|
delayMs: delayMs,
|
|
28
28
|
"aria-hidden": true
|
|
29
|
-
}, willClone ? (/*#__PURE__*/React__default.cloneElement(children, {
|
|
29
|
+
}, willClone ? ( /*#__PURE__*/React__default.cloneElement(children, {
|
|
30
30
|
className: classNames(className, children.props.className),
|
|
31
31
|
ref: mergeRefs(children.ref, ref, internalRef)
|
|
32
32
|
})) : /*#__PURE__*/React__default.createElement("div", _extends({
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { isValidElement } from 'react';
|
|
2
2
|
|
|
3
3
|
function isClassComponent(component) {
|
|
4
|
-
return typeof component === 'function' &&
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
-
// @ts-expect-error
|
|
7
|
-
!!component.prototype.isReactComponent;
|
|
4
|
+
return !!(typeof component === 'function' && !!component.prototype.isReactComponent);
|
|
8
5
|
}
|
|
9
6
|
function isFunctionComponent(component) {
|
|
10
|
-
return typeof component === 'function' && String(component).includes('return React.createElement');
|
|
7
|
+
return !!(typeof component === 'function' && String(component).includes('return React.createElement'));
|
|
11
8
|
}
|
|
12
9
|
function isReactComponent(component) {
|
|
13
|
-
return isClassComponent(component) || isFunctionComponent(component);
|
|
10
|
+
return !!(isClassComponent(component) || isFunctionComponent(component));
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
/**
|
|
@@ -29,11 +29,7 @@ const useTranslation = () => {
|
|
|
29
29
|
const fallbackText = fallbackLocalizedText[key];
|
|
30
30
|
if (!translatedText && !HAS_ERROR_BEEN_LOGGED_FOR_KEY.has(key)) {
|
|
31
31
|
HAS_ERROR_BEEN_LOGGED_FOR_KEY.add(key);
|
|
32
|
-
|
|
33
|
-
console.warn(NO_LOCALIZED_TEXT_FOR_KEY(key));
|
|
34
|
-
} else {
|
|
35
|
-
console.warn(NO_LOCALIZED_OR_FALLBACK_TEXT_FOR_KEY(key));
|
|
36
|
-
}
|
|
32
|
+
fallbackText ? console.warn(NO_LOCALIZED_TEXT_FOR_KEY(key)) : console.warn(NO_LOCALIZED_OR_FALLBACK_TEXT_FOR_KEY(key));
|
|
37
33
|
}
|
|
38
34
|
const text = translatedText || fallbackText;
|
|
39
35
|
if (text && placeholders) {
|
package/icons/package.json
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
"types": "../dist/icons/index.d.ts",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@babel/runtime-corejs3": "^7.24.7",
|
|
7
|
-
"@dnd-kit/core": "6.1.0",
|
|
8
|
-
"@dnd-kit/modifiers": "7.0.0",
|
|
9
7
|
"@juggle/resize-observer": "^3.4.0",
|
|
10
|
-
"@popperjs/core": "^2.
|
|
11
|
-
"@qualtrics/component-styles": "0.
|
|
8
|
+
"@popperjs/core": "^2.10.2",
|
|
9
|
+
"@qualtrics/component-styles": "0.151.0",
|
|
12
10
|
"@radix-ui/react-dropdown-menu": "2.0.6",
|
|
13
|
-
"@react-aria/interactions": "^3.
|
|
11
|
+
"@react-aria/interactions": "^3.15.1",
|
|
14
12
|
"@react-hook/resize-observer": "^1.2.6",
|
|
15
|
-
"@vanilla-extract/css": "^1.
|
|
16
|
-
"classnames": "^2.
|
|
17
|
-
"core-js": "^3.
|
|
13
|
+
"@vanilla-extract/css": "^1.9.1",
|
|
14
|
+
"classnames": "^2.2.6",
|
|
15
|
+
"core-js": "^3.6.5",
|
|
18
16
|
"libphonenumber-js": "^1.9.50",
|
|
19
17
|
"react-aria": "^3.33.1",
|
|
20
|
-
"react-
|
|
18
|
+
"react-dnd": "^15.1.1",
|
|
19
|
+
"react-dnd-html5-backend": "^15.1.2",
|
|
20
|
+
"react-focus-lock": "^2.11.2",
|
|
21
21
|
"react-input-mask": "^2.0.4",
|
|
22
|
-
"react-popper": "^2.
|
|
22
|
+
"react-popper": "^2.2.4",
|
|
23
23
|
"react-virtuoso": "4.7.13",
|
|
24
24
|
"throttle-debounce": "^2.1.0",
|
|
25
25
|
"uuid": "^8.3.2"
|
package/next/package.json
CHANGED
|
@@ -4,27 +4,27 @@
|
|
|
4
4
|
"types": "../dist/next/index.d.ts",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@babel/runtime-corejs3": "^7.24.7",
|
|
7
|
-
"@dnd-kit/core": "6.1.0",
|
|
8
|
-
"@dnd-kit/modifiers": "7.0.0",
|
|
9
7
|
"@juggle/resize-observer": "^3.4.0",
|
|
10
|
-
"@popperjs/core": "^2.
|
|
11
|
-
"@qualtrics/component-styles": "0.
|
|
8
|
+
"@popperjs/core": "^2.10.2",
|
|
9
|
+
"@qualtrics/component-styles": "0.151.0",
|
|
12
10
|
"@radix-ui/react-dropdown-menu": "2.0.6",
|
|
13
|
-
"@react-aria/interactions": "^3.
|
|
11
|
+
"@react-aria/interactions": "^3.15.1",
|
|
14
12
|
"@react-hook/resize-observer": "^1.2.6",
|
|
15
|
-
"@vanilla-extract/css": "^1.
|
|
16
|
-
"classnames": "^2.
|
|
17
|
-
"core-js": "^3.
|
|
13
|
+
"@vanilla-extract/css": "^1.9.1",
|
|
14
|
+
"classnames": "^2.2.6",
|
|
15
|
+
"core-js": "^3.6.5",
|
|
18
16
|
"libphonenumber-js": "^1.9.50",
|
|
19
17
|
"react-aria": "^3.33.1",
|
|
20
|
-
"react-
|
|
18
|
+
"react-dnd": "^15.1.1",
|
|
19
|
+
"react-dnd-html5-backend": "^15.1.2",
|
|
20
|
+
"react-focus-lock": "^2.11.2",
|
|
21
21
|
"react-input-mask": "^2.0.4",
|
|
22
|
-
"react-popper": "^2.
|
|
22
|
+
"react-popper": "^2.2.4",
|
|
23
23
|
"react-virtuoso": "4.7.13",
|
|
24
24
|
"throttle-debounce": "^2.1.0",
|
|
25
25
|
"uuid": "^8.3.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@qualtrics/ui-react": "2.
|
|
28
|
+
"@qualtrics/ui-react": "2.50.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qualtrics/ui-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.50.0",
|
|
4
4
|
"description": "Official Qualtrics UI component library designed for React",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"prettier": "prettier --check .",
|
|
55
55
|
"prettier:fix": "prettier --write .",
|
|
56
56
|
"start": "rollup -c -w",
|
|
57
|
-
"test": "
|
|
57
|
+
"test": "npm run test:unit && npm run test:postbuild",
|
|
58
58
|
"test:ci": "NODE_ENV=test npm run test:unit:ci",
|
|
59
59
|
"test:unit": "jest",
|
|
60
60
|
"test:unit:ci": "npm run test:unit -- --silent",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"test:postbuild:forceupdate": "RERUN=1 FORCESNAPSHOTUPDATE=1 jest --config jest.postbuild.config.js -u",
|
|
66
66
|
"precypress": "sh fix-cypress-reporter.sh && npm run test:cypress:clean",
|
|
67
67
|
"cypress": "./run-cypress-docker.sh",
|
|
68
|
-
"test:cypress": "npm run cypress run --
|
|
69
|
-
"test:cypress:interactive": "sh fix-cypress-reporter.sh && cypress open --
|
|
70
|
-
"test:cypress:ci": "sh fix-cypress-reporter.sh && CI_ENV=1 NO_COLOR=1 cypress run --
|
|
71
|
-
"test:cypress:visual": "
|
|
72
|
-
"test:cypress:visual:update": "
|
|
68
|
+
"test:cypress": "npm run cypress run-ct --config-file cypress.ci.json --headless --browser chrome",
|
|
69
|
+
"test:cypress:interactive": "sh fix-cypress-reporter.sh && cypress open-ct --config-file cypress.ui.json --headless --browser chrome",
|
|
70
|
+
"test:cypress:ci": "sh fix-cypress-reporter.sh && CI_ENV=1 NO_COLOR=1 cypress run-ct --config-file cypress.ci.json --headless --browser chrome",
|
|
71
|
+
"test:cypress:visual": "npm run cypress -- run-ct --config-file cypress.visual.json --headless --browser chrome",
|
|
72
|
+
"test:cypress:visual:update": "npm run cypress -- run-ct --config-file cypress.update.json --headless --browser chrome",
|
|
73
73
|
"test:cypress:clean": "rimraf cypress/snapshots/actual/* && rimraf cypress/snapshots/diff/*",
|
|
74
74
|
"types": "run-s types:generate types:build types:replace-react-jsx-namespace types:clean",
|
|
75
75
|
"types:generate": "run-p types:generate:*",
|
|
@@ -100,22 +100,22 @@
|
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"@babel/runtime-corejs3": "^7.24.7",
|
|
103
|
-
"@dnd-kit/core": "6.1.0",
|
|
104
|
-
"@dnd-kit/modifiers": "7.0.0",
|
|
105
103
|
"@juggle/resize-observer": "^3.4.0",
|
|
106
|
-
"@popperjs/core": "^2.
|
|
107
|
-
"@qualtrics/component-styles": "0.
|
|
104
|
+
"@popperjs/core": "^2.10.2",
|
|
105
|
+
"@qualtrics/component-styles": "0.151.0",
|
|
108
106
|
"@radix-ui/react-dropdown-menu": "2.0.6",
|
|
109
|
-
"@react-aria/interactions": "^3.
|
|
107
|
+
"@react-aria/interactions": "^3.15.1",
|
|
110
108
|
"@react-hook/resize-observer": "^1.2.6",
|
|
111
|
-
"@vanilla-extract/css": "^1.
|
|
112
|
-
"classnames": "^2.
|
|
113
|
-
"core-js": "^3.
|
|
109
|
+
"@vanilla-extract/css": "^1.9.1",
|
|
110
|
+
"classnames": "^2.2.6",
|
|
111
|
+
"core-js": "^3.6.5",
|
|
114
112
|
"libphonenumber-js": "^1.9.50",
|
|
115
113
|
"react-aria": "^3.33.1",
|
|
116
|
-
"react-
|
|
114
|
+
"react-dnd": "^15.1.1",
|
|
115
|
+
"react-dnd-html5-backend": "^15.1.2",
|
|
116
|
+
"react-focus-lock": "^2.11.2",
|
|
117
117
|
"react-input-mask": "^2.0.4",
|
|
118
|
-
"react-popper": "^2.
|
|
118
|
+
"react-popper": "^2.2.4",
|
|
119
119
|
"react-virtuoso": "4.7.13",
|
|
120
120
|
"throttle-debounce": "^2.1.0",
|
|
121
121
|
"uuid": "^8.3.2"
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"@babel/preset-env": "^7.24.7",
|
|
128
128
|
"@babel/preset-react": "^7.24.7",
|
|
129
129
|
"@babel/preset-typescript": "^7.24.7",
|
|
130
|
-
"@cypress/code-coverage": "^3.
|
|
131
|
-
"@cypress/
|
|
132
|
-
"@cypress/webpack-dev-server": "^
|
|
130
|
+
"@cypress/code-coverage": "^3.9.11",
|
|
131
|
+
"@cypress/react": "^5.10.3",
|
|
132
|
+
"@cypress/webpack-dev-server": "^1.7.0",
|
|
133
133
|
"@microsoft/api-extractor": "^7.19.4",
|
|
134
134
|
"@qualtrics-translations/qualtricsdesignsystemui": "^0.6.28735",
|
|
135
135
|
"@qualtrics-translations/qualtricsdesignsystemuicountries": "^0.6.27625",
|
|
@@ -138,48 +138,48 @@
|
|
|
138
138
|
"@rollup/plugin-json": "^4.0.3",
|
|
139
139
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
140
140
|
"@rollup/plugin-replace": "^3.0.0",
|
|
141
|
-
"@testing-library/cypress": "^
|
|
142
|
-
"@testing-library/jest-dom": "^
|
|
143
|
-
"@testing-library/react": "^
|
|
144
|
-
"@testing-library/
|
|
141
|
+
"@testing-library/cypress": "^8.0.1",
|
|
142
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
143
|
+
"@testing-library/react": "^12.1.5",
|
|
144
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
145
|
+
"@testing-library/user-event": "^14.4.3",
|
|
145
146
|
"@types/classnames": "^2.2.6",
|
|
146
147
|
"@types/estree": "^0.0.52",
|
|
147
148
|
"@types/jest": "^29.5.0",
|
|
148
149
|
"@types/node": "^18.17.13",
|
|
149
|
-
"@types/react": "^
|
|
150
|
-
"@types/react-dom": "^
|
|
150
|
+
"@types/react": "^17.0.33",
|
|
151
|
+
"@types/react-dom": "^17.0.10",
|
|
151
152
|
"@types/uuid": "^8.3.4",
|
|
152
153
|
"@types/webpack": "^5.28.0",
|
|
153
154
|
"@types/webpack-dev-server": "^4.3.1",
|
|
154
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
155
|
-
"@typescript-eslint/parser": "^
|
|
155
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
156
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
156
157
|
"@vanilla-extract/integration": "^6.2.1",
|
|
157
158
|
"@vanilla-extract/jest-transform": "^1.1.1",
|
|
158
|
-
"@vanilla-extract/webpack-plugin": "^2.3.11",
|
|
159
159
|
"babel-loader": "^8.2.3",
|
|
160
160
|
"babel-plugin-istanbul": "^6.1.1",
|
|
161
161
|
"css-loader": "^6.5.1",
|
|
162
162
|
"cssnano": "^4.1.11",
|
|
163
163
|
"csstype": "^3.0.10",
|
|
164
|
-
"cypress": "^
|
|
165
|
-
"cypress-mochawesome-reporter": "^3.
|
|
164
|
+
"cypress": "^8.7.0",
|
|
165
|
+
"cypress-mochawesome-reporter": "^3.0.1",
|
|
166
166
|
"cypress-real-events": "^1.7.0",
|
|
167
|
-
"cypress-visual-regression": "^
|
|
167
|
+
"cypress-visual-regression": "^1.6.2",
|
|
168
168
|
"eslint": "^8.57.0",
|
|
169
169
|
"eslint-config-airbnb": "^19.0.4",
|
|
170
|
-
"eslint-config-prettier": "^
|
|
170
|
+
"eslint-config-prettier": "^8.3.0",
|
|
171
171
|
"eslint-plugin-babel": "^5.3.0",
|
|
172
172
|
"eslint-plugin-compat": "^4.0.0",
|
|
173
173
|
"eslint-plugin-cypress": "^2.12.1",
|
|
174
174
|
"eslint-plugin-import": "^2.25.3",
|
|
175
175
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
176
176
|
"eslint-plugin-react": "^7.24.0",
|
|
177
|
-
"eslint-plugin-react-hooks": "^4.
|
|
177
|
+
"eslint-plugin-react-hooks": "^4.2.0",
|
|
178
178
|
"generic-names": "^4.0.0",
|
|
179
179
|
"html-webpack-plugin": "^5.5.0",
|
|
180
180
|
"identity-obj-proxy": "^3.0.0",
|
|
181
|
-
"jest": "^29.
|
|
182
|
-
"jest-environment-jsdom": "^29.
|
|
181
|
+
"jest": "^29.5.0",
|
|
182
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
183
183
|
"jest-junit": "^15.0.0",
|
|
184
184
|
"less": "3.13.1",
|
|
185
185
|
"less-loader": "^10.2.0",
|
|
@@ -190,8 +190,8 @@
|
|
|
190
190
|
"postcss-preset-env": "^6.7.0",
|
|
191
191
|
"postcss-reporter": "^6.0.1",
|
|
192
192
|
"prettier": "^2.4.1",
|
|
193
|
-
"react": "^
|
|
194
|
-
"react-dom": "^
|
|
193
|
+
"react": "^17.0.2",
|
|
194
|
+
"react-dom": "^17.0.2",
|
|
195
195
|
"react-router-dom": "^6.3.0",
|
|
196
196
|
"rimraf": "^3.0.2",
|
|
197
197
|
"rollup": "^2.75.6",
|
|
@@ -200,9 +200,9 @@
|
|
|
200
200
|
"rollup-plugin-copy": "^3.5.0",
|
|
201
201
|
"shelljs": "^0.8.5",
|
|
202
202
|
"style-loader": "^3.3.1",
|
|
203
|
-
"typedoc": "0.
|
|
204
|
-
"typedoc-plugin-missing-exports": "^
|
|
205
|
-
"typescript": "^
|
|
203
|
+
"typedoc": "0.25.4",
|
|
204
|
+
"typedoc-plugin-missing-exports": "^2.0.0",
|
|
205
|
+
"typescript": "^4.4.4",
|
|
206
206
|
"webpack": "^5.58.0",
|
|
207
207
|
"webpack-cli": "^4.9.1",
|
|
208
208
|
"webpack-dev-server": "^4.15.2",
|
|
@@ -1,32 +0,0 @@
|
|
|
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,191 +0,0 @@
|
|
|
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 };
|