@zohodesk/dot 1.0.0-temp-213 → 1.0.0-temp-214

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 (52) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +8 -0
  3. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +1 -1
  4. package/assets/Appearance/light/mode/Dot_LightMode.module.css +1 -1
  5. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +1 -1
  6. package/es/Attachment/Attachment.module.css +7 -3
  7. package/es/AttachmentViewer/Attachment.js +106 -1
  8. package/es/AttachmentViewer/AttachmentViewer.js +114 -28
  9. package/es/AttachmentViewer/AttachmentViewer.module.css +32 -9
  10. package/es/AttachmentViewer/props/defaultProps.js +1 -1
  11. package/es/AttachmentViewer/props/propTypes.js +9 -1
  12. package/es/AttachmentViewer/utils.js +98 -13
  13. package/es/form/fields/CheckBoxField/CheckBoxField.js +7 -9
  14. package/es/form/fields/CurrencyField/CurrencyField.js +5 -5
  15. package/es/form/fields/DateField/DateField.js +7 -8
  16. package/es/form/fields/Fields.module.css +3 -0
  17. package/es/form/fields/MultiSelectField/MultiSelectField.js +5 -6
  18. package/es/form/fields/RadioField/RadioField.js +1 -1
  19. package/es/form/fields/SelectField/SelectField.js +5 -6
  20. package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +6 -8
  21. package/es/form/fields/TextBoxField/TextBoxField.js +7 -7
  22. package/es/form/fields/TextareaField/TextareaField.js +6 -6
  23. package/es/lookup/Lookup/Lookup.js +2 -1
  24. package/es/lookup/Lookup/Lookup.module.css +6 -1
  25. package/es/lookup/Lookup/props/propTypes.js +1 -0
  26. package/es/utils/General.js +23 -1
  27. package/lib/Attachment/Attachment.module.css +7 -3
  28. package/lib/AttachmentViewer/Attachment.js +109 -1
  29. package/lib/AttachmentViewer/AttachmentViewer.js +121 -25
  30. package/lib/AttachmentViewer/AttachmentViewer.module.css +32 -9
  31. package/lib/AttachmentViewer/props/defaultProps.js +1 -1
  32. package/lib/AttachmentViewer/props/propTypes.js +9 -1
  33. package/lib/AttachmentViewer/utils.js +102 -8
  34. package/lib/form/fields/CheckBoxField/CheckBoxField.js +7 -10
  35. package/lib/form/fields/CurrencyField/CurrencyField.js +4 -5
  36. package/lib/form/fields/DateField/DateField.js +6 -9
  37. package/lib/form/fields/Fields.module.css +3 -0
  38. package/lib/form/fields/MultiSelectField/MultiSelectField.js +5 -7
  39. package/lib/form/fields/RadioField/RadioField.js +1 -1
  40. package/lib/form/fields/SelectField/SelectField.js +5 -7
  41. package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +5 -8
  42. package/lib/form/fields/TextBoxField/TextBoxField.js +6 -8
  43. package/lib/form/fields/TextareaField/TextareaField.js +5 -6
  44. package/lib/lookup/Lookup/Lookup.js +2 -1
  45. package/lib/lookup/Lookup/Lookup.module.css +6 -1
  46. package/lib/lookup/Lookup/props/propTypes.js +1 -0
  47. package/lib/utils/General.js +25 -1
  48. package/package.json +9 -11
  49. package/result.json +1 -0
  50. package/unittest/index.html +37 -0
  51. package/es/common/dot_common.module.css +0 -4
  52. package/lib/common/dot_common.module.css +0 -4
@@ -3,8 +3,9 @@ import React, { PureComponent } from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  /**** Components ****/
6
+ // import Label from '@zohodesk/components/lib/Label/Label';
6
7
 
7
- import Label from '@zohodesk/components/lib/Label/Label';
8
+ import Label from '@zohodesk/components/es/v1/Label/Label';
8
9
  import CheckBox from '@zohodesk/components/lib/CheckBox/CheckBox';
