@agnos-ui/angular-headless 0.6.0 → 0.7.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/fesm2022/agnos-ui-angular-headless.mjs +66 -48
  2. package/fesm2022/agnos-ui-angular-headless.mjs.map +1 -1
  3. package/package.json +5 -5
  4. package/slot.directive.d.ts +3 -3
  5. package/types.d.ts +13 -5
  6. package/utils/coercion.d.ts +2 -2
  7. package/utils/directive.d.ts +4 -4
  8. package/utils/widget.d.ts +1 -1
  9. package/esm2022/agnos-ui-angular-headless.mjs +0 -5
  10. package/esm2022/config.mjs +0 -143
  11. package/esm2022/generated/components/accordion/index.mjs +0 -2
  12. package/esm2022/generated/components/alert/index.mjs +0 -2
  13. package/esm2022/generated/components/modal/index.mjs +0 -2
  14. package/esm2022/generated/components/pagination/index.mjs +0 -2
  15. package/esm2022/generated/components/progressbar/index.mjs +0 -2
  16. package/esm2022/generated/components/rating/index.mjs +0 -2
  17. package/esm2022/generated/components/select/index.mjs +0 -2
  18. package/esm2022/generated/components/slider/index.mjs +0 -2
  19. package/esm2022/generated/components/toast/index.mjs +0 -2
  20. package/esm2022/generated/components/tree/index.mjs +0 -2
  21. package/esm2022/generated/config.mjs +0 -2
  22. package/esm2022/generated/index.mjs +0 -34
  23. package/esm2022/generated/services/extendWidget.mjs +0 -2
  24. package/esm2022/generated/services/floatingUI.mjs +0 -2
  25. package/esm2022/generated/services/focustrack.mjs +0 -2
  26. package/esm2022/generated/services/hash.mjs +0 -2
  27. package/esm2022/generated/services/intersection.mjs +0 -2
  28. package/esm2022/generated/services/matchMedia.mjs +0 -2
  29. package/esm2022/generated/services/navManager.mjs +0 -2
  30. package/esm2022/generated/services/portal.mjs +0 -2
  31. package/esm2022/generated/services/resizeObserver.mjs +0 -2
  32. package/esm2022/generated/services/siblingsInert.mjs +0 -2
  33. package/esm2022/generated/services/transitions/baseTransitions.mjs +0 -2
  34. package/esm2022/generated/services/transitions/collapse.mjs +0 -2
  35. package/esm2022/generated/services/transitions/cssTransitions.mjs +0 -2
  36. package/esm2022/generated/services/transitions/simpleClassTransition.mjs +0 -2
  37. package/esm2022/generated/slot.directive.mjs +0 -2
  38. package/esm2022/generated/types.mjs +0 -2
  39. package/esm2022/generated/utils/coercion.mjs +0 -2
  40. package/esm2022/generated/utils/directive.mjs +0 -2
  41. package/esm2022/generated/utils/stores.mjs +0 -2
  42. package/esm2022/generated/utils/widget.mjs +0 -2
  43. package/esm2022/generated/utils/writables.mjs +0 -2
  44. package/esm2022/generated/utils/zone.mjs +0 -2
  45. package/esm2022/index.mjs +0 -5
  46. package/esm2022/slot.directive.mjs +0 -233
  47. package/esm2022/types.mjs +0 -38
  48. package/esm2022/utils/coercion.mjs +0 -32
  49. package/esm2022/utils/directive.mjs +0 -118
  50. package/esm2022/utils/stores.mjs +0 -29
  51. package/esm2022/utils/widget.mjs +0 -149
  52. package/esm2022/utils/zone.mjs +0 -77
@@ -14,7 +14,7 @@ export * from '@agnos-ui/core/services/transitions/collapse';
14
14
  export * from '@agnos-ui/core/services/transitions/baseTransitions';
15
15
  export * from '@agnos-ui/core/utils/writables';
16
16
  import * as i0 from '@angular/core';
17
- import { inject, NgZone, Injectable, signal, DestroyRef, Injector, ElementRef, PLATFORM_ID, runInInjectionContext, afterNextRender, Directive, Input, SkipSelf, Optional, InjectionToken, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewChild, createComponent, EnvironmentInjector, TemplateRef, reflectComponentType, ViewContainerRef } from '@angular/core';
17
+ import { inject, NgZone, Injectable, signal, DestroyRef, Injector, ElementRef, PLATFORM_ID, runInInjectionContext, afterNextRender, input, Directive, computed, SkipSelf, Optional, InjectionToken, booleanAttribute, numberAttribute, viewChild, Component, ChangeDetectionStrategy, createComponent, EnvironmentInjector, TemplateRef, reflectComponentType, ViewContainerRef } from '@angular/core';
18
18
  import { toReadableStore } from '@agnos-ui/core/utils/stores';
19
19
  export * from '@agnos-ui/core/utils/stores';
20
20
  import { multiDirective } from '@agnos-ui/core/utils/directive';
@@ -23,7 +23,7 @@ import { isPlatformServer } from '@angular/common';
23
23
  export * from '@agnos-ui/core/types';
24
24
  import { createWidgetsConfig } from '@agnos-ui/core/config';
25
25
  export * from '@agnos-ui/core/config';
26
- import { writable, computed } from '@amadeus-it-group/tansu';
26
+ import { writable, computed as computed$1 } from '@amadeus-it-group/tansu';
27
27
  export * from '@agnos-ui/core/components/tree';
28
28
  export * from '@agnos-ui/core/components/toast';
29
29
  export * from '@agnos-ui/core/components/slider';
@@ -204,15 +204,19 @@ const useDirectiveForHost = (directive, params) => {
204
204
  * This directive uses a private instance of {@link useDirectiveForHost} to manage the directive and its parameter.
205
205
  */
206
206
  class UseDirective {
207
- #useDirective = useDirectiveForHost();
207
+ constructor() {
208
+ this.use = input.required({ alias: 'auUse' });
209
+ this.#useDirective = useDirectiveForHost();
210
+ }
211
+ #useDirective;
208
212
  /** @internal */
209
213
  ngOnChanges() {
210
- const use = this.use;
214
+ const use = this.use();
211
215
  const [directive, param] = Array.isArray(use) ? use : [use];
212
216
  this.#useDirective.update(directive, param);
213
217
  }
214
218
  static { this.ɵfac = function UseDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UseDirective)(); }; }
215
- static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: UseDirective, selectors: [["", "auUse", ""]], inputs: { use: [0, "auUse", "use"] }, standalone: true, features: [i0.ɵɵNgOnChangesFeature] }); }
219
+ static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: UseDirective, selectors: [["", "auUse", ""]], inputs: { use: [1, "auUse", "use"] }, features: [i0.ɵɵNgOnChangesFeature] }); }
216
220
  }
217
221
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UseDirective, [{
218
222
  type: Directive,
@@ -220,23 +224,27 @@ class UseDirective {
220
224
  standalone: true,
221
225
  selector: '[auUse]',
222
226
  }]
223
- }], null, { use: [{
224
- type: Input,
225
- args: ['auUse']
226
- }] }); })();
227
+ }], null, null); })();
227
228
  /**
228
229
  * A directive that allows the use of multiple directives on a host element.
229
230
  *
230
231
  * @template T - A tuple type representing the directives and their optional parameters.
231
232
  */
232
233
  class UseMultiDirective {
233
- #useDirective = useDirectiveForHost();
234
+ constructor() {
235
+ /**
236
+ * An input property that takes a tuple of directives and their optional parameters.
237
+ */
238
+ this.useMulti = input.required({ alias: 'auUseMulti' });
239
+ this.#useDirective = useDirectiveForHost();
240
+ }
241
+ #useDirective;
234
242
  /** @internal */
235
243
  ngOnChanges() {
236
- this.#useDirective.update(multiDirective, this.useMulti);
244
+ this.#useDirective.update(multiDirective, this.useMulti());
237
245
  }
238
246
  static { this.ɵfac = function UseMultiDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UseMultiDirective)(); }; }
239
- static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: UseMultiDirective, selectors: [["", "auUseMulti", ""]], inputs: { useMulti: [0, "auUseMulti", "useMulti"] }, standalone: true, features: [i0.ɵɵNgOnChangesFeature] }); }
247
+ static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: UseMultiDirective, selectors: [["", "auUseMulti", ""]], inputs: { useMulti: [1, "auUseMulti", "useMulti"] }, features: [i0.ɵɵNgOnChangesFeature] }); }
240
248
  }
241
249
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UseMultiDirective, [{
242
250
  type: Directive,
@@ -244,10 +252,7 @@ class UseMultiDirective {
244
252
  standalone: true,
245
253
  selector: '[auUseMulti]',
246
254
  }]
247
- }], null, { useMulti: [{
248
- type: Input,
249
- args: [{ alias: 'auUseMulti', required: true }]
250
- }] }); })();
255
+ }], null, null); })();
251
256
 
252
257
  /**
253
258
  * Represents a template for a component with specified properties.
@@ -271,18 +276,30 @@ class ComponentTemplate {
271
276
  * @template W - The type of the widget that this slot component manages.
272
277
  */
273
278
  class SlotComponent {
279
+ constructor() {
280
+ /**
281
+ * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}
282
+ */
283
+ this.state = input.required();
284
+ /**
285
+ * all the api functions to interact with the widget
286
+ */
287
+ this.api = input.required();
288
+ /**
289
+ * directives to be used on html elements in the template of the slot
290
+ */
291
+ this.directives = input.required();
292
+ /**
293
+ * The slot context, to be used when the slot component uses other slots.
294
+ */
295
+ this.slotContext = computed(() => ({ state: this.state(), api: this.api(), directives: this.directives() }));
296
+ }
274
297
  static { this.ɵfac = function SlotComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SlotComponent)(); }; }
275
- static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SlotComponent, inputs: { state: "state", api: "api", directives: "directives" } }); }
298
+ static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SlotComponent, inputs: { state: [1, "state"], api: [1, "api"], directives: [1, "directives"] } }); }
276
299
  }
277
300
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SlotComponent, [{
278
301
  type: Directive
279
- }], null, { state: [{
280
- type: Input
281
- }], api: [{
282
- type: Input
283
- }], directives: [{
284
- type: Input
285
- }] }); })();
302
+ }], null, null); })();
286
303
 
287
304
  const createPatchSlots = (set) => {
288
305
  let lastValue = {};
@@ -344,7 +361,7 @@ const callWidgetFactoryWithConfig = ({ factory, defaultConfig, widgetConfig, eve
344
361
  const defaultConfig$ = toReadableStore(defaultConfig);
345
362
  events = zoneWrapper.insideNgZoneWrapFunctionsObject(events);
346
363
  const widget = factory({
347
- config: computed(() => ({
364
+ config: computed$1(() => ({
348
365
  ...defaultConfig$(),
349
366
  children: slotChildren?.(),
350
367
  ...widgetConfig?.(),
@@ -528,7 +545,7 @@ const widgetsConfigFactory = (widgetsConfigInjectionToken = new InjectionToken('
528
545
  */
529
546
  const injectWidgetConfig = (widgetName) => {
530
547
  const widgetsConfig = inject(widgetsConfigInjectionToken, { optional: true });
531
- return computed(() => widgetsConfig?.()[widgetName]);
548
+ return computed$1(() => widgetsConfig?.()[widgetName]);
532
549
  };
533
550
  /**
534
551
  * Creates and initializes a widget using the provided factory and configuration options.
@@ -571,7 +588,7 @@ const { widgetsConfigInjectionToken, provideWidgetsConfig, injectWidgetConfig, i
571
588
  * Intended to be used as a transform function of an input.
572
589
  *
573
590
  * @example
574
- * ```@Input({ transform: auBooleanAttribute }) status: boolean | undefined;```
591
+ * ```readonly status = input({ transform: auBooleanAttribute });```
575
592
  * @param value - Value to be transformed.
576
593
  * @returns the value transformed
577
594
  */
@@ -587,7 +604,7 @@ function auBooleanAttribute(value) {
587
604
  * @param value - Value to be transformed.
588
605
  *
589
606
  * @example
590
- * ```@Input({ transform: auNumberAttribute }) id: number | undefined;```
607
+ * ```readonly id = input({ transform: auNumberAttribute });```
591
608
  * @returns the value transformed
592
609
  */
593
610
  function auNumberAttribute(value) {
@@ -613,12 +630,14 @@ class SlotHandler {
613
630
  destroy() { }
614
631
  }
615
632
  class StringSlotComponent {
633
+ constructor() {
634
+ this.text = viewChild.required('text');
635
+ }
616
636
  static { this.ɵfac = function StringSlotComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || StringSlotComponent)(); }; }
617
637
  static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: StringSlotComponent, selectors: [["ng-component"]], viewQuery: function StringSlotComponent_Query(rf, ctx) { if (rf & 1) {
618
- i0.ɵɵviewQuery(_c0, 7);
638
+ i0.ɵɵviewQuerySignal(ctx.text, _c0, 5);
619
639
  } if (rf & 2) {
620
- let _t;
621
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.text = _t.first);
640
+ i0.ɵɵqueryAdvance();
622
641
  } }, decls: 2, vars: 0, consts: [["text", ""]], template: function StringSlotComponent_Template(rf, ctx) { if (rf & 1) {
623
642
  i0.ɵɵtemplate(0, StringSlotComponent_ng_template_0_Template, 1, 1, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
624
643
  } }, encapsulation: 2, changeDetection: 0 }); }
@@ -629,10 +648,7 @@ class StringSlotComponent {
629
648
  changeDetection: ChangeDetectionStrategy.OnPush,
630
649
  template: `<ng-template #text let-content="content">{{ content }}</ng-template>`,
631
650
  }]
632
- }], null, { text: [{
633
- type: ViewChild,
634
- args: ['text', { static: true }]
635
- }] }); })();
651
+ }], null, null); })();
636
652
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(StringSlotComponent, { className: "StringSlotComponent", filePath: "slot.directive.ts", lineNumber: 29 }); })();
637
653
  const stringSlotComponentTemplate = new ComponentTemplate(StringSlotComponent, 'text');
