@zohodesk/library-platform 1.1.3-exp.3 → 1.1.3-temp-1

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 (72) hide show
  1. package/es/bc/zlist/Constants.js +3 -1
  2. package/es/bc/zrecord/Constants.js +3 -1
  3. package/es/cc/table-connected/Properties.js +16 -0
  4. package/es/cc/table-list/Constants.js +4 -0
  5. package/es/cc/table-list/Properties.js +25 -0
  6. package/es/cc/table-list/row/Properties.js +44 -0
  7. package/es/index.js +2 -1
  8. package/es/library/dot/components/table-list/frameworks/hooks/useDropIndicator.js +8 -0
  9. package/es/library/dot/components/table-list/frameworks/hooks/useRowData.js +8 -0
  10. package/es/library/dot/components/table-list/frameworks/hooks/useTableRowReorder.js +105 -0
  11. package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +85 -15
  12. package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +241 -1
  13. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +28 -4
  14. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +25 -9
  15. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +11 -2
  16. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +50 -8
  17. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +6 -1
  18. package/es/library/dot/components/table-list/frameworks/utils/getHeaderClasses.js +37 -0
  19. package/es/library/dot/components/table-list/frameworks/utils/getTableListClassName.js +37 -0
  20. package/es/library/dot/components/table-list/frameworks/utils/reOrder.js +90 -0
  21. package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +1 -1
  22. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +96 -0
  23. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +11 -3
  24. package/es/platform/client-actions/template-resolver/index.js +1 -0
  25. package/es/platform/client-actions/translators/context-resolver/index.js +6 -6
  26. package/es/platform/components/table-connected/adapters/controllers/ReOrderFinishController.js +21 -0
  27. package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +14 -0
  28. package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +5 -2
  29. package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +4 -2
  30. package/es/platform/components/table-connected/frameworks/TableConnectedView.js +5 -1
  31. package/es/platform/data-source/http-template/reOrderRecord.js +44 -0
  32. package/es/platform/data-source/index.js +2 -0
  33. package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +1 -2
  34. package/es/platform/sdk/domain/entities/ResourceManager.js +1 -1
  35. package/es/platform/zform/adapters/presenter/FormTranslator.js +6 -127
  36. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +32 -0
  37. package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +20 -0
  38. package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +30 -0
  39. package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +21 -0
  40. package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +21 -0
  41. package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +30 -0
  42. package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +30 -0
  43. package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +30 -0
  44. package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +29 -0
  45. package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +30 -0
  46. package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +30 -0
  47. package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +30 -0
  48. package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +29 -0
  49. package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +30 -0
  50. package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +27 -0
  51. package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +30 -0
  52. package/es/platform/zform/adapters/presenter/translators/fields/index.js +15 -0
  53. package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +3 -1
  54. package/es/platform/zform/domain/ZField.js +66 -17
  55. package/es/platform/zform/domain/ZSection.js +20 -7
  56. package/es/platform/zlist/adapters/controllers/ReOrderController.js +25 -0
  57. package/es/platform/zlist/adapters/controllers/ReOrderFailedController.js +26 -0
  58. package/es/platform/zlist/adapters/gateways/Repository.js +7 -0
  59. package/es/platform/zlist/adapters/gateways/Service.js +8 -0
  60. package/es/platform/zlist/adapters/presenters/TableTranslator.js +6 -2
  61. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +9 -10
  62. package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +1 -1
  63. package/es/platform/zlist/applications/interfaces/input/ReOrderRecordUseCaseInput.js +1 -0
  64. package/es/platform/zlist/applications/usecases/ReOrderFailedUseCase.js +22 -0
  65. package/es/platform/zlist/applications/usecases/ReOrderUseCase.js +25 -0
  66. package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +24 -3
  67. package/es/platform/zlist/domain/entities/List.js +66 -2
  68. package/es/platform/zlist/frameworks/EventHandlersFactory.js +7 -3
  69. package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +2 -1
  70. package/es/platform/zrecord/domain/entities/GetReOrderRecordsStrategy.js +40 -0
  71. package/es/platform/zrecord/domain/entities/RecordsManager.js +3 -1
  72. package/package.json +6 -3
