@cccteam/ccc-lib 0.0.20 → 0.0.21
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/fesm2022/cccteam-ccc-lib-ccc-resource.mjs +48 -165
- package/fesm2022/cccteam-ccc-lib-ccc-resource.mjs.map +1 -1
- package/fesm2022/cccteam-ccc-lib-guards.mjs +32 -0
- package/fesm2022/cccteam-ccc-lib-guards.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-resource-nav.mjs +30 -0
- package/fesm2022/cccteam-ccc-lib-resource-nav.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-resource-route-generator.mjs +61 -0
- package/fesm2022/cccteam-ccc-lib-resource-route-generator.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-types.mjs.map +1 -1
- package/package.json +13 -1
- package/types/cccteam-ccc-lib-ccc-resource.d.ts +10 -38
- package/types/cccteam-ccc-lib-guards.d.ts +11 -0
- package/types/cccteam-ccc-lib-resource-nav.d.ts +13 -0
- package/types/cccteam-ccc-lib-resource-route-generator.d.ts +6 -0
- package/types/cccteam-ccc-lib-types.d.ts +44 -43
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { inject } from '@angular/core';
|
|
2
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
3
|
+
import { AuthService } from '@cccteam/ccc-lib/auth-service';
|
|
4
|
+
import { FormStateService, LeavePageConfirmationModalComponent } from '@cccteam/ccc-lib/ccc-resource';
|
|
5
|
+
import { tap, firstValueFrom } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
const canDeactivateGuard = async (_, __, ___, nextState) => {
|
|
8
|
+
const auth = inject(AuthService);
|
|
9
|
+
const dialog = inject(MatDialog);
|
|
10
|
+
const formStateService = inject(FormStateService);
|
|
11
|
+
if (nextState?.url.includes(auth.loginRoute())) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (!formStateService.isDirty()) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
const existingDialog = dialog.openDialogs.find((d) => d.componentInstance instanceof LeavePageConfirmationModalComponent);
|
|
18
|
+
const dialogRef = existingDialog ?? dialog.open(LeavePageConfirmationModalComponent, { delayFocusTrap: false });
|
|
19
|
+
const result = dialogRef.afterClosed().pipe(tap((value) => {
|
|
20
|
+
if (value === true) {
|
|
21
|
+
formStateService.resetDirtyForms();
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
return firstValueFrom(result);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Generated bundle index. Do not edit.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export { canDeactivateGuard };
|
|
32
|
+
//# sourceMappingURL=cccteam-ccc-lib-guards.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cccteam-ccc-lib-guards.mjs","sources":["../../../projects/ccc-lib/guards/can-deactivate.guard.ts","../../../projects/ccc-lib/guards/cccteam-ccc-lib-guards.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { CanDeactivateFn, UrlTree } from '@angular/router';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\nimport { FormStateService, LeavePageConfirmationModalComponent } from '@cccteam/ccc-lib/ccc-resource';\nimport { firstValueFrom, Observable, tap } from 'rxjs';\n\nexport type CanDeactivateType = Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;\n\nexport interface CanComponentDeactivate {\n canDeactivate: () => CanDeactivateType;\n}\n\nexport const canDeactivateGuard: CanDeactivateFn<CanComponentDeactivate> = async (_, __, ___, nextState) => {\n const auth = inject(AuthService);\n const dialog = inject(MatDialog);\n const formStateService = inject(FormStateService);\n\n if (nextState?.url.includes(auth.loginRoute())) {\n return true;\n }\n\n if (!formStateService.isDirty()) {\n return true;\n }\n\n const existingDialog = dialog.openDialogs.find(\n (d) => d.componentInstance instanceof LeavePageConfirmationModalComponent,\n );\n\n const dialogRef = existingDialog ?? dialog.open(LeavePageConfirmationModalComponent, { delayFocusTrap: false });\n\n const result = dialogRef.afterClosed().pipe(\n tap((value) => {\n if (value === true) {\n formStateService.resetDirtyForms();\n }\n }),\n );\n\n return firstValueFrom(result);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAaO,MAAM,kBAAkB,GAA4C,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,KAAI;AACzG,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAChC,IAAA,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAEjD,IAAA,IAAI,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE;AAC9C,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE;AAC/B,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAC5C,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,YAAY,mCAAmC,CAC1E;AAED,IAAA,MAAM,SAAS,GAAG,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,mCAAmC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AAE/G,IAAA,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CACzC,GAAG,CAAC,CAAC,KAAK,KAAI;AACZ,QAAA,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,gBAAgB,CAAC,eAAe,EAAE;QACpC;IACF,CAAC,CAAC,CACH;AAED,IAAA,OAAO,cAAc,CAAC,MAAM,CAAC;AAC/B;;ACzCA;;AAEG;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const generatedNavItems = [];
|
|
2
|
+
const generatedNavGroups = [];
|
|
3
|
+
/**
|
|
4
|
+
* Adds a navigation item to the generated nav items array.
|
|
5
|
+
*/
|
|
6
|
+
function addNavItem(nav, route) {
|
|
7
|
+
nav.navItem.route = [route];
|
|
8
|
+
if (!nav.group) {
|
|
9
|
+
generatedNavItems.push(nav.navItem);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (!generatedNavGroups.includes(nav.group)) {
|
|
13
|
+
generatedNavGroups.push(nav.group);
|
|
14
|
+
}
|
|
15
|
+
let groupItem = generatedNavItems.find((item) => item.label === nav.group);
|
|
16
|
+
if (!groupItem) {
|
|
17
|
+
groupItem = { label: nav.group, children: [] };
|
|
18
|
+
generatedNavItems.push(groupItem);
|
|
19
|
+
}
|
|
20
|
+
groupItem.children = groupItem.children || [];
|
|
21
|
+
groupItem.children.push(nav.navItem);
|
|
22
|
+
generatedNavItems.sort((a, b) => (a.label > b.label ? -1 : 1));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Generated bundle index. Do not edit.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export { addNavItem, generatedNavGroups, generatedNavItems };
|
|
30
|
+
//# sourceMappingURL=cccteam-ccc-lib-resource-nav.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cccteam-ccc-lib-resource-nav.mjs","sources":["../../../projects/ccc-lib/resource-nav/index.ts","../../../projects/ccc-lib/resource-nav/cccteam-ccc-lib-resource-nav.ts"],"sourcesContent":["import { MenuItem } from '@cccteam/ccc-lib/types';\n\nexport const generatedNavItems: MenuItem[] = [];\nexport const generatedNavGroups: string[] = [];\n\n/**\n * Adds a navigation item to the generated nav items array.\n */\nexport function addNavItem(\n nav: {\n navItem: MenuItem;\n group?: string;\n },\n route: string,\n): void {\n nav.navItem.route = [route];\n\n if (!nav.group) {\n generatedNavItems.push(nav.navItem);\n return;\n }\n\n if (!generatedNavGroups.includes(nav.group)) {\n generatedNavGroups.push(nav.group);\n }\n\n let groupItem = generatedNavItems.find((item) => item.label === nav.group);\n\n if (!groupItem) {\n groupItem = { label: nav.group, children: [] };\n generatedNavItems.push(groupItem);\n }\n\n groupItem.children = groupItem.children || [];\n groupItem.children.push(nav.navItem);\n\n generatedNavItems.sort((a, b) => (a.label > b.label ? -1 : 1));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB,GAAe;AACtC,MAAM,kBAAkB,GAAa;AAE5C;;AAEG;AACG,SAAU,UAAU,CACxB,GAGC,EACD,KAAa,EAAA;IAEb,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;AAE3B,IAAA,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE;AACd,QAAA,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;QACnC;IACF;IAEA,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;AAC3C,QAAA,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IACpC;AAEA,IAAA,IAAI,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC;IAE1E,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,SAAS,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;AAC9C,QAAA,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;IACnC;IAEA,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE;IAC7C,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;AAEpC,IAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE;;ACrCA;;AAEG;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { canDeactivateGuard } from '@cccteam/ccc-lib/guards';
|
|
2
|
+
import { addNavItem } from '@cccteam/ccc-lib/resource-nav';
|
|
3
|
+
|
|
4
|
+
const resourceRoutes = (config, resourceMeta) => {
|
|
5
|
+
const meta = resourceMeta(config.parentConfig.primaryResource);
|
|
6
|
+
if (!meta) {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
if (config.nav.group) {
|
|
10
|
+
if (config.routeData.route) {
|
|
11
|
+
addNavItem(config.nav, config.routeData.route);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
addNavItem(config.nav, meta.route);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (config.routeData.route) {
|
|
18
|
+
const baseRoute = {
|
|
19
|
+
path: config.routeData.route,
|
|
20
|
+
data: { config: config },
|
|
21
|
+
children: [
|
|
22
|
+
{
|
|
23
|
+
path: '',
|
|
24
|
+
loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.ResourceListCreateComponent),
|
|
25
|
+
canDeactivate: [canDeactivateGuard],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
if (config.routeData.hasViewRoute !== false) {
|
|
30
|
+
baseRoute.children?.push({
|
|
31
|
+
path: ':uuid',
|
|
32
|
+
loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.CompoundResourceComponent),
|
|
33
|
+
canDeactivate: [canDeactivateGuard],
|
|
34
|
+
});
|
|
35
|
+
return baseRoute;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
path: meta.route,
|
|
40
|
+
data: { config: config },
|
|
41
|
+
children: [
|
|
42
|
+
{
|
|
43
|
+
path: ':uuid',
|
|
44
|
+
loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.CompoundResourceComponent),
|
|
45
|
+
canDeactivate: [canDeactivateGuard],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
path: '',
|
|
49
|
+
loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.ResourceListCreateComponent),
|
|
50
|
+
canDeactivate: [canDeactivateGuard],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Generated bundle index. Do not edit.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
export { resourceRoutes };
|
|
61
|
+
//# sourceMappingURL=cccteam-ccc-lib-resource-route-generator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cccteam-ccc-lib-resource-route-generator.mjs","sources":["../../../projects/ccc-lib/resource-route-generator/index.ts","../../../projects/ccc-lib/resource-route-generator/cccteam-ccc-lib-resource-route-generator.ts"],"sourcesContent":["import { Route } from '@angular/router';\nimport { canDeactivateGuard } from '@cccteam/ccc-lib/guards';\nimport { addNavItem } from '@cccteam/ccc-lib/resource-nav';\nimport { Resource, ResourceMeta, RootConfig, RouteResourceData } from '@cccteam/ccc-lib/types';\n\nexport const resourceRoutes = (config: RootConfig, resourceMeta: (resource: Resource) => ResourceMeta): Route => {\n const meta = resourceMeta(config.parentConfig.primaryResource as Resource);\n if (!meta) {\n return {} as Route;\n }\n\n if (config.nav.group) {\n if (config.routeData.route) {\n addNavItem(config.nav, config.routeData.route);\n } else {\n addNavItem(config.nav, meta.route);\n }\n }\n\n if (config.routeData.route) {\n const baseRoute: Route = {\n path: config.routeData.route,\n data: { config: config } satisfies RouteResourceData,\n children: [\n {\n path: '',\n loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.ResourceListCreateComponent),\n canDeactivate: [canDeactivateGuard],\n },\n ],\n };\n if (config.routeData.hasViewRoute !== false) {\n baseRoute.children?.push({\n path: ':uuid',\n loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.CompoundResourceComponent),\n canDeactivate: [canDeactivateGuard],\n });\n return baseRoute;\n }\n }\n\n return {\n path: meta.route,\n data: { config: config } as RouteResourceData,\n children: [\n {\n path: ':uuid',\n loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.CompoundResourceComponent),\n canDeactivate: [canDeactivateGuard],\n },\n {\n path: '',\n loadComponent: () => import('@cccteam/ccc-lib/ccc-resource').then((mod) => mod.ResourceListCreateComponent),\n canDeactivate: [canDeactivateGuard],\n },\n ],\n } satisfies Route;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,cAAc,GAAG,CAAC,MAAkB,EAAE,YAAkD,KAAW;IAC9G,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,eAA2B,CAAC;IAC1E,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,EAAW;IACpB;AAEA,IAAA,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;AACpB,QAAA,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;YAC1B,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;QAChD;aAAO;YACL,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;QACpC;IACF;AAEA,IAAA,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;AAC1B,QAAA,MAAM,SAAS,GAAU;AACvB,YAAA,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK;AAC5B,YAAA,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAA8B;AACpD,YAAA,QAAQ,EAAE;AACR,gBA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lib/types/resource-types.ts","../../../projects/ccc-lib/types/configs.ts","../../../projects/ccc-lib/types/notification-message.ts","../../../projects/ccc-lib/types/permissions.ts","../../../projects/ccc-lib/types/tokens.ts","../../../projects/ccc-lib/types/validators.ts","../../../projects/ccc-lib/types/cccteam-ccc-lib-types.ts"],"sourcesContent":["export const defaultEmptyFieldValue = '-';\n\nexport type NullBoolean = null | true | false;\n\nexport type ConcatFn = 'space-concat' | 'hyphen-concat' | 'space-hyphen-concat' | 'hyphen-space-concat';\n","import { Directive, input, Type } from '@angular/core';\nimport { TooltipPosition } from '@angular/material/tooltip';\nimport { FieldName, Method, Resource } from './permissions';\nimport { ConcatFn, defaultEmptyFieldValue, NullBoolean } from './resource-types';\nimport { ResourceValidatorFn } from './validators';\n\nexport interface FieldPointer {\n field: FieldName;\n}\n\nexport interface MenuItem {\n label: string;\n route?: string[];\n children?: MenuItem[];\n}\n\nexport interface RouteResourceData {\n config: RootConfig;\n}\n\nexport type DataType = string | number | number[] | string[] | boolean | undefined | Date;\nexport type RecordData = Record<string, DataType | null>;\n\nexport type RPCDataType = string | number | string[] | number[] | boolean | Date;\nexport type RPCRecordData = Record<string, RPCDataType>;\nexport type RpcMethod = Record<string, DataType>;\n\nexport type ParentResourceConfig = ListViewConfig | ViewConfig | ArrayConfig;\nexport type ChildResourceConfig = ListViewConfig | ViewConfig | ComponentConfig | ArrayConfig;\n\nexport type ActionType = 'function' | 'link';\n\nexport type ListConcatFn =\n | 'space-concat'\n | 'hyphen-concat'\n | 'space-hyphen-concat'\n | 'hyphen-space-concat'\n | 'no-space-concat';\nexport type ConfigType = ChildResourceConfig;\nexport type FormatType = 'simpleSlashDateFormat';\nexport type RPCPlacement = 'inline' | 'end';\n\nexport type ColumnConfig = SingleColumnConfig | MultiColumnConfig;\n\nexport interface ActionButtonConfig {\n label: string;\n icon: string;\n action?: (resource: { id: string }) => void;\n viewRoute?: string;\n actionType?: ActionType;\n color?: string;\n disabledLabel?: string;\n}\nexport interface ActionButtonConfigOptions {\n label: string;\n icon: string;\n action?: (resource: { id: string }) => void;\n viewRoute?: string;\n actionType?: ActionType;\n color?: string;\n disabledLabel?: string;\n}\n\nexport function actionButtonConfig(config: ActionButtonConfigOptions): ActionButtonConfig {\n return {\n ...actionButtonConfigDefaults,\n ...config,\n } satisfies ActionButtonConfig;\n}\n\nexport const actionButtonConfigDefaults = {\n label: '',\n icon: '',\n actionType: 'function' as ActionType,\n color: '',\n disabledLabel: '',\n} satisfies ActionButtonConfig;\n\nexport interface SingleColumnConfig {\n id: FieldName;\n header?: string;\n width?: number;\n resizable?: boolean;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n valueGetter?: (data: any) => string;\n valueFormatter?: (data: any) => string;\n tooltipPosition?: TooltipPosition;\n viewRoute?: Resource;\n buttonConfig?: ActionButtonConfig;\n actionType?: ActionType;\n formatType?: FormatType | string;\n hidden?: boolean;\n emptyDataValue?: DataType;\n filterable?: boolean;\n hideHeader?: boolean;\n}\nexport interface SingleColumnConfigOptions {\n id: FieldName;\n header?: string;\n width?: number;\n resizable?: boolean;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n valueGetter?: (data: any) => string;\n valueFormatter?: (data: any) => string;\n tooltipPosition?: TooltipPosition;\n viewRoute?: Resource;\n buttonConfig?: ActionButtonConfig;\n actionType?: ActionType;\n formatType?: FormatType | string;\n hidden?: boolean;\n emptyDataValue?: DataType;\n filterable?: boolean;\n hideHeader?: boolean;\n}\n\nexport function singleColumnConfig(config: SingleColumnConfigOptions): SingleColumnConfig {\n return {\n ...singleColumnConfigDefaults,\n ...config,\n } satisfies SingleColumnConfig;\n}\n\nexport const singleColumnConfigDefaults = {\n id: '' as FieldName,\n header: '',\n resizable: true,\n actionType: 'function' as ActionType,\n hidden: false,\n filterable: true,\n hideHeader: false,\n} satisfies SingleColumnConfig;\n\nexport interface MultiColumnConfig extends SingleColumnConfig {\n // todo: additionalIds name is not clear. the id provided is fetched from a different resource, such as a typeId\n additionalIds: AdditionalResourceConfig[];\n concatFn: ListConcatFn;\n}\nexport interface MultiColumnConfigOptions extends SingleColumnConfigOptions {\n additionalIds: AdditionalResourceConfig[];\n concatFn: ListConcatFn;\n}\n\nexport function multiColumnConfig(config: MultiColumnConfigOptions): MultiColumnConfig {\n return {\n ...multiColumnConfigDefaults,\n ...config,\n } satisfies MultiColumnConfig;\n}\n\nexport const multiColumnConfigDefaults = {\n ...singleColumnConfigDefaults,\n additionalIds: [] as AdditionalResourceConfig[],\n concatFn: 'hyphen-concat' as ListConcatFn,\n} satisfies MultiColumnConfig;\n\nexport interface AdditionalResourceConfig {\n resource?: Resource;\n id: FieldName;\n field?: FieldName;\n hidden?: boolean;\n}\nexport interface AdditionalResourceConfigOptions {\n id: FieldName;\n resource?: Resource;\n field?: FieldName;\n hidden?: boolean;\n}\n\nexport function additionalResourceConfig(config: AdditionalResourceConfigOptions): AdditionalResourceConfig {\n return {\n ...additionalResourceConfigDefaults,\n ...config,\n } satisfies AdditionalResourceConfig;\n}\n\nexport const additionalResourceConfigDefaults = {\n id: '' as FieldName,\n resource: '' as Resource,\n field: '' as FieldName,\n hidden: false,\n} satisfies AdditionalResourceConfig;\n\nexport interface FieldSort {\n field: FieldName;\n direction: 'asc' | 'desc';\n}\nexport interface FieldSortOptions {\n field: FieldName;\n direction?: 'asc' | 'desc';\n}\n\nexport function fieldSort(config: FieldSortOptions): FieldSort {\n return {\n ...fieldSortDefaults,\n ...config,\n } satisfies FieldSort;\n}\n\nexport const fieldSortDefaults = {\n field: '' as FieldName,\n direction: 'asc' as 'asc' | 'desc',\n} satisfies FieldSort;\n\nexport interface EnumeratedConfigOptions {\n // primaryResource comes from the metadata\n overrideResource?: Resource;\n /* A function to filter the list of enumerated options.\n * The `parentResource` argument contains the data of the resource that this enumerated field is part of.\n * It will be an object with the current form values, which can be empty during resource creation.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter?: (resource: any) => string;\n /**\n * Set disableCacheForFilterPii to `true` to promote the GET to a POST when PII is used in the filter\n * POST requests cannot be cached\n */\n disableCacheForFilterPii?: boolean;\n /**\n * Specifies which resource data to pass to the filter function:\n * - 'rootResource': Pass in the root resource data\n * - 'parentResource': Pass in the parent resource data\n * @default 'parentResource'\n */\n filterType?: FilterType;\n sorts?: FieldSort[];\n listDisplay?: FieldName[];\n viewDisplay: FieldName[];\n viewConcatFn?: ConcatFn;\n listConcatFn?: ConcatFn;\n viewDetails?: boolean;\n searchable?: boolean;\n}\n\ntype FilterType = 'parentResource' | 'rootResource';\nexport interface EnumeratedConfig {\n overrideResource: Resource;\n filter: (resource: any) => string;\n disableCacheForFilterPii: boolean;\n filterType: FilterType;\n sorts: FieldSort[];\n listDisplay: FieldName[];\n viewDisplay: FieldName[];\n viewConcatFn: ConcatFn;\n listConcatFn: ConcatFn;\n viewDetails: boolean;\n searchable: boolean;\n}\nexport function enumeratedConfig(config: EnumeratedConfigOptions): EnumeratedConfig {\n return {\n ...enumeratedConfigDefaults,\n ...config,\n } satisfies EnumeratedConfig;\n}\nexport const enumeratedConfigDefaults = {\n overrideResource: '' as Resource,\n filter: (): string => '',\n disableCacheForFilterPii: false,\n filterType: 'parentResource' as FilterType,\n sorts: [] as FieldSort[],\n listDisplay: [] as FieldName[],\n viewDisplay: [] as FieldName[],\n viewConcatFn: 'hyphen-concat' as ConcatFn,\n listConcatFn: 'hyphen-concat' as ConcatFn,\n viewDetails: false,\n searchable: false,\n};\n\nexport type FieldDefault = ForeignKeyDefault | StaticDefault | null;\n\nexport interface NullBooleanConfigOptions {\n displayValues?: Record<'null' | 'true' | 'false', { label: string; value: NullBoolean }>;\n}\nexport interface NullBooleanConfig {\n /** This property maps the three possible values for this\n * nullboolean field with the display values users will see\n * on the screen for each\n */\n displayValues: Record<'null' | 'true' | 'false', { label: string; value: NullBoolean }>;\n}\nexport function nullBooleanConfig(config: NullBooleanConfigOptions): NullBooleanConfig {\n return {\n ...nullBooleanConfigDefaults,\n ...config,\n } satisfies NullBooleanConfig;\n}\nconst defaultBooleanDisplay = Object.freeze({\n null: {\n label: defaultEmptyFieldValue,\n value: null,\n },\n true: {\n label: 'Yes',\n value: true,\n },\n false: {\n label: 'No',\n value: false,\n },\n});\n\nexport const nullBooleanConfigDefaults = {\n displayValues: defaultBooleanDisplay,\n};\n\nexport interface ForeignKeyDefaultOptions {\n parentId: FieldName;\n}\nexport interface ForeignKeyDefault {\n type: 'foreignKey';\n parentId: FieldName;\n}\nexport function foreignKeyDefault(config: ForeignKeyDefaultOptions): ForeignKeyDefault {\n return {\n ...foreignKeyDefaultDefaults,\n ...config,\n } satisfies ForeignKeyDefault;\n}\nexport const foreignKeyDefaultDefaults = {\n type: 'foreignKey',\n parentId: '' as FieldName,\n} satisfies ForeignKeyDefault;\n\nexport interface StaticDefault {\n type: 'static';\n value: string | boolean;\n}\nexport interface staticDefaultOptions {\n value: string | boolean;\n}\nexport function staticDefault(config: staticDefaultOptions): StaticDefault {\n return {\n ...staticDefaultDefaults,\n ...config,\n } satisfies StaticDefault;\n}\nexport const staticDefaultDefaults = {\n type: 'static',\n value: '',\n} satisfies StaticDefault;\n\nexport type Affix = string | remoteData | parentData;\n\ninterface remoteData {\n resource: Resource;\n id: FieldName;\n field: FieldName;\n}\n\ninterface parentData {\n field: FieldName;\n}\n\nexport type ConfigElement = FieldElement | SectionElement | ComputedDisplayFieldElement | PaddingElement;\n\nexport type ColSize = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nexport interface ComputedDisplayFieldElementOptions {\n label?: string;\n class?: string;\n cols?: ColSize;\n calculatedValue?: (data: any) => string;\n shouldRender?: ((data: any) => boolean) | boolean;\n}\nexport interface ComputedDisplayFieldElement {\n type: 'computedDisplayField';\n label: string;\n class: string;\n cols: ColSize;\n calculatedValue: (data: any) => string;\n shouldRender: ((data: any) => boolean) | boolean;\n}\nexport function computedDisplayField(config: ComputedDisplayFieldElementOptions): ComputedDisplayFieldElement {\n return {\n ...computedDisplayFieldElementDefaults,\n ...config,\n } satisfies ComputedDisplayFieldElement;\n}\nexport const computedDisplayFieldElementDefaults = {\n type: 'computedDisplayField',\n label: '',\n class: '',\n cols: 6,\n calculatedValue: (): string => '',\n shouldRender: true,\n} satisfies ComputedDisplayFieldElement;\n\nexport interface PaddingElementOptions {\n cols?: ColSize;\n shouldRender?: ((data: any) => boolean) | boolean;\n}\nexport interface PaddingElement {\n type: 'padding';\n cols: ColSize;\n /** Determines whether the padding is shown\n */\n shouldRender: ((data: any) => boolean) | boolean;\n}\nexport function padding(config?: PaddingElementOptions): PaddingElement {\n return {\n ...paddingElementDefaults,\n ...config,\n } satisfies PaddingElement;\n}\nexport const paddingElementDefaults = {\n type: 'padding',\n cols: 12,\n shouldRender: true,\n} satisfies PaddingElement;\n\nexport interface SectionElementOptions {\n label?: string;\n class?: string;\n cols?: ColSize;\n shouldRender?: ((data: any) => boolean) | boolean;\n nullAllChildrenIfConditionallyHidden?: boolean;\n children?: ConfigElement[];\n}\nexport interface SectionElement {\n type: 'section';\n label: string;\n class: string;\n cols: ColSize;\n /**\n * shouldRender is used to determine if the section should be\n * displayed to users.\n * When assigning shouldRender a function, the first argument\n * is the current state of the resource being displayed\n * Hides the layout AND all of its children\n */\n shouldRender: ((data: any) => boolean) | boolean;\n /** If shouldRender is NOT a function, this property does nothing\n * If shouldRender is a function, this property\n * sets children's values to null if shouldRender hides it (returns false)\n * within the resource-layout.component\n */\n nullAllChildrenIfConditionallyHidden: boolean;\n children: ConfigElement[];\n}\nexport function section(config: SectionElementOptions): SectionElement {\n return {\n ...sectionElementDefaults,\n ...config,\n } satisfies SectionElement;\n}\nexport const sectionElementDefaults = {\n type: 'section',\n label: '',\n class: '',\n cols: 12,\n shouldRender: true,\n nullAllChildrenIfConditionallyHidden: false,\n children: [],\n} satisfies SectionElement;\n\nexport interface FieldElementOptions {\n name: FieldName;\n label?: string;\n cols?: ColSize;\n class?: string;\n enumeratedConfig?: EnumeratedConfig;\n default?: FieldDefault;\n nullBooleanConfig?: NullBooleanConfig;\n validators?: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];\n readOnly?: boolean;\n prefixes?: Affix[];\n suffixes?: Affix[];\n shouldRender?: ((data: any) => boolean) | boolean;\n nullIfConditionallyHidden?: boolean;\n}\nexport interface FieldElement {\n type: 'field';\n name: string;\n label: string;\n cols: ColSize;\n class: string;\n enumeratedConfig: EnumeratedConfig;\n default: FieldDefault;\n nullBooleanConfig: NullBooleanConfig;\n /**\n * A list of validators that must pass to allow a field to be submitted.\n * Utilize existing validators in the resourceValidators object, and\n * add any new or custom validators to it\n */\n validators: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];\n readOnly: boolean;\n prefixes: Affix[];\n suffixes: Affix[];\n /**\n * shouldRender is used to determine if the element should be\n * displayed to users.\n * When assigning shouldRender a function, the first argument\n * is the current state of the resource being displayed\n */\n shouldRender: ((data: any) => boolean) | boolean;\n /** If shouldRender is NOT a function, this property does nothing\n * If shouldRender is a function, this property\n * determines whether the form control associated\n * with this config element should have its value\n * set to null if shouldRender hides it (returns false)\n */\n nullIfConditionallyHidden: boolean;\n}\n\nexport function field(config: FieldElementOptions): FieldElement {\n return {\n ...fieldElementDefaults,\n ...config,\n } satisfies FieldElement;\n}\nexport const fieldElementDefaults = {\n type: 'field',\n name: '',\n label: '',\n cols: 6,\n class: '',\n enumeratedConfig: { ...enumeratedConfigDefaults },\n default: null,\n validators: [],\n nullBooleanConfig: { ...nullBooleanConfigDefaults },\n readOnly: false,\n prefixes: [],\n suffixes: [],\n shouldRender: true,\n nullIfConditionallyHidden: false,\n} satisfies FieldElement;\n\n/**\n * RouteData is used to define the route for a config\n * route: the route for the config\n * hasViewRoute: when true, a route will be created for route/:uuid\n */\nexport interface RootRouteData {\n route?: string;\n hasViewRoute?: boolean;\n}\n\nexport interface RPCConfigOptions {\n label: string;\n afterMethodRedirect?: string;\n conditions: {\n field: FieldName;\n matchValues: string[];\n }[];\n methodBodyTemplate?: any;\n successMessage?: string;\n elements?: ConfigElement[];\n placement?: RPCPlacement;\n method: Method;\n customComponent?: ComponentConfig;\n refreshResources?: Resource[];\n defaultModalWidth?: string;\n shouldRender?: () => boolean;\n}\nexport interface RPCConfig {\n label: string;\n afterMethodRedirect: string | string[];\n conditions: {\n field: FieldName;\n matchValues: string[];\n }[];\n methodBodyTemplate: any;\n method: Method;\n successMessage: string;\n elements: ConfigElement[];\n placement: RPCPlacement;\n customComponent: ComponentConfig;\n refreshResources: Resource[];\n defaultModalWidth: string;\n shouldRender: () => boolean;\n}\nexport function rpcConfig(config: RPCConfigOptions): RPCConfig {\n return {\n ...rpcConfigDefaults,\n ...config,\n } satisfies RPCConfig;\n}\nexport const rpcConfigDefaults = {\n label: '',\n afterMethodRedirect: '',\n conditions: [] as {\n field: FieldName;\n matchValues: string[];\n }[],\n methodBodyTemplate: {} as any,\n successMessage: '',\n elements: [] as ConfigElement[],\n placement: 'end' as RPCPlacement,\n method: '' as Method,\n customComponent: {} as ComponentConfig,\n refreshResources: [] as Resource[],\n defaultModalWidth: '',\n shouldRender: (): boolean => true,\n} satisfies RPCConfig;\n\nexport interface RPCBaseFormData {\n elements: FieldElement[];\n label: string;\n method: Method;\n}\n\n// Config is the base type that all configurations should start with\nexport interface RootConfigOptions {\n routeData?: RootRouteData;\n nav?: {\n navItem: MenuItem;\n group?: string;\n };\n parentConfig: ParentResourceConfig;\n relatedConfigs?: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n}\nexport interface RootConfig {\n routeData: RootRouteData;\n nav: {\n navItem: MenuItem;\n group?: string;\n };\n parentConfig: ParentResourceConfig;\n relatedConfigs: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n}\nexport const rootConfigDefaults = {\n routeData: {} as RootRouteData,\n nav: {\n navItem: {} as MenuItem,\n },\n parentConfig: {} as ParentResourceConfig,\n relatedConfigs: [] as ChildResourceConfig[],\n rpcConfigs: [] as RPCConfig[],\n} satisfies RootConfig;\n\nexport function rootConfig(config: RootConfigOptions): RootConfig {\n return {\n ...rootConfigDefaults,\n ...config,\n } satisfies RootConfig;\n}\n\n// Base type config is the base type for all resource configurations\nexport interface BaseConfigOptions {\n title?: string;\n createTitle?: string;\n createButtonLabel?: string;\n primaryResource: Resource;\n parentClass?: string;\n fieldClass?: string;\n elements: ConfigElement[];\n createConfig?: ConfigType;\n parentRelation?: {\n parentKey: FieldName;\n childKey: FieldName;\n };\n showBackButton?: boolean;\n createNavigation?: string[];\n}\nexport interface BaseConfig {\n title: string;\n createTitle: string;\n createButtonLabel: string;\n primaryResource: Resource;\n parentClass: string;\n fieldClass: string;\n elements: ConfigElement[];\n createConfig: ConfigType;\n parentRelation: {\n parentKey: FieldName;\n childKey: FieldName;\n };\n showBackButton: boolean;\n createNavigation: string[];\n}\n\n@Directive()\nexport abstract class CustomConfigComponent {\n uuid = input<string>();\n parentData = input<RecordData>();\n config = input<ComponentConfig>();\n}\n\n// Available param types for a component config\nexport type ConfigParam = SwitchConfigParam;\n\n// Custom component config renders a custom component and supplies params to it\nexport interface ComponentConfigOptions {\n // todo: it's weird that we have a primary resource here. Would be nice to remove but this adds a null check to all other configs\n primaryResource: Resource;\n component: Type<CustomConfigComponent> | 'SwitchResolver';\n params?: ConfigParam;\n relatedConfig?: ParentResourceConfig[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ComponentConfig {\n type: 'Component';\n primaryResource: Resource;\n component: Type<CustomConfigComponent> | 'SwitchResolver';\n params: ConfigParam;\n relatedConfig: ParentResourceConfig[];\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport function componentConfig(config: ComponentConfigOptions): ComponentConfig {\n return {\n ...componentConfigDefaults,\n ...config,\n } satisfies ComponentConfig;\n}\nexport const componentConfigDefaults = {\n type: 'Component',\n primaryResource: '' as Resource,\n component: 'SwitchResolver',\n params: {\n cases: [],\n } satisfies ConfigParam,\n relatedConfig: [] as ParentResourceConfig[],\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ComponentConfig;\n\n// A switch is a component type that allows for conditional rendering of child components based on the value of a parent field\n// When parentData[c.parentField] equals c.caseId render the caseConfig with parentData[c.childId] as the uuid\nexport interface switchCase {\n caseId: string;\n parentField: string;\n childId: string;\n config: ChildResourceConfig;\n}\nexport interface SwitchConfigParamOptions {\n cases: switchCase[];\n}\nexport interface SwitchConfigParam {\n cases: switchCase[];\n}\nexport function switchParams(config: SwitchConfigParamOptions): SwitchConfigParam {\n return {\n ...switchParamsDefaults,\n ...config,\n } satisfies SwitchConfigParam;\n}\nexport const switchParamsDefaults = {\n cases: [] as switchCase[],\n} satisfies SwitchConfigParam;\n\nexport interface ListViewConfigOptions extends BaseConfigOptions {\n showViewButton?: boolean;\n loadCreatedResource?: boolean;\n collapsible?: boolean;\n overrideResource?: Resource;\n searchable?: boolean;\n enableRowExpansion?: boolean;\n rowExpansionConfig?: ChildResourceConfig;\n requireSearchToDisplayResults?: boolean;\n listColumns: ColumnConfig[];\n relatedConfigs?: ChildResourceConfig[];\n viewResource?: Resource | string;\n actionType?: ActionType;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter?: (parentResource: any) => string;\n disableCacheForFilterPii?: boolean;\n rpcConfigs?: RPCConfig[];\n sorts?: FieldSort[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ListViewConfig extends BaseConfig {\n type: 'ListView';\n showViewButton: boolean;\n loadCreatedResource: boolean;\n collapsible: boolean;\n overrideResource: Resource;\n searchable: boolean;\n enableRowExpansion: boolean;\n rowExpansionConfig: ChildResourceConfig;\n requireSearchToDisplayResults: boolean;\n listColumns: ColumnConfig[];\n relatedConfigs: ChildResourceConfig[];\n viewResource: Resource | string;\n actionType: ActionType;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter: (parentResource: any) => string;\n disableCacheForFilterPii: boolean;\n rpcConfigs?: RPCConfig[];\n sorts: FieldSort[];\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\n\nexport function listViewConfig(config: ListViewConfigOptions): ListViewConfig {\n return {\n ...listViewConfigDefaults,\n ...config,\n } satisfies ListViewConfig;\n}\nexport const listViewConfigDefaults = {\n title: '',\n primaryResource: '' as Resource,\n type: 'ListView',\n createTitle: '',\n createButtonLabel: 'Create',\n loadCreatedResource: false,\n showViewButton: true,\n collapsible: false,\n listColumns: [],\n elements: [],\n parentClass: '',\n fieldClass: '',\n createConfig: {} as ListViewConfig,\n createNavigation: [],\n relatedConfigs: [],\n parentRelation: {\n parentKey: '' as FieldName,\n childKey: '' as FieldName,\n },\n overrideResource: '' as Resource,\n searchable: false,\n enableRowExpansion: false,\n rowExpansionConfig: {} as ChildResourceConfig,\n requireSearchToDisplayResults: false,\n showBackButton: true,\n filter: (): string => '',\n disableCacheForFilterPii: false,\n sorts: [] as FieldSort[],\n viewResource: '' as Resource,\n actionType: 'function' as ActionType,\n rpcConfigs: [],\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ListViewConfig;\n\nexport type ViewType = 'OneToOne' | 'OneToMany';\n\nexport interface ViewConfigOptions extends BaseConfigOptions {\n collapsible?: boolean;\n connectorResource?: Resource;\n relatedConfigs?: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ViewConfig extends BaseConfig {\n type: 'View';\n collapsible: boolean;\n // todo: remove this comment once full documentation has been added. Populate this value when a database view resource is used to connect the ViewConfig's parent resource to its primary resource\n connectorResource: Resource;\n rpcConfigs?: RPCConfig[];\n relatedConfigs: ChildResourceConfig[];\n /** A set of functions that allows for\n * conditional display of non-RPC\n * actions based on the pristine state of the resource\n * (if such a state is applicable. Creation for example won't\n * have such data)\n * This is separate from ABAC control which takes\n * precedence and is based on a user's attributes\n */\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\n\nexport function viewConfig(config: ViewConfigOptions): ViewConfig {\n return {\n ...viewConfigDefaults,\n ...config,\n } satisfies ViewConfig;\n}\nexport const viewConfigDefaults = {\n title: '',\n primaryResource: '' as Resource,\n type: 'View',\n createTitle: '',\n createButtonLabel: 'Create',\n parentClass: '',\n fieldClass: '',\n elements: [],\n collapsible: true,\n connectorResource: '' as Resource,\n relatedConfigs: [],\n createConfig: {} as ViewConfig,\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n createNavigation: [],\n parentRelation: {\n parentKey: '' as FieldName,\n childKey: '' as FieldName,\n },\n showBackButton: true,\n rpcConfigs: [],\n} satisfies ViewConfig;\n\nexport interface arrayConfigOptions {\n iteratedConfig: ChildResourceConfig;\n viewType?: ViewType;\n collapsible?: boolean;\n createConfig?: ConfigType;\n connectorResource?: Resource;\n connectorField?: FieldName;\n primaryResource: Resource;\n listFilter: (parentResource: any) => string;\n disableCacheForFilterPii?: boolean;\n sorts?: FieldSort[];\n title?: string;\n createButtonLabel?: string;\n limit?: number;\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ArrayConfig {\n type: 'Array';\n iteratedConfig: ChildResourceConfig;\n viewType: ViewType;\n collapsible: boolean;\n createConfig: ConfigType;\n connectorResource: Resource;\n connectorField: FieldName;\n primaryResource: Resource;\n listFilter: (parentResource: any) => string;\n disableCacheForFilterPii: boolean;\n sorts: FieldSort[];\n title: string;\n createButtonLabel: string;\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n limit: number;\n}\nexport function arrayConfig(config: arrayConfigOptions): ArrayConfig {\n return {\n ...arrayConfigDefaults,\n ...config,\n } satisfies ArrayConfig;\n}\nexport const arrayConfigDefaults = {\n type: 'Array',\n iteratedConfig: {} as ChildResourceConfig,\n viewType: 'OneToMany' as ViewType,\n collapsible: true,\n createConfig: {} as ViewConfig,\n connectorResource: '' as Resource,\n connectorField: '' as FieldName,\n primaryResource: '' as Resource,\n listFilter: (): string => '',\n disableCacheForFilterPii: false,\n sorts: [] as FieldSort[],\n title: '',\n createButtonLabel: 'Create',\n limit: Infinity,\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ArrayConfig;\n","export enum AlertLevel {\n ERROR = 'warn',\n INFO = 'accent',\n SUCCESS = 'success',\n}\n\nexport interface CreateNotificationMessage {\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n\nexport interface NotificationMessage {\n id: number;\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n","type Brand<K, T> = K & { __brand: T };\n\nexport type Permission = Brand<string, 'Permission'>;\nexport type Resource = Brand<string, 'Resource'>;\nexport type Domain = Brand<string, 'Domain'>;\nexport type FieldName = Brand<string, 'FieldName'>;\nexport type Method = Brand<string, 'Method'>;\nexport type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;\n\nexport interface PermissionScope {\n resource: Resource;\n permission: Permission;\n domain: Domain;\n}\n\nexport const ReadPermission = 'Read' as Permission;\nexport const UpdatePermission = 'Update' as Permission;\n","import { InjectionToken } from '@angular/core';\nimport { Domain, Permission, Resource } from './permissions';\nimport { MethodMeta, ResourceMeta } from './resource-meta';\n\n/**\n * The base URL for API requests (e.g., 'https://api.example.com/').\n */\nexport const BASE_URL = new InjectionToken<string>('BASE_URL');\n\n/**\n * The path to the frontend login page (e.g., '/login').\n */\nexport const FRONTEND_LOGIN_PATH = new InjectionToken<string>('FRONTEND_LOGIN_PATH');\n\n/**\n * The path to the session endpoint (e.g., 'user/session').\n */\nexport const SESSION_PATH = new InjectionToken<string>('SESSION_PATH');\n\n/**\n * The base URL for API requests (e.g., '/api').\n */\nexport const API_URL = new InjectionToken<string>('API_URL');\n\nexport const PERMISSION_REQUIRED = new InjectionToken<(resource: Resource, permission: Permission) => boolean>(\n 'PERMISSION_REQUIRED',\n);\n\nexport const AVAILABLE_PERMISSIONS = new InjectionToken<{\n Create: Permission;\n Delete: Permission;\n List: Permission;\n Read: Permission;\n Update: Permission;\n}>('AVAILABLE_PERMISSIONS');\nexport const AVAILABLE_DOMAINS = new InjectionToken<Record<string, Domain>[]>('AVAILABLE_DOMAINS');\n\nexport const RESOURCE_META = new InjectionToken<(resource: Resource) => ResourceMeta>('RESOURCE_META');\nexport const METHOD_META = new InjectionToken<(method: string) => MethodMeta>('METHOD_META');\n\nexport const IDLE_SESSION_DURATION = new InjectionToken<number>('IDLE_SESSION_DURATION');\nexport const IDLE_WARNING_DURATION = new InjectionToken<number>('IDLE_WARNING_DURATION');\nexport const IDLE_KEEPALIVE_DURATION = new InjectionToken<number>('IDLE_KEEPALIVE_DURATION');\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport const validatorsPresent = (\n control: AbstractControl<unknown, unknown>,\n validators: ValidatorFn[],\n previousValidatorCount: number,\n): boolean => {\n if (validators.length === previousValidatorCount) {\n return true;\n }\n\n let hasAllValidators = true;\n for (const validator of validators) {\n if (!control.hasValidator(validator)) {\n hasAllValidators = false;\n break;\n }\n }\n return hasAllValidators;\n};\n\nexport const requiredIf = (predicate: () => boolean, validator: ValidatorFn) => {\n return (formControl: AbstractControl): ValidationErrors | null => {\n if (!formControl.parent) {\n return null;\n }\n if (predicate()) {\n return validator(formControl);\n }\n return null;\n };\n};\n\ndeclare const __singletonValidatorBrand: unique symbol;\nexport type ResourceValidatorFn = ValidatorFn & {\n readonly [__singletonValidatorBrand]: true;\n};\nexport function createResourceValidator(validator: ValidatorFn): ResourceValidatorFn {\n return validator as ResourceValidatorFn;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAO,MAAM,sBAAsB,GAAG;;AC+DhC,SAAU,kBAAkB,CAAC,MAAiC,EAAA;IAClE,OAAO;AACL,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM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WAAW,CAAC;QAC/B;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;AAMM,SAAU,uBAAuB,CAAC,SAAsB,EAAA;AAC5D,IAAA,OAAO,SAAgC;AACzC;;ACvCA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cccteam-ccc-lib-types.mjs","sources":["../../../projects/ccc-lib/types/resource-types.ts","../../../projects/ccc-lib/types/configs.ts","../../../projects/ccc-lib/types/notification-message.ts","../../../projects/ccc-lib/types/permissions.ts","../../../projects/ccc-lib/types/tokens.ts","../../../projects/ccc-lib/types/validators.ts","../../../projects/ccc-lib/types/cccteam-ccc-lib-types.ts"],"sourcesContent":["export const defaultEmptyFieldValue = '-';\n\nexport type NullBoolean = null | true | false;\n\nexport type ConcatFn = 'space-concat' | 'hyphen-concat' | 'space-hyphen-concat' | 'hyphen-space-concat';\n","import { Directive, input, Type } from '@angular/core';\nimport { TooltipPosition } from '@angular/material/tooltip';\nimport { FieldName, Method, Resource } from './permissions';\nimport { ResourceMeta } from './resource-meta';\nimport { ConcatFn, defaultEmptyFieldValue, NullBoolean } from './resource-types';\nimport { ResourceValidatorFn } from './validators';\n\nexport type ResourceMap = Record<Resource, ResourceMeta>;\n\nexport interface FieldPointer {\n field: FieldName;\n}\n\nexport interface MenuItem {\n label: string;\n route?: string[];\n children?: MenuItem[];\n}\n\nexport interface RouteResourceData {\n config: RootConfig;\n}\n\nexport type DataType = string | number | number[] | string[] | boolean | undefined | Date;\nexport type RecordData = Record<string, DataType | null>;\n\nexport type RPCDataType = string | number | string[] | number[] | boolean | Date;\nexport type RPCRecordData = Record<string, RPCDataType>;\nexport type RpcMethod = Record<string, DataType>;\n\nexport type ParentResourceConfig = ListViewConfig | ViewConfig | ArrayConfig;\nexport type ChildResourceConfig = ListViewConfig | ViewConfig | ComponentConfig | ArrayConfig;\n\nexport type ActionType = 'function' | 'link';\n\nexport type ListConcatFn =\n | 'space-concat'\n | 'hyphen-concat'\n | 'space-hyphen-concat'\n | 'hyphen-space-concat'\n | 'no-space-concat';\nexport type ConfigType = ChildResourceConfig;\nexport type FormatType = 'simpleSlashDateFormat';\nexport type RPCPlacement = 'inline' | 'end';\n\nexport type ColumnConfig = SingleColumnConfig | MultiColumnConfig;\n\nexport interface ActionButtonConfig {\n label: string;\n icon: string;\n action?: (resource: { id: string }) => void;\n viewRoute?: string;\n actionType?: ActionType;\n color?: string;\n disabledLabel?: string;\n}\nexport interface ActionButtonConfigOptions {\n label: string;\n icon: string;\n action?: (resource: { id: string }) => void;\n viewRoute?: string;\n actionType?: ActionType;\n color?: string;\n disabledLabel?: string;\n}\n\nexport function actionButtonConfig(config: ActionButtonConfigOptions): ActionButtonConfig {\n return {\n ...actionButtonConfigDefaults,\n ...config,\n } satisfies ActionButtonConfig;\n}\n\nexport const actionButtonConfigDefaults = {\n label: '',\n icon: '',\n actionType: 'function' as ActionType,\n color: '',\n disabledLabel: '',\n} satisfies ActionButtonConfig;\n\nexport interface SingleColumnConfig {\n id: FieldName;\n header?: string;\n width?: number;\n resizable?: boolean;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n valueGetter?: (data: any) => string;\n valueFormatter?: (data: any) => string;\n tooltipPosition?: TooltipPosition;\n viewRoute?: Resource;\n buttonConfig?: ActionButtonConfig;\n actionType?: ActionType;\n formatType?: FormatType | string;\n hidden?: boolean;\n emptyDataValue?: DataType;\n filterable?: boolean;\n hideHeader?: boolean;\n}\nexport interface SingleColumnConfigOptions {\n id: FieldName;\n header?: string;\n width?: number;\n resizable?: boolean;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n valueGetter?: (data: any) => string;\n valueFormatter?: (data: any) => string;\n tooltipPosition?: TooltipPosition;\n viewRoute?: Resource;\n buttonConfig?: ActionButtonConfig;\n actionType?: ActionType;\n formatType?: FormatType | string;\n hidden?: boolean;\n emptyDataValue?: DataType;\n filterable?: boolean;\n hideHeader?: boolean;\n}\n\nexport function singleColumnConfig(config: SingleColumnConfigOptions): SingleColumnConfig {\n return {\n ...singleColumnConfigDefaults,\n ...config,\n } satisfies SingleColumnConfig;\n}\n\nexport const singleColumnConfigDefaults = {\n id: '' as FieldName,\n header: '',\n resizable: true,\n actionType: 'function' as ActionType,\n hidden: false,\n filterable: true,\n hideHeader: false,\n} satisfies SingleColumnConfig;\n\nexport interface MultiColumnConfig extends SingleColumnConfig {\n // todo: additionalIds name is not clear. the id provided is fetched from a different resource, such as a typeId\n additionalIds: AdditionalResourceConfig[];\n concatFn: ListConcatFn;\n}\nexport interface MultiColumnConfigOptions extends SingleColumnConfigOptions {\n additionalIds: AdditionalResourceConfig[];\n concatFn: ListConcatFn;\n}\n\nexport function multiColumnConfig(config: MultiColumnConfigOptions): MultiColumnConfig {\n return {\n ...multiColumnConfigDefaults,\n ...config,\n } satisfies MultiColumnConfig;\n}\n\nexport const multiColumnConfigDefaults = {\n ...singleColumnConfigDefaults,\n additionalIds: [] as AdditionalResourceConfig[],\n concatFn: 'hyphen-concat' as ListConcatFn,\n} satisfies MultiColumnConfig;\n\nexport interface AdditionalResourceConfig {\n resource?: Resource;\n id: FieldName;\n field?: FieldName;\n hidden?: boolean;\n}\nexport interface AdditionalResourceConfigOptions {\n id: FieldName;\n resource?: Resource;\n field?: FieldName;\n hidden?: boolean;\n}\n\nexport function additionalResourceConfig(config: AdditionalResourceConfigOptions): AdditionalResourceConfig {\n return {\n ...additionalResourceConfigDefaults,\n ...config,\n } satisfies AdditionalResourceConfig;\n}\n\nexport const additionalResourceConfigDefaults = {\n id: '' as FieldName,\n resource: '' as Resource,\n field: '' as FieldName,\n hidden: false,\n} satisfies AdditionalResourceConfig;\n\nexport interface FieldSort {\n field: FieldName;\n direction: 'asc' | 'desc';\n}\nexport interface FieldSortOptions {\n field: FieldName;\n direction?: 'asc' | 'desc';\n}\n\nexport function fieldSort(config: FieldSortOptions): FieldSort {\n return {\n ...fieldSortDefaults,\n ...config,\n } satisfies FieldSort;\n}\n\nexport const fieldSortDefaults = {\n field: '' as FieldName,\n direction: 'asc' as 'asc' | 'desc',\n} satisfies FieldSort;\n\nexport interface EnumeratedConfigOptions {\n // primaryResource comes from the metadata\n overrideResource?: Resource;\n /* A function to filter the list of enumerated options.\n * The `parentResource` argument contains the data of the resource that this enumerated field is part of.\n * It will be an object with the current form values, which can be empty during resource creation.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter?: (resource: any) => string;\n /**\n * Set disableCacheForFilterPii to `true` to promote the GET to a POST when PII is used in the filter\n * POST requests cannot be cached\n */\n disableCacheForFilterPii?: boolean;\n /**\n * Specifies which resource data to pass to the filter function:\n * - 'rootResource': Pass in the root resource data\n * - 'parentResource': Pass in the parent resource data\n * @default 'parentResource'\n */\n filterType?: FilterType;\n sorts?: FieldSort[];\n listDisplay?: FieldName[];\n viewDisplay: FieldName[];\n viewConcatFn?: ConcatFn;\n listConcatFn?: ConcatFn;\n viewDetails?: boolean;\n searchable?: boolean;\n}\n\ntype FilterType = 'parentResource' | 'rootResource';\nexport interface EnumeratedConfig {\n overrideResource: Resource;\n filter: (resource: any) => string;\n disableCacheForFilterPii: boolean;\n filterType: FilterType;\n sorts: FieldSort[];\n listDisplay: FieldName[];\n viewDisplay: FieldName[];\n viewConcatFn: ConcatFn;\n listConcatFn: ConcatFn;\n viewDetails: boolean;\n searchable: boolean;\n}\nexport function enumeratedConfig(config: EnumeratedConfigOptions): EnumeratedConfig {\n return {\n ...enumeratedConfigDefaults,\n ...config,\n } satisfies EnumeratedConfig;\n}\nexport const enumeratedConfigDefaults = {\n overrideResource: '' as Resource,\n filter: (): string => '',\n disableCacheForFilterPii: false,\n filterType: 'parentResource' as FilterType,\n sorts: [] as FieldSort[],\n listDisplay: [] as FieldName[],\n viewDisplay: [] as FieldName[],\n viewConcatFn: 'hyphen-concat' as ConcatFn,\n listConcatFn: 'hyphen-concat' as ConcatFn,\n viewDetails: false,\n searchable: false,\n};\n\nexport type FieldDefault = ForeignKeyDefault | StaticDefault | null;\n\nexport interface NullBooleanConfigOptions {\n displayValues?: Record<'null' | 'true' | 'false', { label: string; value: NullBoolean }>;\n}\nexport interface NullBooleanConfig {\n /** This property maps the three possible values for this\n * nullboolean field with the display values users will see\n * on the screen for each\n */\n displayValues: Record<'null' | 'true' | 'false', { label: string; value: NullBoolean }>;\n}\nexport function nullBooleanConfig(config: NullBooleanConfigOptions): NullBooleanConfig {\n return {\n ...nullBooleanConfigDefaults,\n ...config,\n } satisfies NullBooleanConfig;\n}\nconst defaultBooleanDisplay = Object.freeze({\n null: {\n label: defaultEmptyFieldValue,\n value: null,\n },\n true: {\n label: 'Yes',\n value: true,\n },\n false: {\n label: 'No',\n value: false,\n },\n});\n\nexport const nullBooleanConfigDefaults = {\n displayValues: defaultBooleanDisplay,\n};\n\nexport interface ForeignKeyDefaultOptions {\n parentId: FieldName;\n}\nexport interface ForeignKeyDefault {\n type: 'foreignKey';\n parentId: FieldName;\n}\nexport function foreignKeyDefault(config: ForeignKeyDefaultOptions): ForeignKeyDefault {\n return {\n ...foreignKeyDefaultDefaults,\n ...config,\n } satisfies ForeignKeyDefault;\n}\nexport const foreignKeyDefaultDefaults = {\n type: 'foreignKey',\n parentId: '' as FieldName,\n} satisfies ForeignKeyDefault;\n\nexport interface StaticDefault {\n type: 'static';\n value: string | boolean;\n}\nexport interface staticDefaultOptions {\n value: string | boolean;\n}\nexport function staticDefault(config: staticDefaultOptions): StaticDefault {\n return {\n ...staticDefaultDefaults,\n ...config,\n } satisfies StaticDefault;\n}\nexport const staticDefaultDefaults = {\n type: 'static',\n value: '',\n} satisfies StaticDefault;\n\nexport type Affix = string | remoteData | parentData;\n\ninterface remoteData {\n resource: Resource;\n id: FieldName;\n field: FieldName;\n}\n\ninterface parentData {\n field: FieldName;\n}\n\nexport type ConfigElement = FieldElement | SectionElement | ComputedDisplayFieldElement | PaddingElement;\n\nexport type ColSize = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nexport interface ComputedDisplayFieldElementOptions {\n label?: string;\n class?: string;\n cols?: ColSize;\n calculatedValue?: (data: any) => string;\n shouldRender?: ((data: any) => boolean) | boolean;\n}\nexport interface ComputedDisplayFieldElement {\n type: 'computedDisplayField';\n label: string;\n class: string;\n cols: ColSize;\n calculatedValue: (data: any) => string;\n shouldRender: ((data: any) => boolean) | boolean;\n}\nexport function computedDisplayField(config: ComputedDisplayFieldElementOptions): ComputedDisplayFieldElement {\n return {\n ...computedDisplayFieldElementDefaults,\n ...config,\n } satisfies ComputedDisplayFieldElement;\n}\nexport const computedDisplayFieldElementDefaults = {\n type: 'computedDisplayField',\n label: '',\n class: '',\n cols: 6,\n calculatedValue: (): string => '',\n shouldRender: true,\n} satisfies ComputedDisplayFieldElement;\n\nexport interface PaddingElementOptions {\n cols?: ColSize;\n shouldRender?: ((data: any) => boolean) | boolean;\n}\nexport interface PaddingElement {\n type: 'padding';\n cols: ColSize;\n /** Determines whether the padding is shown\n */\n shouldRender: ((data: any) => boolean) | boolean;\n}\nexport function padding(config?: PaddingElementOptions): PaddingElement {\n return {\n ...paddingElementDefaults,\n ...config,\n } satisfies PaddingElement;\n}\nexport const paddingElementDefaults = {\n type: 'padding',\n cols: 12,\n shouldRender: true,\n} satisfies PaddingElement;\n\nexport interface SectionElementOptions {\n label?: string;\n class?: string;\n cols?: ColSize;\n shouldRender?: ((data: any) => boolean) | boolean;\n nullAllChildrenIfConditionallyHidden?: boolean;\n children?: ConfigElement[];\n}\nexport interface SectionElement {\n type: 'section';\n label: string;\n class: string;\n cols: ColSize;\n /**\n * shouldRender is used to determine if the section should be\n * displayed to users.\n * When assigning shouldRender a function, the first argument\n * is the current state of the resource being displayed\n * Hides the layout AND all of its children\n */\n shouldRender: ((data: any) => boolean) | boolean;\n /** If shouldRender is NOT a function, this property does nothing\n * If shouldRender is a function, this property\n * sets children's values to null if shouldRender hides it (returns false)\n * within the resource-layout.component\n */\n nullAllChildrenIfConditionallyHidden: boolean;\n children: ConfigElement[];\n}\nexport function section(config: SectionElementOptions): SectionElement {\n return {\n ...sectionElementDefaults,\n ...config,\n } satisfies SectionElement;\n}\nexport const sectionElementDefaults = {\n type: 'section',\n label: '',\n class: '',\n cols: 12,\n shouldRender: true,\n nullAllChildrenIfConditionallyHidden: false,\n children: [],\n} satisfies SectionElement;\n\nexport interface FieldElementOptions {\n name: FieldName;\n label?: string;\n cols?: ColSize;\n class?: string;\n enumeratedConfig?: EnumeratedConfig;\n default?: FieldDefault;\n nullBooleanConfig?: NullBooleanConfig;\n validators?: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];\n readOnly?: boolean;\n prefixes?: Affix[];\n suffixes?: Affix[];\n shouldRender?: ((data: any) => boolean) | boolean;\n nullIfConditionallyHidden?: boolean;\n}\nexport interface FieldElement {\n type: 'field';\n name: string;\n label: string;\n cols: ColSize;\n class: string;\n enumeratedConfig: EnumeratedConfig;\n default: FieldDefault;\n nullBooleanConfig: NullBooleanConfig;\n /**\n * A list of validators that must pass to allow a field to be submitted.\n * Utilize existing validators in the resourceValidators object, and\n * add any new or custom validators to it\n */\n validators: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];\n readOnly: boolean;\n prefixes: Affix[];\n suffixes: Affix[];\n /**\n * shouldRender is used to determine if the element should be\n * displayed to users.\n * When assigning shouldRender a function, the first argument\n * is the current state of the resource being displayed\n */\n shouldRender: ((data: any) => boolean) | boolean;\n /** If shouldRender is NOT a function, this property does nothing\n * If shouldRender is a function, this property\n * determines whether the form control associated\n * with this config element should have its value\n * set to null if shouldRender hides it (returns false)\n */\n nullIfConditionallyHidden: boolean;\n}\n\nexport function field(config: FieldElementOptions): FieldElement {\n return {\n ...fieldElementDefaults,\n ...config,\n } satisfies FieldElement;\n}\nexport const fieldElementDefaults = {\n type: 'field',\n name: '',\n label: '',\n cols: 6,\n class: '',\n enumeratedConfig: { ...enumeratedConfigDefaults },\n default: null,\n validators: [],\n nullBooleanConfig: { ...nullBooleanConfigDefaults },\n readOnly: false,\n prefixes: [],\n suffixes: [],\n shouldRender: true,\n nullIfConditionallyHidden: false,\n} satisfies FieldElement;\n\n/**\n * RouteData is used to define the route for a config\n * route: the route for the config\n * hasViewRoute: when true, a route will be created for route/:uuid\n */\nexport interface RootRouteData {\n route?: string;\n hasViewRoute?: boolean;\n}\n\nexport interface RPCConfigOptions {\n label: string;\n afterMethodRedirect?: string;\n conditions: {\n field: FieldName;\n matchValues: string[];\n }[];\n methodBodyTemplate?: any;\n successMessage?: string;\n elements?: ConfigElement[];\n placement?: RPCPlacement;\n method: Method;\n customComponent?: ComponentConfig;\n refreshResources?: Resource[];\n defaultModalWidth?: string;\n shouldRender?: () => boolean;\n}\nexport interface RPCConfig {\n label: string;\n afterMethodRedirect: string | string[];\n conditions: {\n field: FieldName;\n matchValues: string[];\n }[];\n methodBodyTemplate: any;\n method: Method;\n successMessage: string;\n elements: ConfigElement[];\n placement: RPCPlacement;\n customComponent: ComponentConfig;\n refreshResources: Resource[];\n defaultModalWidth: string;\n shouldRender: () => boolean;\n}\nexport function rpcConfig(config: RPCConfigOptions): RPCConfig {\n return {\n ...rpcConfigDefaults,\n ...config,\n } satisfies RPCConfig;\n}\nexport const rpcConfigDefaults = {\n label: '',\n afterMethodRedirect: '',\n conditions: [] as {\n field: FieldName;\n matchValues: string[];\n }[],\n methodBodyTemplate: {} as any,\n successMessage: '',\n elements: [] as ConfigElement[],\n placement: 'end' as RPCPlacement,\n method: '' as Method,\n customComponent: {} as ComponentConfig,\n refreshResources: [] as Resource[],\n defaultModalWidth: '',\n shouldRender: (): boolean => true,\n} satisfies RPCConfig;\n\nexport interface RPCBaseFormData {\n elements: FieldElement[];\n label: string;\n method: Method;\n}\n\n// Config is the base type that all configurations should start with\nexport interface RootConfigOptions {\n routeData?: RootRouteData;\n nav?: {\n navItem: MenuItem;\n group?: string;\n };\n parentConfig: ParentResourceConfig;\n relatedConfigs?: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n}\nexport interface RootConfig {\n routeData: RootRouteData;\n nav: {\n navItem: MenuItem;\n group?: string;\n };\n parentConfig: ParentResourceConfig;\n relatedConfigs: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n}\nexport const rootConfigDefaults = {\n routeData: {} as RootRouteData,\n nav: {\n navItem: {} as MenuItem,\n },\n parentConfig: {} as ParentResourceConfig,\n relatedConfigs: [] as ChildResourceConfig[],\n rpcConfigs: [] as RPCConfig[],\n} satisfies RootConfig;\n\nexport function rootConfig(config: RootConfigOptions): RootConfig {\n return {\n ...rootConfigDefaults,\n ...config,\n } satisfies RootConfig;\n}\n\n// Base type config is the base type for all resource configurations\nexport interface BaseConfigOptions {\n title?: string;\n createTitle?: string;\n createButtonLabel?: string;\n primaryResource: Resource;\n parentClass?: string;\n fieldClass?: string;\n elements: ConfigElement[];\n createConfig?: ConfigType;\n parentRelation?: {\n parentKey: FieldName;\n childKey: FieldName;\n };\n showBackButton?: boolean;\n createNavigation?: string[];\n}\nexport interface BaseConfig {\n title: string;\n createTitle: string;\n createButtonLabel: string;\n primaryResource: Resource;\n parentClass: string;\n fieldClass: string;\n elements: ConfigElement[];\n createConfig: ConfigType;\n parentRelation: {\n parentKey: FieldName;\n childKey: FieldName;\n };\n showBackButton: boolean;\n createNavigation: string[];\n}\n\n@Directive()\nexport abstract class CustomConfigComponent {\n uuid = input<string>();\n parentData = input<RecordData>();\n config = input<ComponentConfig>();\n}\n\n// Available param types for a component config\nexport type ConfigParam = SwitchConfigParam;\n\n// Custom component config renders a custom component and supplies params to it\nexport interface ComponentConfigOptions {\n // todo: it's weird that we have a primary resource here. Would be nice to remove but this adds a null check to all other configs\n primaryResource: Resource;\n component: Type<CustomConfigComponent> | 'SwitchResolver';\n params?: ConfigParam;\n relatedConfig?: ParentResourceConfig[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ComponentConfig {\n type: 'Component';\n primaryResource: Resource;\n component: Type<CustomConfigComponent> | 'SwitchResolver';\n params: ConfigParam;\n relatedConfig: ParentResourceConfig[];\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport function componentConfig(config: ComponentConfigOptions): ComponentConfig {\n return {\n ...componentConfigDefaults,\n ...config,\n } satisfies ComponentConfig;\n}\nexport const componentConfigDefaults = {\n type: 'Component',\n primaryResource: '' as Resource,\n component: 'SwitchResolver',\n params: {\n cases: [],\n } satisfies ConfigParam,\n relatedConfig: [] as ParentResourceConfig[],\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ComponentConfig;\n\n// A switch is a component type that allows for conditional rendering of child components based on the value of a parent field\n// When parentData[c.parentField] equals c.caseId render the caseConfig with parentData[c.childId] as the uuid\nexport interface switchCase {\n caseId: string;\n parentField: string;\n childId: string;\n config: ChildResourceConfig;\n}\nexport interface SwitchConfigParamOptions {\n cases: switchCase[];\n}\nexport interface SwitchConfigParam {\n cases: switchCase[];\n}\nexport function switchParams(config: SwitchConfigParamOptions): SwitchConfigParam {\n return {\n ...switchParamsDefaults,\n ...config,\n } satisfies SwitchConfigParam;\n}\nexport const switchParamsDefaults = {\n cases: [] as switchCase[],\n} satisfies SwitchConfigParam;\n\nexport interface ListViewConfigOptions extends BaseConfigOptions {\n showViewButton?: boolean;\n loadCreatedResource?: boolean;\n collapsible?: boolean;\n overrideResource?: Resource;\n searchable?: boolean;\n enableRowExpansion?: boolean;\n rowExpansionConfig?: ChildResourceConfig;\n requireSearchToDisplayResults?: boolean;\n listColumns: ColumnConfig[];\n relatedConfigs?: ChildResourceConfig[];\n viewResource?: Resource | string;\n actionType?: ActionType;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter?: (parentResource: any) => string;\n disableCacheForFilterPii?: boolean;\n rpcConfigs?: RPCConfig[];\n sorts?: FieldSort[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ListViewConfig extends BaseConfig {\n type: 'ListView';\n showViewButton: boolean;\n loadCreatedResource: boolean;\n collapsible: boolean;\n overrideResource: Resource;\n searchable: boolean;\n enableRowExpansion: boolean;\n rowExpansionConfig: ChildResourceConfig;\n requireSearchToDisplayResults: boolean;\n listColumns: ColumnConfig[];\n relatedConfigs: ChildResourceConfig[];\n viewResource: Resource | string;\n actionType: ActionType;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n filter: (parentResource: any) => string;\n disableCacheForFilterPii: boolean;\n rpcConfigs?: RPCConfig[];\n sorts: FieldSort[];\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\n\nexport function listViewConfig(config: ListViewConfigOptions): ListViewConfig {\n return {\n ...listViewConfigDefaults,\n ...config,\n } satisfies ListViewConfig;\n}\nexport const listViewConfigDefaults = {\n title: '',\n primaryResource: '' as Resource,\n type: 'ListView',\n createTitle: '',\n createButtonLabel: 'Create',\n loadCreatedResource: false,\n showViewButton: true,\n collapsible: false,\n listColumns: [],\n elements: [],\n parentClass: '',\n fieldClass: '',\n createConfig: {} as ListViewConfig,\n createNavigation: [],\n relatedConfigs: [],\n parentRelation: {\n parentKey: '' as FieldName,\n childKey: '' as FieldName,\n },\n overrideResource: '' as Resource,\n searchable: false,\n enableRowExpansion: false,\n rowExpansionConfig: {} as ChildResourceConfig,\n requireSearchToDisplayResults: false,\n showBackButton: true,\n filter: (): string => '',\n disableCacheForFilterPii: false,\n sorts: [] as FieldSort[],\n viewResource: '' as Resource,\n actionType: 'function' as ActionType,\n rpcConfigs: [],\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ListViewConfig;\n\nexport type ViewType = 'OneToOne' | 'OneToMany';\n\nexport interface ViewConfigOptions extends BaseConfigOptions {\n collapsible?: boolean;\n connectorResource?: Resource;\n relatedConfigs?: ChildResourceConfig[];\n rpcConfigs?: RPCConfig[];\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ViewConfig extends BaseConfig {\n type: 'View';\n collapsible: boolean;\n // todo: remove this comment once full documentation has been added. Populate this value when a database view resource is used to connect the ViewConfig's parent resource to its primary resource\n connectorResource: Resource;\n rpcConfigs?: RPCConfig[];\n relatedConfigs: ChildResourceConfig[];\n /** A set of functions that allows for\n * conditional display of non-RPC\n * actions based on the pristine state of the resource\n * (if such a state is applicable. Creation for example won't\n * have such data)\n * This is separate from ABAC control which takes\n * precedence and is based on a user's attributes\n */\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\n\nexport function viewConfig(config: ViewConfigOptions): ViewConfig {\n return {\n ...viewConfigDefaults,\n ...config,\n } satisfies ViewConfig;\n}\nexport const viewConfigDefaults = {\n title: '',\n primaryResource: '' as Resource,\n type: 'View',\n createTitle: '',\n createButtonLabel: 'Create',\n parentClass: '',\n fieldClass: '',\n elements: [],\n collapsible: true,\n connectorResource: '' as Resource,\n relatedConfigs: [],\n createConfig: {} as ViewConfig,\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n createNavigation: [],\n parentRelation: {\n parentKey: '' as FieldName,\n childKey: '' as FieldName,\n },\n showBackButton: true,\n rpcConfigs: [],\n} satisfies ViewConfig;\n\nexport interface arrayConfigOptions {\n iteratedConfig: ChildResourceConfig;\n viewType?: ViewType;\n collapsible?: boolean;\n createConfig?: ConfigType;\n connectorResource?: Resource;\n connectorField?: FieldName;\n primaryResource: Resource;\n listFilter: (parentResource: any) => string;\n disableCacheForFilterPii?: boolean;\n sorts?: FieldSort[];\n title?: string;\n createButtonLabel?: string;\n limit?: number;\n shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n}\nexport interface ArrayConfig {\n type: 'Array';\n iteratedConfig: ChildResourceConfig;\n viewType: ViewType;\n collapsible: boolean;\n createConfig: ConfigType;\n connectorResource: Resource;\n connectorField: FieldName;\n primaryResource: Resource;\n listFilter: (parentResource: any) => string;\n disableCacheForFilterPii: boolean;\n sorts: FieldSort[];\n title: string;\n createButtonLabel: string;\n shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;\n limit: number;\n}\nexport function arrayConfig(config: arrayConfigOptions): ArrayConfig {\n return {\n ...arrayConfigDefaults,\n ...config,\n } satisfies ArrayConfig;\n}\nexport const arrayConfigDefaults = {\n type: 'Array',\n iteratedConfig: {} as ChildResourceConfig,\n viewType: 'OneToMany' as ViewType,\n collapsible: true,\n createConfig: {} as ViewConfig,\n connectorResource: '' as Resource,\n connectorField: '' as FieldName,\n primaryResource: '' as Resource,\n listFilter: (): string => '',\n disableCacheForFilterPii: false,\n sorts: [] as FieldSort[],\n title: '',\n createButtonLabel: 'Create',\n limit: Infinity,\n shouldRenderActions: {\n create: (): boolean => true,\n edit: (): boolean => true,\n delete: (): boolean => true,\n },\n} satisfies ArrayConfig;\n","export enum AlertLevel {\n ERROR = 'warn',\n INFO = 'accent',\n SUCCESS = 'success',\n}\n\nexport interface CreateNotificationMessage {\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n\nexport interface NotificationMessage {\n id: number;\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n","type Brand<K, T> = K & { __brand: T };\n\nexport type Permission = Brand<string, 'Permission'>;\nexport type Resource = Brand<string, 'Resource'>;\nexport type Domain = Brand<string, 'Domain'>;\nexport type FieldName = Brand<string, 'FieldName'>;\nexport type Method = Brand<string, 'Method'>;\nexport type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;\n\nexport interface PermissionScope {\n resource: Resource;\n permission: Permission;\n domain: Domain;\n}\n\nexport const ReadPermission = 'Read' as Permission;\nexport const UpdatePermission = 'Update' as Permission;\n","import { InjectionToken } from '@angular/core';\nimport { Domain, Permission, Resource } from './permissions';\nimport { MethodMeta, ResourceMeta } from './resource-meta';\n\n/**\n * The base URL for API requests (e.g., 'https://api.example.com/').\n */\nexport const BASE_URL = new InjectionToken<string>('BASE_URL');\n\n/**\n * The path to the frontend login page (e.g., '/login').\n */\nexport const FRONTEND_LOGIN_PATH = new InjectionToken<string>('FRONTEND_LOGIN_PATH');\n\n/**\n * The path to the session endpoint (e.g., 'user/session').\n */\nexport const SESSION_PATH = new InjectionToken<string>('SESSION_PATH');\n\n/**\n * The base URL for API requests (e.g., '/api').\n */\nexport const API_URL = new InjectionToken<string>('API_URL');\n\nexport const PERMISSION_REQUIRED = new InjectionToken<(resource: Resource, permission: Permission) => boolean>(\n 'PERMISSION_REQUIRED',\n);\n\nexport const AVAILABLE_PERMISSIONS = new InjectionToken<{\n Create: Permission;\n Delete: Permission;\n List: Permission;\n Read: Permission;\n Update: Permission;\n}>('AVAILABLE_PERMISSIONS');\nexport const AVAILABLE_DOMAINS = new InjectionToken<Record<string, Domain>[]>('AVAILABLE_DOMAINS');\n\nexport const RESOURCE_META = new InjectionToken<(resource: Resource) => ResourceMeta>('RESOURCE_META');\nexport const METHOD_META = new InjectionToken<(method: string) => MethodMeta>('METHOD_META');\n\nexport const IDLE_SESSION_DURATION = new InjectionToken<number>('IDLE_SESSION_DURATION');\nexport const IDLE_WARNING_DURATION = new InjectionToken<number>('IDLE_WARNING_DURATION');\nexport const IDLE_KEEPALIVE_DURATION = new InjectionToken<number>('IDLE_KEEPALIVE_DURATION');\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport const validatorsPresent = (\n control: AbstractControl<unknown, unknown>,\n validators: ValidatorFn[],\n previousValidatorCount: number,\n): boolean => {\n if (validators.length === previousValidatorCount) {\n return true;\n }\n\n let hasAllValidators = true;\n for (const validator of validators) {\n if (!control.hasValidator(validator)) {\n hasAllValidators = false;\n break;\n }\n }\n return hasAllValidators;\n};\n\nexport const requiredIf = (predicate: () => boolean, validator: ValidatorFn) => {\n return (formControl: AbstractControl): ValidationErrors | null => {\n if (!formControl.parent) {\n return null;\n }\n if (predicate()) {\n return validator(formControl);\n }\n return null;\n };\n};\n\ndeclare const __singletonValidatorBrand: unique symbol;\nexport type ResourceValidatorFn = ValidatorFn & {\n readonly [__singletonValidatorBrand]: true;\n};\nexport function createResourceValidator(validator: ValidatorFn): ResourceValidatorFn {\n return validator as ResourceValidatorFn;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAO,MAAM,sBAAsB,GAAG;;ACkEhC,SAAU,kBAAkB,CAAC,MAAiC,EAAA;IAClE,OAAO;AACL,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACmB;AAChC;AAEO,MAAM,0BAA0B,GAAG;AACxC,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,UAAU,EAAE,UAAwB;AACpC,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,aAAa,EAAE,EAAE;;AAwCb,SAAU,kBAAkB,CAAC,MAAiC,EAAA;IAClE,OAAO;AACL,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACmB;AAChC;AAEO,MAAM,0BAA0B,GAAG;AACxC,IAAA,EAAE,EAAE,EAAe;AACnB,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,UAAU,EAAE,UAAwB;AACpC,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,UAAU,EAAE,KAAK;;AAab,SAAU,iBAAiB,CAAC,MAAgC,EAAA;IAChE,OAAO;AACL,QAAA,GAAG,yBAAyB;AAC5B,QAAA,GAAG,MAAM;KACkB;AAC/B;AAEO,MAAM,yBAAyB,GAAG;AACvC,IAAA,GAAG,0BAA0B;AAC7B,IAAA,aAAa,EAAE,EAAgC;AAC/C,IAAA,QAAQ,EAAE,eAA+B;;AAgBrC,SAAU,wBAAwB,CAAC,MAAuC,EAAA;IAC9E,OAAO;AACL,QAAA,GAAG,gCAAgC;AACnC,QAAA,GAAG,MAAM;KACyB;AACtC;AAEO,MAAM,gCAAgC,GAAG;AAC9C,IAAA,EAAE,EAAE,EAAe;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gB,GAAG,KAAK;YACxB;QACF;IACF;AACA,IAAA,OAAO,gBAAgB;AACzB;MAEa,UAAU,GAAG,CAAC,SAAwB,EAAE,SAAsB,KAAI;IAC7E,OAAO,CAAC,WAA4B,KAA6B;AAC/D,QAAA,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;AACvB,YAAA,OAAO,IAAI;QACb;QACA,IAAI,SAAS,EAAE,EAAE;AACf,YAAA,OAAO,SAAS,CAAC,WAAW,CAAC;QAC/B;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;AAMM,SAAU,uBAAuB,CAAC,SAAsB,EAAA;AAC5D,IAAA,OAAO,SAAgC;AACzC;;ACvCA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cccteam/ccc-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git://github.com/cccteam/ccc-lib.git"
|
|
@@ -61,6 +61,18 @@
|
|
|
61
61
|
"types": "./types/cccteam-ccc-lib-forms.d.ts",
|
|
62
62
|
"default": "./fesm2022/cccteam-ccc-lib-forms.mjs"
|
|
63
63
|
},
|
|
64
|
+
"./guards": {
|
|
65
|
+
"types": "./types/cccteam-ccc-lib-guards.d.ts",
|
|
66
|
+
"default": "./fesm2022/cccteam-ccc-lib-guards.mjs"
|
|
67
|
+
},
|
|
68
|
+
"./resource-nav": {
|
|
69
|
+
"types": "./types/cccteam-ccc-lib-resource-nav.d.ts",
|
|
70
|
+
"default": "./fesm2022/cccteam-ccc-lib-resource-nav.mjs"
|
|
71
|
+
},
|
|
72
|
+
"./resource-route-generator": {
|
|
73
|
+
"types": "./types/cccteam-ccc-lib-resource-route-generator.d.ts",
|
|
74
|
+
"default": "./fesm2022/cccteam-ccc-lib-resource-route-generator.mjs"
|
|
75
|
+
},
|
|
64
76
|
"./types": {
|
|
65
77
|
"types": "./types/cccteam-ccc-lib-types.d.ts",
|
|
66
78
|
"default": "./fesm2022/cccteam-ccc-lib-types.mjs"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ModelSignal, Injector, Signal, ResourceRef, OnInit, Type, DestroyRef, ViewContainerRef, WritableSignal } from '@angular/core';
|
|
3
3
|
import * as _cccteam_ccc_lib_types from '@cccteam/ccc-lib/types';
|
|
4
|
-
import { ResourceMeta, RecordData,
|
|
4
|
+
import { ResourceMeta, RecordData, Resource, DataType, ViewConfig, ConfigElement, RPCRecordData, MethodMeta, FieldSort, ColumnConfig, RPCConfig, FieldElement, Method, RPCBaseFormData, RootConfig, ParentResourceConfig, ChildResourceConfig, FormatType, PaddingElement, ArrayConfig, ListViewConfig, Meta, FieldMeta, RPCFieldMeta, ValidDisplayTypes, ComponentConfig } from '@cccteam/ccc-lib/types';
|
|
5
5
|
import { MatDialog } from '@angular/material/dialog';
|
|
6
|
-
import {
|
|
6
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
7
7
|
import { NotificationService } from '@cccteam/ccc-lib/ui-notification-service';
|
|
8
8
|
import { HttpClient } from '@angular/common/http';
|
|
9
9
|
import { Observable } from 'rxjs';
|
|
@@ -39,25 +39,16 @@ declare class FormStateService {
|
|
|
39
39
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<FormStateService>;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
declare const generatedNavItems: MenuItem[];
|
|
43
|
-
declare const generatedNavGroups: string[];
|
|
44
42
|
interface Link {
|
|
45
43
|
id: string;
|
|
46
44
|
resource: Resource;
|
|
47
45
|
text: string;
|
|
48
46
|
}
|
|
49
|
-
type ResourceMap = Record<Resource, ResourceMeta>;
|
|
50
47
|
type PristineData = Record<string, DataType | null>;
|
|
51
48
|
declare const createFormGroup: (meta: ResourceMeta, resourceData: RecordData, config: ViewConfig, formDataState?: ModelSignal<RecordData>) => {
|
|
52
49
|
formGroup: FormGroup;
|
|
53
50
|
pristineFormValues: PristineData;
|
|
54
51
|
};
|
|
55
|
-
declare const resourceRoutes: (config: RootConfig, resourceMeta: (resource: Resource) => ResourceMeta) => Route;
|
|
56
|
-
/**
|
|
57
|
-
* Recursive function to extract nested field names from a config.
|
|
58
|
-
* @param elements - The elements to extract field names from.
|
|
59
|
-
* @returns - An array of field names.
|
|
60
|
-
*/
|
|
61
52
|
declare function extractFieldNames(elements: ConfigElement[]): string[];
|
|
62
53
|
type PatchOperation = 'add' | 'patch' | 'remove';
|
|
63
54
|
interface Operation {
|
|
@@ -74,20 +65,7 @@ interface UpdateOperation extends Operation {
|
|
|
74
65
|
interface DeleteOperation extends Operation {
|
|
75
66
|
op: 'remove';
|
|
76
67
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Checks if a string is a valid UUID (versions 1-5) according to RFC 4122.
|
|
79
|
-
*
|
|
80
|
-
* @param str - The string to validate.
|
|
81
|
-
* @returns `true` if the string is a valid UUID, otherwise `false`.
|
|
82
|
-
*/
|
|
83
68
|
declare function isUUID(str: string): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Coerces metadata types in a record according to the metadata.
|
|
86
|
-
*
|
|
87
|
-
* @param record - The record to coerce.
|
|
88
|
-
* @param meta - The metadata (resource or method).
|
|
89
|
-
* @returns The coerced record.
|
|
90
|
-
*/
|
|
91
69
|
declare function metadataTypeCoercion(record: RecordData, meta: ResourceMeta): RecordData;
|
|
92
70
|
declare function metadataTypeCoercion(record: RPCRecordData, meta: MethodMeta): RPCRecordData;
|
|
93
71
|
|
|
@@ -178,12 +156,6 @@ declare class BaseRPCModalComponent {
|
|
|
178
156
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BaseRPCModalComponent, "ccc-base-rpc-modal", never, {}, {}, never, never, true, never>;
|
|
179
157
|
}
|
|
180
158
|
|
|
181
|
-
type CanDeactivateType = Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
|
182
|
-
interface CanComponentDeactivate {
|
|
183
|
-
canDeactivate: () => CanDeactivateType;
|
|
184
|
-
}
|
|
185
|
-
declare const canDeactivateGuard: CanDeactivateFn<CanComponentDeactivate>;
|
|
186
|
-
|
|
187
159
|
declare class CompoundResourceComponent implements OnInit {
|
|
188
160
|
location: Location;
|
|
189
161
|
route: ActivatedRoute;
|
|
@@ -191,7 +163,7 @@ declare class CompoundResourceComponent implements OnInit {
|
|
|
191
163
|
injector: Injector;
|
|
192
164
|
componentRef: Type<any>;
|
|
193
165
|
resourceMeta: (resource: Resource) => _cccteam_ccc_lib_types.ResourceMeta;
|
|
194
|
-
resourceConfig: _angular_core.InputSignal<_cccteam_ccc_lib_types.
|
|
166
|
+
resourceConfig: _angular_core.InputSignal<_cccteam_ccc_lib_types.ViewConfig | _cccteam_ccc_lib_types.ListViewConfig | _cccteam_ccc_lib_types.ArrayConfig | _cccteam_ccc_lib_types.ComponentConfig | undefined>;
|
|
195
167
|
isArrayChild: _angular_core.InputSignal<boolean>;
|
|
196
168
|
uuid: _angular_core.InputSignal<string>;
|
|
197
169
|
parentData: _angular_core.InputSignal<RecordData | undefined>;
|
|
@@ -204,7 +176,7 @@ declare class CompoundResourceComponent implements OnInit {
|
|
|
204
176
|
navAfterDeleteConsideringRoot: _angular_core.Signal<boolean>;
|
|
205
177
|
hasElements: _angular_core.Signal<boolean>;
|
|
206
178
|
primaryConfigParentId: _angular_core.Signal<string>;
|
|
207
|
-
primaryConfig: _angular_core.Signal<_cccteam_ccc_lib_types.ComponentConfig
|
|
179
|
+
primaryConfig: _angular_core.Signal<ParentResourceConfig | _cccteam_ccc_lib_types.ComponentConfig>;
|
|
208
180
|
title: _angular_core.Signal<string>;
|
|
209
181
|
isRootConfig: _angular_core.Signal<boolean>;
|
|
210
182
|
configs: _angular_core.Signal<ChildResourceConfig[]>;
|
|
@@ -404,7 +376,7 @@ declare class ResourceCreateComponent implements OnInit {
|
|
|
404
376
|
parentData: _angular_core.InputSignal<RecordData>;
|
|
405
377
|
loadCreatedResource: _angular_core.InputSignal<boolean>;
|
|
406
378
|
rootConfig: _angular_core.Signal<RootConfig>;
|
|
407
|
-
config: _angular_core.Signal<
|
|
379
|
+
config: _angular_core.Signal<ViewConfig | ListViewConfig>;
|
|
408
380
|
indentTitle: _angular_core.Signal<boolean>;
|
|
409
381
|
form: _angular_core.Signal<FormGroup<{}>>;
|
|
410
382
|
route: _angular_core.Signal<string>;
|
|
@@ -594,7 +566,7 @@ declare class ResourceViewComponent implements OnInit {
|
|
|
594
566
|
dialog: MatDialog;
|
|
595
567
|
editMode: WritableSignal<'edit' | 'view'>;
|
|
596
568
|
uuid: _angular_core.InputSignal<string>;
|
|
597
|
-
config: _angular_core.InputSignal<
|
|
569
|
+
config: _angular_core.InputSignal<ViewConfig | ListViewConfig>;
|
|
598
570
|
relatedData: _angular_core.InputSignal<RecordData>;
|
|
599
571
|
compoundResourceView: _angular_core.InputSignal<boolean>;
|
|
600
572
|
isDirty: WritableSignal<boolean>;
|
|
@@ -608,7 +580,7 @@ declare class ResourceViewComponent implements OnInit {
|
|
|
608
580
|
commonButtonConfig: _angular_core.Signal<{
|
|
609
581
|
meta: _cccteam_ccc_lib_types.ResourceMeta;
|
|
610
582
|
resourceData: RecordData;
|
|
611
|
-
config:
|
|
583
|
+
config: ViewConfig | ListViewConfig;
|
|
612
584
|
} | undefined>;
|
|
613
585
|
editButtonContext: _angular_core.Signal<{
|
|
614
586
|
actionType: "edit";
|
|
@@ -639,7 +611,7 @@ declare class ResourceViewComponent implements OnInit {
|
|
|
639
611
|
};
|
|
640
612
|
}[] | undefined>;
|
|
641
613
|
useExpansionPanel: _angular_core.Signal<boolean>;
|
|
642
|
-
resourceConfigRouteSnapshot: _angular_core.Signal<
|
|
614
|
+
resourceConfigRouteSnapshot: _angular_core.Signal<ViewConfig | ListViewConfig>;
|
|
643
615
|
emptyFormGroup: FormGroup<{}>;
|
|
644
616
|
form: _angular_core.Signal<FormGroup<{}>>;
|
|
645
617
|
pristineFormValues: Record<string, DataType | null>;
|
|
@@ -659,5 +631,5 @@ declare class ResourceViewComponent implements OnInit {
|
|
|
659
631
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ResourceViewComponent, "ccc-resource-view", never, { "uuid": { "alias": "uuid"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "relatedData": { "alias": "relatedData"; "required": false; "isSignal": true; }; "compoundResourceView": { "alias": "compoundResourceView"; "required": false; "isSignal": true; }; "navAfterDelete": { "alias": "navAfterDelete"; "required": false; "isSignal": true; }; "showCreateForm": { "alias": "showCreateForm"; "required": false; "isSignal": true; }; }, { "deleted": "deleted"; "showCreateForm": "showCreateFormChange"; }, never, never, true, never>;
|
|
660
632
|
}
|
|
661
633
|
|
|
662
|
-
export { ActionAccessControlWrapperComponent, BaseInputComponent, BaseRPCModalComponent, CompoundResourceComponent, DeleteResourceConfirmationModalComponent, EmptyReadonlyFieldComponent, FormStateService, LeavePageConfirmationModalComponent, PaddingElementComponent, ResourceArrayViewComponent, ResourceCreateComponent, ResourceFieldComponent, ResourceLayoutComponent, ResourceListComponent, ResourceListCreateComponent, ResourceResolverComponent, ResourceStore, ResourceViewComponent, RpcButtonComponent, ValueFormatters, applyFormatting,
|
|
663
|
-
export type { ActionButtonContext,
|
|
634
|
+
export { ActionAccessControlWrapperComponent, BaseInputComponent, BaseRPCModalComponent, CompoundResourceComponent, DeleteResourceConfirmationModalComponent, EmptyReadonlyFieldComponent, FormStateService, LeavePageConfirmationModalComponent, PaddingElementComponent, ResourceArrayViewComponent, ResourceCreateComponent, ResourceFieldComponent, ResourceLayoutComponent, ResourceListComponent, ResourceListCreateComponent, ResourceResolverComponent, ResourceStore, ResourceViewComponent, RpcButtonComponent, ValueFormatters, applyFormatting, civildateCoercion, concatFunctions, createFormGroup, extractFieldNames, flattenElements, formatDateString, hyphenConcat, hyphenConcatWithoutResource, hyphenSpaceConcat, hyphenSpaceConcatWithoutResource, isUUID, maxConfigElementRecursionDepth, maxLayoutNestingDepth, metadataTypeCoercion, noSpaceConcatWithoutResource, resourceValidators, simpleSlashDateFormatter, spaceConcat, spaceConcatWithoutResource, spaceHyphenConcat, spaceHyphenConcatWithoutResource };
|
|
635
|
+
export type { ActionButtonContext, CreateOperation, DeleteOperation, FormatterFn, Link, Operation, PatchOperation, PristineData, UpdateOperation };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UrlTree, CanDeactivateFn } from '@angular/router';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
type CanDeactivateType = Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
|
5
|
+
interface CanComponentDeactivate {
|
|
6
|
+
canDeactivate: () => CanDeactivateType;
|
|
7
|
+
}
|
|
8
|
+
declare const canDeactivateGuard: CanDeactivateFn<CanComponentDeactivate>;
|
|
9
|
+
|
|
10
|
+
export { canDeactivateGuard };
|
|
11
|
+
export type { CanComponentDeactivate, CanDeactivateType };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MenuItem } from '@cccteam/ccc-lib/types';
|
|
2
|
+
|
|
3
|
+
declare const generatedNavItems: MenuItem[];
|
|
4
|
+
declare const generatedNavGroups: string[];
|
|
5
|
+
/**
|
|
6
|
+
* Adds a navigation item to the generated nav items array.
|
|
7
|
+
*/
|
|
8
|
+
declare function addNavItem(nav: {
|
|
9
|
+
navItem: MenuItem;
|
|
10
|
+
group?: string;
|
|
11
|
+
}, route: string): void;
|
|
12
|
+
|
|
13
|
+
export { addNavItem, generatedNavGroups, generatedNavItems };
|