@cxbox-ui/core 2.0.0-alpha.7 → 2.0.0-alpha.9

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 (127) hide show
  1. package/README.md +261 -28
  2. package/dist/core.d.ts +4274 -0
  3. package/dist/index.js +2 -6
  4. package/dist/index.js.map +1 -0
  5. package/package.json +19 -30
  6. package/dist/actions/index.d.ts +0 -1081
  7. package/dist/api/ObservableApi.d.ts +0 -53
  8. package/dist/api/ObservableApiWrapper.d.ts +0 -11
  9. package/dist/api/index.d.ts +0 -1
  10. package/dist/cxbox-ui-core.cjs.development.js +0 -3674
  11. package/dist/cxbox-ui-core.cjs.production.min.js +0 -2
  12. package/dist/cxbox-ui-core.esm.js +0 -3638
  13. package/dist/cxbox-ui-core.modern.development.js +0 -3568
  14. package/dist/cxbox-ui-core.modern.js +0 -3568
  15. package/dist/cxbox-ui-core.modern.production.min.js +0 -2
  16. package/dist/epics/data/bcCancelCreateDataEpic.d.ts +0 -9
  17. package/dist/epics/data/bcDeleteDataEpic.d.ts +0 -2
  18. package/dist/epics/data/bcFetchDataEpic.d.ts +0 -15
  19. package/dist/epics/data/bcFetchRowMetaRequestEpic.d.ts +0 -17
  20. package/dist/epics/data/bcLoadMoreEpic.d.ts +0 -2
  21. package/dist/epics/data/bcNewDataEpic.d.ts +0 -14
  22. package/dist/epics/data/bcSaveDataEpic.d.ts +0 -24
  23. package/dist/epics/data/bcSelectDepthRecordEpic.d.ts +0 -2
  24. package/dist/epics/data/bcSelectRecordEpic.d.ts +0 -2
  25. package/dist/epics/data/changeAssociationEpic.d.ts +0 -2
  26. package/dist/epics/data/changeAssociationFullEpic.d.ts +0 -5
  27. package/dist/epics/data/changeAssociationSameBcEpic.d.ts +0 -5
  28. package/dist/epics/data/changeChildrenAssociationsEpic.d.ts +0 -2
  29. package/dist/epics/data/changeChildrenAssociationsSameBcEpic.d.ts +0 -2
  30. package/dist/epics/data/changeDescendantsAssociationsFullEpic.d.ts +0 -5
  31. package/dist/epics/data/index.d.ts +0 -20
  32. package/dist/epics/data/inlinePickListFetchDataEpic.d.ts +0 -2
  33. package/dist/epics/data/removeMultivalueTagEpic.d.ts +0 -17
  34. package/dist/epics/data/saveAssociationsActiveEpic.d.ts +0 -7
  35. package/dist/epics/data/saveAssociationsPassiveEpic.d.ts +0 -7
  36. package/dist/epics/data/selectViewEpic.d.ts +0 -11
  37. package/dist/epics/index.d.ts +0 -6
  38. package/dist/epics/router/changeLocationEpic.d.ts +0 -10
  39. package/dist/epics/router/drilldownEpic.d.ts +0 -2
  40. package/dist/epics/router/handleRouterEpic.d.ts +0 -2
  41. package/dist/epics/router/index.d.ts +0 -10
  42. package/dist/epics/router/loginDoneEpic.d.ts +0 -9
  43. package/dist/epics/router/selectScreenEpic.d.ts +0 -7
  44. package/dist/epics/router/selectScreenFailEpic.d.ts +0 -7
  45. package/dist/epics/router/selectViewEpic.d.ts +0 -7
  46. package/dist/epics/router/selectViewFailEpic.d.ts +0 -6
  47. package/dist/epics/router/userDrillDownEpic.d.ts +0 -6
  48. package/dist/epics/router/userDrilldownChangeCursorsEpic.d.ts +0 -2
  49. package/dist/epics/screen/apiErrorEpic.d.ts +0 -2
  50. package/dist/epics/screen/downloadFileByUrlEpic.d.ts +0 -2
  51. package/dist/epics/screen/downloadFileEpic.d.ts +0 -2
  52. package/dist/epics/screen/httpError401Epic.d.ts +0 -2
  53. package/dist/epics/screen/httpError409Epic.d.ts +0 -2
  54. package/dist/epics/screen/httpError418Epic.d.ts +0 -2
  55. package/dist/epics/screen/httpError500Epic.d.ts +0 -2
  56. package/dist/epics/screen/httpErrorDefaultEpic.d.ts +0 -2
  57. package/dist/epics/screen/index.d.ts +0 -10
  58. package/dist/epics/screen/processPostInvokeConfirmEpic.d.ts +0 -2
  59. package/dist/epics/screen/processPostInvokeEpic.d.ts +0 -2
  60. package/dist/epics/session/index.d.ts +0 -5
  61. package/dist/epics/session/loginByAnotherRoleEpic.d.ts +0 -5
  62. package/dist/epics/session/loginDoneEpic.d.ts +0 -6
  63. package/dist/epics/session/refreshMetaAndReloadPageEpic.d.ts +0 -2
  64. package/dist/epics/session/refreshMetaEpic.d.ts +0 -5
  65. package/dist/epics/session/switchRoleEpic.d.ts +0 -5
  66. package/dist/epics/utils/postOperationRoutine.d.ts +0 -13
  67. package/dist/epics/view/clearPendingDataChangesAfterCursorChangeEpic.d.ts +0 -7
  68. package/dist/epics/view/fileUploadConfirmEpic.d.ts +0 -11
  69. package/dist/epics/view/getRowMetaByForceActiveEpic.d.ts +0 -5
  70. package/dist/epics/view/index.d.ts +0 -9
  71. package/dist/epics/view/selectTableCellInitEpic.d.ts +0 -2
  72. package/dist/epics/view/sendOperationAssociateEpic.d.ts +0 -5
  73. package/dist/epics/view/sendOperationEpic.d.ts +0 -10
  74. package/dist/epics/view/showAllTableRecordsInitEpic.d.ts +0 -2
  75. package/dist/epics/view/showAssocPopupEpic.d.ts +0 -2
  76. package/dist/epics/view/showFileUploadPopupEpic.d.ts +0 -5
  77. package/dist/index.d.ts +0 -7
  78. package/dist/interfaces/bc.d.ts +0 -79
  79. package/dist/interfaces/customEpics.d.ts +0 -15
  80. package/dist/interfaces/customMiddlewares.d.ts +0 -35
  81. package/dist/interfaces/data.d.ts +0 -48
  82. package/dist/interfaces/filters.d.ts +0 -32
  83. package/dist/interfaces/index.d.ts +0 -27
  84. package/dist/interfaces/navigation.d.ts +0 -48
  85. package/dist/interfaces/objectMap.d.ts +0 -36
  86. package/dist/interfaces/operation.d.ts +0 -336
  87. package/dist/interfaces/router.d.ts +0 -17
  88. package/dist/interfaces/rowMeta.d.ts +0 -74
  89. package/dist/interfaces/screen.d.ts +0 -28
  90. package/dist/interfaces/session.d.ts +0 -83
  91. package/dist/interfaces/store.d.ts +0 -14
  92. package/dist/interfaces/tree.d.ts +0 -66
  93. package/dist/interfaces/view.d.ts +0 -202
  94. package/dist/interfaces/widget.d.ts +0 -209
  95. package/dist/middlewares/autosaveMiddleware.d.ts +0 -2
  96. package/dist/middlewares/index.d.ts +0 -6
  97. package/dist/middlewares/popupMiddleware.d.ts +0 -2
  98. package/dist/middlewares/preInvokeMiddleware.d.ts +0 -5
  99. package/dist/middlewares/requiredFieldsMiddleware.d.ts +0 -30
  100. package/dist/reducers/ReducerBuilderManager.d.ts +0 -19
  101. package/dist/reducers/data.d.ts +0 -4
  102. package/dist/reducers/depthData.d.ts +0 -4
  103. package/dist/reducers/index.d.ts +0 -6
  104. package/dist/reducers/router.d.ts +0 -9
  105. package/dist/reducers/screen.d.ts +0 -10
  106. package/dist/reducers/session.d.ts +0 -10
  107. package/dist/reducers/view.d.ts +0 -10
  108. package/dist/utils/api.d.ts +0 -25
  109. package/dist/utils/apiError.d.ts +0 -19
  110. package/dist/utils/autosave.d.ts +0 -37
  111. package/dist/utils/bc.d.ts +0 -27
  112. package/dist/utils/breadthFirst.d.ts +0 -21
  113. package/dist/utils/cancelRequestEpic.d.ts +0 -27
  114. package/dist/utils/combineMiddlewares.d.ts +0 -3
  115. package/dist/utils/deleteUndefinedFromObject.d.ts +0 -1
  116. package/dist/utils/exportState.d.ts +0 -0
  117. package/dist/utils/extendPopupWidgetTypes.d.ts +0 -8
  118. package/dist/utils/filters.d.ts +0 -63
  119. package/dist/utils/hierarchy.d.ts +0 -17
  120. package/dist/utils/highlightJson.d.ts +0 -12
  121. package/dist/utils/history.d.ts +0 -50
  122. package/dist/utils/index.d.ts +0 -10
  123. package/dist/utils/operations.d.ts +0 -21
  124. package/dist/utils/others.d.ts +0 -6
  125. package/dist/utils/strings.d.ts +0 -44
  126. package/dist/utils/tree.d.ts +0 -43
  127. package/dist/utils/viewTabs.d.ts +0 -20
