@zohodesk/library-platform 1.1.13 → 1.2.0-exp.1

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.
Files changed (165) hide show
  1. package/es/bc/column-chooser/EventHandlers.js +1 -2
  2. package/es/bc/sdk/ResourceNamesEnum.js +1 -0
  3. package/es/bc/zform/Properties.js +20 -0
  4. package/es/bc/zform/Symbol.js +3 -0
  5. package/es/bc/zrecord/Constants.js +2 -0
  6. package/es/cc/action-band/Properties.js +37 -0
  7. package/es/cc/action-band/constants/ExternalConstants.js +3 -1
  8. package/es/cc/component/Dispatch.js +1 -0
  9. package/es/cc/component/LifeCycleEventsEnum.js +1 -0
  10. package/es/cc/component/index.js +3 -0
  11. package/es/cc/fields/currency/Properties.js +9 -0
  12. package/es/cc/fields/decimal/Properties.js +9 -0
  13. package/es/cc/fields/email/Properties.js +9 -0
  14. package/es/cc/fields/lookup/Properties.js +10 -26
  15. package/es/cc/fields/multi-line/Properties.js +1 -0
  16. package/es/cc/fields/number/Properties.js +10 -1
  17. package/es/cc/fields/phone/Properties.js +9 -0
  18. package/es/cc/fields/text/Properties.js +2 -2
  19. package/es/cc/fields/url/Properties.js +9 -0
  20. package/es/cc/one-unification/Constants.js +24 -0
  21. package/es/cc/one-unification/unified-navigation/ActionTypes.js +1 -0
  22. package/es/cc/one-unification/unified-navigation/CommonTypes.js +1 -0
  23. package/es/cc/one-unification/unified-navigation/ConfigTypes.js +1 -0
  24. package/es/cc/one-unification/unified-navigation/HandlerTypes.js +1 -0
  25. package/es/cc/one-unification/unified-navigation/Types.js +1 -0
  26. package/es/cc/one-unification/unified-navigation/UnifiedNavigation.d.js +0 -0
  27. package/es/cc/one-unification/unified-navigation/index.js +1 -0
  28. package/es/cc/smart-navigation/Constants.js +8 -0
  29. package/es/cc/smart-navigation/Events.js +107 -0
  30. package/es/cc/smart-navigation/Properties.js +87 -0
  31. package/es/cc/smart-navigation/index.js +4 -0
  32. package/es/cc/table-column-chooser/Constants.js +2 -1
  33. package/es/cc/table-connected/SdkContract.js +22 -0
  34. package/es/cc/text/Properties.js +100 -0
  35. package/es/cc/textbox/Properties.js +1 -1
  36. package/es/index.js +8 -3
  37. package/es/library/behaviours/clip-wrap/applications/usecases/ClipWrapUpdateUseCase.js +19 -0
  38. package/es/library/behaviours/library-loader/adapters/controllers/LibraryLoaderController.js +17 -0
  39. package/es/library/behaviours/library-loader/adapters/gateways/LibraryLoaderAdapter.js +29 -0
  40. package/es/library/behaviours/library-loader/applications/usecases/LoadLibraryUseCase.js +42 -0
  41. package/es/library/behaviours/library-loader/domain/entities/interfaces/ILibraryLoader.js +1 -0
  42. package/es/library/behaviours/library-loader/frameworks/LibraryLoaderBehaviour.js +26 -0
  43. package/es/library/behaviours/search/adapters/controllers/UpdatePropertiesController.js +9 -4
  44. package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +4 -3
  45. package/es/library/custom-component/applications/usecases/DispatchUseCase.js +1 -0
  46. package/es/library/custom-component/applications/usecases/InitializeUseCase.js +1 -0
  47. package/es/library/custom-component/applications/usecases/MountUseCase.js +1 -0
  48. package/es/library/custom-component/applications/usecases/SetRefUseCase.js +7 -0
  49. package/es/library/custom-component/applications/usecases/UnmountUseCase.js +1 -0
  50. package/es/library/custom-component/applications/usecases/UpdatePropertyUseCase.js +1 -0
  51. package/es/library/custom-component/domain/entities/Component.js +1 -0
  52. package/es/library/custom-component/domain/entities/Logger.js +4 -9
  53. package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +2 -0
  54. package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +2 -0
  55. package/es/library/dot/components/form-fields/email/frameworks/ui/Email.js +1 -1
  56. package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +2 -0
  57. package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +2 -0
  58. package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +2 -0
  59. package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextArea.js +1 -1
  60. package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +4 -2
  61. package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +2 -0
  62. package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +2 -0
  63. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +1 -1
  64. package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextFieldView.js +20 -0
  65. package/es/library/dot/legacy-to-new-arch/text/frameworks/ui/Text.js +2 -2
  66. package/es/library/dot/legacy-to-new-arch/text/frameworks/ui/TextView.js +22 -1
  67. package/es/platform/app-context-behaviour/adapters/controllers/AbstractController.js +9 -0
  68. package/es/platform/app-context-behaviour/adapters/controllers/UpdatePropertiesController.js +32 -0
  69. package/es/platform/app-context-behaviour/adapters/gateway/Repository.js +22 -0
  70. package/es/platform/app-context-behaviour/adapters/gateway/Service.js +10 -0
  71. package/es/platform/app-context-behaviour/adapters/presenter/Presenter.js +16 -0
  72. package/es/platform/app-context-behaviour/applications/interfaces/UseCaseDependencies.js +1 -0
  73. package/es/platform/app-context-behaviour/applications/interfaces/gateways/IRepository.js +1 -0
  74. package/es/platform/app-context-behaviour/applications/interfaces/gateways/IService.js +1 -0
  75. package/es/platform/app-context-behaviour/applications/interfaces/input/UpdatePropertiesInputModel.js +1 -0
  76. package/es/platform/app-context-behaviour/applications/interfaces/output/BehaviourOutputModel.js +1 -0
  77. package/es/platform/app-context-behaviour/applications/interfaces/output/IPresenter.js +1 -0
  78. package/es/platform/app-context-behaviour/applications/usecases/AbstractUseCase.js +17 -0
  79. package/es/platform/app-context-behaviour/applications/usecases/UpdatePropertiesUsecase.js +25 -0
  80. package/es/platform/app-context-behaviour/domain/entities/AppContext.js +44 -0
  81. package/es/platform/app-context-behaviour/domain/entities/interfaces/IAppContext.js +1 -0
  82. package/es/platform/app-context-behaviour/frameworks/AppContextBehaviourFactory.js +2 -2
  83. package/es/platform/app-context-behaviour/frameworks/EventHandlerFactory.js +22 -0
  84. package/es/platform/client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils.js +11 -0
  85. package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionsFetchSDK.js +76 -0
  86. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsAPIGatewayParams.js +1 -0
  87. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsFetchSDKParams.js +10 -0
  88. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/IClientActionsFetchSDK.js +0 -0
  89. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/resources/ClientScriptsFetchSDK.js +43 -0
  90. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsAPIGatewayParams.js +1 -0
  91. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsSDKFetchParams.js +1 -0
  92. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/IClientScriptsFetchSDK.js +0 -0
  93. package/es/platform/column-chooser/adapters/controllers/ColumnChooserOpenController.js +14 -6
  94. package/es/platform/column-chooser/adapters/controllers/ColumnChooserUpdateController.js +22 -0
  95. package/es/platform/column-chooser/adapters/gateways/Repository.js +12 -1
  96. package/es/platform/column-chooser/adapters/gateways/Service.js +2 -0
  97. package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserUpdateInput.js +1 -0
  98. package/es/platform/column-chooser/applications/usecases/ColumnChooserSaveUseCase.js +8 -1
  99. package/es/platform/column-chooser/applications/usecases/ColumnChooserUpdateUseCase.js +35 -0
  100. package/es/platform/column-chooser/domain/entities/ColumnChooserImp.js +6 -0
  101. package/es/platform/column-chooser/frameworks/EventHandlersFactory.js +6 -4
  102. package/es/platform/components/index.js +1 -0
  103. package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +70 -8
  104. package/es/platform/components/smart-action-band/adapters/presenters/utils/DefaultClientActions.js +32 -0
  105. package/es/platform/components/smart-action-band/frameworks/EventHandlersFactory.js +42 -1
  106. package/es/platform/components/smart-action-band/frameworks/SmartActionBandFactory.js +4 -1
  107. package/es/platform/components/smart-navigation/adapters/controllers/LoadScriptController.js +0 -0
  108. package/es/platform/components/smart-navigation/adapters/controllers/UiModelInitializeController.js +0 -0
  109. package/es/platform/components/smart-navigation/adapters/presenters/OneUnifiedNavigationTranslator.js +248 -0
  110. package/es/platform/components/smart-navigation/adapters/presenters/Present.js +77 -0
  111. package/es/platform/components/smart-navigation/adapters/presenters/SampleModel.js +356 -0
  112. package/es/platform/components/smart-navigation/adapters/resources/SmartNavigationResource.js +96 -0
  113. package/es/platform/components/smart-navigation/applications/usecases/NavigateModuleUseCase.js +0 -0
  114. package/es/platform/components/smart-navigation/frameworks/CustomElementRenderer.js +22 -0
  115. package/es/platform/components/smart-navigation/frameworks/SmartNavigation.js +12 -0
  116. package/es/platform/components/smart-navigation/frameworks/one-unification/OneUnificationEventHandlers.js +156 -0
  117. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.js +83 -0
  118. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.module.css +3 -0
  119. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigationEventHandlers.js +173 -0
  120. package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigation.js +48 -0
  121. package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigationActions.js +144 -0
  122. package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +52 -0
  123. package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +1 -7
  124. package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +4 -2
  125. package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
  126. package/es/platform/data-source/http-template/getPageClientActions.js +23 -0
  127. package/es/platform/data-source/http-template/getSingleRecord.js +51 -0
  128. package/es/platform/data-source/index.js +2 -0
  129. package/es/platform/data-source/utils/validation-rules/FieldConditions.js +1 -1
  130. package/es/platform/sdk-behaviour/adapters/controllers/InitializeController.js +7 -2
  131. package/es/platform/sdk-behaviour/applications/usecases/CreateResourceInstanceUseCase.js +10 -1
  132. package/es/platform/zform/adapters/controllers/GetInitialRecordSuccessController.js +31 -0
  133. package/es/platform/zform/adapters/gateway/FormRepository.js +10 -2
  134. package/es/platform/zform/adapters/gateway/Service.js +2 -0
  135. package/es/platform/zform/adapters/presenter/FormTranslator.js +27 -15
  136. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +1 -1
  137. package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +1 -0
  138. package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +1 -0
  139. package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +1 -0
  140. package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +11 -7
  141. package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +1 -0
  142. package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +1 -0
  143. package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +1 -0
  144. package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +1 -0
  145. package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +1 -0
  146. package/es/platform/zform/adapters/presenter/utils/sanitizeHtmlString.js +2 -2
  147. package/es/platform/zform/applications/interfaces/input/GetInitialRecordSuccessUseCaseInputModel.js +1 -0
  148. package/es/platform/zform/applications/usecases/GetInitialRecordSuccessUseCase.js +132 -0
  149. package/es/platform/zform/applications/usecases/InitializeUseCase.js +54 -30
  150. package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +5 -0
  151. package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +12 -11
  152. package/es/platform/zform/applications/usecases/SubmitValidationCompletedUseCase.js +21 -8
  153. package/es/platform/zform/domain/ZField.js +7 -5
  154. package/es/platform/zform/domain/ZForm.js +97 -20
  155. package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +23 -5
  156. package/es/platform/zform/frameworks/ui/ZFormBehaviourFactory.js +2 -0
  157. package/es/platform/zlist/adapters/presenters/TableTranslator.js +5 -4
  158. package/es/platform/zrecord/adapters/controllers/UpdateRecordController.js +30 -0
  159. package/es/platform/zrecord/adapters/gateways/Service.js +2 -0
  160. package/es/platform/zrecord/applications/interfaces/input/UpdateRecordInputModel.js +0 -0
  161. package/es/platform/zrecord/applications/usecases/UpdateRecordUseCase.js +30 -0
  162. package/es/platform/zrecord/frameworks/ActionsHandlersFactory.js +4 -1
  163. package/package.json +9 -11
  164. package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js +0 -28
  165. package/es/platform/components/table-connected/adapters/controllers/ColumnChooserUpdateController.js +0 -31