9
10
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
10
11
  import { Container, Box } from '@zohodesk/components/lib/Layout';
@@ -87,15 +88,12 @@ export default class CheckBoxField extends PureComponent {
87
88
  renderProps: renderLabelProps
88
89
  }, /*#__PURE__*/React.createElement(Label, {
89
90
  text: labelName,
90
- id: id,
91
- size: fieldSize === 'small' ? 'small' : 'medium',
92
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
93
- infoText: infoText,
94
- customClass: `${!isDirectCol ? style.checkboxText : ''} ${!isDirectCol ? style[`lineClamp_${lineClamp}`] : ''} ${isReadOnly || isDisabled ? style.cbTextReadonly : style.cbTextPointer} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
95
- title: labelName,
91
+ isRequired: isMandatory,
92
+ isInlineField: true,
93
+ customStyle: labelCustomClass,
94
+ testId: id,
95
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
96
96
  onClick: !removeEvent ? this.handleLabelClick : null,
97
- variant: isDirectCol ? 'default' : 'primary',
98
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
99
97
  ...LabelProps
100
98
  }));
101
99
  return /*#__PURE__*/React.createElement("div", {
@@ -3,8 +3,9 @@ import React, { PureComponent } from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  /**** Components ****/
6
+ // import Label from '@zohodesk/components/lib/Label/Label';
6
7
 
7
- import Label from '@zohodesk/components/lib/Label/Label';
8
+ import Label from '@zohodesk/components/es/v1/Label/Label';
8
9
  import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
9
10
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
10
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
@@ -129,11 +130,10 @@ export default class CurrencyField extends PureComponent {
129
130
  renderProps: renderLabelProps
130
131
  }, /*#__PURE__*/React.createElement(Label, {
131
132
  text: labelName,
132
- size: fieldSize === 'small' ? 'small' : 'medium',
133
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
134
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
133
+ isRequired: isMandatory,
134
+ customStyle: labelCustomClass,
135
135
  htmlFor: uniqueId,
136
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
136
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
137
137
  ...LabelProps
138
138
  })), /*#__PURE__*/React.createElement("div", {
139
139
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
@@ -3,8 +3,9 @@ import React, { PureComponent } from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  /**** Components ****/
6
+ // import Label from '@zohodesk/components/lib/Label/Label';
6
7
 
7
- import Label from '@zohodesk/components/lib/Label/Label';
8
+ import Label from '@zohodesk/components/es/v1/Label/Label';
8
9
  import DateWidget from '@zohodesk/components/lib/DateTime/DateWidget';
9
10
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
10
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
@@ -133,14 +134,12 @@ export default class DateField extends PureComponent {
133
134
  renderProps: renderLabelProps
134
135
  }, /*#__PURE__*/React.createElement(Label, {
135
136
  text: labelName,
137
+ isRequired: isMandatory,
138
+ customStyle: labelCustomClass,
136
139
  htmlFor: getAriaId,
137
- size: fieldSize === 'small' ? 'small' : 'medium',
138
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
139
- onClick: isDisabled || isReadOnly ? null : this.handleLabelClick,
140
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
141
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
142
- ...LabelProps,
143
- id: labelName
140
+ testId: labelName,
141
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
142
+ ...LabelProps
144
143
  })), /*#__PURE__*/React.createElement("div", {
145
144
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
146
145
  }, isLocked && lockedValueText ? /*#__PURE__*/React.createElement("div", {
@@ -7,6 +7,9 @@
7
7
  position: relative;
8
8
  min-height: var(--zd_size25) ;
9
9
  }
10
+ .fieldMargin_large {
11
+ margin-top: var(--zd_size10) ;
12
+ }
10
13
  .fieldMargin_medium {
11
14
  margin-top: var(--zd_size5) ;
12
15
  }
@@ -3,8 +3,9 @@ import React, { PureComponent } from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  /**** Components ****/
6
+ // import Label from '@zohodesk/components/lib/Label/Label';
6
7
 
7
- import Label from '@zohodesk/components/lib/Label/Label';
8
+ import Label from '@zohodesk/components/es/v1/Label/Label';
8
9
  import MultiSelect from '@zohodesk/components/lib/MultiSelect/MultiSelect';
9
10
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
10
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
@@ -145,13 +146,11 @@ export default class MultiSelectField extends PureComponent {
145
146
  renderProps: renderLabelProps
146
147
  }, /*#__PURE__*/React.createElement(Label, {
147
148
  text: labelName,
148
- id: id,
149
- size: fieldSize === 'small' ? 'small' : 'medium',
150
- palette: isDarkPalette ? 'dark' : isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette // onClick={this.handleLabelClick}
149
+ isRequired: isMandatory // customStyle={style.fieldLabel}
151
150
  ,
152
- customClass: `${style.fieldLabel} ${isMandatory ? style.labelMandatory : ''}`,
153
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
154
151
  htmlFor: uniqueId,
152
+ testId: id,
153
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
155
154
  ...LabelProps
156
155
  })), /*#__PURE__*/React.createElement(MultiSelect, {
157
156
  options: options,
@@ -121,7 +121,7 @@ export default class RadioField extends PureComponent {
121
121
  dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
122
122
  ...LabelProps
123
123
  }), /*#__PURE__*/React.createElement("div", {
124
- className: `${style.fieldContainer} ${isBoxStyle ? style.radiosWrapper : ''} ${labelName ? style.fieldMargin_medium : ''} ${style.radioContainer}`
124
+ className: `${style.fieldContainer} ${isBoxStyle ? style.radiosWrapper : ''} ${labelName ? isBoxStyle ? style.fieldMargin_large : style.fieldMargin_medium : ''} ${style.radioContainer}`
125
125
  }, options.map((option, index) => {
126
126
  let {
127
127
  text,
@@ -3,8 +3,9 @@ import React, { PureComponent } from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  /**** Components ****/
6
+ // import Label from '@zohodesk/components/lib/Label/Label';
6
7
 
7
- import Label from '@zohodesk/components/lib/Label/Label';
8
+ import Label from '@zohodesk/components/es/v1/Label/Label';
8
9
  import Select from '@zohodesk/components/lib/Select/Select';
9
10
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
10
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
@@ -115,13 +116,11 @@ export default class SelectField extends PureComponent {
115
116
  renderProps: renderLabelProps
116
117
  }, /*#__PURE__*/React.createElement(Label, {
117
118
  text: labelName,
118
- size: fieldSize === 'small' ? 'small' : 'medium',
119
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
120
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
119
+ isRequired: isMandatory,
121
120
  htmlFor: uniqueId,
122
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
123
121
  ...LabelProps,
124
- id: uniqueId
122
+ testId: uniqueId,
123
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
125
124
  })), /*#__PURE__*/React.createElement("div", {
126
125
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''} ${fieldClass ? fieldClass : ''}`
127
126
  }, /*#__PURE__*/React.createElement(Select, {
@@ -1,8 +1,9 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { defaultProps } from "./props/defaultProps";
3
3
  import { propTypes } from "./props/propTypes";
4
- import { Box } from '@zohodesk/components/lib/Layout';
5
- import Label from '@zohodesk/components/lib/Label/Label';
4
+ import { Box } from '@zohodesk/components/lib/Layout'; // import Label from '@zohodesk/components/lib/Label/Label';
5
+
6
+ import Label from '@zohodesk/components/es/v1/Label/Label';
6
7
  import Popup from '@zohodesk/components/lib/Popup/Popup';
7
8
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
8
9
  import TagsMultiSelect from "../TagsMultiSelect/TagsMultiSelect";
@@ -206,13 +207,10 @@ const TagsMultiSelectField = props => {
206
207
  }
207
208
  }, /*#__PURE__*/React.createElement(Label, {
208
209
  text: labelName,
209
- title: labelName,
210
- id: id,
211
- size: labelSize,
212
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
213
- customClass: `${fieldStyle.fieldLabel} ${isMandatory ? fieldStyle.labelMandatory : ''} ${labelClass ? labelClass : ''}`,
214
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
210
+ isRequired: isMandatory,
215
211
  htmlFor: htmlId,
212
+ testId: id,
213
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
216
214
  ...LabelProps
217
215
  }), selectedValueCount ? /*#__PURE__*/React.createElement(Box, {
218
216
  dataId: `${dataId}_tagCount`,
@@ -3,8 +3,9 @@ import React, { PureComponent } from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  /**** Components ****/
6
+ // import Label from '@zohodesk/components/lib/Label/Label';
6
7
 
7
- import Label from '@zohodesk/components/lib/Label/Label';
8
+ import Label from '@zohodesk/components/es/v1/Label/Label';
8
9
  import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
9
10
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
10
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
@@ -103,13 +104,12 @@ export default class TextBoxField extends PureComponent {
103
104
  renderProps: renderLabelProps
104
105
  }, /*#__PURE__*/React.createElement(Label, {
105
106
  text: labelName,
106
- size: fieldSize === 'small' ? 'small' : 'medium',
107
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
108
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
107
+ isRequired: isMandatory,
108
+ customStyle: labelCustomClass,
109
+ testId: labelName,
109
110
  htmlFor: uniqueId,
110
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
111
- ...LabelProps,
112
- id: labelName
111
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
112
+ ...LabelProps
113
113
  })), /*#__PURE__*/React.createElement("div", {
114
114
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
115
115
  }, /*#__PURE__*/React.createElement(TextBoxIcon, {
@@ -3,8 +3,9 @@ import React, { PureComponent } from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  /**** Components ****/
6
+ // import Label from '@zohodesk/components/lib/Label/Label';
6
7
 
7
- import Label from '@zohodesk/components/lib/Label/Label';
8
+ import Label from '@zohodesk/components/es/v1/Label/Label';
8
9
  import Textarea from '@zohodesk/components/lib/Textarea/Textarea';
9
10
  import ValidationMessage from "../ValidationMessage/ValidationMessage";
10
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
@@ -131,12 +132,11 @@ export default class TextareaField extends PureComponent {
131
132
  renderProps: renderLabelProps
132
133
  }, /*#__PURE__*/React.createElement(Label, {
133
134
  text: labelName,
134
- id: id,
135
- size: fieldSize === 'small' ? 'small' : 'medium',
136
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
137
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
135
+ isRequired: isMandatory,
136
+ customStyle: labelCustomClass,
137
+ testId: id,
138
138
  htmlFor: uniqueId,
139
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
139
+ customId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
140
140
  ...LabelProps
141
141
  })), /*#__PURE__*/React.createElement("div", {
142
142
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
@@ -56,6 +56,7 @@ export default class Lookup extends Component {
56
56
  needFocusScope,
57
57
  customProps,
58
58
  isMinHeight,
59
+ containerClass,
59
60
  lookupClass
60
61
  } = this.props;
61
62
  const {
@@ -93,7 +94,7 @@ export default class Lookup extends Component {
93
94
  }, /*#__PURE__*/React.createElement(Container, {
94
95
  "data-drag-container": "true",
95
96
  isCover: false,
96
- className: isMinHeight ? `${style.wrapper}` : `${style.coverwrap}`
97
+ className: `${isMinHeight ? style.wrapper : style.coverwrap} ${style.containerWidth} ${containerClass}`
97
98
  }, children));
98
99
  return /*#__PURE__*/React.createElement(FreezeLayer, {
99
100
  align: "horizontal",
@@ -19,6 +19,10 @@
19
19
  margin: auto ;
20
20
  }
21
21
 
22
+ .containerWidth {
23
+ width: 100% ;
24
+ }
25
+
22
26
  /* Size */
23
27
  .smallSize {
24
28
  max-width: var(--zd_size470) ;
@@ -35,10 +39,11 @@
35
39
  .largeSize {
36
40
  max-width: 70% ;
37
41
  }
42
+
38
43
  .xlargeSize {
39
44
  max-width: 80% ;
40
45
  }
41
46
 
42
47
  .fullSize {
43
48
  max-width: 90% ;
44
- }
49
+ }
@@ -20,5 +20,6 @@ export const propTypes = {
20
20
  onClick: PropTypes.func,
21
21
  onClose: PropTypes.func,
22
22
  isMinHeight: PropTypes.bool,
23
+ containerClass: PropTypes.string,
23
24
  lookupClass: PropTypes.string
24
25
  };
@@ -43,4 +43,26 @@ export function formatPhoneUrl(phone) {
43
43
 
44
44
  return phone;
45
45
  }
46
- export const DUMMY_OBJECT = Object.freeze({});
46
+ export const DUMMY_OBJECT = Object.freeze({});
47
+ export function getBrowserWithVersion() {
48
+ const userAgent = navigator.userAgent;
49
+ let tempMatch;
50
+ let browserMatch = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i) || [];
51
+
52
+ if (userAgent.toLowerCase().indexOf('edge') !== -1) {
53
+ return userAgent.substring(userAgent.toLowerCase().indexOf('edge'));
54
+ }
55
+
56
+ if (/trident/i.test(browserMatch[1])) {
57
+ tempMatch = /\brv[ :]+(\d+(\.\d+)?)/g.exec(userAgent) || [];
58
+ return `IE ${tempMatch[1] || ''}`;
59
+ }
60
+
61
+ browserMatch = browserMatch[2] ? [browserMatch[1], browserMatch[2]] : [navigator.appName, navigator.appVersion, '-?'];
62
+
63
+ if ((tempMatch = userAgent.match(/version\/([\.\d]+)/i)) !== null) {
64
+ browserMatch[2] = tempMatch[1];
65
+ }
66
+
67
+ return browserMatch.join(' ');
68
+ }
@@ -14,15 +14,15 @@
14
14
  height: 100% ;
15
15
  width: 100% ;
16
16
  position: absolute;
17
- top:0
17
+ top: 0
18
18
  }
19
19
 
20
20
  [dir=ltr] .disableLayer {
21
- left:0
21
+ left: 0
22
22
  }
23
23
 
24
24
  [dir=rtl] .disableLayer {
25
- right:0
25
+ right: 0
26
26
  }
27
27
 
28
28
  .attachmentHover {
@@ -66,6 +66,10 @@
66
66
  height: var(--zd_size40) ;
67
67
  }
68
68
 
69
+ .attachleft {
70
+ padding: var(--zd_size3) ;
71
+ }
72
+
69
73
  [dir=ltr] .attachleft {
70
74
  border-right: 1px solid var(--zdt_attachment_default_border);
71
75
  }
@@ -3,10 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.getAttachmentIconDetails = getAttachmentIconDetails;
6
7
  exports.getExtensionFromFileName = getExtensionFromFileName;
7
8
  exports.isAudioFile = isAudioFile;
8
9
  exports.isBrowserSupportedFile = isBrowserSupportedFile;
9
- var UNASSIGNED = 'Unassigned';
10
+
11
+ var _General = require("../utils/General");
12
+
13
+ var _utils = require("./utils");
14
+
15
+ // const UNASSIGNED = 'Unassigned';
10
16
  var BROWSER_SUPPORTED_FILES = ['pdf', 'text', 'txt', 'css', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'ico', 'sh', 'mp3', 'wav', 'ogg'];
11
17
 
12
18
  function isAudioFile(fileName) {
@@ -25,4 +31,106 @@ function getExtensionFromFileName(fileName) {
25
31
  function isBrowserSupportedFile(fileName) {
26
32
  var extension = getExtensionFromFileName(fileName);
27
33
  return BROWSER_SUPPORTED_FILES.indexOf(extension) !== -1;
34
+ }
35
+
36
+ function getAttachmentIconDetails(fileName) {
37
+ var extension = (getExtensionFromFileName(fileName) || '').toLowerCase();
38
+
39
+ if (!extension) {
40
+ return 'ZD-GN-fileUnknown';
41
+ }
42
+
43
+ var image = _utils.SUPPORTED_FILE_EXTENSIONS.image,
44
+ doc = _utils.SUPPORTED_FILE_EXTENSIONS.doc,
45
+ pdf = _utils.SUPPORTED_FILE_EXTENSIONS.pdf,
46
+ html = _utils.SUPPORTED_FILE_EXTENSIONS.html,
47
+ ppt = _utils.SUPPORTED_FILE_EXTENSIONS.ppt,
48
+ zip = _utils.SUPPORTED_FILE_EXTENSIONS.zip,
49
+ word = _utils.SUPPORTED_FILE_EXTENSIONS.word,
50
+ xml = _utils.SUPPORTED_FILE_EXTENSIONS.xml,
51
+ sheet = _utils.SUPPORTED_FILE_EXTENSIONS.sheet,
52
+ audio = _utils.SUPPORTED_FILE_EXTENSIONS.audio,
53
+ video = _utils.SUPPORTED_FILE_EXTENSIONS.video,
54
+ mail = _utils.SUPPORTED_FILE_EXTENSIONS.mail,
55
+ linux = _utils.SUPPORTED_FILE_EXTENSIONS.linux,
56
+ css = _utils.SUPPORTED_FILE_EXTENSIONS.css,
57
+ exe = _utils.SUPPORTED_FILE_EXTENSIONS.exe,
58
+ event = _utils.SUPPORTED_FILE_EXTENSIONS.event;
59
+
60
+ if (image.includes(extension)) {
61
+ return 'ZD-EF-fileImage';
62
+ }
63
+
64
+ if (doc.includes(extension)) {
65
+ return 'ZD-GN-fileDoc';
66
+ }
67
+
68
+ if (pdf.includes(extension)) {
69
+ return 'ZD-EF-filePdf';
70
+ }
71
+
72
+ if (ppt.includes(extension)) {
73
+ return 'ZD-GN-filePpt';
74
+ }
75
+
76
+ if (zip.includes(extension)) {
77
+ return 'ZD-EF-fileZip';
78
+ }
79
+
80
+ if (word.includes(extension)) {
81
+ var OSName = (navigator.platform || '').toLowerCase();
82
+ return OSName.includes('mac') || OSName.includes('linux') ? 'ZD-EF-fileOffice' : 'ZD-EF-fileWord';
83
+ }
84
+
85
+ if (xml.includes(extension)) {
86
+ return 'ZD-EF-fileXml';
87
+ }
88
+
89
+ if (sheet.includes(extension)) {
90
+ return 'ZD-GN-fileSheet';
91
+ }
92
+
93
+ if (audio.includes(extension)) {
94
+ return 'ZD-EF-fileMp3';
95
+ }
96
+
97
+ if (video.includes(extension)) {
98
+ return 'ZD-EF-fileMp4';
99
+ }
100
+
101
+ if (mail.includes(extension)) {
102
+ return 'ZD-GN-fileMail';
103
+ }
104
+
105
+ if (linux.includes(extension)) {
106
+ return 'ZD-EF-linux';
107
+ }
108
+
109
+ if (css.includes(extension)) {
110
+ return 'ZD-EF-clrCss';
111
+ }
112
+
113
+ if (exe.includes(extension)) {
114
+ return 'ZD-EF-exe';
115
+ }
116
+
117
+ if (event.includes(extension)) {
118
+ return 'ZD-TK-event';
119
+ }
120
+
121
+ if (html.includes(extension)) {
122
+ var browser = ((0, _General.getBrowserWithVersion)() || '').toLowerCase();
123
+
124
+ if (browser.includes('chrome') || browser.includes('safari')) {
125
+ return 'ZD-EF-fileXml';
126
+ }
127
+
128
+ if (browser.includes('ie') || browser.includes('edge')) {
129
+ return 'ZD-EF-explorer';
130
+ }
131
+
132
+ return 'ZD-EF-firebox';
133
+ }
134
+
135
+ return 'ZD-GN-fileUnknown';
28
136
  }