@cxbox-ui/core 1.34.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 (335) hide show
  1. package/CONTRIBUTING.md +124 -0
  2. package/LICENSE +201 -0
  3. package/Provider.d.ts +63 -0
  4. package/README.md +82 -0
  5. package/actions/actions-utils.d.ts +48 -0
  6. package/actions/actions.d.ts +1132 -0
  7. package/actions/index.d.ts +2 -0
  8. package/api/api.d.ts +148 -0
  9. package/api/index.d.ts +1 -0
  10. package/assets/i18n/__tests__/getTextAssets.d.ts +1 -0
  11. package/assets/i18n/index.d.ts +25 -0
  12. package/components/ColumnTitle/ColumnFilter.d.ts +47 -0
  13. package/components/ColumnTitle/ColumnSort.d.ts +26 -0
  14. package/components/ColumnTitle/ColumnTitle.d.ts +31 -0
  15. package/components/ColumnTitle/__tests__/ColumnFilter.test.d.ts +1 -0
  16. package/components/ColumnTitle/__tests__/ColumnSort.test.d.ts +1 -0
  17. package/components/ColumnTitle/__tests__/ColumnTitle.test.d.ts +1 -0
  18. package/components/DebugPanel/DebugPanel.d.ts +7 -0
  19. package/components/DebugPanel/__tests__/DebugPanel.test.d.ts +1 -0
  20. package/components/DebugPanel/components/FormattedJSON.d.ts +6 -0
  21. package/components/DebugPanel/components/InfoLabel.d.ts +7 -0
  22. package/components/DebugPanel/components/ViewInfoLabel.d.ts +3 -0
  23. package/components/DebugPanel/components/WidgetInfoLabel.d.ts +5 -0
  24. package/components/DebugPanel/components/__tests__/FormattedJSON.test.d.ts +1 -0
  25. package/components/DebugPanel/components/__tests__/InfoLabel.test.d.ts +1 -0
  26. package/components/DebugPanel/components/__tests__/ViewInfoLabel.test.d.ts +1 -0
  27. package/components/DebugPanel/components/__tests__/WidgetInfoLabel.test.d.ts +1 -0
  28. package/components/DevToolsPanel/DevToolsPanel.d.ts +10 -0
  29. package/components/DevToolsPanel/DevToolsPanel.test.d.ts +1 -0
  30. package/components/DevToolsPanel/components/DebugModeButton.d.ts +9 -0
  31. package/components/DevToolsPanel/components/RefreshMetaButton.d.ts +9 -0
  32. package/components/DevToolsPanel/components/__tests__/DebugModeButton.test.d.ts +1 -0
  33. package/components/DevToolsPanel/components/__tests__/RefreshMetaButton.test.d.ts +1 -0
  34. package/components/Field/Field.d.ts +72 -0
  35. package/components/Field/Field.test.d.ts +1 -0
  36. package/components/FileUpload/FileUpload.d.ts +32 -0
  37. package/components/FileUploadPopup/FileUploadPopup.d.ts +10 -0
  38. package/components/FilterPopup/FilterPopup.d.ts +26 -0
  39. package/components/FilterPopup/FilterPopup.test.d.ts +1 -0
  40. package/components/FullHierarchyTable/FullHierarchyTable.d.ts +52 -0
  41. package/components/FullHierarchyTable/FullHierarchyTable.test.d.ts +1 -0
  42. package/components/FullHierarchyTable/utils/hierarchySearchCache.d.ts +37 -0
  43. package/components/FullHierarchyTable/utils/hierarchySearchCache.test.d.ts +1 -0
  44. package/components/FullHierarchyTable/utils/useExpandedKeys.d.ts +19 -0
  45. package/components/FullHierarchyTable/utils/useHierarchyCache.d.ts +12 -0
  46. package/components/HierarchyTable/HierarchyTable.d.ts +47 -0
  47. package/components/HierarchyTable/HierarchyTable.test.d.ts +1 -0
  48. package/components/InlinePickList/InlinePickList.d.ts +23 -0
  49. package/components/ModalInvoke/ModalInvoke.d.ts +18 -0
  50. package/components/ModalInvoke/ModalInvoke.test.d.ts +1 -0
  51. package/components/Multivalue/MultiValueListRecord.d.ts +15 -0
  52. package/components/Multivalue/MultivalueField.d.ts +31 -0
  53. package/components/Multivalue/MultivalueField.test.d.ts +1 -0
  54. package/components/PickListField/PickListField.d.ts +25 -0
  55. package/components/RowOperations/RowOperationsButton.d.ts +42 -0
  56. package/components/RowOperations/RowOperationsMenu.d.ts +29 -0
  57. package/components/RowOperations/__tests__/RowOperationsButton.test.d.ts +1 -0
  58. package/components/RowOperations/__tests__/RowOperationsMenu.test.d.ts +1 -0
  59. package/components/SameBcHierarchyTable/SameBcHierarchyTable.d.ts +40 -0
  60. package/components/TemplatedTitle/TemplatedTitle.d.ts +20 -0
  61. package/components/View/View.d.ts +26 -0
  62. package/components/View/__tests__/View.test.d.ts +1 -0
  63. package/components/Widget/Widget.d.ts +28 -0
  64. package/components/Widget/Widget.test.d.ts +1 -0
  65. package/components/WidgetErrorBoundary/WidgetErrorBoundary.d.ts +20 -0
  66. package/components/WidgetErrorBoundary/WidgetErrorBoundary.test.d.ts +1 -0
  67. package/components/WidgetErrorBoundary/components/RefreshButton.d.ts +4 -0
  68. package/components/WidgetErrorBoundary/components/RefreshButton.test.d.ts +1 -0
  69. package/components/index.d.ts +44 -0
  70. package/components/ui/ActionLink/ActionLink.d.ts +11 -0
  71. package/components/ui/CheckboxFilter/CheckboxFilter.d.ts +21 -0
  72. package/components/ui/CheckboxFilter/CheckboxFilter.test.d.ts +1 -0
  73. package/components/ui/CheckboxPicker/CheckboxPicker.d.ts +21 -0
  74. package/components/ui/CopyableText/CopyableText.d.ts +7 -0
  75. package/components/ui/CopyableText/__tests__/CopyableText.test.d.ts +1 -0
  76. package/components/ui/DashboardLayout/DashboardLayout.d.ts +21 -0
  77. package/components/ui/DashboardLayout/__tests__/DashboardLayout.test.d.ts +1 -0
  78. package/components/ui/DatePickerField/DatePickerField.d.ts +25 -0
  79. package/components/ui/Dictionary/Dictionary.d.ts +30 -0
  80. package/components/ui/Dictionary/Dictionary.test.d.ts +1 -0
  81. package/components/ui/ErrorPopup/ErrorPopup.d.ts +18 -0
  82. package/components/ui/ErrorPopup/ErrorPopup.test.d.ts +1 -0
  83. package/components/ui/FilterField/FilterField.d.ts +25 -0
  84. package/components/ui/FilterField/FilterField.test.d.ts +1 -0
  85. package/components/ui/FilterField/components/RangePicker.d.ts +11 -0
  86. package/components/ui/FilterField/components/RangePicker.test.d.ts +1 -0
  87. package/components/ui/HistoryField/HistoryField.d.ts +15 -0
  88. package/components/ui/InteractiveInput/InteractiveInput.d.ts +28 -0
  89. package/components/ui/Link/Link.d.ts +13 -0
  90. package/components/ui/MultiField/MultiField.d.ts +16 -0
  91. package/components/ui/Multivalue/MultivalueHover.d.ts +15 -0
  92. package/components/ui/Multivalue/MultivalueList.d.ts +17 -0
  93. package/components/ui/Multivalue/MultivalueTag.d.ts +24 -0
  94. package/components/ui/NavigationTabs/NavigationTabs.d.ts +7 -0
  95. package/components/ui/NavigationTabs/NavigationTabs.test.d.ts +1 -0
  96. package/components/ui/NumberInput/NumberInput.d.ts +17 -0
  97. package/components/ui/NumberInput/NumberInput.test.d.ts +1 -0
  98. package/components/ui/NumberInput/formaters.d.ts +31 -0
  99. package/components/ui/Pagination/Pagination.d.ts +51 -0
  100. package/components/ui/Pagination/Pagination.test.d.ts +1 -0
  101. package/components/ui/PickInput/PickInput.d.ts +15 -0
  102. package/components/ui/Popup/Popup.d.ts +29 -0
  103. package/components/ui/Popup/Popup.test.d.ts +1 -0
  104. package/components/ui/Popup/PopupFooter.d.ts +16 -0
  105. package/components/ui/RadioButton/RadioButton.d.ts +16 -0
  106. package/components/ui/RadioButton/RadioButton.test.d.ts +1 -0
  107. package/components/ui/ReadOnlyField/ReadOnlyField.d.ts +22 -0
  108. package/components/ui/SearchHightlight/SearchHightlight.d.ts +20 -0
  109. package/components/ui/Select/Select.d.ts +26 -0
  110. package/components/ui/TextArea/TextArea.d.ts +24 -0
  111. package/components/ui/TextArea/TextArea.test.d.ts +1 -0
  112. package/components/ui/TreeVirtualized/TreeVirtualized.d.ts +63 -0
  113. package/components/ui/TreeVirtualized/TreeVirtualizedNode.d.ts +67 -0
  114. package/components/ui/TreeVirtualized/__tests__/TreeVirtualized.test.d.ts +1 -0
  115. package/components/ui/TreeVirtualized/__tests__/TreeVirtualizedNode.test.d.ts +1 -0
  116. package/components/ui/TreeVirtualized/__tests__/useMatchingNodes.test.d.ts +1 -0
  117. package/components/ui/TreeVirtualized/__tests__/useSearchResult.test.d.ts +1 -0
  118. package/components/ui/TreeVirtualized/useMatchingNodes.d.ts +23 -0
  119. package/components/ui/TreeVirtualized/useSearchResult.d.ts +27 -0
  120. package/components/widgets/AssocListPopup/AssocListPopup.d.ts +58 -0
  121. package/components/widgets/AssocListPopup/AssocListPopup.test.d.ts +1 -0
  122. package/components/widgets/AssocListPopup/AssocTable.d.ts +35 -0
  123. package/components/widgets/AssocListPopup/AssocTable.test.d.ts +1 -0
  124. package/components/widgets/FlatTree/FlatTree.d.ts +53 -0
  125. package/components/widgets/FlatTree/FlatTreePopup.d.ts +31 -0
  126. package/components/widgets/FlatTree/__tests__/FlatTree.test.d.ts +1 -0
  127. package/components/widgets/FlatTree/__tests__/FlatTreePopup.test.d.ts +1 -0
  128. package/components/widgets/FlatTree/useMultipleSelect.d.ts +11 -0
  129. package/components/widgets/FlatTree/useSingleSelect.d.ts +10 -0
  130. package/components/widgets/FormWidget/FormWidget.d.ts +23 -0
  131. package/components/widgets/FormWidget/FormWidget.test.d.ts +1 -0
  132. package/components/widgets/InfoWidget/InfoWidget.d.ts +19 -0
  133. package/components/widgets/InfoWidget/__test__/InfoWidget.test.d.ts +1 -0
  134. package/components/widgets/InfoWidget/components/InfoCell.d.ts +15 -0
  135. package/components/widgets/InfoWidget/components/InfoRow.d.ts +16 -0
  136. package/components/widgets/InfoWidget/components/InfoValueWrapper.d.ts +10 -0
  137. package/components/widgets/InfoWidget/components/__tests__/InfoCell.test.d.ts +1 -0
  138. package/components/widgets/InfoWidget/components/__tests__/InfoRow.test.d.ts +1 -0
  139. package/components/widgets/InfoWidget/components/__tests__/InfoValueWrapper.test.d.ts +1 -0
  140. package/components/widgets/NavigationTabsWidget/NavigationTabsWidget.d.ts +8 -0
  141. package/components/widgets/NavigationTabsWidget/NavigationTabsWidget.test.d.ts +1 -0
  142. package/components/widgets/PickListPopup/PickListPopup.d.ts +43 -0
  143. package/components/widgets/PickListPopup/PickListPopup.test.d.ts +1 -0
  144. package/components/widgets/TableWidget/TableWidget.d.ts +88 -0
  145. package/components/widgets/TableWidget/TableWidget.test.d.ts +1 -0
  146. package/components/widgets/TextWidget/TextWidget.d.ts +15 -0
  147. package/components/widgets/TextWidget/TextWidget.test.d.ts +1 -0
  148. package/components/widgets/ViewNavigationWidget/ViewNavigationWidget.d.ts +6 -0
  149. package/components/widgets/ViewNavigationWidget/ViewNavigationWidget.test.d.ts +1 -0
  150. package/components/widgets/index.d.ts +4 -0
  151. package/cxbox-ui-core.js +148 -0
  152. package/cxbox-ui-core.js.map +1 -0
  153. package/epics/data/__tests__/bcCancelCreateDataEpic.test.d.ts +1 -0
  154. package/epics/data/__tests__/bcFetchData.test.d.ts +1 -0
  155. package/epics/data/__tests__/bcFetchRowMetaRequest.test.d.ts +1 -0
  156. package/epics/data/__tests__/bcNewDataEpic.test.d.ts +1 -0
  157. package/epics/data/__tests__/bcSaveData.test.d.ts +1 -0
  158. package/epics/data/__tests__/bcSelectDepthRecord.test.d.ts +1 -0
  159. package/epics/data/__tests__/removeMultivalueTag.test.d.ts +1 -0
  160. package/epics/data/__tests__/saveAssociationsActive.test.d.ts +1 -0
  161. package/epics/data/__tests__/selectView.test.d.ts +1 -0
  162. package/epics/data/bcCancelCreateDataEpic.d.ts +28 -0
  163. package/epics/data/bcFetchData.d.ts +21 -0
  164. package/epics/data/bcFetchRowMetaRequest.d.ts +50 -0
  165. package/epics/data/bcNewDataEpic.d.ts +37 -0
  166. package/epics/data/bcSaveData.d.ts +58 -0
  167. package/epics/data/bcSelectDepthRecord.d.ts +21 -0
  168. package/epics/data/removeMultivalueTag.d.ts +45 -0
  169. package/epics/data/saveAssociationsActive.d.ts +7 -0
  170. package/epics/data/selectView.d.ts +36 -0
  171. package/epics/data.d.ts +105 -0
  172. package/epics/index.d.ts +74 -0
  173. package/epics/router/__tests__/changeLocation.test.d.ts +1 -0
  174. package/epics/router/__tests__/drilldown.test.d.ts +1 -0
  175. package/epics/router/__tests__/handleRouter.test.d.ts +1 -0
  176. package/epics/router/__tests__/loginDone.test.d.ts +1 -0
  177. package/epics/router/__tests__/selectScreen.test.d.ts +1 -0
  178. package/epics/router/__tests__/selectScreenFail.test.d.ts +1 -0
  179. package/epics/router/__tests__/selectView.test.d.ts +1 -0
  180. package/epics/router/__tests__/selectViewFail.test.d.ts +1 -0
  181. package/epics/router/__tests__/userDrillDown.test.d.ts +1 -0
  182. package/epics/router/changeLocation.d.ts +11 -0
  183. package/epics/router/drilldown.d.ts +12 -0
  184. package/epics/router/handleRouter.d.ts +17 -0
  185. package/epics/router/loginDone.d.ts +20 -0
  186. package/epics/router/selectScreen.d.ts +19 -0
  187. package/epics/router/selectScreenFail.d.ts +17 -0
  188. package/epics/router/selectView.d.ts +19 -0
  189. package/epics/router/selectViewFail.d.ts +17 -0
  190. package/epics/router/userDrillDown.d.ts +29 -0
  191. package/epics/router.d.ts +11 -0
  192. package/epics/screen/__tests__/apiError.test.d.ts +1 -0
  193. package/epics/screen/__tests__/httpError401.test.d.ts +1 -0
  194. package/epics/screen/__tests__/httpError409.test.d.ts +1 -0
  195. package/epics/screen/__tests__/httpError418.test.d.ts +1 -0
  196. package/epics/screen/__tests__/httpError500.test.d.ts +1 -0
  197. package/epics/screen/__tests__/httpErrorDefault.test.d.ts +1 -0
  198. package/epics/screen/apiError.d.ts +13 -0
  199. package/epics/screen/httpError401.d.ts +12 -0
  200. package/epics/screen/httpError409.d.ts +12 -0
  201. package/epics/screen/httpError418.d.ts +12 -0
  202. package/epics/screen/httpError500.d.ts +12 -0
  203. package/epics/screen/httpErrorDefault.d.ts +14 -0
  204. package/epics/screen/processPostInvoke.d.ts +12 -0
  205. package/epics/screen.d.ts +35 -0
  206. package/epics/session/__tests__/loginByAnotherRoleEpic.test.d.ts +1 -0
  207. package/epics/session/__tests__/loginDone.test.d.ts +1 -0
  208. package/epics/session/__tests__/refreshMeta.test.d.ts +1 -0
  209. package/epics/session/__tests__/refreshMetaAndReloadPage.test.d.ts +1 -0
  210. package/epics/session/__tests__/switchRole.test.d.ts +1 -0
  211. package/epics/session/loginByAnotherRole.d.ts +27 -0
  212. package/epics/session/loginDone.d.ts +10 -0
  213. package/epics/session/refreshMeta.d.ts +9 -0
  214. package/epics/session/refreshMetaAndReloadPage.d.ts +2 -0
  215. package/epics/session/switchRole.d.ts +9 -0
  216. package/epics/session.d.ts +7 -0
  217. package/epics/utils.d.ts +4 -0
  218. package/epics/view/__tests__/fileUploadConfirm.test.d.ts +1 -0
  219. package/epics/view/__tests__/sendOperation.test.d.ts +1 -0
  220. package/epics/view/__tests__/sendOperationAssociate.test.d.ts +1 -0
  221. package/epics/view/__tests__/showAssocPopup.test.d.ts +1 -0
  222. package/epics/view/__tests__/showFileUploadPopup.test.d.ts +1 -0
  223. package/epics/view/fileUploadConfirm.d.ts +31 -0
  224. package/epics/view/sendOperation.d.ts +24 -0
  225. package/epics/view/sendOperationAssociate.d.ts +34 -0
  226. package/epics/view/showAssocPopup.d.ts +12 -0
  227. package/epics/view/showFileUploadPopup.d.ts +19 -0
  228. package/epics/view.d.ts +57 -0
  229. package/hooks/__tests__/useRowMenu.test.d.ts +1 -0
  230. package/hooks/__tests__/useViewTabs.test.d.ts +1 -0
  231. package/hooks/__tests__/useWidgetOperations.test.d.ts +1 -0
  232. package/hooks/index.d.ts +7 -0
  233. package/hooks/useAssocRecords.d.ts +11 -0
  234. package/hooks/useDebounce.d.ts +8 -0
  235. package/hooks/useDrillDownUrl.d.ts +10 -0
  236. package/hooks/useFlatFormFields.d.ts +9 -0
  237. package/hooks/useRowMenu.d.ts +42 -0
  238. package/hooks/useViewTabs.d.ts +13 -0
  239. package/hooks/useWidgetFilter.d.ts +15 -0
  240. package/hooks/useWidgetOperations.d.ts +34 -0
  241. package/imports/i18n.d.ts +8 -0
  242. package/imports/rxjs.d.ts +19 -0
  243. package/imports/shim.d.ts +6 -0
  244. package/index.d.ts +135 -0
  245. package/interfaces/bc.d.ts +78 -0
  246. package/interfaces/customEpics.d.ts +55 -0
  247. package/interfaces/customMiddlewares.d.ts +35 -0
  248. package/interfaces/data.d.ts +48 -0
  249. package/interfaces/filters.d.ts +32 -0
  250. package/interfaces/filters.js +2 -0
  251. package/interfaces/filters.js.map +1 -0
  252. package/interfaces/index.d.ts +22 -0
  253. package/interfaces/navigation.d.ts +48 -0
  254. package/interfaces/objectMap.d.ts +35 -0
  255. package/interfaces/objectMap.js +2 -0
  256. package/interfaces/objectMap.js.map +1 -0
  257. package/interfaces/operation.d.ts +330 -0
  258. package/interfaces/operation.js +2 -0
  259. package/interfaces/operation.js.map +1 -0
  260. package/interfaces/router.d.ts +16 -0
  261. package/interfaces/router.js +2 -0
  262. package/interfaces/router.js.map +1 -0
  263. package/interfaces/rowMeta.d.ts +74 -0
  264. package/interfaces/screen.d.ts +28 -0
  265. package/interfaces/session.d.ts +62 -0
  266. package/interfaces/store.d.ts +56 -0
  267. package/interfaces/tree.d.ts +66 -0
  268. package/interfaces/view.d.ts +202 -0
  269. package/interfaces/view.js +2 -0
  270. package/interfaces/view.js.map +1 -0
  271. package/interfaces/widget.d.ts +208 -0
  272. package/interfaces/widget.js +2 -0
  273. package/interfaces/widget.js.map +1 -0
  274. package/middlewares/__tests__/autosaveMiddleware.test.d.ts +1 -0
  275. package/middlewares/__tests__/preInvokeMiddleware.test.d.ts +1 -0
  276. package/middlewares/__tests__/requiredFieldsMiddleware.test.d.ts +1 -0
  277. package/middlewares/actionsHistoryMiddleware.d.ts +3 -0
  278. package/middlewares/autosaveMiddleware.d.ts +6 -0
  279. package/middlewares/index.d.ts +6 -0
  280. package/middlewares/preInvokeMiddleware.d.ts +8 -0
  281. package/middlewares/requiredFieldsMiddleware.d.ts +35 -0
  282. package/mocks/data/widgetMeta.d.ts +10 -0
  283. package/package.json +117 -0
  284. package/reducers/__tests__/data.test.d.ts +1 -0
  285. package/reducers/__tests__/forceActiveField.test.d.ts +1 -0
  286. package/reducers/__tests__/screen/bcAddFilter.test.d.ts +1 -0
  287. package/reducers/__tests__/session.test.d.ts +1 -0
  288. package/reducers/__tests__/view.test.d.ts +1 -0
  289. package/reducers/data.d.ts +13 -0
  290. package/reducers/depthData.d.ts +7 -0
  291. package/reducers/index.d.ts +3 -0
  292. package/reducers/router.d.ts +30 -0
  293. package/reducers/screen.d.ts +16 -0
  294. package/reducers/session.d.ts +15 -0
  295. package/reducers/view.d.ts +16 -0
  296. package/tests/assetsMock.d.ts +0 -0
  297. package/tests/mockStore.d.ts +6 -0
  298. package/tests/setup.d.ts +1 -0
  299. package/tests/testEpic.d.ts +14 -0
  300. package/utils/__tests__/autosave.test.d.ts +1 -0
  301. package/utils/__tests__/bc.test.d.ts +1 -0
  302. package/utils/__tests__/breadthFirst.test.d.ts +1 -0
  303. package/utils/__tests__/cancelRequestEpic.test.d.ts +1 -0
  304. package/utils/__tests__/combineEpics.test.d.ts +1 -0
  305. package/utils/__tests__/combineMiddlewares.test.d.ts +1 -0
  306. package/utils/__tests__/configureStore.test.d.ts +1 -0
  307. package/utils/__tests__/extendPopupWidgetTypes.test.d.ts +1 -0
  308. package/utils/__tests__/filters.test.d.ts +1 -0
  309. package/utils/__tests__/history.test.d.ts +1 -0
  310. package/utils/__tests__/notifications.test.d.ts +1 -0
  311. package/utils/__tests__/operations.test.d.ts +1 -0
  312. package/utils/__tests__/tree.test.d.ts +1 -0
  313. package/utils/__tests__/viewTabs.test.d.ts +1 -0
  314. package/utils/actionsHistory.d.ts +2 -0
  315. package/utils/api.d.ts +92 -0
  316. package/utils/autosave.d.ts +26 -0
  317. package/utils/bc.d.ts +27 -0
  318. package/utils/breadthFirst.d.ts +21 -0
  319. package/utils/cancelRequestEpic.d.ts +16 -0
  320. package/utils/combineEpics.d.ts +13 -0
  321. package/utils/combineMiddlewares.d.ts +3 -0
  322. package/utils/configureStore.d.ts +15 -0
  323. package/utils/exportState.d.ts +3 -0
  324. package/utils/extendPopupWidgetTypes.d.ts +8 -0
  325. package/utils/filters.d.ts +64 -0
  326. package/utils/hierarchy.d.ts +17 -0
  327. package/utils/highlightJson.d.ts +12 -0
  328. package/utils/history.d.ts +51 -0
  329. package/utils/index.d.ts +6 -0
  330. package/utils/notifications.d.ts +11 -0
  331. package/utils/operations.d.ts +21 -0
  332. package/utils/redux.d.ts +49 -0
  333. package/utils/strings.d.ts +43 -0
  334. package/utils/tree.d.ts +43 -0
  335. package/utils/viewTabs.d.ts +20 -0
