@agnos-ui/angular-bootstrap 0.9.0-next.0 → 0.9.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.
@@ -1,7 +1,7 @@
1
1
  import { widgetsConfigFactory, SlotDirective, UseDirective, ComponentTemplate, BaseWidgetDirective, auBooleanAttribute, UseMultiDirective, auNumberAttribute, useDirectiveForHost, callWidgetFactory as callWidgetFactory$1, ToasterService as ToasterService$1 } from '@agnos-ui/angular-headless';
2
2
  export * from '@agnos-ui/angular-headless';
3
3
  import * as i0 from '@angular/core';
4
- import { InjectionToken, inject, TemplateRef, Directive, viewChild, ChangeDetectionStrategy, Component, input, contentChild, output, ViewEncapsulation, forwardRef, Injector, runInInjectionContext, Injectable, computed, effect, NgModule, ApplicationRef, createComponent, EnvironmentInjector, OutputEmitterRef } from '@angular/core';
4
+ import { InjectionToken, inject, TemplateRef, Directive, viewChild, ChangeDetectionStrategy, Component, input, contentChild, output, ViewEncapsulation, forwardRef, Injector, runInInjectionContext, Injectable, computed, effect, NgModule, ApplicationRef, createComponent, outputBinding, inputBinding, EnvironmentInjector } from '@angular/core';
5
5
  import { getModalDefaultConfig, createModal, modalOutsideClick, modalCloseButtonClick } from '@agnos-ui/core-bootstrap/components/modal';
6
6
  import { getPaginationDefaultConfig, createPagination } from '@agnos-ui/core-bootstrap/components/pagination';
7
7
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
@@ -5509,30 +5509,22 @@ class ModalService {
5509
5509
  const component = createComponent(ModalComponent, {
5510
5510
  environmentInjector: injector.get(EnvironmentInjector),
5511
5511
  elementInjector: injector,
5512
- });
5513
- const subscriptions = [];
5514
- try {
5515
- for (const [prop, value] of Object.entries(options)) {
5516
- if (prop.startsWith('on')) {
5517
- const eventName = `${prop[2].toLowerCase()}${prop.substring(3)}`;
5518
- const eventEmitter = component.instance[eventName];
5519
- if (eventEmitter instanceof OutputEmitterRef) {
5520
- subscriptions.push(eventEmitter.subscribe(value));
5521
- }
5512
+ bindings: Object.entries(options).map(([key, value]) => {
5513
+ if (key.startsWith('on')) {
5514
+ return outputBinding(`au${key.substring(2)}`, value);
5522
5515
  }
5523
5516
  else {
5524
- component.setInput(`au${prop.substring(0, 1).toUpperCase()}${prop.substring(1)}`, value);
5517
+ return inputBinding(`au${key[0].toUpperCase()}${key.substring(1)}`, () => value);
5525
5518
  }
5526
- }
5519
+ }),
5520
+ });
5521
+ try {
5527
5522
  this._applicationRef.attachView(component.hostView);
5528
5523
  await component.instance['_widget'].initialized;
5529
5524
  return await component.instance.api.open();
5530
5525
  }
5531
5526
  finally {
5532
5527
  component.destroy();
5533
- for (const subscription of subscriptions) {
5534
- subscription.unsubscribe();
5535
- }
5536
5528
  }
5537
5529
  }
5538
5530
  static { this.ɵfac = function ModalService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ModalService)(); }; }