@@ -0,0 +1,30 @@
1
+ const CurrencyFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default CurrencyFieldTranslator;
@@ -0,0 +1,21 @@
1
+ const DateFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type
5
+ } = _ref;
6
+ return {
7
+ id: field.id,
8
+ label: field.i18NLabel,
9
+ type,
10
+ value: field.value || '',
11
+ //state.behaviours.zform.values[field.apiName],
12
+ name: field.apiName,
13
+ // placeholder: field.i18NLabel,//field.placeholder,
14
+ required: field.isMandatory,
15
+ readonly: field.isReadOnly,
16
+ // visibility: field.isVisible
17
+ isVisible: field.isVisible
18
+ };
19
+ };
20
+
21
+ export default DateFieldTranslator;
@@ -0,0 +1,21 @@
1
+ const DateTimeFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type
5
+ } = _ref;
6
+ return {
7
+ id: field.id,
8
+ label: field.i18NLabel,
9
+ type,
10
+ value: field.value || '',
11
+ //state.behaviours.zform.values[field.apiName],
12
+ name: field.apiName,
13
+ // placeholder: field.i18NLabel,//field.placeholder,
14
+ required: field.isMandatory,
15
+ readonly: field.isReadOnly,
16
+ // visibility: field.isVisible
17
+ isVisible: field.isVisible
18
+ };
19
+ };
20
+
21
+ export default DateTimeFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const DecimalFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default DecimalFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const EmailFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default EmailFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const LookUpFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ tooltip: '',
15
+ //field.tooltip,
16
+ placeholder: field.i18NLabel,
17
+ //field.placeholder,
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default LookUpFieldTranslator;
@@ -0,0 +1,29 @@
1
+ const MultiSelectFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type
5
+ } = _ref;
6
+ return {
7
+ id: field.id,
8
+ label: field.i18NLabel,
9
+ options: field.pickListValues ? field.pickListValues.map(picklistValue => {
10
+ return {
11
+ value: picklistValue.value,
12
+ label: picklistValue.value
13
+ };
14
+ }) : [],
15
+ type,
16
+ subType: field.subType,
17
+ value: field.value,
18
+ //state.behaviours.zform.values[field.apiName],
19
+ name: field.apiName,
20
+ // placeholder: field.i18NLabel,//field.placeholder,
21
+ required: field.isMandatory,
22
+ readonly: field.isReadOnly,
23
+ // visibility: field.isVisible,
24
+ isVisible: field.isVisible,
25
+ errorMessage: field.errorMessage || ''
26
+ };
27
+ };
28
+
29
+ export default MultiSelectFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const NumberFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default NumberFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const PercentageFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default PercentageFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const PhoneFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default PhoneFieldTranslator;
@@ -0,0 +1,29 @@
1
+ const PickListFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type
5
+ } = _ref;
6
+ return {
7
+ id: field.id,
8
+ label: field.i18NLabel,
9
+ options: field.pickListValues.map(picklistValue => {
10
+ return {
11
+ value: picklistValue.value,
12
+ label: picklistValue.value
13
+ };
14
+ }),
15
+ type,
16
+ subType: field.subType.toLowerCase(),
17
+ value: field.value,
18
+ //state.behaviours.zform.values[field.apiName],
19
+ name: field.apiName,
20
+ // placeholder: field.i18NLabel,//field.placeholder,
21
+ required: field.isMandatory,
22
+ readonly: field.isReadOnly,
23
+ // visibility: field.isVisible,
24
+ isVisible: field.isVisible,
25
+ errorMessage: field.errorMessage || ''
26
+ };
27
+ };
28
+
29
+ export default PickListFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const TextAreaFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default TextAreaFieldTranslator;
@@ -0,0 +1,27 @@
1
+ const TextFieldTranslator = _ref => {
2
+ let {
3
+ type,
4
+ field
5
+ } = _ref;
6
+ return {
7
+ type,
8
+ value: field.value || '',
9
+ //state.behaviours.zform.values[field.apiName],
10
+ name: field.apiName,
11
+ id: field.id,
12
+ label: field.i18NLabel,
13
+ // toolTip: field.tooltip || '',
14
+ // toolTipType: field.toolTipType || '',
15
+ // placeholder: field.toolTip || '',
16
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
17
+ ePHI: false,
18
+ //field.ePHI,
19
+ required: field.isMandatory,
20
+ readonly: field.isReadOnly,
21
+ // visibility: field.isVisible,
22
+ isVisible: field.isVisible,
23
+ errorMessage: field.errorMessage || ''
24
+ };
25
+ };
26
+
27
+ export default TextFieldTranslator;
@@ -0,0 +1,30 @@
1
+ const URLFieldTranslator = _ref => {
2
+ let {
3
+ field,
4
+ type,
5
+ ePHIFields
6
+ } = _ref;
7
+ const fieldModified = {
8
+ type,
9
+ value: field.value || '',
10
+ //state.behaviours.zform.values[field.apiName],
11
+ name: field.apiName,
12
+ id: field.id,
13
+ label: field.i18NLabel,
14
+ // toolTip: field.tooltip || '',
15
+ // toolTipType: field.toolTipType || '',
16
+ // placeholder: field.toolTip || '',
17
+ placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
18
+ required: field.isMandatory,
19
+ readonly: field.isReadOnly,
20
+ // visibility: field.isVisible,
21
+ isVisible: field.isVisible,
22
+ errorMessage: field.errorMessage || ''
23
+ }; // if (ePHIFields[field.type]) {
24
+ // fieldModified.ePHI = true;
25
+ // }
26
+
27
+ return fieldModified;
28
+ };
29
+
30
+ export default URLFieldTranslator;
@@ -0,0 +1,15 @@
1
+ export { default as Date } from "./DateFieldTranslator";
2
+ export { default as DateTime } from "./DateTimeFieldTranslator";
3
+ export { default as Multiselect } from "./MultiselectFieldTranslator";
4
+ export { default as Text } from "./TextFieldTranslator";
5
+ export { default as Picklist } from "./PicklistFieldTranslator";
6
+ export { default as Boolean } from "./BooleanFieldTranslator";
7
+ export { default as Email } from "./EmailFieldTranslator";
8
+ export { default as Phone } from "./PhoneFieldTranslator";
9
+ export { default as Decimal } from "./DecimalFieldTranslator";
10
+ export { default as Number } from "./NumberFieldTranslator";
11
+ export { default as Currency } from "./CurrencyFieldTranslator";
12
+ export { default as Percent } from "./PercentageFieldTranslator";
13
+ export { default as URL } from "./URLFieldTranslator";
14
+ export { default as Textarea } from "./TextAreaFieldTranslator";
15
+ export { default as LookUp } from "./LookUpFieldTranslator";
@@ -15,7 +15,9 @@ class MyFormSuccessUseCase extends AbstractUseCase {
15
15
  let layoutRuleApplier = this.dependencies.layoutRuleApplier;
16
16
  let sectionEntities = sections.map(section => {
17
17
  let fields = section.fields.map(field => {
18
- return new ZField(field);
18
+ const entity = new ZField(field);
19
+ entity.decideDefaultValue();
20
+ return entity;
19
21
  });
20
22
  let sectionWithFields = { ...section,
21
23
  fields
@@ -1,6 +1,7 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
3
  export default class ZField {
4
+ // visibility:boolean;
4
5
  constructor(_ref) {
5
6
  let {
6
7
  displayLabel,
@@ -18,8 +19,12 @@ export default class ZField {
18
19
  isMandatory,
19
20
  value,
20
21
  errorMessage,
21
- visibility = true,
22
+ // visibility=true,
23
+ isVisible = true,
22
24
  pickListValues,
25
+ toolTip,
26
+ toolTipType,
27
+ defaultValue,
23
28
  subType
24
29
  } = _ref;
25
30
 
@@ -53,7 +58,7 @@ export default class ZField {
53
58
 
54
59
  _defineProperty(this, "errorMessage", void 0);
55
60
 
56
- _defineProperty(this, "visibility", void 0);
61
+ _defineProperty(this, "isVisible", void 0);
57
62
 
58
63
  _defineProperty(this, "pickListValues", void 0);
59
64
 
@@ -61,6 +66,12 @@ export default class ZField {
61
66
 
62
67
  _defineProperty(this, "subType", void 0);
63
68
 
69
+ _defineProperty(this, "toolTip", void 0);
70
+
71
+ _defineProperty(this, "toolTipType", void 0);
72
+
73
+ _defineProperty(this, "defaultValue", void 0);
74
+
64
75
  this.displayLabel = displayLabel;
65
76
  this.apiName = apiName;
66
77
  this.isCustomField = isCustomField;
@@ -75,24 +86,55 @@ export default class ZField {
75
86
  this.maxLength = maxLength;
76
87
  this.isMandatory = isMandatory;
77
88
  this.value = value;
78
- this.errorMessage = errorMessage;
79
- this.visibility = visibility;
89
+ this.errorMessage = errorMessage; // this.visibility=visibility;
90
+
91
+ this.isVisible = isVisible;
80
92
  this.defaultPickListValues = pickListValues;
81
93
  this.pickListValues = pickListValues;
82
94
  this.subType = subType;
95
+ this.toolTip = toolTip;
96
+ this.toolTipType = toolTipType;
97
+ this.defaultValue = defaultValue; // if(value===undefined){
98
+ // this.setDefaultValue()
99
+ // }
100
+ }
101
+
102
+ decideValueForBoolean(defaultValue) {
103
+ if (defaultValue === undefined || defaultValue === null) {
104
+ return false;
105
+ }
83
106
 
84
- if (value === undefined) {
85
- this.setDefaultValue();
107
+ if (typeof defaultValue === "string") {
108
+ return defaultValue === "true" ? true : false;
86
109
  }
110
+
111
+ return defaultValue;
87
112
  }
88
113
 
89
- setDefaultValue() {
90
- if (this.type === "Multiselect") {
91
- this.value = [];
92
- } else if (this.type === "Boolean") {
93
- this.value = false;
94
- } else {
95
- this.value = "";
114
+ decideValueForMultiselect(defaultValue) {
115
+ if (defaultValue === undefined || defaultValue === null) {
116
+ return [];
117
+ }
118
+
119
+ if (typeof defaultValue === "string") {
120
+ return defaultValue.split(";");
121
+ }
122
+
123
+ return defaultValue;
124
+ }
125
+
126
+ decideDefaultValue() {
127
+ switch (this.type) {
128
+ case 'Boolean':
129
+ this.value = this.decideValueForBoolean(this.defaultValue);
130
+ break;
131
+
132
+ case 'Multiselect':
133
+ this.value = this.decideValueForMultiselect(this.defaultValue);
134
+ break;
135
+
136
+ default:
137
+ this.value = this.defaultValue === undefined ? '' : this.defaultValue;
96
138
  }
97
139
  }
98
140
 
@@ -125,15 +167,18 @@ export default class ZField {
125
167
  }
126
168
 
127
169
  toggleVisibility() {
128
- this.visibility = !this.visibility;
170
+ // this.visibility=!this.visibility;
171
+ this.isVisible = !this.isVisible;
129
172
  }
130
173
 
131
174
  setVisibility(visibility) {
132
- this.visibility = visibility;
175
+ // this.visibility=visibility;
176
+ this.isVisible = visibility;
133
177
  }
134
178
 
135
179
  isVisibile() {
136
- return this.visibility;
180
+ // return this.visibility;
181
+ return this.isVisible;
137
182
  }
138
183
 
139
184
  setMandatory(isMandatory) {
@@ -161,8 +206,12 @@ export default class ZField {
161
206
  isMandatory: this.isMandatory,
162
207
  value: this.value,
163
208
  errorMessage: this.errorMessage,
164
- visibility: this.visibility,
209
+ // visibility:this.visibility,
210
+ isVisible: this.isVisible,
165
211
  pickListValues: this.pickListValues,
212
+ toolTip: this.toolTip,
213
+ toolTipType: this.toolTipType,
214
+ defaultValue: this.defaultValue,
166
215
  subType: this.subType
167
216
  };
168
217
  }
@@ -1,14 +1,18 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
3
  export default class ZSection {
4
+ // Optional field for description
5
+ // private visibility:boolean;
4
6
  constructor(_ref) {
5
7
  let {
6
8
  name,
7
9
  i18NLabel,
8
10
  isCustomSection,
11
+ description,
9
12
  id,
10
13
  fields,
11
- visibility
14
+ // visibility
15
+ isVisible
12
16
  } = _ref;
13
17
 
14
18
  _defineProperty(this, "name", void 0);
@@ -17,18 +21,23 @@ export default class ZSection {
17
21
 
18
22
  _defineProperty(this, "isCustomSection", void 0);
19
23
 
24
+ _defineProperty(this, "description", void 0);
25
+
20
26
  _defineProperty(this, "id", void 0);
21
27
 
22
28
  _defineProperty(this, "fields", void 0);
23
29
 
24
- _defineProperty(this, "visibility", void 0);
30
+ _defineProperty(this, "isVisible", void 0);
25
31
 
26
32
  this.name = name;
27
33
  this.i18NLabel = i18NLabel;
28
34
  this.isCustomSection = isCustomSection;
35
+ this.description = description || ''; // Default to empty string if not provided
36
+
29
37
  this.id = id;
30
- this.fields = fields;
31
- this.visibility = visibility;
38
+ this.fields = fields; // this.visibility=visibility;
39
+
40
+ this.isVisible = isVisible;
32
41
  }
33
42
 
34
43
  getName() {
@@ -40,7 +49,8 @@ export default class ZSection {
40
49
  }
41
50
 
42
51
  toggleVisibility() {
43
- this.visibility = !this.visibility;
52
+ // this.visibility=!this.visibility
53
+ this.isVisible = !this.isVisible;
44
54
  }
45
55
 
46
56
  appendField(field) {
@@ -74,7 +84,8 @@ export default class ZSection {
74
84
  }
75
85
 
76
86
  setVisibility(visibility) {
77
- this.visibility = visibility;
87
+ // this.visibility=visibility;
88
+ this.isVisible = visibility;
78
89
  }
79
90
 
80
91
  setFieldErrorMessage(fieldApiName, errorMessage) {
@@ -102,11 +113,13 @@ export default class ZSection {
102
113
  name: this.name,
103
114
  i18NLabel: this.i18NLabel,
104
115
  isCustomSection: this.isCustomSection,
116
+ description: this.description,
105
117
  id: this.id,
106
118
  fields: this.fields.map(field => {
107
119
  return field.toObject();
108
120
  }),
109
- visibility: this.visibility
121
+ // visibility:this.visibility
122
+ isVisible: this.isVisible
110
123
  };
111
124
  }
112
125