@masterteam/components 0.0.117 → 0.0.119

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 (29) hide show
  1. package/assets/common.css +2 -172
  2. package/fesm2022/masterteam-components-entities.mjs +5 -4
  3. package/fesm2022/masterteam-components-entities.mjs.map +1 -1
  4. package/fesm2022/masterteam-components-sidebar.mjs +36 -0
  5. package/fesm2022/masterteam-components-sidebar.mjs.map +1 -0
  6. package/fesm2022/masterteam-components-slider-field.mjs +104 -0
  7. package/fesm2022/masterteam-components-slider-field.mjs.map +1 -0
  8. package/fesm2022/masterteam-components-statistic-card.mjs +22 -0
  9. package/fesm2022/masterteam-components-statistic-card.mjs.map +1 -0
  10. package/fesm2022/masterteam-components-table.mjs +30 -7
  11. package/fesm2022/masterteam-components-table.mjs.map +1 -1
  12. package/fesm2022/masterteam-components-textarea-field.mjs +92 -0
  13. package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -0
  14. package/fesm2022/masterteam-components-toast.mjs +75 -0
  15. package/fesm2022/masterteam-components-toast.mjs.map +1 -0
  16. package/fesm2022/masterteam-components-topbar.mjs +28 -0
  17. package/fesm2022/masterteam-components-topbar.mjs.map +1 -0
  18. package/fesm2022/masterteam-components-tree.mjs +219 -0
  19. package/fesm2022/masterteam-components-tree.mjs.map +1 -0
  20. package/package.json +16 -16
  21. package/types/masterteam-components-entities.d.ts +1 -1
  22. package/types/masterteam-components-sidebar.d.ts +28 -0
  23. package/types/masterteam-components-slider-field.d.ts +45 -0
  24. package/types/masterteam-components-statistic-card.d.ts +18 -0
  25. package/types/masterteam-components-table.d.ts +1 -0
  26. package/types/masterteam-components-textarea-field.d.ts +38 -0
  27. package/types/masterteam-components-toast.d.ts +26 -0
  28. package/types/masterteam-components-topbar.d.ts +17 -0
  29. package/types/masterteam-components-tree.d.ts +98 -0
