@masterteam/components 0.0.83 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/masterteam-components-dynamic-drawer.mjs +31 -19
- package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +75 -2
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components.d.ts +103 -2
|
@@ -100,14 +100,16 @@ class DynamicDrawerHost {
|
|
|
100
100
|
this.cfg.set(opts.config ?? {});
|
|
101
101
|
this.cmpInputs.set(opts.config?.inputValues ?? {});
|
|
102
102
|
this.ref = opts.ref;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
this.childInjector = Injector.create({
|
|
105
|
+
parent: opts.parent,
|
|
106
|
+
providers: [
|
|
107
|
+
{ provide: DynamicDrawerConfig, useValue: opts.config ?? {} },
|
|
108
|
+
{ provide: DynamicDialogRef, useValue: opts.ref },
|
|
109
|
+
{ provide: DrawerController, useValue: this.drawerController },
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
}, 0);
|
|
111
113
|
opts.ref.onClose.subscribe(() => {
|
|
112
114
|
this.visible.set(false);
|
|
113
115
|
});
|
|
@@ -118,7 +120,7 @@ class DynamicDrawerHost {
|
|
|
118
120
|
this.ref?.close(data);
|
|
119
121
|
}
|
|
120
122
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicDrawerHost, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
121
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
123
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: DynamicDrawerHost, isStandalone: true, selector: "mt-dynamic-drawer-host", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, connect: { classPropertyName: "connect", publicName: "connect", isSignal: false, isRequired: true, transformFunction: null } }, outputs: { visible: "visibleChange" }, ngImport: i0, template: `
|
|
122
124
|
<p-drawer
|
|
123
125
|
[(visible)]="visible"
|
|
124
126
|
[closable]="cfg()?.closable"
|
|
@@ -145,11 +147,16 @@ class DynamicDrawerHost {
|
|
|
145
147
|
</mt-button>
|
|
146
148
|
</div>
|
|
147
149
|
</ng-template>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
@if (childInjector) {
|
|
151
|
+
<ng-container
|
|
152
|
+
*ngComponentOutlet="
|
|
153
|
+
cmp();
|
|
154
|
+
injector: childInjector;
|
|
155
|
+
inputs: cmpInputs()
|
|
156
|
+
"
|
|
157
|
+
>
|
|
158
|
+
</ng-container>
|
|
159
|
+
}
|
|
153
160
|
</p-drawer>
|
|
154
161
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i1.Drawer, selector: "p-drawer", inputs: ["appendTo", "motionOptions", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { 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"] }] });
|
|
155
162
|
}
|
|
@@ -186,11 +193,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
186
193
|
</mt-button>
|
|
187
194
|
</div>
|
|
188
195
|
</ng-template>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
@if (childInjector) {
|
|
197
|
+
<ng-container
|
|
198
|
+
*ngComponentOutlet="
|
|
199
|
+
cmp();
|
|
200
|
+
injector: childInjector;
|
|
201
|
+
inputs: cmpInputs()
|
|
202
|
+
"
|
|
203
|
+
>
|
|
204
|
+
</ng-container>
|
|
205
|
+
}
|
|
194
206
|
</p-drawer>
|
|
195
207
|
`,
|
|
196
208
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-dynamic-drawer.mjs","sources":["../../../../packages/masterteam/components/dynamic-drawer/dynamic-drawer-host.ts","../../../../packages/masterteam/components/dynamic-drawer/dynamic-drawer.ts","../../../../packages/masterteam/components/dynamic-drawer/masterteam-components-dynamic-drawer.ts"],"sourcesContent":["import { DynamicDialogRef } from 'primeng/dynamicdialog';\r\nimport { DrawerModule } from 'primeng/drawer';\r\nimport {\r\n Component,\r\n Injector,\r\n Input,\r\n signal,\r\n InjectionToken,\r\n model,\r\n computed,\r\n Injectable,\r\n} from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\n\r\nexport const DynamicDrawerConfig = new InjectionToken<any>(\r\n 'DynamicDrawerConfig',\r\n);\r\n\r\n/**\r\n * Controller to dynamically update drawer properties from inside the child component.\r\n * Inject this in your drawer content component to modify drawer behavior.\r\n */\r\n@Injectable()\r\nexport class DrawerController {\r\n private _styleClass = signal<string>('');\r\n private _header = signal<string>('');\r\n private _fullScreen = signal<boolean | undefined>(undefined);\r\n\r\n /** Get the current additional styleClass */\r\n get styleClass() {\r\n return this._styleClass;\r\n }\r\n\r\n /** Get the current header */\r\n get header() {\r\n return this._header;\r\n }\r\n\r\n /** Get the current fullScreen state */\r\n get fullScreen() {\r\n return this._fullScreen;\r\n }\r\n\r\n /** Add or replace the dynamic styleClass */\r\n setStyleClass(styleClass: string) {\r\n this._styleClass.set(styleClass);\r\n }\r\n\r\n /** Append a class to the existing styleClass */\r\n addClass(className: string) {\r\n const current = this._styleClass();\r\n if (!current.includes(className)) {\r\n this._styleClass.set((current + ' ' + className).trim());\r\n }\r\n }\r\n\r\n /** Remove a class from the styleClass */\r\n removeClass(className: string) {\r\n const current = this._styleClass();\r\n this._styleClass.set(\r\n current\r\n .split(' ')\r\n .filter((c) => c !== className)\r\n .join(' '),\r\n );\r\n }\r\n\r\n /** Toggle a class on/off */\r\n toggleClass(className: string) {\r\n if (this._styleClass().includes(className)) {\r\n this.removeClass(className);\r\n } else {\r\n this.addClass(className);\r\n }\r\n }\r\n\r\n /** Update the drawer header */\r\n setHeader(header: string) {\r\n this._header.set(header);\r\n }\r\n\r\n /** Toggle fullScreen mode */\r\n setFullScreen(fullScreen: boolean) {\r\n this._fullScreen.set(fullScreen);\r\n }\r\n}\r\nimport { Button } from '@masterteam/components/button';\r\n\r\n@Component({\r\n selector: 'mt-dynamic-drawer-host',\r\n standalone: true,\r\n imports: [NgComponentOutlet, DrawerModule, Button],\r\n template: `\r\n <p-drawer\r\n [(visible)]=\"visible\"\r\n [closable]=\"cfg()?.closable\"\r\n [position]=\"cfg()?.position\"\r\n [fullScreen]=\"computedFullScreen()\"\r\n [modal]=\"cfg()?.modal\"\r\n [closeOnEscape]=\"cfg()?.closeOnEscape\"\r\n [dismissible]=\"cfg()?.dismissible\"\r\n [transitionOptions]=\"cfg()?.transitionOptions\"\r\n [styleClass]=\"computedStyleClass()\"\r\n >\r\n <ng-template #header>\r\n <div\r\n class=\"flex items-center justify-between px-5 w-full py-3 border-b border-surface\"\r\n >\r\n <h3 class=\"text-xl font-semibold\">{{ computedHeader() }}</h3>\r\n <mt-button\r\n (onClick)=\"handleHide()\"\r\n variant=\"outlined\"\r\n styleClass=\"!bg-white\"\r\n icon=\"general.x-close\"\r\n severity=\"secondary\"\r\n >\r\n </mt-button>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-container\r\n *ngComponentOutlet=\"cmp(); injector: childInjector; inputs: cmpInputs()\"\r\n >\r\n </ng-container>\r\n </p-drawer>\r\n `,\r\n})\r\nexport class DynamicDrawerHost {\r\n public visible = model<boolean>(false);\r\n cmp = signal<any>(null);\r\n cfg = signal<any>({});\r\n cmpInputs = signal<Record<string, unknown>>({});\r\n childInjector!: Injector;\r\n private ref?: DynamicDialogRef;\r\n private drawerController = new DrawerController();\r\n\r\n /** Computed styleClass combining config + dynamic controller class */\r\n computedStyleClass = computed(() => {\r\n const configClass = this.cfg()?.styleClass ?? '';\r\n const dynamicClass = this.drawerController.styleClass();\r\n return `${configClass} ${dynamicClass} mt-drawer`.trim();\r\n });\r\n\r\n /** Computed header - controller overrides config if set */\r\n computedHeader = computed(() => {\r\n const dynamicHeader = this.drawerController.header();\r\n return dynamicHeader || this.cfg()?.header || '';\r\n });\r\n\r\n /** Computed fullScreen - controller overrides config if set */\r\n computedFullScreen = computed(() => {\r\n const dynamicFullScreen = this.drawerController.fullScreen();\r\n return dynamicFullScreen !== undefined\r\n ? dynamicFullScreen\r\n : this.cfg()?.fullScreen;\r\n });\r\n\r\n @Input({ required: true })\r\n connect(opts: {\r\n component: any;\r\n config?: any;\r\n parent: Injector;\r\n ref: DynamicDialogRef;\r\n }) {\r\n this.cmp.set(opts.component);\r\n this.cfg.set(opts.config ?? {});\r\n this.cmpInputs.set(opts.config?.inputValues ?? {});\r\n this.ref = opts.ref;\r\n this.childInjector = Injector.create({\r\n parent: opts.parent,\r\n providers: [\r\n { provide: DynamicDrawerConfig, useValue: opts.config ?? {} },\r\n { provide: DynamicDialogRef, useValue: opts.ref },\r\n { provide: DrawerController, useValue: this.drawerController },\r\n ],\r\n });\r\n opts.ref.onClose.subscribe(() => {\r\n this.visible.set(false);\r\n });\r\n this.visible.set(true);\r\n }\r\n\r\n handleHide(data = null) {\r\n this.visible.set(false);\r\n this.ref?.close(data);\r\n }\r\n}\r\n","// dynamic-drawer.service.ts\r\nimport {\r\n Injectable,\r\n Type,\r\n createComponent,\r\n EnvironmentInjector,\r\n ApplicationRef,\r\n Injector,\r\n DestroyRef,\r\n inject,\r\n} from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { DynamicDrawerHost } from './dynamic-drawer-host';\r\nimport { DynamicDialogRef } from 'primeng/dynamicdialog';\r\n\r\nexport interface DynamicDrawerConfigInterface {\r\n header?: string;\r\n position?: string;\r\n data?: any;\r\n fullScreen?: boolean;\r\n modal?: boolean;\r\n closable?: boolean;\r\n closeOnEscape?: boolean;\r\n dismissible?: boolean;\r\n appendTo?: any;\r\n transitionOptions?: string;\r\n styleClass?: string;\r\n inputValues?: any;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class DrawerService {\r\n private appRef = inject(ApplicationRef);\r\n private env = inject(EnvironmentInjector);\r\n private rootInjector = inject(Injector);\r\n private destroyRef = inject(DestroyRef);\r\n private doc = inject(DOCUMENT);\r\n private hostRef?: ReturnType<typeof createComponent<DynamicDrawerHost>>;\r\n defauiltConfig: DynamicDrawerConfigInterface = {\r\n position: 'right',\r\n modal: true,\r\n closable: false,\r\n transitionOptions: '200ms cubic-bezier(0, 0, 1, 1)',\r\n inputValues: {},\r\n };\r\n open<T>(\r\n component: Type<any>,\r\n config: DynamicDrawerConfigInterface = {},\r\n ): DynamicDialogRef<T> {\r\n config = { ...this.defauiltConfig, ...config };\r\n\r\n const targetEl = this.resolveAppendTarget(config.appendTo);\r\n\r\n this.hostRef = createComponent(DynamicDrawerHost, {\r\n environmentInjector: this.env,\r\n });\r\n\r\n this.appRef.attachView(this.hostRef.hostView);\r\n\r\n // 📌 append to target (NOT body when provided)\r\n targetEl.appendChild(this.hostRef.location.nativeElement);\r\n\r\n // 🧹 auto-clean if app destroyed (SSR / HMR safety)\r\n this.destroyRef.onDestroy(() => {\r\n this.appRef.detachView(this.hostRef!.hostView);\r\n this.hostRef!.destroy();\r\n this.hostRef = undefined;\r\n });\r\n\r\n const ref = new DynamicDialogRef<T>();\r\n this.hostRef.instance.connect({\r\n component,\r\n config,\r\n parent: this.rootInjector,\r\n ref,\r\n });\r\n\r\n return ref;\r\n }\r\n\r\n private resolveAppendTarget(appendTo?: string | HTMLElement): HTMLElement {\r\n if (!appendTo) return this.doc.body;\r\n\r\n if (typeof appendTo === 'string') {\r\n const selector =\r\n appendTo.startsWith('#') || appendTo.startsWith('.')\r\n ? appendTo\r\n : `#${appendTo}`;\r\n const el = this.doc.querySelector(selector) as HTMLElement | null;\r\n if (!el) {\r\n return this.doc.body;\r\n }\r\n return el;\r\n }\r\n\r\n return appendTo; // HTMLElement passed directly\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAca,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;AAGvB;;;AAGG;MAEU,gBAAgB,CAAA;AACnB,IAAA,WAAW,GAAG,MAAM,CAAS,EAAE,uDAAC;AAChC,IAAA,OAAO,GAAG,MAAM,CAAS,EAAE,mDAAC;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAsB,SAAS,uDAAC;;AAG5D,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,WAAW;IACzB;;AAGA,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;IACrB;;AAGA,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,WAAW;IACzB;;AAGA,IAAA,aAAa,CAAC,UAAkB,EAAA;AAC9B,QAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC;IAClC;;AAGA,IAAA,QAAQ,CAAC,SAAiB,EAAA;AACxB,QAAA,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Q,CAAA,CAAE;YACpB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAuB;YACjE,IAAI,CAAC,EAAE,EAAE;AACP,gBAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI;YACtB;AACA,YAAA,OAAO,EAAE;QACX;QAEA,OAAO,QAAQ,CAAC;IAClB;uGAjEW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;AC9BlC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-dynamic-drawer.mjs","sources":["../../../../packages/masterteam/components/dynamic-drawer/dynamic-drawer-host.ts","../../../../packages/masterteam/components/dynamic-drawer/dynamic-drawer.ts","../../../../packages/masterteam/components/dynamic-drawer/masterteam-components-dynamic-drawer.ts"],"sourcesContent":["import { DynamicDialogRef } from 'primeng/dynamicdialog';\r\nimport { DrawerModule } from 'primeng/drawer';\r\nimport {\r\n Component,\r\n Injector,\r\n Input,\r\n signal,\r\n InjectionToken,\r\n model,\r\n computed,\r\n Injectable,\r\n} from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\n\r\nexport const DynamicDrawerConfig = new InjectionToken<any>(\r\n 'DynamicDrawerConfig',\r\n);\r\n\r\n/**\r\n * Controller to dynamically update drawer properties from inside the child component.\r\n * Inject this in your drawer content component to modify drawer behavior.\r\n */\r\n@Injectable()\r\nexport class DrawerController {\r\n private _styleClass = signal<string>('');\r\n private _header = signal<string>('');\r\n private _fullScreen = signal<boolean | undefined>(undefined);\r\n\r\n /** Get the current additional styleClass */\r\n get styleClass() {\r\n return this._styleClass;\r\n }\r\n\r\n /** Get the current header */\r\n get header() {\r\n return this._header;\r\n }\r\n\r\n /** Get the current fullScreen state */\r\n get fullScreen() {\r\n return this._fullScreen;\r\n }\r\n\r\n /** Add or replace the dynamic styleClass */\r\n setStyleClass(styleClass: string) {\r\n this._styleClass.set(styleClass);\r\n }\r\n\r\n /** Append a class to the existing styleClass */\r\n addClass(className: string) {\r\n const current = this._styleClass();\r\n if (!current.includes(className)) {\r\n this._styleClass.set((current + ' ' + className).trim());\r\n }\r\n }\r\n\r\n /** Remove a class from the styleClass */\r\n removeClass(className: string) {\r\n const current = this._styleClass();\r\n this._styleClass.set(\r\n current\r\n .split(' ')\r\n .filter((c) => c !== className)\r\n .join(' '),\r\n );\r\n }\r\n\r\n /** Toggle a class on/off */\r\n toggleClass(className: string) {\r\n if (this._styleClass().includes(className)) {\r\n this.removeClass(className);\r\n } else {\r\n this.addClass(className);\r\n }\r\n }\r\n\r\n /** Update the drawer header */\r\n setHeader(header: string) {\r\n this._header.set(header);\r\n }\r\n\r\n /** Toggle fullScreen mode */\r\n setFullScreen(fullScreen: boolean) {\r\n this._fullScreen.set(fullScreen);\r\n }\r\n}\r\nimport { Button } from '@masterteam/components/button';\r\n\r\n@Component({\r\n selector: 'mt-dynamic-drawer-host',\r\n standalone: true,\r\n imports: [NgComponentOutlet, DrawerModule, Button],\r\n template: `\r\n <p-drawer\r\n [(visible)]=\"visible\"\r\n [closable]=\"cfg()?.closable\"\r\n [position]=\"cfg()?.position\"\r\n [fullScreen]=\"computedFullScreen()\"\r\n [modal]=\"cfg()?.modal\"\r\n [closeOnEscape]=\"cfg()?.closeOnEscape\"\r\n [dismissible]=\"cfg()?.dismissible\"\r\n [transitionOptions]=\"cfg()?.transitionOptions\"\r\n [styleClass]=\"computedStyleClass()\"\r\n >\r\n <ng-template #header>\r\n <div\r\n class=\"flex items-center justify-between px-5 w-full py-3 border-b border-surface\"\r\n >\r\n <h3 class=\"text-xl font-semibold\">{{ computedHeader() }}</h3>\r\n <mt-button\r\n (onClick)=\"handleHide()\"\r\n variant=\"outlined\"\r\n styleClass=\"!bg-white\"\r\n icon=\"general.x-close\"\r\n severity=\"secondary\"\r\n >\r\n </mt-button>\r\n </div>\r\n </ng-template>\r\n @if (childInjector) {\r\n <ng-container\r\n *ngComponentOutlet=\"\r\n cmp();\r\n injector: childInjector;\r\n inputs: cmpInputs()\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n </p-drawer>\r\n `,\r\n})\r\nexport class DynamicDrawerHost {\r\n public visible = model<boolean>(false);\r\n cmp = signal<any>(null);\r\n cfg = signal<any>({});\r\n cmpInputs = signal<Record<string, unknown>>({});\r\n childInjector!: Injector;\r\n private ref?: DynamicDialogRef;\r\n private drawerController = new DrawerController();\r\n\r\n /** Computed styleClass combining config + dynamic controller class */\r\n computedStyleClass = computed(() => {\r\n const configClass = this.cfg()?.styleClass ?? '';\r\n const dynamicClass = this.drawerController.styleClass();\r\n return `${configClass} ${dynamicClass} mt-drawer`.trim();\r\n });\r\n\r\n /** Computed header - controller overrides config if set */\r\n computedHeader = computed(() => {\r\n const dynamicHeader = this.drawerController.header();\r\n return dynamicHeader || this.cfg()?.header || '';\r\n });\r\n\r\n /** Computed fullScreen - controller overrides config if set */\r\n computedFullScreen = computed(() => {\r\n const dynamicFullScreen = this.drawerController.fullScreen();\r\n return dynamicFullScreen !== undefined\r\n ? dynamicFullScreen\r\n : this.cfg()?.fullScreen;\r\n });\r\n\r\n @Input({ required: true })\r\n connect(opts: {\r\n component: any;\r\n config?: any;\r\n parent: Injector;\r\n ref: DynamicDialogRef;\r\n }) {\r\n this.cmp.set(opts.component);\r\n this.cfg.set(opts.config ?? {});\r\n this.cmpInputs.set(opts.config?.inputValues ?? {});\r\n this.ref = opts.ref;\r\n setTimeout(() => {\r\n this.childInjector = Injector.create({\r\n parent: opts.parent,\r\n providers: [\r\n { provide: DynamicDrawerConfig, useValue: opts.config ?? {} },\r\n { provide: DynamicDialogRef, useValue: opts.ref },\r\n { provide: DrawerController, useValue: this.drawerController },\r\n ],\r\n });\r\n }, 0);\r\n\r\n opts.ref.onClose.subscribe(() => {\r\n this.visible.set(false);\r\n });\r\n this.visible.set(true);\r\n }\r\n\r\n handleHide(data = null) {\r\n this.visible.set(false);\r\n this.ref?.close(data);\r\n }\r\n}\r\n","// dynamic-drawer.service.ts\r\nimport {\r\n Injectable,\r\n Type,\r\n createComponent,\r\n EnvironmentInjector,\r\n ApplicationRef,\r\n Injector,\r\n DestroyRef,\r\n inject,\r\n} from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { DynamicDrawerHost } from './dynamic-drawer-host';\r\nimport { DynamicDialogRef } from 'primeng/dynamicdialog';\r\n\r\nexport interface DynamicDrawerConfigInterface {\r\n header?: string;\r\n position?: string;\r\n data?: any;\r\n fullScreen?: boolean;\r\n modal?: boolean;\r\n closable?: boolean;\r\n closeOnEscape?: boolean;\r\n dismissible?: boolean;\r\n appendTo?: any;\r\n transitionOptions?: string;\r\n styleClass?: string;\r\n inputValues?: any;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class DrawerService {\r\n private appRef = inject(ApplicationRef);\r\n private env = inject(EnvironmentInjector);\r\n private rootInjector = inject(Injector);\r\n private destroyRef = inject(DestroyRef);\r\n private doc = inject(DOCUMENT);\r\n private hostRef?: ReturnType<typeof createComponent<DynamicDrawerHost>>;\r\n defauiltConfig: DynamicDrawerConfigInterface = {\r\n position: 'right',\r\n modal: true,\r\n closable: false,\r\n transitionOptions: '200ms cubic-bezier(0, 0, 1, 1)',\r\n inputValues: {},\r\n };\r\n open<T>(\r\n component: Type<any>,\r\n config: DynamicDrawerConfigInterface = {},\r\n ): DynamicDialogRef<T> {\r\n config = { ...this.defauiltConfig, ...config };\r\n\r\n const targetEl = this.resolveAppendTarget(config.appendTo);\r\n\r\n this.hostRef = createComponent(DynamicDrawerHost, {\r\n environmentInjector: this.env,\r\n });\r\n\r\n this.appRef.attachView(this.hostRef.hostView);\r\n\r\n // 📌 append to target (NOT body when provided)\r\n targetEl.appendChild(this.hostRef.location.nativeElement);\r\n\r\n // 🧹 auto-clean if app destroyed (SSR / HMR safety)\r\n this.destroyRef.onDestroy(() => {\r\n this.appRef.detachView(this.hostRef!.hostView);\r\n this.hostRef!.destroy();\r\n this.hostRef = undefined;\r\n });\r\n\r\n const ref = new DynamicDialogRef<T>();\r\n this.hostRef.instance.connect({\r\n component,\r\n config,\r\n parent: this.rootInjector,\r\n ref,\r\n });\r\n\r\n return ref;\r\n }\r\n\r\n private resolveAppendTarget(appendTo?: string | HTMLElement): HTMLElement {\r\n if (!appendTo) return this.doc.body;\r\n\r\n if (typeof appendTo === 'string') {\r\n const selector =\r\n appendTo.startsWith('#') || appendTo.startsWith('.')\r\n ? appendTo\r\n : `#${appendTo}`;\r\n const el = this.doc.querySelector(selector) as HTMLElement | null;\r\n if (!el) {\r\n return this.doc.body;\r\n }\r\n return el;\r\n }\r\n\r\n return appendTo; // HTMLElement passed directly\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAca,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;AAGvB;;;AAGG;MAEU,gBAAgB,CAAA;AACnB,IAAA,WAAW,GAAG,MAAM,CAAS,EAAE,uDAAC;AAChC,IAAA,OAAO,GAAG,MAAM,CAAS,EAAE,mDAAC;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAsB,SAAS,uDAAC;;AAG5D,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,WAAW;IACzB;;AAGA,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;IACrB;;AAGA,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,WAAW;IACzB;;AAGA,IAAA,aAAa,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I;AAEnC,QAAA,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAChC,YAAA,MAAM,QAAQ,GACZ,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG;AACjD,kBAAE;AACF,kBAAE,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAE;YACpB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAuB;YACjE,IAAI,CAAC,EAAE,EAAE;AACP,gBAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI;YACtB;AACA,YAAA,OAAO,EAAE;QACX;QAEA,OAAO,QAAQ,CAAC;IAClB;uGAjEW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;AC9BlC;;AAEG;;;;"}
|
|
@@ -916,7 +916,68 @@ function wrapValidatorWithMessage(validator, errorKey, message) {
|
|
|
916
916
|
// }
|
|
917
917
|
|
|
918
918
|
/**
|
|
919
|
-
*
|
|
919
|
+
* @deprecated Use direct `select()` + `computed()` pattern instead for better performance.
|
|
920
|
+
*
|
|
921
|
+
* **Problem with BaseFacade:**
|
|
922
|
+
* - All computed signals depend on the full state, causing unnecessary recomputations
|
|
923
|
+
* - Bypasses NGXS selector memoization
|
|
924
|
+
* - Uses `as any` casting, losing type safety
|
|
925
|
+
*
|
|
926
|
+
* **New Pattern - Use slice-based selectors:**
|
|
927
|
+
*
|
|
928
|
+
* ```typescript
|
|
929
|
+
* // In your State class - add slice selectors:
|
|
930
|
+
* @Selector()
|
|
931
|
+
* static getLoadingActive(state: MyStateModel): string[] {
|
|
932
|
+
* return state.loadingActive;
|
|
933
|
+
* }
|
|
934
|
+
*
|
|
935
|
+
* @Selector()
|
|
936
|
+
* static getErrors(state: MyStateModel): Record<string, string | null> {
|
|
937
|
+
* return state.errors;
|
|
938
|
+
* }
|
|
939
|
+
*
|
|
940
|
+
* // In your Facade - don't extend BaseFacade:
|
|
941
|
+
* @Injectable({ providedIn: 'root' })
|
|
942
|
+
* export class MyFacade {
|
|
943
|
+
* private readonly store = inject(Store);
|
|
944
|
+
*
|
|
945
|
+
* // Data selectors - memoized by NGXS
|
|
946
|
+
* readonly items = select(MyState.getItems);
|
|
947
|
+
*
|
|
948
|
+
* // Loading/Error slices - memoized by NGXS
|
|
949
|
+
* private readonly loadingActive = select(MyState.getLoadingActive);
|
|
950
|
+
* private readonly errors = select(MyState.getErrors);
|
|
951
|
+
*
|
|
952
|
+
* // Loading signals - computed from slice (minimal reactivity)
|
|
953
|
+
* readonly isLoadingItems = computed(() =>
|
|
954
|
+
* this.loadingActive().includes(MyActionKey.GetItems)
|
|
955
|
+
* );
|
|
956
|
+
*
|
|
957
|
+
* // Error signals - computed from slice (minimal reactivity)
|
|
958
|
+
* readonly itemsError = computed(() =>
|
|
959
|
+
* this.errors()[MyActionKey.GetItems] ?? null
|
|
960
|
+
* );
|
|
961
|
+
*
|
|
962
|
+
* // Dispatchers
|
|
963
|
+
* loadItems() {
|
|
964
|
+
* return this.store.dispatch(new GetItems());
|
|
965
|
+
* }
|
|
966
|
+
* }
|
|
967
|
+
* ```
|
|
968
|
+
*
|
|
969
|
+
* **Template Usage:**
|
|
970
|
+
* ```html
|
|
971
|
+
* @if (facade.isLoadingItems()) {
|
|
972
|
+
* <loading-spinner />
|
|
973
|
+
* } @else if (facade.itemsError(); as error) {
|
|
974
|
+
* <error-alert>{{ error }}</error-alert>
|
|
975
|
+
* } @else {
|
|
976
|
+
* @for (item of facade.items(); track item.id) {
|
|
977
|
+
* <item-card [item]="item" />
|
|
978
|
+
* }
|
|
979
|
+
* }
|
|
980
|
+
* ```
|
|
920
981
|
*/
|
|
921
982
|
class BaseFacade {
|
|
922
983
|
/**
|
|
@@ -1071,7 +1132,19 @@ class CrudStateBase {
|
|
|
1071
1132
|
return (state, items) => ({ [key]: items });
|
|
1072
1133
|
}
|
|
1073
1134
|
/**
|
|
1074
|
-
*
|
|
1135
|
+
* @deprecated Use `handleApiRequest` directly with `onSuccess` callback.
|
|
1136
|
+
* The `load()` method provides no significant benefit over `handleApiRequest`.
|
|
1137
|
+
*
|
|
1138
|
+
* @example
|
|
1139
|
+
* // Instead of this.load(), use:
|
|
1140
|
+
* return handleApiRequest({
|
|
1141
|
+
* ctx,
|
|
1142
|
+
* key: ActionKey.GetItems,
|
|
1143
|
+
* request$: req$,
|
|
1144
|
+
* onSuccess: (response) => ({
|
|
1145
|
+
* items: response.data ?? [],
|
|
1146
|
+
* }),
|
|
1147
|
+
* });
|
|
1075
1148
|
*/
|
|
1076
1149
|
load(ctx, config) {
|
|
1077
1150
|
return handleApiRequest({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components.mjs","sources":["../../../../packages/masterteam/components/src/lib/utils/theme.ts","../../../../packages/masterteam/components/src/lib/config/providemt.ts","../../../../packages/masterteam/components/src/lib/config/povide-messages.ts","../../../../packages/masterteam/components/src/lib/config/provide-confirmation.ts","../../../../packages/masterteam/components/src/lib/config/dynamic-form.model.ts","../../../../packages/masterteam/components/src/lib/base/base.facade.ts","../../../../packages/masterteam/components/src/lib/utils/entity-adapter.ts","../../../../packages/masterteam/components/src/lib/utils/state-helpers.ts","../../../../packages/masterteam/components/src/lib/utils/api-request.helper.ts","../../../../packages/masterteam/components/src/lib/base/crud-base.state.ts","../../../../packages/masterteam/components/src/lib/utils/inputs.ts","../../../../packages/masterteam/components/src/lib/utils/http-context.ts","../../../../packages/masterteam/components/src/public-api.ts","../../../../packages/masterteam/components/src/masterteam-components.ts"],"sourcesContent":["type HSLTuple = [number, number, number]; // [hue, saturation, lightness]\r\ntype TailwindColorPalette = {\r\n [key: string]: string; // e.g., '50': '#f0f9ff', '500': '#0284c7'\r\n};\r\n\r\n/**\r\n * Converts a hex color string to an HSL tuple.\r\n * @param hex - The hex color string (e.g., \"#RRGGBB\" or \"#RGB\").\r\n * @returns An HSL tuple [hue, saturation, lightness] where hue is in degrees (0-360),\r\n * and saturation/lightness are percentages (0-100).\r\n */\r\nfunction hexToHsl(hex: string): HSLTuple {\r\n let r: number = 0,\r\n g: number = 0,\r\n b: number = 0;\r\n\r\n // Handle shorthand hex codes\r\n if (hex.length === 4) {\r\n r = parseInt(hex[1] + hex[1], 16);\r\n g = parseInt(hex[2] + hex[2], 16);\r\n b = parseInt(hex[3] + hex[3], 16);\r\n } else if (hex.length === 7) {\r\n r = parseInt(hex.substring(1, 3), 16);\r\n g = parseInt(hex.substring(3, 5), 16);\r\n b = parseInt(hex.substring(5, 7), 16);\r\n } else {\r\n throw new Error('Invalid hex color format. Expected #RGB or #RRGGBB.');\r\n }\r\n\r\n r /= 255;\r\n g /= 255;\r\n b /= 255;\r\n\r\n const max: number = Math.max(r, g, b);\r\n const min: number = Math.min(r, g, b);\r\n let h: number = 0,\r\n s: number;\r\n const l: number = (max + min) / 2;\r\n\r\n if (max === min) {\r\n h = s = 0; // achromatic\r\n } else {\r\n const d: number = max - min;\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n\r\n return [h * 360, s * 100, l * 100]; // HSL in degrees, percentage, percentage\r\n}\r\n\r\n/**\r\n * Converts HSL values to a hex color string.\r\n * @param h - Hue (0-360).\r\n * @param s - Saturation (0-100).\r\n * @param l - Lightness (0-100).\r\n * @returns The hex color string (e.g., \"#RRGGBB\").\r\n */\r\nfunction hslToHex(h: number, s: number, l: number): string {\r\n l /= 100;\r\n const a: number = (s * Math.min(l, 1 - l)) / 100;\r\n const f = (n: number): string => {\r\n const k: number = (n + h / 30) % 12;\r\n const color: number = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\r\n return Math.round(255 * color)\r\n .toString(16)\r\n .padStart(2, '0');\r\n };\r\n return `#${f(0)}${f(8)}${f(4)}`;\r\n}\r\n\r\n/**\r\n * Generates a Tailwind-like color palette (50-950) from a primary color (assumed to be 500).\r\n *\r\n * @param primaryColor500 - The hex string of the primary color (e.g., \"#0284c7\").\r\n * @returns An object representing the color palette, where keys are color numbers (e.g., \"50\", \"100\")\r\n * and values are hex color strings.\r\n */\r\n// export function generateTailwindPalette(\r\n// primaryColor500: string,\r\n// ): TailwindColorPalette {\r\n// const [h, s, _l]: HSLTuple = hexToHsl(primaryColor500);\r\n//\r\n// const palette: TailwindColorPalette = {\r\n// '500': primaryColor500,\r\n// };\r\n//\r\n// // Define steps for lighter shades (50 - 400)\r\n// const lightnessStepsLighter: { [key: string]: number } = {\r\n// '50': 95,\r\n// '100': 90,\r\n// '200': 80,\r\n// '300': 70,\r\n// '400': 60,\r\n// };\r\n//\r\n// const saturationReductionsLighter: { [key: string]: number } = {\r\n// '50': 40, // More desaturated\r\n// '100': 30,\r\n// '200': 20,\r\n// '300': 10,\r\n// '400': 5, // Slightly desaturated\r\n// };\r\n//\r\n// for (const shade in lightnessStepsLighter) {\r\n// if (Object.prototype.hasOwnProperty.call(lightnessStepsLighter, shade)) {\r\n// const newL: number = lightnessStepsLighter[shade];\r\n// // Ensure saturation doesn't go below 0\r\n// const newS: number = Math.max(0, s - saturationReductionsLighter[shade]);\r\n// palette[shade] = hslToHex(h, newS, newL);\r\n// }\r\n// }\r\n//\r\n// // Define steps for darker shades (600 - 950)\r\n// const lightnessStepsDarker: { [key: string]: number } = {\r\n// '600': 45,\r\n// '700': 35,\r\n// '800': 25,\r\n// '900': 15,\r\n// '950': 8, // More aggressive darkening for 950\r\n// };\r\n//\r\n// const saturationIncreasesDarker: { [key: string]: number } = {\r\n// '600': 5,\r\n// '700': 10,\r\n// '800': 15,\r\n// '900': 20,\r\n// '950': 25, // Can increase saturation for darker shades\r\n// };\r\n//\r\n// for (const shade in lightnessStepsDarker) {\r\n// if (Object.prototype.hasOwnProperty.call(lightnessStepsDarker, shade)) {\r\n// const newL: number = lightnessStepsDarker[shade];\r\n// // Ensure saturation doesn't exceed 100\r\n// const newS: number = Math.min(100, s + saturationIncreasesDarker[shade]);\r\n// palette[shade] = hslToHex(h, newS, newL);\r\n// }\r\n// }\r\n//\r\n// // Sort the keys numerically to ensure consistent order\r\n// const sortedPalette: TailwindColorPalette = {};\r\n// Object.keys(palette)\r\n// .sort((a, b) => parseInt(a) - parseInt(b))\r\n// .forEach((key: string) => {\r\n// sortedPalette[key] = palette[key];\r\n// });\r\n//\r\n// return sortedPalette;\r\n// }\r\n\r\n// Define the specific shade keys\r\nexport type PaletteShade =\r\n | '0'\r\n | '50'\r\n | '100'\r\n | '200'\r\n | '300'\r\n | '400'\r\n | '500'\r\n | '600'\r\n | '700'\r\n | '800'\r\n | '900'\r\n | '950';\r\n\r\n// A helper type for our new palette profile\r\ntype ShadeProfile = {\r\n /** Target lightness (0-100) */\r\n l: number;\r\n /** Saturation adjustment relative to the 500 shade */\r\n s_adjust: number;\r\n};\r\n\r\n/**\r\n * Defines the \"ideal\" lightness and saturation adjustment for each shade.\r\n * Lightness for 500 is set to 50 as a balanced default.\r\n */\r\nconst PALETTE_PROFILE: Record<PaletteShade, ShadeProfile> = {\r\n '0': { l: 98, s_adjust: -50 },\r\n '50': { l: 95, s_adjust: -40 },\r\n '100': { l: 90, s_adjust: -30 },\r\n '200': { l: 80, s_adjust: -20 },\r\n '300': { l: 70, s_adjust: -10 },\r\n '400': { l: 60, s_adjust: -5 },\r\n '500': { l: 50, s_adjust: 0 },\r\n '600': { l: 45, s_adjust: 5 },\r\n '700': { l: 35, s_adjust: 10 },\r\n '800': { l: 25, s_adjust: 15 },\r\n '900': { l: 15, s_adjust: 20 },\r\n '950': { l: 8, s_adjust: 25 },\r\n};\r\n\r\n// Helper to ensure palette is always in the correct 50-950 order\r\nconst ALL_SHADES: PaletteShade[] = [\r\n '0',\r\n '50',\r\n '100',\r\n '200',\r\n '300',\r\n '400',\r\n '500',\r\n '600',\r\n '700',\r\n '800',\r\n '900',\r\n '950',\r\n];\r\n\r\n/**\r\n * Clamps a number between a min and max value.\r\n */\r\nfunction clamp(value: number, min: number, max: number): number {\r\n return Math.max(min, Math.min(max, value));\r\n}\r\n\r\n/**\r\n * Generates a Tailwind-like color palette (50-950) from any given base color.\r\n *\r\n * @param baseColorHex - The hex string of the base color (e.g., \"#0284c7\").\r\n * @param baseColorShade - The shade of the base color (e.g., \"500\", \"700\").\r\n * @returns An object representing the full color palette.\r\n */\r\nexport function generateTailwindPalette(\r\n baseColorHex: string,\r\n baseColorShade: PaletteShade = '500',\r\n): TailwindColorPalette {\r\n // 1. Get HSL of the input color\r\n const [h_base, s_base, l_base]: HSLTuple = hexToHsl(baseColorHex);\r\n\r\n // 2. Find the anchors\r\n const baseProfile = PALETTE_PROFILE[baseColorShade];\r\n\r\n /** The Hue is constant across the entire palette. */\r\n const h = h_base;\r\n\r\n /**\r\n * Calculate the 500-shade's saturation by \"reversing\" the adjustment\r\n * from the base color.\r\n * e.g., if base is 700 (s_adjust: +10) and s_base is 80,\r\n * s_500 will be 70.\r\n */\r\n const s_500 = clamp(s_base - baseProfile.s_adjust, 0, 100);\r\n\r\n /**\r\n * Calculate the lightness \"offset\". This is the difference between\r\n * the base color's actual lightness and its \"ideal\" lightness\r\n * from the profile.\r\n * e.g., if base is 700 (ideal L: 35) and l_base is 38,\r\n * the offset is +3. This offset will be applied to all shades.\r\n */\r\n const l_offset = l_base - baseProfile.l;\r\n\r\n // 3. Generate the full palette\r\n const palette: Partial<TailwindColorPalette> = {};\r\n\r\n for (const shade of ALL_SHADES) {\r\n const profile = PALETTE_PROFILE[shade];\r\n\r\n // Calculate the new saturation and lightness for this shade\r\n const newS = clamp(s_500 + profile.s_adjust, 0, 100);\r\n const newL = clamp(profile.l + l_offset, 0, 100);\r\n\r\n palette[shade] = hslToHex(h, newS, newL);\r\n }\r\n\r\n // 4. Ensure the originally provided color is used exactly\r\n // (to avoid rounding errors from HSL conversion)\r\n palette[baseColorShade] = baseColorHex;\r\n\r\n return palette as TailwindColorPalette;\r\n}\r\n","import { providePrimeNG } from 'primeng/config';\r\nimport { generateTailwindPalette } from '../utils/theme';\r\nimport Aura from '@primeuix/themes/aura';\r\nimport { definePreset, updatePreset } from '@primeuix/themes';\r\nimport { ToastTokenSections } from '@primeuix/themes/types/toast';\r\nimport { EnvironmentProviders } from '@angular/core';\r\nimport { Preset } from '@primeuix/themes/types';\r\nimport { AuraBaseDesignTokens } from '@primeuix/themes/aura/base';\r\n\r\nexport interface MTThemeOptions {\r\n primaryColor?: string;\r\n textColor?: string;\r\n backgroundColor?: string;\r\n}\r\n\r\nconst toastStyle: ToastTokenSections.Success = {\r\n // borderColor: '{surface.300}',\r\n background: '{content.background}',\r\n // color: '{surface.600}',\r\n // closeButton: {\r\n // hoverBackground: '{surface.100}',\r\n // focusRing: {\r\n // color: '{surface.600}',\r\n // },\r\n // },\r\n};\r\n\r\nexport function changePrimaryColor(color: string): void {\r\n updatePreset({\r\n semantic: {\r\n primary: generateTailwindPalette(color || '#2AAEC0'),\r\n },\r\n });\r\n}\r\n\r\nexport function changeBackgroundColor(color?: string): void {\r\n if (color) {\r\n const palette = generateTailwindPalette(color, '100');\r\n document.documentElement.style.setProperty(\r\n '--app-background-light',\r\n palette['100'],\r\n );\r\n document.documentElement.style.setProperty(\r\n '--app-background-dark',\r\n palette['950'],\r\n );\r\n }\r\n}\r\n\r\nexport function changeTextColor(color: string): void {\r\n const palette = generateTailwindPalette(color ?? '#334155', '700');\r\n updatePreset({\r\n semantic: {\r\n colorScheme: {\r\n light: {\r\n text: {\r\n color: palette['700'],\r\n hoverColor: palette['800'],\r\n hoverMutedColor: palette['600'],\r\n mutedColor: palette['500'],\r\n },\r\n },\r\n dark: {\r\n text: {\r\n color: palette['0'],\r\n hoverColor: palette['0'],\r\n hoverMutedColor: palette['300'],\r\n mutedColor: palette['400'],\r\n },\r\n },\r\n },\r\n },\r\n });\r\n}\r\n\r\nconst MTPreset = (themeOptions?: MTThemeOptions) => {\r\n const textPalette = generateTailwindPalette(\r\n themeOptions?.textColor ?? '#334155',\r\n '700',\r\n );\r\n const configs: Preset<AuraBaseDesignTokens> = {\r\n options: {\r\n prefix: 'mt',\r\n cssLayer: {\r\n name: 'primeng',\r\n order: 'theme, base, primeng',\r\n },\r\n },\r\n semantic: {\r\n colorScheme: {\r\n light: {\r\n text: {\r\n color: textPalette['700'],\r\n hoverColor: textPalette['800'],\r\n hoverMutedColor: textPalette['600'],\r\n mutedColor: textPalette['500'],\r\n },\r\n },\r\n dark: {\r\n text: {\r\n color: textPalette['0'],\r\n hoverColor: textPalette['0'],\r\n hoverMutedColor: textPalette['300'],\r\n mutedColor: textPalette['400'],\r\n },\r\n },\r\n },\r\n primary: generateTailwindPalette(themeOptions?.primaryColor || '#2AAEC0'),\r\n content: {\r\n borderRadius: '{border.radius.lg}',\r\n },\r\n formField: {\r\n borderRadius: '{border.radius.lg}',\r\n },\r\n },\r\n components: {\r\n dialog: {\r\n header: {\r\n padding: '0',\r\n },\r\n content: {\r\n padding: '0',\r\n },\r\n footer: {\r\n padding: '0',\r\n },\r\n },\r\n toast: {\r\n root: {\r\n borderRadius: '{border.radius.xl}',\r\n },\r\n colorScheme: {\r\n light: {\r\n success: toastStyle,\r\n info: toastStyle,\r\n warn: toastStyle,\r\n error: toastStyle,\r\n secondary: toastStyle,\r\n },\r\n dark: {\r\n success: toastStyle,\r\n info: toastStyle,\r\n warn: toastStyle,\r\n error: toastStyle,\r\n secondary: toastStyle,\r\n },\r\n },\r\n },\r\n togglebutton: {\r\n root: {\r\n padding: '1px',\r\n },\r\n colorScheme: {\r\n light: {\r\n root: {\r\n checkedColor: '{primary.500}',\r\n },\r\n },\r\n dark: {\r\n root: {\r\n checkedColor: '{primary.400}',\r\n },\r\n },\r\n },\r\n },\r\n selectbutton: {\r\n root: {\r\n borderRadius: '{border.radius.lg}',\r\n },\r\n },\r\n\r\n paginator: {\r\n root: {\r\n borderRadius: '{border.radius.lg}',\r\n padding: '0 .5rem',\r\n },\r\n navButton: {\r\n borderRadius: '0',\r\n },\r\n\r\n colorScheme: {\r\n light: {\r\n navButton: {\r\n color: '{surface.600}',\r\n hoverBackground: '#fff',\r\n selectedBackground: '{surface.200}',\r\n selectedColor: '{surface.600}',\r\n focusRing: {\r\n color: '{surface.200}',\r\n },\r\n },\r\n },\r\n dark: {\r\n navButton: {\r\n color: '{surface.200}',\r\n hoverBackground: 'transparent',\r\n selectedBackground: 'transparent',\r\n selectedColor: '#fff',\r\n focusRing: {\r\n color: '#fff',\r\n },\r\n },\r\n },\r\n },\r\n\r\n css: () => `\r\n .p-paginator {\r\n --p-paginator-gap: 0;\r\n --p-paginator-nav-button-width: 2.2rem;\r\n --p-paginator-nav-button-height: 2.2rem;\r\n width: fit-content;\r\n border: 1px solid var(--p-surface-200);\r\n overflow: hidden;\r\n font-size: .95rem;\r\n }\r\n\r\n .p-paginator-pages button,\r\n .p-paginator-prev,\r\n .p-paginator-next {\r\n border-color: var(--p-surface-200);\r\n }\r\n\r\n .p-paginator-pages button {\r\n border-style: solid;\r\n border-width: 0 0 0 1px;\r\n }\r\n\r\n .p-paginator-pages button:first-child {\r\n border-left: none;\r\n }\r\n\r\n .p-paginator-prev {\r\n border-right: 1px solid var(--p-surface-200);\r\n }\r\n\r\n .p-paginator-next {\r\n border-left: 1px solid var(--p-surface-200);\r\n }\r\n\r\n .p-paginator .p-select {\r\n border: 0;\r\n background: transparent;\r\n }\r\n\r\n .p-paginator .p-select .p-select-label {\r\n padding: 0;\r\n }\r\n\r\n /* Dark Mode Styles */\r\n .dark .p-paginator {\r\n border-color: var(--p-surface-500);\r\n }\r\n\r\n .dark .p-paginator-pages button,\r\n .dark .p-paginator-prev,\r\n .dark .p-paginator-next {\r\n border-color: var(--p-surface-500);\r\n }\r\n\r\n .dark .p-paginator-prev {\r\n border-right-color: var(--p-surface-500);\r\n }\r\n\r\n .dark .p-paginator-next {\r\n border-left-color: var(--p-surface-500);\r\n }\r\n `,\r\n },\r\n\r\n toggleswitch: {\r\n root: {\r\n width: '2.5rem',\r\n height: '1.4rem',\r\n },\r\n },\r\n select: {\r\n optionGroup: {\r\n fontWeight: 'bold',\r\n padding: '6px 8px',\r\n background: '{surface.50}',\r\n color: '{primary.700}',\r\n },\r\n },\r\n\r\n // steps: {\r\n // item: {\r\n // link: {\r\n // gap: 'calc(50% + 0.25rem)',\r\n // },\r\n // number: {\r\n // font: {\r\n // size: '0.9rem',\r\n // },\r\n // active: {\r\n // color: 'white',\r\n // background: '{primary.500}',\r\n // border: {\r\n // color: '{primary.500}',\r\n // },\r\n // },\r\n // },\r\n // },\r\n // },\r\n },\r\n };\r\n\r\n return definePreset(Aura, configs);\r\n};\r\n\r\nexport function provideMTComponents(\r\n themeOptions?: MTThemeOptions,\r\n): EnvironmentProviders {\r\n changeBackgroundColor(themeOptions?.backgroundColor);\r\n return providePrimeNG({\r\n zIndex: {\r\n modal: 1900,\r\n overlay: 1500,\r\n menu: 1500,\r\n tooltip: 1600,\r\n },\r\n theme: {\r\n preset: MTPreset(themeOptions),\r\n options: {\r\n darkModeSelector: '.dark',\r\n },\r\n },\r\n });\r\n}\r\n","import { MessageService } from 'primeng/api';\r\n\r\nexport function provideMTMessages() {\r\n return MessageService;\r\n}\r\n","import { ConfirmationService } from 'primeng/api';\r\n\r\nexport function provideMTConfirmation() {\r\n return ConfirmationService;\r\n}\r\n","import { HttpContext } from '@angular/common/http';\r\nimport { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\r\n\r\nexport type FieldType =\r\n | 'text'\r\n | 'textarea'\r\n | 'select'\r\n | 'date'\r\n | 'number'\r\n | 'slider'\r\n | 'multi-select'\r\n | 'pick-list'\r\n | 'checkbox'\r\n | 'icon-field'\r\n | 'color-picker'\r\n | 'spacer'\r\n | string;\r\n\r\nexport type ValidatorType =\r\n | 'required'\r\n | 'email'\r\n | 'minLength'\r\n | 'maxLength'\r\n | 'min'\r\n | 'max'\r\n | 'pattern'\r\n | 'custom';\r\n\r\nexport type FieldRelationAction = 'enable' | 'disable' | 'show' | 'hide';\r\n\r\nexport interface FieldRelationConfig {\r\n key: string;\r\n value: any;\r\n action: FieldRelationAction;\r\n}\r\n\r\nexport interface ResponsiveColSpan {\r\n // Container\r\n xs?: number; // @xs\r\n sm?: number; // @sm\r\n md?: number; // @md\r\n lg?: number; // @lg\r\n xl?: number; // @xl\r\n}\r\n\r\nexport class ValidatorConfig {\r\n type: ValidatorType;\r\n value?: any;\r\n message?: string;\r\n customValidator?: (value: any) => boolean | Promise<boolean>;\r\n\r\n constructor(config: {\r\n type: ValidatorType;\r\n value?: any;\r\n message?: string;\r\n customValidator?: (value: any) => boolean | Promise<boolean>;\r\n }) {\r\n this.type = config.type;\r\n this.value = config.value;\r\n this.message = config.message;\r\n this.customValidator = config.customValidator;\r\n }\r\n\r\n // Factory methods for common validators\r\n static required(message = 'This field is required'): ValidatorConfig {\r\n return new ValidatorConfig({ type: 'required', message });\r\n }\r\n\r\n static email(message = 'Please enter a valid email'): ValidatorConfig {\r\n return new ValidatorConfig({ type: 'email', message });\r\n }\r\n\r\n static minLength(length: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'minLength',\r\n value: length,\r\n message: message || `Minimum length is ${length} characters`,\r\n });\r\n }\r\n\r\n static maxLength(length: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'maxLength',\r\n value: length,\r\n message: message || `Maximum length is ${length} characters`,\r\n });\r\n }\r\n\r\n static min(value: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'min',\r\n value,\r\n message: message || `Minimum value is ${value}`,\r\n });\r\n }\r\n\r\n static max(value: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'max',\r\n value,\r\n message: message || `Maximum value is ${value}`,\r\n });\r\n }\r\n\r\n static pattern(pattern: string, message = 'Invalid format'): ValidatorConfig {\r\n return new ValidatorConfig({ type: 'pattern', value: pattern, message });\r\n }\r\n\r\n static custom(\r\n validator: (value: any) => boolean | Promise<boolean>,\r\n message = 'Invalid value',\r\n ): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'custom',\r\n customValidator: validator,\r\n message,\r\n });\r\n }\r\n}\r\n\r\nexport type BaseFieldConstructorConfig = ConstructorParameters<\r\n typeof BaseFieldConfig\r\n>[0];\r\n\r\nexport abstract class BaseFieldConfig {\r\n key: string;\r\n label: string;\r\n type: FieldType;\r\n required: boolean;\r\n disabled: boolean;\r\n readonly: boolean;\r\n hidden: boolean;\r\n placeholder: string;\r\n hint: string;\r\n cssClass: string;\r\n validators: ValidatorConfig[];\r\n order: number;\r\n colSpan: number | ResponsiveColSpan;\r\n\r\n defaultValue?: any;\r\n\r\n customTemplate: string;\r\n relations: FieldRelationConfig[];\r\n\r\n constructor(config: {\r\n key?: string;\r\n label?: string;\r\n type: FieldType;\r\n required?: boolean;\r\n disabled?: boolean;\r\n readonly?: boolean;\r\n hidden?: boolean;\r\n placeholder?: string;\r\n hint?: string;\r\n cssClass?: string;\r\n validators?: ValidatorConfig[];\r\n order?: number;\r\n relations?: FieldRelationConfig[];\r\n colSpan?: number | ResponsiveColSpan;\r\n }) {\r\n this.key = config.key || 'Key';\r\n this.label = config.label || '';\r\n this.type = config.type;\r\n this.required = config.required || false;\r\n this.disabled = config.disabled || false;\r\n this.readonly = config.readonly || false;\r\n this.hidden = config.hidden || false;\r\n this.placeholder = config.placeholder || '';\r\n this.hint = config.hint || '';\r\n this.cssClass = config.cssClass || '';\r\n this.validators = config.validators || [];\r\n this.order = config.order || 0;\r\n this.relations = config.relations || [];\r\n this.colSpan = config.colSpan || 12;\r\n }\r\n}\r\n\r\n// Specific configurations for different field types\r\nexport class TextFieldConfig extends BaseFieldConfig {\r\n inputType: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n inputType?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'text' });\r\n this.inputType = config.inputType || 'text';\r\n }\r\n}\r\n\r\nexport class TextareaFieldConfig extends BaseFieldConfig {\r\n rows: number;\r\n autoResize: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n rows?: number;\r\n autoResize?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'textarea' });\r\n this.rows = config.rows || 3;\r\n this.autoResize = config.autoResize || false;\r\n }\r\n}\r\n\r\nexport class SelectFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n multiple: boolean;\r\n filter: boolean;\r\n filterBy: string;\r\n filterPlaceholder: string;\r\n showClear: boolean;\r\n emptyMessage: string;\r\n size: string;\r\n hasPlaceholderPrefix: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n multiple?: boolean;\r\n filter?: boolean;\r\n filterBy?: string;\r\n filterPlaceholder?: string;\r\n showClear?: boolean;\r\n emptyMessage?: string;\r\n size?: string;\r\n hasPlaceholderPrefix?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'select' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.multiple = config.multiple || false;\r\n this.filter = config.filter || false;\r\n this.filterBy = config.filterBy || '';\r\n this.filterPlaceholder = config.filterPlaceholder || 'Search...';\r\n this.showClear = config.showClear || false;\r\n this.emptyMessage = config.emptyMessage || 'No options available';\r\n this.size = config.size || '';\r\n this.hasPlaceholderPrefix = config.hasPlaceholderPrefix!;\r\n }\r\n}\r\n\r\nexport class RadioButtonFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n orientation: 'vertical' | 'horizontal';\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n orientation?: 'vertical' | 'horizontal';\r\n },\r\n ) {\r\n super({ ...config, type: 'radio-button' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.orientation = config.orientation || 'vertical';\r\n }\r\n}\r\nexport class RadioCardsFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n size: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n size?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'radio-cards' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.size = config.size || 'small';\r\n }\r\n}\r\nexport class UserSearchFieldConfig extends BaseFieldConfig {\r\n optionLabel: string;\r\n optionValue: string;\r\n size: string;\r\n apiUrl: string;\r\n context: HttpContext | undefined;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n optionLabel?: string;\r\n optionValue?: string;\r\n size?: string;\r\n hint?: string;\r\n apiUrl?: string;\r\n context?: HttpContext | undefined;\r\n placeholder?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'user-search' });\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.size = config.size || '';\r\n this.hint = config.hint || '';\r\n this.context = config.context || undefined;\r\n this.apiUrl = config.apiUrl || '';\r\n this.placeholder = config.placeholder || 'Search';\r\n }\r\n}\r\n\r\nexport class UploadFileFieldConfig extends BaseFieldConfig {\r\n size: string;\r\n endPoint?: string;\r\n userImgClass?: string;\r\n shape?: string;\r\n accept?: string;\r\n fileSizeLimit?: number | undefined;\r\n context: HttpContext | undefined;\r\n title: string;\r\n description: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n size?: string;\r\n endPoint?: string;\r\n userImgClass?: string;\r\n shape?: string;\r\n accept?: string;\r\n fileSizeLimit?: number | undefined;\r\n context?: HttpContext | undefined;\r\n title?: string;\r\n description?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'upload-file' });\r\n this.size = config.size || 'normal';\r\n this.endPoint = config.endPoint || 'uploader';\r\n this.userImgClass =\r\n config.userImgClass || 'w-25! h-25! text-4xl! text-gray-400!';\r\n this.shape = config.shape || 'field';\r\n this.accept = config.accept || '.pdf,.doc,.docx,.xlsx,image/*';\r\n this.fileSizeLimit = config.fileSizeLimit || undefined;\r\n this.context = config.context || undefined;\r\n this.title = config.title || 'Upload File';\r\n this.description = config.description || 'Click or drop a file to upload';\r\n }\r\n}\r\n\r\nexport class DateFieldConfig extends BaseFieldConfig {\r\n dateFormat: string;\r\n showTime: boolean;\r\n showSeconds: boolean;\r\n hourFormat: '12' | '24';\r\n minDate?: Date;\r\n maxDate?: Date;\r\n disabledDates: Date[];\r\n disabledDays: number[];\r\n yearRange: string;\r\n showIcon: boolean;\r\n icon: string;\r\n showButtonBar: boolean;\r\n showClear: boolean;\r\n inline: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n dateFormat?: string;\r\n showTime?: boolean;\r\n showSeconds?: boolean;\r\n hourFormat?: '12' | '24';\r\n minDate?: Date;\r\n maxDate?: Date;\r\n disabledDates?: Date[];\r\n disabledDays?: number[];\r\n yearRange?: string;\r\n showIcon?: boolean;\r\n icon?: string;\r\n showButtonBar?: boolean;\r\n showClear?: boolean;\r\n inline?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'date' });\r\n this.dateFormat = config.dateFormat || 'yyyy-mm-dd';\r\n this.showTime = config.showTime || false;\r\n this.showSeconds = config.showSeconds || false;\r\n this.hourFormat = config.hourFormat || '24';\r\n this.minDate = config.minDate;\r\n this.maxDate = config.maxDate;\r\n this.disabledDates = config.disabledDates || [];\r\n this.disabledDays = config.disabledDays || [];\r\n this.yearRange = config.yearRange || '1900:2030';\r\n this.showIcon = config.showIcon || true;\r\n this.icon = config.icon || 'pi pi-calendar';\r\n this.showButtonBar = config.showButtonBar || false;\r\n this.showClear = config.showClear || true;\r\n this.inline = config.inline || false;\r\n }\r\n}\r\n\r\nexport class NumberFieldConfig extends BaseFieldConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n prefix?: string;\r\n suffix?: string;\r\n currency?: string;\r\n locale?: string;\r\n minFractionDigits?: number;\r\n maxFractionDigits?: number;\r\n useGrouping?: boolean;\r\n showButtons?: boolean;\r\n buttonLayout?: 'stacked' | 'horizontal';\r\n incrementButtonClass?: string;\r\n decrementButtonClass?: string;\r\n incrementButtonIcon?: string;\r\n decrementButtonIcon?: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n prefix?: string;\r\n suffix?: string;\r\n currency?: string;\r\n locale?: string;\r\n minFractionDigits?: number;\r\n maxFractionDigits?: number;\r\n useGrouping?: boolean;\r\n showButtons?: boolean;\r\n buttonLayout?: 'stacked' | 'horizontal';\r\n incrementButtonClass?: string;\r\n decrementButtonClass?: string;\r\n incrementButtonIcon?: string;\r\n decrementButtonIcon?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'number' });\r\n this.min = config.min;\r\n this.max = config.max;\r\n this.step = config.step || 1;\r\n this.prefix = config.prefix;\r\n this.suffix = config.suffix;\r\n this.currency = config.currency;\r\n this.locale = config.locale;\r\n this.minFractionDigits = config.minFractionDigits;\r\n this.maxFractionDigits = config.maxFractionDigits;\r\n this.useGrouping = config.useGrouping || false;\r\n this.showButtons = config.showButtons || false;\r\n this.buttonLayout = config.buttonLayout || 'stacked';\r\n this.incrementButtonClass = config.incrementButtonClass;\r\n this.decrementButtonClass = config.decrementButtonClass;\r\n this.incrementButtonIcon = config.incrementButtonIcon;\r\n this.decrementButtonIcon = config.decrementButtonIcon;\r\n }\r\n}\r\n\r\nexport class SliderFieldConfig extends BaseFieldConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n orientation?: 'horizontal' | 'vertical';\r\n range?: boolean;\r\n animate?: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n orientation?: 'horizontal' | 'vertical';\r\n range?: boolean;\r\n animate?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'slider' });\r\n this.min = config.min || 0;\r\n this.max = config.max || 100;\r\n this.step = config.step || 1;\r\n this.orientation = config.orientation || 'horizontal';\r\n this.range = config.range || false;\r\n this.animate = config.animate || false;\r\n }\r\n}\r\n\r\nexport class MultiSelectFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n filter: boolean;\r\n filterBy: string;\r\n filterPlaceholder: string;\r\n showClear: boolean;\r\n emptyMessage: string;\r\n display?: 'comma' | 'chip';\r\n maxSelectedLabels?: number;\r\n selectedItemsLabel?: string;\r\n showToggleAll?: boolean;\r\n resetFilterOnHide?: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n filter?: boolean;\r\n filterBy?: string;\r\n filterPlaceholder?: string;\r\n showClear?: boolean;\r\n emptyMessage?: string;\r\n display?: 'comma' | 'chip';\r\n maxSelectedLabels?: number;\r\n selectedItemsLabel?: string;\r\n showToggleAll?: boolean;\r\n resetFilterOnHide?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'multi-select' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.filter = config.filter || false;\r\n this.filterBy = config.filterBy || '';\r\n this.filterPlaceholder = config.filterPlaceholder || 'Search...';\r\n this.showClear = config.showClear || false;\r\n this.emptyMessage = config.emptyMessage || 'No options available';\r\n this.display = config.display || 'comma';\r\n this.maxSelectedLabels = config.maxSelectedLabels || 3;\r\n this.selectedItemsLabel = config.selectedItemsLabel || '{0} items selected';\r\n this.showToggleAll = config.showToggleAll || true;\r\n this.resetFilterOnHide = config.resetFilterOnHide || false;\r\n }\r\n}\r\n\r\nexport class PickListFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n sourceHeader: string;\r\n targetHeader: string;\r\n showSourceControls: boolean;\r\n showTargetControls: boolean;\r\n showSourceFilter: boolean;\r\n showTargetFilter: boolean;\r\n filterBy: string;\r\n dataKey?: string;\r\n dragdrop: boolean;\r\n responsive: boolean;\r\n breakpoint: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n sourceHeader?: string;\r\n targetHeader?: string;\r\n showSourceControls?: boolean;\r\n showTargetControls?: boolean;\r\n showSourceFilter?: boolean;\r\n showTargetFilter?: boolean;\r\n filterBy?: string;\r\n dataKey?: string;\r\n dragdrop?: boolean;\r\n responsive?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'pick-list' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.sourceHeader = config.sourceHeader || 'Available';\r\n this.targetHeader = config.targetHeader || 'Selected';\r\n this.showSourceControls =\r\n config.showSourceControls !== undefined\r\n ? config.showSourceControls\r\n : true;\r\n this.showTargetControls =\r\n config.showTargetControls !== undefined\r\n ? config.showTargetControls\r\n : true;\r\n this.showSourceFilter =\r\n config.showSourceFilter !== undefined ? config.showSourceFilter : false;\r\n this.showTargetFilter =\r\n config.showTargetFilter !== undefined ? config.showTargetFilter : false;\r\n this.filterBy = config.filterBy || this.optionLabel;\r\n this.dataKey = config.dataKey || this.optionValue;\r\n this.dragdrop = config.dragdrop ?? false;\r\n this.responsive = config.responsive ?? true;\r\n }\r\n}\r\n\r\nexport class CheckboxFieldConfig extends BaseFieldConfig {\r\n binary?: boolean;\r\n trueValue?: any;\r\n falseValue?: any;\r\n checkboxIcon?: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n binary?: boolean;\r\n trueValue?: any;\r\n falseValue?: any;\r\n checkboxIcon?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'checkbox' });\r\n this.binary = config.binary !== false; // Default to true\r\n this.trueValue = config.trueValue !== undefined ? config.trueValue : true;\r\n this.falseValue =\r\n config.falseValue !== undefined ? config.falseValue : false;\r\n this.checkboxIcon = config.checkboxIcon;\r\n }\r\n}\r\nexport class ToggleFieldConfig extends BaseFieldConfig {\r\n toggleShape?: 'toggle' | 'card';\r\n icon?: string;\r\n descriptionCard?: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n toggleShape?: 'toggle' | 'card';\r\n icon?: string;\r\n descriptionCard?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'toggle' });\r\n this.toggleShape = config.toggleShape ?? 'toggle';\r\n this.icon = config.icon;\r\n this.descriptionCard = config.descriptionCard;\r\n }\r\n}\r\nexport class EditorFieldConfig extends BaseFieldConfig {\r\n constructor(config: Omit<BaseFieldConstructorConfig, 'type'>) {\r\n super({ ...config, type: 'editor-field' });\r\n }\r\n}\r\n\r\nexport class ColorPickerFieldConfig extends BaseFieldConfig {\r\n format?: 'hex' | 'rgb' | 'hsb';\r\n inline?: boolean;\r\n appendTo?: any;\r\n variant?: 'outlined' | 'filled';\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n format?: 'hex' | 'rgb' | 'hsb';\r\n inline?: boolean;\r\n appendTo?: any;\r\n variant?: 'outlined' | 'filled';\r\n },\r\n ) {\r\n super({ ...config, type: 'color-picker' });\r\n this.format = config.format || 'hex';\r\n this.inline = config.inline || false;\r\n this.appendTo = config.appendTo || 'body';\r\n this.variant = config.variant || 'outlined';\r\n }\r\n}\r\n\r\nexport class IconFieldConfig extends BaseFieldConfig {\r\n constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {}) {\r\n super({ ...config, type: 'icon-field' });\r\n }\r\n}\r\n\r\nexport class SpacerFieldConfig extends BaseFieldConfig {\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type' | 'key' | 'label'> & {\r\n key?: string;\r\n label?: string;\r\n },\r\n ) {\r\n super({\r\n ...config,\r\n type: 'spacer',\r\n key: config.key || `spacer_${Date.now()}`,\r\n label: config.label || '',\r\n });\r\n }\r\n}\r\n\r\n// Union type for all field configurations\r\nexport type DynamicFieldConfig = {\r\n [K in keyof (TextFieldConfig &\r\n TextareaFieldConfig &\r\n SelectFieldConfig &\r\n DateFieldConfig &\r\n NumberFieldConfig &\r\n SliderFieldConfig &\r\n MultiSelectFieldConfig &\r\n PickListFieldConfig &\r\n CheckboxFieldConfig &\r\n ToggleFieldConfig &\r\n ColorPickerFieldConfig &\r\n IconFieldConfig &\r\n SpacerFieldConfig &\r\n BaseFieldConfig)]?: (TextFieldConfig &\r\n TextareaFieldConfig &\r\n SelectFieldConfig &\r\n DateFieldConfig &\r\n NumberFieldConfig &\r\n SliderFieldConfig &\r\n MultiSelectFieldConfig &\r\n PickListFieldConfig &\r\n CheckboxFieldConfig &\r\n ToggleFieldConfig &\r\n ColorPickerFieldConfig &\r\n IconFieldConfig &\r\n SpacerFieldConfig &\r\n BaseFieldConfig)[K];\r\n};\r\n\r\n// Layout configuration\r\nexport interface LayoutConfig {\r\n containerClass?: string;\r\n sectionClass?: string;\r\n fieldClass?: string;\r\n}\r\n\r\n// Simplified form configuration interface\r\nexport interface DynamicFormConfig {\r\n sections: SectionConfig[];\r\n layout?: LayoutConfig;\r\n}\r\nexport interface SectionConfig {\r\n key?: string;\r\n label?: string;\r\n type: 'none' | 'header';\r\n cssClass?: string;\r\n bodyClass?: string;\r\n headerClass?: string;\r\n columns?: number;\r\n\r\n order?: number;\r\n fields: DynamicFieldConfig[];\r\n}\r\nexport interface FieldState {\r\n hidden: boolean;\r\n disabled: boolean;\r\n}\r\n\r\nexport function createCustomValidator(\r\n customValidator: (value: any) => boolean | Promise<boolean>,\r\n message?: string,\r\n): ValidatorFn {\r\n return (control: AbstractControl): ValidationErrors | null => {\r\n const result = customValidator(control.value);\r\n\r\n if (result instanceof Promise) {\r\n // Handle async validation\r\n result.then((isValid) => {\r\n if (!isValid) {\r\n control.setErrors({\r\n custom: { message: message || 'Invalid value' },\r\n });\r\n }\r\n });\r\n return null; // For async, return null initially\r\n } else {\r\n // Handle sync validation\r\n return result\r\n ? null\r\n : { custom: { message: message || 'Invalid value' } };\r\n }\r\n };\r\n}\r\n\r\nexport function wrapValidatorWithMessage(\r\n validator: ValidatorFn,\r\n errorKey: string,\r\n message: string,\r\n): ValidatorFn {\r\n return (control: AbstractControl): ValidationErrors | null => {\r\n const result = validator(control);\r\n if (result) {\r\n // Replace the default error with custom message\r\n return { [errorKey]: { ...result[Object.keys(result)[0]], message } };\r\n }\r\n return null;\r\n };\r\n}\r\n// DynamicFieldConfig = input.required<any>({\r\n// transform: (value: any) => this.transformToDateFieldConfig(value)\r\n// });\r\n// transformToDateFieldConfig(value: any){\r\n// return new TextFieldConfig()\r\n// }\r\n","import { computed, Signal } from '@angular/core';\r\n\r\n/**\r\n * Query result with separate signals for each property\r\n */\r\nexport interface QueryResult<T> {\r\n data: Signal<T | null>;\r\n isPending: Signal<boolean>;\r\n isSuccess: Signal<boolean>;\r\n isError: Signal<boolean>;\r\n error: Signal<string | null>;\r\n}\r\n\r\n/**\r\n * Base facade with smart query selector factory\r\n */\r\nexport abstract class BaseFacade<TState, TLoadingName extends string> {\r\n /**\r\n * Override in child facade to provide the state selector\r\n */\r\n protected abstract state(): Signal<TState>;\r\n\r\n /**\r\n * Creates a query object with separate signals for data, loading, and error states\r\n * Each property is its own signal for granular reactivity\r\n *\r\n * @example\r\n * readonly modulesQuery = this.query(\r\n * 'getModulesLoading',\r\n * (state) => state.allModules\r\n * );\r\n *\r\n * // In template - each is a separate signal:\r\n * @if (modulesQuery.isPending()) { Loading... }\r\n * @if (modulesQuery.error(); as error) { Error: {{ error }} }\r\n * @if (modulesQuery.data(); as modules) {\r\n * <div *ngFor=\"let m of modules\">{{ m.title }}</div>\r\n * }\r\n */\r\n protected query<T>(\r\n loadingKey: TLoadingName,\r\n dataSelector: (state: TState) => T,\r\n ): QueryResult<T> {\r\n const stateSignal = this.state();\r\n\r\n const isPending = computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.loadingActive?.includes(loadingKey) ?? false;\r\n });\r\n\r\n const error = computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.errors?.[loadingKey] ?? null;\r\n });\r\n\r\n const data = computed(() => {\r\n const currentState = stateSignal() as any;\r\n const hasError = currentState.errors?.[loadingKey];\r\n return hasError ? null : dataSelector(currentState);\r\n });\r\n\r\n const isSuccess = computed(\r\n () => !isPending() && !error() && data() !== null,\r\n );\r\n\r\n const isError = computed(() => !!error());\r\n\r\n return {\r\n data,\r\n isPending,\r\n isSuccess,\r\n isError,\r\n error,\r\n };\r\n }\r\n\r\n /**\r\n * Creates a loading signal for a specific operation\r\n */\r\n protected loading(loadingKey: TLoadingName): Signal<boolean> {\r\n const stateSignal = this.state();\r\n return computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.loadingActive?.includes(loadingKey) ?? false;\r\n });\r\n }\r\n\r\n /**\r\n * Creates an error signal for a specific operation\r\n */\r\n protected errorSignal(loadingKey: TLoadingName): Signal<string | null> {\r\n const stateSignal = this.state();\r\n return computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.errors?.[loadingKey] ?? null;\r\n });\r\n }\r\n}\r\n","export interface EntityAdapter<T> {\r\n addOne(state: T[], entity: T): T[];\r\n upsertOne(state: T[], entity: T, uniqueKey?: keyof T): T[];\r\n updateOne(\r\n state: T[],\r\n id: string | number,\r\n changes: Partial<T>,\r\n uniqueKey?: keyof T,\r\n ): T[];\r\n removeOne(state: T[], id: string | number, uniqueKey?: keyof T): T[];\r\n setAll(state: T[], entities: T[]): T[];\r\n}\r\n\r\nexport function createEntityAdapter<T>(): EntityAdapter<T> {\r\n return {\r\n addOne: (state: T[], entity: T): T[] => [...state, entity],\r\n\r\n upsertOne: (\r\n state: T[],\r\n entity: T,\r\n uniqueKey: keyof T = 'id' as keyof T,\r\n ): T[] => {\r\n const key = entity[uniqueKey];\r\n if (key == null) return state;\r\n const index = state.findIndex((e) => e[uniqueKey] === key);\r\n if (index === -1) {\r\n return [...state, entity];\r\n }\r\n const clone = [...state];\r\n clone[index] = entity;\r\n return clone;\r\n },\r\n\r\n updateOne: (\r\n state: T[],\r\n id: string | number,\r\n changes: Partial<T>,\r\n uniqueKey: keyof T = 'id' as keyof T,\r\n ): T[] =>\r\n state.map((e) => (e[uniqueKey] === id ? { ...e, ...changes } : e)),\r\n\r\n removeOne: (\r\n state: T[],\r\n id: string | number,\r\n uniqueKey: keyof T = 'id' as keyof T,\r\n ): T[] => state.filter((e) => e[uniqueKey] !== id),\r\n\r\n setAll: (_state: T[], entities: T[]): T[] => [...entities],\r\n };\r\n}\r\n","import type { StateContext } from '@ngxs/store';\r\n\r\nexport interface LoadingStateShape<L extends string = string> {\r\n loadingActive: L[];\r\n errors: Partial<Record<L, string>>;\r\n}\r\n\r\ntype LoadingName<T extends LoadingStateShape<string>> =\r\n T['loadingActive'][number];\r\n\r\nexport function startLoading<T extends LoadingStateShape<string>>(\r\n ctx: StateContext<T>,\r\n loadingName: LoadingName<T>,\r\n): void {\r\n const { loadingActive, errors } = ctx.getState();\r\n\r\n if (!loadingActive.includes(loadingName)) {\r\n ctx.patchState({\r\n loadingActive: [...loadingActive, loadingName],\r\n } as Partial<T>);\r\n }\r\n\r\n if (errors && errors[loadingName]) {\r\n const { [loadingName]: _removed, ...rest } = errors;\r\n ctx.patchState({ errors: rest } as Partial<T>);\r\n }\r\n}\r\n\r\nexport function endLoading<T extends LoadingStateShape<string>>(\r\n ctx: StateContext<T>,\r\n loadingName: LoadingName<T>,\r\n): void {\r\n const { loadingActive } = ctx.getState();\r\n\r\n ctx.patchState({\r\n loadingActive: loadingActive.filter((name) => name !== loadingName),\r\n } as Partial<T>);\r\n}\r\n\r\nexport function setLoadingError<T extends LoadingStateShape<string>>(\r\n ctx: StateContext<T>,\r\n loadingName: LoadingName<T>,\r\n message: string,\r\n): void {\r\n const { errors } = ctx.getState();\r\n ctx.patchState({\r\n errors: { ...errors, [loadingName]: message },\r\n } as Partial<T>);\r\n}\r\n","import { StateContext } from '@ngxs/store';\r\nimport { Observable } from 'rxjs';\r\nimport { tap, catchError, finalize } from 'rxjs/operators';\r\nimport {\r\n startLoading,\r\n endLoading,\r\n setLoadingError,\r\n LoadingStateShape,\r\n} from './state-helpers';\r\n\r\nexport interface ApiRequestConfig<TState, TResponse> {\r\n ctx: StateContext<TState>;\r\n key: string;\r\n request$: Observable<TResponse>;\r\n onSuccess: (response: TResponse, state: TState) => Partial<TState> | void;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport function handleApiRequest<\r\n TState extends LoadingStateShape<string>,\r\n TResponse,\r\n>(config: ApiRequestConfig<TState, TResponse>) {\r\n const { ctx, key, request$, onSuccess, onError, errorMessage } = config;\r\n\r\n startLoading(ctx, key);\r\n\r\n return request$.pipe(\r\n tap((response) => {\r\n const state = ctx.getState();\r\n const patch = onSuccess(response, state);\r\n if (patch) {\r\n ctx.patchState(patch);\r\n }\r\n }),\r\n catchError((error) => {\r\n const state = ctx.getState();\r\n const message = error?.error?.message ?? error?.message ?? errorMessage;\r\n setLoadingError(ctx, key, message);\r\n\r\n // Call onError callback if provided\r\n if (onError) {\r\n const patch = onError(error, state);\r\n if (patch) {\r\n ctx.patchState(patch);\r\n }\r\n }\r\n\r\n throw error;\r\n }),\r\n finalize(() => endLoading(ctx, key)),\r\n );\r\n}\r\n","import { StateContext } from '@ngxs/store';\r\nimport { Observable } from 'rxjs';\r\nimport { createEntityAdapter } from '../utils/entity-adapter';\r\nimport { handleApiRequest } from '../utils/api-request.helper';\r\nimport { LoadingStateShape } from '../utils/state-helpers';\r\n\r\nexport interface Response<T> {\r\n endpoint: string;\r\n status: number;\r\n code: number;\r\n locale: string;\r\n message?: string | null;\r\n errors?: unknown | null;\r\n data: T;\r\n cacheSession?: string;\r\n}\r\nexport interface CrudLoadConfig<T, TState, TData = T[]> {\r\n key: string;\r\n request$: Observable<Response<TData>>;\r\n stateProperty?: (state: TState) => T[];\r\n updateState?: (state: TState, data: TData) => Partial<TState>;\r\n transform?: (data: TData) => TData;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport interface CrudCreateConfig<T, TState> {\r\n key: string;\r\n request$: Observable<Response<T>>;\r\n stateProperty: (state: TState) => T[];\r\n updateState?: (state: TState, items: T[]) => Partial<TState>;\r\n transform?: (data: T) => T;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport interface CrudUpdateConfig<T, TState> {\r\n key: string;\r\n request$: Observable<Response<T>>;\r\n uniqueKey: keyof T;\r\n id: string | number;\r\n stateProperty: (state: TState) => T[];\r\n updateState?: (state: TState, items: T[]) => Partial<TState>;\r\n transform?: (data: T) => T;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport interface CrudDeleteConfig<T, TState> {\r\n key: string;\r\n request$: Observable<Response<void>>;\r\n uniqueKey: keyof T;\r\n id: string | number;\r\n stateProperty: (state: TState) => T[];\r\n updateState?: (state: TState, items: T[]) => Partial<TState>;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * T = entity type (Module, User, ...)\r\n * TState = full state model (must include LoadingStateShape)\r\n * TLoad = union type of loading keys for this feature\r\n */\r\nexport abstract class CrudStateBase<\r\n T,\r\n TState extends LoadingStateShape<TLoad>,\r\n TLoad extends string,\r\n> {\r\n protected adapter = createEntityAdapter<T>();\r\n\r\n /**\r\n * Helper to create default updateState function\r\n */\r\n private getDefaultUpdateState<TState>(\r\n stateProperty: (state: TState) => T[],\r\n ): (state: TState, items: T[]) => Partial<TState> {\r\n // Try to extract the property name from the stateProperty function\r\n const funcStr = stateProperty.toString();\r\n const match = funcStr.match(/\\.([a-zA-Z_$][a-zA-Z0-9_$]*)/); // Match .propertyName\r\n const key = match ? match[1] : 'items';\r\n\r\n return (state, items) => ({ [key]: items }) as Partial<TState>;\r\n }\r\n\r\n /**\r\n * Load data (single item or array) with config object\r\n */\r\n protected load<TData = T[]>(\r\n ctx: StateContext<TState>,\r\n config: CrudLoadConfig<T, TState, TData>,\r\n ) {\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (response, state) => {\r\n const data = config.transform\r\n ? config.transform(response.data)\r\n : response.data;\r\n\r\n // If stateProperty provided, use adapter for array operations\r\n if (config.stateProperty) {\r\n const items = this.adapter.setAll(\r\n config.stateProperty(state),\r\n data as T[],\r\n );\r\n const updateState =\r\n config.updateState ??\r\n this.getDefaultUpdateState(config.stateProperty);\r\n return updateState(state, items as any);\r\n }\r\n\r\n // Otherwise, use custom updateState directly\r\n if (config.updateState) {\r\n return config.updateState(state, data);\r\n }\r\n\r\n throw new Error('Either stateProperty or updateState must be provided');\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to load data',\r\n });\r\n }\r\n\r\n /**\r\n * Create one entity with config object\r\n */\r\n protected create(\r\n ctx: StateContext<TState>,\r\n config: CrudCreateConfig<T, TState>,\r\n ) {\r\n const updateState =\r\n config.updateState ?? this.getDefaultUpdateState(config.stateProperty);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (response, state) => {\r\n const entity = config.transform\r\n ? config.transform(response.data)\r\n : response.data;\r\n const items = this.adapter.addOne(config.stateProperty(state), entity);\r\n return updateState(state, items);\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to create item',\r\n });\r\n }\r\n\r\n /**\r\n * Update one entity with config object\r\n */\r\n protected update(\r\n ctx: StateContext<TState>,\r\n config: CrudUpdateConfig<T, TState>,\r\n ) {\r\n const updateState =\r\n config.updateState ?? this.getDefaultUpdateState(config.stateProperty);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (response, state) => {\r\n const entity = config.transform\r\n ? config.transform(response.data)\r\n : response.data;\r\n const items = this.adapter.upsertOne(\r\n config.stateProperty(state),\r\n entity,\r\n config.uniqueKey,\r\n );\r\n return updateState(state, items);\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to update item',\r\n });\r\n }\r\n\r\n /**\r\n * Delete one entity with config object\r\n */\r\n protected delete(\r\n ctx: StateContext<TState>,\r\n config: CrudDeleteConfig<T, TState>,\r\n ) {\r\n const updateState =\r\n config.updateState ?? this.getDefaultUpdateState(config.stateProperty);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (_response, state) => {\r\n const items = this.adapter.removeOne(\r\n config.stateProperty(state),\r\n config.id,\r\n config.uniqueKey,\r\n );\r\n return updateState(state, items);\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to delete item',\r\n });\r\n }\r\n}\r\n","import { AbstractControl } from '@angular/forms';\r\n\r\nexport function isInvalid(control: AbstractControl | null) {\r\n if (!control) return false;\r\n return control && control?.invalid && control?.touched;\r\n}\r\n","import { HttpContextToken } from '@angular/common/http';\r\n\r\n/**\r\n * HTTP context configuration for request handling\r\n */\r\nexport interface RequestContextConfig {\r\n /** Use base URL instead of gateway URL */\r\n useBaseUrl?: boolean;\r\n}\r\n\r\n/**\r\n * Shared HTTP context token for request configuration.\r\n * Used by interceptors to determine base URL routing.\r\n *\r\n * @example\r\n * ```typescript\r\n * import { REQUEST_CONTEXT } from '@masterteam/components';\r\n *\r\n * // In a service\r\n * private context = new HttpContext().set(REQUEST_CONTEXT, { useBaseUrl: true });\r\n *\r\n * getMetadata(): Observable<any> {\r\n * return this.http.get('metadata', { context: this.context });\r\n * }\r\n *\r\n * // In interceptor\r\n * const config = req.context.get(REQUEST_CONTEXT);\r\n * if (config?.useBaseUrl) {\r\n * // Use base URL\r\n * }\r\n * ```\r\n */\r\nexport const REQUEST_CONTEXT = new HttpContextToken<RequestContextConfig>(\r\n () => ({ useBaseUrl: false }),\r\n);\r\n","/*\r\n * Public API Surface of components\r\n */\r\n\r\n// Config\r\nexport * from './lib/config/providemt';\r\nexport * from './lib/config/povide-messages';\r\nexport * from './lib/config/provide-confirmation';\r\nexport * from './lib/config/dynamic-form.model';\r\n\r\n// Base classes\r\nexport * from './lib/base/base.facade';\r\nexport * from './lib/base/crud-base.state';\r\n\r\n// Utils\r\nexport * from './lib/utils/theme';\r\nexport * from './lib/utils/inputs';\r\nexport * from './lib/utils/state-helpers';\r\nexport * from './lib/utils/api-request.helper';\r\nexport * from './lib/utils/entity-adapter';\r\nexport * from './lib/utils/http-context';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAKA;;;;;AAKG;AACH,SAAS,QAAQ,CAAC,GAAW,EAAA;IAC3B,IAAI,CAAC,GAAW,CAAC,EACf,CAAC,GAAW,CAAC,EACb,CAAC,GAAW,CAAC;;AAGf,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AACp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../../packages/masterteam/components/src/lib/utils/theme.ts","../../../../packages/masterteam/components/src/lib/config/providemt.ts","../../../../packages/masterteam/components/src/lib/config/povide-messages.ts","../../../../packages/masterteam/components/src/lib/config/provide-confirmation.ts","../../../../packages/masterteam/components/src/lib/config/dynamic-form.model.ts","../../../../packages/masterteam/components/src/lib/base/base.facade.ts","../../../../packages/masterteam/components/src/lib/utils/entity-adapter.ts","../../../../packages/masterteam/components/src/lib/utils/state-helpers.ts","../../../../packages/masterteam/components/src/lib/utils/api-request.helper.ts","../../../../packages/masterteam/components/src/lib/base/crud-base.state.ts","../../../../packages/masterteam/components/src/lib/utils/inputs.ts","../../../../packages/masterteam/components/src/lib/utils/http-context.ts","../../../../packages/masterteam/components/src/public-api.ts","../../../../packages/masterteam/components/src/masterteam-components.ts"],"sourcesContent":["type HSLTuple = [number, number, number]; // [hue, saturation, lightness]\r\ntype TailwindColorPalette = {\r\n [key: string]: string; // e.g., '50': '#f0f9ff', '500': '#0284c7'\r\n};\r\n\r\n/**\r\n * Converts a hex color string to an HSL tuple.\r\n * @param hex - The hex color string (e.g., \"#RRGGBB\" or \"#RGB\").\r\n * @returns An HSL tuple [hue, saturation, lightness] where hue is in degrees (0-360),\r\n * and saturation/lightness are percentages (0-100).\r\n */\r\nfunction hexToHsl(hex: string): HSLTuple {\r\n let r: number = 0,\r\n g: number = 0,\r\n b: number = 0;\r\n\r\n // Handle shorthand hex codes\r\n if (hex.length === 4) {\r\n r = parseInt(hex[1] + hex[1], 16);\r\n g = parseInt(hex[2] + hex[2], 16);\r\n b = parseInt(hex[3] + hex[3], 16);\r\n } else if (hex.length === 7) {\r\n r = parseInt(hex.substring(1, 3), 16);\r\n g = parseInt(hex.substring(3, 5), 16);\r\n b = parseInt(hex.substring(5, 7), 16);\r\n } else {\r\n throw new Error('Invalid hex color format. Expected #RGB or #RRGGBB.');\r\n }\r\n\r\n r /= 255;\r\n g /= 255;\r\n b /= 255;\r\n\r\n const max: number = Math.max(r, g, b);\r\n const min: number = Math.min(r, g, b);\r\n let h: number = 0,\r\n s: number;\r\n const l: number = (max + min) / 2;\r\n\r\n if (max === min) {\r\n h = s = 0; // achromatic\r\n } else {\r\n const d: number = max - min;\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n\r\n return [h * 360, s * 100, l * 100]; // HSL in degrees, percentage, percentage\r\n}\r\n\r\n/**\r\n * Converts HSL values to a hex color string.\r\n * @param h - Hue (0-360).\r\n * @param s - Saturation (0-100).\r\n * @param l - Lightness (0-100).\r\n * @returns The hex color string (e.g., \"#RRGGBB\").\r\n */\r\nfunction hslToHex(h: number, s: number, l: number): string {\r\n l /= 100;\r\n const a: number = (s * Math.min(l, 1 - l)) / 100;\r\n const f = (n: number): string => {\r\n const k: number = (n + h / 30) % 12;\r\n const color: number = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\r\n return Math.round(255 * color)\r\n .toString(16)\r\n .padStart(2, '0');\r\n };\r\n return `#${f(0)}${f(8)}${f(4)}`;\r\n}\r\n\r\n/**\r\n * Generates a Tailwind-like color palette (50-950) from a primary color (assumed to be 500).\r\n *\r\n * @param primaryColor500 - The hex string of the primary color (e.g., \"#0284c7\").\r\n * @returns An object representing the color palette, where keys are color numbers (e.g., \"50\", \"100\")\r\n * and values are hex color strings.\r\n */\r\n// export function generateTailwindPalette(\r\n// primaryColor500: string,\r\n// ): TailwindColorPalette {\r\n// const [h, s, _l]: HSLTuple = hexToHsl(primaryColor500);\r\n//\r\n// const palette: TailwindColorPalette = {\r\n// '500': primaryColor500,\r\n// };\r\n//\r\n// // Define steps for lighter shades (50 - 400)\r\n// const lightnessStepsLighter: { [key: string]: number } = {\r\n// '50': 95,\r\n// '100': 90,\r\n// '200': 80,\r\n// '300': 70,\r\n// '400': 60,\r\n// };\r\n//\r\n// const saturationReductionsLighter: { [key: string]: number } = {\r\n// '50': 40, // More desaturated\r\n// '100': 30,\r\n// '200': 20,\r\n// '300': 10,\r\n// '400': 5, // Slightly desaturated\r\n// };\r\n//\r\n// for (const shade in lightnessStepsLighter) {\r\n// if (Object.prototype.hasOwnProperty.call(lightnessStepsLighter, shade)) {\r\n// const newL: number = lightnessStepsLighter[shade];\r\n// // Ensure saturation doesn't go below 0\r\n// const newS: number = Math.max(0, s - saturationReductionsLighter[shade]);\r\n// palette[shade] = hslToHex(h, newS, newL);\r\n// }\r\n// }\r\n//\r\n// // Define steps for darker shades (600 - 950)\r\n// const lightnessStepsDarker: { [key: string]: number } = {\r\n// '600': 45,\r\n// '700': 35,\r\n// '800': 25,\r\n// '900': 15,\r\n// '950': 8, // More aggressive darkening for 950\r\n// };\r\n//\r\n// const saturationIncreasesDarker: { [key: string]: number } = {\r\n// '600': 5,\r\n// '700': 10,\r\n// '800': 15,\r\n// '900': 20,\r\n// '950': 25, // Can increase saturation for darker shades\r\n// };\r\n//\r\n// for (const shade in lightnessStepsDarker) {\r\n// if (Object.prototype.hasOwnProperty.call(lightnessStepsDarker, shade)) {\r\n// const newL: number = lightnessStepsDarker[shade];\r\n// // Ensure saturation doesn't exceed 100\r\n// const newS: number = Math.min(100, s + saturationIncreasesDarker[shade]);\r\n// palette[shade] = hslToHex(h, newS, newL);\r\n// }\r\n// }\r\n//\r\n// // Sort the keys numerically to ensure consistent order\r\n// const sortedPalette: TailwindColorPalette = {};\r\n// Object.keys(palette)\r\n// .sort((a, b) => parseInt(a) - parseInt(b))\r\n// .forEach((key: string) => {\r\n// sortedPalette[key] = palette[key];\r\n// });\r\n//\r\n// return sortedPalette;\r\n// }\r\n\r\n// Define the specific shade keys\r\nexport type PaletteShade =\r\n | '0'\r\n | '50'\r\n | '100'\r\n | '200'\r\n | '300'\r\n | '400'\r\n | '500'\r\n | '600'\r\n | '700'\r\n | '800'\r\n | '900'\r\n | '950';\r\n\r\n// A helper type for our new palette profile\r\ntype ShadeProfile = {\r\n /** Target lightness (0-100) */\r\n l: number;\r\n /** Saturation adjustment relative to the 500 shade */\r\n s_adjust: number;\r\n};\r\n\r\n/**\r\n * Defines the \"ideal\" lightness and saturation adjustment for each shade.\r\n * Lightness for 500 is set to 50 as a balanced default.\r\n */\r\nconst PALETTE_PROFILE: Record<PaletteShade, ShadeProfile> = {\r\n '0': { l: 98, s_adjust: -50 },\r\n '50': { l: 95, s_adjust: -40 },\r\n '100': { l: 90, s_adjust: -30 },\r\n '200': { l: 80, s_adjust: -20 },\r\n '300': { l: 70, s_adjust: -10 },\r\n '400': { l: 60, s_adjust: -5 },\r\n '500': { l: 50, s_adjust: 0 },\r\n '600': { l: 45, s_adjust: 5 },\r\n '700': { l: 35, s_adjust: 10 },\r\n '800': { l: 25, s_adjust: 15 },\r\n '900': { l: 15, s_adjust: 20 },\r\n '950': { l: 8, s_adjust: 25 },\r\n};\r\n\r\n// Helper to ensure palette is always in the correct 50-950 order\r\nconst ALL_SHADES: PaletteShade[] = [\r\n '0',\r\n '50',\r\n '100',\r\n '200',\r\n '300',\r\n '400',\r\n '500',\r\n '600',\r\n '700',\r\n '800',\r\n '900',\r\n '950',\r\n];\r\n\r\n/**\r\n * Clamps a number between a min and max value.\r\n */\r\nfunction clamp(value: number, min: number, max: number): number {\r\n return Math.max(min, Math.min(max, value));\r\n}\r\n\r\n/**\r\n * Generates a Tailwind-like color palette (50-950) from any given base color.\r\n *\r\n * @param baseColorHex - The hex string of the base color (e.g., \"#0284c7\").\r\n * @param baseColorShade - The shade of the base color (e.g., \"500\", \"700\").\r\n * @returns An object representing the full color palette.\r\n */\r\nexport function generateTailwindPalette(\r\n baseColorHex: string,\r\n baseColorShade: PaletteShade = '500',\r\n): TailwindColorPalette {\r\n // 1. Get HSL of the input color\r\n const [h_base, s_base, l_base]: HSLTuple = hexToHsl(baseColorHex);\r\n\r\n // 2. Find the anchors\r\n const baseProfile = PALETTE_PROFILE[baseColorShade];\r\n\r\n /** The Hue is constant across the entire palette. */\r\n const h = h_base;\r\n\r\n /**\r\n * Calculate the 500-shade's saturation by \"reversing\" the adjustment\r\n * from the base color.\r\n * e.g., if base is 700 (s_adjust: +10) and s_base is 80,\r\n * s_500 will be 70.\r\n */\r\n const s_500 = clamp(s_base - baseProfile.s_adjust, 0, 100);\r\n\r\n /**\r\n * Calculate the lightness \"offset\". This is the difference between\r\n * the base color's actual lightness and its \"ideal\" lightness\r\n * from the profile.\r\n * e.g., if base is 700 (ideal L: 35) and l_base is 38,\r\n * the offset is +3. This offset will be applied to all shades.\r\n */\r\n const l_offset = l_base - baseProfile.l;\r\n\r\n // 3. Generate the full palette\r\n const palette: Partial<TailwindColorPalette> = {};\r\n\r\n for (const shade of ALL_SHADES) {\r\n const profile = PALETTE_PROFILE[shade];\r\n\r\n // Calculate the new saturation and lightness for this shade\r\n const newS = clamp(s_500 + profile.s_adjust, 0, 100);\r\n const newL = clamp(profile.l + l_offset, 0, 100);\r\n\r\n palette[shade] = hslToHex(h, newS, newL);\r\n }\r\n\r\n // 4. Ensure the originally provided color is used exactly\r\n // (to avoid rounding errors from HSL conversion)\r\n palette[baseColorShade] = baseColorHex;\r\n\r\n return palette as TailwindColorPalette;\r\n}\r\n","import { providePrimeNG } from 'primeng/config';\r\nimport { generateTailwindPalette } from '../utils/theme';\r\nimport Aura from '@primeuix/themes/aura';\r\nimport { definePreset, updatePreset } from '@primeuix/themes';\r\nimport { ToastTokenSections } from '@primeuix/themes/types/toast';\r\nimport { EnvironmentProviders } from '@angular/core';\r\nimport { Preset } from '@primeuix/themes/types';\r\nimport { AuraBaseDesignTokens } from '@primeuix/themes/aura/base';\r\n\r\nexport interface MTThemeOptions {\r\n primaryColor?: string;\r\n textColor?: string;\r\n backgroundColor?: string;\r\n}\r\n\r\nconst toastStyle: ToastTokenSections.Success = {\r\n // borderColor: '{surface.300}',\r\n background: '{content.background}',\r\n // color: '{surface.600}',\r\n // closeButton: {\r\n // hoverBackground: '{surface.100}',\r\n // focusRing: {\r\n // color: '{surface.600}',\r\n // },\r\n // },\r\n};\r\n\r\nexport function changePrimaryColor(color: string): void {\r\n updatePreset({\r\n semantic: {\r\n primary: generateTailwindPalette(color || '#2AAEC0'),\r\n },\r\n });\r\n}\r\n\r\nexport function changeBackgroundColor(color?: string): void {\r\n if (color) {\r\n const palette = generateTailwindPalette(color, '100');\r\n document.documentElement.style.setProperty(\r\n '--app-background-light',\r\n palette['100'],\r\n );\r\n document.documentElement.style.setProperty(\r\n '--app-background-dark',\r\n palette['950'],\r\n );\r\n }\r\n}\r\n\r\nexport function changeTextColor(color: string): void {\r\n const palette = generateTailwindPalette(color ?? '#334155', '700');\r\n updatePreset({\r\n semantic: {\r\n colorScheme: {\r\n light: {\r\n text: {\r\n color: palette['700'],\r\n hoverColor: palette['800'],\r\n hoverMutedColor: palette['600'],\r\n mutedColor: palette['500'],\r\n },\r\n },\r\n dark: {\r\n text: {\r\n color: palette['0'],\r\n hoverColor: palette['0'],\r\n hoverMutedColor: palette['300'],\r\n mutedColor: palette['400'],\r\n },\r\n },\r\n },\r\n },\r\n });\r\n}\r\n\r\nconst MTPreset = (themeOptions?: MTThemeOptions) => {\r\n const textPalette = generateTailwindPalette(\r\n themeOptions?.textColor ?? '#334155',\r\n '700',\r\n );\r\n const configs: Preset<AuraBaseDesignTokens> = {\r\n options: {\r\n prefix: 'mt',\r\n cssLayer: {\r\n name: 'primeng',\r\n order: 'theme, base, primeng',\r\n },\r\n },\r\n semantic: {\r\n colorScheme: {\r\n light: {\r\n text: {\r\n color: textPalette['700'],\r\n hoverColor: textPalette['800'],\r\n hoverMutedColor: textPalette['600'],\r\n mutedColor: textPalette['500'],\r\n },\r\n },\r\n dark: {\r\n text: {\r\n color: textPalette['0'],\r\n hoverColor: textPalette['0'],\r\n hoverMutedColor: textPalette['300'],\r\n mutedColor: textPalette['400'],\r\n },\r\n },\r\n },\r\n primary: generateTailwindPalette(themeOptions?.primaryColor || '#2AAEC0'),\r\n content: {\r\n borderRadius: '{border.radius.lg}',\r\n },\r\n formField: {\r\n borderRadius: '{border.radius.lg}',\r\n },\r\n },\r\n components: {\r\n dialog: {\r\n header: {\r\n padding: '0',\r\n },\r\n content: {\r\n padding: '0',\r\n },\r\n footer: {\r\n padding: '0',\r\n },\r\n },\r\n toast: {\r\n root: {\r\n borderRadius: '{border.radius.xl}',\r\n },\r\n colorScheme: {\r\n light: {\r\n success: toastStyle,\r\n info: toastStyle,\r\n warn: toastStyle,\r\n error: toastStyle,\r\n secondary: toastStyle,\r\n },\r\n dark: {\r\n success: toastStyle,\r\n info: toastStyle,\r\n warn: toastStyle,\r\n error: toastStyle,\r\n secondary: toastStyle,\r\n },\r\n },\r\n },\r\n togglebutton: {\r\n root: {\r\n padding: '1px',\r\n },\r\n colorScheme: {\r\n light: {\r\n root: {\r\n checkedColor: '{primary.500}',\r\n },\r\n },\r\n dark: {\r\n root: {\r\n checkedColor: '{primary.400}',\r\n },\r\n },\r\n },\r\n },\r\n selectbutton: {\r\n root: {\r\n borderRadius: '{border.radius.lg}',\r\n },\r\n },\r\n\r\n paginator: {\r\n root: {\r\n borderRadius: '{border.radius.lg}',\r\n padding: '0 .5rem',\r\n },\r\n navButton: {\r\n borderRadius: '0',\r\n },\r\n\r\n colorScheme: {\r\n light: {\r\n navButton: {\r\n color: '{surface.600}',\r\n hoverBackground: '#fff',\r\n selectedBackground: '{surface.200}',\r\n selectedColor: '{surface.600}',\r\n focusRing: {\r\n color: '{surface.200}',\r\n },\r\n },\r\n },\r\n dark: {\r\n navButton: {\r\n color: '{surface.200}',\r\n hoverBackground: 'transparent',\r\n selectedBackground: 'transparent',\r\n selectedColor: '#fff',\r\n focusRing: {\r\n color: '#fff',\r\n },\r\n },\r\n },\r\n },\r\n\r\n css: () => `\r\n .p-paginator {\r\n --p-paginator-gap: 0;\r\n --p-paginator-nav-button-width: 2.2rem;\r\n --p-paginator-nav-button-height: 2.2rem;\r\n width: fit-content;\r\n border: 1px solid var(--p-surface-200);\r\n overflow: hidden;\r\n font-size: .95rem;\r\n }\r\n\r\n .p-paginator-pages button,\r\n .p-paginator-prev,\r\n .p-paginator-next {\r\n border-color: var(--p-surface-200);\r\n }\r\n\r\n .p-paginator-pages button {\r\n border-style: solid;\r\n border-width: 0 0 0 1px;\r\n }\r\n\r\n .p-paginator-pages button:first-child {\r\n border-left: none;\r\n }\r\n\r\n .p-paginator-prev {\r\n border-right: 1px solid var(--p-surface-200);\r\n }\r\n\r\n .p-paginator-next {\r\n border-left: 1px solid var(--p-surface-200);\r\n }\r\n\r\n .p-paginator .p-select {\r\n border: 0;\r\n background: transparent;\r\n }\r\n\r\n .p-paginator .p-select .p-select-label {\r\n padding: 0;\r\n }\r\n\r\n /* Dark Mode Styles */\r\n .dark .p-paginator {\r\n border-color: var(--p-surface-500);\r\n }\r\n\r\n .dark .p-paginator-pages button,\r\n .dark .p-paginator-prev,\r\n .dark .p-paginator-next {\r\n border-color: var(--p-surface-500);\r\n }\r\n\r\n .dark .p-paginator-prev {\r\n border-right-color: var(--p-surface-500);\r\n }\r\n\r\n .dark .p-paginator-next {\r\n border-left-color: var(--p-surface-500);\r\n }\r\n `,\r\n },\r\n\r\n toggleswitch: {\r\n root: {\r\n width: '2.5rem',\r\n height: '1.4rem',\r\n },\r\n },\r\n select: {\r\n optionGroup: {\r\n fontWeight: 'bold',\r\n padding: '6px 8px',\r\n background: '{surface.50}',\r\n color: '{primary.700}',\r\n },\r\n },\r\n\r\n // steps: {\r\n // item: {\r\n // link: {\r\n // gap: 'calc(50% + 0.25rem)',\r\n // },\r\n // number: {\r\n // font: {\r\n // size: '0.9rem',\r\n // },\r\n // active: {\r\n // color: 'white',\r\n // background: '{primary.500}',\r\n // border: {\r\n // color: '{primary.500}',\r\n // },\r\n // },\r\n // },\r\n // },\r\n // },\r\n },\r\n };\r\n\r\n return definePreset(Aura, configs);\r\n};\r\n\r\nexport function provideMTComponents(\r\n themeOptions?: MTThemeOptions,\r\n): EnvironmentProviders {\r\n changeBackgroundColor(themeOptions?.backgroundColor);\r\n return providePrimeNG({\r\n zIndex: {\r\n modal: 1900,\r\n overlay: 1500,\r\n menu: 1500,\r\n tooltip: 1600,\r\n },\r\n theme: {\r\n preset: MTPreset(themeOptions),\r\n options: {\r\n darkModeSelector: '.dark',\r\n },\r\n },\r\n });\r\n}\r\n","import { MessageService } from 'primeng/api';\r\n\r\nexport function provideMTMessages() {\r\n return MessageService;\r\n}\r\n","import { ConfirmationService } from 'primeng/api';\r\n\r\nexport function provideMTConfirmation() {\r\n return ConfirmationService;\r\n}\r\n","import { HttpContext } from '@angular/common/http';\r\nimport { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\r\n\r\nexport type FieldType =\r\n | 'text'\r\n | 'textarea'\r\n | 'select'\r\n | 'date'\r\n | 'number'\r\n | 'slider'\r\n | 'multi-select'\r\n | 'pick-list'\r\n | 'checkbox'\r\n | 'icon-field'\r\n | 'color-picker'\r\n | 'spacer'\r\n | string;\r\n\r\nexport type ValidatorType =\r\n | 'required'\r\n | 'email'\r\n | 'minLength'\r\n | 'maxLength'\r\n | 'min'\r\n | 'max'\r\n | 'pattern'\r\n | 'custom';\r\n\r\nexport type FieldRelationAction = 'enable' | 'disable' | 'show' | 'hide';\r\n\r\nexport interface FieldRelationConfig {\r\n key: string;\r\n value: any;\r\n action: FieldRelationAction;\r\n}\r\n\r\nexport interface ResponsiveColSpan {\r\n // Container\r\n xs?: number; // @xs\r\n sm?: number; // @sm\r\n md?: number; // @md\r\n lg?: number; // @lg\r\n xl?: number; // @xl\r\n}\r\n\r\nexport class ValidatorConfig {\r\n type: ValidatorType;\r\n value?: any;\r\n message?: string;\r\n customValidator?: (value: any) => boolean | Promise<boolean>;\r\n\r\n constructor(config: {\r\n type: ValidatorType;\r\n value?: any;\r\n message?: string;\r\n customValidator?: (value: any) => boolean | Promise<boolean>;\r\n }) {\r\n this.type = config.type;\r\n this.value = config.value;\r\n this.message = config.message;\r\n this.customValidator = config.customValidator;\r\n }\r\n\r\n // Factory methods for common validators\r\n static required(message = 'This field is required'): ValidatorConfig {\r\n return new ValidatorConfig({ type: 'required', message });\r\n }\r\n\r\n static email(message = 'Please enter a valid email'): ValidatorConfig {\r\n return new ValidatorConfig({ type: 'email', message });\r\n }\r\n\r\n static minLength(length: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'minLength',\r\n value: length,\r\n message: message || `Minimum length is ${length} characters`,\r\n });\r\n }\r\n\r\n static maxLength(length: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'maxLength',\r\n value: length,\r\n message: message || `Maximum length is ${length} characters`,\r\n });\r\n }\r\n\r\n static min(value: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'min',\r\n value,\r\n message: message || `Minimum value is ${value}`,\r\n });\r\n }\r\n\r\n static max(value: number, message?: string): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'max',\r\n value,\r\n message: message || `Maximum value is ${value}`,\r\n });\r\n }\r\n\r\n static pattern(pattern: string, message = 'Invalid format'): ValidatorConfig {\r\n return new ValidatorConfig({ type: 'pattern', value: pattern, message });\r\n }\r\n\r\n static custom(\r\n validator: (value: any) => boolean | Promise<boolean>,\r\n message = 'Invalid value',\r\n ): ValidatorConfig {\r\n return new ValidatorConfig({\r\n type: 'custom',\r\n customValidator: validator,\r\n message,\r\n });\r\n }\r\n}\r\n\r\nexport type BaseFieldConstructorConfig = ConstructorParameters<\r\n typeof BaseFieldConfig\r\n>[0];\r\n\r\nexport abstract class BaseFieldConfig {\r\n key: string;\r\n label: string;\r\n type: FieldType;\r\n required: boolean;\r\n disabled: boolean;\r\n readonly: boolean;\r\n hidden: boolean;\r\n placeholder: string;\r\n hint: string;\r\n cssClass: string;\r\n validators: ValidatorConfig[];\r\n order: number;\r\n colSpan: number | ResponsiveColSpan;\r\n\r\n defaultValue?: any;\r\n\r\n customTemplate: string;\r\n relations: FieldRelationConfig[];\r\n\r\n constructor(config: {\r\n key?: string;\r\n label?: string;\r\n type: FieldType;\r\n required?: boolean;\r\n disabled?: boolean;\r\n readonly?: boolean;\r\n hidden?: boolean;\r\n placeholder?: string;\r\n hint?: string;\r\n cssClass?: string;\r\n validators?: ValidatorConfig[];\r\n order?: number;\r\n relations?: FieldRelationConfig[];\r\n colSpan?: number | ResponsiveColSpan;\r\n }) {\r\n this.key = config.key || 'Key';\r\n this.label = config.label || '';\r\n this.type = config.type;\r\n this.required = config.required || false;\r\n this.disabled = config.disabled || false;\r\n this.readonly = config.readonly || false;\r\n this.hidden = config.hidden || false;\r\n this.placeholder = config.placeholder || '';\r\n this.hint = config.hint || '';\r\n this.cssClass = config.cssClass || '';\r\n this.validators = config.validators || [];\r\n this.order = config.order || 0;\r\n this.relations = config.relations || [];\r\n this.colSpan = config.colSpan || 12;\r\n }\r\n}\r\n\r\n// Specific configurations for different field types\r\nexport class TextFieldConfig extends BaseFieldConfig {\r\n inputType: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n inputType?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'text' });\r\n this.inputType = config.inputType || 'text';\r\n }\r\n}\r\n\r\nexport class TextareaFieldConfig extends BaseFieldConfig {\r\n rows: number;\r\n autoResize: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n rows?: number;\r\n autoResize?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'textarea' });\r\n this.rows = config.rows || 3;\r\n this.autoResize = config.autoResize || false;\r\n }\r\n}\r\n\r\nexport class SelectFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n multiple: boolean;\r\n filter: boolean;\r\n filterBy: string;\r\n filterPlaceholder: string;\r\n showClear: boolean;\r\n emptyMessage: string;\r\n size: string;\r\n hasPlaceholderPrefix: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n multiple?: boolean;\r\n filter?: boolean;\r\n filterBy?: string;\r\n filterPlaceholder?: string;\r\n showClear?: boolean;\r\n emptyMessage?: string;\r\n size?: string;\r\n hasPlaceholderPrefix?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'select' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.multiple = config.multiple || false;\r\n this.filter = config.filter || false;\r\n this.filterBy = config.filterBy || '';\r\n this.filterPlaceholder = config.filterPlaceholder || 'Search...';\r\n this.showClear = config.showClear || false;\r\n this.emptyMessage = config.emptyMessage || 'No options available';\r\n this.size = config.size || '';\r\n this.hasPlaceholderPrefix = config.hasPlaceholderPrefix!;\r\n }\r\n}\r\n\r\nexport class RadioButtonFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n orientation: 'vertical' | 'horizontal';\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n orientation?: 'vertical' | 'horizontal';\r\n },\r\n ) {\r\n super({ ...config, type: 'radio-button' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.orientation = config.orientation || 'vertical';\r\n }\r\n}\r\nexport class RadioCardsFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n size: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n size?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'radio-cards' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.size = config.size || 'small';\r\n }\r\n}\r\nexport class UserSearchFieldConfig extends BaseFieldConfig {\r\n optionLabel: string;\r\n optionValue: string;\r\n size: string;\r\n apiUrl: string;\r\n context: HttpContext | undefined;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n optionLabel?: string;\r\n optionValue?: string;\r\n size?: string;\r\n hint?: string;\r\n apiUrl?: string;\r\n context?: HttpContext | undefined;\r\n placeholder?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'user-search' });\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.size = config.size || '';\r\n this.hint = config.hint || '';\r\n this.context = config.context || undefined;\r\n this.apiUrl = config.apiUrl || '';\r\n this.placeholder = config.placeholder || 'Search';\r\n }\r\n}\r\n\r\nexport class UploadFileFieldConfig extends BaseFieldConfig {\r\n size: string;\r\n endPoint?: string;\r\n userImgClass?: string;\r\n shape?: string;\r\n accept?: string;\r\n fileSizeLimit?: number | undefined;\r\n context: HttpContext | undefined;\r\n title: string;\r\n description: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n size?: string;\r\n endPoint?: string;\r\n userImgClass?: string;\r\n shape?: string;\r\n accept?: string;\r\n fileSizeLimit?: number | undefined;\r\n context?: HttpContext | undefined;\r\n title?: string;\r\n description?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'upload-file' });\r\n this.size = config.size || 'normal';\r\n this.endPoint = config.endPoint || 'uploader';\r\n this.userImgClass =\r\n config.userImgClass || 'w-25! h-25! text-4xl! text-gray-400!';\r\n this.shape = config.shape || 'field';\r\n this.accept = config.accept || '.pdf,.doc,.docx,.xlsx,image/*';\r\n this.fileSizeLimit = config.fileSizeLimit || undefined;\r\n this.context = config.context || undefined;\r\n this.title = config.title || 'Upload File';\r\n this.description = config.description || 'Click or drop a file to upload';\r\n }\r\n}\r\n\r\nexport class DateFieldConfig extends BaseFieldConfig {\r\n dateFormat: string;\r\n showTime: boolean;\r\n showSeconds: boolean;\r\n hourFormat: '12' | '24';\r\n minDate?: Date;\r\n maxDate?: Date;\r\n disabledDates: Date[];\r\n disabledDays: number[];\r\n yearRange: string;\r\n showIcon: boolean;\r\n icon: string;\r\n showButtonBar: boolean;\r\n showClear: boolean;\r\n inline: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n dateFormat?: string;\r\n showTime?: boolean;\r\n showSeconds?: boolean;\r\n hourFormat?: '12' | '24';\r\n minDate?: Date;\r\n maxDate?: Date;\r\n disabledDates?: Date[];\r\n disabledDays?: number[];\r\n yearRange?: string;\r\n showIcon?: boolean;\r\n icon?: string;\r\n showButtonBar?: boolean;\r\n showClear?: boolean;\r\n inline?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'date' });\r\n this.dateFormat = config.dateFormat || 'yyyy-mm-dd';\r\n this.showTime = config.showTime || false;\r\n this.showSeconds = config.showSeconds || false;\r\n this.hourFormat = config.hourFormat || '24';\r\n this.minDate = config.minDate;\r\n this.maxDate = config.maxDate;\r\n this.disabledDates = config.disabledDates || [];\r\n this.disabledDays = config.disabledDays || [];\r\n this.yearRange = config.yearRange || '1900:2030';\r\n this.showIcon = config.showIcon || true;\r\n this.icon = config.icon || 'pi pi-calendar';\r\n this.showButtonBar = config.showButtonBar || false;\r\n this.showClear = config.showClear || true;\r\n this.inline = config.inline || false;\r\n }\r\n}\r\n\r\nexport class NumberFieldConfig extends BaseFieldConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n prefix?: string;\r\n suffix?: string;\r\n currency?: string;\r\n locale?: string;\r\n minFractionDigits?: number;\r\n maxFractionDigits?: number;\r\n useGrouping?: boolean;\r\n showButtons?: boolean;\r\n buttonLayout?: 'stacked' | 'horizontal';\r\n incrementButtonClass?: string;\r\n decrementButtonClass?: string;\r\n incrementButtonIcon?: string;\r\n decrementButtonIcon?: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n prefix?: string;\r\n suffix?: string;\r\n currency?: string;\r\n locale?: string;\r\n minFractionDigits?: number;\r\n maxFractionDigits?: number;\r\n useGrouping?: boolean;\r\n showButtons?: boolean;\r\n buttonLayout?: 'stacked' | 'horizontal';\r\n incrementButtonClass?: string;\r\n decrementButtonClass?: string;\r\n incrementButtonIcon?: string;\r\n decrementButtonIcon?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'number' });\r\n this.min = config.min;\r\n this.max = config.max;\r\n this.step = config.step || 1;\r\n this.prefix = config.prefix;\r\n this.suffix = config.suffix;\r\n this.currency = config.currency;\r\n this.locale = config.locale;\r\n this.minFractionDigits = config.minFractionDigits;\r\n this.maxFractionDigits = config.maxFractionDigits;\r\n this.useGrouping = config.useGrouping || false;\r\n this.showButtons = config.showButtons || false;\r\n this.buttonLayout = config.buttonLayout || 'stacked';\r\n this.incrementButtonClass = config.incrementButtonClass;\r\n this.decrementButtonClass = config.decrementButtonClass;\r\n this.incrementButtonIcon = config.incrementButtonIcon;\r\n this.decrementButtonIcon = config.decrementButtonIcon;\r\n }\r\n}\r\n\r\nexport class SliderFieldConfig extends BaseFieldConfig {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n orientation?: 'horizontal' | 'vertical';\r\n range?: boolean;\r\n animate?: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n orientation?: 'horizontal' | 'vertical';\r\n range?: boolean;\r\n animate?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'slider' });\r\n this.min = config.min || 0;\r\n this.max = config.max || 100;\r\n this.step = config.step || 1;\r\n this.orientation = config.orientation || 'horizontal';\r\n this.range = config.range || false;\r\n this.animate = config.animate || false;\r\n }\r\n}\r\n\r\nexport class MultiSelectFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n filter: boolean;\r\n filterBy: string;\r\n filterPlaceholder: string;\r\n showClear: boolean;\r\n emptyMessage: string;\r\n display?: 'comma' | 'chip';\r\n maxSelectedLabels?: number;\r\n selectedItemsLabel?: string;\r\n showToggleAll?: boolean;\r\n resetFilterOnHide?: boolean;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n filter?: boolean;\r\n filterBy?: string;\r\n filterPlaceholder?: string;\r\n showClear?: boolean;\r\n emptyMessage?: string;\r\n display?: 'comma' | 'chip';\r\n maxSelectedLabels?: number;\r\n selectedItemsLabel?: string;\r\n showToggleAll?: boolean;\r\n resetFilterOnHide?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'multi-select' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.filter = config.filter || false;\r\n this.filterBy = config.filterBy || '';\r\n this.filterPlaceholder = config.filterPlaceholder || 'Search...';\r\n this.showClear = config.showClear || false;\r\n this.emptyMessage = config.emptyMessage || 'No options available';\r\n this.display = config.display || 'comma';\r\n this.maxSelectedLabels = config.maxSelectedLabels || 3;\r\n this.selectedItemsLabel = config.selectedItemsLabel || '{0} items selected';\r\n this.showToggleAll = config.showToggleAll || true;\r\n this.resetFilterOnHide = config.resetFilterOnHide || false;\r\n }\r\n}\r\n\r\nexport class PickListFieldConfig extends BaseFieldConfig {\r\n options: any[];\r\n optionLabel: string;\r\n optionValue: string;\r\n sourceHeader: string;\r\n targetHeader: string;\r\n showSourceControls: boolean;\r\n showTargetControls: boolean;\r\n showSourceFilter: boolean;\r\n showTargetFilter: boolean;\r\n filterBy: string;\r\n dataKey?: string;\r\n dragdrop: boolean;\r\n responsive: boolean;\r\n breakpoint: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n options: any[];\r\n optionLabel?: string;\r\n optionValue?: string;\r\n sourceHeader?: string;\r\n targetHeader?: string;\r\n showSourceControls?: boolean;\r\n showTargetControls?: boolean;\r\n showSourceFilter?: boolean;\r\n showTargetFilter?: boolean;\r\n filterBy?: string;\r\n dataKey?: string;\r\n dragdrop?: boolean;\r\n responsive?: boolean;\r\n },\r\n ) {\r\n super({ ...config, type: 'pick-list' });\r\n this.options = config.options;\r\n this.optionLabel = config.optionLabel || 'label';\r\n this.optionValue = config.optionValue || 'value';\r\n this.sourceHeader = config.sourceHeader || 'Available';\r\n this.targetHeader = config.targetHeader || 'Selected';\r\n this.showSourceControls =\r\n config.showSourceControls !== undefined\r\n ? config.showSourceControls\r\n : true;\r\n this.showTargetControls =\r\n config.showTargetControls !== undefined\r\n ? config.showTargetControls\r\n : true;\r\n this.showSourceFilter =\r\n config.showSourceFilter !== undefined ? config.showSourceFilter : false;\r\n this.showTargetFilter =\r\n config.showTargetFilter !== undefined ? config.showTargetFilter : false;\r\n this.filterBy = config.filterBy || this.optionLabel;\r\n this.dataKey = config.dataKey || this.optionValue;\r\n this.dragdrop = config.dragdrop ?? false;\r\n this.responsive = config.responsive ?? true;\r\n }\r\n}\r\n\r\nexport class CheckboxFieldConfig extends BaseFieldConfig {\r\n binary?: boolean;\r\n trueValue?: any;\r\n falseValue?: any;\r\n checkboxIcon?: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n binary?: boolean;\r\n trueValue?: any;\r\n falseValue?: any;\r\n checkboxIcon?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'checkbox' });\r\n this.binary = config.binary !== false; // Default to true\r\n this.trueValue = config.trueValue !== undefined ? config.trueValue : true;\r\n this.falseValue =\r\n config.falseValue !== undefined ? config.falseValue : false;\r\n this.checkboxIcon = config.checkboxIcon;\r\n }\r\n}\r\nexport class ToggleFieldConfig extends BaseFieldConfig {\r\n toggleShape?: 'toggle' | 'card';\r\n icon?: string;\r\n descriptionCard?: string;\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n toggleShape?: 'toggle' | 'card';\r\n icon?: string;\r\n descriptionCard?: string;\r\n },\r\n ) {\r\n super({ ...config, type: 'toggle' });\r\n this.toggleShape = config.toggleShape ?? 'toggle';\r\n this.icon = config.icon;\r\n this.descriptionCard = config.descriptionCard;\r\n }\r\n}\r\nexport class EditorFieldConfig extends BaseFieldConfig {\r\n constructor(config: Omit<BaseFieldConstructorConfig, 'type'>) {\r\n super({ ...config, type: 'editor-field' });\r\n }\r\n}\r\n\r\nexport class ColorPickerFieldConfig extends BaseFieldConfig {\r\n format?: 'hex' | 'rgb' | 'hsb';\r\n inline?: boolean;\r\n appendTo?: any;\r\n variant?: 'outlined' | 'filled';\r\n\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type'> & {\r\n format?: 'hex' | 'rgb' | 'hsb';\r\n inline?: boolean;\r\n appendTo?: any;\r\n variant?: 'outlined' | 'filled';\r\n },\r\n ) {\r\n super({ ...config, type: 'color-picker' });\r\n this.format = config.format || 'hex';\r\n this.inline = config.inline || false;\r\n this.appendTo = config.appendTo || 'body';\r\n this.variant = config.variant || 'outlined';\r\n }\r\n}\r\n\r\nexport class IconFieldConfig extends BaseFieldConfig {\r\n constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {}) {\r\n super({ ...config, type: 'icon-field' });\r\n }\r\n}\r\n\r\nexport class SpacerFieldConfig extends BaseFieldConfig {\r\n constructor(\r\n config: Omit<BaseFieldConstructorConfig, 'type' | 'key' | 'label'> & {\r\n key?: string;\r\n label?: string;\r\n },\r\n ) {\r\n super({\r\n ...config,\r\n type: 'spacer',\r\n key: config.key || `spacer_${Date.now()}`,\r\n label: config.label || '',\r\n });\r\n }\r\n}\r\n\r\n// Union type for all field configurations\r\nexport type DynamicFieldConfig = {\r\n [K in keyof (TextFieldConfig &\r\n TextareaFieldConfig &\r\n SelectFieldConfig &\r\n DateFieldConfig &\r\n NumberFieldConfig &\r\n SliderFieldConfig &\r\n MultiSelectFieldConfig &\r\n PickListFieldConfig &\r\n CheckboxFieldConfig &\r\n ToggleFieldConfig &\r\n ColorPickerFieldConfig &\r\n IconFieldConfig &\r\n SpacerFieldConfig &\r\n BaseFieldConfig)]?: (TextFieldConfig &\r\n TextareaFieldConfig &\r\n SelectFieldConfig &\r\n DateFieldConfig &\r\n NumberFieldConfig &\r\n SliderFieldConfig &\r\n MultiSelectFieldConfig &\r\n PickListFieldConfig &\r\n CheckboxFieldConfig &\r\n ToggleFieldConfig &\r\n ColorPickerFieldConfig &\r\n IconFieldConfig &\r\n SpacerFieldConfig &\r\n BaseFieldConfig)[K];\r\n};\r\n\r\n// Layout configuration\r\nexport interface LayoutConfig {\r\n containerClass?: string;\r\n sectionClass?: string;\r\n fieldClass?: string;\r\n}\r\n\r\n// Simplified form configuration interface\r\nexport interface DynamicFormConfig {\r\n sections: SectionConfig[];\r\n layout?: LayoutConfig;\r\n}\r\nexport interface SectionConfig {\r\n key?: string;\r\n label?: string;\r\n type: 'none' | 'header';\r\n cssClass?: string;\r\n bodyClass?: string;\r\n headerClass?: string;\r\n columns?: number;\r\n\r\n order?: number;\r\n fields: DynamicFieldConfig[];\r\n}\r\nexport interface FieldState {\r\n hidden: boolean;\r\n disabled: boolean;\r\n}\r\n\r\nexport function createCustomValidator(\r\n customValidator: (value: any) => boolean | Promise<boolean>,\r\n message?: string,\r\n): ValidatorFn {\r\n return (control: AbstractControl): ValidationErrors | null => {\r\n const result = customValidator(control.value);\r\n\r\n if (result instanceof Promise) {\r\n // Handle async validation\r\n result.then((isValid) => {\r\n if (!isValid) {\r\n control.setErrors({\r\n custom: { message: message || 'Invalid value' },\r\n });\r\n }\r\n });\r\n return null; // For async, return null initially\r\n } else {\r\n // Handle sync validation\r\n return result\r\n ? null\r\n : { custom: { message: message || 'Invalid value' } };\r\n }\r\n };\r\n}\r\n\r\nexport function wrapValidatorWithMessage(\r\n validator: ValidatorFn,\r\n errorKey: string,\r\n message: string,\r\n): ValidatorFn {\r\n return (control: AbstractControl): ValidationErrors | null => {\r\n const result = validator(control);\r\n if (result) {\r\n // Replace the default error with custom message\r\n return { [errorKey]: { ...result[Object.keys(result)[0]], message } };\r\n }\r\n return null;\r\n };\r\n}\r\n// DynamicFieldConfig = input.required<any>({\r\n// transform: (value: any) => this.transformToDateFieldConfig(value)\r\n// });\r\n// transformToDateFieldConfig(value: any){\r\n// return new TextFieldConfig()\r\n// }\r\n","import { computed, Signal } from '@angular/core';\r\n\r\n/**\r\n * Query result with separate signals for each property\r\n */\r\nexport interface QueryResult<T> {\r\n data: Signal<T | null>;\r\n isPending: Signal<boolean>;\r\n isSuccess: Signal<boolean>;\r\n isError: Signal<boolean>;\r\n error: Signal<string | null>;\r\n}\r\n\r\n/**\r\n * @deprecated Use direct `select()` + `computed()` pattern instead for better performance.\r\n *\r\n * **Problem with BaseFacade:**\r\n * - All computed signals depend on the full state, causing unnecessary recomputations\r\n * - Bypasses NGXS selector memoization\r\n * - Uses `as any` casting, losing type safety\r\n *\r\n * **New Pattern - Use slice-based selectors:**\r\n *\r\n * ```typescript\r\n * // In your State class - add slice selectors:\r\n * @Selector()\r\n * static getLoadingActive(state: MyStateModel): string[] {\r\n * return state.loadingActive;\r\n * }\r\n *\r\n * @Selector()\r\n * static getErrors(state: MyStateModel): Record<string, string | null> {\r\n * return state.errors;\r\n * }\r\n *\r\n * // In your Facade - don't extend BaseFacade:\r\n * @Injectable({ providedIn: 'root' })\r\n * export class MyFacade {\r\n * private readonly store = inject(Store);\r\n *\r\n * // Data selectors - memoized by NGXS\r\n * readonly items = select(MyState.getItems);\r\n *\r\n * // Loading/Error slices - memoized by NGXS\r\n * private readonly loadingActive = select(MyState.getLoadingActive);\r\n * private readonly errors = select(MyState.getErrors);\r\n *\r\n * // Loading signals - computed from slice (minimal reactivity)\r\n * readonly isLoadingItems = computed(() =>\r\n * this.loadingActive().includes(MyActionKey.GetItems)\r\n * );\r\n *\r\n * // Error signals - computed from slice (minimal reactivity)\r\n * readonly itemsError = computed(() =>\r\n * this.errors()[MyActionKey.GetItems] ?? null\r\n * );\r\n *\r\n * // Dispatchers\r\n * loadItems() {\r\n * return this.store.dispatch(new GetItems());\r\n * }\r\n * }\r\n * ```\r\n *\r\n * **Template Usage:**\r\n * ```html\r\n * @if (facade.isLoadingItems()) {\r\n * <loading-spinner />\r\n * } @else if (facade.itemsError(); as error) {\r\n * <error-alert>{{ error }}</error-alert>\r\n * } @else {\r\n * @for (item of facade.items(); track item.id) {\r\n * <item-card [item]=\"item\" />\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport abstract class BaseFacade<TState, TLoadingName extends string> {\r\n /**\r\n * Override in child facade to provide the state selector\r\n */\r\n protected abstract state(): Signal<TState>;\r\n\r\n /**\r\n * Creates a query object with separate signals for data, loading, and error states\r\n * Each property is its own signal for granular reactivity\r\n *\r\n * @example\r\n * readonly modulesQuery = this.query(\r\n * 'getModulesLoading',\r\n * (state) => state.allModules\r\n * );\r\n *\r\n * // In template - each is a separate signal:\r\n * @if (modulesQuery.isPending()) { Loading... }\r\n * @if (modulesQuery.error(); as error) { Error: {{ error }} }\r\n * @if (modulesQuery.data(); as modules) {\r\n * <div *ngFor=\"let m of modules\">{{ m.title }}</div>\r\n * }\r\n */\r\n protected query<T>(\r\n loadingKey: TLoadingName,\r\n dataSelector: (state: TState) => T,\r\n ): QueryResult<T> {\r\n const stateSignal = this.state();\r\n\r\n const isPending = computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.loadingActive?.includes(loadingKey) ?? false;\r\n });\r\n\r\n const error = computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.errors?.[loadingKey] ?? null;\r\n });\r\n\r\n const data = computed(() => {\r\n const currentState = stateSignal() as any;\r\n const hasError = currentState.errors?.[loadingKey];\r\n return hasError ? null : dataSelector(currentState);\r\n });\r\n\r\n const isSuccess = computed(\r\n () => !isPending() && !error() && data() !== null,\r\n );\r\n\r\n const isError = computed(() => !!error());\r\n\r\n return {\r\n data,\r\n isPending,\r\n isSuccess,\r\n isError,\r\n error,\r\n };\r\n }\r\n\r\n /**\r\n * Creates a loading signal for a specific operation\r\n */\r\n protected loading(loadingKey: TLoadingName): Signal<boolean> {\r\n const stateSignal = this.state();\r\n return computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.loadingActive?.includes(loadingKey) ?? false;\r\n });\r\n }\r\n\r\n /**\r\n * Creates an error signal for a specific operation\r\n */\r\n protected errorSignal(loadingKey: TLoadingName): Signal<string | null> {\r\n const stateSignal = this.state();\r\n return computed(() => {\r\n const currentState = stateSignal() as any;\r\n return currentState.errors?.[loadingKey] ?? null;\r\n });\r\n }\r\n}\r\n","export interface EntityAdapter<T> {\r\n addOne(state: T[], entity: T): T[];\r\n upsertOne(state: T[], entity: T, uniqueKey?: keyof T): T[];\r\n updateOne(\r\n state: T[],\r\n id: string | number,\r\n changes: Partial<T>,\r\n uniqueKey?: keyof T,\r\n ): T[];\r\n removeOne(state: T[], id: string | number, uniqueKey?: keyof T): T[];\r\n setAll(state: T[], entities: T[]): T[];\r\n}\r\n\r\nexport function createEntityAdapter<T>(): EntityAdapter<T> {\r\n return {\r\n addOne: (state: T[], entity: T): T[] => [...state, entity],\r\n\r\n upsertOne: (\r\n state: T[],\r\n entity: T,\r\n uniqueKey: keyof T = 'id' as keyof T,\r\n ): T[] => {\r\n const key = entity[uniqueKey];\r\n if (key == null) return state;\r\n const index = state.findIndex((e) => e[uniqueKey] === key);\r\n if (index === -1) {\r\n return [...state, entity];\r\n }\r\n const clone = [...state];\r\n clone[index] = entity;\r\n return clone;\r\n },\r\n\r\n updateOne: (\r\n state: T[],\r\n id: string | number,\r\n changes: Partial<T>,\r\n uniqueKey: keyof T = 'id' as keyof T,\r\n ): T[] =>\r\n state.map((e) => (e[uniqueKey] === id ? { ...e, ...changes } : e)),\r\n\r\n removeOne: (\r\n state: T[],\r\n id: string | number,\r\n uniqueKey: keyof T = 'id' as keyof T,\r\n ): T[] => state.filter((e) => e[uniqueKey] !== id),\r\n\r\n setAll: (_state: T[], entities: T[]): T[] => [...entities],\r\n };\r\n}\r\n","import type { StateContext } from '@ngxs/store';\r\n\r\nexport interface LoadingStateShape<L extends string = string> {\r\n loadingActive: L[];\r\n errors: Partial<Record<L, string>>;\r\n}\r\n\r\ntype LoadingName<T extends LoadingStateShape<string>> =\r\n T['loadingActive'][number];\r\n\r\nexport function startLoading<T extends LoadingStateShape<string>>(\r\n ctx: StateContext<T>,\r\n loadingName: LoadingName<T>,\r\n): void {\r\n const { loadingActive, errors } = ctx.getState();\r\n\r\n if (!loadingActive.includes(loadingName)) {\r\n ctx.patchState({\r\n loadingActive: [...loadingActive, loadingName],\r\n } as Partial<T>);\r\n }\r\n\r\n if (errors && errors[loadingName]) {\r\n const { [loadingName]: _removed, ...rest } = errors;\r\n ctx.patchState({ errors: rest } as Partial<T>);\r\n }\r\n}\r\n\r\nexport function endLoading<T extends LoadingStateShape<string>>(\r\n ctx: StateContext<T>,\r\n loadingName: LoadingName<T>,\r\n): void {\r\n const { loadingActive } = ctx.getState();\r\n\r\n ctx.patchState({\r\n loadingActive: loadingActive.filter((name) => name !== loadingName),\r\n } as Partial<T>);\r\n}\r\n\r\nexport function setLoadingError<T extends LoadingStateShape<string>>(\r\n ctx: StateContext<T>,\r\n loadingName: LoadingName<T>,\r\n message: string,\r\n): void {\r\n const { errors } = ctx.getState();\r\n ctx.patchState({\r\n errors: { ...errors, [loadingName]: message },\r\n } as Partial<T>);\r\n}\r\n","import { StateContext } from '@ngxs/store';\r\nimport { Observable } from 'rxjs';\r\nimport { tap, catchError, finalize } from 'rxjs/operators';\r\nimport {\r\n startLoading,\r\n endLoading,\r\n setLoadingError,\r\n LoadingStateShape,\r\n} from './state-helpers';\r\n\r\nexport interface ApiRequestConfig<TState, TResponse> {\r\n ctx: StateContext<TState>;\r\n key: string;\r\n request$: Observable<TResponse>;\r\n onSuccess: (response: TResponse, state: TState) => Partial<TState> | void;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport function handleApiRequest<\r\n TState extends LoadingStateShape<string>,\r\n TResponse,\r\n>(config: ApiRequestConfig<TState, TResponse>) {\r\n const { ctx, key, request$, onSuccess, onError, errorMessage } = config;\r\n\r\n startLoading(ctx, key);\r\n\r\n return request$.pipe(\r\n tap((response) => {\r\n const state = ctx.getState();\r\n const patch = onSuccess(response, state);\r\n if (patch) {\r\n ctx.patchState(patch);\r\n }\r\n }),\r\n catchError((error) => {\r\n const state = ctx.getState();\r\n const message = error?.error?.message ?? error?.message ?? errorMessage;\r\n setLoadingError(ctx, key, message);\r\n\r\n // Call onError callback if provided\r\n if (onError) {\r\n const patch = onError(error, state);\r\n if (patch) {\r\n ctx.patchState(patch);\r\n }\r\n }\r\n\r\n throw error;\r\n }),\r\n finalize(() => endLoading(ctx, key)),\r\n );\r\n}\r\n","import { StateContext } from '@ngxs/store';\r\nimport { Observable } from 'rxjs';\r\nimport { createEntityAdapter } from '../utils/entity-adapter';\r\nimport { handleApiRequest } from '../utils/api-request.helper';\r\nimport { LoadingStateShape } from '../utils/state-helpers';\r\n\r\nexport interface Response<T> {\r\n endpoint: string;\r\n status: number;\r\n code: number;\r\n locale: string;\r\n message?: string | null;\r\n errors?: unknown | null;\r\n data: T;\r\n cacheSession?: string;\r\n}\r\nexport interface CrudLoadConfig<T, TState, TData = T[]> {\r\n key: string;\r\n request$: Observable<Response<TData>>;\r\n stateProperty?: (state: TState) => T[];\r\n /**\r\n * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.\r\n * CRUD methods should only be used for simple array operations with `stateProperty`.\r\n */\r\n updateState?: (state: TState, data: TData) => Partial<TState>;\r\n /**\r\n * @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.\r\n * CRUD methods should only be used for simple array operations.\r\n */\r\n transform?: (data: TData) => TData;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport interface CrudCreateConfig<T, TState> {\r\n key: string;\r\n request$: Observable<Response<T>>;\r\n stateProperty: (state: TState) => T[];\r\n /**\r\n * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.\r\n * CRUD methods should only be used for simple array operations with `stateProperty`.\r\n */\r\n updateState?: (state: TState, items: T[]) => Partial<TState>;\r\n /**\r\n * @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.\r\n * CRUD methods should only be used for simple array operations.\r\n */\r\n transform?: (data: T) => T;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport interface CrudUpdateConfig<T, TState> {\r\n key: string;\r\n request$: Observable<Response<T>>;\r\n uniqueKey: keyof T;\r\n id: string | number;\r\n stateProperty: (state: TState) => T[];\r\n /**\r\n * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.\r\n * CRUD methods should only be used for simple array operations with `stateProperty`.\r\n */\r\n updateState?: (state: TState, items: T[]) => Partial<TState>;\r\n /**\r\n * @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.\r\n * CRUD methods should only be used for simple array operations.\r\n */\r\n transform?: (data: T) => T;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\nexport interface CrudDeleteConfig<T, TState> {\r\n key: string;\r\n request$: Observable<Response<void>>;\r\n uniqueKey: keyof T;\r\n id: string | number;\r\n stateProperty: (state: TState) => T[];\r\n /**\r\n * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.\r\n * CRUD methods should only be used for simple array operations with `stateProperty`.\r\n */\r\n updateState?: (state: TState, items: T[]) => Partial<TState>;\r\n onError?: (error: any, state: TState) => Partial<TState> | void;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * T = entity type (Module, User, ...)\r\n * TState = full state model (must include LoadingStateShape)\r\n * TLoad = union type of loading keys for this feature\r\n */\r\nexport abstract class CrudStateBase<\r\n T,\r\n TState extends LoadingStateShape<TLoad>,\r\n TLoad extends string,\r\n> {\r\n protected adapter = createEntityAdapter<T>();\r\n\r\n /**\r\n * Helper to create default updateState function\r\n */\r\n private getDefaultUpdateState<TState>(\r\n stateProperty: (state: TState) => T[],\r\n ): (state: TState, items: T[]) => Partial<TState> {\r\n // Try to extract the property name from the stateProperty function\r\n const funcStr = stateProperty.toString();\r\n const match = funcStr.match(/\\.([a-zA-Z_$][a-zA-Z0-9_$]*)/); // Match .propertyName\r\n const key = match ? match[1] : 'items';\r\n\r\n return (state, items) => ({ [key]: items }) as Partial<TState>;\r\n }\r\n\r\n /**\r\n * @deprecated Use `handleApiRequest` directly with `onSuccess` callback.\r\n * The `load()` method provides no significant benefit over `handleApiRequest`.\r\n *\r\n * @example\r\n * // Instead of this.load(), use:\r\n * return handleApiRequest({\r\n * ctx,\r\n * key: ActionKey.GetItems,\r\n * request$: req$,\r\n * onSuccess: (response) => ({\r\n * items: response.data ?? [],\r\n * }),\r\n * });\r\n */\r\n protected load<TData = T[]>(\r\n ctx: StateContext<TState>,\r\n config: CrudLoadConfig<T, TState, TData>,\r\n ) {\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (response, state) => {\r\n const data = config.transform\r\n ? config.transform(response.data)\r\n : response.data;\r\n\r\n // If stateProperty provided, use adapter for array operations\r\n if (config.stateProperty) {\r\n const items = this.adapter.setAll(\r\n config.stateProperty(state),\r\n data as T[],\r\n );\r\n const updateState =\r\n config.updateState ??\r\n this.getDefaultUpdateState(config.stateProperty);\r\n return updateState(state, items as any);\r\n }\r\n\r\n // Otherwise, use custom updateState directly\r\n if (config.updateState) {\r\n return config.updateState(state, data);\r\n }\r\n\r\n throw new Error('Either stateProperty or updateState must be provided');\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to load data',\r\n });\r\n }\r\n\r\n /**\r\n * Create one entity with config object\r\n */\r\n protected create(\r\n ctx: StateContext<TState>,\r\n config: CrudCreateConfig<T, TState>,\r\n ) {\r\n const updateState =\r\n config.updateState ?? this.getDefaultUpdateState(config.stateProperty);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (response, state) => {\r\n const entity = config.transform\r\n ? config.transform(response.data)\r\n : response.data;\r\n const items = this.adapter.addOne(config.stateProperty(state), entity);\r\n return updateState(state, items);\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to create item',\r\n });\r\n }\r\n\r\n /**\r\n * Update one entity with config object\r\n */\r\n protected update(\r\n ctx: StateContext<TState>,\r\n config: CrudUpdateConfig<T, TState>,\r\n ) {\r\n const updateState =\r\n config.updateState ?? this.getDefaultUpdateState(config.stateProperty);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (response, state) => {\r\n const entity = config.transform\r\n ? config.transform(response.data)\r\n : response.data;\r\n const items = this.adapter.upsertOne(\r\n config.stateProperty(state),\r\n entity,\r\n config.uniqueKey,\r\n );\r\n return updateState(state, items);\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to update item',\r\n });\r\n }\r\n\r\n /**\r\n * Delete one entity with config object\r\n */\r\n protected delete(\r\n ctx: StateContext<TState>,\r\n config: CrudDeleteConfig<T, TState>,\r\n ) {\r\n const updateState =\r\n config.updateState ?? this.getDefaultUpdateState(config.stateProperty);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: config.key,\r\n request$: config.request$,\r\n onSuccess: (_response, state) => {\r\n const items = this.adapter.removeOne(\r\n config.stateProperty(state),\r\n config.id,\r\n config.uniqueKey,\r\n );\r\n return updateState(state, items);\r\n },\r\n onError: config.onError,\r\n errorMessage: config.errorMessage ?? 'Failed to delete item',\r\n });\r\n }\r\n}\r\n","import { AbstractControl } from '@angular/forms';\r\n\r\nexport function isInvalid(control: AbstractControl | null) {\r\n if (!control) return false;\r\n return control && control?.invalid && control?.touched;\r\n}\r\n","import { HttpContextToken } from '@angular/common/http';\r\n\r\n/**\r\n * HTTP context configuration for request handling\r\n */\r\nexport interface RequestContextConfig {\r\n /** Use base URL instead of gateway URL */\r\n useBaseUrl?: boolean;\r\n}\r\n\r\n/**\r\n * Shared HTTP context token for request configuration.\r\n * Used by interceptors to determine base URL routing.\r\n *\r\n * @example\r\n * ```typescript\r\n * import { REQUEST_CONTEXT } from '@masterteam/components';\r\n *\r\n * // In a service\r\n * private context = new HttpContext().set(REQUEST_CONTEXT, { useBaseUrl: true });\r\n *\r\n * getMetadata(): Observable<any> {\r\n * return this.http.get('metadata', { context: this.context });\r\n * }\r\n *\r\n * // In interceptor\r\n * const config = req.context.get(REQUEST_CONTEXT);\r\n * if (config?.useBaseUrl) {\r\n * // Use base URL\r\n * }\r\n * ```\r\n */\r\nexport const REQUEST_CONTEXT = new HttpContextToken<RequestContextConfig>(\r\n () => ({ useBaseUrl: false }),\r\n);\r\n","/*\r\n * Public API Surface of components\r\n */\r\n\r\n// Config\r\nexport * from './lib/config/providemt';\r\nexport * from './lib/config/povide-messages';\r\nexport * from './lib/config/provide-confirmation';\r\nexport * from './lib/config/dynamic-form.model';\r\n\r\n// Base classes\r\nexport * from './lib/base/base.facade';\r\nexport * from './lib/base/crud-base.state';\r\n\r\n// Utils\r\nexport * from './lib/utils/theme';\r\nexport * from './lib/utils/inputs';\r\nexport * from './lib/utils/state-helpers';\r\nexport * from './lib/utils/api-request.helper';\r\nexport * from './lib/utils/entity-adapter';\r\nexport * from './lib/utils/http-context';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAKA;;;;;AAKG;AACH,SAAS,QAAQ,CAAC,GAAW,EAAA;IAC3B,IAAI,CAAC,GAAW,CAAC,EACf,CAAC,GAAW,CAAC,EACb,CAAC,GAAW,CAAC;;AAGf,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AACpB,QAAA,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAA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
|
|
|
424
424
|
error: Signal<string | null>;
|
|
425
425
|
}
|
|
426
426
|
/**
|
|
427
|
-
*
|
|
427
|
+
* @deprecated Use direct `select()` + `computed()` pattern instead for better performance.
|
|
428
|
+
*
|
|
429
|
+
* **Problem with BaseFacade:**
|
|
430
|
+
* - All computed signals depend on the full state, causing unnecessary recomputations
|
|
431
|
+
* - Bypasses NGXS selector memoization
|
|
432
|
+
* - Uses `as any` casting, losing type safety
|
|
433
|
+
*
|
|
434
|
+
* **New Pattern - Use slice-based selectors:**
|
|
435
|
+
*
|
|
436
|
+
* ```typescript
|
|
437
|
+
* // In your State class - add slice selectors:
|
|
438
|
+
* @Selector()
|
|
439
|
+
* static getLoadingActive(state: MyStateModel): string[] {
|
|
440
|
+
* return state.loadingActive;
|
|
441
|
+
* }
|
|
442
|
+
*
|
|
443
|
+
* @Selector()
|
|
444
|
+
* static getErrors(state: MyStateModel): Record<string, string | null> {
|
|
445
|
+
* return state.errors;
|
|
446
|
+
* }
|
|
447
|
+
*
|
|
448
|
+
* // In your Facade - don't extend BaseFacade:
|
|
449
|
+
* @Injectable({ providedIn: 'root' })
|
|
450
|
+
* export class MyFacade {
|
|
451
|
+
* private readonly store = inject(Store);
|
|
452
|
+
*
|
|
453
|
+
* // Data selectors - memoized by NGXS
|
|
454
|
+
* readonly items = select(MyState.getItems);
|
|
455
|
+
*
|
|
456
|
+
* // Loading/Error slices - memoized by NGXS
|
|
457
|
+
* private readonly loadingActive = select(MyState.getLoadingActive);
|
|
458
|
+
* private readonly errors = select(MyState.getErrors);
|
|
459
|
+
*
|
|
460
|
+
* // Loading signals - computed from slice (minimal reactivity)
|
|
461
|
+
* readonly isLoadingItems = computed(() =>
|
|
462
|
+
* this.loadingActive().includes(MyActionKey.GetItems)
|
|
463
|
+
* );
|
|
464
|
+
*
|
|
465
|
+
* // Error signals - computed from slice (minimal reactivity)
|
|
466
|
+
* readonly itemsError = computed(() =>
|
|
467
|
+
* this.errors()[MyActionKey.GetItems] ?? null
|
|
468
|
+
* );
|
|
469
|
+
*
|
|
470
|
+
* // Dispatchers
|
|
471
|
+
* loadItems() {
|
|
472
|
+
* return this.store.dispatch(new GetItems());
|
|
473
|
+
* }
|
|
474
|
+
* }
|
|
475
|
+
* ```
|
|
476
|
+
*
|
|
477
|
+
* **Template Usage:**
|
|
478
|
+
* ```html
|
|
479
|
+
* @if (facade.isLoadingItems()) {
|
|
480
|
+
* <loading-spinner />
|
|
481
|
+
* } @else if (facade.itemsError(); as error) {
|
|
482
|
+
* <error-alert>{{ error }}</error-alert>
|
|
483
|
+
* } @else {
|
|
484
|
+
* @for (item of facade.items(); track item.id) {
|
|
485
|
+
* <item-card [item]="item" />
|
|
486
|
+
* }
|
|
487
|
+
* }
|
|
488
|
+
* ```
|
|
428
489
|
*/
|
|
429
490
|
declare abstract class BaseFacade<TState, TLoadingName extends string> {
|
|
430
491
|
/**
|
|
@@ -482,7 +543,15 @@ interface CrudLoadConfig<T, TState, TData = T[]> {
|
|
|
482
543
|
key: string;
|
|
483
544
|
request$: Observable<Response<TData>>;
|
|
484
545
|
stateProperty?: (state: TState) => T[];
|
|
546
|
+
/**
|
|
547
|
+
* @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
|
|
548
|
+
* CRUD methods should only be used for simple array operations with `stateProperty`.
|
|
549
|
+
*/
|
|
485
550
|
updateState?: (state: TState, data: TData) => Partial<TState>;
|
|
551
|
+
/**
|
|
552
|
+
* @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.
|
|
553
|
+
* CRUD methods should only be used for simple array operations.
|
|
554
|
+
*/
|
|
486
555
|
transform?: (data: TData) => TData;
|
|
487
556
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|
|
488
557
|
errorMessage?: string;
|
|
@@ -491,7 +560,15 @@ interface CrudCreateConfig<T, TState> {
|
|
|
491
560
|
key: string;
|
|
492
561
|
request$: Observable<Response<T>>;
|
|
493
562
|
stateProperty: (state: TState) => T[];
|
|
563
|
+
/**
|
|
564
|
+
* @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
|
|
565
|
+
* CRUD methods should only be used for simple array operations with `stateProperty`.
|
|
566
|
+
*/
|
|
494
567
|
updateState?: (state: TState, items: T[]) => Partial<TState>;
|
|
568
|
+
/**
|
|
569
|
+
* @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.
|
|
570
|
+
* CRUD methods should only be used for simple array operations.
|
|
571
|
+
*/
|
|
495
572
|
transform?: (data: T) => T;
|
|
496
573
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|
|
497
574
|
errorMessage?: string;
|
|
@@ -502,7 +579,15 @@ interface CrudUpdateConfig<T, TState> {
|
|
|
502
579
|
uniqueKey: keyof T;
|
|
503
580
|
id: string | number;
|
|
504
581
|
stateProperty: (state: TState) => T[];
|
|
582
|
+
/**
|
|
583
|
+
* @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
|
|
584
|
+
* CRUD methods should only be used for simple array operations with `stateProperty`.
|
|
585
|
+
*/
|
|
505
586
|
updateState?: (state: TState, items: T[]) => Partial<TState>;
|
|
587
|
+
/**
|
|
588
|
+
* @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.
|
|
589
|
+
* CRUD methods should only be used for simple array operations.
|
|
590
|
+
*/
|
|
506
591
|
transform?: (data: T) => T;
|
|
507
592
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|
|
508
593
|
errorMessage?: string;
|
|
@@ -513,6 +598,10 @@ interface CrudDeleteConfig<T, TState> {
|
|
|
513
598
|
uniqueKey: keyof T;
|
|
514
599
|
id: string | number;
|
|
515
600
|
stateProperty: (state: TState) => T[];
|
|
601
|
+
/**
|
|
602
|
+
* @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
|
|
603
|
+
* CRUD methods should only be used for simple array operations with `stateProperty`.
|
|
604
|
+
*/
|
|
516
605
|
updateState?: (state: TState, items: T[]) => Partial<TState>;
|
|
517
606
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|
|
518
607
|
errorMessage?: string;
|
|
@@ -529,7 +618,19 @@ declare abstract class CrudStateBase<T, TState extends LoadingStateShape<TLoad>,
|
|
|
529
618
|
*/
|
|
530
619
|
private getDefaultUpdateState;
|
|
531
620
|
/**
|
|
532
|
-
*
|
|
621
|
+
* @deprecated Use `handleApiRequest` directly with `onSuccess` callback.
|
|
622
|
+
* The `load()` method provides no significant benefit over `handleApiRequest`.
|
|
623
|
+
*
|
|
624
|
+
* @example
|
|
625
|
+
* // Instead of this.load(), use:
|
|
626
|
+
* return handleApiRequest({
|
|
627
|
+
* ctx,
|
|
628
|
+
* key: ActionKey.GetItems,
|
|
629
|
+
* request$: req$,
|
|
630
|
+
* onSuccess: (response) => ({
|
|
631
|
+
* items: response.data ?? [],
|
|
632
|
+
* }),
|
|
633
|
+
* });
|
|
533
634
|
*/
|
|
534
635
|
protected load<TData = T[]>(ctx: StateContext<TState>, config: CrudLoadConfig<T, TState, TData>): Observable<Response<TData>>;
|
|
535
636
|
/**
|