@zohodesk/library-platform 1.0.0-exp.3 → 1.0.0-exp.5
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/component/properties/getRefPropertySchema.js +10 -0
- package/es/cc/fields/field/Types.js +21 -0
- package/es/cc/fields/multi-select/Model.js +4 -6
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +5 -3
- package/es/library/behaviours/list-selection/adapters/controllers/AllSelectionController.js +1 -1
- package/es/library/behaviours/list-selection/adapters/controllers/DestructController.js +1 -6
- package/es/library/behaviours/list-selection/adapters/controllers/InitializeController.js +2 -8
- package/es/library/behaviours/list-selection/adapters/gateways/Repository.js +9 -3
- package/es/library/behaviours/list-selection/entities/ListItemSelection.js +1 -1
- package/es/library/behaviours/list-selection/frameworks/ActionHandlerFactory.js +15 -15
- package/es/library/behaviours/list-selection/frameworks/ListItemSelectionBehaviourFactory.js +1 -6
- package/es/library/behaviours/list-selection/usecases/interactors/AllItemSelection.js +1 -1
- package/es/library/behaviours/list-selection/usecases/interactors/Destruct.js +1 -1
- package/es/library/behaviours/list-selection/usecases/interactors/Initialize.js +1 -1
- package/es/library/behaviours/sort-by/adapters/gateway/Repository.js +4 -1
- package/es/library/behaviours/sort-by/frameworks/ui/DemoBehaviour.js +2 -6
- package/es/library/behaviours/text-to-field-click/adapters/controllers/ClickController.js +23 -0
- package/es/library/behaviours/text-to-field-click/adapters/gateway/Repository.js +20 -0
- package/es/library/behaviours/text-to-field-click/entities/FieldEventConverter.js +19 -0
- package/es/library/behaviours/text-to-field-click/frameworks/ui/EventHandlersFactory.js +17 -0
- package/es/library/behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory.js +15 -0
- package/es/library/behaviours/text-to-field-click/usecases/interactors/AbstractUseCase.js +15 -0
- package/es/library/behaviours/text-to-field-click/usecases/interactors/ClickUseCase.js +17 -0
- package/es/library/custom-component/adapters/controllers/Controller.js +24 -6
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +30 -13
- package/es/library/custom-component/adapters/presenters/Presenter.js +0 -7
- package/es/library/custom-component/entities/Component.js +26 -24
- package/es/library/custom-component/entities/Properties.js +52 -66
- package/es/library/custom-component/entities/getRef.js +2 -2
- package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +15 -0
- package/es/library/custom-component/frameworks/object-path-immutable/ImmutableHelper.js +2 -0
- package/es/library/custom-component/frameworks/ui/ComponentRegistry.js +0 -1
- package/es/library/custom-component/frameworks/ui/{createCustomComponent.js → CreateCustomComponent.js} +31 -29
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +56 -0
- package/es/library/custom-component/frameworks/ui/DependencyFactory.js +34 -0
- package/es/library/custom-component/index.js +1 -1
- package/es/library/custom-component/usecases/entities-factory/BehavioursFactory.js +31 -29
- package/es/library/custom-component/usecases/entities-factory/ComponentFactory.js +21 -7
- package/es/library/custom-component/usecases/interactors/InitializeUseCase.js +1 -3
- package/es/library/custom-component/usecases/interactors/UpdatePropertyUseCase.js +1 -1
- package/es/library/dot/components/action-location/adapters/gateway/RepositoryOld.js +32 -0
- package/es/library/dot/components/action-location/entities/ActionLocationEntity.js +5 -5
- package/es/library/dot/components/action-location/frameworks/ui/ActionLocationView.js +3 -2
- package/es/library/dot/components/action-location/usecases/interactors/AbstractUseCase.js +6 -2
- package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +39 -19
- package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +7 -16
- package/es/library/dot/components/table-list/frameworks/ui/TableList.js +1 -6
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +64 -20
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +22 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/NoData.js +3 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +39 -33
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/field/FieldComponent.js +3 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/Headers.js +2 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +49 -4
- package/es/library/dot/legacy-to-new-arch/avatar/frameworks/ui/AvatarView.js +35 -31
- package/es/library/dot/legacy-to-new-arch/email/frameworks/ui/EmailView.js +2 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxField.js +13 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxFieldView.js +18 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/EventHandlersFactory.js +29 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/currency-field/frameworks/ui/CurrencyField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/currency-field/frameworks/ui/CurrencyFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/date-field/frameworks/ui/DateField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/date-field/frameworks/ui/DateFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/datetime-field/frameworks/ui/DateTimeField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/datetime-field/frameworks/ui/DateTimeFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/decimal-field/frameworks/ui/DecimalField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/decimal-field/frameworks/ui/DecimalFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +34 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +18 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/multiselect-field/frameworks/ui/MultiSelectField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/multiselect-field/frameworks/ui/MultiSelectFieldView.js +18 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/number-field/frameworks/ui/NumberField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/number-field/frameworks/ui/NumberFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/percentage-field/frameworks/ui/PercentageField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/percentage-field/frameworks/ui/PercentageFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/phone-field/frameworks/ui/PhoneField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/phone-field/frameworks/ui/PhoneFieldView.js +21 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/picklist-field/frameworks/ui/PickListField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/picklist-field/frameworks/ui/PickListFieldView.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/singleline-field/frameworks/ui/SingleLineField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/singleline-field/frameworks/ui/SingleLineFieldView.js +15 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/EventHandlersFactory.js +29 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchField.js +13 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +17 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/url-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/url-field/frameworks/ui/UrlField.js +13 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/url-field/frameworks/ui/UrlFieldView.js +17 -0
- package/es/library/index.js +1 -1
- package/es/platform/data-broker/http-template/deleteRecords.js +1 -2
- package/es/platform/data-broker/http-template/getAvailableFields.js +0 -2
- package/es/platform/data-broker/http-template/getRecords.js +0 -1
- package/es/platform/data-broker/http-template/getSelectedFields.js +0 -16
- package/es/platform/data-broker/http-template/getUIActions.js +3 -3
- package/es/platform/data-broker/utils/transformer/{createCf.js → CreateCf.js} +1 -0
- package/es/platform/data-broker/utils/transformer/Transformer.js +28 -0
- package/es/platform/zfield/adapters/controllers/ExeucteActionController.js +0 -3
- package/es/platform/zfield/adapters/gateways/Repository.js +5 -2
- package/es/platform/zfield/adapters/presenters/Presenter.js +4 -3
- package/es/platform/zfield/entities/fields-manager/FieldsManager.js +6 -2
- package/es/platform/zfield/entities/interfaces/FieldApiName.js +7 -0
- package/es/platform/zfield/entities/interfaces/IField.js +0 -1
- package/es/platform/zfield/frameworks/ActionHandlerFactory.js +16 -16
- package/es/platform/zfield/frameworks/ZFieldBehaviourFactory.js +1 -7
- package/es/platform/zfield/usecases/entities-factory/FieldBuilder.js +110 -0
- package/es/platform/zfield/usecases/entities-factory/FieldFactory.js +10 -0
- package/es/platform/zfield/usecases/entities-factory/FieldsManagerBuilder.js +49 -0
- package/es/platform/zfield/usecases/entity-factory/FieldFactory.js +1 -16
- package/es/platform/zfield/usecases/interactors/RefetchUseCase.js +1 -3
- package/es/platform/zfield/usecases/interfaces/input/FetchInputModel.js +1 -7
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +12 -12
- package/es/platform/zlist/adapters/presenters/translators/EmptyViewModel.js +3 -3
- package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +1 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/DecimalFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/EmailFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/NumberFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/URLFieldTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/utils/Pipeline.js +28 -0
- package/es/platform/zlist/entities/List.js +3 -3
- package/es/platform/zlist/usecases/interactors/AbstractUseCase.js +1 -1
- package/es/platform/zlist/usecases/interactors/InitializeUseCase.js +3 -1
- package/es/platform/zlist/usecases/interactors/PropertiesChangeUseCase.js +3 -1
- package/es/platform/zrecord/entities/Record.js +2 -17
- package/es/platform/zrecord/entities/RecordsManager.js +0 -1
- package/es/platform/zrecord/entities/interfaces/ApiEnum.js +10 -0
- package/es/platform/zrecord/usecases/interactors/AbstractUseCase.js +6 -2
- package/es/platform/zrecord/usecases/interfaces/output/IPresenter.js +1 -0
- package/package.json +6 -5
- package/es/library/behaviours/local-storage/adapters/controllers/handlers/Mount.js +0 -0
- package/es/library/behaviours/local-storage/adapters/controllers/handlers/SetData.js +0 -0
- package/es/library/behaviours/local-storage/adapters/controllers/handlers/UnMount.js +0 -0
- package/es/library/behaviours/local-storage/entities/Storage.js +0 -22
- package/es/library/behaviours/local-storage/usecases/interactors/AbstractUseCase.js +0 -8
- package/es/library/behaviours/local-storage/usecases/interactors/DeleteData.js +0 -15
- package/es/library/behaviours/local-storage/usecases/interactors/GetData.js +0 -16
- package/es/library/behaviours/local-storage/usecases/interactors/SetData.js +0 -15
- package/es/library/behaviours/local-storage/usecases/interfaces/UseCase.js +0 -1
- package/es/library/behaviours/local-storage/usecases/interfaces/input/DeleteDataInput.js +0 -1
- package/es/library/behaviours/local-storage/usecases/interfaces/input/GetDataInput.js +0 -1
- package/es/library/behaviours/local-storage/usecases/interfaces/input/SetDataInput.js +0 -1
- package/es/library/behaviours/local-storage/usecases/interfaces/output/IPresenter.js +0 -1
- package/es/library/behaviours/mouse-resizable/adapters/controllers/handlers/MountHandler.js +0 -8
- package/es/library/behaviours/mouse-resizable/adapters/controllers/handlers/StartResize.js +0 -10
- package/es/library/behaviours/mouse-resizable/adapters/controllers/handlers/UnMountHandler.js +0 -0
- package/es/library/behaviours/mouse-resizable/frameworks/MouseResizableFactory.js +0 -32
- package/es/library/behaviours/table-column-resizer/adapters/controllers/handlers/HandleDragStart.js +0 -0
- package/es/library/custom-component/frameworks/json-schema-validator/validator.js +0 -9
- package/es/library/custom-component/frameworks/ui/dependencyFactory.js +0 -29
- package/es/platform/data-broker/utils/transformer/transformer.js +0 -25
- package/es/platform/zlist/adapters/presenters/utils/pipeline.js +0 -25
- package/es/platform/zlist/adapters/presenters/utils/replacer.js +0 -9
- package/es/platform/zlist/adapters/presenters/utils/selectn.js +0 -7
- package/es/platform/zrecord/entities/interfaces/apiEnum.js +0 -1
- /package/es/library/behaviours/{local-storage/entities/interfaces/ILocalStorage.js → text-to-field-click/entities/interfaces/IFieldEventConverter.js} +0 -0
- /package/es/library/behaviours/{local-storage/entities/interfaces/IStorage.js → text-to-field-click/usecases/interfaces/UseCaseDependencies.js} +0 -0
- /package/es/library/behaviours/{local-storage → text-to-field-click}/usecases/interfaces/gateways/IRepository.js +0 -0
- /package/es/library/behaviours/{local-storage/usecases/interfaces/InputDependencies.js → text-to-field-click/usecases/interfaces/input/ClickUseCaseInputModel.js} +0 -0
- /package/es/library/custom-component/entities/{defaultAppendToActionPayload.js → DefaultAppendToActionPayload.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function CurrencyFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import DateProperties from "../../../../../../../cc/fields/date/Properties";
|
|
3
|
+
import DateEvents from "../../../../../../../cc/fields/date/Events";
|
|
4
|
+
import TextToFieldClickBehaviourFactory from "../../../../../../behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory";
|
|
5
|
+
import { DateFieldView } from "./DateFieldView";
|
|
6
|
+
const DateField = createCustomComponent({
|
|
7
|
+
name: 'DateField',
|
|
8
|
+
View: DateFieldView,
|
|
9
|
+
properties: DateProperties,
|
|
10
|
+
behaviours: [TextToFieldClickBehaviourFactory.create()],
|
|
11
|
+
events: DateEvents,
|
|
12
|
+
eventHandlers: {}
|
|
13
|
+
});
|
|
14
|
+
export default DateField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function DateFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import DateTimeProperties from "../../../../../../../cc/fields/datetime/Properties";
|
|
3
|
+
import DateTimeEvents from "../../../../../../../cc/fields/datetime/Events";
|
|
4
|
+
import TextToFieldClickBehaviourFactory from "../../../../../../behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory";
|
|
5
|
+
import { DateTimeFieldView } from "./DateTimeFieldView";
|
|
6
|
+
const DateTimeField = createCustomComponent({
|
|
7
|
+
name: 'DateTimeField',
|
|
8
|
+
View: DateTimeFieldView,
|
|
9
|
+
properties: DateTimeProperties,
|
|
10
|
+
behaviours: [TextToFieldClickBehaviourFactory.create()],
|
|
11
|
+
events: DateTimeEvents,
|
|
12
|
+
eventHandlers: {}
|
|
13
|
+
});
|
|
14
|
+
export default DateTimeField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function DateTimeFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import DecimalProperties from "../../../../../../../cc/fields/decimal/Properties";
|
|
3
|
+
import DecimalEvents from "../../../../../../../cc/fields/decimal/Events";
|
|
4
|
+
import TextToFieldClickBehaviourFactory from "../../../../../../behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory";
|
|
5
|
+
import { DecimalFieldView } from "./DecimalFieldView";
|
|
6
|
+
const DecimalField = createCustomComponent({
|
|
7
|
+
name: 'DecimalField',
|
|
8
|
+
View: DecimalFieldView,
|
|
9
|
+
properties: DecimalProperties,
|
|
10
|
+
behaviours: [TextToFieldClickBehaviourFactory.create()],
|
|
11
|
+
events: DecimalEvents,
|
|
12
|
+
eventHandlers: {}
|
|
13
|
+
});
|
|
14
|
+
export default DecimalField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function DecimalFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import EmailProperties from "../../../../../../../cc/fields/email/Properties";
|
|
3
|
+
import EmailEvents from "../../../../../../../cc/fields/email/Events";
|
|
4
|
+
import { EmailFieldView } from "./EmailFieldView";
|
|
5
|
+
const EmailField = createCustomComponent({
|
|
6
|
+
name: 'EmailField',
|
|
7
|
+
View: EmailFieldView,
|
|
8
|
+
properties: EmailProperties,
|
|
9
|
+
events: EmailEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default EmailField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Email } from "../../../..";
|
|
3
|
+
export function EmailFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Email, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
email: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import FieldTypes from "../../../../cc/fields/field/Types";
|
|
2
|
+
import CheckboxField from "./checkbox-field/frameworks/ui/CheckboxField";
|
|
3
|
+
import SwitchField from "./switch-field/frameworks/ui/SwitchField";
|
|
4
|
+
import SingleLineField from "./singleline-field/frameworks/ui/SingleLineField";
|
|
5
|
+
import EmailField from "./email-field/frameworks/ui/EmailField";
|
|
6
|
+
import UrlField from "./url-field/frameworks/ui/UrlField";
|
|
7
|
+
import PhoneField from "./phone-field/frameworks/ui/PhoneField";
|
|
8
|
+
import CurrencyField from "./currency-field/frameworks/ui/CurrencyField";
|
|
9
|
+
import LookUpField from "./lookup-field/frameworks/ui/LookupField";
|
|
10
|
+
import PickListField from "./picklist-field/frameworks/ui/PickListField";
|
|
11
|
+
import PercentageField from "./percentage-field/frameworks/ui/PercentageField";
|
|
12
|
+
import DateField from "./date-field/frameworks/ui/DateField";
|
|
13
|
+
import DateTimeField from "./datetime-field/frameworks/ui/DateTimeField";
|
|
14
|
+
import NumberField from "./number-field/frameworks/ui/NumberField";
|
|
15
|
+
import DecimalField from "./decimal-field/frameworks/ui/DecimalField";
|
|
16
|
+
import MultiSelectField from "./multiselect-field/frameworks/ui/MultiSelectField";
|
|
17
|
+
const FieldComponents = {
|
|
18
|
+
[FieldTypes.CheckboxField]: CheckboxField,
|
|
19
|
+
[FieldTypes.SwitchField]: SwitchField,
|
|
20
|
+
[FieldTypes.SingleLineField]: SingleLineField,
|
|
21
|
+
[FieldTypes.EmailField]: EmailField,
|
|
22
|
+
[FieldTypes.URLField]: UrlField,
|
|
23
|
+
[FieldTypes.PhoneField]: PhoneField,
|
|
24
|
+
[FieldTypes.CurrencyField]: CurrencyField,
|
|
25
|
+
[FieldTypes.LookUpField]: LookUpField,
|
|
26
|
+
[FieldTypes.PickListField]: PickListField,
|
|
27
|
+
[FieldTypes.PercentageField]: PercentageField,
|
|
28
|
+
[FieldTypes.DateField]: DateField,
|
|
29
|
+
[FieldTypes.DateTimeField]: DateTimeField,
|
|
30
|
+
[FieldTypes.NumberField]: NumberField,
|
|
31
|
+
[FieldTypes.DecimalField]: DecimalField,
|
|
32
|
+
[FieldTypes.MultiSelectField]: MultiSelectField
|
|
33
|
+
};
|
|
34
|
+
export default FieldComponents;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import LookupProperties from "../../../../../../../cc/fields/lookup/Properties";
|
|
3
|
+
import LookupEvents from "../../../../../../../cc/fields/lookup/Events";
|
|
4
|
+
import { LookupFieldView } from "./LookupFieldView";
|
|
5
|
+
const LookupField = createCustomComponent({
|
|
6
|
+
name: 'LookupField',
|
|
7
|
+
View: LookupFieldView,
|
|
8
|
+
properties: LookupProperties,
|
|
9
|
+
events: LookupEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default LookupField;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Avatar } from "../../../..";
|
|
3
|
+
export function LookupFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
name,
|
|
9
|
+
photoURL
|
|
10
|
+
} = state.properties.value;
|
|
11
|
+
return /*#__PURE__*/React.createElement(Avatar, {
|
|
12
|
+
getRef: ref,
|
|
13
|
+
name: name,
|
|
14
|
+
label: name,
|
|
15
|
+
imageSrc: photoURL,
|
|
16
|
+
tooltip: ""
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import MultiSelectProperties from "../../../../../../../cc/fields/multi-select/Properties";
|
|
3
|
+
import MultiSelectEvents from "../../../../../../../cc/fields/multi-select/Events";
|
|
4
|
+
import { MultiSelectFieldView } from "./MultiSelectFieldView";
|
|
5
|
+
const MultiSelectField = createCustomComponent({
|
|
6
|
+
name: 'MultiSelectField',
|
|
7
|
+
View: MultiSelectFieldView,
|
|
8
|
+
properties: MultiSelectProperties,
|
|
9
|
+
events: MultiSelectEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default MultiSelectField;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tags } from "../../../..";
|
|
3
|
+
export function MultiSelectFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
const selectedOptions = value.map(item => ({
|
|
11
|
+
id: item,
|
|
12
|
+
label: item
|
|
13
|
+
}));
|
|
14
|
+
return /*#__PURE__*/React.createElement(Tags, {
|
|
15
|
+
getRef: ref,
|
|
16
|
+
tags: selectedOptions
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import NumberProperties from "../../../../../../../cc/fields/number/Properties";
|
|
3
|
+
import NumberEvents from "../../../../../../../cc/fields/number/Events";
|
|
4
|
+
import TextToFieldClickBehaviourFactory from "../../../../../../behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory";
|
|
5
|
+
import { NumberFieldView } from "./NumberFieldView";
|
|
6
|
+
const NumberField = createCustomComponent({
|
|
7
|
+
name: 'NumberField',
|
|
8
|
+
View: NumberFieldView,
|
|
9
|
+
properties: NumberProperties,
|
|
10
|
+
behaviours: [TextToFieldClickBehaviourFactory.create()],
|
|
11
|
+
events: NumberEvents,
|
|
12
|
+
eventHandlers: {}
|
|
13
|
+
});
|
|
14
|
+
export default NumberField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function NumberFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import PercentageProperties from "../../../../../../../cc/fields/percent/Properties";
|
|
3
|
+
import PercentageEvents from "../../../../../../../cc/fields/percent/Events";
|
|
4
|
+
import TextToFieldClickBehaviourFactory from "../../../../../../behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory";
|
|
5
|
+
import { PercentageFieldView } from "./PercentageFieldView";
|
|
6
|
+
const PercentageField = createCustomComponent({
|
|
7
|
+
name: 'PercentageField',
|
|
8
|
+
View: PercentageFieldView,
|
|
9
|
+
properties: PercentageProperties,
|
|
10
|
+
behaviours: [TextToFieldClickBehaviourFactory.create()],
|
|
11
|
+
events: PercentageEvents,
|
|
12
|
+
eventHandlers: {}
|
|
13
|
+
});
|
|
14
|
+
export default PercentageField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function PercentageFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import PhoneProperties from "../../../../../../../cc/fields/phone/Properties";
|
|
3
|
+
import PhoneEvents from "../../../../../../../cc/fields/phone/Events";
|
|
4
|
+
import PhoneFieldView from "./PhoneFieldView";
|
|
5
|
+
const PhoneField = createCustomComponent({
|
|
6
|
+
name: 'PhoneField',
|
|
7
|
+
View: PhoneFieldView,
|
|
8
|
+
properties: PhoneProperties,
|
|
9
|
+
events: PhoneEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default PhoneField;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from "../../../..";
|
|
3
|
+
|
|
4
|
+
function PhoneFieldView(_ref, ref) {
|
|
5
|
+
let {
|
|
6
|
+
state
|
|
7
|
+
} = _ref;
|
|
8
|
+
const {
|
|
9
|
+
value
|
|
10
|
+
} = state.properties;
|
|
11
|
+
const href = `tel:${value}`;
|
|
12
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
13
|
+
getRef: ref,
|
|
14
|
+
label: value,
|
|
15
|
+
href: href,
|
|
16
|
+
variant: "secondary",
|
|
17
|
+
opensNewTab: true
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default PhoneFieldView;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import PickListProperties from "../../../../../../../cc/fields/pick-list/Properties";
|
|
3
|
+
import PickListEvents from "../../../../../../../cc/fields/text/Events";
|
|
4
|
+
import TextToFieldClickBehaviourFactory from "../../../../../../behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory";
|
|
5
|
+
import { PickListFieldView } from "./PickListFieldView";
|
|
6
|
+
const PickListField = createCustomComponent({
|
|
7
|
+
name: 'PickListField',
|
|
8
|
+
View: PickListFieldView,
|
|
9
|
+
properties: PickListProperties,
|
|
10
|
+
behaviours: [TextToFieldClickBehaviourFactory.create()],
|
|
11
|
+
events: PickListEvents,
|
|
12
|
+
eventHandlers: {}
|
|
13
|
+
});
|
|
14
|
+
export default PickListField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function PickListFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import TextProperties from "../../../../../../../cc/fields/text/Properties";
|
|
3
|
+
import TextEvents from "../../../../../../../cc/fields/text/Events";
|
|
4
|
+
import TextToFieldClickBehaviourFactory from "../../../../../../behaviours/text-to-field-click/frameworks/ui/TextToFieldClickBehaviourFactory";
|
|
5
|
+
import { SingleLineFieldView } from "./SingleLineFieldView";
|
|
6
|
+
const SingleLineField = createCustomComponent({
|
|
7
|
+
name: 'SingleLineField',
|
|
8
|
+
View: SingleLineFieldView,
|
|
9
|
+
properties: TextProperties,
|
|
10
|
+
behaviours: [TextToFieldClickBehaviourFactory.create()],
|
|
11
|
+
events: TextEvents,
|
|
12
|
+
eventHandlers: {}
|
|
13
|
+
});
|
|
14
|
+
export default SingleLineField;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export function SingleLineFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
text: value,
|
|
13
|
+
tooltip: ""
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Switch } from "../../../..";
|
|
3
|
+
export default function SwitchFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Switch, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
checked: value,
|
|
13
|
+
disabled: false,
|
|
14
|
+
size: 'small',
|
|
15
|
+
tooltip: ""
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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/table-field-components/url-field/frameworks/ui/UrlField.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from "../../../..";
|
|
3
|
+
export function UrlFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
value
|
|
9
|
+
} = state.properties;
|
|
10
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
11
|
+
getRef: ref,
|
|
12
|
+
label: value,
|
|
13
|
+
href: value,
|
|
14
|
+
variant: "secondary",
|
|
15
|
+
opensNewTab: true
|
|
16
|
+
});
|
|
17
|
+
}
|
package/es/library/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as ComponentRegistry } from "./custom-component/frameworks/ui/ComponentRegistry";
|
|
2
|
-
export { default as createCustomComponent } from "./custom-component/frameworks/ui/
|
|
2
|
+
export { default as createCustomComponent } from "./custom-component/frameworks/ui/CreateCustomComponent";
|
|
3
3
|
export { default as TableList } from "./dot/components/table-list/frameworks/ui/TableList";
|
|
@@ -5,8 +5,7 @@ const deleteRecords = {
|
|
|
5
5
|
type: 'POST',
|
|
6
6
|
transformer: data => data,
|
|
7
7
|
requestBody: '{ "entityIds": {{recordIds}} }',
|
|
8
|
-
//
|
|
9
|
-
// requestBody: '{ "recordIds": {{recordIds}} }',
|
|
8
|
+
// REVIEW: Is `entityIds` applicable to all modules? To be confirmed with backend team
|
|
10
9
|
properties: {
|
|
11
10
|
moduleName: {
|
|
12
11
|
required: true,
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
let getAvailableFields = {
|
|
2
2
|
name: "availableFields",
|
|
3
|
-
// api: "/api/v1/organizationFields",
|
|
4
3
|
api: "/api/v1/views/availableFields",
|
|
5
4
|
parameters: `{
|
|
6
5
|
"departmentId":"{{departmentId}}",
|
|
7
6
|
"module":"{{moduleName}}"
|
|
8
7
|
}`,
|
|
9
8
|
type: "GET",
|
|
10
|
-
// transformer: (res) => transformer(res, "name"),
|
|
11
9
|
transformer: res => res.fields,
|
|
12
10
|
properties: {
|
|
13
11
|
moduleName: {
|
|
@@ -6,23 +6,7 @@ let getSelectedFields = {
|
|
|
6
6
|
}`,
|
|
7
7
|
type: "GET",
|
|
8
8
|
transformer: res => res.fields,
|
|
9
|
-
// transformer: (res) => {
|
|
10
|
-
// return transformer(
|
|
11
|
-
// {
|
|
12
|
-
// data: res.fields.map((field) => ({ id: field, name: field }))
|
|
13
|
-
// },
|
|
14
|
-
// "name"
|
|
15
|
-
// );
|
|
16
|
-
// },
|
|
17
9
|
properties: {
|
|
18
|
-
// module: {
|
|
19
|
-
// required: true,
|
|
20
|
-
// typeMetadata: {
|
|
21
|
-
// schema: {
|
|
22
|
-
// type: "string"
|
|
23
|
-
// }
|
|
24
|
-
// }
|
|
25
|
-
// },
|
|
26
10
|
viewId: {
|
|
27
11
|
required: true,
|
|
28
12
|
typeMetadata: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Transformer from "../utils/transformer/Transformer";
|
|
2
2
|
let getUIActions = {
|
|
3
3
|
name: "uiActions",
|
|
4
4
|
api: "https://vimal-19789.tsi.zohocorpin.com:9090/api/v2/records",
|
|
@@ -7,7 +7,7 @@ let getUIActions = {
|
|
|
7
7
|
"module":"{{modelName}}"
|
|
8
8
|
}`,
|
|
9
9
|
type: "GET",
|
|
10
|
-
transformer: data =>
|
|
10
|
+
transformer: data => Transformer.transform(data, "UIActionName"),
|
|
11
11
|
properties: {
|
|
12
12
|
modelName: {
|
|
13
13
|
required: true,
|
|
@@ -19,4 +19,4 @@ let getUIActions = {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
export default getUIActions;
|
|
22
|
+
export default getUIActions;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import createCf from "./CreateCf"; // REVIEW: Function never used
|
|
2
|
+
|
|
3
|
+
class Transformer {
|
|
4
|
+
static transform(_ref, key) {
|
|
5
|
+
let {
|
|
6
|
+
data
|
|
7
|
+
} = _ref;
|
|
8
|
+
let records = data.map(item => {
|
|
9
|
+
let {
|
|
10
|
+
id,
|
|
11
|
+
createdTime
|
|
12
|
+
} = item;
|
|
13
|
+
return {
|
|
14
|
+
id,
|
|
15
|
+
recordName: {
|
|
16
|
+
key: key,
|
|
17
|
+
value: item[key]
|
|
18
|
+
},
|
|
19
|
+
createdTime,
|
|
20
|
+
cf: item.cf ? item.cf : createCf(item, key)
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return records;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default Transformer;
|