@@ -0,0 +1,104 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, numberAttribute, booleanAttribute, EventEmitter, signal, computed, inject, effect, HostBinding, Output, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { Validators, NgControl, FormsModule } from '@angular/forms';
5
+ import * as i2 from 'primeng/slider';
6
+ import { SliderModule } from 'primeng/slider';
7
+ import { FieldValidation } from '@masterteam/components/field-validation';
8
+ import { isInvalid } from '@masterteam/components';
9
+
10
+ class SliderField {
11
+ input;
12
+ field = input(true, ...(ngDevMode ? [{ debugName: "field" }] : []));
13
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
14
+ animate = input(false, ...(ngDevMode ? [{ debugName: "animate" }] : []));
15
+ class = input('', ...(ngDevMode ? [{ debugName: "class" }] : []));
16
+ min = input(0, { ...(ngDevMode ? { debugName: "min" } : {}), transform: numberAttribute });
17
+ max = input(100, { ...(ngDevMode ? { debugName: "max" } : {}), transform: numberAttribute });
18
+ step = input(undefined, { ...(ngDevMode ? { debugName: "step" } : {}), transform: numberAttribute });
19
+ hideNumber = input(false, { ...(ngDevMode ? { debugName: "hideNumber" } : {}), transform: booleanAttribute });
20
+ unit = input('%', ...(ngDevMode ? [{ debugName: "unit" }] : []));
21
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
22
+ pInputs = input(...(ngDevMode ? [undefined, { debugName: "pInputs" }] : []));
23
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
24
+ onChange = new EventEmitter();
25
+ onSlideEnd = new EventEmitter();
26
+ styleClass;
27
+ requiredValidator = Validators.required;
28
+ value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
29
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
30
+ displayValue = computed(() => {
31
+ const value = this.value();
32
+ if (value === null || value === undefined) {
33
+ return '-';
34
+ }
35
+ return `${value}${this.unit()}`;
36
+ }, ...(ngDevMode ? [{ debugName: "displayValue" }] : []));
37
+ onTouched = () => { };
38
+ onModelChange = () => { };
39
+ ngControl = inject(NgControl, { self: true });
40
+ isInvalid = isInvalid;
41
+ constructor() {
42
+ if (this.ngControl) {
43
+ this.ngControl.valueAccessor = this;
44
+ }
45
+ effect(() => {
46
+ if (this.ngControl.control && this.required()) {
47
+ this.ngControl.control.addValidators(Validators.required);
48
+ this.ngControl.control.updateValueAndValidity();
49
+ }
50
+ });
51
+ }
52
+ applyInputsToInput() {
53
+ Object.assign(this.input, this.pInputs());
54
+ }
55
+ ngOnInit() {
56
+ this.styleClass = this.class();
57
+ }
58
+ onValueChange(value) {
59
+ this.onModelChange(value);
60
+ this.value.set(value);
61
+ }
62
+ ngOnChanges(changes) {
63
+ if (changes['pInputs']) {
64
+ this.applyInputsToInput();
65
+ }
66
+ }
67
+ writeValue(value) {
68
+ this.value.set(value);
69
+ }
70
+ registerOnChange(fn) {
71
+ this.onModelChange = fn;
72
+ }
73
+ registerOnTouched(fn) {
74
+ this.onTouched = fn;
75
+ }
76
+ setDisabledState(disabled) {
77
+ this.disabled.set(disabled);
78
+ }
79
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SliderField, deps: [], target: i0.ɵɵFactoryTarget.Component });
80
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: SliderField, isStandalone: true, selector: "mt-slider-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hideNumber: { classPropertyName: "hideNumber", publicName: "hideNumber", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, pInputs: { classPropertyName: "pInputs", publicName: "pInputs", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onChange: "onChange", onSlideEnd: "onSlideEnd" }, host: { properties: { "class": "this.styleClass" }, classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "@if (label() || !hideNumber()) {\r\n <div class=\"flex items-end justify-between gap-3\">\r\n @if (label()) {\r\n <label\r\n class=\"leading-none\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (!hideNumber()) {\r\n <span\r\n class=\"min-w-12 text-right text-sm font-medium leading-none text-muted-color tabular-nums\"\r\n >\r\n {{ displayValue() }}\r\n </span>\r\n }\r\n </div>\r\n}\r\n<div class=\"w-full my-2\">\r\n <p-slider\r\n #input\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onChange)=\"onChange.emit($event)\"\r\n (onSlideEnd)=\"onTouched(); onSlideEnd.emit($event)\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [animate]=\"animate()\"\r\n [id]=\"ngControl?.name || label()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n class=\"block w-full\"\r\n ></p-slider>\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: [":host{--p-slider-track-size: .75rem}:host ::ng-deep .p-slider{background:var(--p-surface-200);border-radius:9999px}:host ::ng-deep .p-slider.p-slider-horizontal{height:var(--p-slider-track-size)}:host ::ng-deep .p-slider-range{border-radius:inherit}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: SliderModule }, { kind: "component", type: i2.Slider, selector: "p-slider", inputs: ["animate", "min", "max", "orientation", "step", "range", "styleClass", "ariaLabel", "ariaLabelledBy", "tabindex", "autofocus"], outputs: ["onChange", "onSlideEnd"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
81
+ }
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SliderField, decorators: [{
83
+ type: Component,
84
+ args: [{ selector: 'mt-slider-field', standalone: true, imports: [FormsModule, SliderModule, FieldValidation], changeDetection: ChangeDetectionStrategy.OnPush, host: {
85
+ class: 'grid gap-1',
86
+ }, template: "@if (label() || !hideNumber()) {\r\n <div class=\"flex items-end justify-between gap-3\">\r\n @if (label()) {\r\n <label\r\n class=\"leading-none\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (!hideNumber()) {\r\n <span\r\n class=\"min-w-12 text-right text-sm font-medium leading-none text-muted-color tabular-nums\"\r\n >\r\n {{ displayValue() }}\r\n </span>\r\n }\r\n </div>\r\n}\r\n<div class=\"w-full my-2\">\r\n <p-slider\r\n #input\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onChange)=\"onChange.emit($event)\"\r\n (onSlideEnd)=\"onTouched(); onSlideEnd.emit($event)\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [animate]=\"animate()\"\r\n [id]=\"ngControl?.name || label()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n class=\"block w-full\"\r\n ></p-slider>\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: [":host{--p-slider-track-size: .75rem}:host ::ng-deep .p-slider{background:var(--p-surface-200);border-radius:9999px}:host ::ng-deep .p-slider.p-slider-horizontal{height:var(--p-slider-track-size)}:host ::ng-deep .p-slider-range{border-radius:inherit}\n"] }]
87
+ }], ctorParameters: () => [], propDecorators: { input: [{
88
+ type: ViewChild,
89
+ args: ['input', { static: true }]
90
+ }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], animate: [{ type: i0.Input, args: [{ isSignal: true, alias: "animate", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], hideNumber: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideNumber", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], pInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "pInputs", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], onChange: [{
91
+ type: Output
92
+ }], onSlideEnd: [{
93
+ type: Output
94
+ }], styleClass: [{
95
+ type: HostBinding,
96
+ args: ['class']
97
+ }] } });
98
+
99
+ /**
100
+ * Generated bundle index. Do not edit.
101
+ */
102
+
103
+ export { SliderField };
104
+ //# sourceMappingURL=masterteam-components-slider-field.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"masterteam-components-slider-field.mjs","sources":["../../../../packages/masterteam/components/slider-field/slider-field.ts","../../../../packages/masterteam/components/slider-field/slider-field.html","../../../../packages/masterteam/components/slider-field/masterteam-components-slider-field.ts"],"sourcesContent":["import {\r\n Component,\r\n EventEmitter,\r\n HostBinding,\r\n Output,\r\n SimpleChanges,\r\n ViewChild,\r\n booleanAttribute,\r\n computed,\r\n input,\r\n numberAttribute,\r\n signal,\r\n OnInit,\r\n OnChanges,\r\n inject,\r\n ChangeDetectionStrategy,\r\n effect,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport {\r\n Slider,\r\n SliderChangeEvent,\r\n SliderSlideEndEvent,\r\n SliderModule,\r\n} from 'primeng/slider';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid } from '@masterteam/components';\r\n\r\n@Component({\r\n selector: 'mt-slider-field',\r\n standalone: true,\r\n imports: [FormsModule, SliderModule, FieldValidation],\r\n templateUrl: './slider-field.html',\r\n styleUrls: ['./slider-field.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'grid gap-1',\r\n },\r\n})\r\nexport class SliderField implements ControlValueAccessor, OnInit, OnChanges {\r\n @ViewChild('input', { static: true })\r\n input: Slider;\r\n\r\n readonly field = input<boolean>(true);\r\n readonly label = input<string>();\r\n readonly animate = input<boolean>(false);\r\n readonly class = input<string>('');\r\n readonly min = input<number, unknown>(0, { transform: numberAttribute });\r\n readonly max = input<number, unknown>(100, { transform: numberAttribute });\r\n readonly step = input<number, unknown>(undefined, {\r\n transform: numberAttribute,\r\n });\r\n readonly hideNumber = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n readonly unit = input<string>('%');\r\n readonly readonly = input<boolean>(false);\r\n readonly pInputs = input<Partial<Slider>>();\r\n readonly required = input<boolean>(false);\r\n\r\n @Output() onChange: EventEmitter<SliderChangeEvent> = new EventEmitter();\r\n @Output() onSlideEnd: EventEmitter<SliderSlideEndEvent> = new EventEmitter();\r\n\r\n @HostBinding('class') styleClass: string;\r\n\r\n requiredValidator = Validators.required;\r\n value = signal<number | null>(null);\r\n disabled = signal<boolean>(false);\r\n displayValue = computed(() => {\r\n const value = this.value();\r\n if (value === null || value === undefined) {\r\n return '-';\r\n }\r\n return `${value}${this.unit()}`;\r\n });\r\n\r\n onTouched: () => void = () => {};\r\n onModelChange: (value: number | null) => void = () => {};\r\n\r\n public ngControl = inject(NgControl, { self: true });\r\n\r\n isInvalid = isInvalid;\r\n\r\n constructor() {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n effect(() => {\r\n if (this.ngControl.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n applyInputsToInput() {\r\n Object.assign(this.input, this.pInputs());\r\n }\r\n\r\n ngOnInit() {\r\n this.styleClass = this.class();\r\n }\r\n onValueChange(value: number | null) {\r\n this.onModelChange(value);\r\n this.value.set(value);\r\n }\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes['pInputs']) {\r\n this.applyInputsToInput();\r\n }\r\n }\r\n\r\n writeValue(value: number) {\r\n this.value.set(value);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean) {\r\n this.disabled.set(disabled);\r\n }\r\n}\r\n","@if (label() || !hideNumber()) {\r\n <div class=\"flex items-end justify-between gap-3\">\r\n @if (label()) {\r\n <label\r\n class=\"leading-none\"\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"ngControl?.name || label()\"\r\n >{{ label() }}</label\r\n >\r\n }\r\n @if (!hideNumber()) {\r\n <span\r\n class=\"min-w-12 text-right text-sm font-medium leading-none text-muted-color tabular-nums\"\r\n >\r\n {{ displayValue() }}\r\n </span>\r\n }\r\n </div>\r\n}\r\n<div class=\"w-full my-2\">\r\n <p-slider\r\n #input\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onChange)=\"onChange.emit($event)\"\r\n (onSlideEnd)=\"onTouched(); onSlideEnd.emit($event)\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [animate]=\"animate()\"\r\n [id]=\"ngControl?.name || label()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n class=\"block w-full\"\r\n ></p-slider>\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA4Ca,WAAW,CAAA;AAEtB,IAAA,KAAK;AAEI,IAAA,KAAK,GAAG,KAAK,CAAU,IAAI,iDAAC;IAC5B,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AACvB,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,mDAAC;AAC/B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;IACzB,GAAG,GAAG,KAAK,CAAkB,CAAC,gDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;IAC/D,GAAG,GAAG,KAAK,CAAkB,GAAG,gDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;IACjE,IAAI,GAAG,KAAK,CAAkB,SAAS,iDAC9C,SAAS,EAAE,eAAe,EAAA,CAC1B;IACO,UAAU,GAAG,KAAK,CAAmB,KAAK,uDACjD,SAAS,EAAE,gBAAgB,EAAA,CAC3B;AACO,IAAA,IAAI,GAAG,KAAK,CAAS,GAAG,gDAAC;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC;IAChC,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAmB;AAClC,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC;AAE/B,IAAA,QAAQ,GAAoC,IAAI,YAAY,EAAE;AAC9D,IAAA,UAAU,GAAsC,IAAI,YAAY,EAAE;AAEtD,IAAA,UAAU;AAEhC,IAAA,iBAAiB,GAAG,UAAU,CAAC,QAAQ;AACvC,IAAA,KAAK,GAAG,MAAM,CAAgB,IAAI,iDAAC;AACnC,IAAA,QAAQ,GAAG,MAAM,CAAU,KAAK,oDAAC;AACjC,IAAA,YAAY,GAAG,QAAQ,CAAC,MAAK;AAC3B,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;QAC1B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AACzC,YAAA,OAAO,GAAG;QACZ;QACA,OAAO,CAAA,EAAG,KAAK,CAAA,EAAG,IAAI,CAAC,IAAI,EAAE,EAAE;AACjC,IAAA,CAAC,wDAAC;AAEF,IAAA,SAAS,GAAe,MAAK,EAAE,CAAC;AAChC,IAAA,aAAa,GAAmC,MAAK,EAAE,CAAC;IAEjD,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAEpD,SAAS,GAAG,SAAS;AAErB,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;AAClB,YAAA,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI;QACrC;QACA,MAAM,CAAC,MAAK;YACV,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;gBAC7C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC;AACzD,gBAAA,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,sBAAsB,EAAE;YACjD;AACF,QAAA,CAAC,CAAC;IACJ;IAEA,kBAAkB,GAAA;AAChB,QAAA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IAC3C;IAEA,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE;IAChC;AACA,IAAA,aAAa,CAAC,KAAoB,EAAA;AAChC,QAAA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;AACzB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;IACvB;AACA,IAAA,WAAW,CAAC,OAAsB,EAAA;AAChC,QAAA,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE;YACtB,IAAI,CAAC,kBAAkB,EAAE;QAC3B;IACF;AAEA,IAAA,UAAU,CAAC,KAAa,EAAA;AACtB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;IACvB;AAEA,IAAA,gBAAgB,CAAC,EAAO,EAAA;AACtB,QAAA,IAAI,CAAC,aAAa,GAAG,EAAE;IACzB;AAEA,IAAA,iBAAiB,CAAC,EAAO,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE;IACrB;AAEA,IAAA,gBAAgB,CAAC,QAAiB,EAAA;AAChC,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC7B;uGAvFW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,syDC5CxB,gsCAsCA,EAAA,MAAA,EAAA,CAAA,6PAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDFY,WAAW,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,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,2QAAE,eAAe,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAQzC,WAAW,EAAA,UAAA,EAAA,CAAA;kBAXvB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,YAAY,EAAE,eAAe,CAAC,EAAA,eAAA,EAGpC,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,YAAY;AACpB,qBAAA,EAAA,QAAA,EAAA,gsCAAA,EAAA,MAAA,EAAA,CAAA,6PAAA,CAAA,EAAA;;sBAGA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;sBAoBnC;;sBACA;;sBAEA,WAAW;uBAAC,OAAO;;;AEpEtB;;AAEG;;;;"}
@@ -0,0 +1,22 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, Component } from '@angular/core';
3
+ import { Card } from '@masterteam/components/card';
4
+ import { Avatar } from '@masterteam/components/avatar';
5
+
6
+ class StatisticCard {
7
+ data = input.required(...(ngDevMode ? [{ debugName: "data" }] : []));
8
+ cardClass = input('shadow-md', ...(ngDevMode ? [{ debugName: "cardClass" }] : []));
9
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: StatisticCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
10
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: StatisticCard, isStandalone: true, selector: "mt-statistic-card", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, cardClass: { classPropertyName: "cardClass", publicName: "cardClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"'var(--p-' + data().color + '-100)'\"\r\n [style.--p-avatar-color]=\"'var(--p-' + data().color + '-600)'\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span\r\n class=\"text-lg font-semibold\"\r\n [style.color]=\"'var(--p-' + data().color + '-600)'\"\r\n >\r\n {{ data().title }}\r\n </span>\r\n <span class=\"text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n", styles: [""], dependencies: [{ kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }] });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: StatisticCard, decorators: [{
13
+ type: Component,
14
+ args: [{ selector: 'mt-statistic-card', standalone: true, imports: [Card, Avatar], template: "<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"'var(--p-' + data().color + '-100)'\"\r\n [style.--p-avatar-color]=\"'var(--p-' + data().color + '-600)'\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span\r\n class=\"text-lg font-semibold\"\r\n [style.color]=\"'var(--p-' + data().color + '-600)'\"\r\n >\r\n {{ data().title }}\r\n </span>\r\n <span class=\"text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n" }]
15
+ }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], cardClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardClass", required: false }] }] } });
16
+
17
+ /**
18
+ * Generated bundle index. Do not edit.
19
+ */
20
+
21
+ export { StatisticCard };
22
+ //# sourceMappingURL=masterteam-components-statistic-card.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"masterteam-components-statistic-card.mjs","sources":["../../../../packages/masterteam/components/statistic-card/statistic-card.ts","../../../../packages/masterteam/components/statistic-card/statistic-card.html","../../../../packages/masterteam/components/statistic-card/masterteam-components-statistic-card.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\r\nimport { Card } from '@masterteam/components/card';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { MTIcon } from '@masterteam/icons';\r\n\r\nexport interface StatisticCardData {\r\n title: string;\r\n subTitle: string;\r\n icon: MTIcon;\r\n color: string;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-statistic-card',\r\n standalone: true,\r\n templateUrl: './statistic-card.html',\r\n styleUrl: './statistic-card.scss',\r\n imports: [Card, Avatar],\r\n})\r\nexport class StatisticCard {\r\n readonly data = input.required<StatisticCardData>();\r\n readonly cardClass = input('shadow-md');\r\n}\r\n","<mt-card headless class=\"shadow-sm\">\r\n <div class=\"flex items-center gap-3 p-2\">\r\n <mt-avatar\r\n [style.--p-avatar-background]=\"'var(--p-' + data().color + '-100)'\"\r\n [style.--p-avatar-color]=\"'var(--p-' + data().color + '-600)'\"\r\n [icon]=\"data().icon\"\r\n size=\"large\"\r\n shape=\"square\"\r\n ></mt-avatar>\r\n\r\n <div class=\"flex flex-col gap-0.5\">\r\n <span\r\n class=\"text-lg font-semibold\"\r\n [style.color]=\"'var(--p-' + data().color + '-600)'\"\r\n >\r\n {{ data().title }}\r\n </span>\r\n <span class=\"text-sm text-surface-500\">\r\n {{ data().subTitle }}\r\n </span>\r\n </div>\r\n </div>\r\n</mt-card>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAmBa,aAAa,CAAA;AACf,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAqB;AAC1C,IAAA,SAAS,GAAG,KAAK,CAAC,WAAW,qDAAC;uGAF5B,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECnB1B,kuBAuBA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDNY,IAAI,+FAAE,MAAM,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,YAAA,EAAA,MAAA,EAAA,OAAA,EAAA,OAAA,EAAA,WAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAEX,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,cACjB,IAAI,EAAA,OAAA,EAGP,CAAC,IAAI,EAAE,MAAM,CAAC,EAAA,QAAA,EAAA,kuBAAA,EAAA;;;AEjBzB;;AAEG;;;;"}
@@ -826,15 +826,38 @@ class Table {
826
826
  };
827
827
  }
