@zohodesk/library-platform 1.1.3-exp.2 → 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.
- package/es/cc/table-list/Properties.js +9 -0
- package/es/cc/table-list/row/Properties.js +9 -0
- package/es/index.js +2 -1
- package/es/library/dot/components/table-list/frameworks/hooks/useTableRowReorder.js +17 -5
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +35 -26
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +153 -56
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +22 -16
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +7 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +5 -13
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +31 -34
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +3 -8
- package/es/library/dot/components/table-list/frameworks/utils/getHeaderClasses.js +37 -0
- package/es/library/dot/components/table-list/frameworks/utils/getTableListClassName.js +37 -0
- package/es/library/dot/components/table-list/frameworks/utils/reOrder.js +28 -14
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +1 -1
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +96 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +11 -3
- package/es/platform/client-actions/template-resolver/index.js +1 -0
- package/es/platform/client-actions/translators/context-resolver/index.js +6 -6
- package/es/platform/components/table-connected/frameworks/TableConnectedView.js +2 -0
- package/es/platform/zform/adapters/presenter/FormTranslator.js +6 -127
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +32 -0
- package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +20 -0
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +21 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +21 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +27 -0
- package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/index.js +15 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +3 -1
- package/es/platform/zform/domain/ZField.js +66 -17
- package/es/platform/zform/domain/ZSection.js +20 -7
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +3 -3
- package/package.json +3 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const BooleanFieldTranslator = _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
|
+
name: field.apiName,
|
|
12
|
+
// placeholder: field.i18NLabel,//field.placeholder,
|
|
13
|
+
required: field.isMandatory,
|
|
14
|
+
readonly: field.isReadOnly,
|
|
15
|
+
// visibility: field.isVisible
|
|
16
|
+
isVisible: field.isVisible
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default BooleanFieldTranslator;
|
|
@@ -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
|
-
|
|
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
|
|
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, "
|
|
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
|
-
|
|
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 (
|
|
85
|
-
|
|
107
|
+
if (typeof defaultValue === "string") {
|
|
108
|
+
return defaultValue === "true" ? true : false;
|
|
86
109
|
}
|
|
110
|
+
|
|
111
|
+
return defaultValue;
|
|
87
112
|
}
|
|
88
113
|
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
|
170
|
+
// this.visibility=!this.visibility;
|
|
171
|
+
this.isVisible = !this.isVisible;
|
|
129
172
|
}
|
|
130
173
|
|
|
131
174
|
setVisibility(visibility) {
|
|
132
|
-
this.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:
|
|
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
|
}
|