@zohodesk/dot 1.0.0-temp-89 → 1.0.0-temp-94

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 (125) hide show
  1. package/README.md +26 -1
  2. package/es/Provider.js +5 -105
  3. package/es/alert/AlertLookup/AlertLookup.js +11 -4
  4. package/es/alert/AlertLookup/docs/AlertLookup__default.docs.js +4 -3
  5. package/es/docs/formDocs.js +5 -1
  6. package/es/docs/generalDocs.js +5 -2
  7. package/es/dropdown/ToggleDropDown/ToggleDropDown.js +3 -2
  8. package/es/dropdown/ToggleDropDown/ToggleDropDown.module.css +3 -2
  9. package/es/emptystate/CommonEmptyState/docs/CommonEmptyState__default.docs.js +3 -3
  10. package/es/emptystate/EditionPage/EditionPage.js +1 -1
  11. package/es/errorstate/Inconvenience/Inconvenience.js +1 -1
  12. package/es/errorstate/NoRequestFound/NoRequestFound.js +1 -1
  13. package/es/errorstate/PermissionPlay/PermissionPlay.js +1 -1
  14. package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +1 -1
  15. package/es/errorstate/UnableToProcess/UnableToProcess.js +1 -1
  16. package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
  17. package/es/errorstate/WillBack/WillBack.js +1 -1
  18. package/es/form/fields/CheckBoxField/CheckBoxField.js +16 -28
  19. package/es/form/fields/CheckBoxField/docs/CheckBoxField__default.docs.js +8 -1
  20. package/es/form/fields/CurrencyField/CurrencyField.js +16 -29
  21. package/es/form/fields/CurrencyField/docs/CurrencyField__default.docs.js +36 -0
  22. package/es/form/fields/DateField/DateField.js +16 -28
  23. package/es/form/fields/DateField/docs/DateField__default.docs.js +8 -1
  24. package/es/form/fields/FieldContainer/FieldContainer.js +82 -0
  25. package/es/form/fields/FieldContainer/docs/FieldContainer__default.docs.js +49 -0
  26. package/es/form/fields/MultiSelectField/MultiSelectField.js +16 -28
  27. package/es/form/fields/MultiSelectField/docs/MultiSelectField__default.docs.js +8 -1
  28. package/es/form/fields/SelectField/SelectField.js +16 -28
  29. package/es/form/fields/SelectField/docs/SelectField__default.docs.js +8 -1
  30. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +9 -6
  31. package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +32 -28
  32. package/es/form/fields/TextBoxField/TextBoxField.js +18 -43
  33. package/es/form/fields/TextBoxField/docs/TextBoxField__default.docs.js +28 -1
  34. package/es/form/fields/TextEditorField/TextEditorField.js +27 -44
  35. package/es/form/fields/TextEditorField/docs/TextEditorField__default.docs.js +9 -2
  36. package/es/form/fields/TextareaField/TextareaField.js +16 -28
  37. package/es/form/fields/TextareaField/docs/TextareaField__default.docs.js +8 -1
  38. package/es/form/fields/props/FieldCommonDefaultProps.js +10 -0
  39. package/es/form/fields/props/FieldCommonPropTypes.js +22 -0
  40. package/es/list/BluePrintStatus/BluePrintStatus.js +2 -4
  41. package/es/list/BluePrintStatus/BluePrintStatus.module.css +6 -8
  42. package/es/list/GridStencils/GridStencils.module.css +7 -18
  43. package/es/list/SecondaryText/AccountName.js +22 -39
  44. package/es/list/SecondaryText/ContactName.js +1 -3
  45. package/es/list/SecondaryText/SecondaryText.module.css +45 -15
  46. package/es/list/SecondaryText/docs/SecondaryText__default.docs.js +114 -0
  47. package/es/list/SentimentStatus/SentimentStatus.js +4 -6
  48. package/es/list/SentimentStatus/SentimentStatus.module.css +4 -9
  49. package/es/list/UserTime/UserTime.js +3 -5
  50. package/es/list/UserTime/UserTime.module.css +20 -3
  51. package/es/list/status/StatusDropdown/StatusDropdown.js +3 -2
  52. package/es/lookup/EmptyPage/EmptyPage.js +4 -4
  53. package/es/lookup/header/ViewDropDown/ViewDropDown.js +1 -1
  54. package/es/svg/PlusIcon.js +1 -1
  55. package/es/svg/SnippetIcon.js +1 -1
  56. package/es/svg/TemplateIcon.js +1 -1
  57. package/es/version2/errorstate/Inconvenience/Inconvenience.js +1 -1
  58. package/es/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +1 -1
  59. package/es/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +1 -1
  60. package/es/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
  61. package/es/version2/errorstate/UrlNotFound/UrlNotFound.js +1 -1
  62. package/es/version2/errorstate/WillBeRightBack/WillBeRightBack.js +1 -1
  63. package/lib/Provider.js +6 -123
  64. package/lib/alert/AlertLookup/AlertLookup.js +11 -4
  65. package/lib/alert/AlertLookup/docs/AlertLookup__default.docs.js +4 -3
  66. package/lib/docs/formDocs.js +32 -0
  67. package/lib/docs/generalDocs.js +8 -0
  68. package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +3 -2
  69. package/lib/dropdown/ToggleDropDown/ToggleDropDown.module.css +3 -2
  70. package/lib/emptystate/CommonEmptyState/docs/CommonEmptyState__default.docs.js +3 -3
  71. package/lib/emptystate/EditionPage/EditionPage.js +1 -1
  72. package/lib/errorstate/Inconvenience/Inconvenience.js +1 -1
  73. package/lib/errorstate/NoRequestFound/NoRequestFound.js +1 -1
  74. package/lib/errorstate/PermissionPlay/PermissionPlay.js +1 -1
  75. package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +1 -1
  76. package/lib/errorstate/UnableToProcess/UnableToProcess.js +1 -1
  77. package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
  78. package/lib/errorstate/WillBack/WillBack.js +1 -1
  79. package/lib/form/fields/CheckBoxField/CheckBoxField.js +23 -29
  80. package/lib/form/fields/CheckBoxField/docs/CheckBoxField__default.docs.js +8 -1
  81. package/lib/form/fields/CurrencyField/CurrencyField.js +23 -30
  82. package/lib/{list/SecondaryText/docs/ContactName__default.docs.js → form/fields/CurrencyField/docs/CurrencyField__default.docs.js} +29 -16
  83. package/lib/form/fields/DateField/DateField.js +23 -29
  84. package/lib/form/fields/DateField/docs/DateField__default.docs.js +8 -1
  85. package/lib/form/fields/FieldContainer/FieldContainer.js +136 -0
  86. package/lib/form/fields/FieldContainer/docs/FieldContainer__default.docs.js +104 -0
  87. package/lib/form/fields/MultiSelectField/MultiSelectField.js +23 -29
  88. package/lib/form/fields/MultiSelectField/docs/MultiSelectField__default.docs.js +8 -1
  89. package/lib/form/fields/SelectField/SelectField.js +23 -29
  90. package/lib/form/fields/SelectField/docs/SelectField__default.docs.js +8 -1
  91. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +9 -6
  92. package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +36 -30
  93. package/lib/form/fields/TextBoxField/TextBoxField.js +25 -45
  94. package/lib/form/fields/TextBoxField/docs/TextBoxField__default.docs.js +35 -2
  95. package/lib/form/fields/TextEditorField/TextEditorField.js +33 -47
  96. package/lib/form/fields/TextEditorField/docs/TextEditorField__default.docs.js +9 -2
  97. package/lib/form/fields/TextareaField/TextareaField.js +23 -29
  98. package/lib/form/fields/TextareaField/docs/TextareaField__default.docs.js +8 -1
  99. package/lib/form/fields/props/FieldCommonDefaultProps.js +19 -0
  100. package/lib/form/fields/props/FieldCommonPropTypes.js +34 -0
  101. package/lib/list/BluePrintStatus/BluePrintStatus.js +2 -4
  102. package/lib/list/BluePrintStatus/BluePrintStatus.module.css +6 -8
  103. package/lib/list/GridStencils/GridStencils.module.css +7 -18
  104. package/lib/list/SecondaryText/AccountName.js +22 -40
  105. package/lib/list/SecondaryText/ContactName.js +1 -4
  106. package/lib/list/SecondaryText/SecondaryText.module.css +45 -15
  107. package/lib/list/SecondaryText/docs/SecondaryText__default.docs.js +162 -0
  108. package/lib/list/SentimentStatus/SentimentStatus.js +4 -6
  109. package/lib/list/SentimentStatus/SentimentStatus.module.css +4 -9
  110. package/lib/list/UserTime/UserTime.js +3 -5
  111. package/lib/list/UserTime/UserTime.module.css +20 -3
  112. package/lib/list/status/StatusDropdown/StatusDropdown.js +3 -2
  113. package/lib/lookup/EmptyPage/EmptyPage.js +4 -4
  114. package/lib/lookup/header/ViewDropDown/ViewDropDown.js +1 -1
  115. package/lib/svg/PlusIcon.js +1 -1
  116. package/lib/svg/SnippetIcon.js +1 -1
  117. package/lib/svg/TemplateIcon.js +1 -1
  118. package/lib/version2/errorstate/Inconvenience/Inconvenience.js +1 -1
  119. package/lib/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +1 -1
  120. package/lib/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +1 -1
  121. package/lib/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
  122. package/lib/version2/errorstate/UrlNotFound/UrlNotFound.js +1 -1
  123. package/lib/version2/errorstate/WillBeRightBack/WillBeRightBack.js +1 -1
  124. package/package.json +10 -9
  125. package/es/list/SecondaryText/docs/ContactName__default.docs.js +0 -23