828
828
  getStatusEntityAccentColor(row) {
829
- const cellValue = this.getProperty(row, 'status');
830
- if (!cellValue || typeof cellValue !== 'object') {
829
+ const statusCellColor = this.resolveStatusEntityAccentColor(this.getProperty(row, 'status'));
830
+ if (statusCellColor) {
831
+ return statusCellColor;
832
+ }
833
+ for (const column of this.columns()) {
834
+ if (column.type !== 'entity' && column.type !== 'status') {
835
+ continue;
836
+ }
837
+ const accentColor = this.resolveStatusEntityAccentColor(this.getProperty(row, column.key));
838
+ if (accentColor) {
839
+ return accentColor;
840
+ }
841
+ }
842
+ return null;
843
+ }
844
+ resolveStatusEntityAccentColor(value) {
845
+ if (!value || typeof value !== 'object') {
831
846
  return null;
832
847
  }
833
- const color = typeof cellValue.value?.color ===
848
+ const entityData = value;
849
+ if ('viewType' in entityData &&
850
+ entityData.viewType &&
851
+ entityData.viewType !== 'Status') {
852
+ return null;
853
+ }
854
+ const color = typeof entityData.value?.color ===
834
855
  'string'
835
- ? cellValue.value.color
856
+ ? entityData.value.color
857
+ : null;
858
+ return typeof color === 'string' && color.trim().length
859
+ ? color.trim()
836
860
  : null;
837
- return typeof color === 'string' && color.trim().length ? color.trim() : null;
838
861
  }
839
862
  getBooleanProperty(obj, key) {
840
863
  const value = this.getProperty(obj, key);
@@ -941,7 +964,7 @@ class Table {
941
964
  });
942
965
  }
