@zohodesk/library-platform 1.2.2-exp.6 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/.DS_Store +0 -0
- package/es/cc/date/Properties.js +0 -15
- package/es/cc/fields/field/Properties.js +1 -8
- package/es/cc/form/Properties.js +0 -8
- package/es/cc/label/Properties.js +5 -12
- package/es/cc/multi-select/Properties.js +1 -8
- package/es/cc/section/Properties.js +1 -8
- package/es/cc/select/Properties.js +1 -8
- package/es/cc/textarea/Properties.js +0 -15
- package/es/cc/textbox/Properties.js +1 -8
- package/es/index.js +6 -4
- package/es/library/dot/components/action-status/frameworks/ui/css/ActionStatus.module.css +3 -3
- package/es/library/dot/components/form/adapters/presenter/TransformState.js +1 -3
- package/es/library/dot/components/form/frameworks/ui/FormView.js +3 -6
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +13 -13
- package/es/library/dot/components/form/frameworks/ui/sub-components/Footer.js +7 -16
- package/es/library/dot/components/form/frameworks/ui/sub-components/Header.js +7 -16
- package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +2 -4
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +3 -6
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +3 -6
- package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +3 -6
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +3 -6
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +3 -6
- package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +3 -6
- package/es/library/dot/components/form-fields/field/FieldItem.js +2 -4
- package/es/library/dot/components/form-fields/field/css/FieldItem.module.css +2 -2
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/LookupView.js +3 -6
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +4 -7
- package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +3 -6
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +4 -7
- package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +3 -6
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +4 -7
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +3 -6
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +3 -6
- package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +3 -6
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +1 -3
- package/es/library/dot/components/section/frameworks/ui/SectionView.js +6 -11
- package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -3
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +4 -8
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +25 -25
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +4 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +6 -11
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +5 -11
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +4 -8
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +5 -12
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +4 -12
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +4 -10
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/css/HighlightedValue.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +5 -11
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +8 -21
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +7 -7
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/css/RadioDropdown.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +8 -18
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/css/Select.module.css +2 -2
- package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/css/TableColumnChooserView.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/css/RadioDropdownField.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +4 -10
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +3 -3
- package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +5 -11
- package/es/platform/.DS_Store +0 -0
- package/es/platform/client-actions/cc/action-event-mediator/Properties.js +43 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +2 -1
- package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer.module.css +6 -6
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +0 -7
- package/es/platform/client-actions/components/row-actions-renderer/domain/entities/interfaces/IState.js +1 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRenderer.js +12 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRendererView.js +42 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/MoreActions/MoreActionsRenderer.js +10 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/MoreActions/MoreActionsRendererView.js +79 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.js +12 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +23 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRendererView.js +37 -0
- package/es/platform/client-scripts/cc/zclient-scripts-execution/clientScriptsSchema.js +1 -4
- package/es/platform/components/form-connected/frameworks/FormConnectedView.js +0 -2
- package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +10 -7
- package/es/platform/components/smart-action-band/frameworks/SmartActionBandView.js +5 -17
- package/es/platform/zform/adapters/presenter/FormTranslator.js +12 -8
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +14 -10
- package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +1 -2
- package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +8 -13
- package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +12 -15
- package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +2 -4
- package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +2 -4
- package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +4 -2
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +1 -6
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +1 -7
- package/es/platform/zlist/adapters/presenters/translators/Header.js +6 -7
- package/es/platform/zlist/adapters/presenters/translators/Row.js +5 -6
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
.wrapper {
|
|
2
|
-
max-width: 100%
|
|
2
|
+
max-width: 100%
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.gap_small {
|
|
6
|
-
gap:
|
|
6
|
+
gap: var(--zd_size4)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.gap_xmedium {
|
|
10
|
-
gap:
|
|
10
|
+
gap: var(--zd_size6)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.gap_medium {
|
|
14
|
-
gap:
|
|
14
|
+
gap: var(--zd_size8)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.gap_large {
|
|
18
|
-
gap:
|
|
18
|
+
gap: var(--zd_size10)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.gap_xlarge {
|
|
22
|
-
gap:
|
|
22
|
+
gap: var(--zd_size12)
|
|
23
23
|
}
|
|
@@ -6,11 +6,4 @@ export let ActionViewGap = /*#__PURE__*/function (ActionViewGap) {
|
|
|
6
6
|
ActionViewGap["LARGE"] = "large";
|
|
7
7
|
ActionViewGap["XLARGE"] = "xlarge";
|
|
8
8
|
return ActionViewGap;
|
|
9
|
-
}({});
|
|
10
|
-
export let Layout = /*#__PURE__*/function (Layout) {
|
|
11
|
-
Layout["HORIZONTAL"] = "horizontal";
|
|
12
|
-
Layout["VERTICAL"] = "vertical";
|
|
13
|
-
Layout["HORIZONTAL_WITH_MORE_ACTIONS"] = "horizontal-with-more-actions";
|
|
14
|
-
Layout["VERTICAL_WITH_MORE_ACTIONS"] = "vertical-with-more-actions";
|
|
15
|
-
return Layout;
|
|
16
9
|
}({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../../library/custom-component";
|
|
2
|
+
import RowActionsRendererProperties from "../../../../../cc/action-event-mediator/Properties";
|
|
3
|
+
import { ComponentRegistry } from "../../../../../../../library";
|
|
4
|
+
import AdaptiveRowActionsRendererView from "./AdaptiveRowActionsRendererView";
|
|
5
|
+
const AdaptiveRowActionsRendererComponent = createCustomComponent({
|
|
6
|
+
name: 'AdaptiveRowActionsRenderer',
|
|
7
|
+
properties: RowActionsRendererProperties,
|
|
8
|
+
eventHandlers: {},
|
|
9
|
+
View: AdaptiveRowActionsRendererView
|
|
10
|
+
});
|
|
11
|
+
ComponentRegistry.register("AdaptiveRowActionsRenderer", AdaptiveRowActionsRendererComponent);
|
|
12
|
+
export default AdaptiveRowActionsRendererComponent;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
4
|
+
import { ActionViewGap } from "../../../../interfaces/ActionViewModel";
|
|
5
|
+
import ActionEventMediator from "../../../../action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
6
|
+
import MoreActionsRenderer from "../MoreActions/MoreActionsRenderer";
|
|
7
|
+
import { findMappedClientScripts } from "../../../../../../client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsUtils"; // @ts-ignore
|
|
8
|
+
|
|
9
|
+
import style from "../RowActions/RowActionsRenderer.module.css";
|
|
10
|
+
export default function AdaptiveRowActionsRendererView(_ref, ref) {
|
|
11
|
+
let {
|
|
12
|
+
state,
|
|
13
|
+
helpers
|
|
14
|
+
} = _ref;
|
|
15
|
+
const {
|
|
16
|
+
actions,
|
|
17
|
+
gap,
|
|
18
|
+
testId,
|
|
19
|
+
clientScripts
|
|
20
|
+
} = state.properties;
|
|
21
|
+
const [firstAction, secondAction, ...moreActions] = actions;
|
|
22
|
+
const showMore = actions.length > 3;
|
|
23
|
+
const actionsList = showMore ? [firstAction, secondAction] : actions;
|
|
24
|
+
|
|
25
|
+
const renderAction = action => /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
26
|
+
key: action.id,
|
|
27
|
+
action: action,
|
|
28
|
+
clientScripts: findMappedClientScripts(action, clientScripts),
|
|
29
|
+
instanceName: action.instanceName
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
testId: testId ? testId : '',
|
|
35
|
+
$ui_className: gap !== ActionViewGap.NONE ? style[`gap_${gap}`] : '',
|
|
36
|
+
$ui_displayMode: "inline",
|
|
37
|
+
$ui_alignItems: "center"
|
|
38
|
+
}, showMore ? /*#__PURE__*/React.createElement(React.Fragment, null, actionsList.map(renderAction), /*#__PURE__*/React.createElement(MoreActionsRenderer, {
|
|
39
|
+
actions: moreActions,
|
|
40
|
+
clientScripts: clientScripts
|
|
41
|
+
})) : actionsList.map(renderAction));
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../../library/custom-component";
|
|
2
|
+
import RowActionsRendererProperties from "../../../../../cc/action-event-mediator/Properties";
|
|
3
|
+
import MoreActionsRendererView from "./MoreActionsRendererView";
|
|
4
|
+
const MoreActionsRenderer = createCustomComponent({
|
|
5
|
+
name: "MoreActionsRenderer",
|
|
6
|
+
eventHandlers: {},
|
|
7
|
+
properties: RowActionsRendererProperties,
|
|
8
|
+
View: MoreActionsRendererView
|
|
9
|
+
});
|
|
10
|
+
export default MoreActionsRenderer;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ActionEventMediator from "../../../../action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
3
|
+
import CustomDropdown from '@zohodesk-private/desk-components/es/CustomDropdown/CustomDropdown';
|
|
4
|
+
import ListItemConstants from "../../../../../../../cc/list-item/Constants";
|
|
5
|
+
import IconButton from '@zohodesk/dot/es/IconButton/IconButton';
|
|
6
|
+
import { findMappedClientScripts } from "../../../../../../client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsUtils";
|
|
7
|
+
export const ListItemConvertor = action => {
|
|
8
|
+
const {
|
|
9
|
+
id,
|
|
10
|
+
properties: {
|
|
11
|
+
icon
|
|
12
|
+
},
|
|
13
|
+
eventMappings,
|
|
14
|
+
instanceName
|
|
15
|
+
} = action;
|
|
16
|
+
const label = action.properties.label ? action.properties.label : action.properties.text;
|
|
17
|
+
const updatedEventMappings = eventMappings.map(eventMapping => {
|
|
18
|
+
return { ...eventMapping,
|
|
19
|
+
sourceEvent: ListItemConstants.LISTITEM_CLICKED
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
component: 'ListItem',
|
|
24
|
+
properties: {
|
|
25
|
+
text: label,
|
|
26
|
+
tooltip: label,
|
|
27
|
+
icon,
|
|
28
|
+
id
|
|
29
|
+
},
|
|
30
|
+
eventMappings: updatedEventMappings,
|
|
31
|
+
id,
|
|
32
|
+
instanceName
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function MoreActionsRendererView(_ref, ref) {
|
|
37
|
+
let {
|
|
38
|
+
state,
|
|
39
|
+
helpers
|
|
40
|
+
} = _ref;
|
|
41
|
+
const {
|
|
42
|
+
actions,
|
|
43
|
+
clientScripts
|
|
44
|
+
} = state.properties;
|
|
45
|
+
const listItemActions = actions.map(action => {
|
|
46
|
+
return ListItemConvertor(action);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const renderTargetElement = _ref2 => {
|
|
50
|
+
let {
|
|
51
|
+
handleTogglePopup,
|
|
52
|
+
isPopupOpen
|
|
53
|
+
} = _ref2;
|
|
54
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
55
|
+
iconName: "ZD-GN-more",
|
|
56
|
+
iconSize: "16",
|
|
57
|
+
isActive: isPopupOpen,
|
|
58
|
+
onClick: handleTogglePopup
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return /*#__PURE__*/React.createElement(CustomDropdown, {
|
|
63
|
+
$ui_boxSize: "medium",
|
|
64
|
+
$flag_padding: true,
|
|
65
|
+
$render_targetElement: renderTargetElement,
|
|
66
|
+
$method_getRef: ref,
|
|
67
|
+
$customProps_dropbox: {
|
|
68
|
+
onClick: undefined
|
|
69
|
+
}
|
|
70
|
+
}, listItemActions.map(action => /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
71
|
+
key: action.id,
|
|
72
|
+
action: action,
|
|
73
|
+
clientScripts: findMappedClientScripts(action, clientScripts),
|
|
74
|
+
instanceName: action.instanceName // getRef={ref}
|
|
75
|
+
|
|
76
|
+
})));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default MoreActionsRendererView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../../library/custom-component";
|
|
2
|
+
import RowActionsRendererProperties from "../../../../../cc/action-event-mediator/Properties";
|
|
3
|
+
import RowActionsRendererView from "./RowActionsRendererView";
|
|
4
|
+
import { ComponentRegistry } from "../../../../../../../library";
|
|
5
|
+
const RowActionsRendererComponent = createCustomComponent({
|
|
6
|
+
name: 'RowActionsRenderer',
|
|
7
|
+
properties: RowActionsRendererProperties,
|
|
8
|
+
eventHandlers: {},
|
|
9
|
+
View: RowActionsRendererView
|
|
10
|
+
});
|
|
11
|
+
ComponentRegistry.register("RowActionsRenderer", RowActionsRendererComponent);
|
|
12
|
+
export default RowActionsRendererComponent;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
max-width: 100%
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.gap_small {
|
|
6
|
+
gap: var(--zd_size4)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.gap_xmedium {
|
|
10
|
+
gap: var(--zd_size6)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.gap_medium {
|
|
14
|
+
gap: var(--zd_size8)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.gap_large {
|
|
18
|
+
gap: var(--zd_size10)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.gap_xlarge {
|
|
22
|
+
gap: var(--zd_size12)
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
3
|
+
import { ActionViewGap } from "../../../../interfaces/ActionViewModel";
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
import style from "./RowActionsRenderer.module.css";
|
|
6
|
+
import ActionEventMediator from "../../../../action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
7
|
+
import { findMappedClientScripts } from "../../../../../../client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsUtils";
|
|
8
|
+
|
|
9
|
+
function RowActionsRendererView(_ref, ref) {
|
|
10
|
+
let {
|
|
11
|
+
state
|
|
12
|
+
} = _ref;
|
|
13
|
+
const {
|
|
14
|
+
actions,
|
|
15
|
+
gap,
|
|
16
|
+
clientScripts,
|
|
17
|
+
testId
|
|
18
|
+
} = state.properties;
|
|
19
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
testId: testId ? testId : "",
|
|
22
|
+
$ui_displayMode: "inline",
|
|
23
|
+
$ui_alignItems: "center",
|
|
24
|
+
$ui_className: `${gap !== ActionViewGap.NONE ? style[`gap_${gap}`] : ''}`
|
|
25
|
+
}, actions.map((action, index) => {
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
return /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
28
|
+
action: action,
|
|
29
|
+
clientScripts: findMappedClientScripts(action, clientScripts),
|
|
30
|
+
key: index,
|
|
31
|
+
instanceName: action.instanceName
|
|
32
|
+
});
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
;
|
|
37
|
+
export default RowActionsRendererView;
|
|
@@ -16,7 +16,6 @@ function View(_ref, ref) {
|
|
|
16
16
|
headerRightActions,
|
|
17
17
|
footerLeftActions,
|
|
18
18
|
footerRightActions,
|
|
19
|
-
context,
|
|
20
19
|
clientScripts
|
|
21
20
|
} = state.viewModel;
|
|
22
21
|
return /*#__PURE__*/React.createElement(Form, {
|
|
@@ -29,7 +28,6 @@ function View(_ref, ref) {
|
|
|
29
28
|
headerRightActions: headerRightActions,
|
|
30
29
|
footerLeftActions: footerLeftActions,
|
|
31
30
|
footerRightActions: footerRightActions,
|
|
32
|
-
context: context,
|
|
33
31
|
rightPanel: rightPanel,
|
|
34
32
|
clientScripts: clientScripts
|
|
35
33
|
});
|
package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
1
2
|
import DefaultClientActions from "./utils/DefaultClientActions";
|
|
2
3
|
import { ActionBandLocations } from "../../../../../bc/action-band/Constants";
|
|
3
4
|
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
@@ -55,11 +56,14 @@ export default class ActionBandTranslator {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
const mappedClientActions = mapper(combinedClientActions || []);
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
moduleName
|
|
62
|
-
|
|
59
|
+
const transformedClientActions = {};
|
|
60
|
+
Object.entries(mappedClientActions).forEach(_ref => {
|
|
61
|
+
let [key, value] = _ref;
|
|
62
|
+
let bandActions = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
|
|
63
|
+
defaultSortField: sortConfig.defaultSortField
|
|
64
|
+
});
|
|
65
|
+
transformedClientActions[key] = bandActions;
|
|
66
|
+
});
|
|
63
67
|
const {
|
|
64
68
|
clientScripts,
|
|
65
69
|
isFetching: isClientScriptsFetching
|
|
@@ -67,10 +71,9 @@ export default class ActionBandTranslator {
|
|
|
67
71
|
const {
|
|
68
72
|
actionBandLeftActions,
|
|
69
73
|
actionBandRightActions
|
|
70
|
-
} =
|
|
74
|
+
} = transformedClientActions;
|
|
71
75
|
return { ...state,
|
|
72
76
|
...zclientAction,
|
|
73
|
-
context: clientActionsContext,
|
|
74
77
|
viewModel: {
|
|
75
78
|
actionBandLeftActions,
|
|
76
79
|
actionBandRightActions,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import ActionBand from '@zohodesk-private/desk-components/es/ActionBand/ActionBand';
|
|
4
|
-
import
|
|
5
|
-
import { ActionViewGap, Layout } from "../../../client-actions/components/interfaces/ActionViewModel";
|
|
4
|
+
import RowActionsRenderer from "../../../client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
|
|
6
5
|
|
|
7
6
|
function View(_ref, ref) {
|
|
8
7
|
let {
|
|
@@ -13,31 +12,20 @@ function View(_ref, ref) {
|
|
|
13
12
|
actionBandRightActions,
|
|
14
13
|
clientScripts
|
|
15
14
|
} = state.viewModel;
|
|
16
|
-
const {
|
|
17
|
-
context
|
|
18
|
-
} = state;
|
|
19
15
|
|
|
20
16
|
const renderLeftActions = () => {
|
|
21
|
-
return /*#__PURE__*/React.createElement(
|
|
17
|
+
return /*#__PURE__*/React.createElement(RowActionsRenderer, {
|
|
22
18
|
actions: actionBandLeftActions,
|
|
23
19
|
clientScripts: clientScripts,
|
|
24
|
-
|
|
25
|
-
viewMeta: {
|
|
26
|
-
layout: Layout.HORIZONTAL,
|
|
27
|
-
gap: ActionViewGap.XLARGE
|
|
28
|
-
}
|
|
20
|
+
gap: "xlarge"
|
|
29
21
|
});
|
|
30
22
|
};
|
|
31
23
|
|
|
32
24
|
const renderRightActions = () => {
|
|
33
|
-
return /*#__PURE__*/React.createElement(
|
|
25
|
+
return /*#__PURE__*/React.createElement(RowActionsRenderer, {
|
|
34
26
|
actions: actionBandRightActions,
|
|
35
27
|
clientScripts: clientScripts,
|
|
36
|
-
|
|
37
|
-
viewMeta: {
|
|
38
|
-
layout: Layout.HORIZONTAL,
|
|
39
|
-
gap: ActionViewGap.XLARGE
|
|
40
|
-
}
|
|
28
|
+
gap: "xlarge"
|
|
41
29
|
});
|
|
42
30
|
};
|
|
43
31
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ClientActionsTranslator from "../../../client-actions/translators/client-actions-translator";
|
|
1
2
|
import SectionTranslator from "./translators/SectionTranslator";
|
|
2
3
|
import DefaultFormClientActions from "./utils/DefaultClientActions";
|
|
3
4
|
import { filterClientActionsByLocation } from "../../../client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils";
|
|
@@ -18,7 +19,7 @@ export default class FormTranslator {
|
|
|
18
19
|
zclientAction,
|
|
19
20
|
zclientScriptsEventMapping
|
|
20
21
|
} = state.behaviours;
|
|
21
|
-
|
|
22
|
+
const {
|
|
22
23
|
context
|
|
23
24
|
} = state.behaviours.appContext;
|
|
24
25
|
const {
|
|
@@ -45,11 +46,6 @@ export default class FormTranslator {
|
|
|
45
46
|
};
|
|
46
47
|
const initialRecordData = zform.initialRecordData ? zform.initialRecordData : {
|
|
47
48
|
cf: {}
|
|
48
|
-
}; // @ts-ignore
|
|
49
|
-
|
|
50
|
-
context = { ...context,
|
|
51
|
-
instanceName,
|
|
52
|
-
moduleName
|
|
53
49
|
};
|
|
54
50
|
const actionContext = { ...context,
|
|
55
51
|
mode: zform.mode,
|
|
@@ -60,7 +56,16 @@ export default class FormTranslator {
|
|
|
60
56
|
};
|
|
61
57
|
Object.entries(mappedClientActions).forEach(_ref => {
|
|
62
58
|
let [key, value] = _ref;
|
|
63
|
-
|
|
59
|
+
|
|
60
|
+
if (isFooterEnabled && (key === 'footerLeftActions' || key === 'footerRightActions')) {
|
|
61
|
+
let footerActions = ClientActionsTranslator.transform(value, instanceName, moduleName, actionContext);
|
|
62
|
+
transformedClientActions[key] = footerActions;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (isHeaderEnabled && (key === 'headerLeftActions' || key === 'headerRightActions')) {
|
|
66
|
+
let headerActions = ClientActionsTranslator.transform(value, instanceName, moduleName, actionContext);
|
|
67
|
+
transformedClientActions[key] = headerActions;
|
|
68
|
+
}
|
|
64
69
|
});
|
|
65
70
|
const {
|
|
66
71
|
clientScripts,
|
|
@@ -138,7 +143,6 @@ export default class FormTranslator {
|
|
|
138
143
|
headerRightActions,
|
|
139
144
|
footerLeftActions,
|
|
140
145
|
footerRightActions,
|
|
141
|
-
context: actionContext,
|
|
142
146
|
isLoading: false,
|
|
143
147
|
rightPanel,
|
|
144
148
|
clientScripts
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DefaultFormSectionUIType, fieldTypeToUIType } from "../../../../../cc/fields/field/FormDefaultUIType";
|
|
2
2
|
import * as FieldTranslators from "./fields";
|
|
3
|
+
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
3
4
|
import { getDefaultFieldEphiActionTemplate, getDefaultFieldInfoActionTemplate } from "../utils/DefaultClientActions";
|
|
4
5
|
import sanitizeHtmlString from "../utils/sanitizeHtmlString";
|
|
5
6
|
|
|
@@ -29,7 +30,10 @@ function SectionTranslator(_ref) {
|
|
|
29
30
|
const transformedClientActions = {};
|
|
30
31
|
Object.entries(sectionFieldOptionActions).forEach(_ref2 => {
|
|
31
32
|
let [key, value] = _ref2;
|
|
32
|
-
|
|
33
|
+
let headerActions = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
|
|
34
|
+
...section
|
|
35
|
+
});
|
|
36
|
+
transformedClientActions[key] = headerActions;
|
|
33
37
|
});
|
|
34
38
|
const defaultViewModel = {
|
|
35
39
|
type: mapping?.UIComponentName ? mapping.UIComponentName : DefaultFormSectionUIType,
|
|
@@ -41,9 +45,6 @@ function SectionTranslator(_ref) {
|
|
|
41
45
|
}),
|
|
42
46
|
headerActions: transformedClientActions.sectionHeaderRightActions,
|
|
43
47
|
titleActions: transformedClientActions.sectionTitleRightActions,
|
|
44
|
-
context: { ...context,
|
|
45
|
-
...section
|
|
46
|
-
},
|
|
47
48
|
// headerLeftActions: sectionFieldOptionActions.sectionHeaderLeftActions,
|
|
48
49
|
// headerRightActions: sectionFieldOptionActions.sectionHeaderRightActions,
|
|
49
50
|
// titleLeftActions: sectionFieldOptionActions.sectionTitleLeftActions,
|
|
@@ -88,14 +89,19 @@ function SectionTranslator(_ref) {
|
|
|
88
89
|
const transformedDefaultActions = createEmptyActions();
|
|
89
90
|
Object.entries(defaultActions).forEach(_ref3 => {
|
|
90
91
|
let [key, value] = _ref3;
|
|
91
|
-
|
|
92
|
+
let transformedDefaultAction = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
|
|
93
|
+
...field
|
|
94
|
+
});
|
|
95
|
+
transformedDefaultActions[key] = transformedDefaultAction;
|
|
92
96
|
}); // Transform client actions
|
|
93
97
|
|
|
94
98
|
const transformedActions = createEmptyActions();
|
|
95
99
|
Object.entries(fieldLevelActions).forEach(_ref4 => {
|
|
96
100
|
let [key, value] = _ref4;
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
let transformedAction = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
|
|
102
|
+
...field
|
|
103
|
+
});
|
|
104
|
+
transformedActions[key] = transformedAction;
|
|
99
105
|
}); // Initialize fieldPreModified
|
|
100
106
|
|
|
101
107
|
const fieldPreModified = {};
|
|
@@ -117,9 +123,7 @@ function SectionTranslator(_ref) {
|
|
|
117
123
|
type,
|
|
118
124
|
fieldPreModified,
|
|
119
125
|
uiConfig,
|
|
120
|
-
context
|
|
121
|
-
...field
|
|
122
|
-
},
|
|
126
|
+
context,
|
|
123
127
|
preferences,
|
|
124
128
|
fieldOptionActions,
|
|
125
129
|
instanceName,
|
|
@@ -3,8 +3,7 @@ const BooleanFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
uiConfig,
|
|
6
|
-
fieldPreModified
|
|
7
|
-
context
|
|
6
|
+
fieldPreModified
|
|
8
7
|
} = _ref;
|
|
9
8
|
const fieldModified = { ...fieldPreModified,
|
|
10
9
|
id: field.id,
|
|
@@ -17,8 +16,7 @@ const BooleanFieldTranslator = _ref => {
|
|
|
17
16
|
required: field.isMandatory,
|
|
18
17
|
readonly: field.isReadOnly,
|
|
19
18
|
// visibility: field.isVisible
|
|
20
|
-
isVisible: field.isVisible
|
|
21
|
-
context
|
|
19
|
+
isVisible: field.isVisible
|
|
22
20
|
};
|
|
23
21
|
return fieldModified;
|
|
24
22
|
};
|
|
@@ -26,8 +26,7 @@ const CurrencyFieldTranslator = _ref => {
|
|
|
26
26
|
isVisible: field.isVisible,
|
|
27
27
|
currencyLocale: prefCurrencyLocale || contextCurrencyLocale,
|
|
28
28
|
currencySymbol: prefCurrencySymbol || contextCurrencySymbol,
|
|
29
|
-
errorMessage: field.errorMessage || ''
|
|
30
|
-
context
|
|
29
|
+
errorMessage: field.errorMessage || ''
|
|
31
30
|
};
|
|
32
31
|
return fieldModified;
|
|
33
32
|
};
|
|
@@ -3,8 +3,7 @@ const DateFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
uiConfig,
|
|
6
|
-
fieldPreModified
|
|
7
|
-
context
|
|
6
|
+
fieldPreModified
|
|
8
7
|
} = _ref;
|
|
9
8
|
const fieldModified = { ...fieldPreModified,
|
|
10
9
|
id: field.id,
|
|
@@ -17,8 +16,7 @@ const DateFieldTranslator = _ref => {
|
|
|
17
16
|
errorMessage: field.errorMessage || '',
|
|
18
17
|
required: field.isMandatory,
|
|
19
18
|
readonly: field.isReadOnly,
|
|
20
|
-
isVisible: field.isVisible
|
|
21
|
-
context
|
|
19
|
+
isVisible: field.isVisible
|
|
22
20
|
};
|
|
23
21
|
return fieldModified;
|
|
24
22
|
};
|
|
@@ -3,8 +3,7 @@ const DateTimeFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
uiConfig,
|
|
6
|
-
fieldPreModified
|
|
7
|
-
context
|
|
6
|
+
fieldPreModified
|
|
8
7
|
} = _ref;
|
|
9
8
|
const fieldModified = { ...fieldPreModified,
|
|
10
9
|
id: field.id,
|
|
@@ -18,8 +17,7 @@ const DateTimeFieldTranslator = _ref => {
|
|
|
18
17
|
required: field.isMandatory,
|
|
19
18
|
readonly: field.isReadOnly,
|
|
20
19
|
// visibility: field.isVisible
|
|
21
|
-
isVisible: field.isVisible
|
|
22
|
-
context
|
|
20
|
+
isVisible: field.isVisible
|
|
23
21
|
};
|
|
24
22
|
return fieldModified;
|
|
25
23
|
};
|
|
@@ -3,8 +3,7 @@ const DecimalFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
fieldPreModified,
|
|
6
|
-
uiConfig
|
|
7
|
-
context
|
|
6
|
+
uiConfig
|
|
8
7
|
} = _ref;
|
|
9
8
|
const fieldModified = {
|
|
10
9
|
type,
|
|
@@ -20,8 +19,7 @@ const DecimalFieldTranslator = _ref => {
|
|
|
20
19
|
maxLength: field.maxLength,
|
|
21
20
|
readonly: field.isReadOnly,
|
|
22
21
|
isVisible: field.isVisible,
|
|
23
|
-
errorMessage: field.errorMessage || ''
|
|
24
|
-
context
|
|
22
|
+
errorMessage: field.errorMessage || ''
|
|
25
23
|
};
|
|
26
24
|
return fieldModified;
|
|
27
25
|
};
|
|
@@ -3,8 +3,7 @@ const EmailFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
fieldPreModified,
|
|
6
|
-
uiConfig
|
|
7
|
-
context
|
|
6
|
+
uiConfig
|
|
8
7
|
} = _ref;
|
|
9
8
|
const fieldModified = {
|
|
10
9
|
type,
|
|
@@ -21,8 +20,7 @@ const EmailFieldTranslator = _ref => {
|
|
|
21
20
|
readonly: field.isReadOnly,
|
|
22
21
|
// visibility: field.isVisible,
|
|
23
22
|
isVisible: field.isVisible,
|
|
24
|
-
errorMessage: field.errorMessage || ''
|
|
25
|
-
context
|
|
23
|
+
errorMessage: field.errorMessage || ''
|
|
26
24
|
};
|
|
27
25
|
return fieldModified;
|
|
28
26
|
};
|
|
@@ -3,8 +3,7 @@ const LookUpFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
fieldPreModified,
|
|
6
|
-
uiConfig
|
|
7
|
-
context
|
|
6
|
+
uiConfig
|
|
8
7
|
} = _ref;
|
|
9
8
|
const fieldModified = {
|
|
10
9
|
// Need to check if value is an object or string (ID)
|
|
@@ -24,8 +23,7 @@ const LookUpFieldTranslator = _ref => {
|
|
|
24
23
|
required: field.isMandatory,
|
|
25
24
|
isCustomField: field.isCustomField,
|
|
26
25
|
maxLength: field.maxLength,
|
|
27
|
-
lookup: field.lookup
|
|
28
|
-
context
|
|
26
|
+
lookup: field.lookup
|
|
29
27
|
};
|
|
30
28
|
return fieldModified;
|
|
31
29
|
};
|