@zohodesk/dot 1.0.0-temp-187.14 → 1.0.0-temp-200.5

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 (42) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/es/Attachment/Attachment.module.css +7 -3
  3. package/es/AttachmentViewer/Attachment.js +208 -3
  4. package/es/AttachmentViewer/AttachmentViewer.js +81 -24
  5. package/es/AttachmentViewer/AttachmentViewer.module.css +55 -9
  6. package/es/AttachmentViewer/props/propTypes.js +3 -1
  7. package/es/AttachmentViewer/utils.js +36 -2
  8. package/es/Onboarding/Onboarding.js +1 -1
  9. package/es/VideoLookup/VideoLookup.js +1 -1
  10. package/es/form/fields/Fields.module.css +0 -4
  11. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -4
  12. package/es/form/fields/TagsMultiSelect/props/propTypes.js +1 -2
  13. package/es/list/DepartmentDropDown/DepartmentDropDown.js +2 -7
  14. package/es/list/DepartmentDropDown/props/defaultProps.js +1 -2
  15. package/es/list/DepartmentDropDown/props/propTypes.js +0 -3
  16. package/es/list/status/StatusListItem/StatusListItem.module.css +6 -5
  17. package/es/utils/General.js +23 -1
  18. package/lib/Attachment/Attachment.module.css +7 -3
  19. package/lib/AttachmentViewer/Attachment.js +226 -3
  20. package/lib/AttachmentViewer/AttachmentViewer.js +82 -21
  21. package/lib/AttachmentViewer/AttachmentViewer.module.css +55 -9
  22. package/lib/AttachmentViewer/props/propTypes.js +3 -1
  23. package/lib/AttachmentViewer/utils.js +47 -1
  24. package/lib/Onboarding/Onboarding.js +2 -2
  25. package/lib/VideoLookup/VideoLookup.js +2 -2
  26. package/lib/form/fields/Fields.module.css +0 -4
  27. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -5
  28. package/lib/form/fields/TagsMultiSelect/props/propTypes.js +1 -2
  29. package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -8
  30. package/lib/list/DepartmentDropDown/props/defaultProps.js +1 -2
  31. package/lib/list/DepartmentDropDown/props/propTypes.js +0 -2
  32. package/lib/list/status/StatusListItem/StatusListItem.module.css +6 -5
  33. package/lib/utils/General.js +25 -1
  34. package/package.json +4 -4
  35. package/result.json +1 -1
  36. package/unittest/index.html +2 -14
  37. package/es/common/dot_common.module.css +0 -4
  38. package/lib/common/dot_common.module.css +0 -4
  39. /package/es/Onboarding/css/{CardOnboarding.module.css → Onboarding.module.css} +0 -0
  40. /package/es/VideoLookup/css/{VideoLookupStyles.module.css → VideoLookup.module.css} +0 -0
  41. /package/lib/Onboarding/css/{CardOnboarding.module.css → Onboarding.module.css} +0 -0
  42. /package/lib/VideoLookup/css/{VideoLookupStyles.module.css → VideoLookup.module.css} +0 -0
@@ -38,7 +38,8 @@ var AttachmentViewer_propTypes = {
38
38
  downloadText: _propTypes["default"].string,
39
39
  closeText: _propTypes["default"].string,
40
40
  hideText: _propTypes["default"].string,
41
- showText: _propTypes["default"].string
41
+ showText: _propTypes["default"].string,
42
+ previewUnsupportedText: _propTypes["default"].string
42
43
  }),
43
44
  needDownload: _propTypes["default"].string,
44
45
  previewObj: _propTypes["default"].object,