638
654
  class StringSlotHandler extends SlotHandler {
@@ -737,10 +753,10 @@ class ComponentTemplateSlotHandler extends SlotHandler {
737
753
  environmentInjector: this.viewContainerRef.injector.get(EnvironmentInjector),
738
754
  });
739
755
  this.#templateRef = this.#componentRef.instance[slot.templateProp];
740
- this.#templateSlotHandler.slotChange(this.#templateRef, props);
756
+ this.#templateSlotHandler.slotChange(this.#templateRef(), props);
741
757
  }
742
758
  propsChange(_slot, props) {
743
- this.#templateSlotHandler.propsChange(this.#templateRef, props);
759
+ this.#templateSlotHandler.propsChange(this.#templateRef(), props);
744
760
  }
745
761
  destroy() {
746
762
  this.#templateSlotHandler.destroy();
@@ -782,6 +798,14 @@ const getSlotType = (value) => {
782
798
  */
783
799
  class SlotDirective {
784
800
  constructor() {
801
+ /**
802
+ * The slot content to be managed.
803
+ */
804
+ this.slot = input.required({ alias: 'auSlot' });
805
+ /**
806
+ * The properties for the slot content.
807
+ */
808
+ this.props = input.required({ alias: 'auSlotProps' });
785
809
  this._viewContainerRef = inject(ViewContainerRef);
786
810
  }
787
811
  /**
@@ -791,7 +815,7 @@ class SlotDirective {
791
815
  ngOnChanges(changes) {
792
816
  const slotChange = changes['slot'];
793
817
  const propsChange = changes['props'];
794
- const slot = this.slot;
818
+ const slot = this.slot();
795
819
  if (slotChange) {
796
820
  const newSlotType = getSlotType(slot);
797
821
  if (newSlotType !== this._slotType) {
@@ -799,10 +823,10 @@ class SlotDirective {
799
823
  this._slotHandler = newSlotType ? new newSlotType(this._viewContainerRef) : undefined;
800
824
  this._slotType = newSlotType;
801
825
  }
802
- this._slotHandler?.slotChange(slot, this.props);
826
+ this._slotHandler?.slotChange(slot, this.props());
803
827
  }
804
828
  else if (propsChange) {
805
- this._slotHandler?.propsChange(slot, this.props);
829
+ this._slotHandler?.propsChange(slot, this.props());
806
830
  }
807
831
  }
808
832
  /** @internal */
@@ -811,7 +835,7 @@ class SlotDirective {
811
835
  this._slotHandler = undefined;
812
836
  }
813
837
  static { this.ɵfac = function SlotDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SlotDirective)(); }; }
814
- static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SlotDirective, selectors: [["", "auSlot", ""]], inputs: { slot: [0, "auSlot", "slot"], props: [0, "auSlotProps", "props"] }, standalone: true, features: [i0.ɵɵNgOnChangesFeature] }); }
838
+ static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SlotDirective, selectors: [["", "auSlot", ""]], inputs: { slot: [1, "auSlot", "slot"], props: [1, "auSlotProps", "props"] }, features: [i0.ɵɵNgOnChangesFeature] }); }
815
839
  }
816
840
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SlotDirective, [{
817
841
  type: Directive,
@@ -819,13 +843,7 @@ class SlotDirective {
819
843
  selector: '[auSlot]',
820
844
  standalone: true,
821
845
  }]
822
- }], null, { slot: [{
823
- type: Input,
824
- args: ['auSlot']
825
- }], props: [{
826
- type: Input,
827
- args: [{ alias: 'auSlotProps', required: true }]
828
- }] }); })();
846
+ }], null, null); })();
829
847
 
