@cxbox-ui/core 2.0.0-alpha.8 → 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 -3692
  11. package/dist/cxbox-ui-core.cjs.production.min.js +0 -2
  12. package/dist/cxbox-ui-core.esm.js +0 -3656
  13. package/dist/cxbox-ui-core.modern.development.js +0 -3586
  14. package/dist/cxbox-ui-core.modern.js +0 -3586
  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,336 +0,0 @@
1
- import { DrillDownType } from './router';
2
- import { AppNotificationType } from './objectMap';
3
- import { DataItem } from './data';
4
- import { OperationTypeCrud, OperationType } from '@cxbox-ui/schema';
5
- export type { OperationType, OperationInclusionDescriptor } from '@cxbox-ui/schema';
6
- export { OperationTypeCrud };
7
- export declare const coreOperations: OperationTypeCrud[];
8
- /**
9
- *
10
- * @param operation
11
- */
12
- export declare function isOperationGroup(operation: Operation | OperationGroup): operation is OperationGroup;
13
- /**
14
- * User operation: CRUD or any custom business action.
15
- *
16
- * Received from record's row meta.
17
- */
18
- export interface Operation {
19
- /**
20
- * Displayed name
21
- */
22
- text: string;
23
- /**
24
- * String that uniquely identifies an operation on widget
25
- */
26
- type: OperationType;
27
- /**
28
- * A hint to decide where to display an operation which is related to the record or the whole widget
29
- */
30
- scope: OperationScope;
31
- /**
32
- * @deprecated TODO: Remove in 2.0.0, designation unknown
33
- */
34
- action?: string;
35
- /**
36
- * An icon (https://ant.design/components/icon) to display on operation button,
37
- */
38
- icon?: string;
39
- /**
40
- * @deprecated TODO: Remove in 2.0.0 in favor of client-side custom parameters
41
- */
42
- bcKey?: string;
43
- /**
44
- * Omit text value of operation in favor of icon
45
- */
46
- showOnlyIcon?: boolean;
47
- /**
48
- * An operation that should be fired before initiating this operation
49
- */
50
- preInvoke?: OperationPreInvoke;
51
- /**
52
- * Validate the record for empty "required" fields before API call
53
- */
54
- autoSaveBefore?: boolean;
55
- /**
56
- * ???
57
- */
58
- confirmOperation?: OperationPreInvoke;
59
- /**
60
- * If custom operation needs to be processed as if it was a default crud operation,
61
- * this flag can be specified and will be used instead of real `type`
62
- */
63
- actionRole?: OperationType;
64
- /**
65
- * Subtype for association popup, used for calling multiFileUploadPopup,
66
- * else has default behaviour of assoc popup
67
- */
68
- subtype?: 'bc' | 'multiFileUpload';
69
- }
70
- /**
71
- * Group of actions.
72
- *
73
- * It shows name of a group, drop down list of actions
74
- * and some actions which are shown in case list is covered.
75
- * Группа действий, показывает название группы и раскрываемые список ее действий,
76
- * а также несколько действий рядом с группой, которые видны не раскрывая список.
77
- */
78
- export interface OperationGroup {
79
- /**
80
- * Unique identifier for the operation group
81
- */
82
- type?: string;
83
- /**
84
- * Displayed name of a group
85
- */
86
- text: string;
87
- /**
88
- * An icon (https://ant.design/components/icon) to display on operation button,
89
- */
90
- icon?: string;
91
- /**
92
- * Omit text value of operation in favor of icon
93
- */
94
- showOnlyIcon?: boolean;
95
- /**
96
- * List of group actions
97
- */
98
- actions: Operation[];
99
- /**
100
- * Number of showed actions in case list is covered
101
- */
102
- maxGroupVisualButtonsCount: number;
103
- }
104
- /**
105
- * An action which fires before user's operation
106
- */
107
- export interface OperationPreInvoke {
108
- /**
109
- * A type of operation (Pop-up message. Other types are not supported)
110
- */
111
- type: OperationPreInvokeType;
112
- /**
113
- * A message shown to user before operation fires
114
- */
115
- message: string;
116
- }
117
- /**
118
- * A type of message shown to user before operation fires
119
- */
120
- export declare enum OperationPreInvokeType {
121
- /**
122
- * Pop-up message contains "Yes/No" answers.
123
- * If user says "Yes" then operation fires
124
- */
125
- confirm = "confirm",
126
- /**
127
- * Pop-up message contains some informational text with info icon
128
- */
129
- info = "info",
130
- /**
131
- * Pop-up message contains some information about error with error icon
132
- * Перед операцией пользователя будет показано всплывающее сообщение
133
- * с иконкой ошибки и операция не будет выполнена (TODO: Будет или не будет? Проверить)
134
- */
135
- error = "error"
136
- }
137
- /**
138
- * A type of action which fires after user's operation
139
- */
140
- export declare enum OperationPostInvokeType {
141
- /**
142
- * BC's refresh. It leads to cursor dropping, data.ts refresh of current BC and its children
143
- */
144
- refreshBC = "refreshBC",
145
- /**
146
- * File downloading by `fileId` which comes from answer to user's operation.
147
- * Вызов сохранения файла в браузере по пришедшему в ответе fileId
148
- */
149
- downloadFile = "downloadFile",
150
- /**
151
- * File downloading by `url` which comes from answer to user's operation.
152
- * Вызов сохранения файла в браузере по пришедшему в ответе url
153
- */
154
- downloadFileByUrl = "downloadFileByUrl",
155
- /**
156
- * Calling a browser transition to some record
157
- */
158
- drillDown = "drillDown",
159
- /**
160
- * `Pick list` widget opening
161
- */
162
- openPickList = "openPickList",
163
- /**
164
- * @deprecated TODO: Не работает, удалить все упоминания из Досье и убрать всех свидетелей
165
- *
166
- */
167
- /**
168
- * Showing pop-up message
169
- */
170
- showMessage = "showMessage",
171
- /**
172
- * Инициировать удаление записей
173
- *
174
- * @deprecated TODO: Remove in 2.0.0
175
- */
176
- postDelete = "postDelete"
177
- }
178
- /**
179
- * The type of message that will be shown to the user for confirmation
180
- */
181
- export declare enum OperationPostInvokeConfirmType {
182
- /**
183
- * Simple confirmation
184
- */
185
- confirm = "confirm",
186
- /**
187
- * Сonfirmation with text from the user
188
- */
189
- confirmText = "confirmText"
190
- }
191
- /**
192
- * The action that will be performed after the user confirms it
193
- */
194
- export interface OperationPostInvokeConfirm {
195
- /**
196
- * Type of postInvokeConfirm action
197
- */
198
- type: OperationPostInvokeConfirmType | string;
199
- /**
200
- * Body text of a modal actually
201
- * TODO 2.0.0 rename correctly
202
- */
203
- message: string;
204
- /**
205
- * Custom modal title actually
206
- * TODO 2.0.0 rename correctly
207
- */
208
- messageContent?: string;
209
- /**
210
- * Custom label of OK button
211
- */
212
- okText?: string;
213
- /**
214
- * Custom label of Cancel button
215
- */
216
- cancelText?: string;
217
- }
218
- /**
219
- * Modal window operation types
220
- */
221
- export interface OperationModalInvokeConfirm extends OperationPostInvokeConfirm {
222
- /**
223
- * Type of confirm action
224
- */
225
- type: OperationPostInvokeConfirmType | OperationPreInvokeType | string;
226
- }
227
- /**
228
- * An action which fires after user's operation
229
- *
230
- * @param bc Имя бизнес-компоненты, которую надо обновлять при refreshBC
231
- * @param fileId Идентификатор файла, который надо скачать при downloadFile
232
- * @param url?
233
- *
234
- * @param [key: string] ??? TODO: Это что?
235
- */
236
- export interface OperationPostInvoke {
237
- /**
238
- * A type of action
239
- */
240
- type: OperationPostInvokeType | string;
241
- }
242
- /**
243
- * BC's refresh. It leads to cursor dropping, data.ts refresh of current BC and its children
244
- */
245
- export interface OperationPostInvokeRefreshBc extends OperationPostInvoke {
246
- /**
247
- * BC's name
248
- */
249
- bc: string;
250
- }
251
- /**
252
- * File downloading by `fileId` which comes from answer.
253
- */
254
- export interface OperationPostInvokeDownloadFile extends OperationPostInvoke {
255
- /**
256
- * Backend's file ID
257
- */
258
- fileId: string;
259
- }
260
- /**
261
- * File downloading by `url` which comes from answer.
262
- */
263
- export interface OperationPostInvokeDownloadFileByUrl extends OperationPostInvoke {
264
- /**
265
- * File's URL
266
- */
267
- url: string;
268
- }
269
- /**
270
- * Calling a browser transition to some record
271
- *
272
- * @param urlName При выполнении перехода на внешнюю сущность (POST-запрос на пришедший url),
273
- * этот адрес будет передан в теле запроса (см. CBR-9320 МР и тикет)
274
- */
275
- export interface OperationPostInvokeDrillDown extends OperationPostInvoke {
276
- /**
277
- * URL of transition
278
- */
279
- url: string;
280
- /**
281
- * A type of transition
282
- */
283
- drillDownType?: DrillDownType;
284
- /**
285
- * If transition performs to outer entity (POST call),
286
- * this param will be passed to request body
287
- */
288
- urlName?: string;
289
- }
290
- /**
291
- * `Pick list` widget opening
292
- */
293
- export interface OperationPostInvokeOpenPickList extends OperationPostInvoke {
294
- /**
295
- * BC name of pick list widget
296
- */
297
- pickList: string;
298
- }
299
- /**
300
- * Pop-up message showing
301
- */
302
- export interface OperationPostInvokeShowMessage extends OperationPostInvoke {
303
- /**
304
- * A type of a message
305
- */
306
- messageType: AppNotificationType;
307
- /**
308
- * A text of a message
309
- */
310
- messageText: string;
311
- }
312
- /**
313
- * A union of all action types which could be be fired after user's operation
314
- */
315
- export type OperationPostInvokeAny = OperationPostInvokeRefreshBc | OperationPostInvokeDownloadFile | OperationPostInvokeDownloadFileByUrl | OperationPostInvokeDrillDown | OperationPostInvokeOpenPickList | OperationPostInvokeShowMessage | OperationPostInvokeConfirm;
316
- /**
317
- * TODO: ???
318
- */
319
- export type OperationScope = 'bc' | 'record' | 'page' | 'associate';
320
- export interface AssociatedItem extends DataItem {
321
- _associate: boolean;
322
- }
323
- export interface OperationError {
324
- success: false;
325
- error: {
326
- entity?: OperationErrorEntity;
327
- popup?: string[];
328
- postActions?: OperationPostInvokeAny[];
329
- };
330
- }
331
- export interface OperationErrorEntity {
332
- bcName: string;
333
- fields: Record<string, string>;
334
- id: string;
335
- }
336
- export type RequestType = 'data' | 'row-meta' | 'force-active';
@@ -1,17 +0,0 @@
1
- export { DrillDownType } from '@cxbox-ui/schema';
2
- export interface Route {
3
- type: RouteType;
4
- path: string;
5
- search: string;
6
- params: Record<string, unknown>;
7
- screenName?: string;
8
- viewName?: string;
9
- bcPath?: string;
10
- }
11
- export declare enum RouteType {
12
- screen = "screen",
13
- default = "default",
14
- router = "router",
15
- invalid = "invalid",
16
- unknown = "unknown"
17
- }
@@ -1,74 +0,0 @@
1
- import { CxboxResponse } from './objectMap';
2
- import { Operation, OperationGroup, OperationPostInvokeAny } from './operation';
3
- import { DataValue } from './data';
4
- /**
5
- * Мета записи, содержит информацию:
6
- *
7
- * @param actions о действиях, которые с ней можно совершить
8
- * @param fields о полях, которые есть в этой записи
9
- * @param errors об ошибках, если запись не проходит валидацию бэка
10
- *
11
- * TODO: По смыслу тут должно быть название DataItemMeta
12
- */
13
- export interface RowMeta {
14
- actions: Array<Operation | OperationGroup>;
15
- fields: RowMetaField[];
16
- errors?: Record<string, string>;
17
- }
18
- export interface RowMetaResponse extends CxboxResponse {
19
- data: {
20
- row: RowMeta;
21
- postActions?: OperationPostInvokeAny[];
22
- };
23
- }
24
- /**
25
- * Мета поля, которую предоставляет мета записи.
26
- * Описывает разную дополнительную информацию о поле, которая не связана
27
- * с конкретной записью или с конкретным виджетом.
28
- *
29
- * @param key - ключ поля, уникально его идентифицирующий (см. DataItem [fieldName: string])
30
- * @param currentValue - актуальное значение на бэке, присылаемое на случай конфликтов совместного изменения
31
- * @param disabled - доступно ли поле для редактирования
32
- * @param placeholder - hint for filling the field
33
- * @param ephemeral - при любой операции поле будет отправляться на бэк, даже если не изменялось
34
- * @param hidden - поле не видно пользователю
35
- * @param required - поле обязательно для заполнения
36
- * @param forceActive - любое изменение этого поля пользователем должно инициировать запрос новой меты записи
37
- * @param drillDown - адрес, по которому поле позволяет осуществить переход
38
- * @param drillDownType - как будет обработан переход по адресу в браузере
39
- * @param drillDownKey - ключ для получения адреса из данных
40
- * @param values TODO:
41
- * @param filterValues TODO:
42
- * @param filterable - можно ли фильтровать записи по этому полю
43
- */
44
- export interface RowMetaField {
45
- key: string;
46
- defaultValue?: DataValue;
47
- currentValue: DataValue;
48
- disabled?: boolean;
49
- placeholder?: string;
50
- ephemeral?: boolean;
51
- hidden?: boolean;
52
- required?: boolean;
53
- forceActive?: boolean;
54
- /**
55
- * @deprecated
56
- * Флаг, определяющий надо ли устанавливать значение переданное в forceValue
57
- * TODO: В Досье не используется, проверить на бэке и удалить
58
- */
59
- setForced?: boolean;
60
- drillDown?: string;
61
- drillDownType?: string;
62
- /**
63
- * @deprecated
64
- * TODO: В Досье не используется, проверить на бэке и удалить
65
- */
66
- values?: Array<{
67
- value: string;
68
- icon: string;
69
- }>;
70
- filterValues?: Array<{
71
- value: string;
72
- }>;
73
- filterable?: boolean;
74
- }
@@ -1,28 +0,0 @@
1
- import { ViewMetaResponse } from '../interfaces/view';
2
- import { BcMeta, BcMetaState } from '../interfaces/bc';
3
- import { BcFilter, BcSorter } from '../interfaces/filters';
4
- import { ViewNavigationGroup, ViewNavigationItem } from '../interfaces/navigation';
5
- export interface ScreenMetaResponse {
6
- bo: {
7
- bc: BcMeta[];
8
- };
9
- views: ViewMetaResponse[];
10
- primary?: string;
11
- navigation?: {
12
- menu: Array<ViewNavigationGroup | ViewNavigationItem>;
13
- };
14
- }
15
- export interface ScreenState {
16
- screenName: string;
17
- bo: {
18
- activeBcName: string;
19
- bc: Record<string, BcMetaState>;
20
- };
21
- cachedBc: {
22
- [bcName: string]: string;
23
- };
24
- views: ViewMetaResponse[];
25
- primaryView: string;
26
- filters: Record<string, BcFilter[]>;
27
- sorters: Record<string, BcSorter[]>;
28
- }
@@ -1,83 +0,0 @@
1
- import { ScreenMetaResponse } from './screen';
2
- import { CxboxResponse } from './objectMap';
3
- import { RequestType } from './operation';
4
- export interface UserRole {
5
- type: string;
6
- key: string;
7
- value: string;
8
- description: string;
9
- language: string;
10
- displayOrder: number;
11
- active: boolean;
12
- cacheLoaderName: string;
13
- }
14
- export type DefaultNotificationType = 'success' | 'error' | 'info' | 'warning';
15
- export interface Notification {
16
- key: string;
17
- type: DefaultNotificationType | string;
18
- message: string;
19
- description?: string;
20
- options?: {
21
- messageOptions?: {
22
- [key: string]: string | number;
23
- };
24
- buttonWarningNotificationOptions?: {
25
- buttonText: string;
26
- actionsForClick?: Array<Record<string, any>>;
27
- };
28
- };
29
- duration?: number;
30
- }
31
- export type NotificationKeys = string[];
32
- export interface Session {
33
- /**
34
- * Whether dev tools panel is shown
35
- */
36
- devPanelEnabled?: boolean;
37
- activeRole?: string;
38
- roles?: UserRole[];
39
- /**
40
- * Shows if debug mode is enabled
41
- */
42
- debugMode?: boolean;
43
- /**
44
- * Enables availability of saving redux store and other info on user device.
45
- * There is need to set it to `true` from client application.
46
- */
47
- exportStateEnabled?: boolean;
48
- firstName?: string;
49
- lastName?: string;
50
- login?: string;
51
- active: boolean;
52
- logout: boolean;
53
- screens: SessionScreen[];
54
- loginSpin: boolean;
55
- errorMsg?: string;
56
- pendingRequests?: PendingRequest[];
57
- notifications: Notification[];
58
- isMetaRefreshing: boolean;
59
- }
60
- export interface LoginResponse extends CxboxResponse {
61
- devPanelEnabled?: boolean;
62
- activeRole?: string;
63
- roles?: UserRole[];
64
- firstName?: string;
65
- lastName?: string;
66
- login?: string;
67
- screens: SessionScreen[];
68
- }
69
- export interface SessionScreen {
70
- id: string;
71
- name: string;
72
- text: string;
73
- url: string;
74
- primary?: string;
75
- defaultScreen?: boolean;
76
- meta?: ScreenMetaResponse;
77
- icon?: string;
78
- notification?: number;
79
- }
80
- export interface PendingRequest {
81
- requestId: string;
82
- type: RequestType;
83
- }
@@ -1,14 +0,0 @@
1
- import { Route } from './router';
2
- import { Session } from './session';
3
- import { ScreenState } from './screen';
4
- import { ViewState } from './view';
5
- import { DataState, DepthDataState } from './data';
6
- export interface Store {
7
- router: Route;
8
- session: Session;
9
- screen: ScreenState;
10
- view: ViewState;
11
- data: DataState;
12
- depthData: DepthDataState;
13
- [reducerName: string]: any;
14
- }
@@ -1,66 +0,0 @@
1
- import { DataItem } from './data';
2
- import { AssociatedItem } from './operation';
3
- export interface BaseDataNode {
4
- /**
5
- * Uniquely identifies record
6
- */
7
- id: string;
8
- }
9
- /**
10
- * Types for Tree-like structures (tree traversal, search, etc)
11
- */
12
- /**
13
- * Base type for tree-like structures in flat array form
14
- */
15
- export interface DataNode extends BaseDataNode {
16
- /**
17
- * String reference to a parent node
18
- */
19
- parentId: string;
20
- /**
21
- * The depth of the node counting from the root of the tree
22
- */
23
- level?: number;
24
- }
25
- /**
26
- * Cxbox-specific data.ts item that classifies as tree node
27
- */
28
- export type DataItemNode = DataNode & DataItem;
29
- /**
30
- * Base type for tree nodes that keep references to parent nodes
31
- */
32
- export interface TreeNodeAscending extends DataNode {
33
- /**
34
- * Reference to parent node
35
- */
36
- parent: TreeNodeAscending;
37
- }
38
- /**
39
- * Base type for tree nodes that keep references to children nodes
40
- */
41
- export interface TreeNodeDescending extends BaseDataNode {
42
- /**
43
- * An array of references to children nodes
44
- */
45
- children?: TreeNodeDescending[];
46
- }
47
- /**
48
- * Base type for tree nodes that keep references both to the parent and children nodes
49
- */
50
- export interface TreeNodeBidirectional extends DataNode {
51
- /**
52
- * Reference to the parent
53
- */
54
- parent: TreeNodeBidirectional;
55
- /**
56
- * An array of children
57
- */
58
- children?: TreeNodeBidirectional[];
59
- }
60
- export type TreeAssociatedRecord = DataNode & AssociatedItem;
61
- /**
62
- * Tree node that keeps a status if it is expanded (i.e. children also should be displayed)
63
- */
64
- export type TreeNodeCollapsable<T extends TreeNodeBidirectional = TreeNodeBidirectional> = T & {
65
- _expanded: boolean;
66
- };