@@ -46,6 +47,7 @@ var AttachmentViewer_propTypes = {
46
47
  maintainZoom: _propTypes["default"].bool,
47
48
  isActive: _propTypes["default"].bool,
48
49
  dataId: _propTypes["default"].string,
50
+ renderUnSupportedElement: _propTypes["default"].func,
49
51
  customProps: _propTypes["default"].shape({
50
52
  avatarProps: _propTypes["default"].exact(_propTypes2.propTypes)
51
53
  })
@@ -7,6 +7,9 @@ exports.ZoomEvent = exports.Zoom = void 0;
7
7
  exports.checkAudioUrlValidity = checkAudioUrlValidity;
8
8
  exports.checkFileSourcesValidation = checkFileSourcesValidation;
9
9
  exports.checkImageValidity = checkImageValidity;
10
+ exports.checkVideoUrlValidity = checkVideoUrlValidity;
11
+ exports.getFrameOrigin = getFrameOrigin;
12
+ exports.isValidDocument = isValidDocument;
10
13
 
11
14
  var _Attachment = require("./Attachment");
12
15
 
@@ -153,6 +156,21 @@ function checkImageValidity(src) {
153
156
  });
154
157
  }
155
158
 
159
+ function checkVideoUrlValidity(url) {
160
+ return new Promise(function (resolve) {
161
+ var video = document.createElement('video');
162
+ video.src = url;
163
+
164
+ video.oncanplaythrough = function () {
165
+ return resolve(true);
166
+ };
167
+
168
+ video.onerror = function () {
169
+ return resolve(false);
170
+ };
171
+ });
172
+ }
173
+
156
174
  function checkAudioUrlValidity(url) {
157
175
  return new Promise(function (resolve) {
158
176
  var audio = new Audio(url);
@@ -169,9 +187,19 @@ function checkAudioUrlValidity(url) {
169
187
 
170
188
  ;
171
189
 
190
+ function isValidDocument(url) {
191
+ if (!url) {
192
+ return false;
193
+ }
194
+
195
+ return true;
196
+ }
197
+
172
198
  function checkFileSourcesValidation(_ref) {
173
199
  var fileName = _ref.fileName,
174
- viewURL = _ref.viewURL;
200
+ viewURL = _ref.viewURL,
201
+ previewUrl = _ref.previewUrl;
202
+ var documentTypes = (0, _Attachment.isDocsFile)(fileName) || (0, _Attachment.isSheetFile)(fileName) || (0, _Attachment.isPresentationFile)(fileName) || (0, _Attachment.isPdfFile)(fileName) || (0, _Attachment.isEmailFile)(fileName);
175
203
 
176
204
  if ((0, _Attachment.isAudioFile)(fileName)) {
177
205
  var audioValidityPromise = checkAudioUrlValidity(viewURL);
@@ -181,6 +209,20 @@ function checkFileSourcesValidation(_ref) {
181
209
  canZoom: false
182
210
  };
183
211
  });
212
+ } else if ((0, _Attachment.isVideoFile)(fileName)) {
213
+ var videoValidityPromise = checkVideoUrlValidity(viewURL);
214
+ return videoValidityPromise.then(function (isURLValid) {
215
+ return {
216
+ isViewURLValid: isURLValid,
217
+ canZoom: false
218
+ };
219
+ });
220
+ } else if (documentTypes && isValidDocument(previewUrl)) {
221
+ var isValid = isValidDocument(previewUrl);
222
+ return Promise.resolve({
223
+ isViewURLValid: isValid,
224
+ canZoom: false
225
+ });
184
226
  } else {
185
227
  var imageValidityPromise = checkImageValidity(viewURL);
186
228
  return imageValidityPromise.then(function (isURLValid) {
@@ -190,4 +232,8 @@ function checkFileSourcesValidation(_ref) {
190
232
  };
191
233
  });
192
234
  }
235
+ }
236
+
237
+ function getFrameOrigin() {
238
+ return new URL(window.location.href).origin;
193
239
  }
@@ -41,7 +41,7 @@ var _useOnboarding2 = _interopRequireDefault(require("./hooks/useOnboarding"));
41
41
 
42
42
  var _General = require("../utils/General");
43
43
 
44
- var _CardOnboardingModule = _interopRequireDefault(require("./css/CardOnboarding.module.css"));
44
+ var _OnboardingModule = _interopRequireDefault(require("./css/Onboarding.module.css"));
45
45
 
46
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
47
47
 
@@ -63,7 +63,7 @@ var Onboarding = function Onboarding(_ref) {
63
63
  onPrimaryButtonClick = _ref.onPrimaryButtonClick,
64
64
  onSecondaryButtonClick = _ref.onSecondaryButtonClick,
65
65
  customProps = _ref.customProps;
66
- var style = (0, _useMergeStyle["default"])(_CardOnboardingModule["default"], customStyle);
66
+ var style = (0, _useMergeStyle["default"])(_OnboardingModule["default"], customStyle);
67
67
 
68
68
  var _useOnboarding = (0, _useOnboarding2["default"])(),
69
69
  state = _useOnboarding.state,
@@ -23,7 +23,7 @@ var _defaultProps = require("./props/defaultProps");
23
23
 
24
24
  var _propTypes = require("./props/propTypes");
25
25
 
26
- var _VideoLookupStylesModule = _interopRequireDefault(require("./css/VideoLookupStyles.module.css"));
26
+ var _VideoLookupModule = _interopRequireDefault(require("./css/VideoLookup.module.css"));
27
27
 
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
29
 
@@ -46,7 +46,7 @@ function VideoLookup(props) {
46
46
  testId = props.testId,
47
47
  customId = props.customId,
48
48
  videoFormat = props.videoFormat;
49
- var style = (0, _utils.mergeStyle)(_VideoLookupStylesModule["default"], customStyle);
49
+ var style = (0, _utils.mergeStyle)(_VideoLookupModule["default"], customStyle);
50
50
  var handleKeyPress = (0, _react.useCallback)(function (e) {
51
51
  if (e.keyCode == '27') {
52
52
  onClose(e);
@@ -218,7 +218,3 @@ position: relative;
218
218
  [dir=rtl] .rightPlaceholder{
219
219
  left:var(--zd_size15)
220
220
  }
221
-
222
- .lineClampPickListItem{
223
- --line-clamp: var(--picklist-field-line-clamp,3);
224
- }
@@ -228,9 +228,7 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
228
228
  _customProps$TagWrapp = customProps.TagWrapperProps,
229
229
  TagWrapperProps = _customProps$TagWrapp === void 0 ? {} : _customProps$TagWrapp,
230
230
  _customProps$TagProps = customProps.TagProps,
231
- TagProps = _customProps$TagProps === void 0 ? {} : _customProps$TagProps,
232
- _customProps$ListItem = customProps.ListItemProps,
233
- ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem;
231
+ TagProps = _customProps$TagProps === void 0 ? {} : _customProps$TagProps;
234
232
  var isEditable = !isReadOnly;
235
233
  return /*#__PURE__*/_react["default"].createElement("div", {
236
234
  className: "".concat(_TagsMultiSelectModule["default"].container, " ").concat(!isReadOnly ? " ".concat(needBorder ? _TagsMultiSelectModule["default"].hasBorder : '', "\n ").concat(needBorder ? _TagsMultiSelectModule["default"]["borderColor_".concat(borderColor)] : _TagsMultiSelectModule["default"].borderColor_transparent, " ").concat(isPopupReady && needBorder || isEditable && isFocus ? _TagsMultiSelectModule["default"].active : '') : '', " ").concat(className),
@@ -340,7 +338,7 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
340
338
  var name = item.name,
341
339
  isNew = item.isNew,
342
340
  listItemProps = item.listItemProps;
343
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, searchList.length > 1 && isNew ? /*#__PURE__*/_react["default"].createElement(_DropDownSeparator["default"], null) : null, /*#__PURE__*/_react["default"].createElement(_ListItem["default"], _extends({
341
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, searchList.length > 1 && isNew ? /*#__PURE__*/_react["default"].createElement(_DropDownSeparator["default"], null) : null, /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
344
342
  key: index,
345
343
  index: index,
346
344
  autoHover: true,
@@ -353,7 +351,7 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
353
351
  isDisabled: listDisabled,
354
352
  customProps: listItemProps,
355
353
  customClass: listItemClass
356
- }, ListItemProps), isNew ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
354
+ }, isNew ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
357
355
  alignBox: "row",
358
356
  align: "vertical"
359
357
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
@@ -62,8 +62,7 @@ var propTypes = {
62
62
  customProps: _propTypes["default"].shape({
63
63
  TextBoxIconProps: _propTypes["default"].object,
64
64
  TagWrapperProps: _propTypes["default"].object,
65
- TagProps: _propTypes["default"].object,
66
- ListItemProps: _propTypes["default"].object
65
+ TagProps: _propTypes["default"].object
67
66
  }),
68
67
  isFocus: _propTypes["default"].bool
69
68
  };
@@ -25,8 +25,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
 
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
28
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
29
-
30
28
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
29
 
32
30
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -102,10 +100,7 @@ var DepartmentDropDown = /*#__PURE__*/function (_Component) {
102
100
  onSearch = _this$props3.onSearch,
103
101
  needSearchFetching = _this$props3.needSearchFetching,
104
102
  searchStr = _this$props3.searchStr,
105
- i18nKeys = _this$props3.i18nKeys,
106
- customProps = _this$props3.customProps;
107
- var _customProps$ToggleDr = customProps.ToggleDropDownProps,
108
- ToggleDropDownProps = _customProps$ToggleDr === void 0 ? {} : _customProps$ToggleDr;
103
+ i18nKeys = _this$props3.i18nKeys;
109
104
  var _i18nKeys$title = i18nKeys.title,
110
105
  title = _i18nKeys$title === void 0 ? 'Move Department' : _i18nKeys$title,
111
106
  _i18nKeys$searchEmpty = i18nKeys.searchEmptyText,
@@ -114,7 +109,7 @@ var DepartmentDropDown = /*#__PURE__*/function (_Component) {
114
109
  searchErrorText = _i18nKeys$searchError === void 0 ? 'No results' : _i18nKeys$searchError,
115
110
  _i18nKeys$placeholder = i18nKeys.placeholder,
116
111
  placeholder = _i18nKeys$placeholder === void 0 ? 'Search Department' : _i18nKeys$placeholder;
117
- return /*#__PURE__*/_react["default"].createElement(_ToggleDropDown["default"], _extends({
112
+ return /*#__PURE__*/_react["default"].createElement(_ToggleDropDown["default"], {
118
113
  title: title,
119
114
  options: departmentList,
120
115
  value: /*#__PURE__*/_react["default"].createElement(_SecondaryText.DepartmentText, {
@@ -143,7 +138,7 @@ var DepartmentDropDown = /*#__PURE__*/function (_Component) {
143
138
  isNextOptions: isNextOptions,
144
139
  onSearch: onSearch,
145
140
  needSearchFetching: needSearchFetching
146
- }, ToggleDropDownProps));
141
+ });
147
142
  }
148
143
  }]);
149
144
 
@@ -9,7 +9,6 @@ var defaultProps = {
9
9
  isPopupActive: true,
10
10
  isNextOptions: false,
11
11
  searchStr: '',
12
- i18nKeys: {},
13
- customProps: {}
12
+ i18nKeys: {}
14
13
  };
15
14
  exports.defaultProps = defaultProps;
@@ -31,7 +31,5 @@ var propTypes = (_propTypes = {
31
31
  searchEmptyText: _propTypes2["default"].string,
32
32
  searchErrorText: _propTypes2["default"].string,
33
33
  placeholder: _propTypes2["default"].string
34
- })), _defineProperty(_propTypes, "customProps", _propTypes2["default"].shape({
35
- ToggleDropDownProps: _propTypes2["default"].object
36
34
  })), _propTypes);
37
35
  exports.propTypes = propTypes;
@@ -36,8 +36,9 @@
36
36
  .value {
37
37
  composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
38
38
  }
39
- .multiLineValue {
40
- composes: lineClamp from '~@zohodesk/components/lib/common/common.module.css';
39
+ .multiLineValue{
40
+ word-break: break-word;
41
+ composes: clamp from '~@zohodesk/components/lib/common/common.module.css';
41
42
  }
42
43
  [dir=ltr] .withBorder.active {
43
44
  border-left-color: var(--zdt_statuslistitem_default_active_border);
@@ -45,6 +46,7 @@
45
46
  [dir=rtl] .withBorder.active {
46
47
  border-right-color: var(--zdt_statuslistitem_default_active_border);
47
48
  }
49
+
48
50
  .default.hover, .default.effect:hover {
49
51
  background-color: var(--zdt_statuslistitem_default_effect_bg);
50
52
  }
@@ -88,9 +90,8 @@
88
90
  }
89
91
  /* Status Type */
90
92
  .statusType {
91
- height: 1em ;
92
- width: 1em ;
93
- font-size: var(--zd_font_size8) ;
93
+ width: var(--zd_size8) ;
94
+ height: var(--zd_size8) ;
94
95
  border-radius: 50%;
95
96
  }
96
97
  [dir=ltr] .statusType {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.DUMMY_OBJECT = void 0;
7
7
  exports.formatPhoneUrl = formatPhoneUrl;
8
+ exports.getBrowserWithVersion = getBrowserWithVersion;
8
9
  exports.getFullName = getFullName;
9
10
  exports.shallowDiff = shallowDiff;
10
11
  exports.stopBubbling = stopBubbling;
@@ -59,4 +60,27 @@ function formatPhoneUrl(phone) {
59
60
  }
60
61
 
61
62
  var DUMMY_OBJECT = Object.freeze({});
62
- exports.DUMMY_OBJECT = DUMMY_OBJECT;
63
+ exports.DUMMY_OBJECT = DUMMY_OBJECT;
64
+
65
+ function getBrowserWithVersion() {
66
+ var userAgent = navigator.userAgent;
67
+ var tempMatch;
68
+ var browserMatch = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i) || [];
69
+
70
+ if (userAgent.toLowerCase().indexOf('edge') !== -1) {
71
+ return userAgent.substring(userAgent.toLowerCase().indexOf('edge'));
72
+ }
73
+
74
+ if (/trident/i.test(browserMatch[1])) {
75
+ tempMatch = /\brv[ :]+(\d+(\.\d+)?)/g.exec(userAgent) || [];
76
+ return "IE ".concat(tempMatch[1] || '');
77
+ }
78
+
79
+ browserMatch = browserMatch[2] ? [browserMatch[1], browserMatch[2]] : [navigator.appName, navigator.appVersion, '-?'];
80
+
81
+ if ((tempMatch = userAgent.match(/version\/([\.\d]+)/i)) !== null) {
82
+ browserMatch[2] = tempMatch[1];
83
+ }
84
+
85
+ return browserMatch.join(' ');
86
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/dot",
3
- "version": "1.0.0-temp-187.14",
3
+ "version": "1.0.0-temp-200.5",
4
4
  "main": "lib/index",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -63,9 +63,9 @@
63
63
  "@zohodesk-private/node-plugins": "1.1.8",
64
64
  "@zohodesk-private/react-prop-validator": "1.2.3",
65
65
  "@zohodesk/a11y": "2.3.4",
66
- "@zohodesk/components": "../components",
66
+ "@zohodesk/components": "1.2.63",
67
67
  "@zohodesk/hooks": "2.0.5",
68
- "@zohodesk/icons": "1.0.72",
68
+ "@zohodesk/icons": "1.0.74",
69
69
  "@zohodesk/layout": "^3.1.0",
70
70
  "@zohodesk/svg": "1.1.22",
71
71
  "@zohodesk/utils": "1.3.14",
@@ -78,7 +78,7 @@
78
78
  "velocity-react": "1.4.3",
79
79
  "@zohodesk/variables": "1.0.0",
80
80
  "@zohodesk/components": "1.2.63",
81
- "@zohodesk/icons": "1.0.72",
81
+ "@zohodesk/icons": "1.0.74",
82
82
  "@zohodesk/svg": "1.1.22",
83
83
  "@zohodesk/virtualizer": "1.0.3",
84
84
  "react-sortable-hoc": "^0.8.3",