@zohodesk/library-platform 1.1.8-exp.2 → 1.1.9
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/bc/zform/Symbol.js +0 -1
- package/es/cc/fields/field/FormDefaultUIType.js +1 -1
- package/es/cc/fields/text/Properties.js +0 -9
- package/es/cc/textarea/Properties.js +0 -11
- package/es/index.js +1 -2
- package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +1 -2
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +3 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +3 -1
- package/es/library/dot/components/form-fields/index.js +1 -2
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +2 -4
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +3 -8
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +7 -5
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +5 -3
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelAction.js +9 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelActionView.js +38 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/css/LabelAction.module.css +4 -0
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +3 -13
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +4 -22
- package/es/platform/client-actions/behaviour/zclient-actions/frameworks/sdk/ClientActionsSDKFactory.js +2 -2
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +0 -1
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +1 -5
- package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +2 -2
- package/es/platform/components/form-connected/frameworks/FormSdkFactory.js +2 -2
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +2 -2
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +2 -2
- package/es/platform/data-source/index.js +1 -3
- package/es/platform/data-source/utils/validation-rules/TransFormValidationRules.js +1 -6
- package/es/platform/sdk/adapters/gateways/Service.js +0 -4
- package/es/platform/sdk/domain/entities/ResourceManager.js +11 -21
- package/es/platform/sdk/frameworks/Sdk.js +2 -13
- package/es/platform/sdk/frameworks/SdkRegistry.js +0 -9
- package/es/platform/zform/adapters/gateway/Service.js +0 -4
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +1 -1
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +1 -2
- package/es/platform/zform/adapters/presenter/utils/DefaultClientActions.js +65 -66
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +1 -35
- package/es/platform/zform/domain/ZField.js +8 -14
- package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +3 -6
- package/package.json +2 -1
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/EventHandlerFactory.js +0 -70
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/Lookup.js +0 -13
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/LookupView.js +0 -51
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +0 -3
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +0 -37
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +0 -40
- package/es/platform/components/app/adapters/resources/AppResource.js +0 -13
- package/es/platform/data-source/http-template/fetchLookupFields.js +0 -24
- package/es/platform/sdk/application/usecases/GetResourcesUseCase.js +0 -12
- package/es/platform/zform/adapters/controllers/LookupFieldController.js +0 -23
- package/es/platform/zform/applications/interfaces/input/LookUpFieldSuccessUseCaseInputModel.js +0 -1
- package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +0 -40
package/es/bc/zform/Symbol.js
CHANGED
|
@@ -17,7 +17,6 @@ export const ZFORM_FIELD_VALUE_CHANGE_REQUEST = 'ZFORM#FIELD_VALUE_CHANGE_REQUES
|
|
|
17
17
|
export const ZFORM_FIELD_VALUE_CHANGED = 'ZFORM#FIELD_VALUE_CHANGED';
|
|
18
18
|
export const ZFORM_FIELD_BLURRED = 'ZFORM#FIELD_BLURRED';
|
|
19
19
|
export const ZFORM_SET_FIELD_ERROR_MESSAGE = 'ZFORM#SET_FIELD_ERROR_MESSAGE';
|
|
20
|
-
export const ZFORM_LOOKUP_FIELD_SUCCESS = 'ZFORM#LOOKUP_FIELD_SUCCESS';
|
|
21
20
|
export const ZFORM_VALIDATE_FIELDS = 'ZFORM#VALIDATE_FIELDS';
|
|
22
21
|
export const ZFORM_VALIDATE_FIELD_REQUEST = 'ZFORM#VALIDATE_FIELD_REQUEST';
|
|
23
22
|
export const ZFORM_SUBMIT = 'ZFORM#SUBMIT_REQUEST';
|
package/es/index.js
CHANGED
|
@@ -7,9 +7,8 @@ export { ComponentRegistry, createCustomComponent } from "./library";
|
|
|
7
7
|
export { default as TableFieldComponents } from "./library/dot/legacy-to-new-arch/table-field-components";
|
|
8
8
|
import * as _Components from "./library/dot/legacy-to-new-arch";
|
|
9
9
|
export { _Components as Components };
|
|
10
|
-
export {
|
|
10
|
+
export { platformSDK } from "./platform/sdk/frameworks/Sdk";
|
|
11
11
|
export { sdkRegistry } from "./platform/sdk/frameworks/SdkRegistry";
|
|
12
|
-
export { AppResource } from "./platform/components/app/adapters/resources/AppResource";
|
|
13
12
|
export { getClientActionsAdapter, fetchClientActions } from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter";
|
|
14
13
|
export { transFormValidationRules } from "./platform/data-source/utils/validation-rules/TransFormValidationRules";
|
|
15
14
|
export { renderField } from "./library/dot/components/section/frameworks/ui/RenderField";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefaultFormSectionUIType } from "../../../../../../cc/fields/field/FormDefaultUIType";
|
|
2
2
|
import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
3
|
-
import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox
|
|
3
|
+
import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox } from "../../../form-fields";
|
|
4
4
|
import Section from "../../../section/frameworks/ui/Section";
|
|
5
5
|
export function registerDefaultComponents() {
|
|
6
6
|
// Registering components in the ComponentRegistry
|
|
@@ -20,6 +20,5 @@ export function registerDefaultComponents() {
|
|
|
20
20
|
ComponentRegistry.register('Date', Date);
|
|
21
21
|
ComponentRegistry.register('DateTime', DateTime);
|
|
22
22
|
ComponentRegistry.register('Checkbox', Checkbox);
|
|
23
|
-
ComponentRegistry.register('LookUp', LookUp);
|
|
24
23
|
ComponentRegistry.register(DefaultFormSectionUIType, Section);
|
|
25
24
|
}
|
|
@@ -64,13 +64,15 @@ function CheckboxView(_ref2, ref) {
|
|
|
64
64
|
type: CheckboxConstants.CHECKBOX_TOGGLED
|
|
65
65
|
})
|
|
66
66
|
} : undefined
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: style.checkboxWrapper
|
|
67
69
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
68
70
|
id: id,
|
|
69
71
|
checked: value,
|
|
70
72
|
required: required,
|
|
71
73
|
disabled: disabled,
|
|
72
74
|
readonly: readonly
|
|
73
|
-
}), /*#__PURE__*/React.createElement(Label, {
|
|
75
|
+
})), /*#__PURE__*/React.createElement(Label, {
|
|
74
76
|
for: id,
|
|
75
77
|
label: label,
|
|
76
78
|
actions: labelActions,
|
|
@@ -12,5 +12,4 @@ export { default as Number } from "./number/frameworks/ui/Number";
|
|
|
12
12
|
export { default as Decimal } from "./decimal/frameworks/ui/Decimal";
|
|
13
13
|
export { default as Date } from "./date/frameworks/ui/Date";
|
|
14
14
|
export { default as DateTime } from "./datetime/frameworks/ui/DateTime";
|
|
15
|
-
export { default as Checkbox } from "./checkbox/frameworks/ui/Checkbox";
|
|
16
|
-
export { default as LookUp } from "./lookup/frameworks/ui/Lookup";
|
|
15
|
+
export { default as Checkbox } from "./checkbox/frameworks/ui/Checkbox";
|
|
@@ -18,8 +18,7 @@ function TextAreaView(_ref, ref) {
|
|
|
18
18
|
readonly,
|
|
19
19
|
required,
|
|
20
20
|
uiConfig,
|
|
21
|
-
labelActions
|
|
22
|
-
actions
|
|
21
|
+
labelActions
|
|
23
22
|
} = state.properties;
|
|
24
23
|
const {
|
|
25
24
|
size,
|
|
@@ -43,8 +42,7 @@ function TextAreaView(_ref, ref) {
|
|
|
43
42
|
value: value,
|
|
44
43
|
required: required,
|
|
45
44
|
disabled: disabled,
|
|
46
|
-
readonly: readonly
|
|
47
|
-
actions: actions
|
|
45
|
+
readonly: readonly
|
|
48
46
|
})));
|
|
49
47
|
}
|
|
50
48
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DateWidget from '@zohodesk/components/es/DateTime/DateWidget';
|
|
3
3
|
import DateConstants from "../../../../../../cc/date/Constants";
|
|
4
|
-
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
5
|
-
|
|
6
|
-
import style from "./css/DateView.module.css";
|
|
4
|
+
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
7
5
|
|
|
8
6
|
function DateView(_ref, ref) {
|
|
9
7
|
let {
|
|
@@ -26,12 +24,9 @@ function DateView(_ref, ref) {
|
|
|
26
24
|
} = state.properties;
|
|
27
25
|
|
|
28
26
|
const renderRightFieldActions = () => {
|
|
29
|
-
|
|
30
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: style.actionContainer
|
|
32
|
-
}, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
27
|
+
return actions !== null && actions !== void 0 && actions.length ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
33
28
|
actions: actions
|
|
34
|
-
})
|
|
29
|
+
}) : null;
|
|
35
30
|
};
|
|
36
31
|
|
|
37
32
|
return /*#__PURE__*/React.createElement(DateWidget, {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Label from '@zohodesk/components/es/Label/Label';
|
|
3
3
|
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
4
|
-
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator"; // import ActionLocation from '@library/dot/components/action-location/frameworks/ui/ActionLocation';
|
|
5
|
+
|
|
6
|
+
import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
7
|
+
import LabelAction from "./sub-components/ui/LabelAction"; // @ts-ignore
|
|
8
|
+
|
|
7
9
|
import style from "./css/Label.module.css";
|
|
10
|
+
ComponentRegistry.register(`LabelAction`, LabelAction);
|
|
8
11
|
|
|
9
12
|
function LabelView(_ref, ref) {
|
|
10
13
|
let {
|
|
@@ -27,8 +30,7 @@ function LabelView(_ref, ref) {
|
|
|
27
30
|
palette: isMandatory ? 'mandatory' : 'default',
|
|
28
31
|
customClass: `${style.label} ${isMandatory ? style.mandatory : ''}`
|
|
29
32
|
}), actions.length ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
30
|
-
actions: actions
|
|
31
|
-
gap: ActionViewGap.XMEDIUM
|
|
33
|
+
actions: actions
|
|
32
34
|
}) : null);
|
|
33
35
|
}
|
|
34
36
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
.label {
|
|
2
|
-
--label_cursor: inherit
|
|
2
|
+
--label_cursor: inherit;
|
|
3
|
+
display: inline;
|
|
4
|
+
vertical-align: middle
|
|
3
5
|
}[dir=ltr] .label {
|
|
4
|
-
padding-right: var(--
|
|
6
|
+
padding-right: var(--zd_size4)
|
|
5
7
|
}[dir=rtl] .label {
|
|
6
|
-
padding-left: var(--
|
|
8
|
+
padding-left: var(--zd_size4)
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
.mandatory::after {
|
package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelAction.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../../custom-component";
|
|
2
|
+
import ActionLocationProperties from "../../../../../../../../cc/action-location/Properties";
|
|
3
|
+
import LabelActionView from "./LabelActionView";
|
|
4
|
+
export default createCustomComponent({
|
|
5
|
+
name: 'LabelAction',
|
|
6
|
+
properties: ActionLocationProperties,
|
|
7
|
+
eventHandlers: {},
|
|
8
|
+
View: LabelActionView
|
|
9
|
+
});
|
package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelActionView.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
3
|
+
import ComponentRegistry from "../../../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
4
|
+
import ActionComponentMapping from "../../../../../../components/action-location/frameworks/ui/ActionComponentMapping"; // @ts-ignore
|
|
5
|
+
|
|
6
|
+
import style from "./css/LabelAction.module.css";
|
|
7
|
+
|
|
8
|
+
function LabelActionView(_ref, ref) {
|
|
9
|
+
let {
|
|
10
|
+
state
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
actions
|
|
14
|
+
} = state.properties;
|
|
15
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
16
|
+
ref: ref,
|
|
17
|
+
$ui_displayMode: "inline",
|
|
18
|
+
$ui_alignItems: "center",
|
|
19
|
+
$ui_className: style.container
|
|
20
|
+
}, actions.map((action, index) => {
|
|
21
|
+
const {
|
|
22
|
+
type,
|
|
23
|
+
properties,
|
|
24
|
+
eventMappings
|
|
25
|
+
} = action;
|
|
26
|
+
const ActionUiType = ActionComponentMapping[type] || ComponentRegistry.get(type);
|
|
27
|
+
return /*#__PURE__*/React.createElement(ActionUiType, {
|
|
28
|
+
key: index,
|
|
29
|
+
...properties,
|
|
30
|
+
appendToActionPayload: {
|
|
31
|
+
eventMappings
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
;
|
|
38
|
+
export default LabelActionView;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
3
3
|
import MultiSelect from "@zohodesk/components/es/MultiSelect/MultiSelect";
|
|
4
|
-
import { MultiSelectConstants } from "../../../../../../cc/multi-select";
|
|
5
|
-
|
|
6
|
-
import style from "./css/MultiSelectView.module.css";
|
|
4
|
+
import { MultiSelectConstants } from "../../../../../../cc/multi-select";
|
|
7
5
|
|
|
8
6
|
function MultiSelectView(_ref, ref) {
|
|
9
7
|
let {
|
|
@@ -26,12 +24,9 @@ function MultiSelectView(_ref, ref) {
|
|
|
26
24
|
} = state.properties;
|
|
27
25
|
|
|
28
26
|
const renderRightFieldActions = () => {
|
|
29
|
-
|
|
30
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: style.actionContainer
|
|
32
|
-
}, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
27
|
+
return actions !== null && actions !== void 0 && actions.length ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
33
28
|
actions: actions
|
|
34
|
-
})
|
|
29
|
+
}) : null;
|
|
35
30
|
};
|
|
36
31
|
|
|
37
32
|
return /*#__PURE__*/React.createElement(MultiSelect, {
|
|
@@ -49,10 +44,6 @@ function MultiSelectView(_ref, ref) {
|
|
|
49
44
|
textBoxSize: "xmedium",
|
|
50
45
|
customProps: {
|
|
51
46
|
TextBoxIconProps: {
|
|
52
|
-
customClass: {
|
|
53
|
-
customTBoxWrap: style.custmInputWrapper,
|
|
54
|
-
customTBoxIcon: style.clearIconContainer
|
|
55
|
-
},
|
|
56
47
|
'aria-required': required,
|
|
57
48
|
renderRightPlaceholderNode: renderRightFieldActions()
|
|
58
49
|
}
|
|
@@ -60,7 +51,6 @@ function MultiSelectView(_ref, ref) {
|
|
|
60
51
|
selectAllText: "Select All",
|
|
61
52
|
emptyMessage: "No options to select",
|
|
62
53
|
searchEmptyMessage: "No Results Found",
|
|
63
|
-
customChildrenClass: `${(actions === null || actions === void 0 ? void 0 : actions.length) >= 2 ? style[`paddingRight${actions.length === 2 ? 64 : 96}`] : ''}`,
|
|
64
54
|
onChange: selectedValues => {
|
|
65
55
|
dispatch({
|
|
66
56
|
type: MultiSelectConstants.MULTISELECT_CHANGED,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
3
2
|
import Textarea from '@zohodesk/components/es/Textarea/Textarea';
|
|
4
|
-
import TextAreaConstants from "../../../../../../cc/textarea/Constants";
|
|
5
|
-
|
|
6
|
-
import style from "./css/TextAreaView.module.css";
|
|
3
|
+
import TextAreaConstants from "../../../../../../cc/textarea/Constants";
|
|
7
4
|
|
|
8
5
|
function TextAreaView(_ref, ref) {
|
|
9
6
|
let {
|
|
@@ -20,10 +17,9 @@ function TextAreaView(_ref, ref) {
|
|
|
20
17
|
value,
|
|
21
18
|
required,
|
|
22
19
|
disabled,
|
|
23
|
-
readonly
|
|
24
|
-
actions
|
|
20
|
+
readonly
|
|
25
21
|
} = state.properties;
|
|
26
|
-
|
|
22
|
+
return /*#__PURE__*/React.createElement(Textarea, {
|
|
27
23
|
getRef: ref,
|
|
28
24
|
htmlId: id,
|
|
29
25
|
maxLength: maxLength,
|
|
@@ -33,7 +29,6 @@ function TextAreaView(_ref, ref) {
|
|
|
33
29
|
isDisabled: disabled,
|
|
34
30
|
animated: !readonly && !disabled,
|
|
35
31
|
size: "xsmall",
|
|
36
|
-
resize: "vertical",
|
|
37
32
|
customAttributes: {
|
|
38
33
|
'aria-required': required
|
|
39
34
|
},
|
|
@@ -50,21 +45,8 @@ function TextAreaView(_ref, ref) {
|
|
|
50
45
|
value
|
|
51
46
|
}
|
|
52
47
|
});
|
|
53
|
-
}
|
|
54
|
-
customClass: `${actions !== null && actions !== void 0 && actions.length ? style[`paddingRight${actions.length === 1 ? 32 : actions.length === 2 ? 64 : 96}`] : ''}`
|
|
48
|
+
}
|
|
55
49
|
});
|
|
56
|
-
|
|
57
|
-
if (!(actions !== null && actions !== void 0 && actions.length)) {
|
|
58
|
-
return textAreaRenderer;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: style.hasChildren
|
|
63
|
-
}, textAreaRenderer, /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: style.rightPlaceholder
|
|
65
|
-
}, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
66
|
-
actions: actions
|
|
67
|
-
})));
|
|
68
50
|
}
|
|
69
51
|
|
|
70
52
|
export default TextAreaView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ResourceNamesEnum from "../../../../../../bc/sdk/ResourceNamesEnum";
|
|
2
|
-
import {
|
|
2
|
+
import { platformSDK } from "../../../../../sdk/frameworks/Sdk";
|
|
3
3
|
export default class ClientActionsSDKFactory {
|
|
4
4
|
static getClientActionSDK(clientActionResource) {
|
|
5
5
|
return {
|
|
@@ -14,7 +14,7 @@ export default class ClientActionsSDKFactory {
|
|
|
14
14
|
let {
|
|
15
15
|
instanceName
|
|
16
16
|
} = _ref;
|
|
17
|
-
const clientActionResource =
|
|
17
|
+
const clientActionResource = platformSDK[ResourceNamesEnum.CLIENT_ACTION](instanceName);
|
|
18
18
|
const clientActionSDK = ClientActionsSDKFactory.getClientActionSDK(clientActionResource);
|
|
19
19
|
return {
|
|
20
20
|
clientAction: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export let ActionViewGap = /*#__PURE__*/function (ActionViewGap) {
|
|
2
2
|
ActionViewGap["NONE"] = "none";
|
|
3
3
|
ActionViewGap["SMALL"] = "small";
|
|
4
|
-
ActionViewGap["XMEDIUM"] = "xmedium";
|
|
5
4
|
ActionViewGap["MEDIUM"] = "medium";
|
|
6
5
|
ActionViewGap["LARGE"] = "large";
|
|
7
6
|
return ActionViewGap;
|
|
@@ -2,7 +2,7 @@ import SmartFormConstants from "../../../../cc/form-connected/Constants";
|
|
|
2
2
|
import FormSdkFactory from "./FormSdkFactory";
|
|
3
3
|
import FormConstants from "../../../../cc/form/Constants";
|
|
4
4
|
import { ZFORM_FIELD_BLURRED, ZFORM_FIELD_VALUE_CHANGED, ZFORM_SUBMIT_SUCCESS, ZFORM_SUBMIT_VALIDATION_FAILURE } from "../../../../bc/zform/Symbol";
|
|
5
|
-
import {
|
|
5
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
6
6
|
const {
|
|
7
7
|
SMART_FORM_FIELD_FOCUSED,
|
|
8
8
|
SMART_FORM_FIELD_BLURRED,
|
|
@@ -23,7 +23,7 @@ function createHandlerWithSdk(handler) {
|
|
|
23
23
|
} = input;
|
|
24
24
|
const instanceName = state.properties.instanceName;
|
|
25
25
|
handler({ ...input,
|
|
26
|
-
platformSDK
|
|
26
|
+
platformSDK
|
|
27
27
|
}, FormSdkFactory.create({
|
|
28
28
|
instanceName
|
|
29
29
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// /* eslint-disable max-lines-per-function */
|
|
2
|
-
import {
|
|
2
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
3
3
|
import ResourceNamesEnum from "../../../../bc/sdk/ResourceNamesEnum";
|
|
4
4
|
export default class FormSdkFactory {
|
|
5
5
|
static getFormSdks(smartForm) {
|
|
@@ -22,7 +22,7 @@ export default class FormSdkFactory {
|
|
|
22
22
|
let {
|
|
23
23
|
instanceName
|
|
24
24
|
} = _ref;
|
|
25
|
-
const smartForm =
|
|
25
|
+
const smartForm = platformSDK[ResourceNamesEnum.SMART_FORM](instanceName);
|
|
26
26
|
const formSdks = FormSdkFactory.getFormSdks(smartForm);
|
|
27
27
|
return {
|
|
28
28
|
zform: {
|
|
@@ -14,7 +14,7 @@ import { ReOrderFinishController } from "../adapters/controllers/ReOrderFinishCo
|
|
|
14
14
|
import ScrollController from "../adapters/controllers/ScrollController";
|
|
15
15
|
import ColumnChooserUpdateController from "../adapters/controllers/ColumnChooserUpdateController";
|
|
16
16
|
import ColumnChooserOpenedController from "../adapters/controllers/ColumnChooserOpenedController";
|
|
17
|
-
import {
|
|
17
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
18
18
|
import { SET_RECORDS_SUCCESS } from "../../../../bc/zrecord/Constants";
|
|
19
19
|
import ErrorEventHandlersFactory from "./ErrorEventHandlersFactory";
|
|
20
20
|
const {
|
|
@@ -32,7 +32,7 @@ function createHandlerWithSdk(handler) {
|
|
|
32
32
|
} = input;
|
|
33
33
|
const instanceName = state.properties.instanceName;
|
|
34
34
|
handler({ ...input,
|
|
35
|
-
platformSDK
|
|
35
|
+
platformSDK
|
|
36
36
|
}, ListSdkFactory.create({
|
|
37
37
|
instanceName
|
|
38
38
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ResourceNamesEnum from "../../../../bc/sdk/ResourceNamesEnum";
|
|
2
|
-
import {
|
|
2
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
3
3
|
export default class ListSdkFactory {
|
|
4
4
|
static getRecordSdks(smartTable) {
|
|
5
5
|
return {
|
|
@@ -33,7 +33,7 @@ export default class ListSdkFactory {
|
|
|
33
33
|
let {
|
|
34
34
|
instanceName
|
|
35
35
|
} = _ref;
|
|
36
|
-
const smartTable =
|
|
36
|
+
const smartTable = platformSDK[ResourceNamesEnum.SMART_TABLE](instanceName);
|
|
37
37
|
const recordSdks = ListSdkFactory.getRecordSdks(smartTable);
|
|
38
38
|
const selectionSdks = ListSdkFactory.getSelectionSdks(smartTable);
|
|
39
39
|
return {
|
|
@@ -16,7 +16,6 @@ import fetchDependencyMappings from "./http-template/fetchDependencyMappings";
|
|
|
16
16
|
import fetchValidationRules from "./http-template/fetchValidationRules";
|
|
17
17
|
import createRecord from "./http-template/createRecord";
|
|
18
18
|
import updateSelectedFields from "./http-template/updateSelectedFields";
|
|
19
|
-
import fetchLookupFields from "./http-template/fetchLookupFields";
|
|
20
19
|
let dataSource = {
|
|
21
20
|
httpTemplates: {
|
|
22
21
|
[RecordApiActionName.GET_RECORDS]: getRecords,
|
|
@@ -34,8 +33,7 @@ let dataSource = {
|
|
|
34
33
|
fetchMyForm,
|
|
35
34
|
fetchLayoutRules,
|
|
36
35
|
fetchDependencyMappings,
|
|
37
|
-
fetchValidationRules
|
|
38
|
-
fetchLookupFields
|
|
36
|
+
fetchValidationRules
|
|
39
37
|
}
|
|
40
38
|
};
|
|
41
39
|
export default dataSource; // let ticketsRecordSerice = createRecord(tickets, () => {});
|
|
@@ -23,8 +23,7 @@ const map = {
|
|
|
23
23
|
Date: DateFieldConditions,
|
|
24
24
|
DateTime: DateTimeFieldConditions,
|
|
25
25
|
Picklist: PicklistFieldConditions,
|
|
26
|
-
Multiselect: MultiSelectFieldConditions
|
|
27
|
-
LookUp: LookupFieldConditions
|
|
26
|
+
Multiselect: MultiSelectFieldConditions
|
|
28
27
|
};
|
|
29
28
|
export function getBasicValidationRulesForField(field) {
|
|
30
29
|
const {
|
|
@@ -41,10 +40,6 @@ export function getBasicValidationRulesForField(field) {
|
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
function LookupFieldConditions(field) {
|
|
45
|
-
return [MandatoryCondition(field)];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
43
|
function TextFieldConditions(field) {
|
|
49
44
|
return [MandatoryCondition(field), MaxLengthCondition(field)];
|
|
50
45
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
-
import { GetResourcesUseCase } from "../../application/usecases/GetResourcesUseCase";
|
|
4
3
|
import { CreateResourceInstanceUseCase } from "../../application/usecases/CreateResourceInstanceUseCase";
|
|
5
4
|
import { DestructResourceInstanceUseCase } from "../../application/usecases/DestructResourceInstanceUseCase";
|
|
6
5
|
import { GetResourceInstanceUseCase } from "../../application/usecases/GetResourceInstanceUseCase";
|
|
@@ -8,8 +7,6 @@ import { RegisterResourceUseCase } from "../../application/usecases/RegisterReso
|
|
|
8
7
|
import { SyncStateWithResourceUseCase } from "../../application/usecases/SyncStateWithResourceUseCase";
|
|
9
8
|
export class Service {
|
|
10
9
|
constructor(dependencies) {
|
|
11
|
-
_defineProperty(this, "getResourcesUseCase", void 0);
|
|
12
|
-
|
|
13
10
|
_defineProperty(this, "createResourceInstanceUseCase", void 0);
|
|
14
11
|
|
|
15
12
|
_defineProperty(this, "destructResourceInstanceUseCase", void 0);
|
|
@@ -20,7 +17,6 @@ export class Service {
|
|
|
20
17
|
|
|
21
18
|
_defineProperty(this, "getResourceInstanceUseCase", void 0);
|
|
22
19
|
|
|
23
|
-
this.getResourcesUseCase = new GetResourcesUseCase(dependencies);
|
|
24
20
|
this.createResourceInstanceUseCase = new CreateResourceInstanceUseCase(dependencies);
|
|
25
21
|
this.destructResourceInstanceUseCase = new DestructResourceInstanceUseCase(dependencies);
|
|
26
22
|
this.syncStateWithResourceUseCase = new SyncStateWithResourceUseCase(dependencies);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const DEFAULT_INSTANCE_NAME = '__default__';
|
|
2
1
|
export class ResourceManager {
|
|
3
2
|
constructor() {
|
|
4
3
|
let resources = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -16,14 +15,6 @@ export class ResourceManager {
|
|
|
16
15
|
return ((_resourceInstances$re = resourceInstances[resourceName]) === null || _resourceInstances$re === void 0 ? void 0 : _resourceInstances$re[instanceName]) || null;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
getResources() {
|
|
20
|
-
return Object.fromEntries(Object.entries(this.resourceInstances).map(_ref => {
|
|
21
|
-
let [resourceName, instance] = _ref;
|
|
22
|
-
const instanceName = Object.keys(instance)[0];
|
|
23
|
-
return [resourceName, instanceName === DEFAULT_INSTANCE_NAME ? this.getResourceInstance(resourceName, '__default__') : instanceName => this.getResourceInstance(resourceName, instanceName)];
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
18
|
createResourceInstance(resourceName, instanceName) {
|
|
28
19
|
const {
|
|
29
20
|
resourceInstances,
|
|
@@ -31,19 +22,18 @@ export class ResourceManager {
|
|
|
31
22
|
} = this;
|
|
32
23
|
const ResourceClass = resources[resourceName];
|
|
33
24
|
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
25
|
+
if (ResourceClass) {
|
|
26
|
+
const instance = new ResourceClass();
|
|
27
|
+
instance.initialize();
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
if (!resourceInstances[resourceName]) {
|
|
30
|
+
resourceInstances[resourceName] = {};
|
|
31
|
+
}
|
|
41
32
|
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
resourceInstances[resourceName][instanceName] = instance;
|
|
34
|
+
} else {
|
|
35
|
+
console.warn(`Resource class not found for: ${resourceName}`);
|
|
44
36
|
}
|
|
45
|
-
|
|
46
|
-
resourceInstances[resourceName][instanceName || DEFAULT_INSTANCE_NAME] = instance;
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
destructResourceInstance(resourceName, instanceName) {
|
|
@@ -74,7 +64,7 @@ export class ResourceManager {
|
|
|
74
64
|
resources[resourceName] = resource;
|
|
75
65
|
}
|
|
76
66
|
|
|
77
|
-
syncStateWithResource(
|
|
67
|
+
syncStateWithResource(_ref) {
|
|
78
68
|
var _resourceInstances$re3;
|
|
79
69
|
|
|
80
70
|
let {
|
|
@@ -83,7 +73,7 @@ export class ResourceManager {
|
|
|
83
73
|
state,
|
|
84
74
|
dispatch,
|
|
85
75
|
updateState
|
|
86
|
-
} =
|
|
76
|
+
} = _ref;
|
|
87
77
|
const {
|
|
88
78
|
resourceInstances
|
|
89
79
|
} = this;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import ResourceNamesEnum from "../../../bc/sdk/ResourceNamesEnum";
|
|
2
2
|
import { sdkRegistry } from "./SdkRegistry";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated
|
|
6
|
-
*/
|
|
7
|
-
export const platformSDK_old = {
|
|
3
|
+
export const platformSDK = {
|
|
8
4
|
[ResourceNamesEnum.SMART_TABLE](instanceName) {
|
|
9
5
|
return sdkRegistry.getResourceInstance({
|
|
10
6
|
resourceName: ResourceNamesEnum.SMART_TABLE,
|
|
@@ -12,7 +8,6 @@ export const platformSDK_old = {
|
|
|
12
8
|
});
|
|
13
9
|
},
|
|
14
10
|
|
|
15
|
-
// ['app']: sdkRegistry.getResourceInstance({ resourceName: 'app' }),
|
|
16
11
|
[ResourceNamesEnum.SMART_FORM](instanceName) {
|
|
17
12
|
return sdkRegistry.getResourceInstance({
|
|
18
13
|
resourceName: ResourceNamesEnum.SMART_FORM,
|
|
@@ -27,10 +22,4 @@ export const platformSDK_old = {
|
|
|
27
22
|
});
|
|
28
23
|
}
|
|
29
24
|
|
|
30
|
-
};
|
|
31
|
-
export const platformSDK = new Proxy({}, {
|
|
32
|
-
get(_, prop) {
|
|
33
|
-
return sdkRegistry.getResources()[prop];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
});
|
|
25
|
+
};
|