@acorex/components 22.0.0-next.1 → 22.0.0-next.3

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,19 +1,36 @@
1
- import * as i0 from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
2
  import { TemplateRef, ViewContainerRef, StaticProvider, OnInit, OnDestroy } from '@angular/core';
3
3
  import * as i2 from '@acorex/cdk/common';
4
- import { MXBaseComponent, AXComponentClosedPromise } from '@acorex/cdk/common';
4
+ import { NXComponent, MXBaseComponent, AXComponentClosedPromise } from '@acorex/cdk/common';
5
5
  import { AXComponentType, AXComponentInputs } from '@acorex/core/components';
6
6
  import { Subject } from 'rxjs';
7
7
  import * as i1 from '@angular/common';
8
8
  import * as i3 from '@acorex/components/decorators';
9
9
  import * as i4 from '@acorex/core/translation';
10
10
 
11
- type AXPopupContentType = TemplateRef<unknown> | AXComponentType<unknown>;
11
+ declare class AXPopupFooterComponent {
12
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPopupFooterComponent, never>;
13
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPopupFooterComponent, "ax-popup-footer", never, {}, {}, never, ["ax-prefix", "ax-suffix", "*"], true, never>;
14
+ }
15
+
16
+ type AXPopupContentType = TemplateRef<unknown> | AXComponentType<unknown> | HTMLElement;
12
17
  type AXPopupSizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'fit';