@@ -0,0 +1,124 @@
1
+ # Versioning
2
+
3
+ Cxbox UI follows [semver](https://semver.org/), e.g. MAJOR.MINOR.PATCH.
4
+ All significant changes are documented in our [changelog file](./CHANGELOG.md).
5
+ Backwards incompatible changes are denoted with `[BREAKING CHANGE]` mark.
6
+
7
+ # Branch organization
8
+
9
+ Realeses are build from main branch, marked with a corresponding tag.
10
+ Minor versions and patches are merged into "develop" branch first.
11
+ Features and bugfixes should be named in `feat/issue-number` and `fix/issue-number` format.
12
+
13
+ # Development
14
+
15
+ All changes by internal team or external contributors should be performed via public pull request.
16
+ All commits should be reasonably squashed before pull request will be merged (multiple commits for a single feature are not
17
+ encouraged but acceptable when they are helpful)
18
+ All commits should contain a commit message with a gist of reasoning behind the change. Full description should be provided via pull
19
+ request description.
20
+ All changes should correlate with our style guide, pass lint and test checks:
21
+ ```sh
22
+ yarn check
23
+ ```
24
+ When submitting a bugfix, unit test should be provided.
25
+
26
+ # Proposing a change
27
+
28
+ If you come up with a feature that looks more attractive as a library component rather than customization layer of your application, please open an issue with your proposal.
29
+
30
+ # Style guide
31
+
32
+ Before commit launch prettier and eslint checks:
33
+
34
+ ```sh
35
+ yarn lint --fix
36
+ ```
37
+
38
+ ## Naming, documentation and folder structure
39
+
40
+ * Test files should be named as <testedModule>.tests.ts or <TestedComponent>.tests.ts
41
+ * Multiple files component should store corresponding tests inside __tests__ folder. Single file component could store their test near them.
42
+ * Reusable UI components without dependencies on Cxbox UI functionality (not connected) should be placed inside `components/ui` folder
43
+ * Widgets should be placed inside `components/widgets` folder
44
+ * All exportable components should be specified inside `components/index.ts` file
45
+ * Use JSDoc comments to describe interfaces and functions when possible
46
+
47
+ ## React
48
+
49
+ * Use React hooks to manage component state
50
+ * Always use functional form for components. Following templates are recommended:
51
+
52
+ ```tsx
53
+ // Connected component template
54
+ import React, { useCallback } from 'react'
55
+ import { useDispatch, useSelector } from 'react-redux'
56
+ import cn from 'classnames'
57
+ import { $do } from '../../actions/actions'
58
+ import { Store } from '../../interfaces/store'
59
+ import styles from './Component.less'
60
+
61
+ export interface ComponentProps {
62
+ className?: string
63
+ bcName: string
64
+ }
65
+
66
+ export const Component = ({
67
+ className,
68
+ bcName
69
+ }: ComponentProps) => {
70
+
71
+ const cursor = useSelector((store: Store) => store.screen.bo.bc[bcName].cursor)
72
+ const dispatch = useDispatch()
73
+
74
+ const handleEmptyAction = useCallback(() => {
75
+ dispatch($do.emptyAction(null)
76
+ }, [dispatch])
77
+
78
+ const handleAction = React.useCallback(() => {
79
+ dispatch($do.someAction({ test: 'Test' }))
80
+ }, [dispatch])
81
+
82
+ return <div className={cn(styles.container, className)}>
83
+ <h2>Cursor - {cursor}</h2>
84
+ <button onClick={handleEmptyAction}>
85
+ Empty action
86
+ </button>
87
+ <button onClick={handleAction}>
88
+ Action with args
89
+ </button>
90
+ </div>
91
+ }
92
+ ```
93
+
94
+ ```tsx
95
+ // Non-connected component template
96
+ import React from 'react'
97
+ import cn from 'classnames'
98
+
99
+ export interface ComponentProps {
100
+ className?: string
101
+ }
102
+
103
+ export const Component: FunctionComponent<ComponentProps> = ({ className }: ComponentProps) => {
104
+ return <div className={cn(styles.container, props.className)}>
105
+ Test
106
+ </div>
107
+ }
108
+
109
+ export default React.memo(Component)
110
+ ```
111
+
112
+ * Always use relative paths for import statements
113
+ * Use cn helper for complex or conditional classnames
114
+ * Visual components should accept className as a property and apply it to the root element
115
+ * Always specify `key` property when you render an array of components
116
+ * Helper functions for component should be located below render function
117
+ * Avoid renderComponentPart functions, prefer render on site or extraction into different component
118
+
119
+ ## CSS/LESS
120
+
121
+ * Avoid nested selectors when possible
122
+ * Avoid `!important` statement
123
+ * Avoid id selectors, tag selectors or universal * selectors - prefer class selectors
124
+ * Put more specific selector on the right side for complex selectors as CSS selectors checked from right to left
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2019 qnt
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/Provider.d.ts ADDED
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import { Action, Store } from 'redux';
3
+ import { Route } from './interfaces/router';
4
+ import { ClientReducersMapObject, Store as CoreStore } from './interfaces/store';
5
+ import { Location } from 'history';
6
+ import { AxiosInstance } from 'axios';
7
+ import { Resource, i18n } from 'i18next';
8
+ import CustomEpics, { AnyEpic } from './interfaces/customEpics';
9
+ import { CustomMiddlewares } from './interfaces/customMiddlewares';
10
+ import { CustomWidgetDescriptor } from './interfaces/widget';
11
+ export interface ProviderProps<ClientState, ClientActions> {
12
+ children: React.ReactNode;
13
+ customReducers?: ClientReducersMapObject<ClientState, ClientActions>;
14
+ customActions?: any;
15
+ customEpics?: CustomEpics | AnyEpic;
16
+ customMiddlewares?: CustomMiddlewares;
17
+ axiosInstance?: AxiosInstance;
18
+ customWidgets?: Record<string, CustomWidgetDescriptor>;
19
+ parseLocation?: (loc: Location<any>) => Route;
20
+ buildLocation?: (route: Route) => string;
21
+ useEpics?: boolean;
22
+ lang?: string;
23
+ langDictionary?: Resource;
24
+ }
25
+ /**
26
+ * @category Utils
27
+ */
28
+ export declare let store: Store<CoreStore>;
29
+ export declare let axiosInstance: AxiosInstance;
30
+ export declare let parseLocation: (loc: Location<any>) => Route;
31
+ export declare let buildLocation: (route: Route) => string;
32
+ export declare let localeProviderInstance: i18n;
33
+ /**
34
+ * TODO
35
+ *
36
+ * @category Utils
37
+ */
38
+ export declare function getStoreInstance(): Store<CoreStore, import("redux").AnyAction>;
39
+ /**
40
+ * TODO
41
+ *
42
+ * @param storeInstance
43
+ */
44
+ export declare function setStoreInstance(storeInstance: Store<CoreStore>): void;
45
+ /**
46
+ * TODO
47
+ */
48
+ export declare function getParseLocationInstance(): (loc: Location<any>) => Route;
49
+ /**
50
+ * TODO
51
+ */
52
+ export declare function getBuildLocationInstance(): (route: Route) => string;
53
+ /**
54
+ * @category Utils
55
+ */
56
+ export declare function getLocaleProviderInstance(): i18n;
57
+ /**
58
+ *
59
+ * @param props
60
+ * @category Components
61
+ */
62
+ declare const Provider: <ClientState extends Partial<CoreStore>, ClientActions extends Action<any>>(props: ProviderProps<ClientState, ClientActions>) => JSX.Element;
63
+ export default Provider;
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+
2
+ # Cxbox UI &middot; [![Build status](https://github.com/CX-Box/cxbox-ui/workflows/Build/badge.svg)](https://github.com/CX-Box/cxbox-ui/actions?query=workflow%3ABuild) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=CX-Box_cxbox-ui&metric=alert_status)](https://sonarcloud.io/dashboard?id=CX-Box_cxbox-ui) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=CX-Box_cxbox-ui&metric=coverage)](https://sonarcloud.io/dashboard?id=CX-Box_cxbox-ui)
3
+
4
+
5
+ Cxbox UI is an open source library that supplies user interaction support for Cxbox framework in form of React components, Redux reducers and redux-observable epics for handling asynchronous actions.
6
+ More specifically that includes:
7
+ - Major UI abstractions of Cxbox framework such as Screen, View, Widget, Field
8
+ - Standard actions, reducers and epics for handling Cxbox API, routing and build-in controls
9
+ - Custom <Provider> component and `connect` function to work with combined Redux store of Cxbox UI library and your own application
10
+ - Reusable UI controls
11
+
12
+ # Main concepts
13
+
14
+ UI side of Cxbox framework is based on a concept of configurable dashboards ("views") with widgets. Visually widgets could be represented as a card with a table, graph, form or something more exotic inside.
15
+ Internally, every widget has a direct link to an entity that we call "business component" (BC). BC controls what data is displayed on widget and whhich interactions are available to the user. Interactions could be a simple filtration or some complex business process, initiated through Cxbox API.
16
+ Information about loaded views and widgets grouped into "screens" and stored in application Redux store.
17
+ Client applications could reuse, extend and customize that functionality by providing its own reducers and epics, widgets and ui controls.
18
+
19
+ # Installation
20
+
21
+ Cxbox UI distributed in form of ES5 compatible npm package:
22
+ ```sh
23
+ yarn add @cxbox-ui/core
24
+ ```
25
+
26
+ Several libraries are specified as peer dependencies and should be installed for client application: react, react-dom, redux, react-redux, rxjs, redux-observable, antd, axios.
27
+
28
+ # Usage
29
+
30
+ <Provider> component provides configurable Redux context and should be used on top level of your application:
31
+
32
+ ```tsx
33
+ import {Provider} from '@cxbox-ui/core'
34
+ import {reducers} from 'reducers'
35
+
36
+ const App = <Provider>
37
+ <div>Client side application</div>
38
+ </Provider>
39
+
40
+ render(App, document.getElementById('root'))
41
+ ```
42
+
43
+ After that, components of your own application could access combined Redux store and import library components:
44
+
45
+ ```tsx
46
+ import React from 'react'
47
+ import {connect, View} from '@cxbox-ui/core'
48
+
49
+ export const ClientComponent: FunctionComponent = (props: { screenName }) => {
50
+ const Card = (props) => <div>
51
+ <h1>Client side component</h1>
52
+ {props.children}
53
+ </div>
54
+ return <View card={Card} />
55
+ }
56
+
57
+ function mapStateToProps(store) {
58
+ return { screenName: store.router.screenName }
59
+ }
60
+
61
+ export default connect(mapStateToProps)(ClientComponent)
62
+ ```
63
+
64
+ # Documentation
65
+
66
+ The documentation is divided into several sections:
67
+ * [Tutorial](http://idocs.cxbox.io/ui/#/screen/tutorial)
68
+ * [Components Overview](http://idocs.cxbox.io/ui/#/screen/components)
69
+ * [Features](http://idocs.cxbox.io/ui/#/screen/features)
70
+ * [API Reference](https://CX-Box.github.io/cxbox-ui)
71
+
72
+ You could also check our [changelog section](https://github.com/CX-Box/cxbox-ui/blob/main/CHANGELOG.md).
73
+
74
+ # Reporting an error
75
+
76
+ In case you've encountered a problem, please open an issue with reproducible example and detailed description.
77
+ If you are also willing to provide a fix, please check our [contributing guide](https://github.com/CX-Box/cxbox-ui/blob/main/CONTRIBUTING.md)!
78
+
79
+ # Contributing
80
+
81
+ All contributions are welcomed, as even a minor pull request with grammar fixes or a single documentation update is of a significant help for us!
82
+ We promise to handle all PR reviews in a friendly and respectful manner.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * TODO: Move to interfaces
3
+ *
4
+ * @category Actions
5
+ */
6
+ export interface Action<K, P> {
7
+ type: K;
8
+ payload: P;
9
+ }
10
+ /**
11
+ * TODO: Move to interfaces
12
+ *
13
+ * @category Actions
14
+ */
15
+ export declare type uActionTypesMap<A> = {
16
+ [key in keyof A]: key;
17
+ };
18
+ /**
19
+ * TODO: Move to interfaces
20
+ *
21
+ * @category Actions
22
+ */
23
+ export declare type uActionsMap<A> = {
24
+ [key in keyof A]: Action<key, A[key]>;
25
+ };
26
+ /**
27
+ * TODO: Move to interfaces
28
+ *
29
+ * @category Actions
30
+ */
31
+ export declare type AnyOfMap<A> = A[keyof A];
32
+ export declare type uActionCreators<A> = {
33
+ [key in keyof A]: (payload: A[key]) => Action<key, A[key]>;
34
+ };
35
+ /**
36
+ * TODO
37
+ *
38
+ * @param actionObj
39
+ * @category Utils
40
+ */
41
+ export declare function createActionCreators<A>(actionObj: A): uActionCreators<A>;
42
+ /**
43
+ * TODO
44
+ *
45
+ * @param actionObj
46
+ * @category Utils
47
+ */
48
+ export declare function createActionTypes<A>(actionObj: A): uActionTypesMap<A>;