@@ -1,202 +0,0 @@
1
- import { WidgetMeta } from './widget';
2
- import { RowMeta } from './rowMeta';
3
- import { PendingDataItem, PickMap } from './data';
4
- import { SystemNotification } from './objectMap';
5
- import { OperationTypeCrud, OperationPostInvokeConfirm } from './operation';
6
- import { AxiosError } from 'axios';
7
- export { FieldType } from '@cxbox-ui/schema';
8
- export interface ViewSelectedCell {
9
- widgetName: string;
10
- rowId: string;
11
- fieldKey: string;
12
- }
13
- export interface PendingValidationFails {
14
- [bcName: string]: {
15
- [cursor: string]: Record<string, string>;
16
- };
17
- }
18
- /**
19
- * Describes format of `pendingValidationFails`
20
- * TODO remove in 2.0.0
21
- */
22
- export declare enum PendingValidationFailsFormat {
23
- old = "old",
24
- target = "target"
25
- }
26
- export interface ViewState extends ViewMetaResponse {
27
- rowMeta: {
28
- [bcName: string]: {
29
- [bcUrl: string]: RowMeta;
30
- };
31
- };
32
- pendingDataChanges: {
33
- [bcName: string]: {
34
- [cursor: string]: PendingDataItem;
35
- };
36
- };
37
- handledForceActive: {
38
- [bcName: string]: {
39
- [cursor: string]: PendingDataItem;
40
- };
41
- };
42
- metaInProgress: {
43
- [bcName: string]: boolean;
44
- };
45
- popupData?: PopupData;
46
- infiniteWidgets?: string[];
47
- pickMap?: PickMap;
48
- selectedCell?: ViewSelectedCell;
49
- systemNotifications?: SystemNotification[];
50
- error?: ApplicationError;
51
- /**
52
- * For backward compatibility
53
- *
54
- * `old` describes `pendingValidationFails` as `Record<string, string>`
55
- * `target` describes `pendingValidationFails` as `PendingValidationFails`
56
- */
57
- pendingValidationFailsFormat?: PendingValidationFailsFormat.old | PendingValidationFailsFormat.target;
58
- pendingValidationFails?: Record<string, string> | PendingValidationFails;
59
- modalInvoke?: {
60
- operation: {
61
- bcName: string;
62
- operationType: OperationTypeCrud | string;
63
- widgetName: string;
64
- };
65
- confirmOperation: OperationPostInvokeConfirm;
66
- };
67
- }
68
- /**
69
- * View description returned by Cxbox API
70
- */
71
- export interface ViewMetaResponse {
72
- /**
73
- * @deprecated Deprecated in favor of `name`
74
- */
75
- id?: number;
76
- /**
77
- * Name of the view as specified in *.view.json file
78
- */
79
- name: string;
80
- /**
81
- * Displayed title
82
- */
83
- title?: string;
84
- /**
85
- * Specifies which layout template to use for the view
86
- *
87
- *Not used in Cxbox UI Core, but can used by client application
88
- */
89
- template?: string;
90
- /**
91
- * @deprecated Used for dynamic view layouts (configurable from user side), which are no longer implemented
92
- */
93
- customizable?: boolean;
94
- /**
95
- * @deprecated Not used
96
- */
97
- editable?: boolean;
98
- /**
99
- * Url for the view (usually in form of `${screen.name}/${view.name}`)
100
- */
101
- url: string;
102
- /**
103
- * Widgets present on the view
104
- */
105
- widgets: WidgetMeta[];
106
- /**
107
- * @deprecated Used for dynamic view layouts (configurable from user side), which are no longer implemented
108
- */
109
- columns?: number | null;
110
- /**
111
- * @deprecated Used for dynamic view layouts (configurable from user side), which are no longer implemented
112
- */
113
- rowHeight?: number | null;
114
- /**
115
- * Not used in Cxbox UI Core, but can be used by client application
116
- */
117
- readOnly?: boolean;
118
- /**
119
- * Not used in Cxbox UI Core
120
- *
121
- * TODO: Need description
122
- */
123
- ignoreHistory?: boolean;
124
- }
125
- export type PopupType = 'assoc' | 'file-upload' | null;
126
- /**
127
- * Describes currently open popup
128
- *
129
- * TODO: Split interface by popup types
130
- */
131
- export interface PopupData {
132
- /**
133
- * Business component of the widget that initiated popup
134
- *
135
- * TODO: Will me removed in favor of widgetName in 2.0.0
136
- */
137
- calleeBCName?: string;
138
- /**
139
- * Name of the widget that initiated popup
140
- */
141
- calleeWidgetName?: string;
142
- /**
143
- * Type of the popup
144
- *
145
- * TODO: Will not be optional in 2.0.0
146
- */
147
- type?: PopupType;
148
- /**
149
- * Business component for widget in Popup
150
- *
151
- * TODO: Move to inherited interfaces (not all popups display widgets)
152
- */
153
- bcName?: string;
154
- /**
155
- * Name of popup widget
156
- *
157
- * TODO: Move to inherited interfaces (not all popups display widgets)
158
- */
159
- widgetName?: string;
160
- /**
161
- * TODO: Description + move to AssocPopupDescriptor
162
- */
163
- associateFieldKey?: string;
164
- /**
165
- * TODO: Description + move to AssocPopupDescriptor
166
- */
167
- assocValueKey?: string;
168
- /**
169
- * If true popup confirm button will send selected items to Cxbox API
170
- *
171
- * TODO: Move to AssocPopupDescriptor
172
- */
173
- active?: boolean;
174
- /**
175
- * This popup is used as a filter
176
- *
177
- * TODO: Used only by assocs so probably move to AssocPopupDescriptor
178
- */
179
- isFilter?: boolean;
180
- }
181
- export type ApplicationError = BusinessError | SystemError | ApplicationErrorBase;
182
- export declare enum ApplicationErrorType {
183
- BusinessError = 0,
184
- SystemError = 1,
185
- NetworkError = 2
186
- }
187
- export interface ApplicationErrorBase {
188
- type: ApplicationErrorType;
189
- code?: number;
190
- }
191
- export interface BusinessError extends ApplicationErrorBase {
192
- type: ApplicationErrorType.BusinessError;
193
- message: string;
194
- }
195
- export interface SystemError extends ApplicationErrorBase {
196
- type: ApplicationErrorType.SystemError;
197
- error?: AxiosError;
198
- details: string;
199
- }
200
- export interface NetworkError extends ApplicationErrorBase {
201
- type: ApplicationErrorType.NetworkError;
202
- }
@@ -1,209 +0,0 @@
1
- import { WidgetShowCondition, WidgetTypes, WidgetOptions, WidgetFormField, WidgetListField, WidgetInfoField } from '@cxbox-ui/schema';
2
- import { ComponentType } from 'react';
3
- export type { WidgetOptions, WidgetShowCondition, LayoutRow, LayoutCol, WidgetOperations, TableOperations, WidgetTableHierarchy, WidgetFieldBase, WidgetListFieldBase, WidgetFormFieldBase, AllWidgetTypeFieldBase, NumberFieldMeta, DateFieldMeta, CheckboxFieldMeta, DateTimeFieldMeta, DateTimeWithSecondsFieldMeta, DictionaryFieldMeta, TextFieldMeta, InputFieldMeta, MultiFieldMeta, MultivalueFieldMeta, PickListFieldMeta, InlinePickListFieldMeta, FileUploadFieldMeta, WidgetFormField, WidgetListField, HiddenFieldMeta, RadioButtonFieldMeta, WidgetField, WidgetInfoField } from '@cxbox-ui/schema';
4
- export { WidgetTypes, PositionTypes } from '@cxbox-ui/schema';
5
- /**
6
- * Different widget types that are considered `tables` in nature for purposes of applying some shared features.
7
- * For example, autofocus on missing required field should work for tables but not forms.
8
- *
9
- * TODO: Make extension point
10
- *
11
- * @category Components
12
- */
13
- export declare const TableLikeWidgetTypes: readonly [WidgetTypes.List, WidgetTypes.DataGrid, WidgetTypes.AssocListPopup, WidgetTypes.PickListPopup, WidgetTypes.FlatTree, WidgetTypes.FlatTreePopup];
14
- /**
15
- * Widgets that are considered `popups` and usually excluded from widgets layout grid
16
- */
17
- export declare const PopupWidgetTypes: string[];
18
- /**
19
- * All widget types that display table-like data.ts
20
- */
21
- type TableLikeWidgetType = (typeof TableLikeWidgetTypes)[number];
22
- export interface WidgetInfoOptions {
23
- fieldBorderBottom?: boolean;
24
- footer?: string;
25
- }
26
- export interface WidgetMeta {
27
- name: string;
28
- type: WidgetTypes | string;
29
- title: string;
30
- bcName: string;
31
- /**
32
- * Business components ancestors hierarchy
33
- *
34
- * TODO: Will be mandatory (but nullable) in 2.0.0
35
- *
36
- * It is declared in `WidgetDTO` of Cxbox API, can be null for widgets without
37
- * business component (headers, navigation tabs, etc.)
38
- */
39
- url?: string | null;
40
- position: number;
41
- limit?: number;
42
- gridWidth: number;
43
- fields: unknown[];
44
- options?: WidgetOptions;
45
- showCondition?: WidgetShowCondition;
46
- description?: string;
47
- }
48
- /**
49
- * Description of the list of fields of block type.
50
- *
51
- * @deprecated Used to create a block grouping of fields
52
- */
53
- export interface WidgetFieldBlock<T> {
54
- /**
55
- * Block ID
56
- */
57
- blockId: number;
58
- /**
59
- * Name of the block
60
- */
61
- name: string;
62
- /**
63
- * Fields contained in the block
64
- */
65
- fields: T[];
66
- /**
67
- * @deprecated TODO: Remove in 2.0.0, used to denote a new row in old layout system for forms
68
- */
69
- newRow?: boolean;
70
- /**
71
- * @deprecated TODO: Remove in 2.0.0, used to ...
72
- */
73
- break?: boolean;
74
- }
75
- export type WidgetFieldsOrBlocks<T> = Array<T | WidgetFieldBlock<T>>;
76
- /**
77
- * Configuration for widgets dislaying form data.ts
78
- */
79
- export interface WidgetFormMeta extends WidgetMeta {
80
- /**
81
- * Unambiguous marker for JSON file specifing widget type
82
- */
83
- type: WidgetTypes.Form;
84
- /**
85
- * Descriptor for fields or block of fields on the form
86
- */
87
- fields: WidgetFieldsOrBlocks<WidgetFormField>;
88
- }
89
- /**
90
- * Configuration for widgets displaying table-like data.ts
91
- */
92
- export interface WidgetTableMeta extends WidgetMeta {
93
- /**
94
- * Unambiguous marker for JSON file specifing widget type
95
- */
96
- type: TableLikeWidgetType;
97
- /**
98
- * Descriptor for table columns
99
- */
100
- fields: WidgetListField[];
101
- }
102
- /**
103
- * Configuration for widgets displaying read-only table data.ts
104
- */
105
- export interface WidgetInfoMeta extends WidgetMeta {
106
- /**
107
- * Unambiguous marker for JSON file specifying widget type
108
- */
109
- type: WidgetTypes.Info;
110
- /**
111
- * Descriptor for fields or block of fields on the form
112
- */
113
- fields: WidgetFieldsOrBlocks<WidgetInfoField>;
114
- /**
115
- * Options for customizing widget
116
- */
117
- options?: WidgetOptions & WidgetInfoOptions;
118
- }
119
- /**
120
- * Configuration for widgets displaying markdown text
121
- */
122
- export interface WidgetTextMeta extends WidgetMeta {
123
- /**
124
- * Unambiguous marker for JSON file specifying widget type
125
- */
126
- type: WidgetTypes.Text;
127
- /**
128
- * Text to display
129
- */
130
- description: string;
131
- /**
132
- * Title text
133
- */
134
- descriptionTitle: string;
135
- }
136
- /**
137
- * Options configuration for widgets displaying NavigationTabs
138
- */
139
- export interface NavigationOptions extends WidgetOptions {
140
- /**
141
- * Level of menu
142
- */
143
- navigationLevel?: number;
144
- }
145
- /**
146
- * Configuration for widgets displaying NavigationTabs
147
- */
148
- export interface NavigationWidgetMeta extends WidgetMeta {
149
- /**
150
- * Unambiguous marker for JSON file specifying widget type
151
- */
152
- type: WidgetTypes.NavigationTabs | WidgetTypes.ViewNavigation;
153
- /**
154
- * Options for customizing widget
155
- */
156
- options: NavigationOptions;
157
- }
158
- /**
159
- * A widget configuration of any known type
160
- */
161
- export type WidgetMetaAny = WidgetFormMeta | WidgetTableMeta | WidgetTextMeta | WidgetInfoMeta | NavigationWidgetMeta;
162
- /**
163
- * Component of custom widget
164
- *
165
- * @deprecated TODO: Remove in 2.0.0
166
- */
167
- export type CustomWidget = ComponentType<any>;
168
- /**
169
- * Configuration of custom widget
170
- */
171
- export interface CustomWidgetConfiguration {
172
- /**
173
- * Whether widget is popup
174
- */
175
- isPopup?: boolean;
176
- /**
177
- * Component of custom widget
178
- */
179
- component: ComponentType<any>;
180
- /**
181
- * Card of widget
182
- */
183
- card?: ComponentType<any> | null;
184
- }
185
- export type CustomWidgetDescriptor = CustomWidget | CustomWidgetConfiguration;
186
- /**
187
- * Check if descriptor is just a widget, or it has additional data.ts
188
- */
189
- export declare function isCustomWidget(descriptor: CustomWidgetDescriptor): descriptor is CustomWidget;
190
- /**
191
- * Checks whether @param descriptor is an instance of `CustomWidgetConfiguration`
192
- *
193
- * @param descriptor custom widget descriptor
194
- */
195
- export declare function isCustomWidgetConfiguration(descriptor: CustomWidgetDescriptor): descriptor is CustomWidgetConfiguration;
196
- /**
197
- * TODO
198
- *
199
- * @param item
200
- * @category Type Guards
201
- */
202
- export declare function isWidgetFieldBlock(item: any): item is WidgetFieldBlock<any>;
203
- /**
204
- * Type of pagination, either page numbers or "Load More" button
205
- */
206
- export declare enum PaginationMode {
207
- page = "page",
208
- loadMore = "loadMore"
209
- }
@@ -1,2 +0,0 @@
1
- import { Middleware } from 'redux';
2
- export declare const saveFormMiddleware: Middleware;
@@ -1,6 +0,0 @@
1
- export declare const middlewares: {
2
- autosave: import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>;
3
- requiredFields: import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>;
4
- preInvoke: import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>;
5
- popup: import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>;
6
- };
@@ -1,2 +0,0 @@
1
- import { Middleware } from 'redux';
2
- export declare const popupMiddleware: Middleware;
@@ -1,5 +0,0 @@
1
- /**
2
- * Process preInvoke operation before action sendOperation
3
- */
4
- import { Middleware } from 'redux';
5
- export declare const preInvokeAction: Middleware;
@@ -1,30 +0,0 @@
1
- /**
2
- * Handles validation of "required fields" for widget operations
3
- */
4
- import { Middleware } from 'redux';
5
- import { Operation, OperationGroup, PendingDataItem, RowMetaField, Store } from '../interfaces';
6
- import { DataItem } from '@cxbox-ui/schema';
7
- export declare const requiredFields: Middleware;
8
- /**
9
- * Check operations and operation groups for 'autoSaveBefore' flag (i.e. operation is validation-sensetive)
10
- *
11
- * @param operationType Key of operation to check
12
- * @param actions List of operations and/or operation groups
13
- */
14
- export declare function operationRequiresAutosave(operationType: string, actions: Array<Operation | OperationGroup>): boolean;
15
- /**
16
- * Check if required records fields have a falsy value.
17
- * "Falsy" stands for "undefined", "null", "", [] and {}.
18
- *
19
- * @param record Record to check
20
- * @param pendingChanges Pending record changes which could override record values
21
- * @param fieldsMeta
22
- */
23
- export declare function getRequiredFieldsMissing(record: DataItem, pendingChanges: PendingDataItem, fieldsMeta: RowMetaField[]): PendingDataItem;
24
- /**
25
- * Checks if `pendingValidationFails` is not empty
26
- *
27
- * @param store
28
- * @param bcName
29
- */
30
- export declare function hasPendingValidationFails(store: Store, bcName: string): boolean;
@@ -1,19 +0,0 @@
1
- import { ActionReducerMapBuilder, CaseReducer } from '@reduxjs/toolkit';
2
- import { Action, AnyAction } from 'redux';
3
- interface TypedActionCreator<Type extends string> {
4
- (...args: any[]): Action<Type>;
5
- type: Type;
6
- }
7
- type TypeGuard<T> = (value: any) => value is T;
8
- export declare class ReducerBuilderManager<State> {
9
- private reducers;
10
- private matchers;
11
- private defaultCaseReducer;
12
- addCase<ActionCreator extends TypedActionCreator<string>>(action: ActionCreator, reducer: CaseReducer<State, ReturnType<ActionCreator>>): this;
13
- removeCase<ActionCreator extends TypedActionCreator<string>>(action: ActionCreator): this;
14
- replaceCase<ActionCreator extends TypedActionCreator<string>>(action: ActionCreator, reducer: CaseReducer<State, ReturnType<ActionCreator>>): this;
15
- addMatcher<A>(matcher: TypeGuard<A> | ((action: any) => boolean), reducer: CaseReducer<State, A extends AnyAction ? A : A & AnyAction>): Omit<ReducerBuilderManager<State>, 'addCase'>;
16
- addDefaultCase(reducer: CaseReducer<State, AnyAction>): Omit<ReducerBuilderManager<State>, 'addCase' | 'addMatcher' | 'addDefaultCase'>;
17
- get builder(): (builder: ActionReducerMapBuilder<State>) => {};
18
- }
19
- export {};
@@ -1,4 +0,0 @@
1
- import { DataState } from '../interfaces';
2
- import { ReducerBuilderManager } from './ReducerBuilderManager';
3
- export declare const dataInitialState: DataState;
4
- export declare const createDataReducerBuilderManager: (initialState: DataState) => ReducerBuilderManager<DataState>;
@@ -1,4 +0,0 @@
1
- import { DepthDataState } from '../interfaces';
2
- import { ReducerBuilderManager } from './ReducerBuilderManager';
3
- export declare const initialDepthDataState: DepthDataState;
4
- export declare const createDepthDataReducerBuilderManager: (initialState: DepthDataState) => ReducerBuilderManager<DepthDataState>;
@@ -1,6 +0,0 @@
1
- export * from './data';
2
- export * from './depthData';
3
- export * from './router';
4
- export * from './screen';
5
- export * from './session';
6
- export * from './view';
@@ -1,9 +0,0 @@
1
- import { Route } from '../interfaces';
2
- import { ReducerBuilderManager } from './ReducerBuilderManager';
3
- export declare const initialRouterState: Route;
4
- /**
5
- * Router reducer
6
- *
7
- * Stores information about currently active route
8
- */
9
- export declare const createRouterReducerBuilderManager: <S extends Route>(initialState: S) => ReducerBuilderManager<S>;
@@ -1,10 +0,0 @@
1
- import { ScreenState } from '../interfaces';
2
- import { ReducerBuilderManager } from './ReducerBuilderManager';
3
- export declare const initialScreenState: ScreenState;
4
- /**
5
- * Screen reducer
6
- *
7
- * Stores information about currently active screen and various more persistent values which should be stored
8
- * until we navitage to a different screen.
9
- */
10
- export declare const createScreenReducerBuilderManager: <S extends ScreenState>(initialState: S) => ReducerBuilderManager<S>;
@@ -1,10 +0,0 @@
1
- import { Session } from '../interfaces';
2
- import { ReducerBuilderManager } from './ReducerBuilderManager';
3
- export declare const initialSessionState: Session;
4
- /**
5
- * Session reducer
6
- *
7
- * Stores information about currently active session and dataEpics.ts that should be persistent during all period of
8
- * user interaction with application.
9
- */
10
- export declare const createSessionReducerBuilderManager: <S extends Session>(initialState: S) => ReducerBuilderManager<S>;
@@ -1,10 +0,0 @@
1
- import { ViewState } from '../interfaces';
2
- import { ReducerBuilderManager } from './ReducerBuilderManager';
3
- export declare const initialViewState: ViewState;
4
- /**
5
- * View reducer
6
- *
7
- * Stores information about currently active view and various fast-living pending values which should be stored
8
- * until we navitage to a different view.
9
- */
10
- export declare const createViewReducerBuilderManager: <S extends ViewState>(initialState: S) => ReducerBuilderManager<S>;
@@ -1,25 +0,0 @@
1
- export interface ApiCallContext {
2
- widgetName: string;
3
- }
4
- type QueryParamsMap = Record<string, string | number>;
5
- /**
6
- * Extends url with query parameters control symbol (`?` or `&`)
7
- *
8
- * @param url Url with or without `?` symbol
9
- */
10
- export declare function addTailControlSequences(url: string): string;
11
- /**
12
- * Extends url with query parameters
13
- *
14
- * @param url Url to extend
15
- * @param qso Query parameters dictionary
16
- */
17
- export declare function applyParams(url: string, qso?: QueryParamsMap): string;
18
- /**
19
- * TODO
20
- *
21
- * @param url
22
- * @param qso
23
- */
24
- export declare function applyRawParams(url: string, qso: Record<string, any>): string;
25
- export {};
@@ -1,19 +0,0 @@
1
- import { AxiosError } from 'axios';
2
- interface ApiCallContext {
3
- widgetName: string;
4
- }
5
- export declare function createApiError(error: AxiosError, context?: ApiCallContext): {
6
- payload: {
7
- error: AxiosError<unknown, any>;
8
- callContext: import("./api").ApiCallContext;
9
- };
10
- type: string;
11
- };
12
- export declare function createApiErrorObservable(error: AxiosError, context?: ApiCallContext): import("rxjs").Observable<{
13
- payload: {
14
- error: AxiosError<unknown, any>;
15
- callContext: import("./api").ApiCallContext;
16
- };
17
- type: string;
18
- }>;
19
- export {};
@@ -1,37 +0,0 @@
1
- import { Store as CoreStore } from '../interfaces/store';
2
- import { AnyAction, Dispatch, MiddlewareAPI } from 'redux';
3
- /**
4
- * Performs mechanism of autosave
5
- *
6
- * @param action
7
- * @param store
8
- * @param next
9
- * @category Utils
10
- */
11
- export declare function autosaveRoutine(action: AnyAction, store: MiddlewareAPI<Dispatch<AnyAction>, CoreStore>, next: Dispatch): AnyAction | {
12
- payload: {
13
- bcName: string;
14
- operationType: string;
15
- widgetName: string;
16
- onSuccessAction?: AnyAction;
17
- confirm?: string;
18
- bcKey?: string;
19
- confirmOperation?: import("../interfaces/operation").OperationPreInvoke;
20
- };
21
- type: string;
22
- };
23
- /**
24
- * Checks presence of pending changes suitable for autosave
25
- *
26
- * @param store
27
- * @param bcName
28
- * @param cursor
29
- */
30
- export declare function bcHasPendingAutosaveChanges(store: CoreStore, bcName: string, cursor: string): boolean;
31
- /**
32
- * Checks presence of unsaved data.ts for specified BC
33
- *
34
- * @param store
35
- * @param bcName
36
- */
37
- export declare function checkUnsavedChangesOfBc(store: CoreStore, bcName: string): boolean;
@@ -1,27 +0,0 @@
1
- import { WidgetMeta, WidgetShowCondition } from '../interfaces/widget';
2
- import { BcMetaState } from '../interfaces/bc';
3
- import { DataItem, PendingDataItem } from '../interfaces/data';
4
- /**
5
- * Find all widgets referencing or descendant from specified origin BC
6
- *
7
- * @param originBcName Origin business component name
8
- * @param widgets Widgets to search through
9
- * @param bcMap Business components dictionary
10
- * @returns A dictionary of business components and widgets
11
- */
12
- export declare function getBcChildren(originBcName: string, widgets: WidgetMeta[], bcMap: Record<string, BcMetaState>): Record<string, string[]>;
13
- /**
14
- * Check specified show condition for the widget
15
- *
16
- * Condition is true (and widget is visible) if currently active record for condition business component has a value of the specific
17
- * field matching the condition; pending values are also enough for the condition to be true.
18
- * Condition is also true when it explicitly declared as default condition, if it's empty or of the legacy array format
19
- *
20
- * Otherwise the condition is false and the widget is hidden.
21
- *
22
- * @param condition Widget showCondition to check
23
- * @param cursor Id of active record for business component in condition
24
- * @param data An array of data.ts items to check for condition
25
- * @param pendingDataChanges Pending data.ts changes of the currently active view
26
- */
27
- export declare function checkShowCondition(condition: WidgetShowCondition | undefined, cursor: string, data: DataItem[], pendingDataChanges: Record<string, Record<string, PendingDataItem>>): boolean;
@@ -1,21 +0,0 @@
1
- /**
2
- * Search node matching the predicate on the current depth prior to moving to the next depth level
3
- *
4
- * @param root Tree root
5
- * @param predicate Search condition for the target tree node
6
- * @returns Matching node and a tree depth where this node was found
7
- */
8
- export declare function breadthFirstSearch<T>(root: T, predicate: (current: any) => boolean, depth?: number, childrenProperty?: keyof T): BreadthFirstResult<T>;
9
- /**
10
- * Bredth-first search result
11
- */
12
- export interface BreadthFirstResult<T> {
13
- /**
14
- * Matching node
15
- */
16
- node: T;
17
- /**
18
- * Tree depth where this node was found
19
- */
20
- depth: number;
21
- }