@cccteam/ccc-lib 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/fesm2022/cccteam-ccc-lib-auth-forms.mjs +13 -13
  2. package/fesm2022/cccteam-ccc-lib-auth-forms.mjs.map +1 -1
  3. package/fesm2022/cccteam-ccc-lib-auth-has-permission.mjs +4 -4
  4. package/fesm2022/cccteam-ccc-lib-auth-has-permission.mjs.map +1 -1
  5. package/fesm2022/cccteam-ccc-lib-auth-service.mjs +15 -8
  6. package/fesm2022/cccteam-ccc-lib-auth-service.mjs.map +1 -1
  7. package/fesm2022/cccteam-ccc-lib-ccc-camel-case-to-title.mjs +3 -3
  8. package/fesm2022/cccteam-ccc-lib-ccc-grid.mjs +20 -20
  9. package/fesm2022/cccteam-ccc-lib-ccc-grid.mjs.map +1 -1
  10. package/fesm2022/cccteam-ccc-lib-ccc-resource-modals.mjs +3 -3
  11. package/fesm2022/cccteam-ccc-lib-ccc-resource-services.mjs +5 -5
  12. package/fesm2022/cccteam-ccc-lib-ccc-resource-services.mjs.map +1 -1
  13. package/fesm2022/cccteam-ccc-lib-ccc-resource.mjs +296 -285
  14. package/fesm2022/cccteam-ccc-lib-ccc-resource.mjs.map +1 -1
  15. package/fesm2022/cccteam-ccc-lib-types.mjs +71 -18
  16. package/fesm2022/cccteam-ccc-lib-types.mjs.map +1 -1
  17. package/fesm2022/cccteam-ccc-lib-ui-alert.mjs +3 -3
  18. package/fesm2022/cccteam-ccc-lib-ui-core-service.mjs +7 -7
  19. package/fesm2022/cccteam-ccc-lib-ui-core-service.mjs.map +1 -1
  20. package/fesm2022/cccteam-ccc-lib-ui-idle-service.mjs +18 -11
  21. package/fesm2022/cccteam-ccc-lib-ui-idle-service.mjs.map +1 -1
  22. package/fesm2022/cccteam-ccc-lib-ui-interceptor.mjs +3 -3
  23. package/fesm2022/cccteam-ccc-lib-ui-notification-service.mjs +5 -5
  24. package/fesm2022/cccteam-ccc-lib-ui-notification-service.mjs.map +1 -1
  25. package/fesm2022/cccteam-ccc-lib-ui-sidenav.mjs +4 -4
  26. package/fesm2022/cccteam-ccc-lib-ui-sidenav.mjs.map +1 -1
  27. package/package.json +1 -1
  28. package/types/cccteam-ccc-lib-auth-service.d.ts +2 -1
  29. package/types/cccteam-ccc-lib-ccc-resource.d.ts +2 -1
  30. package/types/cccteam-ccc-lib-forms.d.ts +1 -1
  31. package/types/cccteam-ccc-lib-types.d.ts +48 -1
  32. package/types/cccteam-ccc-lib-ui-idle-service.d.ts +2 -1
@@ -14,16 +14,16 @@ var InputMode;
14
14
  })(InputMode || (InputMode = {}));
15
15
  class CccInputFieldComponent {
16
16
  auth = inject(AuthService);
17
- className = input(undefined, { ...(ngDevMode ? { debugName: "className" } : {}) });
18
- mode = input.required({ ...(ngDevMode ? { debugName: "mode" } : {}) });
19
- resource = input.required({ ...(ngDevMode ? { debugName: "resource" } : {}) });
20
- domain = input.required({ ...(ngDevMode ? { debugName: "domain" } : {}) });
21
- value = input.required({ ...(ngDevMode ? { debugName: "value" } : {}) });
22
- name = input.required({ ...(ngDevMode ? { debugName: "name" } : {}) });
17
+ className = input(...(ngDevMode ? [undefined, { debugName: "className" }] : []));
18
+ mode = input.required(...(ngDevMode ? [{ debugName: "mode" }] : []));
19
+ resource = input.required(...(ngDevMode ? [{ debugName: "resource" }] : []));
20
+ domain = input.required(...(ngDevMode ? [{ debugName: "domain" }] : []));
21
+ value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
22
+ name = input.required(...(ngDevMode ? [{ debugName: "name" }] : []));
23
23
  inputMode = InputMode;
24
- canEdit = signal(false, { ...(ngDevMode ? { debugName: "canEdit" } : {}) });
24
+ canEdit = signal(false, ...(ngDevMode ? [{ debugName: "canEdit" }] : []));
25
25
  canEditSelector = false;
26
- canRead = signal(false, { ...(ngDevMode ? { debugName: "canRead" } : {}) });
26
+ canRead = signal(false, ...(ngDevMode ? [{ debugName: "canRead" }] : []));
27
27
  canReadSelector = false;
28
28
  ngOnInit() {
29
29
  this.canEditSelector = this.auth.hasPermission({
@@ -45,7 +45,7 @@ class CccInputFieldComponent {
45
45
  return this.canReadSelector;
46
46
  }
47
47
  return false;
48
- }, { ...(ngDevMode ? { debugName: "canRead" } : {}) });
48
+ }, ...(ngDevMode ? [{ debugName: "canRead" }] : []));
49
49
  this.canEdit = computed(() => {
50
50
  const res = this.resource();
51
51
  if (!res) {
@@ -55,17 +55,17 @@ class CccInputFieldComponent {
55
55
  return this.canEditSelector;
56
56
  }
57
57
  return false;
58
- }, { ...(ngDevMode ? { debugName: "canEdit" } : {}) });
58
+ }, ...(ngDevMode ? [{ debugName: "canEdit" }] : []));
59
59
  }