830
848
  /*
831
849
  * Public API Surface of @agnos-ui/angular-headless
@@ -1 +1 @@
1
- {"version":3,"file":"agnos-ui-angular-headless.mjs","sources":["../../src/utils/zone.ts","../../src/utils/stores.ts","../../src/utils/directive.ts","../../src/types.ts","../../src/utils/widget.ts","../../src/config.ts","../../src/utils/coercion.ts","../../src/slot.directive.ts","../../src/index.ts","../../src/agnos-ui-angular-headless.ts"],"sourcesContent":["import {Injectable, NgZone, inject} from '@angular/core';\n\nconst noop = () => {};\nconst identity = <T>(a: T) => a;\n\ntype Wrapper = <T>(fn: T) => T;\n\nconst createObjectWrapper =\n\t(wrap: Wrapper): Wrapper =>\n\t(object) => {\n\t\tif (!object || typeof object !== 'object') {\n\t\t\treturn object;\n\t\t}\n\t\tconst res = {} as any;\n\t\tfor (const key of Object.keys(object)) {\n\t\t\tres[key] = wrap((object as any)[key]);\n\t\t}\n\t\treturn res;\n\t};\n\nconst createReturnValueWrapper =\n\t(wrapReturnValue: Wrapper, wrapResult: Wrapper): Wrapper =>\n\t(fn) =>\n\t\twrapResult(typeof fn === 'function' ? (((...args: any[]) => wrapReturnValue(fn(...args))) as any) : fn);\n\n/**\n * A utility class that provides methods to run functions inside or outside of Angular's NgZone.\n * This can be useful for optimizing performance by avoiding unnecessary change detection cycles.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class ZoneWrapper {\n\treadonly #zone = inject(NgZone);\n\treadonly #hasZone = this.#zone.run(() => NgZone.isInAngularZone()); // check if zone is enabled (can be NoopZone, cf https://angular.io/guide/zone#noopzone)\n\t#runNeeded = false;\n\t#runPlanned = false;\n\n\tplanNgZoneRun = this.#hasZone\n\t\t? () => {\n\t\t\t\tif (this.#zone.isStable) {\n\t\t\t\t\tthis.#runNeeded = true;\n\t\t\t\t\tif (!this.#runPlanned) {\n\t\t\t\t\t\tthis.#runPlanned = true;\n\t\t\t\t\t\tvoid (async () => {\n\t\t\t\t\t\t\tawait Promise.resolve();\n\t\t\t\t\t\t\tthis.#runPlanned = false;\n\t\t\t\t\t\t\tif (this.#runNeeded) {\n\t\t\t\t\t\t\t\tthis.ngZoneRun(noop);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t: noop;\n\n\t/**\n\t * Run the input function synchronously within the Angular zone\n\t *\n\t * @param fn - a function to run\n\t * @returns the value returned by the function\n\t */\n\tngZoneRun<T>(fn: () => T): T {\n\t\tthis.#runNeeded = false;\n\t\treturn this.#zone.run(fn);\n\t}\n\n\tinsideNgZone: Wrapper = this.#hasZone\n\t\t? (fn) => (typeof fn === 'function' ? (((...args: any[]) => this.ngZoneRun(() => fn(...args))) as any) : fn)\n\t\t: identity;\n\tinsideNgZoneWrapFunctionsObject = createObjectWrapper(this.insideNgZone);\n\n\toutsideNgZone: Wrapper = this.#hasZone\n\t\t? (fn) => (typeof fn === 'function' ? (((...args: any[]) => this.#zone.runOutsideAngular(() => fn(...args))) as any) : fn)\n\t\t: identity;\n\n\toutsideNgZoneWrapFunctionsObject = createObjectWrapper(this.outsideNgZone);\n\toutsideNgZoneWrapDirective = createReturnValueWrapper(this.outsideNgZoneWrapFunctionsObject, this.outsideNgZone);\n\toutsideNgZoneWrapDirectivesObject = createObjectWrapper(this.outsideNgZoneWrapDirective);\n}\n","import type {ReadableSignal} from '@amadeus-it-group/tansu';\nimport type {Signal} from '@angular/core';\nimport {DestroyRef, inject, signal} from '@angular/core';\nimport {ZoneWrapper} from './zone';\n\nexport * from '@agnos-ui/core/utils/stores';\n\n/**\n * Converts a Tansu `ReadableSignal` to an Angular `Signal`.\n *\n * This function wraps the provided Tansu signal in an Angular signal, ensuring that updates\n * are properly handled within Angular's zone. It subscribes to the Tansu signal and updates\n * the Angular signal with the received values. The equality function for the Angular signal\n * is set to always return false, ensuring that every new value from the Tansu signal triggers\n * an update.\n *\n * @template T - The type of the value emitted by the signals.\n * @param tansuSignal - The Tansu signal to convert.\n * @returns - The resulting Angular signal.\n */\nexport const toAngularSignal = <T>(tansuSignal: ReadableSignal<T>): Signal<T> => {\n\tconst zoneWrapper = inject(ZoneWrapper);\n\t// The equality of objects from 2 sequential emissions is already checked in tansu signal.\n\t// Here we'll always emit the value received from tansu signal, therefor the equality function\n\tconst res = signal(undefined as any as T, {equal: () => false});\n\tconst subscription = zoneWrapper.outsideNgZone(tansuSignal.subscribe)((value) => {\n\t\tres.set(value);\n\t\tzoneWrapper.planNgZoneRun();\n\t});\n\tinject(DestroyRef).onDestroy(zoneWrapper.outsideNgZone(subscription));\n\treturn res;\n};\n","import type {Directive as AgnosUIDirective, DirectiveAndParam, DirectivesAndOptParam} from '@agnos-ui/core/types';\nimport {multiDirective} from '@agnos-ui/core/utils/directive';\nimport {isPlatformServer} from '@angular/common';\nimport type {OnChanges} from '@angular/core';\nimport {DestroyRef, Directive, ElementRef, Injector, Input, PLATFORM_ID, afterNextRender, inject, runInInjectionContext} from '@angular/core';\n\nexport * from '@agnos-ui/core/utils/directive';\n\n/**\n * A utility function to manage the lifecycle of a directive for a host element.\n *\n * This function handles the creation, updating, and destruction of a directive instance\n * associated with a host element. It ensures that the directive is called appropriately\n * based on the platform (server or client) and manages the directive's lifecycle within\n * the Angular injection context.\n *\n * @template T - The type of parameters that the directive accepts.\n *\n * @param [directive] - The directive to be applied to the host element.\n * @param [params] - The parameters to be passed to the directive.\n *\n * @returns An object containing an `update` function to update the directive and its parameters.\n */\nexport const useDirectiveForHost = <T>(directive?: AgnosUIDirective<T>, params?: T) => {\n\tconst injector = inject(Injector);\n\tconst ref = inject(ElementRef);\n\tconst platform = inject(PLATFORM_ID);\n\n\tlet instance: undefined | ReturnType<AgnosUIDirective<T>>;\n\tlet plannedCallDirective = false;\n\n\tconst callDirective = isPlatformServer(platform)\n\t\t? () => {\n\t\t\t\tinstance = directive?.(ref.nativeElement, params as T);\n\t\t\t}\n\t\t: () => {\n\t\t\t\tif (plannedCallDirective || !directive) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tplannedCallDirective = true;\n\t\t\t\trunInInjectionContext(injector, () => {\n\t\t\t\t\tafterNextRender(() => {\n\t\t\t\t\t\tplannedCallDirective = false;\n\t\t\t\t\t\tinstance = directive?.(ref.nativeElement, params as T);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\tfunction destroyDirectiveInstance() {\n\t\tconst oldInstance = instance;\n\t\tinstance = undefined;\n\t\tdirective = undefined;\n\t\toldInstance?.destroy?.();\n\t}\n\n\tinject(DestroyRef).onDestroy(destroyDirectiveInstance);\n\n\tfunction update(newDirective?: AgnosUIDirective<T>, newParams?: T) {\n\t\tif (newDirective !== directive) {\n\t\t\tvoid destroyDirectiveInstance();\n\t\t\tdirective = newDirective;\n\t\t\tparams = newParams;\n\t\t\tcallDirective();\n\t\t} else if (newParams != params) {\n\t\t\tparams = newParams;\n\t\t\tinstance?.update?.(params as T);\n\t\t}\n\t}\n\n\tcallDirective();\n\treturn {update};\n};\n\n/**\n * A directive that allows the use of another directive with optional parameters.\n *\n * @template T - The type of the parameter that can be passed to the directive.\n *\n * @remarks\n * This directive uses a private instance of {@link useDirectiveForHost} to manage the directive and its parameter.\n */\n@Directive({\n\tstandalone: true,\n\tselector: '[auUse]',\n})\nexport class UseDirective<T> implements OnChanges {\n\t@Input('auUse')\n\tuse: AgnosUIDirective | DirectiveAndParam<T> | undefined;\n\n\treadonly #useDirective = useDirectiveForHost<T>();\n\n\t/** @internal */\n\tngOnChanges() {\n\t\tconst use = this.use;\n\t\tconst [directive, param] = Array.isArray(use) ? use : [use as any];\n\t\tthis.#useDirective.update(directive, param);\n\t}\n}\n\n/**\n * A directive that allows the use of multiple directives on a host element.\n *\n * @template T - A tuple type representing the directives and their optional parameters.\n */\n@Directive({\n\tstandalone: true,\n\tselector: '[auUseMulti]',\n})\nexport class UseMultiDirective<T extends any[]> implements OnChanges {\n\t/**\n\t * An input property that takes a tuple of directives and their optional parameters.\n\t */\n\t@Input({alias: 'auUseMulti', required: true})\n\tuseMulti!: DirectivesAndOptParam<T>;\n\n\treadonly #useDirective = useDirectiveForHost<DirectivesAndOptParam<T>>();\n\n\t/** @internal */\n\tngOnChanges() {\n\t\tthis.#useDirective.update(multiDirective, this.useMulti);\n\t}\n}\n","import type {SlotContent as CoreSlotContent, Widget, WidgetState, Extends} from '@agnos-ui/core/types';\nimport type {Signal, TemplateRef, Type} from '@angular/core';\nimport {Directive, Input} from '@angular/core';\n\nexport * from '@agnos-ui/core/types';\n\n/**\n * Represents a template for a component with specified properties.\n *\n * @template Props - The type of properties that the template accepts.\n * @template K - The key in the template object that maps to the template reference.\n * @template T - An object type where each key of type K maps to a TemplateRef of Props.\n *\n * @param component - The component type that contains the template.\n * @param templateProp - The key in the component that maps to the template reference.\n */\nexport class ComponentTemplate<Props, K extends string, T extends {[key in K]: TemplateRef<Props>}> {\n\tconstructor(\n\t\tpublic readonly component: Type<T>,\n\t\tpublic readonly templateProp: K,\n\t) {}\n}\n\n/**\n * Represents the content that can be used in a slot.\n *\n * @template Props - The type of the properties that the slot content can accept.\n *\n * This type can be one of the following:\n * - `undefined | null`: Nullish value\n * - `string`: A static string\n * - `(props: Props) => string`: A function that takes props as input and returns a string template\n * - `TemplateRef<Props>`: A reference to an Angular template with the specified properties.\n * - `Type<unknown>`: A type representing an unknown component or directive.\n * - `ComponentTemplate<Props, any, any>`: A component template with the specified properties.\n */\nexport type SlotContent<Props extends object = object> =\n\t| CoreSlotContent<Props>\n\t| TemplateRef<Props>\n\t| Type<unknown>\n\t| ComponentTemplate<Props, any, any>;\n\n/**\n * A directive representing a slot component that can be used to manage the state and context of a widget.\n *\n * @template W - The type of the widget that this slot component manages.\n */\n@Directive()\nexport abstract class SlotComponent<W extends Widget> {\n\t/**\n\t * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t */\n\t@Input()\n\tstate!: AngularState<W>;\n\t/**\n\t * all the api functions to interact with the widget\n\t */\n\t@Input()\n\tapi!: W['api'];\n\t/**\n\t * directives to be used on html elements in the template of the slot\n\t */\n\t@Input()\n\tdirectives!: W['directives'];\n}\n\n/**\n * Type utility to determine if a given type `T` is or extends `SlotContent<any>`.\n *\n * This type alias uses conditional types to check if `T` extends `SlotContent<any>` or if `SlotContent<any>` extends `T`.\n * If either condition is true, it resolves to `T`, otherwise it resolves to `0`.\n *\n * @template T - The type to be checked.\n */\nexport type IsSlotContent<T> = Extends<T, SlotContent<any>> | Extends<SlotContent<any>, T> extends 1 ? T : 0;\n\n/**\n * Represents the state of an Angular widget, where each key in the widget's state\n * is mapped to a Signal of the corresponding state value.\n *\n * @template W - The type of the widget.\n */\nexport type AngularState<W extends Widget> = {[key in keyof WidgetState<W>]: Signal<WidgetState<W>[key]>};\n\n/**\n * Represents an Angular widget that extends a base widget type.\n *\n * @template W - The type of the base widget.\n */\nexport interface AngularWidget<W extends Widget> extends Pick<W, 'api' | 'directives' | 'patch'> {\n\t/**\n\t * A promise that resolves when the widget is initialized\n\t */\n\tinitialized: Promise<void>;\n\t/**\n\t * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t */\n\tstate: AngularState<W>;\n\t/**\n\t * A function to initialize the Angular widget.\n\t */\n\tngInit: () => void;\n\t/**\n\t * A utility function to update the slot properties.\n\t */\n\tupdateSlots: () => void;\n}\n\n/**\n * Represents the context for a widget slot, providing access to the widget and its state.\n *\n * @template W - The type of the widget.\n */\nexport interface WidgetSlotContext<W extends Widget> extends Pick<W, 'api' | 'directives'> {\n\t/**\n\t * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t */\n\tstate: AngularState<W>;\n}\n","import {computed, type ReadableSignal, writable} from '@amadeus-it-group/tansu';\nimport type {AfterContentChecked, OnChanges, OnInit, SimpleChanges, TemplateRef} from '@angular/core';\nimport {Directive, Injector, inject, runInInjectionContext} from '@angular/core';\nimport type {AngularState, AngularWidget, IsSlotContent, SlotContent, Widget, WidgetFactory, WidgetProps} from '../types';\nimport {toAngularSignal, toReadableStore} from './stores';\nimport {ZoneWrapper} from './zone';\n\nconst createPatchSlots = <T extends object>(set: (object: Partial<T>) => void) => {\n\tlet lastValue: Partial<T> = {};\n\treturn (object: T) => {\n\t\tconst newValue: Partial<T> = {};\n\t\tlet hasChange = false;\n\t\tfor (const key of Object.keys(object) as (string & keyof T)[]) {\n\t\t\tconst objectKey = (object as any)[key];\n\t\t\tif (objectKey != null) {\n\t\t\t\t// only use defined slots\n\t\t\t\tnewValue[key] = objectKey;\n\t\t\t}\n\t\t\tif (objectKey != lastValue[key]) {\n\t\t\t\thasChange = true;\n\t\t\t}\n\t\t}\n\t\tif (hasChange) {\n\t\t\tlastValue = newValue;\n\t\t\tset(newValue);\n\t\t}\n\t};\n};\n\n/**\n * Call a widget factory using provided configs.\n *\n * @param parameter - the parameter\n * @param parameter.factory - the widget factory to call\n * @param parameter.defaultConfig - the default config of the widget\n * @param parameter.widgetConfig - the config of the widget, overriding the defaultConfig\n * @param parameter.events - the events of the widget\n * @param parameter.afterInit - a callback to call after successful setup of the widget\n * @param parameter.slotTemplates - a function to provide all slot templates using child queries\n * @param parameter.slotChildren - a function to provide the default children slot using a view query\n * @returns the widget\n */\nexport const callWidgetFactoryWithConfig = <W extends Widget>({\n\tfactory,\n\tdefaultConfig,\n\twidgetConfig,\n\tevents,\n\tafterInit,\n\tslotTemplates,\n\tslotChildren,\n}: {\n\tfactory: WidgetFactory<W>;\n\tdefaultConfig?: Partial<WidgetProps<W>> | ReadableSignal<Partial<WidgetProps<W>> | undefined>;\n\twidgetConfig?: null | undefined | ReadableSignal<Partial<WidgetProps<W>> | undefined>;\n\tevents?: Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}`>>;\n\tafterInit?: (widget: AngularWidget<W>) => void;\n\tslotTemplates?: () => {\n\t\t[K in keyof WidgetProps<W> as IsSlotContent<WidgetProps<W>[K]> extends 0 ? never : K]: WidgetProps<W>[K] extends SlotContent<infer U>\n\t\t\t? TemplateRef<U> | undefined\n\t\t\t: never;\n\t};\n\tslotChildren?: () => TemplateRef<void> | undefined;\n}): AngularWidget<W> => {\n\tconst injector = inject(Injector);\n\tconst slots$ = writable({});\n\tconst props = {};\n\tlet initDone: () => void;\n\tconst patchSlots = createPatchSlots(slots$.set);\n\n\tconst res = {\n\t\tinitialized: new Promise<void>((resolve) => {\n\t\t\tinitDone = resolve;\n\t\t}),\n\t\tupdateSlots: () => {\n\t\t\tif (slotTemplates) {\n\t\t\t\tpatchSlots(slotTemplates());\n\t\t\t}\n\t\t},\n\t\tpatch(newProps: Partial<WidgetProps<W>>) {\n\t\t\t// temporary function replaced in ngInit\n\t\t\tObject.assign(props, newProps);\n\t\t},\n\t\tngInit() {\n\t\t\trunInInjectionContext(injector, () => {\n\t\t\t\tconst zoneWrapper = inject(ZoneWrapper);\n\t\t\t\tfactory = zoneWrapper.outsideNgZone(factory);\n\t\t\t\tconst defaultConfig$ = toReadableStore(defaultConfig);\n\t\t\t\tevents = zoneWrapper.insideNgZoneWrapFunctionsObject(events);\n\t\t\t\tconst widget = factory({\n\t\t\t\t\tconfig: computed(() => ({\n\t\t\t\t\t\t...defaultConfig$(),\n\t\t\t\t\t\tchildren: slotChildren?.(),\n\t\t\t\t\t\t...widgetConfig?.(),\n\t\t\t\t\t\t...slots$(),\n\t\t\t\t\t\t...(events as Partial<WidgetProps<W>>),\n\t\t\t\t\t})),\n\t\t\t\t\tprops,\n\t\t\t\t});\n\t\t\t\tObject.assign(res, {\n\t\t\t\t\tpatch: zoneWrapper.outsideNgZone(widget.patch),\n\t\t\t\t\tdirectives: zoneWrapper.outsideNgZoneWrapDirectivesObject(widget.directives),\n\t\t\t\t\tapi: zoneWrapper.outsideNgZoneWrapFunctionsObject(widget.api),\n\t\t\t\t\tstate: Object.fromEntries(\n\t\t\t\t\t\tObject.entries<ReadableSignal<unknown>>(widget.stores as any).map(([key, val]) => [key.slice(0, -1), toAngularSignal(val)]),\n\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t\tafterInit?.(res as AngularWidget<W>);\n\t\t\t\tinitDone();\n\t\t\t});\n\t\t},\n\t};\n\n\treturn res as AngularWidget<W>;\n};\n\nfunction patchSimpleChanges(patchFn: (obj: any) => void, changes: SimpleChanges) {\n\tconst obj: any = {};\n\tfor (const [key, simpleChange] of Object.entries(changes)) {\n\t\tif (simpleChange !== undefined) {\n\t\t\tobj[key] = simpleChange.currentValue;\n\t\t}\n\t}\n\tpatchFn(obj);\n}\n\n/**\n * An abstract base class for widget directives, providing common functionality\n * for Angular components that interact with widgets.\n *\n * @template W - The type of the widget.\n */\n@Directive()\nexport abstract class BaseWidgetDirective<W extends Widget> implements OnChanges, OnInit, AfterContentChecked {\n\tconstructor(private readonly _widget: AngularWidget<W>) {}\n\n\t/**\n\t * Retrieves the widget api\n\t * @returns the widget api\n\t */\n\tget api(): W['api'] {\n\t\treturn this._widget.api;\n\t}\n\n\t/**\n\t * Retrieves the widget state. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t * @returns the widget state\n\t */\n\tget state(): AngularState<W> {\n\t\treturn this._widget.state;\n\t}\n\n\t/**\n\t * Retrieves the widget directives\n\t * @returns the widget directives\n\t */\n\tget directives(): W['directives'] {\n\t\treturn this._widget.directives;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t * @internal\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tpatchSimpleChanges(this._widget.patch, changes);\n\t}\n\n\t/** @internal */\n\tngOnInit(): void {\n\t\tthis._widget.ngInit();\n\t}\n\n\t/** @internal */\n\tngAfterContentChecked(): void {\n\t\tthis._widget.updateSlots();\n\t}\n}\n","import type {Widget, WidgetFactory, WidgetProps} from '@agnos-ui/core/types';\nimport type {Partial2Levels, WidgetsConfigStore, WidgetsConfig} from '@agnos-ui/core/config';\nimport {createWidgetsConfig} from '@agnos-ui/core/config';\nimport type {ReadableSignal} from '@amadeus-it-group/tansu';\nimport {computed} from '@amadeus-it-group/tansu';\nimport type {FactoryProvider, TemplateRef} from '@angular/core';\nimport {InjectionToken, Injector, Optional, SkipSelf, inject, runInInjectionContext} from '@angular/core';\nimport type {AngularWidget, IsSlotContent, SlotContent} from './types';\nimport {callWidgetFactoryWithConfig} from './utils/widget';\n\nexport * from '@agnos-ui/core/config';\n\ntype AdaptParentConfig<Config> = (config: Partial2Levels<Config>) => Partial2Levels<Config>;\ntype InjectWidgetsConfig<Config> = (config?: Partial2Levels<Config>) => WidgetsConfigStore<Config>;\n\n/**\n * A factory to create the utilities to allow widgets to be context-aware.\n *\n * It can be used when extending the core and creating new widgets.\n *\n * @template Config - The type of the widgets configuration object.\n * @param widgetsConfigInjectionToken - the widgets config injection token\n * @returns the utilities to create / manage widgets and contexts\n */\nexport const widgetsConfigFactory = <Config extends {[widgetName: string]: object} = WidgetsConfig>(\n\twidgetsConfigInjectionToken = new InjectionToken<WidgetsConfigStore<Config>>('widgetsConfig'),\n) => {\n\t/**\n\t * Creates a provider of widgets default configuration that inherits from any widgets default configuration already defined at an upper level\n\t * in the Angular dependency injection system. It contains its own set of widgets configuration properties that override the same properties form\n\t * the parent configuration.\n\t *\n\t * @remarks\n\t * The configuration is computed from the parent configuration in two steps:\n\t * - first step: the parent configuration is transformed by the adaptParentConfig function (if specified).\n\t * If adaptParentConfig is not specified, this step is skipped.\n\t * - second step: the configuration from step 1 is merged (2-levels deep) with the own$ store. The own$ store initially contains\n\t * an empty object (i.e. no property from the parent is overridden). It can be changed by calling set on the store returned by\n\t * {@link injectWidgetsConfig}.\n\t *\n\t * @param adaptParentConfig - optional function that receives a 2-levels copy of the widgets default configuration\n\t * defined at an upper level in the Angular dependency injection system (or an empty object if there is none) and returns the widgets\n\t * default configuration to be used.\n\t * It is called only if the configuration is needed, and was not yet computed for the current value of the parent configuration.\n\t * It is called in a tansu reactive context, so it can use any tansu store and will be called again if those stores change.\n\t * It is also called in an Angular injection context, so it can call the Angular inject function to get and use dependencies from the\n\t * Angular dependency injection system.\n\t *\n\t * @returns DI provider to be included a list of `providers` (for example at a component level or\n\t * any other level of the Angular dependency injection system)\n\t *\n\t * @example\n\t * ```typescript\n\t * @Component({\n\t * // ...\n\t * providers: [\n\t * provideWidgetsConfig((parentConfig) => {\n\t * // first step configuration: transforms the parent configuration\n\t * parentConfig.rating = parentConfig.rating ?? {};\n\t * parentConfig.rating.className = `${parentConfig.rating.className ?? ''} my-rating-extra-class`\n\t * return parentConfig;\n\t * })\n\t * ]\n\t * })\n\t * class MyComponent {\n\t * widgetsConfig = injectWidgetsConfig();\n\t * constructor() {\n\t * this.widgetsConfig.set({\n\t * // second step configuration: overrides the parent configuration\n\t * rating: {\n\t * slotStar: MyCustomSlotStar\n\t * }\n\t * });\n\t * }\n\t * // ...\n\t * }\n\t * ```\n\t */\n\tconst provideWidgetsConfig = (adaptParentConfig?: AdaptParentConfig<Config>): FactoryProvider => ({\n\t\tprovide: widgetsConfigInjectionToken,\n\t\tuseFactory: (parent: WidgetsConfigStore<Config> | null) => {\n\t\t\tif (adaptParentConfig) {\n\t\t\t\tconst injector = inject(Injector);\n\t\t\t\tconst originalAdaptParentConfig = adaptParentConfig;\n\t\t\t\tadaptParentConfig = (value) => runInInjectionContext(injector, () => originalAdaptParentConfig(value));\n\t\t\t}\n\t\t\treturn createWidgetsConfig(parent ?? undefined, adaptParentConfig);\n\t\t},\n\t\tdeps: [[new SkipSelf(), new Optional(), widgetsConfigInjectionToken]],\n\t});\n\n\t/**\n\t * Returns the widgets default configuration store that was provided in the current injection context.\n\t * Throws if the no widgets default configuration store was provided.\n\t *\n\t * @param defaultConfig - values to set as soon as the config is injected\n\t * @remarks\n\t * This function must be called from an injection context, such as a constructor, a factory function, a field initializer or\n\t * a function used with {@link https://angular.io/api/core/runInInjectionContext | runInInjectionContext}.\n\t *\n\t * @returns the widgets default configuration store.\n\t */\n\tconst injectWidgetsConfig: InjectWidgetsConfig<Config> = (defaultConfig?: Partial2Levels<Config>) => {\n\t\tconst widgetsConfig = inject(widgetsConfigInjectionToken);\n\t\tif (defaultConfig) {\n\t\t\twidgetsConfig.set(defaultConfig);\n\t\t}\n\t\treturn widgetsConfig;\n\t};\n\n\t/**\n\t * Injects the configuration for a specific widget.\n\t *\n\t * @template N - The key of the widget configuration in the `Config` type.\n\t * @param widgetName - The name of the widget whose configuration is to be injected.\n\t * @returns A `ReadableSignal` that provides a partial configuration of the specified widget or `undefined` if the configuration is not available.\n\t */\n\tconst injectWidgetConfig = <N extends keyof Config>(widgetName: N): ReadableSignal<Partial<Config[N]> | undefined> => {\n\t\tconst widgetsConfig = inject(widgetsConfigInjectionToken, {optional: true});\n\t\treturn computed(() => widgetsConfig?.()[widgetName]);\n\t};\n\n\t/**\n\t * Creates and initializes a widget using the provided factory and configuration options.\n\t *\n\t * @template W - The type of the widget.\n\t * @param params - The parameters for creating the widget.\n\t * @param params.factory - The factory function to create the widget.\n\t * @param params.widgetName - The name of the widget configuration to inject, if any.\n\t * @param params.defaultConfig - The default configuration for the widget.\n\t * @param params.events - The event handlers for the widget.\n\t * @param params.slotTemplates - A function that returns the slot templates for the widget.\n\t * @param params.slotChildren - A function that returns the slot children for the widget.\n\t * @param params.afterInit - A callback function to be called after the widget is initialized.\n\t * @returns The initialized widget.\n\t */\n\tconst callWidgetFactory = <W extends Widget>({\n\t\tfactory,\n\t\twidgetName = null,\n\t\tdefaultConfig = {},\n\t\tevents,\n\t\tafterInit,\n\t\tslotTemplates,\n\t\tslotChildren,\n\t}: {\n\t\tfactory: WidgetFactory<W>;\n\t\twidgetName?: null | keyof Config;\n\t\tdefaultConfig?: Partial<WidgetProps<W>> | ReadableSignal<Partial<WidgetProps<W>> | undefined>;\n\t\tevents?: Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}`>>;\n\t\tafterInit?: (widget: AngularWidget<W>) => void;\n\t\tslotTemplates?: () => {\n\t\t\t[K in keyof WidgetProps<W> as IsSlotContent<WidgetProps<W>[K]> extends 0 ? never : K]: WidgetProps<W>[K] extends SlotContent<infer U>\n\t\t\t\t? TemplateRef<U> | undefined\n\t\t\t\t: never;\n\t\t};\n\t\tslotChildren?: () => TemplateRef<void> | undefined;\n\t}): AngularWidget<W> =>\n\t\tcallWidgetFactoryWithConfig({\n\t\t\tfactory,\n\t\t\twidgetConfig: widgetName ? (injectWidgetConfig(widgetName) as any) : null,\n\t\t\tdefaultConfig,\n\t\t\tevents,\n\t\t\tafterInit,\n\t\t\tslotTemplates: slotTemplates as any,\n\t\t\tslotChildren,\n\t\t});\n\n\treturn {\n\t\t/**\n\t\t * Dependency Injection token which can be used to provide or inject the widgets default configuration store.\n\t\t */\n\t\twidgetsConfigInjectionToken,\n\t\tprovideWidgetsConfig,\n\t\tinjectWidgetsConfig,\n\t\tinjectWidgetConfig,\n\t\tcallWidgetFactory,\n\t};\n};\n\nexport const {widgetsConfigInjectionToken, provideWidgetsConfig, injectWidgetConfig, injectWidgetsConfig, callWidgetFactory} =\n\twidgetsConfigFactory<WidgetsConfig>();\n","import {booleanAttribute, numberAttribute} from '@angular/core';\n\n/**\n * Transforms a value (typically a string) to a boolean.\n * Intended to be used as a transform function of an input.\n *\n * @example\n * ```@Input({ transform: auBooleanAttribute }) status: boolean | undefined;```\n * @param value - Value to be transformed.\n * @returns the value transformed\n */\nexport function auBooleanAttribute(value: unknown): boolean | undefined {\n\tif (value === undefined) {\n\t\treturn undefined;\n\t}\n\treturn booleanAttribute(value);\n}\n\n/**\n * Transforms a value (typically a string) to a number.\n * Intended to be used as a transform function of an input.\n * @param value - Value to be transformed.\n *\n * @example\n * ```@Input({ transform: auNumberAttribute }) id: number | undefined;```\n * @returns the value transformed\n */\nexport function auNumberAttribute(value: unknown): number | undefined {\n\tif (value === undefined) {\n\t\treturn undefined;\n\t}\n\treturn numberAttribute(value);\n}\n","import type {ComponentRef, EmbeddedViewRef, OnChanges, OnDestroy, SimpleChanges, Type} from '@angular/core';\nimport {\n\tComponent,\n\tDirective,\n\tEnvironmentInjector,\n\tInput,\n\tTemplateRef,\n\tViewChild,\n\tViewContainerRef,\n\tcreateComponent,\n\tinject,\n\treflectComponentType,\n\tChangeDetectionStrategy,\n} from '@angular/core';\nimport type {SlotContent} from './types';\nimport {ComponentTemplate} from './types';\n\nabstract class SlotHandler<Props extends Record<string, any>, Slot extends SlotContent<Props> = SlotContent<Props>> {\n\tconstructor(public viewContainerRef: ViewContainerRef) {}\n\tslotChange(_slot: Slot, _props: Props) {}\n\tpropsChange(_slot: Slot, _props: Props) {}\n\tdestroy() {}\n}\n\n@Component({\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\ttemplate: `<ng-template #text let-content=\"content\">{{ content }}</ng-template>`,\n})\nclass StringSlotComponent {\n\t@ViewChild('text', {static: true}) text!: TemplateRef<{content: string}>;\n}\nconst stringSlotComponentTemplate = new ComponentTemplate<{content: string}, 'text', StringSlotComponent>(StringSlotComponent, 'text');\n\nclass StringSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, string> {\n\treadonly #templateRefSlotHandler = new ComponentTemplateSlotHandler<{content: string}, 'text', StringSlotComponent>(this.viewContainerRef);\n\t#initialized = false;\n\n\toverride slotChange(content: string): void {\n\t\tif (!this.#initialized) {\n\t\t\tthis.#initialized = true;\n\t\t\tthis.#templateRefSlotHandler.slotChange(stringSlotComponentTemplate, {content});\n\t\t} else {\n\t\t\tthis.#templateRefSlotHandler.propsChange(stringSlotComponentTemplate, {content});\n\t\t}\n\t}\n\n\toverride destroy(): void {\n\t\tthis.#templateRefSlotHandler.destroy();\n\t}\n}\n\nclass FunctionSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, (props: Props) => string> {\n\treadonly #stringSlotHandler = new StringSlotHandler(this.viewContainerRef);\n\n\toverride slotChange(slot: (props: Props) => string, props: Props): void {\n\t\tthis.#stringSlotHandler.slotChange(slot(props));\n\t}\n\n\toverride propsChange(slot: (props: Props) => string, props: Props): void {\n\t\tthis.#stringSlotHandler.slotChange(slot(props));\n\t}\n\n\toverride destroy(): void {\n\t\tthis.#stringSlotHandler.destroy();\n\t}\n}\n\nclass ComponentSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, Type<unknown>> {\n\t#componentRef: ComponentRef<any> | undefined;\n\t#properties?: string[];\n\n\toverride slotChange(slot: Type<unknown>, props: Props): void {\n\t\tif (this.#componentRef) {\n\t\t\tthis.destroy();\n\t\t}\n\t\tthis.#componentRef = this.viewContainerRef.createComponent(slot);\n\t\tthis.#applyProperties(props);\n\t}\n\n\t#applyProperties(props: Props, oldProperties?: Set<string>) {\n\t\tconst properties = Object.keys(props);\n\t\tthis.#properties = properties;\n\t\tconst componentRef = this.#componentRef!;\n\t\tfor (const property of properties) {\n\t\t\tcomponentRef.setInput(property, props[property]);\n\t\t\toldProperties?.delete(property);\n\t\t}\n\t}\n\n\toverride propsChange(_slot: Type<unknown>, props: Props): void {\n\t\tconst oldProperties = new Set(this.#properties);\n\t\tthis.#applyProperties(props, oldProperties);\n\t\tconst componentRef = this.#componentRef!;\n\t\tfor (const property of oldProperties) {\n\t\t\tcomponentRef.setInput(property, undefined);\n\t\t}\n\t}\n\n\toverride destroy(): void {\n\t\tthis.viewContainerRef.clear();\n\t\tthis.#componentRef = undefined;\n\t}\n}\n\nclass TemplateRefSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, TemplateRef<Props>> {\n\t#viewRef: EmbeddedViewRef<Props> | undefined;\n\t#props?: Props;\n\n\toverride slotChange(slot: TemplateRef<Props>, props: Props): void {\n\t\tif (this.#viewRef) {\n\t\t\tthis.destroy();\n\t\t}\n\t\tprops = {...props};\n\t\tthis.#props = props;\n\t\tthis.#viewRef = this.viewContainerRef.createEmbeddedView(slot, props);\n\t}\n\n\toverride propsChange(_slot: TemplateRef<Props>, props: Props): void {\n\t\tif (this.#viewRef) {\n\t\t\tconst templateProps = this.#props!;\n\t\t\tconst oldProperties = new Set<keyof Props>(Object.keys(templateProps));\n\t\t\tfor (const property of Object.keys(props) as (keyof Props)[]) {\n\t\t\t\ttemplateProps[property] = props[property];\n\t\t\t\toldProperties.delete(property);\n\t\t\t}\n\t\t\tfor (const oldProperty of oldProperties) {\n\t\t\t\tdelete templateProps[oldProperty];\n\t\t\t}\n\t\t\tthis.#viewRef.markForCheck();\n\t\t}\n\t}\n\n\toverride destroy(): void {\n\t\tthis.viewContainerRef.clear();\n\t}\n}\n\nclass ComponentTemplateSlotHandler<\n\tProps extends Record<string, any>,\n\tK extends string,\n\tT extends {[key in K]: TemplateRef<Props>},\n> extends SlotHandler<Props, ComponentTemplate<Props, K, T>> {\n\t#componentRef: ComponentRef<T> | undefined;\n\treadonly #templateSlotHandler = new TemplateRefSlotHandler(this.viewContainerRef);\n\t#templateRef: TemplateRef<Props> | undefined;\n\n\toverride slotChange(slot: ComponentTemplate<Props, K, T>, props: Props): void {\n\t\tif (this.#componentRef) {\n\t\t\tthis.destroy();\n\t\t}\n\t\tthis.#componentRef = createComponent(slot.component, {\n\t\t\telementInjector: this.viewContainerRef.injector,\n\t\t\tenvironmentInjector: this.viewContainerRef.injector.get(EnvironmentInjector),\n\t\t});\n\t\tthis.#templateRef = this.#componentRef.instance[slot.templateProp];\n\t\tthis.#templateSlotHandler.slotChange(this.#templateRef, props);\n\t}\n\n\toverride propsChange(_slot: ComponentTemplate<Props, K, T>, props: Props): void {\n\t\tthis.#templateSlotHandler.propsChange(this.#templateRef!, props);\n\t}\n\n\toverride destroy(): void {\n\t\tthis.#templateSlotHandler.destroy();\n\t\tthis.#componentRef?.destroy();\n\t\tthis.#componentRef = undefined;\n\t}\n}\n\nconst getSlotType = (value: any): undefined | {new (viewContainerRef: ViewContainerRef): SlotHandler<any>} => {\n\tif (!value) return undefined;\n\tconst type = typeof value;\n\tswitch (type) {\n\t\tcase 'string':\n\t\t\treturn StringSlotHandler;\n\t\tcase 'function':\n\t\t\tif (reflectComponentType(value)) {\n\t\t\t\treturn ComponentSlotHandler;\n\t\t\t}\n\t\t\treturn FunctionSlotHandler;\n\t\tcase 'object':\n\t\t\tif (value instanceof TemplateRef) {\n\t\t\t\treturn TemplateRefSlotHandler;\n\t\t\t}\n\t\t\tif (value instanceof ComponentTemplate) {\n\t\t\t\treturn ComponentTemplateSlotHandler;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn undefined;\n};\n\n/**\n * A directive that manages slot content and its properties.\n *\n * @template Props - A record type representing the properties for the slot.\n *\n * @remarks\n * This directive handles changes to the slot content and its properties,\n * and manages the lifecycle of the slot handler.\n */\n@Directive({\n\tselector: '[auSlot]',\n\tstandalone: true,\n})\nexport class SlotDirective<Props extends Record<string, any>> implements OnChanges, OnDestroy {\n\t/**\n\t * The slot content to be managed.\n\t */\n\t@Input('auSlot') slot: SlotContent<Props>;\n\t/**\n\t * The properties for the slot content.\n\t */\n\t@Input({alias: 'auSlotProps', required: true}) props!: Props;\n\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate _slotType: ReturnType<typeof getSlotType>;\n\tprivate _slotHandler: SlotHandler<Props> | undefined;\n\n\t/**\n\t * @param changes SimpleChanges from Angular\n\t * @internal\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tconst slotChange = changes['slot'];\n\t\tconst propsChange = changes['props'];\n\t\tconst slot = this.slot;\n\t\tif (slotChange) {\n\t\t\tconst newSlotType = getSlotType(slot);\n\t\t\tif (newSlotType !== this._slotType) {\n\t\t\t\tthis._slotHandler?.destroy();\n\t\t\t\tthis._slotHandler = newSlotType ? new newSlotType(this._viewContainerRef) : undefined;\n\t\t\t\tthis._slotType = newSlotType;\n\t\t\t}\n\t\t\tthis._slotHandler?.slotChange(slot, this.props);\n\t\t} else if (propsChange) {\n\t\t\tthis._slotHandler?.propsChange(slot, this.props);\n\t\t}\n\t}\n\n\t/** @internal */\n\tngOnDestroy(): void {\n\t\tthis._slotHandler?.destroy();\n\t\tthis._slotHandler = undefined;\n\t}\n}\n","/*\n * Public API Surface of @agnos-ui/angular-headless\n */\nexport * from './generated';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,IAAI,GAAG,MAAK,GAAG,CAAC;AACtB,MAAM,QAAQ,GAAG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ACV,QAAA,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC;AAC7B,QAAA,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;KAC9B;8GAvCW,aAAa,GAAA,CAAA,EAAA,CAAA,EAAA;oEAAb,aAAa,EAAA,SAAA,EAAA,CAAA,CAAA,EAAA,EAAA,QAAA,EAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAA,KAAA,EAAA,CAAA,CAAA,EAAA,aAAA,EAAA,OAAA,CAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,CAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;iFAAb,aAAa,EAAA,CAAA;cAJzB,SAAS;AAAC,QAAA,IAAA,EAAA,CAAA;AACV,gBAAA,QAAQ,EAAE,UAAU;AACpB,gBAAA,UAAU,EAAE,IAAI;AAChB,aAAA,CAAA;gBAKiB,IAAI,EAAA,CAAA;kBAApB,KAAK;mBAAC,QAAQ,CAAA;YAIgC,KAAK,EAAA,CAAA;kBAAnD,KAAK;AAAC,YAAA,IAAA,EAAA,CAAA,EAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAA;;;ACrN9C;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"agnos-ui-angular-headless.mjs","sources":["../../src/utils/zone.ts","../../src/utils/stores.ts","../../src/utils/directive.ts","../../src/types.ts","../../src/utils/widget.ts","../../src/config.ts","../../src/utils/coercion.ts","../../src/slot.directive.ts","../../src/index.ts","../../src/agnos-ui-angular-headless.ts"],"sourcesContent":["import {Injectable, NgZone, inject} from '@angular/core';\n\nconst noop = () => {};\nconst identity = <T>(a: T) => a;\n\ntype Wrapper = <T>(fn: T) => T;\n\nconst createObjectWrapper =\n\t(wrap: Wrapper): Wrapper =>\n\t(object) => {\n\t\tif (!object || typeof object !== 'object') {\n\t\t\treturn object;\n\t\t}\n\t\tconst res = {} as any;\n\t\tfor (const key of Object.keys(object)) {\n\t\t\tres[key] = wrap((object as any)[key]);\n\t\t}\n\t\treturn res;\n\t};\n\nconst createReturnValueWrapper =\n\t(wrapReturnValue: Wrapper, wrapResult: Wrapper): Wrapper =>\n\t(fn) =>\n\t\twrapResult(typeof fn === 'function' ? (((...args: any[]) => wrapReturnValue(fn(...args))) as any) : fn);\n\n/**\n * A utility class that provides methods to run functions inside or outside of Angular's NgZone.\n * This can be useful for optimizing performance by avoiding unnecessary change detection cycles.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class ZoneWrapper {\n\treadonly #zone = inject(NgZone);\n\treadonly #hasZone = this.#zone.run(() => NgZone.isInAngularZone()); // check if zone is enabled (can be NoopZone, cf https://angular.io/guide/zone#noopzone)\n\t#runNeeded = false;\n\t#runPlanned = false;\n\n\tplanNgZoneRun = this.#hasZone\n\t\t? () => {\n\t\t\t\tif (this.#zone.isStable) {\n\t\t\t\t\tthis.#runNeeded = true;\n\t\t\t\t\tif (!this.#runPlanned) {\n\t\t\t\t\t\tthis.#runPlanned = true;\n\t\t\t\t\t\tvoid (async () => {\n\t\t\t\t\t\t\tawait Promise.resolve();\n\t\t\t\t\t\t\tthis.#runPlanned = false;\n\t\t\t\t\t\t\tif (this.#runNeeded) {\n\t\t\t\t\t\t\t\tthis.ngZoneRun(noop);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t: noop;\n\n\t/**\n\t * Run the input function synchronously within the Angular zone\n\t *\n\t * @param fn - a function to run\n\t * @returns the value returned by the function\n\t */\n\tngZoneRun<T>(fn: () => T): T {\n\t\tthis.#runNeeded = false;\n\t\treturn this.#zone.run(fn);\n\t}\n\n\tinsideNgZone: Wrapper = this.#hasZone\n\t\t? (fn) => (typeof fn === 'function' ? (((...args: any[]) => this.ngZoneRun(() => fn(...args))) as any) : fn)\n\t\t: identity;\n\tinsideNgZoneWrapFunctionsObject = createObjectWrapper(this.insideNgZone);\n\n\toutsideNgZone: Wrapper = this.#hasZone\n\t\t? (fn) => (typeof fn === 'function' ? (((...args: any[]) => this.#zone.runOutsideAngular(() => fn(...args))) as any) : fn)\n\t\t: identity;\n\n\toutsideNgZoneWrapFunctionsObject = createObjectWrapper(this.outsideNgZone);\n\toutsideNgZoneWrapDirective = createReturnValueWrapper(this.outsideNgZoneWrapFunctionsObject, this.outsideNgZone);\n\toutsideNgZoneWrapDirectivesObject = createObjectWrapper(this.outsideNgZoneWrapDirective);\n}\n","import type {ReadableSignal} from '@amadeus-it-group/tansu';\nimport type {Signal} from '@angular/core';\nimport {DestroyRef, inject, signal} from '@angular/core';\nimport {ZoneWrapper} from './zone';\n\nexport * from '@agnos-ui/core/utils/stores';\n\n/**\n * Converts a Tansu `ReadableSignal` to an Angular `Signal`.\n *\n * This function wraps the provided Tansu signal in an Angular signal, ensuring that updates\n * are properly handled within Angular's zone. It subscribes to the Tansu signal and updates\n * the Angular signal with the received values. The equality function for the Angular signal\n * is set to always return false, ensuring that every new value from the Tansu signal triggers\n * an update.\n *\n * @template T - The type of the value emitted by the signals.\n * @param tansuSignal - The Tansu signal to convert.\n * @returns - The resulting Angular signal.\n */\nexport const toAngularSignal = <T>(tansuSignal: ReadableSignal<T>): Signal<T> => {\n\tconst zoneWrapper = inject(ZoneWrapper);\n\t// The equality of objects from 2 sequential emissions is already checked in tansu signal.\n\t// Here we'll always emit the value received from tansu signal, therefor the equality function\n\tconst res = signal(undefined as any as T, {equal: () => false});\n\tconst subscription = zoneWrapper.outsideNgZone(tansuSignal.subscribe)((value) => {\n\t\tres.set(value);\n\t\tzoneWrapper.planNgZoneRun();\n\t});\n\tinject(DestroyRef).onDestroy(zoneWrapper.outsideNgZone(subscription));\n\treturn res;\n};\n","import type {Directive as AgnosUIDirective, DirectiveAndParam, DirectivesAndOptParam} from '@agnos-ui/core/types';\nimport {multiDirective} from '@agnos-ui/core/utils/directive';\nimport {isPlatformServer} from '@angular/common';\nimport type {OnChanges} from '@angular/core';\nimport {DestroyRef, Directive, ElementRef, Injector, PLATFORM_ID, afterNextRender, inject, runInInjectionContext, input} from '@angular/core';\n\nexport * from '@agnos-ui/core/utils/directive';\n\n/**\n * A utility function to manage the lifecycle of a directive for a host element.\n *\n * This function handles the creation, updating, and destruction of a directive instance\n * associated with a host element. It ensures that the directive is called appropriately\n * based on the platform (server or client) and manages the directive's lifecycle within\n * the Angular injection context.\n *\n * @template T - The type of parameters that the directive accepts.\n *\n * @param [directive] - The directive to be applied to the host element.\n * @param [params] - The parameters to be passed to the directive.\n *\n * @returns An object containing an `update` function to update the directive and its parameters.\n */\nexport const useDirectiveForHost = <T>(directive?: AgnosUIDirective<T>, params?: T) => {\n\tconst injector = inject(Injector);\n\tconst ref = inject(ElementRef);\n\tconst platform = inject(PLATFORM_ID);\n\n\tlet instance: undefined | ReturnType<AgnosUIDirective<T>>;\n\tlet plannedCallDirective = false;\n\n\tconst callDirective = isPlatformServer(platform)\n\t\t? () => {\n\t\t\t\tinstance = directive?.(ref.nativeElement, params as T);\n\t\t\t}\n\t\t: () => {\n\t\t\t\tif (plannedCallDirective || !directive) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tplannedCallDirective = true;\n\t\t\t\trunInInjectionContext(injector, () => {\n\t\t\t\t\tafterNextRender(() => {\n\t\t\t\t\t\tplannedCallDirective = false;\n\t\t\t\t\t\tinstance = directive?.(ref.nativeElement, params as T);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\tfunction destroyDirectiveInstance() {\n\t\tconst oldInstance = instance;\n\t\tinstance = undefined;\n\t\tdirective = undefined;\n\t\toldInstance?.destroy?.();\n\t}\n\n\tinject(DestroyRef).onDestroy(destroyDirectiveInstance);\n\n\tfunction update(newDirective?: AgnosUIDirective<T>, newParams?: T) {\n\t\tif (newDirective !== directive) {\n\t\t\tvoid destroyDirectiveInstance();\n\t\t\tdirective = newDirective;\n\t\t\tparams = newParams;\n\t\t\tcallDirective();\n\t\t} else if (newParams != params) {\n\t\t\tparams = newParams;\n\t\t\tinstance?.update?.(params as T);\n\t\t}\n\t}\n\n\tcallDirective();\n\treturn {update};\n};\n\n/**\n * A directive that allows the use of another directive with optional parameters.\n *\n * @template T - The type of the parameter that can be passed to the directive.\n *\n * @remarks\n * This directive uses a private instance of {@link useDirectiveForHost} to manage the directive and its parameter.\n */\n@Directive({\n\tstandalone: true,\n\tselector: '[auUse]',\n})\nexport class UseDirective<T> implements OnChanges {\n\treadonly use = input.required<AgnosUIDirective | DirectiveAndParam<T>>({alias: 'auUse'});\n\treadonly #useDirective = useDirectiveForHost<T>();\n\n\t/** @internal */\n\tngOnChanges() {\n\t\tconst use = this.use();\n\t\tconst [directive, param] = Array.isArray(use) ? use : [use as any];\n\t\tthis.#useDirective.update(directive, param);\n\t}\n}\n\n/**\n * A directive that allows the use of multiple directives on a host element.\n *\n * @template T - A tuple type representing the directives and their optional parameters.\n */\n@Directive({\n\tstandalone: true,\n\tselector: '[auUseMulti]',\n})\nexport class UseMultiDirective<T extends any[]> implements OnChanges {\n\t/**\n\t * An input property that takes a tuple of directives and their optional parameters.\n\t */\n\treadonly useMulti = input.required<DirectivesAndOptParam<T>>({alias: 'auUseMulti'});\n\n\treadonly #useDirective = useDirectiveForHost<DirectivesAndOptParam<T>>();\n\n\t/** @internal */\n\tngOnChanges() {\n\t\tthis.#useDirective.update(multiDirective, this.useMulti());\n\t}\n}\n","import type {SlotContent as CoreSlotContent, Widget, WidgetState, Extends} from '@agnos-ui/core/types';\nimport type {Signal, TemplateRef, Type} from '@angular/core';\nimport {computed, Directive, input} from '@angular/core';\n\nexport * from '@agnos-ui/core/types';\n\n/**\n * Represents a template for a component with specified properties.\n *\n * @template Props - The type of properties that the template accepts.\n * @template K - The key in the template object that maps to the template reference.\n * @template T - An object type where each key of type K maps to a TemplateRef of Props.\n *\n * @param component - The component type that contains the template.\n * @param templateProp - The key in the component that maps to the template reference.\n */\nexport class ComponentTemplate<Props, K extends string, T extends {[key in K]: Signal<TemplateRef<Props>>}> {\n\tconstructor(\n\t\tpublic readonly component: Type<T>,\n\t\tpublic readonly templateProp: K,\n\t) {}\n}\n\n/**\n * Represents the content that can be used in a slot.\n *\n * @template Props - The type of the properties that the slot content can accept.\n *\n * This type can be one of the following:\n * - `undefined | null`: Nullish value\n * - `string`: A static string\n * - `(props: Props) => string`: A function that takes props as input and returns a string template\n * - `TemplateRef<Props>`: A reference to an Angular template with the specified properties.\n * - `Type<unknown>`: A type representing an unknown component or directive.\n * - `ComponentTemplate<Props, any, any>`: A component template with the specified properties.\n */\nexport type SlotContent<Props extends object = object> =\n\t| CoreSlotContent<Props>\n\t| TemplateRef<Props>\n\t| Type<unknown>\n\t| ComponentTemplate<Props, any, any>;\n\n/**\n * A directive representing a slot component that can be used to manage the state and context of a widget.\n *\n * @template W - The type of the widget that this slot component manages.\n */\n@Directive()\nexport abstract class SlotComponent<W extends Widget> {\n\t/**\n\t * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t */\n\treadonly state = input.required<AngularState<W>>();\n\t/**\n\t * all the api functions to interact with the widget\n\t */\n\treadonly api = input.required<W['api']>();\n\t/**\n\t * directives to be used on html elements in the template of the slot\n\t */\n\treadonly directives = input.required<W['directives']>();\n\t/**\n\t * The slot context, to be used when the slot component uses other slots.\n\t */\n\treadonly slotContext = computed(() => ({state: this.state(), api: this.api(), directives: this.directives()}));\n}\n\n/**\n * Type utility to determine if a given type `T` is or extends `SlotContent<any>`.\n *\n * This type alias uses conditional types to check if `T` extends `SlotContent<any>` or if `SlotContent<any>` extends `T`.\n * If either condition is true, it resolves to `T`, otherwise it resolves to `0`.\n *\n * @template T - The type to be checked.\n */\nexport type IsSlotContent<T> = Extends<T, SlotContent<any>> | Extends<SlotContent<any>, T> extends 1 ? T : 0;\n\n/**\n * Represents the state of an Angular widget, where each key in the widget's state\n * is mapped to a Signal of the corresponding state value.\n *\n * @template W - The type of the widget.\n */\nexport type AngularState<W extends Widget> = {[key in keyof WidgetState<W>]: Signal<WidgetState<W>[key]>};\n\n/**\n * Represents an Angular widget that extends a base widget type.\n *\n * @template W - The type of the base widget.\n */\nexport interface AngularWidget<W extends Widget> extends Pick<W, 'api' | 'directives' | 'patch'> {\n\t/**\n\t * A promise that resolves when the widget is initialized\n\t */\n\tinitialized: Promise<void>;\n\t/**\n\t * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t */\n\tstate: AngularState<W>;\n\t/**\n\t * A function to initialize the Angular widget.\n\t */\n\tngInit: () => void;\n\t/**\n\t * A utility function to update the slot properties.\n\t */\n\tupdateSlots: () => void;\n}\n\n/**\n * Represents the context for a widget slot, providing access to the widget and its state.\n *\n * @template W - The type of the widget.\n */\nexport interface WidgetSlotContext<W extends Widget> extends Pick<W, 'api' | 'directives'> {\n\t/**\n\t * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t */\n\tstate: AngularState<W>;\n}\n","import {computed, type ReadableSignal, writable} from '@amadeus-it-group/tansu';\nimport type {AfterContentChecked, OnChanges, OnInit, SimpleChanges, TemplateRef} from '@angular/core';\nimport {Directive, Injector, inject, runInInjectionContext} from '@angular/core';\nimport type {AngularState, AngularWidget, IsSlotContent, SlotContent, Widget, WidgetFactory, WidgetProps} from '../types';\nimport {toAngularSignal, toReadableStore} from './stores';\nimport {ZoneWrapper} from './zone';\n\nconst createPatchSlots = <T extends object>(set: (object: Partial<T>) => void) => {\n\tlet lastValue: Partial<T> = {};\n\treturn (object: T) => {\n\t\tconst newValue: Partial<T> = {};\n\t\tlet hasChange = false;\n\t\tfor (const key of Object.keys(object) as (string & keyof T)[]) {\n\t\t\tconst objectKey = (object as any)[key];\n\t\t\tif (objectKey != null) {\n\t\t\t\t// only use defined slots\n\t\t\t\tnewValue[key] = objectKey;\n\t\t\t}\n\t\t\tif (objectKey != lastValue[key]) {\n\t\t\t\thasChange = true;\n\t\t\t}\n\t\t}\n\t\tif (hasChange) {\n\t\t\tlastValue = newValue;\n\t\t\tset(newValue);\n\t\t}\n\t};\n};\n\n/**\n * Call a widget factory using provided configs.\n *\n * @param parameter - the parameter\n * @param parameter.factory - the widget factory to call\n * @param parameter.defaultConfig - the default config of the widget\n * @param parameter.widgetConfig - the config of the widget, overriding the defaultConfig\n * @param parameter.events - the events of the widget\n * @param parameter.afterInit - a callback to call after successful setup of the widget\n * @param parameter.slotTemplates - a function to provide all slot templates using child queries\n * @param parameter.slotChildren - a function to provide the default children slot using a view query\n * @returns the widget\n */\nexport const callWidgetFactoryWithConfig = <W extends Widget>({\n\tfactory,\n\tdefaultConfig,\n\twidgetConfig,\n\tevents,\n\tafterInit,\n\tslotTemplates,\n\tslotChildren,\n}: {\n\tfactory: WidgetFactory<W>;\n\tdefaultConfig?: Partial<WidgetProps<W>> | ReadableSignal<Partial<WidgetProps<W>> | undefined>;\n\twidgetConfig?: null | undefined | ReadableSignal<Partial<WidgetProps<W>> | undefined>;\n\tevents?: Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}`>>;\n\tafterInit?: (widget: AngularWidget<W>) => void;\n\tslotTemplates?: () => {\n\t\t[K in keyof WidgetProps<W> as IsSlotContent<WidgetProps<W>[K]> extends 0 ? never : K]: WidgetProps<W>[K] extends SlotContent<infer U>\n\t\t\t? TemplateRef<U> | undefined\n\t\t\t: never;\n\t};\n\tslotChildren?: () => TemplateRef<void> | undefined;\n}): AngularWidget<W> => {\n\tconst injector = inject(Injector);\n\tconst slots$ = writable({});\n\tconst props = {};\n\tlet initDone: () => void;\n\tconst patchSlots = createPatchSlots(slots$.set);\n\n\tconst res = {\n\t\tinitialized: new Promise<void>((resolve) => {\n\t\t\tinitDone = resolve;\n\t\t}),\n\t\tupdateSlots: () => {\n\t\t\tif (slotTemplates) {\n\t\t\t\tpatchSlots(slotTemplates());\n\t\t\t}\n\t\t},\n\t\tpatch(newProps: Partial<WidgetProps<W>>) {\n\t\t\t// temporary function replaced in ngInit\n\t\t\tObject.assign(props, newProps);\n\t\t},\n\t\tngInit() {\n\t\t\trunInInjectionContext(injector, () => {\n\t\t\t\tconst zoneWrapper = inject(ZoneWrapper);\n\t\t\t\tfactory = zoneWrapper.outsideNgZone(factory);\n\t\t\t\tconst defaultConfig$ = toReadableStore(defaultConfig);\n\t\t\t\tevents = zoneWrapper.insideNgZoneWrapFunctionsObject(events);\n\t\t\t\tconst widget = factory({\n\t\t\t\t\tconfig: computed(() => ({\n\t\t\t\t\t\t...defaultConfig$(),\n\t\t\t\t\t\tchildren: slotChildren?.(),\n\t\t\t\t\t\t...widgetConfig?.(),\n\t\t\t\t\t\t...slots$(),\n\t\t\t\t\t\t...(events as Partial<WidgetProps<W>>),\n\t\t\t\t\t})),\n\t\t\t\t\tprops,\n\t\t\t\t});\n\t\t\t\tObject.assign(res, {\n\t\t\t\t\tpatch: zoneWrapper.outsideNgZone(widget.patch),\n\t\t\t\t\tdirectives: zoneWrapper.outsideNgZoneWrapDirectivesObject(widget.directives),\n\t\t\t\t\tapi: zoneWrapper.outsideNgZoneWrapFunctionsObject(widget.api),\n\t\t\t\t\tstate: Object.fromEntries(\n\t\t\t\t\t\tObject.entries<ReadableSignal<unknown>>(widget.stores as any).map(([key, val]) => [key.slice(0, -1), toAngularSignal(val)]),\n\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t\tafterInit?.(res as AngularWidget<W>);\n\t\t\t\tinitDone();\n\t\t\t});\n\t\t},\n\t};\n\n\treturn res as AngularWidget<W>;\n};\n\nfunction patchSimpleChanges(patchFn: (obj: any) => void, changes: SimpleChanges) {\n\tconst obj: any = {};\n\tfor (const [key, simpleChange] of Object.entries(changes)) {\n\t\tif (simpleChange !== undefined) {\n\t\t\tobj[key] = simpleChange.currentValue;\n\t\t}\n\t}\n\tpatchFn(obj);\n}\n\n/**\n * An abstract base class for widget directives, providing common functionality\n * for Angular components that interact with widgets.\n *\n * @template W - The type of the widget.\n */\n@Directive()\nexport abstract class BaseWidgetDirective<W extends Widget> implements OnChanges, OnInit, AfterContentChecked {\n\tconstructor(private readonly _widget: AngularWidget<W>) {}\n\n\t/**\n\t * Retrieves the widget api\n\t * @returns the widget api\n\t */\n\tget api(): W['api'] {\n\t\treturn this._widget.api;\n\t}\n\n\t/**\n\t * Retrieves the widget state. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}\n\t * @returns the widget state\n\t */\n\tget state(): AngularState<W> {\n\t\treturn this._widget.state;\n\t}\n\n\t/**\n\t * Retrieves the widget directives\n\t * @returns the widget directives\n\t */\n\tget directives(): W['directives'] {\n\t\treturn this._widget.directives;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t * @internal\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tpatchSimpleChanges(this._widget.patch, changes);\n\t}\n\n\t/** @internal */\n\tngOnInit(): void {\n\t\tthis._widget.ngInit();\n\t}\n\n\t/** @internal */\n\tngAfterContentChecked(): void {\n\t\tthis._widget.updateSlots();\n\t}\n}\n","import type {Widget, WidgetFactory, WidgetProps} from '@agnos-ui/core/types';\nimport type {Partial2Levels, WidgetsConfigStore, WidgetsConfig} from '@agnos-ui/core/config';\nimport {createWidgetsConfig} from '@agnos-ui/core/config';\nimport type {ReadableSignal} from '@amadeus-it-group/tansu';\nimport {computed} from '@amadeus-it-group/tansu';\nimport type {FactoryProvider, TemplateRef} from '@angular/core';\nimport {InjectionToken, Injector, Optional, SkipSelf, inject, runInInjectionContext} from '@angular/core';\nimport type {AngularWidget, IsSlotContent, SlotContent} from './types';\nimport {callWidgetFactoryWithConfig} from './utils/widget';\n\nexport * from '@agnos-ui/core/config';\n\ntype AdaptParentConfig<Config> = (config: Partial2Levels<Config>) => Partial2Levels<Config>;\ntype InjectWidgetsConfig<Config> = (config?: Partial2Levels<Config>) => WidgetsConfigStore<Config>;\n\n/**\n * A factory to create the utilities to allow widgets to be context-aware.\n *\n * It can be used when extending the core and creating new widgets.\n *\n * @template Config - The type of the widgets configuration object.\n * @param widgetsConfigInjectionToken - the widgets config injection token\n * @returns the utilities to create / manage widgets and contexts\n */\nexport const widgetsConfigFactory = <Config extends {[widgetName: string]: object} = WidgetsConfig>(\n\twidgetsConfigInjectionToken = new InjectionToken<WidgetsConfigStore<Config>>('widgetsConfig'),\n) => {\n\t/**\n\t * Creates a provider of widgets default configuration that inherits from any widgets default configuration already defined at an upper level\n\t * in the Angular dependency injection system. It contains its own set of widgets configuration properties that override the same properties form\n\t * the parent configuration.\n\t *\n\t * @remarks\n\t * The configuration is computed from the parent configuration in two steps:\n\t * - first step: the parent configuration is transformed by the adaptParentConfig function (if specified).\n\t * If adaptParentConfig is not specified, this step is skipped.\n\t * - second step: the configuration from step 1 is merged (2-levels deep) with the own$ store. The own$ store initially contains\n\t * an empty object (i.e. no property from the parent is overridden). It can be changed by calling set on the store returned by\n\t * {@link injectWidgetsConfig}.\n\t *\n\t * @param adaptParentConfig - optional function that receives a 2-levels copy of the widgets default configuration\n\t * defined at an upper level in the Angular dependency injection system (or an empty object if there is none) and returns the widgets\n\t * default configuration to be used.\n\t * It is called only if the configuration is needed, and was not yet computed for the current value of the parent configuration.\n\t * It is called in a tansu reactive context, so it can use any tansu store and will be called again if those stores change.\n\t * It is also called in an Angular injection context, so it can call the Angular inject function to get and use dependencies from the\n\t * Angular dependency injection system.\n\t *\n\t * @returns DI provider to be included a list of `providers` (for example at a component level or\n\t * any other level of the Angular dependency injection system)\n\t *\n\t * @example\n\t * ```typescript\n\t * @Component({\n\t * // ...\n\t * providers: [\n\t * provideWidgetsConfig((parentConfig) => {\n\t * // first step configuration: transforms the parent configuration\n\t * parentConfig.rating = parentConfig.rating ?? {};\n\t * parentConfig.rating.className = `${parentConfig.rating.className ?? ''} my-rating-extra-class`\n\t * return parentConfig;\n\t * })\n\t * ]\n\t * })\n\t * class MyComponent {\n\t * widgetsConfig = injectWidgetsConfig();\n\t * constructor() {\n\t * this.widgetsConfig.set({\n\t * // second step configuration: overrides the parent configuration\n\t * rating: {\n\t * slotStar: MyCustomSlotStar\n\t * }\n\t * });\n\t * }\n\t * // ...\n\t * }\n\t * ```\n\t */\n\tconst provideWidgetsConfig = (adaptParentConfig?: AdaptParentConfig<Config>): FactoryProvider => ({\n\t\tprovide: widgetsConfigInjectionToken,\n\t\tuseFactory: (parent: WidgetsConfigStore<Config> | null) => {\n\t\t\tif (adaptParentConfig) {\n\t\t\t\tconst injector = inject(Injector);\n\t\t\t\tconst originalAdaptParentConfig = adaptParentConfig;\n\t\t\t\tadaptParentConfig = (value) => runInInjectionContext(injector, () => originalAdaptParentConfig(value));\n\t\t\t}\n\t\t\treturn createWidgetsConfig(parent ?? undefined, adaptParentConfig);\n\t\t},\n\t\tdeps: [[new SkipSelf(), new Optional(), widgetsConfigInjectionToken]],\n\t});\n\n\t/**\n\t * Returns the widgets default configuration store that was provided in the current injection context.\n\t * Throws if the no widgets default configuration store was provided.\n\t *\n\t * @param defaultConfig - values to set as soon as the config is injected\n\t * @remarks\n\t * This function must be called from an injection context, such as a constructor, a factory function, a field initializer or\n\t * a function used with {@link https://angular.io/api/core/runInInjectionContext | runInInjectionContext}.\n\t *\n\t * @returns the widgets default configuration store.\n\t */\n\tconst injectWidgetsConfig: InjectWidgetsConfig<Config> = (defaultConfig?: Partial2Levels<Config>) => {\n\t\tconst widgetsConfig = inject(widgetsConfigInjectionToken);\n\t\tif (defaultConfig) {\n\t\t\twidgetsConfig.set(defaultConfig);\n\t\t}\n\t\treturn widgetsConfig;\n\t};\n\n\t/**\n\t * Injects the configuration for a specific widget.\n\t *\n\t * @template N - The key of the widget configuration in the `Config` type.\n\t * @param widgetName - The name of the widget whose configuration is to be injected.\n\t * @returns A `ReadableSignal` that provides a partial configuration of the specified widget or `undefined` if the configuration is not available.\n\t */\n\tconst injectWidgetConfig = <N extends keyof Config>(widgetName: N): ReadableSignal<Partial<Config[N]> | undefined> => {\n\t\tconst widgetsConfig = inject(widgetsConfigInjectionToken, {optional: true});\n\t\treturn computed(() => widgetsConfig?.()[widgetName]);\n\t};\n\n\t/**\n\t * Creates and initializes a widget using the provided factory and configuration options.\n\t *\n\t * @template W - The type of the widget.\n\t * @param params - The parameters for creating the widget.\n\t * @param params.factory - The factory function to create the widget.\n\t * @param params.widgetName - The name of the widget configuration to inject, if any.\n\t * @param params.defaultConfig - The default configuration for the widget.\n\t * @param params.events - The event handlers for the widget.\n\t * @param params.slotTemplates - A function that returns the slot templates for the widget.\n\t * @param params.slotChildren - A function that returns the slot children for the widget.\n\t * @param params.afterInit - A callback function to be called after the widget is initialized.\n\t * @returns The initialized widget.\n\t */\n\tconst callWidgetFactory = <W extends Widget>({\n\t\tfactory,\n\t\twidgetName = null,\n\t\tdefaultConfig = {},\n\t\tevents,\n\t\tafterInit,\n\t\tslotTemplates,\n\t\tslotChildren,\n\t}: {\n\t\tfactory: WidgetFactory<W>;\n\t\twidgetName?: null | keyof Config;\n\t\tdefaultConfig?: Partial<WidgetProps<W>> | ReadableSignal<Partial<WidgetProps<W>> | undefined>;\n\t\tevents?: Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}`>>;\n\t\tafterInit?: (widget: AngularWidget<W>) => void;\n\t\tslotTemplates?: () => {\n\t\t\t[K in keyof WidgetProps<W> as IsSlotContent<WidgetProps<W>[K]> extends 0 ? never : K]: WidgetProps<W>[K] extends SlotContent<infer U>\n\t\t\t\t? TemplateRef<U> | undefined\n\t\t\t\t: never;\n\t\t};\n\t\tslotChildren?: () => TemplateRef<void> | undefined;\n\t}): AngularWidget<W> =>\n\t\tcallWidgetFactoryWithConfig({\n\t\t\tfactory,\n\t\t\twidgetConfig: widgetName ? (injectWidgetConfig(widgetName) as any) : null,\n\t\t\tdefaultConfig,\n\t\t\tevents,\n\t\t\tafterInit,\n\t\t\tslotTemplates: slotTemplates as any,\n\t\t\tslotChildren,\n\t\t});\n\n\treturn {\n\t\t/**\n\t\t * Dependency Injection token which can be used to provide or inject the widgets default configuration store.\n\t\t */\n\t\twidgetsConfigInjectionToken,\n\t\tprovideWidgetsConfig,\n\t\tinjectWidgetsConfig,\n\t\tinjectWidgetConfig,\n\t\tcallWidgetFactory,\n\t};\n};\n\nexport const {widgetsConfigInjectionToken, provideWidgetsConfig, injectWidgetConfig, injectWidgetsConfig, callWidgetFactory} =\n\twidgetsConfigFactory<WidgetsConfig>();\n","import {booleanAttribute, numberAttribute} from '@angular/core';\n\n/**\n * Transforms a value (typically a string) to a boolean.\n * Intended to be used as a transform function of an input.\n *\n * @example\n * ```readonly status = input({ transform: auBooleanAttribute });```\n * @param value - Value to be transformed.\n * @returns the value transformed\n */\nexport function auBooleanAttribute(value: unknown): boolean | undefined {\n\tif (value === undefined) {\n\t\treturn undefined;\n\t}\n\treturn booleanAttribute(value);\n}\n\n/**\n * Transforms a value (typically a string) to a number.\n * Intended to be used as a transform function of an input.\n * @param value - Value to be transformed.\n *\n * @example\n * ```readonly id = input({ transform: auNumberAttribute });```\n * @returns the value transformed\n */\nexport function auNumberAttribute(value: unknown): number | undefined {\n\tif (value === undefined) {\n\t\treturn undefined;\n\t}\n\treturn numberAttribute(value);\n}\n","import type {ComponentRef, EmbeddedViewRef, OnChanges, OnDestroy, Signal, SimpleChanges, Type} from '@angular/core';\nimport {\n\tComponent,\n\tDirective,\n\tEnvironmentInjector,\n\tTemplateRef,\n\tViewContainerRef,\n\tcreateComponent,\n\tinject,\n\treflectComponentType,\n\tChangeDetectionStrategy,\n\tinput,\n\tviewChild,\n} from '@angular/core';\nimport type {SlotContent} from './types';\nimport {ComponentTemplate} from './types';\n\nabstract class SlotHandler<Props extends Record<string, any>, Slot extends SlotContent<Props> = SlotContent<Props>> {\n\tconstructor(public viewContainerRef: ViewContainerRef) {}\n\tslotChange(_slot: Slot, _props: Props) {}\n\tpropsChange(_slot: Slot, _props: Props) {}\n\tdestroy() {}\n}\n\n@Component({\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\ttemplate: `<ng-template #text let-content=\"content\">{{ content }}</ng-template>`,\n})\nclass StringSlotComponent {\n\treadonly text = viewChild.required<\n\t\tTemplateRef<{\n\t\t\tcontent: string;\n\t\t}>\n\t>('text');\n}\nconst stringSlotComponentTemplate = new ComponentTemplate<{content: string}, 'text', StringSlotComponent>(StringSlotComponent, 'text');\n\nclass StringSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, string> {\n\treadonly #templateRefSlotHandler = new ComponentTemplateSlotHandler<{content: string}, 'text', StringSlotComponent>(this.viewContainerRef);\n\t#initialized = false;\n\n\toverride slotChange(content: string): void {\n\t\tif (!this.#initialized) {\n\t\t\tthis.#initialized = true;\n\t\t\tthis.#templateRefSlotHandler.slotChange(stringSlotComponentTemplate, {content});\n\t\t} else {\n\t\t\tthis.#templateRefSlotHandler.propsChange(stringSlotComponentTemplate, {content});\n\t\t}\n\t}\n\n\toverride destroy(): void {\n\t\tthis.#templateRefSlotHandler.destroy();\n\t}\n}\n\nclass FunctionSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, (props: Props) => string> {\n\treadonly #stringSlotHandler = new StringSlotHandler(this.viewContainerRef);\n\n\toverride slotChange(slot: (props: Props) => string, props: Props): void {\n\t\tthis.#stringSlotHandler.slotChange(slot(props));\n\t}\n\n\toverride propsChange(slot: (props: Props) => string, props: Props): void {\n\t\tthis.#stringSlotHandler.slotChange(slot(props));\n\t}\n\n\toverride destroy(): void {\n\t\tthis.#stringSlotHandler.destroy();\n\t}\n}\n\nclass ComponentSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, Type<unknown>> {\n\t#componentRef: ComponentRef<any> | undefined;\n\t#properties?: string[];\n\n\toverride slotChange(slot: Type<unknown>, props: Props): void {\n\t\tif (this.#componentRef) {\n\t\t\tthis.destroy();\n\t\t}\n\t\tthis.#componentRef = this.viewContainerRef.createComponent(slot);\n\t\tthis.#applyProperties(props);\n\t}\n\n\t#applyProperties(props: Props, oldProperties?: Set<string>) {\n\t\tconst properties = Object.keys(props);\n\t\tthis.#properties = properties;\n\t\tconst componentRef = this.#componentRef!;\n\t\tfor (const property of properties) {\n\t\t\tcomponentRef.setInput(property, props[property]);\n\t\t\toldProperties?.delete(property);\n\t\t}\n\t}\n\n\toverride propsChange(_slot: Type<unknown>, props: Props): void {\n\t\tconst oldProperties = new Set(this.#properties);\n\t\tthis.#applyProperties(props, oldProperties);\n\t\tconst componentRef = this.#componentRef!;\n\t\tfor (const property of oldProperties) {\n\t\t\tcomponentRef.setInput(property, undefined);\n\t\t}\n\t}\n\n\toverride destroy(): void {\n\t\tthis.viewContainerRef.clear();\n\t\tthis.#componentRef = undefined;\n\t}\n}\n\nclass TemplateRefSlotHandler<Props extends Record<string, any>> extends SlotHandler<Props, TemplateRef<Props>> {\n\t#viewRef: EmbeddedViewRef<Props> | undefined;\n\t#props?: Props;\n\n\toverride slotChange(slot: TemplateRef<Props>, props: Props): void {\n\t\tif (this.#viewRef) {\n\t\t\tthis.destroy();\n\t\t}\n\t\tprops = {...props};\n\t\tthis.#props = props;\n\t\tthis.#viewRef = this.viewContainerRef.createEmbeddedView(slot, props);\n\t}\n\n\toverride propsChange(_slot: TemplateRef<Props>, props: Props): void {\n\t\tif (this.#viewRef) {\n\t\t\tconst templateProps = this.#props!;\n\t\t\tconst oldProperties = new Set<keyof Props>(Object.keys(templateProps));\n\t\t\tfor (const property of Object.keys(props) as (keyof Props)[]) {\n\t\t\t\ttemplateProps[property] = props[property];\n\t\t\t\toldProperties.delete(property);\n\t\t\t}\n\t\t\tfor (const oldProperty of oldProperties) {\n\t\t\t\tdelete templateProps[oldProperty];\n\t\t\t}\n\t\t\tthis.#viewRef.markForCheck();\n\t\t}\n\t}\n\n\toverride destroy(): void {\n\t\tthis.viewContainerRef.clear();\n\t}\n}\n\nclass ComponentTemplateSlotHandler<\n\tProps extends Record<string, any>,\n\tK extends string,\n\tT extends {[key in K]: Signal<TemplateRef<Props>>},\n> extends SlotHandler<Props, ComponentTemplate<Props, K, T>> {\n\t#componentRef: ComponentRef<T> | undefined;\n\treadonly #templateSlotHandler = new TemplateRefSlotHandler(this.viewContainerRef);\n\t#templateRef: Signal<TemplateRef<Props>> | undefined;\n\n\toverride slotChange(slot: ComponentTemplate<Props, K, T>, props: Props): void {\n\t\tif (this.#componentRef) {\n\t\t\tthis.destroy();\n\t\t}\n\t\tthis.#componentRef = createComponent(slot.component, {\n\t\t\telementInjector: this.viewContainerRef.injector,\n\t\t\tenvironmentInjector: this.viewContainerRef.injector.get(EnvironmentInjector),\n\t\t});\n\t\tthis.#templateRef = this.#componentRef.instance[slot.templateProp];\n\t\tthis.#templateSlotHandler.slotChange(this.#templateRef(), props);\n\t}\n\n\toverride propsChange(_slot: ComponentTemplate<Props, K, T>, props: Props): void {\n\t\tthis.#templateSlotHandler.propsChange(this.#templateRef!(), props);\n\t}\n\n\toverride destroy(): void {\n\t\tthis.#templateSlotHandler.destroy();\n\t\tthis.#componentRef?.destroy();\n\t\tthis.#componentRef = undefined;\n\t}\n}\n\nconst getSlotType = (value: any): undefined | {new (viewContainerRef: ViewContainerRef): SlotHandler<any>} => {\n\tif (!value) return undefined;\n\tconst type = typeof value;\n\tswitch (type) {\n\t\tcase 'string':\n\t\t\treturn StringSlotHandler;\n\t\tcase 'function':\n\t\t\tif (reflectComponentType(value)) {\n\t\t\t\treturn ComponentSlotHandler;\n\t\t\t}\n\t\t\treturn FunctionSlotHandler;\n\t\tcase 'object':\n\t\t\tif (value instanceof TemplateRef) {\n\t\t\t\treturn TemplateRefSlotHandler;\n\t\t\t}\n\t\t\tif (value instanceof ComponentTemplate) {\n\t\t\t\treturn ComponentTemplateSlotHandler;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn undefined;\n};\n\n/**\n * A directive that manages slot content and its properties.\n *\n * @template Props - A record type representing the properties for the slot.\n *\n * @remarks\n * This directive handles changes to the slot content and its properties,\n * and manages the lifecycle of the slot handler.\n */\n@Directive({\n\tselector: '[auSlot]',\n\tstandalone: true,\n})\nexport class SlotDirective<Props extends Record<string, any>> implements OnChanges, OnDestroy {\n\t/**\n\t * The slot content to be managed.\n\t */\n\treadonly slot = input.required<SlotContent<Props>>({alias: 'auSlot'});\n\t/**\n\t * The properties for the slot content.\n\t */\n\treadonly props = input.required<Props>({alias: 'auSlotProps'});\n\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate _slotType: ReturnType<typeof getSlotType>;\n\tprivate _slotHandler: SlotHandler<Props> | undefined;\n\n\t/**\n\t * @param changes SimpleChanges from Angular\n\t * @internal\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tconst slotChange = changes['slot'];\n\t\tconst propsChange = changes['props'];\n\t\tconst slot = this.slot();\n\t\tif (slotChange) {\n\t\t\tconst newSlotType = getSlotType(slot);\n\t\t\tif (newSlotType !== this._slotType) {\n\t\t\t\tthis._slotHandler?.destroy();\n\t\t\t\tthis._slotHandler = newSlotType ? new newSlotType(this._viewContainerRef) : undefined;\n\t\t\t\tthis._slotType = newSlotType;\n\t\t\t}\n\t\t\tthis._slotHandler?.slotChange(slot, this.props());\n\t\t} else if (propsChange) {\n\t\t\tthis._slotHandler?.propsChange(slot, this.props());\n\t\t}\n\t}\n\n\t/** @internal */\n\tngOnDestroy(): void {\n\t\tthis._slotHandler?.destroy();\n\t\tthis._slotHandler = undefined;\n\t}\n}\n","/*\n * Public API Surface of @agnos-ui/angular-headless\n */\nexport * from './generated';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,IAAI,GAAG,MAAK,GAAG;AACrB,MAAM,QAAQ,GAAG,CAAI,CAAI,KAAK,CAAC;AAI/B,MAAM,mBAAmB,GACxB,CAAC,IAAa,KACd,CAAC,MAAM,KAAI;IACV,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC1C,QAAA,OAAO,MAAM;;IAEd,MAAM,GAAG,GAAG,EAA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IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;;;;IAKpD,WAAW,GAAA;AACV,QAAA,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE;AAC5B,QAAA,IAAI,CAAC,YAAY,GAAG,SAAS;;8GAtClB,aAAa,GAAA,CAAA,EAAA,CAAA;oEAAb,aAAa,EAAA,SAAA,EAAA,CAAA,CAAA,EAAA,EAAA,QAAA,EAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAA,KAAA,EAAA,CAAA,CAAA,EAAA,aAAA,EAAA,OAAA,CAAA,EAAA,EAAA,QAAA,EAAA,CAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,CAAA;;iFAAb,aAAa,EAAA,CAAA;cAJzB,SAAS;AAAC,QAAA,IAAA,EAAA,CAAA;AACV,gBAAA,QAAQ,EAAE,UAAU;AACpB,gBAAA,UAAU,EAAE,IAAI;AAChB,aAAA;;;AChND;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/angular-headless",
3
3
  "description": "Headless component library for Angular.",
4
- "version": "0.6.0",
4
+ "version": "0.7.0-next.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -12,12 +12,12 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@amadeus-it-group/tansu": "^1.0.0",
16
- "@angular/common": "^18.2.12",
17
- "@angular/core": "^18.2.12"
15
+ "@amadeus-it-group/tansu": "^2.0.0",
16
+ "@angular/common": "^19.0.3",
17
+ "@angular/core": "^19.0.3"
18
18
  },
