nw-style-guide 19.2.0-beta.2 → 19.2.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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-animations.mjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-autofocus.mjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-carousel.mjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-charts.mjs"
3
+ }
@@ -0,0 +1,21 @@
1
+ import { QueryList, AfterContentInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
2
+ import { DropdownService } from "./dropdown.service";
3
+ import { DropdownDirective } from "./dropdown.directive";
4
+ import * as i0 from "@angular/core";
5
+ export declare class DropdownMenuDirective implements AfterContentInit, OnDestroy {
6
+ private _service;
7
+ private _element;
8
+ private _cdRef;
9
+ nestedDropdowns: QueryList<DropdownDirective>;
10
+ private _destroyed$;
11
+ constructor(_service: DropdownService, _element: ElementRef<HTMLElement>, _cdRef: ChangeDetectorRef);
12
+ ngAfterContentInit(): void;
13
+ private _subscribeToScrollPosition;
14
+ private _scrollToActiveElement;
15
+ private _subscribeToChildrenVisbilityToggle;
16
+ onClick(event: MouseEvent): void;
17
+ private _shouldCloseOnMenuClick;
18
+ ngOnDestroy(): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownMenuDirective, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownMenuDirective, "[nwDropdownMenu]", ["nw-dropdown-menu"], {}, {}, ["nestedDropdowns"], never, false, never>;
21
+ }
@@ -0,0 +1,24 @@
1
+ import { OnInit, ElementRef, ChangeDetectorRef, OnDestroy } from '@angular/core';
2
+ import { DropdownService } from "./dropdown.service";
3
+ import * as i0 from "@angular/core";
4
+ export declare class DropdownToggleDirective implements OnInit, OnDestroy {
5
+ private _service;
6
+ private _elRef;
7
+ private _cdRef;
8
+ nwTrigger: "click" | "hover";
9
+ breakpoint: number;
10
+ isOpen: boolean;
11
+ private _isMousingOver;
12
+ private _mouseEventSubscriptions;
13
+ private _toggleSub$;
14
+ constructor(_service: DropdownService, _elRef: ElementRef, _cdRef: ChangeDetectorRef);
15
+ ngOnInit(): void;
16
+ private _isMobileScreenSize;
17
+ private _subscribeToToggle;
18
+ private _open;
19
+ private _close;
20
+ toggle(event: MouseEvent): void;
21
+ ngOnDestroy(): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownToggleDirective, never>;
23
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownToggleDirective, "[nwDropdownToggle]", ["nw-dropdown-toggle"], { "nwTrigger": { "alias": "nwTrigger"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; }, {}, never, never, false, never>;
24
+ }
@@ -0,0 +1,31 @@
1
+ import { OnDestroy, OnInit, OnChanges, SimpleChanges, ElementRef, EventEmitter, NgZone, Renderer2, ChangeDetectorRef } from '@angular/core';
2
+ import { DropdownService } from "./dropdown.service";
3
+ import * as i0 from "@angular/core";
4
+ export declare class DropdownDirective implements OnInit, OnChanges, OnDestroy {
5
+ private _service;
6
+ private _elRef;
7
+ private _zone;
8
+ private _renderer;
9
+ private _cdRef;
10
+ autoClose: boolean | "inside" | "outside";
11
+ elementsToIgnore: HTMLElement[];
12
+ selectorsToIgnore: string[];
13
+ disabled: boolean;
14
+ opened: EventEmitter<null>;
15
+ closed: EventEmitter<null>;
16
+ isOpen: boolean;
17
+ private _toggleSubscription;
18
+ private _documentUnlistener;
19
+ private _escapeUnlistener;
20
+ constructor(_service: DropdownService, _elRef: ElementRef, _zone: NgZone, _renderer: Renderer2, _cdRef: ChangeDetectorRef);
21
+ ngOnInit(): void;
22
+ ngOnChanges(changes: SimpleChanges): void;
23
+ open(): void;
24
+ close(): void;
25
+ private _subscribeToToggle;
26
+ onDocumentClick(event: MouseEvent): void;
27
+ onEscape(event: KeyboardEvent): void;
28
+ ngOnDestroy(): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownDirective, never>;
30
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownDirective, "[nwDropdown]", ["nw-dropdown"], { "autoClose": { "alias": "autoClose"; "required": false; }; "elementsToIgnore": { "alias": "elementsToIgnore"; "required": false; }; "selectorsToIgnore": { "alias": "selectorsToIgnore"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; }, never, never, false, never>;
31
+ }
@@ -0,0 +1,14 @@
1
+ import { Observable } from "rxjs";
2
+ import * as i0 from "@angular/core";
3
+ export declare class DropdownService {
4
+ private _toggle$;
5
+ toggle$: Observable<boolean>;
6
+ autoClose: boolean | "inside" | "outside";
7
+ toggle(): void;
8
+ open(): void;
9
+ close(): void;
10
+ isHTMLElementContainedIn(element: HTMLElement, containers: HTMLElement[]): boolean;
11
+ isHTMLElementInPath(event: any, selectors: string[]): boolean;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<DropdownService>;
14
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./dropdown.directive";
3
+ import * as i2 from "./dropdown-toggle.directive";
4
+ import * as i3 from "./dropdown-menu.directive";
5
+ import * as i4 from "@angular/common";
6
+ export declare class DropdownsModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownsModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DropdownsModule, [typeof i1.DropdownDirective, typeof i2.DropdownToggleDirective, typeof i3.DropdownMenuDirective], [typeof i4.CommonModule], [typeof i1.DropdownDirective, typeof i2.DropdownToggleDirective, typeof i3.DropdownMenuDirective]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<DropdownsModule>;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="nw-style-guide/dropdowns" />
5
+ export * from './public-api';
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-dropdowns.mjs"
3
+ }
@@ -0,0 +1,4 @@
1
+ export { DropdownsModule } from './dropdowns.module';
2
+ export { DropdownDirective } from './dropdown.directive';
3
+ export { DropdownToggleDirective } from './dropdown-toggle.directive';
4
+ export { DropdownMenuDirective } from './dropdown-menu.directive';
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-email-input.mjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-feature-alerts.mjs"
3
+ }
@@ -0,0 +1,335 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, HostBinding, Output, Input, Directive, HostListener, ContentChildren, NgModule } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+ import { BehaviorSubject, distinctUntilChanged, skip, fromEvent, Subject, merge } from 'rxjs';
5
+ import { filter, tap, debounceTime, takeUntil, map } from 'rxjs/operators';
6
+
7
+ class DropdownService {
8
+ constructor() {
9
+ this._toggle$ = new BehaviorSubject(false);
10
+ this.toggle$ = this._toggle$.asObservable().pipe(distinctUntilChanged(), skip(1));
11
+ }
12
+ toggle() {
13
+ this._toggle$.next(!this._toggle$.value);
14
+ }
15
+ open() {
16
+ this._toggle$.next(true);
17
+ }
18
+ close() {
19
+ this._toggle$.next(false);
20
+ }
21
+ isHTMLElementContainedIn(element, containers) {
22
+ return containers
23
+ // Filter out falsey elements
24
+ .filter(el => el)
25
+ .some(item => item.contains(element));
26
+ }
27
+ isHTMLElementInPath(event, selectors) {
28
+ // Obtain the path from the event source to the document root
29
+ const path = (event.path || (event.composedPath && event.composedPath()));
30
+ return path
31
+ // Map to parentNode so we can use querySelector
32
+ .map(el => el.parentNode)
33
+ // Filter out undefined parent nodes
34
+ .filter(p => p)
35
+ // Check if any of the parentNodes match any of the selectors
36
+ .some(p => selectors.some(s => Boolean(p.querySelector(s))));
37
+ }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
39
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownService }); }
40
+ }
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownService, decorators: [{
42
+ type: Injectable
43
+ }] });
44
+
45
+ class DropdownDirective {
46
+ constructor(_service, _elRef, _zone, _renderer, _cdRef) {
47
+ this._service = _service;
48
+ this._elRef = _elRef;
49
+ this._zone = _zone;
50
+ this._renderer = _renderer;
51
+ this._cdRef = _cdRef;
52
+ this.autoClose = true;
53
+ this.elementsToIgnore = [];
54
+ this.selectorsToIgnore = [];
55
+ this.disabled = false;
56
+ this.opened = new EventEmitter();
57
+ this.closed = new EventEmitter();
58
+ }
59
+ ngOnInit() {
60
+ this._service.autoClose = this.autoClose;
61
+ this._subscribeToToggle();
62
+ // For performance reasons, bind to document click outside the zone
63
+ this._zone.runOutsideAngular(() => {
64
+ // Store a reference to the "unlisten" functions returned from these methods
65
+ // https://angular.io/api/core/Renderer2#listen
66
+ this._documentUnlistener = this._renderer.listen('document', 'click', this.onDocumentClick.bind(this));
67
+ this._escapeUnlistener = this._renderer.listen('document', 'keydown.escape', this.onEscape.bind(this));
68
+ });
69
+ }
70
+ ngOnChanges(changes) {
71
+ // autoClose is essentially an optional input. What this means is that if you don't pass a
72
+ // value to the `autoClose` input the "if" check below will never evaluate to true. This
73
+ // is why we don't just rely on ngOnChanges to set the value in the service, we also use
74
+ // ngOnInit to set the initial value, with subsequent input changes handled below
75
+ if (changes.autoClose && !changes.autoClose.firstChange) {
76
+ this._service.autoClose = this.autoClose;
77
+ }
78
+ }
79
+ open() {
80
+ this._service.open();
81
+ }
82
+ close() {
83
+ this._service.close();
84
+ }
85
+ _subscribeToToggle() {
86
+ this._toggleSubscription = this._service.toggle$
87
+ /**
88
+ * If the dropdown is disabled, only allow close events through
89
+ */
90
+ .pipe(filter(isOpen => {
91
+ if (this.disabled) {
92
+ return !isOpen;
93
+ }
94
+ return true;
95
+ }))
96
+ .subscribe(isOpen => {
97
+ this.isOpen = isOpen;
98
+ if (this.isOpen) {
99
+ this.opened.emit();
100
+ }
101
+ else {
102
+ this.closed.emit();
103
+ }
104
+ });
105
+ }
106
+ onDocumentClick(event) {
107
+ const shouldClose = (this.autoClose === true || this.autoClose === 'outside') && this.isOpen;
108
+ // Don't bother evaluating the source of the event if `shouldClose` is false
109
+ if (shouldClose) {
110
+ const target = event.target;
111
+ const containers = [this._elRef.nativeElement].concat(this.elementsToIgnore);
112
+ const isEventSourceFromWithinDropdown = this._service.isHTMLElementContainedIn(target, containers) && !target.classList.contains('dropdown-backdrop');
113
+ const isEventSourceFromWithinSelectors = this.selectorsToIgnore.length ?
114
+ this._service.isHTMLElementInPath(event, this.selectorsToIgnore) :
115
+ false;
116
+ if (!isEventSourceFromWithinDropdown && !isEventSourceFromWithinSelectors) {
117
+ this._zone.run(() => {
118
+ this._service.close();
119
+ this._cdRef.detectChanges();
120
+ });
121
+ }
122
+ }
123
+ }
124
+ onEscape(event) {
125
+ if (this.isOpen) {
126
+ this._zone.run(() => {
127
+ this._service.close();
128
+ this._cdRef.detectChanges();
129
+ });
130
+ }
131
+ }
132
+ ngOnDestroy() {
133
+ this._toggleSubscription.unsubscribe();
134
+ if (this._documentUnlistener) {
135
+ this._zone.runOutsideAngular(() => this._documentUnlistener());
136
+ }
137
+ if (this._escapeUnlistener) {
138
+ this._zone.runOutsideAngular(() => this._escapeUnlistener());
139
+ }
140
+ }
141
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownDirective, deps: [{ token: DropdownService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
142
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: DropdownDirective, isStandalone: false, selector: "[nwDropdown]", inputs: { autoClose: "autoClose", elementsToIgnore: "elementsToIgnore", selectorsToIgnore: "selectorsToIgnore", disabled: "disabled" }, outputs: { opened: "opened", closed: "closed" }, host: { properties: { "class.disabled": "this.disabled", "class.open": "this.isOpen" } }, providers: [DropdownService], exportAs: ["nw-dropdown"], usesOnChanges: true, ngImport: i0 }); }
143
+ }
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownDirective, decorators: [{
145
+ type: Directive,
146
+ args: [{
147
+ selector: '[nwDropdown]',
148
+ exportAs: 'nw-dropdown',
149
+ providers: [DropdownService],
150
+ standalone: false
151
+ }]
152
+ }], ctorParameters: () => [{ type: DropdownService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { autoClose: [{
153
+ type: Input
154
+ }], elementsToIgnore: [{
155
+ type: Input
156
+ }], selectorsToIgnore: [{
157
+ type: Input
158
+ }], disabled: [{
159
+ type: HostBinding,
160
+ args: ['class.disabled']
161
+ }, {
162
+ type: Input
163
+ }], opened: [{
164
+ type: Output
165
+ }], closed: [{
166
+ type: Output
167
+ }], isOpen: [{
168
+ type: HostBinding,
169
+ args: ['class.open']
170
+ }] } });
171
+
172
+ class DropdownToggleDirective {
173
+ constructor(_service, _elRef, _cdRef) {
174
+ this._service = _service;
175
+ this._elRef = _elRef;
176
+ this._cdRef = _cdRef;
177
+ this.nwTrigger = "click";
178
+ this.breakpoint = 767;
179
+ this.isOpen = false;
180
+ this._isMousingOver = false;
181
+ this._mouseEventSubscriptions = [];
182
+ }
183
+ ngOnInit() {
184
+ this._subscribeToToggle();
185
+ if (this.nwTrigger === 'hover') {
186
+ const mouseEnterSub = fromEvent(this._elRef.nativeElement, 'mouseenter')
187
+ .pipe(filter(_ => !this._isMobileScreenSize()), tap(_ => this._isMousingOver = true), debounceTime(300), filter(_ => this._isMousingOver))
188
+ .subscribe(event => this._open());
189
+ const mouseLeaveSub = fromEvent(this._elRef.nativeElement, 'mouseleave')
190
+ .pipe(filter(_ => !this._isMobileScreenSize()), tap(_ => this._isMousingOver = false), debounceTime(300), filter(_ => !this._isMousingOver))
191
+ .subscribe(event => this._close());
192
+ this._mouseEventSubscriptions = [mouseEnterSub, mouseLeaveSub];
193
+ }
194
+ }
195
+ _isMobileScreenSize() {
196
+ return window.innerWidth < this.breakpoint;
197
+ }
198
+ _subscribeToToggle() {
199
+ this._toggleSub$ = this._service.toggle$.subscribe(isOpen => {
200
+ this.isOpen = isOpen;
201
+ });
202
+ }
203
+ _open() {
204
+ this._isMousingOver = true;
205
+ this._service.open();
206
+ this._cdRef.detectChanges();
207
+ }
208
+ _close() {
209
+ this._isMousingOver = false;
210
+ this._service.close();
211
+ this._cdRef.detectChanges();
212
+ }
213
+ toggle(event) {
214
+ this._service.toggle();
215
+ if (this.nwTrigger === 'hover') {
216
+ event.stopImmediatePropagation();
217
+ }
218
+ }
219
+ ngOnDestroy() {
220
+ this._mouseEventSubscriptions.forEach(mes => mes.unsubscribe());
221
+ this._toggleSub$.unsubscribe();
222
+ }
223
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownToggleDirective, deps: [{ token: DropdownService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
224
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: DropdownToggleDirective, isStandalone: false, selector: "[nwDropdownToggle]", inputs: { nwTrigger: "nwTrigger", breakpoint: "breakpoint" }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "click": "toggle($event)" }, properties: { "attr.aria-expanded": "isOpen" } }, exportAs: ["nw-dropdown-toggle"], ngImport: i0 }); }
225
+ }
226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownToggleDirective, decorators: [{
227
+ type: Directive,
228
+ args: [{
229
+ selector: '[nwDropdownToggle]',
230
+ exportAs: 'nw-dropdown-toggle',
231
+ host: {
232
+ 'aria-haspopup': 'true',
233
+ '[attr.aria-expanded]': 'isOpen'
234
+ },
235
+ standalone: false
236
+ }]
237
+ }], ctorParameters: () => [{ type: DropdownService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { nwTrigger: [{
238
+ type: Input
239
+ }], breakpoint: [{
240
+ type: Input
241
+ }], toggle: [{
242
+ type: HostListener,
243
+ args: ['click', ['$event']]
244
+ }] } });
245
+
246
+ class DropdownMenuDirective {
247
+ constructor(_service, _element, _cdRef) {
248
+ this._service = _service;
249
+ this._element = _element;
250
+ this._cdRef = _cdRef;
251
+ this._destroyed$ = new Subject();
252
+ }
253
+ ngAfterContentInit() {
254
+ this._subscribeToChildrenVisbilityToggle();
255
+ this._subscribeToScrollPosition();
256
+ }
257
+ _subscribeToScrollPosition() {
258
+ this._service.toggle$.pipe(filter(opened => opened), takeUntil(this._destroyed$)).subscribe(() => {
259
+ this._cdRef.detectChanges();
260
+ this._scrollToActiveElement();
261
+ });
262
+ }
263
+ _scrollToActiveElement() {
264
+ const menuElement = this._element.nativeElement;
265
+ const activeElement = this._element.nativeElement.querySelector('.active');
266
+ if (activeElement) {
267
+ menuElement.scrollTo({ top: activeElement.offsetTop });
268
+ }
269
+ }
270
+ // When a sub dropdown menu is opened, force close any sibling sub dropdown menus
271
+ _subscribeToChildrenVisbilityToggle() {
272
+ const openEvents = this.nestedDropdowns
273
+ .map((nd, index) => {
274
+ return nd.opened
275
+ .pipe(map(x => index));
276
+ });
277
+ merge(...openEvents).pipe(takeUntil(this._destroyed$)).subscribe(index => {
278
+ // Close all other sibling dropdowns
279
+ this.nestedDropdowns
280
+ .filter((nd, i) => i !== index)
281
+ .forEach(nd => nd.close());
282
+ });
283
+ }
284
+ onClick(event) {
285
+ if (this._shouldCloseOnMenuClick()) {
286
+ return this._service.close();
287
+ }
288
+ }
289
+ _shouldCloseOnMenuClick() {
290
+ return this._service.autoClose === true || this._service.autoClose === 'inside';
291
+ }
292
+ ngOnDestroy() {
293
+ this._destroyed$.next();
294
+ this._destroyed$.complete();
295
+ }
296
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownMenuDirective, deps: [{ token: DropdownService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
297
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: DropdownMenuDirective, isStandalone: false, selector: "[nwDropdownMenu]", host: { listeners: { "click": "onClick($event)" } }, queries: [{ propertyName: "nestedDropdowns", predicate: DropdownDirective }], exportAs: ["nw-dropdown-menu"], ngImport: i0 }); }
298
+ }
299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownMenuDirective, decorators: [{
300
+ type: Directive,
301
+ args: [{
302
+ selector: '[nwDropdownMenu]',
303
+ exportAs: 'nw-dropdown-menu',
304
+ standalone: false
305
+ }]
306
+ }], ctorParameters: () => [{ type: DropdownService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { nestedDropdowns: [{
307
+ type: ContentChildren,
308
+ args: [DropdownDirective]
309
+ }], onClick: [{
310
+ type: HostListener,
311
+ args: ['click', ['$event']]
312
+ }] } });
313
+
314
+ class DropdownsModule {
315
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
316
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: DropdownsModule, declarations: [DropdownDirective, DropdownToggleDirective, DropdownMenuDirective], imports: [CommonModule], exports: [DropdownDirective, DropdownToggleDirective, DropdownMenuDirective] }); }
317
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownsModule, imports: [CommonModule] }); }
318
+ }
319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropdownsModule, decorators: [{
320
+ type: NgModule,
321
+ args: [{
322
+ imports: [
323
+ CommonModule
324
+ ],
325
+ declarations: [DropdownDirective, DropdownToggleDirective, DropdownMenuDirective],
326
+ exports: [DropdownDirective, DropdownToggleDirective, DropdownMenuDirective]
327
+ }]
328
+ }] });
329
+
330
+ /**
331
+ * Generated bundle index. Do not edit.
332
+ */
333
+
334
+ export { DropdownDirective, DropdownMenuDirective, DropdownToggleDirective, DropdownsModule };
335
+ //# sourceMappingURL=nw-style-guide-dropdowns.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nw-style-guide-dropdowns.mjs","sources":["../../../projects/nw-style-guide/dropdowns/dropdown.service.ts","../../../projects/nw-style-guide/dropdowns/dropdown.directive.ts","../../../projects/nw-style-guide/dropdowns/dropdown-toggle.directive.ts","../../../projects/nw-style-guide/dropdowns/dropdown-menu.directive.ts","../../../projects/nw-style-guide/dropdowns/dropdowns.module.ts","../../../projects/nw-style-guide/dropdowns/nw-style-guide-dropdowns.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { BehaviorSubject, distinctUntilChanged, Observable, skip, tap } from \"rxjs\";\n\n@Injectable()\nexport class DropdownService {\n\n private _toggle$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n public toggle$: Observable<boolean> = this._toggle$.asObservable().pipe(\n distinctUntilChanged(),\n skip(1)\n );\n\n public autoClose: boolean | \"inside\" | \"outside\";\n\n toggle() {\n this._toggle$.next(!this._toggle$.value);\n }\n\n open() {\n this._toggle$.next(true);\n }\n\n close() {\n this._toggle$.next(false);\n }\n\n isHTMLElementContainedIn(element: HTMLElement, containers: HTMLElement[]): boolean {\n return containers\n // Filter out falsey elements\n .filter(el => el)\n .some(item => item.contains(element));\n }\n\n isHTMLElementInPath(event: any, selectors: string[]) {\n // Obtain the path from the event source to the document root\n const path: HTMLElement[] = (event.path || (event.composedPath && event.composedPath()) as HTMLElement[]);\n\n return path\n // Map to parentNode so we can use querySelector\n .map(el => el.parentNode as HTMLElement)\n // Filter out undefined parent nodes\n .filter(p => p)\n // Check if any of the parentNodes match any of the selectors\n .some(p => selectors.some(s => Boolean(p.querySelector(s))));\n }\n}\n","import { Directive, Input, HostBinding, OnDestroy, OnInit, OnChanges, SimpleChanges, ElementRef, Output, EventEmitter, NgZone, Renderer2, ChangeDetectorRef } from '@angular/core';\nimport { DropdownService } from \"./dropdown.service\";\nimport { Subscription } from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\n@Directive({\n selector: '[nwDropdown]',\n exportAs: 'nw-dropdown',\n providers: [DropdownService],\n standalone: false\n})\nexport class DropdownDirective implements OnInit, OnChanges, OnDestroy {\n\n @Input() autoClose: boolean | \"inside\" | \"outside\" = true;\n @Input() elementsToIgnore: HTMLElement[] = [];\n @Input() selectorsToIgnore: string[] = [];\n @HostBinding('class.disabled')\n @Input() disabled: boolean = false;\n\n @Output() opened: EventEmitter<null> = new EventEmitter();\n @Output() closed: EventEmitter<null> = new EventEmitter();\n\n @HostBinding('class.open') isOpen: boolean;\n\n private _toggleSubscription: Subscription;\n private _documentUnlistener: () => void;\n private _escapeUnlistener: () => void;\n\n constructor(\n private _service: DropdownService,\n private _elRef: ElementRef,\n private _zone: NgZone,\n private _renderer: Renderer2,\n private _cdRef: ChangeDetectorRef) { }\n\n ngOnInit() {\n this._service.autoClose = this.autoClose;\n this._subscribeToToggle();\n\n // For performance reasons, bind to document click outside the zone\n this._zone.runOutsideAngular(() => {\n // Store a reference to the \"unlisten\" functions returned from these methods\n // https://angular.io/api/core/Renderer2#listen\n this._documentUnlistener = this._renderer.listen('document', 'click', this.onDocumentClick.bind(this));\n this._escapeUnlistener = this._renderer.listen('document', 'keydown.escape', this.onEscape.bind(this));\n });\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // autoClose is essentially an optional input. What this means is that if you don't pass a\n // value to the `autoClose` input the \"if\" check below will never evaluate to true. This\n // is why we don't just rely on ngOnChanges to set the value in the service, we also use\n // ngOnInit to set the initial value, with subsequent input changes handled below\n if (changes.autoClose && !changes.autoClose.firstChange) {\n this._service.autoClose = this.autoClose;\n }\n }\n\n open(): void {\n this._service.open();\n }\n\n close(): void {\n this._service.close();\n }\n\n private _subscribeToToggle(): void {\n this._toggleSubscription = this._service.toggle$\n /**\n * If the dropdown is disabled, only allow close events through\n */\n .pipe(\n filter(isOpen => {\n if (this.disabled) {\n return !isOpen;\n }\n return true;\n })\n )\n .subscribe(isOpen => {\n this.isOpen = isOpen;\n\n if (this.isOpen) {\n this.opened.emit();\n } else {\n this.closed.emit();\n }\n });\n }\n\n onDocumentClick(event: MouseEvent) {\n const shouldClose = (this.autoClose === true || this.autoClose === 'outside') && this.isOpen;\n\n // Don't bother evaluating the source of the event if `shouldClose` is false\n if (shouldClose) {\n const target: HTMLElement = event.target as HTMLElement;\n const containers: HTMLElement[] = [this._elRef.nativeElement as HTMLElement].concat(this.elementsToIgnore);\n const isEventSourceFromWithinDropdown = this._service.isHTMLElementContainedIn(target, containers) && !target.classList.contains('dropdown-backdrop');\n const isEventSourceFromWithinSelectors = this.selectorsToIgnore.length ?\n this._service.isHTMLElementInPath(event, this.selectorsToIgnore) :\n false;\n\n if (!isEventSourceFromWithinDropdown && !isEventSourceFromWithinSelectors) {\n this._zone.run(() => {\n this._service.close();\n this._cdRef.detectChanges();\n });\n }\n }\n }\n\n onEscape(event: KeyboardEvent) {\n if (this.isOpen) {\n this._zone.run(() => {\n this._service.close();\n this._cdRef.detectChanges();\n });\n }\n }\n\n ngOnDestroy() {\n this._toggleSubscription.unsubscribe();\n\n if (this._documentUnlistener) {\n this._zone.runOutsideAngular(() => this._documentUnlistener());\n }\n\n if (this._escapeUnlistener) {\n this._zone.runOutsideAngular(() => this._escapeUnlistener());\n }\n }\n\n}\n","import { Directive, Input, HostListener, OnInit, ElementRef, ChangeDetectorRef, OnDestroy } from '@angular/core';\nimport { DropdownService } from \"./dropdown.service\";\nimport { debounceTime, filter, tap } from \"rxjs/operators\";\nimport { Subscription, fromEvent } from 'rxjs';\n\n@Directive({\n selector: '[nwDropdownToggle]',\n exportAs: 'nw-dropdown-toggle',\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'isOpen'\n },\n standalone: false\n})\nexport class DropdownToggleDirective implements OnInit, OnDestroy {\n\n @Input() nwTrigger: \"click\" | \"hover\" = \"click\";\n @Input() breakpoint: number = 767;\n\n public isOpen: boolean = false;\n\n private _isMousingOver: boolean = false;\n private _mouseEventSubscriptions: Subscription[] = [];\n private _toggleSub$: Subscription;\n\n constructor(\n private _service: DropdownService,\n private _elRef: ElementRef,\n private _cdRef: ChangeDetectorRef) {}\n\n ngOnInit() {\n this._subscribeToToggle();\n if (this.nwTrigger === 'hover') {\n const mouseEnterSub: Subscription = fromEvent(this._elRef.nativeElement as HTMLElement, 'mouseenter')\n .pipe(\n filter(_ => !this._isMobileScreenSize()),\n tap(_ => this._isMousingOver = true),\n debounceTime(300),\n filter(_ => this._isMousingOver)\n )\n .subscribe(event => this._open());\n\n const mouseLeaveSub: Subscription = fromEvent(this._elRef.nativeElement as HTMLElement, 'mouseleave')\n .pipe(\n filter(_ => !this._isMobileScreenSize()),\n tap(_ => this._isMousingOver = false),\n debounceTime(300),\n filter(_ => !this._isMousingOver)\n )\n .subscribe(event => this._close());\n\n this._mouseEventSubscriptions = [mouseEnterSub, mouseLeaveSub];\n }\n }\n\n private _isMobileScreenSize() {\n return window.innerWidth < this.breakpoint;\n }\n\n private _subscribeToToggle() {\n this._toggleSub$ = this._service.toggle$.subscribe(isOpen => {\n this.isOpen = isOpen;\n });\n }\n\n private _open() {\n this._isMousingOver = true;\n this._service.open();\n this._cdRef.detectChanges();\n }\n\n private _close() {\n this._isMousingOver = false;\n this._service.close();\n this._cdRef.detectChanges();\n }\n\n @HostListener('click', ['$event'])\n toggle(event: MouseEvent) {\n this._service.toggle();\n if (this.nwTrigger === 'hover') {\n event.stopImmediatePropagation();\n }\n }\n\n ngOnDestroy() {\n this._mouseEventSubscriptions.forEach(mes => mes.unsubscribe());\n this._toggleSub$.unsubscribe();\n }\n\n}\n","import { Directive, HostListener, QueryList, AfterContentInit, ContentChildren, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';\nimport { DropdownService } from \"./dropdown.service\";\nimport { DropdownDirective } from \"./dropdown.directive\";\nimport { filter, map, takeUntil } from \"rxjs/operators\";\nimport { Observable, merge, Subject } from 'rxjs';\n\n@Directive({\n selector: '[nwDropdownMenu]',\n exportAs: 'nw-dropdown-menu',\n standalone: false\n})\nexport class DropdownMenuDirective implements AfterContentInit, OnDestroy {\n\n @ContentChildren(DropdownDirective) nestedDropdowns: QueryList<DropdownDirective>;\n private _destroyed$: Subject<void> = new Subject();\n\n constructor(\n private _service: DropdownService,\n private _element: ElementRef<HTMLElement>,\n private _cdRef: ChangeDetectorRef\n ) { }\n\n ngAfterContentInit() {\n this._subscribeToChildrenVisbilityToggle();\n this._subscribeToScrollPosition();\n }\n\n private _subscribeToScrollPosition() {\n this._service.toggle$.pipe(\n filter(opened => opened),\n takeUntil(this._destroyed$)\n ).subscribe(() => {\n this._cdRef.detectChanges();\n this._scrollToActiveElement();\n });\n }\n\n private _scrollToActiveElement() {\n const menuElement = this._element.nativeElement;\n const activeElement: HTMLElement = this._element.nativeElement.querySelector('.active');\n if (activeElement) {\n menuElement.scrollTo({ top: activeElement.offsetTop });\n }\n }\n\n // When a sub dropdown menu is opened, force close any sibling sub dropdown menus\n private _subscribeToChildrenVisbilityToggle() {\n const openEvents: Observable<number>[] = this.nestedDropdowns\n .map((nd, index) => {\n return nd.opened\n .pipe(map(x => index));\n });\n\n merge(...openEvents).pipe(\n takeUntil(this._destroyed$)\n ).subscribe(index => {\n // Close all other sibling dropdowns\n this.nestedDropdowns\n .filter((nd, i) => i !== index)\n .forEach(nd => nd.close());\n });\n }\n\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent) {\n if (this._shouldCloseOnMenuClick()) {\n return this._service.close();\n }\n }\n\n private _shouldCloseOnMenuClick(): boolean {\n return this._service.autoClose === true || this._service.autoClose === 'inside';\n }\n\n ngOnDestroy() {\n this._destroyed$.next();\n this._destroyed$.complete();\n }\n\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DropdownDirective } from \"./dropdown.directive\";\nimport { DropdownToggleDirective } from \"./dropdown-toggle.directive\";\nimport { DropdownMenuDirective } from \"./dropdown-menu.directive\";\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [DropdownDirective, DropdownToggleDirective, DropdownMenuDirective],\n exports: [DropdownDirective, DropdownToggleDirective, DropdownMenuDirective]\n})\nexport class DropdownsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DropdownService"],"mappings":";;;;;;MAIa,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;AAGY,QAAA,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC;AAChE,QAAA,IAAA,CAAA,OAAO,GAAwB,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,CACnE,oBAAoB,EAAE,EACtB,IAAI,CAAC,CAAC,CAAC,CACV;AAmCJ,IAAA;IA/BG,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC5C;I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,iBAAiB,EAAE,uBAAuB,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAElE,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YALpB,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAKP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAP3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL;AACH,qBAAA;AACD,oBAAA,YAAY,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,EAAE,qBAAqB,CAAC;AACjF,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,EAAE,qBAAqB;AAC9E,iBAAA;;;ACZD;;AAEG;;;;"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-loader.mjs"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "nw-style-guide",
3
- "version": "19.2.0-beta.2",
3
+ "version": "19.2.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/NewsWhip/style-guide"
7
+ },
4
8
  "peerDependencies": {
5
9
  "@angular/common": "^19.2.0",
6
10
  "@angular/core": "^19.2.0",
@@ -26,14 +30,6 @@
26
30
  "types": "./animations/index.d.ts",
27
31
  "default": "./fesm2022/nw-style-guide-animations.mjs"
28
32
  },