943
966
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
944
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: Table, isStandalone: true, selector: "mt-table", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, stripedRows: { classPropertyName: "stripedRows", publicName: "stripedRows", isSignal: true, isRequired: false, transformFunction: null }, selectableRows: { classPropertyName: "selectableRows", publicName: "selectableRows", isSignal: true, isRequired: false, transformFunction: null }, clickableRows: { classPropertyName: "clickableRows", publicName: "clickableRows", isSignal: true, isRequired: false, transformFunction: null }, generalSearch: { classPropertyName: "generalSearch", publicName: "generalSearch", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSearch: { classPropertyName: "lazyLocalSearch", publicName: "lazyLocalSearch", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, updating: { classPropertyName: "updating", publicName: "updating", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSort: { classPropertyName: "lazyLocalSort", publicName: "lazyLocalSort", isSignal: true, isRequired: false, transformFunction: null }, lazyTotalRecords: { classPropertyName: "lazyTotalRecords", publicName: "lazyTotalRecords", isSignal: true, isRequired: false, transformFunction: null }, reorderableColumns: { classPropertyName: "reorderableColumns", publicName: "reorderableColumns", isSignal: true, isRequired: false, transformFunction: null }, reorderableRows: { classPropertyName: "reorderableRows", publicName: "reorderableRows", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, exportable: { classPropertyName: "exportable", publicName: "exportable", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, actionShape: { classPropertyName: "actionShape", publicName: "actionShape", isSignal: true, isRequired: false, transformFunction: null }, tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionLabel: { classPropertyName: "tabsOptionLabel", publicName: "tabsOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionValue: { classPropertyName: "tabsOptionValue", publicName: "tabsOptionValue", isSignal: true, isRequired: false, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "activeTab", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, filterTerm: { classPropertyName: "filterTerm", publicName: "filterTerm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", cellChange: "cellChange", lazyLoad: "lazyLoad", columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", filters: "filtersChange", activeTab: "activeTabChange", onTabChange: "onTabChange", pageSize: "pageSizeChange", currentPage: "currentPageChange", first: "firstChange", filterTerm: "filterTermChange" }, queries: [{ propertyName: "captionStartContent", first: true, predicate: ["captionStart"], descendants: true, isSignal: true }, { propertyName: "captionEndContent", first: true, predicate: ["captionEnd"], descendants: true, isSignal: true }, { propertyName: "emptyContent", first: true, predicate: ["empty"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "tableRef", first: true, predicate: ["dt"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-fixed\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\n <tr\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\n [class.mt-table-clickable-row]=\"clickableRows()\"\n [class.mt-table-status-entity-row]=\"\n getStatusEntityAccentColor(row)\n \"\n [style.--mt-table-status-accent]=\"\n getStatusEntityAccentColor(row)\n \"\n [class.cursor-pointer]=\"clickableRows()\"\n [pReorderableRow]=\"index\"\n (click)=\"onRowClick($event, row)\"\n >\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"selectedRows().has(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\n <td\n class=\"text-gray-700 dark:text-gray-100\"\n [style.width]=\"col.width ?? null\"\n [style.minWidth]=\"col.width ?? null\"\n >\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n <!-- {{ getProperty(row, col.key) | date: \"mediumDate\" }} -->\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"status\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"entity\") {\r\n @if (getEntityColumnData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"rowPopover.toggle($event)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @for (\r\n action of getVisibleRowActions(row);\r\n track $index\r\n ) {\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"false\"\r\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,box-shadow .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{box-shadow:inset 3px 0 0 var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{box-shadow:none}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "directive", type: i1$1.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$1.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }, { kind: "component", type: Paginator, selector: "mt-paginator", inputs: ["rows", "totalRecords", "first", "page", "rowsPerPageOptions", "showFirstLastIcon", "showCurrentPageReport", "fluid", "pageLinkSize", "alwaysShow"], outputs: ["rowsChange", "firstChange", "pageChange", "onPageChange"] }, { kind: "component", type: CheckboxField, selector: "mt-checkbox-field", inputs: ["label", "labelPosition", "placeholder", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i4.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TableFilter, selector: "mt-table-filter", inputs: ["columns", "data"], outputs: ["filterApplied", "filterReset"] }, { kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "pipe", type: i3.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
967
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: Table, isStandalone: true, selector: "mt-table", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, stripedRows: { classPropertyName: "stripedRows", publicName: "stripedRows", isSignal: true, isRequired: false, transformFunction: null }, selectableRows: { classPropertyName: "selectableRows", publicName: "selectableRows", isSignal: true, isRequired: false, transformFunction: null }, clickableRows: { classPropertyName: "clickableRows", publicName: "clickableRows", isSignal: true, isRequired: false, transformFunction: null }, generalSearch: { classPropertyName: "generalSearch", publicName: "generalSearch", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSearch: { classPropertyName: "lazyLocalSearch", publicName: "lazyLocalSearch", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, updating: { classPropertyName: "updating", publicName: "updating", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSort: { classPropertyName: "lazyLocalSort", publicName: "lazyLocalSort", isSignal: true, isRequired: false, transformFunction: null }, lazyTotalRecords: { classPropertyName: "lazyTotalRecords", publicName: "lazyTotalRecords", isSignal: true, isRequired: false, transformFunction: null }, reorderableColumns: { classPropertyName: "reorderableColumns", publicName: "reorderableColumns", isSignal: true, isRequired: false, transformFunction: null }, reorderableRows: { classPropertyName: "reorderableRows", publicName: "reorderableRows", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, exportable: { classPropertyName: "exportable", publicName: "exportable", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, actionShape: { classPropertyName: "actionShape", publicName: "actionShape", isSignal: true, isRequired: false, transformFunction: null }, tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionLabel: { classPropertyName: "tabsOptionLabel", publicName: "tabsOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionValue: { classPropertyName: "tabsOptionValue", publicName: "tabsOptionValue", isSignal: true, isRequired: false, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "activeTab", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, filterTerm: { classPropertyName: "filterTerm", publicName: "filterTerm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", cellChange: "cellChange", lazyLoad: "lazyLoad", columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", filters: "filtersChange", activeTab: "activeTabChange", onTabChange: "onTabChange", pageSize: "pageSizeChange", currentPage: "currentPageChange", first: "firstChange", filterTerm: "filterTermChange" }, queries: [{ propertyName: "captionStartContent", first: true, predicate: ["captionStart"], descendants: true, isSignal: true }, { propertyName: "captionEndContent", first: true, predicate: ["captionEnd"], descendants: true, isSignal: true }, { propertyName: "emptyContent", first: true, predicate: ["empty"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "tableRef", first: true, predicate: ["dt"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-fixed\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\r\n [class.mt-table-clickable-row]=\"clickableRows()\"\r\n [class.mt-table-status-entity-row]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [style.--mt-table-status-accent]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [class.cursor-pointer]=\"clickableRows()\"\r\n [pReorderableRow]=\"index\"\r\n (click)=\"onRowClick($event, row)\"\r\n >\r\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"selectedRows().has(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td\r\n class=\"text-gray-700 dark:text-gray-100\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n <!-- {{ getProperty(row, col.key) | date: \"mediumDate\" }} -->\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"status\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"entity\") {\r\n @if (getEntityColumnData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"rowPopover.toggle($event)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @for (\r\n action of getVisibleRowActions(row);\r\n track $index\r\n ) {\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"false\"\r\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,box-shadow .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{box-shadow:inset 3px 0 0 var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{box-shadow:none}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "directive", type: i1$1.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$1.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }, { kind: "component", type: Paginator, selector: "mt-paginator", inputs: ["rows", "totalRecords", "first", "page", "rowsPerPageOptions", "showFirstLastIcon", "showCurrentPageReport", "fluid", "pageLinkSize", "alwaysShow"], outputs: ["rowsChange", "firstChange", "pageChange", "onPageChange"] }, { kind: "component", type: CheckboxField, selector: "mt-checkbox-field", inputs: ["label", "labelPosition", "placeholder", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "size", "fluid", "disabled"], outputs: ["activeChange", "onChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i4.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TableFilter, selector: "mt-table-filter", inputs: ["columns", "data"], outputs: ["filterApplied", "filterReset"] }, { kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "pipe", type: i3.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
945
968
  }
946
969
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Table, decorators: [{
947
970
  type: Component,
@@ -963,7 +986,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
963
986
  EntityPreview,
964
987
  PopoverModule,
965
988
  Icon,
966
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-fixed\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\n <tr\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\n [class.mt-table-clickable-row]=\"clickableRows()\"\n [class.mt-table-status-entity-row]=\"\n getStatusEntityAccentColor(row)\n \"\n [style.--mt-table-status-accent]=\"\n getStatusEntityAccentColor(row)\n \"\n [class.cursor-pointer]=\"clickableRows()\"\n [pReorderableRow]=\"index\"\n (click)=\"onRowClick($event, row)\"\n >\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"selectedRows().has(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\n <td\n class=\"text-gray-700 dark:text-gray-100\"\n [style.width]=\"col.width ?? null\"\n [style.minWidth]=\"col.width ?? null\"\n >\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n <!-- {{ getProperty(row, col.key) | date: \"mediumDate\" }} -->\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"status\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"entity\") {\r\n @if (getEntityColumnData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"rowPopover.toggle($event)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @for (\r\n action of getVisibleRowActions(row);\r\n track $index\r\n ) {\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"false\"\r\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,box-shadow .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{box-shadow:inset 3px 0 0 var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{box-shadow:none}\n"] }]
989
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"space-y-4 rounded-2xl\">\r\n <div>\r\n @if (\r\n captionStartContent() ||\r\n captionEndContent() ||\r\n generalSearch() ||\r\n showFilters() ||\r\n tabs()?.length > 0 ||\r\n actions()?.length > 0\r\n ) {\r\n <div class=\"p-datatable-header rounded-t-2xl\">\r\n <div\r\n class=\"flex relative\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"captionStartContent()\"\r\n ></ng-container>\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [(ngModel)]=\"filterTerm\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters()) {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable()) {\r\n <mt-button\r\n icon=\"file.file-x-03\"\r\n [tooltip]=\"'components.table.export' | transloco\"\r\n (click)=\"exportCSV()\"\r\n />\r\n }\r\n @if (actions()?.length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size\"\r\n (click)=\"action.action(row)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n <ng-container\r\n *ngTemplateOutlet=\"captionEndContent()\"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div class=\"overflow-x-auto bg-content\">\r\n <p-table\r\n #dt\r\n [value]=\"displayData()\"\r\n [columns]=\"columns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n paginator\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"min-w-full text-sm align-middle table-fixed\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"text-xs text-gray-400\"-->\r\n <!-- ></mt-icon>-->\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-start font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"text-end! font-semibold text-gray-600 dark:text-gray-50 uppercase tracking-wider\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th\r\n [attr.colspan]=\"\r\n columns.length +\r\n (reorderableRows() ? 1 : 0) +\r\n (selectableRows() ? 1 : 0) +\r\n (rowActions().length > 0 ? 1 : 0)\r\n \"\r\n class=\"!p-0\"\r\n >\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\r\n [class.mt-table-clickable-row]=\"clickableRows()\"\r\n [class.mt-table-status-entity-row]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [style.--mt-table-status-accent]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [class.cursor-pointer]=\"clickableRows()\"\r\n [pReorderableRow]=\"index\"\r\n (click)=\"onRowClick($event, row)\"\r\n >\r\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"selectedRows().has(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td\r\n class=\"text-gray-700 dark:text-gray-100\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"col.width ?? null\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n [readonly]=\"col.readonly ?? false\"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"date\") {\r\n <!-- {{ getProperty(row, col.key) | date: \"mediumDate\" }} -->\r\n }\r\n @case (\"user\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"status\") {\r\n @if (getEntityPreviewData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"entity\") {\r\n @if (getEntityColumnData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td class=\"text-right\">\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"rowPopover.toggle($event)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @for (\r\n action of getVisibleRowActions(row);\r\n track $index\r\n ) {\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n </div>\r\n </p-popover>\r\n </div>\r\n } @else {\r\n <div class=\"flex items-center justify-end space-x-2\">\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"20\" class=\"text-center\">\r\n <div class=\"flex justify-center\">No data found.</div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"false\"\r\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n</div>\r\n", styles: [".mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,box-shadow .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0))}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{box-shadow:inset 3px 0 0 var(--p-primary-color)}.mt-table-status-entity-row>td{background:color-mix(in srgb,var(--mt-table-status-accent) 4%,var(--p-surface-0))}.mt-table-status-entity-row>td:first-child{position:relative}.mt-table-status-entity-row>td:first-child:before{content:\"\";position:absolute;inset-block:.4rem;inset-inline-start:.35rem;width:4px;border-radius:999px;background:var(--mt-table-status-accent)}.mt-table-clickable-row.mt-table-status-entity-row:hover>td,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td{background:color-mix(in srgb,var(--mt-table-status-accent) 6%,color-mix(in srgb,var(--p-primary-color) 6%,var(--p-surface-0)))}.mt-table-clickable-row.mt-table-status-entity-row:hover>td:first-child,.mt-table-clickable-row.mt-table-status-entity-row:focus-within>td:first-child{box-shadow:none}\n"] }]
967
990
  }], propDecorators: { selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], cellChange: [{ type: i0.Output, args: ["cellChange"] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], columnReorder: [{ type: i0.Output, args: ["columnReorder"] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showGridlines: [{ type: i0.Input, args: [{ isSignal: true, alias: "showGridlines", required: false }] }], stripedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "stripedRows", required: false }] }], selectableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectableRows", required: false }] }], clickableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickableRows", required: false }] }], generalSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "generalSearch", required: false }] }], lazyLocalSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLocalSearch", required: false }] }], showFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilters", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], updating: [{ type: i0.Input, args: [{ isSignal: true, alias: "updating", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], lazyLocalSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLocalSort", required: false }] }], lazyTotalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyTotalRecords", required: false }] }], reorderableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableColumns", required: false }] }], reorderableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableRows", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], actionShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionShape", required: false }] }], tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], tabsOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionLabel", required: false }] }], tabsOptionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionValue", required: false }] }], activeTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTab", required: false }] }, { type: i0.Output, args: ["activeTabChange"] }], onTabChange: [{ type: i0.Output, args: ["onTabChange"] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], captionStartContent: [{ type: i0.ContentChild, args: ['captionStart', { isSignal: true }] }], captionEndContent: [{ type: i0.ContentChild, args: ['captionEnd', { isSignal: true }] }], emptyContent: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], tableRef: [{ type: i0.ViewChild, args: ['dt', { isSignal: true }] }], paginatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorPosition", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], filterTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterTerm", required: false }] }, { type: i0.Output, args: ["filterTermChange"] }] } });
968
991
 
969
992
  /**