@sebgroup/green-angular 1.0.0-beta.1 → 1.0.0-beta.12

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.
Files changed (54) hide show
  1. package/esm2020/index.mjs +10 -0
  2. package/esm2020/lib/badge/badge.component.mjs +56 -0
  3. package/esm2020/lib/badge/badge.module.mjs +18 -0
  4. package/esm2020/lib/datepicker/datepicker.component.mjs +140 -0
  5. package/esm2020/lib/datepicker/datepicker.module.mjs +19 -0
  6. package/esm2020/lib/dropdown/dropdown.component.mjs +384 -0
  7. package/esm2020/lib/dropdown/dropdown.module.mjs +18 -0
  8. package/esm2020/lib/green-angular.module.mjs +20 -0
  9. package/esm2020/lib/segmented-control/segmented-control.component.mjs +40 -0
  10. package/esm2020/lib/segmented-control/segmented-control.module.mjs +19 -0
  11. package/esm2020/sebgroup-green-angular.mjs +5 -0
  12. package/fesm2015/sebgroup-green-angular.mjs +692 -0
  13. package/fesm2015/sebgroup-green-angular.mjs.map +1 -0
  14. package/fesm2020/sebgroup-green-angular.mjs +687 -0
  15. package/fesm2020/sebgroup-green-angular.mjs.map +1 -0
  16. package/index.d.ts +4 -4
  17. package/lib/badge/badge.component.d.ts +16 -0
  18. package/lib/badge/badge.module.d.ts +8 -0
  19. package/lib/datepicker/datepicker.component.d.ts +45 -0
  20. package/lib/datepicker/datepicker.module.d.ts +9 -0
  21. package/lib/dropdown/dropdown.component.d.ts +40 -13
  22. package/lib/dropdown/dropdown.module.d.ts +3 -7
  23. package/lib/green-angular.module.d.ts +2 -1
  24. package/package.json +29 -17
  25. package/bundles/sebgroup-green-angular.umd.js +0 -610
  26. package/bundles/sebgroup-green-angular.umd.js.map +0 -1
  27. package/esm2015/index.js +0 -10
  28. package/esm2015/index.js.map +0 -1
  29. package/esm2015/lib/dropdown/dropdown.component.js +0 -111
  30. package/esm2015/lib/dropdown/dropdown.component.js.map +0 -1
  31. package/esm2015/lib/dropdown/dropdown.module.js +0 -42
  32. package/esm2015/lib/dropdown/dropdown.module.js.map +0 -1
  33. package/esm2015/lib/dropdown/popover-element.directive.js +0 -220
  34. package/esm2015/lib/dropdown/popover-element.directive.js.map +0 -1
  35. package/esm2015/lib/dropdown/popover-option.directive.js +0 -59
  36. package/esm2015/lib/dropdown/popover-option.directive.js.map +0 -1
  37. package/esm2015/lib/dropdown/popover-trigger.directive.js +0 -80
  38. package/esm2015/lib/dropdown/popover-trigger.directive.js.map +0 -1
  39. package/esm2015/lib/dropdown/popover.directive.js +0 -46
  40. package/esm2015/lib/dropdown/popover.directive.js.map +0 -1
  41. package/esm2015/lib/green-angular.module.js +0 -19
  42. package/esm2015/lib/green-angular.module.js.map +0 -1
  43. package/esm2015/lib/segmented-control/segmented-control.component.js +0 -40
  44. package/esm2015/lib/segmented-control/segmented-control.component.js.map +0 -1
  45. package/esm2015/lib/segmented-control/segmented-control.module.js +0 -19
  46. package/esm2015/lib/segmented-control/segmented-control.module.js.map +0 -1
  47. package/esm2015/sebgroup-green-angular.js +0 -5
  48. package/esm2015/sebgroup-green-angular.js.map +0 -1
  49. package/fesm2015/sebgroup-green-angular.js +0 -602
  50. package/fesm2015/sebgroup-green-angular.js.map +0 -1
  51. package/lib/dropdown/popover-element.directive.d.ts +0 -36
  52. package/lib/dropdown/popover-option.directive.d.ts +0 -20
  53. package/lib/dropdown/popover-trigger.directive.d.ts +0 -19
  54. package/lib/dropdown/popover.directive.d.ts +0 -24
