@masterteam/components 0.0.228 → 0.0.229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
+ import { NgComponentOutlet, DOCUMENT } from '@angular/common';
1
2
  import * as i0 from '@angular/core';
2
3
  import { InjectionToken, signal, Injectable, model, inject, ElementRef, Renderer2, effect, computed, Injector, RendererStyleFlags2, Input, Component, ApplicationRef, EnvironmentInjector, DestroyRef, createComponent } from '@angular/core';
3
- import { NgComponentOutlet, DOCUMENT } from '@angular/common';
4
4
  import { DynamicDialogRef } from 'primeng/dynamicdialog';
5
5
  import * as i1 from 'primeng/drawer';
6
6
  import { DrawerModule } from 'primeng/drawer';
@@ -90,6 +90,8 @@ class DynamicDrawerHost {
90
90
  cmpInputs = signal({}, ...(ngDevMode ? [{ debugName: "cmpInputs" }] : /* istanbul ignore next */ []));
91
91
  childInjector;
92
92
  ref;
93
+ refCloseSubscription;
94
+ fixedPosition = signal(true, ...(ngDevMode ? [{ debugName: "fixedPosition" }] : /* istanbul ignore next */ []));
93
95
  // Guards against emitting onClose twice: the X button closes via
94
96
  // handleHide() (programmatic visible=false, no PrimeNG onHide), while a
95
97
  // backdrop click / Escape closes via PrimeNG's own close() which DOES emit
@@ -156,11 +158,7 @@ class DynamicDrawerHost {
156
158
  this.drawerController.toggleMaximized();
157
159
  }
158
160
  computedDrawerStyle = computed(() => {
159
- const appendTo = this.cfg()?.appendTo;
160
- if (!appendTo || appendTo === 'body') {
161
- return { position: 'fixed' };
162
- }
163
- return null;
161
+ return this.fixedPosition() ? { position: 'fixed' } : null;
164
162
  }, ...(ngDevMode ? [{ debugName: "computedDrawerStyle" }] : /* istanbul ignore next */ []));
165
163
  /** Computed header - controller overrides config if set */
166
164
  computedHeader = computed(() => {
@@ -179,6 +177,8 @@ class DynamicDrawerHost {
179
177
  this.cfg.set(opts.config ?? {});
180
178
  this.cmpInputs.set(opts.config?.inputValues ?? {});
181
179
  this.ref = opts.ref;
180
+ this.fixedPosition.set(opts.fixedPosition ??
181
+ (!opts.config?.appendTo || opts.config?.appendTo === 'body'));
182
182
  this.childInjector = Injector.create({
183
183
  parent: opts.parent,
184
184
  providers: [
@@ -187,7 +187,8 @@ class DynamicDrawerHost {
187
187
  { provide: DrawerController, useValue: this.drawerController },
188
188
  ],
189
189
  });
190
- opts.ref.onClose.subscribe(() => {
190
+ this.refCloseSubscription?.unsubscribe();
191
+ this.refCloseSubscription = opts.ref.onClose.subscribe(() => {
191
192
  this.visible.set(false);
192
193
  });
193
194
  }
@@ -195,6 +196,9 @@ class DynamicDrawerHost {
195
196
  this.closed = false;
196
197
  this.visible.set(true);
197
198
  }
199
+ hide() {
200
+ this.visible.set(false);
201
+ }
198
202
  handleHide(data = null) {
199
203
  this.visible.set(false);
200
204
  this.closeOnce(data);
@@ -258,6 +262,13 @@ class DynamicDrawerHost {
258
262
  this.renderer.removeStyle(drawerEl, 'max-height');
259
263
  }
260
264
  }
265
+ ngOnDestroy() {
266
+ this.refCloseSubscription?.unsubscribe();
267
+ if (this.resizeAnimTimer) {
268
+ clearTimeout(this.resizeAnimTimer);
269
+ this.resizeAnimTimer = null;
270
+ }
271
+ }
261
272
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DynamicDrawerHost, deps: [], target: i0.ɵɵFactoryTarget.Component });
262
273
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", 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: `
263
274
  <p-drawer
@@ -384,14 +395,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
384
395
  args: [{ required: true }]
385
396
  }] } });
386
397
 
