@zohodesk/library-platform 1.0.0-exp.5 → 1.0.0-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/bc/zlist/Constants.js +6 -1
- package/es/bc/zrecord/Constants.js +5 -0
- package/es/cc/fields/boolean/Model.js +3 -1
- package/es/cc/fields/field/Types.js +1 -0
- package/es/cc/table-connected/Properties.js +9 -0
- package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +17 -3
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +1 -0
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/avatar-lookup-field/frameworks/ui/AvatarLookupField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/avatar-lookup-field/frameworks/ui/AvatarLookupFieldView.js +18 -0
- package/es/library/dot/legacy-to-new-arch/{field-components/lookup-field → table-field-components/avatar-lookup-field}/frameworks/ui/LookupField.js +3 -2
- package/es/library/dot/legacy-to-new-arch/{field-components/lookup-field → table-field-components/avatar-lookup-field}/frameworks/ui/LookupFieldView.js +1 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field copy/frameworks/ui/LookupField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field copy/frameworks/ui/LookupFieldView.js +18 -0
- package/es/platform/data-broker/http-template/deleteRecord.js +27 -0
- package/es/platform/data-broker/http-template/deleteRecords.js +1 -1
- package/es/platform/zfield/entities/api-template/APITemplate.js +26 -3
- package/es/platform/zhttp/adapters/controllers/FetchController.js +3 -1
- package/es/platform/zhttp/usecases/interactors/FetchUseCase.js +47 -19
- package/es/platform/zlist/adapters/controllers/DeleteSingleRecordController.js +23 -0
- package/es/platform/zlist/adapters/controllers/RecordExecuteFailedController.js +25 -0
- package/es/platform/zlist/adapters/controllers/RecordExecuteSucceededController.js +25 -0
- package/es/platform/zlist/adapters/gateways/Service.js +12 -0
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +3 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +2 -1
- package/es/platform/zlist/entities/List.js +90 -2
- package/es/platform/zlist/entities/interfaces/RecordExecuteAfterMetaData.js +1 -0
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +11 -1
- package/es/platform/zlist/usecases/interactors/DeleteSingleRecordUseCase.js +19 -0
- package/es/platform/zlist/usecases/interactors/RecordExecuteFailedUseCase.js +22 -0
- package/es/platform/zlist/usecases/interactors/RecordExecuteSucceededUseCase.js +22 -0
- package/es/platform/zlist/usecases/interfaces/input/DeleteSingleRecordUseCaseInput.js +1 -0
- package/es/platform/zlist/usecases/interfaces/input/RecordExecuteFailedUseCaseInput.js +1 -0
- package/es/platform/zlist/usecases/interfaces/input/RecordExecuteSucceededUseCaseInput.js +1 -0
- package/es/platform/zrecord/adapters/controllers/SetRecordsController.js +29 -0
- package/es/platform/zrecord/adapters/gateways/Service.js +4 -0
- package/es/platform/zrecord/entities/APITemplate.js +25 -3
- package/es/platform/zrecord/entities/RecordsManager.js +247 -37
- package/es/platform/zrecord/entities/interfaces/MetaData.js +1 -1
- package/es/platform/zrecord/frameworks/ActionsHandlersFactory.js +4 -1
- package/es/platform/zrecord/usecases/interactors/ExecuteActionUseCase.js +6 -2
- package/es/platform/zrecord/usecases/interactors/FailureUseCase.js +7 -5
- package/es/platform/zrecord/usecases/interactors/FetchMoreUseCase.js +1 -1
- package/es/platform/zrecord/usecases/interactors/NoContentUseCase.js +1 -0
- package/es/platform/zrecord/usecases/interactors/SetRecordsUseCase.js +22 -0
- package/es/platform/zrecord/usecases/interactors/SuccessUseCase.js +11 -4
- package/es/platform/zrecord/usecases/interfaces/input/SetRecordsInputModel.js +1 -0
- package/package.json +1 -1
- package/es/library/behaviours/sort-by/adapters/controllers/Initialize.js +0 -14
- package/es/library/custom-component/adapters/gateways/validator/jsonValidator.js +0 -5
- package/es/library/custom-component/entities/getRef.js +0 -10
- package/es/library/dot/components/action-location/adapters/gateway/RepositoryOld.js +0 -32
- package/es/library/dot/legacy-to-new-arch/field-components/checkbox-field/frameworks/ui/CheckboxField.js +0 -13
- package/es/library/dot/legacy-to-new-arch/field-components/checkbox-field/frameworks/ui/CheckboxFieldView.js +0 -19
- package/es/library/dot/legacy-to-new-arch/field-components/checkbox-field/frameworks/ui/EventHandlersFactory.js +0 -29
- package/es/library/dot/legacy-to-new-arch/field-components/email-field/frameworks/ui/EmailField.js +0 -11
- package/es/library/dot/legacy-to-new-arch/field-components/email-field/frameworks/ui/EmailFieldView.js +0 -15
- package/es/library/dot/legacy-to-new-arch/field-components/index.js +0 -15
- package/es/library/dot/legacy-to-new-arch/field-components/multiselect-field/frameworks/ui/MultiSelectField.js +0 -11
- package/es/library/dot/legacy-to-new-arch/field-components/multiselect-field/frameworks/ui/MultiSelectFieldView.js +0 -21
- package/es/library/dot/legacy-to-new-arch/field-components/phone-field/frameworks/ui/PhoneField.js +0 -11
- package/es/library/dot/legacy-to-new-arch/field-components/phone-field/frameworks/ui/PhoneFieldView.js +0 -22
- package/es/library/dot/legacy-to-new-arch/field-components/picklist-field/frameworks/ui/PickListField.js +0 -11
- package/es/library/dot/legacy-to-new-arch/field-components/picklist-field/frameworks/ui/PickListFieldView.js +0 -19
- package/es/library/dot/legacy-to-new-arch/field-components/switch-field/frameworks/ui/EventHandlersFactory.js +0 -29
- package/es/library/dot/legacy-to-new-arch/field-components/switch-field/frameworks/ui/SwitchField.js +0 -13
- package/es/library/dot/legacy-to-new-arch/field-components/switch-field/frameworks/ui/SwitchFieldView.js +0 -18
- package/es/library/dot/legacy-to-new-arch/field-components/text-field/frameworks/ui/EventHandlersFactory.js +0 -26
- package/es/library/dot/legacy-to-new-arch/field-components/text-field/frameworks/ui/TextField.js +0 -13
- package/es/library/dot/legacy-to-new-arch/field-components/text-field/frameworks/ui/TextFieldView.js +0 -16
- package/es/library/dot/legacy-to-new-arch/field-components/url-field/frameworks/ui/EventHandlersFactory.js +0 -26
- package/es/library/dot/legacy-to-new-arch/field-components/url-field/frameworks/ui/UrlField.js +0 -13
- package/es/library/dot/legacy-to-new-arch/field-components/url-field/frameworks/ui/UrlFieldView.js +0 -18
- package/es/platform/zfield/entities/interfaces/FieldTypes.js +0 -20
- package/es/platform/zfield/usecases/entity-factory/FieldBuilder.js +0 -109
- package/es/platform/zfield/usecases/entity-factory/FieldFactory.js +0 -10
- package/es/platform/zfield/usecases/entity-factory/FieldsManagerBuilder.js +0 -49
|
@@ -14,13 +14,15 @@ class FailureUseCase extends AbstractUseCase {
|
|
|
14
14
|
} = input;
|
|
15
15
|
const recordManager = repository.getRecordsManagerEntity(templateHelpers);
|
|
16
16
|
|
|
17
|
-
if (recordManager.
|
|
18
|
-
|
|
17
|
+
if (recordManager.isGetRecordsApi(metaData)) {
|
|
18
|
+
recordManager.fetchingFinished();
|
|
19
|
+
presenter.updateRecord(recordManager.toObject());
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
recordManager.
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const actions = recordManager.createFailureActions(error, metaData);
|
|
23
|
+
actions.forEach(action => {
|
|
24
|
+
dispatch(action);
|
|
25
|
+
});
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
}
|
|
@@ -21,7 +21,7 @@ class FetchMoreUseCase extends AbstractUseCase {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const apiDetails = recordManager.getApiDetails(actionName, props);
|
|
24
|
-
const metaData = recordManager.
|
|
24
|
+
const metaData = recordManager.createFetchMoreRecordMeta(actionName, apiName, inputMeta.headers, props);
|
|
25
25
|
recordManager.fetchingStarted();
|
|
26
26
|
presenter.updateRecord(recordManager.toObject());
|
|
27
27
|
dispatch(recordManager.createFetchAction(apiDetails, metaData));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
import RecordFactory from "../entities-factory/RecordFactory";
|
|
3
|
+
|
|
4
|
+
class SetRecordsUseCase extends AbstractUseCase {
|
|
5
|
+
execute(input) {
|
|
6
|
+
const {
|
|
7
|
+
presenter,
|
|
8
|
+
repository,
|
|
9
|
+
templateHelpers
|
|
10
|
+
} = this.dependencies;
|
|
11
|
+
const {
|
|
12
|
+
records
|
|
13
|
+
} = input;
|
|
14
|
+
const recordManager = repository.getRecordsManagerEntity(templateHelpers);
|
|
15
|
+
const recordsEntity = RecordFactory.createMultipleRecords(records);
|
|
16
|
+
recordManager.setRecords(recordsEntity);
|
|
17
|
+
presenter.updateRecord(recordManager.toObject());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default SetRecordsUseCase;
|
|
@@ -22,10 +22,17 @@ class SuccessUseCase extends AbstractUseCase {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const transformer = recordManager.getTransformer(actionName);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const transformedResponse = transformer(response);
|
|
26
|
+
|
|
27
|
+
if (recordManager.isGetRecordsApi(metaData)) {
|
|
28
|
+
recordManager.fetchingFinished();
|
|
29
|
+
presenter.updateRecord(recordManager.toObject());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const actions = recordManager.createSuccessActions(transformedResponse, metaData);
|
|
33
|
+
actions.forEach(action => {
|
|
34
|
+
dispatch(action);
|
|
35
|
+
});
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
import ActionLocationEntity from "../../entities/ActionLocationEntity";
|
|
4
|
-
export default class Repository {
|
|
5
|
-
constructor() {
|
|
6
|
-
_defineProperty(this, "element", void 0);
|
|
7
|
-
|
|
8
|
-
_defineProperty(this, "dispatch", void 0);
|
|
9
|
-
|
|
10
|
-
_defineProperty(this, "state", void 0);
|
|
11
|
-
|
|
12
|
-
this.element = null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
updateDependencies(element, state, dispatch) {
|
|
16
|
-
this.element = element;
|
|
17
|
-
this.dispatch = dispatch;
|
|
18
|
-
this.state = state;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
getActionLocation() {
|
|
22
|
-
const {
|
|
23
|
-
actions
|
|
24
|
-
} = this.state.properties;
|
|
25
|
-
const {
|
|
26
|
-
handlers
|
|
27
|
-
} = this.state;
|
|
28
|
-
const actionLocation = new ActionLocationEntity(handlers, actions, this.element, this.dispatch);
|
|
29
|
-
return actionLocation;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import BooleanProperties from "../../../../../../../cc/fields/boolean/Properties";
|
|
3
|
-
import BooleanEvents from "../../../../../../../cc/fields/boolean/Events";
|
|
4
|
-
import CheckboxFieldView from "./CheckboxFieldView";
|
|
5
|
-
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
-
const CheckboxField = createCustomComponent({
|
|
7
|
-
name: 'CheckboxField',
|
|
8
|
-
View: CheckboxFieldView,
|
|
9
|
-
properties: BooleanProperties,
|
|
10
|
-
events: BooleanEvents,
|
|
11
|
-
eventHandlers: EventHandlersFactory.create()
|
|
12
|
-
});
|
|
13
|
-
export default CheckboxField;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Checkbox } from "../../../..";
|
|
3
|
-
export default function CheckboxFieldView(_ref, ref) {
|
|
4
|
-
let {
|
|
5
|
-
state,
|
|
6
|
-
helpers
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
value
|
|
10
|
-
} = state.properties;
|
|
11
|
-
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
12
|
-
getRef: ref,
|
|
13
|
-
checked: value,
|
|
14
|
-
disabled: false,
|
|
15
|
-
readonly: false,
|
|
16
|
-
label: "",
|
|
17
|
-
tooltip: ""
|
|
18
|
-
});
|
|
19
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import CheckboxConstants from "../../../../../../../cc/checkbox/Constants";
|
|
2
|
-
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
-
export class EventHandlersFactory {
|
|
4
|
-
static create() {
|
|
5
|
-
const changeHandler = input => {
|
|
6
|
-
const {
|
|
7
|
-
state,
|
|
8
|
-
dispatch
|
|
9
|
-
} = input;
|
|
10
|
-
const {
|
|
11
|
-
name: fieldName,
|
|
12
|
-
value: currentValue
|
|
13
|
-
} = state.properties;
|
|
14
|
-
const toggledValue = !currentValue;
|
|
15
|
-
dispatch({
|
|
16
|
-
type: FieldConstants.FIELD_CHANGED,
|
|
17
|
-
payload: {
|
|
18
|
-
fieldName,
|
|
19
|
-
value: toggledValue
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
[CheckboxConstants.CHECKBOX_TOGGLED]: changeHandler
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
}
|
package/es/library/dot/legacy-to-new-arch/field-components/email-field/frameworks/ui/EmailField.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import EmailProperties from "../../../../../../../cc/fields/email/Properties";
|
|
3
|
-
import { EmailFieldView } from "./EmailFieldView";
|
|
4
|
-
const EmailField = createCustomComponent({
|
|
5
|
-
name: 'EmailField',
|
|
6
|
-
View: EmailFieldView,
|
|
7
|
-
properties: EmailProperties,
|
|
8
|
-
actions: [],
|
|
9
|
-
actionHandlers: {}
|
|
10
|
-
});
|
|
11
|
-
export default EmailField;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Email } from "../../../..";
|
|
3
|
-
export function EmailFieldView(_ref, ref) {
|
|
4
|
-
let {
|
|
5
|
-
state,
|
|
6
|
-
helpers
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
value
|
|
10
|
-
} = state.properties;
|
|
11
|
-
return /*#__PURE__*/React.createElement(Email, {
|
|
12
|
-
getRef: ref,
|
|
13
|
-
email: value
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { default as CheckboxField } from "./checkbox-field/frameworks/ui/CheckboxField";
|
|
2
|
-
export { default as SwitchField } from "./switch-field/frameworks/ui/SwitchField";
|
|
3
|
-
export { default as SingleLineField } from "./text-field/frameworks/ui/TextField";
|
|
4
|
-
export { default as EmailField } from "./email-field/frameworks/ui/EmailField";
|
|
5
|
-
export { default as URLField } from "./url-field/frameworks/ui/UrlField";
|
|
6
|
-
export { default as PhoneField } from "./phone-field/frameworks/ui/PhoneField";
|
|
7
|
-
export { default as CurrencyField } from "./text-field/frameworks/ui/TextField";
|
|
8
|
-
export { default as LookUpField } from "./lookup-field/frameworks/ui/LookupField";
|
|
9
|
-
export { default as PickListField } from "./text-field/frameworks/ui/TextField";
|
|
10
|
-
export { default as PercentageField } from "./text-field/frameworks/ui/TextField";
|
|
11
|
-
export { default as DateField } from "./text-field/frameworks/ui/TextField";
|
|
12
|
-
export { default as DateTimeField } from "./text-field/frameworks/ui/TextField";
|
|
13
|
-
export { default as MultiSelectField } from "./multiselect-field/frameworks/ui/MultiSelectField"; // export { default as DateTimeField } from './date-time-field/frameworks/ui/DateTimeField';
|
|
14
|
-
// export { default as ColoredPickListField } from './colored-picklist-field/frameworks/ui/ColoredPickListField';
|
|
15
|
-
// export { default as ColoredMultiSelectField } from './colored-multi-select-field/frameworks/ui/ColoredMultiSelectField';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import MultiSelectProperties from "../../../../../../../cc/fields/multi-select/Properties";
|
|
3
|
-
import { MultiSelectFieldView } from "./MultiSelectFieldView";
|
|
4
|
-
const MultiSelectField = createCustomComponent({
|
|
5
|
-
name: 'MultiSelectField',
|
|
6
|
-
View: MultiSelectFieldView,
|
|
7
|
-
properties: MultiSelectProperties,
|
|
8
|
-
actions: [],
|
|
9
|
-
actionHandlers: {}
|
|
10
|
-
});
|
|
11
|
-
export default MultiSelectField;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Tags } from "../../../..";
|
|
3
|
-
export function MultiSelectFieldView(_ref, ref) {
|
|
4
|
-
let {
|
|
5
|
-
state,
|
|
6
|
-
helpers
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
value,
|
|
10
|
-
options
|
|
11
|
-
} = state.properties; // const selectedOptions = options.find(option => value.includes(option.value));
|
|
12
|
-
|
|
13
|
-
const selectedOptions = value.map(item => ({
|
|
14
|
-
id: item,
|
|
15
|
-
label: item
|
|
16
|
-
}));
|
|
17
|
-
return /*#__PURE__*/React.createElement(Tags, {
|
|
18
|
-
getRef: ref,
|
|
19
|
-
tags: selectedOptions
|
|
20
|
-
});
|
|
21
|
-
}
|
package/es/library/dot/legacy-to-new-arch/field-components/phone-field/frameworks/ui/PhoneField.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import UrlProperties from "../../../../../../../cc/fields/url/Properties";
|
|
3
|
-
import PhoneFieldView from "./PhoneFieldView";
|
|
4
|
-
const PhoneField = createCustomComponent({
|
|
5
|
-
name: 'PhoneField',
|
|
6
|
-
View: PhoneFieldView,
|
|
7
|
-
properties: UrlProperties,
|
|
8
|
-
actions: [],
|
|
9
|
-
actionHandlers: {}
|
|
10
|
-
});
|
|
11
|
-
export default PhoneField;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Link } from "../../../..";
|
|
3
|
-
|
|
4
|
-
function PhoneFieldView(_ref, ref) {
|
|
5
|
-
let {
|
|
6
|
-
state,
|
|
7
|
-
helpers
|
|
8
|
-
} = _ref;
|
|
9
|
-
const {
|
|
10
|
-
value
|
|
11
|
-
} = state.properties;
|
|
12
|
-
const href = `tel:${value}`;
|
|
13
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
14
|
-
getRef: ref,
|
|
15
|
-
label: value,
|
|
16
|
-
href: href,
|
|
17
|
-
variant: "secondary",
|
|
18
|
-
opensNewTab: true
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default PhoneFieldView;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import PickListProperties from "../../../../../../../cc/fields/pick-list/Properties";
|
|
3
|
-
import { PickListFieldView } from "./PickListFieldView";
|
|
4
|
-
const PickListField = createCustomComponent({
|
|
5
|
-
name: 'PickListField',
|
|
6
|
-
View: PickListFieldView,
|
|
7
|
-
properties: PickListProperties,
|
|
8
|
-
actions: [],
|
|
9
|
-
actionHandlers: {}
|
|
10
|
-
});
|
|
11
|
-
export default PickListField;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HighlightedValue } from "../../../..";
|
|
3
|
-
export function PickListFieldView(_ref, ref) {
|
|
4
|
-
let {
|
|
5
|
-
state,
|
|
6
|
-
helpers
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
value,
|
|
10
|
-
options
|
|
11
|
-
} = state.properties;
|
|
12
|
-
const selectedOptions = options.find(option => value === option.value);
|
|
13
|
-
return /*#__PURE__*/React.createElement(HighlightedValue, {
|
|
14
|
-
getRef: ref,
|
|
15
|
-
text: value,
|
|
16
|
-
color: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.colorCode,
|
|
17
|
-
tooltip: ""
|
|
18
|
-
});
|
|
19
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import SwitchConstants from "../../../../../../../cc/switch/Constants";
|
|
2
|
-
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
-
export class EventHandlersFactory {
|
|
4
|
-
static create() {
|
|
5
|
-
const changeHandler = input => {
|
|
6
|
-
const {
|
|
7
|
-
state,
|
|
8
|
-
dispatch
|
|
9
|
-
} = input;
|
|
10
|
-
const {
|
|
11
|
-
name: fieldName,
|
|
12
|
-
value: currentValue
|
|
13
|
-
} = state.properties;
|
|
14
|
-
const toggledValue = !currentValue;
|
|
15
|
-
dispatch({
|
|
16
|
-
type: FieldConstants.FIELD_CHANGED,
|
|
17
|
-
payload: {
|
|
18
|
-
fieldName,
|
|
19
|
-
value: toggledValue
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
[SwitchConstants.SWITCH_TOGGLED]: changeHandler
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
}
|
package/es/library/dot/legacy-to-new-arch/field-components/switch-field/frameworks/ui/SwitchField.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import BooleanProperties from "../../../../../../../cc/fields/boolean/Properties";
|
|
3
|
-
import BooleanEvents from "../../../../../../../cc/fields/boolean/Events";
|
|
4
|
-
import SwitchFieldView from "./SwitchFieldView";
|
|
5
|
-
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
-
const SwitchField = createCustomComponent({
|
|
7
|
-
name: 'SwitchField',
|
|
8
|
-
View: SwitchFieldView,
|
|
9
|
-
properties: BooleanProperties,
|
|
10
|
-
events: BooleanEvents,
|
|
11
|
-
eventHandlers: EventHandlersFactory.create()
|
|
12
|
-
});
|
|
13
|
-
export default SwitchField;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Switch } from "../../../..";
|
|
3
|
-
export default function SwitchFieldView(_ref, ref) {
|
|
4
|
-
let {
|
|
5
|
-
state,
|
|
6
|
-
helpers
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
value
|
|
10
|
-
} = state.properties;
|
|
11
|
-
return /*#__PURE__*/React.createElement(Switch, {
|
|
12
|
-
getRef: ref,
|
|
13
|
-
checked: value,
|
|
14
|
-
disabled: false,
|
|
15
|
-
size: 'small',
|
|
16
|
-
tooltip: ""
|
|
17
|
-
});
|
|
18
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import TextConstants from "../../../../../../../cc/text/Constants";
|
|
2
|
-
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
-
export class EventHandlersFactory {
|
|
4
|
-
static create() {
|
|
5
|
-
const clickHandler = input => {
|
|
6
|
-
const {
|
|
7
|
-
state,
|
|
8
|
-
dispatch
|
|
9
|
-
} = input;
|
|
10
|
-
const {
|
|
11
|
-
name: fieldName
|
|
12
|
-
} = state.properties;
|
|
13
|
-
dispatch({
|
|
14
|
-
type: FieldConstants.FIELD_CLICKED,
|
|
15
|
-
payload: {
|
|
16
|
-
fieldName
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
[TextConstants.TEXT_CLICKED]: clickHandler
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
}
|
package/es/library/dot/legacy-to-new-arch/field-components/text-field/frameworks/ui/TextField.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import TextProperties from "../../../../../../../cc/fields/text/Properties";
|
|
3
|
-
import TextEvents from "../../../../../../../cc/fields/text/Events";
|
|
4
|
-
import { TextFieldView } from "./TextFieldView";
|
|
5
|
-
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
-
const TextField = createCustomComponent({
|
|
7
|
-
name: 'TextField',
|
|
8
|
-
View: TextFieldView,
|
|
9
|
-
properties: TextProperties,
|
|
10
|
-
events: TextEvents,
|
|
11
|
-
eventHandlers: EventHandlersFactory.create()
|
|
12
|
-
});
|
|
13
|
-
export default TextField;
|
package/es/library/dot/legacy-to-new-arch/field-components/text-field/frameworks/ui/TextFieldView.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Text } from "../../../..";
|
|
3
|
-
export function TextFieldView(_ref, ref) {
|
|
4
|
-
let {
|
|
5
|
-
state,
|
|
6
|
-
helpers
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
value
|
|
10
|
-
} = state.properties;
|
|
11
|
-
return /*#__PURE__*/React.createElement(Text, {
|
|
12
|
-
getRef: ref,
|
|
13
|
-
text: value,
|
|
14
|
-
tooltip: ""
|
|
15
|
-
});
|
|
16
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import LinkConstants from "../../../../../../../cc/link/Constants";
|
|
2
|
-
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
-
export class EventHandlersFactory {
|
|
4
|
-
static create() {
|
|
5
|
-
const clickHandler = input => {
|
|
6
|
-
const {
|
|
7
|
-
state,
|
|
8
|
-
dispatch
|
|
9
|
-
} = input;
|
|
10
|
-
const {
|
|
11
|
-
name: fieldName
|
|
12
|
-
} = state.properties;
|
|
13
|
-
dispatch({
|
|
14
|
-
type: FieldConstants.FIELD_CLICKED,
|
|
15
|
-
payload: {
|
|
16
|
-
fieldName
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
[LinkConstants.LINK_CLICKED]: clickHandler
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
}
|
package/es/library/dot/legacy-to-new-arch/field-components/url-field/frameworks/ui/UrlField.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import UrlProperties from "../../../../../../../cc/fields/url/Properties";
|
|
3
|
-
import UrlEvents from "../../../../../../../cc/fields/url/Events";
|
|
4
|
-
import { UrlFieldView } from "./UrlFieldView";
|
|
5
|
-
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
-
const UrlField = createCustomComponent({
|
|
7
|
-
name: 'UrlField',
|
|
8
|
-
View: UrlFieldView,
|
|
9
|
-
properties: UrlProperties,
|
|
10
|
-
events: UrlEvents,
|
|
11
|
-
eventHandlers: EventHandlersFactory.create()
|
|
12
|
-
});
|
|
13
|
-
export default UrlField;
|
package/es/library/dot/legacy-to-new-arch/field-components/url-field/frameworks/ui/UrlFieldView.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Link } from "../../../..";
|
|
3
|
-
export function UrlFieldView(_ref, ref) {
|
|
4
|
-
let {
|
|
5
|
-
state,
|
|
6
|
-
helpers
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
value
|
|
10
|
-
} = state.properties;
|
|
11
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
12
|
-
getRef: ref,
|
|
13
|
-
label: value,
|
|
14
|
-
href: value,
|
|
15
|
-
variant: "secondary",
|
|
16
|
-
opensNewTab: true
|
|
17
|
-
});
|
|
18
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var FieldTypes = /*#__PURE__*/function (FieldTypes) {
|
|
2
|
-
FieldTypes["Boolean"] = "CheckboxField";
|
|
3
|
-
FieldTypes["SingleLine"] = "SingleLineField";
|
|
4
|
-
FieldTypes["MultiLine"] = "MultiLineField";
|
|
5
|
-
FieldTypes["URL"] = "URLField";
|
|
6
|
-
FieldTypes["Email"] = "EmailField";
|
|
7
|
-
FieldTypes["Phone"] = "PhoneField";
|
|
8
|
-
FieldTypes["Currency"] = "CurrencyField";
|
|
9
|
-
FieldTypes["Percentage"] = "PercentageField";
|
|
10
|
-
FieldTypes["Date"] = "DateField";
|
|
11
|
-
FieldTypes["DateTime"] = "DateTimeField";
|
|
12
|
-
FieldTypes["PickList"] = "PickListField";
|
|
13
|
-
FieldTypes["MultiSelect"] = "MultiSelectField";
|
|
14
|
-
FieldTypes["LookUp"] = "LookUpField";
|
|
15
|
-
FieldTypes["Number"] = "NumberField";
|
|
16
|
-
FieldTypes["Decimal"] = "DecimalField";
|
|
17
|
-
return FieldTypes;
|
|
18
|
-
}(FieldTypes || {});
|
|
19
|
-
|
|
20
|
-
export default FieldTypes;
|