@design-factory/angular 21.0.0-next.0 → 21.0.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.
package/README.md CHANGED
@@ -1,3 +1,63 @@
1
1
  <h1 align="center">Amadeus Design Factory Angular implementation</h1>
2
2
 
3
- TODO
3
+ ## Description
4
+
5
+ Design Factory Angular is the package containing the Angular components implementing the Amadeus Design System, Design Factory.
6
+
7
+ Design Factory is an InnerSource design system made of:
8
+
9
+ - A UI library for Amadeus external and internal interfaces and applications, based on our four pillars
10
+ - A set of design and coding best practices
11
+ - A cross-functional community from all Amadeus business units
12
+
13
+ If you want to get more information about Design Factory, please contact [Design Factory team](mailto:DesignFactory@amadeus.com).
14
+
15
+ ## Getting started
16
+
17
+ You can easily add Design Factory library in your project thanks our schematics.
18
+ Just run the following:
19
+
20
+ ```bash
21
+ ng add @design-factory/angular
22
+ ```
23
+
24
+ It will install Design Factory for the default application specified in your angular.json. If you have multiple projects and you want to target a specific application, you could specify the --project option
25
+
26
+ ```bash
27
+ ng add @design-factory/angular --project myProject
28
+ ```
29
+
30
+ ## Architecture
31
+
32
+ The Design Factory is composed of multiple projects and you can install the package that fits your requirements.
33
+
34
+ - `@design-factory/tokens` includes the Design Tokens that empower the Design System
35
+ - `@design-factory/styles` includes the styles, composed of utilities and component styles
36
+ - `@design-factory/design-factory` contains Angular components and utilities. They will be migrated to the following package
37
+ - `@design-factory/angular` contains the new SideNav and will grow to include all Design Factory Angular components
38
+
39
+ ### CSS namespace feature
40
+
41
+ For some specific cases, you may have to use the CSS namespace feature which allows you to apply DF styles only under a selector defined by $df-css-namespace-selector variable (by default ==.design-factory-v2==).
42
+ In order to use this feature, just import the following:
43
+
44
+ ```scss
45
+ @import '@design-factory/styles/scss/namespace';
46
+ ```
47
+
48
+ in your styles.scss and add the defined selector in your HTML element where you want to apply DF style.
49
+
50
+ ## Dependencies
51
+
52
+ The dependencies are [Angular](https://angular.io), [Bootstrap 5](https://getbootstrap.com), [Ng-bootstrap](https://ng-bootstrap.github.io), [AgnosUI](https://www.agnosui.dev), [Ng-select](https://ng-select.github.io/ng-select#/data-sources), [Ag-grid](https://www.ag-grid.com/) and [ngx-slider](https://angular-slider.github.io/ngx-slider/).
53
+ The supported versions are:
54
+
55
+ | Design Factory | Angular | Bootstrap CSS | Ng-Bootstrap | Ng-select | Ag-grid | AgnosUI |
56
+ | -------------- | ------- | ------------- | ------------ | --------- | ------- | ------- |
57
+ | 21.0.x | 21.x | 5.3.8 | 20.0.x | 21.x | 35.x | 0.10.x |
58
+
59
+ ## How to work with the icons
60
+
61
+ Icons are a mix of [Font Awesome](https://fontawesome.com/) (FW) and in-house produced pictograms.
62
+
63
+ Since DF 18.0.0 release in-house icons and FW icons are split into different fonts.
@@ -1,31 +1,26 @@
1
1
  import { createDrawer, createSimpleClassTransition, createNavManager, UseDirective, UseMultiDirective } from '@agnos-ui/angular-headless';
2
2
  import { fadeTransition } from '@agnos-ui/core-bootstrap';
3
- import { isPlatformBrowser } from '@angular/common';
4
3
  import * as i0 from '@angular/core';
5
- import { input, model, output, inject, PLATFORM_ID, booleanAttribute, linkedSignal, ChangeDetectionStrategy, Component } from '@angular/core';
6
- import { toSignal } from '@angular/core/rxjs-interop';
4
+ import { input, booleanAttribute, model, output, ChangeDetectionStrategy, Component } from '@angular/core';
7
5
  import { AgnosWidgetDirective, callWidgetFactory } from '@design-factory/angular/internals';
8
- import { DfMedia } from '@design-factory/design-factory';
9
6
 
10
7
  /**
11
- * Utility method to check if the user agent is a mobile device
12
- *
13
- * @param userAgent - The user agent string to check
14
- * @returns `true` if the user agent corresponds to a mobile device, `false` otherwise
8
+ * Enables users to show contextual content via a sliding panel from any screen edge.
9
+ * @experimental
15
10
  */
16
- function isMobileUserAgent(userAgent) {
17
- return /mobile|android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
18
- }
19
11
  class DfDrawerComponent extends AgnosWidgetDirective {
20
12
  constructor() {
21
13
  const widget = callWidgetFactory(createDrawer, {
22
14
  defaultConfig: {
23
- className: '',
24
- bodyScroll: true,
25
- backdrop: false,
15
+ className: 'inline-start',
16
+ bodyScroll: false,
17
+ backdrop: true,
26
18
  transition: createSimpleClassTransition({
27
19
  showClasses: ['show']
28
20
  }),
21
+ verticalTransition: createSimpleClassTransition({
22
+ showClasses: ['show']
23
+ }),
29
24
  backdropTransition: fadeTransition
30
25
  },
31
26
  events: {
@@ -59,13 +54,13 @@ class DfDrawerComponent extends AgnosWidgetDirective {
59
54
  *
60
55
  * @defaultValue `false`
61
56
  */
62
- this.bodyScroll = input(false, ...(ngDevMode ? [{ debugName: "bodyScroll" }] : []));
57
+ this.bodyScroll = input(false, { ...(ngDevMode ? { debugName: "bodyScroll" } : {}), transform: booleanAttribute });
63
58
  /**
64
59
  * If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable
65
60
  *
66
61
  * @defaultValue `true`
67
62
  */
68
- this.backdrop = input(true, ...(ngDevMode ? [{ debugName: "backdrop" }] : []));
63
+ this.backdrop = input(true, { ...(ngDevMode ? { debugName: "backdrop" } : {}), transform: booleanAttribute });
69
64
  /**
70
65
  * Which element should contain the drawer and backdrop DOM elements.
71
66
  * If it is not null, the drawer and backdrop DOM elements are moved to the specified container.
@@ -88,13 +83,20 @@ class DfDrawerComponent extends AgnosWidgetDirective {
88
83
  *
89
84
  * @defaultValue `false`
90
85
  */
91
- this.resizable = input(false, ...(ngDevMode ? [{ debugName: "resizable" }] : []));
86
+ this.resizable = input(false, { ...(ngDevMode ? { debugName: "resizable" } : {}), transform: booleanAttribute });
92
87
  /**
93
88
  * If `true`, the drawer is shown; otherwise, it is hidden.
94
89
  *
95
90
  * @defaultValue `false`
96
91
  */
97
- this.visible = input(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
92
+ this.visible = input(false, { ...(ngDevMode ? { debugName: "visible" } : {}), transform: booleanAttribute });
93
+ /**
94
+ * If `true`, the drawer element is kept in the DOM when it is not visible.
95
+ * This can be useful to preserve the state of the drawer content when it is hidden.
96
+ *
97
+ * @defaultValue `true`
98
+ */
99
+ this.keepInDom = input(true, { ...(ngDevMode ? { debugName: "keepInDom" } : {}), transform: booleanAttribute });
98
100
  /**
99
101
  * An event emitted when the width is changed.
100
102
  *
@@ -144,6 +146,12 @@ class DfDrawerComponent extends AgnosWidgetDirective {
144
146
  * ```
145
147
  */
146
148
  this.resizingChange = output();
149
+ /**
150
+ * If `true` focuses the drawer when it is opened.
151
+ *
152
+ * @defaultValue `true`
153
+ */
154
+ this.focusOnInit = input(true, { ...(ngDevMode ? { debugName: "focusOnInit" } : {}), transform: booleanAttribute });
147
155
  this.navManager = createNavManager();
148
156
  this.navManagerConfig = {
149
157
  keys: {
@@ -163,78 +171,57 @@ class DfDrawerComponent extends AgnosWidgetDirective {
163
171
  * @defaultValue `null`
164
172
  */
165
173
  this.maxSize = output();
166
- this.isSmallScreen = toSignal(inject(DfMedia).getObservable(['sm', 'xs']), { initialValue: false });
167
- this.isMediumScreen = toSignal(inject(DfMedia).getObservable(['md']), { initialValue: false });
168
- this.isLargeUpScreen = toSignal(inject(DfMedia).getObservable(['lg', 'xl', 'xxl', 'xxxl']), {
169
- initialValue: false
170
- });
171
- this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
172
- /**
173
- * Flag to enable mobile device detection for responsive behavior
174
- * @default true
175
- */
176
- this.enableMobile = input(true, { ...(ngDevMode ? { debugName: "enableMobile" } : {}), transform: booleanAttribute });
177
- /**
178
- * Flag to indicate if the drawer is minimized
179
- */
180
- this.isMinimized = linkedSignal(() => {
181
- // in mobile devices, the default value is true (hiding the drawer) and does not track changes to the screen size
182
- if (this.isMobileDevice) {
183
- return true;
184
- }
185
- // in desktop, we track the large screen signal in order to reset the minimized state
186
- // it allows resizing the window and have a more user-friendly behavior
187
- return !this.isLargeUpScreen();
188
- }, ...(ngDevMode ? [{ debugName: "isMinimized" }] : []));
189
- this.isMobileDevice = (() => {
190
- if (this.isBrowser) {
191
- return this.enableMobile() && isMobileUserAgent(navigator.userAgent);
192
- }
193
- else {
194
- // SSR: try to get request if available
195
- try {
196
- const request = inject(Request, { optional: true });
197
- if (request && 'headers' in request) {
198
- const userAgent = request.headers.get('user-agent') || '';
199
- return this.enableMobile() && isMobileUserAgent(userAgent);
200
- }
201
- }
202
- catch {
203
- // Request token not available or not in SSR context
204
- }
205
- return false;
206
- }
207
- })();
208
174
  }
209
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DfDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
210
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DfDrawerComponent, isStandalone: true, selector: "df-drawer", inputs: { className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, bodyScroll: { classPropertyName: "bodyScroll", publicName: "bodyScroll", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, enableMobile: { classPropertyName: "enableMobile", publicName: "enableMobile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { size: "sizeChange", sizeChange: "sizeChange", visibleChange: "visibleChange", minimizedChange: "minimizedChange", maximizedChange: "maximizedChange", resizingChange: "resizingChange", minSize: "minSize", maxSize: "maxSize" }, usesInheritance: true, ngImport: i0, template: `
211
- <div
212
- class="df-drawer d-flex"
213
- [class]="_agnosWidget.state.className()"
214
- [class.show]="_agnosWidget.state.visible()"
215
- [auUseMulti]="[_agnosWidget.directives.drawerPortalDirective, _agnosWidget.directives.drawerDirective]"
216
- [style.--df-drawer-size]="size() !== null ? size() + 'px' : ''"
217
- >
218
- <ng-content />
219
- @if (_agnosWidget.state.resizable()) {
220
- <div class="df-drawer-splitter" tabindex="-1" [auUse]="_agnosWidget.directives.splitterDirective">
221
- <button
222
- #splitterHandle
223
- class="btn btn-outline-primary df-btn-icononly df-drawer-splitter-handle"
224
- [class.df-btn-outline-neutral-mirror]="isMediumScreen() && !isMinimized()"
225
- i18n-aria-label="@@df.drawer.resize.ariaLabel"
226
- aria-label="Resize drawer"
227
- [auUse]="[navManager.directive, navManagerConfig]"
175
+ /**
176
+ * Trigger the opening of the drawer.
177
+ */
178
+ open() {
179
+ this._agnosWidget.api.open();
180
+ }
181
+ /**
182
+ * Trigger the closing of the drawer.
183
+ */
184
+ close() {
185
+ this._agnosWidget.api.close();
186
+ }
187
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: DfDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
188
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: DfDrawerComponent, isStandalone: true, selector: "df-drawer", inputs: { className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, bodyScroll: { classPropertyName: "bodyScroll", publicName: "bodyScroll", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, keepInDom: { classPropertyName: "keepInDom", publicName: "keepInDom", isSignal: true, isRequired: false, transformFunction: null }, focusOnInit: { classPropertyName: "focusOnInit", publicName: "focusOnInit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { size: "sizeChange", sizeChange: "sizeChange", visibleChange: "visibleChange", minimizedChange: "minimizedChange", maximizedChange: "maximizedChange", resizingChange: "resizingChange", minSize: "minSize", maxSize: "maxSize" }, usesInheritance: true, ngImport: i0, template: `
189
+ @if (!_agnosWidget.state.hidden() || keepInDom()) {
190
+ <div
191
+ class="df-drawer"
192
+ [class]="_agnosWidget.state.className()"
193
+ [class.show]="_agnosWidget.state.visible()"
194
+ [auUseMulti]="[_agnosWidget.directives.drawerPortalDirective, _agnosWidget.directives.drawerDirective]"
195
+ [style.--df-drawer-size]="size() !== null ? size() + 'px' : ''"
196
+ >
197
+ <ng-content />
198
+ @if (_agnosWidget.state.resizable()) {
199
+ <div
200
+ class="df-drawer-splitter"
201
+ tabindex="-1"
202
+ [auUse]="_agnosWidget.directives.splitterDirective"
203
+ [style.align-items]="!_agnosWidget.state.isVertical() ? 'center' : undefined"
204
+ [style.justify-content]="_agnosWidget.state.isVertical() ? 'center' : undefined"
228
205
  >
229
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 192 512" fill="currentColor">
230
- <path
231
- d="M16 32C7.2 32 0 39.2 0 48L0 464c0 8.8 7.2 16 16 16s16-7.2 16-16L32 48c0-8.8-7.2-16-16-16zm160 0c-8.8 0-16 7.2-16 16l0 416c0 8.8 7.2 16 16 16s16-7.2 16-16l0-416c0-8.8-7.2-16-16-16z"
232
- />
233
- </svg>
234
- </button>
235
- </div>
236
- }
237
- </div>
206
+ <ng-content select="df-drawer-splitter-content">
207
+ <button
208
+ #splitterHandle
209
+ class="btn df-btn-icononly df-btn-tertiary df-drawer-splitter-handle"
210
+ [class]="{
211
+ 'fa-grip-lines-vertical': !_agnosWidget.state.isVertical(),
212
+ 'fa-grip-lines': _agnosWidget.state.isVertical(),
213
+ 'df-btn-outline-neutral-mirror': !_agnosWidget.state.backdropHidden(),
214
+ 'btn-outline-primary': _agnosWidget.state.backdropHidden()
215
+ }"
216
+ i18n-aria-label="@@df.drawer.resize.ariaLabel"
217
+ aria-label="Resize drawer"
218
+ [auUse]="[navManager.directive, navManagerConfig]"
219
+ ></button>
220
+ </ng-content>
221
+ </div>
222
+ }
223
+ </div>
224
+ }
238
225
  @if (!_agnosWidget.state.backdropHidden()) {
239
226
  <div
240
227
  class="df-drawer-backdrop"
@@ -244,39 +231,48 @@ class DfDrawerComponent extends AgnosWidgetDirective {
244
231
  }
245
232
  `, isInline: true, dependencies: [{ kind: "directive", type: UseDirective, selector: "[auUse]", inputs: ["auUse"] }, { kind: "directive", type: UseMultiDirective, selector: "[auUseMulti]", inputs: ["auUseMulti"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
246
233
  }
247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DfDrawerComponent, decorators: [{
234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: DfDrawerComponent, decorators: [{
248
235
  type: Component,
249
236
  args: [{
250
237
  selector: 'df-drawer',
251
238
  imports: [UseDirective, UseMultiDirective],
252
239
  template: `
253
- <div
254
- class="df-drawer d-flex"
255
- [class]="_agnosWidget.state.className()"
256
- [class.show]="_agnosWidget.state.visible()"
257
- [auUseMulti]="[_agnosWidget.directives.drawerPortalDirective, _agnosWidget.directives.drawerDirective]"
258
- [style.--df-drawer-size]="size() !== null ? size() + 'px' : ''"
259
- >
260
- <ng-content />
261
- @if (_agnosWidget.state.resizable()) {
262
- <div class="df-drawer-splitter" tabindex="-1" [auUse]="_agnosWidget.directives.splitterDirective">
263
- <button
264
- #splitterHandle
265
- class="btn btn-outline-primary df-btn-icononly df-drawer-splitter-handle"
266
- [class.df-btn-outline-neutral-mirror]="isMediumScreen() && !isMinimized()"
267
- i18n-aria-label="@@df.drawer.resize.ariaLabel"
268
- aria-label="Resize drawer"
269
- [auUse]="[navManager.directive, navManagerConfig]"
240
+ @if (!_agnosWidget.state.hidden() || keepInDom()) {
241
+ <div
242
+ class="df-drawer"
243
+ [class]="_agnosWidget.state.className()"
244
+ [class.show]="_agnosWidget.state.visible()"
245
+ [auUseMulti]="[_agnosWidget.directives.drawerPortalDirective, _agnosWidget.directives.drawerDirective]"
246
+ [style.--df-drawer-size]="size() !== null ? size() + 'px' : ''"
247
+ >
248
+ <ng-content />
249
+ @if (_agnosWidget.state.resizable()) {
250
+ <div
251
+ class="df-drawer-splitter"
252
+ tabindex="-1"
253
+ [auUse]="_agnosWidget.directives.splitterDirective"
254
+ [style.align-items]="!_agnosWidget.state.isVertical() ? 'center' : undefined"
255
+ [style.justify-content]="_agnosWidget.state.isVertical() ? 'center' : undefined"
270
256
  >
271
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 192 512" fill="currentColor">
272
- <path
273
- d="M16 32C7.2 32 0 39.2 0 48L0 464c0 8.8 7.2 16 16 16s16-7.2 16-16L32 48c0-8.8-7.2-16-16-16zm160 0c-8.8 0-16 7.2-16 16l0 416c0 8.8 7.2 16 16 16s16-7.2 16-16l0-416c0-8.8-7.2-16-16-16z"
274
- />
275
- </svg>
276
- </button>
277
- </div>
278
- }
279
- </div>
257
+ <ng-content select="df-drawer-splitter-content">
258
+ <button
259
+ #splitterHandle
260
+ class="btn df-btn-icononly df-btn-tertiary df-drawer-splitter-handle"
261
+ [class]="{
262
+ 'fa-grip-lines-vertical': !_agnosWidget.state.isVertical(),
263
+ 'fa-grip-lines': _agnosWidget.state.isVertical(),
264
+ 'df-btn-outline-neutral-mirror': !_agnosWidget.state.backdropHidden(),
265
+ 'btn-outline-primary': _agnosWidget.state.backdropHidden()
266
+ }"
267
+ i18n-aria-label="@@df.drawer.resize.ariaLabel"
268
+ aria-label="Resize drawer"
269
+ [auUse]="[navManager.directive, navManagerConfig]"
270
+ ></button>
271
+ </ng-content>
272
+ </div>
273
+ }
274
+ </div>
275
+ }
280
276
  @if (!_agnosWidget.state.backdropHidden()) {
281
277
  <div
282
278
  class="df-drawer-backdrop"
@@ -287,7 +283,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
287
283
  `,
288
284
  changeDetection: ChangeDetectionStrategy.OnPush
289
285
  }]
290
- }], ctorParameters: () => [], propDecorators: { className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], bodyScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "bodyScroll", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }, { type: i0.Output, args: ["sizeChange"] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], sizeChange: [{ type: i0.Output, args: ["sizeChange"] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }], minimizedChange: [{ type: i0.Output, args: ["minimizedChange"] }], maximizedChange: [{ type: i0.Output, args: ["maximizedChange"] }], resizingChange: [{ type: i0.Output, args: ["resizingChange"] }], minSize: [{ type: i0.Output, args: ["minSize"] }], maxSize: [{ type: i0.Output, args: ["maxSize"] }], enableMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableMobile", required: false }] }] } });
286
+ }], ctorParameters: () => [], propDecorators: { className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], bodyScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "bodyScroll", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }, { type: i0.Output, args: ["sizeChange"] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], keepInDom: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepInDom", required: false }] }], sizeChange: [{ type: i0.Output, args: ["sizeChange"] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }], minimizedChange: [{ type: i0.Output, args: ["minimizedChange"] }], maximizedChange: [{ type: i0.Output, args: ["maximizedChange"] }], resizingChange: [{ type: i0.Output, args: ["resizingChange"] }], focusOnInit: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusOnInit", required: false }] }], minSize: [{ type: i0.Output, args: ["minSize"] }], maxSize: [{ type: i0.Output, args: ["maxSize"] }] } });
291
287
 
292
288
  /**
293
289
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"design-factory-angular-drawer.mjs","sources":["../../drawer/drawer.ts","../../drawer/design-factory-angular-drawer.ts"],"sourcesContent":["import type { DrawerWidget, NavManagerItemConfig } from '@agnos-ui/angular-headless';\nimport {\n createDrawer,\n createNavManager,\n createSimpleClassTransition,\n UseDirective,\n UseMultiDirective\n} from '@agnos-ui/angular-headless';\nimport { fadeTransition } from '@agnos-ui/core-bootstrap';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n linkedSignal,\n model,\n output,\n PLATFORM_ID\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { AgnosWidgetDirective, callWidgetFactory } from '@design-factory/angular/internals';\nimport { DfMedia } from '@design-factory/design-factory';\n\n/**\n * Utility method to check if the user agent is a mobile device\n *\n * @param userAgent - The user agent string to check\n * @returns `true` if the user agent corresponds to a mobile device, `false` otherwise\n */\nfunction isMobileUserAgent(userAgent: string): boolean {\n return /mobile|android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);\n}\n\n@Component({\n selector: 'df-drawer',\n imports: [UseDirective, UseMultiDirective],\n template: `\n <div\n class=\"df-drawer d-flex\"\n [class]=\"_agnosWidget.state.className()\"\n [class.show]=\"_agnosWidget.state.visible()\"\n [auUseMulti]=\"[_agnosWidget.directives.drawerPortalDirective, _agnosWidget.directives.drawerDirective]\"\n [style.--df-drawer-size]=\"size() !== null ? size() + 'px' : ''\"\n >\n <ng-content />\n @if (_agnosWidget.state.resizable()) {\n <div class=\"df-drawer-splitter\" tabindex=\"-1\" [auUse]=\"_agnosWidget.directives.splitterDirective\">\n <button\n #splitterHandle\n class=\"btn btn-outline-primary df-btn-icononly df-drawer-splitter-handle\"\n [class.df-btn-outline-neutral-mirror]=\"isMediumScreen() && !isMinimized()\"\n i18n-aria-label=\"@@df.drawer.resize.ariaLabel\"\n aria-label=\"Resize drawer\"\n [auUse]=\"[navManager.directive, navManagerConfig]\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 192 512\" fill=\"currentColor\">\n <path\n d=\"M16 32C7.2 32 0 39.2 0 48L0 464c0 8.8 7.2 16 16 16s16-7.2 16-16L32 48c0-8.8-7.2-16-16-16zm160 0c-8.8 0-16 7.2-16 16l0 416c0 8.8 7.2 16 16 16s16-7.2 16-16l0-416c0-8.8-7.2-16-16-16z\"\n />\n </svg>\n </button>\n </div>\n }\n </div>\n @if (!_agnosWidget.state.backdropHidden()) {\n <div\n class=\"df-drawer-backdrop\"\n [class.show]=\"_agnosWidget.state.visible()\"\n [auUseMulti]=\"[_agnosWidget.directives.backdropPortalDirective, _agnosWidget.directives.backdropDirective]\"\n ></div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DfDrawerComponent extends AgnosWidgetDirective<DrawerWidget> {\n /**\n * CSS classes to be applied on the widget main container\n *\n * @defaultValue ``\n */\n readonly className = input<string>('');\n /**\n * If `true` allows body scrolling when the drawer is open.\n *\n * @defaultValue `false`\n */\n readonly bodyScroll = input<boolean>(false);\n /**\n * If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable\n *\n * @defaultValue `true`\n */\n readonly backdrop = input<boolean>(true);\n /**\n * Which element should contain the drawer and backdrop DOM elements.\n * If it is not null, the drawer and backdrop DOM elements are moved to the specified container.\n * Otherwise, they stay where the widget is located.\n *\n * @defaultValue\n * ```ts\n * typeof window !== 'undefined' ? document.body : null\n * ```\n */\n readonly container = input<HTMLElement | null>(null);\n /**\n * The size of the drawer in pixels.\n *\n * @defaultValue `300`\n */\n readonly size = model<number | null>(300);\n /**\n * If `true`, the drawer can be resized by the user.\n *\n * @defaultValue `false`\n */\n readonly resizable = input<boolean>(false);\n /**\n * If `true`, the drawer is shown; otherwise, it is hidden.\n *\n * @defaultValue `false`\n */\n readonly visible = input<boolean>(false);\n\n /**\n * An event emitted when the width is changed.\n *\n * Event payload is equal to the newly selected width.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly sizeChange = output<number | null>();\n /**\n * Event to be triggered when the visible property changes.\n *\n * @param visible - new value of the visible propery\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly visibleChange = output<boolean>();\n\n /**\n * Event to be triggered when the minimized state changes.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly minimizedChange = output<boolean>();\n\n /**\n * Event to be triggered when the maximized state changes.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly maximizedChange = output<boolean>();\n\n /**\n * Event to be triggered when the user start or stop moving the drawer.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly resizingChange = output<boolean>();\n\n protected readonly navManager = createNavManager();\n\n protected readonly navManagerConfig: NavManagerItemConfig = {\n keys: {\n Home: this.navManager.focusFirst,\n End: this.navManager.focusLast\n }\n };\n\n /**\n * Event to be triggered when the minimum size is reached.\n *\n * @defaultValue `null`\n */\n readonly minSize = output<void>();\n\n /**\n * Event to be triggered when the maximum size is reached.\n *\n * @defaultValue `null`\n */\n readonly maxSize = output<void>();\n\n protected readonly isSmallScreen = toSignal(inject(DfMedia).getObservable(['sm', 'xs']), { initialValue: false });\n protected readonly isMediumScreen = toSignal(inject(DfMedia).getObservable(['md']), { initialValue: false });\n protected readonly isLargeUpScreen = toSignal(inject(DfMedia).getObservable(['lg', 'xl', 'xxl', 'xxxl']), {\n initialValue: false\n });\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /**\n * Flag to enable mobile device detection for responsive behavior\n * @default true\n */\n readonly enableMobile = input(true, { transform: booleanAttribute });\n\n /**\n * Flag to indicate if the drawer is minimized\n */\n readonly isMinimized = linkedSignal(() => {\n // in mobile devices, the default value is true (hiding the drawer) and does not track changes to the screen size\n if (this.isMobileDevice) {\n return true;\n }\n // in desktop, we track the large screen signal in order to reset the minimized state\n // it allows resizing the window and have a more user-friendly behavior\n return !this.isLargeUpScreen();\n });\n\n protected readonly isMobileDevice = (() => {\n if (this.isBrowser) {\n return this.enableMobile() && isMobileUserAgent(navigator.userAgent);\n } else {\n // SSR: try to get request if available\n try {\n const request = inject(Request, { optional: true });\n if (request && 'headers' in request) {\n const userAgent = request.headers.get('user-agent') || '';\n return this.enableMobile() && isMobileUserAgent(userAgent);\n }\n } catch {\n // Request token not available or not in SSR context\n }\n return false;\n }\n })();\n\n constructor() {\n const widget = callWidgetFactory(createDrawer, {\n defaultConfig: {\n className: '',\n bodyScroll: true,\n backdrop: false,\n transition: createSimpleClassTransition({\n showClasses: ['show']\n }),\n backdropTransition: fadeTransition\n },\n events: {\n onSizeChange: (size) => {\n this.size.set(size);\n this.sizeChange.emit(size);\n },\n onVisibleChange: (visible) => {\n this.visibleChange.emit(visible);\n },\n onMinimizedChange: (isMinimized) => {\n this.minimizedChange.emit(isMinimized);\n },\n onMaximizedChange: (isMaximized) => {\n this.maximizedChange.emit(isMaximized);\n },\n onResizingChange: (isResizing) => {\n this.resizingChange.emit(isResizing);\n }\n }\n });\n super(widget);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"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EAAE,iBAAiB,CAAC;AAC1C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC;AAC1C,iBAAA;;;AC3ED;;AAEG;;;;"}
1
+ {"version":3,"file":"design-factory-angular-drawer.mjs","sources":["../../drawer/drawer.ts","../../drawer/design-factory-angular-drawer.ts"],"sourcesContent":["import type { DrawerWidget, NavManagerItemConfig } from '@agnos-ui/angular-headless';\nimport {\n createDrawer,\n createNavManager,\n createSimpleClassTransition,\n UseDirective,\n UseMultiDirective\n} from '@agnos-ui/angular-headless';\nimport { fadeTransition } from '@agnos-ui/core-bootstrap';\nimport { booleanAttribute, ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';\nimport { AgnosWidgetDirective, callWidgetFactory } from '@design-factory/angular/internals';\n\n/**\n * Possible values for the drawer positions.\n */\nexport type DrawerPositions = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';\n\n/**\n * Enables users to show contextual content via a sliding panel from any screen edge.\n * @experimental\n */\n@Component({\n selector: 'df-drawer',\n imports: [UseDirective, UseMultiDirective],\n template: `\n @if (!_agnosWidget.state.hidden() || keepInDom()) {\n <div\n class=\"df-drawer\"\n [class]=\"_agnosWidget.state.className()\"\n [class.show]=\"_agnosWidget.state.visible()\"\n [auUseMulti]=\"[_agnosWidget.directives.drawerPortalDirective, _agnosWidget.directives.drawerDirective]\"\n [style.--df-drawer-size]=\"size() !== null ? size() + 'px' : ''\"\n >\n <ng-content />\n @if (_agnosWidget.state.resizable()) {\n <div\n class=\"df-drawer-splitter\"\n tabindex=\"-1\"\n [auUse]=\"_agnosWidget.directives.splitterDirective\"\n [style.align-items]=\"!_agnosWidget.state.isVertical() ? 'center' : undefined\"\n [style.justify-content]=\"_agnosWidget.state.isVertical() ? 'center' : undefined\"\n >\n <ng-content select=\"df-drawer-splitter-content\">\n <button\n #splitterHandle\n class=\"btn df-btn-icononly df-btn-tertiary df-drawer-splitter-handle\"\n [class]=\"{\n 'fa-grip-lines-vertical': !_agnosWidget.state.isVertical(),\n 'fa-grip-lines': _agnosWidget.state.isVertical(),\n 'df-btn-outline-neutral-mirror': !_agnosWidget.state.backdropHidden(),\n 'btn-outline-primary': _agnosWidget.state.backdropHidden()\n }\"\n i18n-aria-label=\"@@df.drawer.resize.ariaLabel\"\n aria-label=\"Resize drawer\"\n [auUse]=\"[navManager.directive, navManagerConfig]\"\n ></button>\n </ng-content>\n </div>\n }\n </div>\n }\n @if (!_agnosWidget.state.backdropHidden()) {\n <div\n class=\"df-drawer-backdrop\"\n [class.show]=\"_agnosWidget.state.visible()\"\n [auUseMulti]=\"[_agnosWidget.directives.backdropPortalDirective, _agnosWidget.directives.backdropDirective]\"\n ></div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DfDrawerComponent extends AgnosWidgetDirective<DrawerWidget> {\n /**\n * CSS classes to be applied on the widget main container\n *\n * @defaultValue ``\n */\n readonly className = input<string>('');\n /**\n * If `true` allows body scrolling when the drawer is open.\n *\n * @defaultValue `false`\n */\n readonly bodyScroll = input(false, { transform: booleanAttribute });\n /**\n * If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable\n *\n * @defaultValue `true`\n */\n readonly backdrop = input(true, { transform: booleanAttribute });\n /**\n * Which element should contain the drawer and backdrop DOM elements.\n * If it is not null, the drawer and backdrop DOM elements are moved to the specified container.\n * Otherwise, they stay where the widget is located.\n *\n * @defaultValue\n * ```ts\n * typeof window !== 'undefined' ? document.body : null\n * ```\n */\n readonly container = input<HTMLElement | null>(null);\n /**\n * The size of the drawer in pixels.\n *\n * @defaultValue `300`\n */\n readonly size = model<number | null>(300);\n /**\n * If `true`, the drawer can be resized by the user.\n *\n * @defaultValue `false`\n */\n readonly resizable = input(false, { transform: booleanAttribute });\n /**\n * If `true`, the drawer is shown; otherwise, it is hidden.\n *\n * @defaultValue `false`\n */\n readonly visible = input(false, { transform: booleanAttribute });\n\n /**\n * If `true`, the drawer element is kept in the DOM when it is not visible.\n * This can be useful to preserve the state of the drawer content when it is hidden.\n *\n * @defaultValue `true`\n */\n readonly keepInDom = input(true, { transform: booleanAttribute });\n\n /**\n * An event emitted when the width is changed.\n *\n * Event payload is equal to the newly selected width.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly sizeChange = output<number | null>();\n /**\n * Event to be triggered when the visible property changes.\n *\n * @param visible - new value of the visible propery\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly visibleChange = output<boolean>();\n\n /**\n * Event to be triggered when the minimized state changes.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly minimizedChange = output<boolean>();\n\n /**\n * Event to be triggered when the maximized state changes.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly maximizedChange = output<boolean>();\n\n /**\n * Event to be triggered when the user start or stop moving the drawer.\n *\n * @defaultValue\n * ```ts\n * () => {}\n * ```\n */\n readonly resizingChange = output<boolean>();\n\n /**\n * If `true` focuses the drawer when it is opened.\n *\n * @defaultValue `true`\n */\n readonly focusOnInit = input(true, { transform: booleanAttribute });\n\n protected readonly navManager = createNavManager();\n\n protected readonly navManagerConfig: NavManagerItemConfig = {\n keys: {\n Home: this.navManager.focusFirst,\n End: this.navManager.focusLast\n }\n };\n\n /**\n * Event to be triggered when the minimum size is reached.\n *\n * @defaultValue `null`\n */\n readonly minSize = output<void>();\n\n /**\n * Event to be triggered when the maximum size is reached.\n *\n * @defaultValue `null`\n */\n readonly maxSize = output<void>();\n\n constructor() {\n const widget = callWidgetFactory(createDrawer, {\n defaultConfig: {\n className: 'inline-start',\n bodyScroll: false,\n backdrop: true,\n transition: createSimpleClassTransition({\n showClasses: ['show']\n }),\n verticalTransition: createSimpleClassTransition({\n showClasses: ['show']\n }),\n backdropTransition: fadeTransition\n },\n events: {\n onSizeChange: (size) => {\n this.size.set(size);\n this.sizeChange.emit(size);\n },\n onVisibleChange: (visible) => {\n this.visibleChange.emit(visible);\n },\n onMinimizedChange: (isMinimized) => {\n this.minimizedChange.emit(isMinimized);\n },\n onMaximizedChange: (isMaximized) => {\n this.maximizedChange.emit(isMaximized);\n },\n onResizingChange: (isResizing) => {\n this.resizingChange.emit(isResizing);\n }\n }\n });\n super(widget);\n }\n\n /**\n * Trigger the opening of the drawer.\n */\n public open(): void {\n this._agnosWidget.api.open();\n }\n\n /**\n * Trigger the closing of the drawer.\n */\n public close(): void {\n this._agnosWidget.api.close();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAiBA;;;AAGG;AAmDG,MAAO,iBAAkB,SAAQ,oBAAkC,CAAA;AA4IvE,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,MAAM,GAAG,iBAAiB,CAAC,YAAY,EAAE;AAC7C,YAAA,aAAa,EAAE;AACb,gBAAA,SAAS,EAAE,cAAc;AACzB,gBAAA,UAAU,EAAE,KAAK;AACjB,gBAAA,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,2BAA2B,CAAC;oBACtC,WAAW,EAAE,CAAC,MAAM;iBACrB,CAAC;gBACF,kBAAkB,EAAE,2BAA2B,CAAC;oBAC9C,WAAW,EAAE,CAAC,MAAM;iBACrB,CAAC;AACF,gBAAA,kBAAkB,EAAE;AACrB,aAAA;AACD,YAAA,MAAM,EAAE;AACN,gBAAA,YAAY,EAAE,CAAC,IAAI,KAAI;AACrB,oBAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;AACnB,oBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC5B,CAAC;AACD,gBAAA,eAAe,EAAE,CAAC,OAAO,KAAI;AAC3B,oBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC;gBAClC,CAAC;AACD,gBAAA,iBAAiB,EAAE,CAAC,WAAW,KAAI;AACjC,oBAAA,IA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EAAA,OAAA,EAAA,EAAA,IAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,aAAA,EAAA,eAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EA/ClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CT,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EA7CS,YAAY,uEAAE,iBAAiB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAgD9B,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAlD7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;AAC1C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC;AAC1C,iBAAA;;;ACtED;;AAEG;;;;"}
@@ -96,10 +96,10 @@ class AgnosWidgetDirective {
96
96
  ngAfterContentChecked() {
97
97
  this._agnosWidget.updateSlots();
98
98
  }
99
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AgnosWidgetDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
100
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: AgnosWidgetDirective, isStandalone: true, usesOnChanges: true, ngImport: i0 }); }
99
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: AgnosWidgetDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
100
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: AgnosWidgetDirective, isStandalone: true, usesOnChanges: true, ngImport: i0 }); }
101
101
  }
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AgnosWidgetDirective, decorators: [{
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: AgnosWidgetDirective, decorators: [{
103
103
  type: Directive
104
104
  }], ctorParameters: () => [{ type: undefined }] });
105
105