29
- "./email-input": {
30
- "types": "./email-input/index.d.ts",
31
- "default": "./fesm2022/nw-style-guide-email-input.mjs"
32
- },
33
- "./charts": {
34
- "types": "./charts/index.d.ts",
35
- "default": "./fesm2022/nw-style-guide-charts.mjs"
36
- },
37
33
  "./autofocus": {
38
34
  "types": "./autofocus/index.d.ts",
39
35
  "default": "./fesm2022/nw-style-guide-autofocus.mjs"
@@ -42,14 +38,26 @@
42
38
  "types": "./carousel/index.d.ts",
43
39
  "default": "./fesm2022/nw-style-guide-carousel.mjs"
44
40
  },
45
- "./loader": {
46
- "types": "./loader/index.d.ts",
47
- "default": "./fesm2022/nw-style-guide-loader.mjs"
41
+ "./charts": {
42
+ "types": "./charts/index.d.ts",
43
+ "default": "./fesm2022/nw-style-guide-charts.mjs"
44
+ },
45
+ "./dropdowns": {
46
+ "types": "./dropdowns/index.d.ts",
47
+ "default": "./fesm2022/nw-style-guide-dropdowns.mjs"
48
+ },
49
+ "./email-input": {
50
+ "types": "./email-input/index.d.ts",
51
+ "default": "./fesm2022/nw-style-guide-email-input.mjs"
48
52
  },
49
53
  "./feature-alerts": {
50
54
  "types": "./feature-alerts/index.d.ts",
51
55
  "default": "./fesm2022/nw-style-guide-feature-alerts.mjs"
52
56
  },
57
+ "./loader": {
58
+ "types": "./loader/index.d.ts",
59
+ "default": "./fesm2022/nw-style-guide-loader.mjs"
60
+ },
53
61
  "./picker": {
54
62
  "types": "./picker/index.d.ts",
55
63
  "default": "./fesm2022/nw-style-guide-picker.mjs"
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-picker.mjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/nw-style-guide-resize-observer.mjs"
3
+ }
@@ -243,11 +243,12 @@ input[type="button"] {
243
243
  border: none;
244
244
  margin: 0;
245
245
  }
246
- .dropdown {
246
+ .dropdown,
247
+ .dropup {
247
248
  .btn-block {
248
249
  display: flex;
249
250
  flex-direction: row;
250
251
  align-items: center;
251
252
  justify-content: space-between;
252
253
  }
253
- }
254
+ }