@zohodesk/library-platform 1.2.2-exp.2 → 1.2.2-exp.6
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/action-status/Constants.js +5 -0
- package/es/cc/action-status/Events.js +6 -0
- package/es/cc/action-status/Properties.js +29 -0
- package/es/cc/action-status/index.js +3 -0
- package/es/cc/button/Properties.js +28 -0
- package/es/cc/date/Properties.js +15 -0
- package/es/cc/fields/field/Events.js +8 -0
- package/es/cc/fields/field/Properties.js +8 -1
- package/es/cc/form/Properties.js +8 -0
- package/es/cc/highlighted-value/Properties.js +28 -0
- package/es/cc/index.js +1 -0
- package/es/cc/label/Properties.js +12 -5
- package/es/cc/multi-select/Properties.js +8 -1
- package/es/cc/radio-dropdown/Events.js +16 -0
- package/es/cc/section/Properties.js +8 -1
- package/es/cc/select/Properties.js +8 -1
- package/es/cc/table-column-filter/Properties.js +9 -0
- package/es/cc/table-list/Events.js +8 -0
- package/es/cc/textarea/Properties.js +15 -0
- package/es/cc/textbox/Properties.js +8 -1
- package/es/index.js +4 -6
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +3 -1
- package/es/library/dot/components/action-status/frameworks/ui/ActionStatus.js +12 -0
- package/es/library/dot/components/action-status/frameworks/ui/ActionStatusView.js +57 -0
- package/es/library/dot/components/action-status/frameworks/ui/css/ActionStatus.module.css +61 -0
- package/es/library/dot/components/form/adapters/presenter/TransformState.js +3 -1
- package/es/library/dot/components/form/frameworks/ui/FormView.js +6 -3
- 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 +16 -7
- package/es/library/dot/components/form/frameworks/ui/sub-components/Header.js +16 -7
- package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +4 -2
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +6 -3
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +6 -3
- package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +6 -3
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +6 -3
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +6 -3
- package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +6 -3
- package/es/library/dot/components/form-fields/field/FieldItem.js +4 -2
- 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 +6 -3
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +7 -4
- package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +6 -3
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +7 -4
- package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +6 -3
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +7 -4
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +6 -3
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +6 -3
- package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +6 -3
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +3 -1
- package/es/library/dot/components/section/frameworks/ui/SectionView.js +11 -6
- package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -3
- package/es/library/dot/components/table-list/adapters/controllers/FieldChangeController.js +4 -2
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +8 -4
- 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 +6 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +11 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +11 -5
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +8 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +12 -5
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +12 -4
- 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/button/frameworks/ui/ButtonView.js +17 -2
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +10 -4
- 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/HighlightedValueView.js +13 -2
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/css/HighlightedValue.module.css +4 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +11 -5
- 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 +21 -8
- 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/RadioDropdownView.js +3 -1
- 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 +18 -8
- 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-column-filter/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilter.js +19 -1
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +3 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/EventHandlersFactory.js +2 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueFieldView.js +8 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/EventHandlersFactory.js +4 -2
- 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/table-field-components/switch-field/frameworks/ui/EventHandlersFactory.js +2 -1
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +10 -4
- 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 +11 -5
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/__test__/ClientActionsFetchSDK.test.js +183 -0
- package/es/platform/client-actions/cc/action-event-mediator/Properties.js +0 -43
- package/es/platform/client-actions/cc/client-actions-renderer/Properties.js +58 -0
- package/es/platform/client-actions/cc/client-actions-renderer/ViewMetaSchema.js +17 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +1 -2
- package/es/platform/client-actions/components/client-actions-renderer/adapters/presenters/ClientActionsRendererTranslator.js +24 -0
- package/es/platform/client-actions/components/client-actions-renderer/domain/entities/ClientActionsRendererViewProps.js +1 -0
- package/es/platform/client-actions/components/client-actions-renderer/domain/entities/Context.js +1 -0
- package/es/platform/client-actions/components/client-actions-renderer/domain/entities/State.js +1 -0
- package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer.js +11 -0
- package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer.module.css +23 -0
- package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRendererView.js +25 -0
- package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/views/DefaultActionsRendererView.js +66 -0
- package/es/platform/client-actions/components/{row-actions-renderer/frameworks/ui/MoreActions → client-actions-renderer/frameworks/ui/more-actions-renderer}/MoreActionsRenderer.js +3 -4
- package/es/platform/client-actions/components/{row-actions-renderer/frameworks/ui/MoreActions → client-actions-renderer/frameworks/ui/more-actions-renderer}/MoreActionsRendererView.js +32 -30
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +7 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/resources/__test__/ClientScriptsFetchSDK.test.js +163 -0
- package/es/platform/client-scripts/cc/zclient-scripts-execution/clientScriptsSchema.js +4 -1
- package/es/platform/components/form-connected/frameworks/FormConnectedView.js +2 -0
- package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +7 -10
- package/es/platform/components/smart-action-band/frameworks/SmartActionBandView.js +17 -5
- package/es/platform/data-source/http-template/getAvailableFields.js +4 -2
- package/es/platform/zform/adapters/presenter/FormTranslator.js +8 -12
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +10 -14
- package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +2 -1
- package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +13 -8
- package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +15 -12
- package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +4 -2
- package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +4 -2
- package/es/platform/zform/domain/interfaces/IZForm.js +2 -5
- package/es/platform/zform/domain/interfaces/ValidationEvents.js +4 -0
- package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +2 -4
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +6 -1
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/Header.js +7 -6
- package/es/platform/zlist/adapters/presenters/translators/Row.js +6 -5
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +7 -3
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +7 -3
- package/package.json +19 -6
- package/es/.DS_Store +0 -0
- package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +0 -1
- package/es/platform/.DS_Store +0 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRenderer.js +0 -12
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRendererView.js +0 -42
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.js +0 -12
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +0 -23
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRendererView.js +0 -37
- /package/es/platform/client-actions/components/{row-actions-renderer/domain/entities/interfaces/IState.js → client-actions-renderer/domain/entities/ClientActionsRendererDatatype.js} +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import ClientActionsTranslator from "../../../../../client-actions/translators/client-actions-translator";
|
|
2
|
-
|
|
3
1
|
const PickListFieldTranslator = _ref => {
|
|
4
2
|
let {
|
|
5
3
|
field,
|
|
@@ -8,27 +6,31 @@ const PickListFieldTranslator = _ref => {
|
|
|
8
6
|
fieldPreModified,
|
|
9
7
|
fieldOptionActions,
|
|
10
8
|
instanceName,
|
|
11
|
-
moduleName
|
|
9
|
+
moduleName,
|
|
10
|
+
context
|
|
12
11
|
} = _ref;
|
|
13
12
|
const fieldModified = { ...fieldPreModified,
|
|
14
13
|
id: field.id,
|
|
15
14
|
label: field.i18NLabel,
|
|
16
15
|
options: field.pickListValues.map(picklistValue => {
|
|
17
16
|
const optionActions = {};
|
|
17
|
+
const {
|
|
18
|
+
value: _omit,
|
|
19
|
+
...fieldWithoutValue
|
|
20
|
+
} = field;
|
|
21
|
+
const context = { ...picklistValue,
|
|
22
|
+
...fieldWithoutValue
|
|
23
|
+
};
|
|
18
24
|
Object.entries(fieldOptionActions).forEach(_ref2 => {
|
|
19
25
|
let [key, value] = _ref2;
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
...fieldWithoutValue
|
|
23
|
-
} = field;
|
|
24
|
-
optionActions[key] = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...picklistValue,
|
|
25
|
-
...fieldWithoutValue
|
|
26
|
-
});
|
|
26
|
+
// const { value: _omit, ...fieldWithoutValue } = field;
|
|
27
|
+
optionActions[key] = value; // optionActions[key] = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...picklistValue, ...fieldWithoutValue });
|
|
27
28
|
});
|
|
28
29
|
return {
|
|
29
30
|
optionActions: optionActions.fieldOptionRightActions,
|
|
30
31
|
value: picklistValue.value,
|
|
31
|
-
label: picklistValue.value
|
|
32
|
+
label: picklistValue.value,
|
|
33
|
+
context
|
|
32
34
|
};
|
|
33
35
|
}),
|
|
34
36
|
type,
|
|
@@ -41,7 +43,8 @@ const PickListFieldTranslator = _ref => {
|
|
|
41
43
|
readonly: field.isReadOnly,
|
|
42
44
|
// visibility: field.isVisible,
|
|
43
45
|
isVisible: field.isVisible,
|
|
44
|
-
errorMessage: field.errorMessage || ''
|
|
46
|
+
errorMessage: field.errorMessage || '',
|
|
47
|
+
context
|
|
45
48
|
};
|
|
46
49
|
return fieldModified;
|
|
47
50
|
};
|
|
@@ -3,7 +3,8 @@ const TextAreaFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
fieldPreModified,
|
|
6
|
-
uiConfig
|
|
6
|
+
uiConfig,
|
|
7
|
+
context
|
|
7
8
|
} = _ref;
|
|
8
9
|
const fieldModified = {
|
|
9
10
|
type,
|
|
@@ -19,7 +20,8 @@ const TextAreaFieldTranslator = _ref => {
|
|
|
19
20
|
maxLength: field.maxLength,
|
|
20
21
|
// visibility: field.isVisible,
|
|
21
22
|
isVisible: field.isVisible,
|
|
22
|
-
errorMessage: field.errorMessage || ''
|
|
23
|
+
errorMessage: field.errorMessage || '',
|
|
24
|
+
context
|
|
23
25
|
};
|
|
24
26
|
return fieldModified;
|
|
25
27
|
};
|
|
@@ -3,7 +3,8 @@ const TextFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
fieldPreModified,
|
|
6
|
-
uiConfig
|
|
6
|
+
uiConfig,
|
|
7
|
+
context
|
|
7
8
|
} = _ref;
|
|
8
9
|
const fieldModified = {
|
|
9
10
|
type,
|
|
@@ -20,7 +21,8 @@ const TextFieldTranslator = _ref => {
|
|
|
20
21
|
maxLength: field.maxLength,
|
|
21
22
|
// visibility: field.isVisible,
|
|
22
23
|
isVisible: field.isVisible,
|
|
23
|
-
errorMessage: field.errorMessage || ''
|
|
24
|
+
errorMessage: field.errorMessage || '',
|
|
25
|
+
context
|
|
24
26
|
};
|
|
25
27
|
return fieldModified;
|
|
26
28
|
};
|
|
@@ -3,7 +3,8 @@ const URLFieldTranslator = _ref => {
|
|
|
3
3
|
field,
|
|
4
4
|
type,
|
|
5
5
|
fieldPreModified,
|
|
6
|
-
uiConfig
|
|
6
|
+
uiConfig,
|
|
7
|
+
context
|
|
7
8
|
} = _ref;
|
|
8
9
|
const fieldModified = {
|
|
9
10
|
type,
|
|
@@ -20,7 +21,8 @@ const URLFieldTranslator = _ref => {
|
|
|
20
21
|
readonly: field.isReadOnly,
|
|
21
22
|
// visibility: field.isVisible,
|
|
22
23
|
isVisible: field.isVisible,
|
|
23
|
-
errorMessage: field.errorMessage || ''
|
|
24
|
+
errorMessage: field.errorMessage || '',
|
|
25
|
+
context
|
|
24
26
|
};
|
|
25
27
|
return fieldModified;
|
|
26
28
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @zohodesk/architecturerules/define-property-schema */
|
|
2
2
|
|
|
3
3
|
/* eslint-disable max-lines-per-function */
|
|
4
|
-
import ClientActionsTranslator from "../../../client-actions/translators/client-actions-translator";
|
|
5
4
|
import DefaultClientActions from "./utils/DefaultClientActions";
|
|
6
5
|
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
7
6
|
export default function SelectionTranslator(state) {
|
|
@@ -13,7 +12,6 @@ export default function SelectionTranslator(state) {
|
|
|
13
12
|
columnChooserConfig,
|
|
14
13
|
selectionConfig,
|
|
15
14
|
moduleName,
|
|
16
|
-
instanceName,
|
|
17
15
|
textOverflowConfig
|
|
18
16
|
} = properties;
|
|
19
17
|
const {
|
|
@@ -35,11 +33,11 @@ export default function SelectionTranslator(state) {
|
|
|
35
33
|
isEnabled: textOverflowConfig.isEnabled,
|
|
36
34
|
mode: textOverflow.mode
|
|
37
35
|
});
|
|
38
|
-
const contextAppliedActions = ClientActionsTranslator.transform(clientActions, instanceName, moduleName, context);
|
|
39
36
|
return {
|
|
40
37
|
selected,
|
|
41
38
|
hasAllSelected,
|
|
42
|
-
actions:
|
|
39
|
+
actions: clientActions,
|
|
40
|
+
context
|
|
43
41
|
};
|
|
44
42
|
}
|
|
45
43
|
|
|
@@ -157,13 +157,18 @@ export default class TableTranslator {
|
|
|
157
157
|
field.uiType = uiType;
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
|
+
const massActionsContext = {
|
|
161
|
+
instanceName,
|
|
162
|
+
moduleName
|
|
163
|
+
};
|
|
160
164
|
const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortConfig, records, instanceName, moduleName);
|
|
161
165
|
const rowsTranslator = new RowsTranslator(isLocalSearchEnabled ? localRecords : recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, textOverflowData, moduleName, nameFieldsConfig, recordReadStatusConfig, Array.isArray(zfield.componentMapping) ? [...zfield.componentMapping] : []); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
162
166
|
// const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator(), actionTranslator.getTranslator()];
|
|
163
167
|
|
|
164
168
|
const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator()];
|
|
165
169
|
let data = Pipeline.run(translators, {});
|
|
166
|
-
data.clientScripts = clientScripts;
|
|
170
|
+
data.clientScripts = clientScripts;
|
|
171
|
+
data.massActionsContext = massActionsContext; // TODO: Implement ModuleTableModel, and move data and isLoading to tableViewModel Object
|
|
167
172
|
|
|
168
173
|
return {
|
|
169
174
|
properties,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Alignment } from "../../../../../cc/table-list/data-types/Header";
|
|
2
|
-
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
3
2
|
import { SortModelOrder } from "../../../../zlist/domain/entities/interfaces/Properties";
|
|
4
3
|
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
5
4
|
import { SortOrder } from "../../../../../bc/zlist/Types";
|
|
@@ -14,10 +13,6 @@ function HeaderTranslator(field, actions, context, modifiedWidths, sortConfig, r
|
|
|
14
13
|
const newField = { ...field,
|
|
15
14
|
sort: translateSortBy(field.name, sortConfig)
|
|
16
15
|
};
|
|
17
|
-
const transformedActions = ClientActionsTranslator.transform(actions, instanceName, moduleName, { ...context,
|
|
18
|
-
field: newField,
|
|
19
|
-
recordsLength: records.length.toString()
|
|
20
|
-
});
|
|
21
16
|
const width = modifiedWidths[name];
|
|
22
17
|
return {
|
|
23
18
|
id: id,
|
|
@@ -26,7 +21,13 @@ function HeaderTranslator(field, actions, context, modifiedWidths, sortConfig, r
|
|
|
26
21
|
sortable: isSortable,
|
|
27
22
|
alignment: Alignment.Left,
|
|
28
23
|
width,
|
|
29
|
-
actions
|
|
24
|
+
actions,
|
|
25
|
+
context: { ...context,
|
|
26
|
+
field: newField,
|
|
27
|
+
recordsLength: records.length.toString(),
|
|
28
|
+
instanceName,
|
|
29
|
+
moduleName
|
|
30
|
+
}
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ColumnTranslator from "./ColumnTranslator";
|
|
2
|
-
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
3
2
|
export default function RowTranslator(_ref) {
|
|
4
3
|
let {
|
|
5
4
|
record,
|
|
@@ -17,9 +16,6 @@ export default function RowTranslator(_ref) {
|
|
|
17
16
|
recordReadStatusConfig,
|
|
18
17
|
componentMapping
|
|
19
18
|
} = _ref;
|
|
20
|
-
const actions = ClientActionsTranslator.transform(rowActions, instanceName, moduleName, { ...context,
|
|
21
|
-
record
|
|
22
|
-
});
|
|
23
19
|
return {
|
|
24
20
|
id: record.id,
|
|
25
21
|
columns: fields.map(field => ColumnTranslator({
|
|
@@ -38,7 +34,12 @@ export default function RowTranslator(_ref) {
|
|
|
38
34
|
})),
|
|
39
35
|
rowActionLocation: {
|
|
40
36
|
type: rowActionsUiType,
|
|
41
|
-
actions
|
|
37
|
+
actions: rowActions,
|
|
38
|
+
context: { ...context,
|
|
39
|
+
record,
|
|
40
|
+
instanceName,
|
|
41
|
+
moduleName
|
|
42
|
+
}
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
}
|
|
@@ -15,14 +15,18 @@ const DateFieldTranslator = _ref => {
|
|
|
15
15
|
uiType,
|
|
16
16
|
name
|
|
17
17
|
} = field;
|
|
18
|
+
const defaultDateTimeFormat = {
|
|
19
|
+
dateFormat: 'dd MM yyyy',
|
|
20
|
+
timeFormat: '12-hour',
|
|
21
|
+
delimiter: 'space',
|
|
22
|
+
isShortenDateTimeInfo: false
|
|
23
|
+
};
|
|
18
24
|
const {
|
|
19
25
|
dateFormat,
|
|
20
26
|
timeFormat,
|
|
21
27
|
delimiter,
|
|
22
28
|
isShortenDateTimeInfo
|
|
23
|
-
} = context
|
|
24
|
-
// const { dateFormat, timeFormat, delimiter } = appContext.dateTimeFormat;
|
|
25
|
-
|
|
29
|
+
} = context?.dateTimeFormat || defaultDateTimeFormat;
|
|
26
30
|
const newDateValue = DateAndTimeFormat({
|
|
27
31
|
dateFormatType: dateFormat,
|
|
28
32
|
timeFormatType: timeFormat,
|
|
@@ -15,14 +15,18 @@ const DateTimeFieldTranslator = _ref => {
|
|
|
15
15
|
uiType,
|
|
16
16
|
name
|
|
17
17
|
} = field;
|
|
18
|
+
const defaultDateTimeFormat = {
|
|
19
|
+
dateFormat: 'dd MM yyyy',
|
|
20
|
+
timeFormat: '12-hour',
|
|
21
|
+
delimiter: 'space',
|
|
22
|
+
isShortenDateTimeInfo: false
|
|
23
|
+
};
|
|
18
24
|
const {
|
|
19
25
|
dateFormat,
|
|
20
26
|
timeFormat,
|
|
21
27
|
delimiter,
|
|
22
28
|
isShortenDateTimeInfo
|
|
23
|
-
} = context
|
|
24
|
-
// const { dateFormat, timeFormat, delimiter } = appContext.dateTimeFormat;
|
|
25
|
-
|
|
29
|
+
} = context?.dateTimeFormat || defaultDateTimeFormat;
|
|
26
30
|
const newDateValue = DateAndTimeFormat({
|
|
27
31
|
dateFormatType: dateFormat,
|
|
28
32
|
timeFormatType: timeFormat,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/library-platform",
|
|
3
|
-
"version": "1.2.2-exp.
|
|
3
|
+
"version": "1.2.2-exp.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,18 +15,30 @@
|
|
|
15
15
|
"clean": "cdt clean ./es",
|
|
16
16
|
"build": "npm run clean && cbt build:es",
|
|
17
17
|
"build:watch": "npm run build -- -w",
|
|
18
|
-
"test": "
|
|
18
|
+
"test": "npx ZDTestingFramework unit-test",
|
|
19
19
|
"prepare": "npm run build",
|
|
20
20
|
"publish:alpha": "npm publish --tag alpha",
|
|
21
21
|
"publish:beta": "npm publish --tag beta",
|
|
22
22
|
"publish:exp": "npm publish --tag experimental",
|
|
23
|
+
"postinstall": "node -e \"const path = require('path'); const cwd = process.cwd(); const initCwd = process.env.INIT_CWD ? path.resolve(process.env.INIT_CWD) : cwd; const isDirectInstall = initCwd === cwd; process.exit(!isDirectInstall ? 0 : 1);\" || (npm run lint:setup && sh scripts/setup-husky-precommit.sh)",
|
|
23
24
|
"postpublish": "node ./post_publish.js",
|
|
24
25
|
"lint:setup": "ZDPrecommit setupPlugins",
|
|
25
26
|
"lint": "eslint -c .eslintrc.js --ext .ts,.js,.tsx",
|
|
26
27
|
"lint:analytics": "ZDLintFramework lint",
|
|
27
28
|
"lint:exemption": "ZDLintFramework exemption-report",
|
|
28
29
|
"lint:ci": "ZDLintFramework lint-ci",
|
|
29
|
-
"prettify": "node prettify.js staged"
|
|
30
|
+
"prettify": "node prettify.js staged",
|
|
31
|
+
"arch:check": "depcruise --config .dependency-cruiser.js src",
|
|
32
|
+
"tdd:check": "bash scripts/check-tdd-compliance.sh",
|
|
33
|
+
"layer:check": "bash scripts/check-layer-completeness.sh",
|
|
34
|
+
"guardrails:fast": "bash scripts/guardrails-fast.sh",
|
|
35
|
+
"guardrails:arch": "npm run arch:check && npm run guardrails:fast",
|
|
36
|
+
"guardrails:full": "npm run arch:check && npm run lint && npm test && npm run build && npm run guardrails:fast",
|
|
37
|
+
"staged:test": "bash scripts/run-staged-tests.sh",
|
|
38
|
+
"mutation:test": "npx zdcodequality mutate --local --branch=v2 --mutationConfigPath=mutation.conf.js --jestConfigPath=ut.config.js",
|
|
39
|
+
"mutation:test:ci": "npx zdcodequality mutate --ci --branch=v2 --mutationConfigPath=mutation.conf.js --jestConfigPath=ut.config.js",
|
|
40
|
+
"mutation:staged": "bash scripts/check-mutation-staged.sh",
|
|
41
|
+
"uat:impact": "bash scripts/check-uat-impact.sh"
|
|
30
42
|
},
|
|
31
43
|
"author": "",
|
|
32
44
|
"license": "ISC",
|
|
@@ -46,7 +58,7 @@
|
|
|
46
58
|
"@zohodesk-private/dot-registry": "0.0.2",
|
|
47
59
|
"@zohodesk-private/node-plugins": "1.1.9",
|
|
48
60
|
"@zohodesk/a11y": "2.3.8",
|
|
49
|
-
"@zohodesk/codestandard-validator": "1.3.1",
|
|
61
|
+
"@zohodesk/codestandard-validator": "1.3.1-platform-14",
|
|
50
62
|
"@zohodesk/components": "1.5.8",
|
|
51
63
|
"@zohodesk/dot": "1.8.6",
|
|
52
64
|
"@zohodesk/dotkit": "1.0.7",
|
|
@@ -54,6 +66,7 @@
|
|
|
54
66
|
"@zohodesk/icons": "1.1.5",
|
|
55
67
|
"@zohodesk/layout": "3.1.0",
|
|
56
68
|
"@zohodesk/svg": "1.2.6",
|
|
69
|
+
"@zohodesk/testinglibrary": "0.0.51-n20-experimental",
|
|
57
70
|
"@zohodesk/utils": "1.3.16",
|
|
58
71
|
"@zohodesk/variables": "1.2.0",
|
|
59
72
|
"@zohodesk/virtualizer": "1.0.13",
|
|
@@ -82,7 +95,7 @@
|
|
|
82
95
|
"@zohodesk/dot": "1.8.6",
|
|
83
96
|
"@zohodesk/dotkit": "1.0.7",
|
|
84
97
|
"@zohodesk/hooks": "2.0.6",
|
|
85
|
-
"@zohodesk/i18n": "1.0.0-beta.
|
|
98
|
+
"@zohodesk/i18n": "1.0.0-beta.35",
|
|
86
99
|
"@zohodesk/icons": "1.1.5",
|
|
87
100
|
"@zohodesk/layout": "3.1.0",
|
|
88
101
|
"@zohodesk/svg": "1.2.6",
|
|
@@ -94,4 +107,4 @@
|
|
|
94
107
|
"jsep": "0.3.5",
|
|
95
108
|
"object-path-immutable": "4.1.2"
|
|
96
109
|
}
|
|
97
|
-
}
|
|
110
|
+
}
|
package/es/.DS_Store
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "../../../json-schema-validator/Validator";
|
package/es/platform/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
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;
|