60
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: CccInputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
61
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.2", type: CccInputFieldComponent, isStandalone: true, selector: "ccc-input-field", inputs: { className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, resource: { classPropertyName: "resource", publicName: "resource", isSignal: true, isRequired: true, transformFunction: null }, domain: { classPropertyName: "domain", publicName: "domain", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
60
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CccInputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
61
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: CccInputFieldComponent, isStandalone: true, selector: "ccc-input-field", inputs: { className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, resource: { classPropertyName: "resource", publicName: "resource", isSignal: true, isRequired: true, transformFunction: null }, domain: { classPropertyName: "domain", publicName: "domain", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
62
62
  <mat-form-field [class]="className()">
63
63
  <mat-label>{{ name() }}</mat-label>
64
64
  <input matInput [disabled]="mode() === inputMode.Edit && canEdit()" [value]="value()" />
65
65
  </mat-form-field>
66
66
  `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
67
67
  }
68
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: CccInputFieldComponent, decorators: [{
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CccInputFieldComponent, decorators: [{
69
69
  type: Component,
70
70
  args: [{ selector: 'ccc-input-field', imports: [MatFormFieldModule, MatInputModule], template: `
71
71
  <mat-form-field [class]="className()">
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib-auth-forms.mjs","sources":["../../../projects/ccc-lib/auth-forms/ccc-field/ccc-field.component.ts","../../../projects/ccc-lib/auth-forms/cccteam-ccc-lib-auth-forms.ts"],"sourcesContent":["import { Component, computed, inject, input, OnInit, signal, Signal } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\nimport { Domain, ReadPermission, Resource, UpdatePermission } from '@cccteam/ccc-lib/types';\n\nexport enum InputMode {\n Read = 'read',\n Edit = 'edit',\n}\n\n@Component({\n selector: 'ccc-input-field',\n imports: [MatFormFieldModule, MatInputModule],\n template: `\n <mat-form-field [class]=\"className()\">\n <mat-label>{{ name() }}</mat-label>\n <input matInput [disabled]=\"mode() === inputMode.Edit && canEdit()\" [value]=\"value()\" />\n </mat-form-field>\n `,\n styleUrl: './ccc-field.component.scss',\n})\nexport class CccInputFieldComponent implements OnInit {\n auth = inject(AuthService);\n className = input();\n mode = input.required<InputMode>();\n resource = input.required<Resource>();\n domain = input.required<Domain>();\n value = input.required();\n name = input.required<string>();\n\n inputMode = InputMode;\n\n canEdit: Signal<boolean> = signal(false);\n canEditSelector = false;\n\n canRead: Signal<boolean> = signal(false);\n canReadSelector = false;\n\n ngOnInit(): void {\n this.canEditSelector = this.auth.hasPermission({\n resource: this.resource(),\n permission: ReadPermission,\n domain: this.domain(),\n });\n this.canReadSelector = this.auth.hasPermission({\n resource: this.resource(),\n permission: UpdatePermission,\n domain: this.domain(),\n });\n\n this.canRead = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthService.requiresPermission(this.resource(), ReadPermission)) {\n return this.canReadSelector;\n }\n return false;\n });\n\n this.canEdit = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthService.requiresPermission(this.resource(), UpdatePermission)) {\n return this.canEditSelector;\n }\n return false;\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAMY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AA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,WAClB,CAAC,kBAAkB,EAAE,cAAc,CAAC,EAAA,QAAA,EACnC;;;;;AAKT,EAAA,CAAA,EAAA;;;ACnBH;;AAEG;;;;"}
1
+ {"version":3,"file":"cccteam-ccc-lib-auth-forms.mjs","sources":["../../../projects/ccc-lib/auth-forms/ccc-field/ccc-field.component.ts","../../../projects/ccc-lib/auth-forms/cccteam-ccc-lib-auth-forms.ts"],"sourcesContent":["import { Component, computed, inject, input, OnInit, signal, Signal } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\nimport { Domain, ReadPermission, Resource, UpdatePermission } from '@cccteam/ccc-lib/types';\n\nexport enum InputMode {\n Read = 'read',\n Edit = 'edit',\n}\n\n@Component({\n selector: 'ccc-input-field',\n imports: [MatFormFieldModule, MatInputModule],\n template: `\n <mat-form-field [class]=\"className()\">\n <mat-label>{{ name() }}</mat-label>\n <input matInput [disabled]=\"mode() === inputMode.Edit && canEdit()\" [value]=\"value()\" />\n </mat-form-field>\n `,\n styleUrl: './ccc-field.component.scss',\n})\nexport class CccInputFieldComponent implements OnInit {\n auth = inject(AuthService);\n className = input();\n mode = input.required<InputMode>();\n resource = input.required<Resource>();\n domain = input.required<Domain>();\n value = input.required();\n name = input.required<string>();\n\n inputMode = InputMode;\n\n canEdit: Signal<boolean> = signal(false);\n canEditSelector = false;\n\n canRead: Signal<boolean> = signal(false);\n canReadSelector = false;\n\n ngOnInit(): void {\n this.canEditSelector = this.auth.hasPermission({\n resource: this.resource(),\n permission: ReadPermission,\n domain: this.domain(),\n });\n this.canReadSelector = this.auth.hasPermission({\n resource: this.resource(),\n permission: UpdatePermission,\n domain: this.domain(),\n });\n\n this.canRead = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthService.requiresPermission(this.resource(), ReadPermission)) {\n return this.canReadSelector;\n }\n return false;\n });\n\n this.canEdit = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthService.requiresPermission(this.resource(), UpdatePermission)) {\n return this.canEditSelector;\n }\n return false;\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAMY;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;MAgBR,sBAAsB,CAAA;AACjC,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;IAC1B,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAE;AACnB,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAa;AAClC,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,mDAAY;AACrC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAU;AACjC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAE;AACxB,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAU;IAE/B,SAAS,GAAG,SAAS;AAErB,IAAA,OAAO,GAAoB,MAAM,CAAC,KAAK,mDAAC;IACxC,eAAe,GAAG,KAAK;AAEvB,IAAA,OAAO,GAAoB,MAAM,CAAC,KAAK,mDAAC;IACxC,eAAe,GAAG,KAAK;IAEvB,QAAQ,GAAA;QACN,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;AAC7C,YAAA,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;AACzB,YAAA,UAAU,EAA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,QAAA,EAAA,yHAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,IAAA,EAAA,aAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,mBAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FASjC,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,WAClB,CAAC,kBAAkB,EAAE,cAAc,CAAC,EAAA,QAAA,EACnC;;;;;AAKT,EAAA,CAAA,EAAA;;;ACnBH;;AAEG;;;;"}
@@ -6,7 +6,7 @@ class HasPermissionDirective {
6
6
  auth = inject(AuthService);
7
7
  templateRef = inject((TemplateRef));
8
8
  viewContainer = inject(ViewContainerRef);
9
- scope = signal(undefined, { ...(ngDevMode ? { debugName: "scope" } : {}) });
9
+ scope = signal(undefined, ...(ngDevMode ? [{ debugName: "scope" }] : []));
10
10
  set cccHasPermission(scope) {
11
11
  this.scope.set(scope);
12
12
  }
@@ -23,10 +23,10 @@ class HasPermissionDirective {
23
23
  }
24
24
  });
25
25
  }
