@zohodesk/dot 1.0.0-temp-229.2 → 1.0.0-temp-230.2

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 (35) hide show
  1. package/README.md +7 -5
  2. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +0 -3
  3. package/assets/Appearance/light/mode/Dot_LightMode.module.css +0 -3
  4. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +0 -3
  5. package/es/AttachmentViewer/AttachmentImage.js +3 -1
  6. package/es/AttachmentViewer/AttachmentViewer.js +119 -23
  7. package/es/AttachmentViewer/AttachmentViewer.module.css +1 -1
  8. package/es/AttachmentViewer/props/defaultProps.js +2 -1
  9. package/es/AttachmentViewer/props/propTypes.js +9 -1
  10. package/es/Link/Link.js +4 -3
  11. package/es/Link/props/propTypes.js +1 -0
  12. package/es/common/dot_boxShadow.module.css +0 -2
  13. package/es/form/fields/SelectField/SelectField.js +2 -4
  14. package/es/form/fields/SelectField/props/defaultProps.js +0 -1
  15. package/es/form/fields/SelectField/props/propTypes.js +0 -1
  16. package/es/list/status/StatusDropdown/StatusDropdown.js +79 -121
  17. package/es/list/status/StatusDropdown/StatusDropdown.module.css +7 -54
  18. package/es/list/status/StatusDropdown/props/defaultProps.js +1 -2
  19. package/es/list/status/StatusDropdown/props/propTypes.js +1 -2
  20. package/lib/AttachmentViewer/AttachmentImage.js +3 -1
  21. package/lib/AttachmentViewer/AttachmentViewer.js +181 -80
  22. package/lib/AttachmentViewer/AttachmentViewer.module.css +1 -1
  23. package/lib/AttachmentViewer/props/defaultProps.js +2 -1
  24. package/lib/AttachmentViewer/props/propTypes.js +9 -1
  25. package/lib/Link/Link.js +4 -3
  26. package/lib/Link/props/propTypes.js +1 -0
  27. package/lib/common/dot_boxShadow.module.css +0 -2
  28. package/lib/form/fields/SelectField/SelectField.js +2 -4
  29. package/lib/form/fields/SelectField/props/defaultProps.js +0 -1
  30. package/lib/form/fields/SelectField/props/propTypes.js +0 -1
  31. package/lib/list/status/StatusDropdown/StatusDropdown.js +81 -133
  32. package/lib/list/status/StatusDropdown/StatusDropdown.module.css +7 -54
  33. package/lib/list/status/StatusDropdown/props/defaultProps.js +1 -2
  34. package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
  35. package/package.json +8 -8
@@ -13,7 +13,6 @@ import StatusListItem from "../StatusListItem/StatusListItem";
13
13
  import commonStyle from '@zohodesk/components/es/common/common.module.css';
14
14
  import ResponsiveDropBox from '@zohodesk/components/es/ResponsiveDropBox/ResponsiveDropBox';
15
15
  import { ResponsiveReceiver } from '@zohodesk/components/es/Responsive/CustomResponsive';
16
- import Flex from '@zohodesk/layout/es/Flex/Flex';
17
16
  import { getUniqueId } from '@zohodesk/components/es/Provider/IdProvider';
18
17
  import btnStyle from '@zohodesk/components/es/semantic/Button/semanticButton.module.css';
19
18
  import style from "./StatusDropdown.module.css";
@@ -31,11 +30,6 @@ export class StatusDropdown extends React.Component {
31
30
  this.searchList = this.searchList.bind(this);
32
31
  this.handleScroll = this.handleScroll.bind(this);
33
32
  this.emptySearchSVG = this.emptySearchSVG.bind(this);
34
- this.getSearchA11y = this.getSearchA11y.bind(this);
35
- this.getHeadingA11y = this.getHeadingA11y.bind(this);
36
- this.getListItemA11y = this.getListItemA11y.bind(this);
37
- this.getTextBoxIconCustomProps = this.getTextBoxIconCustomProps.bind(this);
38
- this.handleListItemClick = this.handleListItemClick.bind(this);
39
33
  this.getAriaId = getUniqueId(this);
40
34
  }
41
35
 
@@ -130,44 +124,6 @@ export class StatusDropdown extends React.Component {
130
124
  };
131
125
  }
132
126
 