@@ -1,610 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@popperjs/core'), require('body-scroll-lock')) :
3
- typeof define === 'function' && define.amd ? define('@sebgroup/green-angular', ['exports', '@angular/core', '@angular/common', '@angular/router', '@angular/forms', 'rxjs', 'rxjs/operators', '@popperjs/core', 'body-scroll-lock'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.sebgroup = global.sebgroup || {}, global.sebgroup["green-angular"] = {}), global.ng.core, global.ng.common, global.ng.router, global.ng.forms, global.rxjs, global.rxjs.operators, global.core, global.bodyScrollLock));
5
- })(this, (function (exports, i0, i1, i2, forms, rxjs, operators, core, bodyScrollLock) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
28
-
29
- var NggSegmentedControlComponent = /** @class */ (function () {
30
- function NggSegmentedControlComponent() {
31
- }
32
- return NggSegmentedControlComponent;
33
- }());
34
- NggSegmentedControlComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggSegmentedControlComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
35
- NggSegmentedControlComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0__namespace, template: "\n <div class=\"group\">\n <a\n *ngFor=\"let control of $controls | async\"\n [routerLink]=\"control.url\"\n routerLinkActive=\"active\"\n class=\"button\"\n >{{ control.text }}</a\n >\n </div>\n ", isInline: true, directives: [{ type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i2__namespace.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], exportAs: ["routerLinkActive"] }], pipes: { "async": i1__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
36
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggSegmentedControlComponent, decorators: [{
37
- type: i0.Component,
38
- args: [{
39
- selector: 'ngg-segmented-control',
40
- template: "\n <div class=\"group\">\n <a\n *ngFor=\"let control of $controls | async\"\n [routerLink]=\"control.url\"\n routerLinkActive=\"active\"\n class=\"button\"\n >{{ control.text }}</a\n >\n </div>\n ",
41
- styles: [],
42
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
43
- }]
44
- }], propDecorators: { $controls: [{
45
- type: i0.Input
46
- }] } });
47
-
48
- var NggSegmentedControlModule = /** @class */ (function () {
49
- function NggSegmentedControlModule() {
50
- }
51
- return NggSegmentedControlModule;
52
- }());
53
- NggSegmentedControlModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggSegmentedControlModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
54
- NggSegmentedControlModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [i2.RouterModule, i1.CommonModule], exports: [NggSegmentedControlComponent] });
55
- NggSegmentedControlModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggSegmentedControlModule, imports: [[i2.RouterModule, i1.CommonModule]] });
56
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggSegmentedControlModule, decorators: [{
57
- type: i0.NgModule,
58
- args: [{
59
- declarations: [NggSegmentedControlComponent],
60
- imports: [i2.RouterModule, i1.CommonModule],
61
- exports: [NggSegmentedControlComponent],
62
- }]
63
- }] });
64
-
65
- var NggPopoverDirective = /** @class */ (function () {
66
- function NggPopoverDirective() {
67
- this._config = {
68
- usePopper: true,
69
- container: '',
70
- useBodyScrollLock: true,
71
- };
72
- this.state = {
73
- $isOpen: new rxjs.BehaviorSubject(false),
74
- };
75
- }
76
- Object.defineProperty(NggPopoverDirective.prototype, "config", {
77
- get: function () {
78
- return this._config;
79
- },
80
- set: function (config) {
81
- this._config = Object.assign(Object.assign({}, this.config), config);
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- NggPopoverDirective.prototype.close = function () {
87
- this.state.$isOpen.next(false);
88
- };
89
- NggPopoverDirective.prototype.open = function () {
90
- this.state.$isOpen.next(true);
91
- };
92
- NggPopoverDirective.prototype.toggle = function () {
93
- if (this.state.$isOpen.value) {
94
- this.close();
95
- }
96
- else {
97
- this.open();
98
- }
99
- };
100
- return NggPopoverDirective;
101
- }());
102
- NggPopoverDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
103
- NggPopoverDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: NggPopoverDirective, selector: "[nggPopover]", inputs: { config: "config" }, ngImport: i0__namespace });
104
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverDirective, decorators: [{
105
- type: i0.Directive,
106
- args: [{
107
- selector: '[nggPopover]',
108
- }]
109
- }], propDecorators: { config: [{
110
- type: i0.Input
111
- }] } });
112
-
113
- var NggPopoverTriggerDirective = /** @class */ (function () {
114
- function NggPopoverTriggerDirective(popover, _elRef) {
115
- var _this = this;
116
- this.popover = popover;
117
- this._elRef = _elRef;
118
- this.$unsubscribe = new rxjs.Subject();
119
- this.class = 'dropdown-toggle';
120
- this.haspopup = 'listbox';
121
- this.owns = null;
122
- this.expanded = this.popover.state.$isOpen.value;
123
- this.toggle = function (event) {
124
- if ('key' in event && event.key === 'ArrowDown') {
125
- // open popover on arrow down by not stopping event propagation
126
- if (_this.popover.state.$isOpen.value) {
127
- return;
128
- }
129
- else {
130
- // prevent container from scrolling
131
- event.preventDefault();
132
- }
133
- }
134
- event.stopPropagation();
135
- _this.popover.toggle();
136
- };
137
- }
138
- NggPopoverTriggerDirective.prototype.ngOnInit = function () {
139
- var _this = this;
140
- // if trigger element does not have an id...
141
- if (!this._elRef.nativeElement.id) {
142
- // ...add a unique id
143
- this._elRef.nativeElement.id = "ngg_dropdownTrigger_" + new Date().getTime();
144
- this.owns = this._elRef.nativeElement.id.replace(/dropdownTrigger/, 'popover');
145
- }
146
- else {
147
- this.owns = this._elRef.nativeElement.id + '_popover';
148
- }
149
- this.popover.triggerElement = this._elRef;
150
- this.popover.state.$isOpen
151
- .pipe(operators.tap(function (isOpen) { return (_this.expanded = isOpen); }), operators.takeUntil(this.$unsubscribe))
152
- .subscribe();
153
- };
154
- NggPopoverTriggerDirective.prototype.ngOnDestroy = function () {
155
- this.$unsubscribe.next();
156
- this.$unsubscribe.complete();
157
- };
158
- return NggPopoverTriggerDirective;
159
- }());
160
- NggPopoverTriggerDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverTriggerDirective, deps: [{ token: i0.forwardRef(function () { return NggPopoverDirective; }) }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
161
- NggPopoverTriggerDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: NggPopoverTriggerDirective, selector: "[nggPopoverTrigger]", host: { listeners: { "keydown.arrowdown": "toggle($event)", "click": "toggle($event)" }, properties: { "class": "this.class", "attr.aria-haspopup": "this.haspopup", "attr.aria-owns": "this.owns", "attr.aria-expanded": "this.expanded" } }, ngImport: i0__namespace });
162
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverTriggerDirective, decorators: [{
163
- type: i0.Directive,
164
- args: [{
165
- selector: '[nggPopoverTrigger]',
166
- }]
167
- }], ctorParameters: function () {
168
- return [{ type: NggPopoverDirective, decorators: [{
169
- type: i0.Inject,
170
- args: [i0.forwardRef(function () { return NggPopoverDirective; })]
171
- }] }, { type: i0__namespace.ElementRef }];
172
- }, propDecorators: { class: [{
173
- type: i0.HostBinding,
174
- args: ['class']
175
- }], haspopup: [{
176
- type: i0.HostBinding,
177
- args: ['attr.aria-haspopup']
178
- }], owns: [{
179
- type: i0.HostBinding,
180
- args: ['attr.aria-owns']
181
- }], expanded: [{
182
- type: i0.HostBinding,
183
- args: ['attr.aria-expanded']
184
- }], toggle: [{
185
- type: i0.HostListener,
186
- args: ['keydown.arrowdown', ['$event']]
187
- }, {
188
- type: i0.HostListener,
189
- args: ['click', ['$event']]
190
- }] } });
191
-
192
- var NggPopoverOptionDirective = /** @class */ (function () {
193
- function NggPopoverOptionDirective(popover, elRef) {
194
- var _this = this;
195
- this.popover = popover;
196
- this.elRef = elRef;
197
- this.selected = false;
198
- this.selectedChanged = new i0.EventEmitter();
199
- this.role = 'option';
200
- this.id = '';
201
- this.clickHandler = function (event) {
202
- _this.select(event);
203
- };
204
- this.select = function (event) {
205
- _this.selectedChanged.emit(_this.nggPopoverOption);
206
- };
207
- }
208
- Object.defineProperty(NggPopoverOptionDirective.prototype, "ariaSelected", {
209
- get: function () {
210
- return this.selected || null;
211
- },
212
- enumerable: false,
213
- configurable: true
214
- });
215
- NggPopoverOptionDirective.prototype.ngOnInit = function () {
216
- var _a;
217
- this.id = ((_a = this.popover.triggerElement) === null || _a === void 0 ? void 0 : _a.nativeElement.id) + "_dropdownOption_" + this.index;
218
- };
219
- return NggPopoverOptionDirective;
220
- }());
221
- NggPopoverOptionDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverOptionDirective, deps: [{ token: i0.forwardRef(function () { return NggPopoverDirective; }) }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
222
- NggPopoverOptionDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: NggPopoverOptionDirective, selector: "[nggPopoverOption]", inputs: { nggPopoverOption: "nggPopoverOption", index: "index", selected: "selected" }, outputs: { selectedChanged: "selectedChanged" }, host: { listeners: { "click": "clickHandler()" }, properties: { "attr.role": "this.role", "attr.aria-selected": "this.ariaSelected", "attr.id": "this.id" } }, ngImport: i0__namespace });
223
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverOptionDirective, decorators: [{
224
- type: i0.Directive,
225
- args: [{
226
- selector: '[nggPopoverOption]',
227
- }]
228
- }], ctorParameters: function () {
229
- return [{ type: NggPopoverDirective, decorators: [{
230
- type: i0.Inject,
231
- args: [i0.forwardRef(function () { return NggPopoverDirective; })]
232
- }] }, { type: i0__namespace.ElementRef }];
233
- }, propDecorators: { nggPopoverOption: [{
234
- type: i0.Input
235
- }], index: [{
236
- type: i0.Input
237
- }], selected: [{
238
- type: i0.Input
239
- }], selectedChanged: [{
240
- type: i0.Output
241
- }], role: [{
242
- type: i0.HostBinding,
243
- args: ['attr.role']
244
- }], ariaSelected: [{
245
- type: i0.HostBinding,
246
- args: ['attr.aria-selected']
247
- }], id: [{
248
- type: i0.HostBinding,
249
- args: ['attr.id']
250
- }], clickHandler: [{
251
- type: i0.HostListener,
252
- args: ['click']
253
- }] } });
254
-
255
- var NggPopoverElementDirective = /** @class */ (function () {
256
- function NggPopoverElementDirective(popover, _elRef, _renderer, _cdr) {
257
- this.popover = popover;
258
- this._elRef = _elRef;
259
- this._renderer = _renderer;
260
- this._cdr = _cdr;
261
- this.$unsubscribe = new rxjs.Subject();
262
- this.sm = window.innerWidth <= 576;
263
- this.class = true;
264
- this.role = 'listbox';
265
- this.id = null;
266
- this.show = this.popover.state.$isOpen.value;
267
- this.activeDescendant = null;
268
- }
269
- // TODO: refactor and move to general size/device service
270
- NggPopoverElementDirective.prototype.onResize = function (event) {
271
- // determine if small screen size i.e less than or equal to 576 pixels which is the breakpoint for small screens
272
- this.sm = event.target.innerWidth <= 576;
273
- if (this.sm) {
274
- // remove popper
275
- this.removePopper();
276
- }
277
- else if (!this._popper) {
278
- // add popper
279
- this.addPopper();
280
- }
281
- };
282
- NggPopoverElementDirective.prototype.handleClickEvent = function (event) {
283
- // if click inside popover element...
284
- if (this._elRef.nativeElement.contains(event.target)) {
285
- this.popover.close();
286
- }
287
- else if (this.popover.state.$isOpen.value) {
288
- // else if click outside popover element...
289
- this.popover.close();
290
- }
291
- };
292
- NggPopoverElementDirective.prototype.handleKeydownEvent = function (event) {
293
- var _a, _b, _c, _d, _e, _f;
294
- if (event.key === 'Escape') {
295
- this.popover.close();
296
- return;
297
- }
298
- var next = 0; // Used for home key
299
- var currentSelection = ((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find(function (option) { return !!option.selected; })) === null || _b === void 0 ? void 0 : _b.index) || 0;
300
- if (event.key === 'End') {
301
- // set next to last option
302
- next = (((_c = this.options) === null || _c === void 0 ? void 0 : _c.length) || 1) - 1;
303
- }
304
- else if (event.key === 'ArrowUp') {
305
- // next can't be less than zero
306
- next = Math.max(0, currentSelection - 1);
307
- // prevent container from scrolling
308
- event.preventDefault();
309
- }
310
- else if (event.key === 'ArrowDown') {
311
- // next can't be greater than number of options
312
- next = Math.min((((_d = this.options) === null || _d === void 0 ? void 0 : _d.length) || 1) - 1, currentSelection + 1);
313
- // prevent container from scrolling
314
- event.preventDefault();
315
- }
316
- // select next option
317
- (_f = (_e = this.options) === null || _e === void 0 ? void 0 : _e.get(next)) === null || _f === void 0 ? void 0 : _f.select(event);
318
- };
319
- NggPopoverElementDirective.prototype.ngOnInit = function () {
320
- var _this = this;
321
- var _a, _b, _c;
322
- this.id = /^ngg_dropdownTrigger/.test((_a = this.popover.triggerElement) === null || _a === void 0 ? void 0 : _a.nativeElement.id)
323
- ? (_b = this.popover.triggerElement) === null || _b === void 0 ? void 0 : _b.nativeElement.id.replace(/dropdownTrigger/, 'popover')
324
- : ((_c = this.popover.triggerElement) === null || _c === void 0 ? void 0 : _c.nativeElement.id) + '_popover';
325
- this.popover.state.$isOpen
326
- .pipe(operators.skip(1), // skip initial value
327
- operators.tap(function (isOpen) {
328
- var _a, _b;
329
- _this.show = isOpen; // toggle visibility
330
- if (isOpen) {
331
- _this.activeDescendant =
332
- ((_b = (_a = _this.options) === null || _a === void 0 ? void 0 : _a.find(function (option) { return !!option.selected; })) === null || _b === void 0 ? void 0 : _b.id) || null;
333
- // if use body scroll lock
334
- if (_this.popover.config.useBodyScrollLock) {
335
- _this.disableBodyScrollLock();
336
- }
337
- // if popover is configured to use a container...
338
- if (_this.popover.config.container !== '') {
339
- // ...add container
340
- _this.addContainer();
341
- }
342
- // if popover is configured to use popper.js...
343
- if (_this.popover.config.usePopper) {
344
- _this.addPopper();
345
- }
346
- }
347
- else {
348
- _this.activeDescendant = null;
349
- if (_this.popover.config.useBodyScrollLock) {
350
- _this.enableBodyScrollLock();
351
- }
352
- _this.removeContainer();
353
- _this.removePopper();
354
- }
355
- }), operators.switchMap(function (isOpen) { return isOpen
356
- ? rxjs.merge(
357
- // listen to click events
358
- rxjs.fromEvent(document, 'click').pipe(operators.tap(function (event) { return _this.handleClickEvent(event); })),
359
- // listen to keydown events
360
- rxjs.fromEvent(document, 'keydown').pipe(
361
- // filter keys
362
- operators.filter(function (event) { return ['ArrowDown', 'ArrowUp', 'Escape', 'Home', 'End'].indexOf(event.key) !== -1; }), operators.tap(function (event) { return _this.handleKeydownEvent(event); })))
363
- : rxjs.EMPTY; }), operators.takeUntil(this.$unsubscribe))
364
- .subscribe();
365
- };
366
- NggPopoverElementDirective.prototype.ngOnDestroy = function () {
367
- this.removePopper();
368
- this.disableBodyScrollLock();
369
- // remove container if declared
370
- if (this._container) {
371
- this.removeContainer();
372
- }
373
- this.$unsubscribe.next();
374
- this.$unsubscribe.complete();
375
- };
376
- NggPopoverElementDirective.prototype.enableBodyScrollLock = function () {
377
- bodyScrollLock.enableBodyScroll(this._elRef.nativeElement);
378
- };
379
- NggPopoverElementDirective.prototype.disableBodyScrollLock = function () {
380
- bodyScrollLock.disableBodyScroll(this._elRef.nativeElement);
381
- };
382
- NggPopoverElementDirective.prototype.addPopper = function () {
383
- var _this = this;
384
- var _a, _b;
385
- if (this.sm) {
386
- return;
387
- }
388
- if (!this._popper) {
389
- // ...create popper instance for anchoring popover with trigger element
390
- this._popper = core.createPopper((_a = this.popover.triggerElement) === null || _a === void 0 ? void 0 : _a.nativeElement, this._elRef.nativeElement, {
391
- placement: 'bottom-start',
392
- modifiers: [
393
- {
394
- name: 'offset',
395
- options: {
396
- offset: [0, 4],
397
- },
398
- },
399
- ],
400
- });
401
- // detect changes once element and popper is initiated to update initial position
402
- this._cdr.detectChanges();
403
- }
404
- else {
405
- this._popper.state.elements.reference =
406
- (_b = this.popover.triggerElement) === null || _b === void 0 ? void 0 : _b.nativeElement;
407
- this._popper.update().then(function (_) { return _this._cdr.detectChanges(); });
408
- }
409
- };
410
- NggPopoverElementDirective.prototype.removePopper = function () {
411
- var _a;
412
- // destroy popper if declared
413
- if (this._popper) {
414
- (_a = this._popper) === null || _a === void 0 ? void 0 : _a.destroy();
415
- this._popper = null;
416
- }
417
- };
418
- NggPopoverElementDirective.prototype.addContainer = function () {
419
- // create global container for popover if not already present
420
- if (!this._container) {
421
- this._container = this._renderer.createElement('div');
422
- }
423
- this._renderer.appendChild(this._container, this._elRef.nativeElement);
424
- this._renderer.appendChild(document.body, this._container);
425
- };
426
- NggPopoverElementDirective.prototype.removeContainer = function () {
427
- if (this._container) {
428
- // remove container from DOM tree
429
- this._renderer.removeChild(document.body, this._container);
430
- // clear container
431
- this._container = null;
432
- }
433
- };
434
- return NggPopoverElementDirective;
435
- }());
436
- NggPopoverElementDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverElementDirective, deps: [{ token: i0.forwardRef(function () { return NggPopoverDirective; }) }, { token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
437
- NggPopoverElementDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.10", type: NggPopoverElementDirective, selector: "[nggPopoverElement]", host: { listeners: { "window:resize": "onResize($event)" }, properties: { "class.popover": "this.class", "attr.role": "this.role", "attr.id": "this.id", "class.active": "this.show", "attr.aria-activedescendant": "this.activeDescendant" } }, queries: [{ propertyName: "options", predicate: NggPopoverOptionDirective, descendants: true }], ngImport: i0__namespace });
438
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggPopoverElementDirective, decorators: [{
439
- type: i0.Directive,
440
- args: [{
441
- selector: '[nggPopoverElement]',
442
- }]
443
- }], ctorParameters: function () {
444
- return [{ type: NggPopoverDirective, decorators: [{
445
- type: i0.Inject,
446
- args: [i0.forwardRef(function () { return NggPopoverDirective; })]
447
- }] }, { type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }, { type: i0__namespace.ChangeDetectorRef }];
448
- }, propDecorators: { options: [{
449
- type: i0.ContentChildren,
450
- args: [NggPopoverOptionDirective, { descendants: true }]
451
- }], class: [{
452
- type: i0.HostBinding,
453
- args: ['class.popover']
454
- }], role: [{
455
- type: i0.HostBinding,
456
- args: ['attr.role']
457
- }], id: [{
458
- type: i0.HostBinding,
459
- args: ['attr.id']
460
- }], show: [{
461
- type: i0.HostBinding,
462
- args: ['class.active']
463
- }], activeDescendant: [{
464
- type: i0.HostBinding,
465
- args: ['attr.aria-activedescendant']
466
- }], onResize: [{
467
- type: i0.HostListener,
468
- args: ['window:resize', ['$event']]
469
- }] } });
470
-
471
- var NggDropdownComponent = /** @class */ (function () {
472
- function NggDropdownComponent() {
473
- this._options = [];
474
- this._config = {};
475
- }
476
- Object.defineProperty(NggDropdownComponent.prototype, "options", {
477
- get: function () {
478
- return this._options;
479
- },
480
- set: function (value) {
481
- this._options = value;
482
- },
483
- enumerable: false,
484
- configurable: true
485
- });
486
- Object.defineProperty(NggDropdownComponent.prototype, "config", {
487
- get: function () {
488
- return this._config;
489
- },
490
- set: function (value) {
491
- this._config = value;
492
- },
493
- enumerable: false,
494
- configurable: true
495
- });
496
- NggDropdownComponent.prototype.writeValue = function (obj) {
497
- this.value = obj;
498
- };
499
- NggDropdownComponent.prototype.registerOnChange = function (fn) {
500
- this.onChangeFn = fn;
501
- };
502
- NggDropdownComponent.prototype.registerOnTouched = function (fn) {
503
- this.onTouchedFn = fn;
504
- };
505
- NggDropdownComponent.prototype.select = function (value) {
506
- this.onChangeFn(value);
507
- this.value = value;
508
- };
509
- return NggDropdownComponent;
510
- }());
511
- NggDropdownComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggDropdownComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
512
- NggDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.10", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { options: "options", config: "config" }, providers: [
513
- {
514
- provide: forms.NG_VALUE_ACCESSOR,
515
- useExisting: NggDropdownComponent,
516
- multi: true,
517
- },
518
- ], ngImport: i0__namespace, template: "\n <div nggPopover [config]=\"config\">\n <button type=\"button\" nggPopoverTrigger>\n {{ value }}\n </button>\n <div nggPopoverElement tabindex=\"-1\" autofocus>\n <button class=\"close m-4 m-sm-2 d-block d-sm-none \">\n <span class=\"sr-only\">Close</span>\n </button>\n <ul role=\"listbox\">\n <li\n *ngFor=\"let option of options; let i = index\"\n [nggPopoverOption]=\"option.value\"\n [index]=\"i\"\n [selected]=\"value === option.value\"\n (selectedChanged)=\"select($event)\"\n >\n {{ option.key }}\n </li>\n </ul>\n </div>\n </div>\n ", isInline: true, directives: [{ type: NggPopoverDirective, selector: "[nggPopover]", inputs: ["config"] }, { type: NggPopoverTriggerDirective, selector: "[nggPopoverTrigger]" }, { type: NggPopoverElementDirective, selector: "[nggPopoverElement]" }, { type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: NggPopoverOptionDirective, selector: "[nggPopoverOption]", inputs: ["nggPopoverOption", "index", "selected"], outputs: ["selectedChanged"] }] });
519
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggDropdownComponent, decorators: [{
520
- type: i0.Component,
521
- args: [{
522
- selector: 'ngg-dropdown',
523
- template: "\n <div nggPopover [config]=\"config\">\n <button type=\"button\" nggPopoverTrigger>\n {{ value }}\n </button>\n <div nggPopoverElement tabindex=\"-1\" autofocus>\n <button class=\"close m-4 m-sm-2 d-block d-sm-none \">\n <span class=\"sr-only\">Close</span>\n </button>\n <ul role=\"listbox\">\n <li\n *ngFor=\"let option of options; let i = index\"\n [nggPopoverOption]=\"option.value\"\n [index]=\"i\"\n [selected]=\"value === option.value\"\n (selectedChanged)=\"select($event)\"\n >\n {{ option.key }}\n </li>\n </ul>\n </div>\n </div>\n ",
524
- providers: [
525
- {
526
- provide: forms.NG_VALUE_ACCESSOR,
527
- useExisting: NggDropdownComponent,
528
- multi: true,
529
- },
530
- ],
531
- //changeDetection: ChangeDetectionStrategy.OnPush
532
- }]
533
- }], propDecorators: { options: [{
534
- type: i0.Input
535
- }], config: [{
536
- type: i0.Input
537
- }] } });
538
-
539
- var NggDropdownModule = /** @class */ (function () {
540
- function NggDropdownModule() {
541
- }
542
- return NggDropdownModule;
543
- }());
544
- NggDropdownModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggDropdownModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
545
- NggDropdownModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggDropdownModule, declarations: [NggPopoverDirective,
546
- NggPopoverOptionDirective,
547
- NggPopoverElementDirective,
548
- NggPopoverTriggerDirective,
549
- NggDropdownComponent], imports: [i1.CommonModule], exports: [NggPopoverDirective,
550
- NggPopoverOptionDirective,
551
- NggPopoverElementDirective,
552
- NggPopoverTriggerDirective,
553
- NggDropdownComponent] });
554
- NggDropdownModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggDropdownModule, imports: [[i1.CommonModule]] });
555
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggDropdownModule, decorators: [{
556
- type: i0.NgModule,
557
- args: [{
558
- declarations: [
559
- NggPopoverDirective,
560
- NggPopoverOptionDirective,
561
- NggPopoverElementDirective,
562
- NggPopoverTriggerDirective,
563
- NggDropdownComponent,
564
- ],
565
- imports: [i1.CommonModule],
566
- exports: [
567
- NggPopoverDirective,
568
- NggPopoverOptionDirective,
569
- NggPopoverElementDirective,
570
- NggPopoverTriggerDirective,
571
- NggDropdownComponent,
572
- ],
573
- }]
574
- }] });
575
-
576
- var NggModule = /** @class */ (function () {
577
- function NggModule() {
578
- }
579
- return NggModule;
580
- }());
581
- NggModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
582
- NggModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggModule, imports: [i1.CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule] });
583
- NggModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggModule, imports: [[i1.CommonModule], NggSegmentedControlModule, NggDropdownModule] });
584
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: NggModule, decorators: [{
585
- type: i0.NgModule,
586
- args: [{
587
- declarations: [],
588
- imports: [i1.CommonModule],
589
- exports: [NggSegmentedControlModule, NggDropdownModule],
590
- }]
591
- }] });
592
-
593
- /**
594
- * Generated bundle index. Do not edit.
595
- */
596
-
597
- exports.NggDropdownComponent = NggDropdownComponent;
598
- exports.NggDropdownModule = NggDropdownModule;
599
- exports.NggModule = NggModule;
600
- exports.NggPopoverDirective = NggPopoverDirective;
601
- exports.NggPopoverElementDirective = NggPopoverElementDirective;
602
- exports.NggPopoverOptionDirective = NggPopoverOptionDirective;
603
- exports.NggPopoverTriggerDirective = NggPopoverTriggerDirective;
604
- exports.NggSegmentedControlComponent = NggSegmentedControlComponent;
605
- exports.NggSegmentedControlModule = NggSegmentedControlModule;
606
-
607
- Object.defineProperty(exports, '__esModule', { value: true });
608
-
609
- }));
610
- //# sourceMappingURL=sebgroup-green-angular.umd.js.map