@zohodesk/dot 1.0.0-temp-200.1 → 1.0.0-temp-187.3

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 (40) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +0 -4
  3. package/es/Attachment/Attachment.js +1 -2
  4. package/es/Attachment/Attachment.module.css +3 -7
  5. package/es/AttachmentViewer/Attachment.js +1 -60
  6. package/es/AttachmentViewer/AttachmentViewer.js +14 -148
  7. package/es/AttachmentViewer/AttachmentViewer.module.css +4 -124
  8. package/es/common/dot_common.module.css +2 -37
  9. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +4 -2
  10. package/es/list/DepartmentDropDown/DepartmentDropDown.js +7 -2
  11. package/es/list/DepartmentDropDown/props/defaultProps.js +2 -1
  12. package/es/list/DepartmentDropDown/props/propTypes.js +2 -1
  13. package/es/list/status/StatusListItem/StatusListItem.module.css +35 -5
  14. package/es/lookup/header/Search/LookupSearch.module.css +27 -33
  15. package/es/lookup/header/Search/Search.js +40 -58
  16. package/es/lookup/header/Search/__tests__/Search.spec.js +1 -67
  17. package/es/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +3 -316
  18. package/es/lookup/header/Search/props/defaultProps.js +1 -3
  19. package/es/lookup/header/Search/props/propTypes.js +1 -6
  20. package/lib/Attachment/Attachment.js +1 -3
  21. package/lib/Attachment/Attachment.module.css +3 -7
  22. package/lib/AttachmentViewer/Attachment.js +1 -88
  23. package/lib/AttachmentViewer/AttachmentViewer.js +15 -148
  24. package/lib/AttachmentViewer/AttachmentViewer.module.css +4 -124
  25. package/lib/common/dot_common.module.css +2 -37
  26. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +5 -3
  27. package/lib/list/DepartmentDropDown/DepartmentDropDown.js +8 -3
  28. package/lib/list/DepartmentDropDown/props/defaultProps.js +2 -1
  29. package/lib/list/DepartmentDropDown/props/propTypes.js +1 -1
  30. package/lib/list/status/StatusListItem/StatusListItem.module.css +35 -5
  31. package/lib/lookup/header/Search/LookupSearch.module.css +27 -33
  32. package/lib/lookup/header/Search/Search.js +66 -76
  33. package/lib/lookup/header/Search/__tests__/Search.spec.js +0 -65
  34. package/lib/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +3 -316
  35. package/lib/lookup/header/Search/props/defaultProps.js +1 -3
  36. package/lib/lookup/header/Search/props/propTypes.js +1 -6
  37. package/package.json +4 -4
  38. package/result.json +1 -1
  39. package/unittest/index.html +1 -1
  40. /package/images/{audio_thumbnail_old.png → audio_thumbnail.png} +0 -0