@@ -7,6 +7,106 @@ export default {
7
7
  }
8
8
  }
9
9
  },
10
+ size: {
11
+ required: false,
12
+ defaultValue: "14",
13
+ typeMetadata: {
14
+ schema: {
15
+ type: "string",
16
+ enum: ["7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "24", "25", "26", "28", "29", "30", "32", "34", "35", "36", "40", "50", "inherit"]
17
+ }
18
+ }
19
+ },
20
+ textAlign: {
21
+ required: false,
22
+ typeMetadata: {
23
+ schema: {
24
+ type: "string",
25
+ enum: ["left", "right", "center", "justify"]
26
+ }
27
+ }
28
+ },
29
+ wordBreak: {
30
+ required: false,
31
+ typeMetadata: {
32
+ schema: {
33
+ type: "string",
34
+ enum: ["breakAll", "keepAll", "breakWord"]
35
+ }
36
+ }
37
+ },
38
+ lineClamp: {
39
+ required: false,
40
+ typeMetadata: {
41
+ schema: {
42
+ type: "string",
43
+ enum: ["1", "2", "3", "4", "5"]
44
+ }
45
+ }
46
+ },
47
+ lineHeight: {
48
+ required: false,
49
+ typeMetadata: {
50
+ schema: {
51
+ type: "string",
52
+ enum: ["0", "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2", "normal", "initial", "inherit"]
53
+ }
54
+ }
55
+ },
56
+ letterSpacing: {
57
+ required: false,
58
+ typeMetadata: {
59
+ schema: {
60
+ type: "string",
61
+ enum: ["0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2", "inherit"]
62
+ }
63
+ }
64
+ },
65
+ display: {
66
+ required: false,
67
+ typeMetadata: {
68
+ schema: {
69
+ type: "string",
70
+ enum: ["block", "inlineBlock", "inline", "initial"]
71
+ }
72
+ }
73
+ },
74
+ decoration: {
75
+ required: false,
76
+ typeMetadata: {
77
+ schema: {
78
+ type: "string",
79
+ enum: ["default", "underline", "strike", "overline"]
80
+ }
81
+ }
82
+ },
83
+ whiteSpace: {
84
+ required: false,
85
+ typeMetadata: {
86
+ schema: {
87
+ type: "string",
88
+ enum: ["normal", "noWrap", "pre", "preLine", "preWrap"]
89
+ }
90
+ }
91
+ },
92
+ wordWrap: {
93
+ required: false,
94
+ typeMetadata: {
95
+ schema: {
96
+ type: "string",
97
+ enum: ["normal", "break"]
98
+ }
99
+ }
100
+ },
101
+ transform: {
102
+ required: false,
103
+ typeMetadata: {
104
+ schema: {
105
+ type: "string",
106
+ enum: ["default", "upper", "lower", "capital"]
107
+ }
108
+ }
109
+ },
10
110
  weight: {
11
111
  required: false,
12
112
  typeMetadata: {
@@ -49,7 +49,7 @@ export default {
49
49
  required: false,
50
50
  typeMetadata: {
51
51
  schema: {
52
- type: 'string'
52
+ type: ['string', 'number']
53
53
  }
54
54
  }
55
55
  },
package/es/index.js CHANGED
@@ -5,7 +5,9 @@ import ExternalConstants from "./cc/table-connected/constants/ExternalConstants"
5
5
  import ActionEventMediator from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
6
6
  import RowActionsRenderer from "./platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
7
7
  import AdaptiveRowActionsRenderer from "./platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRenderer";
8
- import ClientActionReordererRegistry from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionReordererRegistry"; // Rebuild SmartTableConstants without Events
8
+ import ClientActionReordererRegistry from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionReordererRegistry";
9
+ import ClientActionsFetchSDK from "./platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionsFetchSDK";
10
+ import ClientScriptsFetchSDK from "./platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/resources/ClientScriptsFetchSDK"; // Rebuild SmartTableConstants without Events
9
11
 
10
12
  const SmartTableConstants = {
11
13
  ExternalConstants
@@ -17,7 +19,7 @@ export const CC = { ...CCNamespace,
17
19
  import * as _BC from "./bc";
18
20
  export { _BC as BC };
19
21
  export * from "./library/analytics";
20
- export { TableConnectedFactory, FormConnectedFactory, SmartActionBandFactory } from "./platform/components";
22
+ export { TableConnectedFactory, FormConnectedFactory, SmartNavigation, createSmartNavigation, SmartActionBandFactory } from "./platform/components";
21
23
  export { ComponentRegistry, createCustomComponent } from "./library";
22
24
  export { default as TableFieldComponents } from "./library/dot/legacy-to-new-arch/table-field-components";
23
25
  import * as _Components from "./library/dot/legacy-to-new-arch";
@@ -27,6 +29,7 @@ export { sdkRegistry } from "./platform/sdk/frameworks/SdkRegistry";
27
29
  export { AppResource } from "./platform/components/app/adapters/resources/AppResource";
28
30
  export { fetchClientActions } from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter";
29
31
  export { ZFormApiActionName } from "./bc/zform/Constants";
32
+ export { RecordApiActionName } from "./bc/zrecord/Constants";
30
33
  export { transFormValidationRules } from "./platform/data-source/utils/validation-rules/TransFormValidationRules";
31
34
  export { AdaptiveRowActionsRenderer };
32
35
  export { ActionEventMediator };
@@ -39,4 +42,6 @@ export const Behaviours = {
39
42
  FieldSectionEventMappingBehaviourFactory
40
43
  };
41
44
  export * from "./library/analytics";
42
- export { ClientActionReordererRegistry };
45
+ export { ClientActionReordererRegistry };
46
+ export { ClientActionsFetchSDK };
47
+ export { ClientScriptsFetchSDK };
@@ -0,0 +1,19 @@
1
+ import AbstractUseCase from "./AbstractUseCase";
2
+
3
+ class ClipWrapUpdateUseCase extends AbstractUseCase {
4
+ execute(input) {
5
+ const {
6
+ repository,
7
+ presenter
8
+ } = this.dependencies;
9
+ const {
10
+ mode
11
+ } = input;
12
+ const clipWrap = repository.getClipWrapEntity();
13
+ clipWrap.setValue(mode);
14
+ presenter.updateClipWrap(clipWrap.toObject());
15
+ }
16
+
17
+ }
18
+
19
+ export default ClipWrapUpdateUseCase;
@@ -0,0 +1,17 @@
1
+ export class LibraryLoaderController {
2
+ constructor(loadLibraryUseCase, scriptId) {
3
+ this.loadLibraryUseCase = loadLibraryUseCase;
4
+ this.scriptId = scriptId;
5
+ }
6
+
7
+ handleMount(_ref) {
8
+ let {
9
+ dispatch
10
+ } = _ref;
11
+ this.loadLibraryUseCase.execute({
12
+ dispatch,
13
+ scriptId: this.scriptId
14
+ });
15
+ }
16
+
17
+ }
@@ -0,0 +1,29 @@
1
+ export class LibraryLoaderAdapter {
2
+ constructor(url) {
3
+ this.url = url;
4
+ }
5
+
6
+ isScriptLoaded() {
7
+ return Array.from(document.querySelectorAll('script[data-library-loader-script="true"]')).some(script => script.src === this.url);
8
+ }
9
+
10
+ loadScript() {
11
+ if (this.isScriptLoaded()) {
12
+ return Promise.resolve();
13
+ }
14
+
15
+ return new Promise((resolve, reject) => {
16
+ const script = document.createElement('script');
17
+ script.src = this.url;
18
+ script.async = true;
19
+ script.setAttribute('data-library-loader-script', 'true');
20
+
21
+ script.onload = () => resolve();
22
+
23
+ script.onerror = () => reject(new Error(`Failed to load script: ${this.url}`));
24
+
25
+ document.head.appendChild(script);
26
+ });
27
+ }
28
+
29
+ }
@@ -0,0 +1,42 @@
1
+ export class LoadLibraryUseCase {
2
+ constructor(loader) {
3
+ this.loader = loader;
4
+ }
5
+
6
+ async execute(_ref) {
7
+ let {
8
+ dispatch,
9
+ scriptId
10
+ } = _ref;
11
+
12
+ // If the loader has isScriptLoaded, use it
13
+ if (typeof this.loader.isScriptLoaded === 'function' && this.loader.isScriptLoaded()) {
14
+ dispatch({
15
+ type: 'LIBRARY_LOADER#ALREADY_LOADED',
16
+ payload: {
17
+ scriptId: scriptId
18
+ }
19
+ });
20
+ return;
21
+ }
22
+
23
+ try {
24
+ await this.loader.loadScript();
25
+ dispatch({
26
+ type: 'LIBRARY_LOADER#SUCCESS',
27
+ payload: {
28
+ scriptId: scriptId
29
+ }
30
+ });
31
+ } catch (error) {
32
+ dispatch({
33
+ type: 'LIBRARY_LOADER#FAILURE',
34
+ payload: {
35
+ scriptId: scriptId,
36
+ error: error.message
37
+ }
38
+ });
39
+ }
40
+ }
41
+
42
+ }
@@ -0,0 +1,26 @@
1
+ import { LibraryLoaderAdapter } from "../adapters/gateways/LibraryLoaderAdapter";
2
+ import { LoadLibraryUseCase } from "../applications/usecases/LoadLibraryUseCase";
3
+ import { LibraryLoaderController } from "../adapters/controllers/LibraryLoaderController";
4
+ export function LibraryLoaderBehaviour(scriptId, url) {
5
+ const loader = new LibraryLoaderAdapter(url);
6
+ const loadLibraryUseCase = new LoadLibraryUseCase(loader);
7
+ const controller = new LibraryLoaderController(loadLibraryUseCase, scriptId);
8
+ return {
9
+ name: 'LibraryLoaderBehaviour',
10
+ setInitialState: () => ({}),
11
+ eventHandlers: {
12
+ MOUNT: controller.handleMount.bind(controller)
13
+ },
14
+ properties: {
15
+ url: {
16
+ required: true,
17
+ defaultValue: url,
18
+ typeMetadata: {
19
+ schema: {
20
+ type: 'string'
21
+ }
22
+ }
23
+ }
24
+ }
25
+ };
26
+ }
@@ -9,12 +9,17 @@ class UpdatePropertiesController extends AbstractController {
9
9
  state,
10
10
  updateState,
11
11
  action
12
- } = event; // console.log("UpdatePropertiesController action:", action);
13
-
12
+ } = event;
14
13
  const {
15
- searchString,
16
- previousSearchString
14
+ currentProperties,
15
+ previousProperties
17
16
  } = action.payload;
17
+ const {
18
+ searchString: previousSearchString
19
+ } = previousProperties;
20
+ const {
21
+ searchString
22
+ } = currentProperties;
18
23
  updatePropertiesUsecase.updateDependencies(state, updateState);
19
24
  updatePropertiesUsecase.execute({
20
25
  searchString,
@@ -43,11 +43,11 @@ class EventManager {
43
43
  }
44
44
 
45
45
  unSubscribe(events) {
46
- events.forEach((eventHandlers, key) => {
47
- this._element && eventHandlers.map(eventHandler => {
46
+ if (this._element) {
47
+ events.forEach((eventHandler, key) => {
48
48
  this._element.removeEventListener(key, eventHandler);
49
49
  });
50
- });
50
+ }
51
51
  }
52
52
 
53
53
  dispatch(event) {
@@ -92,6 +92,7 @@ class EventManager {
92
92
  code: ErrorCode.InvalidSchema,
93
93
  error: e
94
94
  };
95
+ __DEVELOPMENT__ && console.error('Schema Validation Error: ', e);
95
96
  }
96
97
 
97
98
  return error;
@@ -35,6 +35,7 @@ class DispatchUseCase extends AbstractUseCase {
35
35
  eventManager.dispatch(action);
36
36
  }
37
37
  } catch (e) {
38
+ __DEVELOPMENT__ && console.error('ACA DispatchUseCase Error: ', e);
38
39
  component.setError(e);
39
40
  presenter.setError(e);
40
41
  }
@@ -15,6 +15,7 @@ class InitializeUseCase extends AbstractUseCase {
15
15
  let state = component.getState();
16
16
  presenter.render(state);
17
17
  } catch (e) {
18
+ __DEVELOPMENT__ && console.error('ACA InitializeUseCase Error: ', e);
18
19
  const error = component.getClassifiedErrorStructure(e);
19
20
  component.setError(error);
20
21
  presenter.setError(error);
@@ -18,6 +18,7 @@ class MountUsecase extends AbstractUseCase {
18
18
  eventManager.dispatch(mountAction);
19
19
  }
20
20
  } catch (e) {
21
+ __DEVELOPMENT__ && console.error('ACA MountUsecase Error: ', e);
21
22
  component.setError(e);
22
23
  presenter.setError(e);
23
24
  }
@@ -11,6 +11,12 @@ class SetRefUseCase extends AbstractUseCase {
11
11
  eventManager
12
12
  } = this.dependencies;
13
13
  const component = repository.getComponent();
14
+
15
+ if (!component) {
16
+ // NOTE: need to check why component is null
17
+ return;
18
+ }
19
+
14
20
  const eventHandlers = component.getEventHandlersWrapper();
15
21
 
16
22
  try {
@@ -20,6 +26,7 @@ class SetRefUseCase extends AbstractUseCase {
20
26
  eventManager.subscribe(eventHandlers);
21
27
  }
22
28
  } catch (e) {
29
+ __DEVELOPMENT__ && console.error('ACA SetRefUseCase Error: ', e);
23
30
  const error = component.getClassifiedErrorStructure(e);
24
31
  component.setError(error);
25
32
  presenter.setError(error);
@@ -16,6 +16,7 @@ class UnmountUsecase extends AbstractUseCase {
16
16
  eventManager.unSubscribe(eventHanlders);
17
17
  repository.clear();
18
18
  } catch (e) {
19
+ __DEVELOPMENT__ && console.error('ACA UnmountUsecase Error: ', e);
19
20
  component.setError(null);
20
21
  presenter.setError(null);
21
22
  }
@@ -28,6 +28,7 @@ class UpdatePropertyUseCase extends AbstractUseCase {
28
28
  }));
29
29
  }
30
30
  } catch (error) {
31
+ __DEVELOPMENT__ && console.error('ACA UpdatePropertyUseCase Error: ', error);
31
32
  component.setError(error);
32
33
  presenter.setError(error);
33
34
  }
@@ -210,6 +210,7 @@ export default class Component {
210
210
  ...helpers
211
211
  });
212
212
  } catch (e) {
213
+ __DEVELOPMENT__ && console.error(`ACA ${key} Event Handler Error: `, e);
213
214
  const error = {
214
215
  code: ErrorCodes.EVENT_HANDLER_FAILED,
215
216
  message: 'Error occurred in event handler for event ' + key,
@@ -12,7 +12,7 @@ export default class Logger {
12
12
 
13
13
 
14
14
  logPropertiesValidation(validationResults) {
15
- if (__DEVELOPMENT__) {
15
+ if (__DEVELOPMENT__ && validationResults) {
16
16
  console.group(`%cProperties Validation: %c${this.componentName}`, ERROR_PRIMARY, ERROR_SECONDARY, validationResults);
17
17
  validationResults.forEach(_ref => {
18
18
  let {
@@ -44,14 +44,9 @@ export default class Logger {
44
44
  return;
45
45
  }
46
46
 
47
- console.group(`%cError Occurred: %c${this.componentName}`, ERROR_PRIMARY, ERROR_SECONDARY, error);
48
- console.error(`%cError Code: %c${error.code}`, ERROR_PRIMARY, ERROR_SECONDARY);
49
- console.error(`%cError Message: %c${error.message}`, ERROR_PRIMARY, ERROR_SECONDARY);
50
-
51
- if (error.errorDetails?.originalError) {
52
- console.error(error.errorDetails.originalError);
53
- }
54
-
47
+ console.group(`%cError Occurred: %c${this.componentName}`, ERROR_SECONDARY, ERROR_PRIMARY, error);
48
+ console.error(`%cError Code: %c${error.code}`, ERROR_SECONDARY, ERROR_PRIMARY);
49
+ console.error(`%cError Message: %c${error.message}`, ERROR_SECONDARY, ERROR_PRIMARY);
55
50
  console.groupEnd();
56
51
  }
57
52
  }
@@ -18,6 +18,7 @@ function CurrencyView(_ref, ref) {
18
18
  label,
19
19
  value,
20
20
  placeholder,
21
+ maxLength,
21
22
  errorMessage,
22
23
  disabled,
23
24
  readonly,
@@ -54,6 +55,7 @@ function CurrencyView(_ref, ref) {
54
55
  id: id,
55
56
  value: formattedValue,
56
57
  placeholder: placeholder,
58
+ maxLength: maxLength,
57
59
  disabled: disabled,
58
60
  readonly: readonly,
59
61
  required: required,
@@ -13,6 +13,7 @@ function DecimalView(_ref, ref) {
13
13
  label,
14
14
  value,
15
15
  placeholder,
16
+ maxLength,
16
17
  errorMessage,
17
18
  disabled,
18
19
  readonly,
@@ -42,6 +43,7 @@ function DecimalView(_ref, ref) {
42
43
  id: id,
43
44
  placeholder: placeholder,
44
45
  value: value,
46
+ maxLength: maxLength,
45
47
  required: required,
46
48
  disabled: disabled,
47
49
  readonly: readonly,
@@ -1,5 +1,5 @@
1
1
  import { createCustomComponent } from "../../../../../../custom-component";
2
- import EmailProperties from "../../../../../../../cc/fields/text/Properties";
2
+ import EmailProperties from "../../../../../../../cc/fields/email/Properties";
3
3
  import EmailView from "./EmailView";
4
4
  import EventHandlersFactory from "./EventHandlerFactory";
5
5
  import FocusFieldBehaviourFactory from "../../../../../../behaviours/field-focus/frameworks/ui/FocusFieldBehaviourFactory";
@@ -13,6 +13,7 @@ function EmailView(_ref, ref) {
13
13
  label,
14
14
  value,
15
15
  placeholder,
16
+ maxLength,
16
17
  disabled,
17
18
  readonly,
18
19
  errorMessage,
@@ -42,6 +43,7 @@ function EmailView(_ref, ref) {
42
43
  id: id,
43
44
  placeholder: placeholder,
44
45
  value: value,
46
+ maxLength: maxLength,
45
47
  disabled: disabled,
46
48
  readonly: readonly,
47
49
  required: required,
@@ -13,6 +13,7 @@ function NumberView(_ref, ref) {
13
13
  label,
14
14
  value,
15
15
  placeholder,
16
+ maxLength,
16
17
  errorMessage,
17
18
  disabled,
18
19
  readonly,
@@ -42,6 +43,7 @@ function NumberView(_ref, ref) {
42
43
  id: id,
43
44
  placeholder: placeholder,
44
45
  value: value,
46
+ maxLength: maxLength,
45
47
  disabled: disabled,
46
48
  readonly: readonly,
47
49
  required: required,
@@ -13,6 +13,7 @@ function PhoneView(_ref, ref) {
13
13
  label,
14
14
  value,
15
15
  placeholder,
16
+ maxLength,
16
17
  errorMessage,
17
18
  disabled,
18
19
  readonly,
@@ -42,6 +43,7 @@ function PhoneView(_ref, ref) {
42
43
  id: id,
43
44
  placeholder: placeholder,
44
45
  value: value,
46
+ maxLength: maxLength,
45
47
  disabled: disabled,
46
48
  readonly: readonly,
47
49
  required: required,
@@ -1,5 +1,5 @@
1
1
  import { createCustomComponent } from "../../../../../../custom-component";
2
- import TextAreaProperties from "../../../../../../../cc/fields/text/Properties";
2
+ import TextAreaProperties from "../../../../../../../cc/fields/multi-line/Properties";
3
3
  import TextAreaView from "./TextAreaView";
4
4
  import EventHandlerFactory from "./EventHandlerFactory";
5
5
  import FocusFieldBehaviourFactory from "../../../../../../behaviours/field-focus/frameworks/ui/FocusFieldBehaviourFactory";
@@ -20,7 +20,8 @@ function TextAreaView(_ref, ref) {
20
20
  uiConfig,
21
21
  labelActions,
22
22
  actions,
23
- clientScripts
23
+ clientScripts,
24
+ maxLength
24
25
  } = state.properties;
25
26
  const {
26
27
  size,
@@ -46,7 +47,8 @@ function TextAreaView(_ref, ref) {
46
47
  disabled: disabled,
47
48
  readonly: readonly,
48
49
  actions: actions,
49
- clientScripts: clientScripts
50
+ clientScripts: clientScripts,
51
+ maxLength: maxLength
50
52
  })));
51
53
  }
52
54
 
@@ -13,6 +13,7 @@ function TextBoxView(_ref, ref) {
13
13
  label,
14
14
  value,
15
15
  placeholder,
16
+ maxLength,
16
17
  errorMessage,
17
18
  disabled,
18
19
  readonly,
@@ -42,6 +43,7 @@ function TextBoxView(_ref, ref) {
42
43
  id: id,
43
44
  placeholder: placeholder,
44
45
  value: value,
46
+ maxLength: maxLength,
45
47
  required: required,
46
48
  disabled: disabled,
47
49
  readonly: readonly,
@@ -13,6 +13,7 @@ function UrlView(_ref, ref) {
13
13
  label,
14
14
  value,
15
15
  placeholder,
16
+ maxLength,
16
17
  uiConfig,
17
18
  errorMessage,
18
19
  disabled,
@@ -42,6 +43,7 @@ function UrlView(_ref, ref) {
42
43
  id: id,
43
44
  placeholder: placeholder,
44
45
  value: value,
46
+ maxLength: maxLength,
45
47
  disabled: disabled,
46
48
  readonly: readonly,
47
49
  required: required,
@@ -41,7 +41,7 @@ function HeaderData(_ref) {
41
41
  },
42
42
  $customProps_container: hasActions ? {
43
43
  $ui_displayMode: 'flex',
44
- $ui_alignItems: 'center',
44
+ $ui_alignItems: isMultiline ? 'baseline' : 'center',
45
45
  $ui_justifyContent: AlignmentOfFlex[alignment]
46
46
  } : null,
47
47
  customStyle: hasActions ? {
@@ -6,6 +6,16 @@ export default function TextFieldView(_ref, ref) {
6
6
  } = _ref;
7
7
  const {
8
8
  text,
9
+ size,
10
+ display,
11
+ decoration,
12
+ textAlign,
13
+ lineClamp,
14
+ lineHeight,
15
+ transform,
16
+ whiteSpace,
17
+ wordWrap,
18
+ wordBreak,
9
19
  weight,
10
20
  isDotted,
11
21
  tooltip
@@ -13,6 +23,16 @@ export default function TextFieldView(_ref, ref) {
13
23
  return /*#__PURE__*/React.createElement(Text, {
14
24
  getRef: ref,
15
25
  text: text,
26
+ size: size,
27
+ display: display,
28
+ decoration: decoration,
29
+ textAlign: textAlign,
30
+ lineClamp: lineClamp,
31
+ lineHeight: lineHeight,
32
+ transform: transform,
33
+ whiteSpace: whiteSpace,
34
+ wordWrap: wordWrap,
35
+ wordBreak: isDotted ? wordBreak : 'breakWord',
16
36
  tooltip: tooltip,
17
37
  weight: weight,
18
38
  isDotted: isDotted
@@ -5,7 +5,7 @@ let WrapText = createCustomComponent({
5
5
  name: "TableText",
6
6
  View: TextView,
7
7
  properties: TextProperties,
8
- actions: TextActions,
9
- actionHandlers: {}
8
+ events: TextActions,
9
+ eventHandlers: {}
10
10
  });
11
11
  export default WrapText;