@cxbox-ui/core 2.0.0-alpha.7 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +261 -28
- package/dist/core.d.ts +4274 -0
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -0
- package/package.json +19 -30
- package/dist/actions/index.d.ts +0 -1081
- package/dist/api/ObservableApi.d.ts +0 -53
- package/dist/api/ObservableApiWrapper.d.ts +0 -11
- package/dist/api/index.d.ts +0 -1
- package/dist/cxbox-ui-core.cjs.development.js +0 -3674
- package/dist/cxbox-ui-core.cjs.production.min.js +0 -2
- package/dist/cxbox-ui-core.esm.js +0 -3638
- package/dist/cxbox-ui-core.modern.development.js +0 -3568
- package/dist/cxbox-ui-core.modern.js +0 -3568
- package/dist/cxbox-ui-core.modern.production.min.js +0 -2
- package/dist/epics/data/bcCancelCreateDataEpic.d.ts +0 -9
- package/dist/epics/data/bcDeleteDataEpic.d.ts +0 -2
- package/dist/epics/data/bcFetchDataEpic.d.ts +0 -15
- package/dist/epics/data/bcFetchRowMetaRequestEpic.d.ts +0 -17
- package/dist/epics/data/bcLoadMoreEpic.d.ts +0 -2
- package/dist/epics/data/bcNewDataEpic.d.ts +0 -14
- package/dist/epics/data/bcSaveDataEpic.d.ts +0 -24
- package/dist/epics/data/bcSelectDepthRecordEpic.d.ts +0 -2
- package/dist/epics/data/bcSelectRecordEpic.d.ts +0 -2
- package/dist/epics/data/changeAssociationEpic.d.ts +0 -2
- package/dist/epics/data/changeAssociationFullEpic.d.ts +0 -5
- package/dist/epics/data/changeAssociationSameBcEpic.d.ts +0 -5
- package/dist/epics/data/changeChildrenAssociationsEpic.d.ts +0 -2
- package/dist/epics/data/changeChildrenAssociationsSameBcEpic.d.ts +0 -2
- package/dist/epics/data/changeDescendantsAssociationsFullEpic.d.ts +0 -5
- package/dist/epics/data/index.d.ts +0 -20
- package/dist/epics/data/inlinePickListFetchDataEpic.d.ts +0 -2
- package/dist/epics/data/removeMultivalueTagEpic.d.ts +0 -17
- package/dist/epics/data/saveAssociationsActiveEpic.d.ts +0 -7
- package/dist/epics/data/saveAssociationsPassiveEpic.d.ts +0 -7
- package/dist/epics/data/selectViewEpic.d.ts +0 -11
- package/dist/epics/index.d.ts +0 -6
- package/dist/epics/router/changeLocationEpic.d.ts +0 -10
- package/dist/epics/router/drilldownEpic.d.ts +0 -2
- package/dist/epics/router/handleRouterEpic.d.ts +0 -2
- package/dist/epics/router/index.d.ts +0 -10
- package/dist/epics/router/loginDoneEpic.d.ts +0 -9
- package/dist/epics/router/selectScreenEpic.d.ts +0 -7
- package/dist/epics/router/selectScreenFailEpic.d.ts +0 -7
- package/dist/epics/router/selectViewEpic.d.ts +0 -7
- package/dist/epics/router/selectViewFailEpic.d.ts +0 -6
- package/dist/epics/router/userDrillDownEpic.d.ts +0 -6
- package/dist/epics/router/userDrilldownChangeCursorsEpic.d.ts +0 -2
- package/dist/epics/screen/apiErrorEpic.d.ts +0 -2
- package/dist/epics/screen/downloadFileByUrlEpic.d.ts +0 -2
- package/dist/epics/screen/downloadFileEpic.d.ts +0 -2
- package/dist/epics/screen/httpError401Epic.d.ts +0 -2
- package/dist/epics/screen/httpError409Epic.d.ts +0 -2
- package/dist/epics/screen/httpError418Epic.d.ts +0 -2
- package/dist/epics/screen/httpError500Epic.d.ts +0 -2
- package/dist/epics/screen/httpErrorDefaultEpic.d.ts +0 -2
- package/dist/epics/screen/index.d.ts +0 -10
- package/dist/epics/screen/processPostInvokeConfirmEpic.d.ts +0 -2
- package/dist/epics/screen/processPostInvokeEpic.d.ts +0 -2
- package/dist/epics/session/index.d.ts +0 -5
- package/dist/epics/session/loginByAnotherRoleEpic.d.ts +0 -5
- package/dist/epics/session/loginDoneEpic.d.ts +0 -6
- package/dist/epics/session/refreshMetaAndReloadPageEpic.d.ts +0 -2
- package/dist/epics/session/refreshMetaEpic.d.ts +0 -5
- package/dist/epics/session/switchRoleEpic.d.ts +0 -5
- package/dist/epics/utils/postOperationRoutine.d.ts +0 -13
- package/dist/epics/view/clearPendingDataChangesAfterCursorChangeEpic.d.ts +0 -7
- package/dist/epics/view/fileUploadConfirmEpic.d.ts +0 -11
- package/dist/epics/view/getRowMetaByForceActiveEpic.d.ts +0 -5
- package/dist/epics/view/index.d.ts +0 -9
- package/dist/epics/view/selectTableCellInitEpic.d.ts +0 -2
- package/dist/epics/view/sendOperationAssociateEpic.d.ts +0 -5
- package/dist/epics/view/sendOperationEpic.d.ts +0 -10
- package/dist/epics/view/showAllTableRecordsInitEpic.d.ts +0 -2
- package/dist/epics/view/showAssocPopupEpic.d.ts +0 -2
- package/dist/epics/view/showFileUploadPopupEpic.d.ts +0 -5
- package/dist/index.d.ts +0 -7
- package/dist/interfaces/bc.d.ts +0 -79
- package/dist/interfaces/customEpics.d.ts +0 -15
- package/dist/interfaces/customMiddlewares.d.ts +0 -35
- package/dist/interfaces/data.d.ts +0 -48
- package/dist/interfaces/filters.d.ts +0 -32
- package/dist/interfaces/index.d.ts +0 -27
- package/dist/interfaces/navigation.d.ts +0 -48
- package/dist/interfaces/objectMap.d.ts +0 -36
- package/dist/interfaces/operation.d.ts +0 -336
- package/dist/interfaces/router.d.ts +0 -17
- package/dist/interfaces/rowMeta.d.ts +0 -74
- package/dist/interfaces/screen.d.ts +0 -28
- package/dist/interfaces/session.d.ts +0 -83
- package/dist/interfaces/store.d.ts +0 -14
- package/dist/interfaces/tree.d.ts +0 -66
- package/dist/interfaces/view.d.ts +0 -202
- package/dist/interfaces/widget.d.ts +0 -209
- package/dist/middlewares/autosaveMiddleware.d.ts +0 -2
- package/dist/middlewares/index.d.ts +0 -6
- package/dist/middlewares/popupMiddleware.d.ts +0 -2
- package/dist/middlewares/preInvokeMiddleware.d.ts +0 -5
- package/dist/middlewares/requiredFieldsMiddleware.d.ts +0 -30
- package/dist/reducers/ReducerBuilderManager.d.ts +0 -19
- package/dist/reducers/data.d.ts +0 -4
- package/dist/reducers/depthData.d.ts +0 -4
- package/dist/reducers/index.d.ts +0 -6
- package/dist/reducers/router.d.ts +0 -9
- package/dist/reducers/screen.d.ts +0 -10
- package/dist/reducers/session.d.ts +0 -10
- package/dist/reducers/view.d.ts +0 -10
- package/dist/utils/api.d.ts +0 -25
- package/dist/utils/apiError.d.ts +0 -19
- package/dist/utils/autosave.d.ts +0 -37
- package/dist/utils/bc.d.ts +0 -27
- package/dist/utils/breadthFirst.d.ts +0 -21
- package/dist/utils/cancelRequestEpic.d.ts +0 -27
- package/dist/utils/combineMiddlewares.d.ts +0 -3
- package/dist/utils/deleteUndefinedFromObject.d.ts +0 -1
- package/dist/utils/exportState.d.ts +0 -0
- package/dist/utils/extendPopupWidgetTypes.d.ts +0 -8
- package/dist/utils/filters.d.ts +0 -63
- package/dist/utils/hierarchy.d.ts +0 -17
- package/dist/utils/highlightJson.d.ts +0 -12
- package/dist/utils/history.d.ts +0 -50
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/operations.d.ts +0 -21
- package/dist/utils/others.d.ts +0 -6
- package/dist/utils/strings.d.ts +0 -44
- package/dist/utils/tree.d.ts +0 -43
- package/dist/utils/viewTabs.d.ts +0 -20
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { AnyAction } from 'redux';
|
|
3
|
-
import { isAnyOf } from '@reduxjs/toolkit';
|
|
4
|
-
/**
|
|
5
|
-
* Type tweak for backward @reduxjs/toolkit compatibility
|
|
6
|
-
*/
|
|
7
|
-
type TypeGuard<T> = (value: any) => value is T;
|
|
8
|
-
interface HasMatchFunction<T> {
|
|
9
|
-
match: TypeGuard<T>;
|
|
10
|
-
}
|
|
11
|
-
/** @public */
|
|
12
|
-
type Matcher<T> = HasMatchFunction<T> | TypeGuard<T>;
|
|
13
|
-
/**
|
|
14
|
-
* Default list of action types which are triggers for request cancel
|
|
15
|
-
*/
|
|
16
|
-
export declare const cancelRequestActionTypes: [Matcher<any>, ...Matcher<any>[]];
|
|
17
|
-
/**
|
|
18
|
-
* Creator of request cancel epic
|
|
19
|
-
*
|
|
20
|
-
* @param action$ an observable input
|
|
21
|
-
* @param actionTypes list of action types which triggers cancel
|
|
22
|
-
* @param cancelFn a callback of request cancelation
|
|
23
|
-
* @param cancelActionCreator an action creator which called by request cancelation
|
|
24
|
-
* @param filterFn a callback function which filters come actions
|
|
25
|
-
*/
|
|
26
|
-
export declare function cancelRequestEpic(action$: Observable<AnyAction>, actionTypes: Parameters<typeof isAnyOf>, cancelFn: (() => void) | undefined, cancelActionCreator: AnyAction, filterFn?: (actions: AnyAction) => boolean): Observable<AnyAction>;
|
|
27
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Middleware } from 'redux';
|
|
2
|
-
import { CustomMiddlewares, CoreMiddlewares } from '../interfaces/customMiddlewares';
|
|
3
|
-
export declare function combineMiddlewares(coreMiddlewares: CoreMiddlewares, customMiddlewares?: CustomMiddlewares): Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function deleteUndefinedFromObject(obj: Record<string, any>): void;
|
|
File without changes
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CustomWidgetDescriptor } from '../interfaces/widget';
|
|
2
|
-
/**
|
|
3
|
-
* Add new values to `PopupWidgetTypes` from client application
|
|
4
|
-
*
|
|
5
|
-
* @param customWidgets client's widgets
|
|
6
|
-
*/
|
|
7
|
-
declare function extendPopupWidgetTypes(customWidgets: Record<string, CustomWidgetDescriptor>): void;
|
|
8
|
-
export default extendPopupWidgetTypes;
|
package/dist/utils/filters.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { BcFilter, BcSorter, FilterType, FieldType } from '../interfaces';
|
|
2
|
-
/**
|
|
3
|
-
* Maps an input array of BcFilter objects into a dictionary of GET-request params
|
|
4
|
-
*
|
|
5
|
-
* Name of the param formed as field name and filter type, separated by dot,
|
|
6
|
-
* e.g. `${filter.fieldName}.${filter.type}`
|
|
7
|
-
*
|
|
8
|
-
* Value of the param is:
|
|
9
|
-
* - for non-array values, stringified filter value
|
|
10
|
-
* - for array values, a comma-separated list of stringified elements with each element enclosed in double quotes
|
|
11
|
-
*
|
|
12
|
-
* @see {@link parseFilters} Reverse function
|
|
13
|
-
*
|
|
14
|
-
* @param filters Filters for business components
|
|
15
|
-
* @returns Dictionary of query-params for GET-request
|
|
16
|
-
* @category Utils
|
|
17
|
-
*/
|
|
18
|
-
export declare function getFilters(filters: BcFilter[]): Record<string, string>;
|
|
19
|
-
/**
|
|
20
|
-
* Maps an input array of business component sorters into a dictionary of query params for
|
|
21
|
-
* Cxbox API, where values are field names and keys follows the template:
|
|
22
|
-
* `_sort.${index}.${item.direction}`
|
|
23
|
-
*
|
|
24
|
-
* @param sorters Array of business component sorters
|
|
25
|
-
* @returns Dictionary of query-params for GET-request
|
|
26
|
-
* @category Utils
|
|
27
|
-
*/
|
|
28
|
-
export declare function getSorters(sorters: BcSorter[]): Record<string, string>;
|
|
29
|
-
/**
|
|
30
|
-
* Function for parsing filters from string into BcFilter type
|
|
31
|
-
*
|
|
32
|
-
* @see {@link getFilters} Reverse function
|
|
33
|
-
* @param defaultFilters string representation of filters
|
|
34
|
-
* @category Utils
|
|
35
|
-
*/
|
|
36
|
-
export declare function parseFilters(defaultFilters?: string): BcFilter[];
|
|
37
|
-
/**
|
|
38
|
-
* Parse sorter string into separate sorter objects.
|
|
39
|
-
* String representation of sorters is url based:
|
|
40
|
-
* "_sort.{order}.{direction}={fieldKey}&_sort.{order}.{direction}"
|
|
41
|
-
*
|
|
42
|
-
* fieldKey Sort by field
|
|
43
|
-
* order Priority of this specfic sorter
|
|
44
|
-
* direction "asc" or "desc"
|
|
45
|
-
*
|
|
46
|
-
* i.e. "_sort.0.asc=firstName"
|
|
47
|
-
*
|
|
48
|
-
* @param sorters string representation of sorters
|
|
49
|
-
* @category Utils
|
|
50
|
-
*/
|
|
51
|
-
export declare function parseSorters(sorters?: string): BcSorter[];
|
|
52
|
-
/**
|
|
53
|
-
* Returns appropriate filtration type for specified field type.
|
|
54
|
-
*
|
|
55
|
-
* - Text-based fields use `contains`
|
|
56
|
-
* - Checkbox fields use `specified` (boolean)
|
|
57
|
-
* - Dictionary fiels use `equalsOneOf`
|
|
58
|
-
*
|
|
59
|
-
* All other field types use strict `equals`
|
|
60
|
-
*
|
|
61
|
-
* @param fieldType Field type
|
|
62
|
-
*/
|
|
63
|
-
export declare function getFilterType(fieldType: FieldType): FilterType.equals | FilterType.contains | FilterType.specified | FilterType.equalsOneOf;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RowMetaField } from '../interfaces/rowMeta';
|
|
2
|
-
import { WidgetListField } from '../interfaces/widget';
|
|
3
|
-
/**
|
|
4
|
-
* Function of calculate hierarchy column width
|
|
5
|
-
*
|
|
6
|
-
* @param columnName Witch column is match
|
|
7
|
-
* @param depthLevel Hierarchy level
|
|
8
|
-
* @param fields Widget fields
|
|
9
|
-
* @param rowMetaFields Widget field meta
|
|
10
|
-
* @param maxDepth Maximum hierarchy depth level
|
|
11
|
-
* @param width Custom column width
|
|
12
|
-
*
|
|
13
|
-
* function return string value as number with 'px' or null
|
|
14
|
-
* example '100px'
|
|
15
|
-
* Last column dont math width and return null value
|
|
16
|
-
*/
|
|
17
|
-
export declare function getColumnWidth(columnName: string, depthLevel: number, fields: WidgetListField[], rowMetaFields: RowMetaField[], maxDepth: number, width?: number): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
package/dist/utils/history.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for urls and browser history
|
|
3
|
-
*/
|
|
4
|
-
import { Route } from '../interfaces';
|
|
5
|
-
/**
|
|
6
|
-
* Appends '/' in front of `absoluteUrl` argument.
|
|
7
|
-
* If `absoluteUrl` alredy starts with `/` then argument returned without changes.
|
|
8
|
-
*
|
|
9
|
-
* @param absoluteUrl Url
|
|
10
|
-
*/
|
|
11
|
-
export declare function makeRelativeUrl(absoluteUrl: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Parses a business component hierarchy url into a dictionary of business components
|
|
14
|
-
* and their cursors.
|
|
15
|
-
*
|
|
16
|
-
* @param bcPath Business component hierarchy url, e.g. `bcName1/cursor1/bcName2/cursor2`
|
|
17
|
-
* @category Utils
|
|
18
|
-
*/
|
|
19
|
-
export declare function parseBcCursors(bcPath: string): Record<string, string>;
|
|
20
|
-
/**
|
|
21
|
-
* TODO
|
|
22
|
-
*
|
|
23
|
-
* @param literals
|
|
24
|
-
* @param placeholders
|
|
25
|
-
* @category Utils
|
|
26
|
-
*/
|
|
27
|
-
export declare function buildUrl(literals: TemplateStringsArray, ...placeholders: Array<string | number>): string;
|
|
28
|
-
/**
|
|
29
|
-
* Default implementation for utility to parse `history`-compatible location to {@link Route | Cxbox UI route}.
|
|
30
|
-
*
|
|
31
|
-
* Supports three types of URLs:
|
|
32
|
-
* - {@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/`;
|
|
33
|
-
* - {@link RouteType.router | RouteType.router}, i.e. an url without information about entity that should be handled on server side. Example: `/router/server-entity`
|
|
34
|
-
* - {@link RouteType.default | RouteType.default}, i.e. an url that leads to default entity of the application. Example: `/`
|
|
35
|
-
*
|
|
36
|
-
* Reverse function is {@link defaultBuildURL}.
|
|
37
|
-
*
|
|
38
|
-
* @category Utils
|
|
39
|
-
*/
|
|
40
|
-
export declare function defaultParseURL(url: URL): Route;
|
|
41
|
-
/**
|
|
42
|
-
* Transform {@link Route | Cxbox UI route} to string url.
|
|
43
|
-
*
|
|
44
|
-
* Reverse function is {@link defaultParseURL}.
|
|
45
|
-
*
|
|
46
|
-
* @param route Cxbox UI route
|
|
47
|
-
* @category Utils
|
|
48
|
-
*/
|
|
49
|
-
export declare function defaultBuildURL(route: Route): string;
|
|
50
|
-
export declare const getRouteFromString: (ulrString: string) => Route;
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './api';
|
|
2
|
-
export * from './apiError';
|
|
3
|
-
export * from './strings';
|
|
4
|
-
export * from './history';
|
|
5
|
-
export * from './filters';
|
|
6
|
-
export * from './operations';
|
|
7
|
-
export * from './bc';
|
|
8
|
-
export * from './tree';
|
|
9
|
-
export * from './breadthFirst';
|
|
10
|
-
export * from './deleteUndefinedFromObject';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Operation, OperationGroup, OperationTypeCrud } from '../interfaces/operation';
|
|
2
|
-
import { Store } from '../interfaces/store';
|
|
3
|
-
import { sendOperation } from '../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: ReturnType<typeof sendOperation>['payload'], store: Store): boolean;
|
package/dist/utils/others.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FieldType, MultivalueFieldMeta, PickListFieldMeta } from '@cxbox-ui/schema';
|
|
2
|
-
export declare function isMultivalueField(fieldType: FieldType): boolean;
|
|
3
|
-
export declare function getPopupAssocKeys(fieldMeta: MultivalueFieldMeta | PickListFieldMeta): {
|
|
4
|
-
assocValueKey: string;
|
|
5
|
-
associateFieldKey: string;
|
|
6
|
-
};
|
package/dist/utils/strings.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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 state
|
|
17
|
-
* @category Utils
|
|
18
|
-
*/
|
|
19
|
-
export declare function buildBcUrl(bcName: string, includeSelf: boolean, state: Store): string;
|
|
20
|
-
export declare function splitBcUrl(bcUrl: string): string[];
|
|
21
|
-
/**
|
|
22
|
-
* If there is a template in the field name then returns the formatted string
|
|
23
|
-
*
|
|
24
|
-
* @param title Field name
|
|
25
|
-
* @param dataItem An object in the fields of which tokens should be searched
|
|
26
|
-
*/
|
|
27
|
-
export declare function getFieldTitle(title: string, dataItem?: DataItem): string;
|
|
28
|
-
/**
|
|
29
|
-
* If there is a template in the field name then returns array of string
|
|
30
|
-
*
|
|
31
|
-
* Example:
|
|
32
|
-
* splitIntoTokens(`The quick brown fox jumps over the lazy dog. If the dog reacted, was it realdogly lazy?`, 'dog')
|
|
33
|
-
* ["The quick brown fox jumps over the lazy ", "dog", ". If the ", "dog", " reacted, was it real", "dog", "ly lazy?"]
|
|
34
|
-
*
|
|
35
|
-
* @param source Field name
|
|
36
|
-
* @param search An object in the fields of which tokens should be searched
|
|
37
|
-
*/
|
|
38
|
-
export declare function splitIntoTokens(source: string, search: string | RegExp): string[];
|
|
39
|
-
/**
|
|
40
|
-
* Convert string to RegExp
|
|
41
|
-
*
|
|
42
|
-
* @param str Source string
|
|
43
|
-
*/
|
|
44
|
-
export declare function escapedSrc(str: string): RegExp;
|
package/dist/utils/tree.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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.ts.
|
|
40
|
-
*
|
|
41
|
-
* @param data Unsorted data.ts
|
|
42
|
-
*/
|
|
43
|
-
export declare function presort(data: TreeNodeBidirectional[]): TreeNodeBidirectional[];
|
package/dist/utils/viewTabs.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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;
|