@@ -1,25 +1,20 @@
1
- .wrapper {
1
+ .searchStyle,
2
+ .boxStyle {
2
3
  transition: var(--zd_transition1);
3
- width: var(--zd_size160) ;
4
+ width: var(--zd_size96) ;
4
5
  height: var(--zd_size28) ;
5
6
  position: relative;
7
+ }.searchStyle, .boxStyle {
8
+ background: none;
6
9
  }
7
- .boxType {
8
- border: 1px solid transparent;
10
+ .boxStyle {
11
+ width: var(--zd_size160) ;
9
12
  border-radius: 4px;
13
+ border: 1px solid var(--zdt_lookupsearch_boxstyle_border);
10
14
  }
11
- .borderType {
12
- border-bottom: 1px solid transparent;
13
- }
14
- .boxType, .borderType {
15
- border-color: var(--zdt_lookupsearch_boxstyle_border);
16
- }
17
- .boxType:hover, .borderType:hover {
15
+ .searchStyle:hover, .boxStyle:hover {
18
16
  border-color: var(--zdt_lookupsearch_boxstyle_hover_border);
19
17
  }
20
- .boxType.active, .borderType.active {
21
- border-color: var(--zdt_lookupsearch_boxstyle_activer_border);
22
- }
23
18
  .focusWidth {
24
19
  width: var(--zd_size220) ;
25
20
  }
@@ -28,36 +23,35 @@
28
23
  height: var(--zd_size28) ;
29
24
  cursor: pointer;
30
25
  }
31
- [dir=ltr] .drpSearchBox {
32
- padding-left: var(--zd_size12) ;
26
+ .drpSearchBox::after {
27
+ content: '';
28
+ position: absolute;
29
+ top: var(--zd_size8) ;
30
+ bottom: var(--zd_size8) ;
33
31
  }
34
- [dir=rtl] .drpSearchBox {
35
- padding-right: var(--zd_size12) ;
32
+ [dir=ltr] .drpSearchBox::after {
33
+ right: calc( var(--zd_size1) * -1 ) ;
34
+ border-right: 1px solid var(--zdt_lookupsearch_boxstyle_border);
36
35
  }
37
- [dir=ltr] .searchIcon {
38
- padding-right: var(--zd_size8) ;
36
+ [dir=rtl] .drpSearchBox::after {
37
+ left: calc( var(--zd_size1) * -1 ) ;
38
+ border-left: 1px solid var(--zdt_lookupsearch_boxstyle_border);
39
39
  }
40
- [dir=rtl] .searchIcon {
41
- padding-left: var(--zd_size8) ;
40
+ .inputBox, .drpSearchBox {
41
+ padding: 0 var(--zd_size9) ;
42
42
  }
43
43
  [dir=ltr] .searchIconBox {
44
- padding-left: var(--zd_size12) ;
44
+ padding: var(--zd_size4) 0 var(--zd_size4) var(--zd_size9) ;
45
45
  }
46
46
  [dir=rtl] .searchIconBox {
47
- padding-right: var(--zd_size12) ;
47
+ padding: var(--zd_size4) var(--zd_size9) var(--zd_size4) 0 ;
48
48
  }
49
49
  .active, .boxStyle.active, .lineActive.drpSearchBox::after {
50
50
  border-color: var(--zdt_lookupsearch_boxstyle_activer_border);
51
51
  }
52
52
  [dir=ltr] .iconArrow {
53
- margin-left: var(--zd_size6) ;
53
+ margin-left: var(--zd_size5) ;
54
54
  }
55
55
  [dir=rtl] .iconArrow {
56
- margin-right: var(--zd_size6) ;
57
- }
58
- .separator {
59
- width: var(--zd_size1) ;
60
- height: var(--zd_size16) ;
61
- margin: 0 var(--zd_size12) ;
62
- background-color: var(--zdt_lookupsearch_boxstyle_border);
63
- }
56
+ margin-right: var(--zd_size5) ;
57
+ }
@@ -17,8 +17,6 @@ var _TextBoxIcon = _interopRequireDefault(require("@zohodesk/components/lib/Text
17
17
 
18
18
  var _Layout = require("@zohodesk/components/lib/Layout");
19
19
 
20
- var _utils = require("@zohodesk/utils");
21
-
22
20
  var _icons = require("@zohodesk/icons");
23
21
 
24
22
  var _ToggleDropDown = _interopRequireDefault(require("../../../dropdown/ToggleDropDown/ToggleDropDown"));
@@ -68,17 +66,33 @@ var Search = /*#__PURE__*/function (_Component) {
68
66
  _classCallCheck(this, Search);
69
67
 
70
68
  _this = _super.call(this, props);
69
+ _this.handleDropDownOpen = _this.handleDropDownOpen.bind(_assertThisInitialized(_this));
70
+ _this.handleDropDownClose = _this.handleDropDownClose.bind(_assertThisInitialized(_this));
71
71
  _this.handleTextBoxFocus = _this.handleTextBoxFocus.bind(_assertThisInitialized(_this));
72
72
  _this.handleTextBoxBlur = _this.handleTextBoxBlur.bind(_assertThisInitialized(_this));
73
73
  _this.handleGetTextBoxRef = _this.handleGetTextBoxRef.bind(_assertThisInitialized(_this));
74
- _this.handleRenderChildren = _this.handleRenderChildren.bind(_assertThisInitialized(_this));
75
74
  _this.state = {
76
- isFocus: false
75
+ isFocus: false,
76
+ isDropDownOpen: false
77
77
  };
78
78
  return _this;
79
79
  }
80
80
 
81
81
  _createClass(Search, [{
82
+ key: "handleDropDownOpen",
83
+ value: function handleDropDownOpen() {
84
+ this.setState({
85
+ isDropDownOpen: true
86
+ });
87
+ }
88
+ }, {
89
+ key: "handleDropDownClose",
90
+ value: function handleDropDownClose() {
91
+ this.setState({
92
+ isDropDownOpen: false
93
+ });
94
+ }
95
+ }, {
82
96
  key: "handleTextBoxFocus",
83
97
  value: function handleTextBoxFocus(e) {
84
98
  var onFocus = this.props.onFocus;
@@ -103,39 +117,22 @@ var Search = /*#__PURE__*/function (_Component) {
103
117
  this.textBox = el;
104
118
  getRef && getRef(el);
105
119
  }
106
- }, {
107
- key: "handleRenderChildren",
108
- value: function handleRenderChildren(_ref) {
109
- var isActive = _ref.isActive,
110
- isFocus = _ref.isFocus;
111
- var _this$props = this.props,
112
- value = _this$props.value,
113
- selectedId = _this$props.selectedId,
114
- renderChildren = _this$props.renderChildren;
115
- return renderChildren({
116
- isActive: isActive,
117
- isFocus: isFocus,
118
- value: value,
119
- selectedId: selectedId
120
- });
121
- }
122
120
  }, {
123
121
  key: "render",
124
122
  value: function render() {
125
- var _this$props2 = this.props,
126
- options = _this$props2.options,
127
- onSelect = _this$props2.onSelect,
128
- value = _this$props2.value,
129
- selectedId = _this$props2.selectedId,
130
- renderChildren = _this$props2.renderChildren;
131
- var isFocus = this.state.isFocus;
123
+ var _this$props = this.props,
124
+ options = _this$props.options,
125
+ onSelect = _this$props.onSelect,
126
+ value = _this$props.value,
127
+ selectedId = _this$props.selectedId;
128
+ var _this$state = this.state,
129
+ isFocus = _this$state.isFocus,
130
+ isDropDownOpen = _this$state.isDropDownOpen;
132
131
  var searchUIExtraProps = {
133
- isFocus: isFocus,
132
+ isFocus: isFocus || isDropDownOpen,
134
133
  onFocus: this.handleTextBoxFocus,
135
134
  onBlur: this.handleTextBoxBlur,
136
- getRef: this.handleGetTextBoxRef,
137
- value: value,
138
- renderChildren: typeof renderChildren == 'function' ? this.handleRenderChildren : undefined
135
+ getRef: this.handleGetTextBoxRef
139
136
  };
140
137
  return options ? /*#__PURE__*/_react["default"].createElement(_ToggleDropDown["default"], {
141
138
  value: value,
@@ -144,7 +141,9 @@ var Search = /*#__PURE__*/function (_Component) {
144
141
  needTick: true,
145
142
  isArrow: false,
146
143
  isToggleStateNeeded: true,
147
- selectedId: selectedId
144
+ selectedId: selectedId,
145
+ onDropDownOpen: this.handleDropDownOpen,
146
+ onDropDownClose: this.handleDropDownClose
148
147
  }, /*#__PURE__*/_react["default"].createElement(SearchUI, _extends({}, this.props, searchUIExtraProps))) : /*#__PURE__*/_react["default"].createElement(SearchUI, _extends({}, this.props, searchUIExtraProps));
149
148
  }
150
149
  }]);
@@ -183,10 +182,10 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
183
182
  key: "handleKeyDown",
184
183
  value: function handleKeyDown(e) {
185
184
  var keyCode = e.keyCode;
186
- var _this$props3 = this.props,
187
- onSearch = _this$props3.onSearch,
188
- needOnTypeSearch = _this$props3.needOnTypeSearch,
189
- onKeyDown = _this$props3.onKeyDown;
185
+ var _this$props2 = this.props,
186
+ onSearch = _this$props2.onSearch,
187
+ needOnTypeSearch = _this$props2.needOnTypeSearch,
188
+ onKeyDown = _this$props2.onKeyDown;
190
189
  onKeyDown && onKeyDown(e);
191
190
 
192
191
  if (keyCode === 13) {
@@ -196,9 +195,9 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
196
195
  }, {
197
196
  key: "handleChange",
198
197
  value: function handleChange(value) {
199
- var _this$props4 = this.props,
200
- onChange = _this$props4.onChange,
201
- needOnTypeSearch = _this$props4.needOnTypeSearch;
198
+ var _this$props3 = this.props,
199
+ onChange = _this$props3.onChange,
200
+ needOnTypeSearch = _this$props3.needOnTypeSearch;
202
201
  onChange && onChange(value);
203
202
  needOnTypeSearch && this.handleSearch();
204
203
  }
@@ -213,36 +212,26 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
213
212
  }, {
214
213
  key: "render",
215
214
  value: function render() {
216
- var _this$props5 = this.props,
217
- dataId = _this$props5.dataId,
218
- searchStr = _this$props5.searchStr,
219
- placeHolder = _this$props5.placeHolder,
220
- getRef = _this$props5.getRef,
221
- title = _this$props5.title,
222
- isBoxed = _this$props5.isBoxed,
223
- isSearchIconNeed = _this$props5.isSearchIconNeed,
224
- options = _this$props5.options,
225
- activeClass = _this$props5.activeClass,
226
- isFocus = _this$props5.isFocus,
227
- onFocus = _this$props5.onFocus,
228
- onBlur = _this$props5.onBlur,
229
- renderChildren = _this$props5.renderChildren,
230
- isActive = _this$props5.isActive,
231
- hasSeparator = _this$props5.hasSeparator,
232
- customStyle = _this$props5.customStyle;
233
- var isActiveState = isFocus || isActive;
234
- var isFocusWidth = isActiveState || searchStr;
235
- var style = (0, _utils.mergeStyle)(_LookupSearchModule["default"], customStyle);
215
+ var _this$props4 = this.props,
216
+ dataId = _this$props4.dataId,
217
+ searchStr = _this$props4.searchStr,
218
+ placeHolder = _this$props4.placeHolder,
219
+ getRef = _this$props4.getRef,
220
+ title = _this$props4.title,
221
+ isBoxed = _this$props4.isBoxed,
222
+ isSearchIconNeed = _this$props4.isSearchIconNeed,
223
+ options = _this$props4.options,
224
+ activeClass = _this$props4.activeClass,
225
+ isFocus = _this$props4.isFocus,
226
+ onFocus = _this$props4.onFocus,
227
+ onBlur = _this$props4.onBlur;
236
228
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
237
229
  isCover: false,
238
230
  alignBox: "row",
239
231
  align: "vertical",
240
- className: "\n ".concat(style.wrapper, " ").concat(isBoxed ? style.boxType : style.borderType, " \n ").concat(isActiveState ? "".concat(style.active, " ").concat(activeClass || '') : '', "\n ").concat(isFocusWidth ? style.focusWidth : '', "\n ")
241
- }, typeof renderChildren == 'function' ? renderChildren({
242
- isActive: isActive,
243
- isFocus: isFocus
244
- }) : options ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
245
- className: "".concat(style.drpSearchBox, " ").concat(isActiveState ? style.lineActive : ''),
232
+ className: "".concat(_LookupSearchModule["default"].searchStyle, " ").concat(isBoxed ? _LookupSearchModule["default"].boxStyle : '', " ").concat(isFocus ? "".concat(_LookupSearchModule["default"].active, " ").concat(activeClass ? activeClass : '', " ") : '', " ").concat(searchStr || isFocus ? _LookupSearchModule["default"].focusWidth : '')
233
+ }, options && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
234
+ className: "".concat(_LookupSearchModule["default"].drpSearchBox, " ").concat(isFocus ? _LookupSearchModule["default"].lineActive : ''),
246
235
  isCover: false,
247
236
  align: "vertical",
248
237
  alignBox: "row",
@@ -253,17 +242,18 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
253
242
  }), /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
254
243
  name: "ZD-down",
255
244
  size: "7",
256
- iconClass: style.iconArrow
257
- })) : isSearchIconNeed ? /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
245
+ iconClass: _LookupSearchModule["default"].iconArrow
246
+ })), isSearchIconNeed && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
247
+ className: _LookupSearchModule["default"].searchIconBox
248
+ }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
258
249
  name: "ZD-search",
259
- size: "11",
260
- iconClass: "".concat(style.searchIcon, " ").concat(isBoxed ? style.searchIconBox : '')
261
- }) : null, hasSeparator ? /*#__PURE__*/_react["default"].createElement("div", {
262
- className: style.separator
263
- }) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
264
- flexible: true,
265
- onClick: _Common.cancelBubblingEffect
250
+ size: "11"
251
+ })), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
252
+ flexible: true
266
253
  }, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
