@zohodesk/library-platform 1.1.3-exp.1 → 1.1.3-exp.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/README.md +3 -3
- package/es/index.js +4 -3
- package/es/platform/client-actions/translators/client-actions-translator/index.js +5 -2
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/GetResolvedContextFieldValue.js +3 -2
- package/es/platform/client-actions/translators/context-resolver/index.js +1 -4
- package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +33 -0
- package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormConnectedView.js +1 -1
- package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormSdkFactory.js +3 -14
- package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js +28 -0
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ColumnChooserUpdateController.js +5 -5
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeByMouseController.js +1 -1
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeEndController.js +1 -1
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeFinishController.js +1 -1
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeStartController.js +2 -2
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ScrollController.js +1 -1
- package/es/{desk-frameworks/table-connected/frameworks → platform/components/table-connected/adapters}/resources/SmartTableResource.js +21 -17
- package/es/{desk-frameworks → platform/components}/table-connected/frameworks/EventHandlersFactory.js +15 -15
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +55 -0
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +76 -0
- package/es/{desk-frameworks → platform/components}/table-connected/frameworks/TableConnectedView.js +2 -2
- package/es/platform/sdk/{frameworks → application/interfaces/gateways}/AbstractResource.js +2 -4
- package/es/platform/sdk/frameworks/Sdk.js +1 -1
- package/package.json +1 -2
- package/es/desk-frameworks/form-connected/frameworks/FormConnectedFactory.js +0 -33
- package/es/desk-frameworks/table-connected/adapters/controllers/ColumnChooserOpenedController.js +0 -36
- package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +0 -57
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +0 -64
- /package/es/{desk-frameworks → platform/components}/form-connected/frameworks/EventHandlersFactory.js +0 -0
- /package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormConnected.js +0 -0
- /package/es/{desk-frameworks → platform/components}/index.js +0 -0
- /package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/AbstractController.js +0 -0
- /package/es/{desk-frameworks/table-connected/frameworks/resources → platform/components/table-connected/application/interfaces}/ISmartTableResource.js +0 -0
- /package/es/{desk-frameworks → platform/components}/table-connected/frameworks/TableConnected.js +0 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ npm install @zohodesk/library-platform
|
|
|
17
17
|
To create a Table Connected component, you can use the `TableConnectedFactory`. Here is a simple example:
|
|
18
18
|
|
|
19
19
|
```javascript
|
|
20
|
-
import TableConnectedFactory from '@zohodesk/library-platform
|
|
20
|
+
import {TableConnectedFactory} from '@zohodesk/library-platform';
|
|
21
21
|
|
|
22
22
|
const myTableComponent = TableConnectedFactory.create({
|
|
23
23
|
name: 'MyTableComponent',
|
|
@@ -37,7 +37,7 @@ You can create custom components using the `createCustomComponent` function. Thi
|
|
|
37
37
|
#### Example
|
|
38
38
|
|
|
39
39
|
```javascript
|
|
40
|
-
import createCustomComponent from '@zohodesk/library-platform
|
|
40
|
+
import {createCustomComponent} from '@zohodesk/library-platform';
|
|
41
41
|
|
|
42
42
|
const MyCustomComponent = createCustomComponent({
|
|
43
43
|
name: 'MyCustomComponent',
|
|
@@ -55,7 +55,7 @@ The `ComponentRegistry` class is a singleton that allows you to register and ret
|
|
|
55
55
|
#### Example
|
|
56
56
|
|
|
57
57
|
```javascript
|
|
58
|
-
import ComponentRegistry from '@zohodesk/library-platform
|
|
58
|
+
import {ComponentRegistry} from '@zohodesk/library-platform';
|
|
59
59
|
|
|
60
60
|
// Register a component
|
|
61
61
|
ComponentRegistry.register('MyComponent', myComponentInstance);
|
package/es/index.js
CHANGED
|
@@ -2,10 +2,11 @@ import * as _CC from "./cc";
|
|
|
2
2
|
export { _CC as CC };
|
|
3
3
|
import * as _BC from "./bc";
|
|
4
4
|
export { _BC as BC };
|
|
5
|
-
export { TableConnectedFactory } from "./
|
|
5
|
+
export { TableConnectedFactory, FormConnectedFactory } from "./platform/components";
|
|
6
6
|
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 {
|
|
11
|
-
export { sdkRegistry } from "./platform/sdk/frameworks/SdkRegistry";
|
|
10
|
+
export { platformSDK } from "./platform/sdk/frameworks/Sdk";
|
|
11
|
+
export { sdkRegistry } from "./platform/sdk/frameworks/SdkRegistry";
|
|
12
|
+
export { validations as defaultFieldValidations } from "./library/behaviours/field-validation/frameworks/utils/FormBasicValidationAdaptor";
|
|
@@ -20,8 +20,11 @@ export default class ClientActionsTranslator {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
static transform(actions, context) {
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const replacementContext = {
|
|
24
|
+
"@context": context
|
|
25
|
+
};
|
|
26
|
+
const resolvedActions = ActionContextResolver.resolveActions(actions, replacementContext);
|
|
27
|
+
const evaluatedActions = resolvedActions.filter(action => ConditionResolver.evaluateCondition(action.conditions, replacementContext, action.id));
|
|
25
28
|
const finalTransformedActions = evaluatedActions.map(action => this.transformToActionViewModel(action));
|
|
26
29
|
return finalTransformedActions;
|
|
27
30
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import TemplateResolver from "../../../template-resolver";
|
|
1
2
|
export function getResolvedContextFieldValue(context, field) {
|
|
2
|
-
if (field.includes(
|
|
3
|
-
let value =
|
|
3
|
+
if (field.includes('.')) {
|
|
4
|
+
let value = TemplateResolver.replaceContextVariables(field, context);
|
|
4
5
|
return value;
|
|
5
6
|
}
|
|
6
7
|
|
|
@@ -45,10 +45,7 @@ export class ActionContextResolver {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
static resolveActions(actions, context) {
|
|
48
|
-
|
|
49
|
-
"@context": context
|
|
50
|
-
};
|
|
51
|
-
return actions ? actions.map(action => this.resolveAction(action, replacementContext)) : [];
|
|
48
|
+
return actions ? actions.map(action => this.resolveAction(action, context)) : [];
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Properties from "../../../../cc/form-connected/Properties";
|
|
2
|
+
import { createCustomComponent } from "../../../../library/custom-component";
|
|
3
|
+
import ZHttpBehaviourFactory from "../../../zhttp/frameworks/ZHttpBehaviourFactory";
|
|
4
|
+
import RecordBehaviourFactory from "../../../zrecord/frameworks/RecordBehaviourFactory";
|
|
5
|
+
import FormConnectedView from "./FormConnectedView";
|
|
6
|
+
import defaultDataBroker from "../../../data-source";
|
|
7
|
+
import DataBrokerBehaviourFactory from "../../../zdata-source/frameworks/DataBrokerBehaviourFactory";
|
|
8
|
+
import FormTranslator from "../../../zform/adapters/presenter/FormTranslator";
|
|
9
|
+
import ZFormBehaviourFactory from "../../../zform/frameworks/ui/ZFormBehaviourFactory";
|
|
10
|
+
import FieldValidationBehaviourFactory from "../../../../library/behaviours/field-validation/frameworks/ui/FieldValidationBehaviourFactory";
|
|
11
|
+
import EventHandlersfactory from "./EventHandlersFactory";
|
|
12
|
+
export default class FormConnectedFactory {
|
|
13
|
+
static create(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
name,
|
|
16
|
+
customValidators,
|
|
17
|
+
dataBroker = defaultDataBroker,
|
|
18
|
+
eventHandlers = {},
|
|
19
|
+
View = FormConnectedView
|
|
20
|
+
} = _ref;
|
|
21
|
+
return createCustomComponent({
|
|
22
|
+
name: name,
|
|
23
|
+
View: View,
|
|
24
|
+
properties: Properties,
|
|
25
|
+
eventHandlers: EventHandlersfactory.create(eventHandlers),
|
|
26
|
+
transformState: FormTranslator.transformState,
|
|
27
|
+
behaviours: [ZHttpBehaviourFactory.create(), DataBrokerBehaviourFactory.create(), RecordBehaviourFactory.create(dataBroker.httpTemplates), FieldValidationBehaviourFactory.create(), ZFormBehaviourFactory.create({
|
|
28
|
+
customValidators
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormSdkFactory.js
RENAMED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
export default class FormSdkFactory {
|
|
3
3
|
static create(_ref) {
|
|
4
4
|
let {
|
|
5
|
-
state
|
|
6
|
-
dispatch
|
|
5
|
+
state
|
|
7
6
|
} = _ref;
|
|
8
7
|
return {
|
|
9
8
|
zform: {
|
|
@@ -12,21 +11,11 @@ export default class FormSdkFactory {
|
|
|
12
11
|
},
|
|
13
12
|
getFieldValue: name => {
|
|
14
13
|
let field = state.behaviours.zform.sections.flatMap(section => section.fields).find(field => field.name === name);
|
|
15
|
-
|
|
16
|
-
if (field) {
|
|
17
|
-
return field.value;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return null;
|
|
14
|
+
return field ? field.value : null;
|
|
21
15
|
},
|
|
22
16
|
getFieldValidationResult: name => {
|
|
23
17
|
let field = state.behaviours.zform.sections.flatMap(section => section.fields).find(field => field.name === name);
|
|
24
|
-
|
|
25
|
-
if (field) {
|
|
26
|
-
return field.errorMessage;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return null;
|
|
18
|
+
return field ? field.errorMessage : null;
|
|
30
19
|
}
|
|
31
20
|
}
|
|
32
21
|
};
|
package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
import { COLUMN_CHOOSER_BEHAVIOUR_OPENED } from "../../../../../bc/column-chooser/Constants";
|
|
3
|
+
export default class ColumnChooserOpenedController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const state = event.state;
|
|
6
|
+
const {
|
|
7
|
+
zfield
|
|
8
|
+
} = state.behaviours;
|
|
9
|
+
const {
|
|
10
|
+
fields: availableFields,
|
|
11
|
+
selectedFields
|
|
12
|
+
} = zfield;
|
|
13
|
+
const columnChooserOptionsOrder = selectedFields;
|
|
14
|
+
availableFields.forEach(field => {
|
|
15
|
+
if (!selectedFields.includes(field.name)) {
|
|
16
|
+
columnChooserOptionsOrder.push(field.name);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
event.dispatch({
|
|
20
|
+
type: COLUMN_CHOOSER_BEHAVIOUR_OPENED,
|
|
21
|
+
payload: {
|
|
22
|
+
order: columnChooserOptionsOrder,
|
|
23
|
+
selectedArray: selectedFields
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import AbstractController from "./AbstractController";
|
|
2
|
-
import { FIELD_EXECUTE } from "
|
|
2
|
+
import { FIELD_EXECUTE } from "../../../../../bc/zfield/Constants";
|
|
3
3
|
export default class ColumnChooserUpdateController extends AbstractController {
|
|
4
4
|
handle(event) {
|
|
5
5
|
const {
|
|
6
|
-
state
|
|
6
|
+
state,
|
|
7
|
+
dispatch
|
|
7
8
|
} = event;
|
|
8
9
|
const {
|
|
9
10
|
context
|
|
10
11
|
} = state.properties;
|
|
11
12
|
const fields = event.action.payload.selectedArray;
|
|
12
|
-
|
|
13
|
+
dispatch({
|
|
13
14
|
type: FIELD_EXECUTE,
|
|
14
15
|
payload: {
|
|
15
16
|
actionName: 'updateSelectedFields',
|
|
@@ -18,8 +19,7 @@ export default class ColumnChooserUpdateController extends AbstractController {
|
|
|
18
19
|
},
|
|
19
20
|
apiName: 'updateSelectedFields'
|
|
20
21
|
}
|
|
21
|
-
};
|
|
22
|
-
event.dispatch(action);
|
|
22
|
+
});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RESIZE_MOUSE } from "
|
|
1
|
+
import { RESIZE_MOUSE } from "../../../../../bc/table-column-resizer/Constants";
|
|
2
2
|
import AbstractController from "./AbstractController";
|
|
3
3
|
export default class ResizeByMouseController extends AbstractController {
|
|
4
4
|
handle(event) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RESIZE_ENDED } from "
|
|
1
|
+
import { RESIZE_ENDED } from "../../../../../bc/table-column-resizer/Constants";
|
|
2
2
|
import AbstractController from "./AbstractController";
|
|
3
3
|
export default class ResizeEndController extends AbstractController {
|
|
4
4
|
handle(event) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { STORE_REQUESTED } from "
|
|
1
|
+
import { STORE_REQUESTED } from "../../../../../bc/local-storage/Constants";
|
|
2
2
|
import AbstractController from "./AbstractController";
|
|
3
3
|
export class ResizeFinishController extends AbstractController {
|
|
4
4
|
handle(event) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RESIZE_STARTED } from "
|
|
1
|
+
import { RESIZE_STARTED } from "../../../../../bc/table-column-resizer/Constants";
|
|
2
2
|
import AbstractController from "./AbstractController";
|
|
3
3
|
export default class ResizeStartController extends AbstractController {
|
|
4
4
|
handle(event) {
|
|
@@ -11,7 +11,7 @@ export default class ResizeStartController extends AbstractController {
|
|
|
11
11
|
mouseEvent
|
|
12
12
|
} = event.action.payload;
|
|
13
13
|
const mouseX = mouseEvent.clientX;
|
|
14
|
-
const lineClientRect = lineElement.getBoundingClientRect(); // HACK: calculate the initial position of the line element because of lineElement will not be read form entity because of clean architecture.
|
|
14
|
+
const lineClientRect = lineElement.getBoundingClientRect(); // HACK: calculate the initial position of the line element because of lineElement will not be read form entity because of clean architecture.
|
|
15
15
|
// lineElement is not part of the entity, it is part of the view.
|
|
16
16
|
// Note: the reason for this (lineClientRect.width / 2) is , Even line is 2 or 3 px thick we need to take center position.
|
|
17
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RESIZE_SCROLL } from "
|
|
1
|
+
import { RESIZE_SCROLL } from "../../../../../bc/table-column-resizer/Constants";
|
|
2
2
|
import AbstractController from "./AbstractController";
|
|
3
3
|
export default class ScrollController extends AbstractController {
|
|
4
4
|
handle(event) {
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { AbstractResource } from "../../../../
|
|
2
|
-
import ZListRepository from "../../../../
|
|
3
|
-
import ZListSortBy from "../../../../
|
|
4
|
-
import ZListPresenters from "../../../../
|
|
5
|
-
import ZRecordRepository from "../../../../
|
|
6
|
-
import ZRecordPresenter from "../../../../
|
|
7
|
-
import ListSelectRepository from "
|
|
8
|
-
import ListSelectPresenter from "
|
|
9
|
-
import ListSelectSelectUsecase from "
|
|
10
|
-
import ListSelectDeselectUsecase from "
|
|
11
|
-
import GetMultipleRecordUseCase from "../../../../
|
|
12
|
-
import GetSingleRecordUseCase from "../../../../
|
|
13
|
-
import DeleteSingleRecordUseCase from "../../../../
|
|
14
|
-
import DeleteMultipleRecordUseCase from "../../../../
|
|
15
|
-
import RecordUpdateUseCase from "../../../../
|
|
16
|
-
import UpdateMultipleRecordUseCase from "../../../../
|
|
17
|
-
import GetContextUseCase from "../../../../
|
|
1
|
+
import { AbstractResource } from "../../../../sdk/application/interfaces/gateways/AbstractResource";
|
|
2
|
+
import ZListRepository from "../../../../zlist/adapters/gateways/Repository";
|
|
3
|
+
import ZListSortBy from "../../../../zlist/adapters/gateways/SortBy";
|
|
4
|
+
import ZListPresenters from "../../../../zlist/adapters/presenters/Presenters";
|
|
5
|
+
import ZRecordRepository from "../../../../zrecord/adapters/gateways/Repository";
|
|
6
|
+
import ZRecordPresenter from "../../../../zrecord/adapters/presenters/Presenter";
|
|
7
|
+
import ListSelectRepository from "../../../../../library/behaviours/list-selection/adapters/gateways/Repository";
|
|
8
|
+
import ListSelectPresenter from "../../../../../library/behaviours/list-selection/adapters/presenters/Presenter";
|
|
9
|
+
import ListSelectSelectUsecase from "../../../../../library/behaviours/list-selection/applications/usecases/Select";
|
|
10
|
+
import ListSelectDeselectUsecase from "../../../../../library/behaviours/list-selection/applications/usecases/Deselect";
|
|
11
|
+
import GetMultipleRecordUseCase from "../../../../zrecord/applications/usecases/GetMultipleRecordUseCase";
|
|
12
|
+
import GetSingleRecordUseCase from "../../../../zrecord/applications/usecases/GetSingleRecordUseCase";
|
|
13
|
+
import DeleteSingleRecordUseCase from "../../../../zlist/applications/usecases/DeleteSingleRecordUseCase";
|
|
14
|
+
import DeleteMultipleRecordUseCase from "../../../../zlist/applications/usecases/DeleteMultipleRecordUseCase";
|
|
15
|
+
import RecordUpdateUseCase from "../../../../zlist/applications/usecases/RecordUpdateUseCase";
|
|
16
|
+
import UpdateMultipleRecordUseCase from "../../../../zlist/applications/usecases/UpdateMultipleRecordUseCase";
|
|
17
|
+
import GetContextUseCase from "../../../../zlist/applications/usecases/GetContextUseCase";
|
|
18
18
|
export class SmartTableResource extends AbstractResource {
|
|
19
|
+
initialize() {}
|
|
20
|
+
|
|
21
|
+
destroy() {}
|
|
22
|
+
|
|
19
23
|
getRecordDependencies() {
|
|
20
24
|
const dependencies = {
|
|
21
25
|
repository: new ZRecordRepository(),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LIST_SELECTION_RECORDS_DESELECTED, LIST_SELECTION_RECORDS_SELECTED, LIST_SELECTION_SELECTION_LIMIT_EXCEEDED } from "
|
|
2
|
-
import { RESIZE_FINISHED } from "
|
|
3
|
-
import { ZLIST_SORT } from "
|
|
4
|
-
import { COLUMN_CHOOSER_BEHAVIOUR_UPDATED } from "
|
|
5
|
-
import { COLUMN_CHOOSER_OPEN_REQUESTED } from "
|
|
1
|
+
import { LIST_SELECTION_RECORDS_DESELECTED, LIST_SELECTION_RECORDS_SELECTED, LIST_SELECTION_SELECTION_LIMIT_EXCEEDED } from "../../../../bc/list-selection/Constants";
|
|
2
|
+
import { RESIZE_FINISHED } from "../../../../bc/table-column-resizer/Constants";
|
|
3
|
+
import { ZLIST_SORT } from "../../../../bc/zlist/Constants";
|
|
4
|
+
import { COLUMN_CHOOSER_BEHAVIOUR_UPDATED } from "../../../../bc/column-chooser/Constants";
|
|
5
|
+
import { COLUMN_CHOOSER_OPEN_REQUESTED } from "../../../../cc/table-column-chooser/Constants";
|
|
6
6
|
import ListSdkFactory from "./ListSdkFactory";
|
|
7
|
-
import { SmartTableConstants } from "
|
|
8
|
-
import TableListEventConstants from "
|
|
7
|
+
import { SmartTableConstants } from "../../../../cc/table-connected";
|
|
8
|
+
import TableListEventConstants from "../../../../cc/table-list/Constants";
|
|
9
9
|
import ResizeStartController from "../adapters/controllers/ResizeStartController";
|
|
10
10
|
import ResizeByMouseController from "../adapters/controllers/ResizeByMouseController";
|
|
11
11
|
import ResizeEndController from "../adapters/controllers/ResizeEndController";
|
|
@@ -13,10 +13,7 @@ import { ResizeFinishController } from "../adapters/controllers/ResizeFinishCont
|
|
|
13
13
|
import ScrollController from "../adapters/controllers/ScrollController";
|
|
14
14
|
import ColumnChooserUpdateController from "../adapters/controllers/ColumnChooserUpdateController";
|
|
15
15
|
import ColumnChooserOpenedController from "../adapters/controllers/ColumnChooserOpenedController";
|
|
16
|
-
import {
|
|
17
|
-
import { sdk } from "../../../platform/sdk/frameworks/Sdk";
|
|
18
|
-
window.sdkRegistry = sdkRegistry;
|
|
19
|
-
window.sdk = sdk;
|
|
16
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
20
17
|
const {
|
|
21
18
|
TABLE_LIST_RESIZE_START_REQUESTED,
|
|
22
19
|
TABLE_LIST_RESIZE_MOVE_REQUESTED,
|
|
@@ -31,7 +28,7 @@ function createHandlerWithSdk(handler) {
|
|
|
31
28
|
} = input;
|
|
32
29
|
const instanceName = state.properties.instanceName;
|
|
33
30
|
handler({ ...input,
|
|
34
|
-
|
|
31
|
+
platformSDK
|
|
35
32
|
}, ListSdkFactory.create({
|
|
36
33
|
instanceName
|
|
37
34
|
}));
|
|
@@ -39,12 +36,15 @@ function createHandlerWithSdk(handler) {
|
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
export default class EventHandlersFactory {
|
|
42
|
-
static
|
|
43
|
-
|
|
39
|
+
static getSdkWrappedEventHandler(eventHandlers) {
|
|
40
|
+
return Object.fromEntries(Object.keys(eventHandlers).map(eventName => {
|
|
44
41
|
const handler = createHandlerWithSdk(eventHandlers[eventName]);
|
|
45
42
|
return [eventName, handler];
|
|
46
43
|
}));
|
|
47
|
-
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static create(eventHandlers) {
|
|
47
|
+
return { ...EventHandlersFactory.getSdkWrappedEventHandler(eventHandlers),
|
|
48
48
|
NAVIGATION: NavigationHandler,
|
|
49
49
|
[RESIZE_FINISHED]: new ResizeFinishController().handle,
|
|
50
50
|
[TABLE_LIST_RESIZE_START_REQUESTED]: new ResizeStartController().handle,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import ResourceNamesEnum from "../../../../bc/sdk/ResourceNamesEnum";
|
|
2
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
3
|
+
export default class ListSdkFactory {
|
|
4
|
+
static getRecordSdks(smartTable) {
|
|
5
|
+
return {
|
|
6
|
+
getRecords: () => smartTable.getRecords(),
|
|
7
|
+
getRecord: recordId => smartTable.getRecord(recordId),
|
|
8
|
+
getContext: variableName => smartTable.getContext(variableName),
|
|
9
|
+
deleteRecord: recordId => smartTable.deleteRecord(recordId),
|
|
10
|
+
deleteRecords: function (recordIds) {
|
|
11
|
+
let shouldFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
12
|
+
return smartTable.deleteRecords(recordIds, shouldFetch);
|
|
13
|
+
},
|
|
14
|
+
updateRecord: (recordId, record) => smartTable.updateRecord(recordId, record),
|
|
15
|
+
updateRecords: function (recordsMap) {
|
|
16
|
+
let shouldFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
17
|
+
return smartTable.updateRecords(recordsMap, shouldFetch);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static getSelectionSdks(smartTable) {
|
|
23
|
+
return {
|
|
24
|
+
selectRecords: ids => smartTable.selectRecords(ids),
|
|
25
|
+
deselectRecords: ids => smartTable.deselectRecords(ids),
|
|
26
|
+
selectAllRecords: () => smartTable.selectAllRecords(),
|
|
27
|
+
deselectAllRecords: () => smartTable.deselectAllRecords()
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static create(_ref) {
|
|
32
|
+
let {
|
|
33
|
+
instanceName
|
|
34
|
+
} = _ref;
|
|
35
|
+
const smartTable = platformSDK[ResourceNamesEnum.SMART_TABLE](instanceName);
|
|
36
|
+
const recordSdks = ListSdkFactory.getRecordSdks(smartTable);
|
|
37
|
+
const selectionSdks = ListSdkFactory.getSelectionSdks(smartTable);
|
|
38
|
+
return {
|
|
39
|
+
zlist: {
|
|
40
|
+
getRecords: recordSdks.getRecords,
|
|
41
|
+
getRecord: recordSdks.getRecord,
|
|
42
|
+
getContext: recordSdks.getContext,
|
|
43
|
+
deleteRecord: recordSdks.deleteRecord,
|
|
44
|
+
deleteRecords: recordSdks.deleteRecords,
|
|
45
|
+
updateRecord: recordSdks.updateRecord,
|
|
46
|
+
updateRecords: recordSdks.updateRecords,
|
|
47
|
+
selectRecords: selectionSdks.selectRecords,
|
|
48
|
+
deselectRecords: selectionSdks.deselectRecords,
|
|
49
|
+
selectAllRecords: selectionSdks.selectAllRecords,
|
|
50
|
+
deselectAllRecords: selectionSdks.deselectAllRecords
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import Properties from "../../../../cc/table-connected/Properties";
|
|
2
|
+
import { createCustomComponent } from "../../../../library/custom-component";
|
|
3
|
+
import ZFieldBehaviourFactory from "../../../zfield/frameworks/ZFieldBehaviourFactory";
|
|
4
|
+
import ZHttpBehaviourFactory from "../../../zhttp/frameworks/ZHttpBehaviourFactory";
|
|
5
|
+
import TableTranslator from "../../../zlist/adapters/presenters/TableTranslator";
|
|
6
|
+
import ZListBehaviourFactory from "../../../zlist/frameworks/ZListBehaviourFactory";
|
|
7
|
+
import RecordBehaviourFactory from "../../../zrecord/frameworks/RecordBehaviourFactory";
|
|
8
|
+
import EventHandlersFactory from "./EventHandlersFactory";
|
|
9
|
+
import TableConnectedView from "./TableConnectedView";
|
|
10
|
+
import defaultDataSource from "../../../data-source";
|
|
11
|
+
import DataSourceBehaviourFactory from "../../../zdata-source/frameworks/DataBrokerBehaviourFactory";
|
|
12
|
+
import ClientActionsBehaviourFactory from "../../../client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory";
|
|
13
|
+
import LocalStorageBehaviourFactory from "../../../../library/behaviours/local-storage/frameworks/LocalStorageBehaviourFactory";
|
|
14
|
+
import TableColumnResizerBehaviorFactory from "../../../../library/behaviours/table-column-resizer/frameworks/TableColumnResizerBehaviorFactory";
|
|
15
|
+
import ListItemSelectionBehaviourFactory from "../../../../library/behaviours/list-selection/frameworks/ListItemSelectionBehaviourFactory";
|
|
16
|
+
import ColumnChooserBehaviourFactory from "../../../column-chooser/frameworks/ColumnChooserBehaviourFactory";
|
|
17
|
+
import SdkBehaviourFactory from "../../../sdk-behaviour/frameworks/SdkBehaviourFactory";
|
|
18
|
+
import ResourceNamesEnum from "../../../../bc/sdk/ResourceNamesEnum";
|
|
19
|
+
import { sdkRegistry } from "../../../sdk/frameworks/SdkRegistry";
|
|
20
|
+
import { SmartTableResource } from "../adapters/resources/SmartTableResource";
|
|
21
|
+
sdkRegistry.registerResource({
|
|
22
|
+
resourceName: ResourceNamesEnum.SMART_TABLE,
|
|
23
|
+
resource: SmartTableResource
|
|
24
|
+
});
|
|
25
|
+
import KeyboardControlBehaviourFactory from "../../../../library/behaviours/keyboard-controls/frameworks/KeyboardControlBehaviourFactory";
|
|
26
|
+
|
|
27
|
+
function combineDataSourceWithDefault(dataSource) {
|
|
28
|
+
return { ...defaultDataSource,
|
|
29
|
+
...dataSource,
|
|
30
|
+
httpTemplates: { ...defaultDataSource.httpTemplates,
|
|
31
|
+
...(dataSource === null || dataSource === void 0 ? void 0 : dataSource.httpTemplates)
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default class TableConnectedFactory {
|
|
37
|
+
static create(_ref) {
|
|
38
|
+
let {
|
|
39
|
+
name,
|
|
40
|
+
dataBroker,
|
|
41
|
+
dataSource,
|
|
42
|
+
eventHandlers = {},
|
|
43
|
+
View = TableConnectedView
|
|
44
|
+
} = _ref;
|
|
45
|
+
|
|
46
|
+
if (dataBroker) {
|
|
47
|
+
console.warn('Desk Platform Warning: dataBroker is deprecated, use dataSource instead');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const _dataSource = combineDataSourceWithDefault(dataBroker ? dataBroker : dataSource);
|
|
51
|
+
|
|
52
|
+
return createCustomComponent({
|
|
53
|
+
name: name,
|
|
54
|
+
View: View,
|
|
55
|
+
properties: Properties,
|
|
56
|
+
eventHandlers: EventHandlersFactory.create(eventHandlers),
|
|
57
|
+
transformState: TableTranslator.transformState,
|
|
58
|
+
behaviours: TableConnectedFactory.getBehaviours(_dataSource)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static getBehaviours(_dataSource) {
|
|
63
|
+
return [SdkBehaviourFactory.create([ResourceNamesEnum.SMART_TABLE]), TableColumnResizerBehaviorFactory.create(), KeyboardControlBehaviourFactory.create(), LocalStorageBehaviourFactory.create(), ZHttpBehaviourFactory.create(), DataSourceBehaviourFactory.create(), ...TableConnectedFactory.getPlatformBehaviours(_dataSource), ColumnChooserBehaviourFactory.create(), ListItemSelectionBehaviourFactory.create()];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static getPlatformBehaviours(_dataSource) {
|
|
67
|
+
return [RecordBehaviourFactory.create(_dataSource.httpTemplates), ClientActionsBehaviourFactory.create({
|
|
68
|
+
getClientActions: _dataSource.httpTemplates.getClientActions
|
|
69
|
+
}), ZFieldBehaviourFactory.create({
|
|
70
|
+
availableFields: _dataSource.httpTemplates.getAvailableFields,
|
|
71
|
+
updateSelectedFields: _dataSource.httpTemplates.updateSelectedFields,
|
|
72
|
+
selectedFields: _dataSource.httpTemplates.getSelectedFields
|
|
73
|
+
}), ZListBehaviourFactory.create()];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
}
|
package/es/{desk-frameworks → platform/components}/table-connected/frameworks/TableConnectedView.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import TableList from "
|
|
3
|
+
import TableList from "../../../../library/dot/components/table-list/frameworks/ui/TableList";
|
|
4
4
|
|
|
5
5
|
function View(_ref, ref) {
|
|
6
6
|
let {
|
|
@@ -26,7 +26,7 @@ function View(_ref, ref) {
|
|
|
26
26
|
} = state.properties;
|
|
27
27
|
const {
|
|
28
28
|
autoColumnSizing
|
|
29
|
-
} = preferences
|
|
29
|
+
} = preferences ? preferences : {};
|
|
30
30
|
return /*#__PURE__*/React.createElement(TableList, {
|
|
31
31
|
data: data,
|
|
32
32
|
rowCursor: rowCursor,
|
|
@@ -1,16 +1,14 @@
|
|
|
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 { SdkResourceDependencies } from "../../../domain/entities/interfaces/SdkResourceDependencies";
|
|
4
|
+
export { SdkResourceDependencies };
|
|
3
5
|
export class AbstractResource {
|
|
4
6
|
constructor() {
|
|
5
7
|
_defineProperty(this, "dependencies", void 0);
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
initialize() {}
|
|
9
|
-
|
|
10
10
|
updateDependencies(dependencies) {
|
|
11
11
|
this.dependencies = dependencies;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
destroy() {}
|
|
15
|
-
|
|
16
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ResourceNamesEnum from "../../../bc/sdk/ResourceNamesEnum";
|
|
2
2
|
import { sdkRegistry } from "./SdkRegistry";
|
|
3
|
-
export const
|
|
3
|
+
export const platformSDK = {
|
|
4
4
|
[ResourceNamesEnum.SMART_TABLE](instanceName) {
|
|
5
5
|
return sdkRegistry.getResourceInstance({
|
|
6
6
|
resourceName: ResourceNamesEnum.SMART_TABLE,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/library-platform",
|
|
3
|
-
"version": "1.1.3-exp.
|
|
3
|
+
"version": "1.1.3-exp.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"files": [
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"@zohodesk/components": "1.2.62",
|
|
53
53
|
"@zohodesk/dot": "1.7.8",
|
|
54
54
|
"@zohodesk/eslint-plugin-architecturerules": "0.0.5-exp-3",
|
|
55
|
-
"@zohodesk/eslint-plugin-no-hardcoding": "^1.0.6",
|
|
56
55
|
"@zohodesk/hooks": "2.0.5",
|
|
57
56
|
"@zohodesk/icons": "1.0.72",
|
|
58
57
|
"@zohodesk/layout": "3.1.0",
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import Properties from "../../../cc/form-connected/Properties";
|
|
2
|
-
import { createCustomComponent } from "../../../library/custom-component";
|
|
3
|
-
import ZHttpBehaviourFactory from "../../../platform/zhttp/frameworks/ZHttpBehaviourFactory";
|
|
4
|
-
import RecordBehaviourFactory from "../../../platform/zrecord/frameworks/RecordBehaviourFactory";
|
|
5
|
-
import FormConnectedView from "./FormConnectedView";
|
|
6
|
-
import defaultDataBroker from "../../../platform/data-source";
|
|
7
|
-
import DataBrokerBehaviourFactory from "../../../platform/zdata-source/frameworks/DataBrokerBehaviourFactory";
|
|
8
|
-
import FormTranslator from "../../../platform/zform/adapters/presenter/FormTranslator";
|
|
9
|
-
import ZFormBehaviourFactory from "../../../platform/zform/frameworks/ui/ZFormBehaviourFactory";
|
|
10
|
-
import FieldValidationBehaviourFactory from "../../../library/behaviours/field-validation/frameworks/ui/FieldValidationBehaviourFactory";
|
|
11
|
-
import EventHandlersfactory from "./EventHandlersFactory";
|
|
12
|
-
export default class FormConnectedFactory {
|
|
13
|
-
static create(_ref) {
|
|
14
|
-
let {
|
|
15
|
-
name,
|
|
16
|
-
customValidators,
|
|
17
|
-
dataBroker = defaultDataBroker,
|
|
18
|
-
eventHandlers = {},
|
|
19
|
-
View = FormConnectedView
|
|
20
|
-
} = _ref;
|
|
21
|
-
return createCustomComponent({
|
|
22
|
-
name: name,
|
|
23
|
-
View: View,
|
|
24
|
-
properties: Properties,
|
|
25
|
-
eventHandlers: EventHandlersfactory.create(eventHandlers),
|
|
26
|
-
transformState: FormTranslator.transformState,
|
|
27
|
-
behaviours: [ZHttpBehaviourFactory.create(), DataBrokerBehaviourFactory.create(), RecordBehaviourFactory.create(dataBroker.httpTemplates), FieldValidationBehaviourFactory.create(), ZFormBehaviourFactory.create({
|
|
28
|
-
customValidators
|
|
29
|
-
})]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
package/es/desk-frameworks/table-connected/adapters/controllers/ColumnChooserOpenedController.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import AbstractController from "./AbstractController";
|
|
2
|
-
import { COLUMN_CHOOSER_BEHAVIOUR_OPENED } from "../../../../bc/column-chooser/Constants";
|
|
3
|
-
export default class ColumnChooserOpenedController extends AbstractController {
|
|
4
|
-
handle(event) {
|
|
5
|
-
const state = event.state;
|
|
6
|
-
const {
|
|
7
|
-
zfield
|
|
8
|
-
} = state.behaviours;
|
|
9
|
-
const {
|
|
10
|
-
fields: availableFields,
|
|
11
|
-
selectedFields
|
|
12
|
-
} = zfield;
|
|
13
|
-
const columnChooserOptionsOrder = this.getColumnChooserOptionsOrder(availableFields, selectedFields);
|
|
14
|
-
event.dispatch({
|
|
15
|
-
type: COLUMN_CHOOSER_BEHAVIOUR_OPENED,
|
|
16
|
-
payload: {
|
|
17
|
-
order: columnChooserOptionsOrder,
|
|
18
|
-
selectedArray: selectedFields
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
getColumnChooserOptionsOrder() {
|
|
24
|
-
let availableFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25
|
-
let selectedFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
26
|
-
let searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
27
|
-
|
|
28
|
-
if (availableFields.length === 0 || selectedFields.length === 0) {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const columnChooserOptions = selectedFields.concat(availableFields.filter(field => !selectedFields.includes(field.name)).map(field => field.name));
|
|
33
|
-
return columnChooserOptions;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import ResourceNamesEnum from "../../../bc/sdk/ResourceNamesEnum";
|
|
2
|
-
import { sdk } from "../../../platform/sdk/frameworks/Sdk";
|
|
3
|
-
export default class ListSdkFactory {
|
|
4
|
-
static create(_ref) {
|
|
5
|
-
let {
|
|
6
|
-
instanceName
|
|
7
|
-
} = _ref;
|
|
8
|
-
const smartTable = sdk[ResourceNamesEnum.SMART_TABLE](instanceName);
|
|
9
|
-
return {
|
|
10
|
-
zlist: {
|
|
11
|
-
getRecords() {
|
|
12
|
-
return smartTable.getRecords();
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
getRecord(recordId) {
|
|
16
|
-
return smartTable.getRecord(recordId);
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
getContext(variableName) {
|
|
20
|
-
return smartTable.getContext(variableName);
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
deleteRecord(recordId) {
|
|
24
|
-
return smartTable.deleteRecord(recordId);
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
deleteRecords(recordIds) {
|
|
28
|
-
let shouldFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
29
|
-
return smartTable.deleteRecords(recordIds, shouldFetch);
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
updateRecord(recordId, record) {
|
|
33
|
-
return smartTable.updateRecord(recordId, record);
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
updateRecords(recordsMap) {
|
|
37
|
-
let shouldFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
38
|
-
return smartTable.updateRecords(recordsMap, shouldFetch);
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
selectRecords: ids => {
|
|
42
|
-
smartTable.selectRecords(ids);
|
|
43
|
-
},
|
|
44
|
-
deselectRecords: ids => {
|
|
45
|
-
smartTable.deselectRecords(ids);
|
|
46
|
-
},
|
|
47
|
-
selectAllRecords: () => {
|
|
48
|
-
smartTable.selectAllRecords();
|
|
49
|
-
},
|
|
50
|
-
deselectAllRecords: () => {
|
|
51
|
-
smartTable.deselectAllRecords();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import Properties from "../../../cc/table-connected/Properties";
|
|
2
|
-
import { createCustomComponent } from "../../../library/custom-component";
|
|
3
|
-
import ZFieldBehaviourFactory from "../../../platform/zfield/frameworks/ZFieldBehaviourFactory";
|
|
4
|
-
import ZHttpBehaviourFactory from "../../../platform/zhttp/frameworks/ZHttpBehaviourFactory";
|
|
5
|
-
import TableTranslator from "../../../platform/zlist/adapters/presenters/TableTranslator";
|
|
6
|
-
import ZListBehaviourFactory from "../../../platform/zlist/frameworks/ZListBehaviourFactory";
|
|
7
|
-
import RecordBehaviourFactory from "../../../platform/zrecord/frameworks/RecordBehaviourFactory";
|
|
8
|
-
import EventHandlersFactory from "./EventHandlersFactory";
|
|
9
|
-
import TableConnectedView from "./TableConnectedView";
|
|
10
|
-
import defaultDataSource from "../../../platform/data-source";
|
|
11
|
-
import DataSourceBehaviourFactory from "../../../platform/zdata-source/frameworks/DataBrokerBehaviourFactory";
|
|
12
|
-
import ClientActionsBehaviourFactory from "../../../platform/client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory";
|
|
13
|
-
import LocalStorageBehaviourFactory from "../../../library/behaviours/local-storage/frameworks/LocalStorageBehaviourFactory";
|
|
14
|
-
import TableColumnResizerBehaviorFactory from "../../../library/behaviours/table-column-resizer/frameworks/TableColumnResizerBehaviorFactory";
|
|
15
|
-
import ListItemSelectionBehaviourFactory from "../../../library/behaviours/list-selection/frameworks/ListItemSelectionBehaviourFactory";
|
|
16
|
-
import ColumnChooserBehaviourFactory from "../../../platform/column-chooser/frameworks/ColumnChooserBehaviourFactory";
|
|
17
|
-
import SdkBehaviourFactory from "../../../platform/sdk-behaviour/frameworks/SdkBehaviourFactory";
|
|
18
|
-
import ResourceNamesEnum from "../../../bc/sdk/ResourceNamesEnum";
|
|
19
|
-
import { sdkRegistry } from "../../../platform/sdk/frameworks/SdkRegistry";
|
|
20
|
-
import { SmartTableResource } from "./resources/SmartTableResource";
|
|
21
|
-
sdkRegistry.registerResource({
|
|
22
|
-
resourceName: ResourceNamesEnum.SMART_TABLE,
|
|
23
|
-
resource: SmartTableResource
|
|
24
|
-
});
|
|
25
|
-
import KeyboardControlBehaviourFactory from "../../../library/behaviours/keyboard-controls/frameworks/KeyboardControlBehaviourFactory";
|
|
26
|
-
export default class TableConnectedFactory {
|
|
27
|
-
static create(_ref) {
|
|
28
|
-
var _dataSource2;
|
|
29
|
-
|
|
30
|
-
let {
|
|
31
|
-
name,
|
|
32
|
-
dataBroker,
|
|
33
|
-
dataSource,
|
|
34
|
-
eventHandlers = {},
|
|
35
|
-
View = TableConnectedView
|
|
36
|
-
} = _ref;
|
|
37
|
-
|
|
38
|
-
if (dataBroker) {
|
|
39
|
-
console.warn('Desk Platform Warning: dataBroker is deprecated, use dataSource instead');
|
|
40
|
-
dataSource = dataBroker;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const _dataSource = { ...dataSource,
|
|
44
|
-
httpTemplates: { ...defaultDataSource.httpTemplates,
|
|
45
|
-
...((_dataSource2 = dataSource) === null || _dataSource2 === void 0 ? void 0 : _dataSource2.httpTemplates)
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return createCustomComponent({
|
|
49
|
-
name: name,
|
|
50
|
-
View: View,
|
|
51
|
-
properties: Properties,
|
|
52
|
-
eventHandlers: EventHandlersFactory.create(eventHandlers),
|
|
53
|
-
transformState: TableTranslator.transformState,
|
|
54
|
-
behaviours: [SdkBehaviourFactory.create([ResourceNamesEnum.SMART_TABLE]), TableColumnResizerBehaviorFactory.create(), KeyboardControlBehaviourFactory.create(), LocalStorageBehaviourFactory.create(), ZHttpBehaviourFactory.create(), DataSourceBehaviourFactory.create(), RecordBehaviourFactory.create(_dataSource.httpTemplates), ClientActionsBehaviourFactory.create({
|
|
55
|
-
getClientActions: _dataSource.httpTemplates.getClientActions
|
|
56
|
-
}), ZFieldBehaviourFactory.create({
|
|
57
|
-
availableFields: _dataSource.httpTemplates.getAvailableFields,
|
|
58
|
-
updateSelectedFields: _dataSource.httpTemplates.updateSelectedFields,
|
|
59
|
-
selectedFields: _dataSource.httpTemplates.getSelectedFields
|
|
60
|
-
}), ZListBehaviourFactory.create(), ColumnChooserBehaviourFactory.create(), ListItemSelectionBehaviourFactory.create()]
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
}
|
|
File without changes
|
/package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormConnected.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/es/{desk-frameworks → platform/components}/table-connected/frameworks/TableConnected.js
RENAMED
|
File without changes
|