@masterteam/client-components 0.0.23 → 0.0.25

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.
@@ -1 +1 @@
1
- {"version":3,"file":"masterteam-client-components-escalation-runtime.mjs","sources":["../../../../packages/masterteam/client-components/escalation-runtime/escalation-runtime.service.ts","../../../../packages/masterteam/client-components/escalation-runtime/escalation-add-dialog.ts","../../../../packages/masterteam/client-components/escalation-runtime/escalation-add-dialog.html","../../../../packages/masterteam/client-components/escalation-runtime/masterteam-client-components-escalation-runtime.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { map } from 'rxjs';\r\nimport {\r\n CreateEscalationPayload,\r\n CreateEscalationResponseData,\r\n EscalationRuntimeContext,\r\n Response,\r\n} from './escalation-runtime.model';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class EscalationRuntimeService {\r\n private readonly http = inject(HttpClient);\r\n\r\n createEscalation(\r\n context: EscalationRuntimeContext,\r\n payload: CreateEscalationPayload,\r\n ) {\r\n return this.http\r\n .post<\r\n Response<CreateEscalationResponseData>\r\n >(`levels/${context.levelId}/${context.levelDataId}/escalations`, payload)\r\n .pipe(map((response) => response.data));\r\n }\r\n}\r\n","import {\r\n Component,\r\n DestroyRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\r\nimport {\r\n DateFieldConfig,\r\n DynamicFormConfig,\r\n TextFieldConfig,\r\n TextareaFieldConfig,\r\n UploadFileFieldConfig,\r\n ValidatorConfig,\r\n} from '@masterteam/components';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { ModalRef } from '@masterteam/components/dialog';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { DynamicForm } from '@masterteam/forms/dynamic-form';\r\nimport { finalize } from 'rxjs';\r\nimport { EscalationRuntimeService } from './escalation-runtime.service';\r\nimport {\r\n CreateEscalationPayload,\r\n EscalationCreateResult,\r\n EscalationRuntimeContext,\r\n} from './escalation-runtime.model';\r\n\r\ninterface EscalationAddFormValue {\r\n startDate: Date;\r\n escalatedBy: string;\r\n reason: string;\r\n attachments: EscalationAttachmentValue | null;\r\n}\r\n\r\ninterface EscalationAttachmentValue {\r\n fileName?: string | null;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-escalation-add-dialog',\r\n standalone: true,\r\n imports: [Button, DynamicForm, ReactiveFormsModule],\r\n templateUrl: './escalation-add-dialog.html',\r\n})\r\nexport default class EscalationAddDialog {\r\n readonly modal = inject(ModalService);\r\n readonly ref = inject(ModalRef);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly escalationRuntimeService = inject(EscalationRuntimeService);\r\n private readonly startedAt = new Date();\r\n\r\n readonly context = input.required<EscalationRuntimeContext>();\r\n readonly currentUserDisplayName = input('Current User');\r\n readonly escalationFormControl = new FormControl<EscalationAddFormValue>(\r\n {\r\n startDate: this.startedAt,\r\n escalatedBy: '',\r\n reason: '',\r\n attachments: null,\r\n },\r\n { nonNullable: true },\r\n );\r\n\r\n readonly resolvedCurrentUserDisplayName = computed(\r\n () => this.currentUserDisplayName().trim() || 'Current User',\r\n );\r\n readonly isSubmitting = signal(false);\r\n readonly submitError = signal<string | null>(null);\r\n readonly dynamicFormConfig = computed<DynamicFormConfig>(() => ({\r\n sections: [\r\n {\r\n key: 'escalation-runtime',\r\n type: 'header',\r\n label: '',\r\n fields: [\r\n new TextFieldConfig({\r\n key: 'escalatedBy',\r\n label: 'Escalated By',\r\n disabled: true,\r\n colSpan: 12,\r\n order: 1,\r\n }),\r\n new DateFieldConfig({\r\n key: 'startDate',\r\n label: 'Start Date',\r\n disabled: true,\r\n showIcon: true,\r\n colSpan: 6,\r\n order: 2,\r\n }),\r\n new TextareaFieldConfig({\r\n key: 'reason',\r\n label: 'Reason',\r\n placeholder: 'Describe the escalation reason',\r\n validators: [ValidatorConfig.required()],\r\n rows: 3,\r\n autoResize: true,\r\n colSpan: 12,\r\n order: 3,\r\n }),\r\n new UploadFileFieldConfig({\r\n key: 'attachments',\r\n label: 'Attachments',\r\n title: 'Attachments',\r\n description: 'Upload supporting files',\r\n shape: 'card',\r\n colSpan: 12,\r\n order: 4,\r\n }),\r\n ],\r\n },\r\n ],\r\n }));\r\n\r\n constructor() {\r\n effect(() => {\r\n this.escalationFormControl.setValue(\r\n {\r\n ...this.escalationFormControl.getRawValue(),\r\n startDate: this.startedAt,\r\n escalatedBy: this.resolvedCurrentUserDisplayName(),\r\n },\r\n { emitEvent: false },\r\n );\r\n });\r\n }\r\n\r\n createEscalation(): void {\r\n if (this.isSubmitting()) {\r\n return;\r\n }\r\n\r\n this.submitError.set(null);\r\n\r\n if (this.escalationFormControl.invalid) {\r\n this.escalationFormControl.markAllAsTouched();\r\n return;\r\n }\r\n\r\n const payload = this.buildPayload();\r\n if (!payload.reason) {\r\n this.submitError.set('Reason is required.');\r\n this.escalationFormControl.markAllAsTouched();\r\n return;\r\n }\r\n\r\n this.isSubmitting.set(true);\r\n\r\n this.escalationRuntimeService\r\n .createEscalation(this.context(), payload)\r\n .pipe(\r\n finalize(() => this.isSubmitting.set(false)),\r\n takeUntilDestroyed(this.destroyRef),\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n const result: EscalationCreateResult = {\r\n instanceId: response.instanceId,\r\n moduleDataId: payload.moduleDataId,\r\n };\r\n this.ref.close(result);\r\n },\r\n error: (error) => {\r\n this.submitError.set(\r\n error?.error?.message ?? 'Failed to create escalation.',\r\n );\r\n },\r\n });\r\n }\r\n\r\n close(): void {\r\n if (this.isSubmitting()) {\r\n return;\r\n }\r\n\r\n this.ref.close();\r\n }\r\n\r\n private buildPayload(): CreateEscalationPayload {\r\n const formValue = this.escalationFormControl.getRawValue();\r\n\r\n return {\r\n moduleDataId: this.context().moduleDataId,\r\n reason: formValue.reason.trim(),\r\n notes: '',\r\n attachments: formValue.attachments?.fileName\r\n ? [formValue.attachments.fileName]\r\n : [],\r\n };\r\n }\r\n}\r\n","<div [class]=\"modal.contentClass + ' p-4 flex flex-col gap-4'\">\r\n <form class=\"col-span-1\">\r\n <mt-dynamic-form\r\n [formConfig]=\"dynamicFormConfig()\"\r\n [formControl]=\"escalationFormControl\"\r\n />\r\n </form>\r\n\r\n @if (submitError(); as errorMessage) {\r\n <div\r\n class=\"rounded-xl border border-red-200 bg-red-50 p-4 text-sm text-red-700\"\r\n role=\"alert\"\r\n >\r\n {{ errorMessage }}\r\n </div>\r\n }\r\n</div>\r\n\r\n<div [class]=\"modal.footerClass + ' flex items-center justify-end gap-2'\">\r\n <mt-button\r\n label=\"Cancel\"\r\n severity=\"secondary\"\r\n [disabled]=\"isSubmitting()\"\r\n (onClick)=\"close()\"\r\n />\r\n\r\n <mt-button\r\n label=\"Escalation Up\"\r\n [loading]=\"isSubmitting()\"\r\n [disabled]=\"isSubmitting() || !escalationFormControl.valid\"\r\n (onClick)=\"createEscalation()\"\r\n />\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAaa,wBAAwB,CAAA;AAClB,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IAE1C,gBAAgB,CACd,OAAiC,EACjC,OAAgC,EAAA;QAEhC,OAAO,IAAI,CAAC;AACT,aAAA,IAAI,CAEH,CAAA,OAAA,EAAU,OAAO,CAAC,OAAO,CAAA,CAAA,EAAI,OAAO,CAAC,WAAW,CAAA,YAAA,CAAc,EAAE,OAAO;AACxE,aAAA,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C;uGAZW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAxB,IAAA,OAAA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A,EAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,SAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,WAAW,oMAAE,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,sGAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAG/B,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBANvC,SAAS;+BACE,0BAA0B,EAAA,UAAA,EACxB,IAAI,EAAA,OAAA,EACP,CAAC,MAAM,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,+5BAAA,EAAA;;;AE7CrD;;AAEG;;;;"}
1
+ {"version":3,"file":"masterteam-client-components-escalation-runtime.mjs","sources":["../../../../packages/masterteam/client-components/escalation-runtime/escalation-runtime.service.ts","../../../../packages/masterteam/client-components/escalation-runtime/escalation-add-dialog.ts","../../../../packages/masterteam/client-components/escalation-runtime/escalation-add-dialog.html","../../../../packages/masterteam/client-components/escalation-runtime/masterteam-client-components-escalation-runtime.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { map } from 'rxjs';\r\nimport {\r\n CreateEscalationPayload,\r\n CreateEscalationResponseData,\r\n EscalationRuntimeContext,\r\n Response,\r\n} from './escalation-runtime.model';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class EscalationRuntimeService {\r\n private readonly http = inject(HttpClient);\r\n\r\n createEscalation(\r\n context: EscalationRuntimeContext,\r\n payload: CreateEscalationPayload,\r\n ) {\r\n return this.http\r\n .post<\r\n Response<CreateEscalationResponseData>\r\n >(`levels/${context.levelId}/${context.levelDataId}/escalations`, payload)\r\n .pipe(map((response) => response.data));\r\n }\r\n}\r\n","import {\r\n Component,\r\n DestroyRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\r\nimport {\r\n DateFieldConfig,\r\n DynamicFormConfig,\r\n TextFieldConfig,\r\n TextareaFieldConfig,\r\n UploadFileFieldConfig,\r\n ValidatorConfig,\r\n} from '@masterteam/components';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { ModalRef } from '@masterteam/components/dialog';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { DynamicForm } from '@masterteam/forms/dynamic-form';\r\nimport { finalize } from 'rxjs';\r\nimport { EscalationRuntimeService } from './escalation-runtime.service';\r\nimport {\r\n CreateEscalationPayload,\r\n EscalationCreateResult,\r\n EscalationRuntimeContext,\r\n} from './escalation-runtime.model';\r\n\r\ninterface EscalationAddFormValue {\r\n startDate: Date;\r\n escalatedBy: string;\r\n reason: string;\r\n attachments: EscalationAttachmentValue | null;\r\n}\r\n\r\ninterface EscalationAttachmentValue {\r\n fileName?: string | null;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-escalation-add-dialog',\r\n standalone: true,\r\n imports: [Button, DynamicForm, ReactiveFormsModule],\r\n templateUrl: './escalation-add-dialog.html',\r\n})\r\nexport default class EscalationAddDialog {\r\n readonly modal = inject(ModalService);\r\n readonly ref = inject(ModalRef);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly escalationRuntimeService = inject(EscalationRuntimeService);\r\n private readonly startedAt = new Date();\r\n\r\n readonly context = input.required<EscalationRuntimeContext>();\r\n readonly currentUserDisplayName = input('Current User');\r\n readonly escalationFormControl = new FormControl<EscalationAddFormValue>(\r\n {\r\n startDate: this.startedAt,\r\n escalatedBy: '',\r\n reason: '',\r\n attachments: null,\r\n },\r\n { nonNullable: true },\r\n );\r\n\r\n readonly resolvedCurrentUserDisplayName = computed(\r\n () => this.currentUserDisplayName().trim() || 'Current User',\r\n );\r\n readonly isSubmitting = signal(false);\r\n readonly submitError = signal<string | null>(null);\r\n readonly dynamicFormConfig = computed<DynamicFormConfig>(() => ({\r\n sections: [\r\n {\r\n key: 'escalation-runtime',\r\n type: 'header',\r\n label: '',\r\n fields: [\r\n new TextFieldConfig({\r\n key: 'escalatedBy',\r\n label: 'Escalated By',\r\n disabled: true,\r\n colSpan: 12,\r\n order: 1,\r\n }),\r\n new DateFieldConfig({\r\n key: 'startDate',\r\n label: 'Start Date',\r\n disabled: true,\r\n showIcon: true,\r\n colSpan: 6,\r\n order: 2,\r\n }),\r\n new TextareaFieldConfig({\r\n key: 'reason',\r\n label: 'Reason',\r\n placeholder: 'Describe the escalation reason',\r\n validators: [ValidatorConfig.required()],\r\n rows: 3,\r\n autoResize: true,\r\n colSpan: 12,\r\n order: 3,\r\n }),\r\n new UploadFileFieldConfig({\r\n key: 'attachments',\r\n label: 'Attachments',\r\n title: 'Attachments',\r\n description: 'Upload supporting files',\r\n shape: 'card',\r\n colSpan: 12,\r\n order: 4,\r\n }),\r\n ],\r\n },\r\n ],\r\n }));\r\n\r\n constructor() {\r\n effect(() => {\r\n this.escalationFormControl.setValue(\r\n {\r\n ...this.escalationFormControl.getRawValue(),\r\n startDate: this.startedAt,\r\n escalatedBy: this.resolvedCurrentUserDisplayName(),\r\n },\r\n { emitEvent: false },\r\n );\r\n });\r\n }\r\n\r\n createEscalation(): void {\r\n if (this.isSubmitting()) {\r\n return;\r\n }\r\n\r\n this.submitError.set(null);\r\n\r\n if (this.escalationFormControl.invalid) {\r\n this.escalationFormControl.markAllAsTouched();\r\n return;\r\n }\r\n\r\n const payload = this.buildPayload();\r\n if (!payload.reason) {\r\n this.submitError.set('Reason is required.');\r\n this.escalationFormControl.markAllAsTouched();\r\n return;\r\n }\r\n\r\n this.isSubmitting.set(true);\r\n\r\n this.escalationRuntimeService\r\n .createEscalation(this.context(), payload)\r\n .pipe(\r\n finalize(() => this.isSubmitting.set(false)),\r\n takeUntilDestroyed(this.destroyRef),\r\n )\r\n .subscribe({\r\n next: (response) => {\r\n const result: EscalationCreateResult = {\r\n instanceId: response.instanceId,\r\n moduleDataId: payload.moduleDataId,\r\n };\r\n this.ref.close(result);\r\n },\r\n error: (error) => {\r\n this.submitError.set(\r\n error?.error?.message ?? 'Failed to create escalation.',\r\n );\r\n },\r\n });\r\n }\r\n\r\n close(): void {\r\n if (this.isSubmitting()) {\r\n return;\r\n }\r\n\r\n this.ref.close();\r\n }\r\n\r\n private buildPayload(): CreateEscalationPayload {\r\n const formValue = this.escalationFormControl.getRawValue();\r\n\r\n return {\r\n moduleDataId: this.context().moduleDataId,\r\n reason: formValue.reason.trim(),\r\n notes: '',\r\n attachments: formValue.attachments?.fileName\r\n ? [formValue.attachments.fileName]\r\n : [],\r\n };\r\n }\r\n}\r\n","<div [class]=\"modal.contentClass + ' p-4 flex flex-col gap-4'\">\r\n <form class=\"col-span-1\">\r\n <mt-dynamic-form\r\n [formConfig]=\"dynamicFormConfig()\"\r\n [formControl]=\"escalationFormControl\"\r\n />\r\n </form>\r\n\r\n @if (submitError(); as errorMessage) {\r\n <div\r\n class=\"rounded-xl border border-red-200 bg-red-50 p-4 text-sm text-red-700\"\r\n role=\"alert\"\r\n >\r\n {{ errorMessage }}\r\n </div>\r\n }\r\n</div>\r\n\r\n<div [class]=\"modal.footerClass + ' flex items-center justify-end gap-2'\">\r\n <mt-button\r\n label=\"Cancel\"\r\n severity=\"secondary\"\r\n [disabled]=\"isSubmitting()\"\r\n (onClick)=\"close()\"\r\n />\r\n\r\n <mt-button\r\n label=\"Escalation Up\"\r\n [loading]=\"isSubmitting()\"\r\n [disabled]=\"isSubmitting() || !escalationFormControl.valid\"\r\n (onClick)=\"createEscalation()\"\r\n />\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAaa,wBAAwB,CAAA;AAClB,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IAE1C,gBAAgB,CACd,OAAiC,EACjC,OAAgC,EAAA;QAEhC,OAAO,IAAI,CAAC;AACT,aAAA,IAAI,CAEH,CAAA,OAAA,EAAU,OAAO,CAAC,OAAO,CAAA,CAAA,EAAI,OAAO,CAAC,WAAW,CAAA,YAAA,CAAc,EAAE,OAAO;AACxE,aAAA,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C;uGAZW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA;;2FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACoCa,MAAO,mBAAmB,CAAA;AAC7B,IAA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AAA,EAAA,QAAA,EAAA,8CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,sGAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAG/B,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBANvC,SAAS;+BACE,0BAA0B,EAAA,UAAA,EACxB,IAAI,EAAA,OAAA,EACP,CAAC,MAAM,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,+5BAAA,EAAA;;;AE7CrD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@masterteam/client-components",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/client-components",
6
6
  "linkDirectory": true,
7
7
  "access": "public"
8
8
  },
9
9
  "peerDependencies": {
10
- "@angular/common": "^21.0.3",
11
- "@angular/core": "^21.0.3",
12
- "@angular/forms": "^21.0.3",
13
- "@tailwindcss/postcss": "^4.1.17",
14
- "postcss": "^8.5.6",
15
- "primeng": "21.0.1",
10
+ "@angular/common": "^21.2.8",
11
+ "@angular/core": "^21.2.8",
12
+ "@angular/forms": "^21.2.8",
13
+ "@tailwindcss/postcss": "^4.2.2",
14
+ "postcss": "^8.5.9",
15
+ "primeng": "21.1.5",
16
16
  "rxjs": "^7.8.2",
17
- "tailwindcss": "^4.1.17",
17
+ "tailwindcss": "^4.2.2",
18
18
  "tailwindcss-primeui": "^0.6.1",
19
- "@masterteam/forms": "^0.0.63",
20
- "@masterteam/components": "^0.0.135",
21
- "@masterteam/dashboard-builder": "^0.0.16"
19
+ "@masterteam/dashboard-builder": "^0.0.18",
20
+ "@masterteam/components": "^0.0.141",
21
+ "@masterteam/forms": "^0.0.65"
22
22
  },
23
23
  "dependencies": {
24
24
  "tslib": "^2.8.1"
@@ -49,5 +49,6 @@
49
49
  }
50
50
  },
51
51
  "module": "fesm2022/masterteam-client-components.mjs",
52
- "typings": "types/masterteam-client-components.d.ts"
52
+ "typings": "types/masterteam-client-components.d.ts",
53
+ "type": "module"
53
54
  }
@@ -217,7 +217,7 @@ interface ClientListInformativeChartLink {
217
217
  interface ClientListInformativeDashboardPayload {
218
218
  moduleId: number;
219
219
  ignoreQueryFilter: boolean;
220
- filters: Record<string, any>;
220
+ filters: Record<string, any> | any[];
221
221
  extraInfo: Record<string, any>;
222
222
  versionNumber: number;
223
223
  chartLinks: ClientListInformativeChartLink[];