@@ -2,11 +2,18 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import React, { useState, useEffect } from 'react';
4
4
  import PropTypes from 'prop-types';
5
- import { Container, Box } from '@zohodesk/components/lib/Layout';
5
+ import { Box } from '@zohodesk/components/lib/Layout';
6
6
  import Label from '@zohodesk/components/lib/Label/Label';
7
7
  import Popup from '@zohodesk/components/lib/Popup/Popup';
8
8
  import ValidationMessage from '../ValidationMessage/ValidationMessage';
9
9
  import TagsMultiSelect from '../TagsMultiSelect/TagsMultiSelect';
10
+ import FieldContainer from '../FieldContainer/FieldContainer';
11
+ /**** props ****/
12
+
13
+ import { FieldCommonDefaultProps } from '../props/FieldCommonDefaultProps';
14
+ import { FieldCommonPropTypes } from '../props/FieldCommonPropTypes';
15
+ /**** css ****/
16
+
10
17
  import fieldStyle from '../Fields.module.css';
11
18
  import style from './TagsMultiSelectField.module.css';
12
19
 
@@ -36,7 +43,8 @@ const TagsMultiSelectField = props => {
36
43
  getTextBoxChildren,
37
44
  children,
38
45
  ePhiData,
39
- customProps
46
+ customProps,
47
+ clickableTag
40
48
  } = props;
