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