387
- // dynamic-drawer.service.ts
388
398
  class DrawerService {
389
399
  appRef = inject(ApplicationRef);
390
400
  env = inject(EnvironmentInjector);
391
401
  rootInjector = inject(Injector);
392
402
  destroyRef = inject(DestroyRef);
393
403
  doc = inject(DOCUMENT);
394
- hostRef;
404
+ activeHosts = new Set();
405
+ animationCleanupBufferMs = 32;
395
406
  defauiltConfig = {
396
407
  position: 'right',
397
408
  modal: true,
@@ -402,35 +413,54 @@ class DrawerService {
402
413
  };
403
414
  constructor() {
404
415
  this.preloadDrawerHost();
416
+ this.destroyRef.onDestroy(() => {
417
+ for (const lifecycle of Array.from(this.activeHosts)) {
418
+ this.cleanupHost(lifecycle);
419
+ }
420
+ });
405
421
  }
406
422
  open(component, config = {}) {
407
423
  config = { ...this.defauiltConfig, ...config };
408
424
  const targetEl = this.resolveAppendTarget(config.appendTo);
409
- this.hostRef = createComponent(DynamicDrawerHost, {
425
+ // Keep the host placement and the configuration exposed to the drawer
426
+ // content in sync. In particular, a missing selector falls back to body;
427
+ // consumers must not continue seeing the stale selector and infer that
428
+ // the drawer is container-positioned.
429
+ config = { ...config, appendTo: targetEl };
430
+ const hostRef = createComponent(DynamicDrawerHost, {
410
431
  environmentInjector: this.env,
411
432
  });
412
433
  const ref = new DynamicDialogRef();
413
- this.hostRef.instance.connect({
434
+ hostRef.instance.connect({
414
435
  component,
415
436
  config,
416
437
  parent: this.rootInjector,
417
438
  ref,
439
+ fixedPosition: targetEl === this.doc.body,
418
440
  });
419
- this.appRef.attachView(this.hostRef.hostView);
420
- // 📌 append to target (NOT body when provided)
421
- targetEl.appendChild(this.hostRef.location.nativeElement);
422
- // 🧹 auto-clean if app destroyed (SSR / HMR safety)
423
- this.destroyRef.onDestroy(() => {
424
- this.appRef.detachView(this.hostRef.hostView);
425
- this.hostRef.destroy();
426
- this.hostRef = undefined;
441
+ const lifecycle = {
442
+ hostRef,
443
+ hostElement: hostRef.location.nativeElement,
444
+ attached: false,
445
+ closing: false,
446
+ cleaned: false,
447
+ };
448
+ this.activeHosts.add(lifecycle);
449
+ this.appRef.attachView(hostRef.hostView);
450
+ lifecycle.attached = true;
451
+ targetEl.appendChild(lifecycle.hostElement);
452
+ lifecycle.closeSubscription = ref.onClose.subscribe({
453
+ next: () => this.closeHost(lifecycle, config.transitionOptions),
454
+ error: () => this.cleanupHost(lifecycle),
455
+ });
456
+ lifecycle.destroySubscription = ref.onDestroy.subscribe({
457
+ next: () => this.closeHost(lifecycle, config.transitionOptions),
458
+ error: () => this.cleanupHost(lifecycle),
427
459
  });
428
- const currentHostRef = this.hostRef;
429
460
  const openDrawer = () => {
430
- if (this.hostRef !== currentHostRef) {
431
- return;
461
+ if (!lifecycle.closing && !lifecycle.cleaned) {
462
+ hostRef.instance.show();
432
463
  }
433
- currentHostRef.instance.show();
434
464
  };
435
465
  if (this.doc.defaultView?.requestAnimationFrame) {
436
466
  this.doc.defaultView.requestAnimationFrame(openDrawer);
@@ -440,6 +470,49 @@ class DrawerService {
440
470
  }
441
471
  return ref;
442
472
  }
473
+ closeHost(lifecycle, transitionOptions) {
474
+ if (lifecycle.closing || lifecycle.cleaned) {
475
+ return;
476
+ }
477
+ lifecycle.closing = true;
478
+ lifecycle.hostRef.instance.hide();
479
+ const transitionDurationMs = this.readTransitionDurationMs(transitionOptions);
480
+ if (transitionDurationMs <= 0) {
481
+ this.cleanupHost(lifecycle);
482
+ return;
483
+ }
484
+ lifecycle.cleanupTimer = setTimeout(() => this.cleanupHost(lifecycle), transitionDurationMs + this.animationCleanupBufferMs);
485
+ }
486
+ cleanupHost(lifecycle) {
487
+ if (lifecycle.cleaned) {
488
+ return;
489
+ }
490
+ lifecycle.cleaned = true;
491
+ if (lifecycle.cleanupTimer) {
492
+ clearTimeout(lifecycle.cleanupTimer);
493
+ lifecycle.cleanupTimer = undefined;
494
+ }
495
+ lifecycle.closeSubscription?.unsubscribe();
496
+ lifecycle.destroySubscription?.unsubscribe();
497
+ if (lifecycle.attached) {
498
+ this.appRef.detachView(lifecycle.hostRef.hostView);
499
+ lifecycle.attached = false;
500
+ }
501
+ lifecycle.hostRef.destroy();
502
+ lifecycle.hostElement.remove();
503
+ this.activeHosts.delete(lifecycle);
504
+ }
505
+ readTransitionDurationMs(transitionOptions) {
506
+ if (!transitionOptions) {
507
+ return 0;
508
+ }
509
+ const match = transitionOptions.match(/(-?\d*\.?\d+)\s*(ms|s)\b/i);
510
+ if (!match) {
511
+ return 0;
512
+ }
513
+ const value = Math.max(0, Number(match[1]));
514
+ return match[2].toLowerCase() === 's' ? value * 1000 : value;
515
+ }
443
516
  preloadDrawerHost() {
444
517
  const preloadHostRef = createComponent(DynamicDrawerHost, {
445
518
  environmentInjector: this.env,
@@ -454,19 +527,17 @@ class DrawerService {
454
527
  preloadHostRef.destroy();
455
528
  }
456
529
  resolveAppendTarget(appendTo) {
457
- if (!appendTo)
530
+ if (!appendTo || appendTo === 'body') {
458
531
  return this.doc.body;
532
+ }
459
533
  if (typeof appendTo === 'string') {
460
534
  const selector = appendTo.startsWith('#') || appendTo.startsWith('.')
461
535
  ? appendTo
462
536
  : `#${appendTo}`;
463
- const el = this.doc.querySelector(selector);
464
- if (!el) {
465
- return this.doc.body;
466
- }
467
- return el;
537
+ return (this.doc.querySelector(selector) ??
538
+ this.doc.body);
468
539
  }
469
- return appendTo; // HTMLElement passed directly
540
+ return appendTo;
470
541
  }
471
542
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
472
543
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DrawerService, providedIn: 'root' });
@@ -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 ElementRef,\r\n Injector,\r\n Input,\r\n Renderer2,\r\n RendererStyleFlags2,\r\n effect,\r\n inject,\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\nimport { TranslocoService } from '@jsverse/transloco';\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 private _maximized = signal<boolean>(false);\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 /** Get the current maximized (full-width) state */\r\n get maximized() {\r\n return this._maximized;\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\n /** Set maximized (full-width) state */\r\n setMaximized(maximized: boolean) {\r\n this._maximized.set(maximized);\r\n }\r\n\r\n /** Toggle maximized (full-width) state */\r\n toggleMaximized() {\r\n this._maximized.set(!this._maximized());\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 [appendTo]=\"'self'\"\r\n [style]=\"computedDrawerStyle()\"\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 (onShow)=\"onDrawerShow()\"\r\n (onHide)=\"onDrawerHide()\"\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 <div class=\"flex items-center gap-2\">\r\n @if (canShowMaximizeToggle()) {\r\n <mt-button\r\n (onClick)=\"toggleMaximized()\"\r\n variant=\"outlined\"\r\n styleClass=\"!bg-white\"\r\n severity=\"secondary\"\r\n [icon]=\"maximizeButtonIcon()\"\r\n [tooltip]=\"maximizeButtonTooltip()\"\r\n >\r\n </mt-button>\r\n }\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 </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>({ position: 'right' });\r\n cmpInputs = signal<Record<string, unknown>>({});\r\n childInjector!: Injector;\r\n private ref?: DynamicDialogRef;\r\n // Guards against emitting onClose twice: the X button closes via\r\n // handleHide() (programmatic visible=false, no PrimeNG onHide), while a\r\n // backdrop click / Escape closes via PrimeNG's own close() which DOES emit\r\n // onHide. Without bridging onHide -> ref.close(), consumers never learn\r\n // about dismiss-by-outside-click / Escape.\r\n private closed = false;\r\n private drawerController = new DrawerController();\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n private readonly renderer = inject(Renderer2);\r\n private readonly transloco = inject(TranslocoService);\r\n private resizeAnimTimer: ReturnType<typeof setTimeout> | null = null;\r\n private readonly RESIZE_ANIM_CLASS = 'mt-drawer--anim-resize';\r\n private readonly RESIZE_ANIM_DURATION_MS = 700;\r\n\r\n constructor() {\r\n effect(() => {\r\n // React only when the user toggles maximize while the drawer is open.\r\n // Closing/opening goes through onDrawerShow / onDrawerHide so we never\r\n // race with PrimeNG's slide animation.\r\n const isMaximized = this.drawerController.maximized();\r\n if (!this.visible()) {\r\n return;\r\n }\r\n this.applyMaximizedInlineStyles(isMaximized, true);\r\n });\r\n }\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 const maximizedClass = this.drawerController.maximized()\r\n ? 'mt-drawer--maximized'\r\n : '';\r\n return `${configClass} ${dynamicClass} mt-drawer ${maximizedClass}`\r\n .replace(/\\s+/g, ' ')\r\n .trim();\r\n });\r\n\r\n /** Whether the maximize toggle button is visible in the header */\r\n canShowMaximizeToggle = computed(() => {\r\n const config = this.cfg();\r\n if (config?.showMaximizeToggle === false) {\r\n return false;\r\n }\r\n if (this.computedFullScreen()) {\r\n return false;\r\n }\r\n const position = config?.position ?? 'right';\r\n return position === 'left' || position === 'right';\r\n });\r\n\r\n /** Tooltip for maximize/restore button (state-aware) */\r\n maximizeButtonTooltip = computed(() => {\r\n const config = this.cfg();\r\n return this.drawerController.maximized()\r\n ? (config?.restoreTooltip ??\r\n this.transloco.translate('components.drawer.restoreSize'))\r\n : (config?.maximizeTooltip ??\r\n this.transloco.translate('components.drawer.expandFullWidth'));\r\n });\r\n\r\n /** Icon for maximize/restore button (state-aware) */\r\n maximizeButtonIcon = computed(() =>\r\n this.drawerController.maximized()\r\n ? 'layout.minimize-01'\r\n : 'layout.maximize-01',\r\n );\r\n\r\n /** Toggle the drawer's full-width state */\r\n toggleMaximized() {\r\n this.drawerController.toggleMaximized();\r\n }\r\n\r\n computedDrawerStyle = computed<Record<string, string> | null>(() => {\r\n const appendTo = this.cfg()?.appendTo;\r\n if (!appendTo || appendTo === 'body') {\r\n return { position: 'fixed' };\r\n }\r\n\r\n return null;\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\r\n opts.ref.onClose.subscribe(() => {\r\n this.visible.set(false);\r\n });\r\n }\r\n\r\n show() {\r\n this.closed = false;\r\n this.visible.set(true);\r\n }\r\n\r\n handleHide(data = null) {\r\n this.visible.set(false);\r\n this.closeOnce(data);\r\n }\r\n\r\n /** Close the drawer ref at most once, regardless of the close path. */\r\n private closeOnce(data: unknown = null): void {\r\n if (this.closed) {\r\n return;\r\n }\r\n this.closed = true;\r\n this.ref?.close(data);\r\n }\r\n\r\n onDrawerShow() {\r\n // Drawer DOM only exists after PrimeNG renders it — apply current state\r\n // instantly so the open animation doesn't fight the resize transition.\r\n this.applyMaximizedInlineStyles(this.drawerController.maximized(), false);\r\n }\r\n\r\n onDrawerHide() {\r\n // Instant cleanup — close animation already done; we don't want to start\r\n // a 650ms width transition mid-hide.\r\n this.applyMaximizedInlineStyles(false, false);\r\n\r\n // PrimeNG emits (onHide) when the drawer is dismissed via backdrop click\r\n // or Escape (its close() -> hide(true)). The X button instead closes\r\n // programmatically (visible=false -> onAfterLeave -> hide(false)), so it\r\n // does not reach here. Bridge the dismiss paths to ref.close() so\r\n // consumers' onClose runs for every close path. closeOnce() de-dupes.\r\n this.closeOnce();\r\n }\r\n\r\n private getDrawerElement(): HTMLElement | null {\r\n return this.host.nativeElement.querySelector(\r\n '.p-drawer',\r\n ) as HTMLElement | null;\r\n }\r\n\r\n private applyMaximizedInlineStyles(\r\n isMaximized: boolean,\r\n animate: boolean,\r\n ): void {\r\n const drawerEl = this.getDrawerElement();\r\n if (!drawerEl) {\r\n return;\r\n }\r\n\r\n if (this.resizeAnimTimer) {\r\n clearTimeout(this.resizeAnimTimer);\r\n this.resizeAnimTimer = null;\r\n }\r\n\r\n if (animate) {\r\n this.renderer.addClass(drawerEl, this.RESIZE_ANIM_CLASS);\r\n this.resizeAnimTimer = setTimeout(() => {\r\n this.renderer.removeClass(drawerEl, this.RESIZE_ANIM_CLASS);\r\n this.resizeAnimTimer = null;\r\n }, this.RESIZE_ANIM_DURATION_MS);\r\n } else {\r\n this.renderer.removeClass(drawerEl, this.RESIZE_ANIM_CLASS);\r\n }\r\n\r\n if (isMaximized) {\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'width',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'max-width',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'height',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'max-height',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n } else {\r\n this.renderer.removeStyle(drawerEl, 'width');\r\n this.renderer.removeStyle(drawerEl, 'max-width');\r\n this.renderer.removeStyle(drawerEl, 'height');\r\n this.renderer.removeStyle(drawerEl, 'max-height');\r\n }\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 showMaximizeToggle?: boolean;\r\n maximizeTooltip?: string;\r\n restoreTooltip?: string;\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 showMaximizeToggle: true,\r\n };\r\n\r\n constructor() {\r\n this.preloadDrawerHost();\r\n }\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 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 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 currentHostRef = this.hostRef;\r\n const openDrawer = () => {\r\n if (this.hostRef !== currentHostRef) {\r\n return;\r\n }\r\n\r\n currentHostRef.instance.show();\r\n };\r\n\r\n if (this.doc.defaultView?.requestAnimationFrame) {\r\n this.doc.defaultView.requestAnimationFrame(openDrawer);\r\n } else {\r\n setTimeout(openDrawer, 0);\r\n }\r\n\r\n return ref;\r\n }\r\n\r\n private preloadDrawerHost() {\r\n const preloadHostRef = createComponent(DynamicDrawerHost, {\r\n environmentInjector: this.env,\r\n });\r\n const preloadElement = preloadHostRef.location.nativeElement as HTMLElement;\r\n\r\n preloadElement.style.display = 'none';\r\n\r\n this.appRef.attachView(preloadHostRef.hostView);\r\n this.doc.body.appendChild(preloadElement);\r\n preloadHostRef.changeDetectorRef.detectChanges();\r\n this.appRef.detachView(preloadHostRef.hostView);\r\n preloadElement.remove();\r\n preloadHostRef.destroy();\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":";;;;;;;;;MAoBa,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;AAGvB;;;AAGG;MAEU,gBAAgB,CAAA;AACnB,IAAA,WAAW,GAAG,MAAM,CAAS,EAAE,kFAAC;AAChC,IAAA,OAAO,GAAG,MAAM,CAAS,EAAE,8EAAC;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAsB,SAAS,kFAAC;AACpD,IAAA,UAAU,GAAG,MAAM,CAAU,KAAK,iFAAC;;AAG3C,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,IA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AAA,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;;;ACjClC;;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 ElementRef,\r\n Injector,\r\n Input,\r\n Renderer2,\r\n RendererStyleFlags2,\r\n effect,\r\n inject,\r\n signal,\r\n InjectionToken,\r\n model,\r\n computed,\r\n Injectable,\r\n OnDestroy,\r\n} from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\nimport { TranslocoService } from '@jsverse/transloco';\r\nimport { Subscription } from 'rxjs';\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 private _maximized = signal<boolean>(false);\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 /** Get the current maximized (full-width) state */\r\n get maximized() {\r\n return this._maximized;\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\n /** Set maximized (full-width) state */\r\n setMaximized(maximized: boolean) {\r\n this._maximized.set(maximized);\r\n }\r\n\r\n /** Toggle maximized (full-width) state */\r\n toggleMaximized() {\r\n this._maximized.set(!this._maximized());\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 [appendTo]=\"'self'\"\r\n [style]=\"computedDrawerStyle()\"\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 (onShow)=\"onDrawerShow()\"\r\n (onHide)=\"onDrawerHide()\"\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 <div class=\"flex items-center gap-2\">\r\n @if (canShowMaximizeToggle()) {\r\n <mt-button\r\n (onClick)=\"toggleMaximized()\"\r\n variant=\"outlined\"\r\n styleClass=\"!bg-white\"\r\n severity=\"secondary\"\r\n [icon]=\"maximizeButtonIcon()\"\r\n [tooltip]=\"maximizeButtonTooltip()\"\r\n >\r\n </mt-button>\r\n }\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 </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 implements OnDestroy {\r\n public visible = model<boolean>(false);\r\n cmp = signal<any>(null);\r\n cfg = signal<any>({ position: 'right' });\r\n cmpInputs = signal<Record<string, unknown>>({});\r\n childInjector!: Injector;\r\n private ref?: DynamicDialogRef;\r\n private refCloseSubscription?: Subscription;\r\n private readonly fixedPosition = signal(true);\r\n // Guards against emitting onClose twice: the X button closes via\r\n // handleHide() (programmatic visible=false, no PrimeNG onHide), while a\r\n // backdrop click / Escape closes via PrimeNG's own close() which DOES emit\r\n // onHide. Without bridging onHide -> ref.close(), consumers never learn\r\n // about dismiss-by-outside-click / Escape.\r\n private closed = false;\r\n private drawerController = new DrawerController();\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n private readonly renderer = inject(Renderer2);\r\n private readonly transloco = inject(TranslocoService);\r\n private resizeAnimTimer: ReturnType<typeof setTimeout> | null = null;\r\n private readonly RESIZE_ANIM_CLASS = 'mt-drawer--anim-resize';\r\n private readonly RESIZE_ANIM_DURATION_MS = 700;\r\n\r\n constructor() {\r\n effect(() => {\r\n // React only when the user toggles maximize while the drawer is open.\r\n // Closing/opening goes through onDrawerShow / onDrawerHide so we never\r\n // race with PrimeNG's slide animation.\r\n const isMaximized = this.drawerController.maximized();\r\n if (!this.visible()) {\r\n return;\r\n }\r\n this.applyMaximizedInlineStyles(isMaximized, true);\r\n });\r\n }\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 const maximizedClass = this.drawerController.maximized()\r\n ? 'mt-drawer--maximized'\r\n : '';\r\n return `${configClass} ${dynamicClass} mt-drawer ${maximizedClass}`\r\n .replace(/\\s+/g, ' ')\r\n .trim();\r\n });\r\n\r\n /** Whether the maximize toggle button is visible in the header */\r\n canShowMaximizeToggle = computed(() => {\r\n const config = this.cfg();\r\n if (config?.showMaximizeToggle === false) {\r\n return false;\r\n }\r\n if (this.computedFullScreen()) {\r\n return false;\r\n }\r\n const position = config?.position ?? 'right';\r\n return position === 'left' || position === 'right';\r\n });\r\n\r\n /** Tooltip for maximize/restore button (state-aware) */\r\n maximizeButtonTooltip = computed(() => {\r\n const config = this.cfg();\r\n return this.drawerController.maximized()\r\n ? (config?.restoreTooltip ??\r\n this.transloco.translate('components.drawer.restoreSize'))\r\n : (config?.maximizeTooltip ??\r\n this.transloco.translate('components.drawer.expandFullWidth'));\r\n });\r\n\r\n /** Icon for maximize/restore button (state-aware) */\r\n maximizeButtonIcon = computed(() =>\r\n this.drawerController.maximized()\r\n ? 'layout.minimize-01'\r\n : 'layout.maximize-01',\r\n );\r\n\r\n /** Toggle the drawer's full-width state */\r\n toggleMaximized() {\r\n this.drawerController.toggleMaximized();\r\n }\r\n\r\n computedDrawerStyle = computed<Record<string, string> | null>(() => {\r\n return this.fixedPosition() ? { position: 'fixed' } : null;\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 fixedPosition?: boolean;\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.fixedPosition.set(\r\n opts.fixedPosition ??\r\n (!opts.config?.appendTo || opts.config?.appendTo === 'body'),\r\n );\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\r\n this.refCloseSubscription?.unsubscribe();\r\n this.refCloseSubscription = opts.ref.onClose.subscribe(() => {\r\n this.visible.set(false);\r\n });\r\n }\r\n\r\n show() {\r\n this.closed = false;\r\n this.visible.set(true);\r\n }\r\n\r\n hide() {\r\n this.visible.set(false);\r\n }\r\n\r\n handleHide(data = null) {\r\n this.visible.set(false);\r\n this.closeOnce(data);\r\n }\r\n\r\n /** Close the drawer ref at most once, regardless of the close path. */\r\n private closeOnce(data: unknown = null): void {\r\n if (this.closed) {\r\n return;\r\n }\r\n this.closed = true;\r\n this.ref?.close(data);\r\n }\r\n\r\n onDrawerShow() {\r\n // Drawer DOM only exists after PrimeNG renders it — apply current state\r\n // instantly so the open animation doesn't fight the resize transition.\r\n this.applyMaximizedInlineStyles(this.drawerController.maximized(), false);\r\n }\r\n\r\n onDrawerHide() {\r\n // Instant cleanup — close animation already done; we don't want to start\r\n // a 650ms width transition mid-hide.\r\n this.applyMaximizedInlineStyles(false, false);\r\n\r\n // PrimeNG emits (onHide) when the drawer is dismissed via backdrop click\r\n // or Escape (its close() -> hide(true)). The X button instead closes\r\n // programmatically (visible=false -> onAfterLeave -> hide(false)), so it\r\n // does not reach here. Bridge the dismiss paths to ref.close() so\r\n // consumers' onClose runs for every close path. closeOnce() de-dupes.\r\n this.closeOnce();\r\n }\r\n\r\n private getDrawerElement(): HTMLElement | null {\r\n return this.host.nativeElement.querySelector(\r\n '.p-drawer',\r\n ) as HTMLElement | null;\r\n }\r\n\r\n private applyMaximizedInlineStyles(\r\n isMaximized: boolean,\r\n animate: boolean,\r\n ): void {\r\n const drawerEl = this.getDrawerElement();\r\n if (!drawerEl) {\r\n return;\r\n }\r\n\r\n if (this.resizeAnimTimer) {\r\n clearTimeout(this.resizeAnimTimer);\r\n this.resizeAnimTimer = null;\r\n }\r\n\r\n if (animate) {\r\n this.renderer.addClass(drawerEl, this.RESIZE_ANIM_CLASS);\r\n this.resizeAnimTimer = setTimeout(() => {\r\n this.renderer.removeClass(drawerEl, this.RESIZE_ANIM_CLASS);\r\n this.resizeAnimTimer = null;\r\n }, this.RESIZE_ANIM_DURATION_MS);\r\n } else {\r\n this.renderer.removeClass(drawerEl, this.RESIZE_ANIM_CLASS);\r\n }\r\n\r\n if (isMaximized) {\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'width',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'max-width',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'height',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n this.renderer.setStyle(\r\n drawerEl,\r\n 'max-height',\r\n '100%',\r\n RendererStyleFlags2.Important,\r\n );\r\n } else {\r\n this.renderer.removeStyle(drawerEl, 'width');\r\n this.renderer.removeStyle(drawerEl, 'max-width');\r\n this.renderer.removeStyle(drawerEl, 'height');\r\n this.renderer.removeStyle(drawerEl, 'max-height');\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.refCloseSubscription?.unsubscribe();\r\n if (this.resizeAnimTimer) {\r\n clearTimeout(this.resizeAnimTimer);\r\n this.resizeAnimTimer = null;\r\n }\r\n }\r\n}\r\n","import { DOCUMENT } from '@angular/common';\r\nimport {\r\n ApplicationRef,\r\n ComponentRef,\r\n DestroyRef,\r\n EnvironmentInjector,\r\n Injectable,\r\n Injector,\r\n Type,\r\n createComponent,\r\n inject,\r\n} from '@angular/core';\r\nimport { DynamicDialogRef } from 'primeng/dynamicdialog';\r\nimport { Subscription } from 'rxjs';\r\n\r\nimport { DynamicDrawerHost } from './dynamic-drawer-host';\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 showMaximizeToggle?: boolean;\r\n maximizeTooltip?: string;\r\n restoreTooltip?: string;\r\n}\r\n\r\ninterface DrawerHostLifecycle {\r\n hostRef: ComponentRef<DynamicDrawerHost>;\r\n hostElement: HTMLElement;\r\n closeSubscription?: Subscription;\r\n destroySubscription?: Subscription;\r\n cleanupTimer?: ReturnType<typeof setTimeout>;\r\n attached: boolean;\r\n closing: boolean;\r\n cleaned: boolean;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class DrawerService {\r\n private readonly appRef = inject(ApplicationRef);\r\n private readonly env = inject(EnvironmentInjector);\r\n private readonly rootInjector = inject(Injector);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly doc = inject(DOCUMENT);\r\n private readonly activeHosts = new Set<DrawerHostLifecycle>();\r\n private readonly animationCleanupBufferMs = 32;\r\n\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 showMaximizeToggle: true,\r\n };\r\n\r\n constructor() {\r\n this.preloadDrawerHost();\r\n this.destroyRef.onDestroy(() => {\r\n for (const lifecycle of Array.from(this.activeHosts)) {\r\n this.cleanupHost(lifecycle);\r\n }\r\n });\r\n }\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 // Keep the host placement and the configuration exposed to the drawer\r\n // content in sync. In particular, a missing selector falls back to body;\r\n // consumers must not continue seeing the stale selector and infer that\r\n // the drawer is container-positioned.\r\n config = { ...config, appendTo: targetEl };\r\n const hostRef = createComponent(DynamicDrawerHost, {\r\n environmentInjector: this.env,\r\n });\r\n const ref = new DynamicDialogRef<T>();\r\n\r\n hostRef.instance.connect({\r\n component,\r\n config,\r\n parent: this.rootInjector,\r\n ref,\r\n fixedPosition: targetEl === this.doc.body,\r\n });\r\n\r\n const lifecycle: DrawerHostLifecycle = {\r\n hostRef,\r\n hostElement: hostRef.location.nativeElement as HTMLElement,\r\n attached: false,\r\n closing: false,\r\n cleaned: false,\r\n };\r\n this.activeHosts.add(lifecycle);\r\n\r\n this.appRef.attachView(hostRef.hostView);\r\n lifecycle.attached = true;\r\n targetEl.appendChild(lifecycle.hostElement);\r\n\r\n lifecycle.closeSubscription = ref.onClose.subscribe({\r\n next: () => this.closeHost(lifecycle, config.transitionOptions),\r\n error: () => this.cleanupHost(lifecycle),\r\n });\r\n lifecycle.destroySubscription = ref.onDestroy.subscribe({\r\n next: () => this.closeHost(lifecycle, config.transitionOptions),\r\n error: () => this.cleanupHost(lifecycle),\r\n });\r\n\r\n const openDrawer = () => {\r\n if (!lifecycle.closing && !lifecycle.cleaned) {\r\n hostRef.instance.show();\r\n }\r\n };\r\n\r\n if (this.doc.defaultView?.requestAnimationFrame) {\r\n this.doc.defaultView.requestAnimationFrame(openDrawer);\r\n } else {\r\n setTimeout(openDrawer, 0);\r\n }\r\n\r\n return ref;\r\n }\r\n\r\n private closeHost(\r\n lifecycle: DrawerHostLifecycle,\r\n transitionOptions?: string,\r\n ): void {\r\n if (lifecycle.closing || lifecycle.cleaned) {\r\n return;\r\n }\r\n\r\n lifecycle.closing = true;\r\n lifecycle.hostRef.instance.hide();\r\n\r\n const transitionDurationMs =\r\n this.readTransitionDurationMs(transitionOptions);\r\n if (transitionDurationMs <= 0) {\r\n this.cleanupHost(lifecycle);\r\n return;\r\n }\r\n\r\n lifecycle.cleanupTimer = setTimeout(\r\n () => this.cleanupHost(lifecycle),\r\n transitionDurationMs + this.animationCleanupBufferMs,\r\n );\r\n }\r\n\r\n private cleanupHost(lifecycle: DrawerHostLifecycle): void {\r\n if (lifecycle.cleaned) {\r\n return;\r\n }\r\n\r\n lifecycle.cleaned = true;\r\n if (lifecycle.cleanupTimer) {\r\n clearTimeout(lifecycle.cleanupTimer);\r\n lifecycle.cleanupTimer = undefined;\r\n }\r\n\r\n lifecycle.closeSubscription?.unsubscribe();\r\n lifecycle.destroySubscription?.unsubscribe();\r\n\r\n if (lifecycle.attached) {\r\n this.appRef.detachView(lifecycle.hostRef.hostView);\r\n lifecycle.attached = false;\r\n }\r\n lifecycle.hostRef.destroy();\r\n lifecycle.hostElement.remove();\r\n this.activeHosts.delete(lifecycle);\r\n }\r\n\r\n private readTransitionDurationMs(transitionOptions?: string): number {\r\n if (!transitionOptions) {\r\n return 0;\r\n }\r\n\r\n const match = transitionOptions.match(/(-?\\d*\\.?\\d+)\\s*(ms|s)\\b/i);\r\n if (!match) {\r\n return 0;\r\n }\r\n\r\n const value = Math.max(0, Number(match[1]));\r\n return match[2].toLowerCase() === 's' ? value * 1000 : value;\r\n }\r\n\r\n private preloadDrawerHost(): void {\r\n const preloadHostRef = createComponent(DynamicDrawerHost, {\r\n environmentInjector: this.env,\r\n });\r\n const preloadElement = preloadHostRef.location.nativeElement as HTMLElement;\r\n\r\n preloadElement.style.display = 'none';\r\n\r\n this.appRef.attachView(preloadHostRef.hostView);\r\n this.doc.body.appendChild(preloadElement);\r\n preloadHostRef.changeDetectorRef.detectChanges();\r\n this.appRef.detachView(preloadHostRef.hostView);\r\n preloadElement.remove();\r\n preloadHostRef.destroy();\r\n }\r\n\r\n private resolveAppendTarget(appendTo?: string | HTMLElement): HTMLElement {\r\n if (!appendTo || appendTo === 'body') {\r\n return this.doc.body;\r\n }\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 return (\r\n (this.doc.querySelector(selector) as HTMLElement | null) ??\r\n this.doc.body\r\n );\r\n }\r\n\r\n return appendTo;\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAsBa,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;AAGvB;;;AAGG;MAEU,gBAAgB,CAAA;AACnB,IAAA,WAAW,GAAG,MAAM,CAAS,EAAE,kFAAC;AAChC,IAAA,OAAO,GAAG,MAAM,CAAS,EAAE,8EAAC;AAC5B,IAAA,WAAW,GAAG,MAAM,CAAsB,SAAS,kFAAC;AACpD,IAAA,UAAU,GAAG,MAAM,CAAU,KAAK,iFAAC;;AAG3C,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,IAAI,SAAS,GAAA;QACX,O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C,IAAI;QACtB;AAEA,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,QACG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAwB;AACxD,gBAAA,IAAI,CAAC,GAAG,CAAC,IAAI;QAEjB;AAEA,QAAA,OAAO,QAAQ;IACjB;uGAvLW,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;;;AC9ClC;;AAEG;;;;"}
@@ -959,7 +959,7 @@ class EntityValuePreview {
959
959
  return viewType === 'LookupMatrix' ? 'Lookup' : viewType;
960
960
  }, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
961
961
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
962
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityValuePreview, isStandalone: true, selector: "mt-entity-value-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: "@switch (previewType()) {\n @case (\"Text\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"LongText\") {\n <mt-entity-long-text [data]=\"data()\" />\n }\n @case (\"Date\") {\n <mt-entity-date [data]=\"data()\" />\n }\n @case (\"DateTime\") {\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\n }\n @case (\"User\") {\n <mt-entity-user [data]=\"data()\" />\n }\n @case (\"Percentage\") {\n <mt-entity-percentage [data]=\"data()\" />\n }\n @case (\"Currency\") {\n <mt-entity-currency [data]=\"data()\" />\n }\n @case (\"Number\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"Checkbox\") {\n <mt-entity-checkbox [data]=\"data()\" />\n }\n @case (\"Lookup\") {\n <mt-entity-lookup [data]=\"data()\" />\n }\n @case (\"Status\") {\n <mt-entity-status [data]=\"data()\" />\n }\n @case (\"Attachment\") {\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\n }\n @case (\"Location\") {\n <mt-entity-location [data]=\"data()\" />\n }\n @case (\"Connection\") {\n <mt-entity-connection [data]=\"data()\" />\n }\n @case (\"ScheduleItemSelector\") {\n <mt-entity-schedule-item [data]=\"data()\" />\n }\n @case (\"LeafDetails\") {\n <mt-entity-leaf-details [data]=\"data()\" />\n }\n @default {\n <mt-entity-text [data]=\"data()\" />\n }\n}\n", dependencies: [{ kind: "component", type: EntityText, selector: "mt-entity-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLongText, selector: "mt-entity-long-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityDate, selector: "mt-entity-date", inputs: ["data", "name", "value", "viewType"] }, { kind: "component", type: EntityUser, selector: "mt-entity-user", inputs: ["data"] }, { kind: "component", type: EntityPercentage, selector: "mt-entity-percentage", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityCurrency, selector: "mt-entity-currency", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityCheckbox, selector: "mt-entity-checkbox", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityLookup, selector: "mt-entity-lookup", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityAttachment, selector: "mt-entity-attachment", inputs: ["data", "name", "shape", "value", "endPoint", "context"] }, { kind: "component", type: EntityStatus, selector: "mt-entity-status", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLeafDetails, selector: "mt-entity-leaf-details", inputs: ["data"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }, { kind: "component", type: EntityConnection, selector: "mt-entity-connection", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityScheduleItem, selector: "mt-entity-schedule-item", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
962
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityValuePreview, isStandalone: true, selector: "mt-entity-value-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n", dependencies: [{ kind: "component", type: EntityText, selector: "mt-entity-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLongText, selector: "mt-entity-long-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityDate, selector: "mt-entity-date", inputs: ["data", "name", "value", "viewType"] }, { kind: "component", type: EntityUser, selector: "mt-entity-user", inputs: ["data"] }, { kind: "component", type: EntityPercentage, selector: "mt-entity-percentage", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityCurrency, selector: "mt-entity-currency", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityCheckbox, selector: "mt-entity-checkbox", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityLookup, selector: "mt-entity-lookup", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityAttachment, selector: "mt-entity-attachment", inputs: ["data", "name", "shape", "value", "endPoint", "context"] }, { kind: "component", type: EntityStatus, selector: "mt-entity-status", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLeafDetails, selector: "mt-entity-leaf-details", inputs: ["data"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }, { kind: "component", type: EntityConnection, selector: "mt-entity-connection", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityScheduleItem, selector: "mt-entity-schedule-item", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
963
963
  }
964
964
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, decorators: [{
965
965
  type: Component,
@@ -980,7 +980,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
980
980
  EntityScheduleItem,
981
981
  ], host: {
982
982
  class: 'block min-w-0 w-full',
983
- }, template: "@switch (previewType()) {\n @case (\"Text\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"LongText\") {\n <mt-entity-long-text [data]=\"data()\" />\n }\n @case (\"Date\") {\n <mt-entity-date [data]=\"data()\" />\n }\n @case (\"DateTime\") {\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\n }\n @case (\"User\") {\n <mt-entity-user [data]=\"data()\" />\n }\n @case (\"Percentage\") {\n <mt-entity-percentage [data]=\"data()\" />\n }\n @case (\"Currency\") {\n <mt-entity-currency [data]=\"data()\" />\n }\n @case (\"Number\") {\n <mt-entity-text [data]=\"data()\" />\n }\n @case (\"Checkbox\") {\n <mt-entity-checkbox [data]=\"data()\" />\n }\n @case (\"Lookup\") {\n <mt-entity-lookup [data]=\"data()\" />\n }\n @case (\"Status\") {\n <mt-entity-status [data]=\"data()\" />\n }\n @case (\"Attachment\") {\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\n }\n @case (\"Location\") {\n <mt-entity-location [data]=\"data()\" />\n }\n @case (\"Connection\") {\n <mt-entity-connection [data]=\"data()\" />\n }\n @case (\"ScheduleItemSelector\") {\n <mt-entity-schedule-item [data]=\"data()\" />\n }\n @case (\"LeafDetails\") {\n <mt-entity-leaf-details [data]=\"data()\" />\n }\n @default {\n <mt-entity-text [data]=\"data()\" />\n }\n}\n" }]
983
+ }, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n" }]
984
984
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
985
985
 
986
986
  /**
@@ -1089,11 +1089,11 @@ class EntityLookupModuleCheckList {
1089
1089
  return typeof key === 'string' ? key : '';
1090
1090
  }
1091
1091
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, deps: [], target: i0.ɵɵFactoryTarget.Component });
1092
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookupModuleCheckList, isStandalone: true, selector: "mt-entity-lookup-module-check-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"data().name ?? ''\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (hasItems()) {\n <div class=\"flex flex-col gap-2\">\n @for (item of items(); track $index) {\n <div\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\n >\n {{ item.lookupLabel || emptyLabel }}\n </span>\n @if (item.props.length) {\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\n @for (prop of item.props; track prop.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"prop\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n } @else {\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\n >\n {{ emptyLabel }}\n </span>\n }\n</mt-entity-field>\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1092
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookupModuleCheckList, isStandalone: true, selector: "mt-entity-lookup-module-check-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupLabel || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"prop\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1093
1093
  }
1094
1094
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, decorators: [{
1095
1095
  type: Component,
1096
- args: [{ selector: 'mt-entity-lookup-module-check-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, EntityValuePreview], template: "<mt-entity-field\n [label]=\"data().name ?? ''\"\n [configuration]=\"data()?.configuration\"\n gap=\"normal\"\n>\n @if (hasItems()) {\n <div class=\"flex flex-col gap-2\">\n @for (item of items(); track $index) {\n <div\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\n >\n {{ item.lookupLabel || emptyLabel }}\n </span>\n @if (item.props.length) {\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\n @for (prop of item.props; track prop.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"prop\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n } @else {\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\n >\n {{ emptyLabel }}\n </span>\n }\n</mt-entity-field>\n" }]
1096
+ args: [{ selector: 'mt-entity-lookup-module-check-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, EntityValuePreview], template: "<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupLabel || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"prop\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
1097
1097
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
1098
1098
 
1099
1099
  const LEAF_DETAILS_KEY_SEPARATOR = '::leaflevel::';
@@ -1280,13 +1280,13 @@ class EntityPreviewBody {
1280
1280
  data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1281
1281
  attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
1282
1282
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
1283
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreviewBody, isStandalone: true, selector: "mt-entity-preview-body", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@if (data().viewType === \"LookupModuleCheckList\") {\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\n} @else {\n <mt-entity-value-preview\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n}\n", dependencies: [{ kind: "component", type: EntityLookupModuleCheckList, selector: "mt-entity-lookup-module-check-list", inputs: ["data"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1283
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreviewBody, isStandalone: true, selector: "mt-entity-preview-body", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@if (data().viewType === \"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\r\n} @else {\r\n <mt-entity-value-preview\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n}\r\n", dependencies: [{ kind: "component", type: EntityLookupModuleCheckList, selector: "mt-entity-lookup-module-check-list", inputs: ["data"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1284
1284
  }
1285
1285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, decorators: [{
1286
1286
  type: Component,
1287
1287
  args: [{ selector: 'mt-entity-preview-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityLookupModuleCheckList, EntityValuePreview], host: {
1288
1288
  class: 'w-full',
1289
- }, template: "@if (data().viewType === \"LookupModuleCheckList\") {\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\n} @else {\n <mt-entity-value-preview\n [data]=\"data()\"\n [attachmentShape]=\"attachmentShape()\"\n />\n}\n" }]
1289
+ }, template: "@if (data().viewType === \"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\r\n} @else {\r\n <mt-entity-value-preview\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n}\r\n" }]
1290
1290
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
1291
1291
 
1292
1292
  class ComparisonValue {