@cccteam/ccc-lib 0.0.15 → 0.0.16
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 +38 -13
- package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs +36 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs +25 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs +83 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs +44 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs +82 -0
- package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-camel-case-to-title.mjs +33 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-camel-case-to-title.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-grid.mjs +256 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-grid.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-resource.mjs +3129 -0
- package/fesm2022/cccteam-ccc-lib-src-ccc-resource.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-forms.mjs +79 -0
- package/fesm2022/cccteam-ccc-lib-src-forms.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-internal-types.mjs +6 -0
- package/fesm2022/cccteam-ccc-lib-src-internal-types.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-types.mjs +431 -0
- package/fesm2022/cccteam-ccc-lib-src-types.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs +48 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs +41 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-idle-service.mjs +157 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-idle-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs +50 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs +63 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs +60 -0
- package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs +19 -0
- package/fesm2022/cccteam-ccc-lib-src-util-request-options.mjs.map +1 -0
- package/fesm2022/cccteam-ccc-lib.mjs +4444 -0
- package/fesm2022/cccteam-ccc-lib.mjs.map +1 -0
- package/package.json +88 -5
- package/types/cccteam-ccc-lib-src-auth-authentication-guard.d.ts +6 -0
- package/types/cccteam-ccc-lib-src-auth-authorization-guard.d.ts +6 -0
- package/types/cccteam-ccc-lib-src-auth-forms.d.ts +28 -0
- package/types/cccteam-ccc-lib-src-auth-has-permission.d.ts +15 -0
- package/types/cccteam-ccc-lib-src-auth-service.d.ts +38 -0
- package/types/cccteam-ccc-lib-src-ccc-camel-case-to-title.d.ts +10 -0
- package/types/cccteam-ccc-lib-src-ccc-grid.d.ts +35 -0
- package/types/cccteam-ccc-lib-src-ccc-resource.d.ts +674 -0
- package/types/cccteam-ccc-lib-src-forms.d.ts +27 -0
- package/types/cccteam-ccc-lib-src-types.d.ts +934 -0
- package/types/cccteam-ccc-lib-src-ui-alert.d.ts +16 -0
- package/types/cccteam-ccc-lib-src-ui-core-service.d.ts +20 -0
- package/types/cccteam-ccc-lib-src-ui-idle-service.d.ts +49 -0
- package/types/cccteam-ccc-lib-src-ui-interceptor.d.ts +16 -0
- package/types/cccteam-ccc-lib-src-ui-notification-service.d.ts +33 -0
- package/types/cccteam-ccc-lib-src-ui-sidenav.d.ts +33 -0
- package/types/cccteam-ccc-lib-src-util-request-options.d.ts +12 -0
- package/types/cccteam-ccc-lib.d.ts +1877 -0
- package/eslint.config.js +0 -32
- package/ng-package.json +0 -11
- package/src/auth-authentication-guard/authentication.guard.ts +0 -40
- package/src/auth-authentication-guard/index.ts +0 -1
- package/src/auth-authentication-guard/ng-package.json +0 -6
- package/src/auth-authorization-guard/authorization.guard.ts +0 -17
- package/src/auth-authorization-guard/index.ts +0 -1
- package/src/auth-authorization-guard/ng-package.json +0 -6
- package/src/auth-forms/ccc-field/ccc-field.component.html +0 -1
- package/src/auth-forms/ccc-field/ccc-field.component.scss +0 -0
- package/src/auth-forms/ccc-field/ccc-field.component.spec.ts +0 -22
- package/src/auth-forms/ccc-field/ccc-field.component.ts +0 -74
- package/src/auth-forms/form-helpers.ts +0 -39
- package/src/auth-forms/index.ts +0 -3
- package/src/auth-forms/ng-package.json +0 -6
- package/src/auth-has-permission/has-permission.directive.ts +0 -34
- package/src/auth-has-permission/index.ts +0 -1
- package/src/auth-has-permission/ng-package.json +0 -6
- package/src/auth-service/auth.service.ts +0 -92
- package/src/auth-service/index.ts +0 -1
- package/src/auth-service/ng-package.json +0 -6
- package/src/ccc-camel-case-to-title/camel-case-to-title.pipe.ts +0 -23
- package/src/ccc-camel-case-to-title/index.ts +0 -1
- package/src/ccc-camel-case-to-title/ng-package.json +0 -6
- package/src/ccc-grid/ccc-grid.component.ts +0 -155
- package/src/ccc-grid/index.ts +0 -3
- package/src/ccc-grid/ng-package.json +0 -6
- package/src/ccc-grid/table-button/table-button.component.html +0 -16
- package/src/ccc-grid/table-button/table-button.component.scss +0 -5
- package/src/ccc-grid/table-button/table-button.component.spec.ts +0 -22
- package/src/ccc-grid/table-button/table-button.component.ts +0 -49
- package/src/ccc-resource/can-deactivate.guard.ts +0 -41
- package/src/ccc-resource/compound-resource/compound-resource.component.html +0 -57
- package/src/ccc-resource/compound-resource/compound-resource.component.scss +0 -86
- package/src/ccc-resource/compound-resource/compound-resource.component.spec.ts +0 -22
- package/src/ccc-resource/compound-resource/compound-resource.component.ts +0 -158
- package/src/ccc-resource/concat-fns.ts +0 -162
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.html +0 -12
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.scss +0 -0
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.spec.ts +0 -23
- package/src/ccc-resource/empty-readonly-field/empty-readonly-field.component.ts +0 -17
- package/src/ccc-resource/form-state.service.ts +0 -24
- package/src/ccc-resource/format-fns.ts +0 -49
- package/src/ccc-resource/gui-constants.ts +0 -88
- package/src/ccc-resource/index.ts +0 -23
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.html +0 -8
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.scss +0 -0
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.spec.ts +0 -22
- package/src/ccc-resource/leave-page-confirmation-modal/leave-page-confirmation-modal.component.ts +0 -12
- package/src/ccc-resource/ng-package.json +0 -6
- package/src/ccc-resource/operation-types.ts +0 -19
- package/src/ccc-resource/padding-element/padding-element.component.html +0 -1
- package/src/ccc-resource/padding-element/padding-element.component.scss +0 -3
- package/src/ccc-resource/padding-element/padding-element.component.spec.ts +0 -22
- package/src/ccc-resource/padding-element/padding-element.component.ts +0 -20
- package/src/ccc-resource/resource-array-view/resource-array-view.component.html +0 -81
- package/src/ccc-resource/resource-array-view/resource-array-view.component.scss +0 -21
- package/src/ccc-resource/resource-array-view/resource-array-view.component.spec.ts +0 -22
- package/src/ccc-resource/resource-array-view/resource-array-view.component.ts +0 -143
- package/src/ccc-resource/resource-base/resource-base.component.spec.ts +0 -22
- package/src/ccc-resource/resource-base/resource-base.component.ts +0 -11
- package/src/ccc-resource/resource-cache.service.ts +0 -232
- package/src/ccc-resource/resource-create/resource-create.component.html +0 -31
- package/src/ccc-resource/resource-create/resource-create.component.scss +0 -130
- package/src/ccc-resource/resource-create/resource-create.component.spec.ts +0 -22
- package/src/ccc-resource/resource-create/resource-create.component.ts +0 -303
- package/src/ccc-resource/resource-field/base-field.directive.ts +0 -102
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.html +0 -16
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/boolean-field/boolean-field.component.ts +0 -15
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.html +0 -13
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.spec.ts +0 -23
- package/src/ccc-resource/resource-field/fields/computed-field/computed-field.component.ts +0 -50
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.html +0 -22
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.scss +0 -0
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/date-field/date-field.component.ts +0 -14
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.html +0 -71
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.scss +0 -9
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/enumerated-field/enumerated-field.component.ts +0 -207
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.html +0 -38
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.scss +0 -3
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/nullboolean-field/nullboolean-field.component.ts +0 -87
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.html +0 -23
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.scss +0 -6
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/number-field/number-field.component.ts +0 -14
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.html +0 -29
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.scss +0 -6
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/fields/text-field/text-field.component.ts +0 -23
- package/src/ccc-resource/resource-field/resource-field.component.html +0 -112
- package/src/ccc-resource/resource-field/resource-field.component.scss +0 -7
- package/src/ccc-resource/resource-field/resource-field.component.spec.ts +0 -22
- package/src/ccc-resource/resource-field/resource-field.component.ts +0 -214
- package/src/ccc-resource/resource-layout/resource-layout.component.html +0 -73
- package/src/ccc-resource/resource-layout/resource-layout.component.scss +0 -26
- package/src/ccc-resource/resource-layout/resource-layout.component.spec.ts +0 -22
- package/src/ccc-resource/resource-layout/resource-layout.component.ts +0 -176
- package/src/ccc-resource/resource-list/ resource-list.component.spec.ts +0 -22
- package/src/ccc-resource/resource-list/resource-list.component.html +0 -27
- package/src/ccc-resource/resource-list/resource-list.component.scss +0 -67
- package/src/ccc-resource/resource-list/resource-list.component.ts +0 -376
- package/src/ccc-resource/resource-list-create/resource-list-create.component.html +0 -71
- package/src/ccc-resource/resource-list-create/resource-list-create.component.scss +0 -9
- package/src/ccc-resource/resource-list-create/resource-list-create.component.spec.ts +0 -22
- package/src/ccc-resource/resource-list-create/resource-list-create.component.ts +0 -103
- package/src/ccc-resource/resource-resolver/resource-resolver.component.html +0 -1
- package/src/ccc-resource/resource-resolver/resource-resolver.component.scss +0 -0
- package/src/ccc-resource/resource-resolver/resource-resolver.component.spec.ts +0 -22
- package/src/ccc-resource/resource-resolver/resource-resolver.component.ts +0 -69
- package/src/ccc-resource/resource-store.service.ts +0 -93
- package/src/ccc-resource/resource-view/resource-view.component.html +0 -133
- package/src/ccc-resource/resource-view/resource-view.component.scss +0 -150
- package/src/ccc-resource/resource-view/resource-view.component.spec.ts +0 -22
- package/src/ccc-resource/resource-view/resource-view.component.ts +0 -354
- package/src/ccc-resource/resources-helpers.ts +0 -262
- package/src/ccc-resource/utils/validator-utils.ts +0 -6
- package/src/index.ts +0 -44
- package/src/internal-types/ng-package.json +0 -6
- package/src/types/auth.actions.ts +0 -46
- package/src/types/configs.ts +0 -952
- package/src/types/constants.ts +0 -1
- package/src/types/core.actions.ts +0 -33
- package/src/types/index.ts +0 -9
- package/src/types/ng-package.json +0 -6
- package/src/types/notification-message.ts +0 -20
- package/src/types/permissions.ts +0 -17
- package/src/types/session-info.ts +0 -10
- package/src/types/tokens.ts +0 -20
- package/src/ui-alert/alert.component.html +0 -13
- package/src/ui-alert/alert.component.scss +0 -48
- package/src/ui-alert/alert.component.spec.ts +0 -22
- package/src/ui-alert/alert.component.ts +0 -35
- package/src/ui-alert/index.ts +0 -1
- package/src/ui-alert/ng-package.json +0 -6
- package/src/ui-core-service/index.ts +0 -1
- package/src/ui-core-service/ng-package.json +0 -6
- package/src/ui-core-service/ui-core.service.ts +0 -34
- package/src/ui-interceptor/api.interceptor.spec.ts +0 -16
- package/src/ui-interceptor/api.interceptor.ts +0 -45
- package/src/ui-interceptor/index.ts +0 -1
- package/src/ui-interceptor/ng-package.json +0 -6
- package/src/ui-notification-service/index.ts +0 -1
- package/src/ui-notification-service/ng-package.json +0 -6
- package/src/ui-notification-service/notification.service.ts +0 -59
- package/src/ui-sidenav/index.ts +0 -1
- package/src/ui-sidenav/ng-package.json +0 -6
- package/src/ui-sidenav/sidenav.component.html +0 -60
- package/src/ui-sidenav/sidenav.component.scss +0 -99
- package/src/ui-sidenav/sidenav.component.spec.ts +0 -22
- package/src/ui-sidenav/sidenav.component.ts +0 -64
- package/src/util-request-options/index.ts +0 -1
- package/src/util-request-options/ng-package.json +0 -6
- package/src/util-request-options/request-options.ts +0 -17
- package/tsconfig.lib.json +0 -13
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
- /package/{src/internal-types/index.ts → types/cccteam-ccc-lib-src-internal-types.d.ts} +0 -0
|
@@ -0,0 +1,934 @@
|
|
|
1
|
+
import { TooltipPosition } from '@angular/material/tooltip';
|
|
2
|
+
import { ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
3
|
+
import { InjectionToken } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
type Brand<K, T> = K & {
|
|
6
|
+
__brand: T;
|
|
7
|
+
};
|
|
8
|
+
type Permission = Brand<string, 'Permission'>;
|
|
9
|
+
type Resource = Brand<string, 'Resource'>;
|
|
10
|
+
type Domain = Brand<string, 'Domain'>;
|
|
11
|
+
type FieldName = Brand<string, 'FieldName'>;
|
|
12
|
+
type Method = Brand<string, 'Method'>;
|
|
13
|
+
type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;
|
|
14
|
+
interface PermissionScope {
|
|
15
|
+
resource: Resource;
|
|
16
|
+
permission: Permission;
|
|
17
|
+
domain: Domain;
|
|
18
|
+
}
|
|
19
|
+
declare const ReadPermission: Permission;
|
|
20
|
+
declare const UpdatePermission: Permission;
|
|
21
|
+
|
|
22
|
+
declare const defaultEmptyFieldValue = "-";
|
|
23
|
+
type NullBoolean = null | true | false;
|
|
24
|
+
type ConcatFn = 'space-concat' | 'hyphen-concat' | 'space-hyphen-concat' | 'hyphen-space-concat';
|
|
25
|
+
|
|
26
|
+
declare const validatorsPresent: (control: AbstractControl<unknown, unknown>, validators: ValidatorFn[], previousValidatorCount: number) => boolean;
|
|
27
|
+
declare const requiredIf: (predicate: () => boolean, validator: ValidatorFn) => (formControl: AbstractControl) => ValidationErrors | null;
|
|
28
|
+
declare const __singletonValidatorBrand: unique symbol;
|
|
29
|
+
type ResourceValidatorFn = ValidatorFn & {
|
|
30
|
+
readonly [__singletonValidatorBrand]: true;
|
|
31
|
+
};
|
|
32
|
+
declare function createResourceValidator(validator: ValidatorFn): ResourceValidatorFn;
|
|
33
|
+
|
|
34
|
+
interface FieldPointer {
|
|
35
|
+
field: FieldName;
|
|
36
|
+
}
|
|
37
|
+
interface MenuItem {
|
|
38
|
+
label: string;
|
|
39
|
+
route?: string[];
|
|
40
|
+
children?: MenuItem[];
|
|
41
|
+
}
|
|
42
|
+
interface RouteResourceData {
|
|
43
|
+
config: RootConfig;
|
|
44
|
+
}
|
|
45
|
+
type DataType = string | number | number[] | string[] | boolean | undefined | Date;
|
|
46
|
+
type RecordData = Record<string, DataType | null>;
|
|
47
|
+
type RPCDataType = string | number | string[] | number[] | boolean | Date;
|
|
48
|
+
type RPCRecordData = Record<string, RPCDataType>;
|
|
49
|
+
type RpcMethod = Record<string, DataType>;
|
|
50
|
+
type ParentResourceConfig = ListViewConfig | ViewConfig | ArrayConfig;
|
|
51
|
+
type ChildResourceConfig = ListViewConfig | ViewConfig | ComponentConfig | ArrayConfig;
|
|
52
|
+
type ActionType = 'function' | 'link';
|
|
53
|
+
type ListConcatFn = 'space-concat' | 'hyphen-concat' | 'space-hyphen-concat' | 'hyphen-space-concat' | 'no-space-concat';
|
|
54
|
+
type ConfigType = ChildResourceConfig;
|
|
55
|
+
type FormatType = 'simpleSlashDateFormat';
|
|
56
|
+
type RPCPlacement = 'inline' | 'end';
|
|
57
|
+
type ColumnConfig = SingleColumnConfig | MultiColumnConfig;
|
|
58
|
+
interface ActionButtonConfig {
|
|
59
|
+
label: string;
|
|
60
|
+
icon: string;
|
|
61
|
+
action?: (resource: {
|
|
62
|
+
id: string;
|
|
63
|
+
}) => void;
|
|
64
|
+
viewRoute?: string;
|
|
65
|
+
actionType?: ActionType;
|
|
66
|
+
color?: string;
|
|
67
|
+
disabledLabel?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ActionButtonConfigOptions {
|
|
70
|
+
label: string;
|
|
71
|
+
icon: string;
|
|
72
|
+
action?: (resource: {
|
|
73
|
+
id: string;
|
|
74
|
+
}) => void;
|
|
75
|
+
viewRoute?: string;
|
|
76
|
+
actionType?: ActionType;
|
|
77
|
+
color?: string;
|
|
78
|
+
disabledLabel?: string;
|
|
79
|
+
}
|
|
80
|
+
declare function actionButtonConfig(config: ActionButtonConfigOptions): ActionButtonConfig;
|
|
81
|
+
declare const actionButtonConfigDefaults: {
|
|
82
|
+
label: string;
|
|
83
|
+
icon: string;
|
|
84
|
+
actionType: ActionType;
|
|
85
|
+
color: string;
|
|
86
|
+
disabledLabel: string;
|
|
87
|
+
};
|
|
88
|
+
interface SingleColumnConfig {
|
|
89
|
+
id: FieldName;
|
|
90
|
+
header?: string;
|
|
91
|
+
width?: number;
|
|
92
|
+
resizable?: boolean;
|
|
93
|
+
valueGetter?: (data: any) => string;
|
|
94
|
+
valueFormatter?: (data: any) => string;
|
|
95
|
+
tooltipPosition?: TooltipPosition;
|
|
96
|
+
viewRoute?: Resource;
|
|
97
|
+
buttonConfig?: ActionButtonConfig;
|
|
98
|
+
actionType?: ActionType;
|
|
99
|
+
formatType?: FormatType | string;
|
|
100
|
+
hidden?: boolean;
|
|
101
|
+
emptyDataValue?: DataType;
|
|
102
|
+
filterable?: boolean;
|
|
103
|
+
hideHeader?: boolean;
|
|
104
|
+
}
|
|
105
|
+
interface SingleColumnConfigOptions {
|
|
106
|
+
id: FieldName;
|
|
107
|
+
header?: string;
|
|
108
|
+
width?: number;
|
|
109
|
+
resizable?: boolean;
|
|
110
|
+
valueGetter?: (data: any) => string;
|
|
111
|
+
valueFormatter?: (data: any) => string;
|
|
112
|
+
tooltipPosition?: TooltipPosition;
|
|
113
|
+
viewRoute?: Resource;
|
|
114
|
+
buttonConfig?: ActionButtonConfig;
|
|
115
|
+
actionType?: ActionType;
|
|
116
|
+
formatType?: FormatType | string;
|
|
117
|
+
hidden?: boolean;
|
|
118
|
+
emptyDataValue?: DataType;
|
|
119
|
+
filterable?: boolean;
|
|
120
|
+
hideHeader?: boolean;
|
|
121
|
+
}
|
|
122
|
+
declare function singleColumnConfig(config: SingleColumnConfigOptions): SingleColumnConfig;
|
|
123
|
+
declare const singleColumnConfigDefaults: {
|
|
124
|
+
id: FieldName;
|
|
125
|
+
header: string;
|
|
126
|
+
resizable: true;
|
|
127
|
+
actionType: ActionType;
|
|
128
|
+
hidden: false;
|
|
129
|
+
filterable: true;
|
|
130
|
+
hideHeader: false;
|
|
131
|
+
};
|
|
132
|
+
interface MultiColumnConfig extends SingleColumnConfig {
|
|
133
|
+
additionalIds: AdditionalResourceConfig[];
|
|
134
|
+
concatFn: ListConcatFn;
|
|
135
|
+
}
|
|
136
|
+
interface MultiColumnConfigOptions extends SingleColumnConfigOptions {
|
|
137
|
+
additionalIds: AdditionalResourceConfig[];
|
|
138
|
+
concatFn: ListConcatFn;
|
|
139
|
+
}
|
|
140
|
+
declare function multiColumnConfig(config: MultiColumnConfigOptions): MultiColumnConfig;
|
|
141
|
+
declare const multiColumnConfigDefaults: {
|
|
142
|
+
additionalIds: AdditionalResourceConfig[];
|
|
143
|
+
concatFn: ListConcatFn;
|
|
144
|
+
id: FieldName;
|
|
145
|
+
header: string;
|
|
146
|
+
resizable: true;
|
|
147
|
+
actionType: ActionType;
|
|
148
|
+
hidden: false;
|
|
149
|
+
filterable: true;
|
|
150
|
+
hideHeader: false;
|
|
151
|
+
};
|
|
152
|
+
interface AdditionalResourceConfig {
|
|
153
|
+
resource?: Resource;
|
|
154
|
+
id: FieldName;
|
|
155
|
+
field?: FieldName;
|
|
156
|
+
hidden?: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface AdditionalResourceConfigOptions {
|
|
159
|
+
id: FieldName;
|
|
160
|
+
resource?: Resource;
|
|
161
|
+
field?: FieldName;
|
|
162
|
+
hidden?: boolean;
|
|
163
|
+
}
|
|
164
|
+
declare function additionalResourceConfig(config: AdditionalResourceConfigOptions): AdditionalResourceConfig;
|
|
165
|
+
declare const additionalResourceConfigDefaults: {
|
|
166
|
+
id: FieldName;
|
|
167
|
+
resource: Resource;
|
|
168
|
+
field: FieldName;
|
|
169
|
+
hidden: false;
|
|
170
|
+
};
|
|
171
|
+
interface FieldSort {
|
|
172
|
+
field: FieldName;
|
|
173
|
+
direction: 'asc' | 'desc';
|
|
174
|
+
}
|
|
175
|
+
interface FieldSortOptions {
|
|
176
|
+
field: FieldName;
|
|
177
|
+
direction?: 'asc' | 'desc';
|
|
178
|
+
}
|
|
179
|
+
declare function fieldSort(config: FieldSortOptions): FieldSort;
|
|
180
|
+
declare const fieldSortDefaults: {
|
|
181
|
+
field: FieldName;
|
|
182
|
+
direction: "asc" | "desc";
|
|
183
|
+
};
|
|
184
|
+
interface EnumeratedConfigOptions {
|
|
185
|
+
overrideResource?: Resource;
|
|
186
|
+
filter?: (resource: any) => string;
|
|
187
|
+
/**
|
|
188
|
+
* Set disableCacheForFilterPii to `true` to promote the GET to a POST when PII is used in the filter
|
|
189
|
+
* POST requests cannot be cached
|
|
190
|
+
*/
|
|
191
|
+
disableCacheForFilterPii?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Specifies which resource data to pass to the filter function:
|
|
194
|
+
* - 'rootResource': Pass in the root resource data
|
|
195
|
+
* - 'parentResource': Pass in the parent resource data
|
|
196
|
+
* @default 'parentResource'
|
|
197
|
+
*/
|
|
198
|
+
filterType?: FilterType;
|
|
199
|
+
sorts?: FieldSort[];
|
|
200
|
+
listDisplay?: FieldName[];
|
|
201
|
+
viewDisplay: FieldName[];
|
|
202
|
+
viewConcatFn?: ConcatFn;
|
|
203
|
+
listConcatFn?: ConcatFn;
|
|
204
|
+
viewDetails?: boolean;
|
|
205
|
+
searchable?: boolean;
|
|
206
|
+
}
|
|
207
|
+
type FilterType = 'parentResource' | 'rootResource';
|
|
208
|
+
interface EnumeratedConfig {
|
|
209
|
+
overrideResource: Resource;
|
|
210
|
+
filter: (resource: any) => string;
|
|
211
|
+
disableCacheForFilterPii: boolean;
|
|
212
|
+
filterType: FilterType;
|
|
213
|
+
sorts: FieldSort[];
|
|
214
|
+
listDisplay: FieldName[];
|
|
215
|
+
viewDisplay: FieldName[];
|
|
216
|
+
viewConcatFn: ConcatFn;
|
|
217
|
+
listConcatFn: ConcatFn;
|
|
218
|
+
viewDetails: boolean;
|
|
219
|
+
searchable: boolean;
|
|
220
|
+
}
|
|
221
|
+
declare function enumeratedConfig(config: EnumeratedConfigOptions): EnumeratedConfig;
|
|
222
|
+
declare const enumeratedConfigDefaults: {
|
|
223
|
+
overrideResource: Resource;
|
|
224
|
+
filter: () => string;
|
|
225
|
+
disableCacheForFilterPii: boolean;
|
|
226
|
+
filterType: FilterType;
|
|
227
|
+
sorts: FieldSort[];
|
|
228
|
+
listDisplay: FieldName[];
|
|
229
|
+
viewDisplay: FieldName[];
|
|
230
|
+
viewConcatFn: ConcatFn;
|
|
231
|
+
listConcatFn: ConcatFn;
|
|
232
|
+
viewDetails: boolean;
|
|
233
|
+
searchable: boolean;
|
|
234
|
+
};
|
|
235
|
+
type FieldDefault = ForeignKeyDefault | StaticDefault | null;
|
|
236
|
+
interface NullBooleanConfigOptions {
|
|
237
|
+
displayValues?: Record<'null' | 'true' | 'false', {
|
|
238
|
+
label: string;
|
|
239
|
+
value: NullBoolean;
|
|
240
|
+
}>;
|
|
241
|
+
}
|
|
242
|
+
interface NullBooleanConfig {
|
|
243
|
+
/** This property maps the three possible values for this
|
|
244
|
+
* nullboolean field with the display values users will see
|
|
245
|
+
* on the screen for each
|
|
246
|
+
*/
|
|
247
|
+
displayValues: Record<'null' | 'true' | 'false', {
|
|
248
|
+
label: string;
|
|
249
|
+
value: NullBoolean;
|
|
250
|
+
}>;
|
|
251
|
+
}
|
|
252
|
+
declare function nullBooleanConfig(config: NullBooleanConfigOptions): NullBooleanConfig;
|
|
253
|
+
declare const nullBooleanConfigDefaults: {
|
|
254
|
+
displayValues: Readonly<{
|
|
255
|
+
null: {
|
|
256
|
+
label: string;
|
|
257
|
+
value: null;
|
|
258
|
+
};
|
|
259
|
+
true: {
|
|
260
|
+
label: string;
|
|
261
|
+
value: boolean;
|
|
262
|
+
};
|
|
263
|
+
false: {
|
|
264
|
+
label: string;
|
|
265
|
+
value: boolean;
|
|
266
|
+
};
|
|
267
|
+
}>;
|
|
268
|
+
};
|
|
269
|
+
interface ForeignKeyDefaultOptions {
|
|
270
|
+
parentId: FieldName;
|
|
271
|
+
}
|
|
272
|
+
interface ForeignKeyDefault {
|
|
273
|
+
type: 'foreignKey';
|
|
274
|
+
parentId: FieldName;
|
|
275
|
+
}
|
|
276
|
+
declare function foreignKeyDefault(config: ForeignKeyDefaultOptions): ForeignKeyDefault;
|
|
277
|
+
declare const foreignKeyDefaultDefaults: {
|
|
278
|
+
type: "foreignKey";
|
|
279
|
+
parentId: FieldName;
|
|
280
|
+
};
|
|
281
|
+
interface StaticDefault {
|
|
282
|
+
type: 'static';
|
|
283
|
+
value: string | boolean;
|
|
284
|
+
}
|
|
285
|
+
interface staticDefaultOptions {
|
|
286
|
+
value: string | boolean;
|
|
287
|
+
}
|
|
288
|
+
declare function staticDefault(config: staticDefaultOptions): StaticDefault;
|
|
289
|
+
declare const staticDefaultDefaults: {
|
|
290
|
+
type: "static";
|
|
291
|
+
value: string;
|
|
292
|
+
};
|
|
293
|
+
type Affix = string | remoteData | parentData;
|
|
294
|
+
interface remoteData {
|
|
295
|
+
resource: Resource;
|
|
296
|
+
id: FieldName;
|
|
297
|
+
field: FieldName;
|
|
298
|
+
}
|
|
299
|
+
interface parentData {
|
|
300
|
+
field: FieldName;
|
|
301
|
+
}
|
|
302
|
+
type ConfigElement = FieldElement | SectionElement | ComputedDisplayFieldElement | PaddingElement;
|
|
303
|
+
type ColSize = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
304
|
+
interface ComputedDisplayFieldElementOptions {
|
|
305
|
+
label?: string;
|
|
306
|
+
class?: string;
|
|
307
|
+
cols?: ColSize;
|
|
308
|
+
calculatedValue?: (data: any) => string;
|
|
309
|
+
shouldRender?: ((data: any) => boolean) | boolean;
|
|
310
|
+
}
|
|
311
|
+
interface ComputedDisplayFieldElement {
|
|
312
|
+
type: 'computedDisplayField';
|
|
313
|
+
label: string;
|
|
314
|
+
class: string;
|
|
315
|
+
cols: ColSize;
|
|
316
|
+
calculatedValue: (data: any) => string;
|
|
317
|
+
shouldRender: ((data: any) => boolean) | boolean;
|
|
318
|
+
}
|
|
319
|
+
declare function computedDisplayField(config: ComputedDisplayFieldElementOptions): ComputedDisplayFieldElement;
|
|
320
|
+
declare const computedDisplayFieldElementDefaults: {
|
|
321
|
+
type: "computedDisplayField";
|
|
322
|
+
label: string;
|
|
323
|
+
class: string;
|
|
324
|
+
cols: 6;
|
|
325
|
+
calculatedValue: () => string;
|
|
326
|
+
shouldRender: true;
|
|
327
|
+
};
|
|
328
|
+
interface PaddingElementOptions {
|
|
329
|
+
cols?: ColSize;
|
|
330
|
+
shouldRender?: ((data: any) => boolean) | boolean;
|
|
331
|
+
}
|
|
332
|
+
interface PaddingElement {
|
|
333
|
+
type: 'padding';
|
|
334
|
+
cols: ColSize;
|
|
335
|
+
/** Determines whether the padding is shown
|
|
336
|
+
*/
|
|
337
|
+
shouldRender: ((data: any) => boolean) | boolean;
|
|
338
|
+
}
|
|
339
|
+
declare function padding(config?: PaddingElementOptions): PaddingElement;
|
|
340
|
+
declare const paddingElementDefaults: {
|
|
341
|
+
type: "padding";
|
|
342
|
+
cols: 12;
|
|
343
|
+
shouldRender: true;
|
|
344
|
+
};
|
|
345
|
+
interface SectionElementOptions {
|
|
346
|
+
label?: string;
|
|
347
|
+
class?: string;
|
|
348
|
+
cols?: ColSize;
|
|
349
|
+
shouldRender?: ((data: any) => boolean) | boolean;
|
|
350
|
+
nullAllChildrenIfConditionallyHidden?: boolean;
|
|
351
|
+
children?: ConfigElement[];
|
|
352
|
+
}
|
|
353
|
+
interface SectionElement {
|
|
354
|
+
type: 'section';
|
|
355
|
+
label: string;
|
|
356
|
+
class: string;
|
|
357
|
+
cols: ColSize;
|
|
358
|
+
/**
|
|
359
|
+
* shouldRender is used to determine if the section should be
|
|
360
|
+
* displayed to users.
|
|
361
|
+
* When assigning shouldRender a function, the first argument
|
|
362
|
+
* is the current state of the resource being displayed
|
|
363
|
+
* Hides the layout AND all of its children
|
|
364
|
+
*/
|
|
365
|
+
shouldRender: ((data: any) => boolean) | boolean;
|
|
366
|
+
/** If shouldRender is NOT a function, this property does nothing
|
|
367
|
+
* If shouldRender is a function, this property
|
|
368
|
+
* sets children's values to null if shouldRender hides it (returns false)
|
|
369
|
+
* within the resource-layout.component
|
|
370
|
+
*/
|
|
371
|
+
nullAllChildrenIfConditionallyHidden: boolean;
|
|
372
|
+
children: ConfigElement[];
|
|
373
|
+
}
|
|
374
|
+
declare function section(config: SectionElementOptions): SectionElement;
|
|
375
|
+
declare const sectionElementDefaults: {
|
|
376
|
+
type: "section";
|
|
377
|
+
label: string;
|
|
378
|
+
class: string;
|
|
379
|
+
cols: 12;
|
|
380
|
+
shouldRender: true;
|
|
381
|
+
nullAllChildrenIfConditionallyHidden: false;
|
|
382
|
+
children: never[];
|
|
383
|
+
};
|
|
384
|
+
interface FieldElementOptions {
|
|
385
|
+
name: FieldName;
|
|
386
|
+
label?: string;
|
|
387
|
+
cols?: ColSize;
|
|
388
|
+
class?: string;
|
|
389
|
+
enumeratedConfig?: EnumeratedConfig;
|
|
390
|
+
default?: FieldDefault;
|
|
391
|
+
nullBooleanConfig?: NullBooleanConfig;
|
|
392
|
+
validators?: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];
|
|
393
|
+
readOnly?: boolean;
|
|
394
|
+
prefixes?: Affix[];
|
|
395
|
+
suffixes?: Affix[];
|
|
396
|
+
shouldRender?: ((data: any) => boolean) | boolean;
|
|
397
|
+
nullIfConditionallyHidden?: boolean;
|
|
398
|
+
}
|
|
399
|
+
interface FieldElement {
|
|
400
|
+
type: 'field';
|
|
401
|
+
name: string;
|
|
402
|
+
label: string;
|
|
403
|
+
cols: ColSize;
|
|
404
|
+
class: string;
|
|
405
|
+
enumeratedConfig: EnumeratedConfig;
|
|
406
|
+
default: FieldDefault;
|
|
407
|
+
nullBooleanConfig: NullBooleanConfig;
|
|
408
|
+
/**
|
|
409
|
+
* A list of validators that must pass to allow a field to be submitted.
|
|
410
|
+
* Utilize existing validators in the resourceValidators object, and
|
|
411
|
+
* add any new or custom validators to it
|
|
412
|
+
*/
|
|
413
|
+
validators: ((data: any) => ResourceValidatorFn[]) | ResourceValidatorFn[];
|
|
414
|
+
readOnly: boolean;
|
|
415
|
+
prefixes: Affix[];
|
|
416
|
+
suffixes: Affix[];
|
|
417
|
+
/**
|
|
418
|
+
* shouldRender is used to determine if the element should be
|
|
419
|
+
* displayed to users.
|
|
420
|
+
* When assigning shouldRender a function, the first argument
|
|
421
|
+
* is the current state of the resource being displayed
|
|
422
|
+
*/
|
|
423
|
+
shouldRender: ((data: any) => boolean) | boolean;
|
|
424
|
+
/** If shouldRender is NOT a function, this property does nothing
|
|
425
|
+
* If shouldRender is a function, this property
|
|
426
|
+
* determines whether the form control associated
|
|
427
|
+
* with this config element should have its value
|
|
428
|
+
* set to null if shouldRender hides it (returns false)
|
|
429
|
+
*/
|
|
430
|
+
nullIfConditionallyHidden: boolean;
|
|
431
|
+
}
|
|
432
|
+
declare function field(config: FieldElementOptions): FieldElement;
|
|
433
|
+
declare const fieldElementDefaults: {
|
|
434
|
+
type: "field";
|
|
435
|
+
name: string;
|
|
436
|
+
label: string;
|
|
437
|
+
cols: 6;
|
|
438
|
+
class: string;
|
|
439
|
+
enumeratedConfig: {
|
|
440
|
+
overrideResource: Resource;
|
|
441
|
+
filter: () => string;
|
|
442
|
+
disableCacheForFilterPii: boolean;
|
|
443
|
+
filterType: FilterType;
|
|
444
|
+
sorts: FieldSort[];
|
|
445
|
+
listDisplay: FieldName[];
|
|
446
|
+
viewDisplay: FieldName[];
|
|
447
|
+
viewConcatFn: ConcatFn;
|
|
448
|
+
listConcatFn: ConcatFn;
|
|
449
|
+
viewDetails: boolean;
|
|
450
|
+
searchable: boolean;
|
|
451
|
+
};
|
|
452
|
+
default: null;
|
|
453
|
+
validators: never[];
|
|
454
|
+
nullBooleanConfig: {
|
|
455
|
+
displayValues: Readonly<{
|
|
456
|
+
null: {
|
|
457
|
+
label: string;
|
|
458
|
+
value: null;
|
|
459
|
+
};
|
|
460
|
+
true: {
|
|
461
|
+
label: string;
|
|
462
|
+
value: boolean;
|
|
463
|
+
};
|
|
464
|
+
false: {
|
|
465
|
+
label: string;
|
|
466
|
+
value: boolean;
|
|
467
|
+
};
|
|
468
|
+
}>;
|
|
469
|
+
};
|
|
470
|
+
readOnly: false;
|
|
471
|
+
prefixes: never[];
|
|
472
|
+
suffixes: never[];
|
|
473
|
+
shouldRender: true;
|
|
474
|
+
nullIfConditionallyHidden: false;
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* RouteData is used to define the route for a config
|
|
478
|
+
* route: the route for the config
|
|
479
|
+
* hasViewRoute: when true, a route will be created for route/:uuid
|
|
480
|
+
*/
|
|
481
|
+
interface RootRouteData {
|
|
482
|
+
route?: string;
|
|
483
|
+
hasViewRoute?: boolean;
|
|
484
|
+
}
|
|
485
|
+
interface RPCConfigOptions {
|
|
486
|
+
label: string;
|
|
487
|
+
afterMethodRedirect?: string;
|
|
488
|
+
conditions: {
|
|
489
|
+
field: FieldName;
|
|
490
|
+
matchValues: string[];
|
|
491
|
+
}[];
|
|
492
|
+
methodBodyTemplate?: any;
|
|
493
|
+
successMessage?: string;
|
|
494
|
+
elements?: ConfigElement[];
|
|
495
|
+
placement?: RPCPlacement;
|
|
496
|
+
method: Method;
|
|
497
|
+
customComponent?: ComponentConfig;
|
|
498
|
+
refreshResources?: Resource[];
|
|
499
|
+
defaultModalWidth?: string;
|
|
500
|
+
shouldRender?: () => boolean;
|
|
501
|
+
}
|
|
502
|
+
interface RPCConfig {
|
|
503
|
+
label: string;
|
|
504
|
+
afterMethodRedirect: string | string[];
|
|
505
|
+
conditions: {
|
|
506
|
+
field: FieldName;
|
|
507
|
+
matchValues: string[];
|
|
508
|
+
}[];
|
|
509
|
+
methodBodyTemplate: any;
|
|
510
|
+
method: Method;
|
|
511
|
+
successMessage: string;
|
|
512
|
+
elements: ConfigElement[];
|
|
513
|
+
placement: RPCPlacement;
|
|
514
|
+
customComponent: ComponentConfig;
|
|
515
|
+
refreshResources: Resource[];
|
|
516
|
+
defaultModalWidth: string;
|
|
517
|
+
shouldRender: () => boolean;
|
|
518
|
+
}
|
|
519
|
+
declare function rpcConfig(config: RPCConfigOptions): RPCConfig;
|
|
520
|
+
declare const rpcConfigDefaults: {
|
|
521
|
+
label: string;
|
|
522
|
+
afterMethodRedirect: string;
|
|
523
|
+
conditions: {
|
|
524
|
+
field: FieldName;
|
|
525
|
+
matchValues: string[];
|
|
526
|
+
}[];
|
|
527
|
+
methodBodyTemplate: any;
|
|
528
|
+
successMessage: string;
|
|
529
|
+
elements: ConfigElement[];
|
|
530
|
+
placement: RPCPlacement;
|
|
531
|
+
method: Method;
|
|
532
|
+
customComponent: ComponentConfig;
|
|
533
|
+
refreshResources: Resource[];
|
|
534
|
+
defaultModalWidth: string;
|
|
535
|
+
shouldRender: () => boolean;
|
|
536
|
+
};
|
|
537
|
+
interface RPCBaseFormData {
|
|
538
|
+
elements: FieldElement[];
|
|
539
|
+
label: string;
|
|
540
|
+
method: Method;
|
|
541
|
+
}
|
|
542
|
+
interface RootConfigOptions {
|
|
543
|
+
routeData?: RootRouteData;
|
|
544
|
+
nav?: {
|
|
545
|
+
navItem: MenuItem;
|
|
546
|
+
group?: string;
|
|
547
|
+
};
|
|
548
|
+
parentConfig: ParentResourceConfig;
|
|
549
|
+
relatedConfigs?: ChildResourceConfig[];
|
|
550
|
+
rpcConfigs?: RPCConfig[];
|
|
551
|
+
}
|
|
552
|
+
interface RootConfig {
|
|
553
|
+
routeData: RootRouteData;
|
|
554
|
+
nav: {
|
|
555
|
+
navItem: MenuItem;
|
|
556
|
+
group?: string;
|
|
557
|
+
};
|
|
558
|
+
parentConfig: ParentResourceConfig;
|
|
559
|
+
relatedConfigs: ChildResourceConfig[];
|
|
560
|
+
rpcConfigs?: RPCConfig[];
|
|
561
|
+
}
|
|
562
|
+
declare const rootConfigDefaults: {
|
|
563
|
+
routeData: RootRouteData;
|
|
564
|
+
nav: {
|
|
565
|
+
navItem: MenuItem;
|
|
566
|
+
};
|
|
567
|
+
parentConfig: ParentResourceConfig;
|
|
568
|
+
relatedConfigs: ChildResourceConfig[];
|
|
569
|
+
rpcConfigs: RPCConfig[];
|
|
570
|
+
};
|
|
571
|
+
declare function rootConfig(config: RootConfigOptions): RootConfig;
|
|
572
|
+
interface BaseConfigOptions {
|
|
573
|
+
title?: string;
|
|
574
|
+
createTitle?: string;
|
|
575
|
+
createButtonLabel?: string;
|
|
576
|
+
primaryResource: Resource;
|
|
577
|
+
parentClass?: string;
|
|
578
|
+
fieldClass?: string;
|
|
579
|
+
elements: ConfigElement[];
|
|
580
|
+
createConfig?: ConfigType;
|
|
581
|
+
parentRelation?: {
|
|
582
|
+
parentKey: FieldName;
|
|
583
|
+
childKey: FieldName;
|
|
584
|
+
};
|
|
585
|
+
showBackButton?: boolean;
|
|
586
|
+
createNavigation?: string[];
|
|
587
|
+
}
|
|
588
|
+
interface BaseConfig {
|
|
589
|
+
title: string;
|
|
590
|
+
createTitle: string;
|
|
591
|
+
createButtonLabel: string;
|
|
592
|
+
primaryResource: Resource;
|
|
593
|
+
parentClass: string;
|
|
594
|
+
fieldClass: string;
|
|
595
|
+
elements: ConfigElement[];
|
|
596
|
+
createConfig: ConfigType;
|
|
597
|
+
parentRelation: {
|
|
598
|
+
parentKey: FieldName;
|
|
599
|
+
childKey: FieldName;
|
|
600
|
+
};
|
|
601
|
+
showBackButton: boolean;
|
|
602
|
+
createNavigation: string[];
|
|
603
|
+
}
|
|
604
|
+
type AvailableComponents = 'SwitchResolver';
|
|
605
|
+
type ConfigParam = SwitchConfigParam;
|
|
606
|
+
interface ComponentConfigOptions {
|
|
607
|
+
primaryResource: Resource;
|
|
608
|
+
component: AvailableComponents;
|
|
609
|
+
params?: ConfigParam;
|
|
610
|
+
relatedConfig?: ParentResourceConfig[];
|
|
611
|
+
shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
612
|
+
}
|
|
613
|
+
interface ComponentConfig {
|
|
614
|
+
type: 'Component';
|
|
615
|
+
primaryResource: Resource;
|
|
616
|
+
component: AvailableComponents;
|
|
617
|
+
params: ConfigParam;
|
|
618
|
+
relatedConfig: ParentResourceConfig[];
|
|
619
|
+
shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
620
|
+
}
|
|
621
|
+
declare function componentConfig(config: ComponentConfigOptions): ComponentConfig;
|
|
622
|
+
declare const componentConfigDefaults: {
|
|
623
|
+
type: "Component";
|
|
624
|
+
primaryResource: Resource;
|
|
625
|
+
component: AvailableComponents;
|
|
626
|
+
params: {
|
|
627
|
+
cases: never[];
|
|
628
|
+
};
|
|
629
|
+
relatedConfig: ParentResourceConfig[];
|
|
630
|
+
shouldRenderActions: {
|
|
631
|
+
create: () => boolean;
|
|
632
|
+
edit: () => boolean;
|
|
633
|
+
delete: () => boolean;
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
interface switchCase {
|
|
637
|
+
caseId: string;
|
|
638
|
+
parentField: string;
|
|
639
|
+
childId: string;
|
|
640
|
+
config: ChildResourceConfig;
|
|
641
|
+
}
|
|
642
|
+
interface SwitchConfigParamOptions {
|
|
643
|
+
cases: switchCase[];
|
|
644
|
+
}
|
|
645
|
+
interface SwitchConfigParam {
|
|
646
|
+
cases: switchCase[];
|
|
647
|
+
}
|
|
648
|
+
declare function switchParams(config: SwitchConfigParamOptions): SwitchConfigParam;
|
|
649
|
+
declare const switchParamsDefaults: {
|
|
650
|
+
cases: switchCase[];
|
|
651
|
+
};
|
|
652
|
+
interface ListViewConfigOptions extends BaseConfigOptions {
|
|
653
|
+
showViewButton?: boolean;
|
|
654
|
+
loadCreatedResource?: boolean;
|
|
655
|
+
collapsible?: boolean;
|
|
656
|
+
overrideResource?: Resource;
|
|
657
|
+
searchable?: boolean;
|
|
658
|
+
enableRowExpansion?: boolean;
|
|
659
|
+
rowExpansionConfig?: ChildResourceConfig;
|
|
660
|
+
requireSearchToDisplayResults?: boolean;
|
|
661
|
+
listColumns: ColumnConfig[];
|
|
662
|
+
relatedConfigs?: ChildResourceConfig[];
|
|
663
|
+
viewResource?: Resource | string;
|
|
664
|
+
actionType?: ActionType;
|
|
665
|
+
filter?: (parentResource: any) => string;
|
|
666
|
+
disableCacheForFilterPii?: boolean;
|
|
667
|
+
rpcConfigs?: RPCConfig[];
|
|
668
|
+
sorts?: FieldSort[];
|
|
669
|
+
shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
670
|
+
}
|
|
671
|
+
interface ListViewConfig extends BaseConfig {
|
|
672
|
+
type: 'ListView';
|
|
673
|
+
showViewButton: boolean;
|
|
674
|
+
loadCreatedResource: boolean;
|
|
675
|
+
collapsible: boolean;
|
|
676
|
+
overrideResource: Resource;
|
|
677
|
+
searchable: boolean;
|
|
678
|
+
enableRowExpansion: boolean;
|
|
679
|
+
rowExpansionConfig: ChildResourceConfig;
|
|
680
|
+
requireSearchToDisplayResults: boolean;
|
|
681
|
+
listColumns: ColumnConfig[];
|
|
682
|
+
relatedConfigs: ChildResourceConfig[];
|
|
683
|
+
viewResource: Resource | string;
|
|
684
|
+
actionType: ActionType;
|
|
685
|
+
filter: (parentResource: any) => string;
|
|
686
|
+
disableCacheForFilterPii: boolean;
|
|
687
|
+
rpcConfigs?: RPCConfig[];
|
|
688
|
+
sorts: FieldSort[];
|
|
689
|
+
shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
690
|
+
}
|
|
691
|
+
declare function listViewConfig(config: ListViewConfigOptions): ListViewConfig;
|
|
692
|
+
declare const listViewConfigDefaults: {
|
|
693
|
+
title: string;
|
|
694
|
+
primaryResource: Resource;
|
|
695
|
+
type: "ListView";
|
|
696
|
+
createTitle: string;
|
|
697
|
+
createButtonLabel: string;
|
|
698
|
+
loadCreatedResource: false;
|
|
699
|
+
showViewButton: true;
|
|
700
|
+
collapsible: false;
|
|
701
|
+
listColumns: never[];
|
|
702
|
+
elements: never[];
|
|
703
|
+
parentClass: string;
|
|
704
|
+
fieldClass: string;
|
|
705
|
+
createConfig: ListViewConfig;
|
|
706
|
+
createNavigation: never[];
|
|
707
|
+
relatedConfigs: never[];
|
|
708
|
+
parentRelation: {
|
|
709
|
+
parentKey: FieldName;
|
|
710
|
+
childKey: FieldName;
|
|
711
|
+
};
|
|
712
|
+
overrideResource: Resource;
|
|
713
|
+
searchable: false;
|
|
714
|
+
enableRowExpansion: false;
|
|
715
|
+
rowExpansionConfig: ChildResourceConfig;
|
|
716
|
+
requireSearchToDisplayResults: false;
|
|
717
|
+
showBackButton: true;
|
|
718
|
+
filter: () => string;
|
|
719
|
+
disableCacheForFilterPii: false;
|
|
720
|
+
sorts: FieldSort[];
|
|
721
|
+
viewResource: Resource;
|
|
722
|
+
actionType: ActionType;
|
|
723
|
+
rpcConfigs: never[];
|
|
724
|
+
shouldRenderActions: {
|
|
725
|
+
create: () => boolean;
|
|
726
|
+
edit: () => boolean;
|
|
727
|
+
delete: () => boolean;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
type ViewType = 'OneToOne' | 'OneToMany';
|
|
731
|
+
interface ViewConfigOptions extends BaseConfigOptions {
|
|
732
|
+
collapsible?: boolean;
|
|
733
|
+
connectorResource?: Resource;
|
|
734
|
+
relatedConfigs?: ChildResourceConfig[];
|
|
735
|
+
rpcConfigs?: RPCConfig[];
|
|
736
|
+
shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
737
|
+
}
|
|
738
|
+
interface ViewConfig extends BaseConfig {
|
|
739
|
+
type: 'View';
|
|
740
|
+
collapsible: boolean;
|
|
741
|
+
connectorResource: Resource;
|
|
742
|
+
rpcConfigs?: RPCConfig[];
|
|
743
|
+
relatedConfigs: ChildResourceConfig[];
|
|
744
|
+
/** A set of functions that allows for
|
|
745
|
+
* conditional display of non-RPC
|
|
746
|
+
* actions based on the pristine state of the resource
|
|
747
|
+
* (if such a state is applicable. Creation for example won't
|
|
748
|
+
* have such data)
|
|
749
|
+
* This is separate from ABAC control which takes
|
|
750
|
+
* precedence and is based on a user's attributes
|
|
751
|
+
*/
|
|
752
|
+
shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
753
|
+
}
|
|
754
|
+
declare function viewConfig(config: ViewConfigOptions): ViewConfig;
|
|
755
|
+
declare const viewConfigDefaults: {
|
|
756
|
+
title: string;
|
|
757
|
+
primaryResource: Resource;
|
|
758
|
+
type: "View";
|
|
759
|
+
createTitle: string;
|
|
760
|
+
createButtonLabel: string;
|
|
761
|
+
parentClass: string;
|
|
762
|
+
fieldClass: string;
|
|
763
|
+
elements: never[];
|
|
764
|
+
collapsible: true;
|
|
765
|
+
connectorResource: Resource;
|
|
766
|
+
relatedConfigs: never[];
|
|
767
|
+
createConfig: ViewConfig;
|
|
768
|
+
shouldRenderActions: {
|
|
769
|
+
create: () => boolean;
|
|
770
|
+
edit: () => boolean;
|
|
771
|
+
delete: () => boolean;
|
|
772
|
+
};
|
|
773
|
+
createNavigation: never[];
|
|
774
|
+
parentRelation: {
|
|
775
|
+
parentKey: FieldName;
|
|
776
|
+
childKey: FieldName;
|
|
777
|
+
};
|
|
778
|
+
showBackButton: true;
|
|
779
|
+
rpcConfigs: never[];
|
|
780
|
+
};
|
|
781
|
+
interface arrayConfigOptions {
|
|
782
|
+
iteratedConfig: ChildResourceConfig;
|
|
783
|
+
viewType?: ViewType;
|
|
784
|
+
collapsible?: boolean;
|
|
785
|
+
createConfig?: ConfigType;
|
|
786
|
+
connectorResource?: Resource;
|
|
787
|
+
connectorField?: FieldName;
|
|
788
|
+
primaryResource: Resource;
|
|
789
|
+
listFilter: (parentResource: any) => string;
|
|
790
|
+
disableCacheForFilterPii?: boolean;
|
|
791
|
+
sorts?: FieldSort[];
|
|
792
|
+
title?: string;
|
|
793
|
+
createButtonLabel?: string;
|
|
794
|
+
limit?: number;
|
|
795
|
+
shouldRenderActions?: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
796
|
+
}
|
|
797
|
+
interface ArrayConfig {
|
|
798
|
+
type: 'Array';
|
|
799
|
+
iteratedConfig: ChildResourceConfig;
|
|
800
|
+
viewType: ViewType;
|
|
801
|
+
collapsible: boolean;
|
|
802
|
+
createConfig: ConfigType;
|
|
803
|
+
connectorResource: Resource;
|
|
804
|
+
connectorField: FieldName;
|
|
805
|
+
primaryResource: Resource;
|
|
806
|
+
listFilter: (parentResource: any) => string;
|
|
807
|
+
disableCacheForFilterPii: boolean;
|
|
808
|
+
sorts: FieldSort[];
|
|
809
|
+
title: string;
|
|
810
|
+
createButtonLabel: string;
|
|
811
|
+
shouldRenderActions: Record<'edit' | 'delete' | 'create', (data: any) => boolean>;
|
|
812
|
+
limit: number;
|
|
813
|
+
}
|
|
814
|
+
declare function arrayConfig(config: arrayConfigOptions): ArrayConfig;
|
|
815
|
+
declare const arrayConfigDefaults: {
|
|
816
|
+
type: "Array";
|
|
817
|
+
iteratedConfig: ChildResourceConfig;
|
|
818
|
+
viewType: ViewType;
|
|
819
|
+
collapsible: true;
|
|
820
|
+
createConfig: ViewConfig;
|
|
821
|
+
connectorResource: Resource;
|
|
822
|
+
connectorField: FieldName;
|
|
823
|
+
primaryResource: Resource;
|
|
824
|
+
listFilter: () => string;
|
|
825
|
+
disableCacheForFilterPii: false;
|
|
826
|
+
sorts: FieldSort[];
|
|
827
|
+
title: string;
|
|
828
|
+
createButtonLabel: string;
|
|
829
|
+
limit: number;
|
|
830
|
+
shouldRenderActions: {
|
|
831
|
+
create: () => boolean;
|
|
832
|
+
edit: () => boolean;
|
|
833
|
+
delete: () => boolean;
|
|
834
|
+
};
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
declare enum AlertLevel {
|
|
838
|
+
ERROR = "warn",
|
|
839
|
+
INFO = "accent",
|
|
840
|
+
SUCCESS = "success"
|
|
841
|
+
}
|
|
842
|
+
interface CreateNotificationMessage {
|
|
843
|
+
duration?: number;
|
|
844
|
+
message: string;
|
|
845
|
+
link: string;
|
|
846
|
+
level: AlertLevel;
|
|
847
|
+
}
|
|
848
|
+
interface NotificationMessage {
|
|
849
|
+
id: number;
|
|
850
|
+
duration?: number;
|
|
851
|
+
message: string;
|
|
852
|
+
link: string;
|
|
853
|
+
level: AlertLevel;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
type ValidDisplayTypes = 'boolean' | 'nullboolean' | 'number' | 'string' | 'date' | 'enumerated' | 'link' | 'uuid' | 'civildate';
|
|
857
|
+
type ValidRPCTypes = ValidDisplayTypes | `${ValidDisplayTypes}[]`;
|
|
858
|
+
interface RPCFieldMeta {
|
|
859
|
+
fieldName: string;
|
|
860
|
+
displayType: ValidRPCTypes;
|
|
861
|
+
enumeratedResource?: Resource;
|
|
862
|
+
}
|
|
863
|
+
interface MethodMeta {
|
|
864
|
+
route: string;
|
|
865
|
+
fields: RPCFieldMeta[];
|
|
866
|
+
}
|
|
867
|
+
interface FieldMeta {
|
|
868
|
+
fieldName: string;
|
|
869
|
+
/** Indicates whether the field is required and only applies during resource creation.
|
|
870
|
+
* Use the validators config parameter in all other contexts
|
|
871
|
+
*/
|
|
872
|
+
required: boolean;
|
|
873
|
+
primaryKey?: {
|
|
874
|
+
ordinalPosition: number;
|
|
875
|
+
};
|
|
876
|
+
displayType: ValidDisplayTypes;
|
|
877
|
+
enumeratedResource?: Resource;
|
|
878
|
+
isIndex: boolean;
|
|
879
|
+
}
|
|
880
|
+
interface ResourceMeta {
|
|
881
|
+
route: string;
|
|
882
|
+
consolidatedRoute?: string;
|
|
883
|
+
listDisabled?: boolean;
|
|
884
|
+
readDisabled?: boolean;
|
|
885
|
+
createDisabled?: boolean;
|
|
886
|
+
updateDisabled?: boolean;
|
|
887
|
+
deleteDisabled?: boolean;
|
|
888
|
+
substringSearchParameter?: string;
|
|
889
|
+
fields: FieldMeta[];
|
|
890
|
+
}
|
|
891
|
+
type Meta = MethodMeta | ResourceMeta;
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Session Information for a logged in user
|
|
895
|
+
*/
|
|
896
|
+
interface SessionInfo {
|
|
897
|
+
authenticated: boolean;
|
|
898
|
+
username: string;
|
|
899
|
+
permissions: DomainPermissions;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* The base URL for API requests (e.g., 'https://api.example.com/').
|
|
904
|
+
*/
|
|
905
|
+
declare const BASE_URL: InjectionToken<string>;
|
|
906
|
+
/**
|
|
907
|
+
* The path to the frontend login page (e.g., '/login').
|
|
908
|
+
*/
|
|
909
|
+
declare const FRONTEND_LOGIN_PATH: InjectionToken<string>;
|
|
910
|
+
/**
|
|
911
|
+
* The path to the session endpoint (e.g., 'user/session').
|
|
912
|
+
*/
|
|
913
|
+
declare const SESSION_PATH: InjectionToken<string>;
|
|
914
|
+
/**
|
|
915
|
+
* The base URL for API requests (e.g., '/api').
|
|
916
|
+
*/
|
|
917
|
+
declare const API_URL: InjectionToken<string>;
|
|
918
|
+
declare const PERMISSION_REQUIRED: InjectionToken<(resource: Resource, permission: Permission) => boolean>;
|
|
919
|
+
declare const AVAILABLE_PERMISSIONS: InjectionToken<{
|
|
920
|
+
Create: Permission;
|
|
921
|
+
Delete: Permission;
|
|
922
|
+
List: Permission;
|
|
923
|
+
Read: Permission;
|
|
924
|
+
Update: Permission;
|
|
925
|
+
}>;
|
|
926
|
+
declare const AVAILABLE_DOMAINS: InjectionToken<Record<string, Domain>[]>;
|
|
927
|
+
declare const RESOURCE_META: InjectionToken<(resource: Resource) => ResourceMeta>;
|
|
928
|
+
declare const METHOD_META: InjectionToken<(method: string) => MethodMeta>;
|
|
929
|
+
declare const IDLE_SESSION_DURATION: InjectionToken<number>;
|
|
930
|
+
declare const IDLE_WARNING_DURATION: InjectionToken<number>;
|
|
931
|
+
declare const IDLE_KEEPALIVE_DURATION: InjectionToken<number>;
|
|
932
|
+
|
|
933
|
+
export { API_URL, AVAILABLE_DOMAINS, AVAILABLE_PERMISSIONS, AlertLevel, BASE_URL, FRONTEND_LOGIN_PATH, IDLE_KEEPALIVE_DURATION, IDLE_SESSION_DURATION, IDLE_WARNING_DURATION, METHOD_META, PERMISSION_REQUIRED, RESOURCE_META, ReadPermission, SESSION_PATH, UpdatePermission, actionButtonConfig, actionButtonConfigDefaults, additionalResourceConfig, additionalResourceConfigDefaults, arrayConfig, arrayConfigDefaults, componentConfig, componentConfigDefaults, computedDisplayField, computedDisplayFieldElementDefaults, createResourceValidator, defaultEmptyFieldValue, enumeratedConfig, enumeratedConfigDefaults, field, fieldElementDefaults, fieldSort, fieldSortDefaults, foreignKeyDefault, foreignKeyDefaultDefaults, listViewConfig, listViewConfigDefaults, multiColumnConfig, multiColumnConfigDefaults, nullBooleanConfig, nullBooleanConfigDefaults, padding, paddingElementDefaults, requiredIf, rootConfig, rootConfigDefaults, rpcConfig, rpcConfigDefaults, section, sectionElementDefaults, singleColumnConfig, singleColumnConfigDefaults, staticDefault, staticDefaultDefaults, switchParams, switchParamsDefaults, validatorsPresent, viewConfig, viewConfigDefaults };
|
|
934
|
+
export type { ActionButtonConfig, ActionButtonConfigOptions, ActionType, AdditionalResourceConfig, AdditionalResourceConfigOptions, Affix, ArrayConfig, AvailableComponents, BaseConfig, BaseConfigOptions, ChildResourceConfig, ColSize, ColumnConfig, ComponentConfig, ComponentConfigOptions, ComputedDisplayFieldElement, ComputedDisplayFieldElementOptions, ConcatFn, ConfigElement, ConfigParam, ConfigType, CreateNotificationMessage, DataType, Domain, DomainPermissions, EnumeratedConfig, EnumeratedConfigOptions, FieldDefault, FieldElement, FieldElementOptions, FieldMeta, FieldName, FieldPointer, FieldSort, FieldSortOptions, ForeignKeyDefault, ForeignKeyDefaultOptions, FormatType, ListConcatFn, ListViewConfig, ListViewConfigOptions, MenuItem, Meta, Method, MethodMeta, MultiColumnConfig, MultiColumnConfigOptions, NotificationMessage, NullBoolean, NullBooleanConfig, NullBooleanConfigOptions, PaddingElement, PaddingElementOptions, ParentResourceConfig, Permission, PermissionScope, RPCBaseFormData, RPCConfig, RPCConfigOptions, RPCDataType, RPCFieldMeta, RPCPlacement, RPCRecordData, RecordData, Resource, ResourceMeta, ResourceValidatorFn, RootConfig, RootConfigOptions, RootRouteData, RouteResourceData, RpcMethod, SectionElement, SectionElementOptions, SessionInfo, SingleColumnConfig, SingleColumnConfigOptions, StaticDefault, SwitchConfigParam, SwitchConfigParamOptions, ValidDisplayTypes, ValidRPCTypes, ViewConfig, ViewConfigOptions, ViewType, arrayConfigOptions, staticDefaultOptions, switchCase };
|