@zohodesk/dot 1.0.0-temp-230.3 → 1.0.0-temp-232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -11
- package/es/ActionButton/__tests__/ActionButton.spec.js +4 -5
- package/es/AttachmentViewer/AttachmentImage.js +1 -3
- package/es/AttachmentViewer/AttachmentViewer.js +254 -359
- package/es/AttachmentViewer/AttachmentViewer.module.css +15 -8
- package/es/AttachmentViewer/props/defaultProps.js +2 -4
- package/es/AttachmentViewer/props/propTypes.js +2 -8
- package/es/AttachmentViewer/utils.js +6 -7
- package/es/AudioPlayer/utils/utils.js +2 -5
- package/es/DotProvider/hooks/useDotProvider.js +14 -15
- package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +21 -16
- package/es/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +3 -4
- package/es/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +4 -5
- package/es/DotProvider/utils/errorValidation.js +5 -6
- package/es/DotProvider/utils/getAssetsImportPromises.js +4 -5
- package/es/Drawer/Drawer.js +6 -8
- package/es/FreezeLayer/css/cssJSLogic.js +4 -5
- package/es/Hooks/Dragger/useDragger.js +5 -6
- package/es/Hooks/Dragger/utils/DraggerUtil.js +7 -8
- package/es/Hooks/useFreezeLayer.js +4 -5
- package/es/Link/Link.js +3 -4
- package/es/Link/props/propTypes.js +0 -1
- package/es/Onboarding/CarouselDots/CarouselDots.js +29 -32
- package/es/Onboarding/Onboarding.js +23 -24
- package/es/Onboarding/hooks/useOnboarding.js +4 -5
- package/es/Onboarding/hooks/useOnboardingSlider.js +5 -6
- package/es/deprecated/SelectDropdown/SelectDropdown.js +43 -47
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +214 -225
- package/es/errorstate/Inconvenience/Inconvenience.js +32 -36
- package/es/errorstate/NoRequestFound/NoRequestFound.js +32 -36
- package/es/errorstate/PermissionPlay/PermissionPlay.js +31 -35
- package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +32 -36
- package/es/errorstate/UnableToProcess/UnableToProcess.js +32 -36
- package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +32 -36
- package/es/errorstate/WillBack/WillBack.js +30 -34
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +81 -85
- package/es/list/status/StatusDropdown/StatusDropdown.js +109 -113
- package/es/list/status/StatusDropdown/__tests__/StatusDropdown.spec.js +3 -4
- package/es/lookup/header/Search/Search.js +4 -5
- package/es/lookup/header/Search/__tests__/Search.spec.js +3 -4
- package/es/lookup/header/ViewDropDown/ViewDropDown.js +67 -75
- package/es/utils/General.js +2 -7
- package/es/utils/editorUtils.js +1 -5
- package/es/version2/lookup/AlertHeader/AlertHeader.js +5 -3
- package/es/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +24 -0
- package/es/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +34 -0
- package/es/version2/lookup/AlertHeader/css/cssJSLogic.js +4 -5
- package/es/version2/lookup/AlertHeader/props/propTypes.js +2 -1
- package/es/version2/notification/DesktopNotification/DesktopNotification.js +59 -63
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +40 -44
- package/lib/AttachmentViewer/AttachmentImage.js +1 -3
- package/lib/AttachmentViewer/AttachmentViewer.js +85 -187
- package/lib/AttachmentViewer/AttachmentViewer.module.css +15 -8
- package/lib/AttachmentViewer/props/defaultProps.js +2 -6
- package/lib/AttachmentViewer/props/propTypes.js +2 -8
- package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +9 -3
- package/lib/Link/Link.js +3 -4
- package/lib/Link/props/propTypes.js +0 -1
- package/lib/version2/lookup/AlertHeader/AlertHeader.js +5 -2
- package/lib/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +26 -0
- package/lib/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +34 -0
- package/lib/version2/lookup/AlertHeader/props/propTypes.js +2 -1
- package/package.json +7 -7
package/es/utils/editorUtils.js
CHANGED
|
@@ -176,11 +176,7 @@ export function loadResource(url, type, id, callback) {
|
|
|
176
176
|
});
|
|
177
177
|
} // bind
|
|
178
178
|
|
|
179
|
-
export function bind() {
|
|
180
|
-
for (var _len = arguments.length, handlers = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
181
|
-
handlers[_key] = arguments[_key];
|
|
182
|
-
}
|
|
183
|
-
|
|
179
|
+
export function bind(...handlers) {
|
|
184
180
|
handlers.forEach(handler => {
|
|
185
181
|
if (__DEVELOPMENT__) {
|
|
186
182
|
if (!this[handler]) {
|
|
@@ -2,7 +2,8 @@ import React, { useRef } from 'react'; //AlertDependencies
|
|
|
2
2
|
|
|
3
3
|
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
4
4
|
import AlertClose from "../../AlertClose/AlertClose";
|
|
5
|
-
import AlertIcons from "../../alertIcons/AlertIcons";
|
|
5
|
+
import AlertIcons from "../../alertIcons/AlertIcons";
|
|
6
|
+
import renderNode from '@zohodesk/utils/es/renderNode'; //CSS
|
|
6
7
|
|
|
7
8
|
import style from "./css/AlertHeaderNew.module.css";
|
|
8
9
|
import cssJSLogic from "./css/cssJSLogic";
|
|
@@ -24,7 +25,8 @@ export default function AlertHeader(props) {
|
|
|
24
25
|
type,
|
|
25
26
|
htmlId,
|
|
26
27
|
customStyle,
|
|
27
|
-
dragBoundaryLimit
|
|
28
|
+
dragBoundaryLimit,
|
|
29
|
+
renderAlertIcon
|
|
28
30
|
} = props;
|
|
29
31
|
const finalStyle = mergeStyle(style, customStyle);
|
|
30
32
|
const {
|
|
@@ -51,7 +53,7 @@ export default function AlertHeader(props) {
|
|
|
51
53
|
eleRef: dragRef
|
|
52
54
|
}, needIcon && /*#__PURE__*/React.createElement("div", {
|
|
53
55
|
className: finalStyle.iconContainer
|
|
54
|
-
}, /*#__PURE__*/React.createElement(AlertIcons, {
|
|
56
|
+
}, renderNode(renderAlertIcon) || /*#__PURE__*/React.createElement(AlertIcons, {
|
|
55
57
|
type: type
|
|
56
58
|
})), (title || children) && /*#__PURE__*/React.createElement(Box, {
|
|
57
59
|
flexible: true
|
|
@@ -8,4 +8,28 @@ describe('AlertHeader', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(AlertHeader, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('renders custom renderAlertIcon when needIcon is true', () => {
|
|
12
|
+
const customIcon = /*#__PURE__*/React.createElement("span", {
|
|
13
|
+
"data-test-id": "custom-icon"
|
|
14
|
+
}, "icon");
|
|
15
|
+
const {
|
|
16
|
+
asFragment
|
|
17
|
+
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
18
|
+
needIcon: true,
|
|
19
|
+
renderAlertIcon: customIcon
|
|
20
|
+
}));
|
|
21
|
+
expect(asFragment()).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
test('does not render custom renderAlertIcon when needIcon is false', () => {
|
|
24
|
+
const customIcon = /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
"data-test-id": "custom-icon"
|
|
26
|
+
}, "icon");
|
|
27
|
+
const {
|
|
28
|
+
asFragment
|
|
29
|
+
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
30
|
+
needIcon: false,
|
|
31
|
+
renderAlertIcon: customIcon
|
|
32
|
+
}));
|
|
33
|
+
expect(asFragment()).toMatchSnapshot();
|
|
34
|
+
});
|
|
11
35
|
});
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`AlertHeader does not render custom renderAlertIcon when needIcon is false 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="container danger flex rowdir wrap vCenter"
|
|
7
|
+
data-drag-hook="true"
|
|
8
|
+
data-id="containerComponent"
|
|
9
|
+
data-selector-id="container"
|
|
10
|
+
data-test-id="containerComponent"
|
|
11
|
+
/>
|
|
12
|
+
</DocumentFragment>
|
|
13
|
+
`;
|
|
14
|
+
|
|
3
15
|
exports[`AlertHeader rendering the defult props 1`] = `
|
|
4
16
|
<DocumentFragment>
|
|
5
17
|
<div
|
|
@@ -86,3 +98,25 @@ exports[`AlertHeader rendering the defult props 1`] = `
|
|
|
86
98
|
</div>
|
|
87
99
|
</DocumentFragment>
|
|
88
100
|
`;
|
|
101
|
+
|
|
102
|
+
exports[`AlertHeader renders custom renderAlertIcon when needIcon is true 1`] = `
|
|
103
|
+
<DocumentFragment>
|
|
104
|
+
<div
|
|
105
|
+
class="container danger flex rowdir wrap vCenter"
|
|
106
|
+
data-drag-hook="true"
|
|
107
|
+
data-id="containerComponent"
|
|
108
|
+
data-selector-id="container"
|
|
109
|
+
data-test-id="containerComponent"
|
|
110
|
+
>
|
|
111
|
+
<div
|
|
112
|
+
class="iconContainer"
|
|
113
|
+
>
|
|
114
|
+
<span
|
|
115
|
+
data-test-id="custom-icon"
|
|
116
|
+
>
|
|
117
|
+
icon
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</DocumentFragment>
|
|
122
|
+
`;
|
|
@@ -95,10 +95,9 @@ export function DesktopNotificationUI(props) {
|
|
|
95
95
|
let uiVariantOne = title && (info || secondaryInfo);
|
|
96
96
|
let uiVariantTwo = title && !(info || secondaryInfo) && !getSectionContainer;
|
|
97
97
|
|
|
98
|
-
function responsiveFunc(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
} = _ref;
|
|
98
|
+
function responsiveFunc({
|
|
99
|
+
mediaQueryOR
|
|
100
|
+
}) {
|
|
102
101
|
return {
|
|
103
102
|
uptoTablet: mediaQueryOR([{
|
|
104
103
|
maxWidth: 760
|
|
@@ -115,66 +114,63 @@ export function DesktopNotificationUI(props) {
|
|
|
115
114
|
}, /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
116
115
|
query: responsiveFunc,
|
|
117
116
|
responsiveId: responsiveId
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
123
|
-
className: `${style.container} ${isAnimate ? animateClass : animateRemoveClass}
|
|
117
|
+
}, ({
|
|
118
|
+
uptoTablet
|
|
119
|
+
}) => /*#__PURE__*/React.createElement(Container, _extends({
|
|
120
|
+
className: `${style.container} ${isAnimate ? animateClass : animateRemoveClass}
|
|
124
121
|
${isShrinkView ? style.globalNotify : ''} ${containerClass} ${uptoTablet ? style.tapWidth : style[`${size}`]}`,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}));
|
|
122
|
+
isCover: false,
|
|
123
|
+
dataId: dataId,
|
|
124
|
+
isInline: uiVariantTwo
|
|
125
|
+
}, ExtraProps), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(DesktopNotificationHeader, {
|
|
126
|
+
type: type,
|
|
127
|
+
title: title,
|
|
128
|
+
variant: titleVariant,
|
|
129
|
+
needIcon: needIcon,
|
|
130
|
+
onClose: onClose,
|
|
131
|
+
closeTitle: closeTitle,
|
|
132
|
+
dataId: `${dataId}_close`,
|
|
133
|
+
needClose: needClose
|
|
134
|
+
})), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Container, {
|
|
135
|
+
alignBox: "column"
|
|
136
|
+
}, uiVariantOne && /*#__PURE__*/React.createElement(Box, {
|
|
137
|
+
flexible: true
|
|
138
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: `${style.section} ${style.infoText}`
|
|
140
|
+
}, subTitle && /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: `${style.subTitle} ${info || secondaryInfo ? style.subTitleMargin : ''}`
|
|
142
|
+
}, subTitle), info && /*#__PURE__*/React.createElement("div", null, info), secondaryInfo && /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
className: `${info ? style.secondaryInfo : ''}`
|
|
144
|
+
}, secondaryInfo))), getSectionContainer && /*#__PURE__*/React.createElement(Box, {
|
|
145
|
+
flexible: true
|
|
146
|
+
}, getSectionContainer()), submitText || cancelText ? /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement("div", {
|
|
147
|
+
className: style.footer
|
|
148
|
+
}, isMore ? /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: `${style.message}`,
|
|
150
|
+
tagName: "p"
|
|
151
|
+
}, message) : null, /*#__PURE__*/React.createElement(FormAction, {
|
|
152
|
+
size: "small",
|
|
153
|
+
paddingLeftSize: "xmedium"
|
|
154
|
+
}, submitText ? /*#__PURE__*/React.createElement("div", {
|
|
155
|
+
onClick: onClickSubmit,
|
|
156
|
+
"data-id": `${dataId}_submitButton`,
|
|
157
|
+
"data-test-id": `${dataId}_submitButton`
|
|
158
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
159
|
+
align: "vertical",
|
|
160
|
+
alignBox: "row"
|
|
161
|
+
}, getSubmitContainer ? /*#__PURE__*/React.createElement(Box, {
|
|
162
|
+
flexible: true
|
|
163
|
+
}, getSubmitContainer()) : /*#__PURE__*/React.createElement(Box, {
|
|
164
|
+
flexible: true
|
|
165
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
166
|
+
text: submitText,
|
|
167
|
+
palette: submitType ? submitType : buttonPalette
|
|
168
|
+
})))) : null, cancelText ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
169
|
+
text: cancelText,
|
|
170
|
+
palette: "secondary",
|
|
171
|
+
dataId: `${dataId}_cancelButton`,
|
|
172
|
+
onClick: onClickCancel
|
|
173
|
+
})) : null))) : null)), getBottomContainer ? /*#__PURE__*/React.createElement(Box, null, getBottomContainer()) : null)));
|
|
178
174
|
}
|
|
179
175
|
DesktopNotificationUI.propTypes = DesktopNotificationUI_propTypes;
|
|
180
176
|
export default function DesktopNotification(props) {
|
|
@@ -25,10 +25,9 @@ export default class DesktopNotificationHeader extends Component {
|
|
|
25
25
|
responsiveId
|
|
26
26
|
} = this.props;
|
|
27
27
|
|
|
28
|
-
function responsiveFunc(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
28
|
+
function responsiveFunc({
|
|
29
|
+
mediaQueryOR
|
|
30
|
+
}) {
|
|
32
31
|
return {
|
|
33
32
|
uptoTablet: mediaQueryOR([{
|
|
34
33
|
maxWidth: 760
|
|
@@ -45,46 +44,43 @@ export default class DesktopNotificationHeader extends Component {
|
|
|
45
44
|
}, /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
46
45
|
query: responsiveFunc,
|
|
47
46
|
responsiveId: responsiveId
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
type: "light"
|
|
86
|
-
})) : null);
|
|
87
|
-
}));
|
|
47
|
+
}, ({
|
|
48
|
+
uptoTablet
|
|
49
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, needIcon ? /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: style.iconContainer
|
|
51
|
+
}, /*#__PURE__*/React.createElement(AlertIcons, {
|
|
52
|
+
type: type
|
|
53
|
+
})) : null, /*#__PURE__*/React.createElement(Box, {
|
|
54
|
+
flexible: true
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
56
|
+
alignBox: "row",
|
|
57
|
+
align: "center"
|
|
58
|
+
}, variant === 'primary' ? /*#__PURE__*/React.createElement(Box, {
|
|
59
|
+
shrink: true
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
61
|
+
$i18n_dataTitle: title,
|
|
62
|
+
$ui_className: style.title,
|
|
63
|
+
$ui_tagName: "h1",
|
|
64
|
+
$ui_size: uptoTablet ? '16' : '18',
|
|
65
|
+
$ui_lineHeight: "1.2",
|
|
66
|
+
$ui_weight: "bold",
|
|
67
|
+
$flag_reset: true,
|
|
68
|
+
$ui_wordBreak: "breakWord"
|
|
69
|
+
}, title)) : /*#__PURE__*/React.createElement(Box, {
|
|
70
|
+
className: `${style.infoText}`
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
72
|
+
$i18n_dataTitle: title,
|
|
73
|
+
$ui_className: style.title,
|
|
74
|
+
$ui_size: "14",
|
|
75
|
+
$ui_wordBreak: "breakWord"
|
|
76
|
+
}, title)))), needClose ? /*#__PURE__*/React.createElement(Box, {
|
|
77
|
+
className: style.close
|
|
78
|
+
}, /*#__PURE__*/React.createElement(AlertClose, {
|
|
79
|
+
onClose: onClose,
|
|
80
|
+
dataTitle: closeTitle,
|
|
81
|
+
dataId: dataId,
|
|
82
|
+
type: "light"
|
|
83
|
+
})) : null)));
|
|
88
84
|
}
|
|
89
85
|
|
|
90
86
|
}
|
|
@@ -92,8 +92,7 @@ var AttachmentImage = /*#__PURE__*/function (_Component) {
|
|
|
92
92
|
isCover = _this$props.isCover,
|
|
93
93
|
customClass = _this$props.customClass,
|
|
94
94
|
onLoad = _this$props.onLoad,
|
|
95
|
-
onError = _this$props.onError
|
|
96
|
-
imageRef = _this$props.imageRef;
|
|
95
|
+
onError = _this$props.onError;
|
|
97
96
|
var isImageValid = this.state.isImageValid;
|
|
98
97
|
var _customClass$customIm = customClass.customImageClass,
|
|
99
98
|
customImageClass = _customClass$customIm === void 0 ? '' : _customClass$customIm;
|
|
@@ -105,7 +104,6 @@ var AttachmentImage = /*#__PURE__*/function (_Component) {
|
|
|
105
104
|
className: customImageClass,
|
|
106
105
|
alt: alt,
|
|
107
106
|
isCover: isCover,
|
|
108
|
-
eleRef: imageRef,
|
|
109
107
|
onLoad: onLoad,
|
|
110
108
|
onError: onError
|
|
111
109
|
});
|