133
- getSearchA11y() {
134
- return {
135
- ariaHaspopup: this.props.isSearch ? 'listbox' : 'menu',
136
- ariaExpanded: this.props.isPopupReady,
137
- role: 'combobox',
138
- ariaActivedescendant: this.props.isPopupReady ? this.props.value : '',
139
- ariaOwns: this.getAriaId()
140
- };
141
- }
142
-
143
- getHeadingA11y() {
144
- return {
145
- role: 'heading'
146
- };
147
- }
148
-
149
- getListItemA11y(isActive, listItemText) {
150
- return {
151
- role: this.props.isSearch ? 'option' : 'menuitem',
152
- ariaSelected: isActive,
153
- ariaLabel: listItemText
154
- };
155
- }
156
-
157
- getTextBoxIconCustomProps() {
158
- return {
159
- TextBoxProps: {
160
- 'data-a11y-autofocus': true
161
- }
162
- };
163
- }
164
-
165
- handleListItemClick(item) {
166
- return e => {
167
- this.onSelect(item, e);
168
- };
169
- }
170
-
171
127
  render() {
172
128
  let {
173
129
  options
@@ -223,12 +179,10 @@ export class StatusDropdown extends React.Component {
223
179
  renderTargetElement,
224
180
  renderFooterElement,
225
181
  a11y = {},
226
- customClass,
227
- renderCustomDropBoxHeader
182
+ customClass
228
183
  } = this.props;
229
184
  const {
230
- dropBoxClass = '',
231
- customDropBoxHeader = ''
185
+ dropBoxClass = ''
232
186
  } = customClass;
233
187
  const {
234
188
  tabIndex = 0,
@@ -241,9 +195,6 @@ export class StatusDropdown extends React.Component {
241
195
  } = this.state;
242
196
  let containerClass = `${className ? className : ''} ${isPopupReady ? activeStyle ? activeStyle : '' : showIconOnHover ? style.hoverIcon : ''} ${isDisabled ? commonStyle.disabled : isReadOnly ? style.readOnly : !isEditable ? style.cursorDefault : !showOnHover ? `${style.cursor} ${hoverStyle ? hoverStyle : ''}` : `${hoverStyle ? hoverStyle : ''} ${style.cursorDefault}`}`;
243
197
  let ariaTitleId = this.getAriaId();
244
- let textBoxA11y = this.getSearchA11y();
245
- let headingA11y = this.getHeadingA11y();
246
- let textBoxIconCustomProps = this.getTextBoxIconCustomProps();
247
198
  return /*#__PURE__*/React.createElement("div", {
248
199
  className: style.posRel,
249
200
  onMouseEnter: showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : undefined,
@@ -300,8 +251,8 @@ export class StatusDropdown extends React.Component {
300
251
  isAnimate: true,
301
252
  getRef: getContainerRef,
302
253
  customClass: {
303
- customDropBoxWrap: `${style.dropBoxContainer} `,
304
- customDropBox: `${dropBoxClass} ${renderCustomDropBoxHeader ? style.dropBoxWithCustomHeader : ''}`
254
+ customDropBoxWrap: style.dropBoxContainer,
255
+ customDropBox: dropBoxClass
305
256
  },
306
257
  needResponsive: needResponsive,
307
258
  isResponsivePadding: true,
@@ -319,74 +270,81 @@ export class StatusDropdown extends React.Component {
319
270
  isFetchingOptions: isFetchingOptions
320
271
  }
321
272
  }
322
- }, (() => {
323
- const dropdownContent = /*#__PURE__*/React.createElement(React.Fragment, null, isSearch ? /*#__PURE__*/React.createElement(Box, {
324
- className: style.search
325
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
326
- placeHolder: placeHolderText,
327
- onChange: this.handleChange,
328
- value: searchString,
329
- onClear: this.onSearchClear,
330
- size: searchBoxSize,
331
- customProps: textBoxIconCustomProps,
332
- a11y: textBoxA11y,
333
- dataId: `${dataId}_search`
334
- })) : null, title && options.length != 0 && /*#__PURE__*/React.createElement(Box, {
335
- className: style.title
336
- }, /*#__PURE__*/React.createElement(DropDownHeading, {
337
- htmlId: ariaTitleId,
338
- text: title,
339
- a11y: headingA11y
340
- })), /*#__PURE__*/React.createElement(Box, {
341
- scroll: "vertical",
342
- flexible: true,
343
- shrink: true,
344
- dataId: `${dataId}_list`,
345
- preventParentScroll: "vertical",
346
- className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
347
- onScroll: this.handleScroll,
348
- role: isSearch ? 'listbox' : 'menu',
349
- tabindex: "-1",
350
- isScrollAttribute: true
351
- }, options.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((item, i) => {
352
- const listItemText = item[keyName];
353
- const isActive = value === listItemText;
354
- return /*#__PURE__*/React.createElement(StatusListItem, {
355
- key: item[idName] || i,
356
- dataId: `dataid_${i}`,
357
- value: listItemText,
358
- id: item[idName],
359
- active: isActive,
360
- onClick: this.handleListItemClick(item),
361
- index: i,
362
- needTick: needTick,
363
- needBorder: false,
364
- bulletColor: item[statusColor],
365
- title: listItemText,
366
- needMultiLineText: needMultiLineText,
367
- autoHover: true,
368
- a11y: this.getListItemA11y(isActive, listItemText)
369
- });
370
- }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
371
- isCover: false,
372
- align: "both"
373
- }, /*#__PURE__*/React.createElement(Loader, null))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
374
- className: style.svgWrapper,
375
- title: searchErrorText || 'No results',
376
- description: searchEmptyHint,
377
- size: "small",
378
- getEmptyState: this.emptySearchSVG
379
- }) : /*#__PURE__*/React.createElement("div", {
380
- className: style.loader
381
- }, /*#__PURE__*/React.createElement(Loader, null))), renderFooterElement ? renderFooterElement : null);
382
- return renderCustomDropBoxHeader ? /*#__PURE__*/React.createElement("div", {
383
- className: style.dropBoxListContainer
384
- }, /*#__PURE__*/React.createElement(Flex, {
385
- $ui_className: `${customDropBoxHeader} ${style.customDropBoxHeaderContainer}`
386
- }, renderCustomDropBoxHeader), /*#__PURE__*/React.createElement("div", {
387
- className: style.dropdownOptions
388
- }, dropdownContent)) : dropdownContent;
389
- })());
273
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, isSearch ? /*#__PURE__*/React.createElement(Box, {
274
+ className: style.search
275
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
276
+ placeHolder: placeHolderText,
277
+ onChange: this.handleChange,
278
+ value: searchString,
279
+ onClear: this.onSearchClear,
280
+ size: searchBoxSize,
281
+ customProps: {
282
+ TextBoxProps: {
283
+ 'data-a11y-autofocus': true
284
+ }
285
+ },
286
+ a11y: {
287
+ ariaHaspopup: isSearch ? 'listbox' : 'menu',
288
+ ariaExpanded: isPopupReady,
289
+ role: 'combobox',
290
+ ariaActivedescendant: isPopupReady ? value : '',
291
+ ariaOwns: ariaTitleId
292
+ },
293
+ dataId: `${dataId}_search`
294
+ })) : null, title && options.length != 0 && /*#__PURE__*/React.createElement(Box, {
295
+ className: style.title
296
+ }, /*#__PURE__*/React.createElement(DropDownHeading, {
297
+ htmlId: ariaTitleId,
298
+ text: title,
299
+ a11y: {
300
+ role: 'heading'
301
+ }
302
+ })), /*#__PURE__*/React.createElement(Box, {
303
+ scroll: "vertical",
304
+ flexible: true,
305
+ shrink: true,
306
+ dataId: `${dataId}_list`,
307
+ preventParentScroll: "vertical",
308
+ className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
309
+ onScroll: this.handleScroll,
310
+ role: isSearch ? 'listbox' : 'menu',
311
+ tabindex: "-1",
312
+ isScrollAttribute: true
313
+ }, options.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((item, i) => {
314
+ const listItemText = item[keyName];
315
+ const isActive = value === listItemText;
316
+ return /*#__PURE__*/React.createElement(StatusListItem, {
317
+ key: i,
318
+ dataId: `dataid_${i}`,
319
+ value: listItemText,
320
+ id: item[idName],
321
+ active: isActive,
322
+ onClick: this.onSelect.bind(this, item),
323
+ index: i,
324
+ needTick: needTick,
325
+ needBorder: false,
326
+ bulletColor: item[statusColor],
327
+ title: listItemText,
328
+ needMultiLineText: needMultiLineText,
329
+ autoHover: true,
330
+ a11y: {
331
+ role: isSearch ? 'option' : 'menuitem',
332
+ ariaSelected: isActive,
333
+ ariaLabel: listItemText
334
+ }
335
+ });
336
+ }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
337
+ isCover: false,
338
+ align: "both"
339
+ }, /*#__PURE__*/React.createElement(Loader, null))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
340
+ className: style.svgWrapper,
341
+ title: searchErrorText || 'No results',
342
+ description: searchEmptyHint,
343
+ size: "small",
344
+ getEmptyState: this.emptySearchSVG
345
+ }) : /*#__PURE__*/React.createElement("div", {
346
+ className: style.loader
347
+ }, /*#__PURE__*/React.createElement(Loader, null))), renderFooterElement ? renderFooterElement : null));
390
348
  }) : null);