26
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: HasPermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
27
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.2", type: HasPermissionDirective, isStandalone: true, selector: "[cccHasPermission]", inputs: { cccHasPermission: "cccHasPermission" }, ngImport: i0 });
26
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: HasPermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
27
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: HasPermissionDirective, isStandalone: true, selector: "[cccHasPermission]", inputs: { cccHasPermission: "cccHasPermission" }, ngImport: i0 });
28
28
  }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: HasPermissionDirective, decorators: [{
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: HasPermissionDirective, decorators: [{
30
30
  type: Directive,
31
31
  args: [{
32
32
  selector: '[cccHasPermission]',
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib-auth-has-permission.mjs","sources":["../../../projects/ccc-lib/auth-has-permission/has-permission.directive.ts","../../../projects/ccc-lib/auth-has-permission/cccteam-ccc-lib-auth-has-permission.ts"],"sourcesContent":["import { Directive, Input, TemplateRef, ViewContainerRef, effect, inject, signal } from '@angular/core';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\nimport { PermissionScope } from '@cccteam/ccc-lib/types';\n\n@Directive({\n selector: '[cccHasPermission]',\n standalone: true,\n})\nexport class HasPermissionDirective {\n private auth = inject(AuthService);\n private templateRef = inject(TemplateRef<unknown>);\n private viewContainer = inject(ViewContainerRef);\n\n private scope = signal<PermissionScope | undefined>(undefined);\n\n @Input()\n set cccHasPermission(scope: PermissionScope) {\n this.scope.set(scope);\n }\n\n constructor() {\n effect(() => {\n const scope = this.scope();\n\n if (this.auth.hasPermission(scope) && this.auth.authenticated()) {\n if (!this.viewContainer.get(0)) {\n this.viewContainer.createEmbeddedView(this.templateRef);\n }\n } else {\n this.viewContainer.clear();\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,sBAAsB,CAAA;AACzB,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1B,IAAA,WAAW,GAAG,MAAM,EAAC,WAAoB,EAAC;AAC1C,IAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAExC,IAAA,KAAK,GAAG,MAAM,CAA8B,SAAS,mDAAC;IAE9D,IACI,gBAAgB,CAAC,KAAsB,EAAA;AACzC,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;IACvB;AAEA,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAE1B,YAAA,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE;gBAC/D,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;oBAC9B,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC;gBACzD;YACF;iBAAO;AACL,gBAAA,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;YAC5B;AACF,QAAA,CAAC,CAAC;IACJ;uGAxBW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAQE;;;ACfH;;AAEG;;;;"}
1
+ {"version":3,"file":"cccteam-ccc-lib-auth-has-permission.mjs","sources":["../../../projects/ccc-lib/auth-has-permission/has-permission.directive.ts","../../../projects/ccc-lib/auth-has-permission/cccteam-ccc-lib-auth-has-permission.ts"],"sourcesContent":["import { Directive, Input, TemplateRef, ViewContainerRef, effect, inject, signal } from '@angular/core';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\nimport { PermissionScope } from '@cccteam/ccc-lib/types';\n\n@Directive({\n selector: '[cccHasPermission]',\n standalone: true,\n})\nexport class HasPermissionDirective {\n private auth = inject(AuthService);\n private templateRef = inject(TemplateRef<unknown>);\n private viewContainer = inject(ViewContainerRef);\n\n private scope = signal<PermissionScope | undefined>(undefined);\n\n @Input()\n set cccHasPermission(scope: PermissionScope) {\n this.scope.set(scope);\n }\n\n constructor() {\n effect(() => {\n const scope = this.scope();\n\n if (this.auth.hasPermission(scope) && this.auth.authenticated()) {\n if (!this.viewContainer.get(0)) {\n this.viewContainer.createEmbeddedView(this.templateRef);\n }\n } else {\n this.viewContainer.clear();\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,sBAAsB,CAAA;AACzB,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1B,IAAA,WAAW,GAAG,MAAM,EAAC,WAAoB,EAAC;AAC1C,IAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAExC,IAAA,KAAK,GAAG,MAAM,CAA8B,SAAS,iDAAC;IAE9D,IACI,gBAAgB,CAAC,KAAsB,EAAA;AACzC,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;IACvB;AAEA,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAE1B,YAAA,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE;gBAC/D,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;oBAC9B,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC;gBACzD;YACF;iBAAO;AACL,gBAAA,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;YAC5B;AACF,QAAA,CAAC,CAAC;IACJ;uGAxBW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAQE;;;ACfH;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, signal, Injectable } from '@angular/core';
4
- import { API_URL, FRONTEND_LOGIN_PATH, SESSION_PATH, PERMISSION_REQUIRED } from '@cccteam/ccc-lib/types';
4
+ import { API_URL, FRONTEND_LOGIN_PATH, SESSION_PATH, LOGOUT_ACTION, PERMISSION_REQUIRED } from '@cccteam/ccc-lib/types';
5
5
  import { errorOptions } from '@cccteam/ccc-lib/util-request-options';
6
6
  import { map, tap } from 'rxjs';
7
7
 
@@ -9,10 +9,11 @@ class AuthService {
9
9
  apiUrl = inject(API_URL);
10
10
  loginUrl = inject(FRONTEND_LOGIN_PATH);
11
11
  sessionUrl = inject(SESSION_PATH);
12
+ logoutAction = inject(LOGOUT_ACTION);
12
13
  http = inject(HttpClient);
13
- authenticatedSignal = signal(false, { ...(ngDevMode ? { debugName: "authenticatedSignal" } : {}) });
14
- sessionInfoSignal = signal({}, { ...(ngDevMode ? { debugName: "sessionInfoSignal" } : {}) });
15
- redirectUrl = signal('', { ...(ngDevMode ? { debugName: "redirectUrl" } : {}) });
14
+ authenticatedSignal = signal(false, ...(ngDevMode ? [{ debugName: "authenticatedSignal" }] : []));
15
+ sessionInfoSignal = signal({}, ...(ngDevMode ? [{ debugName: "sessionInfoSignal" }] : []));
16
+ redirectUrl = signal('', ...(ngDevMode ? [{ debugName: "redirectUrl" }] : []));
16
17
  authenticated = this.authenticatedSignal.asReadonly();
17
18
  sessionInfo = this.sessionInfoSignal.asReadonly();
18
19
  constructor() {
@@ -37,7 +38,7 @@ class AuthService {
37
38
  }
38
39
  }
39
40
  /**
40
- * Logs a user out.
41
+ * Logs a user out and calls the configured logout action.
41
42
  *
42
43
  * @returns Observable with a boolean indicating whether they were logged out.
43
44
  */
@@ -46,6 +47,12 @@ class AuthService {
46
47
  .delete(`${this.apiUrl}/${this.sessionUrl}`, errorOptions(false))
47
48
  .pipe(map(() => true))
48
49
  .pipe(tap(() => {
50
+ try {
51
+ this.logoutAction();
52
+ }
53
+ catch (error) {
54
+ console.error('Error during logout action (LOGOUT_ACTION token):', error);
55
+ }
49
56
  this.authenticatedSignal.set(false);
50
57
  this.sessionInfoSignal.set({});
51
58
  }));
@@ -64,10 +71,10 @@ class AuthService {
64
71
  loginRoute() {
65
72
  return this.loginUrl;
66
73
  }
67
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
68
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, providedIn: 'root' });
74
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
75
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: AuthService, providedIn: 'root' });
69
76
  }
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, decorators: [{
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: AuthService, decorators: [{
71
78
  type: Injectable,
72
79
  args: [{
73
80
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib-auth-service.mjs","sources":["../../../projects/ccc-lib/auth-service/auth.service.ts","../../../projects/ccc-lib/auth-service/cccteam-ccc-lib-auth-service.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable, signal } from '@angular/core';\nimport {\n API_URL,\n FRONTEND_LOGIN_PATH,\n Permission,\n PERMISSION_REQUIRED,\n PermissionScope,\n Resource,\n SESSION_PATH,\n SessionInfo,\n} from '@cccteam/ccc-lib/types';\nimport { errorOptions } from '@cccteam/ccc-lib/util-request-options';\nimport { map, Observable, tap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n private apiUrl = inject(API_URL);\n private loginUrl = inject(FRONTEND_LOGIN_PATH);\n private sessionUrl = inject(SESSION_PATH);\n\n http = inject(HttpClient);\n private authenticatedSignal = signal(false);\n private sessionInfoSignal = signal({} as SessionInfo);\n\n redirectUrl = signal('');\n authenticated = this.authenticatedSignal.asReadonly();\n sessionInfo = this.sessionInfoSignal.asReadonly();\n\n constructor() {\n this.initializePermissionFn();\n }\n\n private static permissionFn: (resource: Resource, permission: Permission) => boolean;\n\n hasPermission(scope?: PermissionScope): boolean {\n if (!scope) return true;\n const resourcePermissions = this.sessionInfo().permissions?.[scope.domain]?.[scope.resource];\n return Array.isArray(resourcePermissions) && resourcePermissions.includes(scope.permission);\n }\n\n static requiresPermission(resource: Resource, permission: Permission): boolean {\n if (!AuthService.permissionFn) {\n throw new Error(\n `AuthState has not been initialized. Ensure AuthState is provided in your module or instantiated at least once.`,\n );\n }\n return AuthService.permissionFn(resource, permission);\n }\n\n private initializePermissionFn(): void {\n if (!AuthService.permissionFn) {\n AuthService.permissionFn = inject(PERMISSION_REQUIRED);\n }\n }\n\n /**\n * Logs a user out.\n *\n * @returns Observable with a boolean indicating whether they were logged out.\n */\n logout(): Observable<boolean> {\n return this.http\n .delete(`${this.apiUrl}/${this.sessionUrl}`, errorOptions(false))\n .pipe(map(() => true))\n .pipe(\n tap(() => {\n this.authenticatedSignal.set(false);\n this.sessionInfoSignal.set({} as SessionInfo);\n }),\n );\n }\n\n /**\n * Checks a user's session with the server.\n *\n * @returns Observable with the user session info\n */\n checkUserSession(): Observable<SessionInfo> {\n return this.http.get<SessionInfo>(`${this.apiUrl}/${this.sessionUrl}`, errorOptions(false)).pipe(\n tap((sessionInfo) => {\n this.authenticatedSignal.set(!!sessionInfo?.authenticated);\n this.sessionInfoSignal.set(sessionInfo);\n }),\n );\n }\n\n loginRoute(): string {\n return this.loginUrl;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAkBa,WAAW,CAAA;AACd,IAAA,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;AACxB,IAAA,QAAQ,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACtC,IAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;AAEzC,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACjB,IAAA,mBAAmB,GAAG,MAAM,CAAC,KAAK,iEAAC;AACnC,IAAA,iBAAiB,GAAG,MAAM,CAAC,EAAiB,+DAAC;AAErD,IAAA,WAAW,GAAG,MAAM,CAAC,EAAE,yDAAC;AACxB,IAAA,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE;AACrD,IAAA,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE;AAEjD,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,sBAAsB,EAAE;IAC/B;IAEQ,OAAO,YAAY;AAE3B,IAAA,aAAa,CAAC,KAAuB,EAAA;AACnC,Q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AA,EAAI,IAAI,CAAC,UAAU,CAAA,CAAE,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAC9F,GAAG,CAAC,CAAC,WAAW,KAAI;YAClB,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,aAAa,CAAC;AAC1D,YAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC;QACzC,CAAC,CAAC,CACH;IACH;IAEA,UAAU,GAAA;QACR,OAAO,IAAI,CAAC,QAAQ;IACtB;uGAzEW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;2FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACjBD;;AAEG;;;;"}
1
+ {"version":3,"file":"cccteam-ccc-lib-auth-service.mjs","sources":["../../../projects/ccc-lib/auth-service/auth.service.ts","../../../projects/ccc-lib/auth-service/cccteam-ccc-lib-auth-service.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable, signal } from '@angular/core';\nimport {\n API_URL,\n FRONTEND_LOGIN_PATH,\n LOGOUT_ACTION,\n Permission,\n PERMISSION_REQUIRED,\n PermissionScope,\n Resource,\n SESSION_PATH,\n SessionInfo,\n} from '@cccteam/ccc-lib/types';\nimport { errorOptions } from '@cccteam/ccc-lib/util-request-options';\nimport { map, Observable, tap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n private apiUrl = inject(API_URL);\n private loginUrl = inject(FRONTEND_LOGIN_PATH);\n private sessionUrl = inject(SESSION_PATH);\n private logoutAction = inject(LOGOUT_ACTION);\n\n http = inject(HttpClient);\n private authenticatedSignal = signal(false);\n private sessionInfoSignal = signal({} as SessionInfo);\n\n redirectUrl = signal('');\n authenticated = this.authenticatedSignal.asReadonly();\n sessionInfo = this.sessionInfoSignal.asReadonly();\n\n constructor() {\n this.initializePermissionFn();\n }\n\n private static permissionFn: (resource: Resource, permission: Permission) => boolean;\n\n hasPermission(scope?: PermissionScope): boolean {\n if (!scope) return true;\n const resourcePermissions = this.sessionInfo().permissions?.[scope.domain]?.[scope.resource];\n return Array.isArray(resourcePermissions) && resourcePermissions.includes(scope.permission);\n }\n\n static requiresPermission(resource: Resource, permission: Permission): boolean {\n if (!AuthService.permissionFn) {\n throw new Error(\n `AuthState has not been initialized. Ensure AuthState is provided in your module or instantiated at least once.`,\n );\n }\n return AuthService.permissionFn(resource, permission);\n }\n\n private initializePermissionFn(): void {\n if (!AuthService.permissionFn) {\n AuthService.permissionFn = inject(PERMISSION_REQUIRED);\n }\n }\n\n /**\n * Logs a user out and calls the configured logout action.\n *\n * @returns Observable with a boolean indicating whether they were logged out.\n */\n logout(): Observable<boolean> {\n return this.http\n .delete(`${this.apiUrl}/${this.sessionUrl}`, errorOptions(false))\n .pipe(map(() => true))\n .pipe(\n tap(() => {\n try {\n this.logoutAction();\n } catch (error) {\n console.error('Error during logout action (LOGOUT_ACTION token):', error);\n }\n this.authenticatedSignal.set(false);\n this.sessionInfoSignal.set({} as SessionInfo);\n }),\n );\n }\n\n /**\n * Checks a user's session with the server.\n *\n * @returns Observable with the user session info\n */\n checkUserSession(): Observable<SessionInfo> {\n return this.http.get<SessionInfo>(`${this.apiUrl}/${this.sessionUrl}`, errorOptions(false)).pipe(\n tap((sessionInfo) => {\n this.authenticatedSignal.set(!!sessionInfo?.authenticated);\n this.sessionInfoSignal.set(sessionInfo);\n }),\n );\n }\n\n loginRoute(): string {\n return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AI,CAAC,QAAQ;IACtB;uGA/EW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;2FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AClBD;;AAEG;;;;"}
@@ -15,10 +15,10 @@ class CamelCaseToTitlePipe {
15
15
  transformed = transformed.charAt(0).toUpperCase() + transformed.slice(1);
16
16
  return transformed;
17
17
  }
18
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: CamelCaseToTitlePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
19
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.2", ngImport: i0, type: CamelCaseToTitlePipe, isStandalone: true, name: "camelCaseToTitle" });
18
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CamelCaseToTitlePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
19
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.1", ngImport: i0, type: CamelCaseToTitlePipe, isStandalone: true, name: "camelCaseToTitle" });
20
20
  }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: CamelCaseToTitlePipe, decorators: [{
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CamelCaseToTitlePipe, decorators: [{
22
22
  type: Pipe,
23
23
  args: [{
24
24
  name: 'camelCaseToTitle',
@@ -15,13 +15,13 @@ import * as i1$1 from '@progress/kendo-angular-grid';
15
15
  import { GridModule } from '@progress/kendo-angular-grid';
16
16
 
17
17
  class TableButtonComponent {
18
- config = input.required({ ...(ngDevMode ? { debugName: "config" } : {}) });
19
- rowData = input.required({ ...(ngDevMode ? { debugName: "rowData" } : {}) });
20
- tooltipPosition = input('above', { ...(ngDevMode ? { debugName: "tooltipPosition" } : {}) });
21
- color = input('', { ...(ngDevMode ? { debugName: "color" } : {}) });
22
- disabled = signal(false, { ...(ngDevMode ? { debugName: "disabled" } : {}) });
23
- viewRoute = input('', { ...(ngDevMode ? { debugName: "viewRoute" } : {}) });
24
- id = input('', { ...(ngDevMode ? { debugName: "id" } : {}) });
18
+ config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
19
+ rowData = input.required(...(ngDevMode ? [{ debugName: "rowData" }] : []));
20
+ tooltipPosition = input('above', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : []));
21
+ color = input('', ...(ngDevMode ? [{ debugName: "color" }] : []));
22
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
23
+ viewRoute = input('', ...(ngDevMode ? [{ debugName: "viewRoute" }] : []));
24
+ id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
25
25
  link = computed(() => {
26
26
  const viewRoute = this.viewRoute();
27
27
  const id = this.id();
@@ -32,7 +32,7 @@ class TableButtonComponent {
32
32
  return `${viewRoute}/${id}`;
33
33
  }
34
34
  return `${viewRoute}/${id}`;
35
- }, { ...(ngDevMode ? { debugName: "link" } : {}) });
35
+ }, ...(ngDevMode ? [{ debugName: "link" }] : []));
36
36
  callAction() {
37
37
  const rowData = this.rowData();
38
38
  const action = this.config().action;
@@ -42,21 +42,21 @@ class TableButtonComponent {
42
42
  action({ id: idVal });
43
43
  }
44
44
  }
45
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: TableButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
46
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: TableButtonComponent, isStandalone: true, selector: "ccc-table-button", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: true, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, viewRoute: { classPropertyName: "viewRoute", publicName: "viewRoute", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span\n [matTooltip]=\"disabled() ? config().disabledLabel : config().label\"\n [matTooltipPosition]=\"tooltipPosition()\"\n class=\"parent\">\n @if (config().actionType === 'link') {\n <a [routerLink]=\"viewRoute()\">\n <button mat-icon-button [disabled]=\"disabled()\" [color]=\"config().color\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n </a>\n } @else if (config().actionType === 'function') {\n <button mat-icon-button (click)=\"callAction()\" [disabled]=\"disabled()\" [color]=\"color()\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n }\n</span>\n", styles: [".parent{width:100%;height:100%;display:flex}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
45
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
46
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TableButtonComponent, isStandalone: true, selector: "ccc-table-button", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: true, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, viewRoute: { classPropertyName: "viewRoute", publicName: "viewRoute", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span\n [matTooltip]=\"disabled() ? config().disabledLabel : config().label\"\n [matTooltipPosition]=\"tooltipPosition()\"\n class=\"parent\">\n @if (config().actionType === 'link') {\n <a [routerLink]=\"viewRoute()\">\n <button mat-icon-button [disabled]=\"disabled()\" [color]=\"config().color\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n </a>\n } @else if (config().actionType === 'function') {\n <button mat-icon-button (click)=\"callAction()\" [disabled]=\"disabled()\" [color]=\"color()\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n }\n</span>\n", styles: [".parent{width:100%;height:100%;display:flex}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
47
47
  }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: TableButtonComponent, decorators: [{
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableButtonComponent, decorators: [{
49
49
  type: Component,
50
50
  args: [{ selector: 'ccc-table-button', standalone: true, imports: [MatButtonModule, MatIconModule, MatTooltipModule, RouterModule], template: "<span\n [matTooltip]=\"disabled() ? config().disabledLabel : config().label\"\n [matTooltipPosition]=\"tooltipPosition()\"\n class=\"parent\">\n @if (config().actionType === 'link') {\n <a [routerLink]=\"viewRoute()\">\n <button mat-icon-button [disabled]=\"disabled()\" [color]=\"config().color\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n </a>\n } @else if (config().actionType === 'function') {\n <button mat-icon-button (click)=\"callAction()\" [disabled]=\"disabled()\" [color]=\"color()\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n }\n</span>\n", styles: [".parent{width:100%;height:100%;display:flex}\n"] }]
51
51
  }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], rowData: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowData", required: true }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], viewRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewRoute", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
52
52
 
53
53
  class AppGridComponent {
54
54
  /* eslint-disable @typescript-eslint/no-explicit-any */
55
- rowData = input([], { ...(ngDevMode ? { debugName: "rowData" } : {}) });
56
- columnDefs = input([], { ...(ngDevMode ? { debugName: "columnDefs" } : {}) });
57
- enableRowExpansion = input(false, { ...(ngDevMode ? { debugName: "enableRowExpansion" } : {}) });
58
- detailTemplate = input(undefined, { ...(ngDevMode ? { debugName: "detailTemplate" } : {}) });
59
- selectionType = input('none', { ...(ngDevMode ? { debugName: "selectionType" } : {}) });
55
+ rowData = input([], ...(ngDevMode ? [{ debugName: "rowData" }] : []));
56
+ columnDefs = input([], ...(ngDevMode ? [{ debugName: "columnDefs" }] : []));
57
+ enableRowExpansion = input(false, ...(ngDevMode ? [{ debugName: "enableRowExpansion" }] : []));
58
+ detailTemplate = input(...(ngDevMode ? [undefined, { debugName: "detailTemplate" }] : []));
59
+ selectionType = input('none', ...(ngDevMode ? [{ debugName: "selectionType" }] : []));
60
60
  selectedRows = output();
61
61
  selectedKeys = [];
62
62
  onSelectedKeysChange(keys) {
@@ -80,9 +80,9 @@ class AppGridComponent {
80
80
  checkboxOnly: true,
81
81
  };
82
82
  }
83
- }, { ...(ngDevMode ? { debugName: "selectionMode" } : {}) });
84
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AppGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
85
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: AppGridComponent, isStandalone: true, selector: "ccc-grid", inputs: { rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: false, transformFunction: null }, columnDefs: { classPropertyName: "columnDefs", publicName: "columnDefs", isSignal: true, isRequired: false, transformFunction: null }, enableRowExpansion: { classPropertyName: "enableRowExpansion", publicName: "enableRowExpansion", isSignal: true, isRequired: false, transformFunction: null }, detailTemplate: { classPropertyName: "detailTemplate", publicName: "detailTemplate", isSignal: true, isRequired: false, transformFunction: null }, selectionType: { classPropertyName: "selectionType", publicName: "selectionType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedRows: "selectedRows" }, ngImport: i0, template: `
83
+ }, ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
84
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: AppGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
85
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: AppGridComponent, isStandalone: true, selector: "ccc-grid", inputs: { rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: false, transformFunction: null }, columnDefs: { classPropertyName: "columnDefs", publicName: "columnDefs", isSignal: true, isRequired: false, transformFunction: null }, enableRowExpansion: { classPropertyName: "enableRowExpansion", publicName: "enableRowExpansion", isSignal: true, isRequired: false, transformFunction: null }, detailTemplate: { classPropertyName: "detailTemplate", publicName: "detailTemplate", isSignal: true, isRequired: false, transformFunction: null }, selectionType: { classPropertyName: "selectionType", publicName: "selectionType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedRows: "selectedRows" }, ngImport: i0, template: `
86
86
  <kendo-grid
87
87
  [data]="rowData()"
88
88
  filterable="menu"
@@ -159,7 +159,7 @@ class AppGridComponent {
159
159
  </kendo-grid>
160
160
  `, isInline: true, styles: [":host{display:block;height:100%}kendo-grid{height:100%}.col-header{font-weight:700}app-table-button{position:relative;z-index:10}a[mat-button]{position:relative;z-index:11}::ng-deep .k-grid .k-grid-aria-root{overflow-x:auto;overflow-y:hidden}::ng-deep .k-grid .k-detail-cell{padding:16px}\n"], dependencies: [{ kind: "ngmodule", type: GridModule }, { kind: "component", type: i1$1.GridComponent, selector: "kendo-grid", inputs: ["data", "pageSize", "height", "rowHeight", "adaptiveMode", "detailRowHeight", "skip", "scrollable", "selectable", "sort", "size", "trackBy", "filter", "group", "virtualColumns", "filterable", "sortable", "pageable", "groupable", "gridResizable", "rowReorderable", "navigable", "autoSize", "rowClass", "rowSticky", "rowSelected", "isRowSelectable", "cellSelected", "resizable", "reorderable", "loading", "columnMenu", "hideHeader", "showInactiveTools", "isDetailExpanded", "isGroupExpanded", "dataLayoutMode"], outputs: ["filterChange", "pageChange", "groupChange", "sortChange", "selectionChange", "rowReorder", "dataStateChange", "gridStateChange", "groupExpand", "groupCollapse", "detailExpand", "detailCollapse", "edit", "cancel", "save", "remove", "add", "cellClose", "cellClick", "pdfExport", "excelExport", "columnResize", "columnReorder", "columnVisibilityChange", "columnLockedChange", "columnStickyChange", "scrollBottom", "contentScroll"], exportAs: ["kendoGrid"] }, { kind: "directive", type: i1$1.SelectionDirective, selector: "[kendoGridSelectBy]" }, { kind: "component", type: i1$1.ColumnComponent, selector: "kendo-grid-column", inputs: ["field", "format", "sortable", "groupable", "editor", "filter", "filterVariant", "filterable", "editable"] }, { kind: "directive", type: i1$1.DetailTemplateDirective, selector: "[kendoGridDetailTemplate]", inputs: ["kendoGridDetailTemplateShowIf"] }, { kind: "component", type: i1$1.CheckboxColumnComponent, selector: "kendo-grid-checkbox-column", inputs: ["showSelectAll", "showDisabledCheckbox"] }, { kind: "directive", type: i1$1.CellTemplateDirective, selector: "[kendoGridCellTemplate]" }, { kind: "directive", type: i1$1.NoRecordsTemplateDirective, selector: "[kendoGridNoRecordsTemplate]" }, { kind: "directive", type: i1$1.HeaderTemplateDirective, selector: "[kendoGridHeaderTemplate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TableButtonComponent, selector: "ccc-table-button", inputs: ["config", "rowData", "tooltipPosition", "color", "viewRoute", "id"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: CamelCaseToTitlePipe, name: "camelCaseToTitle" }] });
161
161
  }
162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AppGridComponent, decorators: [{
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: AppGridComponent, decorators: [{
163
163
  type: Component,
164
164
  args: [{ selector: 'ccc-grid', standalone: true, imports: [
165
165
  GridModule,
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib-ccc-grid.mjs","sources":["../../../projects/ccc-lib/ccc-grid/table-button/table-button.component.ts","../../../projects/ccc-lib/ccc-grid/table-button/table-button.component.html","../../../projects/ccc-lib/ccc-grid/ccc-grid.component.ts","../../../projects/ccc-lib/ccc-grid/cccteam-ccc-lib-ccc-grid.ts"],"sourcesContent":["import { Component, computed, input, signal } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule, TooltipPosition } from '@angular/material/tooltip';\nimport { RouterModule } from '@angular/router';\nimport { ActionButtonConfig } from '@cccteam/ccc-lib/types';\n\n@Component({\n selector: 'ccc-table-button',\n standalone: true,\n imports: [MatButtonModule, MatIconModule, MatTooltipModule, RouterModule],\n templateUrl: './table-button.component.html',\n styleUrl: './table-button.component.scss',\n})\nexport class TableButtonComponent<T> {\n config = input.required<ActionButtonConfig>();\n\n rowData = input.required<T>();\n tooltipPosition = input<TooltipPosition>('above' as TooltipPosition);\n color = input<string>('');\n disabled = signal<boolean>(false);\n viewRoute = input<string>('');\n id = input<string>('');\n\n link = computed(() => {\n const viewRoute = this.viewRoute();\n const id = this.id();\n\n if (!viewRoute || !id) {\n return '';\n }\n\n if (!viewRoute.startsWith('/')) {\n return `${viewRoute}/${id}`;\n }\n\n return `${viewRoute}/${id}`;\n });\n\n callAction(): void {\n const rowData = this.rowData();\n const action = this.config().action;\n if (rowData && action !== undefined) {\n const id = 'id' as keyof T;\n const idVal = rowData[id] as string;\n action({ id: idVal });\n }\n }\n}\n","<span\n [matTooltip]=\"disabled() ? config().disabledLabel : config().label\"\n [matTooltipPosition]=\"tooltipPosition()\"\n class=\"parent\">\n @if (config().actionType === 'link') {\n <a [routerLink]=\"viewRoute()\">\n <button mat-icon-button [disabled]=\"disabled()\" [color]=\"config().color\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n </a>\n } @else if (config().actionType === 'function') {\n <button mat-icon-button (click)=\"callAction()\" [disabled]=\"disabled()\" [color]=\"color()\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n }\n</span>\n","import { CommonModule } from '@angular/common';\nimport { Component, computed, input, output, TemplateRef } from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { RouterModule } from '@angular/router';\nimport { CamelCaseToTitlePipe } from '@cccteam/ccc-lib/ccc-camel-case-to-title';\nimport { ColumnConfig, RecordData } from '@cccteam/ccc-lib/types';\nimport { GridModule, SelectableMode, SelectableSettings } from '@progress/kendo-angular-grid';\nimport { TableButtonComponent } from './table-button/table-button.component';\n\n@Component({\n selector: 'ccc-grid',\n standalone: true,\n imports: [\n GridModule,\n CommonModule,\n TableButtonComponent,\n CamelCaseToTitlePipe,\n RouterModule,\n MatIconButton,\n MatIconModule,\n MatTooltipModule,\n ],\n template: `\n <kendo-grid\n [data]=\"rowData()\"\n filterable=\"menu\"\n [sortable]=\"true\"\n scrollable=\"none\"\n [selectable]=\"selectionMode()\"\n [selectedKeys]=\"selectedKeys\"\n kendoGridSelectBy=\"id\"\n (selectedKeysChange)=\"onSelectedKeysChange($event)\">\n @if (selectionMode() !== false) {\n <kendo-grid-checkbox-column\n [width]=\"40\"\n [showSelectAll]=\"selectionType() === 'multiple'\"></kendo-grid-checkbox-column>\n }\n @for (col of columnDefs(); track col.id + col.header) {\n @if (col.buttonConfig) {\n <kendo-grid-column\n [field]=\"col.id\"\n [filterable]=\"false\"\n [sortable]=\"false\"\n [width]=\"66\"\n [resizable]=\"col.resizable ?? true\">\n <ng-template kendoGridHeaderTemplate> </ng-template>\n <ng-template kendoGridCellTemplate let-dataItem>\n @if (col.buttonConfig.actionType === 'link' && col.buttonConfig.viewRoute) {\n <a\n mat-icon-button\n [routerLink]=\"['/', col.buttonConfig.viewRoute, dataItem['id']]\"\n [matTooltip]=\"col.buttonConfig.label || ''\"\n [matTooltipPosition]=\"col.tooltipPosition || 'above'\">\n <mat-icon>{{ col.buttonConfig.icon || 'arrow_forward' }}</mat-icon>\n </a>\n } @else {\n <ccc-table-button\n [config]=\"col.buttonConfig\"\n [rowData]=\"dataItem\"\n [tooltipPosition]=\"col.tooltipPosition || 'above'\"\n [viewRoute]=\"col.buttonConfig.viewRoute || ''\"\n [id]=\"dataItem['id']\">\n </ccc-table-button>\n }\n </ng-template>\n </kendo-grid-column>\n } @else {\n @if (col.width) {\n <kendo-grid-column [field]=\"col.id\" [width]=\"col.width\" [resizable]=\"col.resizable ?? true\">\n <ng-template kendoGridHeaderTemplate>\n @if (!col.hideHeader) {\n <span class=\"col-header\">{{ col.header || col.id | camelCaseToTitle }}</span>\n }\n </ng-template>\n <ng-template kendoGridCellTemplate let-dataItem>{{ dataItem[col.id] }} </ng-template>\n </kendo-grid-column>\n } @else {\n <kendo-grid-column [field]=\"col.id\" [resizable]=\"col.resizable ?? true\">\n <ng-template kendoGridHeaderTemplate>\n @if (!col.hideHeader) {\n <span class=\"col-header\">{{ col.header || col.id | camelCaseToTitle }}</span>\n }\n </ng-template>\n <ng-template kendoGridCellTemplate let-dataItem>{{ dataItem[col.id] }} </ng-template>\n </kendo-grid-column>\n }\n }\n }\n @if (enableRowExpansion() && detailTemplate()) {\n <ng-template kendoGridDetailTemplate let-dataItem>\n <ng-container *ngTemplateOutlet=\"detailTemplate()!; context: { $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n <ng-template kendoGridNoRecordsTemplate>\n <div style=\"text-align: center; padding: 20px;\">No records found</div>\n </ng-template>\n </kendo-grid>\n `,\n styles: [\n `\n :host {\n display: block;\n height: 100%;\n }\n kendo-grid {\n height: 100%;\n }\n .col-header {\n font-weight: bold;\n }\n app-table-button {\n position: relative;\n z-index: 10;\n }\n a[mat-button] {\n position: relative;\n z-index: 11;\n }\n ::ng-deep .k-grid .k-grid-aria-root {\n overflow-x: auto; /* Allow horizontal scrolling */\n overflow-y: hidden; /* Keep vertical behavior as needed */\n }\n ::ng-deep .k-grid .k-detail-cell {\n padding: 16px;\n }\n `,\n ],\n})\nexport class AppGridComponent {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n rowData = input<any[]>([]);\n columnDefs = input<ColumnConfig[]>([]);\n enableRowExpansion = input<boolean>(false);\n detailTemplate = input<TemplateRef<unknown>>();\n selectionType = input<'multiple' | 'single' | 'none'>('none');\n selectedRows = output<RecordData[]>();\n\n public selectedKeys: number[] = [];\n\n onSelectedKeysChange(keys: number[]): void {\n this.selectedKeys = keys;\n const selectedRows = this.rowData().filter((row: any) => keys.includes(row.id));\n this.selectedRows.emit(selectedRows);\n }\n\n selectionMode = computed(() => {\n if (this.selectionType() === 'none') {\n return false;\n } else if (this.selectionType() === 'single') {\n return {\n mode: 'single' as SelectableMode,\n checkboxOnly: true,\n } as SelectableSettings;\n } else {\n return {\n mode: 'multiple' as SelectableMode,\n checkboxOnly: true,\n } as SelectableSettings;\n }\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;;MAca,oBAAoB,CAAA;AAC/B,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,mDAAsB;AAE7C,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,oDAAK;AAC7B,IAAA,eAAe,GAAG,KAAK,CAAkB,OAA0B,6DAAC;AACpE,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,mDAAC;AACzB,IAAA,QAAQ,GAAG,MAAM,CAAU,KAAK,sDAAC;AACjC,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,uDAAC;AAC7B,IAAA,EAAE,GAAG,KAAK,CAAS,EAAE,gDAAC;AAEtB,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAK;AACnB,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE;AAClC,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE;AAEpB,QAAA,IAAI,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE;AACrB,YAAA,OAAO,EAAE;QACX;QAEA,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,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,EACR,IAAI,EAAA,OAAA,EACP;wBACP,UAAU;wBACV,YAAY;wBACZ,oBAAoB;wBACpB,oBAAoB;wBACpB,YAAY;wBACZ,aAAa;wBACb,aAAa;wBACb,gBAAgB;qBACjB,EAAA,QAAA,EACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ET,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,oSAAA,CAAA,EAAA;;;ACnGH;;AAEG;;;;"}
1
+ {"version":3,"file":"cccteam-ccc-lib-ccc-grid.mjs","sources":["../../../projects/ccc-lib/ccc-grid/table-button/table-button.component.ts","../../../projects/ccc-lib/ccc-grid/table-button/table-button.component.html","../../../projects/ccc-lib/ccc-grid/ccc-grid.component.ts","../../../projects/ccc-lib/ccc-grid/cccteam-ccc-lib-ccc-grid.ts"],"sourcesContent":["import { Component, computed, input, signal } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule, TooltipPosition } from '@angular/material/tooltip';\nimport { RouterModule } from '@angular/router';\nimport { ActionButtonConfig } from '@cccteam/ccc-lib/types';\n\n@Component({\n selector: 'ccc-table-button',\n standalone: true,\n imports: [MatButtonModule, MatIconModule, MatTooltipModule, RouterModule],\n templateUrl: './table-button.component.html',\n styleUrl: './table-button.component.scss',\n})\nexport class TableButtonComponent<T> {\n config = input.required<ActionButtonConfig>();\n\n rowData = input.required<T>();\n tooltipPosition = input<TooltipPosition>('above' as TooltipPosition);\n color = input<string>('');\n disabled = signal<boolean>(false);\n viewRoute = input<string>('');\n id = input<string>('');\n\n link = computed(() => {\n const viewRoute = this.viewRoute();\n const id = this.id();\n\n if (!viewRoute || !id) {\n return '';\n }\n\n if (!viewRoute.startsWith('/')) {\n return `${viewRoute}/${id}`;\n }\n\n return `${viewRoute}/${id}`;\n });\n\n callAction(): void {\n const rowData = this.rowData();\n const action = this.config().action;\n if (rowData && action !== undefined) {\n const id = 'id' as keyof T;\n const idVal = rowData[id] as string;\n action({ id: idVal });\n }\n }\n}\n","<span\n [matTooltip]=\"disabled() ? config().disabledLabel : config().label\"\n [matTooltipPosition]=\"tooltipPosition()\"\n class=\"parent\">\n @if (config().actionType === 'link') {\n <a [routerLink]=\"viewRoute()\">\n <button mat-icon-button [disabled]=\"disabled()\" [color]=\"config().color\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n </a>\n } @else if (config().actionType === 'function') {\n <button mat-icon-button (click)=\"callAction()\" [disabled]=\"disabled()\" [color]=\"color()\">\n <mat-icon>{{ config().icon }}</mat-icon>\n </button>\n }\n</span>\n","import { CommonModule } from '@angular/common';\nimport { Component, computed, input, output, TemplateRef } from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { RouterModule } from '@angular/router';\nimport { CamelCaseToTitlePipe } from '@cccteam/ccc-lib/ccc-camel-case-to-title';\nimport { ColumnConfig, RecordData } from '@cccteam/ccc-lib/types';\nimport { GridModule, SelectableMode, SelectableSettings } from '@progress/kendo-angular-grid';\nimport { TableButtonComponent } from './table-button/table-button.component';\n\n@Component({\n selector: 'ccc-grid',\n standalone: true,\n imports: [\n GridModule,\n CommonModule,\n TableButtonComponent,\n CamelCaseToTitlePipe,\n RouterModule,\n MatIconButton,\n MatIconModule,\n MatTooltipModule,\n ],\n template: `\n <kendo-grid\n [data]=\"rowData()\"\n filterable=\"menu\"\n [sortable]=\"true\"\n scrollable=\"none\"\n [selectable]=\"selectionMode()\"\n [selectedKeys]=\"selectedKeys\"\n kendoGridSelectBy=\"id\"\n (selectedKeysChange)=\"onSelectedKeysChange($event)\">\n @if (selectionMode() !== false) {\n <kendo-grid-checkbox-column\n [width]=\"40\"\n [showSelectAll]=\"selectionType() === 'multiple'\"></kendo-grid-checkbox-column>\n }\n @for (col of columnDefs(); track col.id + col.header) {\n @if (col.buttonConfig) {\n <kendo-grid-column\n [field]=\"col.id\"\n [filterable]=\"false\"\n [sortable]=\"false\"\n [width]=\"66\"\n [resizable]=\"col.resizable ?? true\">\n <ng-template kendoGridHeaderTemplate> </ng-template>\n <ng-template kendoGridCellTemplate let-dataItem>\n @if (col.buttonConfig.actionType === 'link' && col.buttonConfig.viewRoute) {\n <a\n mat-icon-button\n [routerLink]=\"['/', col.buttonConfig.viewRoute, dataItem['id']]\"\n [matTooltip]=\"col.buttonConfig.label || ''\"\n [matTooltipPosition]=\"col.tooltipPosition || 'above'\">\n <mat-icon>{{ col.buttonConfig.icon || 'arrow_forward' }}</mat-icon>\n </a>\n } @else {\n <ccc-table-button\n [config]=\"col.buttonConfig\"\n [rowData]=\"dataItem\"\n [tooltipPosition]=\"col.tooltipPosition || 'above'\"\n [viewRoute]=\"col.buttonConfig.viewRoute || ''\"\n [id]=\"dataItem['id']\">\n </ccc-table-button>\n }\n </ng-template>\n </kendo-grid-column>\n } @else {\n @if (col.width) {\n <kendo-grid-column [field]=\"col.id\" [width]=\"col.width\" [resizable]=\"col.resizable ?? true\">\n <ng-template kendoGridHeaderTemplate>\n @if (!col.hideHeader) {\n <span class=\"col-header\">{{ col.header || col.id | camelCaseToTitle }}</span>\n }\n </ng-template>\n <ng-template kendoGridCellTemplate let-dataItem>{{ dataItem[col.id] }} </ng-template>\n </kendo-grid-column>\n } @else {\n <kendo-grid-column [field]=\"col.id\" [resizable]=\"col.resizable ?? true\">\n <ng-template kendoGridHeaderTemplate>\n @if (!col.hideHeader) {\n <span class=\"col-header\">{{ col.header || col.id | camelCaseToTitle }}</span>\n }\n </ng-template>\n <ng-template kendoGridCellTemplate let-dataItem>{{ dataItem[col.id] }} </ng-template>\n </kendo-grid-column>\n }\n }\n }\n @if (enableRowExpansion() && detailTemplate()) {\n <ng-template kendoGridDetailTemplate let-dataItem>\n <ng-container *ngTemplateOutlet=\"detailTemplate()!; context: { $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n <ng-template kendoGridNoRecordsTemplate>\n <div style=\"text-align: center; padding: 20px;\">No records found</div>\n </ng-template>\n </kendo-grid>\n `,\n styles: [\n `\n :host {\n display: block;\n height: 100%;\n }\n kendo-grid {\n height: 100%;\n }\n .col-header {\n font-weight: bold;\n }\n app-table-button {\n position: relative;\n z-index: 10;\n }\n a[mat-button] {\n position: relative;\n z-index: 11;\n }\n ::ng-deep .k-grid .k-grid-aria-root {\n overflow-x: auto; /* Allow horizontal scrolling */\n overflow-y: hidden; /* Keep vertical behavior as needed */\n }\n ::ng-deep .k-grid .k-detail-cell {\n padding: 16px;\n }\n `,\n ],\n})\nexport class AppGridComponent {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n rowData = input<any[]>([]);\n columnDefs = input<ColumnConfig[]>([]);\n enableRowExpansion = input<boolean>(false);\n detailTemplate = input<TemplateRef<unknown>>();\n selectionType = input<'multiple' | 'single' | 'none'>('none');\n selectedRows = output<RecordData[]>();\n\n public selectedKeys: number[] = [];\n\n onSelectedKeysChange(keys: number[]): void {\n this.selectedKeys = keys;\n const selectedRows = this.rowData().filter((row: any) => keys.includes(row.id));\n this.selectedRows.emit(selectedRows);\n }\n\n selectionMode = computed(() => {\n if (this.selectionType() === 'none') {\n return false;\n } else if (this.selectionType() === 'single') {\n return {\n mode: 'single' as SelectableMode,\n checkboxOnly: true,\n } as SelectableSettings;\n } else {\n return {\n mode: 'multiple' as SelectableMode,\n checkboxOnly: true,\n } as SelectableSettings;\n }\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;;MAca,oBAAoB,CAAA;AAC/B,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAsB;AAE7C,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAK;AAC7B,IAAA,eAAe,GAAG,KAAK,CAAkB,OAA0B,2DAAC;AACpE,IAAA,KAAK,GAAG,KAAK,CAAS,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IAAA,EACb,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACb,gBAAgB,wTAJhB,oBAAoB,EAAA,IAAA,EAAA,kBAAA,EAAA,CAAA,EAAA,CAAA;;2FAgHX,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAvH5B,SAAS;+BACE,UAAU,EAAA,UAAA,EACR,IAAI,EAAA,OAAA,EACP;wBACP,UAAU;wBACV,YAAY;wBACZ,oBAAoB;wBACpB,oBAAoB;wBACpB,YAAY;wBACZ,aAAa;wBACb,aAAa;wBACb,gBAAgB;qBACjB,EAAA,QAAA,EACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ET,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,oSAAA,CAAA,EAAA;;;ACnGH;;AAEG;;;;"}
@@ -7,10 +7,10 @@ import { MatDialogModule, MatDialogActions } from '@angular/material/dialog';
7
7
  import { MatFormFieldModule } from '@angular/material/form-field';
8
8
 
9
9
  class LeavePageConfirmationModalComponent {
10
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: LeavePageConfirmationModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
11
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: LeavePageConfirmationModalComponent, isStandalone: true, selector: "ccc-leave-page-confirmation-modal", ngImport: i0, template: "<div mat-dialog-title>You have unsaved changes, are you sure you want to leave?</div>\n<mat-dialog-content>\n <p>Any unsaved changes will be lost.</p>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"warn\" [mat-dialog-close]=\"false\">Cancel</button>\n <button mat-raised-button color=\"accent\" [mat-dialog-close]=\"true\">Confirm</button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
10
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: LeavePageConfirmationModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
11
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: LeavePageConfirmationModalComponent, isStandalone: true, selector: "ccc-leave-page-confirmation-modal", ngImport: i0, template: "<div mat-dialog-title>You have unsaved changes, are you sure you want to leave?</div>\n<mat-dialog-content>\n <p>Any unsaved changes will be lost.</p>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"warn\" [mat-dialog-close]=\"false\">Cancel</button>\n <button mat-raised-button color=\"accent\" [mat-dialog-close]=\"true\">Confirm</button>\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
12
12
  }
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: LeavePageConfirmationModalComponent, decorators: [{
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: LeavePageConfirmationModalComponent, decorators: [{
14
14
  type: Component,
15
15
  args: [{ selector: 'ccc-leave-page-confirmation-modal', imports: [MatDialogModule, MatFormFieldModule, MatDialogActions, MatButtonModule], template: "<div mat-dialog-title>You have unsaved changes, are you sure you want to leave?</div>\n<mat-dialog-content>\n <p>Any unsaved changes will be lost.</p>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"warn\" [mat-dialog-close]=\"false\">Cancel</button>\n <button mat-raised-button color=\"accent\" [mat-dialog-close]=\"true\">Confirm</button>\n</mat-dialog-actions>\n" }]
16
16
  }] });
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { signal, computed, Injectable } from '@angular/core';
3
3
 
4
4
  class FormStateService {
5
- dirtyForms = signal(0, { ...(ngDevMode ? { debugName: "dirtyForms" } : {}) });
5
+ dirtyForms = signal(0, ...(ngDevMode ? [{ debugName: "dirtyForms" }] : []));
6
6
  incrementDirtyForms() {
7
7
  this.dirtyForms.set(this.dirtyForms() + 1);
8
8
  }
@@ -14,11 +14,11 @@ class FormStateService {
14
14
  }
15
15
  isDirty = computed(() => {
16
16
  return this.dirtyForms() > 0;
17
- }, { ...(ngDevMode ? { debugName: "isDirty" } : {}) });
18
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: FormStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
19
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: FormStateService, providedIn: 'root' });
17
+ }, ...(ngDevMode ? [{ debugName: "isDirty" }] : []));
18
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FormStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
19
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FormStateService, providedIn: 'root' });
20
20
  }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: FormStateService, decorators: [{
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FormStateService, decorators: [{
22
22
  type: Injectable,
23
23
  args: [{
24
24
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib-ccc-resource-services.mjs","sources":["../../../projects/ccc-lib/ccc-resource-services/form-state.service.ts","../../../projects/ccc-lib/ccc-resource-services/cccteam-ccc-lib-ccc-resource-services.ts"],"sourcesContent":["import { computed, Injectable, signal } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormStateService {\n dirtyForms = signal(0);\n\n incrementDirtyForms(): void {\n this.dirtyForms.set(this.dirtyForms() + 1);\n }\n\n decrementDirtyForms(): void {\n this.dirtyForms.set(this.dirtyForms() - 1);\n }\n\n resetDirtyForms(): void {\n this.dirtyForms.set(0);\n }\n\n isDirty = computed(() => {\n return this.dirtyForms() > 0;\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,gBAAgB,CAAA;AAC3B,IAAA,UAAU,GAAG,MAAM,CAAC,CAAC,wDAAC;IAEtB,mBAAmB,GAAA;AACjB,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC5C;IAEA,mBAAmB,GAAA;AACjB,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC5C;IAEA,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB;AAEA,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACtB,QAAA,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC;AAC9B,IAAA,CAAC,qDAAC;uGAjBS,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJD;;AAEG;;;;"}
1
+ {"version":3,"file":"cccteam-ccc-lib-ccc-resource-services.mjs","sources":["../../../projects/ccc-lib/ccc-resource-services/form-state.service.ts","../../../projects/ccc-lib/ccc-resource-services/cccteam-ccc-lib-ccc-resource-services.ts"],"sourcesContent":["import { computed, Injectable, signal } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormStateService {\n dirtyForms = signal(0);\n\n incrementDirtyForms(): void {\n this.dirtyForms.set(this.dirtyForms() + 1);\n }\n\n decrementDirtyForms(): void {\n this.dirtyForms.set(this.dirtyForms() - 1);\n }\n\n resetDirtyForms(): void {\n this.dirtyForms.set(0);\n }\n\n isDirty = computed(() => {\n return this.dirtyForms() > 0;\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,gBAAgB,CAAA;AAC3B,IAAA,UAAU,GAAG,MAAM,CAAC,CAAC,sDAAC;IAEtB,mBAAmB,GAAA;AACjB,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC5C;IAEA,mBAAmB,GAAA;AACjB,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC5C;IAEA,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB;AAEA,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACtB,QAAA,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC;AAC9B,IAAA,CAAC,mDAAC;uGAjBS,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJD;;AAEG;;;;"}