19
19
  "dependencies": {
20
- "@agnos-ui/core": "0.6.0",
20
+ "@agnos-ui/core": "0.7.0-next.0",
21
21
  "tslib": "^2.8.1"
22
22
  },
23
23
  "sideEffects": false,
@@ -14,11 +14,11 @@ export declare class SlotDirective<Props extends Record<string, any>> implements
14
14
  /**
15
15
  * The slot content to be managed.
16
16
  */
17
- slot: SlotContent<Props>;
17
+ readonly slot: import("@angular/core").InputSignal<SlotContent<Props>>;
18
18
  /**
19
19
  * The properties for the slot content.
20
20
  */
21
- props: Props;
21
+ readonly props: import("@angular/core").InputSignal<Props>;
22
22
  private readonly _viewContainerRef;
23
23
  private _slotType;
24
24
  private _slotHandler;
@@ -30,5 +30,5 @@ export declare class SlotDirective<Props extends Record<string, any>> implements
30
30
  /** @internal */
31
31
  ngOnDestroy(): void;
32
32
  static ɵfac: i0.ɵɵFactoryDeclaration<SlotDirective<any>, never>;
33
- static ɵdir: i0.ɵɵDirectiveDeclaration<SlotDirective<any>, "[auSlot]", never, { "slot": { "alias": "auSlot"; "required": false; }; "props": { "alias": "auSlotProps"; "required": true; }; }, {}, never, never, true, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SlotDirective<any>, "[auSlot]", never, { "slot": { "alias": "auSlot"; "required": true; "isSignal": true; }; "props": { "alias": "auSlotProps"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
34
34
  }
package/types.d.ts CHANGED
@@ -13,7 +13,7 @@ export * from '@agnos-ui/core/types';
13
13
  * @param templateProp - The key in the component that maps to the template reference.
14
14
  */
15
15
  export declare class ComponentTemplate<Props, K extends string, T extends {
16
- [key in K]: TemplateRef<Props>;
16
+ [key in K]: Signal<TemplateRef<Props>>;
17
17
  }> {
18
18
  readonly component: Type<T>;
19
19
  readonly templateProp: K;
@@ -42,17 +42,25 @@ export declare abstract class SlotComponent<W extends Widget> {
42
42
  /**
43
43
  * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}
44
44
  */
45
- state: AngularState<W>;
45
+ readonly state: import("@angular/core").InputSignal<AngularState<W>>;
46
46
  /**
47
47
  * all the api functions to interact with the widget
48
48
  */
49
- api: W['api'];
49
+ readonly api: import("@angular/core").InputSignal<W["api"]>;
50
50
  /**
51
51
  * directives to be used on html elements in the template of the slot
52
52
  */
53
- directives: W['directives'];
53
+ readonly directives: import("@angular/core").InputSignal<W["directives"]>;
54
+ /**
55
+ * The slot context, to be used when the slot component uses other slots.
56
+ */
57
+ readonly slotContext: Signal<{
58
+ state: AngularState<W>;
59
+ api: W["api"];
60
+ directives: W["directives"];
61
+ }>;
54
62
  static ɵfac: i0.ɵɵFactoryDeclaration<SlotComponent<any>, never>;
55
- static ɵdir: i0.ɵɵDirectiveDeclaration<SlotComponent<any>, never, never, { "state": { "alias": "state"; "required": false; }; "api": { "alias": "api"; "required": false; }; "directives": { "alias": "directives"; "required": false; }; }, {}, never, never, false, never>;
63
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SlotComponent<any>, never, never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "api": { "alias": "api"; "required": true; "isSignal": true; }; "directives": { "alias": "directives"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
56
64
  }
57
65
  /**
58
66
  * Type utility to determine if a given type `T` is or extends `SlotContent<any>`.