@carbon/ibm-products 2.10.2 → 2.11.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -0
- package/css/index-full-carbon.css +71 -26
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +1 -0
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +71 -26
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +68 -25
- package/css/index.css.map +1 -1
- package/css/index.min.css +2 -2
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +10 -3
- package/es/components/AboutModal/AboutModal.js +10 -3
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +17 -5
- package/es/components/CreateModal/CreateModal.js +10 -3
- package/es/components/Datagrid/Datagrid/DatagridContent.js +9 -7
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +3 -2
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +26 -13
- package/es/components/Datagrid/Datagrid/DatagridRow.js +47 -40
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +30 -37
- package/es/components/Datagrid/Datagrid/DraggableElement.js +36 -132
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +17 -49
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +125 -40
- package/es/components/Datagrid/Extensions/ExpandableRow/ExpandableRow.docs-page.js +1 -1
- package/es/components/Datagrid/useExpandedRow.js +1 -1
- package/es/components/Datagrid/useNestedRowExpander.js +22 -9
- package/es/components/Datagrid/useRowExpander.js +22 -9
- package/es/components/Datagrid/utils/DatagridActions.js +1 -1
- package/es/components/Datagrid/utils/DatagridPagination.js +1 -1
- package/es/components/Datagrid/utils/getArgTypes.js +12 -0
- package/es/components/EditTearsheet/EditTearsheet.js +47 -38
- package/es/components/EditTearsheet/EditTearsheetForm.js +6 -0
- package/es/components/EditTearsheet/preview-components/MultiFormEditTearsheet.js +6 -1
- package/es/components/EmptyStates/EmptyState.js +1 -1
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
- package/es/components/EmptyStates/assets/ErrorIllustration.js +6 -11
- package/es/components/EmptyStates/assets/NoDataIllustration.js +6 -11
- package/es/components/EmptyStates/assets/NoTagsIllustration.js +6 -12
- package/es/components/EmptyStates/assets/NotFoundIllustration.js +6 -12
- package/es/components/EmptyStates/assets/NotificationsIllustration.js +6 -12
- package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +6 -12
- package/es/components/ExportModal/ExportModal.js +10 -3
- package/es/components/ImportModal/ImportModal.js +10 -3
- package/es/components/RemoveModal/RemoveModal.js +10 -3
- package/es/components/TagSet/TagSet.js +5 -21
- package/es/components/TagSet/TagSetModal.js +7 -3
- package/es/components/Tearsheet/Tearsheet.js +2 -2
- package/es/components/Tearsheet/TearsheetNarrow.js +2 -2
- package/es/components/Tearsheet/TearsheetShell.js +14 -28
- package/es/global/decorators/sidePanelDecorator.js +7 -0
- package/es/global/js/hooks/usePortalTarget.js +30 -0
- package/es/global/js/hooks/useRetrieveFormTitles.js +20 -0
- package/es/global/js/hooks/useWindowScroll.js +5 -0
- package/es/global/js/package-settings.js +0 -1
- package/es/global/js/utils/getNodeTextContent.js +47 -0
- package/flags.js +6 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +10 -3
- package/lib/components/AboutModal/AboutModal.js +10 -3
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +17 -5
- package/lib/components/CreateModal/CreateModal.js +10 -3
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +9 -7
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +26 -13
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +46 -41
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +30 -37
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +37 -137
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +20 -49
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +130 -47
- package/lib/components/Datagrid/Extensions/ExpandableRow/ExpandableRow.docs-page.js +1 -1
- package/lib/components/Datagrid/useExpandedRow.js +1 -1
- package/lib/components/Datagrid/useNestedRowExpander.js +24 -9
- package/lib/components/Datagrid/useRowExpander.js +24 -9
- package/lib/components/Datagrid/utils/DatagridActions.js +1 -1
- package/lib/components/Datagrid/utils/DatagridPagination.js +1 -1
- package/lib/components/Datagrid/utils/getArgTypes.js +12 -0
- package/lib/components/EditTearsheet/EditTearsheet.js +47 -38
- package/lib/components/EditTearsheet/EditTearsheetForm.js +6 -0
- package/lib/components/EditTearsheet/preview-components/MultiFormEditTearsheet.js +6 -1
- package/lib/components/EmptyStates/EmptyState.js +1 -1
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +6 -11
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +6 -11
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +6 -12
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +6 -12
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +6 -12
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +6 -12
- package/lib/components/ExportModal/ExportModal.js +10 -3
- package/lib/components/ImportModal/ImportModal.js +10 -3
- package/lib/components/RemoveModal/RemoveModal.js +10 -3
- package/lib/components/TagSet/TagSet.js +5 -21
- package/lib/components/TagSet/TagSetModal.js +7 -3
- package/lib/components/Tearsheet/Tearsheet.js +2 -2
- package/lib/components/Tearsheet/TearsheetNarrow.js +2 -2
- package/lib/components/Tearsheet/TearsheetShell.js +14 -28
- package/lib/global/decorators/sidePanelDecorator.js +7 -0
- package/lib/global/js/hooks/usePortalTarget.js +38 -0
- package/lib/global/js/hooks/useRetrieveFormTitles.js +28 -0
- package/lib/global/js/hooks/useWindowScroll.js +6 -0
- package/lib/global/js/package-settings.js +0 -1
- package/lib/global/js/utils/getNodeTextContent.js +55 -0
- package/package.json +7 -3
- package/scss/components/ActionSet/_action-set.scss +2 -1
- package/scss/components/Datagrid/_datagrid.scss +9 -0
- package/scss/components/Datagrid/styles/_datagrid.scss +7 -6
- package/scss/components/Datagrid/styles/_draggableElement.scss +34 -16
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +13 -0
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +1 -1
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +23 -11
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +7 -3
- package/scss/components/FilterSummary/_filter-summary.scss +3 -1
- package/scss/global/decorators/_side-panel-decorator.scss +7 -0
- package/scss/global/js/utils/_story-as-full-page.scss +0 -6
@@ -16,6 +16,7 @@ import { Column, FormGroup, Grid } from '@carbon/react';
|
|
16
16
|
import { FormContext, FormNumberContext } from './EditTearsheet';
|
17
17
|
import { pkg } from '../../settings';
|
18
18
|
import pconsole from '../../global/js/utils/pconsole';
|
19
|
+
import { useRetrieveFormTitles } from '../../global/js/hooks/useRetrieveFormTitles';
|
19
20
|
var componentName = 'EditTearsheetForm';
|
20
21
|
var blockClass = "".concat(pkg.prefix, "--tearsheet-edit__form");
|
21
22
|
|
@@ -36,6 +37,11 @@ export var EditTearsheetForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
36
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
37
38
|
var formContext = useContext(FormContext);
|
38
39
|
var formNumber = useContext(FormNumberContext);
|
40
|
+
useRetrieveFormTitles({
|
41
|
+
formContext: formContext,
|
42
|
+
formNumber: formNumber,
|
43
|
+
title: title
|
44
|
+
});
|
39
45
|
return formContext ? /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
40
46
|
className: cx(blockClass, className, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__form--hidden-form"), formNumber !== (formContext === null || formContext === void 0 ? void 0 : formContext.currentForm)), _defineProperty(_cx, "".concat(blockClass, "__form--visible-form"), formNumber === (formContext === null || formContext === void 0 ? void 0 : formContext.currentForm)), _cx)),
|
41
47
|
ref: ref
|
@@ -13,6 +13,7 @@ import cx from 'classnames';
|
|
13
13
|
import { pkg } from '../../../settings';
|
14
14
|
import { EditTearsheet } from '../EditTearsheet';
|
15
15
|
import { EditTearsheetForm } from '../EditTearsheetForm';
|
16
|
+
import { action } from '@storybook/addon-actions';
|
16
17
|
var blockClass = "".concat(pkg.prefix, "--tearsheet-edit-multi-form");
|
17
18
|
export var MultiFormEditTearsheet = function MultiFormEditTearsheet(_ref) {
|
18
19
|
var cancelButtonText = _ref.cancelButtonText,
|
@@ -72,6 +73,9 @@ export var MultiFormEditTearsheet = function MultiFormEditTearsheet(_ref) {
|
|
72
73
|
var handleModalClick = function handleModalClick() {
|
73
74
|
setOpen(!open);
|
74
75
|
};
|
76
|
+
var handleFormChange = function handleFormChange() {
|
77
|
+
action('handleFormChange')();
|
78
|
+
};
|
75
79
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("style", null, ".".concat(blockClass, " { opacity: 0 }"), ";"), /*#__PURE__*/React.createElement(Button, {
|
76
80
|
onClick: handleModalClick
|
77
81
|
}, open ? 'Close EditTearsheet' : 'Open EditTearsheet'), /*#__PURE__*/React.createElement(EditTearsheet, {
|
@@ -84,7 +88,8 @@ export var MultiFormEditTearsheet = function MultiFormEditTearsheet(_ref) {
|
|
84
88
|
title: title,
|
85
89
|
open: open,
|
86
90
|
onHandleModalClick: handleModalClick,
|
87
|
-
onClose: clearCreateData
|
91
|
+
onClose: clearCreateData,
|
92
|
+
onFormChange: handleFormChange
|
88
93
|
}, /*#__PURE__*/React.createElement(EditTearsheetForm, {
|
89
94
|
title: "Topic name",
|
90
95
|
fieldsetLegendText: "Topic information",
|
@@ -50,7 +50,7 @@ export var EmptyState = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
50
50
|
title = _ref.title,
|
51
51
|
rest = _objectWithoutProperties(_ref, _excluded);
|
52
52
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
53
|
-
className: cx(blockClass, className, _defineProperty({}, "".concat(blockClass, "-position--").concat(illustrationPosition), !!illustration)),
|
53
|
+
className: cx(blockClass, "".concat(blockClass, "-type--default"), className, _defineProperty({}, "".concat(blockClass, "-position--").concat(illustrationPosition), !!illustration)),
|
54
54
|
ref: ref
|
55
55
|
}, getDevtoolsProps(componentName)), illustration && /*#__PURE__*/React.createElement("img", {
|
56
56
|
src: illustration,
|
@@ -44,7 +44,7 @@ export var ErrorEmptyState = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
44
44
|
title = _ref.title,
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
46
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
47
|
-
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition)),
|
47
|
+
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition), "".concat(blockClass, "-type--error")),
|
48
48
|
ref: ref
|
49
49
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(ErrorIllustration, {
|
50
50
|
theme: illustrationTheme,
|
@@ -44,7 +44,7 @@ export var NoDataEmptyState = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
44
44
|
title = _ref.title,
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
46
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
47
|
-
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition)),
|
47
|
+
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition), "".concat(blockClass, "-type--noData")),
|
48
48
|
ref: ref
|
49
49
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(NoDataIllustration, {
|
50
50
|
theme: illustrationTheme,
|
@@ -44,7 +44,7 @@ export var NoTagsEmptyState = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
44
44
|
title = _ref.title,
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
46
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
47
|
-
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition)),
|
47
|
+
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition), "".concat(blockClass, "-type--noTags")),
|
48
48
|
ref: ref
|
49
49
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(NoTagsIllustration, {
|
50
50
|
theme: illustrationTheme,
|
@@ -44,7 +44,7 @@ export var NotFoundEmptyState = /*#__PURE__*/React.forwardRef(function (_ref, re
|
|
44
44
|
title = _ref.title,
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
46
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
47
|
-
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition)),
|
47
|
+
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition), "".concat(blockClass, "-type--notFound")),
|
48
48
|
ref: ref
|
49
49
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(NotFoundIllustration, {
|
50
50
|
theme: illustrationTheme,
|
@@ -44,7 +44,7 @@ export var NotificationsEmptyState = /*#__PURE__*/React.forwardRef(function (_re
|
|
44
44
|
title = _ref.title,
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
46
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
47
|
-
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition)),
|
47
|
+
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition), "".concat(blockClass, "-type--notifications")),
|
48
48
|
ref: ref
|
49
49
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(NotificationsIllustration, {
|
50
50
|
size: size,
|
@@ -44,7 +44,7 @@ export var UnauthorizedEmptyState = /*#__PURE__*/React.forwardRef(function (_ref
|
|
44
44
|
title = _ref.title,
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
46
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
47
|
-
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition)),
|
47
|
+
className: cx(blockClass, className, "".concat(blockClass, "-position--").concat(illustrationPosition), "".concat(blockClass, "-type--unauthorized")),
|
48
48
|
ref: ref
|
49
49
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(UnauthorizedIllustration, {
|
50
50
|
size: size,
|
@@ -24,13 +24,14 @@ export var ErrorIllustration = function ErrorIllustration(_ref) {
|
|
24
24
|
size = _ref.size,
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
26
26
|
var svgId = uuidv4();
|
27
|
-
return
|
27
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, rest, {
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
29
29
|
width: 80,
|
30
30
|
height: 80,
|
31
31
|
viewBox: "0 0 80 80",
|
32
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
33
|
-
|
32
|
+
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-error"), "".concat(blockClass, "__illustration--").concat(size)]),
|
33
|
+
role: "img"
|
34
|
+
}), theme === 'dark' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
34
35
|
id: "prefix__a_dark_".concat(svgId),
|
35
36
|
x1: 38.9,
|
36
37
|
y1: 77.08,
|
@@ -94,13 +95,7 @@ export var ErrorIllustration = function ErrorIllustration(_ref) {
|
|
94
95
|
}), /*#__PURE__*/React.createElement("path", {
|
95
96
|
d: "M38.93 49.79a6.9 6.9 0 01-2.66-2.51 6.11 6.11 0 01-.81-3v-1a2.26 2.26 0 01.81-2c.54-.35 1.43-.17 2.66.54a6.71 6.71 0 012.61 2.5 6.06 6.06 0 01.81 3v1a2.24 2.24 0 01-.81 2.05c-.54.29-1.41.12-2.61-.58zm-1.16-11.63L36 22.77V13l5.81 3.36v9.73l-1.64 13.46z",
|
96
97
|
fill: "#525252"
|
97
|
-
})) : /*#__PURE__*/React.createElement("
|
98
|
-
xmlns: "http://www.w3.org/2000/svg",
|
99
|
-
width: 80,
|
100
|
-
height: 80,
|
101
|
-
viewBox: "0 0 80 80",
|
102
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
103
|
-
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
98
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
104
99
|
id: "prefix__a_".concat(svgId),
|
105
100
|
x1: 29.96,
|
106
101
|
y1: 45.68,
|
@@ -210,7 +205,7 @@ export var ErrorIllustration = function ErrorIllustration(_ref) {
|
|
210
205
|
}), /*#__PURE__*/React.createElement("path", {
|
211
206
|
d: "M38.93 49.79a6.9 6.9 0 01-2.66-2.51 6.11 6.11 0 01-.81-3v-1a2.26 2.26 0 01.81-2c.54-.35 1.43-.17 2.66.54a6.71 6.71 0 012.61 2.5 6.06 6.06 0 01.81 3v1a2.24 2.24 0 01-.81 2.05c-.54.29-1.41.12-2.61-.58zm-1.16-11.63L36 22.77V13l5.81 3.36v9.73l-1.64 13.46z",
|
212
207
|
fill: "url(#prefix__e_".concat(svgId, ")")
|
213
|
-
}));
|
208
|
+
})));
|
214
209
|
};
|
215
210
|
ErrorIllustration.propTypes = {
|
216
211
|
size: PropTypes.oneOf(['lg', 'sm']),
|
@@ -24,13 +24,14 @@ export var NoDataIllustration = function NoDataIllustration(_ref) {
|
|
24
24
|
size = _ref.size,
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
26
26
|
var svgId = uuidv4();
|
27
|
-
return
|
27
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, rest, {
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
29
29
|
width: 80,
|
30
30
|
height: 80,
|
31
31
|
viewBox: "0 0 80 80",
|
32
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
33
|
-
|
32
|
+
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-noData"), "".concat(blockClass, "__illustration--").concat(size)]),
|
33
|
+
role: "img"
|
34
|
+
}), theme === 'dark' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
34
35
|
id: "prefix__a_dark_".concat(svgId),
|
35
36
|
x1: 11.12,
|
36
37
|
y1: 43.34,
|
@@ -93,13 +94,7 @@ export var NoDataIllustration = function NoDataIllustration(_ref) {
|
|
93
94
|
}), /*#__PURE__*/React.createElement("path", {
|
94
95
|
fill: "#525252",
|
95
96
|
d: "M21.49 33.33l-8.2-4.73.01-5.69 8.19 4.74v5.68z"
|
96
|
-
})) : /*#__PURE__*/React.createElement("
|
97
|
-
xmlns: "http://www.w3.org/2000/svg",
|
98
|
-
width: 80,
|
99
|
-
height: 80,
|
100
|
-
viewBox: "0 0 80 80",
|
101
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
102
|
-
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
97
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
103
98
|
id: "prefix__a_".concat(svgId),
|
104
99
|
x1: 18.35,
|
105
100
|
y1: 74.17,
|
@@ -173,7 +168,7 @@ export var NoDataIllustration = function NoDataIllustration(_ref) {
|
|
173
168
|
}), /*#__PURE__*/React.createElement("path", {
|
174
169
|
className: "prefix__g_".concat(svgId),
|
175
170
|
d: "M40 35.24L11.13 18.57v-.24l.21-.12 28.87 16.67-.21.11v.25zM21.49 33.33l-8.2-4.73.01-5.69 8.19 4.74v5.68z"
|
176
|
-
}));
|
171
|
+
})));
|
177
172
|
};
|
178
173
|
NoDataIllustration.propTypes = {
|
179
174
|
size: PropTypes.oneOf(['lg', 'sm']),
|
@@ -24,14 +24,15 @@ export var NoTagsIllustration = function NoTagsIllustration(_ref) {
|
|
24
24
|
size = _ref.size,
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
26
26
|
var svgId = uuidv4();
|
27
|
-
return
|
27
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, rest, {
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
29
29
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
30
30
|
width: 80,
|
31
31
|
height: 80,
|
32
32
|
viewBox: "0 0 80 80",
|
33
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
34
|
-
|
33
|
+
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-noTags"), "".concat(blockClass, "__illustration--").concat(size)]),
|
34
|
+
role: "img"
|
35
|
+
}), theme === 'dark' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
35
36
|
id: "prefix__c_dark_".concat(svgId),
|
36
37
|
x1: 34.96,
|
37
38
|
y1: 5.37,
|
@@ -231,14 +232,7 @@ export var NoTagsIllustration = function NoTagsIllustration(_ref) {
|
|
231
232
|
}), /*#__PURE__*/React.createElement("path", {
|
232
233
|
d: "M35.67 16.33a2.88 2.88 0 011.41.43 7 7 0 013.13 5.44c0 1.42-.7 2.24-1.73 2.24a2.82 2.82 0 01-1.4-.43 6.93 6.93 0 01-3.14-5.44c0-1.42.7-2.24 1.73-2.24m0-.41c-1.3 0-2.15 1-2.15 2.65a7.3 7.3 0 003.35 5.8 3.23 3.23 0 001.61.48c1.3 0 2.15-1 2.15-2.65a7.29 7.29 0 00-3.35-5.8 3.2 3.2 0 00-1.61-.48z",
|
233
234
|
fill: "url(#prefix__i_dark_".concat(svgId, ")")
|
234
|
-
})) : /*#__PURE__*/React.createElement("
|
235
|
-
xmlns: "http://www.w3.org/2000/svg",
|
236
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
237
|
-
width: 80,
|
238
|
-
height: 80,
|
239
|
-
viewBox: "0 0 80 80",
|
240
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
241
|
-
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
235
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
242
236
|
id: "prefix__b_".concat(svgId),
|
243
237
|
x1: 634.81,
|
244
238
|
y1: 667.18,
|
@@ -481,7 +475,7 @@ export var NoTagsIllustration = function NoTagsIllustration(_ref) {
|
|
481
475
|
}), /*#__PURE__*/React.createElement("path", {
|
482
476
|
d: "M35.67 16.33a2.88 2.88 0 011.41.43 7 7 0 013.13 5.44c0 1.42-.7 2.24-1.73 2.24a2.82 2.82 0 01-1.4-.43 6.93 6.93 0 01-3.14-5.44c0-1.42.7-2.24 1.73-2.24m0-.41c-1.3 0-2.15 1-2.15 2.65a7.3 7.3 0 003.35 5.8 3.23 3.23 0 001.61.48c1.3 0 2.15-1 2.15-2.65a7.29 7.29 0 00-3.35-5.8 3.2 3.2 0 00-1.61-.48z",
|
483
477
|
fill: "url(#prefix__j_".concat(svgId, ")")
|
484
|
-
}));
|
478
|
+
})));
|
485
479
|
};
|
486
480
|
NoTagsIllustration.propTypes = {
|
487
481
|
size: PropTypes.oneOf(['lg', 'sm']),
|
@@ -24,13 +24,14 @@ export var NotFoundIllustration = function NotFoundIllustration(_ref) {
|
|
24
24
|
size = _ref.size,
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
26
26
|
var svgId = uuidv4();
|
27
|
-
return
|
27
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, rest, {
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
29
29
|
width: 80,
|
30
30
|
height: 80,
|
31
31
|
viewBox: "0 0 80 80",
|
32
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
33
|
-
|
32
|
+
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-notFound"), "".concat(blockClass, "__illustration--").concat(size)]),
|
33
|
+
role: "img"
|
34
|
+
}), theme === 'dark' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
34
35
|
id: "prefix__a_dark_".concat(svgId),
|
35
36
|
x1: 2.6,
|
36
37
|
y1: -12.81,
|
@@ -181,14 +182,7 @@ export var NotFoundIllustration = function NotFoundIllustration(_ref) {
|
|
181
182
|
}), /*#__PURE__*/React.createElement("path", {
|
182
183
|
d: "M57 37.5c0-12-8.75-26.85-19.56-33.08C31.82 1.16 26.73.89 23.16 3.09l-4.83 2.78 1.19 1.94c3.25-1.74 7.72-1.38 12.67 1.47C42.09 15 50.11 28.57 50.11 39.6c0 4.86-1.55 8.4-4.11 10.4-.12.1-1.17.73-1.31.82l2.12 1.42 4.83-2.79C55 47.44 57 43.34 57 37.5",
|
183
184
|
fill: "url(#prefix__f_dark_".concat(svgId, ")")
|
184
|
-
})) : /*#__PURE__*/React.createElement("
|
185
|
-
xmlns: "http://www.w3.org/2000/svg",
|
186
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
187
|
-
width: 80,
|
188
|
-
height: 80,
|
189
|
-
viewBox: "0 0 80 80",
|
190
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
191
|
-
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
185
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
192
186
|
id: "prefix__a_".concat(svgId),
|
193
187
|
x1: 2.6,
|
194
188
|
y1: -12.81,
|
@@ -358,7 +352,7 @@ export var NotFoundIllustration = function NotFoundIllustration(_ref) {
|
|
358
352
|
}), /*#__PURE__*/React.createElement("path", {
|
359
353
|
d: "M57 37.5c0-12-8.75-26.85-19.56-33.08C31.82 1.16 26.73.89 23.16 3.09l-4.83 2.78 1.19 1.94c3.25-1.74 7.72-1.38 12.67 1.47C42.09 15 50.11 28.57 50.11 39.6c0 4.86-1.55 8.4-4.11 10.4-.12.1-1.17.73-1.31.82l2.12 1.42 4.83-2.79C55 47.44 57 43.34 57 37.5",
|
360
354
|
fill: "url(#prefix__g_".concat(svgId, ")")
|
361
|
-
}));
|
355
|
+
})));
|
362
356
|
};
|
363
357
|
NotFoundIllustration.propTypes = {
|
364
358
|
size: PropTypes.oneOf(['lg', 'sm']),
|
@@ -24,13 +24,14 @@ export var NotificationsIllustration = function NotificationsIllustration(_ref)
|
|
24
24
|
size = _ref.size,
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
26
26
|
var svgId = uuidv4();
|
27
|
-
return
|
27
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, rest, {
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
29
29
|
width: 80,
|
30
30
|
height: 80,
|
31
31
|
viewBox: "0 0 80 80",
|
32
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
33
|
-
|
32
|
+
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-notification"), "".concat(blockClass, "__illustration--").concat(size)]),
|
33
|
+
role: "img"
|
34
|
+
}), theme === 'dark' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
34
35
|
id: "prefix__a_dark_".concat(svgId),
|
35
36
|
x1: 30.05,
|
36
37
|
y1: 54.31,
|
@@ -126,14 +127,7 @@ export var NotificationsIllustration = function NotificationsIllustration(_ref)
|
|
126
127
|
}), /*#__PURE__*/React.createElement("path", {
|
127
128
|
d: "M60.76 30.55a2.54 2.54 0 01.14.8v3.95l.41-.13v-3.82a3.54 3.54 0 00-1.63-2.82L16.86 3.8a2.09 2.09 0 00-.44-.19l-.78.45a1 1 0 01.21-.06h.48l.27.12 21.47 12.4 21.41 12.36a3.19 3.19 0 011.28 1.67z",
|
128
129
|
fill: "url(#prefix__d_dark_".concat(svgId, ")")
|
129
|
-
})) : /*#__PURE__*/React.createElement("
|
130
|
-
xmlns: "http://www.w3.org/2000/svg",
|
131
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
132
|
-
width: 80,
|
133
|
-
height: 80,
|
134
|
-
viewBox: "0 0 80 80",
|
135
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
136
|
-
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
130
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
137
131
|
id: "prefix__a_".concat(svgId),
|
138
132
|
x1: 61.44,
|
139
133
|
y1: 66.99,
|
@@ -329,7 +323,7 @@ export var NotificationsIllustration = function NotificationsIllustration(_ref)
|
|
329
323
|
}), /*#__PURE__*/React.createElement("path", {
|
330
324
|
d: "M60.76 30.55a2.54 2.54 0 01.14.8v3.95l.41-.13v-3.82a3.54 3.54 0 00-1.63-2.82L16.86 3.8a2.09 2.09 0 00-.44-.19l-.78.45a1 1 0 01.21-.06h.48l.27.12 21.47 12.4 21.41 12.36a3.19 3.19 0 011.28 1.67z",
|
331
325
|
fill: "url(#prefix__k_".concat(svgId, ")")
|
332
|
-
}));
|
326
|
+
})));
|
333
327
|
};
|
334
328
|
NotificationsIllustration.propTypes = {
|
335
329
|
size: PropTypes.oneOf(['lg', 'sm']),
|
@@ -24,14 +24,15 @@ export var UnauthorizedIllustration = function UnauthorizedIllustration(_ref) {
|
|
24
24
|
size = _ref.size,
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
26
26
|
var svgId = uuidv4();
|
27
|
-
return
|
27
|
+
return /*#__PURE__*/React.createElement("svg", _extends({}, rest, {
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
29
29
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
30
30
|
width: 80,
|
31
31
|
height: 80,
|
32
32
|
viewBox: "0 0 80 80",
|
33
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
34
|
-
|
33
|
+
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-unauthorized"), "".concat(blockClass, "__illustration--").concat(size)]),
|
34
|
+
role: "img"
|
35
|
+
}), theme === 'dark' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
35
36
|
id: "prefix__b_dark_".concat(svgId),
|
36
37
|
x1: 17.33,
|
37
38
|
y1: 40.68,
|
@@ -114,14 +115,7 @@ export var UnauthorizedIllustration = function UnauthorizedIllustration(_ref) {
|
|
114
115
|
}), /*#__PURE__*/React.createElement("path", {
|
115
116
|
d: "M51.41 38.51a1.9 1.9 0 00-.64-.65l-1.1-.63-28.49-16.45-.1-.05-.61.35a.33.33 0 01.17 0 .6.6 0 01.32.1l28.5 16.41 1.1.63a1.5 1.5 0 01.49.51s.05.09.08.14l.36-.21z",
|
116
117
|
fill: "#6f6f6f"
|
117
|
-
})) : /*#__PURE__*/React.createElement("
|
118
|
-
xmlns: "http://www.w3.org/2000/svg",
|
119
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
120
|
-
width: 80,
|
121
|
-
height: 80,
|
122
|
-
viewBox: "0 0 80 80",
|
123
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration--").concat(size)])
|
124
|
-
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
118
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
125
119
|
id: "prefix__b",
|
126
120
|
x1: 27.98,
|
127
121
|
y1: 73.72,
|
@@ -302,7 +296,7 @@ export var UnauthorizedIllustration = function UnauthorizedIllustration(_ref) {
|
|
302
296
|
}), /*#__PURE__*/React.createElement("path", {
|
303
297
|
d: "M51.41 38.51a1.9 1.9 0 00-.64-.65l-1.1-.63-28.49-16.45-.1-.05-.61.35a.33.33 0 01.17 0 .6.6 0 01.32.1l28.5 16.41 1.1.63a1.5 1.5 0 01.49.51s.05.09.08.14l.36-.21z",
|
304
298
|
fill: "url(#prefix__h_".concat(svgId, ")")
|
305
|
-
}));
|
299
|
+
})));
|
306
300
|
};
|
307
301
|
UnauthorizedIllustration.propTypes = {
|
308
302
|
size: PropTypes.oneOf(['lg', 'sm']),
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["body", "className", "error", "errorMessage", "filename", "hidePasswordLabel", "inputLabel", "inputType", "invalidInputText", "loading", "loadingMessage", "onClose", "onRequestSubmit", "open", "preformattedExtensions", "preformattedExtensionsLabel", "primaryButtonText", "secondaryButtonText", "showPasswordLabel", "successMessage", "successful", "title", "validExtensions"];
|
5
|
+
var _excluded = ["body", "className", "error", "errorMessage", "filename", "hidePasswordLabel", "inputLabel", "inputType", "invalidInputText", "loading", "loadingMessage", "onClose", "onRequestSubmit", "open", "portalTarget", "preformattedExtensions", "preformattedExtensionsLabel", "primaryButtonText", "secondaryButtonText", "showPasswordLabel", "successMessage", "successful", "title", "validExtensions"];
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
8
8
|
//
|
@@ -20,6 +20,7 @@ import PropTypes from 'prop-types';
|
|
20
20
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
21
21
|
import uuidv4 from '../../global/js/utils/uuidv4';
|
22
22
|
import { pkg } from '../../settings';
|
23
|
+
import { usePortalTarget } from '../../global/js/hooks/usePortalTarget';
|
23
24
|
var componentName = 'ExportModal';
|
24
25
|
|
25
26
|
// Default values for props
|
@@ -48,6 +49,7 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
48
49
|
onClose = _ref.onClose,
|
49
50
|
onRequestSubmit = _ref.onRequestSubmit,
|
50
51
|
open = _ref.open,
|
52
|
+
portalTargetIn = _ref.portalTarget,
|
51
53
|
_ref$preformattedExte = _ref.preformattedExtensions,
|
52
54
|
preformattedExtensions = _ref$preformattedExte === void 0 ? defaults.preformattedExtensions : _ref$preformattedExte,
|
53
55
|
preformattedExtensionsLabel = _ref.preformattedExtensionsLabel,
|
@@ -73,6 +75,7 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
73
75
|
_useState6 = _slicedToArray(_useState5, 2),
|
74
76
|
extension = _useState6[0],
|
75
77
|
setExtension = _useState6[1];
|
78
|
+
var renderPortalUse = usePortalTarget(portalTargetIn);
|
76
79
|
useEffect(function () {
|
77
80
|
var _preformattedExtensio;
|
78
81
|
setName(filename);
|
@@ -117,7 +120,7 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
117
120
|
invalidText: invalidInputText,
|
118
121
|
onBlur: onBlurHandler
|
119
122
|
}, 'data-modal-primary-focus', true);
|
120
|
-
return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
123
|
+
return renderPortalUse( /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
121
124
|
className: cx(blockClass, className),
|
122
125
|
"aria-label": title,
|
123
126
|
size: "sm",
|
@@ -177,7 +180,7 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
177
180
|
kind: "primary",
|
178
181
|
onClick: onSubmitHandler,
|
179
182
|
disabled: primaryButtonDisabled
|
180
|
-
}, primaryButtonText)));
|
183
|
+
}, primaryButtonText))));
|
181
184
|
});
|
182
185
|
|
183
186
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -239,6 +242,10 @@ ExportModal.propTypes = {
|
|
239
242
|
* Specify whether the Modal is currently open
|
240
243
|
*/
|
241
244
|
open: PropTypes.bool,
|
245
|
+
/**
|
246
|
+
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
247
|
+
*/
|
248
|
+
portalTarget: PropTypes.node,
|
242
249
|
/**
|
243
250
|
* Array of extensions to display as radio buttons
|
244
251
|
*/
|
@@ -4,7 +4,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
7
|
-
var _excluded = ["accept", "className", "defaultErrorBody", "defaultErrorHeader", "description", "fetchErrorBody", "fetchErrorHeader", "fileDropHeader", "fileDropLabel", "fileUploadLabel", "inputButtonIcon", "inputButtonText", "inputId", "inputLabel", "inputPlaceholder", "invalidFileTypeErrorBody", "invalidFileTypeErrorHeader", "invalidIconDescription", "maxFileSize", "maxFileSizeErrorBody", "maxFileSizeErrorHeader", "onClose", "onRequestSubmit", "open", "primaryButtonText", "secondaryButtonText", "title"];
|
7
|
+
var _excluded = ["accept", "className", "defaultErrorBody", "defaultErrorHeader", "description", "fetchErrorBody", "fetchErrorHeader", "fileDropHeader", "fileDropLabel", "fileUploadLabel", "inputButtonIcon", "inputButtonText", "inputId", "inputLabel", "inputPlaceholder", "invalidFileTypeErrorBody", "invalidFileTypeErrorHeader", "invalidIconDescription", "maxFileSize", "maxFileSizeErrorBody", "maxFileSizeErrorHeader", "onClose", "onRequestSubmit", "open", "portalTarget", "primaryButtonText", "secondaryButtonText", "title"];
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
@@ -21,6 +21,7 @@ import { ComposedModal, ModalHeader, ModalFooter, ModalBody, FileUploaderDropCon
|
|
21
21
|
import cx from 'classnames';
|
22
22
|
import PropTypes from 'prop-types';
|
23
23
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
24
|
+
import { usePortalTarget } from '../../global/js/hooks/usePortalTarget';
|
24
25
|
import uuidv4 from '../../global/js/utils/uuidv4';
|
25
26
|
import { pkg } from '../../settings';
|
26
27
|
var componentName = 'ImportModal';
|
@@ -56,6 +57,7 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
56
57
|
onClose = _ref.onClose,
|
57
58
|
onRequestSubmit = _ref.onRequestSubmit,
|
58
59
|
open = _ref.open,
|
60
|
+
portalTargetIn = _ref.portalTarget,
|
59
61
|
primaryButtonText = _ref.primaryButtonText,
|
60
62
|
secondaryButtonText = _ref.secondaryButtonText,
|
61
63
|
title = _ref.title,
|
@@ -69,6 +71,7 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
69
71
|
_useState4 = _slicedToArray(_useState3, 2),
|
70
72
|
importUrl = _useState4[0],
|
71
73
|
setImportUrl = _useState4[1];
|
74
|
+
var renderPortalUse = usePortalTarget(portalTargetIn);
|
72
75
|
var isInvalidFileType = function isInvalidFileType(file) {
|
73
76
|
var acceptSet = new Set(accept);
|
74
77
|
var name = file.name;
|
@@ -193,7 +196,7 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
193
196
|
var importButtonDisabled = !importUrl || hasFiles;
|
194
197
|
var fileStatusString = "".concat(numberOfValidFiles, " / ").concat(numberOfFiles, " ").concat(fileUploadLabel);
|
195
198
|
var blockClass = "".concat(pkg.prefix, "--import-modal");
|
196
|
-
return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, _objectSpread({
|
199
|
+
return renderPortalUse( /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, _objectSpread({
|
197
200
|
open: open,
|
198
201
|
ref: ref
|
199
202
|
}, getDevtoolsProps(componentName)), {
|
@@ -270,7 +273,7 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
270
273
|
kind: "primary",
|
271
274
|
onClick: onSubmitHandler,
|
272
275
|
disabled: primaryButtonDisabled
|
273
|
-
}, primaryButtonText)));
|
276
|
+
}, primaryButtonText))));
|
274
277
|
});
|
275
278
|
|
276
279
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -372,6 +375,10 @@ ImportModal.propTypes = {
|
|
372
375
|
* Specify whether the Modal is currently open
|
373
376
|
*/
|
374
377
|
open: PropTypes.bool.isRequired,
|
378
|
+
/**
|
379
|
+
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
380
|
+
*/
|
381
|
+
portalTarget: PropTypes.node,
|
375
382
|
/**
|
376
383
|
* Specify the text for the primary button
|
377
384
|
*/
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["body", "className", "iconDescription", "inputInvalidText", "inputLabelText", "inputPlaceholderText", "label", "onClose", "onRequestSubmit", "open", "preventCloseOnClickOutside", "primaryButtonDisabled", "primaryButtonText", "resourceName", "secondaryButtonText", "textConfirmation", "title"];
|
5
|
+
var _excluded = ["body", "className", "iconDescription", "inputInvalidText", "inputLabelText", "inputPlaceholderText", "label", "onClose", "onRequestSubmit", "open", "portalTarget", "preventCloseOnClickOutside", "primaryButtonDisabled", "primaryButtonText", "resourceName", "secondaryButtonText", "textConfirmation", "title"];
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
8
8
|
//
|
@@ -20,6 +20,7 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
|
20
20
|
import uuidv4 from '../../global/js/utils/uuidv4';
|
21
21
|
import { pkg } from '../../settings';
|
22
22
|
import { usePreviousValue } from '../../global/js/hooks';
|
23
|
+
import { usePortalTarget } from '../../global/js/hooks/usePortalTarget';
|
23
24
|
var componentName = 'RemoveModal';
|
24
25
|
|
25
26
|
/**
|
@@ -38,6 +39,7 @@ export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
38
39
|
onClose = _ref.onClose,
|
39
40
|
onRequestSubmit = _ref.onRequestSubmit,
|
40
41
|
open = _ref.open,
|
42
|
+
portalTargetIn = _ref.portalTarget,
|
41
43
|
preventCloseOnClickOutside = _ref.preventCloseOnClickOutside,
|
42
44
|
primaryButtonDisabled = _ref.primaryButtonDisabled,
|
43
45
|
primaryButtonText = _ref.primaryButtonText,
|
@@ -54,6 +56,7 @@ export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
54
56
|
userInput = _useState2[0],
|
55
57
|
setUserInput = _useState2[1];
|
56
58
|
var idRef = useRef(uuidv4());
|
59
|
+
var renderPortalUse = usePortalTarget(portalTargetIn);
|
57
60
|
var onChangeHandler = function onChangeHandler(e) {
|
58
61
|
setUserInput(e.target.value);
|
59
62
|
};
|
@@ -77,7 +80,7 @@ export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
77
80
|
setUserInput('');
|
78
81
|
}
|
79
82
|
}, [open, previousState === null || previousState === void 0 ? void 0 : previousState.open]);
|
80
|
-
return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
83
|
+
return renderPortalUse( /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
81
84
|
className: cx(blockClass, className),
|
82
85
|
size: "sm",
|
83
86
|
"aria-label": title
|
@@ -111,7 +114,7 @@ export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
111
114
|
kind: "danger",
|
112
115
|
onClick: onRequestSubmit,
|
113
116
|
disabled: primaryButtonStatus
|
114
|
-
}, primaryButtonText)));
|
117
|
+
}, primaryButtonText))));
|
115
118
|
});
|
116
119
|
|
117
120
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -157,6 +160,10 @@ RemoveModal.propTypes = {
|
|
157
160
|
* Specify whether the Modal is currently open
|
158
161
|
*/
|
159
162
|
open: PropTypes.bool.isRequired,
|
163
|
+
/**
|
164
|
+
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
165
|
+
*/
|
166
|
+
portalTarget: PropTypes.node,
|
160
167
|
/**
|
161
168
|
* Prevent closing on click outside of modal
|
162
169
|
*/
|