391
349
  }
392
350
 
@@ -1,130 +1,83 @@
1
1
  .container {
2
2
  max-width: 100% ;
3
3
  }
4
-
5
- .dropBoxListContainer {
6
- border-radius: 7px;
7
- padding: var(--zd_size10) ;
8
- border: 1px solid var(--zdt_statusdropdown_wrapper_container_border);
9
- background: var(--zdt_statusdropdown_wrapper_container_bg);
10
- box-shadow: var(--zd_bs_statusdropdown_wrapper_container);
11
- }
12
-
13
- .dropdownOptions {
14
- padding-inline: var(--zd_size1) ;
15
- padding-block: var(--zd_size1) ;
16
- background-color: var(--zdt_statusdropdown_wrapper_dropdown_bg);
17
- border: 1px solid var(--zdt_statusdropdown_wrapper_container_border);
18
- border-radius: 7px;
19
- }
20
-
21
4
  .posRel {
22
5
  position: relative;
23
6
  }
24
-
25
7
  .maxHgt {
26
8
  max-height: var(--zd_size265) ;
27
9
  padding-block: var(--zd_size10) ;
28
- padding-inline: 0 ;
10
+ padding-inline:0 ;
29
11
  }
30
-
31
- .responsivemaxHgt {
12
+ .responsivemaxHgt{
32
13
  padding-block: var(--zd_size10) 0 ;
33
- padding-inline: 0 ;
14
+ padding-inline:0 ;
34
15
  }
35
-
36
16
  .title {
37
17
  padding-block-start: var(--zd_size6) ;
38
18
  }
39
-
40
19
  .default_arrow,
41
20
  .overlay_arrow {
42
21
  padding-inline: var(--zd_size5) 0 ;
43
- padding-block: 0 ;
22
+ padding-block:0 ;
44
23
  }
45
-
46
24
  .overlay_arrow {
47
25
  position: absolute;
48
26
  top: 50% ;
49
27
  transform: translateY(-50%) perspective(1px);
50
28
  }
51
-
52
29
  [dir=ltr] .overlay_arrow {
53
30
  left: 100% ;
54
31
  }
55
-
56
32
  [dir=rtl] .overlay_arrow {
57
33
  right: 100% ;
58
34
  }
59
-
60
35
  .hoverIcon .arrow {
61
36
  opacity: 0;
62
37
  visibility: hidden;
63
38
  }
64
-
65
39
  .hoverIcon:hover .arrow {
66
40
  opacity: 1;
67
41
  visibility: visible;
68
42
  }
69
-
70
43
  .value {
71
44
  composes: dotted from '~@zohodesk/components/es/common/common.module.css';
72
45
  }
73
-
74
46
  .search {
75
47
  padding-block: var(--zd_size6) 0 ;
76
- padding-inline: var(--zd_size20) ;
48
+ padding-inline:var(--zd_size20) ;
77
49
  }
78
-
79
50
  .svgWrapper {
80
51
  padding-block-end: var(--zd_size25) ;
81
52
  }
82
-
83
53
  .readOnly {
84
54
  cursor: no-drop;
85
55
  }
86
-
87
56
  .cursorDefault {
88
57
  cursor: default;
89
58
  }
90
-
91
59
  .cursor {
92
60
  cursor: pointer;
93
61
  }
94
-
95
62
  [dir=ltr] .dropBoxContainer {
96
63
  text-align: left;
97
64
  }
98
-
99
65
  [dir=rtl] .dropBoxContainer {
100
66
  text-align: right;
101
67
  }
102
-
103
68
  .iconBox {
104
69
  margin-inline-end: var(--zd_size4) ;
105
70
  }
106
-
107
- .iconBox>i {
71
+ .iconBox > i {
108
72
  display: block;
109
73
  }
110
-
111
74
  .loader {
112
75
  width: var(--zd_size40) ;
113
76
  margin: 0 auto ;
114
77
  }
115
-
116
78
  .seperatedLine {
117
79
  height: var(--zd_size1) ;
118
80
  margin-block: var(--zd_size9) var(--zd_size10) ;
119
- margin-inline: 0 ;
81
+ margin-inline:0 ;
120
82
  border-bottom: 1px solid var(--zdt_statusdropdown_line_border);
121
83
  }
122
-
123
- .customDropBoxHeaderContainer {
124
- margin-block-end: var(--zd_size6) ;
125
- margin-inline: var(--zd_size1) ;
126
- }
127
-
128
- .dropBoxWithCustomHeader {
129
- border-radius: 7px;
130
- }
@@ -19,6 +19,5 @@ export const defaultProps = {
19
19
  isFetchingOptions: false,
20
20
  isAbsolutePositioningNeeded: true,
21
21
  isRestrictScroll: false,
22
- customClass: {},
23
- renderCustomDropBoxHeader: null
22
+ customClass: {}
24
23
  };
@@ -59,6 +59,5 @@ export const propTypes = {
59
59
  targetOffset: PropTypes.object,
60
60
  customClass: PropTypes.shape({
61
61
  dropBoxClass: PropTypes.string
62
- }),
63
- renderCustomDropBoxHeader: PropTypes.node
62
+ })
64
63
  };
@@ -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
  });