@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.
- package/CONTRIBUTING.md +124 -0
- package/LICENSE +201 -0
- package/Provider.d.ts +63 -0
- package/README.md +82 -0
- package/actions/actions-utils.d.ts +48 -0
- package/actions/actions.d.ts +1132 -0
- package/actions/index.d.ts +2 -0
- package/api/api.d.ts +148 -0
- package/api/index.d.ts +1 -0
- package/assets/i18n/__tests__/getTextAssets.d.ts +1 -0
- package/assets/i18n/index.d.ts +25 -0
- package/components/ColumnTitle/ColumnFilter.d.ts +47 -0
- package/components/ColumnTitle/ColumnSort.d.ts +26 -0
- package/components/ColumnTitle/ColumnTitle.d.ts +31 -0
- package/components/ColumnTitle/__tests__/ColumnFilter.test.d.ts +1 -0
- package/components/ColumnTitle/__tests__/ColumnSort.test.d.ts +1 -0
- package/components/ColumnTitle/__tests__/ColumnTitle.test.d.ts +1 -0
- package/components/DebugPanel/DebugPanel.d.ts +7 -0
- package/components/DebugPanel/__tests__/DebugPanel.test.d.ts +1 -0
- package/components/DebugPanel/components/FormattedJSON.d.ts +6 -0
- package/components/DebugPanel/components/InfoLabel.d.ts +7 -0
- package/components/DebugPanel/components/ViewInfoLabel.d.ts +3 -0
- package/components/DebugPanel/components/WidgetInfoLabel.d.ts +5 -0
- package/components/DebugPanel/components/__tests__/FormattedJSON.test.d.ts +1 -0
- package/components/DebugPanel/components/__tests__/InfoLabel.test.d.ts +1 -0
- package/components/DebugPanel/components/__tests__/ViewInfoLabel.test.d.ts +1 -0
- package/components/DebugPanel/components/__tests__/WidgetInfoLabel.test.d.ts +1 -0
- package/components/DevToolsPanel/DevToolsPanel.d.ts +10 -0
- package/components/DevToolsPanel/DevToolsPanel.test.d.ts +1 -0
- package/components/DevToolsPanel/components/DebugModeButton.d.ts +9 -0
- package/components/DevToolsPanel/components/RefreshMetaButton.d.ts +9 -0
- package/components/DevToolsPanel/components/__tests__/DebugModeButton.test.d.ts +1 -0
- package/components/DevToolsPanel/components/__tests__/RefreshMetaButton.test.d.ts +1 -0
- package/components/Field/Field.d.ts +72 -0
- package/components/Field/Field.test.d.ts +1 -0
- package/components/FileUpload/FileUpload.d.ts +32 -0
- package/components/FileUploadPopup/FileUploadPopup.d.ts +10 -0
- package/components/FilterPopup/FilterPopup.d.ts +26 -0
- package/components/FilterPopup/FilterPopup.test.d.ts +1 -0
- package/components/FullHierarchyTable/FullHierarchyTable.d.ts +52 -0
- package/components/FullHierarchyTable/FullHierarchyTable.test.d.ts +1 -0
- package/components/FullHierarchyTable/utils/hierarchySearchCache.d.ts +37 -0
- package/components/FullHierarchyTable/utils/hierarchySearchCache.test.d.ts +1 -0
- package/components/FullHierarchyTable/utils/useExpandedKeys.d.ts +19 -0
- package/components/FullHierarchyTable/utils/useHierarchyCache.d.ts +12 -0
- package/components/HierarchyTable/HierarchyTable.d.ts +47 -0
- package/components/HierarchyTable/HierarchyTable.test.d.ts +1 -0
- package/components/InlinePickList/InlinePickList.d.ts +23 -0
- package/components/ModalInvoke/ModalInvoke.d.ts +18 -0
- package/components/ModalInvoke/ModalInvoke.test.d.ts +1 -0
- package/components/Multivalue/MultiValueListRecord.d.ts +15 -0
- package/components/Multivalue/MultivalueField.d.ts +31 -0
- package/components/Multivalue/MultivalueField.test.d.ts +1 -0
- package/components/PickListField/PickListField.d.ts +25 -0
- package/components/RowOperations/RowOperationsButton.d.ts +42 -0
- package/components/RowOperations/RowOperationsMenu.d.ts +29 -0
- package/components/RowOperations/__tests__/RowOperationsButton.test.d.ts +1 -0
- package/components/RowOperations/__tests__/RowOperationsMenu.test.d.ts +1 -0
- package/components/SameBcHierarchyTable/SameBcHierarchyTable.d.ts +40 -0
- package/components/TemplatedTitle/TemplatedTitle.d.ts +20 -0
- package/components/View/View.d.ts +26 -0
- package/components/View/__tests__/View.test.d.ts +1 -0
- package/components/Widget/Widget.d.ts +28 -0
- package/components/Widget/Widget.test.d.ts +1 -0
- package/components/WidgetErrorBoundary/WidgetErrorBoundary.d.ts +20 -0
- package/components/WidgetErrorBoundary/WidgetErrorBoundary.test.d.ts +1 -0
- package/components/WidgetErrorBoundary/components/RefreshButton.d.ts +4 -0
- package/components/WidgetErrorBoundary/components/RefreshButton.test.d.ts +1 -0
- package/components/index.d.ts +44 -0
- package/components/ui/ActionLink/ActionLink.d.ts +11 -0
- package/components/ui/CheckboxFilter/CheckboxFilter.d.ts +21 -0
- package/components/ui/CheckboxFilter/CheckboxFilter.test.d.ts +1 -0
- package/components/ui/CheckboxPicker/CheckboxPicker.d.ts +21 -0
- package/components/ui/CopyableText/CopyableText.d.ts +7 -0
- package/components/ui/CopyableText/__tests__/CopyableText.test.d.ts +1 -0
- package/components/ui/DashboardLayout/DashboardLayout.d.ts +21 -0
- package/components/ui/DashboardLayout/__tests__/DashboardLayout.test.d.ts +1 -0
- package/components/ui/DatePickerField/DatePickerField.d.ts +25 -0
- package/components/ui/Dictionary/Dictionary.d.ts +30 -0
- package/components/ui/Dictionary/Dictionary.test.d.ts +1 -0
- package/components/ui/ErrorPopup/ErrorPopup.d.ts +18 -0
- package/components/ui/ErrorPopup/ErrorPopup.test.d.ts +1 -0
- package/components/ui/FilterField/FilterField.d.ts +25 -0
- package/components/ui/FilterField/FilterField.test.d.ts +1 -0
- package/components/ui/FilterField/components/RangePicker.d.ts +11 -0
- package/components/ui/FilterField/components/RangePicker.test.d.ts +1 -0
- package/components/ui/HistoryField/HistoryField.d.ts +15 -0
- package/components/ui/InteractiveInput/InteractiveInput.d.ts +28 -0
- package/components/ui/Link/Link.d.ts +13 -0
- package/components/ui/MultiField/MultiField.d.ts +16 -0
- package/components/ui/Multivalue/MultivalueHover.d.ts +15 -0
- package/components/ui/Multivalue/MultivalueList.d.ts +17 -0
- package/components/ui/Multivalue/MultivalueTag.d.ts +24 -0
- package/components/ui/NavigationTabs/NavigationTabs.d.ts +7 -0
- package/components/ui/NavigationTabs/NavigationTabs.test.d.ts +1 -0
- package/components/ui/NumberInput/NumberInput.d.ts +17 -0
- package/components/ui/NumberInput/NumberInput.test.d.ts +1 -0
- package/components/ui/NumberInput/formaters.d.ts +31 -0
- package/components/ui/Pagination/Pagination.d.ts +51 -0
- package/components/ui/Pagination/Pagination.test.d.ts +1 -0
- package/components/ui/PickInput/PickInput.d.ts +15 -0
- package/components/ui/Popup/Popup.d.ts +29 -0
- package/components/ui/Popup/Popup.test.d.ts +1 -0
- package/components/ui/Popup/PopupFooter.d.ts +16 -0
- package/components/ui/RadioButton/RadioButton.d.ts +16 -0
- package/components/ui/RadioButton/RadioButton.test.d.ts +1 -0
- package/components/ui/ReadOnlyField/ReadOnlyField.d.ts +22 -0
- package/components/ui/SearchHightlight/SearchHightlight.d.ts +20 -0
- package/components/ui/Select/Select.d.ts +26 -0
- package/components/ui/TextArea/TextArea.d.ts +24 -0
- package/components/ui/TextArea/TextArea.test.d.ts +1 -0
- package/components/ui/TreeVirtualized/TreeVirtualized.d.ts +63 -0
- package/components/ui/TreeVirtualized/TreeVirtualizedNode.d.ts +67 -0
- package/components/ui/TreeVirtualized/__tests__/TreeVirtualized.test.d.ts +1 -0
- package/components/ui/TreeVirtualized/__tests__/TreeVirtualizedNode.test.d.ts +1 -0
- package/components/ui/TreeVirtualized/__tests__/useMatchingNodes.test.d.ts +1 -0
- package/components/ui/TreeVirtualized/__tests__/useSearchResult.test.d.ts +1 -0
- package/components/ui/TreeVirtualized/useMatchingNodes.d.ts +23 -0
- package/components/ui/TreeVirtualized/useSearchResult.d.ts +27 -0
- package/components/widgets/AssocListPopup/AssocListPopup.d.ts +58 -0
- package/components/widgets/AssocListPopup/AssocListPopup.test.d.ts +1 -0
- package/components/widgets/AssocListPopup/AssocTable.d.ts +35 -0
- package/components/widgets/AssocListPopup/AssocTable.test.d.ts +1 -0
- package/components/widgets/FlatTree/FlatTree.d.ts +53 -0
- package/components/widgets/FlatTree/FlatTreePopup.d.ts +31 -0
- package/components/widgets/FlatTree/__tests__/FlatTree.test.d.ts +1 -0
- package/components/widgets/FlatTree/__tests__/FlatTreePopup.test.d.ts +1 -0
- package/components/widgets/FlatTree/useMultipleSelect.d.ts +11 -0
- package/components/widgets/FlatTree/useSingleSelect.d.ts +10 -0
- package/components/widgets/FormWidget/FormWidget.d.ts +23 -0
- package/components/widgets/FormWidget/FormWidget.test.d.ts +1 -0
- package/components/widgets/InfoWidget/InfoWidget.d.ts +19 -0
- package/components/widgets/InfoWidget/__test__/InfoWidget.test.d.ts +1 -0
- package/components/widgets/InfoWidget/components/InfoCell.d.ts +15 -0
- package/components/widgets/InfoWidget/components/InfoRow.d.ts +16 -0
- package/components/widgets/InfoWidget/components/InfoValueWrapper.d.ts +10 -0
- package/components/widgets/InfoWidget/components/__tests__/InfoCell.test.d.ts +1 -0
- package/components/widgets/InfoWidget/components/__tests__/InfoRow.test.d.ts +1 -0
- package/components/widgets/InfoWidget/components/__tests__/InfoValueWrapper.test.d.ts +1 -0
- package/components/widgets/NavigationTabsWidget/NavigationTabsWidget.d.ts +8 -0
- package/components/widgets/NavigationTabsWidget/NavigationTabsWidget.test.d.ts +1 -0
- package/components/widgets/PickListPopup/PickListPopup.d.ts +43 -0
- package/components/widgets/PickListPopup/PickListPopup.test.d.ts +1 -0
- package/components/widgets/TableWidget/TableWidget.d.ts +88 -0
- package/components/widgets/TableWidget/TableWidget.test.d.ts +1 -0
- package/components/widgets/TextWidget/TextWidget.d.ts +15 -0
- package/components/widgets/TextWidget/TextWidget.test.d.ts +1 -0
- package/components/widgets/ViewNavigationWidget/ViewNavigationWidget.d.ts +6 -0
- package/components/widgets/ViewNavigationWidget/ViewNavigationWidget.test.d.ts +1 -0
- package/components/widgets/index.d.ts +4 -0
- package/cxbox-ui-core.js +148 -0
- package/cxbox-ui-core.js.map +1 -0
- package/epics/data/__tests__/bcCancelCreateDataEpic.test.d.ts +1 -0
- package/epics/data/__tests__/bcFetchData.test.d.ts +1 -0
- package/epics/data/__tests__/bcFetchRowMetaRequest.test.d.ts +1 -0
- package/epics/data/__tests__/bcNewDataEpic.test.d.ts +1 -0
- package/epics/data/__tests__/bcSaveData.test.d.ts +1 -0
- package/epics/data/__tests__/bcSelectDepthRecord.test.d.ts +1 -0
- package/epics/data/__tests__/removeMultivalueTag.test.d.ts +1 -0
- package/epics/data/__tests__/saveAssociationsActive.test.d.ts +1 -0
- package/epics/data/__tests__/selectView.test.d.ts +1 -0
- package/epics/data/bcCancelCreateDataEpic.d.ts +28 -0
- package/epics/data/bcFetchData.d.ts +21 -0
- package/epics/data/bcFetchRowMetaRequest.d.ts +50 -0
- package/epics/data/bcNewDataEpic.d.ts +37 -0
- package/epics/data/bcSaveData.d.ts +58 -0
- package/epics/data/bcSelectDepthRecord.d.ts +21 -0
- package/epics/data/removeMultivalueTag.d.ts +45 -0
- package/epics/data/saveAssociationsActive.d.ts +7 -0
- package/epics/data/selectView.d.ts +36 -0
- package/epics/data.d.ts +105 -0
- package/epics/index.d.ts +74 -0
- package/epics/router/__tests__/changeLocation.test.d.ts +1 -0
- package/epics/router/__tests__/drilldown.test.d.ts +1 -0
- package/epics/router/__tests__/handleRouter.test.d.ts +1 -0
- package/epics/router/__tests__/loginDone.test.d.ts +1 -0
- package/epics/router/__tests__/selectScreen.test.d.ts +1 -0
- package/epics/router/__tests__/selectScreenFail.test.d.ts +1 -0
- package/epics/router/__tests__/selectView.test.d.ts +1 -0
- package/epics/router/__tests__/selectViewFail.test.d.ts +1 -0
- package/epics/router/__tests__/userDrillDown.test.d.ts +1 -0
- package/epics/router/changeLocation.d.ts +11 -0
- package/epics/router/drilldown.d.ts +12 -0
- package/epics/router/handleRouter.d.ts +17 -0
- package/epics/router/loginDone.d.ts +20 -0
- package/epics/router/selectScreen.d.ts +19 -0
- package/epics/router/selectScreenFail.d.ts +17 -0
- package/epics/router/selectView.d.ts +19 -0
- package/epics/router/selectViewFail.d.ts +17 -0
- package/epics/router/userDrillDown.d.ts +29 -0
- package/epics/router.d.ts +11 -0
- package/epics/screen/__tests__/apiError.test.d.ts +1 -0
- package/epics/screen/__tests__/httpError401.test.d.ts +1 -0
- package/epics/screen/__tests__/httpError409.test.d.ts +1 -0
- package/epics/screen/__tests__/httpError418.test.d.ts +1 -0
- package/epics/screen/__tests__/httpError500.test.d.ts +1 -0
- package/epics/screen/__tests__/httpErrorDefault.test.d.ts +1 -0
- package/epics/screen/apiError.d.ts +13 -0
- package/epics/screen/httpError401.d.ts +12 -0
- package/epics/screen/httpError409.d.ts +12 -0
- package/epics/screen/httpError418.d.ts +12 -0
- package/epics/screen/httpError500.d.ts +12 -0
- package/epics/screen/httpErrorDefault.d.ts +14 -0
- package/epics/screen/processPostInvoke.d.ts +12 -0
- package/epics/screen.d.ts +35 -0
- package/epics/session/__tests__/loginByAnotherRoleEpic.test.d.ts +1 -0
- package/epics/session/__tests__/loginDone.test.d.ts +1 -0
- package/epics/session/__tests__/refreshMeta.test.d.ts +1 -0
- package/epics/session/__tests__/refreshMetaAndReloadPage.test.d.ts +1 -0
- package/epics/session/__tests__/switchRole.test.d.ts +1 -0
- package/epics/session/loginByAnotherRole.d.ts +27 -0
- package/epics/session/loginDone.d.ts +10 -0
- package/epics/session/refreshMeta.d.ts +9 -0
- package/epics/session/refreshMetaAndReloadPage.d.ts +2 -0
- package/epics/session/switchRole.d.ts +9 -0
- package/epics/session.d.ts +7 -0
- package/epics/utils.d.ts +4 -0
- package/epics/view/__tests__/fileUploadConfirm.test.d.ts +1 -0
- package/epics/view/__tests__/sendOperation.test.d.ts +1 -0
- package/epics/view/__tests__/sendOperationAssociate.test.d.ts +1 -0
- package/epics/view/__tests__/showAssocPopup.test.d.ts +1 -0
- package/epics/view/__tests__/showFileUploadPopup.test.d.ts +1 -0
- package/epics/view/fileUploadConfirm.d.ts +31 -0
- package/epics/view/sendOperation.d.ts +24 -0
- package/epics/view/sendOperationAssociate.d.ts +34 -0
- package/epics/view/showAssocPopup.d.ts +12 -0
- package/epics/view/showFileUploadPopup.d.ts +19 -0
- package/epics/view.d.ts +57 -0
- package/hooks/__tests__/useRowMenu.test.d.ts +1 -0
- package/hooks/__tests__/useViewTabs.test.d.ts +1 -0
- package/hooks/__tests__/useWidgetOperations.test.d.ts +1 -0
- package/hooks/index.d.ts +7 -0
- package/hooks/useAssocRecords.d.ts +11 -0
- package/hooks/useDebounce.d.ts +8 -0
- package/hooks/useDrillDownUrl.d.ts +10 -0
- package/hooks/useFlatFormFields.d.ts +9 -0
- package/hooks/useRowMenu.d.ts +42 -0
- package/hooks/useViewTabs.d.ts +13 -0
- package/hooks/useWidgetFilter.d.ts +15 -0
- package/hooks/useWidgetOperations.d.ts +34 -0
- package/imports/i18n.d.ts +8 -0
- package/imports/rxjs.d.ts +19 -0
- package/imports/shim.d.ts +6 -0
- package/index.d.ts +135 -0
- package/interfaces/bc.d.ts +78 -0
- package/interfaces/customEpics.d.ts +55 -0
- package/interfaces/customMiddlewares.d.ts +35 -0
- package/interfaces/data.d.ts +48 -0
- package/interfaces/filters.d.ts +32 -0
- package/interfaces/filters.js +2 -0
- package/interfaces/filters.js.map +1 -0
- package/interfaces/index.d.ts +22 -0
- package/interfaces/navigation.d.ts +48 -0
- package/interfaces/objectMap.d.ts +35 -0
- package/interfaces/objectMap.js +2 -0
- package/interfaces/objectMap.js.map +1 -0
- package/interfaces/operation.d.ts +330 -0
- package/interfaces/operation.js +2 -0
- package/interfaces/operation.js.map +1 -0
- package/interfaces/router.d.ts +16 -0
- package/interfaces/router.js +2 -0
- package/interfaces/router.js.map +1 -0
- package/interfaces/rowMeta.d.ts +74 -0
- package/interfaces/screen.d.ts +28 -0
- package/interfaces/session.d.ts +62 -0
- package/interfaces/store.d.ts +56 -0
- package/interfaces/tree.d.ts +66 -0
- package/interfaces/view.d.ts +202 -0
- package/interfaces/view.js +2 -0
- package/interfaces/view.js.map +1 -0
- package/interfaces/widget.d.ts +208 -0
- package/interfaces/widget.js +2 -0
- package/interfaces/widget.js.map +1 -0
- package/middlewares/__tests__/autosaveMiddleware.test.d.ts +1 -0
- package/middlewares/__tests__/preInvokeMiddleware.test.d.ts +1 -0
- package/middlewares/__tests__/requiredFieldsMiddleware.test.d.ts +1 -0
- package/middlewares/actionsHistoryMiddleware.d.ts +3 -0
- package/middlewares/autosaveMiddleware.d.ts +6 -0
- package/middlewares/index.d.ts +6 -0
- package/middlewares/preInvokeMiddleware.d.ts +8 -0
- package/middlewares/requiredFieldsMiddleware.d.ts +35 -0
- package/mocks/data/widgetMeta.d.ts +10 -0
- package/package.json +117 -0
- package/reducers/__tests__/data.test.d.ts +1 -0
- package/reducers/__tests__/forceActiveField.test.d.ts +1 -0
- package/reducers/__tests__/screen/bcAddFilter.test.d.ts +1 -0
- package/reducers/__tests__/session.test.d.ts +1 -0
- package/reducers/__tests__/view.test.d.ts +1 -0
- package/reducers/data.d.ts +13 -0
- package/reducers/depthData.d.ts +7 -0
- package/reducers/index.d.ts +3 -0
- package/reducers/router.d.ts +30 -0
- package/reducers/screen.d.ts +16 -0
- package/reducers/session.d.ts +15 -0
- package/reducers/view.d.ts +16 -0
- package/tests/assetsMock.d.ts +0 -0
- package/tests/mockStore.d.ts +6 -0
- package/tests/setup.d.ts +1 -0
- package/tests/testEpic.d.ts +14 -0
- package/utils/__tests__/autosave.test.d.ts +1 -0
- package/utils/__tests__/bc.test.d.ts +1 -0
- package/utils/__tests__/breadthFirst.test.d.ts +1 -0
- package/utils/__tests__/cancelRequestEpic.test.d.ts +1 -0
- package/utils/__tests__/combineEpics.test.d.ts +1 -0
- package/utils/__tests__/combineMiddlewares.test.d.ts +1 -0
- package/utils/__tests__/configureStore.test.d.ts +1 -0
- package/utils/__tests__/extendPopupWidgetTypes.test.d.ts +1 -0
- package/utils/__tests__/filters.test.d.ts +1 -0
- package/utils/__tests__/history.test.d.ts +1 -0
- package/utils/__tests__/notifications.test.d.ts +1 -0
- package/utils/__tests__/operations.test.d.ts +1 -0
- package/utils/__tests__/tree.test.d.ts +1 -0
- package/utils/__tests__/viewTabs.test.d.ts +1 -0
- package/utils/actionsHistory.d.ts +2 -0
- package/utils/api.d.ts +92 -0
- package/utils/autosave.d.ts +26 -0
- package/utils/bc.d.ts +27 -0
- package/utils/breadthFirst.d.ts +21 -0
- package/utils/cancelRequestEpic.d.ts +16 -0
- package/utils/combineEpics.d.ts +13 -0
- package/utils/combineMiddlewares.d.ts +3 -0
- package/utils/configureStore.d.ts +15 -0
- package/utils/exportState.d.ts +3 -0
- package/utils/extendPopupWidgetTypes.d.ts +8 -0
- package/utils/filters.d.ts +64 -0
- package/utils/hierarchy.d.ts +17 -0
- package/utils/highlightJson.d.ts +12 -0
- package/utils/history.d.ts +51 -0
- package/utils/index.d.ts +6 -0
- package/utils/notifications.d.ts +11 -0
- package/utils/operations.d.ts +21 -0
- package/utils/redux.d.ts +49 -0
- package/utils/strings.d.ts +43 -0
- package/utils/tree.d.ts +43 -0
- package/utils/viewTabs.d.ts +20 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format json and highlight it as well.
|
|
3
|
+
* May not be suitable for handling huge (such as 10MB) JSON.
|
|
4
|
+
*
|
|
5
|
+
* It's temp solution
|
|
6
|
+
*
|
|
7
|
+
* @param json JSON to highlight
|
|
8
|
+
* @param colorOptions optional color options
|
|
9
|
+
* @category Utils
|
|
10
|
+
*/
|
|
11
|
+
declare function highlightJson(json: any, colorOptions?: {}): any;
|
|
12
|
+
export default highlightJson;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for urls and browser history
|
|
3
|
+
*/
|
|
4
|
+
import { Location } from 'history';
|
|
5
|
+
import { Route } from '../interfaces/router';
|
|
6
|
+
/**
|
|
7
|
+
* Appends '/' in front of `absoluteUrl` argument.
|
|
8
|
+
* If `absoluteUrl` alredy starts with `/` then argument returned without changes.
|
|
9
|
+
*
|
|
10
|
+
* @param absoluteUrl Url
|
|
11
|
+
*/
|
|
12
|
+
export declare function makeRelativeUrl(absoluteUrl: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Parses a business component hierarchy url into a dictionary of business components
|
|
15
|
+
* and their cursors.
|
|
16
|
+
*
|
|
17
|
+
* @param bcPath Business component hierarchy url, e.g. `bcName1/cursor1/bcName2/cursor2`
|
|
18
|
+
* @category Utils
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseBcCursors(bcPath: string): Record<string, string>;
|
|
21
|
+
/**
|
|
22
|
+
* TODO
|
|
23
|
+
*
|
|
24
|
+
* @param literals
|
|
25
|
+
* @param placeholders
|
|
26
|
+
* @category Utils
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildUrl(literals: TemplateStringsArray, ...placeholders: Array<string | number>): string;
|
|
29
|
+
/**
|
|
30
|
+
* Default implementation for utility to parse `history`-compatible location to {@link Route | Cxbox UI route}.
|
|
31
|
+
*
|
|
32
|
+
* Supports three types of URLs:
|
|
33
|
+
* - {@link RouteType.screen | RouteType.screen}, i.e. an url referencing some UI entity that can be parsed to Route directly. Example: `/screen/name/view/name/`;
|
|
34
|
+
* - {@link RouteType.router | RouteType.router}, i.e. an url without information about entity that should be handled on server side. Example: `/router/server-entity`
|
|
35
|
+
* - {@link RouteType.default | RouteType.default}, i.e. an url that leads to default entity of the application. Example: `/`
|
|
36
|
+
*
|
|
37
|
+
* Reverse function is {@link defaultBuildLocation}.
|
|
38
|
+
*
|
|
39
|
+
* @param loc Location compatible with `history` module
|
|
40
|
+
* @category Utils
|
|
41
|
+
*/
|
|
42
|
+
export declare function defaultParseLocation(loc: Location<any>): Route;
|
|
43
|
+
/**
|
|
44
|
+
* Transform {@link Route | Cxbox UI route} to string url.
|
|
45
|
+
*
|
|
46
|
+
* Reverse function is {@link defaultParseLocation}.
|
|
47
|
+
*
|
|
48
|
+
* @param route Cxbox UI route
|
|
49
|
+
* @category Utils
|
|
50
|
+
*/
|
|
51
|
+
export declare function defaultBuildLocation(route: Route): string;
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shows antd notification with button
|
|
3
|
+
*
|
|
4
|
+
* @param description Notification message
|
|
5
|
+
* @param buttonText Displayed text on button
|
|
6
|
+
* @param duration How long notification will be shown
|
|
7
|
+
* @param onButtonClick Button callback
|
|
8
|
+
* @param key Used for updating existing notification instead of showing new one.
|
|
9
|
+
* If omitted, following template will be used to generate unique key: `notification_${Date.now}`
|
|
10
|
+
*/
|
|
11
|
+
export declare const openButtonWarningNotification: (description: string, buttonText: string, duration?: number, onButtonClick?: () => void, key?: string) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Operation, OperationGroup, OperationTypeCrud } from '../interfaces/operation';
|
|
2
|
+
import { Store } from '../interfaces/store';
|
|
3
|
+
import { ActionPayloadTypes } from '../actions/actions';
|
|
4
|
+
/**
|
|
5
|
+
* Extract operations from all operations groups and return them as an array of flat operations
|
|
6
|
+
*
|
|
7
|
+
* @param operations Operations or operation groups as received from row meta
|
|
8
|
+
* @category Utils
|
|
9
|
+
*/
|
|
10
|
+
export declare function flattenOperations(operations: Array<Operation | OperationGroup>): Operation[];
|
|
11
|
+
/**
|
|
12
|
+
* Check if an operation matches a specified `role` directly by type or by `actionRole` field.
|
|
13
|
+
*
|
|
14
|
+
* If operation role is unavailable due to the store lacking an appropriate row meta, only `role` is checked.
|
|
15
|
+
*
|
|
16
|
+
* @param role Expected operation role or 'none' if operation shouldn't match any crud role
|
|
17
|
+
* @param payload sendOperation action payload
|
|
18
|
+
* @param store Store instance
|
|
19
|
+
* @category Utils
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchOperationRole(role: OperationTypeCrud | 'none' | string, payload: ActionPayloadTypes['sendOperation'], store: Store): boolean;
|
package/utils/redux.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Dispatch, ReducersMapObject, Reducer } from 'redux';
|
|
2
|
+
import { MapDispatchToPropsFactory } from 'react-redux';
|
|
3
|
+
import { CombinedReducersMapObject } from '../interfaces/store';
|
|
4
|
+
import { AnyAction } from '../actions/actions';
|
|
5
|
+
/**
|
|
6
|
+
* Combines a dictionary of reducers for different slices of the store into one
|
|
7
|
+
* root reducer.
|
|
8
|
+
*
|
|
9
|
+
* Effectively works like default redux `combineReducers` but provides access to the store
|
|
10
|
+
* via the third argument to allow reducers read only access to other slices
|
|
11
|
+
* (simplifies callbacks, epics and actions' payloads).
|
|
12
|
+
*
|
|
13
|
+
* @param reducers A dictionary of reducers for different slices of the redux store
|
|
14
|
+
* @category Utils
|
|
15
|
+
*/
|
|
16
|
+
export declare function combineReducers<State>(reducers: ReducersMapObject<State, AnyAction> | CombinedReducersMapObject<State, AnyAction>): Reducer<State, AnyAction>;
|
|
17
|
+
/**
|
|
18
|
+
* Shallow compare of two dictionaries by strict comparison.
|
|
19
|
+
* `ignore` argument can be used to forcefully exclude some properties from result set even if their
|
|
20
|
+
* are different.
|
|
21
|
+
*
|
|
22
|
+
* TODO: Check if possible to replace with `shallowEqual` from `react-redux`
|
|
23
|
+
*
|
|
24
|
+
* @param prevProps
|
|
25
|
+
* @param nextProps
|
|
26
|
+
* @param ignore
|
|
27
|
+
*/
|
|
28
|
+
export declare function shallowCompare(prevProps: Record<string, any>, nextProps: Record<string, any>, ignore?: string[]): string[];
|
|
29
|
+
/**
|
|
30
|
+
* TODO: JSDoc
|
|
31
|
+
*/
|
|
32
|
+
declare class ActionsContext<T> {
|
|
33
|
+
/**
|
|
34
|
+
* TODO
|
|
35
|
+
*/
|
|
36
|
+
dispatch: Dispatch<any>;
|
|
37
|
+
/**
|
|
38
|
+
* TODO
|
|
39
|
+
*/
|
|
40
|
+
props: T;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* TODO: JSDoc
|
|
44
|
+
*
|
|
45
|
+
* @param contextCreator
|
|
46
|
+
* @param actionsCreator
|
|
47
|
+
*/
|
|
48
|
+
export declare function createMapDispatchToProps<ContextProps, Actions, OwnProps>(contextCreator: (props: OwnProps) => ContextProps, actionsCreator: (context: ActionsContext<ContextProps>) => Actions): MapDispatchToPropsFactory<Actions, OwnProps>;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Store } from '../interfaces/store';
|
|
2
|
+
import { DataItem } from '../interfaces/data';
|
|
3
|
+
/**
|
|
4
|
+
* TODO
|
|
5
|
+
*
|
|
6
|
+
* @param literals
|
|
7
|
+
* @param placeholders
|
|
8
|
+
*/
|
|
9
|
+
export declare function getTemplate(literals: TemplateStringsArray, ...placeholders: any[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* Forms a string representation of business components hierarchy with
|
|
12
|
+
* respect to business components ancestors and their corresponding cursors
|
|
13
|
+
*
|
|
14
|
+
* @param bcName Business component name
|
|
15
|
+
* @param includeSelf If result hierarchy should include target bc or only ancestors
|
|
16
|
+
* @param store
|
|
17
|
+
* @category Utils
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildBcUrl(bcName: string, includeSelf?: boolean, store?: Store): string;
|
|
20
|
+
/**
|
|
21
|
+
* If there is a template in the field name then returns the formatted string
|
|
22
|
+
*
|
|
23
|
+
* @param title Field name
|
|
24
|
+
* @param dataItem An object in the fields of which tokens should be searched
|
|
25
|
+
*/
|
|
26
|
+
export declare function getFieldTitle(title: string, dataItem?: DataItem): string;
|
|
27
|
+
/**
|
|
28
|
+
* If there is a template in the field name then returns array of string
|
|
29
|
+
*
|
|
30
|
+
* Example:
|
|
31
|
+
* splitIntoTokens(`The quick brown fox jumps over the lazy dog. If the dog reacted, was it realdogly lazy?`, 'dog')
|
|
32
|
+
* ["The quick brown fox jumps over the lazy ", "dog", ". If the ", "dog", " reacted, was it real", "dog", "ly lazy?"]
|
|
33
|
+
*
|
|
34
|
+
* @param source Field name
|
|
35
|
+
* @param search An object in the fields of which tokens should be searched
|
|
36
|
+
*/
|
|
37
|
+
export declare function splitIntoTokens(source: string, search: string | RegExp): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Convert string to RegExp
|
|
40
|
+
*
|
|
41
|
+
* @param str Source string
|
|
42
|
+
*/
|
|
43
|
+
export declare function escapedSrc(str: string): RegExp;
|
package/utils/tree.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module contains utilities for tree-like structures
|
|
3
|
+
*/
|
|
4
|
+
import { DataNode, TreeNodeBidirectional, TreeNodeDescending } from '../interfaces/tree';
|
|
5
|
+
/**
|
|
6
|
+
* Assigns for each element:
|
|
7
|
+
*
|
|
8
|
+
* - `parent` property, which is a reference to parent mode found through `parentId` match.
|
|
9
|
+
* - `children` property, which is an array of references to child nodes.
|
|
10
|
+
*
|
|
11
|
+
* `parentId`: '0' considered a root pseudo-node
|
|
12
|
+
*
|
|
13
|
+
* Orphaned records will be excluded from result and throw a console warning.
|
|
14
|
+
*
|
|
15
|
+
* @param flat Flat array representation of tree structure
|
|
16
|
+
* @returns New array
|
|
17
|
+
*/
|
|
18
|
+
export declare function assignTreeLinks<T extends DataNode>(flat: T[]): (T & TreeNodeBidirectional)[];
|
|
19
|
+
/**
|
|
20
|
+
* Recursively traverse through each node and their descendant to aggregate ids of all
|
|
21
|
+
* descendant nodes into `result` array.
|
|
22
|
+
*
|
|
23
|
+
* @param nodes Nodes to start search from; their ids also will be part of the result
|
|
24
|
+
* @param result An array of ids for found descendant nodes
|
|
25
|
+
*/
|
|
26
|
+
export declare function getDescendants(nodes: TreeNodeDescending[], result: string[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Returns array of matching nodes, their direct children and every ancestor node
|
|
29
|
+
*
|
|
30
|
+
* @param nodes An array to search
|
|
31
|
+
* @param matchingNodes Ids of the nodes to match
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildSearchResultTree<T extends TreeNodeBidirectional = TreeNodeBidirectional>(nodes: T[], matchingNodes: string[]): T[];
|
|
34
|
+
/**
|
|
35
|
+
* Presort items based on their `level` property: each parent is followed by its descendant.
|
|
36
|
+
* Items with level `1` considered to be root-level items.
|
|
37
|
+
*
|
|
38
|
+
* Notice: not very performant and almost always wasted as Cxbox API mostly returns already
|
|
39
|
+
* sorted data.
|
|
40
|
+
*
|
|
41
|
+
* @param data Unsorted data
|
|
42
|
+
*/
|
|
43
|
+
export declare function presort(data: TreeNodeBidirectional[]): TreeNodeBidirectional[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MenuItem, ViewNavigationCategory, NavigationTab } from '../interfaces/navigation';
|
|
2
|
+
/**
|
|
3
|
+
* Return navigation tabs array appropriate for specified level of navigation and currently active view
|
|
4
|
+
*
|
|
5
|
+
* @param navigation Navigation `menu` description from screen meta model
|
|
6
|
+
* @param level Target level of navigation
|
|
7
|
+
* @param activeView Currently active view
|
|
8
|
+
*/
|
|
9
|
+
export declare function getViewTabs(navigation: Array<Exclude<MenuItem, ViewNavigationCategory>>, level: number, activeView?: string): NavigationTab[];
|
|
10
|
+
/**
|
|
11
|
+
* Return matching navigation tab for provided navigation item:
|
|
12
|
+
* - view name if item is just a view
|
|
13
|
+
* - group title and referenced view name, where view is found by breadth-first search through group children
|
|
14
|
+
* for default view if `defaultView` is specified on group or first available view otherwise.
|
|
15
|
+
*
|
|
16
|
+
* TODO: Change Exclude<MenuItem, ViewNavigationCategory> to MenuItem in 2.0.0
|
|
17
|
+
*
|
|
18
|
+
* @param navigationItem
|
|
19
|
+
*/
|
|
20
|
+
export declare function getReferencedView(navigationItem: Readonly<Exclude<MenuItem, ViewNavigationCategory>>): string;
|