41
49
  const {
42
50
  LabelProps = {},
@@ -71,11 +79,6 @@ const TagsMultiSelectField = props => {
71
79
  validationMessage,
72
80
  options
73
81
  } = fieldProperties;
74
- let {
75
- ePhiTitle = '',
76
- ePhiText = '',
77
- ePhiStatus = false
78
- } = ePhiData;
79
82
  options = options || [];
80
83
 
81
84
  const handleKeyUp = event => {
@@ -173,6 +176,10 @@ const TagsMultiSelectField = props => {
173
176
  changeSearchValue('');
174
177
  };
175
178
 
179
+ const renderEnd = () => {
180
+ return children ? children : null;
181
+ };
182
+
176
183
  useEffect(() => {
177
184
  window.addEventListener('click', documentClick);
178
185
  return () => {
@@ -180,12 +187,14 @@ const TagsMultiSelectField = props => {
180
187
  };
181
188
  }, []);
182
189
  return /*#__PURE__*/React.createElement("div", {
183
- className: `${style.container} ${isDisabled ? fieldStyle.disabled : isReadOnly ? fieldStyle.readonly : ''}`
184
- }, /*#__PURE__*/React.createElement(Container, {
185
- alignBox: "row",
186
- align: "baseline",
187
- isCover: false
188
- }, labelName && /*#__PURE__*/React.createElement(Label, _extends({
190
+ className: `${isDisabled ? fieldStyle.disabled : isReadOnly ? fieldStyle.readonly : ''}`
191
+ }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
192
+ ePhiData: ePhiData,
193
+ alignContainer: "baseline",
194
+ renderProps: {
195
+ end: renderEnd
196
+ }
197
+ }, /*#__PURE__*/React.createElement(Label, _extends({
189
198
  text: labelName,
190
199
  title: labelName,
191
200
  id: id,
@@ -197,11 +206,7 @@ const TagsMultiSelectField = props => {
197
206
  }, LabelProps)), selectedValueCount ? /*#__PURE__*/React.createElement(Box, {
198
207
  dataId: `${dataId}_tagCount`,
199
208
  className: style.count
200
- }, `(${selectedValueCount})`) : null, ePhiStatus ? /*#__PURE__*/React.createElement("span", {
201
- "data-title": ePhiTitle,
202
- "data-id": `${dataId}_ePHI`,
203
- className: fieldStyle.ePhiTag
204
- }, ePhiText) : null, children ? children : null), /*#__PURE__*/React.createElement(TagsMultiSelect, _extends({
209
+ }, `(${selectedValueCount})`) : null), /*#__PURE__*/React.createElement(TagsMultiSelect, _extends({
205
210
  addTag: handleAdd,
206
211
  deleteTag: onDelete,
207
212
  handleChange: handleChange,
@@ -232,7 +237,9 @@ const TagsMultiSelectField = props => {
232
237
  htmlId: htmlId,
233
238
  getTextBoxChildren: getTextBoxChildren,
234
239
  className: containerClass
235
- }, TagsMultiSelectProps)), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
240
+ }, TagsMultiSelectProps, {
241
+ clickableTag: clickableTag
242
+ })), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
236
243
  text: validationMessage,
237
244
  palette: validationPalette,
238
245
  type: errorType,
@@ -252,7 +259,8 @@ TagsMultiSelectField.propTypes = {
252
259
  value: PropTypes.string,
253
260
  selectedValueCount: PropTypes.string,
254
261
  validationMessage: PropTypes.string,
255
- options: PropTypes.array
262
+ options: PropTypes.array,
263
+ clickableTag: PropTypes.bool
256
264
  }),
257
265
  styleProperties: PropTypes.shape({
258
266
  labelSize: PropTypes.string,
@@ -284,16 +292,12 @@ TagsMultiSelectField.propTypes = {
284
292
  position: PropTypes.string,
285
293
  getContainerRef: PropTypes.func,
286
294
  getTargetRef: PropTypes.func,
287
- ePhiData: PropTypes.shape({
288
- ePhiTitle: PropTypes.string,
289
- ePhiText: PropTypes.string,
290
- ePhiStatus: PropTypes.bool
291
- }),
292
295
  customProps: PropTypes.shape({
293
296
  LabelProps: PropTypes.object,
294
297
  TagsMultiSelectProps: PropTypes.object,
295
298
  ValidationMessageProps: PropTypes.object
296
- })
299
+ }),
300
+ ...FieldCommonPropTypes()
297
301
  };
298
302
  TagsMultiSelectField.defaultProps = {
299
303
  fieldProperties: {
@@ -309,8 +313,8 @@ TagsMultiSelectField.defaultProps = {
309
313
  isNewNeeded: false,
310
314
  i18nKeys: {},
311
315
  numberOfDisplayedValues: '5',
312
- ePhiData: {},
313
- customProps: {}
316
+ customProps: {},
317
+ ...FieldCommonDefaultProps()
314
318
  };
315
319
 
316
320
  if (false) {
@@ -9,9 +9,11 @@ import Label from '@zohodesk/components/lib/Label/Label';
9
9
  import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
10
10
  import ValidationMessage from '../ValidationMessage/ValidationMessage';
11
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
12
- /**** Icons ****/
12
+ import FieldContainer from '../FieldContainer/FieldContainer';
13
+ /**** props ****/
13
14
 
14
- import Icon from '@zohodesk/icons/lib/Icon';
15
+ import { FieldCommonDefaultProps } from '../props/FieldCommonDefaultProps';
16
+ import { FieldCommonPropTypes } from '../props/FieldCommonPropTypes';
15
17
  /**** CSS ****/
16
18
 
17
19
  import style from '../Fields.module.css';
@@ -82,7 +84,8 @@ export default class TextBoxField extends PureComponent {
82
84
  onFocus,
83
85
  ePhiData,
84
86
  children,
85
- customProps
87
+ customProps,
88
+ renderLabelProps
86
89
  } = this.props;
87
90
  const {
88
91
  LabelProps = {},
@@ -90,17 +93,17 @@ export default class TextBoxField extends PureComponent {
90
93
  ValidationMessageProps1 = {},
91
94
  ValidationMessageProps2 = {}
92
95
  } = customProps;
93
- let {
94
- ePhiTitle = '',
95
- ePhiText = '',
96
- ePhiStatus = false
97
- } = ePhiData;
98
96
  let uniqueId = htmlId ? htmlId : this.getNextId();
99
97
  return /*#__PURE__*/React.createElement("div", {
100
98
  className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
101
99
  "data-title": isDisabled ? title : null
102
- }, labelName && /*#__PURE__*/React.createElement("div", {
103
- className: style.labelContainer
100
+ }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
101
+ infoText: infoText,
102
+ isLocked: isLocked,
103
+ lockedInfoText: lockedInfoText,
104
+ ePhiData: ePhiData,
105
+ dataId: dataId,
106
+ renderProps: renderLabelProps
104
107
  }, /*#__PURE__*/React.createElement(Label, _extends({
105
108
  text: labelName,
106
109
  size: fieldSize === 'small' ? 'small' : 'medium',
@@ -108,21 +111,7 @@ export default class TextBoxField extends PureComponent {
108
111
  customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
109
112
  htmlFor: uniqueId,
110
113
  dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
111
- }, LabelProps)), infoText ? /*#__PURE__*/React.createElement(Icon, {
112
- name: "ZD-GN-info",
113
- iconClass: style.infoIcon,
114
- title: infoText,
115
- size: "15"
116
- }) : null, isLocked ? /*#__PURE__*/React.createElement(Icon, {
117
- name: "ZD-GN-lock",
118
- size: "13",
119
- iconClass: style.lockIcon,
120
- title: lockedInfoText
121
- }) : null, ePhiStatus ? /*#__PURE__*/React.createElement("span", {
122
- "data-title": ePhiTitle,
123
- "data-id": `${dataId}_ePHI`,
124
- className: style.ePhiTag
125
- }, ePhiText) : null), /*#__PURE__*/React.createElement("div", {
114
+ }, LabelProps))), /*#__PURE__*/React.createElement("div", {
126
115
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
127
116
  }, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
128
117
  htmlId: uniqueId,
@@ -163,16 +152,11 @@ export default class TextBoxField extends PureComponent {
163
152
  }
164
153
  TextBoxField.propTypes = {
165
154
  borderColor: PropTypes.oneOf(['transparent', 'default']),
166
- dataId: PropTypes.string,
167
155
  errorType: PropTypes.oneOf(['primary', 'secondary']),
168
156
  fieldSize: PropTypes.oneOf(['small', 'medium']),
169
157
  getRef: PropTypes.func,
170
158
  id: PropTypes.string,
171
- infoText: PropTypes.string,
172
- isDisabled: PropTypes.bool,
173
159
  // isFocusOnLabelClick: PropTypes.bool,
174
- isMandatory: PropTypes.bool,
175
- isReadOnly: PropTypes.bool,
176
160
  labelCustomClass: PropTypes.string,
177
161
  labelName: PropTypes.string.isRequired,
178
162
  labelPalette: PropTypes.string,
@@ -190,40 +174,31 @@ TextBoxField.propTypes = {
190
174
  validationRuleMessage: PropTypes.string,
191
175
  validationRulePalette: PropTypes.string,
192
176
  value: PropTypes.string,
193
- lockedInfoText: PropTypes.string,
194
- isLocked: PropTypes.bool,
195
177
  isClickable: PropTypes.bool,
196
178
  needReadOnlyStyle: PropTypes.bool,
197
- ePhiData: PropTypes.shape({
198
- ePhiTitle: PropTypes.string,
199
- ePhiText: PropTypes.string,
200
- ePhiStatus: PropTypes.bool
201
- }),
202
179
  children: PropTypes.node,
203
180
  customProps: PropTypes.shape({
204
181
  LabelProps: PropTypes.object,
205
182
  TextBoxIconProps: PropTypes.object,
206
183
  ValidationMessageProps1: PropTypes.object,
207
184
  ValidationMessageProps2: PropTypes.object
208
- })
185
+ }),
186
+ ...FieldCommonPropTypes()
209
187
  };
210
188
  TextBoxField.defaultProps = {
211
189
  errorType: 'primary',
212
- isMandatory: false,
213
190
  textBoxSize: 'xmedium',
214
191
  textBoxType: 'text',
215
192
  textBoxVariant: 'primary',
216
193
  borderColor: 'default',
217
- isDisabled: false,
218
- isReadOnly: false,
219
194
  fieldSize: 'medium',
220
195
  // isFocusOnLabelClick: true,
221
196
  labelPalette: 'default',
222
197
  labelCustomClass: '',
223
198
  isClickable: false,
224
199
  needReadOnlyStyle: true,
225
- ePhiData: {},
226
- customProps: {}
200
+ customProps: {},
201
+ ...FieldCommonDefaultProps()
227
202
  };
228
203
 
229
204
  if (false) {
@@ -6,6 +6,21 @@ import Icon from '@zohodesk/icons/lib/Icon';
6
6
  export default class TextBoxField__default extends Component {
7
7
  constructor(props) {
8
8
  super(props);
9
+ this.renderStart = this.renderStart.bind(this);
10
+ this.renderMiddle = this.renderMiddle.bind(this);
11
+ this.renderEnd = this.renderEnd.bind(this);
12
+ }
13
+
14
+ renderStart() {
15
+ return 'Start';
16
+ }
17
+
18
+ renderMiddle() {
19
+ return 'Middle';
20
+ }
21
+
22
+ renderEnd() {
23
+ return 'End';
9
24
  }
10
25
 
11
26
  render() {
@@ -23,7 +38,19 @@ export default class TextBoxField__default extends Component {
23
38
  labelName: "Contact Name",
24
39
  textBoxSize: "xmedium",
25
40
  textBoxVariant: "primary",
26
- validationMessage: "Invalid Input"
41
+ validationMessage: "Invalid Input",
42
+ infoText: "infoText",
43
+ isLocked: true,
44
+ ePhiData: {
45
+ ePhiTitle: 'ePhiTitle',
46
+ ePhiText: 'ePhiText',
47
+ ePhiStatus: true
48
+ },
49
+ renderLabelProps: {
50
+ start: this.renderStart,
51
+ middle: this.renderMiddle,
52
+ end: this.renderEnd
53
+ }
27
54
  }, /*#__PURE__*/React.createElement(Container, {
28
55
  align: "both",
29
56
  style: {
@@ -6,12 +6,13 @@ import PropTypes from 'prop-types';
6
6
  /**** Components ****/
7
7
 
8
8
  import Label from '@zohodesk/components/lib/Label/Label';
9
- import { Container, Box } from '@zohodesk/components/lib/Layout';
10
9
  import ValidationMessage from '../ValidationMessage/ValidationMessage';
11
10
  import TextEditorWrapper from '../TextEditorWrapper/TextEditorWrapper';
12
- /**** Icons ****/
11
+ import FieldContainer from '../FieldContainer/FieldContainer';
12
+ /**** props ****/
13
13
 
14
- import Icon from '@zohodesk/icons/lib/Icon';
14
+ import { FieldCommonDefaultProps } from '../props/FieldCommonDefaultProps';
15
+ import { FieldCommonPropTypes } from '../props/FieldCommonPropTypes';
15
16
  /** Css */
16
17
 
17
18
  import style from '../Fields.module.css';
@@ -21,6 +22,7 @@ export default class TextEditorField extends PureComponent {
21
22
  this.handleChange = this.handleChange.bind(this);
22
23
  this.handleGetRef = this.handleGetRef.bind(this);
23
24
  this.handleLabelClick = this.handleLabelClick.bind(this);
25
+ this.renderEnd = this.renderEnd.bind(this);
24
26
  }
25
27
 
26
28
  handleChange(value) {
@@ -52,6 +54,13 @@ export default class TextEditorField extends PureComponent {
52
54
  }
53
55
  }
54
56
 
57
+ renderEnd() {
58
+ let {
59
+ children
60
+ } = this.props;
61
+ return children ? children : null;
62
+ }
63
+
55
64
  render() {
56
65
  let {
57
66
  labelName,
@@ -102,18 +111,18 @@ export default class TextEditorField extends PureComponent {
102
111
  TextEditorWrapperProps = {},
103
112
  ValidationMessageProps = {}
104
113
  } = customProps;
105
- let {
106
- ePhiTitle = '',
107
- ePhiText = '',
108
- ePhiStatus = false
109
- } = ePhiData;
110
114
  return /*#__PURE__*/React.createElement("div", {
111
115
  className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''} ${className || ''}`
112
- }, /*#__PURE__*/React.createElement(Container, {
113
- isCover: false,
114
- alignBox: "row",
115
- align: "vertical"
116
- }, labelName && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Label, _extends({
116
+ }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
117
+ infoText: infoText,
118
+ isLocked: isLocked,
119
+ lockedInfoText: lockedInfoText,
120
+ ePhiData: ePhiData,
121
+ dataId: dataId,
122
+ renderProps: {
123
+ end: this.renderEnd
124
+ }
125
+ }, /*#__PURE__*/React.createElement(Label, _extends({
117
126
  text: labelName,
118
127
  size: fieldSize === 'small' ? 'small' : 'medium',
119
128
  htmlFor: !isReadOnly && !isDisabled ? id : undefined,
@@ -121,21 +130,7 @@ export default class TextEditorField extends PureComponent {
121
130
  onClick: this.handleLabelClick,
122
131
  customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
123
132
  dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
124
- }, LabelProps))), infoText ? /*#__PURE__*/React.createElement(Icon, {
125
- name: "ZD-GN-info",
126
- iconClass: style.infoIcon,
127
- title: infoText,
128
- size: "15"
129
- }) : null, isLocked ? /*#__PURE__*/React.createElement(Icon, {
130
- name: "ZD-GN-lock",
131
- size: "13",
132
- iconClass: style.lockIcon,
133
- title: lockedInfoText
134
- }) : null, ePhiStatus ? /*#__PURE__*/React.createElement("span", {
135
- "data-title": ePhiTitle,
136
- "data-id": `${dataId}_ePHI`,
137
- className: style.ePhiTag
138
- }, ePhiText) : null, children ? children : null), /*#__PURE__*/React.createElement("div", {
133
+ }, LabelProps))), /*#__PURE__*/React.createElement("div", {
139
134
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
140
135
  }, /*#__PURE__*/React.createElement(TextEditorWrapper, _extends({
141
136
  needEditor: needEditor,
@@ -181,10 +176,7 @@ TextEditorField.propTypes = {
181
176
  fieldSize: PropTypes.oneOf(['small', 'medium']),
182
177
  getRef: PropTypes.func,
183
178
  id: PropTypes.string,
184
- isDisabled: PropTypes.bool,
185
179
  isFocusOnLabelClick: PropTypes.bool,
186
- isMandatory: PropTypes.bool,
187
- isReadOnly: PropTypes.bool,
188
180
  labelCustomClass: PropTypes.string,
189
181
  labelName: PropTypes.string,
190
182
  labelPalette: PropTypes.string,
@@ -196,9 +188,6 @@ TextEditorField.propTypes = {
196
188
  validationMessage: PropTypes.string,
197
189
  validationPalette: PropTypes.string,
198
190
  value: PropTypes.string,
199
- infoText: PropTypes.string,
200
- isLocked: PropTypes.bool,
201
- lockedInfoText: PropTypes.string,
202
191
  errorType: PropTypes.string,
203
192
  EDITORURL: PropTypes.string,
204
193
  editorMode: PropTypes.string,
@@ -219,23 +208,17 @@ TextEditorField.propTypes = {
219
208
  setInlineAttachmentInProgress: PropTypes.func,
220
209
  handleEditorDropUpload: PropTypes.func,
221
210
  children: PropTypes.node,
222
- ePhiData: PropTypes.shape({
223
- ePhiTitle: PropTypes.string,
224
- ePhiText: PropTypes.string,
225
- ePhiStatus: PropTypes.bool
226
- }),
227
211
  needInlineAttachment: PropTypes.bool,
228
212
  customProps: PropTypes.shape({
229
213
  LabelProps: PropTypes.object,
230
214
  TextEditorWrapperProps: PropTypes.object,
231
215
  ValidationMessageProps: PropTypes.object
232
- })
216
+ }),
217
+ ...FieldCommonPropTypes()
233
218
  };
234
219
  TextEditorField.defaultProps = {
235
220
  errorType: 'primary',
236
221
  needEditor: true,
237
- isDisabled: false,
238
- isReadOnly: false,
239
222
  isFocusOnLabelClick: true,
240
223
  fieldSize: 'medium',
241
224
  textBoxSize: 'xsmall',
@@ -243,8 +226,8 @@ TextEditorField.defaultProps = {
243
226
  labelPalette: 'default',
244
227
  labelCustomClass: '',
245
228
  className: '',
246
- ePhiData: {},
247
- customProps: {}
229
+ customProps: {},
230
+ ...FieldCommonDefaultProps()
248
231
  };
249
232
 
250
233
  if (false) {
@@ -30,8 +30,15 @@ export default class TextEditorField__default extends Component {
30
30
  labelName: "TextEditor",
31
31
  EDITORURL: "https://js.zohostatic.com/zde/v2.2.9/js/ZohoDeskEditor.js",
32
32
  initCallback: this.handleEditorStyleOptions,
33
- loadingComponent: /*#__PURE__*/React.createElement("div", null, "Loading...")
34
- }));
33
+ loadingComponent: /*#__PURE__*/React.createElement("div", null, "Loading..."),
34
+ infoText: "infoText",
35
+ isLocked: true,
36
+ ePhiData: {
37
+ ePhiTitle: 'ePhiTitle',
38
+ ePhiText: 'ePhiText',
39
+ ePhiStatus: true
40
+ }
41
+ }, "Children"));
35
42
  }
36
43
 
37
44
  }
@@ -9,9 +9,11 @@ import Label from '@zohodesk/components/lib/Label/Label';
9
9
  import Textarea from '@zohodesk/components/lib/Textarea/Textarea';
10
10
  import ValidationMessage from '../ValidationMessage/ValidationMessage';
11
11
  import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
12
- /**** Icons ****/
12
+ import FieldContainer from '../FieldContainer/FieldContainer';
13
+ /**** props ****/
13
14
 
14
- import Icon from '@zohodesk/icons/lib/Icon';
15
+ import { FieldCommonDefaultProps } from '../props/FieldCommonDefaultProps';
16
+ import { FieldCommonPropTypes } from '../props/FieldCommonPropTypes';
15
17
  /**** CSS ****/
16
18
 
17
19
  import style from '../Fields.module.css';
@@ -85,7 +87,8 @@ export default class TextareaField extends PureComponent {
85
87
  htmlId,
86
88
  lockedInfoText,
87
89
  isLocked,
88
- customProps
90
+ customProps,
91
+ renderLabelProps
89
92
  } = this.props;
90
93
  const {
91
94
  LabelProps = {},
@@ -97,8 +100,11 @@ export default class TextareaField extends PureComponent {
97
100
  return /*#__PURE__*/React.createElement("div", {
98
101
  className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
99
102
  "data-title": isDisabled ? title : null
100
- }, labelName && /*#__PURE__*/React.createElement("div", {
101
- className: style.labelContainer
103
+ }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
104
+ infoText: infoText,
105
+ isLocked: isLocked,
106
+ lockedInfoText: lockedInfoText,
107
+ renderProps: renderLabelProps
102
108
  }, /*#__PURE__*/React.createElement(Label, _extends({
103
109
  text: labelName,
104
110
  id: id,
@@ -107,17 +113,7 @@ export default class TextareaField extends PureComponent {
107
113
  customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
108
114
  htmlFor: uniqueId,
109
115
  dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
110
- }, LabelProps)), infoText ? /*#__PURE__*/React.createElement(Icon, {
111
- name: "ZD-GN-info",
112
- iconClass: style.infoIcon,
113
- title: infoText,
114
- size: "15"
115
- }) : null, isLocked ? /*#__PURE__*/React.createElement(Icon, {
116
- name: "ZD-GN-lock",
117
- size: "13",
118
- iconClass: style.lockIcon,
119
- title: lockedInfoText
120
- }) : null), /*#__PURE__*/React.createElement("div", {
116
+ }, LabelProps))), /*#__PURE__*/React.createElement("div", {
121
117
  className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
122
118
  }, /*#__PURE__*/React.createElement(Textarea, _extends({
123
119
  onChange: this.handleChange,
@@ -156,16 +152,11 @@ export default class TextareaField extends PureComponent {
156
152
  TextareaField.propTypes = {
157
153
  animated: PropTypes.bool,
158
154
  borderColor: PropTypes.oneOf(['transparent', 'default']),
159
- dataId: PropTypes.string,
160
155
  errorType: PropTypes.oneOf(['primary', 'secondary']),
161
156
  fieldSize: PropTypes.oneOf(['small', 'medium']),
162
157
  getRef: PropTypes.func,
163
158
  id: PropTypes.string,
164
- infoText: PropTypes.string,
165
- isDisabled: PropTypes.bool,
166
159
  // isFocusOnLabelClick: PropTypes.bool,
167
- isMandatory: PropTypes.bool,
168
- isReadOnly: PropTypes.bool,
169
160
  labelCustomClass: PropTypes.string,
170
161
  labelName: PropTypes.string,
171
162
  labelPalette: PropTypes.string,
@@ -182,29 +173,26 @@ TextareaField.propTypes = {
182
173
  validationRuleMessage: PropTypes.string,
183
174
  validationRulePalette: PropTypes.string,
184
175
  value: PropTypes.string,
185
- lockedInfoText: PropTypes.string,
186
- isLocked: PropTypes.bool,
187
176
  customProps: PropTypes.shape({
188
177
  LabelProps: PropTypes.object,
189
178
  TextareaProps: PropTypes.object,
190
179
  ValidationMessageProps1: PropTypes.object,
191
180
  ValidationMessageProps2: PropTypes.object
192
- })
181
+ }),
182
+ ...FieldCommonPropTypes()
193
183
  };
194
184
  TextareaField.defaultProps = {
195
- isMandatory: false,
196
- isReadOnly: false,
197
185
  textBoxSize: 'xsmall',
198
186
  textBoxVariant: 'primary',
199
187
  animated: true,
200
188
  errorType: 'primary',
201
189
  borderColor: 'default',
202
- isDisabled: false,
203
190
  fieldSize: 'medium',
204
191
  // isFocusOnLabelClick: true,
205
192
  labelPalette: 'default',
206
193
  labelCustomClass: '',
207
- customProps: {}
194
+ customProps: {},
195
+ ...FieldCommonDefaultProps()
208
196
  };
209
197
 
210
198
  if (false) {
@@ -12,7 +12,14 @@ export default class TextareaField__default extends Component {
12
12
  onChange: () => {},
13
13
  textBoxSize: "xsmall",
14
14
  textBoxVariant: "primary",
15
- validationMessage: "Invalid Input"
15
+ validationMessage: "Invalid Input",
16
+ infoText: "infoText",
17
+ isLocked: true,
18
+ ePhiData: {
19
+ ePhiTitle: 'ePhiTitle',
20
+ ePhiText: 'ePhiText',
21
+ ePhiStatus: true
22
+ }
16
23
  });
17
24
  }
18
25
 
@@ -0,0 +1,10 @@
1
+ export const FieldCommonDefaultProps = () => {
2
+ return {
3
+ ePhiData: {},
4
+ isLocked: false,
5
+ isMandatory: false,
6
+ isDisabled: false,
7
+ isReadOnly: false,
8
+ renderLabelProps: {}
9
+ };
10
+ };
@@ -0,0 +1,22 @@
1
+ import PropTypes from 'prop-types';
2
+ export const FieldCommonPropTypes = () => {
3
+ return {
4
+ ePhiData: PropTypes.shape({
5
+ ePhiTitle: PropTypes.string,
6
+ ePhiText: PropTypes.string,
7
+ ePhiStatus: PropTypes.bool
8
+ }),
9
+ dataId: PropTypes.string,
10
+ infoText: PropTypes.string,
11
+ lockedInfoText: PropTypes.string,
12
+ isLocked: PropTypes.bool,
13
+ isDisabled: PropTypes.bool,
14
+ isReadOnly: PropTypes.bool,
15
+ isMandatory: PropTypes.bool,
16
+ renderLabelProps: PropTypes.shape({
17
+ start: PropTypes.func,
18
+ middle: PropTypes.func,
19
+ end: PropTypes.func
20
+ })
21
+ };
22
+ };
@@ -11,13 +11,11 @@ export default class BluePrintStatus extends React.Component {
11
11
  let {
12
12
  title
13
13
  } = this.props;
14
- return /*#__PURE__*/React.createElement("span", {
15
- className: `${style.container}`
16
- }, /*#__PURE__*/React.createElement(Icon, {
14
+ return /*#__PURE__*/React.createElement(Icon, {
17
15
  name: "ZD-blueprint",
18
16
  title: title,
19
17
  iconClass: style.iconStyle
20
- }));
18
+ });
21
19
  }
22
20
 
23
21
  }
@@ -1,10 +1,3 @@
1
- .container {
2
- display: inherit;
3
- }[dir=ltr] .container {
4
- padding-right: var(--zd_size5);
5
- }[dir=rtl] .container {
6
- padding-left: var(--zd_size5);
7
- }
8
1
  /* .danger {
9
2
  color: var(--dot_brightRed);
10
3
  }
@@ -12,6 +5,11 @@
12
5
  color: var(--dot_shuttleGrey);
13
6
  } */
14
7
  .iconStyle {
15
- display: block;
16
8
  font-size: var(--zd_font_size10);
17
9
  }
10
+ [dir=ltr] .iconStyle {
11
+ padding-right: var(--zd_size5);
12
+ }
13
+ [dir=rtl] .iconStyle {
14
+ padding-left: var(--zd_size5);
15
+ }