18
+ type AXPopupMinimizePosition = 'bottom-right' | 'bottom-left';
19
+ interface AXPopupButtonsConfig {
20
+ minimize?: {
21
+ enable: boolean;
22
+ position: AXPopupMinimizePosition;
23
+ };
24
+ maximize?: boolean;
25
+ close?: boolean;
26
+ }
13
27
  interface AXPopupConfig {
14
28
  title?: string;
29
+ /** Flat alias; overridden by `buttons.close` when set. */
15
30
  closeButton?: boolean;
16
31
  header?: boolean;
32
+ footer?: boolean;
33
+ /** Flat alias; overridden by `buttons.maximize` when set. */
17
34
  maximizable?: boolean;
18
35
  size?: AXPopupSizeType;
19
36
  /** @deprecated Use `inputs` instead to pass data to the popup component. */
@@ -24,10 +41,20 @@ interface AXPopupConfig {
24
41
  backdropClass?: string;
25
42
  closeOnBackdropClick?: boolean;
26
43
  closeOnNavigation?: boolean;
44
+ /** When unset, Escape closes only if the close button is enabled (legacy behavior). */
45
+ closeOnEscape?: boolean;
27
46
  viewContainerRef?: ViewContainerRef;
28
47
  providers?: StaticProvider[];
29
48
  panelClass?: string[];
30
49
  direction?: 'rtl' | 'ltr';
50
+ /** Window chrome buttons. Individual fields override flat `closeButton` / `maximizable` when set. */
51
+ buttons?: AXPopupButtonsConfig;
52
+ /**
53
+ * @internal
54
+ * Called with the popup ref before content is created so callers can inject
55
+ * extra content inputs that depend on the ref.
56
+ */
57
+ _bindContentInputs?: (ref: AXPopupRef) => Record<string, unknown>;
31
58
  }
32
59
  interface AXPopupData {
33
60
  title: string;
@@ -43,19 +70,79 @@ interface AXPopupRef<TResult = any> {
43
70
  close: (data?: TResult) => void;
44
71
  setInputs: (values: AXComponentInputs) => void;
45
72
  setTitle: (title: string) => void;
73
+ minimize: () => void;
74
+ maximize: () => void;
75
+ restore: () => void;
46
76
  /** Brings this popup to the front of all other overlays */
47
77
  bringToFront: () => void;
48
78
  onClose: Subject<TResult>;
49
79
  /** The component instance rendered inside the popup (available after content is rendered) */
50
80
  componentInstance?: unknown;
81
+ /** @internal Stack index among open popups (minimized bar positioning). */
82
+ _getStackIndex?: () => number;
51
83
  }
52
84
  declare abstract class AXPopupComponentBase {
53
- __popup__: i0.InputSignal<AXPopupRef<any>>;
85
+ __popup__: _angular_core.InputSignal<AXPopupRef<any>>;
54
86
  close(data?: any): void;
55
87
  setTitle(title: string): void;
88
+ minimize(): void;
89
+ maximize(): void;
90
+ restore(): void;
56
91
  bringToFront(): void;
57
- static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupComponentBase, never>;
58
- static ɵdir: i0.ɵɵDirectiveDeclaration<AXPopupComponentBase, never, never, { "__popup__": { "alias": "__popup__"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
92
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPopupComponentBase, never>;
93
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXPopupComponentBase, never, never, { "__popup__": { "alias": "__popup__"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
94
+ }
95
+ /** Resolves whether the close header button is shown. `buttons.close` wins over `closeButton`. */
96
+ declare function resolvePopupCloseButton(config?: AXPopupConfig | null): boolean;
97
+ /** Resolves whether maximize is enabled. `buttons.maximize` wins over `maximizable`. Default: false. */
98
+ declare function resolvePopupMaximizable(config?: AXPopupConfig | null): boolean;
99
+ /** Resolves minimize button config. Default: disabled at bottom-right. */
100
+ declare function resolvePopupMinimize(config?: AXPopupConfig | null): {
101
+ enable: boolean;
102
+ position: AXPopupMinimizePosition;
103
+ };
104
+
105
+ /**
106
+ * Declarative popup host. Project content and call `open()` / `close()` on the component instance.
107
+ *
108
+ * @example
109
+ * ```html
110
+ * <ax-popup-host #popup>
111
+ * <p>Content</p>
112
+ * </ax-popup-host>
113
+ * <ax-button (onClick)="popup.open({ title: 'Hello', header: true })"></ax-button>
114
+ * ```
115
+ */
116
+ declare class AXPopupHostComponent extends NXComponent {
117
+ private popupService;
118
+ protected template: _angular_core.Signal<TemplateRef<any>>;
119
+ private ref;
120
+ /**
121
+ * Opens the projected content in a popup overlay.
122
+ */
123
+ open(options?: AXPopupConfig): Promise<AXPopupRef>;
124
+ /**
125
+ * Closes the currently open popup hosted by this component.
126
+ */
127
+ close(data?: unknown): Promise<void>;
128
+ /**
129
+ * Sets input values for the popup content component.
130
+ */
131
+ setInputs(values: AXComponentInputs): Promise<void>;
132
+ /**
133
+ * Minimizes the hosted popup.
134
+ */
135
+ minimize(): Promise<void>;
136
+ /**
137
+ * Maximizes the hosted popup.
138
+ */
139
+ maximize(): Promise<void>;
140
+ /**
141
+ * Restores the hosted popup.
142
+ */
143
+ restore(): Promise<void>;
144
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPopupHostComponent, never>;
145
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPopupHostComponent, "ax-popup-host", never, {}, {}, never, ["*"], true, never>;
59
146
  }
60
147
 
61
148
  /**
@@ -72,10 +159,11 @@ declare class AXPopupComponent extends MXBaseComponent implements OnInit, OnDest
72
159
  private _destroyRef;
73
160
  private contentContainerRef;
74
161
  private contentContainerEl;
75
- readonly __content__: i0.InputSignal<AXPopupContentType>;
76
- readonly __config__: i0.InputSignal<AXPopupConfig>;
77
- readonly __popupRef__: i0.InputSignal<AXPopupRef<any>>;
78
- readonly __id__: i0.InputSignal<number>;
162
+ private popupEl;
163
+ readonly __content__: _angular_core.InputSignal<AXPopupContentType>;
164
+ readonly __config__: _angular_core.InputSignal<AXPopupConfig>;
165
+ readonly __popupRef__: _angular_core.InputSignal<AXPopupRef<any>>;
166
+ readonly __id__: _angular_core.InputSignal<number>;
79
167
  /**
80
168
  * Indicates whether the component is loading.
81
169
  * @defaultValue true
@@ -86,11 +174,11 @@ declare class AXPopupComponent extends MXBaseComponent implements OnInit, OnDest
86
174
  /** @ignore */
87
175
  private _componentRef;
88
176
  /** Current title */
89
- protected title: i0.WritableSignal<string>;
177
+ protected title: _angular_core.WritableSignal<string>;
90
178
  /** @ignore */
91
- protected isDragging: i0.WritableSignal<boolean>;
179
+ protected isDragging: _angular_core.WritableSignal<boolean>;
92
180
  /** @ignore */
93
- protected dragOffset: i0.WritableSignal<{
181
+ protected dragOffset: _angular_core.WritableSignal<{
94
182
  x: number;
95
183
  y: number;
96
184
  }>;
@@ -98,6 +186,14 @@ declare class AXPopupComponent extends MXBaseComponent implements OnInit, OnDest
98
186
  private dragStartPos;
99
187
  /** @ignore */
100
188
  private elementStartPos;
189
+ protected popupSizeState: _angular_core.WritableSignal<"minimize" | "normal">;
190
+ protected fullScreenState: _angular_core.WritableSignal<boolean>;
191
+ protected minimizeLeft: _angular_core.WritableSignal<string>;
192
+ protected minimizeRight: _angular_core.WritableSignal<string>;
193
+ private fullscreenChangeHandler;
194
+ protected closeEnabled: () => boolean;
195
+ protected maximizeEnabled: () => boolean;
196
+ protected minimizeEnabled: () => boolean;
101
197
  /** @ignore */
102
198
  ngOnInit(): void;
103
199
  /**
@@ -123,30 +219,39 @@ declare class AXPopupComponent extends MXBaseComponent implements OnInit, OnDest
123
219
  focus(): void;
124
220
  /**
125
221
  * Closes the popup, emitting component reference, host element, and optional data.
126
- * @param {unknown} [data]
127
222
  */
128
223
  close(data?: unknown): void;
224
+ /**
225
+ * Minimizes the popup to the bottom bar.
226
+ */
227
+ minimize(): void;
228
+ /**
229
+ * Maximizes the popup using the Fullscreen API.
230
+ */
231
+ maximize(): void;
232
+ /**
233
+ * Restores the popup from minimized or fullscreen state.
234
+ */
235
+ restore(): void;
129
236
  /**
130
237
  * Sets inputs on the content component.
131
- * @param values - Object containing input values to set
132
238
  */
133
239
  setContentInputs(values: AXComponentInputs): void;
134
240
  /**
135
241
  * Sets the popup title.
136
- * @param title - The new title
137
242
  */
138
243
  setTitle(title: string): void;
139
244
  protected onDragStart(event: MouseEvent): void;
140
245
  onDragMove(event: MouseEvent): void;
141
246
  onDragEnd(): void;
142
- static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupComponent, never>;
143
- static ɵcmp: i0.ɵɵComponentDeclaration<AXPopupComponent, "ax-popup", never, { "__content__": { "alias": "__content__"; "required": false; "isSignal": true; }; "__config__": { "alias": "__config__"; "required": false; "isSignal": true; }; "__popupRef__": { "alias": "__popupRef__"; "required": false; "isSignal": true; }; "__id__": { "alias": "__id__"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
247
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPopupComponent, never>;
248
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXPopupComponent, "ax-popup", never, { "__content__": { "alias": "__content__"; "required": false; "isSignal": true; }; "__config__": { "alias": "__config__"; "required": false; "isSignal": true; }; "__popupRef__": { "alias": "__popupRef__"; "required": false; "isSignal": true; }; "__id__": { "alias": "__id__"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
144
249
  }
145
250
 
146
251
  declare class AXPopupModule {
147
- static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupModule, never>;
148
- static ɵmod: i0.ɵɵNgModuleDeclaration<AXPopupModule, never, [typeof i1.CommonModule, typeof i2.AXCommonModule, typeof i3.AXDecoratorModule, typeof i4.AXTranslationModule, typeof AXPopupComponent], [typeof AXPopupComponent]>;
149
- static ɵinj: i0.ɵɵInjectorDeclaration<AXPopupModule>;
252
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPopupModule, never>;
253
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXPopupModule, never, [typeof i1.CommonModule, typeof i2.AXCommonModule, typeof i3.AXDecoratorModule, typeof i4.AXTranslationModule, typeof AXPopupComponent, typeof AXPopupHostComponent, typeof AXPopupFooterComponent], [typeof AXPopupComponent, typeof AXPopupHostComponent, typeof AXPopupFooterComponent]>;
254
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXPopupModule>;
150
255
  }
151
256
 
152
257
  /**
@@ -165,39 +270,42 @@ declare class AXPopupService {
165
270
  * Open popup 2
166
271
  */
167
272
  open(content: AXPopupContentType, config?: AXPopupConfig): AXComponentClosedPromise;
273
+ /**
274
+ * Opens a popup and returns a mutable reference (for host components and advanced control).
275
+ */
276
+ openRef<TResult = any>(content: AXPopupContentType, config?: AXPopupConfig): Promise<AXPopupRef<TResult>>;
277
+ private mergeConfig;
168
278
  /**
169
279
  * Opens a popup with the specified content and configuration.
170
- * @param content - Component or template to display
171
- * @param config - Configuration options for the popup
172
- * @returns Promise<AXPopupRef> - Reference to the opened popup
173
280
  */
174
281
  private openInternal;
175
282
  /**
176
283
  * Closes a popup by its ID.
177
- * @param id - The popup ID to close
178
- * @param data - Optional data to pass to the close event
179
284
  */
180
285
  close<TResult = any>(id: number, data?: TResult): void;
181
286
  /**
182
287
  * Sets input values for a popup by its ID.
183
- * @param id - The popup ID
184
- * @param values - Object containing input values to set
185
288
  */
186
289
  setInputs(id: number, values: AXComponentInputs): void;
187
290
  /**
188
291
  * Sets the title for a popup by its ID.
189
- * @param id - The popup ID
190
- * @param title - The new title
191
292
  */
192
293
  setTitle(id: number, title: string): void;
294
+ minimize(id: number): void;
295
+ maximize(id: number): void;
296
+ restore(id: number): void;
297
+ /**
298
+ * Gets the index of a popup in the open stack (used for minimized bar positioning).
299
+ */
300
+ getMapIndexOf(targetKey: number): number;
193
301
  /**
194
302
  * Brings a popup to the front of all other overlays.
195
- * @param id - The popup ID to bring to front
196
303
  */
197
304
  bringToFront(id: number): void;
198
- static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupService, never>;
199
- static ɵprov: i0.ɵɵInjectableDeclaration<AXPopupService>;
305
+ private getPopupInstance;
306
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXPopupService, never>;
307
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXPopupService>;
200
308
  }
201
309
 
202
- export { AXPopupComponent, AXPopupComponentBase, AXPopupModule, AXPopupService };
203
- export type { AXPopupConfig, AXPopupContentType, AXPopupData, AXPopupRef, AXPopupSizeType };
310
+ export { AXPopupComponent, AXPopupComponentBase, AXPopupFooterComponent, AXPopupHostComponent, AXPopupModule, AXPopupService, resolvePopupCloseButton, resolvePopupMaximizable, resolvePopupMinimize };
311
+ export type { AXPopupButtonsConfig, AXPopupConfig, AXPopupContentType, AXPopupData, AXPopupMinimizePosition, AXPopupRef, AXPopupSizeType };
@@ -1,388 +0,0 @@
1
- import { AXComponent, NXComponent } from '@acorex/cdk/common';
2
- import * as i0 from '@angular/core';
3
- import { ViewEncapsulation, Component, inject, signal, ComponentRef, Injectable, viewChild, TemplateRef, NgModule, input, Directive } from '@angular/core';
4
- import { AXOverlayService } from '@acorex/cdk/overlay';
5
- import { cloneDeep, set } from 'lodash-es';
6
- import { Subject } from 'rxjs';
7
-
8
- class AXModalFooterComponent {
9
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: AXModalFooterComponent, isStandalone: true, selector: "ax-modal-footer", providers: [{ provide: AXComponent, useExisting: AXModalFooterComponent }], ngImport: i0, template: "<ng-content select=\"ax-modal-footer\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-suffix\"></ng-content>\n</ng-content>\n", styles: ["@layer components{ax-modal-footer{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2)}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], encapsulation: i0.ViewEncapsulation.None }); }
11
- }
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalFooterComponent, decorators: [{
13
- type: Component,
14
- args: [{ selector: 'ax-modal-footer', imports: [], encapsulation: ViewEncapsulation.None, providers: [{ provide: AXComponent, useExisting: AXModalFooterComponent }], template: "<ng-content select=\"ax-modal-footer\">\n <ng-content select=\"ax-prefix\"></ng-content>\n <ng-content select=\"ax-suffix\"></ng-content>\n</ng-content>\n", styles: ["@layer components{ax-modal-footer{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2)}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
15
- }] });
16
-
17
- class AXModalStateService {
18
- constructor() {
19
- this.modalList = new Map();
20
- this.overlayService = inject(AXOverlayService);
21
- this.modalOption = signal(null, /* @ts-ignore */
22
- ...(ngDevMode ? [{ debugName: "modalOption" }] : /* istanbul ignore next */ []));
23
- }
24
- /**
25
- * Opens a modal with the specified content and options.
26
- * @param content - Component, template, or HTML element to display
27
- * @param options - Configuration options for the modal
28
- * @returns Promise<AXModalRef> - Reference to the opened modal
29
- */
30
- async open(content, options) {
31
- this.modalOption.set(options);
32
- const randomId = Math.floor(Math.random() * 100000000000);
33
- const modalContentComp = (await import('./acorex-components-modal-modal-content.component-BpUsCI8D.mjs')).AXModalContentComponent;
34
- const onClose = new Subject();
35
- const returnRef = {
36
- close: (data) => {
37
- this.close(randomId, data);
38
- },
39
- setInputs: (values) => {
40
- this.setInputs(randomId, values);
41
- },
42
- minimize: () => {
43
- this.minimize(randomId);
44
- },
45
- maximize: () => {
46
- this.maximize(randomId);
47
- },
48
- restore: () => {
49
- this.restore(randomId);
50
- },
51
- bringToFront: () => {
52
- this.bringToFront(randomId);
53
- },
54
- onClose,
55
- };
56
- const finalInputs = { ...(cloneDeep(options?.inputs) ?? {}), ...{ __modal__: returnRef } };
57
- const finalOptions = set(cloneDeep(options) ?? {}, 'inputs', finalInputs);
58
- const ref = await this.overlayService.create(modalContentComp, {
59
- position: options?.position,
60
- backdrop: options?.backdrop,
61
- inputs: {
62
- __content__: content,
63
- inputs: {
64
- ...finalOptions?.inputs,
65
- },
66
- id: randomId,
67
- },
68
- });
69
- this.modalList.set(randomId, { overlay: ref, modal: returnRef });
70
- return returnRef;
71
- }
72
- /**
73
- * Closes a modal by its ID.
74
- * @param id - The modal ID to close
75
- * @param data - Optional data to pass to the close event
76
- */
77
- async close(id, data) {
78
- const ref = this.modalList.get(id);
79
- if (!ref)
80
- return;
81
- ref.modal.onClose.next(data);
82
- ref.overlay.dispose();
83
- this.modalList.delete(id);
84
- }
85
- /**
86
- * Sets input values for a modal by its ID.
87
- * @param id - The modal ID
88
- * @param values - Object containing input values to set
89
- */
90
- async setInputs(id, values) {
91
- const ref = this.modalList.get(id).overlay.instance;
92
- if (!ref)
93
- return;
94
- if (ref instanceof ComponentRef) {
95
- const comRef = ref;
96
- Object.entries(values).forEach((v) => {
97
- comRef.setInput(v[0], v[1]);
98
- });
99
- }
100
- else {
101
- ref.context.inputs.set(values);
102
- }
103
- }
104
- /**
105
- * Minimizes a modal by its ID.
106
- * @param id - The modal ID to minimize
107
- */
108
- async minimize(id) {
109
- const ref = this.modalList.get(id).overlay.instance;
110
- if (!ref)
111
- return;
112
- if (ref instanceof ComponentRef) {
113
- ref.instance.minimize();
114
- }
115
- else {
116
- ref.context.minimize();
117
- }
118
- }
119
- /**
120
- * Maximizes a modal by its ID.
121
- * @param id - The modal ID to maximize
122
- */
123
- async maximize(id) {
124
- const ref = this.modalList.get(id).overlay.instance;
125
- if (!ref)
126
- return;
127
- if (ref instanceof ComponentRef) {
128
- ref.instance.maximize();
129
- }
130
- else {
131
- ref.context.maximize();
132
- }
133
- }
134
- /**
135
- * Restores a modal by its ID.
136
- * @param id - The modal ID to restore
137
- */
138
- async restore(id) {
139
- const ref = this.modalList.get(id).overlay.instance;
140
- if (!ref)
141
- return;
142
- if (ref instanceof ComponentRef) {
143
- ref.instance.restore();
144
- }
145
- else {
146
- ref.context.restore();
147
- }
148
- }
149
- /**
150
- * Gets the index of a modal in the minimized stack.
151
- * @param targetKey - The modal ID to find
152
- * @returns number - The index position in the stack
153
- */
154
- getMapIndexOf(targetKey) {
155
- let index = 0;
156
- for (const key of this.modalList.keys()) {
157
- if (key === targetKey) {
158
- return index;
159
- }
160
- index++;
161
- }
162
- return -1;
163
- }
164
- /**
165
- * Brings a modal to the front of all other overlays.
166
- * @param id - The modal ID to bring to front
167
- */
168
- bringToFront(id) {
169
- const ref = this.modalList.get(id);
170
- if (!ref)
171
- return;
172
- ref.overlay.bringToFront();
173
- }
174
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
175
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalStateService, providedIn: 'root' }); }
176
- }
177
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalStateService, decorators: [{
178
- type: Injectable,
179
- args: [{
180
- providedIn: 'root',
181
- }]
182
- }] });
183
-
184
- class AXModalComponent extends NXComponent {
185
- constructor() {
186
- super(...arguments);
187
- this.service = inject(AXModalStateService);
188
- this.template = viewChild(TemplateRef, /* @ts-ignore */
189
- ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
190
- this.ref = signal(null, /* @ts-ignore */
191
- ...(ngDevMode ? [{ debugName: "ref" }] : /* istanbul ignore next */ []));
192
- }
193
- /**
194
- * Opens the modal with the specified options.
195
- * @param options - Configuration options for the modal
196
- * @returns Promise<AXModalRef> - Reference to the opened modal
197
- */
198
- async open(options) {
199
- const ref = await this.service.open(this.template(), options);
200
- this.ref.set(ref);
201
- return ref;
202
- }
203
- /**
204
- * Closes the currently open modal.
205
- */
206
- async close() {
207
- if (this.ref())
208
- return;
209
- this.ref().close();
210
- }
211
- /**
212
- * Sets input values for the modal content component.
213
- * @param values - Object containing input values to set
214
- */
215
- async setInputs(values) {
216
- if (!this.ref())
217
- return;
218
- const transform = { inputs: values };
219
- this.ref().setInputs(transform);
220
- }
221
- /**
222
- * Minimizes the modal to the bottom bar.
223
- */
224
- async minimize() {
225
- if (!this.ref())
226
- return;
227
- this.ref().minimize();
228
- }
229
- /**
230
- * Maximizes the modal to fullscreen.
231
- */
232
- async maximize() {
233
- if (!this.ref())
234
- return;
235
- this.ref().maximize();
236
- }
237
- /**
238
- * Restores the modal from minimized or maximized state.
239
- */
240
- async restore() {
241
- if (!this.ref())
242
- return;
243
- this.ref().restore();
244
- }
245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
246
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: AXModalComponent, isStandalone: true, selector: "ax-modal", providers: [{ provide: AXComponent, useExisting: AXModalComponent }], viewQueries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
247
- <ng-template #contentTemplate>
248
- <ng-content></ng-content>
249
- </ng-template>
250
- `, isInline: true, encapsulation: i0.ViewEncapsulation.None }); }
251
- }
252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalComponent, decorators: [{
253
- type: Component,
254
- args: [{
255
- selector: 'ax-modal',
256
- template: `
257
- <ng-template #contentTemplate>
258
- <ng-content></ng-content>
259
- </ng-template>
260
- `,
261
- encapsulation: ViewEncapsulation.None,
262
- providers: [{ provide: AXComponent, useExisting: AXModalComponent }],
263
- }]
264
- }], propDecorators: { template: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
265
-
266
- class AXModalModule {
267
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
268
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXModalModule, imports: [AXModalComponent, AXModalFooterComponent], exports: [AXModalComponent, AXModalFooterComponent] }); }
269
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalModule }); }
270
- }
271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalModule, decorators: [{
272
- type: NgModule,
273
- args: [{
274
- imports: [AXModalComponent, AXModalFooterComponent],
275
- exports: [AXModalComponent, AXModalFooterComponent],
276
- }]
277
- }] });
278
-
279
- class AXModalService {
280
- constructor() {
281
- this.stateService = inject(AXModalStateService);
282
- this.ref = signal(null, /* @ts-ignore */
283
- ...(ngDevMode ? [{ debugName: "ref" }] : /* istanbul ignore next */ []));
284
- }
285
- /**
286
- * Opens a modal with the specified content and options.
287
- * @param content - Component, template, or HTML element to display
288
- * @param options - Configuration options for the modal
289
- * @returns Promise<AXModalRef> - Reference to the opened modal
290
- */
291
- async open(content, options) {
292
- const ref = await this.stateService.open(content, options);
293
- this.ref.set(ref);
294
- return ref;
295
- }
296
- /**
297
- * Closes the currently open modal.
298
- */
299
- async close() {
300
- if (!this.ref())
301
- return;
302
- this.ref().close();
303
- }
304
- /**
305
- * Sets input values for the modal content component.
306
- * @param values - Object containing input values to set
307
- */
308
- async setInputs(values) {
309
- if (!this.ref())
310
- return;
311
- const transform = { inputs: values };
312
- this.ref().setInputs(transform);
313
- }
314
- /**
315
- * Minimizes the modal to the bottom bar.
316
- */
317
- async minimize() {
318
- if (!this.ref())
319
- return;
320
- this.ref().minimize();
321
- }
322
- /**
323
- * Maximizes the modal to fullscreen.
324
- */
325
- async maximize() {
326
- if (!this.ref())
327
- return;
328
- this.ref().maximize();
329
- }
330
- /**
331
- * Restores the modal from minimized or maximized state.
332
- */
333
- async restore() {
334
- if (!this.ref())
335
- return;
336
- this.ref().restore();
337
- }
338
- /**
339
- * Brings the modal to the front of all other overlays.
340
- */
341
- bringToFront() {
342
- if (!this.ref())
343
- return;
344
- this.ref().bringToFront();
345
- }
346
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
347
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalService, providedIn: 'root' }); }
348
- }
349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalService, decorators: [{
350
- type: Injectable,
351
- args: [{
352
- providedIn: 'root',
353
- }]
354
- }] });
355
-
356
- class AXModalComponentBase {
357
- constructor() {
358
- this.__modal__ = input(/* @ts-ignore */
359
- ...(ngDevMode ? [undefined, { debugName: "__modal__" }] : /* istanbul ignore next */ []));
360
- }
361
- close(data = null) {
362
- this.__modal__().close(data);
363
- }
364
- minimize() {
365
- this.__modal__().minimize();
366
- }
367
- restore() {
368
- this.__modal__().restore();
369
- }
370
- maximize() {
371
- this.__modal__().maximize();
372
- }
373
- bringToFront() {
374
- this.__modal__().bringToFront();
375
- }
376
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalComponentBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
377
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: AXModalComponentBase, isStandalone: true, inputs: { __modal__: { classPropertyName: "__modal__", publicName: "__modal__", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
378
- }
379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXModalComponentBase, decorators: [{
380
- type: Directive
381
- }], propDecorators: { __modal__: [{ type: i0.Input, args: [{ isSignal: true, alias: "__modal__", required: false }] }] } });
382
-
383
- /**
384
- * Generated bundle index. Do not edit.
385
- */
386
-
387
- export { AXModalStateService as A, AXModalFooterComponent as a, AXModalComponent as b, AXModalComponentBase as c, AXModalModule as d, AXModalService as e };
388
- //# sourceMappingURL=acorex-components-modal-acorex-components-modal-Djl-uo9b.mjs.map