@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.
Files changed (67) hide show
  1. package/README.md +14 -2
  2. package/es/ActionButton/__tests__/ActionButton.spec.js +5 -4
  3. package/es/AttachmentViewer/AttachmentImage.js +3 -1
  4. package/es/AttachmentViewer/AttachmentViewer.js +340 -265
  5. package/es/AttachmentViewer/AttachmentViewer.module.css +8 -15
  6. package/es/AttachmentViewer/__tests__/AttachmentViewer.spec.js +104 -100
  7. package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +778 -1
  8. package/es/AttachmentViewer/props/defaultProps.js +4 -2
  9. package/es/AttachmentViewer/props/propTypes.js +9 -2
  10. package/es/AttachmentViewer/utils.js +7 -6
  11. package/es/AudioPlayer/utils/utils.js +5 -2
  12. package/es/DotProvider/hooks/useDotProvider.js +15 -14
  13. package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +16 -21
  14. package/es/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +4 -3
  15. package/es/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +5 -4
  16. package/es/DotProvider/utils/errorValidation.js +6 -5
  17. package/es/DotProvider/utils/getAssetsImportPromises.js +5 -4
  18. package/es/Drawer/Drawer.js +8 -6
  19. package/es/FreezeLayer/css/cssJSLogic.js +5 -4
  20. package/es/Hooks/Dragger/useDragger.js +6 -5
  21. package/es/Hooks/Dragger/utils/DraggerUtil.js +8 -7
  22. package/es/Hooks/useFreezeLayer.js +5 -4
  23. package/es/Link/Link.js +4 -3
  24. package/es/Link/props/propTypes.js +1 -0
  25. package/es/Onboarding/CarouselDots/CarouselDots.js +32 -29
  26. package/es/Onboarding/Onboarding.js +24 -23
  27. package/es/Onboarding/hooks/useOnboarding.js +5 -4
  28. package/es/Onboarding/hooks/useOnboardingSlider.js +6 -5
  29. package/es/deprecated/SelectDropdown/SelectDropdown.js +47 -43
  30. package/es/dropdown/ToggleDropDown/ToggleDropDown.js +225 -214
  31. package/es/errorstate/Inconvenience/Inconvenience.js +36 -32
  32. package/es/errorstate/NoRequestFound/NoRequestFound.js +36 -32
  33. package/es/errorstate/PermissionPlay/PermissionPlay.js +35 -31
  34. package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +36 -32
  35. package/es/errorstate/UnableToProcess/UnableToProcess.js +36 -32
  36. package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +36 -32
  37. package/es/errorstate/WillBack/WillBack.js +34 -30
  38. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +85 -81
  39. package/es/list/status/StatusDropdown/StatusDropdown.js +113 -109
  40. package/es/list/status/StatusDropdown/__tests__/StatusDropdown.spec.js +4 -3
  41. package/es/lookup/header/Search/Search.js +5 -4
  42. package/es/lookup/header/Search/__tests__/Search.spec.js +4 -3
  43. package/es/lookup/header/ViewDropDown/ViewDropDown.js +75 -67
  44. package/es/utils/General.js +7 -2
  45. package/es/utils/editorUtils.js +5 -1
  46. package/es/version2/lookup/AlertHeader/AlertHeader.js +3 -5
  47. package/es/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +0 -24
  48. package/es/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +0 -34
  49. package/es/version2/lookup/AlertHeader/css/cssJSLogic.js +5 -4
  50. package/es/version2/lookup/AlertHeader/props/propTypes.js +1 -2
  51. package/es/version2/notification/DesktopNotification/DesktopNotification.js +63 -59
  52. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +44 -40
  53. package/lib/AttachmentViewer/AttachmentImage.js +3 -1
  54. package/lib/AttachmentViewer/AttachmentViewer.js +164 -97
  55. package/lib/AttachmentViewer/AttachmentViewer.module.css +8 -15
  56. package/lib/AttachmentViewer/__tests__/AttachmentViewer.spec.js +100 -100
  57. package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +778 -1
  58. package/lib/AttachmentViewer/props/defaultProps.js +6 -2
  59. package/lib/AttachmentViewer/props/propTypes.js +9 -2
  60. package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +3 -9
  61. package/lib/Link/Link.js +4 -3
  62. package/lib/Link/props/propTypes.js +1 -0
  63. package/lib/version2/lookup/AlertHeader/AlertHeader.js +2 -5
  64. package/lib/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +0 -26
  65. package/lib/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +0 -34
  66. package/lib/version2/lookup/AlertHeader/props/propTypes.js +1 -2
  67. package/package.json +5 -5
@@ -176,7 +176,11 @@ export function loadResource(url, type, id, callback) {
176
176
  });
177
177
  } // bind
178
178
 
179
- export function bind(...handlers) {
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
- }, renderNode(renderAlertIcon) || /*#__PURE__*/React.createElement(AlertIcons, {
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
- `;
@@ -1,8 +1,9 @@
1
1
  import { compileClassNames } from '@zohodesk/utils';
2
- export default function cssJSLogic({
3
- props,
4
- style
5
- }) {
2
+ export default function cssJSLogic(_ref) {
3
+ let {
4
+ props,
5
+ style
6
+ } = _ref;
6
7
  let {
7
8
  children,
8
9
  type,
@@ -15,6 +15,5 @@ export default {
15
15
  left: PropTypes.number,
16
16
  right: PropTypes.number,
17
17
  bottom: PropTypes.number
18
- }),
19
- renderAlertIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
18
+ })
20
19
  };
@@ -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
- mediaQueryOR
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
- uptoTablet
119
- }) => /*#__PURE__*/React.createElement(Container, _extends({
120
- className: `${style.container} ${isAnimate ? animateClass : animateRemoveClass}
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
- 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)));
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
- mediaQueryOR
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
- 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)));
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
  });