254
+ customClass: {
255
+ customTextBox: "".concat(isBoxed ? _LookupSearchModule["default"].inputBox : '')
256
+ },
267
257
  customProps: {
268
258
  TextBoxProps: {
269
259
  'data-a11y-autofocus': true
@@ -272,6 +262,7 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
272
262
  placeHolder: placeHolder,
273
263
  value: searchStr,
274
264
  onChange: this.handleChange,
265
+ onClick: _Common.cancelBubblingEffect,
275
266
  onFocus: onFocus,
276
267
  onBlur: onBlur,
277
268
  onKeyDown: this.handleKeyDown,
@@ -280,8 +271,7 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
280
271
  size: "small",
281
272
  inputRef: getRef,
282
273
  onClear: this.handleClear,
283
- onClearMouseDown: _Common.cancelBubblingEffect,
284
- needBorder: false
274
+ onClearMouseDown: _Common.cancelBubblingEffect
285
275
  })));
286
276
  }
287
277
  }]);
@@ -8,7 +8,6 @@ var _Search = _interopRequireDefault(require("../Search"));
8
8
 
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
10
 
11
- afterEach(_react2.cleanup);
12
11
  describe('Search', function () {
13
12
  test('rendering the defult props', function () {
14
13
  var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Search["default"], null)),
@@ -16,68 +15,4 @@ describe('Search', function () {
16
15
 
17
16
  expect(asFragment()).toMatchSnapshot();
18
17
  });
19
- test('rendering the search active', function () {
20
- var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Search["default"], null)),
21
- asFragment = _render2.asFragment,
22
- getByRole = _render2.getByRole;
23
-
24
- _react2.fireEvent.focus(getByRole('textbox'));
25
-
26
- expect(asFragment()).toMatchSnapshot();
27
- });
28
- test('rendering the prop hasSeparator is true', function () {
29
- var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Search["default"], {
30
- hasSeparator: true
31
- })),
32
- asFragment = _render3.asFragment;
33
-
34
- expect(asFragment()).toMatchSnapshot();
35
- });
36
- test('rendering the prop hasSeparator is false', function () {
37
- var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Search["default"], {
38
- hasSeparator: false
39
- })),
40
- asFragment = _render4.asFragment;
41
-
42
- expect(asFragment()).toMatchSnapshot();
43
- });
44
- test('rendering the renderChildren props via function', function () {
45
- var options = [{
46
- value: 'All Fields',
47
- id: '1'
48
- }, {
49
- value: 'Account',
50
- id: '3'
51
- }, {
52
- value: 'Customer Place',
53
- id: '4'
54
- }, {
55
- value: 'Conatct ID',
56
- id: '5'
57
- }];
58
-
59
- function renderChildren(_ref) {
60
- var value = _ref.value;
61
- return /*#__PURE__*/_react["default"].createElement("div", null, value);
62
- }
63
-
64
- var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Search["default"], {
65
- value: "All Fields",
66
- renderChildren: renderChildren,
67
- options: options
68
- })),
69
- asFragment = _render5.asFragment;
70
-
71
- expect(asFragment()).toMatchSnapshot();
72
- });
73
- test('rendering the customized style search', function () {
74
- var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Search["default"], {
75
- customStyle: {
76
- wrapper: "searchWrapperClass"
77
- }
78
- })),
79
- asFragment = _render6.asFragment;
80
-
81
- expect(asFragment()).toMatchSnapshot();
82
- });
83
18
  });