chrv-components 1.11.25 → 1.11.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, AfterViewInit, OnDestroy, EventEmitter, ElementRef, AfterViewChecked, AfterContentChecked, ViewContainerRef, QueryList, AfterContentInit, Type, InjectionToken } from '@angular/core';
2
+ import { OnInit, ViewContainerRef, Type, ApplicationRef, EnvironmentInjector, ComponentRef, AfterViewInit, OnDestroy, EventEmitter, ElementRef, AfterViewChecked, AfterContentChecked, QueryList, AfterContentInit, InjectionToken } from '@angular/core';
3
3
  import { Router, UrlTree } from '@angular/router';
4
- import { MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
4
+ import * as rxjs from 'rxjs';
5
+ import { Observable, Subject, Subscription, BehaviorSubject } from 'rxjs';
5
6
  import * as _angular_forms from '@angular/forms';
6
7
  import { AbstractControl, ValidationErrors, ValidatorFn, AsyncValidatorFn, FormControl, FormGroup, ControlValueAccessor, NgControl, Validator } from '@angular/forms';
7
- import * as rxjs from 'rxjs';
8
- import { Subject, Subscription, Observable, BehaviorSubject } from 'rxjs';
9
8
  import { MatAutocomplete } from '@angular/material/autocomplete';
9
+ import { MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
10
10
  import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
11
11
  import { HttpClient, HttpInterceptorFn, HttpEvent, HttpFeature } from '@angular/common/http';
12
12
  import * as _angular_animations from '@angular/animations';
@@ -62,9 +62,166 @@ declare class ChrButtonComponent {
62
62
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChrButtonComponent, "app-chr-button", never, { "display": { "alias": "display"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "click": { "alias": "click"; "required": false; "isSignal": true; }; "clickWhileDisabled": { "alias": "clickWhileDisabled"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "textColor": { "alias": "textColor"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; "predicate": { "alias": "predicate"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
63
63
  }
64
64
 
65
+ declare class ChrModalComponent<T> implements OnInit {
66
+ dynamicContent: ViewContainerRef;
67
+ /**
68
+ * Indique si le modal est ouvert ou fermé.
69
+ * @default false
70
+ */
71
+ isOpen: _angular_core.InputSignal<boolean>;
72
+ /**
73
+ * Indique si le modal doit se fermer lorsque l'utilisateur clique sur le fond.
74
+ * @default true
75
+ */
76
+ closeOnBackdropClick: _angular_core.ModelSignal<boolean>;
77
+ /**
78
+ * Indique si le modal doit se fermer lorsque l'utilisateur appuie sur la touche Échap.
79
+ * @default true
80
+ */
81
+ closeOnEscape: _angular_core.ModelSignal<boolean>;
82
+ /**
83
+ * Shorthand for closeOnBackdropClick and closeOnEscape
84
+ * @default undefined
85
+ */
86
+ disableClose: _angular_core.InputSignal<boolean | undefined>;
87
+ /**
88
+ * Événement émis lorsque le modal doit être fermé.
89
+ * @default undefined
90
+ */
91
+ close: _angular_core.OutputEmitterRef<any>;
92
+ /**
93
+ * Largeur du modal en pourcentage de la largeur de la fenêtre.
94
+ */
95
+ width: _angular_core.InputSignal<number | undefined>;
96
+ /**
97
+ * Hauteur du modal en pourcentage de la hauteur de la fenêtre.
98
+ */
99
+ height: _angular_core.InputSignal<number | undefined>;
100
+ /**
101
+ * Fond par défaut du conteneur modal. Par défaut, 'none' pour permettre la personnalisation via CSS avec la classe '.modal-wrapper' ou '.modal-content'.
102
+ * @default 'none'
103
+ */
104
+ background: _angular_core.InputSignal<Color>;
105
+ constructor();
106
+ getDynamicContentContainer(): ViewContainerRef;
107
+ onBackdropClick(): void;
108
+ onModalClick(event: Event): void;
109
+ onEscapeKey(event: KeyboardEvent): void;
110
+ ngOnInit(): void;
111
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChrModalComponent<any>, never>;
112
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChrModalComponent<any>, "chr-modal", never, { "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "disableClose": { "alias": "disableClose"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "background": { "alias": "background"; "required": false; "isSignal": true; }; }, { "closeOnBackdropClick": "closeOnBackdropClickChange"; "closeOnEscape": "closeOnEscapeChange"; "close": "close"; }, never, never, true, never>;
113
+ }
114
+
115
+ interface ModalOptions {
116
+ /**
117
+ * Indicates if the modal is open or closed.
118
+ * @default true
119
+ */
120
+ closeOnBackdropClick?: boolean;
121
+ /**
122
+ * Indicates if the modal should close when the user presses the Escape key.
123
+ * @default true
124
+ */
125
+ closeOnEscape?: boolean;
126
+ /**
127
+ * Shorthand for closeOnBackdropClick and closeOnEscape
128
+ */
129
+ disableClose?: boolean;
130
+ /**
131
+ * Width in vw
132
+ */
133
+ width?: number;
134
+ /**
135
+ * Height in vh
136
+ */
137
+ height?: number;
138
+ /**
139
+ * Default background of the modal container. Defaults to 'none' as to allow customisation through css with the class '.modal-content'.
140
+ * @default 'none'
141
+ */
142
+ background?: Color;
143
+ /**
144
+ * Data to be passed to the modal component
145
+ */
146
+ data?: any;
147
+ }
148
+ interface ModalData {
149
+ [key: string]: any;
150
+ }
151
+ interface IModalRef<ChrModalComponent, T extends object = any> {
152
+ open: () => void;
153
+ configure(options: ModalOptions): void;
154
+ close: (result?: any) => void;
155
+ afterClosed: () => Observable<any>;
156
+ }
157
+ /**
158
+ * Classe ModalRef générique qui gère la logique de création, configuration et fermeture des modales.
159
+ * Cette classe extrait la logique du ModalService pour permettre une meilleure séparation des responsabilités.
160
+ *
161
+ * Usage dans le ModalService refactorisé:
162
+ * ```typescript
163
+ * open<T>(component: Type<T>, options: ModalOptions = {}): ModalRef<T> {
164
+ * const modalRef = new ModalRef(component, options);
165
+ * const modalComponentRef = modalRef.create();
166
+ * this.activeModals.add(modalRef);
167
+ * return modalRef;
168
+ * }
169
+ * ```
170
+ */
171
+ declare class ModalRef<T extends object> implements IModalRef<ChrModalComponent<T>> {
172
+ private _component;
173
+ private options;
174
+ private _afterClosed;
175
+ private modalComponentRef;
176
+ private contentComponentRef;
177
+ private appRef;
178
+ private environmentInjector;
179
+ constructor(_component: Type<T>, options: ModalOptions, appRef: ApplicationRef, injector: EnvironmentInjector);
180
+ /**
181
+ * Returns the component instance of the modal content.
182
+ * Throws an error if the content component is not initialized.
183
+ */
184
+ get componentInstance(): T;
185
+ /**
186
+ * Returns the modal instance.
187
+ * Throws an error if the modal component is not initialized.
188
+ */
189
+ get instance(): ChrModalComponent<T>;
190
+ setWidth(width: number): void;
191
+ setHeight(height: number): void;
192
+ protected set(property: string, value: any): void;
193
+ /**
194
+ * Creates and initializes the modal component and its content
195
+ */
196
+ create(): ComponentRef<ChrModalComponent<T>>;
197
+ /**
198
+ * Opens the modal by setting isOpen to true
199
+ */
200
+ open(): void;
201
+ /**
202
+ * Closes the modal and emits the result
203
+ */
204
+ close(result?: any): void;
205
+ /**
206
+ * Returns an observable that emits when the modal is closed
207
+ */
208
+ afterClosed(): Observable<any>;
209
+ /**
210
+ * Configures the modal with the provided options.
211
+ * This methods allow dynamic configuration of the modal after its creation.
212
+ * It will however not properly update the data as it is injected at creation time.
213
+ * @param options
214
+ */
215
+ configure(options: ModalOptions): void;
216
+ private _configureModal;
217
+ private _attachToDom;
218
+ }
219
+
65
220
  declare class ChrDeleteModalComponent {
66
- dialogRef: MatDialogRef<ChrDeleteModalComponent, any>;
221
+ t: ModalRef<ChrDeleteModalComponent>;
222
+ dialogRef: ModalRef<any>;
67
223
  valid: boolean;
224
+ constructor(t: ModalRef<ChrDeleteModalComponent>);
68
225
  ngOnInit(): void;
69
226
  cancel: () => void;
70
227
  close: () => void;
@@ -1074,50 +1231,6 @@ declare class ChrDefaultModalComponent {
1074
1231
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChrDefaultModalComponent, "app-chr-default-modal", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "close": { "alias": "close"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1075
1232
  }
1076
1233
 
1077
- declare class ChrModalComponent implements OnInit {
1078
- dynamicContent: ViewContainerRef;
1079
- /**
1080
- * Indique si le modal est ouvert ou fermé.
1081
- * @default false
1082
- */
1083
- isOpen: _angular_core.InputSignal<boolean>;
1084
- /**
1085
- * Indique si le modal doit se fermer lorsque l'utilisateur clique sur le fond.
1086
- * @default true
1087
- */
1088
- closeOnBackdropClick: _angular_core.ModelSignal<boolean>;
1089
- /**
1090
- * Indique si le modal doit se fermer lorsque l'utilisateur appuie sur la touche Échap.
1091
- * @default true
1092
- */
1093
- closeOnEscape: _angular_core.ModelSignal<boolean>;
1094
- /**
1095
- * Shorthand for closeOnBackdropClick and closeOnEscape
1096
- * @default undefined
1097
- */
1098
- disableClose: _angular_core.InputSignal<boolean | undefined>;
1099
- /**
1100
- * Événement émis lorsque le modal doit être fermé.
1101
- * @default undefined
1102
- */
1103
- close: _angular_core.OutputEmitterRef<any>;
1104
- /**
1105
- * Largeur du modal en pourcentage de la largeur de la fenêtre.
1106
- */
1107
- width: _angular_core.InputSignal<number | undefined>;
1108
- /**
1109
- * Hauteur du modal en pourcentage de la hauteur de la fenêtre.
1110
- */
1111
- height: _angular_core.InputSignal<number | undefined>;
1112
- getDynamicContentContainer(): ViewContainerRef;
1113
- onBackdropClick(): void;
1114
- onModalClick(event: Event): void;
1115
- onEscapeKey(event: KeyboardEvent): void;
1116
- ngOnInit(): void;
1117
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChrModalComponent, never>;
1118
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChrModalComponent, "chr-modal", never, { "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "disableClose": { "alias": "disableClose"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, { "closeOnBackdropClick": "closeOnBackdropClickChange"; "closeOnEscape": "closeOnEscapeChange"; "close": "close"; }, never, never, true, never>;
1119
- }
1120
-
1121
1234
  declare class InlineSvgComponent implements OnInit {
1122
1235
  private http;
1123
1236
  private sanitizer;
@@ -1284,48 +1397,13 @@ declare const inOutAnimation: (duration?: number) => _angular_animations.Animati
1284
1397
 
1285
1398
  declare const rotationAnimation: (initialAngle?: number, endAngle?: number, duration?: number) => _angular_animations.AnimationTriggerMetadata;
1286
1399
 
1287
- interface ModalOptions {
1288
- /**
1289
- * Indicates if the modal is open or closed.
1290
- * @default true
1291
- */
1292
- closeOnBackdropClick?: boolean;
1293
- /**
1294
- * Indicates if the modal should close when the user presses the Escape key.
1295
- * @default true
1296
- */
1297
- closeOnEscape?: boolean;
1298
- /**
1299
- * Shorthand for closeOnBackdropClick and closeOnEscape
1300
- */
1301
- disableClose?: boolean;
1302
- /**
1303
- * Width in vw
1304
- */
1305
- width?: number;
1306
- /**
1307
- * Height in vh
1308
- */
1309
- height?: number;
1310
- data?: any;
1311
- }
1312
- interface ModalData {
1313
- [key: string]: any;
1314
- }
1315
- interface ModalRef<T = any> {
1316
- componentInstance: T;
1317
- close: (result?: any) => void;
1318
- afterClosed: () => Observable<any>;
1319
- }
1320
-
1321
1400
  declare class ModalService {
1322
- private dialog;
1401
+ private activeModals;
1323
1402
  private appRef;
1324
1403
  private environmentInjector;
1325
- private activeModals;
1326
- open<T>(component: Type<T>, options?: ModalOptions): ModalRef<ChrModalComponent>;
1404
+ open<T extends object>(component: Type<T>, options?: ModalOptions): IModalRef<T>;
1405
+ close(modalRefType: Type<any>): void;
1327
1406
  closeAll(): void;
1328
- private closeModal;
1329
1407
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalService, never>;
1330
1408
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ModalService>;
1331
1409
  }
@@ -1477,5 +1555,5 @@ declare const XSRFHEADERNAME: InjectionToken<string>;
1477
1555
  declare const XSRFCOOKIENAME: InjectionToken<string>;
1478
1556
  declare const HUBURL: InjectionToken<string>;
1479
1557
 
1480
- export { Aligments, AutofocusDirective, BreadcrumbComponent, ButtonComponent, CHR_MODAL_DATA, CHR_MODAL_REF, CarouselComponent, ChrBaseInputComponent, ChrButtonComponent, ChrCheckboxComponent, ChrColorInputComponent, ChrDataTable, ChrDateInputComponent, ChrDatetimeInputComponent, ChrDefaultModalComponent, ChrDeleteModalComponent, ChrFileInputComponent, ChrFormComponent, ChrModalComponent, ChrNiceFileInputComponent, ChrPaginatorComponent, ChrSearchSelectComponent, ChrSearchbarComponent, ChrSeparatorComponent, ChrSpinnerComponent, ChrTableComponent, ChrTableHeaderCellComponent, ChrTagSelectComponent, ChrTextareaInputComponent, ChrToastComponent, ChrToggleInputComponent, Colors, CookiesService, DEFAULTLIVEUPDATEMESSAGE, DataService, DecimalValidatorDirective, DefaultLiveUpdateMessage, FileService, HUBURL, InlineSvgComponent, LiveUpdateService, LiveUpdateStatus, LoaderService, MaxDateValidatorDirective, MaxFileSizeValidator, MaxLengthValidatorDirective, MinFileSizeValidator, MinLengthValidatorDirective, ModalService, RequiredValidatorDirective, SpinnerInterceptor, SyncValidatorToAsync, TabComponent, TabGroupComponent, TabToEnterHandlerDirective, TabToInputHandlerDirective, ToastService, TypeValidatorDirective, WaitAndStoreXsrfToken, XSRFCOOKIENAME, XSRFHEADERNAME, XsrfInterceptor, decimal, getAsyncValidators, getBackgroundColor, getBorderColor, getContrastBackgroundColor, getContrastBorderColor, getContrastTextColor, getSyncValidators, getTextColor, getValidators, inOutAnimation, maxDate, maxFileSize, maxLength, minFileSize, minLength, provideXsrfHttpClient, required, rotationAnimation, type };
1481
- export type { Alignment, Breadcrumb, Color, IAction, IChip, IChips, IColumn, IComputedColumn, IComputedRow, IControl, IControlValidation, IDefaultDialogConfig, IFile, IFormSection, IInputSearchFilter, ILiveUpdateMessage, ISearchFilter, IXsrfProviderParams, InputType, ModalData, ModalOptions, ModalRef, TColumn, TColumnType, Toast };
1558
+ export { Aligments, AutofocusDirective, BreadcrumbComponent, ButtonComponent, CHR_MODAL_DATA, CHR_MODAL_REF, CarouselComponent, ChrBaseInputComponent, ChrButtonComponent, ChrCheckboxComponent, ChrColorInputComponent, ChrDataTable, ChrDateInputComponent, ChrDatetimeInputComponent, ChrDefaultModalComponent, ChrDeleteModalComponent, ChrFileInputComponent, ChrFormComponent, ChrModalComponent, ChrNiceFileInputComponent, ChrPaginatorComponent, ChrSearchSelectComponent, ChrSearchbarComponent, ChrSeparatorComponent, ChrSpinnerComponent, ChrTableComponent, ChrTableHeaderCellComponent, ChrTagSelectComponent, ChrTextareaInputComponent, ChrToastComponent, ChrToggleInputComponent, Colors, CookiesService, DEFAULTLIVEUPDATEMESSAGE, DataService, DecimalValidatorDirective, DefaultLiveUpdateMessage, FileService, HUBURL, InlineSvgComponent, LiveUpdateService, LiveUpdateStatus, LoaderService, MaxDateValidatorDirective, MaxFileSizeValidator, MaxLengthValidatorDirective, MinFileSizeValidator, MinLengthValidatorDirective, ModalRef, ModalService, RequiredValidatorDirective, SpinnerInterceptor, SyncValidatorToAsync, TabComponent, TabGroupComponent, TabToEnterHandlerDirective, TabToInputHandlerDirective, ToastService, TypeValidatorDirective, WaitAndStoreXsrfToken, XSRFCOOKIENAME, XSRFHEADERNAME, XsrfInterceptor, decimal, getAsyncValidators, getBackgroundColor, getBorderColor, getContrastBackgroundColor, getContrastBorderColor, getContrastTextColor, getSyncValidators, getTextColor, getValidators, inOutAnimation, maxDate, maxFileSize, maxLength, minFileSize, minLength, provideXsrfHttpClient, required, rotationAnimation, type };
1559
+ export type { Alignment, Breadcrumb, Color, IAction, IChip, IChips, IColumn, IComputedColumn, IComputedRow, IControl, IControlValidation, IDefaultDialogConfig, IFile, IFormSection, IInputSearchFilter, ILiveUpdateMessage, IModalRef, ISearchFilter, IXsrfProviderParams, InputType, ModalData, ModalOptions, TColumn, TColumnType, Toast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chrv-components",
3
- "version": "1.11.25",
3
+ "version": "1.11.26",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=17.0.0",
6
6
  "@angular/core": ">=17.0.0",
Binary file